<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _tables_line(args):
 """Implements the BigQuery tables magic used to display tables in a dataset. The supported syntax is: %bigquery tables -p|--project <project_id> -d|--dataset <dataset_id> Args: args: the arguments following '%bigquery tables'. Returns: The HTML rendering for the list of tables. """

  filter_ = args['filter'] if args['filter'] else '*'
  if args['dataset']:
    if args['project'] is None:
      datasets = [datalab.bigquery.Dataset(args['dataset'])]
    else:
      datasets = [datalab.bigquery.Dataset((args['project'], args['dataset']))]
  else:
    datasets = datalab.bigquery.Datasets(args['project'])

  tables = []
  for dataset in datasets:
    tables.extend([str(table) for table in dataset if fnmatch.fnmatch(str(table), filter_)])

  return _render_list(tables)