class_docstr: A callable for parsing and resolving CSS to atomic properties
  
      
code: def size_to_pt(self, in_val, em_pt=None, conversions=UNIT_RATIOS):
      def _error():
          warnings.warn(
              "Unhandled size: {val!r}".format(val=in_val), CSSWarning
          )
          return self.size_to_pt("1!!default", conversions=conversions)
  
      try:
          val, unit = re.match(
              r"^(\S*?)([a-zA-Z%!].*)", in_val
          ).groups()
      except AttributeError:
          return _error()
      if val == "":
          # hack for 'large' etc.
          val = 1
      else:
          try:
              val = float(val)
          except ValueError:
              return _error()
  
      while unit != "pt":
          if unit == "em":
              if em_pt is None:
                  unit = "rem"
              else:
                  val *= em_pt
                  unit = "pt"
              continue
  
          try:
              unit, mul = conversions[unit]
          except KeyError:
              return _error()
          val *= mul
  
      val = round(val, 5)
      if int(val) == val:
          size_fmt = "{fmt:d}pt".format(fmt=int(val))
      else:
          size_fmt = "{fmt:f}pt".format(fmt=val)
      return size_fmt
  
file_path: catboost/contrib/python/pandas/py2/pandas/io/formats/css.py
imports: import re
  import warnings
label_desc: Use image node_id 2 for calling the CSSResolver obj's underlying member method code with example usage: obj.size_to_pt(in_val, em_pt, conversions) and returns: size_fmt, self, _error, _error, _error