graphit/graph_io/io_pydata_format.py
def serialize(self, **kwargs):
        """
        Serialize graph nodes to a Python dictionary

        This default `serialize` method is used when no python data type
        specific or custom method is returned by the ORM.
        It will serialize the current node children if any to a Python
        dictionary and return them with the current node key.

        :param kwargs:
        :return:
        """

        attributes = {}
        if kwargs.get('export_all'):
            for key in self.nodes[self.nid].keys():
                if key in excluded_keys or key == self.key_tag:
                    continue

                value = self.get(key, default=kwargs.get('default'))
                if not kwargs.get('allow_none') and value is None:
                    continue

                attributes[key] = value
        else:
            attributes[self.value_tag] = self.get(self.value_tag, default=kwargs.get('default'))

        # Iterate child attributes
        for cid in self.children(return_nids=True):
            child_node = self.getnodes(cid)

            if not hasattr(child_node, 'serialize'):
                continue

            key, value = child_node.serialize(**kwargs)

            # Check for dictionary key overload
            if key in attributes:
                logging.warning('Key {0} already defined. Values will be updated'.format(key))

            attributes[key] = value

        if len(attributes) == 1:
            return self.get(self.key_tag), list(attributes.values())[0]

        return self.get(self.key_tag), attributes

        Serialize graph nodes to a Python dictionary

        This default `serialize` method is used when no python data type
        specific or custom method is returned by the ORM.
        It will serialize the current node children if any to a Python
        dictionary and return them with the current node key.

        :param kwargs:
        :return:
        
Serialize graph nodes to a Python dictionary
This default `serialize` method is used when no python data type
specific or custom method is returned by the ORM.
It will serialize the current node children if any to a Python
dictionary and return them with the current node key.
Serialize graph nodes to a Python dictionary This default ` serialize ` method is used when no python data type specific or custom method is returned by the ORM . It will serialize the current node children if any to a Python dictionary and return them with the current node key .
def serialize(self, **kwargs):
        attributes = {}
        if kwargs.get('export_all'):
            for key in self.nodes[self.nid].keys():
                if key in excluded_keys or key == self.key_tag:
                    continue
                value = self.get(key, default=kwargs.get('default'))
                if not kwargs.get('allow_none') and value is None:
                    continue
                attributes[key] = value
        else:
            attributes[self.value_tag] = self.get(self.value_tag, default=kwargs.get('default'))
        for cid in self.children(return_nids=True):
            child_node = self.getnodes(cid)
            if not hasattr(child_node, 'serialize'):
                continue
            key, value = child_node.serialize(**kwargs)
            if key in attributes:
                logging.warning('Key {0} already defined. Values will be updated'.format(key))
            attributes[key] = value
        if len(attributes) == 1:
            return self.get(self.key_tag), list(attributes.values())[0]
        return self.get(self.key_tag), attributes
def serialize ( self , ** kwargs ) : attributes = { } if kwargs . get ( 'export_all' ) : for key in self . nodes [ self . nid ] . keys ( ) : if key in excluded_keys or key == self . key_tag : continue value = self . get ( key , default = kwargs . get ( 'default' ) ) if not kwargs . get ( 'allow_none' ) and value is None : continue attributes [ key ] = value else : attributes [ self . value_tag ] = self . get ( self . value_tag , default = kwargs . get ( 'default' ) ) for cid in self . children ( return_nids = True ) : child_node = self . getnodes ( cid ) if not hasattr ( child_node , 'serialize' ) : continue key , value = child_node . serialize ( ** kwargs ) if key in attributes : logging . warning ( 'Key {0} already defined. Values will be updated' . format ( key ) ) attributes [ key ] = value if len ( attributes ) == 1 : return self . get ( self . key_tag ) , list ( attributes . values ( ) ) [ 0 ] return self . get ( self . key_tag ) , attributes
Serialize graph nodes to a Python dictionary
This default `serialize` method is used when no python data type
specific or custom method is returned by the ORM.
Serialize graph nodes to a Python dictionary This default ` serialize ` method is used when no python data type specific or custom method is returned by the ORM .
"""
        Serialize graph nodes to a Python dictionary

        This default `serialize` method is used when no python data type
        specific or custom method is returned by the ORM.
        It will serialize the current node children if any to a Python
        dictionary and return them with the current node key.

        :param kwargs:
        :return:
        """ # Iterate child attributes # Check for dictionary key overload
None
self
kwargs
None