code: def is_valid_dir(path):
      ''' Returns True if provided directory exists and is a directory, or False otherwise. '''
      return os.path.exists(path) and os.path.isdir(pathf is_valid_dir(path):
      ''' Returns True if provided directory exists and is a directory, or False otherwise. '''
      return os.path.exists(path) and os.path.isdir(path)
docs: Returns True if provided directory exists and is a directory, or False otherwise.