class_docstr: Represent an Alembic configuration.
  
  Within an ``env.py`` script, this is available
  via the :attr:`.EnvironmentContext.config` attribute,
  which in turn is available at ``alembic.context``::
  
      from alembic import context
  
      some_param = context.config.get_main_option("my option")
  
  When invoking Alembic programmatically, a new
  :class:`.Config` can be created by passing
  the name of an .ini file to the constructor::
  
      from alembic.config import Config
      alembic_cfg = Config("/path/to/yourapp/alembic.ini")
  
  With a :class:`.Config` object, you can then
  run Alembic commands programmatically using the directives
  in :mod:`alembic.command`.
  
  The :class:`.Config` object can also be constructed without
  a filename.   Values can be set programmatically, and
  new sections will be created as needed::
  
      from alembic.config import Config
      alembic_cfg = Config()
      alembic_cfg.set_main_option("script_location", "myapp:migrations")
      alembic_cfg.set_main_option("sqlalchemy.url", "postgresql://foo/bar")
      alembic_cfg.set_section_option("mysection", "foo", "bar")
  
  .. warning::
  
     When using programmatic configuration, make sure the
     ``env.py`` file in use is compatible with the target configuration;
     including that the call to Python ``logging.fileConfig()`` is
     omitted if the programmatic configuration doesn't actually include
     logging directives.
  
  For passing non-string values to environments, such as connections and
  engines, use the :attr:`.Config.attributes` dictionary::
  
      with engine.begin() as connection:
          alembic_cfg.attributes['connection'] = connection
          command.upgrade(alembic_cfg, "head")
  
  :param file\_: name of the .ini file to open.
  :param ini_section: name of the main Alembic section within the
   .ini file
  :param output_buffer: optional file-like input buffer which
   will be passed to the :class:`.MigrationContext` - used to redirect
   the output of "offline generation" when using Alembic programmatically.
  :param stdout: buffer where the "print" output of commands will be sent.
   Defaults to ``sys.stdout``.
  
  :param config_args: A dictionary of keys and values that will be used
   for substitution in the alembic config file.  The dictionary as given
   is **copied** to a new one, stored locally as the attribute
   ``.config_args``. When the :attr:`.Config.file_config` attribute is
   first invoked, the replacement variable ``here`` will be added to this
   dictionary before the dictionary is passed to ``ConfigParser()``
   to parse the .ini file.
  
  :param attributes: optional dictionary of arbitrary Python keys/values,
   which will be populated into the :attr:`.Config.attributes` dictionary.
  
   .. seealso::
  
      :ref:`connection_sharing`
class_docstr_tok: ["Represent","an","Alembic","configuration",".","Within","an","``","env.py","``","script",",","this","is","available","via","the",":","attr",":","`",".EnvironmentContext.config","`","attribute",",","which","in","turn","is","available","at","``","alembic.context","``",":",":","from","alembic","import","context","some_param","=","context.config.get_main_option","(","``","my","option","''",")","When","invoking","Alembic","programmatically",",","a","new",":","class",":","`",".Config","`","can","be","created","by","passing","the","name","of","an",".ini","file","to","the","constructor",":",":","from","alembic.config","import","Config","alembic_cfg","=","Config","(","``","\/path\/to\/yourapp\/alembic.ini","''",")","With","a",":","class",":","`",".Config","`","object",",","you","can","then","run","Alembic","commands","programmatically","using","the","directives","in",":","mod",":","`","alembic.command","`",".","The",":","class",":","`",".Config","`","object","can","also","be","constructed","without","a","filename",".","Values","can","be","set","programmatically",",","and","new","sections","will","be","created","as","needed",":",":","from","alembic.config","import","Config","alembic_cfg","=","Config","(",")","alembic_cfg.set_main_option","(","``","script_location","''",",","``","myapp",":","migrations","''",")","alembic_cfg.set_main_option","(","``","sqlalchemy.url","''",",","``","postgresql",":","\/\/foo\/bar","''",")","alembic_cfg.set_section_option","(","``","mysection","''",",","``","foo","''",",","``","bar","''",")","..","warning",":",":","When","using","programmatic","configuration",",","make","sure","the","``","env.py","``","file","in","use","is","compatible","with","the","target","configuration",";","including","that","the","call","to","Python","``","logging.fileConfig","(",")","``","is","omitted","if","the","programmatic","configuration","does","n't","actually","include","logging","directives",".","For","passing","non-string","values","to","environments",",","such","as","connections","and","engines",",","use","the",":","attr",":","`",".Config.attributes","`","dictionary",":",":","with","engine.begin","(",")","as","connection",":","alembic_cfg.attributes","[","'connection","'","]","=","connection","command.upgrade","(","alembic_cfg",",","``","head","''",")",":","param","file\\_",":","name","of","the",".ini","file","to","open",".",":","param","ini_section",":","name","of","the","main","Alembic","section","within","the",".ini","file",":","param","output_buffer",":","optional","file-like","input","buffer","which","will","be","passed","to","the",":","class",":","`",".MigrationContext","`","-","used","to","redirect","the","output","of","``","offline","generation","''","when","using","Alembic","programmatically",".",":","param","stdout",":","buffer","where","the","``","print","''","output","of","commands","will","be","sent",".","Defaults","to","``","sys.stdout","``",".",":","param","config_args",":","A","dictionary","of","keys","and","values","that","will","be","used","for","substitution","in","the","alembic","config","file",".","The","dictionary","as","given","is","*","*","copied","*","*","to","a","new","one",",","stored","locally","as","the","attribute","``",".config_args","``",".","When","the",":","attr",":","`",".Config.file_config","`","attribute","is","first","invoked",",","the","replacement","variable","``","here","``","will","be","added","to","this","dictionary","before","the","dictionary","is","passed","to","``","ConfigParser","(",")","``","to","parse","the",".ini","file",".",":","param","attributes",":","optional","dictionary","of","arbitrary","Python","keys\/values",",","which","will","be","populated","into","the",":","attr",":","`",".Config.attributes","`","dictionary",".","..","seealso",":",":",":","ref",":","`","connection_sharing","`"]
docstr: Return the directory where Alembic setup templates are found.
  
  This method is used by the alembic ``init`` and ``list_templates``
  commands.
docstr_tok: ["Return","the","directory","where","Alembic","setup","templates","are","found",".","This","method","is","used","by","the","alembic","``","init","``","and","``","list_templates","``","commands","."]
code: def get_template_directory(self) -> str:
      """Return the directory where Alembic setup templates are found.
  
      This method is used by the alembic ``init`` and ``list_templates``
      commands.
  
      """
      import alembic
  
      package_dir = os.path.abspath(os.path.dirname(alembic.__file__))
      return os.path.join(package_dir, "templates")
  
imports: from __future__ import annotations
  from argparse import ArgumentParser
  from argparse import Namespace
  from configparser import ConfigParser
  import inspect
  import os
  import sys
  from typing import Any
  from typing import cast
  from typing import Dict
  from typing import Mapping
  from typing import Optional
  from typing import overload
  from typing import Sequence
  from typing import TextIO
  from typing import Union
  from typing_extensions import TypedDict
  from .None import __version__
  from .None import command
  from .None import util
  from .util import compat
label_desc: Use image node_id 5 for calling the Config obj's underlying member method code with example usage: obj.get_template_directory() and returns: os