code: def dedent(bstr):
      lines = bstr.splitlines()
      if not lines[0].strip():
          raise ValueError("First line must contain text")
      stripamt = len(lines[0]) - len(lines[0].lstrip())
      return b"\r\n".join(
          [x[stripamt:] if len(x) >= stripamt else b"" for x in lines]
      )
  
file_path: cpython/Lib/test/test_email/test_inversion.py
imports: import io
  import unittest
  from email import policy, message_from_bytes
  from email.message import EmailMessage
  from email.generator import BytesGenerator
  from test.test_email import TestEmailBase, parameterize
label_desc: Use image node_id 1 for calling a global function with example usage: dedent(bstr) and returns: bytes