code: def value_to_int(attrib, key):
      
      val = attrib.get(key, 0)
      if isinstance(val, str):
          if val.isspace() or val == '':
              return 0
      return val
docs: Massage runs in an inning to 0 if an empty string,
      or key not found. Otherwise return the value