repo
stringlengths
7
54
path
stringlengths
4
223
func_name
stringlengths
1
134
original_string
stringlengths
75
104k
language
stringclasses
1 value
code
stringlengths
75
104k
code_tokens
listlengths
20
28.4k
docstring
stringlengths
1
46.3k
docstring_tokens
listlengths
1
1.66k
sha
stringlengths
40
40
url
stringlengths
87
315
partition
stringclasses
1 value
summary
stringlengths
4
350
obf_code
stringlengths
7.85k
764k
awslabs/aws-sam-cli
samcli/commands/local/lib/sam_function_provider.py
SamFunctionProvider._extract_sam_function_codeuri
def _extract_sam_function_codeuri(name, resource_properties, code_property_key): """ Extracts the SAM Function CodeUri from the Resource Properties Parameters ---------- name str LogicalId of the resource resource_properties dict Dictionary repres...
python
def _extract_sam_function_codeuri(name, resource_properties, code_property_key): """ Extracts the SAM Function CodeUri from the Resource Properties Parameters ---------- name str LogicalId of the resource resource_properties dict Dictionary repres...
[ "def", "_extract_sam_function_codeuri", "(", "name", ",", "resource_properties", ",", "code_property_key", ")", ":", "codeuri", "=", "resource_properties", ".", "get", "(", "code_property_key", ",", "SamFunctionProvider", ".", "_DEFAULT_CODEURI", ")", "# CodeUri can be a ...
Extracts the SAM Function CodeUri from the Resource Properties Parameters ---------- name str LogicalId of the resource resource_properties dict Dictionary representing the Properties of the Resource code_property_key str Property Key of the c...
[ "Extracts", "the", "SAM", "Function", "CodeUri", "from", "the", "Resource", "Properties" ]
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/commands/local/lib/sam_function_provider.py#L138-L163
train
Extracts the SAM Function CodeUri from the Resource Properties and returns it
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/commands/local/lib/sam_function_provider.py
SamFunctionProvider._convert_lambda_function_resource
def _convert_lambda_function_resource(name, resource_properties, layers): # pylint: disable=invalid-name """ Converts a AWS::Serverless::Function resource to a Function configuration usable by the provider. :param string name: LogicalID of the resource NOTE: This is *not* the function name bec...
python
def _convert_lambda_function_resource(name, resource_properties, layers): # pylint: disable=invalid-name """ Converts a AWS::Serverless::Function resource to a Function configuration usable by the provider. :param string name: LogicalID of the resource NOTE: This is *not* the function name bec...
[ "def", "_convert_lambda_function_resource", "(", "name", ",", "resource_properties", ",", "layers", ")", ":", "# pylint: disable=invalid-name", "# CodeUri is set to \".\" in order to get code locally from current directory. AWS::Lambda::Function's ``Code``", "# property does not support spec...
Converts a AWS::Serverless::Function resource to a Function configuration usable by the provider. :param string name: LogicalID of the resource NOTE: This is *not* the function name because not all functions declare a name :param dict resource_properties: Properties of this resource ...
[ "Converts", "a", "AWS", "::", "Serverless", "::", "Function", "resource", "to", "a", "Function", "configuration", "usable", "by", "the", "provider", "." ]
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/commands/local/lib/sam_function_provider.py#L166-L192
train
Converts a AWS Lambda function resource to a Function configuration usable by the provider.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/commands/local/lib/sam_function_provider.py
SamFunctionProvider._extract_lambda_function_code
def _extract_lambda_function_code(resource_properties, code_property_key): """ Extracts the Lambda Function Code from the Resource Properties Parameters ---------- resource_properties dict Dictionary representing the Properties of the Resource code_property_k...
python
def _extract_lambda_function_code(resource_properties, code_property_key): """ Extracts the Lambda Function Code from the Resource Properties Parameters ---------- resource_properties dict Dictionary representing the Properties of the Resource code_property_k...
[ "def", "_extract_lambda_function_code", "(", "resource_properties", ",", "code_property_key", ")", ":", "codeuri", "=", "resource_properties", ".", "get", "(", "code_property_key", ",", "SamFunctionProvider", ".", "_DEFAULT_CODEURI", ")", "if", "isinstance", "(", "codeu...
Extracts the Lambda Function Code from the Resource Properties Parameters ---------- resource_properties dict Dictionary representing the Properties of the Resource code_property_key str Property Key of the code on the Resource Returns ------- ...
[ "Extracts", "the", "Lambda", "Function", "Code", "from", "the", "Resource", "Properties" ]
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/commands/local/lib/sam_function_provider.py#L195-L217
train
Extracts the Lambda Function Code from the Resource Properties and returns the codeuri
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/commands/local/lib/sam_function_provider.py
SamFunctionProvider._parse_layer_info
def _parse_layer_info(list_of_layers, resources): """ Creates a list of Layer objects that are represented by the resources and the list of layers Parameters ---------- list_of_layers List(str) List of layers that are defined within the Layers Property on a function ...
python
def _parse_layer_info(list_of_layers, resources): """ Creates a list of Layer objects that are represented by the resources and the list of layers Parameters ---------- list_of_layers List(str) List of layers that are defined within the Layers Property on a function ...
[ "def", "_parse_layer_info", "(", "list_of_layers", ",", "resources", ")", ":", "layers", "=", "[", "]", "for", "layer", "in", "list_of_layers", ":", "# If the layer is a string, assume it is the arn", "if", "isinstance", "(", "layer", ",", "six", ".", "string_types"...
Creates a list of Layer objects that are represented by the resources and the list of layers Parameters ---------- list_of_layers List(str) List of layers that are defined within the Layers Property on a function resources dict The Resources dictionary defined in...
[ "Creates", "a", "list", "of", "Layer", "objects", "that", "are", "represented", "by", "the", "resources", "and", "the", "list", "of", "layers" ]
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/commands/local/lib/sam_function_provider.py#L220-L270
train
Parses the list of layers and resources from a template and returns a list of Layer objects that are represented by the resources and the list of layers that are defined within the template and the list of layers that are defined within the template.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/local/lambdafn/env_vars.py
EnvironmentVariables.resolve
def resolve(self): """ Resolves the values from different sources and returns a dict of environment variables to use when running the function locally. :return dict: Dict where key is the variable name and value is the value of the variable. Both key and values are strings ...
python
def resolve(self): """ Resolves the values from different sources and returns a dict of environment variables to use when running the function locally. :return dict: Dict where key is the variable name and value is the value of the variable. Both key and values are strings ...
[ "def", "resolve", "(", "self", ")", ":", "# AWS_* variables must always be passed to the function, but user has the choice to override them", "result", "=", "self", ".", "_get_aws_variables", "(", ")", "# Default value for the variable gets lowest priority", "for", "name", ",", "...
Resolves the values from different sources and returns a dict of environment variables to use when running the function locally. :return dict: Dict where key is the variable name and value is the value of the variable. Both key and values are strings
[ "Resolves", "the", "values", "from", "different", "sources", "and", "returns", "a", "dict", "of", "environment", "variables", "to", "use", "when", "running", "the", "function", "locally", "." ]
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/local/lambdafn/env_vars.py#L77-L104
train
Resolves the values from different sources and returns a dict of environment variables to use when running the function locally.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/local/lambdafn/env_vars.py
EnvironmentVariables._get_aws_variables
def _get_aws_variables(self): """ Returns the AWS specific environment variables that should be available in the Lambda runtime. They are prefixed it "AWS_*". :return dict: Name and value of AWS environment variable """ result = { # Variable that says this f...
python
def _get_aws_variables(self): """ Returns the AWS specific environment variables that should be available in the Lambda runtime. They are prefixed it "AWS_*". :return dict: Name and value of AWS environment variable """ result = { # Variable that says this f...
[ "def", "_get_aws_variables", "(", "self", ")", ":", "result", "=", "{", "# Variable that says this function is running in Local Lambda", "\"AWS_SAM_LOCAL\"", ":", "\"true\"", ",", "# Function configuration", "\"AWS_LAMBDA_FUNCTION_MEMORY_SIZE\"", ":", "str", "(", "self", ".",...
Returns the AWS specific environment variables that should be available in the Lambda runtime. They are prefixed it "AWS_*". :return dict: Name and value of AWS environment variable
[ "Returns", "the", "AWS", "specific", "environment", "variables", "that", "should", "be", "available", "in", "the", "Lambda", "runtime", ".", "They", "are", "prefixed", "it", "AWS_", "*", "." ]
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/local/lambdafn/env_vars.py#L136-L173
train
Returns the AWS specific environment variables that should be available in Lambda runtime.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/local/lambdafn/env_vars.py
EnvironmentVariables._stringify_value
def _stringify_value(self, value): """ This method stringifies values of environment variables. If the value of the method is a list or dictionary, then this method will replace it with empty string. Values of environment variables in Lambda must be a string. List or dictionary usually m...
python
def _stringify_value(self, value): """ This method stringifies values of environment variables. If the value of the method is a list or dictionary, then this method will replace it with empty string. Values of environment variables in Lambda must be a string. List or dictionary usually m...
[ "def", "_stringify_value", "(", "self", ",", "value", ")", ":", "# List/dict/None values are replaced with a blank", "if", "isinstance", "(", "value", ",", "(", "dict", ",", "list", ",", "tuple", ")", ")", "or", "value", "is", "None", ":", "result", "=", "se...
This method stringifies values of environment variables. If the value of the method is a list or dictionary, then this method will replace it with empty string. Values of environment variables in Lambda must be a string. List or dictionary usually means they are intrinsic functions which have not been r...
[ "This", "method", "stringifies", "values", "of", "environment", "variables", ".", "If", "the", "value", "of", "the", "method", "is", "a", "list", "or", "dictionary", "then", "this", "method", "will", "replace", "it", "with", "empty", "string", ".", "Values",...
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/local/lambdafn/env_vars.py#L175-L204
train
This method will stringify the value of the key - value pair in Lambda.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/local/docker/container.py
Container.create
def create(self): """ Calls Docker API to creates the Docker container instance. Creating the container does *not* run the container. Use ``start`` method to run the container :return string: ID of the created container :raise RuntimeError: If this method is called after a conta...
python
def create(self): """ Calls Docker API to creates the Docker container instance. Creating the container does *not* run the container. Use ``start`` method to run the container :return string: ID of the created container :raise RuntimeError: If this method is called after a conta...
[ "def", "create", "(", "self", ")", ":", "if", "self", ".", "is_created", "(", ")", ":", "raise", "RuntimeError", "(", "\"This container already exists. Cannot create again.\"", ")", "LOG", ".", "info", "(", "\"Mounting %s as %s:ro,delegated inside runtime container\"", ...
Calls Docker API to creates the Docker container instance. Creating the container does *not* run the container. Use ``start`` method to run the container :return string: ID of the created container :raise RuntimeError: If this method is called after a container already has been created
[ "Calls", "Docker", "API", "to", "creates", "the", "Docker", "container", "instance", ".", "Creating", "the", "container", "does", "*", "not", "*", "run", "the", "container", ".", "Use", "start", "method", "to", "run", "the", "container" ]
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/local/docker/container.py#L75-L137
train
Creates a new container instance.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/local/docker/container.py
Container.delete
def delete(self): """ Removes a container that was created earlier. """ if not self.is_created(): LOG.debug("Container was not created. Skipping deletion") return try: self.docker_client.containers\ .get(self.id)\ ...
python
def delete(self): """ Removes a container that was created earlier. """ if not self.is_created(): LOG.debug("Container was not created. Skipping deletion") return try: self.docker_client.containers\ .get(self.id)\ ...
[ "def", "delete", "(", "self", ")", ":", "if", "not", "self", ".", "is_created", "(", ")", ":", "LOG", ".", "debug", "(", "\"Container was not created. Skipping deletion\"", ")", "return", "try", ":", "self", ".", "docker_client", ".", "containers", ".", "get...
Removes a container that was created earlier.
[ "Removes", "a", "container", "that", "was", "created", "earlier", "." ]
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/local/docker/container.py#L139-L163
train
Removes a container from the cluster.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/local/docker/container.py
Container.start
def start(self, input_data=None): """ Calls Docker API to start the container. The container must be created at the first place to run. It waits for the container to complete, fetches both stdout and stderr logs and returns through the given streams. Parameters ---------...
python
def start(self, input_data=None): """ Calls Docker API to start the container. The container must be created at the first place to run. It waits for the container to complete, fetches both stdout and stderr logs and returns through the given streams. Parameters ---------...
[ "def", "start", "(", "self", ",", "input_data", "=", "None", ")", ":", "if", "input_data", ":", "raise", "ValueError", "(", "\"Passing input through container's stdin is not supported\"", ")", "if", "not", "self", ".", "is_created", "(", ")", ":", "raise", "Runt...
Calls Docker API to start the container. The container must be created at the first place to run. It waits for the container to complete, fetches both stdout and stderr logs and returns through the given streams. Parameters ---------- input_data Optional. Input data ...
[ "Calls", "Docker", "API", "to", "start", "the", "container", ".", "The", "container", "must", "be", "created", "at", "the", "first", "place", "to", "run", ".", "It", "waits", "for", "the", "container", "to", "complete", "fetches", "both", "stdout", "and", ...
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/local/docker/container.py#L165-L187
train
Starts the container.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/local/docker/container.py
Container._write_container_output
def _write_container_output(output_itr, stdout=None, stderr=None): """ Based on the data returned from the Container output, via the iterator, write it to the appropriate streams Parameters ---------- output_itr: Iterator Iterator returned by the Docker Attach comman...
python
def _write_container_output(output_itr, stdout=None, stderr=None): """ Based on the data returned from the Container output, via the iterator, write it to the appropriate streams Parameters ---------- output_itr: Iterator Iterator returned by the Docker Attach comman...
[ "def", "_write_container_output", "(", "output_itr", ",", "stdout", "=", "None", ",", "stderr", "=", "None", ")", ":", "# Iterator returns a tuple of (frame_type, data) where the frame type determines which stream we write output", "# to", "for", "frame_type", ",", "data", "i...
Based on the data returned from the Container output, via the iterator, write it to the appropriate streams Parameters ---------- output_itr: Iterator Iterator returned by the Docker Attach command stdout: samcli.lib.utils.stream_writer.StreamWriter, optional Str...
[ "Based", "on", "the", "data", "returned", "from", "the", "Container", "output", "via", "the", "iterator", "write", "it", "to", "the", "appropriate", "streams" ]
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/local/docker/container.py#L229-L258
train
Write the contents of the output_itr to the appropriate streams for the current container.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/commands/init/__init__.py
cli
def cli(ctx, location, runtime, dependency_manager, output_dir, name, no_input): """ \b Initialize a serverless application with a SAM template, folder structure for your Lambda functions, connected to an event source such as APIs, S3 Buckets or DynamoDB Tables. This application includes eve...
python
def cli(ctx, location, runtime, dependency_manager, output_dir, name, no_input): """ \b Initialize a serverless application with a SAM template, folder structure for your Lambda functions, connected to an event source such as APIs, S3 Buckets or DynamoDB Tables. This application includes eve...
[ "def", "cli", "(", "ctx", ",", "location", ",", "runtime", ",", "dependency_manager", ",", "output_dir", ",", "name", ",", "no_input", ")", ":", "# All logic must be implemented in the `do_cli` method. This helps ease unit tests", "do_cli", "(", "ctx", ",", "location", ...
\b Initialize a serverless application with a SAM template, folder structure for your Lambda functions, connected to an event source such as APIs, S3 Buckets or DynamoDB Tables. This application includes everything you need to get started with serverless and eventually grow into a produc...
[ "\\", "b", "Initialize", "a", "serverless", "application", "with", "a", "SAM", "template", "folder", "structure", "for", "your", "Lambda", "functions", "connected", "to", "an", "event", "source", "such", "as", "APIs", "S3", "Buckets", "or", "DynamoDB", "Tables...
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/commands/init/__init__.py#L30-L76
train
This command is used to initialize a serverless application with a custom template and a custom dependency manager.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/commands/init/__init__.py
do_cli
def do_cli(ctx, location, runtime, dependency_manager, output_dir, name, no_input): """ Implementation of the ``cli`` method, just separated out for unit testing purposes """ LOG.debug("Init command") click.secho("[+] Initializing project structure...", fg="green") no_build_msg = """ Project ge...
python
def do_cli(ctx, location, runtime, dependency_manager, output_dir, name, no_input): """ Implementation of the ``cli`` method, just separated out for unit testing purposes """ LOG.debug("Init command") click.secho("[+] Initializing project structure...", fg="green") no_build_msg = """ Project ge...
[ "def", "do_cli", "(", "ctx", ",", "location", ",", "runtime", ",", "dependency_manager", ",", "output_dir", ",", "name", ",", "no_input", ")", ":", "LOG", ".", "debug", "(", "\"Init command\"", ")", "click", ".", "secho", "(", "\"[+] Initializing project struc...
Implementation of the ``cli`` method, just separated out for unit testing purposes
[ "Implementation", "of", "the", "cli", "method", "just", "separated", "out", "for", "unit", "testing", "purposes" ]
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/commands/init/__init__.py#L79-L116
train
This method is used to initialize the structure of the current project.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/commands/build/command.py
do_cli
def do_cli(function_identifier, # pylint: disable=too-many-locals template, base_dir, build_dir, clean, use_container, manifest_path, docker_network, skip_pull_image, parameter_overrides, mode): """ Im...
python
def do_cli(function_identifier, # pylint: disable=too-many-locals template, base_dir, build_dir, clean, use_container, manifest_path, docker_network, skip_pull_image, parameter_overrides, mode): """ Im...
[ "def", "do_cli", "(", "function_identifier", ",", "# pylint: disable=too-many-locals", "template", ",", "base_dir", ",", "build_dir", ",", "clean", ",", "use_container", ",", "manifest_path", ",", "docker_network", ",", "skip_pull_image", ",", "parameter_overrides", ","...
Implementation of the ``cli`` method
[ "Implementation", "of", "the", "cli", "method" ]
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/commands/build/command.py#L106-L168
train
Implementation of the cli method
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/commands/local/lib/swagger/parser.py
SwaggerParser.get_apis
def get_apis(self): """ Parses a swagger document and returns a list of APIs configured in the document. Swagger documents have the following structure { "/path1": { # path "get": { # method "x-amazon-apigateway-integration": { # in...
python
def get_apis(self): """ Parses a swagger document and returns a list of APIs configured in the document. Swagger documents have the following structure { "/path1": { # path "get": { # method "x-amazon-apigateway-integration": { # in...
[ "def", "get_apis", "(", "self", ")", ":", "result", "=", "[", "]", "paths_dict", "=", "self", ".", "swagger", ".", "get", "(", "\"paths\"", ",", "{", "}", ")", "binary_media_types", "=", "self", ".", "get_binary_media_types", "(", ")", "for", "full_path"...
Parses a swagger document and returns a list of APIs configured in the document. Swagger documents have the following structure { "/path1": { # path "get": { # method "x-amazon-apigateway-integration": { # integration "type"...
[ "Parses", "a", "swagger", "document", "and", "returns", "a", "list", "of", "APIs", "configured", "in", "the", "document", "." ]
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/commands/local/lib/swagger/parser.py#L38-L92
train
Parses a Swagger document and returns a list of Api objects.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/commands/local/lib/swagger/parser.py
SwaggerParser._get_integration_function_name
def _get_integration_function_name(self, method_config): """ Tries to parse the Lambda Function name from the Integration defined in the method configuration. Integration configuration is defined under the special "x-amazon-apigateway-integration" key. We care only about Lambda integrati...
python
def _get_integration_function_name(self, method_config): """ Tries to parse the Lambda Function name from the Integration defined in the method configuration. Integration configuration is defined under the special "x-amazon-apigateway-integration" key. We care only about Lambda integrati...
[ "def", "_get_integration_function_name", "(", "self", ",", "method_config", ")", ":", "if", "not", "isinstance", "(", "method_config", ",", "dict", ")", "or", "self", ".", "_INTEGRATION_KEY", "not", "in", "method_config", ":", "return", "None", "integration", "=...
Tries to parse the Lambda Function name from the Integration defined in the method configuration. Integration configuration is defined under the special "x-amazon-apigateway-integration" key. We care only about Lambda integrations, which are of type aws_proxy, and ignore the rest. Integration URI is com...
[ "Tries", "to", "parse", "the", "Lambda", "Function", "name", "from", "the", "Integration", "defined", "in", "the", "method", "configuration", ".", "Integration", "configuration", "is", "defined", "under", "the", "special", "x", "-", "amazon", "-", "apigateway", ...
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/commands/local/lib/swagger/parser.py#L94-L121
train
Tries to parse the Lambda Function name from the Integration defined in the method configuration.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/commands/local/start_lambda/cli.py
do_cli
def do_cli(ctx, host, port, template, env_vars, debug_port, debug_args, # pylint: disable=R0914 debugger_path, docker_volume_basedir, docker_network, log_file, layer_cache_basedir, skip_pull_image, force_image_build, parameter_overrides): """ Implementation of the ``cli`` method, just sep...
python
def do_cli(ctx, host, port, template, env_vars, debug_port, debug_args, # pylint: disable=R0914 debugger_path, docker_volume_basedir, docker_network, log_file, layer_cache_basedir, skip_pull_image, force_image_build, parameter_overrides): """ Implementation of the ``cli`` method, just sep...
[ "def", "do_cli", "(", "ctx", ",", "host", ",", "port", ",", "template", ",", "env_vars", ",", "debug_port", ",", "debug_args", ",", "# pylint: disable=R0914", "debugger_path", ",", "docker_volume_basedir", ",", "docker_network", ",", "log_file", ",", "layer_cache_...
Implementation of the ``cli`` method, just separated out for unit testing purposes
[ "Implementation", "of", "the", "cli", "method", "just", "separated", "out", "for", "unit", "testing", "purposes" ]
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/commands/local/start_lambda/cli.py#L76-L113
train
This function is used to start a local lambda service.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/lib/logs/formatter.py
LogsFormatter.do_format
def do_format(self, event_iterable): """ Formats the given CloudWatch Logs Event dictionary as necessary and returns an iterable that will return the formatted string. This can be used to parse and format the events based on context ie. In Lambda Function logs, a formatter may wish to co...
python
def do_format(self, event_iterable): """ Formats the given CloudWatch Logs Event dictionary as necessary and returns an iterable that will return the formatted string. This can be used to parse and format the events based on context ie. In Lambda Function logs, a formatter may wish to co...
[ "def", "do_format", "(", "self", ",", "event_iterable", ")", ":", "for", "operation", "in", "self", ".", "formatter_chain", ":", "# Make sure the operation has access to certain basic objects like colored", "partial_op", "=", "functools", ".", "partial", "(", "operation",...
Formats the given CloudWatch Logs Event dictionary as necessary and returns an iterable that will return the formatted string. This can be used to parse and format the events based on context ie. In Lambda Function logs, a formatter may wish to color the "ERROR" keywords red, or highlight a filt...
[ "Formats", "the", "given", "CloudWatch", "Logs", "Event", "dictionary", "as", "necessary", "and", "returns", "an", "iterable", "that", "will", "return", "the", "formatted", "string", ".", "This", "can", "be", "used", "to", "parse", "and", "format", "the", "e...
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/lib/logs/formatter.py#L83-L111
train
Formats the given CloudWatch Logs Event dictionary as necessary and returns an iterable that will be formatted as a string.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/lib/logs/formatter.py
LogsFormatter._pretty_print_event
def _pretty_print_event(event, colored): """ Basic formatter to convert an event object to string """ event.timestamp = colored.yellow(event.timestamp) event.log_stream_name = colored.cyan(event.log_stream_name) return ' '.join([event.log_stream_name, event.timestamp, ev...
python
def _pretty_print_event(event, colored): """ Basic formatter to convert an event object to string """ event.timestamp = colored.yellow(event.timestamp) event.log_stream_name = colored.cyan(event.log_stream_name) return ' '.join([event.log_stream_name, event.timestamp, ev...
[ "def", "_pretty_print_event", "(", "event", ",", "colored", ")", ":", "event", ".", "timestamp", "=", "colored", ".", "yellow", "(", "event", ".", "timestamp", ")", "event", ".", "log_stream_name", "=", "colored", ".", "cyan", "(", "event", ".", "log_strea...
Basic formatter to convert an event object to string
[ "Basic", "formatter", "to", "convert", "an", "event", "object", "to", "string" ]
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/lib/logs/formatter.py#L114-L121
train
Pretty print an event object.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/lib/logs/formatter.py
LambdaLogMsgFormatters.colorize_errors
def colorize_errors(event, colored): """ Highlights some commonly known Lambda error cases in red: - Nodejs process crashes - Lambda function timeouts """ nodejs_crash_msg = "Process exited before completing request" timeout_msg = "Task timed out" ...
python
def colorize_errors(event, colored): """ Highlights some commonly known Lambda error cases in red: - Nodejs process crashes - Lambda function timeouts """ nodejs_crash_msg = "Process exited before completing request" timeout_msg = "Task timed out" ...
[ "def", "colorize_errors", "(", "event", ",", "colored", ")", ":", "nodejs_crash_msg", "=", "\"Process exited before completing request\"", "timeout_msg", "=", "\"Task timed out\"", "if", "nodejs_crash_msg", "in", "event", ".", "message", "or", "timeout_msg", "in", "even...
Highlights some commonly known Lambda error cases in red: - Nodejs process crashes - Lambda function timeouts
[ "Highlights", "some", "commonly", "known", "Lambda", "error", "cases", "in", "red", ":", "-", "Nodejs", "process", "crashes", "-", "Lambda", "function", "timeouts" ]
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/lib/logs/formatter.py#L132-L146
train
Highlights commonly known Lambda error cases in red
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/lib/logs/formatter.py
KeywordHighlighter.highlight_keywords
def highlight_keywords(self, event, colored): """ Highlight the keyword in the log statement by drawing an underline """ if self.keyword: highlight = colored.underline(self.keyword) event.message = event.message.replace(self.keyword, highlight) return eve...
python
def highlight_keywords(self, event, colored): """ Highlight the keyword in the log statement by drawing an underline """ if self.keyword: highlight = colored.underline(self.keyword) event.message = event.message.replace(self.keyword, highlight) return eve...
[ "def", "highlight_keywords", "(", "self", ",", "event", ",", "colored", ")", ":", "if", "self", ".", "keyword", ":", "highlight", "=", "colored", ".", "underline", "(", "self", ".", "keyword", ")", "event", ".", "message", "=", "event", ".", "message", ...
Highlight the keyword in the log statement by drawing an underline
[ "Highlight", "the", "keyword", "in", "the", "log", "statement", "by", "drawing", "an", "underline" ]
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/lib/logs/formatter.py#L157-L165
train
Highlight the keywords in the log statement by drawing an underline
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/lib/logs/formatter.py
JSONMsgFormatter.format_json
def format_json(event, colored): """ If the event message is a JSON string, then pretty print the JSON with 2 indents and sort the keys. This makes it very easy to visually parse and search JSON data """ try: if event.message.startswith("{"): msg_dict...
python
def format_json(event, colored): """ If the event message is a JSON string, then pretty print the JSON with 2 indents and sort the keys. This makes it very easy to visually parse and search JSON data """ try: if event.message.startswith("{"): msg_dict...
[ "def", "format_json", "(", "event", ",", "colored", ")", ":", "try", ":", "if", "event", ".", "message", ".", "startswith", "(", "\"{\"", ")", ":", "msg_dict", "=", "json", ".", "loads", "(", "event", ".", "message", ")", "event", ".", "message", "="...
If the event message is a JSON string, then pretty print the JSON with 2 indents and sort the keys. This makes it very easy to visually parse and search JSON data
[ "If", "the", "event", "message", "is", "a", "JSON", "string", "then", "pretty", "print", "the", "JSON", "with", "2", "indents", "and", "sort", "the", "keys", ".", "This", "makes", "it", "very", "easy", "to", "visually", "parse", "and", "search", "JSON", ...
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/lib/logs/formatter.py#L174-L188
train
Format the event message in JSON format.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/commands/_utils/template.py
get_template_data
def get_template_data(template_file): """ Read the template file, parse it as JSON/YAML and return the template as a dictionary. Parameters ---------- template_file : string Path to the template to read Returns ------- Template data as a dictionary """ if not pathlib.P...
python
def get_template_data(template_file): """ Read the template file, parse it as JSON/YAML and return the template as a dictionary. Parameters ---------- template_file : string Path to the template to read Returns ------- Template data as a dictionary """ if not pathlib.P...
[ "def", "get_template_data", "(", "template_file", ")", ":", "if", "not", "pathlib", ".", "Path", "(", "template_file", ")", ".", "exists", "(", ")", ":", "raise", "ValueError", "(", "\"Template file not found at {}\"", ".", "format", "(", "template_file", ")", ...
Read the template file, parse it as JSON/YAML and return the template as a dictionary. Parameters ---------- template_file : string Path to the template to read Returns ------- Template data as a dictionary
[ "Read", "the", "template", "file", "parse", "it", "as", "JSON", "/", "YAML", "and", "return", "the", "template", "as", "a", "dictionary", "." ]
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/commands/_utils/template.py#L36-L57
train
Read the template file parse it as JSON and return the template as a dictionary.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/commands/_utils/template.py
move_template
def move_template(src_template_path, dest_template_path, template_dict): """ Move the SAM/CloudFormation template from ``src_template_path`` to ``dest_template_path``. For convenience, this method accepts a dictionary of template data ``template_dict`` that will be writte...
python
def move_template(src_template_path, dest_template_path, template_dict): """ Move the SAM/CloudFormation template from ``src_template_path`` to ``dest_template_path``. For convenience, this method accepts a dictionary of template data ``template_dict`` that will be writte...
[ "def", "move_template", "(", "src_template_path", ",", "dest_template_path", ",", "template_dict", ")", ":", "original_root", "=", "os", ".", "path", ".", "dirname", "(", "src_template_path", ")", "new_root", "=", "os", ".", "path", ".", "dirname", "(", "dest_...
Move the SAM/CloudFormation template from ``src_template_path`` to ``dest_template_path``. For convenience, this method accepts a dictionary of template data ``template_dict`` that will be written to the destination instead of reading from the source file. SAM/CloudFormation template can contain certain pr...
[ "Move", "the", "SAM", "/", "CloudFormation", "template", "from", "src_template_path", "to", "dest_template_path", ".", "For", "convenience", "this", "method", "accepts", "a", "dictionary", "of", "template", "data", "template_dict", "that", "will", "be", "written", ...
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/commands/_utils/template.py#L60-L100
train
Move the SAM template from one location to another.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/commands/_utils/template.py
_update_relative_paths
def _update_relative_paths(template_dict, original_root, new_root): """ SAM/CloudFormation template can contain certain properties whose value is a relative path to a local file/folder. This path is usually relative to the template's location. If the tem...
python
def _update_relative_paths(template_dict, original_root, new_root): """ SAM/CloudFormation template can contain certain properties whose value is a relative path to a local file/folder. This path is usually relative to the template's location. If the tem...
[ "def", "_update_relative_paths", "(", "template_dict", ",", "original_root", ",", "new_root", ")", ":", "for", "resource_type", ",", "properties", "in", "template_dict", ".", "get", "(", "\"Metadata\"", ",", "{", "}", ")", ".", "items", "(", ")", ":", "if", ...
SAM/CloudFormation template can contain certain properties whose value is a relative path to a local file/folder. This path is usually relative to the template's location. If the template is being moved from original location ``original_root`` to new location ``new_root``, use this method to update these paths ...
[ "SAM", "/", "CloudFormation", "template", "can", "contain", "certain", "properties", "whose", "value", "is", "a", "relative", "path", "to", "a", "local", "file", "/", "folder", ".", "This", "path", "is", "usually", "relative", "to", "the", "template", "s", ...
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/commands/_utils/template.py#L103-L177
train
This method updates the properties of a SAM template with relative paths.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/commands/_utils/template.py
_update_aws_include_relative_path
def _update_aws_include_relative_path(template_dict, original_root, new_root): """ Update relative paths in "AWS::Include" directive. This directive can be present at any part of the template, and not just within resources. """ for key, val in template_dict.items(): if key == "Fn::Transform...
python
def _update_aws_include_relative_path(template_dict, original_root, new_root): """ Update relative paths in "AWS::Include" directive. This directive can be present at any part of the template, and not just within resources. """ for key, val in template_dict.items(): if key == "Fn::Transform...
[ "def", "_update_aws_include_relative_path", "(", "template_dict", ",", "original_root", ",", "new_root", ")", ":", "for", "key", ",", "val", "in", "template_dict", ".", "items", "(", ")", ":", "if", "key", "==", "\"Fn::Transform\"", ":", "if", "isinstance", "(...
Update relative paths in "AWS::Include" directive. This directive can be present at any part of the template, and not just within resources.
[ "Update", "relative", "paths", "in", "AWS", "::", "Include", "directive", ".", "This", "directive", "can", "be", "present", "at", "any", "part", "of", "the", "template", "and", "not", "just", "within", "resources", "." ]
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/commands/_utils/template.py#L180-L205
train
Update relative paths in AWS include directive.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/commands/_utils/template.py
_resolve_relative_to
def _resolve_relative_to(path, original_root, new_root): """ If the given ``path`` is a relative path, then assume it is relative to ``original_root``. This method will update the path to be resolve it relative to ``new_root`` and return. Examples ------- # Assume a file called template.txt...
python
def _resolve_relative_to(path, original_root, new_root): """ If the given ``path`` is a relative path, then assume it is relative to ``original_root``. This method will update the path to be resolve it relative to ``new_root`` and return. Examples ------- # Assume a file called template.txt...
[ "def", "_resolve_relative_to", "(", "path", ",", "original_root", ",", "new_root", ")", ":", "if", "not", "isinstance", "(", "path", ",", "six", ".", "string_types", ")", "or", "path", ".", "startswith", "(", "\"s3://\"", ")", "or", "os", ".", "path", "....
If the given ``path`` is a relative path, then assume it is relative to ``original_root``. This method will update the path to be resolve it relative to ``new_root`` and return. Examples ------- # Assume a file called template.txt at location /tmp/original/root/template.txt expressed as relative pa...
[ "If", "the", "given", "path", "is", "a", "relative", "path", "then", "assume", "it", "is", "relative", "to", "original_root", ".", "This", "method", "will", "update", "the", "path", "to", "be", "resolve", "it", "relative", "to", "new_root", "and", "return"...
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/commands/_utils/template.py#L208-L237
train
Resolves the given path relative to the given original_root and new_root.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/commands/local/lib/swagger/reader.py
parse_aws_include_transform
def parse_aws_include_transform(data): """ If the input data is an AWS::Include data, then parse and return the location of the included file. AWS::Include transform data usually has the following format: { "Fn::Transform": { "Name": "AWS::Include", "Parameters": { ...
python
def parse_aws_include_transform(data): """ If the input data is an AWS::Include data, then parse and return the location of the included file. AWS::Include transform data usually has the following format: { "Fn::Transform": { "Name": "AWS::Include", "Parameters": { ...
[ "def", "parse_aws_include_transform", "(", "data", ")", ":", "if", "not", "data", ":", "return", "if", "_FN_TRANSFORM", "not", "in", "data", ":", "return", "transform_data", "=", "data", "[", "_FN_TRANSFORM", "]", "name", "=", "transform_data", ".", "get", "...
If the input data is an AWS::Include data, then parse and return the location of the included file. AWS::Include transform data usually has the following format: { "Fn::Transform": { "Name": "AWS::Include", "Parameters": { "Location": "s3://MyAmazonS3BucketName/s...
[ "If", "the", "input", "data", "is", "an", "AWS", "::", "Include", "data", "then", "parse", "and", "return", "the", "location", "of", "the", "included", "file", "." ]
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/commands/local/lib/swagger/reader.py#L20-L57
train
Parse AWS :: Include transform data and return the location of the included file.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/commands/local/lib/swagger/reader.py
SamSwaggerReader.read
def read(self): """ Gets the Swagger document from either of the given locations. If we fail to retrieve or parse the Swagger file, this method will return None. Returns ------- dict: Swagger document. None, if we cannot retrieve the document """ ...
python
def read(self): """ Gets the Swagger document from either of the given locations. If we fail to retrieve or parse the Swagger file, this method will return None. Returns ------- dict: Swagger document. None, if we cannot retrieve the document """ ...
[ "def", "read", "(", "self", ")", ":", "swagger", "=", "None", "# First check if there is inline swagger", "if", "self", ".", "definition_body", ":", "swagger", "=", "self", ".", "_read_from_definition_body", "(", ")", "if", "not", "swagger", "and", "self", ".", ...
Gets the Swagger document from either of the given locations. If we fail to retrieve or parse the Swagger file, this method will return None. Returns ------- dict: Swagger document. None, if we cannot retrieve the document
[ "Gets", "the", "Swagger", "document", "from", "either", "of", "the", "given", "locations", ".", "If", "we", "fail", "to", "retrieve", "or", "parse", "the", "Swagger", "file", "this", "method", "will", "return", "None", "." ]
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/commands/local/lib/swagger/reader.py#L92-L113
train
Reads the Swagger document from either the given locations or downloads it from the given URI.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/commands/local/lib/swagger/reader.py
SamSwaggerReader._read_from_definition_body
def _read_from_definition_body(self): """ Read the Swagger document from DefinitionBody. It could either be an inline Swagger dictionary or an AWS::Include macro that contains location of the included Swagger. In the later case, we will download and parse the Swagger document. R...
python
def _read_from_definition_body(self): """ Read the Swagger document from DefinitionBody. It could either be an inline Swagger dictionary or an AWS::Include macro that contains location of the included Swagger. In the later case, we will download and parse the Swagger document. R...
[ "def", "_read_from_definition_body", "(", "self", ")", ":", "# Let's try to parse it as AWS::Include Transform first. If not, then fall back to assuming the Swagger document", "# was inclined directly into the body", "location", "=", "parse_aws_include_transform", "(", "self", ".", "defi...
Read the Swagger document from DefinitionBody. It could either be an inline Swagger dictionary or an AWS::Include macro that contains location of the included Swagger. In the later case, we will download and parse the Swagger document. Returns ------- dict Swagger do...
[ "Read", "the", "Swagger", "document", "from", "DefinitionBody", ".", "It", "could", "either", "be", "an", "inline", "Swagger", "dictionary", "or", "an", "AWS", "::", "Include", "macro", "that", "contains", "location", "of", "the", "included", "Swagger", ".", ...
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/commands/local/lib/swagger/reader.py#L115-L136
train
Read the Swagger document from the DefinitionBody.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/commands/local/lib/swagger/reader.py
SamSwaggerReader._download_swagger
def _download_swagger(self, location): """ Download the file from given local or remote location and return it Parameters ---------- location : str or dict Local path or S3 path to Swagger file to download. Consult the ``__init__.py`` documentation for specifics ...
python
def _download_swagger(self, location): """ Download the file from given local or remote location and return it Parameters ---------- location : str or dict Local path or S3 path to Swagger file to download. Consult the ``__init__.py`` documentation for specifics ...
[ "def", "_download_swagger", "(", "self", ",", "location", ")", ":", "if", "not", "location", ":", "return", "bucket", ",", "key", ",", "version", "=", "self", ".", "_parse_s3_location", "(", "location", ")", "if", "bucket", "and", "key", ":", "LOG", ".",...
Download the file from given local or remote location and return it Parameters ---------- location : str or dict Local path or S3 path to Swagger file to download. Consult the ``__init__.py`` documentation for specifics on structure of this property. Returns ...
[ "Download", "the", "file", "from", "given", "local", "or", "remote", "location", "and", "return", "it" ]
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/commands/local/lib/swagger/reader.py#L138-L180
train
Download the file from given location and return it as a dict.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/commands/local/lib/swagger/reader.py
SamSwaggerReader._download_from_s3
def _download_from_s3(bucket, key, version=None): """ Download a file from given S3 location, if available. Parameters ---------- bucket : str S3 Bucket name key : str S3 Bucket Key aka file path version : str Optional Versio...
python
def _download_from_s3(bucket, key, version=None): """ Download a file from given S3 location, if available. Parameters ---------- bucket : str S3 Bucket name key : str S3 Bucket Key aka file path version : str Optional Versio...
[ "def", "_download_from_s3", "(", "bucket", ",", "key", ",", "version", "=", "None", ")", ":", "s3", "=", "boto3", ".", "client", "(", "'s3'", ")", "extra_args", "=", "{", "}", "if", "version", ":", "extra_args", "[", "\"VersionId\"", "]", "=", "version...
Download a file from given S3 location, if available. Parameters ---------- bucket : str S3 Bucket name key : str S3 Bucket Key aka file path version : str Optional Version ID of the file Returns ------- str ...
[ "Download", "a", "file", "from", "given", "S3", "location", "if", "available", "." ]
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/commands/local/lib/swagger/reader.py#L183-L229
train
Download a file from S3 location if available.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/commands/local/lib/swagger/reader.py
SamSwaggerReader._parse_s3_location
def _parse_s3_location(location): """ Parses the given location input as a S3 Location and returns the file's bucket, key and version as separate values. Input can be in two different formats: 1. Dictionary with ``Bucket``, ``Key``, ``Version`` keys 2. String of S3 URI in format...
python
def _parse_s3_location(location): """ Parses the given location input as a S3 Location and returns the file's bucket, key and version as separate values. Input can be in two different formats: 1. Dictionary with ``Bucket``, ``Key``, ``Version`` keys 2. String of S3 URI in format...
[ "def", "_parse_s3_location", "(", "location", ")", ":", "bucket", ",", "key", ",", "version", "=", "None", ",", "None", ",", "None", "if", "isinstance", "(", "location", ",", "dict", ")", ":", "# This is a S3 Location dictionary. Just grab the fields. It is very wel...
Parses the given location input as a S3 Location and returns the file's bucket, key and version as separate values. Input can be in two different formats: 1. Dictionary with ``Bucket``, ``Key``, ``Version`` keys 2. String of S3 URI in format ``s3://<bucket>/<key>?versionId=<version>`` ...
[ "Parses", "the", "given", "location", "input", "as", "a", "S3", "Location", "and", "returns", "the", "file", "s", "bucket", "key", "and", "version", "as", "separate", "values", ".", "Input", "can", "be", "in", "two", "different", "formats", ":" ]
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/commands/local/lib/swagger/reader.py#L232-L282
train
Parses the given location and returns the bucket key and version as separate values.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/cli/context.py
Context.debug
def debug(self, value): """ Turn on debug logging if necessary. :param value: Value of debug flag """ self._debug = value if self._debug: # Turn on debug logging logging.getLogger().setLevel(logging.DEBUG)
python
def debug(self, value): """ Turn on debug logging if necessary. :param value: Value of debug flag """ self._debug = value if self._debug: # Turn on debug logging logging.getLogger().setLevel(logging.DEBUG)
[ "def", "debug", "(", "self", ",", "value", ")", ":", "self", ".", "_debug", "=", "value", "if", "self", ".", "_debug", ":", "# Turn on debug logging", "logging", ".", "getLogger", "(", ")", ".", "setLevel", "(", "logging", ".", "DEBUG", ")" ]
Turn on debug logging if necessary. :param value: Value of debug flag
[ "Turn", "on", "debug", "logging", "if", "necessary", "." ]
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/cli/context.py#L35-L45
train
Turn on debug logging if necessary.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/cli/context.py
Context._refresh_session
def _refresh_session(self): """ Update boto3's default session by creating a new session based on values set in the context. Some properties of the Boto3's session object are read-only. Therefore when Click parses new AWS session related properties (like region & profile), it will call t...
python
def _refresh_session(self): """ Update boto3's default session by creating a new session based on values set in the context. Some properties of the Boto3's session object are read-only. Therefore when Click parses new AWS session related properties (like region & profile), it will call t...
[ "def", "_refresh_session", "(", "self", ")", ":", "boto3", ".", "setup_default_session", "(", "region_name", "=", "self", ".", "_aws_region", ",", "profile_name", "=", "self", ".", "_aws_profile", ")" ]
Update boto3's default session by creating a new session based on values set in the context. Some properties of the Boto3's session object are read-only. Therefore when Click parses new AWS session related properties (like region & profile), it will call this method to create a new session with latest v...
[ "Update", "boto3", "s", "default", "session", "by", "creating", "a", "new", "session", "based", "on", "values", "set", "in", "the", "context", ".", "Some", "properties", "of", "the", "Boto3", "s", "session", "object", "are", "read", "-", "only", ".", "Th...
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/cli/context.py#L71-L78
train
Refresh the default session based on the current context.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/local/init/__init__.py
generate_project
def generate_project( location=None, runtime="nodejs", dependency_manager=None, output_dir=".", name='sam-sample-app', no_input=False): """Generates project using cookiecutter and options given Generate project scaffolds a project using default templates if user doesn't provide one via loca...
python
def generate_project( location=None, runtime="nodejs", dependency_manager=None, output_dir=".", name='sam-sample-app', no_input=False): """Generates project using cookiecutter and options given Generate project scaffolds a project using default templates if user doesn't provide one via loca...
[ "def", "generate_project", "(", "location", "=", "None", ",", "runtime", "=", "\"nodejs\"", ",", "dependency_manager", "=", "None", ",", "output_dir", "=", "\".\"", ",", "name", "=", "'sam-sample-app'", ",", "no_input", "=", "False", ")", ":", "template", "=...
Generates project using cookiecutter and options given Generate project scaffolds a project using default templates if user doesn't provide one via location parameter. Default templates are automatically chosen depending on runtime given by the user. Parameters ---------- location: Path, optio...
[ "Generates", "project", "using", "cookiecutter", "and", "options", "given" ]
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/local/init/__init__.py#L16-L83
train
Generates a project from a cookiecutter template and optional options.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/lib/utils/time.py
to_utc
def to_utc(some_time): """ Convert the given date to UTC, if the date contains a timezone. Parameters ---------- some_time : datetime.datetime datetime object to convert to UTC Returns ------- datetime.datetime Converted datetime object """ # Convert timezone a...
python
def to_utc(some_time): """ Convert the given date to UTC, if the date contains a timezone. Parameters ---------- some_time : datetime.datetime datetime object to convert to UTC Returns ------- datetime.datetime Converted datetime object """ # Convert timezone a...
[ "def", "to_utc", "(", "some_time", ")", ":", "# Convert timezone aware objects to UTC", "if", "some_time", ".", "tzinfo", "and", "some_time", ".", "utcoffset", "(", ")", ":", "some_time", "=", "some_time", ".", "astimezone", "(", "tzutc", "(", ")", ")", "# Now...
Convert the given date to UTC, if the date contains a timezone. Parameters ---------- some_time : datetime.datetime datetime object to convert to UTC Returns ------- datetime.datetime Converted datetime object
[ "Convert", "the", "given", "date", "to", "UTC", "if", "the", "date", "contains", "a", "timezone", "." ]
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/lib/utils/time.py#L68-L88
train
Convert the given date to UTC
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/lib/utils/time.py
parse_date
def parse_date(date_string): """ Parse the given string as datetime object. This parser supports in almost any string formats. For relative times, like `10min ago`, this parser computes the actual time relative to current UTC time. This allows time to always be in UTC if an explicit time zone is not pr...
python
def parse_date(date_string): """ Parse the given string as datetime object. This parser supports in almost any string formats. For relative times, like `10min ago`, this parser computes the actual time relative to current UTC time. This allows time to always be in UTC if an explicit time zone is not pr...
[ "def", "parse_date", "(", "date_string", ")", ":", "parser_settings", "=", "{", "# Relative times like '10m ago' must subtract from the current UTC time. Without this setting, dateparser", "# will use current local time as the base for subtraction, but falsely assume it is a UTC time. Therefore"...
Parse the given string as datetime object. This parser supports in almost any string formats. For relative times, like `10min ago`, this parser computes the actual time relative to current UTC time. This allows time to always be in UTC if an explicit time zone is not provided. Parameters ---------- ...
[ "Parse", "the", "given", "string", "as", "datetime", "object", ".", "This", "parser", "supports", "in", "almost", "any", "string", "formats", "." ]
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/lib/utils/time.py#L91-L117
train
Parses a date string into a datetime object.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/commands/local/cli_common/invoke_context.py
InvokeContext.function_name
def function_name(self): """ Returns name of the function to invoke. If no function identifier is provided, this method will return name of the only function from the template :return string: Name of the function :raises InvokeContextException: If function identifier is not prov...
python
def function_name(self): """ Returns name of the function to invoke. If no function identifier is provided, this method will return name of the only function from the template :return string: Name of the function :raises InvokeContextException: If function identifier is not prov...
[ "def", "function_name", "(", "self", ")", ":", "if", "self", ".", "_function_identifier", ":", "return", "self", ".", "_function_identifier", "# Function Identifier is *not* provided. If there is only one function in the template,", "# default to it.", "all_functions", "=", "["...
Returns name of the function to invoke. If no function identifier is provided, this method will return name of the only function from the template :return string: Name of the function :raises InvokeContextException: If function identifier is not provided
[ "Returns", "name", "of", "the", "function", "to", "invoke", ".", "If", "no", "function", "identifier", "is", "provided", "this", "method", "will", "return", "name", "of", "the", "only", "function", "from", "the", "template" ]
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/commands/local/cli_common/invoke_context.py#L157-L180
train
Returns the name of the function in the template.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/commands/local/cli_common/invoke_context.py
InvokeContext.local_lambda_runner
def local_lambda_runner(self): """ Returns an instance of the runner capable of running Lambda functions locally :return samcli.commands.local.lib.local_lambda.LocalLambdaRunner: Runner configured to run Lambda functions locally """ layer_downloader = LayerDownloade...
python
def local_lambda_runner(self): """ Returns an instance of the runner capable of running Lambda functions locally :return samcli.commands.local.lib.local_lambda.LocalLambdaRunner: Runner configured to run Lambda functions locally """ layer_downloader = LayerDownloade...
[ "def", "local_lambda_runner", "(", "self", ")", ":", "layer_downloader", "=", "LayerDownloader", "(", "self", ".", "_layer_cache_basedir", ",", "self", ".", "get_cwd", "(", ")", ")", "image_builder", "=", "LambdaImage", "(", "layer_downloader", ",", "self", ".",...
Returns an instance of the runner capable of running Lambda functions locally :return samcli.commands.local.lib.local_lambda.LocalLambdaRunner: Runner configured to run Lambda functions locally
[ "Returns", "an", "instance", "of", "the", "runner", "capable", "of", "running", "Lambda", "functions", "locally" ]
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/commands/local/cli_common/invoke_context.py#L183-L201
train
Returns an instance of the local Lambda runner capable of running Lambda functions locally
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/commands/local/cli_common/invoke_context.py
InvokeContext.stdout
def stdout(self): """ Returns stream writer for stdout to output Lambda function logs to Returns ------- samcli.lib.utils.stream_writer.StreamWriter Stream writer for stdout """ stream = self._log_file_handle if self._log_file_handle else osutils.stdo...
python
def stdout(self): """ Returns stream writer for stdout to output Lambda function logs to Returns ------- samcli.lib.utils.stream_writer.StreamWriter Stream writer for stdout """ stream = self._log_file_handle if self._log_file_handle else osutils.stdo...
[ "def", "stdout", "(", "self", ")", ":", "stream", "=", "self", ".", "_log_file_handle", "if", "self", ".", "_log_file_handle", "else", "osutils", ".", "stdout", "(", ")", "return", "StreamWriter", "(", "stream", ",", "self", ".", "_is_debugging", ")" ]
Returns stream writer for stdout to output Lambda function logs to Returns ------- samcli.lib.utils.stream_writer.StreamWriter Stream writer for stdout
[ "Returns", "stream", "writer", "for", "stdout", "to", "output", "Lambda", "function", "logs", "to" ]
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/commands/local/cli_common/invoke_context.py#L204-L214
train
Returns a stream writer for stdout to output Lambda function logs toUniversalLog
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/commands/local/cli_common/invoke_context.py
InvokeContext.stderr
def stderr(self): """ Returns stream writer for stderr to output Lambda function errors to Returns ------- samcli.lib.utils.stream_writer.StreamWriter Stream writer for stderr """ stream = self._log_file_handle if self._log_file_handle else osutils.st...
python
def stderr(self): """ Returns stream writer for stderr to output Lambda function errors to Returns ------- samcli.lib.utils.stream_writer.StreamWriter Stream writer for stderr """ stream = self._log_file_handle if self._log_file_handle else osutils.st...
[ "def", "stderr", "(", "self", ")", ":", "stream", "=", "self", ".", "_log_file_handle", "if", "self", ".", "_log_file_handle", "else", "osutils", ".", "stderr", "(", ")", "return", "StreamWriter", "(", "stream", ",", "self", ".", "_is_debugging", ")" ]
Returns stream writer for stderr to output Lambda function errors to Returns ------- samcli.lib.utils.stream_writer.StreamWriter Stream writer for stderr
[ "Returns", "stream", "writer", "for", "stderr", "to", "output", "Lambda", "function", "errors", "to" ]
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/commands/local/cli_common/invoke_context.py#L217-L227
train
Returns a stream writer for stderr to output Lambda function errors to the Lambda function errors to the Lambda function errors to
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/commands/local/cli_common/invoke_context.py
InvokeContext.get_cwd
def get_cwd(self): """ Get the working directory. This is usually relative to the directory that contains the template. If a Docker volume location is specified, it takes preference All Lambda function code paths are resolved relative to this working directory :return string: W...
python
def get_cwd(self): """ Get the working directory. This is usually relative to the directory that contains the template. If a Docker volume location is specified, it takes preference All Lambda function code paths are resolved relative to this working directory :return string: W...
[ "def", "get_cwd", "(", "self", ")", ":", "cwd", "=", "os", ".", "path", ".", "dirname", "(", "os", ".", "path", ".", "abspath", "(", "self", ".", "_template_file", ")", ")", "if", "self", ".", "_docker_volume_basedir", ":", "cwd", "=", "self", ".", ...
Get the working directory. This is usually relative to the directory that contains the template. If a Docker volume location is specified, it takes preference All Lambda function code paths are resolved relative to this working directory :return string: Working directory
[ "Get", "the", "working", "directory", ".", "This", "is", "usually", "relative", "to", "the", "directory", "that", "contains", "the", "template", ".", "If", "a", "Docker", "volume", "location", "is", "specified", "it", "takes", "preference" ]
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/commands/local/cli_common/invoke_context.py#L238-L252
train
Get the working directory for the Docker image.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/commands/local/cli_common/invoke_context.py
InvokeContext._get_env_vars_value
def _get_env_vars_value(filename): """ If the user provided a file containing values of environment variables, this method will read the file and return its value :param string filename: Path to file containing environment variable values :return dict: Value of environment varia...
python
def _get_env_vars_value(filename): """ If the user provided a file containing values of environment variables, this method will read the file and return its value :param string filename: Path to file containing environment variable values :return dict: Value of environment varia...
[ "def", "_get_env_vars_value", "(", "filename", ")", ":", "if", "not", "filename", ":", "return", "None", "# Try to read the file and parse it as JSON", "try", ":", "with", "open", "(", "filename", ",", "'r'", ")", "as", "fp", ":", "return", "json", ".", "load"...
If the user provided a file containing values of environment variables, this method will read the file and return its value :param string filename: Path to file containing environment variable values :return dict: Value of environment variables, if provided. None otherwise :raises Invok...
[ "If", "the", "user", "provided", "a", "file", "containing", "values", "of", "environment", "variables", "this", "method", "will", "read", "the", "file", "and", "return", "its", "value" ]
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/commands/local/cli_common/invoke_context.py#L282-L303
train
Reads the file containing values of environment variables and returns the value of that environment variable.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/commands/local/cli_common/invoke_context.py
InvokeContext._get_debug_context
def _get_debug_context(debug_port, debug_args, debugger_path): """ Creates a DebugContext if the InvokeContext is in a debugging mode Parameters ---------- debug_port int Port to bind the debugger to debug_args str Additional arguments passed to ...
python
def _get_debug_context(debug_port, debug_args, debugger_path): """ Creates a DebugContext if the InvokeContext is in a debugging mode Parameters ---------- debug_port int Port to bind the debugger to debug_args str Additional arguments passed to ...
[ "def", "_get_debug_context", "(", "debug_port", ",", "debug_args", ",", "debugger_path", ")", ":", "if", "debug_port", "and", "debugger_path", ":", "try", ":", "debugger", "=", "Path", "(", "debugger_path", ")", ".", "resolve", "(", "strict", "=", "True", ")...
Creates a DebugContext if the InvokeContext is in a debugging mode Parameters ---------- debug_port int Port to bind the debugger to debug_args str Additional arguments passed to the debugger debugger_path str Path to the directory of the deb...
[ "Creates", "a", "DebugContext", "if", "the", "InvokeContext", "is", "in", "a", "debugging", "mode" ]
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/commands/local/cli_common/invoke_context.py#L319-L356
train
Returns a DebugContext object if the InvokeContext is in debugging mode.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/local/docker/attach_api.py
_read_socket
def _read_socket(socket): """ The stdout and stderr data from the container multiplexed into one stream of response from the Docker API. It follows the protocol described here https://docs.docker.com/engine/api/v1.30/#operation/ContainerAttach. The stream starts with a 8 byte header that contains the fr...
python
def _read_socket(socket): """ The stdout and stderr data from the container multiplexed into one stream of response from the Docker API. It follows the protocol described here https://docs.docker.com/engine/api/v1.30/#operation/ContainerAttach. The stream starts with a 8 byte header that contains the fr...
[ "def", "_read_socket", "(", "socket", ")", ":", "# Keep reading the stream until the stream terminates", "while", "True", ":", "try", ":", "payload_type", ",", "payload_size", "=", "_read_header", "(", "socket", ")", "if", "payload_size", "<", "0", ":", "# Something...
The stdout and stderr data from the container multiplexed into one stream of response from the Docker API. It follows the protocol described here https://docs.docker.com/engine/api/v1.30/#operation/ContainerAttach. The stream starts with a 8 byte header that contains the frame type and also payload size. Follwi...
[ "The", "stdout", "and", "stderr", "data", "from", "the", "container", "multiplexed", "into", "one", "stream", "of", "response", "from", "the", "Docker", "API", ".", "It", "follows", "the", "protocol", "described", "here", "https", ":", "//", "docs", ".", "...
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/local/docker/attach_api.py#L69-L116
train
Reads a socket and yields the appropriate types and data.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/local/docker/attach_api.py
_read_payload
def _read_payload(socket, payload_size): """ From the given socket, reads and yields payload of the given size. With sockets, we don't receive all data at once. Therefore this method will yield each time we read some data from the socket until the payload_size has reached or socket has no more data. ...
python
def _read_payload(socket, payload_size): """ From the given socket, reads and yields payload of the given size. With sockets, we don't receive all data at once. Therefore this method will yield each time we read some data from the socket until the payload_size has reached or socket has no more data. ...
[ "def", "_read_payload", "(", "socket", ",", "payload_size", ")", ":", "remaining", "=", "payload_size", "while", "remaining", ">", "0", ":", "# Try and read as much as possible", "data", "=", "read", "(", "socket", ",", "remaining", ")", "if", "data", "is", "N...
From the given socket, reads and yields payload of the given size. With sockets, we don't receive all data at once. Therefore this method will yield each time we read some data from the socket until the payload_size has reached or socket has no more data. Parameters ---------- socket Socket...
[ "From", "the", "given", "socket", "reads", "and", "yields", "payload", "of", "the", "given", "size", ".", "With", "sockets", "we", "don", "t", "receive", "all", "data", "at", "once", ".", "Therefore", "this", "method", "will", "yield", "each", "time", "w...
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/local/docker/attach_api.py#L119-L155
train
Reads and yields the given size from the given socket.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/cli/options.py
debug_option
def debug_option(f): """ Configures --debug option for CLI :param f: Callback Function to be passed to Click """ def callback(ctx, param, value): state = ctx.ensure_object(Context) state.debug = value return value return click.option('--debug', e...
python
def debug_option(f): """ Configures --debug option for CLI :param f: Callback Function to be passed to Click """ def callback(ctx, param, value): state = ctx.ensure_object(Context) state.debug = value return value return click.option('--debug', e...
[ "def", "debug_option", "(", "f", ")", ":", "def", "callback", "(", "ctx", ",", "param", ",", "value", ")", ":", "state", "=", "ctx", ".", "ensure_object", "(", "Context", ")", "state", ".", "debug", "=", "value", "return", "value", "return", "click", ...
Configures --debug option for CLI :param f: Callback Function to be passed to Click
[ "Configures", "--", "debug", "option", "for", "CLI" ]
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/cli/options.py#L11-L27
train
Configures the debug option for CLI
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/cli/options.py
region_option
def region_option(f): """ Configures --region option for CLI :param f: Callback Function to be passed to Click """ def callback(ctx, param, value): state = ctx.ensure_object(Context) state.region = value return value return click.option('--region', ...
python
def region_option(f): """ Configures --region option for CLI :param f: Callback Function to be passed to Click """ def callback(ctx, param, value): state = ctx.ensure_object(Context) state.region = value return value return click.option('--region', ...
[ "def", "region_option", "(", "f", ")", ":", "def", "callback", "(", "ctx", ",", "param", ",", "value", ")", ":", "state", "=", "ctx", ".", "ensure_object", "(", "Context", ")", "state", ".", "region", "=", "value", "return", "value", "return", "click",...
Configures --region option for CLI :param f: Callback Function to be passed to Click
[ "Configures", "--", "region", "option", "for", "CLI" ]
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/cli/options.py#L30-L44
train
Configures the -- region option for CLI
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/cli/options.py
profile_option
def profile_option(f): """ Configures --profile option for CLI :param f: Callback Function to be passed to Click """ def callback(ctx, param, value): state = ctx.ensure_object(Context) state.profile = value return value return click.option('--profile', ...
python
def profile_option(f): """ Configures --profile option for CLI :param f: Callback Function to be passed to Click """ def callback(ctx, param, value): state = ctx.ensure_object(Context) state.profile = value return value return click.option('--profile', ...
[ "def", "profile_option", "(", "f", ")", ":", "def", "callback", "(", "ctx", ",", "param", ",", "value", ")", ":", "state", "=", "ctx", ".", "ensure_object", "(", "Context", ")", "state", ".", "profile", "=", "value", "return", "value", "return", "click...
Configures --profile option for CLI :param f: Callback Function to be passed to Click
[ "Configures", "--", "profile", "option", "for", "CLI" ]
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/cli/options.py#L47-L61
train
Configures the -- profile option for CLI
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/local/lambda_service/lambda_error_responses.py
LambdaErrorResponses.resource_not_found
def resource_not_found(function_name): """ Creates a Lambda Service ResourceNotFound Response Parameters ---------- function_name str Name of the function that was requested to invoke Returns ------- Flask.Response A response obje...
python
def resource_not_found(function_name): """ Creates a Lambda Service ResourceNotFound Response Parameters ---------- function_name str Name of the function that was requested to invoke Returns ------- Flask.Response A response obje...
[ "def", "resource_not_found", "(", "function_name", ")", ":", "exception_tuple", "=", "LambdaErrorResponses", ".", "ResourceNotFoundException", "return", "BaseLocalService", ".", "service_response", "(", "LambdaErrorResponses", ".", "_construct_error_response_body", "(", "Lamb...
Creates a Lambda Service ResourceNotFound Response Parameters ---------- function_name str Name of the function that was requested to invoke Returns ------- Flask.Response A response object representing the ResourceNotFound Error
[ "Creates", "a", "Lambda", "Service", "ResourceNotFound", "Response" ]
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/local/lambda_service/lambda_error_responses.py#L39-L62
train
Creates a Lambda Service ResourceNotFound Response object representing the Lambda Service ResourceNotFound exception
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/local/lambda_service/lambda_error_responses.py
LambdaErrorResponses.invalid_request_content
def invalid_request_content(message): """ Creates a Lambda Service InvalidRequestContent Response Parameters ---------- message str Message to be added to the body of the response Returns ------- Flask.Response A response object r...
python
def invalid_request_content(message): """ Creates a Lambda Service InvalidRequestContent Response Parameters ---------- message str Message to be added to the body of the response Returns ------- Flask.Response A response object r...
[ "def", "invalid_request_content", "(", "message", ")", ":", "exception_tuple", "=", "LambdaErrorResponses", ".", "InvalidRequestContentException", "return", "BaseLocalService", ".", "service_response", "(", "LambdaErrorResponses", ".", "_construct_error_response_body", "(", "...
Creates a Lambda Service InvalidRequestContent Response Parameters ---------- message str Message to be added to the body of the response Returns ------- Flask.Response A response object representing the InvalidRequestContent Error
[ "Creates", "a", "Lambda", "Service", "InvalidRequestContent", "Response" ]
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/local/lambda_service/lambda_error_responses.py#L65-L85
train
Creates a Lambda Service InvalidRequestContent Response object representing the InvalidRequestContent exception.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/local/lambda_service/lambda_error_responses.py
LambdaErrorResponses.unsupported_media_type
def unsupported_media_type(content_type): """ Creates a Lambda Service UnsupportedMediaType Response Parameters ---------- content_type str Content Type of the request that was made Returns ------- Flask.Response A response object...
python
def unsupported_media_type(content_type): """ Creates a Lambda Service UnsupportedMediaType Response Parameters ---------- content_type str Content Type of the request that was made Returns ------- Flask.Response A response object...
[ "def", "unsupported_media_type", "(", "content_type", ")", ":", "exception_tuple", "=", "LambdaErrorResponses", ".", "UnsupportedMediaTypeException", "return", "BaseLocalService", ".", "service_response", "(", "LambdaErrorResponses", ".", "_construct_error_response_body", "(", ...
Creates a Lambda Service UnsupportedMediaType Response Parameters ---------- content_type str Content Type of the request that was made Returns ------- Flask.Response A response object representing the UnsupportedMediaType Error
[ "Creates", "a", "Lambda", "Service", "UnsupportedMediaType", "Response" ]
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/local/lambda_service/lambda_error_responses.py#L88-L109
train
Creates a Lambda Service UnsupportedMediaType Response object representing the UnsupportedMediaType exception.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/local/lambda_service/lambda_error_responses.py
LambdaErrorResponses.generic_service_exception
def generic_service_exception(*args): """ Creates a Lambda Service Generic ServiceException Response Parameters ---------- args list List of arguments Flask passes to the method Returns ------- Flask.Response A response object rep...
python
def generic_service_exception(*args): """ Creates a Lambda Service Generic ServiceException Response Parameters ---------- args list List of arguments Flask passes to the method Returns ------- Flask.Response A response object rep...
[ "def", "generic_service_exception", "(", "*", "args", ")", ":", "exception_tuple", "=", "LambdaErrorResponses", ".", "ServiceException", "return", "BaseLocalService", ".", "service_response", "(", "LambdaErrorResponses", ".", "_construct_error_response_body", "(", "LambdaEr...
Creates a Lambda Service Generic ServiceException Response Parameters ---------- args list List of arguments Flask passes to the method Returns ------- Flask.Response A response object representing the GenericServiceException Error
[ "Creates", "a", "Lambda", "Service", "Generic", "ServiceException", "Response" ]
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/local/lambda_service/lambda_error_responses.py#L112-L132
train
Creates a Lambda Service Generic ServiceException Response containing the exception message and a set of attributes that are not set.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/local/lambda_service/lambda_error_responses.py
LambdaErrorResponses.generic_path_not_found
def generic_path_not_found(*args): """ Creates a Lambda Service Generic PathNotFound Response Parameters ---------- args list List of arguments Flask passes to the method Returns ------- Flask.Response A response object representi...
python
def generic_path_not_found(*args): """ Creates a Lambda Service Generic PathNotFound Response Parameters ---------- args list List of arguments Flask passes to the method Returns ------- Flask.Response A response object representi...
[ "def", "generic_path_not_found", "(", "*", "args", ")", ":", "exception_tuple", "=", "LambdaErrorResponses", ".", "PathNotFoundException", "return", "BaseLocalService", ".", "service_response", "(", "LambdaErrorResponses", ".", "_construct_error_response_body", "(", "Lambda...
Creates a Lambda Service Generic PathNotFound Response Parameters ---------- args list List of arguments Flask passes to the method Returns ------- Flask.Response A response object representing the GenericPathNotFound Error
[ "Creates", "a", "Lambda", "Service", "Generic", "PathNotFound", "Response" ]
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/local/lambda_service/lambda_error_responses.py#L158-L179
train
Creates a Lambda Service Generic PathNotFound Response object representing the PathNotFound exception.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/local/lambda_service/lambda_error_responses.py
LambdaErrorResponses.generic_method_not_allowed
def generic_method_not_allowed(*args): """ Creates a Lambda Service Generic MethodNotAllowed Response Parameters ---------- args list List of arguments Flask passes to the method Returns ------- Flask.Response A response object re...
python
def generic_method_not_allowed(*args): """ Creates a Lambda Service Generic MethodNotAllowed Response Parameters ---------- args list List of arguments Flask passes to the method Returns ------- Flask.Response A response object re...
[ "def", "generic_method_not_allowed", "(", "*", "args", ")", ":", "exception_tuple", "=", "LambdaErrorResponses", ".", "MethodNotAllowedException", "return", "BaseLocalService", ".", "service_response", "(", "LambdaErrorResponses", ".", "_construct_error_response_body", "(", ...
Creates a Lambda Service Generic MethodNotAllowed Response Parameters ---------- args list List of arguments Flask passes to the method Returns ------- Flask.Response A response object representing the GenericMethodNotAllowed Error
[ "Creates", "a", "Lambda", "Service", "Generic", "MethodNotAllowed", "Response" ]
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/local/lambda_service/lambda_error_responses.py#L182-L203
train
Creates a Lambda Service Generic MethodNotAllowed Response
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/commands/validate/validate.py
do_cli
def do_cli(ctx, template): """ Implementation of the ``cli`` method, just separated out for unit testing purposes """ sam_template = _read_sam_file(template) iam_client = boto3.client('iam') validator = SamTemplateValidator(sam_template, ManagedPolicyLoader(iam_client)) try: valid...
python
def do_cli(ctx, template): """ Implementation of the ``cli`` method, just separated out for unit testing purposes """ sam_template = _read_sam_file(template) iam_client = boto3.client('iam') validator = SamTemplateValidator(sam_template, ManagedPolicyLoader(iam_client)) try: valid...
[ "def", "do_cli", "(", "ctx", ",", "template", ")", ":", "sam_template", "=", "_read_sam_file", "(", "template", ")", "iam_client", "=", "boto3", ".", "client", "(", "'iam'", ")", "validator", "=", "SamTemplateValidator", "(", "sam_template", ",", "ManagedPolic...
Implementation of the ``cli`` method, just separated out for unit testing purposes
[ "Implementation", "of", "the", "cli", "method", "just", "separated", "out", "for", "unit", "testing", "purposes" ]
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/commands/validate/validate.py#L33-L51
train
Implementation of the cli method just separated out for unit testing purposes
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/commands/validate/validate.py
_read_sam_file
def _read_sam_file(template): """ Reads the file (json and yaml supported) provided and returns the dictionary representation of the file. :param str template: Path to the template file :return dict: Dictionary representing the SAM Template :raises: SamTemplateNotFoundException when the template fi...
python
def _read_sam_file(template): """ Reads the file (json and yaml supported) provided and returns the dictionary representation of the file. :param str template: Path to the template file :return dict: Dictionary representing the SAM Template :raises: SamTemplateNotFoundException when the template fi...
[ "def", "_read_sam_file", "(", "template", ")", ":", "if", "not", "os", ".", "path", ".", "exists", "(", "template", ")", ":", "click", ".", "secho", "(", "\"SAM Template Not Found\"", ",", "bg", "=", "'red'", ")", "raise", "SamTemplateNotFoundException", "("...
Reads the file (json and yaml supported) provided and returns the dictionary representation of the file. :param str template: Path to the template file :return dict: Dictionary representing the SAM Template :raises: SamTemplateNotFoundException when the template file does not exist
[ "Reads", "the", "file", "(", "json", "and", "yaml", "supported", ")", "provided", "and", "returns", "the", "dictionary", "representation", "of", "the", "file", "." ]
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/commands/validate/validate.py#L54-L69
train
Reads the SAM template file provided and returns the dictionary representation of the file.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/lib/utils/codeuri.py
resolve_code_path
def resolve_code_path(cwd, codeuri): """ Returns path to the function code resolved based on current working directory. Parameters ---------- cwd str Current working directory codeuri CodeURI of the function. This should contain the path to the function code Returns ---...
python
def resolve_code_path(cwd, codeuri): """ Returns path to the function code resolved based on current working directory. Parameters ---------- cwd str Current working directory codeuri CodeURI of the function. This should contain the path to the function code Returns ---...
[ "def", "resolve_code_path", "(", "cwd", ",", "codeuri", ")", ":", "LOG", ".", "debug", "(", "\"Resolving code path. Cwd=%s, CodeUri=%s\"", ",", "cwd", ",", "codeuri", ")", "# First, let us figure out the current working directory.", "# If current working directory is not provid...
Returns path to the function code resolved based on current working directory. Parameters ---------- cwd str Current working directory codeuri CodeURI of the function. This should contain the path to the function code Returns ------- str Absolute path to the functio...
[ "Returns", "path", "to", "the", "function", "code", "resolved", "based", "on", "current", "working", "directory", "." ]
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/lib/utils/codeuri.py#L13-L46
train
Resolves the path to the function code based on the current working directory and codeuri.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/local/apigw/path_converter.py
PathConverter.convert_path_to_flask
def convert_path_to_flask(path): """ Converts a Path from an Api Gateway defined path to one that is accepted by Flask Examples: '/id/{id}' => '/id/<id>' '/{proxy+}' => '/<path:proxy>' :param str path: Path to convert to Flask defined path :return str: Path rep...
python
def convert_path_to_flask(path): """ Converts a Path from an Api Gateway defined path to one that is accepted by Flask Examples: '/id/{id}' => '/id/<id>' '/{proxy+}' => '/<path:proxy>' :param str path: Path to convert to Flask defined path :return str: Path rep...
[ "def", "convert_path_to_flask", "(", "path", ")", ":", "proxy_sub_path", "=", "APIGW_TO_FLASK_REGEX", ".", "sub", "(", "FLASK_CAPTURE_ALL_PATH", ",", "path", ")", "# Replace the '{' and '}' with '<' and '>' respectively", "return", "proxy_sub_path", ".", "replace", "(", "...
Converts a Path from an Api Gateway defined path to one that is accepted by Flask Examples: '/id/{id}' => '/id/<id>' '/{proxy+}' => '/<path:proxy>' :param str path: Path to convert to Flask defined path :return str: Path representing a Flask path
[ "Converts", "a", "Path", "from", "an", "Api", "Gateway", "defined", "path", "to", "one", "that", "is", "accepted", "by", "Flask" ]
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/local/apigw/path_converter.py#L37-L52
train
Converts a Path from an Api Gateway defined path to a Flask defined path
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/local/apigw/path_converter.py
PathConverter.convert_path_to_api_gateway
def convert_path_to_api_gateway(path): """ Converts a Path from a Flask defined path to one that is accepted by Api Gateway Examples: '/id/<id>' => '/id/{id}' '/<path:proxy>' => '/{proxy+}' :param str path: Path to convert to Api Gateway defined path :return st...
python
def convert_path_to_api_gateway(path): """ Converts a Path from a Flask defined path to one that is accepted by Api Gateway Examples: '/id/<id>' => '/id/{id}' '/<path:proxy>' => '/{proxy+}' :param str path: Path to convert to Api Gateway defined path :return st...
[ "def", "convert_path_to_api_gateway", "(", "path", ")", ":", "proxy_sub_path", "=", "FLASK_TO_APIGW_REGEX", ".", "sub", "(", "PROXY_PATH_PARAMS", ",", "path", ")", "# Replace the '<' and '>' with '{' and '}' respectively", "return", "proxy_sub_path", ".", "replace", "(", ...
Converts a Path from a Flask defined path to one that is accepted by Api Gateway Examples: '/id/<id>' => '/id/{id}' '/<path:proxy>' => '/{proxy+}' :param str path: Path to convert to Api Gateway defined path :return str: Path representing an Api Gateway path
[ "Converts", "a", "Path", "from", "a", "Flask", "defined", "path", "to", "one", "that", "is", "accepted", "by", "Api", "Gateway" ]
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/local/apigw/path_converter.py#L55-L70
train
Converts a Path from a Flask defined path to an Api Gateway defined path.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/commands/local/lib/swagger/integration_uri.py
LambdaUri.get_function_name
def get_function_name(integration_uri): """ Gets the name of the function from the Integration URI ARN. This is a best effort service which returns None if function name could not be parsed. This can happen when the ARN is an intrinsic function which is too complex or the ARN is not a La...
python
def get_function_name(integration_uri): """ Gets the name of the function from the Integration URI ARN. This is a best effort service which returns None if function name could not be parsed. This can happen when the ARN is an intrinsic function which is too complex or the ARN is not a La...
[ "def", "get_function_name", "(", "integration_uri", ")", ":", "arn", "=", "LambdaUri", ".", "_get_function_arn", "(", "integration_uri", ")", "LOG", ".", "debug", "(", "\"Extracted Function ARN: %s\"", ",", "arn", ")", "return", "LambdaUri", ".", "_get_function_name...
Gets the name of the function from the Integration URI ARN. This is a best effort service which returns None if function name could not be parsed. This can happen when the ARN is an intrinsic function which is too complex or the ARN is not a Lambda integration. Parameters ---------- ...
[ "Gets", "the", "name", "of", "the", "function", "from", "the", "Integration", "URI", "ARN", ".", "This", "is", "a", "best", "effort", "service", "which", "returns", "None", "if", "function", "name", "could", "not", "be", "parsed", ".", "This", "can", "ha...
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/commands/local/lib/swagger/integration_uri.py#L42-L64
train
Gets the name of the function from the Integration URI ARN.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/commands/local/lib/swagger/integration_uri.py
LambdaUri._get_function_arn
def _get_function_arn(uri_data): """ Integration URI can be expressed in various shapes and forms. This method normalizes the Integration URI ARN and returns the Lambda Function ARN. Here are the different forms of Integration URI ARN: - String: - Fully resolved ARN ...
python
def _get_function_arn(uri_data): """ Integration URI can be expressed in various shapes and forms. This method normalizes the Integration URI ARN and returns the Lambda Function ARN. Here are the different forms of Integration URI ARN: - String: - Fully resolved ARN ...
[ "def", "_get_function_arn", "(", "uri_data", ")", ":", "if", "not", "uri_data", ":", "return", "None", "if", "LambdaUri", ".", "_is_sub_intrinsic", "(", "uri_data", ")", ":", "uri_data", "=", "LambdaUri", ".", "_resolve_fn_sub", "(", "uri_data", ")", "LOG", ...
Integration URI can be expressed in various shapes and forms. This method normalizes the Integration URI ARN and returns the Lambda Function ARN. Here are the different forms of Integration URI ARN: - String: - Fully resolved ARN - ARN with Stage Variables: Ex: arn...
[ "Integration", "URI", "can", "be", "expressed", "in", "various", "shapes", "and", "forms", ".", "This", "method", "normalizes", "the", "Integration", "URI", "ARN", "and", "returns", "the", "Lambda", "Function", "ARN", ".", "Here", "are", "the", "different", ...
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/commands/local/lib/swagger/integration_uri.py#L67-L128
train
This method returns the Lambda Function ARN from the Integration URI.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/commands/local/lib/swagger/integration_uri.py
LambdaUri._get_function_name_from_arn
def _get_function_name_from_arn(function_arn): """ Given the integration ARN, extract the Lambda function name from the ARN. If there are stage variables, or other unsupported formats, this function will return None. Parameters ---------- function_arn : basestring or Non...
python
def _get_function_name_from_arn(function_arn): """ Given the integration ARN, extract the Lambda function name from the ARN. If there are stage variables, or other unsupported formats, this function will return None. Parameters ---------- function_arn : basestring or Non...
[ "def", "_get_function_name_from_arn", "(", "function_arn", ")", ":", "if", "not", "function_arn", ":", "return", "None", "matches", "=", "re", ".", "match", "(", "LambdaUri", ".", "_REGEX_GET_FUNCTION_NAME", ",", "function_arn", ")", "if", "not", "matches", "or"...
Given the integration ARN, extract the Lambda function name from the ARN. If there are stage variables, or other unsupported formats, this function will return None. Parameters ---------- function_arn : basestring or None Function ARN from the swagger document Retur...
[ "Given", "the", "integration", "ARN", "extract", "the", "Lambda", "function", "name", "from", "the", "ARN", ".", "If", "there", "are", "stage", "variables", "or", "other", "unsupported", "formats", "this", "function", "will", "return", "None", "." ]
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/commands/local/lib/swagger/integration_uri.py#L131-L170
train
Given an integration ARN extract the Lambda function name from the ARN.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/commands/local/lib/swagger/integration_uri.py
LambdaUri._resolve_fn_sub
def _resolve_fn_sub(uri_data): """ Tries to resolve an Integration URI which contains Fn::Sub intrinsic function. This method tries to resolve and produce a string output. Example: { "Fn::Sub": "arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/funct...
python
def _resolve_fn_sub(uri_data): """ Tries to resolve an Integration URI which contains Fn::Sub intrinsic function. This method tries to resolve and produce a string output. Example: { "Fn::Sub": "arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/funct...
[ "def", "_resolve_fn_sub", "(", "uri_data", ")", ":", "# Try the short form of Fn::Sub syntax where the value is the ARN", "arn", "=", "uri_data", "[", "LambdaUri", ".", "_FN_SUB", "]", "if", "isinstance", "(", "arn", ",", "list", ")", ":", "# This is the long form of Fn...
Tries to resolve an Integration URI which contains Fn::Sub intrinsic function. This method tries to resolve and produce a string output. Example: { "Fn::Sub": "arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${LambdaFunction.Arn}/invocations" } ...
[ "Tries", "to", "resolve", "an", "Integration", "URI", "which", "contains", "Fn", "::", "Sub", "intrinsic", "function", ".", "This", "method", "tries", "to", "resolve", "and", "produce", "a", "string", "output", "." ]
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/commands/local/lib/swagger/integration_uri.py#L173-L250
train
Resolves a Fn :: Sub intrinsic function to a string.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/commands/local/lib/swagger/integration_uri.py
LambdaUri._is_sub_intrinsic
def _is_sub_intrinsic(data): """ Is this input data a Fn::Sub intrinsic function Parameters ---------- data Data to check Returns ------- bool True if the data Fn::Sub intrinsic function """ return isinstance(data,...
python
def _is_sub_intrinsic(data): """ Is this input data a Fn::Sub intrinsic function Parameters ---------- data Data to check Returns ------- bool True if the data Fn::Sub intrinsic function """ return isinstance(data,...
[ "def", "_is_sub_intrinsic", "(", "data", ")", ":", "return", "isinstance", "(", "data", ",", "dict", ")", "and", "len", "(", "data", ")", "==", "1", "and", "LambdaUri", ".", "_FN_SUB", "in", "data" ]
Is this input data a Fn::Sub intrinsic function Parameters ---------- data Data to check Returns ------- bool True if the data Fn::Sub intrinsic function
[ "Is", "this", "input", "data", "a", "Fn", "::", "Sub", "intrinsic", "function" ]
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/commands/local/lib/swagger/integration_uri.py#L253-L267
train
Checks if the input data is a Fn :: Sub intrinsic function
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/commands/local/invoke/cli.py
do_cli
def do_cli(ctx, function_identifier, template, event, no_event, env_vars, debug_port, # pylint: disable=R0914 debug_args, debugger_path, docker_volume_basedir, docker_network, log_file, layer_cache_basedir, skip_pull_image, force_image_build, parameter_overrides): """ Implementation of th...
python
def do_cli(ctx, function_identifier, template, event, no_event, env_vars, debug_port, # pylint: disable=R0914 debug_args, debugger_path, docker_volume_basedir, docker_network, log_file, layer_cache_basedir, skip_pull_image, force_image_build, parameter_overrides): """ Implementation of th...
[ "def", "do_cli", "(", "ctx", ",", "function_identifier", ",", "template", ",", "event", ",", "no_event", ",", "env_vars", ",", "debug_port", ",", "# pylint: disable=R0914", "debug_args", ",", "debugger_path", ",", "docker_volume_basedir", ",", "docker_network", ",",...
Implementation of the ``cli`` method, just separated out for unit testing purposes
[ "Implementation", "of", "the", "cli", "method", "just", "separated", "out", "for", "unit", "testing", "purposes" ]
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/commands/local/invoke/cli.py#L59-L109
train
This function is called by the local Lambda runner.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/commands/local/invoke/cli.py
_get_event
def _get_event(event_file_name): """ Read the event JSON data from the given file. If no file is provided, read the event from stdin. :param string event_file_name: Path to event file, or '-' for stdin :return string: Contents of the event file or stdin """ if event_file_name == STDIN_FILE_NAM...
python
def _get_event(event_file_name): """ Read the event JSON data from the given file. If no file is provided, read the event from stdin. :param string event_file_name: Path to event file, or '-' for stdin :return string: Contents of the event file or stdin """ if event_file_name == STDIN_FILE_NAM...
[ "def", "_get_event", "(", "event_file_name", ")", ":", "if", "event_file_name", "==", "STDIN_FILE_NAME", ":", "# If event is empty, listen to stdin for event data until EOF", "LOG", ".", "info", "(", "\"Reading invoke payload from stdin (you can also pass it from file with --event)\"...
Read the event JSON data from the given file. If no file is provided, read the event from stdin. :param string event_file_name: Path to event file, or '-' for stdin :return string: Contents of the event file or stdin
[ "Read", "the", "event", "JSON", "data", "from", "the", "given", "file", ".", "If", "no", "file", "is", "provided", "read", "the", "event", "from", "stdin", "." ]
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/commands/local/invoke/cli.py#L112-L127
train
Read the event from the given file.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/lib/samlib/resource_metadata_normalizer.py
ResourceMetadataNormalizer.normalize
def normalize(template_dict): """ Normalize all Resources in the template with the Metadata Key on the resource. This method will mutate the template Parameters ---------- template_dict dict Dictionary representing the template """ resources...
python
def normalize(template_dict): """ Normalize all Resources in the template with the Metadata Key on the resource. This method will mutate the template Parameters ---------- template_dict dict Dictionary representing the template """ resources...
[ "def", "normalize", "(", "template_dict", ")", ":", "resources", "=", "template_dict", ".", "get", "(", "RESOURCES_KEY", ",", "{", "}", ")", "for", "logical_id", ",", "resource", "in", "resources", ".", "items", "(", ")", ":", "resource_metadata", "=", "re...
Normalize all Resources in the template with the Metadata Key on the resource. This method will mutate the template Parameters ---------- template_dict dict Dictionary representing the template
[ "Normalize", "all", "Resources", "in", "the", "template", "with", "the", "Metadata", "Key", "on", "the", "resource", "." ]
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/lib/samlib/resource_metadata_normalizer.py#L19-L38
train
This method will normalize all Resources in the template with the Metadata Key on the resource.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/lib/samlib/resource_metadata_normalizer.py
ResourceMetadataNormalizer._replace_property
def _replace_property(property_key, property_value, resource, logical_id): """ Replace a property with an asset on a given resource This method will mutate the template Parameters ---------- property str The property to replace on the resource proper...
python
def _replace_property(property_key, property_value, resource, logical_id): """ Replace a property with an asset on a given resource This method will mutate the template Parameters ---------- property str The property to replace on the resource proper...
[ "def", "_replace_property", "(", "property_key", ",", "property_value", ",", "resource", ",", "logical_id", ")", ":", "if", "property_key", "and", "property_value", ":", "resource", ".", "get", "(", "PROPERTIES_KEY", ",", "{", "}", ")", "[", "property_key", "]...
Replace a property with an asset on a given resource This method will mutate the template Parameters ---------- property str The property to replace on the resource property_value str The new value of the property resource dict Dictio...
[ "Replace", "a", "property", "with", "an", "asset", "on", "a", "given", "resource" ]
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/lib/samlib/resource_metadata_normalizer.py#L41-L63
train
Replace a property with an asset on a given resource
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/cli/command.py
BaseCommand._set_commands
def _set_commands(package_names): """ Extract the command name from package name. Last part of the module path is the command ie. if path is foo.bar.baz, then "baz" is the command name. :param package_names: List of package names :return: Dictionary with command name as key and ...
python
def _set_commands(package_names): """ Extract the command name from package name. Last part of the module path is the command ie. if path is foo.bar.baz, then "baz" is the command name. :param package_names: List of package names :return: Dictionary with command name as key and ...
[ "def", "_set_commands", "(", "package_names", ")", ":", "commands", "=", "{", "}", "for", "pkg_name", "in", "package_names", ":", "cmd_name", "=", "pkg_name", ".", "split", "(", "'.'", ")", "[", "-", "1", "]", "commands", "[", "cmd_name", "]", "=", "pk...
Extract the command name from package name. Last part of the module path is the command ie. if path is foo.bar.baz, then "baz" is the command name. :param package_names: List of package names :return: Dictionary with command name as key and the package name as value.
[ "Extract", "the", "command", "name", "from", "package", "name", ".", "Last", "part", "of", "the", "module", "path", "is", "the", "command", "ie", ".", "if", "path", "is", "foo", ".", "bar", ".", "baz", "then", "baz", "is", "the", "command", "name", "...
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/cli/command.py#L62-L77
train
Extracts the command name from the package name.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/cli/command.py
BaseCommand.get_command
def get_command(self, ctx, cmd_name): """ Overrides method from ``click.MultiCommand`` that returns Click CLI object for given command name, if found. :param ctx: Click context :param cmd_name: Top-level command name :return: Click object representing the command """ ...
python
def get_command(self, ctx, cmd_name): """ Overrides method from ``click.MultiCommand`` that returns Click CLI object for given command name, if found. :param ctx: Click context :param cmd_name: Top-level command name :return: Click object representing the command """ ...
[ "def", "get_command", "(", "self", ",", "ctx", ",", "cmd_name", ")", ":", "if", "cmd_name", "not", "in", "self", ".", "_commands", ":", "logger", ".", "error", "(", "\"Command %s not available\"", ",", "cmd_name", ")", "return", "pkg_name", "=", "self", "....
Overrides method from ``click.MultiCommand`` that returns Click CLI object for given command name, if found. :param ctx: Click context :param cmd_name: Top-level command name :return: Click object representing the command
[ "Overrides", "method", "from", "click", ".", "MultiCommand", "that", "returns", "Click", "CLI", "object", "for", "given", "command", "name", "if", "found", "." ]
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/cli/command.py#L88-L112
train
Returns Click CLI object for given command name.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/lib/utils/stream_writer.py
StreamWriter.write
def write(self, output): """ Writes specified text to the underlying stream Parameters ---------- output bytes-like object Bytes to write """ self._stream.write(output) if self._auto_flush: self._stream.flush()
python
def write(self, output): """ Writes specified text to the underlying stream Parameters ---------- output bytes-like object Bytes to write """ self._stream.write(output) if self._auto_flush: self._stream.flush()
[ "def", "write", "(", "self", ",", "output", ")", ":", "self", ".", "_stream", ".", "write", "(", "output", ")", "if", "self", ".", "_auto_flush", ":", "self", ".", "_stream", ".", "flush", "(", ")" ]
Writes specified text to the underlying stream Parameters ---------- output bytes-like object Bytes to write
[ "Writes", "specified", "text", "to", "the", "underlying", "stream" ]
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/lib/utils/stream_writer.py#L22-L34
train
Writes specified text to the underlying stream
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/lib/build/workflow_config.py
get_workflow_config
def get_workflow_config(runtime, code_dir, project_dir): """ Get a workflow config that corresponds to the runtime provided. This method examines contents of the project and code directories to determine the most appropriate workflow for the given runtime. Currently the decision is based on the presence...
python
def get_workflow_config(runtime, code_dir, project_dir): """ Get a workflow config that corresponds to the runtime provided. This method examines contents of the project and code directories to determine the most appropriate workflow for the given runtime. Currently the decision is based on the presence...
[ "def", "get_workflow_config", "(", "runtime", ",", "code_dir", ",", "project_dir", ")", ":", "selectors_by_runtime", "=", "{", "\"python2.7\"", ":", "BasicWorkflowSelector", "(", "PYTHON_PIP_CONFIG", ")", ",", "\"python3.6\"", ":", "BasicWorkflowSelector", "(", "PYTHO...
Get a workflow config that corresponds to the runtime provided. This method examines contents of the project and code directories to determine the most appropriate workflow for the given runtime. Currently the decision is based on the presence of a supported manifest file. For runtimes that have more than one w...
[ "Get", "a", "workflow", "config", "that", "corresponds", "to", "the", "runtime", "provided", ".", "This", "method", "examines", "contents", "of", "the", "project", "and", "code", "directories", "to", "determine", "the", "most", "appropriate", "workflow", "for", ...
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/lib/build/workflow_config.py#L70-L125
train
Returns a namedtuple that represents the most appropriate workflow for the given runtime.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/lib/build/workflow_config.py
supports_build_in_container
def supports_build_in_container(config): """ Given a workflow config, this method provides a boolean on whether the workflow can run within a container or not. Parameters ---------- config namedtuple(Capability) Config specifying the particular build workflow Returns ------- tu...
python
def supports_build_in_container(config): """ Given a workflow config, this method provides a boolean on whether the workflow can run within a container or not. Parameters ---------- config namedtuple(Capability) Config specifying the particular build workflow Returns ------- tu...
[ "def", "supports_build_in_container", "(", "config", ")", ":", "def", "_key", "(", "c", ")", ":", "return", "str", "(", "c", ".", "language", ")", "+", "str", "(", "c", ".", "dependency_manager", ")", "+", "str", "(", "c", ".", "application_framework", ...
Given a workflow config, this method provides a boolean on whether the workflow can run within a container or not. Parameters ---------- config namedtuple(Capability) Config specifying the particular build workflow Returns ------- tuple(bool, str) True, if this workflow can be ...
[ "Given", "a", "workflow", "config", "this", "method", "provides", "a", "boolean", "on", "whether", "the", "workflow", "can", "run", "within", "a", "container", "or", "not", "." ]
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/lib/build/workflow_config.py#L128-L161
train
Given a workflow config this method provides a boolean on whether the workflow can be built within a container or not.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/lib/build/workflow_config.py
ManifestWorkflowSelector.get_config
def get_config(self, code_dir, project_dir): """ Finds a configuration by looking for a manifest in the given directories. Returns ------- samcli.lib.build.workflow_config.CONFIG A supported configuration if one is found Raises ------ ValueEr...
python
def get_config(self, code_dir, project_dir): """ Finds a configuration by looking for a manifest in the given directories. Returns ------- samcli.lib.build.workflow_config.CONFIG A supported configuration if one is found Raises ------ ValueEr...
[ "def", "get_config", "(", "self", ",", "code_dir", ",", "project_dir", ")", ":", "# Search for manifest first in code directory and then in the project directory.", "# Search order is important here because we want to prefer the manifest present within the code directory over", "# a manifest...
Finds a configuration by looking for a manifest in the given directories. Returns ------- samcli.lib.build.workflow_config.CONFIG A supported configuration if one is found Raises ------ ValueError If none of the supported manifests files are foun...
[ "Finds", "a", "configuration", "by", "looking", "for", "a", "manifest", "in", "the", "given", "directories", "." ]
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/lib/build/workflow_config.py#L188-L216
train
Find a configuration by looking for a manifest in the given directories.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/yamlhelper.py
intrinsics_multi_constructor
def intrinsics_multi_constructor(loader, tag_prefix, node): """ YAML constructor to parse CloudFormation intrinsics. This will return a dictionary with key being the instrinsic name """ # Get the actual tag name excluding the first exclamation tag = node.tag[1:] # Some intrinsic functions ...
python
def intrinsics_multi_constructor(loader, tag_prefix, node): """ YAML constructor to parse CloudFormation intrinsics. This will return a dictionary with key being the instrinsic name """ # Get the actual tag name excluding the first exclamation tag = node.tag[1:] # Some intrinsic functions ...
[ "def", "intrinsics_multi_constructor", "(", "loader", ",", "tag_prefix", ",", "node", ")", ":", "# Get the actual tag name excluding the first exclamation", "tag", "=", "node", ".", "tag", "[", "1", ":", "]", "# Some intrinsic functions doesn't support prefix \"Fn::\"", "pr...
YAML constructor to parse CloudFormation intrinsics. This will return a dictionary with key being the instrinsic name
[ "YAML", "constructor", "to", "parse", "CloudFormation", "intrinsics", ".", "This", "will", "return", "a", "dictionary", "with", "key", "being", "the", "instrinsic", "name" ]
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/yamlhelper.py#L12-L46
train
This is a YAML constructor that parses CloudFormation intrinsics. It will parse CloudFormation intrinsics.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/yamlhelper.py
yaml_parse
def yaml_parse(yamlstr): """Parse a yaml string""" try: # PyYAML doesn't support json as well as it should, so if the input # is actually just json it is better to parse it with the standard # json parser. return json.loads(yamlstr) except ValueError: yaml.SafeLoader....
python
def yaml_parse(yamlstr): """Parse a yaml string""" try: # PyYAML doesn't support json as well as it should, so if the input # is actually just json it is better to parse it with the standard # json parser. return json.loads(yamlstr) except ValueError: yaml.SafeLoader....
[ "def", "yaml_parse", "(", "yamlstr", ")", ":", "try", ":", "# PyYAML doesn't support json as well as it should, so if the input", "# is actually just json it is better to parse it with the standard", "# json parser.", "return", "json", ".", "loads", "(", "yamlstr", ")", "except",...
Parse a yaml string
[ "Parse", "a", "yaml", "string" ]
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/yamlhelper.py#L58-L67
train
Parse a yaml string
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/commands/local/lib/generated_sample_events/events.py
Events.encode
def encode(self, tags, encoding, values_to_sub): """ reads the encoding type from the event-mapping.json and determines whether a value needs encoding Parameters ---------- tags: dict the values of a particular event that can be substituted within...
python
def encode(self, tags, encoding, values_to_sub): """ reads the encoding type from the event-mapping.json and determines whether a value needs encoding Parameters ---------- tags: dict the values of a particular event that can be substituted within...
[ "def", "encode", "(", "self", ",", "tags", ",", "encoding", ",", "values_to_sub", ")", ":", "for", "tag", "in", "tags", ":", "if", "tags", "[", "tag", "]", ".", "get", "(", "encoding", ")", "!=", "\"None\"", ":", "if", "tags", "[", "tag", "]", "....
reads the encoding type from the event-mapping.json and determines whether a value needs encoding Parameters ---------- tags: dict the values of a particular event that can be substituted within the event json encoding: string string that help...
[ "reads", "the", "encoding", "type", "from", "the", "event", "-", "mapping", ".", "json", "and", "determines", "whether", "a", "value", "needs", "encoding" ]
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/commands/local/lib/generated_sample_events/events.py#L36-L62
train
Encodes the json - related key - value pairs of a particular event - mapping.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/commands/local/lib/generated_sample_events/events.py
Events.generate_event
def generate_event(self, service_name, event_type, values_to_sub): """ opens the event json, substitutes the values in, and returns the customized event json Parameters ---------- service_name: string name of the top level service (S3, apigateway, etc) ...
python
def generate_event(self, service_name, event_type, values_to_sub): """ opens the event json, substitutes the values in, and returns the customized event json Parameters ---------- service_name: string name of the top level service (S3, apigateway, etc) ...
[ "def", "generate_event", "(", "self", ",", "service_name", ",", "event_type", ",", "values_to_sub", ")", ":", "# set variables for easy calling", "tags", "=", "self", ".", "event_mapping", "[", "service_name", "]", "[", "event_type", "]", "[", "'tags'", "]", "va...
opens the event json, substitutes the values in, and returns the customized event json Parameters ---------- service_name: string name of the top level service (S3, apigateway, etc) event_type: string name of the event underneath the service value...
[ "opens", "the", "event", "json", "substitutes", "the", "values", "in", "and", "returns", "the", "customized", "event", "json" ]
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/commands/local/lib/generated_sample_events/events.py#L94-L129
train
This function generates the event json and returns the custom event json
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/lib/utils/colors.py
Colored.underline
def underline(self, msg): """Underline the input""" return click.style(msg, underline=True) if self.colorize else msg
python
def underline(self, msg): """Underline the input""" return click.style(msg, underline=True) if self.colorize else msg
[ "def", "underline", "(", "self", ",", "msg", ")", ":", "return", "click", ".", "style", "(", "msg", ",", "underline", "=", "True", ")", "if", "self", ".", "colorize", "else", "msg" ]
Underline the input
[ "Underline", "the", "input" ]
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/lib/utils/colors.py#L57-L59
train
Underline the input
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/lib/utils/colors.py
Colored._color
def _color(self, msg, color): """Internal helper method to add colors to input""" kwargs = {'fg': color} return click.style(msg, **kwargs) if self.colorize else msg
python
def _color(self, msg, color): """Internal helper method to add colors to input""" kwargs = {'fg': color} return click.style(msg, **kwargs) if self.colorize else msg
[ "def", "_color", "(", "self", ",", "msg", ",", "color", ")", ":", "kwargs", "=", "{", "'fg'", ":", "color", "}", "return", "click", ".", "style", "(", "msg", ",", "*", "*", "kwargs", ")", "if", "self", ".", "colorize", "else", "msg" ]
Internal helper method to add colors to input
[ "Internal", "helper", "method", "to", "add", "colors", "to", "input" ]
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/lib/utils/colors.py#L61-L64
train
Internal helper method to add colors to input
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/lib/logs/fetcher.py
LogsFetcher.fetch
def fetch(self, log_group_name, start=None, end=None, filter_pattern=None): """ Fetch logs from all streams under the given CloudWatch Log Group and yields in the output. Optionally, caller can filter the logs using a pattern or a start/end time. Parameters ---------- lo...
python
def fetch(self, log_group_name, start=None, end=None, filter_pattern=None): """ Fetch logs from all streams under the given CloudWatch Log Group and yields in the output. Optionally, caller can filter the logs using a pattern or a start/end time. Parameters ---------- lo...
[ "def", "fetch", "(", "self", ",", "log_group_name", ",", "start", "=", "None", ",", "end", "=", "None", ",", "filter_pattern", "=", "None", ")", ":", "kwargs", "=", "{", "\"logGroupName\"", ":", "log_group_name", ",", "\"interleaved\"", ":", "True", "}", ...
Fetch logs from all streams under the given CloudWatch Log Group and yields in the output. Optionally, caller can filter the logs using a pattern or a start/end time. Parameters ---------- log_group_name : string Name of CloudWatch Logs Group to query. start : datet...
[ "Fetch", "logs", "from", "all", "streams", "under", "the", "given", "CloudWatch", "Log", "Group", "and", "yields", "in", "the", "output", ".", "Optionally", "caller", "can", "filter", "the", "logs", "using", "a", "pattern", "or", "a", "start", "/", "end", ...
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/lib/logs/fetcher.py#L32-L85
train
Fetch logs from all streams under the given CloudWatch Log Group and yields in the output.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/lib/logs/fetcher.py
LogsFetcher.tail
def tail(self, log_group_name, start=None, filter_pattern=None, max_retries=1000, poll_interval=0.3): """ ** This is a long blocking call ** Fetches logs from CloudWatch logs similar to the ``fetch`` method, but instead of stopping after all logs have been fetched, this method continues...
python
def tail(self, log_group_name, start=None, filter_pattern=None, max_retries=1000, poll_interval=0.3): """ ** This is a long blocking call ** Fetches logs from CloudWatch logs similar to the ``fetch`` method, but instead of stopping after all logs have been fetched, this method continues...
[ "def", "tail", "(", "self", ",", "log_group_name", ",", "start", "=", "None", ",", "filter_pattern", "=", "None", ",", "max_retries", "=", "1000", ",", "poll_interval", "=", "0.3", ")", ":", "# On every poll, startTime of the API call is the timestamp of last record o...
** This is a long blocking call ** Fetches logs from CloudWatch logs similar to the ``fetch`` method, but instead of stopping after all logs have been fetched, this method continues to poll CloudWatch for new logs. So this essentially simulates the ``tail -f`` bash command. If no logs ...
[ "**", "This", "is", "a", "long", "blocking", "call", "**" ]
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/lib/logs/fetcher.py#L87-L157
train
This method returns a list of CloudWatch Logs for the specified log group.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/commands/local/lib/provider.py
LayerVersion._compute_layer_version
def _compute_layer_version(is_defined_within_template, arn): """ Parses out the Layer version from the arn Parameters ---------- is_defined_within_template bool True if the resource is a Ref to a resource otherwise False arn str ARN of the Resourc...
python
def _compute_layer_version(is_defined_within_template, arn): """ Parses out the Layer version from the arn Parameters ---------- is_defined_within_template bool True if the resource is a Ref to a resource otherwise False arn str ARN of the Resourc...
[ "def", "_compute_layer_version", "(", "is_defined_within_template", ",", "arn", ")", ":", "if", "is_defined_within_template", ":", "return", "None", "try", ":", "_", ",", "layer_version", "=", "arn", ".", "rsplit", "(", "':'", ",", "1", ")", "layer_version", "...
Parses out the Layer version from the arn Parameters ---------- is_defined_within_template bool True if the resource is a Ref to a resource otherwise False arn str ARN of the Resource Returns ------- int The Version of the Lay...
[ "Parses", "out", "the", "Layer", "version", "from", "the", "arn" ]
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/commands/local/lib/provider.py#L72-L99
train
Computes the Layer Version from the Layer Version ARN.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/commands/local/lib/provider.py
LayerVersion._compute_layer_name
def _compute_layer_name(is_defined_within_template, arn): """ Computes a unique name based on the LayerVersion Arn Format: <Name of the LayerVersion>-<Version of the LayerVersion>-<sha256 of the arn> Parameters ---------- is_defined_within_template bool ...
python
def _compute_layer_name(is_defined_within_template, arn): """ Computes a unique name based on the LayerVersion Arn Format: <Name of the LayerVersion>-<Version of the LayerVersion>-<sha256 of the arn> Parameters ---------- is_defined_within_template bool ...
[ "def", "_compute_layer_name", "(", "is_defined_within_template", ",", "arn", ")", ":", "# If the Layer is defined in the template, the arn will represent the LogicalId of the LayerVersion Resource,", "# which does not require creating a name based on the arn.", "if", "is_defined_within_templat...
Computes a unique name based on the LayerVersion Arn Format: <Name of the LayerVersion>-<Version of the LayerVersion>-<sha256 of the arn> Parameters ---------- is_defined_within_template bool True if the resource is a Ref to a resource otherwise False arn st...
[ "Computes", "a", "unique", "name", "based", "on", "the", "LayerVersion", "Arn" ]
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/commands/local/lib/provider.py#L102-L134
train
Computes a unique name based on the LayerVersion and the LayerVersion ARN.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/lib/utils/osutils.py
mkdir_temp
def mkdir_temp(mode=0o755): """ Context manager that makes a temporary directory and yields it name. Directory is deleted after the context exits Parameters ---------- mode : octal Permissions to apply to the directory. Defaults to '755' because don't want directories world writable ...
python
def mkdir_temp(mode=0o755): """ Context manager that makes a temporary directory and yields it name. Directory is deleted after the context exits Parameters ---------- mode : octal Permissions to apply to the directory. Defaults to '755' because don't want directories world writable ...
[ "def", "mkdir_temp", "(", "mode", "=", "0o755", ")", ":", "temp_dir", "=", "None", "try", ":", "temp_dir", "=", "tempfile", ".", "mkdtemp", "(", ")", "os", ".", "chmod", "(", "temp_dir", ",", "mode", ")", "yield", "temp_dir", "finally", ":", "if", "t...
Context manager that makes a temporary directory and yields it name. Directory is deleted after the context exits Parameters ---------- mode : octal Permissions to apply to the directory. Defaults to '755' because don't want directories world writable Returns ------- str Pa...
[ "Context", "manager", "that", "makes", "a", "temporary", "directory", "and", "yields", "it", "name", ".", "Directory", "is", "deleted", "after", "the", "context", "exits" ]
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/lib/utils/osutils.py#L14-L40
train
Context manager that creates a temporary directory and yields it name.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/lib/utils/osutils.py
stdout
def stdout(): """ Returns the stdout as a byte stream in a Py2/PY3 compatible manner Returns ------- io.BytesIO Byte stream of Stdout """ # We write all of the data to stdout with bytes, typically io.BytesIO. stdout in Python2 # accepts bytes but Python3 does not. This is due t...
python
def stdout(): """ Returns the stdout as a byte stream in a Py2/PY3 compatible manner Returns ------- io.BytesIO Byte stream of Stdout """ # We write all of the data to stdout with bytes, typically io.BytesIO. stdout in Python2 # accepts bytes but Python3 does not. This is due t...
[ "def", "stdout", "(", ")", ":", "# We write all of the data to stdout with bytes, typically io.BytesIO. stdout in Python2", "# accepts bytes but Python3 does not. This is due to a type change on the attribute. To keep", "# this consistent, we leave Python2 the same and get the .buffer attribute on std...
Returns the stdout as a byte stream in a Py2/PY3 compatible manner Returns ------- io.BytesIO Byte stream of Stdout
[ "Returns", "the", "stdout", "as", "a", "byte", "stream", "in", "a", "Py2", "/", "PY3", "compatible", "manner" ]
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/lib/utils/osutils.py#L43-L61
train
Returns the stdout as a byte stream in a Py2 or Py3 compatible manner
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/lib/utils/osutils.py
stderr
def stderr(): """ Returns the stderr as a byte stream in a Py2/PY3 compatible manner Returns ------- io.BytesIO Byte stream of stderr """ # We write all of the data to stderr with bytes, typically io.BytesIO. stderr in Python2 # accepts bytes but Python3 does not. This is due t...
python
def stderr(): """ Returns the stderr as a byte stream in a Py2/PY3 compatible manner Returns ------- io.BytesIO Byte stream of stderr """ # We write all of the data to stderr with bytes, typically io.BytesIO. stderr in Python2 # accepts bytes but Python3 does not. This is due t...
[ "def", "stderr", "(", ")", ":", "# We write all of the data to stderr with bytes, typically io.BytesIO. stderr in Python2", "# accepts bytes but Python3 does not. This is due to a type change on the attribute. To keep", "# this consistent, we leave Python2 the same and get the .buffer attribute on std...
Returns the stderr as a byte stream in a Py2/PY3 compatible manner Returns ------- io.BytesIO Byte stream of stderr
[ "Returns", "the", "stderr", "as", "a", "byte", "stream", "in", "a", "Py2", "/", "PY3", "compatible", "manner" ]
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/lib/utils/osutils.py#L64-L82
train
Returns the stderr as a byte stream in a Py2 or Py3 compatible manner
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/local/layers/layer_downloader.py
LayerDownloader.download_all
def download_all(self, layers, force=False): """ Download a list of layers to the cache Parameters ---------- layers list(samcli.commands.local.lib.provider.Layer) List of Layers representing the layer to be downloaded force bool True to download ...
python
def download_all(self, layers, force=False): """ Download a list of layers to the cache Parameters ---------- layers list(samcli.commands.local.lib.provider.Layer) List of Layers representing the layer to be downloaded force bool True to download ...
[ "def", "download_all", "(", "self", ",", "layers", ",", "force", "=", "False", ")", ":", "layer_dirs", "=", "[", "]", "for", "layer", "in", "layers", ":", "layer_dirs", ".", "append", "(", "self", ".", "download", "(", "layer", ",", "force", ")", ")"...
Download a list of layers to the cache Parameters ---------- layers list(samcli.commands.local.lib.provider.Layer) List of Layers representing the layer to be downloaded force bool True to download the layer even if it exists already on the system Return...
[ "Download", "a", "list", "of", "layers", "to", "the", "cache" ]
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/local/layers/layer_downloader.py#L54-L74
train
Download a list of layers to the cache
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/local/layers/layer_downloader.py
LayerDownloader.download
def download(self, layer, force=False): """ Download a given layer to the local cache. Parameters ---------- layer samcli.commands.local.lib.provider.Layer Layer representing the layer to be downloaded. force bool True to download the layer even i...
python
def download(self, layer, force=False): """ Download a given layer to the local cache. Parameters ---------- layer samcli.commands.local.lib.provider.Layer Layer representing the layer to be downloaded. force bool True to download the layer even i...
[ "def", "download", "(", "self", ",", "layer", ",", "force", "=", "False", ")", ":", "if", "layer", ".", "is_defined_within_template", ":", "LOG", ".", "info", "(", "\"%s is a local Layer in the template\"", ",", "layer", ".", "name", ")", "layer", ".", "code...
Download a given layer to the local cache. Parameters ---------- layer samcli.commands.local.lib.provider.Layer Layer representing the layer to be downloaded. force bool True to download the layer even if it exists already on the system Returns -...
[ "Download", "a", "given", "layer", "to", "the", "local", "cache", "." ]
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/local/layers/layer_downloader.py#L76-L113
train
Download a given layer to the local cache.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/local/layers/layer_downloader.py
LayerDownloader._fetch_layer_uri
def _fetch_layer_uri(self, layer): """ Fetch the Layer Uri based on the LayerVersion Arn Parameters ---------- layer samcli.commands.local.lib.provider.LayerVersion LayerVersion to fetch Returns ------- str The Uri to download the...
python
def _fetch_layer_uri(self, layer): """ Fetch the Layer Uri based on the LayerVersion Arn Parameters ---------- layer samcli.commands.local.lib.provider.LayerVersion LayerVersion to fetch Returns ------- str The Uri to download the...
[ "def", "_fetch_layer_uri", "(", "self", ",", "layer", ")", ":", "try", ":", "layer_version_response", "=", "self", ".", "lambda_client", ".", "get_layer_version", "(", "LayerName", "=", "layer", ".", "layer_arn", ",", "VersionNumber", "=", "layer", ".", "versi...
Fetch the Layer Uri based on the LayerVersion Arn Parameters ---------- layer samcli.commands.local.lib.provider.LayerVersion LayerVersion to fetch Returns ------- str The Uri to download the LayerVersion Content from Raises ----...
[ "Fetch", "the", "Layer", "Uri", "based", "on", "the", "LayerVersion", "Arn" ]
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/local/layers/layer_downloader.py#L115-L154
train
Fetch the Layer Uri based on the LayerVersion Arn and the LayerVersion Version Number.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/local/layers/layer_downloader.py
LayerDownloader._create_cache
def _create_cache(layer_cache): """ Create the Cache directory if it does not exist. Parameters ---------- layer_cache Directory to where the layers should be cached Returns ------- None """ Path(layer_cache).mkdir(mode=0o700...
python
def _create_cache(layer_cache): """ Create the Cache directory if it does not exist. Parameters ---------- layer_cache Directory to where the layers should be cached Returns ------- None """ Path(layer_cache).mkdir(mode=0o700...
[ "def", "_create_cache", "(", "layer_cache", ")", ":", "Path", "(", "layer_cache", ")", ".", "mkdir", "(", "mode", "=", "0o700", ",", "parents", "=", "True", ",", "exist_ok", "=", "True", ")" ]
Create the Cache directory if it does not exist. Parameters ---------- layer_cache Directory to where the layers should be cached Returns ------- None
[ "Create", "the", "Cache", "directory", "if", "it", "does", "not", "exist", "." ]
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/local/layers/layer_downloader.py#L174-L188
train
Create the Cache directory if it does not exist.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/commands/validate/lib/sam_template_validator.py
SamTemplateValidator.is_valid
def is_valid(self): """ Runs the SAM Translator to determine if the template provided is valid. This is similar to running a ChangeSet in CloudFormation for a SAM Template Raises ------- InvalidSamDocumentException If the template is not valid, an InvalidSam...
python
def is_valid(self): """ Runs the SAM Translator to determine if the template provided is valid. This is similar to running a ChangeSet in CloudFormation for a SAM Template Raises ------- InvalidSamDocumentException If the template is not valid, an InvalidSam...
[ "def", "is_valid", "(", "self", ")", ":", "managed_policy_map", "=", "self", ".", "managed_policy_loader", ".", "load", "(", ")", "sam_translator", "=", "Translator", "(", "managed_policy_map", "=", "managed_policy_map", ",", "sam_parser", "=", "self", ".", "sam...
Runs the SAM Translator to determine if the template provided is valid. This is similar to running a ChangeSet in CloudFormation for a SAM Template Raises ------- InvalidSamDocumentException If the template is not valid, an InvalidSamDocumentException is raised
[ "Runs", "the", "SAM", "Translator", "to", "determine", "if", "the", "template", "provided", "is", "valid", ".", "This", "is", "similar", "to", "running", "a", "ChangeSet", "in", "CloudFormation", "for", "a", "SAM", "Template" ]
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/commands/validate/lib/sam_template_validator.py#L44-L68
train
Checks if the SAM template provided is valid.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/commands/validate/lib/sam_template_validator.py
SamTemplateValidator._replace_local_codeuri
def _replace_local_codeuri(self): """ Replaces the CodeUri in AWS::Serverless::Function and DefinitionUri in AWS::Serverless::Api to a fake S3 Uri. This is to support running the SAM Translator with valid values for these fields. If this in not done, the template is invalid in the eyes o...
python
def _replace_local_codeuri(self): """ Replaces the CodeUri in AWS::Serverless::Function and DefinitionUri in AWS::Serverless::Api to a fake S3 Uri. This is to support running the SAM Translator with valid values for these fields. If this in not done, the template is invalid in the eyes o...
[ "def", "_replace_local_codeuri", "(", "self", ")", ":", "all_resources", "=", "self", ".", "sam_template", ".", "get", "(", "\"Resources\"", ",", "{", "}", ")", "for", "_", ",", "resource", "in", "all_resources", ".", "items", "(", ")", ":", "resource_type...
Replaces the CodeUri in AWS::Serverless::Function and DefinitionUri in AWS::Serverless::Api to a fake S3 Uri. This is to support running the SAM Translator with valid values for these fields. If this in not done, the template is invalid in the eyes of SAM Translator (the translator does not support loca...
[ "Replaces", "the", "CodeUri", "in", "AWS", "::", "Serverless", "::", "Function", "and", "DefinitionUri", "in", "AWS", "::", "Serverless", "::", "Api", "to", "a", "fake", "S3", "Uri", ".", "This", "is", "to", "support", "running", "the", "SAM", "Translator"...
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/commands/validate/lib/sam_template_validator.py#L70-L94
train
Replaces the CodeUri in AWS Serverless Function and DefinitionUri in AWS Serverless API with a fake S3 Uri.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/commands/validate/lib/sam_template_validator.py
SamTemplateValidator._update_to_s3_uri
def _update_to_s3_uri(property_key, resource_property_dict, s3_uri_value="s3://bucket/value"): """ Updates the 'property_key' in the 'resource_property_dict' to the value of 's3_uri_value' Note: The function will mutate the resource_property_dict that is pass in Parameters ----...
python
def _update_to_s3_uri(property_key, resource_property_dict, s3_uri_value="s3://bucket/value"): """ Updates the 'property_key' in the 'resource_property_dict' to the value of 's3_uri_value' Note: The function will mutate the resource_property_dict that is pass in Parameters ----...
[ "def", "_update_to_s3_uri", "(", "property_key", ",", "resource_property_dict", ",", "s3_uri_value", "=", "\"s3://bucket/value\"", ")", ":", "uri_property", "=", "resource_property_dict", ".", "get", "(", "property_key", ",", "\".\"", ")", "# ignore if dict or already an ...
Updates the 'property_key' in the 'resource_property_dict' to the value of 's3_uri_value' Note: The function will mutate the resource_property_dict that is pass in Parameters ---------- property_key str, required Key in the resource_property_dict resource_property_d...
[ "Updates", "the", "property_key", "in", "the", "resource_property_dict", "to", "the", "value", "of", "s3_uri_value" ]
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/commands/validate/lib/sam_template_validator.py#L115-L136
train
Updates the property_key in the resource_property_dict to the value of s3_uri_value
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/commands/logs/logs_context.py
LogsCommandContext.formatter
def formatter(self): """ Creates and returns a Formatter capable of nicely formatting Lambda function logs Returns ------- LogsFormatter """ formatter_chain = [ LambdaLogMsgFormatters.colorize_errors, # Format JSON "before" highlighting t...
python
def formatter(self): """ Creates and returns a Formatter capable of nicely formatting Lambda function logs Returns ------- LogsFormatter """ formatter_chain = [ LambdaLogMsgFormatters.colorize_errors, # Format JSON "before" highlighting t...
[ "def", "formatter", "(", "self", ")", ":", "formatter_chain", "=", "[", "LambdaLogMsgFormatters", ".", "colorize_errors", ",", "# Format JSON \"before\" highlighting the keywords. Otherwise, JSON will be invalid from all the", "# ANSI color codes and fail to pretty print", "JSONMsgForm...
Creates and returns a Formatter capable of nicely formatting Lambda function logs Returns ------- LogsFormatter
[ "Creates", "and", "returns", "a", "Formatter", "capable", "of", "nicely", "formatting", "Lambda", "function", "logs" ]
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/commands/logs/logs_context.py#L103-L121
train
Creates and returns a LogsFormatter capable of nicely formatting Lambda function logs .
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/commands/logs/logs_context.py
LogsCommandContext.log_group_name
def log_group_name(self): """ Name of the AWS CloudWatch Log Group that we will be querying. It generates the name based on the Lambda Function name and stack name provided. Returns ------- str Name of the CloudWatch Log Group """ function_id...
python
def log_group_name(self): """ Name of the AWS CloudWatch Log Group that we will be querying. It generates the name based on the Lambda Function name and stack name provided. Returns ------- str Name of the CloudWatch Log Group """ function_id...
[ "def", "log_group_name", "(", "self", ")", ":", "function_id", "=", "self", ".", "_function_name", "if", "self", ".", "_stack_name", ":", "function_id", "=", "self", ".", "_get_resource_id_from_stack", "(", "self", ".", "_cfn_client", ",", "self", ".", "_stack...
Name of the AWS CloudWatch Log Group that we will be querying. It generates the name based on the Lambda Function name and stack name provided. Returns ------- str Name of the CloudWatch Log Group
[ "Name", "of", "the", "AWS", "CloudWatch", "Log", "Group", "that", "we", "will", "be", "querying", ".", "It", "generates", "the", "name", "based", "on", "the", "Lambda", "Function", "name", "and", "stack", "name", "provided", "." ]
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/commands/logs/logs_context.py#L132-L149
train
Returns the name of the CloudWatch Log Group that we will be querying.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/commands/logs/logs_context.py
LogsCommandContext._parse_time
def _parse_time(time_str, property_name): """ Parse the time from the given string, convert to UTC, and return the datetime object Parameters ---------- time_str : str The time to parse property_name : str Name of the property where this time cam...
python
def _parse_time(time_str, property_name): """ Parse the time from the given string, convert to UTC, and return the datetime object Parameters ---------- time_str : str The time to parse property_name : str Name of the property where this time cam...
[ "def", "_parse_time", "(", "time_str", ",", "property_name", ")", ":", "if", "not", "time_str", ":", "return", "parsed", "=", "parse_date", "(", "time_str", ")", "if", "not", "parsed", ":", "raise", "UserException", "(", "\"Unable to parse the time provided by '{}...
Parse the time from the given string, convert to UTC, and return the datetime object Parameters ---------- time_str : str The time to parse property_name : str Name of the property where this time came from. Used in the exception raised if time is not parseable ...
[ "Parse", "the", "time", "from", "the", "given", "string", "convert", "to", "UTC", "and", "return", "the", "datetime", "object" ]
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/commands/logs/logs_context.py#L191-L220
train
Parse the time from the given string convert to UTC and return the datetime object.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
awslabs/aws-sam-cli
samcli/commands/logs/logs_context.py
LogsCommandContext._get_resource_id_from_stack
def _get_resource_id_from_stack(cfn_client, stack_name, logical_id): """ Given the LogicalID of a resource, call AWS CloudFormation to get physical ID of the resource within the specified stack. Parameters ---------- cfn_client CloudFormation client provided ...
python
def _get_resource_id_from_stack(cfn_client, stack_name, logical_id): """ Given the LogicalID of a resource, call AWS CloudFormation to get physical ID of the resource within the specified stack. Parameters ---------- cfn_client CloudFormation client provided ...
[ "def", "_get_resource_id_from_stack", "(", "cfn_client", ",", "stack_name", ",", "logical_id", ")", ":", "LOG", ".", "debug", "(", "\"Getting resource's PhysicalId from AWS CloudFormation stack. StackName=%s, LogicalId=%s\"", ",", "stack_name", ",", "logical_id", ")", "try", ...
Given the LogicalID of a resource, call AWS CloudFormation to get physical ID of the resource within the specified stack. Parameters ---------- cfn_client CloudFormation client provided by AWS SDK stack_name : str Name of the stack to query logi...
[ "Given", "the", "LogicalID", "of", "a", "resource", "call", "AWS", "CloudFormation", "to", "get", "physical", "ID", "of", "the", "resource", "within", "the", "specified", "stack", "." ]
c05af5e7378c6f05f7d82ad3f0bca17204177db6
https://github.com/awslabs/aws-sam-cli/blob/c05af5e7378c6f05f7d82ad3f0bca17204177db6/samcli/commands/logs/logs_context.py#L223-L264
train
Get the PhysicalId of a resource within a specified stack.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...