def _recurse_on_row(self, col_dict, nested_value):
        """Apply the schema specified by the given dict to the nested value by
        recursing on it.

        Parameters
        ----------
        col_dict : dict
            The schema to apply to the nested value.
        nested_value : A value nested in a BigQuery row.

        Returns
        -------
        Union[dict, list]
            ``dict`` or ``list`` of ``dict`` objects from applied schema.
        """

        row_value = None

        # Multiple nested records
        if col_dict['mode'] == 'REPEATED' and isinstance(nested_value, list):
            row_value = [self._transform_row(record['v'], col_dict['fields'])
                         for record in nested_value]

        # A single nested record
        else:
            row_value = self._transform_row(nested_value, col_dict['fields'])

        return row_value
dataset/ETHPy150Open tylertreat/BigQuery-Python/bigquery/client.py/BigQueryClient._recurse_on_row/original