code: def _compute_csum(data):
      # type: (bytes) -> int
      '''
      A method to compute a simple checksum over the given data.
  
      Parameters:
       data - The data to compute the checksum over.
      Returns:
       The checksum.
      '''
      def identity(x):
          # type: (int) -> int
          '''
          The identity function so we can use a function for python2/3
          compatibility.
          '''
          return x
  
      if isinstance(data, str):
          myord = ord
      elif isinstance(data, bytes):
          myord = identity
      elif isinstance(data, bytearray):
          myord = identity
      csum = 0
      for byte in data:
          csum += myord(byte)
      csum -= myord(data[4])
      csum %= 256
  
      return csuf _compute_csum(data):
      # type: (bytes) -> int
      '''
      A method to compute a simple checksum over the given data.
  
      Parameters:
       data - The data to compute the checksum over.
      Returns:
       The checksum.
      '''
      def identity(x):
          # type: (int) -> int
          '''
          The identity function so we can use a function for python2/3
          compatibility.
          '''
          return x
  
      if isinstance(data, str):
          myord = ord
      elif isinstance(data, bytes):
          myord = identity
      elif isinstance(data, bytearray):
          myord = identity
      csum = 0
      for byte in data:
          csum += myord(byte)
      csum -= myord(data[4])
      csum %= 256
  
      return csum
docs: A method to compute a simple checksum over the given data.
  
      Parameters:
       data - The data to compute the checksum over.
      Returns:
       The checksum.