This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from datadog import datadog_lambda_wrapper, statsd | |
| import time | |
| @datadog_lambda_wrapper | |
| def lambda_handler(event, context): | |
| x = event['x'] | |
| y = event['y'] | |
| z = event['z'] | |
| start_time = time.time() | |
| result = perform_complex_calculation(x, y, z) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import tensorflow as tf | |
| def lambda_handler(event, context): | |
| # Simple hello world using TensorFlow | |
| hello = tf.constant('Hello, TensorFlow!') | |
| # Start tf session | |
| sess = tf.Session() | |
| # Run the op |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import subprocess | |
| import os | |
| def run(command): | |
| print(command) | |
| process = subprocess.call(command, shell=True, cwd='/tmp/') | |
| def lambda_handler(event, context): | |
| GITHUB_EMAIL = os.environ['GITHUB_EMAIL'] | |
| GITHUB_USERNAME = os.environ['GITHUB_USERNAME'] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pip install numpy -t deployment_package | |
| cp lambda_handler.py deployment_package | |
| (cd deployment_package && zip -r ../package.zip .) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import numpy as np | |
| def lambda_handler(event, context): | |
| input_array = np.array(event['array']) | |
| num_dimensions = input_array.ndim | |
| return num_dimensions |
NewerOlder