<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def path_to_glob(path):
 """ Convert pattern style paths to glob style paths Returns path if path is not str Parameters path : str Path to data optionally containing format_strings Returns ------- glob : str Path with any format strings replaced with * Examples -------- '*/*/*.csv' 'data/*.csv' 'data/*.csv' """

    from string import Formatter

    fmt = Formatter()

    if not isinstance(path, str):
        return path

    # Get just the real bits of the urlpath
    literal_texts = [i[0] for i in fmt.parse(path)]

    # Only use a star for first empty string in literal_texts
    index_of_empty = [i for i, lt in enumerate(literal_texts) if lt == '' and i != 0]
    glob = '*'.join([literal_texts[i] for i in range(len(literal_texts)) if i not in index_of_empty])

    return glob