blogs/lightning/ltgpred/goesutil/goesio.py
def list_gcs_paths(bucket, gcs_prefix, gcs_patterns=None):
  """list GCS blobs in a bucket starting with the gcs_prefix.

  Args:
    bucket (google.cloud.storage.Bucket): bucket
    gcs_prefix (string): prefix
    gcs_patterns (list of str): return only blobs whose name contains all these
      strings.

  Returns:
    list of blob URLs
  """
  bucket = cached_gcs_client().get_bucket(bucket)
  blobs = bucket.list_blobs(prefix=gcs_prefix, delimiter='/')
  result = []
  if gcs_patterns:
    for b in blobs:
      match = True
      for pattern in gcs_patterns:
        if pattern not in b.path:
          match = False
      if match:
        result.append(b.path)
  else:
    for b in blobs:
      result.append(b.path)
  return result
list GCS blobs in a bucket starting with the gcs_prefix.

  Args:
    bucket (google.cloud.storage.Bucket): bucket
    gcs_prefix (string): prefix
    gcs_patterns (list of str): return only blobs whose name contains all these
      strings.

  Returns:
    list of blob URLs
  
list GCS blobs in a bucket starting with the gcs_prefix.
list GCS blobs in a bucket starting with the gcs_prefix .
def list_gcs_paths(bucket, gcs_prefix, gcs_patterns=None):
  bucket = cached_gcs_client().get_bucket(bucket)
  blobs = bucket.list_blobs(prefix=gcs_prefix, delimiter='/')
  result = []
  if gcs_patterns:
    for b in blobs:
      match = True
      for pattern in gcs_patterns:
        if pattern not in b.path:
          match = False
      if match:
        result.append(b.path)
  else:
    for b in blobs:
      result.append(b.path)
  return result
def list_gcs_paths ( bucket , gcs_prefix , gcs_patterns = None ) : bucket = cached_gcs_client ( ) . get_bucket ( bucket ) blobs = bucket . list_blobs ( prefix = gcs_prefix , delimiter = '/' ) result = [ ] if gcs_patterns : for b in blobs : match = True for pattern in gcs_patterns : if pattern not in b . path : match = False if match : result . append ( b . path ) else : for b in blobs : result . append ( b . path ) return result
list GCS blobs in a bucket starting with the gcs_prefix.
list GCS blobs in a bucket starting with the gcs_prefix .
"""list GCS blobs in a bucket starting with the gcs_prefix.

  Args:
    bucket (google.cloud.storage.Bucket): bucket
    gcs_prefix (string): prefix
    gcs_patterns (list of str): return only blobs whose name contains all these
      strings.

  Returns:
    list of blob URLs
  """
list of blob URLs
list of blob URLs
bucket
None
gcs_prefix
None
gcs_patterns
return only blobs whose name contains all these
strings.
return only blobs whose name contains all these strings .