def METHOD_NAME(  # noqa: PLR0913
    context: Context,
    item: str,
    attribute: str | None = None,
    value: str | None = None,
    parameter: str | None = None,
    parameter_value: str | None = None,
) -> None:
    """Add an item with and optionally set attribute to value."""
    api = f"{item}/new"
    container = {"source": "metric", "metric": "subject", "subject": "report"}.get(item)
    if container:
        api += f"/{context.uuid[container]}"
    if attribute == "type":
        item_type = value
        attribute = value = None
    else:
        item_type = {"source": "axe_core", "metric": "accessibility", "subject": "software"}.get(item)
    if "tries to" in context.step.name:
        context.post(api, {"type": item_type})
        return
    context.uuid[item] = context.post(api, {"type": item_type})[f"new_{item}_uuid"]
    if attribute and value:
        context.execute_steps(f'when the client changes the {item} {attribute} to "{value}"')
    if parameter and parameter_value:
        context.execute_steps(f'when the client sets the source parameter {parameter} to "{parameter_value}"')