'Grant authorized view access of a dataset to a view table.
If this view has already been granted access to the dataset, do nothing.
This method is not atomic.  Running it may clobber a simultaneous update.
:param source_dataset: the source dataset
:type source_dataset: str
:param view_dataset: the dataset that the view is in
:type view_dataset: str
:param view_table: the table of the view
:type view_table: str
:param source_project: the project of the source dataset. If None,
self.project_id will be used.
:type source_project: str
:param view_project: the project that the view is in. If None,
self.project_id will be used.
:type view_project: str
:return: the datasets resource of the source dataset.'

def run_grant_dataset_view_access(self, source_dataset, view_dataset, view_table, source_project=None, view_project=None):

    source_project = (source_project if source_project else self.project_id)
    view_project = (view_project if view_project else self.project_id)
    source_dataset_resource = self.service.datasets().get(projectId=source_project, datasetId=source_dataset).execute()
    access = (source_dataset_resource['access'] if ('access' in source_dataset_resource) else [])
    view_access = {'view': {'projectId': view_project, 'datasetId': view_dataset, 'tableId': view_table}}
    if (view_access not in access):
        logging.info('granting    table    %s:%s.%s    authorized    view    access    to    %s:%s    dataset.', view_project, view_dataset, view_table, source_project, source_dataset)
        access.append(view_access)
        return self.service.datasets().patch(projectId=source_project, datasetId=source_dataset, body={'access': access}).execute()
    else:
        logging.info('table    %s:%s.%s    already    has    authorized    view    access    to    %s:%s    dataset.', view_project, view_dataset, view_table, source_project, source_dataset)
        return source_dataset_resource
