code: def convert_to_int(value):
      
      if not value:
          return None
  
      # Apart from numbers also accept values that end with px
      if isinstance(value, str):
          value = value.strip(' px')
  
      try:
          return int(value)
      except (TypeError, ValueError):
          return None
docs: Attempts to convert a specified value to an integer
  
      :param value: Content to be converted into an integer
      :type value: string or int