code: def bytes_to_long(s):
      
      if isinstance(s, int):
          # On Python 2, indexing into a bytearray returns a byte string; on Python 3, an int.
          return s
      acc = 0
      if USING_PYTHON2:
          acc = long(acc)  # noqa
      unpack = struct.unpack
      length = len(s)
      if length % 4:
          extra = (4 - length % 4)
          s = b'\000' * extra + s
          length = length + extra
      for i in range(0, length, 4):
          acc = (acc << 32) + unpack(b'>I', s[i:i + 4])[0]
      return acc
docs: bytes_to_long(string) : long
      Convert a byte string to a long integer.
  
      This is (essentially) the inverse of long_to_bytes().