MCPcopy Create free account
hub / github.com/google-deepmind/alphageometry / from_string

Method from_string

problem.py:307–312  ·  view source on GitHub ↗
(cls, string: str, to_dict: bool = False)

Source from the content-addressed store, hash-verified

305
306 @classmethod
307 def from_string(cls, string: str, to_dict: bool = False) -> Definition:
308 lines = string.split('\n')
309 data = [cls.from_txt('\n'.join(group)) for group in reshape(lines, 6)]
310 if to_dict:
311 return cls.to_dict(data)
312 return data
313
314 @classmethod
315 def to_dict(cls, data: list[Definition]) -> dict[str, Definition]:

Callers

nothing calls this directly

Calls 3

reshapeFunction · 0.85
from_txtMethod · 0.45
to_dictMethod · 0.45

Tested by

no test coverage detected