def METHOD_NAME(param_name, ctx):
    value = None
    if param_name in ctx.params:
        value = ctx.params[param_name]
    else:  # use the default
        for param in ctx.command.params:
            if param.name == param_name:
                value = param.default
    return value