<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def add_rows(self, values=None, index=None):
 """ Add rows to this table. Multiple rows can be added at once. This request might occasionally receive a 504 HTTP error. The appropriate response to this error is to repeat the request. :param list values: Optional. a 1 or 2 dimensional array of values to add :param int index: Optional. Specifies the relative position of the new row. If null, the addition happens at the end. :return: """

        params = {}
        if values is not None:
            if values and not isinstance(values[0], list):
                # this is a single row
                values = [values]
            params['values'] = values
        if index is not None:
            params['index'] = index

        params = params if params else None

        url = self.build_url(self._endpoints.get('add_rows'))
        response = self.session.post(url, data=params)
        if not response:
            return None
        return self.row_constructor(parent=self, **{self._cloud_data_key: response.json()})