class_docstr: Here are some common low-level expressions that may be useful in
  jump-starting parser development:
  
  - numeric forms (:class:`integers<integer>`, :class:`reals<real>`,
    :class:`scientific notation<sci_real>`)
  - common :class:`programming identifiers<identifier>`
  - network addresses (:class:`MAC<mac_address>`,
    :class:`IPv4<ipv4_address>`, :class:`IPv6<ipv6_address>`)
  - ISO8601 :class:`dates<iso8601_date>` and
    :class:`datetime<iso8601_datetime>`
  - :class:`UUID<uuid>`
  - :class:`comma-separated list<comma_separated_list>`
  - :class:`url`
  
  Parse actions:
  
  - :class:`convert_to_integer`
  - :class:`convert_to_float`
  - :class:`convert_to_date`
  - :class:`convert_to_datetime`
  - :class:`strip_html_tags`
  - :class:`upcase_tokens`
  - :class:`downcase_tokens`
  
  Example::
  
      pyparsing_common.number.run_tests('''
          # any int or real number, returned as the appropriate type
          100
          -100
          +100
          3.14159
          6.02e23
          1e-12
          ''')
  
      pyparsing_common.fnumber.run_tests('''
          # any int or real number, returned as float
          100
          -100
          +100
          3.14159
          6.02e23
          1e-12
          ''')
  
      pyparsing_common.hex_integer.run_tests('''
          # hex numbers
          100
          FF
          ''')
  
      pyparsing_common.fraction.run_tests('''
          # fractions
          1/2
          -3/4
          ''')
  
      pyparsing_common.mixed_integer.run_tests('''
          # mixed fractions
          1
          1/2
          -3/4
          1-3/4
          ''')
  
      import uuid
      pyparsing_common.uuid.set_parse_action(token_map(uuid.UUID))
      pyparsing_common.uuid.run_tests('''
          # uuid
          12345678-1234-5678-1234-567812345678
          ''')
  
  prints::
  
      # any int or real number, returned as the appropriate type
      100
      [100]
  
      -100
      [-100]
  
      +100
      [100]
  
      3.14159
      [3.14159]
  
      6.02e23
      [6.02e+23]
  
      1e-12
      [1e-12]
  
      # any int or real number, returned as float
      100
      [100.0]
  
      -100
      [-100.0]
  
      +100
      [100.0]
  
      3.14159
      [3.14159]
  
      6.02e23
      [6.02e+23]
  
      1e-12
      [1e-12]
  
      # hex numbers
      100
      [256]
  
      FF
      [255]
  
      # fractions
      1/2
      [0.5]
  
      -3/4
      [-0.75]
  
      # mixed fractions
      1
      [1]
  
      1/2
      [0.5]
  
      -3/4
      [-0.75]
  
      1-3/4
      [1.75]
  
      # uuid
      12345678-1234-5678-1234-567812345678
      [UUID('12345678-1234-5678-1234-567812345678')]
docstr: Helper to create a parse action for converting parsed
  datetime string to Python datetime.datetime
  
  Params -
  - fmt - format to be passed to datetime.strptime (default= ``"%Y-%m-%dT%H:%M:%S.%f"``)
  
  Example::
  
      dt_expr = pyparsing_common.iso8601_datetime.copy()
      dt_expr.set_parse_action(pyparsing_common.convert_to_datetime())
      print(dt_expr.parse_string("1999-12-31T23:59:59.999"))
  
  prints::
  
      [datetime.datetime(1999, 12, 31, 23, 59, 59, 999000)]
docstr_tok: ["Helper","to","create","a","parse","action","for","converting","parsed","datetime","string","to","Python","datetime.datetime","Params","-","-","fmt","-","format","to","be","passed","to","datetime.strptime","(","default=","``","``","%","Y-","%","m-","%","dT","%","H",":","%","M",":","%","S.","%","f","''","``",")","Example",":",":","dt_expr","=","pyparsing_common.iso8601_datetime.copy","(",")","dt_expr.set_parse_action","(","pyparsing_common.convert_to_datetime","(",")",")","print","(","dt_expr.parse_string","(","``","1999-12-31T23:59:59.999","''",")",")","prints",":",":","[","datetime.datetime","(","1999",",","12",",","31",",","23",",","59",",","59",",","999000",")","]"]
code: def convert_to_datetime(fmt: str = "%Y-%m-%dT%H:%M:%S.%f"):
      """Helper to create a parse action for converting parsed
      datetime string to Python datetime.datetime
  
      Params -
      - fmt - format to be passed to datetime.strptime (default= ``"%Y-%m-%dT%H:%M:%S.%f"``)
  
      Example::
  
          dt_expr = pyparsing_common.iso8601_datetime.copy()
          dt_expr.set_parse_action(pyparsing_common.convert_to_datetime())
          print(dt_expr.parse_string("1999-12-31T23:59:59.999"))
  
      prints::
  
          [datetime.datetime(1999, 12, 31, 23, 59, 59, 999000)]
      """
  
      def cvt_fn(s, l, t):
          try:
              return datetime.strptime(t[0], fmt)
          except ValueError as ve:
              raise ParseException(s, l, str(ve))
  
      return cvt_fn
  
imports: from .core import *
  from .helpers import DelimitedList, any_open_tag, any_close_tag
  from datetime import datetime
label_desc: Use image node_id 2 for calling the pyparsing_common obj's underlying member method code with example usage: obj.convert_to_datetime(fmt) and returns: cvt_fn, datetime