code: def peek(contents):
      
  
      if not isinstance(contents, byte_cls):
          raise TypeError('contents must be a byte string, not %s' % type_name(contents))
  
      info, consumed = _parse(contents, len(contents))
      return consumed
docs: Parses a byte string of ASN.1 BER/DER-encoded data to find the length
  
      This is typically used to look into an encoded value to see how long the
      next chunk of ASN.1-encoded data is. Primarily it is useful when a
      value is a concatenation of multiple values.
  
      :param contents:
          A byte string of BER/DER-encoded data
  
      :raises:
          ValueError - when the contents do not contain an ASN.1 header or are truncated in some way
          TypeError - when contents is not a byte string
  
      :return:
          An integer with the number of bytes occupied by the ASN.1 value