municip. | population | start date | expected mortality | actual mortality | excess rate | date of peak | figure |
---|---|---|---|---|---|---|---|
Nembro | 11526 | 2020‑02‑20 | 15 | 149 | 993% | 2020‑03‑10 | ![]() |
Albino | 17805 | 2020‑02‑21 | 15 | 141 | 940% | 2020‑03‑13 | .get_paginator('list_objects') | |
with open('manifest.jsonl', 'w') as f: | |
for page in paginator.paginate(Bucket=bucket, Prefix=prefix): | |
for obj in page['Contents']: | |
lbl = 0 if 'dog.' in obj['Key'] else 1 | |
f.write('{{"source-ref":"s3://{}/{}", "class":"{}"}}\n'\ | |
.format(bucket, obj['Key'], lbl)) |
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
aws stepfunctions start-execution \ | |
- state-machine-arn {CrossValidatorStateMachineArn} \ | |
- input file://my_input.json |
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 glob | |
prefix = 's3://my_bucket/dogs_vs_cats/' | |
with open('manifest.jsonl', 'w') as f: | |
for img in glob.glob('*.jpg'): | |
lbl = 0 if img.startswith('dog') else 1 | |
f.write('{{"source-ref":"{}{}", "class":"{}"}}\n'\ | |
.format(prefix, img, lbl)) |
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
''' | |
A snippet demonstrating how an AWS IoT device can make direct calls to every AWS | |
service using only the device certificate and private key. | |
For more info see the docs at https://docs.aws.amazon.com/iot/latest/developerguide/authorizing-direct-aws.html | |
to create the role and the role alias. To get the AWS IoT credential provider endpoint of your account you can use | |
$ aws iot describe-endpoint --endpoint-type iot:CredentialProvider | |
Dependencies: requests and boto3 |
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 os | |
import json | |
from pathlib import Path | |
from urllib.parse import urljoin | |
import jsonschema | |
def add_local_schemas_to(resolver, schema_folder, base_uri, schema_ext='.schema.json'): | |
''' Add local schema instances to a resolver schema cache. | |
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
''' The parse_telegram_export function in this gist parses the html export of a Telegram chat. | |
You should have [BeautifulSoup](https://www.crummy.com/software/BeautifulSoup/bs4/) and | |
[dateutil](https://dateutil.readthedocs.io/) installed. It extracts the sender name, the | |
message date and time, the message text and the links in the message. | |
''' | |
from bs4 import BeautifulSoup | |
import dateutil | |
def parse_telegram_export(html_str, tz_name=None): |
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 __future__ import print_function | |
import csv | |
def print_row(row, maxlen): | |
for elem, len in zip (row, maxlen): | |
print('| {} '.format(elem.ljust(len)), end='') | |
print('|') | |
def print_hline(maxlen): | |
for len in maxlen: |
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 boto3 | |
import logging | |
import json | |
import re | |
import uuid | |
import argparse | |
''' | |
This script enables the IoT shadow syncing for your AWS Greengrass Core. |