code: def cast_int(x):
      
      try:
          x = int(x)
      except ValueError:
          try:
              x = x.strip()
          except AttributeError as e:
              logger_misc.warn("parse_str: AttributeError: String not number or word, {}, {}".format(x, e))
      return x
docs: Cast unknown type into integer
  
      :param any x:
      :return int: