class_docstr: The ``BodyPart`` object is a ``Response``-like interface to an individual
  subpart of a multipart response. It is expected that these will
  generally be created by objects of the ``MultipartDecoder`` class.
  
  Like ``Response``, there is a ``CaseInsensitiveDict`` object named headers,
  ``content`` to access bytes, ``text`` to access unicode, and ``encoding``
  to access the unicode codec.
class_docstr_tok: ["The","``","BodyPart","``","object","is","a","``","Response","``","-like","interface","to","an","individual","subpart","of","a","multipart","response",".","It","is","expected","that","these","will","generally","be","created","by","objects","of","the","``","MultipartDecoder","``","class",".","Like","``","Response","``",",","there","is","a","``","CaseInsensitiveDict","``","object","named","headers",",","``","content","``","to","access","bytes",",","``","text","``","to","access","unicode",",","and","``","encoding","``","to","access","the","unicode","codec","."]
code: def __init__(self, content, encoding):
      self.encoding = encoding
      headers = {}
      # Split into header section (if any) and the content
      if b"\r\n\r\n" in content:
          first, self.content = _split_on_find(content, b"\r\n\r\n")
          if first != b"":
              headers = _header_parser(first.lstrip(), encoding)
      else:
          raise ImproperBodyPartContentException(
              "content does not contain CR-LF-CR-LF"
          )
      self.headers = CaseInsensitiveDict(headers)
  
imports: import sys
  import email.parser
  from .encoder import encode_with
  from requests.structures import CaseInsensitiveDict
label_desc: Use image node_id 1 to create a new BodyPart object from inherited base classes: object with example: obj = BodyPart(content, encoding)