class_docstr: Serializable base class establishing
  :meth:`~nupic.serializable.Serializable.read` and
  :meth:`~nupic.serializable.Serializable.write` abstract methods,
  :meth:`.readFromFile` and :meth:`.writeToFile` concrete methods to support
  serialization with Cap'n Proto.
docstr: Read serialized object from file.
  
  :param f: input file
  :param packed: If true, will assume content is packed
  :return: first-class instance initialized from proto obj
docstr_tok: ["Read","serialized","object","from","file",".",":","param","f",":","input","file",":","param","packed",":","If","true",",","will","assume","content","is","packed",":","return",":","first-class","instance","initialized","from","proto","obj"]
code: def readFromFile(cls, f, packed=True):
      """
      Read serialized object from file.
  
      :param f: input file
      :param packed: If true, will assume content is packed
      :return: first-class instance initialized from proto obj
      """
      # Get capnproto schema from instance
      schema = cls.getSchema()
  
      # Read from file
      if packed:
          proto = schema.read_packed(f)
      else:
          proto = schema.read(f)
  
      # Return first-class instance initialized from proto obj
      return cls.read(proto)
  
file_path: nupic-legacy/src/nupic/serializable.py
imports: from abc import ABCMeta, abstractmethod
label_desc: Use image node_id 4 for calling the Serializable obj's underlying member method code with example usage: obj.readFromFile(cls, f, packed) and returns: cls