I hereby claim:
- I am vlcinsky on github.
- I am vlcinsky (https://keybase.io/vlcinsky) on keybase.
- I have a public key ASCnbRr-ve9t3Vb2dPBwo8lMftVKos2jXs4Q6PlcgfZw4go
To claim this, I am signing this object:
import json | |
import boto3 | |
class S3JsonBucket: | |
def __init__(self, bucket_name): | |
self.bucket = boto3.resource("s3").Bucket(bucket_name) | |
def load(self, key): |
[tool.poetry] | |
name = "pytestver" | |
version = "0.1.0" | |
description = "" | |
authors = ["Jan Vlcinsky <jan.vlcinsky@tamtamresearch.com>"] | |
[tool.poetry.dependencies] | |
python = "^3.10" | |
[tool.poetry.dev-dependencies] |
[tool.poetry] | |
name = "jinjatest" | |
version = "0.1.0" | |
description = "" | |
authors = ["Jan Vlcinsky <jan.vlcinsky@tamtamresearch.com>"] | |
[tool.poetry.dependencies] | |
python = "^3.7" | |
[tool.poetry.dev-dependencies] |
import os | |
def task_one(): | |
def create_cmd_string(a, b, target): | |
return "echo a: %s b: %s > %s" % (a, b, target) | |
with open("list_of_input_filenames.txt") as f: | |
fnames = [line.strip() for line in f.readlines() if line] | |
for a in fnames: |
I hereby claim:
To claim this, I am signing this object:
def calculate_age_in_minutes(rec_time, pub_time): | |
""" | |
pub_time .. string with datetime in ISO 8601 format. Time, when is the feed published (mostly current time). | |
rec_time .. string with datetime in ISO 8601 format. Time, when record was created. | |
sample ISO string: 2011-10-25T13:55:42.123Z | |
return .. integer with duration between pub_time and rec_time expressed in minutes | |
""" | |
#parsing pub_time to datetime structure. Ignoring timezone and fractions of seconds | |
pub_t = datetime.datetime.strptime(pub_time[:19],"%Y-%m-%dT%H:%M:%S") |
def versioned_bucket_lister(bucket, prefix='', delimiter='', | |
key_marker='', version_id_marker='', headers=None): | |
""" | |
A generator function for listing versions in a bucket. | |
""" | |
more_results = True | |
k = None | |
while more_results: | |
rs = bucket.get_all_versions(prefix=prefix, key_marker=key_marker, | |
version_id_marker=version_id_marker, |
<Documents> | |
<Document id="1" time="5/2/2010"> | |
</Document> | |
<Document id="2" time="4/8/2011"> | |
</Document> | |
<Document id="3" time="6/9/2010"> | |
</Document> | |
<Document id="4" time="8/10/2010"> | |
</Document> | |
</Documents> |
for $doc in //Document | |
let $datestr := $doc/@time | |
let $datearr := tokenize($datestr, '/') | |
let $year := $datearr[3] | |
let $month := format-number(xs:int($datearr[2]), '#00') | |
let $day := format-number(xs:int($datearr[1]), '#00') | |
let $dateisostr := concat($year, '-', $month, '-', $day) | |
where $dateisostr > '2010-06-01' and $dateisostr < '2011-01-01' | |
(: | |
let $date := xs:date($dateisostr) |
cd d:\var\projects |