This is a simple description of the tutorial.
When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.
Please note we have a code of conduct, please follow it in all your interactions with the project.
- Ensure any install or build dependencies are removed before the end of the layer when doing a
This file contains 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
var AWS = require('aws-sdk'); | |
var cloudwatch = new AWS.CloudWatch({ region: 'us-east-1'}); | |
exports.handler = function (event, context) { | |
var ElasticSearchHost = 'elasticsearch.example:9200'; | |
var Environment = 'int'; | |
var EndTime = new Date; | |
var StartTime = new Date(EndTime - 15*60*1000); | |
var Metrics = { |
This file contains 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
logs/ |
This file contains 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 unittest | |
import os | |
from zipfile import ZipFile | |
from mock import MagicMock, patch, Mock, mock_open | |
# The functions that are tested: | |
def function_to_test_zipfile(example_arg): | |
with ZipFile(example_arg, 'r') as zip_in: | |
for input_file in zip_in.infolist(): |
This file contains 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
d = {1:11, 2:22, 3:33} | |
# filter by key | |
d2 = {k : v for k,v in filter(lambda t: t[0] in [1, 3], d.iteritems())} | |
# filter by value | |
d3 = {k : v for k,v in d.iteritems() if k in [2,3]} |
This file contains 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 typing import Dict | |
# Helper function to generate dict object | |
def get_menu() -> Dict[str, dict]: | |
return { | |
"TIMMY_BLACK": { | |
"item": "Timmy's Coffee Barista's Black", | |
"sugar_free": True, | |
"with_milk": False, | |
}, |
This file contains 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
class FilterableDict(dict): | |
def __call__(self, filter_): | |
return FilterableDict([k, v for k, v in self.iteritems() if filter_(v) else None, None]) | |
class Filter(object): | |
def __call__(self, o): | |
throw NotImplementedError() | |
def __and__(self, right): |