code: def main(args):
      config = {
          "dry-run": False,
          "help": False,
          "to": 4,
          "from": -1,
          "tabs": False,
          "encoding": "utf-8",
          "is-tabs": False,
          "tabsize": 4,
          "all-tabs": False,
      }
      possible_args = {
          "d": "dry-run",
          "h": "help",
          "t:": "to=",
          "f:": "from=",
          "n": "tabs",
          "e:": "encoding=",
          "s:": "tabsize=",
          "a": "all-tabs",
      }
      optlist, filenames = getopt.getopt(
          args[1:],
          "".join(possible_args.keys()),
          possible_args.values(),
      )
  
      shortargs, longargs = [], []
      for shortarg in possible_args:
          shortargs.append(shortarg.rstrip(":"))
          longargs.append(possible_args[shortarg].rstrip("="))
  
      for opt, val in optlist:
          opt = opt.lstrip("-")
          if opt in shortargs:
              opt = longargs[shortargs.index(opt)]
          if isinstance(config[opt], bool):
              config[opt] = True
          elif isinstance(config[opt], int):
              config[opt] = int(val)
          else:
              config[opt] = val
  
      if config["help"]:
          help = (
              """
          Usage: %s [options] filename(s)
          Options:
              -h, --help              Show this message
              -d, --dry-run           Don't save anything, just print
                                      the result
              -t <n>, --to <n>        Convert to this number of spaces
                                      (default: 4)
              -f <n>, --from <n>      Convert from this number of spaces
                                      (default: auto-detect, will also
                                      detect tabs)
              -n, --tabs              Don't convert indentation to spaces,
                                      convert to tabs instead. -t and
                                      --to will have no effect.
              -a, --all-tabs          Also convert tabs used for alignment
                                      in the code (Warning: will replace
                                      all tabs in the file, even if inside
                                      a string)
              -s <n>, --tabsize <n>   Set how many spaces one tab is
                                      (only has an effect on -a, default: 4)
              -e <s>, --encoding <s>  Open files with specified encoding
                                      (default: utf-8)
          """
              % args[0]
          )
  
          # Also removes 8 leading spaces to remove our indentation
          print("\n".join([x[8:] for x in help[1:].split("\n")]))
          sys.exit(0)
  
      if filenames:
          run_files(filenames, config)
      else:
          run(sys.stdin, sys.stdout, config)
  
file_path: H2O/h2o_hf/helm/src/helm/benchmark/scenarios/code_scenario_helper.py
imports: import codecs
  import getopt
  import os
  import shutil
  import sys
  import tempfile
label_desc: Use image node_id 6 for calling a global function with example usage: main(args) without return types