utils.py 937 B

123456789101112131415161718192021222324252627282930313233343536
  1. from dataclasses import dataclass
  2. @dataclass
  3. class BiocoderData:
  4. instance_id: str
  5. filePath: str
  6. numLines: int
  7. lineStart: int
  8. lineEnd: int
  9. signature: str
  10. comment: str
  11. content: str
  12. repository: str
  13. promptSummaryOnly: str
  14. contextCode: str
  15. goldenCode: str
  16. test_case_id: str
  17. language: str
  18. def to_dict(self):
  19. return {
  20. 'filePath': self.filePath,
  21. 'numLines': self.numLines,
  22. 'lineStart': self.lineStart,
  23. 'lineEnd': self.lineEnd,
  24. 'signature': self.signature,
  25. 'comment': self.comment,
  26. 'content': self.content,
  27. 'repository': self.repository,
  28. 'promptSummaryOnly': self.promptSummaryOnly,
  29. 'contextCode': self.contextCode,
  30. 'goldenCode': self.goldenCode,
  31. 'test_case_id': self.test_case_id,
  32. 'language': self.language,
  33. }