code: def numerize_ordinals(s, ignore=None, bias=None):
      if bias == "fractionals":
          return s
      if ignore is None:
          ignore = []
      all_ords = regexify(consts.ALL_ORDINALS.keys(), ignore=ignore)
      # {|x| x == 'second' && bias != :ordinal}
      if bias != "ordinal" and "second" not in ignore:
          pat = re.compile(
              r"(?!second|\d|{})(^|\W)second(?=$|\W)".format(
                  consts.ALL_ORDINALS_REGEX
              ),
              flags=re.IGNORECASE,
          )
          m = re.search(pat, s)
          if m is not None:
  
              def _repl_ordinal(m):
                  m1 = m.group(1)
                  m2 = str(consts.ALL_ORDINALS["second".lower()])
                  return f"{m1}<num>{m2}nd"
  
              s = re.sub(pat, _repl_ordinal, s, count=1)
      pat = re.compile(
          r"(^|\W)({})(?=$|\W)".format(all_ords), flags=re.IGNORECASE
      )
      m = re.search(pat, s)
      if m is not None:
  
          def _repl_ordinal(m):
              m1 = m.group(1)
              m2 = str(consts.ALL_ORDINALS[m.group(2).lower()])
              return f"{m1}<num>{m2}" + m.group(2)[-2:]
  
          s = re.sub(pat, _repl_ordinal, s, count=1)
      return s
  
imports: import re
  from .None import consts
label_desc: Use image node_id 11 for calling a global function with example usage: numerize_ordinals(s, ignore, bias) and returns: s, s, unknown, m1, str, m2, str