Skip to content

Instantly share code, notes, and snippets.

from dataclasses import dataclass
from factory import Faker
from factory.alchemy import SQLAlchemyModelFactory
from faker import providers
from sqlalchemy import Column, Integer, String
Faker.add_provider(providers.internet)
Faker.add_provider(providers.date_time)
#!/usr/bin/env python
import json
from stumpf.app import create_app
from stumpf.diva_fact_schemas import ActivityStatus
def main():
map = {}
app = create_app({})
#!/usr/bin/env python
import json
import sys
def main(ids):
if not len(ids):
print('Usage: %s id [id [id ...] ]' % sys.argv[0])
sys.exit(1)
try:
This file has been truncated, but you can view the full file.
{"1962013705373852446": "3674f223-c283-463c-bc32-a1980548d49d", "5656378033815299130": "9cfefbb4-b9c4-4875-9206-2561abf7d939", "576559719765483851": "1000b405-50d7-4296-b848-838aa2da1577", "41154296447279729": "01246b3a-a971-44e2-9cc3-c01f2ff9dbe0", "3369453097041011047": "5d85677a-b0f0-42ce-a0ca-cc1dbfebb720", "2752769918904771807": "4c679b50-1966-49bf-b58f-7a75d697218f", "238968998537044898": "06a1fa13-7c43-4745-a563-49ca02763780", "4553076208071124806": "7e5f8d60-42b9-4e8c-b20e-179c2c98bc02", "255144580194673543": "0714e949-a9bd-470f-9834-1ea5c53936bb", "1647741021997803455": "2dbbe775-7409-4f7e-a826-4de38dc988a3", "96525180692898501": "02adda47-e629-458b-9f40-7d91fe540e94", "2597774124104459621": "481a4b9a-c3e5-4acb-a43f-d1249c37949b", "4862498879735603223": "86f621ef-dec0-402e-9aee-fe249d8e11e0", "7108345004323317354": "c54bd43d-573a-4cd5-8aa8-9cbff2d27775", "2029140424725472151": "3851e8ee-4e4b-472e-8920-e1165d78c11c", "1059293324928755549": "1d66bb55-52a4-4ebb-a525-c812420e7b7b", "1329266215302506302":
def int_to_uuid(id):
h = hex(int(id) << 65)[2:]
assert len(h) <= 32
for i in range(len(h), 32):
h = '0' + h
assert len(h) == 32
return h[:8] + '-' + h[8:12] + '-' + h[12:14]
@jbeezley
jbeezley / cov.sh
Last active October 19, 2017 12:35
#!/bin/bash
coverage erase
test_files="retrograde/tests/test_*.py"
if [ $# -gt 0 ] ; then
test_files="$@"
fi
export PYTHONPATH=$PWD
[2017-09-05 09:22:58,722: ERROR/ForkPoolWorker-11] Task girder_worker.run[39d9bc24-09cb-453b-8356-eeb6f13af467] raised unexpected: AttributeError("'NoneType' object has no attribute 'get'",)
Traceback (most recent call last):
File "/home/jbeezley/git/girder_worker/env/lib/python2.7/site-packages/celery/app/trace.py", line 367, in trace_task
R = retval = fun(*args, **kwargs)
File "/home/jbeezley/git/girder_worker/env/lib/python2.7/site-packages/celery/app/trace.py", line 622, in __protected_call__
return self.run(*args, **kwargs)
File "/home/jbeezley/git/girder_worker/girder_worker/tasks.py", line 19, in run
return core.run(*pargs, **kwargs)
File "/home/jbeezley/git/girder_worker/girder_worker/core/utils.py", line 123, in wrapped
return fn(*args, **kwargs)
$ girder-install web --dev --all-plugins
npm WARN deprecated minimatch@0.2.14: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated graceful-fs@1.2.3: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
npm WARN deprecated minimatch@0.3.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN prefer global jsonlint@1.6.2 should be installed with -g
npm WARN prefer global marked@0.3.6 should be installed with -g
npm WARN prefer global coffee-script@1.10.0 should be installed with -g
> phantomjs-prebuilt@2.1.14 install /home/jbeezley/test/master/node_modules/phantomjs-prebuilt
> node install.js
> girder@2.1.0 build /home/jbeezley/tmp/girder
> grunt init && NODE_PATH=$PWD/node_modules grunt "--plugins=large_image"
Running "setup" task
Running "shell:fontello" (shell) task
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 100 540k 100 540k 0 0 4255k 0 --:--:-- --:--:-- --:--:-- 4287k
# deb cdrom:[Ubuntu 16.04 LTS _Xenial Xerus_ - Release amd64 (20160420.1)]/ xenial main restricted
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://us.archive.ubuntu.com/ubuntu/ xenial main restricted
# deb-src http://us.archive.ubuntu.com/ubuntu/ xenial main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb http://us.archive.ubuntu.com/ubuntu/ xenial-updates main restricted