code: def _list_s3_subdirs(self, prefix=None):
      if prefix is None:
          prefix = self.basedir
      bucket = self.s3.Bucket(self.bucket)
      all_keys = [
          obj.key for obj in bucket.objects.filter(Prefix=prefix)
      ]
      subdir_match = r"{prefix}\/(.*)\/".format(prefix=prefix)
      subdirs = []
      for key in all_keys:
          match_obj = re.match(subdir_match, key)
          if match_obj is None:
              continue
          else:
              subdirs.append(match_obj.groups()[0])
      distinct_subdirs = set(subdirs)
      return list(distinct_subdirs)
  
imports: import json
  import os
  import os.path
  from sacred.commandline_options import cli_option
  from sacred.dependencies import get_digest
  from sacred.observers.base import RunObserver
  from sacred.serializer import flatten
  import re
  import socket
label_desc: Use image node_id 4 for calling the S3Observer obj's underlying member method code with example usage: obj._list_s3_subdirs(prefix) and returns: list