code: def list_directory(path: Text) -> List[Text]:
      """Returns all files and folders excluding hidden files.
  
      If the path points to a file, returns the file. This is a recursive
      implementation returning files in any depth of the path.
      """
      if not isinstance(path, str):
          raise ValueError(
              f"`resource_name` must be a string type. "
              f"Got `{type(path)}` instead"
          )
  
      if os.path.isfile(path):
          return [path]
      elif os.path.isdir(path):
          results: List[Text] = []
          for base, dirs, files in os.walk(path, followlinks=True):
              # sort files for same order across runs
              files = sorted(files, key=_filename_without_prefix)
              # add not hidden files
              good_files = filter(
                  lambda x: not x.startswith("."), files
              )
              results.extend(os.path.join(base, f) for f in good_files)
              # add not hidden directories
              good_directories = filter(
                  lambda x: not x.startswith("."), dirs
              )
              results.extend(
                  os.path.join(base, f) for f in good_directories
              )
          return results
      else:
          raise ValueError(
              f"Could not locate the resource '{os.path.abspath(path)}'."
          )
  
imports: from collections import OrderedDict
  import errno
  import glob
  from hashlib import md5
  from io import StringIO
  import json
  import os
  import sys
  from pathlib import Path
  import re
  from typing import Any, Dict, List, Optional, Text, Type, Union
  import warnings
  import random
  import string
  import portalocker
  from ruamel import yaml
  from ruamel.yaml import RoundTripRepresenter, YAMLError
  from ruamel.yaml.constructor import DuplicateKeyError, BaseConstructor, ScalarNode
  from rasa.shared.constants import DEFAULT_LOG_LEVEL, ENV_LOG_LEVEL, NEXT_MAJOR_VERSION_FOR_DEPRECATIONS, CONFIG_SCHEMA_FILE, MODEL_CONFIG_SCHEMA_FILE
  from rasa.shared.exceptions import FileIOException, FileNotFoundException, YamlSyntaxException, RasaException
  import rasa.shared.utils.validation
label_desc: Use image node_id 6 for calling a global function with example usage: list_directory(path) and returns: list, results