def find_matches(pattern, var_list):
    '\n    Return list of variable names that match given pattern.\n\n    Parameters\n    ----------\n    pattern : str\n        Glob pattern or variable name.\n    var_list : list of str\n        List of variable names to search for pattern.\n\n    Returns\n    -------\n    list\n        Variable names that match pattern.\n    '
    if (pattern == '*'):
        return var_list
    elif (pattern in var_list):
        return [pattern]
    return [name for name in var_list if fnmatchcase(name, pattern)]
Return list of variable names that match given pattern.

Parameters
----------
pattern : str
    Glob pattern or variable name.
var_list : list of str
    List of variable names to search for pattern.

Returns
-------
list
    Variable names that match pattern.
def find_matches(pattern, var_list):
    '\n    Return list of variable names that match given pattern.\n\n    Parameters\n    ----------\n    pattern : str\n        Glob pattern or variable name.\n    var_list : list of str\n        List of variable names to search for pattern.\n\n    Returns\n    -------\n    list\n        Variable names that match pattern.\n    '
    if (pattern == '*'):
        return var_list
    elif (pattern in var_list):
        return [pattern]
    return [name for name in var_list if fnmatchcase(name, pattern)]