code: def main():
      """Main entry function."""
      parser = argparse.ArgumentParser(description="lint source codes")
      parser.add_argument("project", help="project name")
      parser.add_argument(
          "filetype",
          choices=["python", "cpp", "all"],
          help="source code type",
      )
      parser.add_argument("path", nargs="+", help="path to traverse")
      parser.add_argument(
          "--exclude_path",
          nargs="+",
          default=[],
          help="exclude this path, and all subfolders if path is a folder",
      )
      parser.add_argument(
          "--quiet",
          action="store_true",
          help="run cpplint in quiet mode",
      )
      parser.add_argument(
          "--pylint-rc", default=None, help="pylint rc file"
      )
      args = parser.parse_args()
  
      _HELPER.project_name = args.project
      if args.pylint_rc is not None:
          _HELPER.pylint_opts = [
              "--rcfile=" + args.pylint_rc,
          ]
      file_type = args.filetype
      allow_type = []
      if file_type in ("python", "all"):
          allow_type += PYTHON_SUFFIX
      if file_type in ("cpp", "all"):
          allow_type += CXX_SUFFIX
      allow_type = set(allow_type)
      if sys.version_info.major == 2 and os.name != "nt":
          sys.stderr = codecs.StreamReaderWriter(
              sys.stderr,
              codecs.getreader("utf8"),
              codecs.getwriter("utf8"),
              "replace",
          )
      # get excluded files
      excluded_paths = filepath_enumerate(args.exclude_path)
      for path in args.path:
          if os.path.isfile(path):
              normpath = os.path.normpath(path)
              if normpath not in excluded_paths:
                  process(path, allow_type)
          else:
              for root, dirs, files in os.walk(path):
                  for name in files:
                      file_path = os.path.normpath(
                          os.path.join(root, name)
                      )
                      if file_path not in excluded_paths:
                          process(file_path, allow_type)
      nerr = _HELPER.print_summary(sys.stderr)
      sys.exit(nerr > 0)
  
file_path: dgl/tests/lint/lint.py
imports: from __future__ import print_function
  import argparse
  import codecs
  import os
  import re
  import sys
  import cpplint
  from cpplint import _cpplint_state
  from pylint import epylint
label_desc: Use image node_id 4 for calling a global function with example usage: main() without return types