def METHOD_NAME(context, value):
    """Search the variable and see if variables need to be expanded.
    This expands ${ENV} and {context} variables in a :param:`value` parameter.
    :param context: a context of dictionary keys for filling in values
    :type context: Dict[str, str]
    :param value: the value to do variable expansion on.
    :type value: str
    :returns: the expanded string
    :rtype: str
    """
    if not isinstance(value, str):
        return value
    value = os.path.expandvars(value)
    for k, v in context.items():
        var = "{" + k.strip() + "}"
        if var in value:
            value = value.replace(var, v)
    return value