code: def walk_resources(package_or_requirement, resource_name, recurse=True, base=''):
      
      base = base.rstrip('/') + '/'
      resource_base = (resource_name.rstrip('/') + '/' + base.strip('/')).rstrip('/')
  
      # Create default configuration files
      for filename in pymagic.resource_listdir(package_or_requirement, resource_base):
          # Skip hidden and other trashy names
          if filename.startswith('.') or any(filename.endswith(i) for i in (".pyc", ".pyo", "~")):
              continue
  
          # Handle subdirectories
          if pymagic.resource_isdir(package_or_requirement, resource_base + '/' + filename):
              if recurse:
                  for i in walk_resources(package_or_requirement, resource_name, recurse, base=base + filename):
                      yield i
          else:
              yield base + filename
docs: Yield paths of files in the given resource directory, all paths start with '/'.