parameters: (self, obj)
docstring: Provide a persistent ID for "saving" GLC objects by reference. Return
          None for all non GLC objects.
  
          Parameters
          ----------
  
          obj: Name of the object whose persistent ID is extracted.
  
          Returns
          --------
          None if the object is not a GLC object. (ClassName, relative path)
          if the object is a GLC object.
  
          Notes
          -----
  
          Borrowed from pickle docs (https://docs.python.org/2/library/_pickle.html)
  
          For the benefit of object persistence, the pickle module supports the
          notion of a reference to an object outside the pickled data stream.
  
          To pickle objects that have an external persistent id, the pickler must
          have a custom persistent_id() method that takes an object as an argument and
          returns either None or the persistent id for that object.
  
          For GLC objects, the persistent_id is merely a relative file path (within
          the ZIP archive) to the GLC archive where the GLC object is saved. For
          example:
  
              (SFrame, 'sframe-save-path')
              (SGraph, 'sgraph-save-path')
              (Model, 'model-save-path')
docstring_summary: Provide a persistent ID for "saving" GLC objects by reference. Return
          None for all non GLC objects.
docstring_tokens: Provide a persistent ID for saving GLC objects by reference . Return None for all non GLC objects .
function: def persistent_id(self, obj):
          """
          Provide a persistent ID for "saving" GLC objects by reference. Return
          None for all non GLC objects.
  
          Parameters
          ----------
  
          obj: Name of the object whose persistent ID is extracted.
  
          Returns
          --------
          None if the object is not a GLC object. (ClassName, relative path)
          if the object is a GLC object.
  
          Notes
          -----
  
          Borrowed from pickle docs (https://docs.python.org/2/library/_pickle.html)
  
          For the benefit of object persistence, the pickle module supports the
          notion of a reference to an object outside the pickled data stream.
  
          To pickle objects that have an external persistent id, the pickler must
          have a custom persistent_id() method that takes an object as an argument and
          returns either None or the persistent id for that object.
  
          For GLC objects, the persistent_id is merely a relative file path (within
          the ZIP archive) to the GLC archive where the GLC object is saved. For
          example:
  
              (SFrame, 'sframe-save-path')
              (SGraph, 'sgraph-save-path')
              (Model, 'model-save-path')
  
          """
  
          # Get the class of the object (if it can be done)
          obj_class = None if not hasattr(obj, "__class__") else obj.__class__
          if obj_class is None:
              return None
  
          # If the object is a GLC class.
          if _is_not_pickle_safe_gl_class(obj_class):
              if id(obj) in self.gl_object_memo:
                  # has already been pickled
                  return (None, None, id(obj))
              else:
                  # Save the location of the GLC object's archive to the pickle file.
                  relative_filename = str(_uuid.uuid4())
                  filename = _os.path.join(self.gl_temp_storage_path, relative_filename)
                  self.mark_for_delete -= set([filename])
  
                  # Save the GLC object
                  obj.save(filename)
  
                  # Memoize.
                  self.gl_object_memo.add(id(obj))
  
                  # Return the tuple (class_name, relative_filename) in archive.
                  return (_get_gl_class_type(obj.__class__), relative_filename, id(obj))
  
          # Not a GLC object. Default to cloud pickle
          else:
              return None
function_tokens: def persistent_id ( self , obj ) : # Get the class of the object (if it can be done) obj_class = None if not hasattr ( obj , "__class__" ) else obj . __class__ if obj_class is None : return None # If the object is a GLC class. if _is_not_pickle_safe_gl_class ( obj_class ) : if id ( obj ) in self . gl_object_memo : # has already been pickled return ( None , None , id ( obj ) ) else : # Save the location of the GLC object's archive to the pickle file. relative_filename = str ( _uuid . uuid4 ( ) ) filename = _os . path . join ( self . gl_temp_storage_path , relative_filename ) self . mark_for_delete -= set ( [ filename ] ) # Save the GLC object obj . save ( filename ) # Memoize. self . gl_object_memo . add ( id ( obj ) ) # Return the tuple (class_name, relative_filename) in archive. return ( _get_gl_class_type ( obj . __class__ ) , relative_filename , id ( obj ) ) # Not a GLC object. Default to cloud pickle else : return None