def policy_from_source_code(source_code): # type: (str) -> Dict[str, Any] from chalice.analyzer import get_client_calls_for_app client_calls = get_client_calls_for_app(source_code) builder = PolicyBuilder() policy = builder.build_policy_from_api_calls(client_calls) return policy
def chalice_aws_calls(source_code): real_source_code = dedent(source_code) calls = analyzer.get_client_calls_for_app(real_source_code) return calls