code: def make_payloads(name, content):
      
      if content is None:
          yield make_bytes_payload(name, b"")
      elif isinstance(content, bool):
          if content:
              yield make_bytes_payload(name, b"true")
          else:
              yield make_bytes_payload(name, b"false")
      elif isinstance(content, int):
          yield make_bytes_payload(name, b"%d" % content)
      elif isinstance(content, bytes):
          yield make_bytes_payload(name, content)
      elif isinstance(content, str):
          yield make_string_payload(name, content)
      elif isinstance(content, IOBase):
          yield make_file_payload(name, content)
      elif callable(content):
          with content() as content:
              for payload in make_payloads(name, content):
                  yield payload
      elif isinstance(content, Iterable):
          for part in content:
              for payload in make_payloads(name, part):
                  yield payload
      else:
          raise AssertionError(
              "%r is unrecognised: %r" % (name, content))
docs: Constructs payload(s) for the given `name` and `content`.
  
      If `content` is a byte string, this calls `make_bytes_payload` to
      construct the payload, which this then yields.
  
      If `content` is a unicode string, this calls `make_string_payload`.
  
      If `content` is file-like -- it inherits from `IOBase` or `file` --
      this calls `make_file_payload`.
  
      If `content` is iterable, this calls `make_payloads` for each item,
      with the same name, and then re-yields each payload generated.
  
      If `content` is callable, this calls it with no arguments, and then
      uses the result as a context manager. This can be useful if the
      callable returns an open file, for example, because the context
      protocol means it will be closed after use.
  
      This raises `AssertionError` if it encounters anything else.