class_docstr: A collection of options, a dictionary with object-like access.
  
  Normally accessed via static functions in the `tornado.options` module,
  which reference a global instance.
class_docstr_tok: ["A","collection","of","options",",","a","dictionary","with","object-like","access",".","Normally","accessed","via","static","functions","in","the","`","tornado.options","`","module",",","which","reference","a","global","instance","."]
docstr: Defines a new command line option.
  
  If ``type`` is given (one of str, float, int, datetime, or timedelta)
  or can be inferred from the ``default``, we parse the command line
  arguments based on the given type. If ``multiple`` is True, we accept
  comma-separated values, and the option value is always a list.
  
  For multi-value integers, we also accept the syntax ``x:y``, which
  turns into ``range(x, y)`` - very useful for long integer ranges.
  
  ``help`` and ``metavar`` are used to construct the
  automatically generated command line help string. The help
  message is formatted like::
  
     --name=METAVAR      help string
  
  ``group`` is used to group the defined options in logical
  groups. By default, command line options are grouped by the
  file in which they are defined.
  
  Command line option names must be unique globally. They can be parsed
  from the command line with `parse_command_line` or parsed from a
  config file with `parse_config_file`.
  
  If a ``callback`` is given, it will be run with the new value whenever
  the option is changed.  This can be used to combine command-line
  and file-based options::
  
      define("config", type=str, help="path to config file",
             callback=lambda path: parse_config_file(path, final=False))
  
  With this definition, options in the file specified by ``--config`` will
  override options set earlier on the command line, but can be overridden
  by later flags.
code: def define(
      self,
      name,
      default=None,
      type=None,
      help=None,
      metavar=None,
      multiple=False,
      group=None,
      callback=None,
  ):
      """Defines a new command line option.
  
      If ``type`` is given (one of str, float, int, datetime, or timedelta)
      or can be inferred from the ``default``, we parse the command line
      arguments based on the given type. If ``multiple`` is True, we accept
      comma-separated values, and the option value is always a list.
  
      For multi-value integers, we also accept the syntax ``x:y``, which
      turns into ``range(x, y)`` - very useful for long integer ranges.
  
      ``help`` and ``metavar`` are used to construct the
      automatically generated command line help string. The help
      message is formatted like::
  
         --name=METAVAR      help string
  
      ``group`` is used to group the defined options in logical
      groups. By default, command line options are grouped by the
      file in which they are defined.
  
      Command line option names must be unique globally. They can be parsed
      from the command line with `parse_command_line` or parsed from a
      config file with `parse_config_file`.
  
      If a ``callback`` is given, it will be run with the new value whenever
      the option is changed.  This can be used to combine command-line
      and file-based options::
  
          define("config", type=str, help="path to config file",
                 callback=lambda path: parse_config_file(path, final=False))
  
      With this definition, options in the file specified by ``--config`` will
      override options set earlier on the command line, but can be overridden
      by later flags.
      """
      normalized = self._normalize_name(name)
      if normalized in self._options:
          raise Error(
              "Option %r already defined in %s"
              % (normalized, self._options[normalized].file_name)
          )
      frame = sys._getframe(0)
      options_file = frame.f_code.co_filename
  
      # Can be called directly, or through top level define() fn, in which
      # case, step up above that frame to look for real caller.
      if (
          frame.f_back.f_code.co_filename == options_file
          and frame.f_back.f_code.co_name == "define"
      ):
          frame = frame.f_back
  
      file_name = frame.f_back.f_code.co_filename
      if file_name == options_file:
          file_name = ""
      if type is None:
          if not multiple and default is not None:
              type = default.__class__
          else:
              type = str
      if group:
          group_name = group
      else:
          group_name = file_name
      option = _Option(
          name,
          file_name=file_name,
          default=default,
          type=type,
          help=help,
          metavar=metavar,
          multiple=multiple,
          group_name=group_name,
          callback=callback,
      )
      self._options[normalized] = option
  
imports: from __future__ import absolute_import, division, print_function
  import datetime
  import numbers
  import re
  import sys
  import os
  import textwrap
  from tornado.escape import _unicode, native_str
  from tornado.log import define_logging_options
  from tornado import stack_context
  from tornado.util import basestring_type, exec_in
label_desc: Use image node_id 13 for calling the OptionParser obj's underlying member method code with example usage: obj.define(name, default, type, help, metavar, multiple, group, callback) without return types