human
I wrote the below code

    def lookup_arg(match):
        x = context[(match.group(1) or match.group(2))]
        if (not isinstance(x, string_types)):
            x = type(string)(x)
        return x
    return _format_re.sub(lookup_arg, string)

What's a good function header?
assistant
#Here's a good function header.

def format_string(string, context):