def read_from_file(self, path, md5=None, compute_md5=False, state=FileState.Tracked):
    if not os.path.isfile(path):
      raise InvalidOperation("file not found: '%s'" % path)
    if not os.path.isfile(path):
      raise NotImplementedError("support only plan files: '%s'" % path)
    self.type = ItemType.FILE
    self.size = os.path.getsize(path)
    self.mtime = os.path.getmtime(path)
    if md5:
      self.md5 = md5
    elif compute_md5:
      self.md5 = file_md5(path)
    else:
      self.md5 = None
    self.state = state
dataset/ETHPy150Open bloomreach/zinc/zinc.py/Fingerprint.read_from_file/original