docs: def create_push_handlers():
      """Create a handler for upload per package format."""
      # pylint: disable=fixme
      # HACK: hacky territory - Dynamically generate a handler for each of the
      # package formats, until we have slightly more clever 'guess type'
      # handling. :-)
      handlers = create_push_handlers.handlers = {}
      context = create_push_handlers.context = get_package_formats()
  
      for key, parameters in six.iteritems(context):
          kwargs = parameters.copy()
  
          # Remove standard arguments
          kwargs.pop("package_file")
          if "distribution" in parameters:
              has_distribution_param = True
              kwargs.pop("distribution")
          else:
              has_distribution_param = False
  
          has_additional_params = len(kwargs) > 0
  
          help_text = """
              Push/upload a new %(type)s package upstream.
              """ % {
              "type": key.capitalize()
          }
  
          if has_additional_params:
              help_text += """
  
              PACKAGE_FILE: The main file to create the package from.
              """
          else:
              help_text += """
  
              PACKAGE_FILE: Any number of files to create packages from. Each
              file will result in a separate package.
              """
  
          if has_distribution_param:
              target_metavar = "OWNER/REPO/DISTRO/RELEASE"
              target_callback = validators.validate_owner_repo_distro
              help_text += """
  
              OWNER/REPO/DISTRO/RELEASE: Specify the OWNER namespace (i.e.
              user or org), the REPO name where the package file will be uploaded
              to, and the DISTRO and RELEASE the package is for. All separated by
              a slash.
  
              Example: 'your-org/awesome-repo/ubuntu/xenial'.
              """
          else:
              target_metavar = "OWNER/REPO"
              target_callback = validators.validate_owner_repo
              help_text += """
  
              OWNER/REPO: Specify the OWNER namespace (i.e. user or org), and the
              REPO name where the package file will be uploaded to. All separated
              by a slash.
  
              Example: 'your-org/awesome-repo'.
              """
  
          @push.command(name=key, help=help_text)
          @decorators.common_api_auth_options
          @decorators.common_cli_config_options
          @decorators.common_cli_output_options
          @decorators.common_package_action_options
          @decorators.initialise_api
          @click.argument("owner_repo", metavar=target_metavar, callback=target_callback)
          @click.argument(
              "package_file",
              nargs=1 if has_additional_params else -1,
              type=ExpandPath(
                  dir_okay=False, exists=True, writable=False, resolve_path=True
              ),
          )
          @click.option(
              "-n",
              "--dry-run",
              default=False,
              is_flag=True,
              help="Execute in dry run mode (don't upload anything.)",
          )
          @click.option(
              "-n",
              "--dry-run",
              default=False,
              is_flag=True,
              help="Execute in dry run mode (don't upload anything.)",
          )
          @click.pass_context
          def push_handler(ctx, *args, **kwargs):
              """Handle upload for a specific package format."""
              parameters = context.get(ctx.info_name)
              kwargs["package_type"] = ctx.info_name
  
              owner_repo = kwargs.pop("owner_repo")
              if "distribution" in parameters:
                  kwargs["distribution"] = "/".join(owner_repo[2:])
                  owner_repo = owner_repo[0:2]
              kwargs["owner_repo"] = owner_repo
  
              package_files = kwargs.pop("package_file")
              if not isinstance(package_files, tuple):
                  package_files = (package_files,)
  
              for package_file in package_files:
                  kwargs["package_file"] = package_file
  
                  try:
                      click.echo()
                      upload_files_and_create_package(ctx, *args, **kwargs)
                  except ApiException:
                      click.secho("Skipping error and moving on.", fg="yellow")
  
                  click.echo()
  
          # Add any additional arguments
          for k, info in six.iteritems(kwargs):
              option_kwargs = {}
              option_name_fmt = "--%(key)s"
  
              if k.endswith("_file"):
                  # Treat parameters that end with _file as uploadable filepaths.
                  option_kwargs["type"] = ExpandPath(
                      dir_okay=False, exists=True, writable=False, resolve_path=True
                  )
              elif info["type"] == "bool":
                  option_name_fmt = "--%(key)s/--no-%(key)s"
                  option_kwargs["is_flag"] = True
              else:
                  option_kwargs["type"] = str
  
              option_name = option_name_fmt % {"key": k.replace("_", "-")}
              decorator = click.option(
                  option_name,
                  required=info["required"],
                  help=info["help"],
                  **option_kwargs
              )
              push_handler = decorator(push_handler)
  
          handlers[key] = push_handler