code: def from_json(cls, service_dict):
          
          sd = service_dict.copy()
          service_endpoint = sd.get(cls.SERVICE_ENDPOINT)
          if not service_endpoint:
              logger.error(
                  'Service definition in DDO document is missing the "serviceEndpoint" key/value.')
              raise IndexError
  
          _type = sd.get('type')
          if not _type:
              logger.error('Service definition in DDO document is missing the "type" key/value.')
              raise IndexError
  
          sd.pop(cls.SERVICE_ENDPOINT)
          sd.pop('type')
          return cls(
              service_endpoint,
              _type,
              sd
          )
docs: Create a service object from a JSON string.