def ListToGetFields(list_fields=None):
  if list_fields:
    get_fields = set()
    for field in list_fields:
      if field in ('kind', 'nextPageToken', 'prefixes'):
        # These are not actually object / bucket metadata fields.
        # They are fields specific to listing, so we don't consider them.
        continue
      get_fields.add(re.sub(r'items/', '', field))
    return get_fields
Removes 'items/' from the input fields and converts it to a set.
dataset/ETHPy150Open GoogleCloudPlatform/gsutil/gslib/cloud_api_helper.py/ListToGetFields