code: def is_dir_or_file(dirname):
      '''Checks if a path is an actual directory that exists or a file'''
      if not os.path.isdir(dirname) and not os.path.isfile(dirname):
          msg = "{0} is not a directory nor a file".format(dirname)
          raise argparse.ArgumentTypeError(msg)
      else:
          return dirnamf is_dir_or_file(dirname):
      '''Checks if a path is an actual directory that exists or a file'''
      if not os.path.isdir(dirname) and not os.path.isfile(dirname):
          msg = "{0} is not a directory nor a file".format(dirname)
          raise argparse.ArgumentTypeError(msg)
      else:
          return dirname
docs: Checks if a path is an actual directory that exists or a file