MCPcopy Index your code
hub / github.com/PyGithub/PyGithub / cst_to_python

Function cst_to_python

scripts/openapi.py:63–73  ·  view source on GitHub ↗
(value: cst.BaseExpression)

Source from the content-addressed store, hash-verified

61
62
63def cst_to_python(value: cst.BaseExpression) -> Any:
64 if isinstance(value, cst.List):
65 return [cst_to_python(item.value) for item in value.elements]
66 if isinstance(value, cst.SimpleString):
67 return value.evaluated_value
68 if isinstance(value, cst.Name):
69 if value.value == "True":
70 return True
71 if value.value == "False":
72 return False
73 raise ValueError(f"unsupported expr: {value}")
74
75
76def as_python_type(

Callers 1

get_decoratorsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…