(self, data)
Check if the data contains binary components.
Check if the data contains binary components.
Check if the data contains binary components .
def _data_is_binary(self, data):
        """Check if the data contains binary components."""
        if isinstance(data, bytes):
            return True
        elif isinstance(data, list):
            return functools.reduce(
                lambda a, b: a or b, [self._data_is_binary(item)
                                      for item in data], False)
        elif isinstance(data, dict):
            return functools.reduce(
                lambda a, b: a or b, [self._data_is_binary(item)
                                      for item in data.values()],
                False)
        else:
            return False
def _data_is_binary ( self , data ) : if isinstance ( data , bytes ) : return True elif isinstance ( data , list ) : return functools . reduce ( lambda a , b : a or b , [ self . _data_is_binary ( item ) for item in data ] , False ) elif isinstance ( data , dict ) : return functools . reduce ( lambda a , b : a or b , [ self . _data_is_binary ( item ) for item in data . values ( ) ] , False ) else : return False