def blob_from_path_and_stat(fs_path, st):
 assert isinstance(fs_path, bytes)
 blob = Blob()
 if (not stat.S_ISLNK(st.st_mode)):
  with open(fs_path, 'rb') as f:
   blob.data = f.read()
 else:
  blob.data = os.readlink(fs_path)
 return blob

def blob_from_path_and_stat ( fs_path , st ) : assert isinstance ( fs_path , bytes ) blob = Blob ( ) if ( not stat . S_ISLNK ( st . st_mode ) ) : with open ( fs_path , 'rb' ) as f : blob . data = f . read ( ) else : blob . data = os . readlink ( fs_path ) return blob
create a blob from a path and a stat object .