import fnmatch


def _gcs_get_keys(bucket, pattern):
  """ Get names of all Google Cloud Storage keys in a specified bucket that match a pattern. """
  return [obj for obj in list(bucket.objects()) if fnmatch.fnmatch(obj.metadata.name, pattern)]