def _filter(args):
    """Construct the value for the '--filter' flag to gcloud.

    Args:
      args: The Namespace instance returned by argparse
    Returns:
      A string suitable for passing to the `gcloud` command
    """
    base_expr = 'tags.items=\'{0}\''.format('datalab')
    if args.filter:
        return '({0}) ({1})'.format(base_expr, args.filter)
    else:
        return base_expr