def METHOD_NAME(ctx, value):
    if value is None:
        return None
    state = ctx.ensure_object(CommandState)
    try:
        # we may be given a comma-delimited list of values
        # any cases of empty strings are dropped
        pairs = [x for x in (y.strip() for y in value.split(",")) if len(x)]
        # iterate over those pairs, splitting them on `=` signs
        for http_stat, exit_stat in (pair.split("=") for pair in pairs):
            # "parse" as ints
            http_stat, exit_stat = int(http_stat), int(exit_stat)
            # force into the desired range
            if exit_stat not in exit_stat_set:
                raise ValueError()
            # map the status
            state.http_status_map[http_stat] = exit_stat
    # two conditions can cause ValueError: split didn't give right number
    # of args, or results weren't int()-able
    except ValueError:
        raise click.UsageError(
            "--map-http-status must have an argument of the form "
            '"INT=INT,INT=INT,..." and values of exit codes must be in '
            "0,1,50-99"
        )