<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def view_trends(self, pattern=''):

 """
 Return a pandas df with the available trends
 """

        d = OrderedDict()
        d['Index'] = None
        d['Variable'] = []
        d['Position'] = []
        d['Unit'] = []
        d['Description'] = []
        raw_d = self.filter_trends(pattern)
        d['Index'] = [k for k in raw_d.keys()]
        for st in self.filter_trends(pattern).values():
            st = st.replace('\n', '')
            d['Variable'].append(st.split(' ')[0])
            temp = [x[1:-1] for x in re.findall("\'[\w\(\) \-\:\/]+\'", st)]
            d['Description'].append(temp[-1])
            d['Unit'].append(temp[-2][1:-1])
            pos = " - ".join(temp[: -2]).replace("BRANCH", "Br").replace(":", "")
            d['Position'].append(pos)
        df=pd.DataFrame(d)
        df.index.name = "Filter: {}".format(pattern)
        return df