MCPcopy
hub / github.com/reflex-dev/reflex / _get_source_from_app_source

Method _get_source_from_app_source

reflex/testing.py:221–236  ·  view source on GitHub ↗

Get the source from app_source. Args: app_source: function or module or str Returns: source code

(self, app_source: Any)

Source from the content-addressed store, hash-verified

219 return glbs
220
221 def _get_source_from_app_source(self, app_source: Any) -> str:
222 """Get the source from app_source.
223
224 Args:
225 app_source: function or module or str
226
227 Returns:
228 source code
229 """
230 if isinstance(app_source, str):
231 return app_source
232 source = inspect.getsource(app_source)
233 source = re.sub(
234 r"^\s*def\s+\w+\s*\(.*?\)(\s+->\s+\w+)?:", "", source, flags=re.DOTALL
235 )
236 return textwrap.dedent(source)
237
238 def _initialize_app(self):
239 # disable telemetry reporting for tests

Callers 1

_initialize_appMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected