<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def read_price_data(files, name_func=None):
 """ Convenience function for reading in pricing data from csv files Parameters files: list List of strings refering to csv files to read data in from, first column should be dates name_func: func A function to apply to the file strings to infer the instrument name, used in the second level of the MultiIndex index. Default is the file name excluding the pathname and file ending, e.g. /path/to/file/name.csv -> name Returns ------- A pandas.DataFrame with a pandas.MultiIndex where the top level is pandas.Timestamps and the second level is instrument names. Columns are given by the csv file columns. """

    if name_func is None:
        def name_func(x):
            return os.path.split(x)[1].split(".")[0]

    dfs = []
    for f in files:
        name = name_func(f)
        df = pd.read_csv(f, index_col=0, parse_dates=True)
        df.sort_index(inplace=True)
        df.index = pd.MultiIndex.from_product([df.index, [name]],
                                              names=["date", "contract"])
        dfs.append(df)

    return pd.concat(dfs, axis=0, sort=False).sort_index()