def get_datatap(self, instream=None, **kwargs):
        '''
        Returns a datatap that can serialize hypermedia items and deserialize to native instances

        :param instream: A list of resource items or a primitive datatap
        '''
        if instream is None:
            #open for read; give primitives
            return self.get_native_datatap(**kwargs)
        elif isinstance(instream, (list, tuple)):
            #list of resource items; give primitives
            native_instream = self.get_native_datatap_instream_from_items(instream)
            return self.get_native_datatap(instream=native_instream, **kwargs)
        else:
            #read primitives from instream, return deserialized objects
            return self.get_native_datatap(instream=instream, **kwargs)
dataset/ETHPy150Open zbyte64/django-hyperadmin/hyperadmin/endpoints.py/BaseEndpoint.get_datatap/original