<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def temperature_data_from_csv( filepath_or_buffer, tz=None, date_col="dt", temp_col="tempF", gzipped=False, freq=None, **kwargs ):
 """ Load temperature data from a CSV file. Default format:: dt,tempF 2017-01-01T00:00:00+00:00,21 2017-01-01T01:00:00+00:00,22.5 2017-01-01T02:00:00+00:00,23.5 Parameters filepath_or_buffer : :any:`str` or file-handle File path or object. tz : :any:`str`, optional E.g., ``'UTC'`` or ``'US/Pacific'`` date_col : :any:`str`, optional, default ``'dt'`` Date period start column. temp_col : :any:`str`, optional, default ``'tempF'`` Temperature column. gzipped : :any:`bool`, optional Whether file is gzipped. freq : :any:`str`, optional If given, apply frequency to data using :any:`pandas.Series.resample`. **kwargs Extra keyword arguments to pass to :any:`pandas.read_csv`, such as ``sep='|'``. """

    read_csv_kwargs = {
        "usecols": [date_col, temp_col],
        "dtype": {temp_col: np.float64},
        "parse_dates": [date_col],
        "index_col": date_col,
    }

    if gzipped:
        read_csv_kwargs.update({"compression": "gzip"})

    # allow passing extra kwargs
    read_csv_kwargs.update(kwargs)

    if tz is None:
        tz = "UTC"

    df = pd.read_csv(filepath_or_buffer, **read_csv_kwargs).tz_localize(tz)

    if freq == "hourly":
        df = df.resample("H").sum()

    return df[temp_col]