You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

data.py 443 B

1234567891011121314151617181920
  1. import json
  2. class ServiceInfo:
  3. def __init__(self):
  4. self.startTime = ''
  5. self.updateTime = ''
  6. self.inferenceNumber = 0
  7. self.hardExampleNumber = 0
  8. self.uploadCloudRatio = 0
  9. @staticmethod
  10. def from_json(json_str):
  11. info = ServiceInfo()
  12. info.__dict__ = json.loads(json_str)
  13. return info
  14. def to_json(self):
  15. info = json.dumps(self.__dict__)
  16. return info