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

18 lines
512 B

2 years ago
3 years ago
2 years ago
  1. import json
  2. from typing import Any, Dict, List, Union
  3. class Record:
  4. def __init__(
  5. self, id: int, data: str, label: Union[List[Any], Dict[Any, Any]], user: str, metadata: Dict[Any, Any]
  6. ):
  7. self.id = id
  8. self.data = data
  9. self.label = label
  10. self.user = user
  11. self.metadata = metadata
  12. def __str__(self):
  13. return json.dumps(
  14. {"id": self.id, "data": self.data, "label": self.label, "user": self.user, "metadata": self.metadata}
  15. )