<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def fetch(self, tickers, fields=None, date=None, date_from=None, date_to=None, freq='D', only_data=True, static=False):
 """Fetch data from TR DWE. tickers - ticker or list of tickers fields - list of fields. date - date for a single-date query date_from, date_to - date range (used only if "date" is not specified) freq - frequency of data: daily('D'), weekly('W') or monthly('M') only_data - if True then metadata will not be returned static - if True "static" request is created (i.e. not a series). In this case 'date_from', 'date_to' and 'freq' are ignored In case list of tickers is requested, a MultiIndex-dataframe is returned. Some of available fields: P - adjusted closing price PO - opening price PH - high price PL - low price VO - volume, which is expressed in 1000's of shares. UP - unadjusted price OI - open interest MV - market value EPS - earnings per share DI - dividend index MTVB - market to book value PTVB - price to book value The full list of data fields is available at http://dtg.tfn.com/. """

        if static:
            query = self.construct_request(tickers, fields, date, freq='REP')
        else:
            query = self.construct_request(tickers, fields, date, date_from, date_to, freq)

        raw = self.request(query)

        if static:
            data, metadata = self.parse_record_static(raw)
        elif isinstance(tickers, basestring) or len(tickers) == 1:
            data, metadata = self.parse_record(raw)
        elif hasattr(tickers, '__len__'):
            metadata = pd.DataFrame()
            data = {}
            for indx in range(len(tickers)):
                dat, meta = self.parse_record(raw, indx)
                data[tickers[indx]] = dat
                metadata = metadata.append(meta, ignore_index=False)

            data = pd.concat(data)
        else:
            raise DatastreamException(('First argument should be either ticker or '
                                       'list of tickers'))

        if only_data:
            return data
        else:
            return data, metadata