code: def emit(class_, method, tag, contents):
      
  
      if not isinstance(class_, int):
          raise TypeError('class_ must be an integer, not %s' % type_name(class_))
  
      if class_ < 0 or class_ > 3:
          raise ValueError('class_ must be one of 0, 1, 2 or 3, not %s' % class_)
  
      if not isinstance(method, int):
          raise TypeError('method must be an integer, not %s' % type_name(method))
  
      if method < 0 or method > 1:
          raise ValueError('method must be 0 or 1, not %s' % method)
  
      if not isinstance(tag, int):
          raise TypeError('tag must be an integer, not %s' % type_name(tag))
  
      if tag < 0:
          raise ValueError('tag must be greater than zero, not %s' % tag)
  
      if not isinstance(contents, byte_cls):
          raise TypeError('contents must be a byte string, not %s' % type_name(contents))
  
      return _dump_header(class_, method, tag, contents) + contents
docs: Constructs a byte string of an ASN.1 DER-encoded value
  
      This is typically not useful. Instead, use one of the standard classes from
      asn1crypto.core, or construct a new class with specific fields, and call the
      .dump() method.
  
      :param class_:
          An integer ASN.1 class value: 0 (universal), 1 (application),
          2 (context), 3 (private)
  
      :param method:
          An integer ASN.1 method value: 0 (primitive), 1 (constructed)
  
      :param tag:
          An integer ASN.1 tag value
  
      :param contents:
          A byte string of the encoded byte contents
  
      :return:
          A byte string of the ASN.1 DER value (header and contents)