hexsha
stringlengths
40
40
size
int64
5
2.06M
ext
stringclasses
11 values
lang
stringclasses
1 value
max_stars_repo_path
stringlengths
3
251
max_stars_repo_name
stringlengths
4
130
max_stars_repo_head_hexsha
stringlengths
40
78
max_stars_repo_licenses
listlengths
1
10
max_stars_count
int64
1
191k
max_stars_repo_stars_event_min_datetime
stringlengths
24
24
max_stars_repo_stars_event_max_datetime
stringlengths
24
24
max_issues_repo_path
stringlengths
3
251
max_issues_repo_name
stringlengths
4
130
max_issues_repo_head_hexsha
stringlengths
40
78
max_issues_repo_licenses
listlengths
1
10
max_issues_count
int64
1
116k
max_issues_repo_issues_event_min_datetime
stringlengths
24
24
max_issues_repo_issues_event_max_datetime
stringlengths
24
24
max_forks_repo_path
stringlengths
3
251
max_forks_repo_name
stringlengths
4
130
max_forks_repo_head_hexsha
stringlengths
40
78
max_forks_repo_licenses
listlengths
1
10
max_forks_count
int64
1
105k
max_forks_repo_forks_event_min_datetime
stringlengths
24
24
max_forks_repo_forks_event_max_datetime
stringlengths
24
24
content
stringlengths
1
1.05M
avg_line_length
float64
1
1.02M
max_line_length
int64
3
1.04M
alphanum_fraction
float64
0
1
b765d8a9e197945a8d8e649b5d2aab25a4ba41c1
1,548
py
Python
posthog/apps.py
adamb70/posthog
54ae8f0e70092f86b4aefbd93b56680dbd28b1c5
[ "MIT" ]
null
null
null
posthog/apps.py
adamb70/posthog
54ae8f0e70092f86b4aefbd93b56680dbd28b1c5
[ "MIT" ]
null
null
null
posthog/apps.py
adamb70/posthog
54ae8f0e70092f86b4aefbd93b56680dbd28b1c5
[ "MIT" ]
null
null
null
import os import sys import posthoganalytics from django.apps import AppConfig from django.conf import settings from posthog.utils import get_git_branch, get_git_commit, get_machine_id from posthog.version import VERSION
34.4
111
0.628553
b765edd3d7064dd1a82224294d673c2cee6bca1a
836
py
Python
src/task_timer.py
dlb-rl/pulse-rl
ebe78d2286b2199d18b86941fbc9990e0d5c354a
[ "MIT" ]
4
2021-12-06T09:19:14.000Z
2022-01-31T13:58:06.000Z
src/task_timer.py
dlb-rl/pulse-rl
ebe78d2286b2199d18b86941fbc9990e0d5c354a
[ "MIT" ]
null
null
null
src/task_timer.py
dlb-rl/pulse-rl
ebe78d2286b2199d18b86941fbc9990e0d5c354a
[ "MIT" ]
null
null
null
import os import json import time from datetime import timedelta
26.967742
85
0.574163
b7660ef0961ba8b4931477e766e7019f01819220
8,718
py
Python
tasks-deploy/terminal/check.py
chankruze/qctf-school-2018
1e732cf264ee0a94bc2fc1fd8cf3a20660d57605
[ "MIT" ]
null
null
null
tasks-deploy/terminal/check.py
chankruze/qctf-school-2018
1e732cf264ee0a94bc2fc1fd8cf3a20660d57605
[ "MIT" ]
null
null
null
tasks-deploy/terminal/check.py
chankruze/qctf-school-2018
1e732cf264ee0a94bc2fc1fd8cf3a20660d57605
[ "MIT" ]
null
null
null
#!/usr/bin/env python3 flags = ['QCTF{2a5576bc51a5c3feb82c96fe80d3a520}', 'QCTF{eb2ddbf0e318812ede843e8ecec6144f}', 'QCTF{5cdf65c6069a6b815352c3f1b4d09a56}', 'QCTF{69d7b7deb23746b8bd18b22f3eb92b50}', 'QCTF{44e37938c0bc05393b5b33a70c5a70db}', 'QCTF{3b37a953391e38ce0b8e168e9eaa6ec5}', 'QCTF{ee2848cb73236007d36cb5ae75c4d2bf}', 'QCTF{8dceee7e583b81a844a58ae72bf0671f}', 'QCTF{1e3dbf7253eaa1454ba21806dd1fc14c}', 'QCTF{da8f9cc7d7f1b1481f87f6390fa25e0c}', 'QCTF{ef7e72c36017f57e3f6b940b25bcd3b8}', 'QCTF{41342b5fdd954b2ff55773096c335f52}', 'QCTF{35fa8fbb26685d098fc776e0a36f49aa}', 'QCTF{168ab402de637d3d309d32d5290e1e31}', 'QCTF{f184a2e0373a244ed3a1b84a9bdb3a23}', 'QCTF{f586fdb5119afc82250ed69fe9bdc7dd}', 'QCTF{1f13c89d8c9eb5573c15ecd50d2f9e50}', 'QCTF{11dfd6714cf59973c28b29c27b3f84df}', 'QCTF{210050152f6adf890bc663580cbca181}', 'QCTF{8200b5ef385ca392651e186a436e0609}', 'QCTF{552eb20e1897c751adf2e320f47d9179}', 'QCTF{cb6efd12b769ea8f1c38c98f1977d5ce}', 'QCTF{004072519dd358254b1de59133ba8386}', 'QCTF{9c4b21c7c3a0fcc3f391695968b7c7e9}', 'QCTF{5a940d17a3b9afa668381947469dd9f7}', 'QCTF{7a3891890abaf4921b8fb2e4a940eb2d}', 'QCTF{3527635e90dc57fe164d5f8d88dbcb38}', 'QCTF{3c5c5abd09bdcfdf09e65eba1eb80b24}', 'QCTF{6f46a5846a40d68d6a035a2ad60a2622}', 'QCTF{794223155a79df0d44a13687b1ed2003}', 'QCTF{43d4cb8f632f779975d6060b5193153f}', 'QCTF{775427be397d5bf852a046e65884d7f9}', 'QCTF{f9fd2dff056c2d47d14bdb9a417d99d5}', 'QCTF{300e2128e66389b5d3c3e057c1ade37f}', 'QCTF{25ee8ba64e6f578a14065aef15fb0028}', 'QCTF{7b0a45a53a059e55dcccf3b7e975ff2e}', 'QCTF{ebff50288af7c8a2a7bd8b1e11a8a612}', 'QCTF{b9a51b35b496056c4fbce56d3c6368e5}', 'QCTF{e1c9872464c4a27cbab39abcd86203b9}', 'QCTF{249589aeb27f9215b209dd933b6dccd8}', 'QCTF{55edfaf50d7e83ade9a98655fca33b31}', 'QCTF{597ab70595c974e07e31a3fa1277bf11}', 'QCTF{7c5023239ef7f22c41aa606ce9aaba5b}', 'QCTF{72257f0fb4a980bcbd9a6f41f52a370b}', 'QCTF{fc09caef8f7c55cd878344568f47a382}', 'QCTF{1dc7595bdbd4c4c60ceda6e21709e6f2}', 'QCTF{d19d9769e8c4262f3a66c95f63fe7f34}', 'QCTF{dec3d0c80f0df0e5af9a97d665dbdc37}', 'QCTF{02bafaf609aaa269bd8abf417208bb54}', 'QCTF{67507d62a48f4e06275f3363b7876d3c}', 'QCTF{8a5a2752374ef22803d1e600177b1bb4}', 'QCTF{a353e9e2be2070249cd297715ea6b10a}', 'QCTF{80225cecfb252b774fa338313e9430b7}', 'QCTF{fa584956ef689e8b341e1d734c734719}', 'QCTF{63015e092eb29efb121f3253cd21c379}', 'QCTF{d62443dfd293d1e412afe00676e437d5}', 'QCTF{59e40e54a8c5a04526e545bbee435249}', 'QCTF{30702aa0f1f56f7c6b8f738602e498e0}', 'QCTF{efec73d04226055571e8f18c96ee3c96}', 'QCTF{9d1dc2ea33d36391531c5555bf39e433}', 'QCTF{d367af673f3c9cf0fdb2893b00689b7c}', 'QCTF{1e24ece8acce5ad1902f412338b01e53}', 'QCTF{88293463e852a19b1c5009bbb1d6ed5f}', 'QCTF{319a0909fd0df476109c9bab65b5202a}', 'QCTF{59f28c649809dd3e4287c72f617428a4}', 'QCTF{ce7df959f53a8dea0ce1e3aa0c2eb8f8}', 'QCTF{5386d6256232979494c48252ee1dd640}', 'QCTF{5ad8efd6bb44d0604cba3800600b1d0e}', 'QCTF{087ca88149d4323d1f00be02a882a79b}', 'QCTF{ce4abbce715a72951061f7adcf15ea1b}', 'QCTF{301e2306bc2849fb53fff0595afc3ed1}', 'QCTF{206d3753e0070c66561a16abfa9c845b}', 'QCTF{05e734b3544679475050326e11441d6e}', 'QCTF{f45249ac1b299ac8a9f430a791e20ceb}', 'QCTF{3433fc22bbc389ba386c1d21f532ed3b}', 'QCTF{15edbf8aaa728eb81ba6f555997f4815}', 'QCTF{580fe8c58bf434bc5f2eef7420649673}', 'QCTF{e41bfb2090daf3773fa230eee97c2d90}', 'QCTF{654380c696844545896584334e208184}', 'QCTF{3946d70c84bf4810cf7e9a31e0b12cff}', 'QCTF{97b67f280a1b2bf58f8bd54ad8ceff66}', 'QCTF{3278f990d9dd5f5dd67c2d4b9d230753}', 'QCTF{f966c22475a0964eaa834830bfe338bd}', 'QCTF{3f913b97b23c854fcdf6fddc41743c62}', 'QCTF{e5dc135b13c2c5b5371d9c24b7715a90}', 'QCTF{70cfc6a3e2f98e98f3488d5180fd3d1c}', 'QCTF{1dfea28b554380e772736d0b3e2e060d}', 'QCTF{4cf742197c83c13a76ffd38fcd9394c7}', 'QCTF{0389931bc1415676698558259dd33911}', 'QCTF{2c6a7d2d0cb06b7050164c593b6eff88}', 'QCTF{43bd14ac279307f5370ae6ec6e50404e}', 'QCTF{9dc8266201ea1ba7072d3a717099bab1}', 'QCTF{f35148de32676d50e1d7b2482f800a2c}', 'QCTF{70c01985b0e31b6915a4e42936dedf25}', 'QCTF{231cdcc8bbf386a10e93530cb4595991}', 'QCTF{543a9e949ff8f72b7388b39d44288b55}', 'QCTF{2bb32c8b3e2468bc6f3f1140e02e1e33}', 'QCTF{b5f4dd820207d40769649252979ce450}', 'QCTF{1432aeb99dc6560626d075c9666973e2}', 'QCTF{7520b882081e987b73e728409c38bb55}', 'QCTF{8748557fa294f0c49ef93016ce1ca4ab}', 'QCTF{51e68ed7cbeae5ef716ff98a95ea783a}', 'QCTF{6a2643309f4ffd5856aeb90e6c68267e}', 'QCTF{9eb6102744e6c0e9994d7886ed125f8e}', 'QCTF{0731061397ccd2de5b324ce6c13dc611}', 'QCTF{3b106d379fa05638d90ed9a5a1dfdcbe}', 'QCTF{e539d324465979cb4c54773139ba833f}', 'QCTF{ac0e2a0b56508dfa6b253823697e842d}', 'QCTF{6b020c80f9b62510caec2ec17a07b640}', 'QCTF{00a1c7c11aedc76428ded7dd254adc31}', 'QCTF{2be348ddb0c9d391c114b5878ac1a3ae}', 'QCTF{5875aa9d30aca2e4590534016342aba7}', 'QCTF{07c01bde7f54d222d59e1f45781e8acc}', 'QCTF{1e3f24b6cd7066ac673048656d7d2fc9}', 'QCTF{0a75b22e9f94f3dfc19ab4b934b2961d}', 'QCTF{6a6564ca624d02b152987d5a595cf7bc}', 'QCTF{52463184224982ccf2f9346438f92268}', 'QCTF{ab014a22c6ea08979323fd8a467f1f4a}', 'QCTF{4a3e06c87bb6c0580195db33b39776f7}', 'QCTF{395eb9a839f59f933e135b02d9543c3b}', 'QCTF{c4fd0005bf0d339ff0f7e1860baa5f36}', 'QCTF{aa15b27e2f0485ca04ae787530c1ed18}', 'QCTF{10e844c23ec931932ea6bd4e3e728004}', 'QCTF{b8b86c195cb7dcb041e9dfb3d6b94573}', 'QCTF{932ff0cf891fe181b78a8763eb82a6c4}', 'QCTF{d6f4a756a5206321737afb1e0a183844}', 'QCTF{8c93d71184c17684c92e409e39cb7c00}', 'QCTF{dc4e8fb58fa2ed616d123a73b1a81467}', 'QCTF{8ee320c8dea80ef18d04534ff798caba}', 'QCTF{6a11a92d100293a4835f54dde05cbe34}', 'QCTF{9a79fff31abe7e4718070fa517e64fc0}', 'QCTF{ef93a88f1454894b3940fd2aa93e048d}', 'QCTF{0bed196ea7b09a5db9f31ef3c7f6848d}', 'QCTF{cee84fc49b89ffa988f52d0797baa73d}', 'QCTF{9e80c3d1bba93faa3b45eda0b912a02c}', 'QCTF{cac025aa9e5f4394744f12db0f3e5f71}', 'QCTF{5ee478bf634afe72ae0d3b9e95faf021}', 'QCTF{a5903dad242c4413fa99381d340226d1}', 'QCTF{abcd7d765c23353e38dc09a616bd9bde}', 'QCTF{c13ed258f4775efa54d5b166dd3240ed}', 'QCTF{e08e0a83b3a96cbf379380139b65cc7e}', 'QCTF{7b3803fdb94ff47cf63b7526ac388bc1}', 'QCTF{352ca5de54ffbe8515635118c787b8af}', 'QCTF{50da9ea0ae8ad773bde9a1577ceee9ff}', 'QCTF{7564194acd79f1eb36e46b33143361eb}', 'QCTF{05e594d4643b5b256084d33e51789029}', 'QCTF{36ba558d89ae53394cbd7eaf497601e3}', 'QCTF{33c50dc466f2cfaf68d173a7af16377a}', 'QCTF{903fa3b7125aa29dd2edcb1f2c5da381}', 'QCTF{4bc7246bfdd22e310bbfa25046b20d2c}', 'QCTF{baf8274e1ad81a53c9ca3a1c4762d718}', 'QCTF{9066fe52443e5978e9b82fe2b0801b03}', 'QCTF{39acd1bd34c6a258f3f7167dc21c7a85}', 'QCTF{deca3ebff2319c1e1df6fe96ffb2ff7b}', 'QCTF{0324d544b5e46489943574b02061ebed}', 'QCTF{d08bde8d29c4de77c3439eed7eeb677a}', 'QCTF{16337906f4fa89ee4dd04e6ad1fec14f}', 'QCTF{44de9c99a06af160110e707b93c3dd79}', 'QCTF{87a3543161d6d0ac1497ef1e43de70ec}', 'QCTF{41460476cb83e4544c1b0018c4b20980}', 'QCTF{c0242fbcf990f3a62e6be743a65d07f8}', 'QCTF{a865da86e6d2a17ab3b848f47f997704}', 'QCTF{51ac3d05e0fd1cdc6c9a31c47d2a3a88}', 'QCTF{943ca3ce0cc488be0589ca207806738d}', 'QCTF{f24460a3ce62c641236671b66f193054}', 'QCTF{87980f7c165f4d392c6d377ef6706027}', 'QCTF{2b3ef8a0e956b8d1b9c0373e5686147e}', 'QCTF{97fc9edc359c3ac1f368ea9d6f707ee2}', 'QCTF{f39d636b8d20fdb174bf627c94af8308}', 'QCTF{3eb03e255dacfff2f34afd34f0791f06}', 'QCTF{b819ac459aa4570528e102929befec96}', 'QCTF{7cbf5260678a762738a45a9a08a0d049}', 'QCTF{c58971009a765417bf73916323eb68e1}', 'QCTF{77444071adcf5221c83ad35ebc6c4cdb}', 'QCTF{53a01ebed36320ab8a71084c94ba585f}', 'QCTF{c89f06767a21bdd15a463a92897b0cae}', 'QCTF{6a4cf33cc6fcea2fab3e9612a57994fd}', 'QCTF{0bb8a72a683c35fa835226f7c5ebe3a9}', 'QCTF{206b39742a866fed482a03ce5b6dbd1c}', 'QCTF{4f027a70b064eac7ff2e9ca3d2e03b1d}', 'QCTF{4c39da37e2580f8deb5eba08ed7d5a57}', 'QCTF{f99cfb8878971c21b243f818e505b61e}', 'QCTF{e7daf2f64180b615c1c4ebbecadd0518}', 'QCTF{3304f198c3435e0d49a67f1672a08209}', 'QCTF{e720953183625b8a69a2f8e3e8a8d93a}', 'QCTF{350655c7d8bbaa6495d9ebfa1c0d76a7}', 'QCTF{d74759b2ad78fa941ef19257976392d4}', 'QCTF{146730e07ca858bbf709c2f5bee0a41e}', 'QCTF{db1962db2dc72006c551f14912f3a81a}', 'QCTF{0273d4d040f7de7daa2cea88b86f8f62}', 'QCTF{56ff70053c7a1dba014711c73f3f0486}', 'QCTF{90548bc64e69a21ace8d622e0c21d485}', 'QCTF{052d0c62d05b258b6e4d0fbb64d2c837}', 'QCTF{9fbf42a0d9c53b2b78dc9abef52dd368}', 'QCTF{cf50c6918c393ab19066d688fee7f3d1}', 'QCTF{c7a5a9ca5a29f3bdcd13bc38b4960506}', 'QCTF{c92b7a3db35070eda9793a250a8b8373}', 'QCTF{04d0261d7237329eeabe658967e752ca}', 'QCTF{f52a7914bb09c7cfea77ac0cc91c68b1}', 'QCTF{cc2c170948663de9d7dd25e4e6ce8834}']
670.615385
8,408
0.848704
b76732831186e479ef5311c8854a1d2a5b3efda3
18,186
py
Python
bioshareX/api/views.py
amschaal/bioshare
7ac5da6874f70605ded8757c46fd9629d2d3d18b
[ "MIT" ]
7
2015-12-10T23:23:53.000Z
2018-08-22T11:00:28.000Z
bioshareX/api/views.py
amschaal/bioshare
7ac5da6874f70605ded8757c46fd9629d2d3d18b
[ "MIT" ]
61
2015-12-11T01:26:26.000Z
2021-10-05T00:25:20.000Z
bioshareX/api/views.py
amschaal/bioshare
7ac5da6874f70605ded8757c46fd9629d2d3d18b
[ "MIT" ]
2
2019-05-31T16:33:37.000Z
2021-05-03T20:51:25.000Z
# Create your views here. from django.core.urlresolvers import reverse from django.http.response import JsonResponse, HttpResponse from settings.settings import AUTHORIZED_KEYS_FILE, SITE_URL from bioshareX.models import Share, SSHKey, MetaData, Tag from bioshareX.forms import MetaDataForm, json_form_validate from guardian.shortcuts import get_perms, get_users_with_perms, remove_perm, assign_perm from bioshareX.utils import JSONDecorator, json_response, json_error, share_access_decorator, safe_path_decorator, validate_email, fetchall,\ test_path, du from django.contrib.auth.models import User, Group from django.db.models import Q import os from rest_framework.decorators import api_view, detail_route, throttle_classes,\ action from bioshareX.forms import ShareForm from guardian.decorators import permission_required from bioshareX.utils import ajax_login_required, email_users from rest_framework import generics, viewsets, status from bioshareX.models import ShareLog, Message from bioshareX.api.serializers import ShareLogSerializer, ShareSerializer,\ GroupSerializer, UserSerializer, MessageSerializer from rest_framework.permissions import DjangoModelPermissions, IsAuthenticated from bioshareX.permissions import ManageGroupPermission from rest_framework.response import Response from guardian.models import UserObjectPermission from django.contrib.contenttypes.models import ContentType import datetime from bioshareX.api.filters import UserShareFilter, ShareTagFilter,\ GroupShareFilter, ActiveMessageFilter from rest_framework.throttling import UserRateThrottle from django.utils import timezone import csv def get_group(request): query = request.GET.get('query') try: group = Group.objects.get(name=query) return json_response({'group':{'name':group.name}}) except Exception, e: return json_error([e.message]) """ Requires: "name", "notes", "filesystem" arguments. Optional: "link_to_path", "read_only" """ class ShareLogList(generics.ListAPIView): serializer_class = ShareLogSerializer permission_classes = (IsAuthenticated,) filter_fields = {'action':['icontains'],'user__username':['icontains'],'text':['icontains'],'paths':['icontains'],'share':['exact']} # @detail_route(['POST']) # def remove_user(self,request,*args,**kwargs): # # user = request.query_params.get('user') # # self.get_object().user_set.remove(user) # return Response({'status':'success'})
47.11399
298
0.651875
b769a2ddbb714e86c922fd616f0acb57b564206d
5,192
py
Python
db_query.py
UiOHive/FinseDashboard
14184fbc425e87a4b9a13b3a9b31159b181cf357
[ "MIT" ]
null
null
null
db_query.py
UiOHive/FinseDashboard
14184fbc425e87a4b9a13b3a9b31159b181cf357
[ "MIT" ]
null
null
null
db_query.py
UiOHive/FinseDashboard
14184fbc425e87a4b9a13b3a9b31159b181cf357
[ "MIT" ]
null
null
null
import datetime import os, sys import pprint import requests from pandas.io.json import json_normalize import pandas as pd URL = 'https://wsn.latice.eu/api/query/v2/' #URL = 'http://localhost:8000/wsn/api/query/v2/' #TOKEN = os.getenv('WSN_TOKEN') TOKEN = os.getenv('WSN_TOKEN') path = os.getcwd() if __name__ == '__main__': # We need an authentication token TOKEN = os.getenv('WSN_TOKEN') # Number of elements to return in every query limit = 100 # Example 1: Get all the fields and tags of a given mote from a given time. # This is good to explore the data, but bad on performance. response = query(limit=limit, serial=0x1F566F057C105487, time__gte=datetime.datetime(2017, 11, 15), debug=True, ) # Example 2: Get the RSSI of an Xbee module identified by its address print('==============================================') response = query(limit=limit, source_addr_long=0x0013A2004105D4B6, fields=['rssi'], debug=True, ) # Example 3: Get the battery and internal temperature from all motes, # include the serial tag to tell them apart. # Frames that don't have at least one of the fields we ask for will not be # included. print('==============================================') response = query(limit=limit, fields=['bat', 'in_temp'], tags=['serial'], debug=True, ) # Example 4: Get the time the frame was received by the Pi print('==============================================') response = query(limit=limit, serial=408520806, fields=['received'], debug=True, ) # Example 5: Get the battery once every hour response = query(limit=10, serial=0x1F566F057C105487, fields=['bat'], interval=3600, debug=True, )
28.217391
125
0.573575
b76bc1e49faa136f8b812dcedd6dc878d0d8aa05
4,716
py
Python
src/olympia/reviews/tests/test_models.py
leplatrem/addons-server
8b5ebda6f33194aa9fce12c0453574e7f850e6ad
[ "BSD-3-Clause" ]
null
null
null
src/olympia/reviews/tests/test_models.py
leplatrem/addons-server
8b5ebda6f33194aa9fce12c0453574e7f850e6ad
[ "BSD-3-Clause" ]
null
null
null
src/olympia/reviews/tests/test_models.py
leplatrem/addons-server
8b5ebda6f33194aa9fce12c0453574e7f850e6ad
[ "BSD-3-Clause" ]
null
null
null
from django.utils import translation from olympia import amo from olympia.amo.tests import TestCase, ESTestCase from olympia.addons.models import Addon from olympia.reviews import tasks from olympia.reviews.models import ( check_spam, GroupedRating, Review, ReviewFlag, Spam) from olympia.users.models import UserProfile
31.44
78
0.636556
b76c4833b7dafb63e3cda3a938dba6519b8c5061
1,544
py
Python
snpy/spline2/__init__.py
emirkmo/snpy
2a0153c84477ba8a30310d7dbca3d5a8f24de3c6
[ "MIT" ]
6
2019-01-14T19:40:45.000Z
2021-06-05T12:19:39.000Z
snpy/spline2/__init__.py
emirkmo/snpy
2a0153c84477ba8a30310d7dbca3d5a8f24de3c6
[ "MIT" ]
3
2017-04-25T20:06:22.000Z
2021-06-09T20:46:41.000Z
snpy/spline2/__init__.py
emirkmo/snpy
2a0153c84477ba8a30310d7dbca3d5a8f24de3c6
[ "MIT" ]
8
2017-04-25T19:57:57.000Z
2021-11-12T11:54:19.000Z
''' Spline2.py: wrapper for B. Thijsse et al.'s hyper-spline routines. Yet another spline interpolation routine. The problem: given a set of experimental data with noise, find the spline with the optimal number of knots. Solution : They use the usual kind of routines to determine least-squares splines from a given set of knot points. The problem REALLY boils down to: how many knots do you use? There are two extremes: put a knot point on each data point to get an interpolating spline (which sucks for experimental data with noise). The other extreme is to have the minimal set of knots to define a polynomial of order k (e.g., a cubic). This also sucks. Somewhere between the two extremes is a number of knots that optimally recovers the information in the data and smooths out the noise. spline2 starts with a large number of knots (interpolating spline) and iteratively removes knots until a figure of merit reaches some prescribed value. In this case, this figure of merit is the Durbin-Watson statistic, which measures the auto- correlation between the residuals of the spline fit. For more details, see: * Barend J. Thijsse et al., "A Practical Algorithm for Least-Squares spline Approximation of Data Containing Noise", Computers in Physics, vol 12 no. 4 July 1998 * http://structureandchange.3me.tudelft.nl/ ''' from .spline2 import *
49.806452
74
0.687824
b76e06eb55845d82a11e8d62864a8001b125af43
703
py
Python
halo_app/infra/cache.py
halo-framework/halo-app
98e057b2f433d97d903589ac75a6c2544174bac8
[ "MIT" ]
null
null
null
halo_app/infra/cache.py
halo-framework/halo-app
98e057b2f433d97d903589ac75a6c2544174bac8
[ "MIT" ]
null
null
null
halo_app/infra/cache.py
halo-framework/halo-app
98e057b2f433d97d903589ac75a6c2544174bac8
[ "MIT" ]
null
null
null
from __future__ import annotations import elasticache_auto_discovery from pymemcache.client.hash import HashClient # elasticache settings elasticache_config_endpoint = "your-elasticache-cluster-endpoint:port" nodes = elasticache_auto_discovery.discover(elasticache_config_endpoint) nodes = map(lambda x: (x[1], int(x[2])), nodes) memcache_client = HashClient(nodes) def put(requestId, event): """ This function puts into memcache and get from it. Memcache is hosted using elasticache """ # Put the UUID to the cache. memcache_client.set(requestId, event)
25.107143
72
0.752489
b76e3c3a78b500e4bd43645ac8426138d20f7491
659
py
Python
uniclass_to_nf_ea_com_source/b_code/migrators/uniclass_raw_to_domain/evolve/evolve_stage_4/domain_table_data_processor/parent_code_column_adder.py
boro-alpha/uniclass_to_nf_ea_com
753e97467ce53c25bc86341b915489c2eeeb3f49
[ "MIT" ]
2
2021-08-09T14:40:04.000Z
2022-03-13T22:22:19.000Z
uniclass_to_nf_ea_com_source/b_code/migrators/uniclass_raw_to_domain/evolve/evolve_stage_4/domain_table_data_processor/parent_code_column_adder.py
boro-alpha/uniclass_to_nf_ea_com
753e97467ce53c25bc86341b915489c2eeeb3f49
[ "MIT" ]
null
null
null
uniclass_to_nf_ea_com_source/b_code/migrators/uniclass_raw_to_domain/evolve/evolve_stage_4/domain_table_data_processor/parent_code_column_adder.py
boro-alpha/uniclass_to_nf_ea_com
753e97467ce53c25bc86341b915489c2eeeb3f49
[ "MIT" ]
null
null
null
import numpy as np from uniclass_to_nf_ea_com_source.b_code.configurations.common_constants.uniclass_bclearer_constants import PARENT_CODE_COLUMN_NAME, \ UNICLASS2015_OBJECT_TABLE_NAME
27.458333
134
0.752656
b771162a3330c2472592fd5f42c757bebf6eb7a4
12,046
py
Python
ext/ANTsPyNet/antspynet/utilities/mixture_density_utilities.py
tsmonteiro/fmri_proc
ee740cfa3c3a7ef8e1ee1ebd3b286a66712e0ec1
[ "MIT" ]
2
2021-11-16T10:00:33.000Z
2021-12-13T02:57:40.000Z
ext/ANTsPyNet/antspynet/utilities/mixture_density_utilities.py
tsmonteiro/fmri_proc
ee740cfa3c3a7ef8e1ee1ebd3b286a66712e0ec1
[ "MIT" ]
null
null
null
ext/ANTsPyNet/antspynet/utilities/mixture_density_utilities.py
tsmonteiro/fmri_proc
ee740cfa3c3a7ef8e1ee1ebd3b286a66712e0ec1
[ "MIT" ]
1
2021-12-13T02:57:27.000Z
2021-12-13T02:57:27.000Z
import keras.backend as K from keras.engine import Layer, InputSpec from keras.layers import Concatenate from keras import initializers import numpy as np import tensorflow as tf import tensorflow_probability as tfp def get_mixture_density_loss_function(output_dimension, number_of_mixtures): """ Returns a loss function for the mixture density. Arguments --------- output_dimension : integer Dimensionality of the output. number_of_mixtures : integer Number of gaussians used. Returns ------- Function A function providing the mean square error accuracy """ with tf.name_scope("MixtureDensityNetwork"): return(loss_function) def get_mixture_density_sampling_function(output_dimension, number_of_mixtures): """ Returns a sampling function for the mixture density. Arguments --------- output_dimension : integer Dimensionality of the output. number_of_mixtures : integer Number of gaussians used. Returns ------- Function A function providing the mean square error accuracy """ with tf.name_scope("MixtureDensityNetwork"): return(sampling_function) def get_mixture_density_mse_function(output_dimension, number_of_mixtures): """ Returns a mse function for the mixture density. Arguments --------- output_dimension : integer Dimensionality of the output. number_of_mixtures : integer Number of gaussians used. Returns ------- Function A function providing the mean square error accuracy """ with tf.name_scope("MixtureDensityNetwork"): return(mse_accuracy_function) def split_mixture_parameters(parameters, output_dimension, number_of_mixtures): """ Splits the mixture parameters. Arguments --------- parameters : tuple Parameter to split output_dimension : integer Dimensionality of the output. number_of_mixtures : integer Number of gaussians used. Returns ------- List of arrays Separate mixture parameters """ dimension = number_of_mixtures * output_dimension mu = parameters[:dimension] sigma = parameters[dimension:(2 * dimension)] pi_logits = parameters[-number_of_mixtures:] return([mu, sigma, pi_logits]) def mixture_density_software_max(logits, temperature=1.0): """ Softmax function for mixture density with temperature adjustment. Arguments --------- logits : list or numpy array input temperature : The temperature for to adjust the distribution (default 1.0) Returns ------- Scalar Softmax loss value. """ e = np.array(logits) / temperature e -= np.max(e) e = np.exp(e) distribution = e / np.sum(e) return(distribution) def sample_from_categorical_distribution(distribution): """ Softmax function for mixture density with temperature adjustment. Arguments --------- distribution : input categorical distribution from which to sample. Returns ------- Scalar A single sample. """ r = np.random.rand(1) accumulate = 0 for i in range(len(distribution)): accumulate += distribution[i] if accumulate >= r: return(i) tf.logging.info('Error: sampling categorical model.') return(-1) def sample_from_output(parameters, output_dimension, number_of_mixtures, temperature=1.0, sigma_temperature=1.0): """ Softmax function for mixture density with temperature adjustment. Arguments --------- output_dimension : integer Dimensionality of the output. number_of_mixtures : integer Number of gaussians used. temperature : The temperature for to adjust the distribution (default 1.0) sigma_temperature : The temperature for to adjust the distribution (default 1.0) Returns ------- Scalar A single sample. """ mu, sigma, pi = split_mixture_parameters(parameters, output_dimension, number_of_mixtures) pi_softmax = mixture_density_software_max(pi, temperature=temperature) m = sample_from_categorical_distribution(pi_softmax) mu_vector = mu[m * output_dimension:(m + 1) * output_dimension] sigma_vector = sigma[m * output_dimension:(m + 1) * output_dimension] * sigma_temperature covariance_matrix = np.identity(output_dimension) * sigma_vector sample = np.random.multivariate_normal(mu_vector, covariance_matrix, 1) return(sample)
30.651399
94
0.628341
b7712de7485aecf34c54bcaa9134a8c65cfc7aa6
1,481
py
Python
test.py
pnawalramka/cowin
f8ce6286d38fc0616a385ac0a971c8947f71348c
[ "MIT" ]
null
null
null
test.py
pnawalramka/cowin
f8ce6286d38fc0616a385ac0a971c8947f71348c
[ "MIT" ]
null
null
null
test.py
pnawalramka/cowin
f8ce6286d38fc0616a385ac0a971c8947f71348c
[ "MIT" ]
null
null
null
import json from unittest import mock, TestCase import check_availability json_data = \ """ { "centers": [ { "center_id": 1234, "name": "District General Hostpital", "name_l": "", "address": "45 M G Road", "address_l": "", "state_name": "Maharashtra", "state_name_l": "", "district_name": "Satara", "district_name_l": "", "block_name": "Jaoli", "block_name_l": "", "pincode": "413608", "lat": 28.7, "long": 77.1, "from": "09:00:00", "to": "18:00:00", "fee_type": "Free", "vaccine_fees": [ { "vaccine": "COVISHIELD", "fee": "250" } ], "sessions": [ { "session_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "date": "31-05-2021", "available_capacity": 50, "available_capacity_dose1": 25, "available_capacity_dose2": 25, "min_age_limit": 18, "vaccine": "COVISHIELD", "slots": [ "FORENOON", "AFTERNOON" ] } ] } ] } """
21.779412
63
0.532073
b771d6a65389f019399e4105e7ca9559208f9b9c
271
py
Python
pycon_project/apps/proposals/admin.py
mitsuhiko/pycon
73688a82080539a1c0d575cf3248f55fefb6b9ba
[ "BSD-3-Clause" ]
1
2017-09-04T08:19:08.000Z
2017-09-04T08:19:08.000Z
pycon_project/apps/proposals/admin.py
mitsuhiko/pycon
73688a82080539a1c0d575cf3248f55fefb6b9ba
[ "BSD-3-Clause" ]
null
null
null
pycon_project/apps/proposals/admin.py
mitsuhiko/pycon
73688a82080539a1c0d575cf3248f55fefb6b9ba
[ "BSD-3-Clause" ]
null
null
null
from django.contrib import admin from proposals.models import Proposal, ProposalSessionType admin.site.register(ProposalSessionType) admin.site.register(Proposal, list_display = ["title", "session_type", "audience_level", "cancelled", "extreme_pycon", "invited"] )
30.111111
103
0.785978
b7720c668afa28b45e212a7ec9a950d7f27725bb
12,805
py
Python
cemc/mcmc/cov_reaction_crd.py
davidkleiven/WangLandau
0b253dd98033c53560fe95c76f5e38257834bdf6
[ "MIT" ]
2
2022-02-10T00:38:53.000Z
2022-03-17T22:08:40.000Z
cemc/mcmc/cov_reaction_crd.py
davidkleiven/CEMC
0b253dd98033c53560fe95c76f5e38257834bdf6
[ "MIT" ]
30
2018-05-21T14:52:00.000Z
2021-02-24T07:45:09.000Z
cemc/mcmc/cov_reaction_crd.py
davidkleiven/WangLandau
0b253dd98033c53560fe95c76f5e38257834bdf6
[ "MIT" ]
3
2018-10-09T14:03:32.000Z
2022-02-09T05:36:05.000Z
import sys from cemc.mcmc import ReactionCrdInitializer, ReactionCrdRangeConstraint import numpy as np from itertools import product import time from numpy.linalg import inv def log(self, msg): print(msg) def set(self, atoms, value): """Create an atoms object with the correct reaction coordinate. :param Atoms atom: Atoms object (not used, using the one attached to the MC object). Argument only included traj_full = TrajectoryWriter(self.traj_file, mode="a") traj_clst = TrajectoryWriter(self.traj_file_clst, mode="a")parent class has it. :param float value: Target value for the react traj_full = TrajectoryWriter(self.traj_file, mode="a") traj_clst = TrajectoryWriter(self.traj_file_clst, mode="a")dinate """ from random import choice, shuffle # Make sure that the observer is initialized correctly self.cov_obs.init_com_and_covariance() self.fixed_nucl_mc.network([]) max_attempts = 1000 * len(self.fixed_nucl_mc.atoms) attempt = 0 neighbors = self.fixed_nucl_mc.network_clust_indx atoms = self.fixed_nucl_mc.atoms calc = atoms.get_calculator() current_value = self.get(atoms) current_diff = abs(value - current_value) should_increase_value = current_diff < value shoud_decrease_value = not should_increase_value mc = self.fixed_nucl_mc output_every = 15 now = time.time() while attempt < max_attempts: if self.fixed_nucl_mc.network.num_root_nodes() > 1: raise RuntimeError("For some unknown reason there are " "more than one cluster!") attempt += 1 surf_atoms = self.surface_atoms rand_surf_atom = choice(surf_atoms) rand_surf_atom2 = choice(surf_atoms) shuffle(neighbors) found_swap_candidate = False for indx in neighbors: t_indx = mc.get_translated_indx(rand_surf_atom2, indx) symb = mc.atoms[t_indx].symbol if symb == self.matrix_element: old_symb = mc.atoms[rand_surf_atom].symbol ch1 = (rand_surf_atom, old_symb, symb) ch2 = (t_indx, symb, old_symb) system_changes = [ch1, ch2] if self.fixed_nucl_mc.network.move_creates_new_cluster(system_changes): continue assert self.fixed_nucl_mc.network.num_root_nodes() == 1 if mc._no_constraint_violations(system_changes): calc.calculate(atoms, ["energy"], system_changes) found_swap_candidate = True break if not found_swap_candidate: continue # Get bases its calculation on the atom tracker new_value = self.get(atoms, system_changes=system_changes) new_diff = abs(new_value - value) if time.time() - now > output_every: print("Current value: {} Target value: {}" "".format(new_value, value)) sys.stdout.flush() now = time.time() if new_diff < current_diff: # The candidate trial moves brings the system closer to the # target value, so we accept this move current_diff = new_diff # We need to update the covariance observer self.cov_obs(system_changes) # Update the network assert self.fixed_nucl_mc.network.num_root_nodes() == 1 self.fixed_nucl_mc.network(system_changes) assert self.fixed_nucl_mc.network.num_root_nodes() == 1 # Update the symbol tracker self.fixed_nucl_mc._update_tracker(system_changes) calc.clear_history() else: calc.undo_changes() assert self.fixed_nucl_mc.network.num_root_nodes() == 1 if should_increase_value and new_value > value: break elif shoud_decrease_value and new_value < value: break if attempt == max_attempts: raise CouldNotFindValidStateError("Did not manage to find a state " "with reaction coordinate " "{}!".format(value)) class CovarianceRangeConstraint(ReactionCrdRangeConstraint): """Constraint to ensure that the system stays without its bounds. :param FixedNucleusMC fixed_nuc_mc: Monte Carlo object :param list range: Upper and lower bound of the reaction coordinate :param CovarianceCrdInitializer cov_init: Initializer :param bool verbose: If True print messages every 10 sec if the constraint is violated """ def get_new_value(self, system_changes): """Get new value for reaction coordinate. :param list system_changes: List with the proposed changes :return: Reaction coordate after the change :rtype: float """ # Get the new value of the observer new_val = self._cov_init.get(None, system_changes=system_changes) return new_val def __call__(self, system_changes): """Check the system is in a valid state after the changes. :param list system_changes: Proposed changes :return: True/False, if True the system is still within the bounds :rtype: bool """ new_val = self.get_new_value(system_changes) ok = (new_val >= self.range[0] and new_val < self.range[1]) if not ok and self.verbose: # The evaluation of this constraint can be time consuming # so let the user know at regular intervals if time.time() - self.last_print > 10: print("Move violates constraint") self.last_print = time.time() return ok
38.338323
109
0.617415
b77285d78a57f47f11411ca9d0f97da9f2e1f31c
3,810
py
Python
mysql/main.py
migachevalexey/BigQuery-integrations
d44546fbd3ff116e35ef90800ade2399e7266d9e
[ "MIT" ]
null
null
null
mysql/main.py
migachevalexey/BigQuery-integrations
d44546fbd3ff116e35ef90800ade2399e7266d9e
[ "MIT" ]
null
null
null
mysql/main.py
migachevalexey/BigQuery-integrations
d44546fbd3ff116e35ef90800ade2399e7266d9e
[ "MIT" ]
null
null
null
from google.cloud import bigquery from mysql.connector import connect import os # writeable part of the filesystem for Cloud Functions instance gc_write_dir = "/tmp" def get_file_mysql(mysql_configuration): """ Querying data using Connector/Python via *host* MySQL server. The function return the full path to the file that has been downloaded. """ # construct MySQLConnection object and query table on a server try: cnx = connect(user = mysql_configuration["user"], password = mysql_configuration["psswd"], host = mysql_configuration["host"], database = mysql_configuration["database"], port = mysql_configuration["port"] ) cursor = cnx.cursor(dictionary = True) cursor.execute(mysql_configuration["query"]) results = cursor.fetchall() file_name = "mysql.txt" with open(file_name, "w") as output_file: for row in results: output_file.write(json.dumps(row) + "\n") file_location = gc_write_dir + "/" + file_name print("Query <" + mysql_configuration["query"] + "> has completed successfully.") finally: try: cursor.close() cnx.close() except: print("Connection has not been established.") return file_location def give_file_gbq(path_to_file, bq_configuration): """ Download file from *path_to_file* to BigQuery table using *bq_configuration* settings. """ # construct Client object with the path to the table in which data will be stored client = bigquery.Client(project = bq_configuration["project_id"]) dataset_ref = client.dataset(bq_configuration["dataset_id"]) table_ref = dataset_ref.table(bq_configuration["table_id"]) # determine uploading options job_config = bigquery.LoadJobConfig() job_config.source_format = "NEWLINE_DELIMITED_JSON" job_config.write_disposition = bq_configuration["write_disposition"] job_config.autodetect = True # upload the file to BigQuery table with open(path_to_file, "rb") as source_file: job = client.load_table_from_file(source_file, table_ref, location = bq_configuration["location"], job_config = job_config) job.result() print("The Job " + job.job_id + " in status " + job.state + " for table " + bq_configuration["project_id"] + "." + bq_configuration["dataset_id"] + "." + bq_configuration["table_id"] + ".") def mysql(request): """ Function to execute. """ try: # get POST data from Flask.request object request_json = request.get_json() mysql_configuration = request_json["mysql"] bq_configuration = request_json["bq"] if not mysql_configuration.get("query"): mysql_configuration["query"] = "SELECT * FROM " + mysql_configuration["table_id"] if not mysql_configuration.get("port"): mysql_configuration["port"] = 3306 if not bq_configuration.get("location"): bq_configuration["location"] = "US" bq_configuration["write_disposition"] = "WRITE_TRUNCATE" except Exception as error: print("An error occured with POST request data.") print(str(error)) raise SystemExit # go to writable directory os.chdir(gc_write_dir) # get the file from MySQL server try: mysql_file = get_file_mysql(mysql_configuration) except Exception as error: print("An error occured trying to get file from MySQL server.") print(str(error)) raise SystemExit # upload the file to BigQuery try: give_file_gbq(mysql_file, bq_configuration) except Exception as error: print("An error occured trying to upload file to Google BigQuery.") print(str(error))
39.6875
193
0.664829
b7728a4f2303e9918fa06fb3ec419829f1f73d23
2,413
py
Python
arthur.carvalho/snakepro/game.py
LUDUSLab/stem-games
347afa8b1511d76f8070fa69f27a49b57e551376
[ "MIT" ]
2
2021-01-24T01:04:34.000Z
2021-05-06T16:25:53.000Z
arthur.carvalho/snakepro/game.py
LUDUSLab/stem-games
347afa8b1511d76f8070fa69f27a49b57e551376
[ "MIT" ]
null
null
null
arthur.carvalho/snakepro/game.py
LUDUSLab/stem-games
347afa8b1511d76f8070fa69f27a49b57e551376
[ "MIT" ]
3
2021-01-26T21:35:43.000Z
2021-05-06T16:06:47.000Z
from config import * from fruit import * from snakebody import * from wall import * # score score_font = pygame.font.Font('assets/PressStart2P.ttf', 30) score = 0 # game over game_ove_font = pygame.font.Font('assets/PressStart2P.ttf', 60) game_over_text = game_ove_font.render('Game Over', True, color_black, color_73ED73) play_sound = 0 snake_direction = 0
25.135417
110
0.574803
b7728d4f3bcf2508223268aec9d55c9c7919b6a4
821
py
Python
preprocessing_pipeline/so/util/log.py
sotorrent/preprocessing-pipeline
d407a56760fa5ab975dc2043c89f478bd7c89e99
[ "Apache-2.0" ]
null
null
null
preprocessing_pipeline/so/util/log.py
sotorrent/preprocessing-pipeline
d407a56760fa5ab975dc2043c89f478bd7c89e99
[ "Apache-2.0" ]
null
null
null
preprocessing_pipeline/so/util/log.py
sotorrent/preprocessing-pipeline
d407a56760fa5ab975dc2043c89f478bd7c89e99
[ "Apache-2.0" ]
1
2021-09-22T16:07:18.000Z
2021-09-22T16:07:18.000Z
import logging from preprocessing_pipeline.so.util.config import LOG_LEVEL def initialize_logger(logger_name): """ Configure a named logger (see https://stackoverflow.com/a/43794480). """ # create logger for module module_logger = logging.getLogger(logger_name) # set lowest log level the logger will handle (but not necessarily output) module_logger.setLevel(LOG_LEVEL) # disable propagation to root logger module_logger.propagate = False log_formatter = logging.Formatter(fmt='%(asctime)s [%(levelname)s] [%(name)s]: %(message)s') # write log messages to console console_handler = logging.StreamHandler() console_handler.setFormatter(log_formatter) console_handler.setLevel(LOG_LEVEL) module_logger.addHandler(console_handler) return module_logger
30.407407
96
0.742996
b7734741f7d6376de18287d5b5965809361df47f
995
py
Python
utilityFunction/CommandFunc.py
The-Fragment/FragmentFembot
bca0027b423753eb162590e8fd440a2c1e65d133
[ "MIT" ]
null
null
null
utilityFunction/CommandFunc.py
The-Fragment/FragmentFembot
bca0027b423753eb162590e8fd440a2c1e65d133
[ "MIT" ]
3
2021-03-23T04:58:47.000Z
2021-04-02T02:40:54.000Z
utilityFunction/CommandFunc.py
The-Fragment/FragmentFembot
bca0027b423753eb162590e8fd440a2c1e65d133
[ "MIT" ]
null
null
null
import random # Ex. takes in 2d20 and outputs the string Rolling 2 d20 # Ex. takes in 2d20 and outputs resultString = 11, 19 results = 30 numDice = 2
27.638889
78
0.582915
b773ef3748302d9fb0e80bd06beb0fda6a677835
12,339
py
Python
src/reviews/tests/test_forms.py
Talengi/phase
60ff6f37778971ae356c5b2b20e0d174a8288bfe
[ "MIT" ]
8
2016-01-29T11:53:40.000Z
2020-03-02T22:42:02.000Z
src/reviews/tests/test_forms.py
Talengi/phase
60ff6f37778971ae356c5b2b20e0d174a8288bfe
[ "MIT" ]
289
2015-03-23T07:42:52.000Z
2022-03-11T23:26:10.000Z
src/reviews/tests/test_forms.py
Talengi/phase
60ff6f37778971ae356c5b2b20e0d174a8288bfe
[ "MIT" ]
7
2015-12-08T09:03:20.000Z
2020-05-11T15:36:51.000Z
# -*- coding: utf-8 -*- import datetime from django.test import TestCase from django.contrib.contenttypes.models import ContentType from accounts.factories import UserFactory from categories.factories import CategoryFactory from documents.factories import DocumentFactory from default_documents.models import ContractorDeliverable from default_documents.forms import ContractorDeliverableRevisionForm from default_documents.factories import (ContractorDeliverableFactory, ContractorDeliverableRevisionFactory) from reviews.models import Review
34.275
86
0.630359
b77448adc21f21e754acd95d28d79c117e90042e
2,814
py
Python
WWW/pycopia/WWW/HTML5simple.py
kdart/pycopia
1446fabaedf8c6bdd4ab1fc3f0ea731e0ef8da9d
[ "Apache-2.0" ]
89
2015-03-26T11:25:20.000Z
2022-01-12T06:25:14.000Z
WWW/pycopia/WWW/HTML5simple.py
kdart/pycopia
1446fabaedf8c6bdd4ab1fc3f0ea731e0ef8da9d
[ "Apache-2.0" ]
1
2015-07-05T03:27:43.000Z
2015-07-11T06:21:20.000Z
WWW/pycopia/WWW/HTML5simple.py
kdart/pycopia
1446fabaedf8c6bdd4ab1fc3f0ea731e0ef8da9d
[ "Apache-2.0" ]
30
2015-04-30T01:35:54.000Z
2022-01-12T06:19:49.000Z
#!/usr/bin/python2.7 # -*- coding: utf-8 -*- # vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. """ Simple HTML5 top-level boilerplate generator. """ from __future__ import absolute_import from __future__ import print_function from __future__ import unicode_literals from __future__ import division # Currenty using this subset of HTML5 features shared by both FF 3.6.x and Chrome 10 BROWSER_FEATURES = ['applicationcache', 'backgroundsize', 'borderimage', 'borderradius', 'boxshadow', 'canvas', 'canvastext', 'csscolumns', 'cssgradients', 'csstransforms', 'draganddrop', 'flexbox', 'fontface', 'geolocation', 'hashchange', 'hsla', 'js', 'localstorage', 'multiplebgs', 'opacity', 'postmessage', 'rgba', 'sessionstorage', 'svg', 'svgclippaths', 'textshadow', 'webworkers'] NO_BROWSER_FEATURES = ['no-audio', 'no-cssanimations', 'no-cssreflections', 'no-csstransforms3d', 'no-csstransitions', 'no-history', 'no-indexeddb', 'no-inlinesvg', 'no-smil', 'no-touch', 'no-video', 'no-webgl', 'no-websockets', 'no-websqldatabase'] FEATURE_CLASS = " ".join(BROWSER_FEATURES) + " " + " ".join(NO_BROWSER_FEATURES) #### simple templates for use by mostly client-side apps. SIMPLE_TEMPLATE = """<?xml version="1.0" encoding="{charset}"?> <!DOCTYPE html> <html lang="en" xmlns="http://www.w3.org/1999/xhtml" class="{features}"> <head> <meta charset="{charset}" /> <meta name="robots" content="noindex" /> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <title>{title}</title> <link href="/media/css/{appname}.css" type="text/css" rel="stylesheet" /> <!-- <script src="/media/js/modernizr-1.7.min.js" type="text/javascript"></script> --> <script src="/media/js/packed.js" type="text/javascript"></script> <script src="/media/js/{appname}.js" type="text/javascript"></script> </head> <body> {body} </body> </html> """ if __name__ == "__main__": docs = new_simple_document("myapp", "MyApp", "utf-8") print (docs)
35.620253
90
0.678749
b77490b49e8e303cfb2f69ab8e30192b9d37bd8f
2,077
py
Python
zairachem/reports/report.py
ersilia-os/ersilia-automl-chem
fabb1f05d17cff11ec0e084495eed4c0152f2f63
[ "MIT" ]
null
null
null
zairachem/reports/report.py
ersilia-os/ersilia-automl-chem
fabb1f05d17cff11ec0e084495eed4c0152f2f63
[ "MIT" ]
null
null
null
zairachem/reports/report.py
ersilia-os/ersilia-automl-chem
fabb1f05d17cff11ec0e084495eed4c0152f2f63
[ "MIT" ]
null
null
null
from .plots import ( ActivesInactivesPlot, ConfusionPlot, RocCurvePlot, ProjectionPlot, RegressionPlotRaw, HistogramPlotRaw, RegressionPlotTransf, HistogramPlotTransf, Transformation, IndividualEstimatorsAurocPlot, InidvidualEstimatorsR2Plot, ) from .. import ZairaBase from ..vars import REPORT_SUBFOLDER
28.847222
69
0.692826
b777765b36345a7cbdc249bcc3d7922fbe5e7398
2,198
py
Python
tests/backend/configobj.py
edyan/python-anyconfig
d237909a6e4848737539b80951b710238c72052f
[ "MIT" ]
null
null
null
tests/backend/configobj.py
edyan/python-anyconfig
d237909a6e4848737539b80951b710238c72052f
[ "MIT" ]
null
null
null
tests/backend/configobj.py
edyan/python-anyconfig
d237909a6e4848737539b80951b710238c72052f
[ "MIT" ]
null
null
null
# # Copyright (C) 2013 - 2017 Satoru SATOH <ssato @ redhat.com> # License: MIT # # pylint: disable=missing-docstring,invalid-name,too-few-public-methods # pylint: disable=ungrouped-imports from __future__ import absolute_import import anyconfig.backend.configobj as TT import tests.backend.common as TBC from anyconfig.compat import OrderedDict as ODict CNF_0_S = """\ # This is the 'initial_comment' # Which may be several lines keyword1 = value1 'keyword 2' = 'value 2' [ "section 1" ] # This comment goes with keyword 3 keyword 3 = value 3 'keyword 4' = value4, value 5, 'value 6' [[ sub-section ]] # an inline comment # sub-section is inside "section 1" 'keyword 5' = 'value 7' 'keyword 6' = '''A multiline value, that spans more than one line :-) The line breaks are included in the value.''' [[[ sub-sub-section ]]] # sub-sub-section is *in* 'sub-section' # which is in 'section 1' 'keyword 7' = 'value 8' [section 2] # an inline comment keyword8 = "value 9" keyword9 = value10 # an inline comment # The 'final_comment' # Which also may be several lines """ _ML_0 = """A multiline value, that spans more than one line :-) The line breaks are included in the value.""" CNF_0 = ODict((('keyword1', 'value1'), ('keyword 2', 'value 2'), ('section 1', ODict((('keyword 3', 'value 3'), ('keyword 4', ['value4', 'value 5', 'value 6']), ('sub-section', ODict((('keyword 5', 'value 7'), ('keyword 6', _ML_0), ('sub-sub-section', ODict((('keyword 7', 'value 8'), ))))))))), ('section 2', ODict((('keyword8', 'value 9'), ('keyword9', 'value10')))))) # vim:sw=4:ts=4:et:
27.135802
76
0.589172
b777b683adb530c1229387728fa21c1239e09fa6
23
py
Python
backend/lorre/__init__.py
nhurman/Lorre
9a19d00809bd3850d288c9ef1166da016d29b819
[ "MIT" ]
null
null
null
backend/lorre/__init__.py
nhurman/Lorre
9a19d00809bd3850d288c9ef1166da016d29b819
[ "MIT" ]
null
null
null
backend/lorre/__init__.py
nhurman/Lorre
9a19d00809bd3850d288c9ef1166da016d29b819
[ "MIT" ]
null
null
null
__author__ = 'nhurman'
11.5
22
0.73913
b778baead541bab3544aa4b5bfec40bbfb0e7118
1,794
py
Python
tests/test_spider.py
aezhov/sw_downloader
325f6fe98579dda4f98613e4513fc46c7bd962c7
[ "MIT" ]
1
2020-01-23T06:56:34.000Z
2020-01-23T06:56:34.000Z
tests/test_spider.py
aezhov/sw_downloader
325f6fe98579dda4f98613e4513fc46c7bd962c7
[ "MIT" ]
null
null
null
tests/test_spider.py
aezhov/sw_downloader
325f6fe98579dda4f98613e4513fc46c7bd962c7
[ "MIT" ]
2
2020-01-23T06:56:36.000Z
2020-01-24T05:34:25.000Z
import requests from scrapy.http import HtmlResponse from sw_downloader.sw_downloader.spiders.smashing_magazine \ import SmashingMagazineSpider
39.866667
70
0.628763
b778ede17d0ff72b747e93fc5f260c19e384862d
160
py
Python
1_PROGI/Exe 5.py
Julymusso/IFES
939277c375dacc7750705c5593537d80ab4cbc0e
[ "MIT" ]
null
null
null
1_PROGI/Exe 5.py
Julymusso/IFES
939277c375dacc7750705c5593537d80ab4cbc0e
[ "MIT" ]
null
null
null
1_PROGI/Exe 5.py
Julymusso/IFES
939277c375dacc7750705c5593537d80ab4cbc0e
[ "MIT" ]
null
null
null
#var #num, media, i: inteiro media=0 for i in range(1,11,1): num=int(input("Digite um nmero: ")) media = media+num media=media/i print (media)
17.777778
40
0.61875
b7794cab91544e360a3b3517961177ee512565ea
4,289
py
Python
rio/tasks.py
soasme/rio
e6b89634db8d3ad75ac7f7b25ddec5b19d4f66e2
[ "MIT" ]
null
null
null
rio/tasks.py
soasme/rio
e6b89634db8d3ad75ac7f7b25ddec5b19d4f66e2
[ "MIT" ]
14
2016-04-14T04:18:41.000Z
2016-05-12T03:46:37.000Z
rio/tasks.py
soasme/rio
e6b89634db8d3ad75ac7f7b25ddec5b19d4f66e2
[ "MIT" ]
1
2016-04-06T08:54:20.000Z
2016-04-06T08:54:20.000Z
# -*- coding: utf-8 -*- """ rio.tasks ~~~~~~~~~~ Implement of rio tasks based on celery. """ from time import time from celery import chord from requests import ConnectionError from celery.utils.log import get_task_logger from rio.core import celery from rio.core import sentry from rio.utils.http import dispatch_webhook_request from rio.utils.http import raven_context from rio.utils.http import FailureWebhookError from rio.utils.template import format_template from rio.signals import webhook_ran logger = get_task_logger(__name__) def exec_event(event, webhooks, payload): """Execute event. Merge webhooks run set to do some stats after all of the webhooks been responded successfully. +---------+ |webhook-1+--------------------+ +---------+ | | +---------+ | |webhook-2+-------------+ | +---------+ +------+-----+ |merge runset+------> +---------+ +------+-----+ |webhook-3+-------------+ | +---------+ | | +---------+ | |... +--------------------+ +---------+ Error webhook will be propagated. Note that other webhook calls will still execute. """ calls = ( call_webhook.s(event, webhook, payload) for webhook in webhooks ) callback = merge_webhooks_runset.s() call_promise = chord(calls) promise = call_promise(callback) return promise
26.312883
77
0.55211
b77a241d42c4accce70a300b51e344bbc1b51e81
2,932
py
Python
security_app/createuserpoolgroup.py
jagalembu/chalice_cognito_multi_tenancy
b1a6569e716848adfd5b443239fca1ae883d4f4b
[ "MIT" ]
null
null
null
security_app/createuserpoolgroup.py
jagalembu/chalice_cognito_multi_tenancy
b1a6569e716848adfd5b443239fca1ae883d4f4b
[ "MIT" ]
null
null
null
security_app/createuserpoolgroup.py
jagalembu/chalice_cognito_multi_tenancy
b1a6569e716848adfd5b443239fca1ae883d4f4b
[ "MIT" ]
null
null
null
import os import uuid import json import argparse import boto3 USERPOOL = { 'env_var_poolid': 'APPUSERPOOLID', 'env_var_cognito_url': 'COGNITOJWKSURL', 'env_var_pool_client': 'APPCLIENTID', } if __name__ == '__main__': main()
30.863158
104
0.645634
b77c8918ea2f71cb1258eb1a156531c01f3b83b2
269
py
Python
Chapter 07/hmac-md5.py
Prakshal2607/Effective-Python-Penetration-Testing
f49fedc172a1add45edb21f66f74746dfa9c944a
[ "MIT" ]
346
2016-06-21T11:39:39.000Z
2022-01-26T03:19:29.000Z
Chapter 07/hmac-md5.py
liceaga/Effective-Python-Penetration-Testing
0b043885231662efd63402eec3c9cb413b9693e2
[ "MIT" ]
1
2016-06-21T11:44:42.000Z
2016-11-17T05:10:08.000Z
Chapter 07/hmac-md5.py
liceaga/Effective-Python-Penetration-Testing
0b043885231662efd63402eec3c9cb413b9693e2
[ "MIT" ]
210
2016-06-22T12:08:47.000Z
2022-03-16T15:54:30.000Z
import hmac hmac_md5 = hmac.new('secret-key') f = open('sample-file.txt', 'rb') try: while True: block = f.read(1024) if not block: break hmac_md5.update(block) finally: f.close() digest = hmac_md5.hexdigest() print digest
16.8125
33
0.598513
b77cac8f40a35a229bb7b41f7b04619f55a2baf4
31,686
py
Python
dingtalk/python/alibabacloud_dingtalk/alitrip_1_0/models.py
yndu13/dingtalk-sdk
700fb7bb49c4d3167f84afc5fcb5e7aa5a09735f
[ "Apache-2.0" ]
null
null
null
dingtalk/python/alibabacloud_dingtalk/alitrip_1_0/models.py
yndu13/dingtalk-sdk
700fb7bb49c4d3167f84afc5fcb5e7aa5a09735f
[ "Apache-2.0" ]
null
null
null
dingtalk/python/alibabacloud_dingtalk/alitrip_1_0/models.py
yndu13/dingtalk-sdk
700fb7bb49c4d3167f84afc5fcb5e7aa5a09735f
[ "Apache-2.0" ]
null
null
null
# -*- coding: utf-8 -*- # This file is auto-generated, don't edit it. Thanks. from Tea.model import TeaModel from typing import Dict, List
33.636943
142
0.581424
b7800aafff5c8094f397d2e3b7573a73689dfdba
560
py
Python
src/while_exit.py
Alex9808/py101
18c585c1433e8ec6f5e4962e556a781e0c3c3cd5
[ "MIT" ]
25
2018-08-14T22:13:13.000Z
2021-07-23T04:14:06.000Z
src/while_exit.py
Alex9808/py101
18c585c1433e8ec6f5e4962e556a781e0c3c3cd5
[ "MIT" ]
1
2021-05-21T23:46:42.000Z
2021-05-21T23:46:42.000Z
src/while_exit.py
Alex9808/py101
18c585c1433e8ec6f5e4962e556a781e0c3c3cd5
[ "MIT" ]
34
2018-07-30T20:48:17.000Z
2022-02-04T19:01:27.000Z
#!/usr/bin/env python ''' Este programa se repetir 3 veces o hasta que se ingrese la palabra "despedida" y desplegar slo el nmero de intentos fallidos hasta que cualquiera de los eventos ocurentradara. Al ingresar la palabra "termina" el programa se detendr.''' entrada = "" suma = 0 while suma < 3: entrada = input("Clave:") if entrada == "despedida": break elif entrada == "termina": exit() suma = suma + 1 print("Intento %d. \n " % suma) print("Tuviste %d intentos fallidos." % suma)
29.473684
67
0.630357
b78064bab0e579a79f199c581d29dfd0023d9a67
1,337
py
Python
src/kong/db.py
paulgessinger/kong
b1e2ec0c18f432fa2419b2b0dc95ee1e391cf7a5
[ "MIT" ]
3
2020-02-14T09:23:56.000Z
2020-08-24T16:19:00.000Z
src/kong/db.py
paulgessinger/kong
b1e2ec0c18f432fa2419b2b0dc95ee1e391cf7a5
[ "MIT" ]
159
2019-09-16T19:17:16.000Z
2022-03-29T19:12:37.000Z
src/kong/db.py
paulgessinger/kong
b1e2ec0c18f432fa2419b2b0dc95ee1e391cf7a5
[ "MIT" ]
null
null
null
""" Singleton database instance """ from typing import TYPE_CHECKING, Any, List, ContextManager, Tuple, Iterable if not TYPE_CHECKING: from playhouse.sqlite_ext import SqliteExtDatabase, AutoIncrementField else: # pragma: no cover database = SqliteExtDatabase(None)
20.890625
86
0.449514
b7828d9ca80482a07e76866d18c12b99668834d3
2,582
py
Python
selenium_wrapper/factory.py
dfeeley/selenium-wrapper
f69576802e7847d120a051a2902da5750b9c6203
[ "MIT" ]
1
2022-01-14T20:21:19.000Z
2022-01-14T20:21:19.000Z
selenium_wrapper/factory.py
dfeeley/selenium-wrapper
f69576802e7847d120a051a2902da5750b9c6203
[ "MIT" ]
null
null
null
selenium_wrapper/factory.py
dfeeley/selenium-wrapper
f69576802e7847d120a051a2902da5750b9c6203
[ "MIT" ]
null
null
null
import os from selenium import webdriver from selenium.webdriver.common.desired_capabilities import DesiredCapabilities from selenium.webdriver.chrome.options import Options from .driver import Driver
39.723077
84
0.703718
b782afffa41a32debaad33cd5a697c066dc182f8
14,153
py
Python
networking_cisco/tests/unit/saf/agent/vdp/test_lldpad.py
arvindsharma16/networking-cisco
2f38c25742296f07ab80479c152504353da0a1d4
[ "Apache-2.0" ]
null
null
null
networking_cisco/tests/unit/saf/agent/vdp/test_lldpad.py
arvindsharma16/networking-cisco
2f38c25742296f07ab80479c152504353da0a1d4
[ "Apache-2.0" ]
null
null
null
networking_cisco/tests/unit/saf/agent/vdp/test_lldpad.py
arvindsharma16/networking-cisco
2f38c25742296f07ab80479c152504353da0a1d4
[ "Apache-2.0" ]
1
2020-08-31T22:53:38.000Z
2020-08-31T22:53:38.000Z
# Copyrigh 2015 Cisco Systems. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import collections import mock from neutron.tests import base from networking_cisco.apps.saf.agent.vdp import lldpad from networking_cisco.apps.saf.agent.vdp import lldpad_constants as vdp_con from networking_cisco.apps.saf.common import dfa_sys_lib as utils try: OrderedDict = collections.OrderedDict except AttributeError: import ordereddict OrderedDict = ordereddict.OrderedDict
50.366548
79
0.466191
b7836e4485ed6acdd7e26cba6a9e54fccf62bd20
15,656
py
Python
py/prospect/viewer/cds.py
segasai/prospect
0237fad5b04f5a982ba4178320e1ca5bb5fa408f
[ "BSD-3-Clause" ]
4
2018-10-22T21:12:43.000Z
2019-07-11T20:08:12.000Z
py/prospect/viewer/cds.py
segasai/prospect
0237fad5b04f5a982ba4178320e1ca5bb5fa408f
[ "BSD-3-Clause" ]
54
2019-12-07T08:24:53.000Z
2022-02-25T10:17:59.000Z
py/prospect/viewer/cds.py
segasai/prospect
0237fad5b04f5a982ba4178320e1ca5bb5fa408f
[ "BSD-3-Clause" ]
5
2019-12-20T21:47:40.000Z
2021-01-20T23:54:43.000Z
# Licensed under a 3-clause BSD style license - see LICENSE.rst # -*- coding: utf-8 -*- """ =================== prospect.viewer.cds =================== Class containing all bokeh's ColumnDataSource objects needed in viewer.py """ import numpy as np from pkg_resources import resource_filename import bokeh.plotting as bk from bokeh.models import ColumnDataSource _specutils_imported = True try: from specutils import Spectrum1D, SpectrumList except ImportError: _specutils_imported = False from ..coaddcam import coaddcam_prospect from ..utilities import supported_desitarget_masks, vi_file_fields def _airtovac(w): """Convert air wavelengths to vacuum wavelengths. Don't convert less than 2000 . Parameters ---------- w : :class:`float` Wavelength [] of the line in air. Returns ------- :class:`float` Wavelength [] of the line in vacuum. """ if w < 2000.0: return w; vac = w for iter in range(2): sigma2 = (1.0e4/vac)*(1.0e4/vac) fact = 1.0 + 5.792105e-2/(238.0185 - sigma2) + 1.67917e-3/(57.362 - sigma2) vac = w*fact return vac
45.37971
135
0.551993
b785c28b83b4fcf0dd190a336d9e93908aec9ec2
4,865
py
Python
tests/test_32_read_registration.py
jschlyter/oidcendpoint
3192e6043f00b22809f63329893c50bedbdeafbc
[ "Apache-2.0" ]
null
null
null
tests/test_32_read_registration.py
jschlyter/oidcendpoint
3192e6043f00b22809f63329893c50bedbdeafbc
[ "Apache-2.0" ]
null
null
null
tests/test_32_read_registration.py
jschlyter/oidcendpoint
3192e6043f00b22809f63329893c50bedbdeafbc
[ "Apache-2.0" ]
null
null
null
# -*- coding: latin-1 -*- import json import pytest from oidcendpoint.endpoint_context import EndpointContext from oidcendpoint.oidc.authorization import Authorization from oidcendpoint.oidc.read_registration import RegistrationRead from oidcendpoint.oidc.registration import Registration from oidcendpoint.oidc.token import AccessToken from oidcendpoint.oidc.userinfo import UserInfo from oidcmsg.oidc import RegistrationRequest KEYDEFS = [ {"type": "RSA", "key": "", "use": ["sig"]}, {"type": "EC", "crv": "P-256", "use": ["sig"]}, ] RESPONSE_TYPES_SUPPORTED = [ ["code"], ["token"], ["id_token"], ["code", "token"], ["code", "id_token"], ["id_token", "token"], ["code", "token", "id_token"], ["none"], ] CAPABILITIES = { "subject_types_supported": ["public", "pairwise"], "grant_types_supported": [ "authorization_code", "implicit", "urn:ietf:params:oauth:grant-type:jwt-bearer", "refresh_token", ], } msg = { "application_type": "web", "redirect_uris": [ "https://client.example.org/callback", "https://client.example.org/callback2", ], "client_name": "My Example", "client_name#ja-Jpan-JP": "", "subject_type": "pairwise", "token_endpoint_auth_method": "client_secret_basic", "jwks_uri": "https://client.example.org/my_public_keys.jwks", "userinfo_encrypted_response_alg": "RSA1_5", "userinfo_encrypted_response_enc": "A128CBC-HS256", "contacts": ["ve7jtb@example.org", "mary@example.org"], "request_uris": [ "https://client.example.org/rf.txt#qpXaRLh_n93TT", "https://client.example.org/rf.txt", ], "post_logout_redirect_uris": [ "https://rp.example.com/pl?foo=bar", "https://rp.example.com/pl", ], } CLI_REQ = RegistrationRequest(**msg)
35.510949
87
0.567523
b786deb138ef01a31f9f64e2908250e1c39d81e6
253
py
Python
thippiproject/modelapp/admin.py
Anandgowda18/djangocomplete
c9eebe7834e404c73deca295289142a1e95ab573
[ "Apache-2.0" ]
null
null
null
thippiproject/modelapp/admin.py
Anandgowda18/djangocomplete
c9eebe7834e404c73deca295289142a1e95ab573
[ "Apache-2.0" ]
null
null
null
thippiproject/modelapp/admin.py
Anandgowda18/djangocomplete
c9eebe7834e404c73deca295289142a1e95ab573
[ "Apache-2.0" ]
1
2021-08-31T10:20:49.000Z
2021-08-31T10:20:49.000Z
from django.contrib import admin from modelapp.models import Project # Register your models here. admin.site.register(Project,Projectadmin)
31.625
73
0.786561
b786e3a7dfda3169fee4e233a099bad862bcb4ab
621
py
Python
2013.6/2015.6.py
luisalvaradoar/olimpiada.ct
aea479116036abe1c9cca3b482fed61f275ed319
[ "Apache-2.0" ]
null
null
null
2013.6/2015.6.py
luisalvaradoar/olimpiada.ct
aea479116036abe1c9cca3b482fed61f275ed319
[ "Apache-2.0" ]
null
null
null
2013.6/2015.6.py
luisalvaradoar/olimpiada.ct
aea479116036abe1c9cca3b482fed61f275ed319
[ "Apache-2.0" ]
null
null
null
main() #15 min
19.40625
58
0.516908
b78725b75722098cca7515b9adddc2dea857de17
538
py
Python
hash.py
STR-Coding-Club/blockchain-demo
fae29a52d97c7595fa1e9d99527c4b034b721b8f
[ "MIT" ]
null
null
null
hash.py
STR-Coding-Club/blockchain-demo
fae29a52d97c7595fa1e9d99527c4b034b721b8f
[ "MIT" ]
null
null
null
hash.py
STR-Coding-Club/blockchain-demo
fae29a52d97c7595fa1e9d99527c4b034b721b8f
[ "MIT" ]
null
null
null
import hashlib, json # def hash(to_hash): # h = hashlib.md5() # h.update(bytes(str(to_hash), 'utf-8')) # return h.hexdigest()
24.454545
92
0.60223
b78782c19f15096aec39ba8d508066aa4591ae37
1,008
py
Python
covid-modeling-master/generate_ma_csv.py
rdkap42/caedus-covid
f64a833bdf386708fcb9394f94026c48f8d474ee
[ "MIT" ]
10
2020-03-17T21:21:50.000Z
2020-04-30T02:30:47.000Z
covid-modeling-master/generate_ma_csv.py
rdkap42/caedus-covid
f64a833bdf386708fcb9394f94026c48f8d474ee
[ "MIT" ]
5
2020-03-17T04:39:03.000Z
2021-04-30T21:11:14.000Z
covid-modeling-master/generate_ma_csv.py
rdkap42/caedus-covid
f64a833bdf386708fcb9394f94026c48f8d474ee
[ "MIT" ]
null
null
null
import logging import time import numpy as np from eda import ma_data, tx_data from sir_fitting_us import seir_experiment, make_csv_from_tx_traj logger = logging.getLogger(__name__) logger.setLevel(logging.INFO) logger.info("Fitting model.") # initial values taken from previous fit, used to seed MH sampler efficiently. x0 = np.array([ 0.393, -2.586, -3.241, -5.874, -24.999]) # ma_traj = seir_experiment(ma_data, x0, iterations=10000) tx_traj = seir_experiment(tx_data, x0, iterations=10000) # mean_ll = np.mean([ll for (x, ll) in ma_traj]) mean_ll = np.mean([ll for (x, ll) in tx_traj]) logger.info("Model fitting finished with mean log-likelihood: {}".format(mean_ll)) if mean_ll < -2000: raise AssertionError( """Mean log-likelihood {} less than threshold of -20. This is probably an error.""".format(mean_ll) ) underscored_time = time.ctime().replace(" ", "_") fname = "ma_seir_output_{}.csv".format(underscored_time) make_csv_from_tx_traj(tx_traj, tx_data, fname)
31.5
82
0.727183
b7886dbd5b5bd5591584039afc3ce54cfdba530a
6,877
py
Python
For_Simulator/learning/plot_gmm_nd.py
a-taniguchi/CSL-BGM
64bd803289e55b76a219c02ea040325a8a5b949e
[ "MIT" ]
1
2018-09-27T12:19:05.000Z
2018-09-27T12:19:05.000Z
learning/plot_gmm_nd.py
neuronalX/CSL-BGM
2fc66611928783c9b65c675ec84d9c06e0b6cd8a
[ "MIT" ]
null
null
null
learning/plot_gmm_nd.py
neuronalX/CSL-BGM
2fc66611928783c9b65c675ec84d9c06e0b6cd8a
[ "MIT" ]
1
2018-09-27T12:19:21.000Z
2018-09-27T12:19:21.000Z
#coding:utf-8 #gaussian plot (position category) #Akira Taniguchi 2016/06/16 import itertools import numpy as np from scipy import linalg import matplotlib.pyplot as plt import matplotlib as mpl from sklearn import mixture from __init__ import * from numpy.random import multinomial,uniform,dirichlet from scipy.stats import multivariate_normal,invwishart,rv_discrete trialname = "testss"#raw_input("trialname?(folder) >") start = "1"#raw_input("start number?>") end = "40"#raw_input("end number?>") filename = raw_input("learning trial name?>")#"001"# sn = int(start) en = int(end) Data = int(en) - int(sn) +1 foldername = datafolder + trialname+"("+str(sn).zfill(3)+"-"+str(en).zfill(3)+")" Mu_p = [ np.array([0 for i in xrange(dim_p)]) for k in xrange(Kp) ] Sig_p = [ np.eye(dim_p)*sig_p_init for k in xrange(Kp) ] #p_dm = [[[-0.3945, 0.0165]], [[-0.3555, -0.006], [-0.336, 0.18]], [[-0.438, -0.0315], [-0.315, 0.0225], [-0.2355, 0.18]], [[-0.453, -0.018], [-0.3, -0.1005], [-0.258, -0.0255]], [[-0.438, 0.036], [-0.318, 0.1875], [-0.3, 0.0795]], [[-0.5535, 0.0675], [-0.336, -0.0465]], [[-0.3885, 0.0555], [-0.3465, -0.126]], [[-0.3555, -0.1425], [-0.324, -0.039], [-0.273, 0.0825]], [[-0.3885, 0.135]], [[-0.285, -0.0135]], [[-0.5265, 0.045], [-0.33, 0.18], [-0.2685, 0.0165]], [[-0.453, 0.015], [-0.3795, 0.231]], [[-0.3825, -0.231]], [[-0.327, -0.18], [-0.309, -0.0075]], [[-0.3735, -0.1455]], [[-0.2685, -0.0135]], [[-0.438, 0.033], [-0.36, 0.204], [-0.2955, 0.0855]], [[-0.45, 0.048]], [[-0.447, -0.006], [-0.3735, 0.1785]], [[-0.4005, 0.1755], [-0.2655, -0.0705]]] p_temp = [] #for d in xrange(D): # p_temp = p_temp + p_dm[d] #[[-0.319936213, 0.117489433],[-0.345566772, -0.00810185],[-0.362990185, -0.042447971],[-0.277759177, 0.083363745]] #Sig_p = [[] , [], [] ,[]] #Sig_p[0] = [[0.010389635, 0.001709343],[0.001709343, 0.018386732]] #[[0.005423979, 0.000652657],[0.000652657, 0.001134736]] #Sig_p[1] = [[0.001920786, -0.001210214],[-0.001210214, 0.002644612]] #Sig_p[2] = [[0.003648299, -0.000312398],[-0.000312398, 0.001518234]] #Sig_p[3] = [[0.001851727, -0.000656013],[-0.000656013, 0.004825636]] k=0 for line in open(foldername +'/' + filename + '/' + trialname + '_'+ filename +'_Mu_p.csv', 'r'): itemList = line[:-1].split(',') #for i in xrange(len(itemList)): Mu_p[k] = [float(itemList[0]),float(itemList[1])] k = k + 1 k=0 i=0 for line in open(foldername +'/' + filename + '/' + trialname + '_'+ filename +'_Sig_p.csv', 'r'): itemList = line[:-1].split(',') if k < Kp: if (i == 0): #for i in xrange(len(itemList)): print itemList Sig_p[k][0][0] = float(itemList[0]) Sig_p[k][0][1] = float(itemList[1]) i = i + 1 elif (i == 1): #for i in xrange(len(itemList)): print itemList Sig_p[k][1][0] = float(itemList[0]) Sig_p[k][1][1] = float(itemList[1]) i = i + 1 elif (i == 2): i = 0 k = k + 1 zp = [] pi_p = [0.0 for k in range(Kp)] #[0.017826621173443864,0.28554229470170217,0.041570976925928926,0.1265347852145472,0.52852532198437785] dm = 0 for line in open(foldername +'/' + filename + '/' + trialname + '_'+ filename +'_zp.csv', 'r'): itemList = line[:-1].split(',') for i in range(len(itemList)): if itemList[i] != '': #print dm,itemList[i] zp = zp + [int(itemList[i])] dm = dm + 1 for line in open(foldername +'/' + filename + '/' + trialname + '_'+ filename +'_pi_p.csv', 'r'): itemList = line[:-1].split(',') for i in range(len(pi_p)): pi_p[i] = float(itemList[i]) colors = ['b', 'g', 'm', 'r', 'c', 'y', 'k', 'orange', 'purple', 'brown'] color_iter = itertools.cycle(colors) splot = plt.subplot(1, 1,1) for k,(mean,covar,color) in enumerate(zip(Mu_p,Sig_p,color_iter)): v, w = linalg.eigh(covar) u = w[0] / linalg.norm(w[0]) angle = np.arctan(u[1] / u[0]) angle = 180 * angle / np.pi # convert to degrees ell = mpl.patches.Ellipse([mean[1],mean[0]], v[0], v[1], 180 + angle, color=color) ell.set_clip_box(splot.bbox) ell.set_alpha(0.5) #splot.add_artist(ell) # for i in range(int(5000*2*pi_p[k])):#)):# X = multivariate_normal.rvs(mean=mean, cov=covar) plt.scatter(X[1],X[0], s=5, marker='.', color=color, alpha=0.2) # #for i in range(len(p_temp)): # plt.scatter(p_temp[i][1],p_temp[i][0], marker='x', c=colors[zp[i]]) """ # Number of samples per component n_samples = 500 # Generate random sample, two components np.random.seed(0) C = np.array([[0., -0.1], [1.7, .4]]) X = np.r_[np.dot(np.random.randn(n_samples, 2), C), .7 * np.random.randn(n_samples, 2) + np.array([-6, 3])] # Fit a mixture of Gaussians with EM using five components #gmm = mixture.GMM(n_components=5, covariance_type='full') #gmm.fit(X) # Fit a Dirichlet process mixture of Gaussians using five components dpgmm = mixture.DPGMM(n_components=5, covariance_type='full') dpgmm.fit(X) #for i, (clf, title) in enumerate([#(gmm, 'GMM'), # (dpgmm, 'Dirichlet Process GMM')]): """ #clf=dpgmm title = 'Position category'#data' #Y_ = clf.predict(X) #print Y_ """ for i, (mean, covar, color) in enumerate(zip( clf.means_, clf._get_covars(), color_iter)): v, w = linalg.eigh(covar) print covar u = w[0] / linalg.norm(w[0]) # as the DP will not use every component it has access to # unless it needs it, we shouldn't plot the redundant # components. #if not np.any(Y_ == i): # continue #plt.scatter(X[Y_ == i, 0], X[Y_ == i, 1], .8, color=color) # Plot an ellipse to show the Gaussian component angle = np.arctan(u[1] / u[0]) angle = 180 * angle / np.pi # convert to degrees ell = mpl.patches.Ellipse(mean, v[0], v[1], 180 + angle, color=color) ell.set_clip_box(splot.bbox) ell.set_alpha(0.5) splot.add_artist(ell) """ plt.ylim(-0.2, -0.8) plt.xlim(-0.3, 0.3) #plt.xticks([-0.8+0.1*i for i in range(7)]) #plt.yticks([-0.3+0.1*i for i in range(7)]) plt.title(title) #w, h = plt.get_figwidth(), plt.get_figheight() #ax = plt.add_axes((0.5 - 0.5 * 0.8 * h / w, 0.1, 0.8 * h / w, 0.8)) #aspect = (ax.get_xlim()[1] - ax.get_xlim()[0]) / (ax.get_ylim()[1] - ax.get_ylim()[0]) #ax.set_aspect(aspect) plt.gca().set_aspect('equal', adjustable='box') plt.savefig(foldername +'/' + filename + '/' + trialname + '_'+ filename +'_position_data_plot_p1nd.eps', dpi=150) plt.savefig(foldername +'/' + filename + '/' + trialname + '_'+ filename +'_position_data_plot_p1nd.png', dpi=150) plt.show()
38.418994
757
0.574378
b789e2f11f57608cb00f55b63d916cf77099aa18
338
py
Python
condiment/tests/test_simple.py
WeilerWebServices/Kivy
54e3438156eb0c853790fd3cecc593f09123f892
[ "MIT" ]
3
2020-09-13T09:55:02.000Z
2021-01-23T11:13:59.000Z
condiment/tests/test_simple.py
WeilerWebServices/Kivy
54e3438156eb0c853790fd3cecc593f09123f892
[ "MIT" ]
2
2018-03-16T22:01:12.000Z
2020-01-13T10:33:22.000Z
condiment/tests/test_simple.py
WeilerWebServices/Kivy
54e3438156eb0c853790fd3cecc593f09123f892
[ "MIT" ]
2
2015-04-26T15:31:40.000Z
2017-09-12T12:36:14.000Z
#exclude import condiment; condiment.install() #endexclude if WITH_TIMEBOMB: timebomb = int(WITH_TIMEBOMB) print 'timebomb feature is activated, and set to', timebomb if WITH_INAPP_PURCHASE: print 'inapp purchase feature is activated' if WITH_TIMEBOMB and WITH_INAPP_PURCHASE: print 'both features have been activated'
24.142857
63
0.775148
b78d491f7594796538d954c219bf7266a1779707
1,096
py
Python
tests/init.py
touqir14/Emergent
0782e1304702f3c95092953ce5da1d8ed69bbe6f
[ "MIT" ]
null
null
null
tests/init.py
touqir14/Emergent
0782e1304702f3c95092953ce5da1d8ed69bbe6f
[ "MIT" ]
null
null
null
tests/init.py
touqir14/Emergent
0782e1304702f3c95092953ce5da1d8ed69bbe6f
[ "MIT" ]
null
null
null
import pathlib import os import sys from multiprocessing import resource_tracker modify_resource_tracker() add_Emergent_paths()
27.4
106
0.718978
b78f243f121a8fb7c7eb83f7fd3d5745810817b9
12,586
py
Python
data-processor/modules/wikia_handler.py
stephanietuerk/art-history-jobs
d10718ce7c8eb591cea9808945d01a2273425a58
[ "MIT" ]
null
null
null
data-processor/modules/wikia_handler.py
stephanietuerk/art-history-jobs
d10718ce7c8eb591cea9808945d01a2273425a58
[ "MIT" ]
null
null
null
data-processor/modules/wikia_handler.py
stephanietuerk/art-history-jobs
d10718ce7c8eb591cea9808945d01a2273425a58
[ "MIT" ]
null
null
null
import csv import re import unicodedata import bs4 import wikia from modules import utils from modules.config import Config
44.161404
245
0.571667
b78f91bde4f8867fdadaaee058845f1ee62f598c
3,949
py
Python
ucsmsdk/mometa/cimcvmedia/CimcvmediaExtMgmtRuleEntry.py
anoop1984/python_sdk
c4a226bad5e10ad233eda62bc8f6d66a5a82b651
[ "Apache-2.0" ]
null
null
null
ucsmsdk/mometa/cimcvmedia/CimcvmediaExtMgmtRuleEntry.py
anoop1984/python_sdk
c4a226bad5e10ad233eda62bc8f6d66a5a82b651
[ "Apache-2.0" ]
null
null
null
ucsmsdk/mometa/cimcvmedia/CimcvmediaExtMgmtRuleEntry.py
anoop1984/python_sdk
c4a226bad5e10ad233eda62bc8f6d66a5a82b651
[ "Apache-2.0" ]
null
null
null
"""This module contains the general information for CimcvmediaExtMgmtRuleEntry ManagedObject.""" import sys, os from ...ucsmo import ManagedObject from ...ucscoremeta import UcsVersion, MoPropertyMeta, MoMeta from ...ucsmeta import VersionMeta
58.940299
248
0.66042
b78fac6287214282885abd8ffbebb076e0bdd37a
3,672
py
Python
paddlescience/pde/pde_navier_stokes.py
juneweng/PaddleScience
f30ce908b6fbec2403936007d12d9701f74fd00e
[ "Apache-2.0" ]
null
null
null
paddlescience/pde/pde_navier_stokes.py
juneweng/PaddleScience
f30ce908b6fbec2403936007d12d9701f74fd00e
[ "Apache-2.0" ]
null
null
null
paddlescience/pde/pde_navier_stokes.py
juneweng/PaddleScience
f30ce908b6fbec2403936007d12d9701f74fd00e
[ "Apache-2.0" ]
null
null
null
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. from .pde_base import PDE
40.351648
223
0.510349
b7907344916d1e840e9f663cfdac58234f01e739
327
py
Python
tests/strict/it_mod_double_fun.py
Euromance/pycopy
540cfcc52d17667a5f6b2a176427cc031029b78f
[ "MIT" ]
663
2018-12-30T00:17:59.000Z
2022-03-14T05:03:41.000Z
tests/strict/it_mod_double_fun.py
Euromance/pycopy
540cfcc52d17667a5f6b2a176427cc031029b78f
[ "MIT" ]
41
2019-06-06T08:31:19.000Z
2022-02-13T16:53:41.000Z
tests/strict/it_mod_double_fun.py
Euromance/pycopy
540cfcc52d17667a5f6b2a176427cc031029b78f
[ "MIT" ]
60
2019-06-01T04:25:00.000Z
2022-02-25T01:47:31.000Z
import mod try: mod.foo = foo except RuntimeError: print("RuntimeError1") print(mod.foo()) try: mod.foo = 1 except RuntimeError: print("RuntimeError2") print(mod.foo) try: mod.foo = 2 except RuntimeError: print("RuntimeError3") print(mod.foo)
10.21875
26
0.642202
b791735533ee827f9ea58cc60b007fcd8bb18dbd
2,295
py
Python
LungCancer.py
SpiroGanas/Lung-Cancer-Machine-Learning
4e38b3df9b560194f67ab03e9aaefad6c84216db
[ "MIT" ]
1
2019-04-28T02:25:32.000Z
2019-04-28T02:25:32.000Z
LungCancer.py
SpiroGanas/Lung-Cancer-Machine-Learning
4e38b3df9b560194f67ab03e9aaefad6c84216db
[ "MIT" ]
null
null
null
LungCancer.py
SpiroGanas/Lung-Cancer-Machine-Learning
4e38b3df9b560194f67ab03e9aaefad6c84216db
[ "MIT" ]
null
null
null
# Spiro Ganas # 9/27/17 # # Python 3 script to ######### NOTES ######################################## # 1. Each "slice" is a 512x512 image, stored in a single .dcm file. # 2. A 3-dimensional CT Scan consists of between 94 and 541 slices (according to the Stage 1 data). # 3. We need to rescale all the CT scans so they have the same number of slices. ######################################################### ####### CONSTANTS ########################## # This folder contains one subfolder per patient data_dir = 'D:\\Lung Cancer Dataset\\stage1' # This CSV lists all patients and shows which ones have canver truth_file = 'D:\\Lung Cancer Dataset\\stage1_labels.csv' # These values are used to downscale the images to a uniform size IMAGE_DIMESNION = 512 # Downscale the images so the size of a slice is IMAGE_DIMENSIONxIMAGE_DIMENSION NUMBER_OF_SLICES =20 # A patient can have between X and Y slices. This downscales all patients to the same number of slices. ############################################# import dicom #http://pydicom.readthedocs.io/en/stable/getting_started.html #print("pydicom version: ", dicom.__version__) import os import math import numpy as np import pandas as pd import tensorflow as tf # Change this to wherever you are storing your data: # IF YOU ARE FOLLOWING ON KAGGLE, YOU CAN ONLY PLAY WITH THE SAMPLE DATA, WHICH IS MUCH SMALLER labels_df = pd.read_csv(truth_file, index_col=0) #patients = list(labels_df.index.values) patients = os.listdir(data_dir) print(labels_df.head()) print(patients) print(len(patients)) temp_min = 9999 temp_max = 0 for patient in patients: try: label = labels_df.get_value(patient, 'cancer') path = data_dir +'/'+ patient # a couple great 1-liners from: https://www.kaggle.com/gzuidhof/data-science-bowl-2017/full-preprocessing-tutorial slices = [dicom.read_file(path + '/' + s) for s in os.listdir(path)] slices.sort(key=lambda x: int(x.ImagePositionPatient[2])) print(slices[0].pixel_array.shape, len(slices)) if len(slices)>temp_max: temp_max=len(slices) if len(slices) < temp_min: temp_min = len(slices) except: pass print("Minimum number of slices:", temp_min) print("Maximum number of slices:", temp_max)
27.650602
127
0.662309
b791ac3d3021c73d2b06aeec225eba82f7ecf599
852
py
Python
setup.py
LEGO-Robotics/aistorms
abfb6b978215507d331d9ade764310ee9d8c9448
[ "MIT" ]
1
2020-06-06T22:47:09.000Z
2020-06-06T22:47:09.000Z
setup.py
AntoniLuongPham/LEGO-Mindstorms-AI
abfb6b978215507d331d9ade764310ee9d8c9448
[ "MIT" ]
null
null
null
setup.py
AntoniLuongPham/LEGO-Mindstorms-AI
abfb6b978215507d331d9ade764310ee9d8c9448
[ "MIT" ]
1
2020-06-08T15:53:42.000Z
2020-06-08T15:53:42.000Z
import json import os from setuptools import find_packages, setup PACKAGE_NAMESPACE_NAME = 'aistorms' METADATA_FILE_NAME = 'metadata.json' REQUIREMENTS_FILE_NAME = 'requirements.txt' _metadata = \ json.load( open(os.path.join( os.path.dirname(__file__), PACKAGE_NAMESPACE_NAME, METADATA_FILE_NAME))) setup( name=_metadata['PACKAGE'], author=_metadata['AUTHOR'], author_email=_metadata['AUTHOR_EMAIL'], url=_metadata['URL'], version=_metadata['VERSION'], description=_metadata['DESCRIPTION'], long_description=_metadata['DESCRIPTION'], keywords=_metadata['DESCRIPTION'], packages=find_packages(), include_package_data=True, install_requires= [s for s in open(REQUIREMENTS_FILE_NAME).readlines() if not s.startswith('#')])
24.342857
60
0.676056
b791e622824560b49e99db6ea638309e033920f8
3,357
py
Python
scripts/merge.py
jgonzalezdemendibil/movie_publisher
0e58cb616e6e6c2c5cac7cb5016e0874c0409b42
[ "BSD-3-Clause" ]
null
null
null
scripts/merge.py
jgonzalezdemendibil/movie_publisher
0e58cb616e6e6c2c5cac7cb5016e0874c0409b42
[ "BSD-3-Clause" ]
null
null
null
scripts/merge.py
jgonzalezdemendibil/movie_publisher
0e58cb616e6e6c2c5cac7cb5016e0874c0409b42
[ "BSD-3-Clause" ]
null
null
null
#!/usr/bin/python # Copied from https://raw.githubusercontent.com/srv/srv_tools/kinetic/bag_tools/scripts/merge.py since this script is # not released for indigo. """ Copyright (c) 2015, Enrique Fernandez Perdomo Clearpath Robotics, Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Systems, Robotics and Vision Group, University of the Balearican Islands nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. """ from __future__ import print_function import rosbag import argparse import os import sys if __name__ == "__main__": parser = argparse.ArgumentParser( description='Merge multiple bag files into a single one.') parser.add_argument('inbag', help='input bagfile(s)', nargs='+') parser.add_argument('--output', help='output bag file', default='output.bag') parser.add_argument('--topics', help='topics to merge from the input bag files', nargs='+', default=None) parser.add_argument('--exclude_topics', help='topics not to merge from the input bag files', nargs='+', default=[]) args = parser.parse_args() try: sys.exit(merge(args.inbag, args.output, args.topics, args.exclude_topics)) except Exception, e: import traceback traceback.print_exc()
42.493671
117
0.739053
b7925483ba95f2bb530529066114343ba1164af4
1,567
py
Python
src/pyforest/auto_import.py
tnwei/pyforest
73b36298e8cbce9a861c13c01509e34f0e3397fe
[ "MIT" ]
1,002
2019-08-13T15:00:39.000Z
2022-03-29T19:14:41.000Z
src/pyforest/auto_import.py
tnwei/pyforest
73b36298e8cbce9a861c13c01509e34f0e3397fe
[ "MIT" ]
40
2019-08-13T19:17:49.000Z
2022-02-14T08:46:09.000Z
src/pyforest/auto_import.py
tnwei/pyforest
73b36298e8cbce9a861c13c01509e34f0e3397fe
[ "MIT" ]
202
2019-08-13T19:37:25.000Z
2022-03-21T20:05:27.000Z
from pathlib import Path IPYTHON_STARTUP_FOLDER = Path.home() / ".ipython" / "profile_default" / "startup" STARTUP_FILE = IPYTHON_STARTUP_FOLDER / "pyforest_autoimport.py"
31.34
137
0.699426
b7936727533c1b6e64a5988a2f89fc499bcee832
23,430
py
Python
tests/torch/pruning/test_model_pruning_analysis.py
sarthakpati/nncf
29ad62c664c1dd53b3c8c50fc001a1b36bd1e8ac
[ "Apache-2.0" ]
null
null
null
tests/torch/pruning/test_model_pruning_analysis.py
sarthakpati/nncf
29ad62c664c1dd53b3c8c50fc001a1b36bd1e8ac
[ "Apache-2.0" ]
1
2021-07-23T07:46:52.000Z
2021-07-23T07:46:52.000Z
tests/torch/pruning/test_model_pruning_analysis.py
sarthakpati/nncf
29ad62c664c1dd53b3c8c50fc001a1b36bd1e8ac
[ "Apache-2.0" ]
null
null
null
""" Copyright (c) 2020 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ from typing import Callable from typing import Dict from typing import List from typing import Tuple from typing import Type import pytest import torch from torch import nn from nncf.common.graph import NNCFNodeName from nncf.common.pruning.clusterization import Cluster from nncf.common.pruning.clusterization import Clusterization from nncf.common.pruning.model_analysis import ModelAnalyzer from nncf.common.pruning.model_analysis import cluster_special_ops from nncf.torch.dynamic_graph.graph_tracer import ModelInputInfo from nncf.torch.layers import NNCF_PRUNING_MODULES_DICT from nncf.torch.nncf_network import NNCFNetwork from nncf.torch.pruning.export_helpers import PTElementwise from nncf.torch.pruning.export_helpers import PTIdentityMaskForwardOps from nncf.torch.pruning.export_helpers import PT_PRUNING_OPERATOR_METATYPES from nncf.common.pruning.utils import is_depthwise_conv from nncf.torch.pruning.filter_pruning.algo import FilterPruningBuilder from tests.torch.helpers import create_compressed_model_and_algo_for_test from tests.torch.helpers import create_nncf_model_and_single_algo_builder from tests.torch.pruning.helpers import PruningTestModelEltwise from tests.torch.pruning.helpers import PruningTestModelSharedConvs from tests.torch.pruning.helpers import TestModelBranching from tests.torch.pruning.helpers import TestModelDiffConvs from tests.torch.pruning.helpers import TestModelEltwiseCombination from tests.torch.pruning.helpers import TestModelResidualConnection from tests.torch.pruning.helpers import TestModelShuffleNetUnit from tests.torch.pruning.helpers import TestModelShuffleNetUnitDW from tests.torch.pruning.helpers import get_basic_pruning_config # pylint: disable=protected-access GROUP_PRUNING_MODULES_TEST_CASES = [ GroupPruningModulesTestStruct(model=PruningTestModelEltwise, non_pruned_module_nodes=['PruningTestModelEltwise/NNCFConv2d[conv1]/conv2d_0', 'PruningTestModelEltwise/NNCFConv2d[conv4]/conv2d_0'], pruned_groups=[['PruningTestModelEltwise/NNCFConv2d[conv2]/conv2d_0', 'PruningTestModelEltwise/NNCFConv2d[conv3]/conv2d_0']], pruned_groups_by_node_id=[[3, 4]], prune_params=(False, False, False)), GroupPruningModulesTestStruct(model=PruningTestModelEltwise, non_pruned_module_nodes=[], pruned_groups=[['PruningTestModelEltwise/NNCFConv2d[conv1]/conv2d_0'], ['PruningTestModelEltwise/NNCFConv2d[conv4]/conv2d_0'], ['PruningTestModelEltwise/NNCFConv2d[conv2]/conv2d_0', 'PruningTestModelEltwise/NNCFConv2d[conv3]/conv2d_0']], pruned_groups_by_node_id=[[1], [7], [3, 4]], prune_params=(True, True, False)), GroupPruningModulesTestStruct(model=TestModelBranching, non_pruned_module_nodes=[], pruned_groups=[['TestModelBranching/NNCFConv2d[conv1]/conv2d_0', 'TestModelBranching/NNCFConv2d[conv2]/conv2d_0', 'TestModelBranching/NNCFConv2d[conv3]/conv2d_0']], pruned_groups_by_node_id=[[1, 2, 4]], prune_params=(True, True, False)), GroupPruningModulesTestStruct(model=TestModelBranching, non_pruned_module_nodes=['TestModelBranching/NNCFConv2d[conv1]/conv2d_0', 'TestModelBranching/NNCFConv2d[conv2]/conv2d_0', 'TestModelBranching/NNCFConv2d[conv3]/conv2d_0'], pruned_groups=[['TestModelBranching/NNCFConv2d[conv4]/conv2d_0', 'TestModelBranching/NNCFConv2d[conv5]/conv2d_0']], pruned_groups_by_node_id=[[7, 8]], prune_params=(False, True, False)), GroupPruningModulesTestStruct(model=TestModelBranching, non_pruned_module_nodes=['TestModelBranching/NNCFConv2d[conv4]/conv2d_0', 'TestModelBranching/NNCFConv2d[conv5]/conv2d_0'], pruned_groups=[['TestModelBranching/NNCFConv2d[conv1]/conv2d_0', 'TestModelBranching/NNCFConv2d[conv2]/conv2d_0', 'TestModelBranching/NNCFConv2d[conv3]/conv2d_0']], pruned_groups_by_node_id=[[1, 2, 4]], prune_params=(True, False, False)), GroupPruningModulesTestStruct(model=TestModelResidualConnection, non_pruned_module_nodes=['TestModelResidualConnection/NNCFConv2d[conv4]/conv2d_0', 'TestModelResidualConnection/NNCFConv2d[conv5]/conv2d_0'], pruned_groups=[['TestModelResidualConnection/NNCFConv2d[conv1]/conv2d_0', 'TestModelResidualConnection/NNCFConv2d[conv2]/conv2d_0', 'TestModelResidualConnection/NNCFConv2d[conv3]/conv2d_0']], pruned_groups_by_node_id=[[1, 2, 4]], prune_params=(True, True, False)), GroupPruningModulesTestStruct(model=TestModelEltwiseCombination, non_pruned_module_nodes=[], pruned_groups=[['TestModelEltwiseCombination/NNCFConv2d[conv1]/conv2d_0', 'TestModelEltwiseCombination/NNCFConv2d[conv2]/conv2d_0', 'TestModelEltwiseCombination/NNCFConv2d[conv4]/conv2d_0', 'TestModelEltwiseCombination/NNCFConv2d[conv3]/conv2d_0',], ['TestModelEltwiseCombination/NNCFConv2d[conv5]/conv2d_0', 'TestModelEltwiseCombination/NNCFConv2d[conv6]/conv2d_0']], pruned_groups_by_node_id=[[1, 2, 4, 6], [8, 9]], prune_params=(True, True, False)), GroupPruningModulesTestStruct(model=PruningTestModelSharedConvs, non_pruned_module_nodes=['PruningTestModelSharedConvs/NNCFConv2d[conv1]/conv2d_0', 'PruningTestModelSharedConvs/NNCFConv2d[conv3]/conv2d_0', 'PruningTestModelSharedConvs/NNCFConv2d[conv3]/conv2d_1'], pruned_groups=[['PruningTestModelSharedConvs/NNCFConv2d[conv2]/conv2d_0', 'PruningTestModelSharedConvs/NNCFConv2d[conv2]/conv2d_1']], pruned_groups_by_node_id=[[3, 4]], prune_params=(False, False, False)) ] GROUP_SPECIAL_MODULES_TEST_CASES = [ GroupSpecialModulesTestStruct( model=TestModelBranching, eltwise_clusters=[[3, 5], [9]], ), GroupSpecialModulesTestStruct( model=TestModelResidualConnection, eltwise_clusters=[[3, 5], [9]], ), GroupSpecialModulesTestStruct( model=TestModelEltwiseCombination, eltwise_clusters=[[3, 5, 7], [10]] ) ] MODEL_ANALYSER_TEST_CASES = [ ModelAnalyserTestStruct( model=TestModelResidualConnection, ref_can_prune={0: True, 1: True, 2: True, 3: True, 4: True, 5: True, 6: True, 7: False, 8: False, 9: False, 10: False, 11: False, 12: False} ) ] IS_MODULE_PRUNABLE_TEST_CASES = [ ModulePrunableTestStruct( model=TestModelDiffConvs, config_params={}, is_module_prunable={'TestModelDiffConvs/NNCFConv2d[conv1]/conv2d_0': False, 'TestModelDiffConvs/NNCFConv2d[conv2]/conv2d_0': True, 'TestModelDiffConvs/NNCFConv2d[conv3]/conv2d_0': False, 'TestModelDiffConvs/NNCFConv2d[conv4]/conv2d_0': False}, ), ModulePrunableTestStruct( model=TestModelDiffConvs, config_params={'prune_first_conv': True, 'prune_last_conv': True}, is_module_prunable={'TestModelDiffConvs/NNCFConv2d[conv1]/conv2d_0': True, 'TestModelDiffConvs/NNCFConv2d[conv2]/conv2d_0': True, 'TestModelDiffConvs/NNCFConv2d[conv3]/conv2d_0': False, 'TestModelDiffConvs/NNCFConv2d[conv4]/conv2d_0': False}, ), ModulePrunableTestStruct( model=TestModelDiffConvs, config_params={'prune_first_conv': True, 'prune_last_conv': True, 'prune_downsample_convs': True}, is_module_prunable={'TestModelDiffConvs/NNCFConv2d[conv1]/conv2d_0': True, 'TestModelDiffConvs/NNCFConv2d[conv2]/conv2d_0': True, 'TestModelDiffConvs/NNCFConv2d[conv3]/conv2d_0': True, 'TestModelDiffConvs/NNCFConv2d[conv4]/conv2d_0': False}, ), ModulePrunableTestStruct( model=TestModelBranching, config_params={}, is_module_prunable={'TestModelBranching/NNCFConv2d[conv1]/conv2d_0': False, 'TestModelBranching/NNCFConv2d[conv2]/conv2d_0': False, 'TestModelBranching/NNCFConv2d[conv3]/conv2d_0': False, 'TestModelBranching/NNCFConv2d[conv4]/conv2d_0': False, 'TestModelBranching/NNCFConv2d[conv5]/conv2d_0': False}, ), ModulePrunableTestStruct( model=TestModelBranching, config_params={'prune_first_conv': True, 'prune_last_conv': True, }, is_module_prunable={'TestModelBranching/NNCFConv2d[conv1]/conv2d_0': True, 'TestModelBranching/NNCFConv2d[conv2]/conv2d_0': True, 'TestModelBranching/NNCFConv2d[conv3]/conv2d_0': True, 'TestModelBranching/NNCFConv2d[conv4]/conv2d_0': True, 'TestModelBranching/NNCFConv2d[conv5]/conv2d_0': True}, ), ModulePrunableTestStruct( model=TestModelShuffleNetUnitDW, config_params={'prune_first_conv': True, 'prune_last_conv': True, }, is_module_prunable={ 'TestModelShuffleNetUnitDW/NNCFConv2d[conv]/conv2d_0': True, 'TestModelShuffleNetUnitDW/TestShuffleUnit[unit1]/NNCFConv2d[dw_conv4]/conv2d_0': False, 'TestModelShuffleNetUnitDW/TestShuffleUnit[unit1]/NNCFConv2d[expand_conv5]/conv2d_0': True, 'TestModelShuffleNetUnitDW/TestShuffleUnit[unit1]/NNCFConv2d[compress_conv1]/conv2d_0': True, 'TestModelShuffleNetUnitDW/TestShuffleUnit[unit1]/NNCFConv2d[dw_conv2]/conv2d_0': False, 'TestModelShuffleNetUnitDW/TestShuffleUnit[unit1]/NNCFConv2d[expand_conv3]/conv2d_0': True}, ), ModulePrunableTestStruct( model=TestModelShuffleNetUnit, config_params={'prune_first_conv': True, 'prune_last_conv': True, }, is_module_prunable={'TestModelShuffleNetUnit/NNCFConv2d[conv]/conv2d_0': True, 'TestModelShuffleNetUnit/TestShuffleUnit[unit1]/NNCFConv2d[compress_conv1]/conv2d_0': True, 'TestModelShuffleNetUnit/TestShuffleUnit[unit1]/NNCFConv2d[dw_conv2]/conv2d_0': True, 'TestModelShuffleNetUnit/TestShuffleUnit[unit1]/NNCFConv2d[expand_conv3]/conv2d_0': True}, ) ]
51.721854
119
0.660606
b7937e5f465626651bc0a037a47d5bc1cfd62cdf
261
py
Python
tests/future_division_eval.py
mayl8822/onelinerizer
bad341f261d35e56872b4c22297a44dc6d5cfab3
[ "MIT" ]
1,062
2015-11-18T01:04:33.000Z
2022-03-29T07:13:30.000Z
tests/future_division_eval.py
CoDeRgAnEsh/1line
507ef35b0006fc2998463dee92c2fdae53fe0694
[ "MIT" ]
26
2015-11-17T06:58:07.000Z
2022-01-15T18:11:16.000Z
tests/future_division_eval.py
CoDeRgAnEsh/1line
507ef35b0006fc2998463dee92c2fdae53fe0694
[ "MIT" ]
100
2015-11-17T09:01:22.000Z
2021-09-12T13:58:28.000Z
from __future__ import division print eval('1/2') exec('print 1/2') eval(compile('print 1/2', 'wat.py', 'exec')) print eval(compile('1/2', 'wat.py', 'eval')) print eval(compile('1/2', 'wat.py', 'eval', 0, 0)) print eval(compile('1/2', 'wat.py', 'eval', 0, ~0))
32.625
51
0.62069
b7939b77631def2ec27e1370419a519e33e2db7a
180
py
Python
matchms/similarity/spec2vec/__init__.py
fossabot/matchms
090db31b22829dc224e5ed78fb4901e8c14a8e92
[ "Apache-2.0" ]
null
null
null
matchms/similarity/spec2vec/__init__.py
fossabot/matchms
090db31b22829dc224e5ed78fb4901e8c14a8e92
[ "Apache-2.0" ]
null
null
null
matchms/similarity/spec2vec/__init__.py
fossabot/matchms
090db31b22829dc224e5ed78fb4901e8c14a8e92
[ "Apache-2.0" ]
null
null
null
from .Document import Document from .SpectrumDocument import SpectrumDocument from .Spec2Vec import Spec2Vec __all__ = [ "Document", "SpectrumDocument", "Spec2Vec" ]
16.363636
46
0.738889
b794d1e8ea63cc3bf3146f5e45ab36528d92826b
22,826
py
Python
cisco-ios-xr/ydk/models/cisco_ios_xr/Cisco_IOS_XR_wanphy_ui_oper.py
tkamata-test/ydk-py
b637e7853a8edbbd31fbc05afa3aa4110b31c5f9
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
cisco-ios-xr/ydk/models/cisco_ios_xr/Cisco_IOS_XR_wanphy_ui_oper.py
tkamata-test/ydk-py
b637e7853a8edbbd31fbc05afa3aa4110b31c5f9
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
cisco-ios-xr/ydk/models/cisco_ios_xr/Cisco_IOS_XR_wanphy_ui_oper.py
tkamata-test/ydk-py
b637e7853a8edbbd31fbc05afa3aa4110b31c5f9
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
""" Cisco_IOS_XR_wanphy_ui_oper This module contains a collection of YANG definitions for Cisco IOS\-XR wanphy\-ui package operational data. This module contains definitions for the following management objects\: wanphy\: WANPHY operational data Copyright (c) 2013\-2016 by Cisco Systems, Inc. All rights reserved. """ import re import collections from enum import Enum from ydk.types import Empty, YList, YLeafList, DELETE, Decimal64, FixedBitsDict from ydk.errors import YPYError, YPYModelError
30.434667
293
0.423596
b79500b1906f3f8e77f736bcb5d3e403aa5d9a7d
773
py
Python
test/unit/solver/test_lamb.py
megvii-research/basecls
6b395a0a888370b4523764afb78a5a7634a3f6cd
[ "Apache-2.0" ]
23
2021-12-08T02:35:01.000Z
2022-03-16T02:23:19.000Z
test/unit/solver/test_lamb.py
megvii-research/basecls
6b395a0a888370b4523764afb78a5a7634a3f6cd
[ "Apache-2.0" ]
4
2021-12-23T11:31:17.000Z
2022-02-28T01:35:31.000Z
test/unit/solver/test_lamb.py
megvii-research/basecls
6b395a0a888370b4523764afb78a5a7634a3f6cd
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/env python3 # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. import megengine as mge import numpy as np import pytest from megengine.autodiff import GradManager from basecls.solver.optimizer import LAMB
26.655172
67
0.633894
b7961cc47beaac8f9cce44564f475f951b32b24b
2,180
py
Python
onenote-dump/__main__.py
genericmoniker/onenote-dump
78b2ee2dcf854f6bc989d3081f42c97f245e49cc
[ "MIT" ]
39
2019-07-17T06:08:56.000Z
2022-03-22T09:48:58.000Z
onenote-dump/__main__.py
nicknickel/onenote-dump
84607f89f8c14c51796ab660dc0e741af3ccf55c
[ "MIT" ]
5
2020-07-02T02:44:38.000Z
2021-11-11T18:16:13.000Z
onenote-dump/__main__.py
nicknickel/onenote-dump
84607f89f8c14c51796ab660dc0e741af3ccf55c
[ "MIT" ]
6
2020-11-01T12:46:56.000Z
2022-01-12T22:24:50.000Z
import argparse import logging import os import pathlib import time import log import onenote_auth import onenote import pipeline logger = logging.getLogger() main()
27.25
76
0.624771
b7971aac602f7d60f9d06ecc4d523b5988cef546
10,391
py
Python
venv/lib/python3.8/site-packages/ansible_collections/community/aws/tests/unit/plugins/modules/test_data_pipeline.py
saeedya/docker-ansible
6fb0cfc6bc4a5925b21380952a5a4502ec02119a
[ "Apache-2.0" ]
7
2021-11-16T04:05:42.000Z
2022-02-19T21:14:29.000Z
venv/lib/python3.8/site-packages/ansible_collections/community/aws/tests/unit/plugins/modules/test_data_pipeline.py
saeedya/docker-ansible
6fb0cfc6bc4a5925b21380952a5a4502ec02119a
[ "Apache-2.0" ]
1
2022-03-12T02:25:26.000Z
2022-03-12T02:25:26.000Z
venv/lib/python3.8/site-packages/ansible_collections/community/aws/tests/unit/plugins/modules/test_data_pipeline.py
saeedya/docker-ansible
6fb0cfc6bc4a5925b21380952a5a4502ec02119a
[ "Apache-2.0" ]
1
2022-03-01T05:43:07.000Z
2022-03-01T05:43:07.000Z
# (c) 2017 Red Hat Inc. # # This file is part of Ansible # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # Make coding more python3-ish from __future__ import (absolute_import, division, print_function) __metaclass__ = type import collections import os import json import pytest from ansible.module_utils._text import to_text # Magic... Incorrectly identified by pylint as unused from ansible_collections.amazon.aws.tests.unit.utils.amazon_placebo_fixtures import maybe_sleep # pylint: disable=unused-import from ansible_collections.amazon.aws.tests.unit.utils.amazon_placebo_fixtures import placeboify # pylint: disable=unused-import from ansible_collections.community.aws.plugins.modules import data_pipeline # test_api_gateway.py requires the `boto3` and `botocore` modules boto3 = pytest.importorskip('boto3') def test_create_pipeline_already_exists(placeboify, maybe_sleep, dp_setup): connection = placeboify.client('datapipeline') changed, result = data_pipeline.create_pipeline(connection, dp_setup.module) assert changed is False assert "Data Pipeline ansible-test-create-pipeline is present" in result['msg'] def test_pipeline_field(placeboify, maybe_sleep, dp_setup): connection = placeboify.client('datapipeline') pipeline_field_info = data_pipeline.pipeline_field(connection, dp_setup.data_pipeline_id, "@pipelineState") assert pipeline_field_info == "PENDING" def test_define_pipeline(placeboify, maybe_sleep, dp_setup): connection = placeboify.client('datapipeline') changed, result = data_pipeline.define_pipeline(connection, dp_setup.module, dp_setup.objects, dp_setup.data_pipeline_id) assert 'has been updated' in result def test_deactivate_pipeline(placeboify, maybe_sleep, dp_setup): connection = placeboify.client('datapipeline') changed, result = data_pipeline.deactivate_pipeline(connection, dp_setup.module) assert "Data Pipeline ansible-test-create-pipeline deactivated" in result['msg'] def test_activate_without_population(placeboify, maybe_sleep, dp_setup): connection = placeboify.client('datapipeline') with pytest.raises(Exception) as error_message: changed, result = data_pipeline.activate_pipeline(connection, dp_setup.module) assert error_message == "You need to populate your pipeline before activation." def test_create_pipeline(placeboify, maybe_sleep): connection = placeboify.client('datapipeline') params = {'name': 'ansible-unittest-create-pipeline', 'description': 'ansible-datapipeline-unit-test', 'state': 'present', 'timeout': 300, 'tags': {}} m = FakeModule(**params) changed, result = data_pipeline.create_pipeline(connection, m) assert changed is True assert result['msg'] == "Data Pipeline ansible-unittest-create-pipeline created." data_pipeline.delete_pipeline(connection, m) def test_create_pipeline_with_tags(placeboify, maybe_sleep): connection = placeboify.client('datapipeline') params = {'name': 'ansible-unittest-create-pipeline_tags', 'description': 'ansible-datapipeline-unit-test', 'state': 'present', 'tags': {'ansible': 'test'}, 'timeout': 300} m = FakeModule(**params) changed, result = data_pipeline.create_pipeline(connection, m) assert changed is True assert result['msg'] == "Data Pipeline ansible-unittest-create-pipeline_tags created." data_pipeline.delete_pipeline(connection, m) def test_delete_nonexistent_pipeline(placeboify, maybe_sleep): connection = placeboify.client('datapipeline') params = {'name': 'ansible-test-nonexistent', 'description': 'ansible-test-nonexistent', 'state': 'absent', 'objects': [], 'tags': {'ansible': 'test'}, 'timeout': 300} m = FakeModule(**params) changed, result = data_pipeline.delete_pipeline(connection, m) assert changed is False def test_delete_pipeline(placeboify, maybe_sleep): connection = placeboify.client('datapipeline') params = {'name': 'ansible-test-nonexistent', 'description': 'ansible-test-nonexistent', 'state': 'absent', 'objects': [], 'tags': {'ansible': 'test'}, 'timeout': 300} m = FakeModule(**params) data_pipeline.create_pipeline(connection, m) changed, result = data_pipeline.delete_pipeline(connection, m) assert changed is True def test_build_unique_id_different(): m = FakeModule(**{'name': 'ansible-unittest-1', 'description': 'test-unique-id'}) m2 = FakeModule(**{'name': 'ansible-unittest-1', 'description': 'test-unique-id-different'}) assert data_pipeline.build_unique_id(m) != data_pipeline.build_unique_id(m2) def test_build_unique_id_same(): m = FakeModule(**{'name': 'ansible-unittest-1', 'description': 'test-unique-id', 'tags': {'ansible': 'test'}}) m2 = FakeModule(**{'name': 'ansible-unittest-1', 'description': 'test-unique-id', 'tags': {'ansible': 'test'}}) assert data_pipeline.build_unique_id(m) == data_pipeline.build_unique_id(m2) def test_build_unique_id_obj(): # check that the object can be different and the unique id should be the same; should be able to modify objects m = FakeModule(**{'name': 'ansible-unittest-1', 'objects': [{'first': 'object'}]}) m2 = FakeModule(**{'name': 'ansible-unittest-1', 'objects': [{'second': 'object'}]}) assert data_pipeline.build_unique_id(m) == data_pipeline.build_unique_id(m2) def test_format_tags(): unformatted_tags = {'key1': 'val1', 'key2': 'val2', 'key3': 'val3'} formatted_tags = data_pipeline.format_tags(unformatted_tags) for tag_set in formatted_tags: assert unformatted_tags[tag_set['key']] == tag_set['value']
40.909449
128
0.698008
b7977b33c0e4a7ba789fa84d50fd2df4ed4339db
3,433
py
Python
Janela/Cadastro_clientes/Clientes.py
marcosj046/Treinando-Python-Tkinter
7b88a6b6afba46e6c013b65b952723047c173901
[ "MIT" ]
null
null
null
Janela/Cadastro_clientes/Clientes.py
marcosj046/Treinando-Python-Tkinter
7b88a6b6afba46e6c013b65b952723047c173901
[ "MIT" ]
null
null
null
Janela/Cadastro_clientes/Clientes.py
marcosj046/Treinando-Python-Tkinter
7b88a6b6afba46e6c013b65b952723047c173901
[ "MIT" ]
null
null
null
import sqlite3 import tkinter as tk import pandas as pd #---------------------------------------------- #Para criao do banco de dados retira o comentrio (#) da linha 9 23 somente a primeira vez que rodar o cd, #depois, basta comentar novamente. #Criando o Banco de Dados # conexao = sqlite3.connect('Clientes.db') # # c = conexao.cursor() # # c.execute(''' CREATE TABLE clientes ( # Nome text, # Sobrenome text, # Email text, # Telefone text # ) # ''') # # conexao.commit() # conexao.close() #----------------------------------------------- #Criando as funes #Criando a funo para exportar as informaes do banco em formato xlxs #----------------------------------------------- janela = tk.Tk() #estartando a janela janela.title("Cadastro de Clientes") #Inserindo um ttulo na janela #Criando as Labels: label_nome = tk.Label(janela, text="Nome") label_nome.grid(row=0, column=0, padx=10, pady=10) label_sobrenome = tk.Label(janela, text="Sobrenome") label_sobrenome.grid(row=1, column=0, padx=10, pady=10) label_email = tk.Label(janela, text="Email") label_email.grid(row=2, column=0, padx=10, pady=10) label_telefone = tk.Label(janela, text="Telefone") label_telefone.grid(row=3, column=0, padx=10, pady=10) #------------------------------------------------------- #Entrys entry_nome = tk.Entry(janela, text="Nome", width=30) entry_nome.grid(row=0, column=2, padx=10, pady=10) entry_sobrenome = tk.Entry(janela, text="Sobrenome", width=30) entry_sobrenome.grid(row=1, column=2, padx=10, pady=10) entry_email = tk.Entry(janela, text="Email", width=30) entry_email.grid(row=2, column=2, padx=10, pady=10) entry_telefone = tk.Entry(janela, text="Telefone", width=30) entry_telefone.grid(row=3, column=2, padx=10, pady=10) #Botes botao_Cadastrar = tk.Button(janela, text="Cadastrar Cliente", command = cadastrar_cliente) botao_Cadastrar.grid(row=4, column=0, padx=10, pady=10, columnspan=2, ipadx=80) botao_exportar = tk.Button(janela, text="Exportar Cliente", command = exportar_cliente) botao_exportar.grid(row=4, column=2, padx=10, pady=10, columnspan=2, ipadx=80) #Obs: ipadx=80 - Basicamente serve para alargar uma estrutura especifca janela.mainloop()
33.990099
171
0.669677
b79823a97f320a9bd4990bfd614e964f079da76e
14,382
py
Python
pygitbucket/client.py
SimiCode/pygitbucket
46a22fcc0292231905eb4e0e2da47f8a85743bbd
[ "MIT" ]
1
2021-07-04T19:45:05.000Z
2021-07-04T19:45:05.000Z
pygitbucket/client.py
SimiCode/pygitbucket
46a22fcc0292231905eb4e0e2da47f8a85743bbd
[ "MIT" ]
null
null
null
pygitbucket/client.py
SimiCode/pygitbucket
46a22fcc0292231905eb4e0e2da47f8a85743bbd
[ "MIT" ]
null
null
null
import math import requests from pygitbucket.exceptions import ( UnknownError, InvalidIDError, NotFoundIDError, NotAuthenticatedError, PermissionError, )
28.821643
117
0.578779
b79836d2b12f5a44dd3688e75af8cc0da3616913
3,982
py
Python
egg/zoo/basic_games/data_readers.py
renata-nerenata/EGG
b8532efc3569defabeba6851986cecb0c6640984
[ "MIT" ]
1
2021-05-26T14:23:25.000Z
2021-05-26T14:23:25.000Z
egg/zoo/basic_games/data_readers.py
renata-nerenata/EGG
b8532efc3569defabeba6851986cecb0c6640984
[ "MIT" ]
1
2019-10-31T16:21:01.000Z
2019-10-31T16:21:01.000Z
egg/zoo/basic_games/data_readers.py
renata-nerenata/EGG
b8532efc3569defabeba6851986cecb0c6640984
[ "MIT" ]
null
null
null
# Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import torch from torch.utils.data import Dataset import numpy as np # These input-data-processing classes take input data from a text file and convert them to the format # appropriate for the recognition and discrimination games, so that they can be read by # the standard pytorch DataLoader. The latter requires the data reading classes to support # a __len__(self) method, returning the size of the dataset, and a __getitem__(self, idx) # method, returning the idx-th item in the dataset. We also provide a get_n_features(self) method, # returning the dimensionality of the Sender input vector after it is transformed to one-hot format. # The AttValRecoDataset class is used in the reconstruction game. It takes an input file with a # space-delimited attribute-value vector per line and creates a data-frame with the two mandatory # fields expected in EGG games, namely sender_input and labels. # In this case, the two fields contain the same information, namely the input attribute-value vectors, # represented as one-hot in sender_input, and in the original integer-based format in # labels. # The AttValDiscriDataset class, used in the discrimination game takes an input file with a variable # number of period-delimited fields, where all fields but the last represent attribute-value vectors # (with space-delimited attributes). The last field contains the index (counting from 0) of the target # vector. # Here, we create a data-frame containing 3 fields: sender_input, labels and receiver_input (these are # expected by EGG, the first two mandatorily so). # The sender_input corresponds to the target vector (in one-hot format), labels are the indices of the # target vector location and receiver_input is a matrix with a row for each input vector (in input order).
45.770115
106
0.678805
b798b33e304086ef9c7efe2c716e2e87dfcb993a
3,594
py
Python
viroconcom/read_write.py
adrdrew/viroconcom
3eb748ba8e3e076eddd174a0fcdfee3917aa4045
[ "MIT" ]
null
null
null
viroconcom/read_write.py
adrdrew/viroconcom
3eb748ba8e3e076eddd174a0fcdfee3917aa4045
[ "MIT" ]
1
2020-05-18T11:06:28.000Z
2020-05-18T11:06:28.000Z
viroconcom/read_write.py
adrdrew/viroconcom
3eb748ba8e3e076eddd174a0fcdfee3917aa4045
[ "MIT" ]
null
null
null
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Reads datasets, reads and writes contour coordinates. """ import numpy as np import csv def read_ecbenchmark_dataset(path='datasets/1year_dataset_A.txt'): """ Reads a 2D dataset that uses a an ASCI format with ';' as a seperator. This format has been used in the EC benchmark, see https://github.com/ec-benchmark-organizers/ec-benchmark . Parameters ---------- path : string Path to dataset including the file name, defaults to '../datasets/1year_dataset_A.txt' Returns ------- x : ndarray of doubles Observations of the environmental variable 1. y : ndarray of doubles Observations of the environmental variable 2. x_label : str Label of the environmantal variable 1. y_label : str Label of the environmental variable 2. """ x = list() y = list() x_label = None y_label = None with open(path, newline='') as csv_file: reader = csv.reader(csv_file, delimiter=';') idx = 0 for row in reader: if idx == 0: x_label = row[1][1:] # Ignore first char (is a white space). y_label = row[2][1:] # Ignore first char (is a white space). if idx > 0: # Ignore the header x.append(float(row[1])) y.append(float(row[2])) idx = idx + 1 x = np.asarray(x) y = np.asarray(y) return (x, y, x_label, y_label) def write_contour(x, y, path, label_x='Variable x (unit)', label_y='Variable y (unit)'): """ Writes 2D contour coordinates in an ASCI format with ';' as a seperator. Parameters ---------- x : ndarray of doubles Values in the first dimensions of the contour's coordinates. y : ndarray of doubles Values in the second dimensions of the contour's coordinates. path : string Path including folder and file name where the contour should be saved. label_x : str Name and unit of the first environmental variable, defaults to 'Variable x (unit), could be, for exmaple, 'Significant wave height (m)'. label_y : str Name and unit of the second environmental variable, defaults to 'Variable y (unit)', could be, for example, 'Zero-up-crossing period (s)'. """ with open(path, mode='w', newline='') as contour_file: contour_writer = csv.writer(contour_file, delimiter=';', quotechar='"', quoting=csv.QUOTE_MINIMAL) contour_writer.writerow([label_x, label_y]) for xi,yi in zip(x,y): contour_writer.writerow([str(xi), str(yi)]) def read_contour(path): """ Reads 2D contour coordinates in an ASCI format with ';' as a seperator. Parameters ---------- path : string Path to contour including the file name. Returns ------- x : ndarray of doubles Observations of the environmental variable 1. y : ndarray of doubles Observations of the environmental variable 2. """ x = list() y = list() with open(path, newline='') as csv_file: reader = csv.reader(csv_file, delimiter=';') idx = 0 for row in reader: if idx > 0: # Ignore the header x.append(float(row[0])) y.append(float(row[1])) idx = idx + 1 x = np.asarray(x) y = np.asarray(y) return (x, y)
31.526316
107
0.574012
b798e6d01b3ed050802b1fbfc6ef1f267c2dd36a
601
py
Python
check_python_install/check_numba.py
sdpython/_check_python_install
06a34e3b8559370c8c41b655ed2acc72c7f1bf34
[ "MIT" ]
null
null
null
check_python_install/check_numba.py
sdpython/_check_python_install
06a34e3b8559370c8c41b655ed2acc72c7f1bf34
[ "MIT" ]
2
2019-11-07T18:11:18.000Z
2021-01-02T11:49:38.000Z
check_python_install/check_numba.py
sdpython/_check_python_install
06a34e3b8559370c8c41b655ed2acc72c7f1bf34
[ "MIT" ]
null
null
null
""" @file @brief Test for :epkg:`cartopy`. """ import numpy import numba def check_numba(): """ Runs a sample with :epkg:`numba`. """ Y = numpy.random.rand(10).astype(numpy.double) X = numpy.random.rand(10, 2).astype(numpy.double) w = numpy.random.rand(2).astype(numpy.double) return logistic_regression(Y, X, w, 2)
24.04
86
0.62396
b799cded976768ac0fb3f24b3d043843412ec29f
4,056
py
Python
Round 3/fence_design.py
e-ntro-py/GoogleCodeJam-2021
c42283480fa20a853c6d31d5faf0e83c6ad0f5f7
[ "MIT" ]
30
2021-03-27T20:18:15.000Z
2022-03-19T06:18:58.000Z
Round 3/fence_design.py
e-ntro-py/GoogleCodeJam-2021
c42283480fa20a853c6d31d5faf0e83c6ad0f5f7
[ "MIT" ]
1
2021-05-24T19:14:29.000Z
2021-05-25T04:14:10.000Z
Round 3/fence_design.py
e-ntro-py/GoogleCodeJam-2021
c42283480fa20a853c6d31d5faf0e83c6ad0f5f7
[ "MIT" ]
7
2021-03-28T12:38:55.000Z
2021-09-19T15:30:39.000Z
# Copyright (c) 2021 kamyu. All rights reserved. # # Google Code Jam 2021 Round 3 - Problem C. Fence Design # https://codingcompetitions.withgoogle.com/codejam/round/0000000000436142/0000000000813bc7 # # Time: O(NlogN) on average, pass in PyPy2 but Python2 # Space: O(N) # from random import seed, randint # Compute the cross product of vectors AB and AC CW, COLLINEAR, CCW = range(-1, 2) seed(0) for case in xrange(input()): print 'Case #%d: %s' % (case+1, fence_design())
38.264151
115
0.554487
b79b05e86bdffa34c0cb47c7868d179ea550149c
50,505
py
Python
Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/pygsl/_block.py
poojavade/Genomics_Docker
829b5094bba18bbe03ae97daf925fee40a8476e8
[ "Apache-2.0" ]
1
2019-07-29T02:53:51.000Z
2019-07-29T02:53:51.000Z
Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/pygsl/_block.py
poojavade/Genomics_Docker
829b5094bba18bbe03ae97daf925fee40a8476e8
[ "Apache-2.0" ]
1
2021-09-11T14:30:32.000Z
2021-09-11T14:30:32.000Z
Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/pygsl/_block.py
poojavade/Genomics_Docker
829b5094bba18bbe03ae97daf925fee40a8476e8
[ "Apache-2.0" ]
2
2016-12-19T02:27:46.000Z
2019-07-29T02:53:54.000Z
# This file was automatically generated by SWIG (http://www.swig.org). # Version 2.0.11 # # Do not make changes to this file unless you know what you are doing--modify # the SWIG interface file instead. from sys import version_info if version_info >= (2,6,0): __block = swig_import_helper() del swig_import_helper else: import __block del version_info try: _swig_property = property except NameError: pass # Python < 2.2 doesn't have 'property'. try: _object = object _newclass = 1 except AttributeError: _newclass = 0 gsl_vector_set_zero = __block.gsl_vector_set_zero gsl_vector_set_all = __block.gsl_vector_set_all gsl_vector_set_basis = __block.gsl_vector_set_basis gsl_vector_fread = __block.gsl_vector_fread gsl_vector_fwrite = __block.gsl_vector_fwrite gsl_vector_fscanf = __block.gsl_vector_fscanf gsl_vector_fprintf = __block.gsl_vector_fprintf gsl_vector_reverse = __block.gsl_vector_reverse gsl_vector_swap = __block.gsl_vector_swap gsl_vector_swap_elements = __block.gsl_vector_swap_elements gsl_vector_max = __block.gsl_vector_max gsl_vector_min = __block.gsl_vector_min gsl_vector_minmax = __block.gsl_vector_minmax gsl_vector_max_index = __block.gsl_vector_max_index gsl_vector_min_index = __block.gsl_vector_min_index gsl_vector_minmax_index = __block.gsl_vector_minmax_index gsl_vector_isnull = __block.gsl_vector_isnull gsl_matrix_set_zero = __block.gsl_matrix_set_zero gsl_matrix_set_all = __block.gsl_matrix_set_all gsl_matrix_set_identity = __block.gsl_matrix_set_identity gsl_matrix_fread = __block.gsl_matrix_fread gsl_matrix_fwrite = __block.gsl_matrix_fwrite gsl_matrix_fscanf = __block.gsl_matrix_fscanf gsl_matrix_fprintf = __block.gsl_matrix_fprintf gsl_matrix_swap = __block.gsl_matrix_swap gsl_matrix_swap_rows = __block.gsl_matrix_swap_rows gsl_matrix_swap_columns = __block.gsl_matrix_swap_columns gsl_matrix_swap_rowcol = __block.gsl_matrix_swap_rowcol gsl_matrix_transpose = __block.gsl_matrix_transpose gsl_matrix_max = __block.gsl_matrix_max gsl_matrix_min = __block.gsl_matrix_min gsl_matrix_minmax = __block.gsl_matrix_minmax gsl_matrix_max_index = __block.gsl_matrix_max_index gsl_matrix_min_index = __block.gsl_matrix_min_index gsl_matrix_minmax_index = __block.gsl_matrix_minmax_index gsl_matrix_isnull = __block.gsl_matrix_isnull gsl_matrix_diagonal = __block.gsl_matrix_diagonal gsl_matrix_subdiagonal = __block.gsl_matrix_subdiagonal gsl_matrix_superdiagonal = __block.gsl_matrix_superdiagonal gsl_vector_float_set_zero = __block.gsl_vector_float_set_zero gsl_vector_float_set_all = __block.gsl_vector_float_set_all gsl_vector_float_set_basis = __block.gsl_vector_float_set_basis gsl_vector_float_fread = __block.gsl_vector_float_fread gsl_vector_float_fwrite = __block.gsl_vector_float_fwrite gsl_vector_float_fscanf = __block.gsl_vector_float_fscanf gsl_vector_float_fprintf = __block.gsl_vector_float_fprintf gsl_vector_float_reverse = __block.gsl_vector_float_reverse gsl_vector_float_swap = __block.gsl_vector_float_swap gsl_vector_float_swap_elements = __block.gsl_vector_float_swap_elements gsl_vector_float_max = __block.gsl_vector_float_max gsl_vector_float_min = __block.gsl_vector_float_min gsl_vector_float_minmax = __block.gsl_vector_float_minmax gsl_vector_float_max_index = __block.gsl_vector_float_max_index gsl_vector_float_min_index = __block.gsl_vector_float_min_index gsl_vector_float_minmax_index = __block.gsl_vector_float_minmax_index gsl_vector_float_isnull = __block.gsl_vector_float_isnull gsl_matrix_float_set_zero = __block.gsl_matrix_float_set_zero gsl_matrix_float_set_all = __block.gsl_matrix_float_set_all gsl_matrix_float_set_identity = __block.gsl_matrix_float_set_identity gsl_matrix_float_fread = __block.gsl_matrix_float_fread gsl_matrix_float_fwrite = __block.gsl_matrix_float_fwrite gsl_matrix_float_fscanf = __block.gsl_matrix_float_fscanf gsl_matrix_float_fprintf = __block.gsl_matrix_float_fprintf gsl_matrix_float_swap = __block.gsl_matrix_float_swap gsl_matrix_float_swap_rows = __block.gsl_matrix_float_swap_rows gsl_matrix_float_swap_columns = __block.gsl_matrix_float_swap_columns gsl_matrix_float_swap_rowcol = __block.gsl_matrix_float_swap_rowcol gsl_matrix_float_transpose = __block.gsl_matrix_float_transpose gsl_matrix_float_max = __block.gsl_matrix_float_max gsl_matrix_float_min = __block.gsl_matrix_float_min gsl_matrix_float_minmax = __block.gsl_matrix_float_minmax gsl_matrix_float_max_index = __block.gsl_matrix_float_max_index gsl_matrix_float_min_index = __block.gsl_matrix_float_min_index gsl_matrix_float_minmax_index = __block.gsl_matrix_float_minmax_index gsl_matrix_float_isnull = __block.gsl_matrix_float_isnull gsl_matrix_float_diagonal = __block.gsl_matrix_float_diagonal gsl_matrix_float_subdiagonal = __block.gsl_matrix_float_subdiagonal gsl_matrix_float_superdiagonal = __block.gsl_matrix_float_superdiagonal gsl_vector_long_set_zero = __block.gsl_vector_long_set_zero gsl_vector_long_set_all = __block.gsl_vector_long_set_all gsl_vector_long_set_basis = __block.gsl_vector_long_set_basis gsl_vector_long_fread = __block.gsl_vector_long_fread gsl_vector_long_fwrite = __block.gsl_vector_long_fwrite gsl_vector_long_fscanf = __block.gsl_vector_long_fscanf gsl_vector_long_fprintf = __block.gsl_vector_long_fprintf gsl_vector_long_reverse = __block.gsl_vector_long_reverse gsl_vector_long_swap = __block.gsl_vector_long_swap gsl_vector_long_swap_elements = __block.gsl_vector_long_swap_elements gsl_vector_long_max = __block.gsl_vector_long_max gsl_vector_long_min = __block.gsl_vector_long_min gsl_vector_long_minmax = __block.gsl_vector_long_minmax gsl_vector_long_max_index = __block.gsl_vector_long_max_index gsl_vector_long_min_index = __block.gsl_vector_long_min_index gsl_vector_long_minmax_index = __block.gsl_vector_long_minmax_index gsl_vector_long_isnull = __block.gsl_vector_long_isnull gsl_matrix_long_set_zero = __block.gsl_matrix_long_set_zero gsl_matrix_long_set_all = __block.gsl_matrix_long_set_all gsl_matrix_long_set_identity = __block.gsl_matrix_long_set_identity gsl_matrix_long_fread = __block.gsl_matrix_long_fread gsl_matrix_long_fwrite = __block.gsl_matrix_long_fwrite gsl_matrix_long_fscanf = __block.gsl_matrix_long_fscanf gsl_matrix_long_fprintf = __block.gsl_matrix_long_fprintf gsl_matrix_long_swap = __block.gsl_matrix_long_swap gsl_matrix_long_swap_rows = __block.gsl_matrix_long_swap_rows gsl_matrix_long_swap_columns = __block.gsl_matrix_long_swap_columns gsl_matrix_long_swap_rowcol = __block.gsl_matrix_long_swap_rowcol gsl_matrix_long_transpose = __block.gsl_matrix_long_transpose gsl_matrix_long_max = __block.gsl_matrix_long_max gsl_matrix_long_min = __block.gsl_matrix_long_min gsl_matrix_long_minmax = __block.gsl_matrix_long_minmax gsl_matrix_long_max_index = __block.gsl_matrix_long_max_index gsl_matrix_long_min_index = __block.gsl_matrix_long_min_index gsl_matrix_long_minmax_index = __block.gsl_matrix_long_minmax_index gsl_matrix_long_isnull = __block.gsl_matrix_long_isnull gsl_matrix_long_diagonal = __block.gsl_matrix_long_diagonal gsl_matrix_long_subdiagonal = __block.gsl_matrix_long_subdiagonal gsl_matrix_long_superdiagonal = __block.gsl_matrix_long_superdiagonal gsl_vector_int_set_zero = __block.gsl_vector_int_set_zero gsl_vector_int_set_all = __block.gsl_vector_int_set_all gsl_vector_int_set_basis = __block.gsl_vector_int_set_basis gsl_vector_int_fread = __block.gsl_vector_int_fread gsl_vector_int_fwrite = __block.gsl_vector_int_fwrite gsl_vector_int_fscanf = __block.gsl_vector_int_fscanf gsl_vector_int_fprintf = __block.gsl_vector_int_fprintf gsl_vector_int_reverse = __block.gsl_vector_int_reverse gsl_vector_int_swap = __block.gsl_vector_int_swap gsl_vector_int_swap_elements = __block.gsl_vector_int_swap_elements gsl_vector_int_max = __block.gsl_vector_int_max gsl_vector_int_min = __block.gsl_vector_int_min gsl_vector_int_minmax = __block.gsl_vector_int_minmax gsl_vector_int_max_index = __block.gsl_vector_int_max_index gsl_vector_int_min_index = __block.gsl_vector_int_min_index gsl_vector_int_minmax_index = __block.gsl_vector_int_minmax_index gsl_vector_int_isnull = __block.gsl_vector_int_isnull gsl_matrix_int_set_zero = __block.gsl_matrix_int_set_zero gsl_matrix_int_set_all = __block.gsl_matrix_int_set_all gsl_matrix_int_set_identity = __block.gsl_matrix_int_set_identity gsl_matrix_int_fread = __block.gsl_matrix_int_fread gsl_matrix_int_fwrite = __block.gsl_matrix_int_fwrite gsl_matrix_int_fscanf = __block.gsl_matrix_int_fscanf gsl_matrix_int_fprintf = __block.gsl_matrix_int_fprintf gsl_matrix_int_swap = __block.gsl_matrix_int_swap gsl_matrix_int_swap_rows = __block.gsl_matrix_int_swap_rows gsl_matrix_int_swap_columns = __block.gsl_matrix_int_swap_columns gsl_matrix_int_swap_rowcol = __block.gsl_matrix_int_swap_rowcol gsl_matrix_int_transpose = __block.gsl_matrix_int_transpose gsl_matrix_int_max = __block.gsl_matrix_int_max gsl_matrix_int_min = __block.gsl_matrix_int_min gsl_matrix_int_minmax = __block.gsl_matrix_int_minmax gsl_matrix_int_max_index = __block.gsl_matrix_int_max_index gsl_matrix_int_min_index = __block.gsl_matrix_int_min_index gsl_matrix_int_minmax_index = __block.gsl_matrix_int_minmax_index gsl_matrix_int_isnull = __block.gsl_matrix_int_isnull gsl_matrix_int_diagonal = __block.gsl_matrix_int_diagonal gsl_matrix_int_subdiagonal = __block.gsl_matrix_int_subdiagonal gsl_matrix_int_superdiagonal = __block.gsl_matrix_int_superdiagonal gsl_vector_short_set_zero = __block.gsl_vector_short_set_zero gsl_vector_short_set_all = __block.gsl_vector_short_set_all gsl_vector_short_set_basis = __block.gsl_vector_short_set_basis gsl_vector_short_fread = __block.gsl_vector_short_fread gsl_vector_short_fwrite = __block.gsl_vector_short_fwrite gsl_vector_short_fscanf = __block.gsl_vector_short_fscanf gsl_vector_short_fprintf = __block.gsl_vector_short_fprintf gsl_vector_short_reverse = __block.gsl_vector_short_reverse gsl_vector_short_swap = __block.gsl_vector_short_swap gsl_vector_short_swap_elements = __block.gsl_vector_short_swap_elements gsl_vector_short_max = __block.gsl_vector_short_max gsl_vector_short_min = __block.gsl_vector_short_min gsl_vector_short_minmax = __block.gsl_vector_short_minmax gsl_vector_short_max_index = __block.gsl_vector_short_max_index gsl_vector_short_min_index = __block.gsl_vector_short_min_index gsl_vector_short_minmax_index = __block.gsl_vector_short_minmax_index gsl_vector_short_isnull = __block.gsl_vector_short_isnull gsl_matrix_short_set_zero = __block.gsl_matrix_short_set_zero gsl_matrix_short_set_all = __block.gsl_matrix_short_set_all gsl_matrix_short_set_identity = __block.gsl_matrix_short_set_identity gsl_matrix_short_fread = __block.gsl_matrix_short_fread gsl_matrix_short_fwrite = __block.gsl_matrix_short_fwrite gsl_matrix_short_fscanf = __block.gsl_matrix_short_fscanf gsl_matrix_short_fprintf = __block.gsl_matrix_short_fprintf gsl_matrix_short_swap = __block.gsl_matrix_short_swap gsl_matrix_short_swap_rows = __block.gsl_matrix_short_swap_rows gsl_matrix_short_swap_columns = __block.gsl_matrix_short_swap_columns gsl_matrix_short_swap_rowcol = __block.gsl_matrix_short_swap_rowcol gsl_matrix_short_transpose = __block.gsl_matrix_short_transpose gsl_matrix_short_max = __block.gsl_matrix_short_max gsl_matrix_short_min = __block.gsl_matrix_short_min gsl_matrix_short_minmax = __block.gsl_matrix_short_minmax gsl_matrix_short_max_index = __block.gsl_matrix_short_max_index gsl_matrix_short_min_index = __block.gsl_matrix_short_min_index gsl_matrix_short_minmax_index = __block.gsl_matrix_short_minmax_index gsl_matrix_short_isnull = __block.gsl_matrix_short_isnull gsl_matrix_short_diagonal = __block.gsl_matrix_short_diagonal gsl_matrix_short_subdiagonal = __block.gsl_matrix_short_subdiagonal gsl_matrix_short_superdiagonal = __block.gsl_matrix_short_superdiagonal gsl_vector_char_set_zero = __block.gsl_vector_char_set_zero gsl_vector_char_set_all = __block.gsl_vector_char_set_all gsl_vector_char_set_basis = __block.gsl_vector_char_set_basis gsl_vector_char_fread = __block.gsl_vector_char_fread gsl_vector_char_fwrite = __block.gsl_vector_char_fwrite gsl_vector_char_fscanf = __block.gsl_vector_char_fscanf gsl_vector_char_fprintf = __block.gsl_vector_char_fprintf gsl_vector_char_reverse = __block.gsl_vector_char_reverse gsl_vector_char_swap = __block.gsl_vector_char_swap gsl_vector_char_swap_elements = __block.gsl_vector_char_swap_elements gsl_vector_char_max = __block.gsl_vector_char_max gsl_vector_char_min = __block.gsl_vector_char_min gsl_vector_char_minmax = __block.gsl_vector_char_minmax gsl_vector_char_max_index = __block.gsl_vector_char_max_index gsl_vector_char_min_index = __block.gsl_vector_char_min_index gsl_vector_char_minmax_index = __block.gsl_vector_char_minmax_index gsl_vector_char_isnull = __block.gsl_vector_char_isnull gsl_matrix_char_set_zero = __block.gsl_matrix_char_set_zero gsl_matrix_char_set_all = __block.gsl_matrix_char_set_all gsl_matrix_char_set_identity = __block.gsl_matrix_char_set_identity gsl_matrix_char_fread = __block.gsl_matrix_char_fread gsl_matrix_char_fwrite = __block.gsl_matrix_char_fwrite gsl_matrix_char_fscanf = __block.gsl_matrix_char_fscanf gsl_matrix_char_fprintf = __block.gsl_matrix_char_fprintf gsl_matrix_char_swap = __block.gsl_matrix_char_swap gsl_matrix_char_swap_rows = __block.gsl_matrix_char_swap_rows gsl_matrix_char_swap_columns = __block.gsl_matrix_char_swap_columns gsl_matrix_char_swap_rowcol = __block.gsl_matrix_char_swap_rowcol gsl_matrix_char_transpose = __block.gsl_matrix_char_transpose gsl_matrix_char_max = __block.gsl_matrix_char_max gsl_matrix_char_min = __block.gsl_matrix_char_min gsl_matrix_char_minmax = __block.gsl_matrix_char_minmax gsl_matrix_char_max_index = __block.gsl_matrix_char_max_index gsl_matrix_char_min_index = __block.gsl_matrix_char_min_index gsl_matrix_char_minmax_index = __block.gsl_matrix_char_minmax_index gsl_matrix_char_isnull = __block.gsl_matrix_char_isnull gsl_matrix_char_diagonal = __block.gsl_matrix_char_diagonal gsl_matrix_char_subdiagonal = __block.gsl_matrix_char_subdiagonal gsl_matrix_char_superdiagonal = __block.gsl_matrix_char_superdiagonal gsl_vector_complex_set_zero = __block.gsl_vector_complex_set_zero gsl_vector_complex_set_all = __block.gsl_vector_complex_set_all gsl_vector_complex_set_basis = __block.gsl_vector_complex_set_basis gsl_vector_complex_fread = __block.gsl_vector_complex_fread gsl_vector_complex_fwrite = __block.gsl_vector_complex_fwrite gsl_vector_complex_fscanf = __block.gsl_vector_complex_fscanf gsl_vector_complex_fprintf = __block.gsl_vector_complex_fprintf gsl_vector_complex_reverse = __block.gsl_vector_complex_reverse gsl_vector_complex_swap = __block.gsl_vector_complex_swap gsl_vector_complex_swap_elements = __block.gsl_vector_complex_swap_elements gsl_vector_complex_isnull = __block.gsl_vector_complex_isnull gsl_matrix_complex_set_zero = __block.gsl_matrix_complex_set_zero gsl_matrix_complex_set_all = __block.gsl_matrix_complex_set_all gsl_matrix_complex_set_identity = __block.gsl_matrix_complex_set_identity gsl_matrix_complex_fread = __block.gsl_matrix_complex_fread gsl_matrix_complex_fwrite = __block.gsl_matrix_complex_fwrite gsl_matrix_complex_fscanf = __block.gsl_matrix_complex_fscanf gsl_matrix_complex_fprintf = __block.gsl_matrix_complex_fprintf gsl_matrix_complex_swap = __block.gsl_matrix_complex_swap gsl_matrix_complex_swap_rows = __block.gsl_matrix_complex_swap_rows gsl_matrix_complex_swap_columns = __block.gsl_matrix_complex_swap_columns gsl_matrix_complex_swap_rowcol = __block.gsl_matrix_complex_swap_rowcol gsl_matrix_complex_transpose = __block.gsl_matrix_complex_transpose gsl_matrix_complex_isnull = __block.gsl_matrix_complex_isnull gsl_matrix_complex_diagonal = __block.gsl_matrix_complex_diagonal gsl_matrix_complex_subdiagonal = __block.gsl_matrix_complex_subdiagonal gsl_matrix_complex_superdiagonal = __block.gsl_matrix_complex_superdiagonal gsl_vector_complex_float_set_zero = __block.gsl_vector_complex_float_set_zero gsl_vector_complex_float_set_all = __block.gsl_vector_complex_float_set_all gsl_vector_complex_float_set_basis = __block.gsl_vector_complex_float_set_basis gsl_vector_complex_float_fread = __block.gsl_vector_complex_float_fread gsl_vector_complex_float_fwrite = __block.gsl_vector_complex_float_fwrite gsl_vector_complex_float_fscanf = __block.gsl_vector_complex_float_fscanf gsl_vector_complex_float_fprintf = __block.gsl_vector_complex_float_fprintf gsl_vector_complex_float_reverse = __block.gsl_vector_complex_float_reverse gsl_vector_complex_float_swap = __block.gsl_vector_complex_float_swap gsl_vector_complex_float_swap_elements = __block.gsl_vector_complex_float_swap_elements gsl_vector_complex_float_isnull = __block.gsl_vector_complex_float_isnull gsl_matrix_complex_float_set_zero = __block.gsl_matrix_complex_float_set_zero gsl_matrix_complex_float_set_all = __block.gsl_matrix_complex_float_set_all gsl_matrix_complex_float_set_identity = __block.gsl_matrix_complex_float_set_identity gsl_matrix_complex_float_fread = __block.gsl_matrix_complex_float_fread gsl_matrix_complex_float_fwrite = __block.gsl_matrix_complex_float_fwrite gsl_matrix_complex_float_fscanf = __block.gsl_matrix_complex_float_fscanf gsl_matrix_complex_float_fprintf = __block.gsl_matrix_complex_float_fprintf gsl_matrix_complex_float_swap = __block.gsl_matrix_complex_float_swap gsl_matrix_complex_float_swap_rows = __block.gsl_matrix_complex_float_swap_rows gsl_matrix_complex_float_swap_columns = __block.gsl_matrix_complex_float_swap_columns gsl_matrix_complex_float_swap_rowcol = __block.gsl_matrix_complex_float_swap_rowcol gsl_matrix_complex_float_transpose = __block.gsl_matrix_complex_float_transpose gsl_matrix_complex_float_isnull = __block.gsl_matrix_complex_float_isnull gsl_matrix_complex_float_diagonal = __block.gsl_matrix_complex_float_diagonal gsl_matrix_complex_float_subdiagonal = __block.gsl_matrix_complex_float_subdiagonal gsl_matrix_complex_float_superdiagonal = __block.gsl_matrix_complex_float_superdiagonal # This file is compatible with both classic and new-style classes.
41.161369
90
0.825542
b79b4b3441162b8ce9025428d639fcec36693cf3
42
py
Python
tests/__init__.py
chasefinch/amp-renderer
a226140d8a8a6f8c21c073e394b672cf75c8671e
[ "Apache-2.0" ]
13
2020-08-19T18:37:01.000Z
2021-12-10T17:33:14.000Z
tests/__init__.py
chasefinch/amp-renderer
a226140d8a8a6f8c21c073e394b672cf75c8671e
[ "Apache-2.0" ]
5
2020-08-24T18:31:12.000Z
2022-02-07T17:36:59.000Z
tests/__init__.py
chasefinch/amp-renderer
a226140d8a8a6f8c21c073e394b672cf75c8671e
[ "Apache-2.0" ]
null
null
null
"""Tests for the AMP Renderer project."""
21
41
0.690476
b79c02ce02e6d31db2455c7ba97e981d1dda98d5
3,564
py
Python
sudoku/sudoku.py
Ostap2003/backtracking-team-project
2a6fb2fc80dcdd286c76dbc3b546baf452098d98
[ "MIT" ]
null
null
null
sudoku/sudoku.py
Ostap2003/backtracking-team-project
2a6fb2fc80dcdd286c76dbc3b546baf452098d98
[ "MIT" ]
null
null
null
sudoku/sudoku.py
Ostap2003/backtracking-team-project
2a6fb2fc80dcdd286c76dbc3b546baf452098d98
[ "MIT" ]
null
null
null
from pprint import pprint '''The module has class Grid for solving sudoku. Grid should be given as a list of integers or a path to a file. ''' # grid = [ [3, 0, 6, 5, 0, 8, 4, 0, 0], # [5, 2, 0, 0, 0, 0, 0, 0, 0], # [0, 8, 7, 0, 0, 0, 0, 3, 1], # [0, 0, 3, 0, 1, 0, 0, 8, 0], # [9, 0, 0, 8, 6, 3, 0, 0, 5], # [0, 5, 0, 0, 9, 0, 6, 0, 0], # [1, 3, 0, 0, 0, 0, 2, 5, 0], # [0, 0, 0, 0, 0, 0, 0, 7, 4], # [0, 0, 5, 2, 0, 6, 3, 0, 0] ] sudoku = Grid('grid_2.txt') sudoku.solve_sudoku(0, 0) sudoku.write_to_file()
28.741935
81
0.45679
b79f4a64c362393fd37c99b135489a7797ae3252
1,421
py
Python
device_e2e/sync/test_sync_c2d.py
dt-boringtao/azure-iot-sdk-python
35a09679bdf4d7a727391b265a8f1fbb99a30c45
[ "MIT" ]
null
null
null
device_e2e/sync/test_sync_c2d.py
dt-boringtao/azure-iot-sdk-python
35a09679bdf4d7a727391b265a8f1fbb99a30c45
[ "MIT" ]
null
null
null
device_e2e/sync/test_sync_c2d.py
dt-boringtao/azure-iot-sdk-python
35a09679bdf4d7a727391b265a8f1fbb99a30c45
[ "MIT" ]
null
null
null
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. import pytest import logging import json import threading from utils import get_random_dict logger = logging.getLogger(__name__) logger.setLevel(level=logging.INFO) # TODO: add tests for various application properties # TODO: is there a way to call send_c2d so it arrives as an object rather than a JSON string?
30.891304
93
0.713582
b79f9124d587b0b999491249d4952350ec3b140e
6,588
py
Python
addons/mixer/blender_data/tests/test_bpy_blend_diff.py
trisadmeslek/V-Sekai-Blender-tools
0d8747387c58584b50c69c61ba50a881319114f8
[ "MIT" ]
null
null
null
addons/mixer/blender_data/tests/test_bpy_blend_diff.py
trisadmeslek/V-Sekai-Blender-tools
0d8747387c58584b50c69c61ba50a881319114f8
[ "MIT" ]
null
null
null
addons/mixer/blender_data/tests/test_bpy_blend_diff.py
trisadmeslek/V-Sekai-Blender-tools
0d8747387c58584b50c69c61ba50a881319114f8
[ "MIT" ]
null
null
null
# GPLv3 License # # Copyright (C) 2020 Ubisoft # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <https://www.gnu.org/licenses/>. import unittest from bpy import data as D # noqa from bpy import types as T # noqa from mixer.blender_data.bpy_data_proxy import BpyDataProxy from mixer.blender_data.diff import BpyBlendDiff from mixer.blender_data.filter import test_properties
41.961783
120
0.622495
b7a030be152f3c0e93089efb532b4fde2f3761dd
17,258
py
Python
dependencies/svgwrite/examples/ltattrie/tiling_part_5.py
charlesmchen/typefacet
8c6db26d0c599ece16f3704696811275120a4044
[ "Apache-2.0" ]
21
2015-01-16T05:10:02.000Z
2021-06-11T20:48:15.000Z
dependencies/svgwrite/examples/ltattrie/tiling_part_5.py
charlesmchen/typefacet
8c6db26d0c599ece16f3704696811275120a4044
[ "Apache-2.0" ]
1
2019-09-09T12:10:27.000Z
2020-05-22T10:12:14.000Z
dependencies/svgwrite/examples/ltattrie/tiling_part_5.py
charlesmchen/typefacet
8c6db26d0c599ece16f3704696811275120a4044
[ "Apache-2.0" ]
2
2015-05-03T04:51:08.000Z
2018-08-24T08:28:53.000Z
#!/usr/bin/python # -*- coding: utf-8 -*- import math, sys import svgwrite # # http://www.w3.org/TR/SVG11/struct.html#UseElement # # For more information on tesselation / tiling see http://en.wikipedia.org/wiki/Wallpaper_group # The organization of these tilings are from the interesting book # Designing Testellations: The Secrets of Interlocking Patterns by Jinny Beyer. PROGNAME = sys.argv[0].rstrip('.py') if __name__ == '__main__': create_svg(PROGNAME + '.svg') # vim: expandtab shiftwidth=4 tabstop=8 softtabstop=4 textwidth=99
51.825826
137
0.670877
b7a3ac719d785e13f7265ad9a05f4b664dd99826
3,685
py
Python
MIssions_to_Mars/scrape_mars_mission.py
pwickliff1/web-scraping-challenge
56e2b5e6905c17fce762aeb2ae1ad8cb0f48f8d6
[ "ADSL" ]
null
null
null
MIssions_to_Mars/scrape_mars_mission.py
pwickliff1/web-scraping-challenge
56e2b5e6905c17fce762aeb2ae1ad8cb0f48f8d6
[ "ADSL" ]
null
null
null
MIssions_to_Mars/scrape_mars_mission.py
pwickliff1/web-scraping-challenge
56e2b5e6905c17fce762aeb2ae1ad8cb0f48f8d6
[ "ADSL" ]
null
null
null
# Dependencies from bs4 import BeautifulSoup import requests import re import pandas as pd
35.095238
172
0.686567
b7a7160ec0048a1f0be91a335c4abd54fb69fa8b
10,165
py
Python
guiapp/meditech_nls_parser/old/meditech_nls_to_xml.py
gcampuzano14/PathISTabs
ae29a0b71647ecb32fc40e234b5c7276ab5333d9
[ "MIT" ]
1
2017-07-28T14:01:32.000Z
2017-07-28T14:01:32.000Z
guiapp/meditech_nls_parser/old/meditech_nls_to_xml.py
gcampuzano14/PathISTabs
ae29a0b71647ecb32fc40e234b5c7276ab5333d9
[ "MIT" ]
null
null
null
guiapp/meditech_nls_parser/old/meditech_nls_to_xml.py
gcampuzano14/PathISTabs
ae29a0b71647ecb32fc40e234b5c7276ab5333d9
[ "MIT" ]
1
2019-02-14T06:07:24.000Z
2019-02-14T06:07:24.000Z
#!/usr/bin/env python import os import re import csv # with open(outxml, "r") as out: # t = out.read() # with open(outxml, "w") as out: # u = t.encode('latin1','xmlcharrefreplace').decode('utf8','xmlcharrefreplace') # u = u.decode("utf-8").replace(u"\u2022", "*").u.encode("utf-8") # out.write(u) fil()
50.073892
174
0.52789
b7a7213417448a10f646593e2af28f99d94c2f47
3,144
py
Python
paper_plots/small_vs_large_box.py
finn-dodgson/DeepHalos
86e0ac6c24ac97a0a2a0a60a7ea3721a04bd050c
[ "MIT" ]
null
null
null
paper_plots/small_vs_large_box.py
finn-dodgson/DeepHalos
86e0ac6c24ac97a0a2a0a60a7ea3721a04bd050c
[ "MIT" ]
null
null
null
paper_plots/small_vs_large_box.py
finn-dodgson/DeepHalos
86e0ac6c24ac97a0a2a0a60a7ea3721a04bd050c
[ "MIT" ]
null
null
null
import numpy as np from plots import plots_for_predictions as pp from utilss import distinct_colours as dc import matplotlib.pyplot as plt c = dc.get_distinct(4) path = '/Users/luisals/Documents/deep_halos_files/mass_range_13.4/random_20sims_200k/lr5e-5/' p1 = np.load(path + "seed_20/predicted_sim_6_epoch_09.npy") t1 = np.load(path + "seed_20/true_sim_6_epoch_09.npy") p_big = np.load("/Users/luisals/Projects/DLhalos/bigbox/raw/predicted_sim_L200_N1024_genetIC3_epoch_10.npy") t_big = np.load("/Users/luisals/Projects/DLhalos/bigbox/raw/true_sim_L200_N1024_genetIC3_epoch_10.npy") path_av = "/Users/luisals/Documents/deep_halos_files/mass_range_13.4/random_20sims_200k/averaged_boxes/log_alpha_-4.3/" p_av = np.load(path_av + "predicted_sim_6_epoch_32.npy") t_av = np.load(path_av + "true_sim_6_epoch_32.npy") p_av_big = np.load("/Users/luisals/Projects/DLhalos/bigbox/avg/predicted_sim_L200_N1024_genetIC3_epoch_18.npy") t_av_big = np.load("/Users/luisals/Projects/DLhalos/bigbox/avg/true_sim_L200_N1024_genetIC3_epoch_18.npy") # Raw-density case f1, a, m = pp.plot_histogram_predictions(p1, t1, radius_bins=False, particle_ids=None, errorbars=False, label=r"$L_\mathrm{box}=50 \, \mathrm{Mpc} \,/ \,h$", color="C0") f11, a1, m1 = pp.plot_histogram_predictions(p_big, t_big, radius_bins=False, particle_ids=None, errorbars=False, fig=f1, axes=a, color="C1", label=r"$L_\mathrm{box}=200 \, \mathrm{Mpc} \,/ \,h$") a1[0].set_ylabel(r"$n_{\mathrm{particles}}$", fontsize=16) [a.set_xlabel(r"$\log(M_{\mathrm{predicted}}/M_{\mathrm{true}})$", fontsize=16) for a in a1] plt.savefig("/Users/lls/Documents/Papers/dlhalos_paper/small_vs_large_box.pdf") # Averaged-density case f1, a, m = pp.plot_histogram_predictions(p_av, t_av, radius_bins=False, particle_ids=None, errorbars=False, label=r"$L_\mathrm{box}=50 \, \mathrm{Mpc} \,/ \,h$", color="C0") f11, a1, m1 = pp.plot_histogram_predictions(p_av_big, t_av_big, radius_bins=False, particle_ids=None, errorbars=False, fig=f1, axes=a, color="C1", label=r"$L_\mathrm{box}=200 \, \mathrm{Mpc} \,/ \,h$") a1[0].set_ylabel(r"$n_{\mathrm{particles}}$", fontsize=16) [a.set_xlabel(r"$\log(M_{\mathrm{predicted}}/M_{\mathrm{true}})$", fontsize=16) for a in a1] plt.savefig("/Users/luisals/Documents/Papers/dlhalos_paper/averaged_small_vs_large_box.pdf") # Averaged-density case f1, a, m = pp.plot_histogram_predictions(p_big, t_big, radius_bins=False, particle_ids=None, errorbars=False, label="Raw density", color="C0") f11, a1, m1 = pp.plot_histogram_predictions(p_av_big, t_av_big, radius_bins=False, particle_ids=None, errorbars=False, fig=f1, axes=a, color="C1", label="Averaged density") a1[0].set_ylabel(r"$n_{\mathrm{particles}}$", fontsize=16) [a.set_xlabel(r"$\log(M_{\mathrm{predicted}}/M_{\mathrm{true}})$", fontsize=16) for a in a1] plt.savefig("/Users/luisals/Documents/Papers/dlhalos_paper/raw_vs_averaged_large_box.pdf")
60.461538
126
0.699746
b7a964ee74b74803fefa91500045e19a16c2244a
85,945
py
Python
regions.py
greggy/python-ipgeobase
593e4dc7e55e0c90a1979e586f03c013f6ac057a
[ "BSD-3-Clause" ]
1
2017-11-12T11:26:25.000Z
2017-11-12T11:26:25.000Z
regions.py
greggy/python-ipgeobase
593e4dc7e55e0c90a1979e586f03c013f6ac057a
[ "BSD-3-Clause" ]
null
null
null
regions.py
greggy/python-ipgeobase
593e4dc7e55e0c90a1979e586f03c013f6ac057a
[ "BSD-3-Clause" ]
null
null
null
# -*- coding: utf-8 -*- REGIONS = {'USRI': 'Rhode Island', 'UY02': 'Canelones', 'KR21': 'Ulsan-gwangyoksi', 'KR20': 'Kyongsang-namdo', 'KM02': 'Grande Comore', 'KM03': 'Moheli', 'CO22': 'Putumayo', 'BN18': 'Zou', 'BN17': 'Plateau', 'BN16': 'Oueme', 'BN15': 'Tutong', 'BN14': 'Littoral', 'BN13': 'Donga', 'BN12': 'Kouffo', 'BN11': 'Collines', 'BN10': 'Temburong', 'KP09': 'Kangwon-do', 'KP08': 'Kaesong-si', 'KP07': 'Hwanghae-bukto', 'KP06': 'Hwanghae-namdo', 'KP01': 'Chagang-do', 'KP03': 'Hamgyong-namdo', 'IS40': 'Norourland Eystra', 'CO28': 'Tolima', 'TH77': 'Amnat Charoen', 'CO29': 'Valle del Cauca', 'TH76': 'Udon Thani', 'IS44': 'Vestfiroir', 'IS45': 'Vesturland', 'MK80': 'Plasnica', 'MK81': 'Podares', 'MK82': 'Prilep', 'MK83': 'Probistip', 'MK84': 'Radovis', 'MK85': 'Rankovce', 'MK86': 'Resen', 'MK87': 'Rosoman', 'MK88': 'Rostusa', 'MK89': 'Samokov', 'NG23': 'Kaduna', 'NG22': 'Cross River', 'SZ05': 'Praslin', 'SZ04': 'Shiselweni', 'SZ03': 'Manzini', 'SZ02': 'Lubombo', 'SZ01': 'Hhohho', 'NG26': 'Benue', 'BG41': 'Gabrovo', 'BG40': 'Dobrich', 'BG43': 'Khaskovo', 'BG42': 'Grad Sofiya', 'BG45': 'Kyustendil', 'BG44': 'Kurdzhali', 'BG47': 'Montana', 'BG46': 'Lovech', 'BG49': 'Pernik', 'BG48': 'Pazardzhik', 'NG24': 'Katsina', 'DO19': 'Salcedo', 'KH18': 'Svay Rieng', 'KH19': 'Takeo', 'KH12': 'Pursat', 'KH13': 'Preah Vihear', 'KH10': 'Mondulkiri', 'KH11': 'Phnum Penh', 'KH16': 'Siem Reap', 'KH17': 'Stung Treng', 'KH14': 'Prey Veng', 'KH15': 'Ratanakiri Kiri', 'GN15': 'Kerouane', 'GN16': 'Kindia', 'GN17': 'Kissidougou', 'GN10': 'Forecariah', 'GN11': 'Fria', 'GN12': 'Gaoual', 'GN13': 'Gueckedou', 'GN18': 'Koundara', 'GN19': 'Kouroussa', 'GBR1': 'Ballymoney', 'GBR3': 'Belfast', 'GBR2': 'Banbridge', 'GBR5': 'Castlereagh', 'GBR4': 'Carrickfergus', 'GBR7': 'Cookstown', 'GBR6': 'Coleraine', 'GBR9': 'Down', 'GBR8': 'Craigavon', 'CZ87': 'Plzensky kraj', 'CZ86': 'Pardubicky kraj', 'CZ85': 'Moravskoslezsky kraj', 'CZ84': 'Olomoucky kraj', 'CZ83': 'Liberecky kraj', 'CZ82': 'Kralovehradecky kraj', 'CZ81': 'Karlovarsky kraj', 'CZ80': 'Vysocina', 'CZ89': 'Ustecky kraj', 'CZ88': 'Stredocesky kraj', 'MD87': 'Soroca', 'MD86': 'Soldanesti', 'MD85': 'Singerei', 'MD84': 'Riscani', 'MD83': 'Rezina', 'MD81': 'Ocnita', 'MD80': 'Nisporeni', 'VN55': 'Binh Thuan', 'MD89': 'Straseni', 'MD88': 'Stefan-Voda', 'CN09': 'Henan', 'CN08': 'Heilongjiang', 'CN03': 'Jiangxi', 'CN02': 'Zhejiang', 'CN01': 'Anhui', 'CN07': 'Fujian', 'CN06': 'Qinghai', 'CN05': 'Jilin', 'CN04': 'Jiangsu', 'DE04': 'Hamburg', 'VN50': 'Vinh Phu', 'PE09': 'Huancavelica', 'PE08': 'Cusco', 'PE01': 'Amazonas', 'PE03': 'Apurimac', 'PE02': 'Ancash', 'PE05': 'Ayacucho', 'PE04': 'Arequipa', 'PE07': 'Callao', 'PE06': 'Cajamarca', 'AE02': 'Ajman', 'DE08': 'Rheinland-Pfalz', 'AE01': 'Abu Dhabi', 'AE06': 'Sharjah', 'AE07': 'Umm Al Quwain', 'GY19': 'Upper Takutu-Upper Essequibo', 'GY18': 'Upper Demerara-Berbice', 'AE04': 'Fujairah', 'AF08': 'Ghazni', 'GY13': 'East Berbice-Corentyne', 'GY12': 'Demerara-Mahaica', 'GY11': 'Cuyuni-Mazaruni', 'GY10': 'Barima-Waini', 'GY17': 'Potaro-Siparuni', 'GY16': 'Pomeroon-Supenaam', 'GY15': 'Mahaica-Berbice', 'GY14': 'Essequibo Islands-West Demerara', 'BI10': 'Bururi', 'BI11': 'Cankuzo', 'BI12': 'Cibitoke', 'BI13': 'Gitega', 'BI14': 'Karuzi', 'BI15': 'Kayanza', 'BI16': 'Kirundo', 'BI17': 'Makamba', 'BI18': 'Muyinga', 'BI19': 'Ngozi', 'IE02': 'Cavan', 'USSC': 'South Carolina', 'AF02': 'Badghis', 'USSD': 'South Dakota', 'IE06': 'Donegal', 'IE04': 'Cork', 'MK93': 'Sopotnica', 'MK92': 'Sopiste', 'MK91': 'Sipkovica', 'MK90': 'Saraj', 'MK97': 'Staro Nagoricane', 'MK96': 'Star Dojran', 'MK95': 'Staravina', 'MK94': 'Srbinovo', 'MK99': 'Struga', 'MK98': 'Stip', 'CD01': 'Bandundu', 'KG01': 'Bishkek', 'CD05': 'Katanga', 'CD04': 'Kasai-Oriental', 'CD06': 'Kinshasa', 'SD32': 'Bahr al Ghazal', 'LB02': 'Al Janub', 'LB03': 'Liban-Nord', 'LB01': 'Beqaa', 'LB06': 'Liban-Sud', 'LB07': 'Nabatiye', 'LB04': 'Beyrouth', 'LB05': 'Mont-Liban', 'LB08': 'Beqaa', 'LB09': 'Liban-Nord', 'KH05': 'Kampong Thum', 'KH04': 'Kampong Speu', 'KH07': 'Kandal', 'KH06': 'Kampot', 'KH01': 'Batdambang', 'KH03': 'Kampong Chhnang', 'KH02': 'Kampong Cham', 'KH09': 'Kracheh', 'KH08': 'Koh Kong', 'PT02': 'Aveiro', 'PT03': 'Beja', 'PT04': 'Braga', 'PT05': 'Braganca', 'PT06': 'Castelo Branco', 'PT07': 'Coimbra', 'PT08': 'Evora', 'PT09': 'Faro', 'GN07': 'Dinguiraye', 'GN06': 'Dalaba', 'GN05': 'Dabola', 'GN04': 'Conakry', 'GN03': 'Boke', 'GN02': 'Boffa', 'GN01': 'Beyla', 'GN09': 'Faranah', 'SI17': 'Crnomelj', 'SI16': 'Crna na Koroskem', 'SK06': 'Trencin', 'SK07': 'Trnava', 'SK04': 'Nitra', 'SK05': 'Presov', 'SK02': 'Bratislava', 'SK03': 'Kosice', 'SK01': 'Banska Bystrica', 'SK08': 'Zilina', 'GBW5': 'South Lanarkshire', 'MX27': 'Tabasco', 'CN32': 'Sichuan', 'CN33': 'Chongqing', 'CN30': 'Guangdong', 'CN31': 'Hainan', 'BH17': 'Al Janubiyah', 'VE18': 'Portuguesa', 'VE19': 'Sucre', 'VE11': 'Falcon', 'VE12': 'Guarico', 'VE13': 'Lara', 'VE14': 'Merida', 'VE15': 'Miranda', 'VE16': 'Monagas', 'VE17': 'Nueva Esparta', 'BH16': 'Al Asimah', 'NE07': 'Zinder', 'MX10': 'Durango', 'MX11': 'Guanajuato', 'MX12': 'Guerrero', 'MX13': 'Hidalgo', 'MX14': 'Jalisco', 'MX15': 'Mexico', 'MX16': 'Michoacan de Ocampo', 'MX17': 'Morelos', 'MX18': 'Nayarit', 'MX19': 'Nuevo Leon', 'DZ55': 'Tipaza', 'BI02': 'Bujumbura', 'BI09': 'Bubanza', 'CV10': 'Sao Nicolau', 'CV11': 'Sao Vicente', 'CV13': 'Mosteiros', 'CV14': 'Praia', 'CV15': 'Santa Catarina', 'CV16': 'Santa Cruz', 'CV17': 'Sao Domingos', 'CV18': 'Sao Filipe', 'CV19': 'Sao Miguel', 'PHB8': 'Cotabato', 'PHB9': 'Dagupan', 'PHB3': 'Calbayog', 'ER01': 'Anseba', 'ER03': "Debubawi K'eyih Bahri", 'ER02': 'Debub', 'ER05': "Ma'akel", 'ER04': 'Gash Barka', 'ER06': "Semenawi K'eyih Bahri", 'NE08': 'Niamey', 'TH80': 'Sa Kaeo', 'PHB5': 'Canlaon', 'TD08': 'Logone Occidental', 'TD09': 'Logone Oriental', 'TD04': 'Chari-Baguirmi', 'TD05': 'Guera', 'TD06': 'Kanem', 'TD07': 'Lac', 'TD01': 'Batha', 'TD02': 'Biltine', 'TD03': 'Borkou-Ennedi-Tibesti', 'LB11': 'Baalbek-Hermel', 'LB10': 'Aakk', 'PT13': 'Leiria', 'PT11': 'Guarda', 'PT10': 'Madeira', 'PT17': 'Porto', 'PT16': 'Portalegre', 'PT14': 'Lisboa', 'PT19': 'Setubal', 'PT18': 'Santarem', 'GN32': 'Kankan', 'GN33': 'Koubia', 'GN30': 'Coyah', 'GN31': 'Dubreka', 'GN36': 'Lola', 'GN37': 'Mandiana', 'GN34': 'Labe', 'GN35': 'Lelouma', 'GN38': 'Nzerekore', 'GN39': 'Siguiri', 'MW22': 'Salima', 'ES56': 'Catalonia', 'ES55': 'Castilla y Leon', 'JM14': 'Saint Thomas', 'ES54': 'Castilla-La Mancha', 'JP47': 'Okinawa', 'MW26': 'Balaka', 'JM16': 'Westmoreland', 'ES52': 'Aragon', 'CN21': 'Ningxia', 'CN20': 'Nei Mongol', 'CN23': 'Shanghai', 'CN22': 'Beijing', 'CN25': 'Shandong', 'CN24': 'Shanxi', 'CN26': 'Shaanxi', 'CN29': 'Yunnan', 'CN28': 'Tianjin', 'JM11': 'Saint Elizabeth', 'LT59': 'Marijampoles Apskritis', 'LT58': 'Klaipedos Apskritis', 'JM12': 'Saint James', 'VE03': 'Apure', 'VE02': 'Anzoategui', 'VE01': 'Amazonas', 'JP41': 'Tottori', 'LT57': 'Kauno Apskritis', 'LT56': 'Alytaus Apskritis', 'VE05': 'Barinas', 'VE04': 'Aragua', 'FRB2': 'Lorraine', 'FRB1': 'Limousin', 'VN54': 'Binh Dinh', 'FRB6': 'Picardie', 'FRB7': 'Poitou-Charentes', 'EC08': 'El Oro', 'EC09': 'Esmeraldas', 'FRB4': 'Nord-Pas-de-Calais', 'EC01': 'Galapagos', 'EC02': 'Azuay', 'EC03': 'Bolivar', 'EC04': 'Canar', 'EC05': 'Carchi', 'EC06': 'Chimborazo', 'EC07': 'Cotopaxi', 'MX03': 'Baja California Sur', 'MX02': 'Baja California', 'MX01': 'Aguascalientes', 'MX07': 'Coahuila de Zaragoza', 'MX06': 'Chihuahua', 'MX05': 'Chiapas', 'MX04': 'Campeche', 'CAPE': 'Prince Edward Island', 'MX09': 'Distrito Federal', 'MX08': 'Colima', 'SI66': 'Loski Potok', 'SI64': 'Logatec', 'ZM07': 'Southern', 'ZM06': 'North-Western', 'SI62': 'Ljubno', 'ZM05': 'Northern', 'PA06': 'Herrera', 'PA01': 'Bocas del Toro', 'UG90': 'Mukono', 'CV02': 'Brava', 'CV01': 'Boa Vista', 'KY08': 'Western', 'ZM01': 'Western', 'CV05': 'Paul', 'CV04': 'Maio', 'KY04': 'South Town', 'KY05': 'Spot Bay', 'KY06': 'Stake Bay', 'CV08': 'Sal', 'KY01': 'Creek', 'KY02': 'Eastern', 'KY03': 'Midland', 'US44': 'Rhode Island', 'MZ03': 'Inhambane', 'US47': 'Tennessee', 'US40': 'Oklahoma', 'US41': 'Oregon', 'US42': 'Pennsylvania', 'IQ08': 'Dahuk', 'IQ09': 'Dhi Qar', 'IQ06': 'Babil', 'IQ07': 'Baghdad', 'IQ04': 'Al Qadisiyah', 'IQ05': 'As Sulaymaniyah', 'IQ02': 'Al Basrah', 'LA14': 'Xiangkhoang', 'IQ01': 'Al Anbar', 'TD14': 'Tandjile', 'TD13': 'Salamat', 'TD12': 'Ouaddai', 'TD11': 'Moyen-Chari', 'TD10': 'Mayo-Kebbi', 'GT22': 'Zacapa', 'GT21': 'Totonicapan', 'GT20': 'Suchitepequez', 'GBA8': 'Blackburn with Darwen', 'GBA9': 'Blackpool', 'PT22': 'Viseu', 'PT23': 'Azores', 'PT20': 'Viana do Castelo', 'PT21': 'Vila Real', 'GN29': 'Yomou', 'GN28': 'Tougue', 'EE10': 'Parnu', 'GN25': 'Pita', 'GN27': 'Telimele', 'GN21': 'Macenta', 'GBA2': 'Barnet', 'GN23': 'Mamou', 'GN22': 'Mali', 'GR47': 'Dhodhekanisos', 'GBA3': 'Barnsley', 'GR46': 'Lasithi', 'GBA4': 'Bath and North East Somerset', 'GBA5': 'Bedfordshire', 'GR44': 'Rethimni', 'GBA6': 'Bexley', 'GBA7': 'Birmingham', 'AD08': 'Escaldes-Engordany', 'AD03': 'Encamp', 'AD02': 'Canillo', 'AD07': 'Andorra la Vella', 'AD06': 'Sant Julia de Loria', 'AD05': 'Ordino', 'AD04': 'La Massana', 'CG08': 'Plateaux', 'LY57': 'Gharyan', 'CG01': 'Bouenza', 'CG06': 'Likouala', 'CG07': 'Niari', 'CG04': 'Kouilou', 'CG05': 'Lekoumou', 'VN44': 'Dac Lac', 'VN45': 'Dong Nai', 'LT64': 'Utenos Apskritis', 'LT65': 'Vilniaus Apskritis', 'LT62': 'Taurages Apskritis', 'LT63': 'Telsiu Apskritis', 'LT60': 'Panevezio Apskritis', 'LT61': 'Siauliu Apskritis', 'VN49': 'Song Be', 'JP28': 'Nara', 'JP29': 'Niigata', 'JP24': 'Miyagi', 'JP25': 'Miyazaki', 'JP26': 'Nagano', 'JP27': 'Nagasaki', 'JP20': 'Kochi', 'JP21': 'Kumamoto', 'JP22': 'Kyoto', 'JP23': 'Mie', 'EC19': 'Tungurahua', 'EC18': 'Pichincha', 'EC13': 'Los Rios', 'EC12': 'Loja', 'EC11': 'Imbabura', 'EC10': 'Guayas', 'EC17': 'Pastaza', 'EC15': 'Morona-Santiago', 'EC14': 'Manabi', 'SI04': 'Bohinj', 'SI05': 'Borovnica', 'SI06': 'Bovec', 'SI07': 'Brda', 'SI01': 'Ajdovscina', 'SI02': 'Beltinci', 'SI03': 'Bled', 'MX32': 'Zacatecas', 'SI09': 'Brezovica', 'MX30': 'Veracruz-Llave', 'MX31': 'Yucatan', 'DO18': 'Puerto Plata', 'PHA9': 'Cabanatuan', 'PHA8': 'Butuan', 'PHA7': 'Batangas City', 'PHA6': 'Basilan City', 'PHA5': 'Bais', 'PHA4': 'Baguio', 'PHA3': 'Bago', 'PHA2': 'Bacolod', 'PHA1': 'Angeles', 'JP42': 'Toyama', 'BI21': 'Ruyigi', 'BI20': 'Rutana', 'BI23': 'Mwaro', 'BI22': 'Muramvya', 'PA10': 'Veraguas', 'MZ10': 'Manica', 'MZ11': 'Maputo', 'IQ18': 'Salah ad Din', 'PH29': 'Ilocos Sur', 'IQ11': 'Arbil', 'IQ10': 'Diyala', 'IQ13': "At Ta'mim", 'IQ12': "Karbala'", 'IQ15': 'Ninawa', 'IQ14': 'Maysan', 'IQ17': 'An Najaf', 'IQ16': 'Wasit', 'TJ02': 'Khatlon', 'TJ03': 'Sughd', 'TJ01': 'Kuhistoni Badakhshon', 'GT12': 'Peten', 'GT13': 'Quetzaltenango', 'GT10': 'Jalapa', 'GT11': 'Jutiapa', 'GT16': 'Sacatepequez', 'GT17': 'San Marcos', 'GT14': 'Quiche', 'GT15': 'Retalhuleu', 'GT18': 'Santa Rosa', 'GT19': 'Solola', 'PSWE': 'West Bank', 'PY23': 'Alto Paraguay', 'PY21': 'Nueva Asuncion', 'PY20': 'Chaco', 'QA06': 'Ar Rayyan', 'QA04': 'Al Khawr', 'QA05': 'Al Wakrah Municipality', 'QA02': 'Al Ghuwariyah', 'QA03': 'Al Jumaliyah', 'QA01': 'Ad Dawhah', 'QA08': 'Madinat ach Shamal', 'QA09': 'Umm Salal', 'GBU5': 'East Dunbartonshire', 'UY03': 'Cerro Largo', 'UY01': 'Artigas', 'UY06': 'Flores', 'UY07': 'Florida', 'UY04': 'Colonia', 'UY05': 'Durazno', 'UY08': 'Lavalleja', 'UY09': 'Maldonado', 'CH10': 'Inner-Rhoden', 'GBU6': 'East Lothian', 'CH11': 'Luzern', 'CG14': 'Cuvette-Ouest', 'CG11': 'Pool', 'CG10': 'Sangha', 'CG13': 'Cuvette', 'CG12': 'Brazzaville', 'UA24': "Volyns'ka Oblast'", 'UA25': "Zakarpats'ka Oblast'", 'UA26': "Zaporiz'ka Oblast'", 'UA27': "Zhytomyrs'ka Oblast'", 'UA20': "Sevastopol'", 'UA21': "Sums'ka Oblast'", 'UA22': "Ternopil's'ka Oblast'", 'UA23': "Vinnyts'ka Oblast'", 'IT20': 'Veneto', 'US11': 'District of Columbia', 'VE21': 'Trujillo', 'VE20': 'Tachira', 'VE23': 'Zulia', 'VE22': 'Yaracuy', 'VE25': 'Distrito Federal', 'VN52': 'Ho Chi Minh', 'VN51': 'Ha Noi', 'VE26': 'Vargas', 'VN59': 'Ha Tay', 'VN58': 'Ha Giang', 'LY62': 'Yafran', 'JP39': 'Tokushima', 'JP38': 'Tochigi', 'JP37': 'Shizuoka', 'JP36': 'Shimane', 'JP35': 'Shiga', 'JP34': 'Saitama', 'JP33': 'Saga', 'JP32': 'Osaka', 'JP31': 'Okayama', 'JP30': 'Oita', 'MX29': 'Tlaxcala', 'MX28': 'Tamaulipas', 'SI15': 'Crensovci', 'SI14': 'Cerkno', 'SI13': 'Cerknica', 'SI12': 'Cerklje na Gorenjskem', 'SI11': 'Celje', 'MX21': 'Puebla', 'MX20': 'Oaxaca', 'MX23': 'Quintana Roo', 'MX22': 'Queretaro de Arteaga', 'MX25': 'Sinaloa', 'MX24': 'San Luis Potosi', 'SI19': 'Divaca', 'MX26': 'Sonora', 'LY60': 'Surt', 'MD61': 'Basarabeasca', 'MD60': 'Balti', 'MD63': 'Briceni', 'KN10': 'Saint Paul Charlestown', 'KN11': 'Saint Peter Basseterre', 'KN12': 'Saint Thomas Lowland', 'MD62': 'Bender', 'KN15': 'Trinity Palmetto Point', 'PHB2': 'Cagayan de Oro', 'MD65': 'Cantemir', 'PHB1': 'Cadiz', 'PHB6': 'Cavite City', 'PHB7': 'Cebu City', 'PHB4': 'Caloocan', 'MD64': 'Cahul', 'CI75': 'Bafing', 'CI74': 'Agneby', 'CI77': 'Denguele', 'CI76': 'Bas-Sassandra', 'CI79': 'Fromager', 'CI78': 'Dix-Huit Montagnes', 'FRB5': 'Pays de la Loire', 'EC24': 'Orellana', 'EC22': 'Sucumbios', 'EC23': 'Napo', 'EC20': 'Zamora-Chinchipe', 'CV20': 'Tarrafal', 'KW02': 'Al Kuwayt', 'KW01': 'Al Ahmadi', 'KW07': 'Al Farwaniyah', 'KW05': 'Al Jahra', 'CH19': 'Thurgau', 'KW08': 'Hawalli', 'KW09': 'Mubarak al Kabir', 'PA09': 'San Blas', 'PA08': 'Panama', 'ZM09': 'Lusaka', 'ZM08': 'Copperbelt', 'PA05': 'Darien', 'PA04': 'Colon', 'PA07': 'Los Santos', 'ZM04': 'Luapula', 'ZM03': 'Eastern', 'ZM02': 'Central', 'PA03': 'Cocle', 'PA02': 'Chiriqui', 'MZ01': 'Cabo Delgado', 'US45': 'South Carolina', 'US46': 'South Dakota', 'MZ02': 'Gaza', 'MZ05': 'Sofala', 'MZ04': 'Maputo', 'MZ07': 'Niassa', 'MZ06': 'Nampula', 'MZ09': 'Zambezia', 'MZ08': 'Tete', 'US48': 'Texas', 'US49': 'Utah', 'GD05': 'Saint Mark', 'GD04': 'Saint John', 'GD06': 'Saint Patrick', 'GD01': 'Saint Andrew', 'GD03': 'Saint George', 'GD02': 'Saint David', 'IS09': 'Eyjafjardarsysla', 'IS05': 'Austur-Hunavatnssysla', 'IS06': 'Austur-Skaftafellssysla', 'IS07': 'Borgarfjardarsysla', 'IS03': 'Arnessysla', 'AU02': 'New South Wales', 'AU03': 'Northern Territory', 'AU01': 'Australian Capital Territory', 'AU06': 'Tasmania', 'AU07': 'Victoria', 'AU04': 'Queensland', 'AU05': 'South Australia', 'AU08': 'Western Australia', 'BO09': 'Tarija', 'BM10': 'Southampton', 'BM11': 'Warwick', 'GT09': 'Izabal', 'GT08': 'Huehuetenango', 'GT05': 'El Progreso', 'GT04': 'Chiquimula', 'GT07': 'Guatemala', 'GT06': 'Escuintla', 'GT01': 'Alta Verapaz', 'GT03': 'Chimaltenango', 'GT02': 'Baja Verapaz', 'PY19': 'Canindeyu', 'PY12': 'Misiones', 'PY13': 'Neembucu', 'PY10': 'Guaira', 'PY11': 'Itapua', 'PY16': 'Presidente Hayes', 'PY17': 'San Pedro', 'PY15': 'Paraguari', 'QA11': 'Jariyan al Batnah', 'QA10': 'Al Wakrah', 'QA12': "Umm Sa'id", 'AF41': 'Daykondi', 'AF40': 'Parvan', 'AF42': 'Panjshir', 'GBY1': 'Flintshire', 'GBY2': 'Gwynedd', 'GBY3': 'Merthyr Tydfil', 'GBY4': 'Monmouthshire', 'GBY5': 'Neath Port Talbot', 'GBY6': 'Newport', 'GBY7': 'Pembrokeshire', 'GBY8': 'Powys', 'GBY9': 'Rhondda Cynon Taff', 'UY19': 'Treinta y Tres', 'UY18': 'Tacuarembo', 'UY15': 'Salto', 'UY14': 'Rocha', 'UY17': 'Soriano', 'UY16': 'San Jose', 'UY11': 'Paysandu', 'UY10': 'Montevideo', 'UY13': 'Rivera', 'UY12': 'Rio Negro', 'CL16': 'Arica y Parinacota', 'CL17': 'Los Rios', 'CL14': 'Los Lagos', 'CL15': 'Tarapaca', 'SN14': 'Saint-Louis', 'SN15': 'Matam', 'CL10': 'Magallanes y de la Antartica Chilena', 'CL11': 'Maule', 'BZ01': 'Belize', 'BZ02': 'Cayo', 'BZ03': 'Corozal', 'BZ04': 'Orange Walk', 'BZ05': 'Stann Creek', 'BZ06': 'Toledo', 'CASK': 'Saskatchewan', 'RU87': 'Yamal-Nenets', 'RU86': 'Voronezh', 'RU85': 'Vologda', 'RU84': 'Volgograd', 'RU83': 'Vladimir', 'VN67': 'Ninh Binh', 'VN64': 'Quang Tri', 'VN65': 'Nam Ha', 'VN68': 'Ninh Thuan', 'VN69': 'Phu Yen', 'RU89': 'Yevrey', 'RU88': "Yaroslavl'", 'JP08': 'Fukushima', 'JP09': 'Gifu', 'JP02': 'Akita', 'JP03': 'Aomori', 'JP01': 'Aichi', 'JP06': 'Fukui', 'JP07': 'Fukuoka', 'JP04': 'Chiba', 'JP05': 'Ehime', 'SI22': 'Dol pri Ljubljani', 'SI20': 'Dobrepolje', 'SI26': 'Duplek', 'SI27': 'Gorenja Vas-Poljane', 'SI24': 'Dornava', 'SI25': 'Dravograd', 'SI28': 'Gorisnica', 'SI29': 'Gornja Radgona', 'GBE4': 'Essex', 'GBE5': 'Gateshead', 'GBE6': 'Gloucestershire', 'GBE7': 'Greenwich', 'GBE1': 'East Riding of Yorkshire', 'GBE2': 'East Sussex', 'GBE3': 'Enfield', 'GBE8': 'Hackney', 'GBE9': 'Halton', 'KN03': 'Saint George Basseterre', 'KN02': 'Saint Anne Sandy Point', 'KN01': 'Christ Church Nichola Town', 'KN07': 'Saint John Figtree', 'KN06': 'Saint John Capisterre', 'KN05': 'Saint James Windward', 'KN04': 'Saint George Gingerland', 'KN09': 'Saint Paul Capisterre', 'KN08': 'Saint Mary Cayon', 'CI88': 'Sud-Bandama', 'CI89': 'Sud-Comoe', 'CI84': 'Moyen-Cavally', 'CI85': 'Moyen-Comoe', 'CI86': "N'zi-Comoe", 'CI87': 'Savanes', 'CI80': 'Haut-Sassandra', 'CI81': 'Lacs', 'CI82': 'Lagunes', 'CI83': 'Marahoue', 'NG16': 'Ogun', 'AZ18': 'Fuzuli', 'AZ19': 'Gadabay', 'NG11': 'Federal Capital Territory', 'US56': 'Wyoming', 'US55': 'Wisconsin', 'US54': 'West Virginia', 'US53': 'Washington', 'US51': 'Virginia', 'US50': 'Vermont', 'PHC5': 'Dumaguete', 'PHC4': 'Dipolog', 'PHC7': 'Gingoog', 'PHC6': 'General Santos', 'PHC1': 'Danao', 'PHC3': 'Davao City', 'PHC2': 'Dapitan', 'CO38': 'Magdalena', 'PHC9': 'Iloilo City', 'SN12': 'Ziguinchor', 'SN13': 'Louga', 'TH48': 'Chanthaburi', 'TH49': 'Trat', 'TH44': 'Chachoengsao', 'TH45': 'Prachin Buri', 'IS15': 'Kjosarsysla', 'TH47': 'Rayong', 'TH40': 'Krung Thep', 'TH41': 'Phayao', 'TH42': 'Samut Prakan', 'IS10': 'Gullbringusysla', 'BM07': "Saint George's", 'BM06': 'Saint George', 'BM05': 'Pembroke', 'BM04': 'Paget', 'BM03': 'Hamilton', 'BM02': 'Hamilton', 'BM01': 'Devonshire', 'BM09': 'Smiths', 'BM08': 'Sandys', 'SIK5': 'Preddvor', 'USDC': 'District of Columbia', 'PY05': 'Caazapa', 'PY04': 'Caaguazu', 'PY07': 'Concepcion', 'PY06': 'Central', 'PY01': 'Alto Parana', 'PY03': 'Boqueron', 'PY02': 'Amambay', 'PY08': 'Cordillera', 'AF30': 'Balkh', 'AF31': 'Jowzjan', 'AF32': 'Samangan', 'AF33': 'Sar-e Pol', 'AF34': 'Konar', 'AF35': 'Laghman', 'AF36': 'Paktia', 'AF37': 'Khowst', 'AF38': 'Nurestan', 'AF39': 'Oruzgan', 'GBX3': 'Bridgend', 'GBX2': 'Blaenau Gwent', 'GBX1': 'Isle of Anglesey', 'ML10': 'Kidal', 'GBX6': 'Ceredigion', 'GBX5': 'Cardiff', 'GBX4': 'Caerphilly', 'GBX9': 'Denbighshire', 'GBX8': 'Conwy', 'AM08': "Syunik'", 'AM09': 'Tavush', 'AM02': 'Ararat', 'AM03': 'Armavir', 'AM01': 'Aragatsotn', 'AM06': 'Lorri', 'AM07': 'Shirak', 'AM04': "Geghark'unik'", 'AM05': "Kotayk'", 'CL09': 'Los Lagos', 'CL08': "Libertador General Bernardo O'Higgins", 'SN09': 'Fatick', 'SN03': 'Diourbel', 'SN01': 'Dakar', 'CL02': 'Aisen del General Carlos Ibanez del Campo', 'SN07': 'Thies', 'CL04': 'Araucania', 'SN05': 'Tambacounda', 'CL06': 'Bio-Bio', 'SN10': 'Kaolack', 'UA08': "Khersons'ka Oblast'", 'UA09': "Khmel'nyts'ka Oblast'", 'USMN': 'Minnesota', 'UA02': "Chernihivs'ka Oblast'", 'UA03': "Chernivets'ka Oblast'", 'UA01': "Cherkas'ka Oblast'", 'UA06': "Ivano-Frankivs'ka Oblast'", 'UA07': "Kharkivs'ka Oblast'", 'UA04': "Dnipropetrovs'ka Oblast'", 'UA05': "Donets'ka Oblast'", 'SN11': 'Kolda', 'VN62': 'Khanh Hoa', 'VN79': 'Hai Duong', 'VN78': 'Da Nang', 'VN63': 'Kon Tum', 'VN75': 'Tra Vinh', 'VN74': 'Thua Thien', 'VN77': 'Vinh Long', 'VN76': 'Tuyen Quang', 'VN71': 'Quang Ngai', 'VN60': 'Ha Tinh', 'VN73': 'Soc Trang', 'VN72': 'Quang Tri', 'VN61': 'Hoa Binh', 'VN66': 'Nghe An', 'RU82': 'Ust-Orda Buryat', 'JP15': 'Ishikawa', 'JP14': 'Ibaraki', 'JP17': 'Kagawa', 'JP16': 'Iwate', 'JP11': 'Hiroshima', 'RU81': "Ul'yanovsk", 'JP13': 'Hyogo', 'JP12': 'Hokkaido', 'IL03': 'HaZafon', 'IL02': 'HaMerkaz', 'IL01': 'HaDarom', 'RU80': 'Udmurt', 'JP19': 'Kanagawa', 'JP18': 'Kagoshima', 'IL05': 'Tel Aviv', 'IL04': 'Hefa', 'SI39': 'Ivancna Gorica', 'SI38': 'Ilirska Bistrica', 'SI35': 'Hrpelje-Kozina', 'SI34': 'Hrastnik', 'SI37': 'Ig', 'SI36': 'Idrija', 'SI31': 'Gornji Petrovci', 'SI30': 'Gornji Grad', 'SI32': 'Grosuplje', 'EE20': 'Viljandimaa', 'GBD6': 'Dorset', 'GBD5': 'Doncaster', 'GBD4': 'Devon', 'GBD3': 'Derbyshire', 'GBD2': 'Derby', 'GBD1': 'Darlington', 'GBD9': 'Ealing', 'GBD8': 'Durham', 'BR01': 'Acre', 'BR02': 'Alagoas', 'BR03': 'Amapa', 'BR04': 'Amazonas', 'BR05': 'Bahia', 'BR06': 'Ceara', 'BR07': 'Distrito Federal', 'BR08': 'Espirito Santo', 'CI92': 'Zanzan', 'CI91': 'Worodougou', 'CI90': 'Vallee du Bandama', 'PK03': 'North-West Frontier', 'PK02': 'Balochistan', 'IT10': 'Marche', 'IT11': 'Molise', 'IT12': 'Piemonte', 'IT13': 'Puglia', 'IT14': 'Sardegna', 'IT15': 'Sicilia', 'IT16': 'Toscana', 'IT17': 'Trentino-Alto Adige', 'IT18': 'Umbria', 'IT19': "Valle d'Aosta", 'PHD1': 'Iriga', 'PHD2': 'La Carlota', 'PHD3': 'Laoag', 'PHD4': 'Lapu-Lapu', 'PHD5': 'Legaspi', 'PHD6': 'Lipa', 'PHD7': 'Lucena', 'PHD8': 'Mandaue', 'PHD9': 'Manila', 'PK08': 'Islamabad', 'BB01': 'Christ Church', 'IS28': 'Skagafjardarsysla', 'IS29': 'Snafellsnes- og Hnappadalssysla', 'BB04': 'Saint James', 'BB05': 'Saint John', 'TH59': 'Ranong', 'TH58': 'Chumphon', 'TH57': 'Prachuap Khiri Khan', 'IS23': 'Rangarvallasysla', 'TH55': 'Samut Sakhon', 'TH54': 'Samut Songkhram', 'TH53': 'Nakhon Pathom', 'TH52': 'Ratchaburi', 'TH51': 'Suphan Buri', 'TH50': 'Kanchanaburi', 'BT20': 'Thimphu', 'BT21': 'Tongsa', 'BT22': 'Wangdi Phodrang', 'CR07': 'Puntarenas', 'CR06': 'Limon', 'CR04': 'Heredia', 'CR03': 'Guanacaste', 'CR02': 'Cartago', 'CR01': 'Alajuela', 'CR08': 'San Jose', 'HN02': 'Choluteca', 'HN03': 'Colon', 'HN01': 'Atlantida', 'HN06': 'Cortes', 'HN07': 'El Paraiso', 'HN04': 'Comayagua', 'HN05': 'Copan', 'HN08': 'Francisco Morazan', 'HN09': 'Gracias a Dios', 'GL01': 'Nordgronland', 'GL03': 'Vestgronland', 'GL02': 'Ostgronland', 'ET50': 'Hareri Hizb', 'ET51': 'Oromiya', 'ET52': 'Sumale', 'ET53': 'Tigray', 'ET54': 'YeDebub Biheroch Bihereseboch na Hizboch', 'AF23': 'Kandahar', 'AF27': 'Vardak', 'IE29': 'Westmeath', 'AF24': 'Kondoz', 'IE24': 'Roscommon', 'IE25': 'Sligo', 'IE26': 'Tipperary', 'IE27': 'Waterford', 'IE20': 'Mayo', 'IE21': 'Meath', 'IE22': 'Monaghan', 'IE23': 'Offaly', 'ML07': 'Koulikoro', 'ML06': 'Sikasso', 'ML05': 'Segou', 'ML04': 'Mopti', 'ML03': 'Kayes', 'AM10': "Vayots' Dzor", 'ML01': 'Bamako', 'ML09': 'Gao', 'ML08': 'Tombouctou', 'UA15': "L'vivs'ka Oblast'", 'UA14': "Luhans'ka Oblast'", 'UA17': "Odes'ka Oblast'", 'UA16': "Mykolayivs'ka Oblast'", 'UA11': 'Krym', 'UA10': "Kirovohrads'ka Oblast'", 'UA13': "Kyyivs'ka Oblast'", 'UA12': 'Kyyiv', 'GBV9': 'Orkney', 'UA19': "Rivnens'ka Oblast'", 'UA18': "Poltavs'ka Oblast'", 'GBV8': 'North Lanarkshire', 'GBV5': 'Midlothian', 'GBV4': 'Inverclyde', 'VN09': 'Dong Thap', 'VN01': 'An Giang', 'VN03': 'Ben Tre', 'VN05': 'Cao Bang', 'NG56': 'Nassarawa', 'MV41': 'Meemu', 'MV40': 'Maale', 'MV43': 'Noonu', 'PL80': 'Podkarpackie', 'SI49': 'Komen', 'PL82': 'Pomorskie', 'MV42': 'Gnaviyani', 'PL84': 'Swietokrzyskie', 'PL85': 'Warminsko-Mazurskie', 'PL86': 'Wielkopolskie', 'PL87': 'Zachodniopomorskie', 'SI40': 'Izola-Isola', 'MV45': 'Shaviyani', 'SI42': 'Jursinci', 'SI44': 'Kanal', 'SI45': 'Kidricevo', 'SI46': 'Kobarid', 'MV44': 'Raa', 'MV47': 'Vaavu', 'MV46': 'Thaa', 'GBG2': 'Isle of Wight', 'GBG3': 'Islington', 'GBG1': 'Hounslow', 'GBG6': 'Kingston upon Hull', 'GBG7': 'Kingston upon Thames', 'GBG4': 'Kensington and Chelsea', 'GBG5': 'Kent', 'GBG8': 'Kirklees', 'GBG9': 'Knowsley', 'MKC3': 'Zelino', 'BR13': 'Maranhao', 'BR11': 'Mato Grosso do Sul', 'MKC2': 'Zelenikovo', 'BR17': 'Paraiba', 'BR16': 'Para', 'BR15': 'Minas Gerais', 'BR14': 'Mato Grosso', 'FJ04': 'Rotuma', 'FJ05': 'Western', 'BR18': 'Parana', 'FJ01': 'Central', 'FJ02': 'Eastern', 'FJ03': 'Northern', 'MKC6': 'Zrnovci', 'PH08': 'Batanes', 'PH09': 'Batangas', 'PH04': 'Aklan', 'PH05': 'Albay', 'PH06': 'Antique', 'PH07': 'Bataan', 'PH01': 'Abra', 'PH02': 'Agusan del Norte', 'PH03': 'Agusan del Sur', 'IT03': 'Calabria', 'IT02': 'Basilicata', 'IT01': 'Abruzzi', 'IT07': 'Lazio', 'IT06': 'Friuli-Venezia Giulia', 'IT05': 'Emilia-Romagna', 'IT04': 'Campania', 'IT09': 'Lombardia', 'IT08': 'Liguria', 'PHE3': 'Olongapo', 'PHE2': 'Naga', 'PHE1': 'Marawi', 'PHE7': 'Pagadian', 'PHE6': 'Ozamis', 'PHE5': 'Oroquieta', 'PHE4': 'Ormoc', 'PHE9': 'Pasay', 'PHE8': 'Palayan', 'TH68': 'Songkhla', 'TH69': 'Pattani', 'TH62': 'Phuket', 'TH63': 'Krabi', 'TH60': 'Surat Thani', 'TH61': 'Phangnga', 'TH66': 'Phatthalung', 'TH67': 'Satun', 'TH64': 'Nakhon Si Thammarat', 'TH65': 'Trang', 'MS01': 'Saint Anthony', 'MS02': 'Saint Georges', 'MS03': 'Saint Peter', 'VE24': 'Dependencias Federales', 'SIB3': 'Sentilj', 'DE12': 'Mecklenburg-Vorpommern', 'DE13': 'Sachsen', 'DE10': 'Schleswig-Holstein', 'DE11': 'Brandenburg', 'DE16': 'Berlin', 'DE14': 'Sachsen-Anhalt', 'DE15': 'Thuringen', 'MU20': 'Savanne', 'MU21': 'Agalega Islands', 'MU22': 'Cargados Carajos', 'MU23': 'Rodrigues', 'HN18': 'Yoro', 'HN15': 'Olancho', 'HN14': 'Ocotepeque', 'HN17': 'Valle', 'HN16': 'Santa Barbara', 'HN11': 'Islas de la Bahia', 'HN10': 'Intibuca', 'HN13': 'Lempira', 'HN12': 'La Paz', 'IS35': 'Vestur-Hunavatnssysla', 'IS34': 'Vestur-Bardastrandarsysla', 'IS37': 'Vestur-Skaftafellssysla', 'IS36': 'Vestur-Isafjardarsysla', 'IS31': 'Sudur-Mulasysla', 'IS30': 'Strandasysla', 'IS32': 'Sudur-Tingeyjarsysla', 'HT03': 'Nord-Ouest', 'USFL': 'Florida', 'USFM': 'Federated States of Micronesia', 'ET49': 'Gambela Hizboch', 'ET48': 'Dire Dawa', 'ZW10': 'Harare', 'ET47': 'Binshangul Gumuz', 'ET46': 'Amara', 'ET45': 'Afar', 'ET44': 'Adis Abeba', 'AF18': 'Nangarhar', 'AF19': 'Nimruz', 'AF17': 'Lowgar', 'AF14': 'Kapisa', 'AF13': 'Kabol', 'AF10': 'Helmand', 'AF11': 'Herat', 'GBZ1': 'Swansea', 'GBZ3': 'Vale of Glamorgan', 'GBZ2': 'Torfaen', 'GBZ4': 'Wrexham', 'AO08': 'Huambo', 'AO09': 'Huila', 'AO01': 'Benguela', 'AO02': 'Bie', 'AO03': 'Cabinda', 'AO04': 'Cuando Cubango', 'AO05': 'Cuanza Norte', 'AO06': 'Cuanza Sul', 'AO07': 'Cunene', 'TO03': 'Vava', 'NP08': 'Lumbini', 'NP09': 'Mahakali', 'NP06': 'Karnali', 'NP07': 'Kosi', 'NP04': 'Gandaki', 'NP05': 'Janakpur', 'NP02': 'Bheri', 'NP03': 'Dhawalagiri', 'NP01': 'Bagmati', 'VN13': 'Hai Phong', 'UG84': 'Kitgum', 'UG85': 'Kyenjojo', 'UG86': 'Mayuge', 'UG87': 'Mbale', 'UG80': 'Kaberamaido', 'UG81': 'Kamwenge', 'UG82': 'Kanungu', 'UG83': 'Kayunga', 'UG88': 'Moroto', 'UG89': 'Mpigi', 'SI53': 'Kranjska Gora', 'SI52': 'Kranj', 'SI51': 'Kozje', 'SI50': 'Koper-Capodistria', 'SI57': 'Lasko', 'SI55': 'Kungota', 'SI54': 'Krsko', 'GBF9': 'Hillingdon', 'GBF8': 'Hertford', 'EE08': 'Laane-Virumaa', 'EE09': 'Narva', 'GBF5': 'Hartlepool', 'GBF4': 'Harrow', 'GBF7': 'Herefordshire', 'GBF6': 'Havering', 'GBF1': 'Hammersmith and Fulham', 'EE03': 'Ida-Virumaa', 'GBF3': 'Haringey', 'GBF2': 'Hampshire', 'BR28': 'Sergipe', 'BR29': 'Goias', 'BR26': 'Santa Catarina', 'BR27': 'Sao Paulo', 'BR24': 'Rondonia', 'BR25': 'Roraima', 'BR22': 'Rio Grande do Norte', 'BR23': 'Rio Grande do Sul', 'BR20': 'Piaui', 'BR21': 'Rio de Janeiro', 'SI76': 'Mislinja', 'PH19': 'Catanduanes', 'PH18': 'Capiz', 'PH17': 'Camiguin', 'PH16': 'Camarines Sur', 'PH15': 'Camarines Norte', 'PH14': 'Cagayan', 'PH13': 'Bulacan', 'PH12': 'Bukidnon', 'PH11': 'Bohol', 'PH10': 'Benguet', 'US08': 'Colorado', 'US09': 'Connecticut', 'CH25': 'Zurich', 'CH24': 'Zug', 'CH23': 'Vaud', 'CH22': 'Valais', 'CH21': 'Uri', 'CH20': 'Ticino', 'US01': 'Alabama', 'US02': 'Alaska', 'US04': 'Arizona', 'US05': 'Arkansas', 'US06': 'California', 'NA25': 'Kavango', 'PHF8': 'Silay', 'PHF9': 'Surigao', 'PHF6': 'San Jose', 'PHF7': 'San Pablo', 'PHF4': 'San Carlos', 'PHF5': 'San Carlos', 'PHF2': 'Quezon City', 'PHF3': 'Roxas', 'PHF1': 'Puerto Princesa', 'LA02': 'Champasak', 'NA21': 'Windhoek', 'USGA': 'Georgia', 'NA20': 'Karasburg', 'NA23': 'Hereroland Oos', 'USGU': 'Guam', 'BT06': 'Chhukha', 'BT07': 'Chirang', 'BT05': 'Bumthang', 'BT08': 'Daga', 'BT09': 'Geylegphug', 'KZ14': 'Qyzylorda', 'KZ15': 'East Kazakhstan', 'KZ16': 'North Kazakhstan', 'KZ17': 'Zhambyl', 'KZ10': 'South Kazakhstan', 'KZ11': 'Pavlodar', 'KZ12': 'Qaraghandy', 'KZ13': 'Qostanay', 'LU02': 'Grevenmacher', 'PHC8': 'Iligan', 'TH75': 'Ubon Ratchathani', 'IS41': 'Norourland Vestra', 'IS42': 'Suourland', 'IS43': 'Suournes', 'TH71': 'Ubon Ratchathani', 'TH70': 'Yala', 'TH73': 'Nakhon Phanom', 'TH72': 'Yasothon', 'TH79': 'Nong Bua Lamphu', 'TH78': 'Mukdahan', 'ZW05': 'Mashonaland West', 'ZW04': 'Mashonaland East', 'ZW07': 'Matabeleland South', 'ZW06': 'Matabeleland North', 'ZW01': 'Manicaland', 'ZW03': 'Mashonaland Central', 'ZW02': 'Midlands', 'ZW09': 'Bulawayo', 'ZW08': 'Masvingo', 'FM02': 'Pohnpei', 'FM01': 'Kosrae', 'DE05': 'Hessen', 'IS17': 'Myrasysla', 'DE07': 'Nordrhein-Westfalen', 'DE06': 'Niedersachsen', 'DE01': 'Baden-Wurttemberg', 'DE03': 'Bremen', 'DE02': 'Bayern', 'NR08': 'Denigomodu', 'DE09': 'Saarland', 'TH46': 'Chon Buri', 'NR09': 'Ewa', 'AF09': 'Ghowr', 'SC20': 'Pointe La Rue', 'SC21': 'Port Glaud', 'AF01': 'Badakhshan', 'IE03': 'Clare', 'AF03': 'Baghlan', 'IE01': 'Carlow', 'AF05': 'Bamian', 'IE07': 'Dublin', 'AF07': 'Faryab', 'AF06': 'Farah', 'VN39': 'Lang Son', 'TH43': 'Nakhon Nayok', 'AO19': 'Bengo', 'AO18': 'Lunda Sul', 'AO13': 'Namibe', 'AO12': 'Malanje', 'AO17': 'Lunda Norte', 'AO16': 'Zaire', 'AO15': 'Uige', 'AO14': 'Moxico', 'TW04': "T'ai-wan", 'TW03': "T'ai-pei", 'TW02': 'Kao-hsiung', 'TW01': 'Fu-chien', 'NP11': 'Narayani', 'NP10': 'Mechi', 'NP13': 'Sagarmatha', 'NP12': 'Rapti', 'NP14': 'Seti', 'EG05': 'Al Gharbiyah', 'SIA7': 'Rogaska Slatina', 'SIA6': 'Rogasovci', 'SIA3': 'Radovljica', 'SIA2': 'Radlje ob Dravi', 'SIA1': 'Radenci', 'SIA8': 'Rogatec', 'CAMB': 'Manitoba', 'EG03': 'Al Buhayrah', 'JP46': 'Yamanashi', 'JM15': 'Trelawny', 'JP44': 'Yamagata', 'JP45': 'Yamaguchi', 'JM10': 'Saint Catherine', 'JP43': 'Wakayama', 'JP40': 'Tokyo', 'JM13': 'Saint Mary', 'UG97': 'Yumbe', 'UG96': 'Wakiso', 'UG95': 'Soroti', 'UG94': 'Sironko', 'UG93': 'Rukungiri', 'UG92': 'Pader', 'UG91': 'Nakapiripirit', 'SI61': 'Ljubljana', 'SI68': 'Lukovica', 'EE19': 'Valgamaa', 'EE18': 'Tartumaa', 'VN24': 'Long An', 'VN23': 'Lam Dong', 'VN20': 'Ho Chi Minh', 'VN21': 'Kien Giang', 'EE11': 'Parnumaa', 'GBA1': 'Barking and Dagenham', 'EE13': 'Raplamaa', 'EE12': 'Polvamaa', 'EE15': 'Sillamae', 'EE14': 'Saaremaa', 'EE17': 'Tartu', 'EE16': 'Tallinn', 'BR31': 'Tocantins', 'BR30': 'Pernambuco', 'IR43': 'Khorasan-e Shemali', 'PH28': 'Ilocos Norte', 'RUCI': 'Chechnya Republic', 'PH22': 'Basilan', 'PH23': 'Eastern Samar', 'PH20': 'Cavite', 'PH21': 'Cebu', 'PH26': 'Davao Oriental', 'PH27': 'Ifugao', 'PH24': 'Davao', 'PH25': 'Davao del Sur', 'CH12': 'Neuchatel', 'CH13': 'Nidwalden', 'US19': 'Iowa', 'US18': 'Indiana', 'CH16': 'Schaffhausen', 'CH17': 'Schwyz', 'CH14': 'Obwalden', 'CH15': 'Sankt Gallen', 'US13': 'Georgia', 'US12': 'Florida', 'CH18': 'Solothurn', 'US10': 'Delaware', 'US17': 'Illinois', 'US16': 'Idaho', 'US15': 'Hawaii', 'PHG8': 'Aurora', 'PHG1': 'Tacloban', 'PHG3': 'Tagbilaran', 'PHG2': 'Tagaytay', 'PHG5': 'Toledo', 'PHG4': 'Tangub', 'PHG7': 'Zamboanga', 'PHG6': 'Trece Martires', 'BT11': 'Lhuntshi', 'BT10': 'Ha', 'BT13': 'Paro', 'BT12': 'Mongar', 'BT15': 'Punakha', 'BT14': 'Pemagatsel', 'BT17': 'Samdrup', 'BT16': 'Samchi', 'BT19': 'Tashigang', 'BT18': 'Shemgang', 'KZ07': 'West Kazakhstan', 'KZ06': 'Atyrau', 'KZ05': 'Astana', 'KZ04': 'Aqtobe', 'KZ03': 'Aqmola', 'KZ02': 'Almaty City', 'KZ01': 'Almaty', 'KZ09': 'Mangghystau', 'KZ08': 'Bayqonyr', 'KR19': 'Taejon-jikhalsi', 'TH01': 'Mae Hong Son', 'TH02': 'Chiang Mai', 'TH03': 'Chiang Rai', 'TH04': 'Nan', 'TH05': 'Lamphun', 'TH06': 'Lampang', 'TH07': 'Phrae', 'TH08': 'Tak', 'TH09': 'Sukhothai', 'FM04': 'Yap', 'TN28': 'Madanin', 'TN29': 'Gabes', 'TN22': 'Siliana', 'TN23': 'Sousse', 'TN27': 'Ben Arous', 'UG52': 'Mbarara', 'DK18': 'Midtjylland', 'DK19': 'Nordjylland', 'DK17': 'Hovedstaden', 'UG50': 'Masindi', 'DZ24': 'Jijel', 'DZ25': 'Laghouat', 'NG50': 'Rivers', 'NG51': 'Sokoto', 'DZ20': 'Blida', 'CH08': 'Glarus', 'NG54': 'Ekiti', 'NG55': 'Gombe', 'IE15': 'Laois', 'IE14': 'Leitrim', 'IE16': 'Limerick', 'IE11': 'Kerry', 'IE10': 'Galway', 'IE13': 'Kilkenny', 'IE12': 'Kildare', 'IE19': 'Louth', 'IE18': 'Longford', 'SIB2': 'Sencur', 'HT09': 'Nord', 'SIB1': 'Semic', 'SIB6': 'Sevnica', 'SIB7': 'Sezana', 'SIB4': 'Sentjernej', 'USDE': 'Delaware', 'SIB8': 'Skocjan', 'SIB9': 'Skofja Loka', 'HT06': 'Artibonite', 'HT07': 'Centre', 'LR21': 'Gbarpolu', 'JM09': 'Saint Ann', 'JM08': 'Saint Andrew', 'JM07': 'Portland', 'JM04': 'Manchester', 'JM02': 'Hanover', 'JM01': 'Clarendon', 'AO20': 'Luanda', 'SI71': 'Medvode', 'VN80': 'Ha Nam', 'SI73': 'Metlika', 'SI72': 'Menges', 'SI74': 'Mezica', 'SI77': 'Moravce', 'VN81': 'Hung Yen', 'SI79': 'Mozirje', 'SI78': 'Moravske Toplice', 'VN82': 'Nam Dinh', 'GBO9': 'Waltham Forest', 'VN84': 'Quang Nam', 'LU01': 'Diekirch', 'LU03': 'Luxembourg', 'VN85': 'Thai Nguyen', 'VN86': 'Vinh Puc Province', 'VN87': 'Can Tho', 'FM03': 'Chuuk', 'VN30': 'Quang Ninh', 'VN33': 'Tay Ninh', 'VN32': 'Son La', 'VN35': 'Thai Binh', 'VN34': 'Thanh Hoa', 'VN37': 'Tien Giang', 'VN89': 'Lai Chau', 'NR04': 'Anibare', 'NR05': 'Baiti', 'NR06': 'Boe', 'NR07': 'Buada', 'NR01': 'Aiwo', 'NR02': 'Anabar', 'NR03': 'Anetan', 'EG08': 'Al Jizah', 'EG09': 'Al Minufiyah', 'EG04': 'Al Fayyum', 'GBO6': 'Trafford', 'EG06': 'Al Iskandariyah', 'EG07': "Al Isma'iliyah", 'EG01': 'Ad Daqahliyah', 'EG02': 'Al Bahr al Ahmar', 'GBO7': 'Wakefield', 'PH35': 'Lanao del Sur', 'PH34': 'Lanao del Norte', 'PH37': 'Leyte', 'PH36': 'La Union', 'PH31': 'Isabela', 'PH30': 'Iloilo', 'PH33': 'Laguna', 'PH32': 'Kalinga-Apayao', 'PH39': 'Masbate', 'PH38': 'Marinduque', 'US26': 'Michigan', 'US27': 'Minnesota', 'US24': 'Maryland', 'US25': 'Massachusetts', 'US22': 'Louisiana', 'US23': 'Maine', 'US20': 'Kansas', 'US21': 'Kentucky', 'US28': 'Mississippi', 'US29': 'Missouri', 'NG52': 'Bayelsa', 'NG53': 'Ebonyi', 'DZ26': 'Mascara', 'DZ27': "M'sila", 'CH09': 'Graubunden', 'DZ21': 'Bouira', 'DZ22': 'Djelfa', 'DZ23': 'Guelma', 'CH05': 'Bern', 'CH04': 'Basel-Stadt', 'CH07': 'Geneve', 'CH06': 'Fribourg', 'CH01': 'Aargau', 'DZ29': 'Oum el Bouaghi', 'CH03': 'Basel-Landschaft', 'CH02': 'Ausser-Rhoden', 'VE08': 'Cojedes', 'USAK': 'Alaska', 'USAL': 'Alabama', 'USAA': 'Armed Forces Americas', 'USAE': 'Armed Forces Europe', 'USAZ': 'Arizona', 'USAS': 'American Samoa', 'USAR': 'Arkansas', 'USAP': 'Armed Forces Pacific', 'ES51': 'Andalucia', 'MU13': 'Flacq', 'MU12': 'Black River', 'MU15': 'Moka', 'MU14': 'Grand Port', 'MU17': 'Plaines Wilhems', 'MU16': 'Pamplemousses', 'MU19': 'Riviere du Rempart', 'MU18': 'Port Louis', 'TH13': 'Phichit', 'TH12': 'Phitsanulok', 'TH11': 'Kamphaeng Phet', 'TH10': 'Uttaradit', 'TH17': 'Nong Khai', 'TH16': 'Nakhon Sawan', 'TH15': 'Uthai Thani', 'TH14': 'Phetchabun', 'TH18': 'Loei', 'TN39': 'Manouba', 'TN38': 'Aiana', 'TN33': 'Sidi Bou Zid', 'TN32': 'Sfax', 'TN31': 'Kebili', 'TN37': 'Zaghouan', 'TN36': 'Tunis', 'TN35': 'Tozeur', 'TN34': 'Tataouine', 'TG25': 'Plateaux', 'TG24': 'Maritime', 'TG26': 'Savanes', 'TG23': 'Kara', 'TG22': 'Centrale', 'NG25': 'Anambra', 'YE24': 'Lahij', 'YE25': 'Ta', 'YE20': "Al Bayda'", 'YE21': 'Al Jawf', 'YE22': 'Hajjah', 'YE23': 'Ibb', 'TR58': 'Sivas', 'CZ52': 'Hlavni mesto Praha', 'MM08': 'Mandalay', 'MM09': 'Pegu', 'MM06': 'Kayah State', 'MM07': 'Magwe', 'MM04': 'Kachin State', 'MM05': 'Karan State', 'MM02': 'Chin State', 'MM03': 'Irrawaddy', 'MM01': 'Rakhine State', 'VE06': 'Bolivar', 'RS01': 'Kosovo', 'RS02': 'Vojvodina', 'SIC9': 'Store', 'SIC8': 'Starse', 'SIC5': 'Smarje pri Jelsah', 'SIC4': 'Slovenske Konjice', 'SIC7': 'Sostanj', 'SIC6': 'Smartno ob Paki', 'SIC1': 'Skofljica', 'HT15': 'Nippes', 'TR54': 'Sakarya', 'TO01': 'Ha', 'GBX7': 'Carmarthenshire', 'SE08': 'Jonkopings Lan', 'SE09': 'Kalmar Lan', 'AR24': 'Tucuman', 'AR23': 'Tierra del Fuego', 'AR22': 'Santiago del Estero', 'AR21': 'Santa Fe', 'AR20': 'Santa Cruz', 'SE02': 'Blekinge Lan', 'SE03': 'Gavleborgs Lan', 'SE05': 'Gotlands Lan', 'SE06': 'Hallands Lan', 'SE07': 'Jamtlands Lan', 'SI88': 'Osilnica', 'SI89': 'Pesnica', 'SI84': 'Nova Gorica', 'SI86': 'Odranci', 'SI87': 'Ormoz', 'SI80': 'Murska Sobota', 'SI81': 'Muta', 'SI82': 'Naklo', 'SI83': 'Nazarje', 'GBC6': 'Cornwall', 'GBC7': 'Coventry', 'GBC4': 'Camden', 'GBC5': 'Cheshire', 'GBC2': 'Calderdale', 'GBC3': 'Cambridgeshire', 'GBC1': 'Bury', 'MD58': 'Stinga Nistrului', 'MD59': 'Anenii Noi', 'GBC8': 'Croydon', 'GBC9': 'Cumbria', 'NR14': 'Yaren', 'NR13': 'Uaboe', 'NR12': 'Nibok', 'NR11': 'Meneng', 'NR10': 'Ijuw', 'EG19': "Bur Sa'id", 'EG18': 'Bani Suwayf', 'EG17': 'Asyut', 'EG16': 'Aswan', 'EG15': 'As Suways', 'EG14': 'Ash Sharqiyah', 'EG13': 'Al Wadi al Jadid', 'EG12': 'Al Qalyubiyah', 'EG11': 'Al Qahirah', 'EG10': 'Al Minya', 'ZA10': 'North-West', 'PH41': 'Mindoro Oriental', 'PH42': 'Misamis Occidental', 'PH43': 'Misamis Oriental', 'PH44': 'Mountain', 'PH45': 'Negros Occidental', 'PH46': 'Negros Oriental', 'PH47': 'Nueva Ecija', 'PH48': 'Nueva Vizcaya', 'PH49': 'Palawan', 'JO12': 'At Tafilah', 'JO13': 'Az Zarqa', 'JO10': 'Al Mafraq', 'JO11': 'Amman Governorate', 'JO16': 'Amman', 'JO14': 'Irbid', 'NG05': 'Lagos', 'US31': 'Nebraska', 'US30': 'Montana', 'US33': 'New Hampshire', 'US32': 'Nevada', 'US35': 'New Mexico', 'US34': 'New Jersey', 'US37': 'North Carolina', 'US36': 'New York', 'US39': 'Ohio', 'US38': 'North Dakota', 'DZ37': 'Annaba', 'DZ36': 'Ain Temouchent', 'DZ35': 'Ain Defla', 'DZ34': 'Adrar', 'DZ33': 'Tebessa', 'NG48': 'Ondo', 'DZ31': 'Skikda', 'DZ30': 'Sidi Bel Abbes', 'NG45': 'Abia', 'NG44': 'Yobe', 'NG47': 'Enugu', 'NG46': 'Bauchi', 'NG41': 'Kogi', 'NG40': 'Kebbi', 'DZ39': 'Bordj Bou Arreridj', 'DZ38': 'Bechar', 'CL01': 'Valparaiso', 'CL03': 'Antofagasta', 'CL05': 'Atacama', 'CL07': 'Coquimbo', 'AE05': 'Ras Al Khaimah', 'BO05': 'Oruro', 'BO04': 'La Paz', 'BO07': 'Potosi', 'BO06': 'Pando', 'BO01': 'Chuquisaca', 'TH28': 'Buriram', 'TH29': 'Surin', 'TH26': 'Chaiyaphum', 'TH27': 'Nakhon Ratchasima', 'TH24': 'Maha Sarakham', 'TH25': 'Roi Et', 'TH22': 'Khon Kaen', 'TH23': 'Kalasin', 'TH20': 'Sakon Nakhon', 'TH21': 'Nakhon Phanom', 'TN06': 'Jendouba', 'TN02': 'Kasserine', 'TN03': 'Kairouan', 'SIL3': 'Ruse', 'NA27': 'Namaland', 'MV37': 'Haa Dhaalu', 'MW04': 'Chitipa', 'MW05': 'Thyolo', 'MW06': 'Dedza', 'MW07': 'Dowa', 'MW02': 'Chikwawa', 'MW03': 'Chiradzulu', 'MW08': 'Karonga', 'MW09': 'Kasungu', 'TR82': 'Cankiri', 'TR83': 'Gaziantep', 'TR80': 'Sirnak', 'TR81': 'Adana', 'TR86': 'Ardahan', 'TR87': 'Bartin', 'TR84': 'Kars', 'TR85': 'Zonguldak', 'TR88': 'Igdir', 'TR89': 'Karabuk', 'SD44': 'Central Equatoria State', 'MM11': 'Shan State', 'MM10': 'Sagaing', 'MM13': 'Mon State', 'MM12': 'Tenasserim', 'MM14': 'Rangoon', 'MM17': 'Yangon', 'BF15': 'Bam', 'BF19': 'Boulkiemde', 'NG37': 'Edo', 'SL01': 'Eastern', 'SL03': 'Southern', 'SL02': 'Northern', 'SL04': 'Western Area', 'SID8': 'Velike Lasce', 'SID1': 'Sveti Jurij', 'SID2': 'Tolmin', 'SID3': 'Trbovlje', 'SID4': 'Trebnje', 'SID5': 'Trzic', 'SID6': 'Turnisce', 'SID7': 'Velenje', 'DZ51': 'Relizane', 'AR12': 'La Rioja', 'AR13': 'Mendoza', 'AR10': 'Jujuy', 'AR11': 'La Pampa', 'AR16': 'Rio Negro', 'AR17': 'Salta', 'LY61': 'Tarabulus', 'AR15': 'Neuquen', 'SE12': 'Kronobergs Lan', 'AR18': 'San Juan', 'AR19': 'San Luis', 'SE16': 'Ostergotlands Lan', 'SE15': 'Orebro Lan', 'SE14': 'Norrbottens Lan', 'SI99': 'Radece', 'SI98': 'Racam', 'SI97': 'Puconci', 'SI94': 'Postojna', 'SI92': 'Podcetrtek', 'SI91': 'Pivka', 'VN70': 'Quang Binh', 'GBB1': 'Bolton', 'GBB3': 'Bracknell Forest', 'GBB2': 'Bournemouth', 'GBB5': 'Brent', 'GBB4': 'Bradford', 'GBB7': 'Bristol', 'GBB6': 'Brighton and Hove', 'GBB9': 'Buckinghamshire', 'GBB8': 'Bromley', 'RU18': 'Evenk', 'RU19': 'Ingush', 'RU14': 'Chita', 'RU15': 'Chukot', 'RU16': 'Chuvashia', 'RU17': 'Dagestan', 'RU10': 'Bryansk', 'RU11': 'Buryat', 'RU12': 'Chechnya', 'RU13': 'Chelyabinsk', 'EG22': 'Matruh', 'EG23': 'Qina', 'EG20': 'Dumyat', 'EG21': 'Kafr ash Shaykh', 'EG26': "Janub Sina'", 'EG27': "Shamal Sina'", 'EG24': 'Suhaj', 'ZA03': 'Free State', 'ZA02': 'KwaZulu-Natal', 'ZA01': 'North-Western Province', 'PH50': 'Pampanga', 'PH57': 'North Cotabato', 'PH56': 'Maguindanao', 'PH55': 'Samar', 'PH54': 'Romblon', 'ZA09': 'Limpopo', 'ZA08': 'Northern Cape', 'JO09': 'Al Karak', 'JO07': 'Ma', 'JO02': "Al Balqa'", 'TZ22': 'Zanzibar North', 'RO28': 'Neamt', 'AZ38': 'Qabala', 'AZ39': 'Qax', 'AZ34': 'Naftalan', 'AZ35': 'Naxcivan', 'AZ36': 'Neftcala', 'AZ37': 'Oguz', 'AZ30': 'Lankaran', 'AZ31': 'Lerik', 'AZ32': 'Masalli', 'JP10': 'Gumma', 'DZ03': 'Batna', 'DZ01': 'Alger', 'DZ06': 'Medea', 'DZ07': 'Mostaganem', 'DZ04': 'Constantine', 'VC05': 'Saint Patrick', 'VC04': 'Saint George', 'NG32': 'Oyo', 'VC06': 'Grenadines', 'VC01': 'Charlotte', 'NG35': 'Adamawa', 'VC03': 'Saint David', 'VC02': 'Saint Andrew', 'USCT': 'Connecticut', 'IL06': 'Yerushalayim', 'USCA': 'California', 'USCO': 'Colorado', 'ZA07': 'Mpumalanga', 'ZA06': 'Gauteng', 'ZA05': 'Eastern Cape', 'TH39': 'Pathum Thani', 'TH38': 'Nonthaburi', 'TH31': 'Narathiwat', 'TH30': 'Sisaket', 'TH33': 'Sing Buri', 'TH32': 'Chai Nat', 'TH35': 'Ang Thong', 'TH34': 'Lop Buri', 'TH37': 'Saraburi', 'TH36': 'Phra Nakhon Si Ayutthaya', 'TN10': 'Qafsah', 'TN15': 'Al Mahdia', 'VN53': 'Ba Ria-Vung Tau', 'TN17': 'Bajah', 'TN16': 'Al Munastir', 'TN19': 'Nabeul', 'TN18': 'Bizerte', 'LC10': 'Vieux-Fort', 'LC11': 'Praslin', 'DK21': 'Syddanmark', 'DK20': 'Sjelland', 'MW17': 'Nkhata Bay', 'MW16': 'Ntcheu', 'MW15': 'Mzimba', 'MW13': 'Mchinji', 'MW12': 'Mangochi', 'MW11': 'Lilongwe', 'MW19': 'Nsanje', 'MW18': 'Nkhotakota', 'TR91': 'Osmaniye', 'TR90': 'Kilis', 'TR93': 'Duzce', 'TR92': 'Yalova', 'YE08': 'Al Hudaydah', 'YE02': 'Adan', 'YE03': 'Al Mahrah', 'YE01': 'Abyan', 'YE06': 'Al Ghaydah', 'YE04': 'Hadramawt', 'YE05': 'Shabwah', 'CZ78': 'Jihomoravsky kraj', 'CZ79': 'Jihocesky kraj', 'BF20': 'Ganzourgou', 'BF21': 'Gnagna', 'BF28': 'Kouritenga', 'GBQ1': 'Wirral', 'SIE9': 'Zavrc', 'SIE3': 'Vodice', 'SIE2': 'Vitanje', 'SIE1': 'Vipava', 'SIE7': 'Zagorje ob Savi', 'SIE6': 'Vuzenica', 'SIE5': 'Vrhnika', 'SE26': 'Stockholms Lan', 'SE27': 'Skane Lan', 'SE24': 'Vasternorrlands Lan', 'SE25': 'Vastmanlands Lan', 'SE22': 'Varmlands Lan', 'SE23': 'Vasterbottens Lan', 'SE21': 'Uppsala Lan', 'SE28': 'Vastra Gotaland', 'LY52': 'Awbari', 'LY53': 'Az Zawiyah', 'LY50': 'Al Khums', 'LY51': 'An Nuqat al Khams', 'AR09': 'Formosa', 'AR08': 'Entre Rios', 'LY54': 'Banghazi', 'LY55': 'Darnah', 'AR05': 'Cordoba', 'AR04': 'Chubut', 'AR07': 'Distrito Federal', 'AR06': 'Corrientes', 'AR01': 'Buenos Aires', 'AR03': 'Chaco', 'AR02': 'Catamarca', 'NE03': 'Dosso', 'NE02': 'Diffa', 'NE01': 'Agadez', 'CA08': 'Ontario', 'CA09': 'Prince Edward Island', 'LR22': 'River Gee', 'NE04': 'Maradi', 'CA04': 'New Brunswick', 'CA05': 'Newfoundland and Labrador', 'CA07': 'Nova Scotia', 'CA01': 'Alberta', 'CA02': 'British Columbia', 'CA03': 'Manitoba', 'GBD7': 'Dudley', 'GBM8': 'Southwark', 'GBM9': 'Staffordshire', 'MD78': 'Ialoveni', 'EE21': 'Vorumaa', 'GBM4': 'Southampton', 'GBM5': 'Southend-on-Sea', 'GBM6': 'South Gloucestershire', 'GBM7': 'South Tyneside', 'MD72': 'Dubasari', 'GBM1': 'Slough', 'GBM2': 'Solihull', 'GBM3': 'Somerset', 'RU09': 'Belgorod', 'RU08': 'Bashkortostan', 'RU07': "Astrakhan'", 'RU06': "Arkhangel'sk", 'RU05': 'Amur', 'RU04': 'Altaisky krai', 'RU03': 'Gorno-Altay', 'RU02': 'Aginsky Buryatsky AO', 'RU01': 'Adygeya', 'PH68': 'Quirino', 'PH69': 'Siquijor', 'PH66': 'Zamboanga del Sur', 'PH67': 'Northern Samar', 'PH64': 'Zambales', 'PH65': 'Zamboanga del Norte', 'PH62': 'Surigao del Sur', 'PH63': 'Tarlac', 'PH60': 'Sulu', 'PH61': 'Surigao del Norte', 'CO24': 'Risaralda', 'CO25': 'San Andres y Providencia', 'CO26': 'Santander', 'CO27': 'Sucre', 'CO20': 'Narino', 'CO21': 'Norte de Santander', 'AZ29': 'Lankaran', 'AZ28': 'Lacin', 'AZ27': 'Kurdamir', 'AZ26': 'Kalbacar', 'AZ25': 'Ismayilli', 'AZ24': 'Imisli', 'AZ23': 'Haciqabul', 'AZ22': 'Goycay', 'AZ21': 'Goranboy', 'AZ20': 'Ganca', 'NG29': 'Kano', 'NG28': 'Imo', 'DZ19': 'Biskra', 'DZ18': 'Bejaia', 'DZ15': 'Tlemcen', 'DZ14': 'Tizi Ouzou', 'NG21': 'Akwa Ibom', 'NG27': 'Borno', 'DZ10': 'Saida', 'DZ13': 'Tiaret', 'DZ12': 'Setif', 'NA05': 'Grootfontein', 'FI14': 'Eastern Finland', 'FI15': 'Western Finland', 'FI13': 'Southern Finland', 'VU10': 'Malakula', 'VU11': 'Paama', 'VU12': 'Pentecote', 'VU13': 'Sanma', 'VU14': 'Shepherd', 'VU15': 'Tafea', 'VU16': 'Malampa', 'VU17': 'Penama', 'NG57': 'Zamfara', 'HT13': 'Sud-Est', 'HT12': 'Sud', 'HT11': 'Ouest', 'HT10': 'Nord-Est', 'BA02': 'Republika Srpska', 'BA01': 'Federation of Bosnia and Herzegovina', 'SIC2': 'Slovenj Gradec', 'USLA': 'Louisiana', 'LC09': 'Soufriere', 'LC08': 'Micoud', 'LC03': 'Castries', 'LC02': 'Dauphin', 'LC01': 'Anse-la-Raye', 'LC07': 'Laborie', 'LC06': 'Gros-Islet', 'LC05': 'Dennery', 'LC04': 'Choiseul', 'ES57': 'Extremadura', 'MW23': 'Zomba', 'MW20': 'Ntchisi', 'MW21': 'Rumphi', 'ES53': 'Canarias', 'MW27': 'Likoma', 'MW24': 'Blantyre', 'MW25': 'Mwanza', 'MW28': 'Machinga', 'MW29': 'Mulanje', 'ES59': 'Pais Vasco', 'ES58': 'Galicia', 'YE15': 'Sa', 'YE14': "Ma'rib", 'YE16': 'San', 'YE11': 'Dhamar', 'YE10': 'Al Mahwit', 'MN19': 'Uvs', 'UG29': 'Bushenyi', 'BF34': 'Passore', 'BF36': 'Sanguie', 'BF33': 'Oudalan', 'MN13': 'Hovsgol', 'AL50': 'Tirane', 'AL51': 'Vlore', 'HR20': 'Zagrebacka', 'HR21': 'Grad Zagreb', 'LY49': 'Al Jabal al Akhdar', 'LY48': 'Al Fatih', 'LY45': 'Zlitan', 'LY47': 'Ajdabiya', 'LY41': 'Tarhunah', 'LY42': 'Tubruq', 'CA14': 'Nunavut', 'CA13': 'Northwest Territories', 'CA12': 'Yukon Territory', 'CA11': 'Saskatchewan', 'CA10': 'Quebec', 'FR99': 'Basse-Normandie', 'FR98': 'Auvergne', 'FR97': 'Aquitaine', 'MD69': 'Criuleni', 'MD68': 'Cimislia', 'GBL9': 'Sheffield', 'GBL8': 'Sefton', 'GBL7': 'Sandwell', 'GBL6': 'Shropshire', 'GBL5': 'Salford', 'GBL4': 'Rutland', 'GBL3': 'Rotherham', 'GBL2': 'Rochdale', 'GBL1': 'Richmond upon Thames', 'MD66': 'Calarasi', 'RU38': 'Krasnodar', 'RU39': 'Krasnoyarsk', 'SIF2': 'Ziri', 'SIF3': 'Zrece', 'SIF1': 'Zelezniki', 'RU32': 'Khanty-Mansiy', 'RU33': 'Kirov', 'RU30': 'Khabarovsk', 'RU31': 'Khakass', 'RU36': 'Koryak', 'RU37': 'Kostroma', 'RU34': 'Komi', 'RU35': 'Komi-Permyak', 'RW12': 'Kigali', 'RW13': 'Nord', 'RW11': 'Est', 'RW14': 'Ouest', 'RW15': 'Sud', 'BO08': 'Santa Cruz', 'MO01': 'Ilhas', 'PH71': 'Sultan Kudarat', 'PH70': 'South Cotabato', 'PH72': 'Tawitawi', 'CO37': 'Caldas', 'CO36': 'Boyaca', 'CO35': 'Bolivar', 'CO34': 'Distrito Especial', 'CO33': 'Cundinamarca', 'CO32': 'Casanare', 'CO31': 'Vichada', 'CO30': 'Vaupes', 'AZ12': 'Beylaqan', 'AZ13': 'Bilasuvar', 'AZ10': 'Balakan', 'AZ11': 'Barda', 'AZ16': 'Daskasan', 'AZ17': 'Davaci', 'AZ14': 'Cabrayil', 'AZ15': 'Calilabad', 'WS02': 'Aiga-i-le-Tai', 'WS03': 'Atua', 'WS06': 'Va', 'WS07': 'Gagaifomauga', 'WS04': 'Fa', 'WS05': 'Gaga', 'WS08': 'Palauli', 'WS09': 'Satupa', 'USMT': 'Montana', 'USMS': 'Mississippi', 'USMP': 'Northern Mariana Islands', 'USMO': 'Missouri', 'FI06': 'Lapland', 'FI01': 'Aland', 'USMH': 'Marshall Islands', 'USME': 'Maine', 'USMD': 'Maryland', 'USMA': 'Massachusetts', 'FI08': 'Oulu', 'PK07': 'Northern Areas', 'PK06': 'Azad Kashmir', 'PK05': 'Sindh', 'PK04': 'Punjab', 'RO38': 'Vaslui', 'RO39': 'Valcea', 'PK01': 'Federally Administered Tribal Areas', 'RO34': 'Suceava', 'RO35': 'Teleorman', 'RO36': 'Timis', 'RO37': 'Tulcea', 'RO30': 'Prahova', 'RO31': 'Salaj', 'RO32': 'Satu Mare', 'RO33': 'Sibiu', 'IR38': 'Qazvin', 'IR39': 'Qom', 'MD51': 'Gagauzia', 'IR34': 'Markazi', 'IR35': 'Mazandaran', 'IR36': 'Zanjan', 'IR37': 'Golestan', 'IR30': 'Khorasan', 'IR31': 'Yazd', 'IR32': 'Ardabil', 'IR33': 'East Azarbaijan', 'MD57': 'Chisinau', 'BB02': 'Saint Andrew', 'BB03': 'Saint George', 'NO20': 'Vestfold', 'BB06': 'Saint Joseph', 'BB07': 'Saint Lucy', 'BB08': 'Saint Michael', 'BB09': 'Saint Peter', 'IS20': 'Nordur-Mulasysla', 'IS21': 'Nordur-Tingeyjarsysla', 'BF59': 'Koulpelogo', 'ES60': 'Comunidad Valenciana', 'MK47': 'Konce', 'MW30': 'Phalombe', 'MK48': 'Kondovo', 'MK49': 'Konopiste', 'BF48': 'Bougouriba', 'BF49': 'Boulgou', 'SC22': 'Saint Louis', 'SC23': 'Takamaka', 'BF40': 'Soum', 'BF42': 'Tapoa', 'BF44': 'Zoundweogo', 'BF45': 'Bale', 'BF46': 'Banwa', 'BF47': 'Bazega', 'AL49': 'Shkoder', 'AL48': 'Lezhe', 'AL47': 'Kukes', 'AL46': 'Korce', 'AL45': 'Gjirokaster', 'AL44': 'Fier', 'AL43': 'Elbasan', 'AL42': 'Durres', 'AL41': 'Diber', 'AL40': 'Berat', 'LK10': 'Kandy', 'LK11': 'Kegalla', 'LK12': 'Kurunegala', 'LK14': 'Matale', 'LK15': 'Matara', 'LK16': 'Moneragala', 'LK17': 'Nuwara Eliya', 'LK18': 'Polonnaruwa', 'LK19': 'Puttalam', 'LV18': 'Limbazu', 'CF11': 'Ouaka', 'CF12': 'Ouham', 'CF13': 'Ouham-Pende', 'CF14': 'Cuvette-Ouest', 'CF15': 'Nana-Grebizi', 'CF16': 'Sangha-Mbaere', 'CF17': 'Ombella-Mpoko', 'CF18': 'Bangui', 'LY30': 'Murzuq', 'LY34': 'Sabha', 'LR01': 'Bong', 'LR06': 'Maryland', 'LR07': 'Monrovia', 'LR04': 'Grand Cape Mount', 'LR05': 'Lofa', 'LR09': 'Nimba', 'CANB': 'New Brunswick', 'RU25': 'Kaluga', 'RU24': 'Kalmyk', 'GBO8': 'Walsall', 'VN83': 'Phu Tho', 'RU21': 'Ivanovo', 'RU20': 'Irkutsk', 'RU23': 'Kaliningrad', 'RU22': 'Kabardin-Balkar', 'GBO2': 'Telford and Wrekin', 'GBO3': 'Thurrock', 'GBO1': 'Tameside', 'RU29': 'Kemerovo', 'RU28': 'Karelia', 'GBO4': 'Torbay', 'GBO5': 'Tower Hamlets', 'SIG4': 'Dobrova-Horjul-Polhov Gradec', 'SIG7': 'Domzale', 'CANL': 'Newfoundland', 'PH40': 'Mindoro Occidental', 'RW09': 'Kigali', 'ZA11': 'Western Cape', 'RW07': 'Kibungo', 'RW06': 'Gitarama', 'RW01': 'Butare', 'GA01': 'Estuaire', 'GA02': 'Haut-Ogooue', 'GA03': 'Moyen-Ogooue', 'GA04': 'Ngounie', 'GA05': 'Nyanga', 'GA06': 'Ogooue-Ivindo', 'GA07': 'Ogooue-Lolo', 'GA08': 'Ogooue-Maritime', 'GA09': 'Woleu-Ntem', 'TT08': 'Saint George', 'TT09': 'Saint Patrick', 'TT04': 'Nariva', 'TT05': 'Port-of-Spain', 'TT06': 'Saint Andrew', 'TT07': 'Saint David', 'TT01': 'Arima', 'TT02': 'Caroni', 'TT03': 'Mayaro', 'CANS': 'Nova Scotia', 'AZ05': 'Agstafa', 'AZ04': 'Agdas', 'AZ07': 'Ali Bayramli', 'AZ06': 'Agsu', 'AZ01': 'Abseron', 'AZ03': 'Agdam', 'AZ02': 'Agcabadi', 'AZ09': 'Baki', 'AZ08': 'Astara', 'CO02': 'Antioquia', 'CO03': 'Arauca', 'CO01': 'Amazonas', 'CO06': 'Boyaca Department', 'CO07': 'Caldas Department', 'CO04': 'Atlantico', 'CO05': 'Bolivar Department', 'CO08': 'Caqueta', 'CO09': 'Cauca', 'WS11': 'Vaisigano', 'WS10': 'Tuamasaga', 'GQ03': 'Annobon', 'GQ04': 'Bioko Norte', 'GQ05': 'Bioko Sur', 'GQ06': 'Centro Sur', 'GQ07': 'Kie-Ntem', 'GQ08': 'Litoral', 'GQ09': 'Wele-Nzas', 'TZ24': 'Rukwa', 'TZ25': 'Zanzibar Urban', 'TZ26': 'Arusha', 'TZ27': 'Manyara', 'TZ20': 'Pemba South', 'TZ21': 'Zanzibar Central', 'RO29': 'Olt', 'TZ23': 'Dar es Salaam', 'RO27': 'Mures', 'RO26': 'Mehedinti', 'RO25': 'Maramures', 'RO23': 'Iasi', 'RO22': 'Ialomita', 'RO21': 'Hunedoara', 'RO20': 'Harghita', 'IR29': 'Kerman', 'IR28': 'Esfahan', 'IR27': 'Zanjan', 'IR26': 'Tehran', 'IR25': 'Semnan', 'IR24': 'Markazi', 'IR23': 'Lorestan', 'IR22': 'Bushehr', 'IR21': 'Zanjan', 'LY56': 'Ghadamis', 'USNY': 'New York', 'USNV': 'Nevada', 'USNJ': 'New Jersey', 'USNH': 'New Hampshire', 'USNM': 'New Mexico', 'USNC': 'North Carolina', 'USND': 'North Dakota', 'USNE': 'Nebraska', 'VU18': 'Shefa', 'NO18': 'Troms', 'NO19': 'Vest-Agder', 'NO16': 'Sor-Trondelag', 'NO17': 'Telemark', 'NO14': 'Rogaland', 'NO15': 'Sogn og Fjordane', 'NO12': 'Oslo', 'NO13': 'Ostfold', 'NO10': 'Nord-Trondelag', 'NO11': 'Oppland', 'NG49': 'Plateau', 'MK44': 'Kisela Voda', 'MK45': 'Klecevce', 'MK46': 'Kocani', 'BF58': 'Kossi', 'MK40': 'Karbinci', 'MK41': 'Karpos', 'MK42': 'Kavadarci', 'MK43': 'Kicevo', 'BF53': 'Kadiogo', 'BF52': 'Ioba', 'BF51': 'Houet', 'BF50': 'Gourma', 'BF57': 'Kompienga', 'BF56': 'Komondjari', 'BF55': 'Komoe', 'BF54': 'Kenedougou', 'BY03': "Hrodzyenskaya Voblasts'", 'BY02': "Homyel'skaya Voblasts'", 'BY01': "Brestskaya Voblasts'", 'BY07': "Vitsyebskaya Voblasts'", 'BY06': "Mahilyowskaya Voblasts'", 'BY05': "Minskaya Voblasts'", 'BY04': 'Minsk', 'LK03': 'Badulla', 'LK02': 'Anuradhapura', 'LK01': 'Amparai', 'LK07': 'Hambantota', 'LK06': 'Galle', 'LK04': 'Batticaloa', 'LK09': 'Kalutara', 'CANT': 'Northwest Territories', 'CANU': 'Nunavut', 'PSGZ': 'Gaza', 'NG43': 'Taraba', 'NG42': 'Osun', 'CF03': 'Haute-Kotto', 'CF02': 'Basse-Kotto', 'CF01': 'Bamingui-Bangoran', 'CF07': 'Lobaye', 'CF06': 'Kemo', 'CF05': 'Haut-Mbomou', 'CF04': 'Mambere-Kadei', 'CF09': 'Nana-Mambere', 'CF08': 'Mbomou', 'KI01': 'Gilbert Islands', 'KI02': 'Line Islands', 'KI03': 'Phoenix Islands', 'HR08': 'Licko-Senjska', 'HR09': 'Medimurska', 'HR06': 'Koprivnicko-Krizevacka', 'HR07': 'Krapinsko-Zagorska', 'HR04': 'Istarska', 'HR05': 'Karlovacka', 'HR02': 'Brodsko-Posavska', 'HR03': 'Dubrovacko-Neretvanska', 'HR01': 'Bjelovarsko-Bilogorska', 'RU50': 'Nenets', 'LR19': 'Grand Gedeh', 'LR18': 'River Cess', 'VN92': 'Dien Bien', 'LR14': 'Montserrado', 'LR17': 'Margibi', 'LR11': 'Grand Bassa', 'LR10': 'Sino', 'LR13': 'Maryland', 'LR12': 'Grand Cape Mount', 'GBN5': 'Suffolk', 'GBN4': 'Stoke-on-Trent', 'GBN7': 'Surrey', 'GBN6': 'Sunderland', 'GBN1': 'St. Helens', 'GBN3': 'Stockton-on-Tees', 'GBN2': 'Stockport', 'GBN9': 'Swindon', 'GBN8': 'Sutton', 'VN93': 'Hau Giang', 'RU51': 'Nizhegorod', 'VN91': 'Dak Nong', 'VN90': 'Lao Cai', 'RU54': 'Omsk', 'RU55': 'Orenburg', 'RU56': 'Orel', 'RU57': 'Penza', 'RU58': "Perm'", 'RU59': "Primor'ye", 'SIH4': 'Jesenice', 'SIH6': 'Kamnik', 'SIH7': 'Kocevje', 'SH01': 'Ascension', 'SH03': 'Tristan da Cunha', 'SH02': 'Saint Helena', 'LI22': 'River Gee', 'LI21': 'Gbarpolu', 'TT12': 'Victoria', 'TT11': 'Tobago', 'TT10': 'San Fernando', 'AZ70': 'Zaqatala', 'AZ71': 'Zardab', 'BS30': 'Kemps Bay', 'BS31': 'Marsh Harbour', 'BS32': 'Nichollstown and Berry Islands', 'BS33': 'Rock Sound', 'CO19': 'Meta', 'DZ43': 'El Oued', 'DZ40': 'Boumerdes', 'DZ41': 'Chlef', 'CO15': 'Guainia', 'CO14': 'Guaviare', 'CO17': 'La Guajira', 'CO16': 'Huila', 'CO11': 'Choco', 'CO10': 'Cesar', 'DZ48': 'Mila', 'DZ49': 'Naama', 'USOH': 'Ohio', 'USOK': 'Oklahoma', 'RO18': 'Galati', 'RO19': 'Gorj', 'USOR': 'Oregon', 'RO12': 'Caras-Severin', 'RO13': 'Cluj', 'RO10': 'Bucuresti', 'RO11': 'Buzau', 'RO16': 'Dambovita', 'RO17': 'Dolj', 'RO14': 'Constanta', 'RO15': 'Covasna', 'IR18': 'Semnan Province', 'IR19': 'Markazi', 'IR12': 'Kerman', 'IR13': 'Bakhtaran', 'IR10': 'Ilam', 'IR11': 'Hormozgan', 'IR16': 'Kordestan', 'IR17': 'Mazandaran', 'IR15': 'Khuzestan', 'NA14': 'Outjo', 'NA15': 'Owambo', 'NA16': 'Rehoboth', 'NA17': 'Swakopmund', 'NA10': 'Maltahohe', 'NA11': 'Okahandja', 'NA12': 'Omaruru', 'NA13': 'Otjiwarongo', 'NA18': 'Tsumeb', 'VE09': 'Delta Amacuro', 'BH08': 'Al Mintaqah al Gharbiyah', 'BH09': 'Mintaqat Juzur Hawar', 'BH02': 'Al Manamah', 'BH01': 'Al Hadd', 'BH06': 'Sitrah', 'BH05': 'Jidd Hafs', 'BD86': 'Sylhet', 'BD84': 'Chittagong', 'BD85': 'Barisal', 'BD82': 'Khulna', 'BD83': 'Rajshahi', 'BD81': 'Dhaka', 'AF26': 'Takhar', 'NO09': 'Nordland', 'NO08': 'More og Romsdal', 'VU09': 'Epi', 'VU08': 'Efate', 'NO01': 'Akershus', 'VE07': 'Carabobo', 'NO02': 'Aust-Agder', 'NO05': 'Finnmark', 'NO04': 'Buskerud', 'NO07': 'Hordaland', 'NO06': 'Hedmark', 'KN13': 'Saint Thomas Middle Island', 'AF29': 'Paktika', 'AF28': 'Zabol', 'ES07': 'Islas Baleares', 'SY04': 'Ar Raqqah', 'SY05': "As Suwayda'", 'SY06': 'Dar', 'SY07': 'Dayr az Zawr', 'SY01': 'Al Hasakah', 'SY02': 'Al Ladhiqiyah', 'SY03': 'Al Qunaytirah', 'SY08': 'Rif Dimashq', 'SY09': 'Halab', 'BF66': 'Nayala', 'BF67': 'Noumbiel', 'BF64': 'Namentenga', 'BF65': 'Naouri', 'BF62': 'Loroum', 'BF63': 'Mouhoun', 'BF60': 'Kourweogo', 'BF61': 'Leraba', 'BF68': 'Oubritenga', 'BF69': 'Poni', 'MK57': 'Kumanovo', 'MK56': 'Kukurecani', 'MK55': 'Kuklis', 'MK54': 'Krusevo', 'MK53': 'Krivogastani', 'MK52': 'Kriva Palanka', 'MK51': 'Kratovo', 'SC09': 'Bel Air', 'SC06': 'Baie Lazare', 'SC07': 'Baie Sainte Anne', 'SC04': 'Anse Louis', 'SC05': 'Anse Royale', 'SC02': 'Anse Boileau', 'SC03': 'Anse Etoile', 'MK59': 'Lipkovo', 'MK58': 'Labunista', 'LK36': 'Western', 'LK34': 'Southern', 'LK35': 'Uva', 'LK32': 'North Western', 'LK33': 'Sabaragamuwa', 'LK30': 'North Central', 'LK31': 'Northern', 'AM11': 'Yerevan', 'LY13': "Ash Shati'", 'HR19': 'Zadarska', 'HR18': 'Vukovarsko-Srijemska', 'HR11': 'Pozesko-Slavonska', 'HR10': 'Osjecko-Baranjska', 'HR13': 'Sibensko-Kninska', 'HR12': 'Primorsko-Goranska', 'HR15': 'Splitsko-Dalmatinska', 'HR14': 'Sisacko-Moslavacka', 'HR17': 'Viroviticko-Podravska', 'HR16': 'Varazdinska', 'GBI1': 'Luton', 'GBI2': 'Manchester', 'GBI3': 'Medway', 'GBI4': 'Merton', 'GBI5': 'Middlesbrough', 'GBI6': 'Milton Keynes', 'GBI7': 'Newcastle upon Tyne', 'GBI8': 'Newham', 'GBI9': 'Norfolk', 'RU43': 'Lipetsk', 'ID10': 'Yogyakarta', 'RU41': 'Kursk', 'RU40': 'Kurgan', 'RU47': 'Moskva', 'RU46': 'Mordovia', 'RU45': 'Mariy-El', 'RU44': 'Magadan', 'RU49': 'Murmansk', 'RU48': 'Moscow City', 'ID12': 'Kalimantan Selatan', 'ID13': 'Kalimantan Tengah', 'SII9': 'Luce', 'SII7': 'Loska Dolina', 'SII6': 'Ljutomer', 'SII5': 'Litija', 'SII3': 'Lenart', 'SII2': 'Kuzma', 'CAON': 'Ontario', 'LI10': 'Triesenberg', 'LI11': 'Vaduz', 'DZ46': 'Illizi', 'DZ47': 'Khenchela', 'DZ44': 'El Tarf', 'DZ45': 'Ghardaia', 'CD12': 'Sud-Kivu', 'CD10': 'Maniema', 'CD11': 'Nord-Kivu', 'DZ42': 'El Bayadh', 'BS35': 'San Salvador and Rum Cay', 'AZ63': 'Xizi', 'SV10': 'San Salvador', 'AZ61': 'Xankandi', 'AZ60': 'Xacmaz', 'AZ67': 'Yevlax', 'AZ66': 'Yardimli', 'AZ65': 'Xocavand', 'AZ64': 'Xocali', 'AZ69': 'Zangilan', 'AZ68': 'Yevlax', 'SV12': 'San Vicente', 'BS23': 'New Providence', 'BS22': 'Harbour Island', 'DZ53': 'Tamanghasset', 'DZ52': 'Souk Ahras', 'BS27': "Governor's Harbour", 'BS26': 'Fresh Creek', 'BS25': 'Freeport', 'BS24': 'Acklins and Crooked Islands', 'BS29': 'High Rock', 'BS28': 'Green Turtle Cay', 'CO12': 'Cordoba', 'BO03': 'El Beni', 'GBU8': 'Edinburgh', 'BO02': 'Cochabamba', 'GBU9': 'Falkirk', 'RO05': 'Bihor', 'RO04': 'Bacau', 'RO07': 'Botosani', 'MY09': 'Pulau Pinang', 'RO01': 'Alba', 'RO03': 'Arges', 'RO02': 'Arad', 'MY02': 'Kedah', 'MY03': 'Kelantan', 'MY01': 'Johor', 'MY06': 'Pahang', 'MY07': 'Perak', 'MY04': 'Melaka', 'MY05': 'Negeri Sembilan', 'TZ02': 'Pwani', 'TZ03': 'Dodoma', 'TZ06': 'Kilimanjaro', 'TZ07': 'Lindi', 'TZ04': 'Iringa', 'TZ05': 'Kigoma', 'TZ08': 'Mara', 'TZ09': 'Mbeya', 'BH15': 'Al Muharraq', 'NA06': 'Kaokoland', 'AT09': 'Wien', 'NA04': 'Gobabis', 'BH11': 'Al Mintaqah al Wusta', 'BH10': 'Al Mintaqah ash Shamaliyah', 'NA01': 'Bethanien', 'BH12': 'Madinat', 'AT03': 'Niederosterreich', 'AT02': 'Karnten', 'AT01': 'Burgenland', 'BH19': 'Al Wusta', 'BH18': 'Ash Shamaliyah', 'AT05': 'Salzburg', 'NA08': 'Keetmanshoop', 'GW06': 'Cacheu', 'GW07': 'Tombali', 'GW04': 'Oio', 'GW05': 'Bolama', 'GR50': 'Khios', 'GR51': 'Lesvos', 'GW01': 'Bafata', 'USHI': 'Hawaii', 'IR05': 'Kohkiluyeh va Buyer Ahmadi', 'IR04': 'Sistan va Baluchestan', 'IR07': 'Fars', 'IR01': 'Azarbayjan-e Bakhtari', 'IR03': 'Chahar Mahall va Bakhtiari', 'IR09': 'Hamadan', 'IR08': 'Gilan', 'TR28': 'Giresun', 'TR24': 'Erzincan', 'TR25': 'Erzurum', 'TR26': 'Eskisehir', 'TR20': 'Denizli', 'TR21': 'Diyarbakir', 'TR22': 'Edirne', 'TR23': 'Elazig', 'SI47': 'Kobilje', 'SY14': 'Tartus', 'SY13': 'Dimashq', 'SY12': 'Idlib', 'SY11': 'Hims', 'SY10': 'Hamah', 'ID41': 'Sulawesi Barat', 'ID40': 'Kepulauan Riau', 'BF71': 'Seno', 'BF70': 'Sanmatenga', 'BF73': 'Sourou', 'BF72': 'Sissili', 'BF75': 'Yagha', 'BF74': 'Tuy', 'BF77': 'Ziro', 'BF76': 'Yatenga', 'DO14': 'Maria Trinidad Sanchez', 'DO15': 'Monte Cristi', 'DO16': 'Pedernales', 'DO17': 'Peravia', 'DO10': 'La Altagracia', 'DO11': 'Elias Pina', 'DO12': 'La Romana', 'MK62': 'Makedonska Kamenica', 'MK63': 'Makedonski Brod', 'MK60': 'Lozovo', 'MK61': 'Lukovo', 'MK66': 'Miravci', 'MK67': 'Mogila', 'MK64': 'Mavrovi Anovi', 'MK65': 'Meseista', 'SC11': 'Cascade', 'SC10': 'Bel Ombre', 'MK68': 'Murtino', 'MK69': 'Negotino', 'SC15': 'La Digue', 'SC14': "Grand' Anse", 'SC17': 'Mont Buxton', 'SC16': 'La Riviere Anglaise', 'NI18': 'Region Autonoma Atlantico Sur', 'NI14': 'Rio San Juan', 'NI15': 'Rivas', 'NI16': 'Zelaya', 'NI17': 'Autonoma Atlantico Norte', 'NI10': 'Managua', 'NI11': 'Masaya', 'NI12': 'Matagalpa', 'NI13': 'Nueva Segovia', 'LK29': 'Central', 'LK28': 'Vavuniya', 'LK21': 'Trincomalee', 'LK20': 'Ratnapura', 'LK23': 'Colombo', 'LK25': 'Jaffna', 'LK24': 'Gampaha', 'LK27': 'Mullaittivu', 'LK26': 'Mannar', 'CM04': 'Est', 'CM05': 'Littoral', 'LY03': 'Al Aziziyah', 'LY05': 'Al Jufrah', 'LY08': 'Al Kufrah', 'SO05': 'Galguduud', 'GBH3': 'Leeds', 'GBH2': 'Lancashire', 'GBH1': 'Lambeth', 'GBH7': 'Lincolnshire', 'GBH6': 'Lewisham', 'GBH5': 'Leicestershire', 'GBH4': 'Leicester', 'GBH9': 'London', 'GBH8': 'Liverpool', 'RU78': "Tyumen'", 'RU79': 'Tuva', 'RU76': 'Tula', 'RU77': "Tver'", 'RU74': 'Taymyr', 'RU75': 'Tomsk', 'RU72': 'Tambovskaya oblast', 'RU73': 'Tatarstan', 'RU70': "Stavropol'", 'RU71': 'Sverdlovsk', 'SIJ9': 'Piran', 'SIJ2': 'Maribor', 'SIJ1': 'Majsperk', 'SIJ7': 'Novo Mesto', 'SIJ5': 'Miren-Kostanjevica', 'LI01': 'Balzers', 'AE03': 'Dubai', 'LI03': 'Gamprin', 'LI02': 'Eschen', 'LI05': 'Planken', 'LI04': 'Mauren', 'LI07': 'Schaan', 'LI06': 'Ruggell', 'LI09': 'Triesen', 'LI08': 'Schellenberg', 'KG02': 'Chuy', 'KG03': 'Jalal-Abad', 'UG28': 'Bundibugyo', 'CD02': 'Equateur', 'KG06': 'Talas', 'KG07': 'Ysyk-Kol', 'KG04': 'Naryn', 'KG05': 'Osh', 'CD09': 'Orientale', 'CD08': 'Bas-Congo', 'KG08': 'Osh', 'KG09': 'Batken', 'UG26': 'Apac', 'AZ58': 'Tovuz', 'AZ59': 'Ucar', 'AZ56': 'Susa', 'AZ57': 'Tartar', 'AZ54': 'Sumqayit', 'AZ55': 'Susa', 'AZ52': 'Samux', 'AZ53': 'Siyazan', 'AZ50': 'Samaxi', 'AZ51': 'Samkir', 'MC03': 'Monte-Carlo', 'BS18': 'Ragged Island', 'BS16': 'Mayaguana', 'BS15': 'Long Island', 'BS13': 'Inagua', 'BS10': 'Exuma', 'KY07': 'West End', 'MO02': 'Macau', 'MY15': 'Labuan', 'MY14': 'Kuala Lumpur', 'MY17': 'Putrajaya', 'MY16': 'Sabah', 'MY11': 'Sarawak', 'MY13': 'Terengganu', 'MY12': 'Selangor', 'USIA': 'Iowa', 'USID': 'Idaho', 'USIN': 'Indiana', 'USIL': 'Illinois', 'PH53': 'Rizal', 'TZ19': 'Kagera', 'TZ18': 'Tanga', 'TZ15': 'Shinyanga', 'TZ14': 'Ruvuma', 'TZ17': 'Tabora', 'TZ16': 'Singida', 'TZ11': 'Mtwara', 'TZ10': 'Morogoro', 'TZ13': 'Pemba North', 'TZ12': 'Mwanza', 'NA32': 'Kunene', 'NA33': 'Ohangwena', 'NA30': 'Hardap', 'NA31': 'Karas', 'NA36': 'Omusati', 'NA37': 'Oshana', 'NA34': 'Okavango', 'NA35': 'Omaheke', 'LA17': 'Louangphrabang', 'NA38': 'Oshikoto', 'NA39': 'Otjozondjupa', 'LA13': 'Xaignabouri', 'LA10': 'Savannakhet', 'LA11': 'Vientiane', 'BJ08': 'Atakora', 'BJ09': 'Atlanyique', 'BJ07': 'Alibori', 'GW11': 'Bissau', 'GW10': 'Gabu', 'GR45': 'Iraklion', 'GW12': 'Biombo', 'GR43': 'Khania', 'GR42': 'Lakonia', 'GR41': 'Arkadhia', 'GR40': 'Messinia', 'GR49': 'Kikladhes', 'GR48': 'Samos', 'USVI': 'Virgin Islands', 'CO18': 'Magdalena Department', 'ES27': 'La Rioja', 'ES29': 'Madrid', 'TR39': 'Kirklareli', 'TR38': 'Kayseri', 'TR37': 'Kastamonu', 'TR35': 'Izmir', 'TR34': 'Istanbul', 'TR33': 'Isparta', 'TR32': 'Mersin', 'TR31': 'Hatay', 'PL81': 'Podlaskie', 'PL83': 'Slaskie', 'NZE9': 'Canterbury', 'NZE8': 'Bay of Plenty', 'NZE7': 'Auckland', 'DO09': 'Independencia', 'DO08': 'Espaillat', 'TH56': 'Phetchaburi', 'DO06': 'Duarte', 'DO05': 'Distrito Nacional', 'DO04': 'Dajabon', 'DO03': 'Barahona', 'DO02': 'Baoruco', 'DO01': 'Azua', 'MK79': 'Petrovec', 'MK78': 'Pehcevo', 'MK75': 'Orasac', 'MK74': 'Ohrid', 'MK77': 'Oslomej', 'MK76': 'Orizari', 'MK71': 'Novaci', 'MK70': 'Negotino-Polosko', 'MK73': 'Oblesevo', 'MK72': 'Novo Selo', 'RU52': 'Novgorod', 'NI09': 'Madriz', 'NI08': 'Leon', 'NI07': 'Jinotega', 'NI06': 'Granada', 'NI05': 'Esteli', 'NI04': 'Chontales', 'NI03': 'Chinandega', 'NI02': 'Carazo', 'NI01': 'Boaco', 'RU53': 'Novosibirsk', 'IQ03': 'Al Muthanna', 'HU41': 'Salgotarjan', 'HU40': 'Zalaegerszeg', 'HU43': 'Erd', 'HU42': 'Szekszard', 'GBK8': 'Redbridge', 'GBK9': 'Redcar and Cleveland', 'GBK6': 'Portsmouth', 'GBK7': 'Reading', 'GBK4': 'Plymouth', 'GBK5': 'Poole', 'GBK2': 'Oxfordshire', 'GBK3': 'Peterborough', 'GBK1': 'Oldham', 'RU69': 'Smolensk', 'RU68': 'North Ossetia', 'SIK7': 'Ptuj', 'RU61': 'Rostov', 'RU60': 'Pskov', 'RU63': 'Sakha', 'RU62': "Ryazan'", 'RU65': 'Samara', 'RU64': 'Sakhalin', 'RU67': 'Saratov', 'RU66': 'Saint Petersburg City', 'SA08': 'Al Qasim', 'SA09': 'Al Qurayyat', 'SA05': 'Al Madinah', 'SA06': 'Ash Sharqiyah', 'SA02': 'Al Bahah', 'SA03': 'Al Jawf', 'SO20': 'Woqooyi Galbeed', 'SO21': 'Awdal', 'SO22': 'Sool', 'CAAB': 'Alberta', 'UG37': 'Kampala', 'UG36': 'Kalangala', 'UG31': 'Hoima', 'UG30': 'Gulu', 'UG33': 'Jinja', 'UG39': 'Kapchorwa', 'UG38': 'Kamuli', 'AZ49': 'Salyan', 'AZ48': 'Saki', 'AZ41': 'Qobustan', 'AZ40': 'Qazax', 'AZ43': 'Qubadli', 'AZ42': 'Quba', 'AZ45': 'Saatli', 'AZ44': 'Qusar', 'AZ47': 'Saki', 'AZ46': 'Sabirabad', 'BS05': 'Bimini', 'BS06': 'Cat Island', 'MA46': 'Fes-Boulemane', 'MA47': 'Marrakech-Tensift-Al Haouz', 'MA45': 'Grand Casablanca', 'MA48': 'Meknes-Tafilalet', 'MA49': 'Rabat-Sale-Zemmour-Zaer', 'VU07': 'Torba', 'VU06': 'Aoba', 'VU05': 'Ambrym', 'LA09': 'Saravan', 'LA08': 'Phongsali', 'NA29': 'Erongo', 'NA28': 'Caprivi', 'LA01': 'Attapu', 'NA24': 'Hereroland Wes', 'LA03': 'Houaphan', 'NA26': 'Mariental', 'LA05': 'Louang Namtha', 'LA04': 'Khammouan', 'LA07': 'Oudomxai', 'NA22': 'Damaraland', 'MR12': 'Inchiri', 'MR10': 'Guidimaka', 'MR11': 'Tiris Zemmour', 'BJ18': 'Zou', 'BJ13': 'Donga', 'BJ12': 'Kouffo', 'BJ11': 'Collines', 'BJ10': 'Borgou', 'BJ17': 'Plateau', 'BJ16': 'Oueme', 'BJ15': 'Mono', 'BJ14': 'Littoral', 'CU08': 'Cienfuegos', 'CU09': 'Granma', 'CU01': 'Pinar del Rio', 'CU02': 'Ciudad de la Habana', 'CU03': 'Matanzas', 'CU04': 'Isla de la Juventud', 'CU05': 'Camaguey', 'CU07': 'Ciego de Avila', 'GE04': 'Ajaria', 'GE05': 'Akhalgoris Raioni', 'GE06': "Akhalk'alak'is Raioni", 'GE07': "Akhalts'ikhis Raioni", 'GE01': 'Abashis Raioni', 'GE02': 'Abkhazia', 'GE03': 'Adigenis Raioni', 'GE08': 'Akhmetis Raioni', 'GE09': 'Ambrolauris Raioni', 'ES31': 'Murcia', 'ES32': 'Navarra', 'ES34': 'Asturias', 'ES39': 'Cantabria', 'TR08': 'Artvin', 'TR09': 'Aydin', 'TR02': 'Adiyaman', 'TR03': 'Afyonkarahisar', 'TR07': 'Antalya', 'TR04': 'Agri', 'TR05': 'Amasya', 'USMI': 'Michigan', 'DO32': 'Monte Plata', 'DO33': 'San Cristobal', 'DO30': 'La Vega', 'DO31': 'Monsenor Nouel', 'DO36': 'San Jose de Ocoa', 'DO37': 'Santo Domingo', 'DO34': 'Distrito Nacional', 'DO35': 'Peravia', 'MK08': 'Bogdanci', 'MK09': 'Bogomila', 'MK01': 'Aracinovo', 'MK02': 'Bac', 'MK03': 'Belcista', 'MK04': 'Berovo', 'MK05': 'Bistrica', 'MK06': 'Bitola', 'MK07': 'Blatec', 'CABC': 'British Columbia', 'RU27': 'Karachay-Cherkess', 'NZF6': 'Northland', 'NZF7': 'Otago', 'NZF4': 'Marlborough', 'NZF5': 'Nelson', 'NZF2': "Hawke's Bay", 'NZF3': 'Manawatu-Wanganui', 'NZF1': 'Gisborne', 'VN46': 'Dong Thap', 'NZF8': 'Southland', 'NZF9': 'Taranaki', 'HU38': 'Tatabanya', 'HU39': 'Veszprem', 'AR14': 'Misiones', 'HU30': 'Kaposvar', 'HU31': 'Kecskemet', 'HU32': 'Nagykanizsa', 'HU33': 'Nyiregyhaza', 'HU34': 'Sopron', 'HU35': 'Szekesfehervar', 'HU36': 'Szolnok', 'HU37': 'Szombathely', 'GBJ9': 'Nottinghamshire', 'GBJ8': 'Nottingham', 'GBJ1': 'Northamptonshire', 'GBJ3': 'North Lincolnshire', 'GBJ2': 'North East Lincolnshire', 'GBJ5': 'North Tyneside', 'GBJ4': 'North Somerset', 'GBJ7': 'North Yorkshire', 'GBJ6': 'Northumberland', 'SIL1': 'Ribnica', 'DM10': 'Saint Paul', 'DM11': 'Saint Peter', 'SIL7': 'Sentjur pri Celju', 'SIL8': 'Slovenska Bistrica', 'SA19': 'Tabuk', 'SA17': 'Jizan', 'SA16': 'Najran', 'SA15': 'Al Hudud ash Shamaliyah', 'SA14': 'Makkah', 'SA13': "Ha'il", 'SD40': 'Al Wahadah State', 'SA10': 'Ar Riyad', 'UG40': 'Kasese', 'UG41': 'Kibale', 'UG42': 'Kiboga', 'UG43': 'Kisoro', 'UG45': 'Kotido', 'UG46': 'Kumi', 'UG47': 'Lira', 'CL12': 'Region Metropolitana', 'MA51': 'Doukkala-Abda', 'MA50': 'Chaouia-Ouardigha', 'MA53': 'Guelmim-Es Smara', 'MA52': 'Gharb-Chrarda-Beni Hssen', 'MA55': 'Souss-Massa-Dr', 'MA54': 'Oriental', 'MA57': 'Tanger-Tetouan', 'MA56': 'Tadla-Azilal', 'MA59': 'La', 'MA58': 'Taza-Al Hoceima-Taounate', 'CL13': 'Tarapaca', 'USKY': 'Kentucky', 'USKS': 'Kansas', 'MR09': 'Tagant', 'MR08': 'Dakhlet Nouadhibou', 'MR01': 'Hodh Ech Chargui', 'MR03': 'Assaba', 'MR02': 'Hodh El Gharbi', 'MR05': 'Brakna', 'MR04': 'Gorgol', 'MR07': 'Adrar', 'MR06': 'Trarza', 'BB11': 'Saint Thomas', 'BB10': 'Saint Philip', 'CU13': 'Las Tunas', 'CU12': 'Holguin', 'CU11': 'La Habana', 'CU10': 'Guantanamo', 'CU16': 'Villa Clara', 'CU15': 'Santiago de Cuba', 'CU14': 'Sancti Spiritus', 'GE17': "Dedop'listsqaros Raioni", 'GE16': "Ch'okhatauris Raioni", 'GE15': "Ch'khorotsqus Raioni", 'GE14': "Chiat'ura", 'GE13': 'Borjomis Raioni', 'GE12': 'Bolnisis Raioni', 'GE11': "Baghdat'is Raioni", 'GE10': 'Aspindzis Raioni', 'GE19': "Dushet'is Raioni", 'GE18': 'Dmanisis Raioni', 'TR15': 'Burdur', 'TR14': 'Bolu', 'TR17': 'Canakkale', 'TR16': 'Bursa', 'TR11': 'Bilecik', 'TR10': 'Balikesir', 'TR13': 'Bitlis', 'TR12': 'Bingol', 'TR19': 'Corum', 'BE10': 'Brabant Wallon', 'BE11': 'Brussels Hoofdstedelijk Gewest', 'BE12': 'Vlaams-Brabant', 'SC08': 'Beau Vallon', 'USTN': 'Tennessee', 'MK50': 'Kosel', 'DO25': 'Santiago', 'DO24': 'San Pedro De Macoris', 'DO27': 'Valverde', 'DO26': 'Santiago Rodriguez', 'DO21': 'Sanchez Ramirez', 'DO20': 'Samana', 'DO23': 'San Juan', 'DO29': 'Hato Mayor', 'DO28': 'El Seibo', 'SC01': 'Anse aux Pins', 'MK19': 'Cesinovo', 'MK18': 'Centar Zupa', 'MK13': 'Cair', 'MK12': 'Brvenica', 'MK11': 'Bosilovo', 'MK10': 'Bogovinje', 'MK17': 'Centar', 'MK16': 'Cegrane', 'MK15': 'Caska', 'MK14': 'Capari', 'BG33': 'Mikhaylovgrad', 'BG38': 'Blagoevgrad', 'BG39': 'Burgas', 'NZG1': 'Waikato', 'ID11': 'Kalimantan Barat', 'NZG3': 'West Coast', 'NZG2': 'Wellington', 'ID14': 'Kalimantan Timur', 'ID15': 'Lampung', 'ID16': 'Maluku', 'ID17': 'Nusa Tenggara Barat', 'ID18': 'Nusa Tenggara Timur', 'ID19': 'Riau', 'GBU4': 'East Ayrshire', 'SV11': 'Santa Ana', 'HU29': 'Hodmezovasarhely', 'SV13': 'Sonsonate', 'SV14': 'Usulutan', 'GBU1': 'Clackmannanshire', 'GBU2': 'Dumfries and Galloway', 'GBU3': 'Dundee City', 'HU23': 'Veszprem', 'HU22': 'Vas', 'HU21': 'Tolna', 'HU20': 'Jasz-Nagykun-Szolnok', 'HU27': 'Dunaujvaros', 'HU26': 'Bekescsaba', 'HU25': 'Gyor', 'HU24': 'Zala', 'MKC4': 'Zitose', 'DM09': 'Saint Patrick', 'DM08': 'Saint Mark', 'DM05': 'Saint John', 'DM04': 'Saint George', 'DM07': 'Saint Luke', 'DM06': 'Saint Joseph', 'DM03': 'Saint David', 'DM02': 'Saint Andrew', 'SD30': 'Ash Shamaliyah', 'SD31': 'Ash Sharqiyah', 'SA20': 'Al Jawf', 'SD33': 'Darfur', 'SD34': 'Kurdufan', 'SD35': 'Upper Nile', 'SO02': 'Banaadir', 'SO03': 'Bari', 'SO01': 'Bakool', 'SO06': 'Gedo', 'SO07': 'Hiiraan', 'SO04': 'Bay', 'CM07': 'Nord-Ouest', 'CM08': 'Ouest', 'CM09': 'Sud-Ouest', 'SO08': 'Jubbada Dhexe', 'SO09': 'Jubbada Hoose', 'PH51': 'Pangasinan', 'LV28': 'Talsu', 'LV29': 'Tukuma', 'LV20': 'Madonas', 'LV21': 'Ogres', 'LV22': 'Preilu', 'LV23': 'Rezekne', 'LV24': 'Rezeknes', 'LV25': 'Riga', 'LV26': 'Rigas', 'LV27': 'Saldus', 'MC01': 'La Condamine', 'MC02': 'Monaco', 'IR42': 'Khorasan-e Razavi', 'UG56': 'Mubende', 'UG59': 'Ntungamo', 'UG58': 'Nebbi', 'PH59': 'Southern Leyte', 'PH58': 'Sorsogon', 'PG18': 'Sandaun', 'PG19': 'Enga', 'PG10': 'East New Britain', 'PG11': 'East Sepik', 'PG12': 'Madang', 'PG13': 'Manus', 'PG14': 'Morobe', 'PG15': 'New Ireland', 'PG16': 'Western Highlands', 'PG17': 'West New Britain', 'RO41': 'Calarasi', 'RO40': 'Vrancea', 'RO43': 'Ilfov', 'RO42': 'Giurgiu', 'GR18': 'Thesprotia', 'GR19': 'Preveza', 'GR10': 'Grevena', 'GR11': 'Kozani', 'GR12': 'Imathia', 'GR13': 'Thessaloniki', 'GR14': 'Kavala', 'GR15': 'Khalkidhiki', 'GR16': 'Pieria', 'GR17': 'Ioannina', 'USTX': 'Texas', 'GE22': 'Goris Raioni', 'GE23': 'Gurjaanis Raioni', 'GE20': 'Gardabanis Raioni', 'GE21': 'Gori', 'GE26': 'Kaspis Raioni', 'GE27': 'Kharagaulis Raioni', 'GE24': 'Javis Raioni', 'GE25': "K'arelis Raioni", 'IR41': 'Khorasan-e Janubi', 'IR40': 'Yazd', 'GE28': 'Khashuris Raioni', 'GE29': 'Khobis Raioni', 'TR60': 'Tokat', 'TR61': 'Trabzon', 'TR62': 'Tunceli', 'TR63': 'Sanliurfa', 'TR64': 'Usak', 'TR65': 'Van', 'TR66': 'Yozgat', 'TR68': 'Ankara', 'TR69': 'Gumushane', 'BE09': 'West-Vlaanderen', 'BE08': 'Oost-Vlaanderen', 'BE07': 'Namur', 'BE06': 'Luxembourg', 'BE05': 'Limburg', 'BE04': 'Liege', 'BE03': 'Hainaut', 'BE01': 'Antwerpen', 'UZ14': 'Toshkent', 'UZ12': 'Surkhondaryo', 'UZ13': 'Toshkent', 'UZ10': 'Samarqand', 'UZ11': 'Sirdaryo', 'AZ33': 'Mingacevir', 'NG39': 'Jigawa', 'MK26': 'Dobrusevo', 'MK27': 'Dolna Banjica', 'MK24': 'Demir Hisar', 'MK25': 'Demir Kapija', 'MK22': 'Delcevo', 'MK23': 'Delogozdi', 'MK20': 'Cucer-Sandevo', 'MK21': 'Debar', 'MV38': 'Kaafu', 'MV39': 'Lhaviyani', 'MK28': 'Dolneni', 'MK29': 'Dorce Petrov', 'NG30': 'Kwara', 'NG31': 'Niger', 'DZ09': 'Oran', 'NG36': 'Delta', 'GM04': 'Upper River', 'GM05': 'Western', 'GM07': 'North Bank', 'GM01': 'Banjul', 'GM02': 'Lower River', 'GM03': 'Central River', 'CAQC': 'Quebec', 'ID03': 'Bengkulu', 'ID02': 'Bali', 'ID01': 'Aceh', 'ID07': 'Jawa Tengah', 'ID06': 'Jawa Barat', 'ID05': 'Jambi', 'ID04': 'Jakarta Raya', 'CO23': 'Quindio', 'ID09': 'Papua', 'ID08': 'Jawa Timur', 'SV03': 'Chalatenango', 'GBT6': 'Aberdeenshire', 'GBT5': 'Aberdeen City', 'GBT4': 'Strabane', 'GBT3': 'Omagh', 'GBT2': 'North Down', 'GBT1': 'Newtownabbey', 'RU42': 'Leningrad', 'SV09': 'San Miguel', 'SV08': 'Morazan', 'GBT9': 'Scottish Borders', 'GBT8': 'Argyll and Bute', 'MV34': 'Gaafu Alifu', 'MV35': 'Gaafu Dhaalu', 'SIN5': 'Zalec', 'SIN2': 'Videm', 'SIN3': 'Vojnik', 'MKA9': 'Vasilevo', 'SD28': "Al Istiwa'iyah", 'MKA3': 'Suto Orizari', 'MKA2': 'Studenicani', 'MKA1': 'Strumica', 'MKA7': 'Topolcani', 'MKA6': 'Tetovo', 'MKA5': 'Tearce', 'MKA4': 'Sveti Nikole', 'CM13': 'Nord', 'CM12': 'Extreme-Nord', 'CM11': 'Centre', 'CM10': 'Adamaoua', 'SO19': 'Togdheer', 'SO18': 'Nugaal', 'CM14': 'Sud', 'SO14': 'Shabeellaha Hoose', 'SO16': 'Woqooyi Galbeed', 'SO11': 'Nugaal', 'SO10': 'Mudug', 'SO13': 'Shabeellaha Dhexe', 'SO12': 'Sanaag', 'LV33': 'Ventspils', 'LV32': 'Ventspils', 'LV31': 'Valmieras', 'LV30': 'Valkas', 'UG69': 'Katakwi', 'UG66': 'Bugiri', 'UG67': 'Busia', 'UG65': 'Adjumani', 'UG60': 'Pallisa', 'UG61': 'Rakai', 'FRA7': 'Haute-Normandie', 'FRA6': 'Franche-Comte', 'FRA5': 'Corse', 'FRA4': 'Champagne-Ardenne', 'FRA3': 'Centre', 'FRA2': 'Bretagne', 'HU10': 'Hajdu-Bihar', 'HU11': 'Heves', 'FRA9': 'Languedoc-Roussillon', 'FRA8': 'Ile-de-France', 'PG09': 'Eastern Highlands', 'PG08': 'Chimbu', 'PG03': 'Milne Bay', 'PG02': 'Gulf', 'PG01': 'Central', 'PG07': 'North Solomons', 'PG06': 'Western', 'PG05': 'Southern Highlands', 'PG04': 'Northern', 'IN30': 'Arunachal Pradesh', 'IN31': 'Mizoram', 'IN32': 'Daman and Diu', 'VN47': 'Kien Giang', 'IN34': 'Bihar', 'IN35': 'Madhya Pradesh', 'IN36': 'Uttar Pradesh', 'IN37': 'Chhattisgarh', 'IN38': 'Jharkhand', 'IN39': 'Uttarakhand', 'USUT': 'Utah', 'VN43': 'An Giang', 'MD67': 'Causeni', 'OM04': 'Ash Sharqiyah', 'OM05': 'Az Zahirah', 'OM06': 'Masqat', 'OM07': 'Musandam', 'OM01': 'Ad Dakhiliyah', 'OM02': 'Al Batinah', 'OM03': 'Al Wusta', 'OM08': 'Zufar', 'GR09': 'Kastoria', 'GR08': 'Florina', 'PHH2': 'Quezon', 'PHH3': 'Negros Occidental', 'GR03': 'Xanthi', 'GR02': 'Rodhopi', 'GR01': 'Evros', 'GR07': 'Pella', 'GR06': 'Kilkis', 'GR05': 'Serrai', 'GR04': 'Drama', 'GE39': 'Ninotsmindis Raioni', 'GE38': "Mts'khet'is Raioni", 'GE35': 'Marneulis Raioni', 'GE34': 'Lentekhis Raioni', 'GE37': 'Mestiis Raioni', 'GE36': 'Martvilis Raioni', 'GE31': "K'ut'aisi", 'GE30': 'Khonis Raioni', 'GE33': "Lanch'khut'is Raioni", 'GE32': 'Lagodekhis Raioni', 'TR73': 'Nigde', 'TR72': 'Mardin', 'TR71': 'Konya', 'TR70': 'Hakkari', 'TR77': 'Bayburt', 'TR76': 'Batman', 'TR75': 'Aksaray', 'TR74': 'Siirt', 'TR79': 'Kirikkale', 'TR78': 'Karaman', 'IE31': 'Wicklow', 'IE30': 'Wexford', 'UZ09': 'Qoraqalpoghiston', 'UZ08': 'Qashqadaryo', 'UZ01': 'Andijon', 'KM01': 'Anjouan', 'UZ03': 'Farghona', 'UZ02': 'Bukhoro', 'UZ05': 'Khorazm', 'UZ04': 'Jizzakh', 'UZ07': 'Nawoiy', 'UZ06': 'Namangan', 'BW10': 'Southern', 'BW11': 'North-West', 'MK31': 'Dzepciste', 'MK30': 'Drugovo', 'MK33': 'Gevgelija', 'MK32': 'Gazi Baba', 'MK35': 'Gradsko', 'MK34': 'Gostivar', 'MK37': 'Izvor', 'MK36': 'Ilinden', 'MK39': 'Kamenjane', 'MK38': 'Jegunovce', 'RU26': 'Kamchatka', 'ID38': 'Sulawesi Selatan', 'ID39': 'Irian Jaya Barat', 'ID36': 'Papua', 'ID37': 'Riau', 'ID34': 'Gorontalo', 'ID35': 'Kepulauan Bangka Belitung', 'ID32': 'Sumatera Selatan', 'ID33': 'Banten', 'ID30': 'Jawa Barat', 'ID31': 'Sulawesi Utara', 'GBW2': 'Renfrewshire', 'GBW3': 'Shetland Islands', 'GBW1': 'Perth and Kinross', 'GBW6': 'Stirling', 'GBW7': 'West Dunbartonshire', 'GBW4': 'South Ayrshire', 'AZ62': 'Xanlar', 'GBW8': 'Eilean Siar', 'GBW9': 'West Lothian', 'MKB6': 'Vranestica', 'MKB7': 'Vrapciste', 'MKB4': 'Vinica', 'MKB5': 'Vitoliste', 'MKB2': 'Velesta', 'MKB3': 'Vevcani', 'MKB1': 'Veles', 'MKB8': 'Vratnica', 'MKB9': 'Vrutok', 'LV06': 'Daugavpils', 'LV07': 'Daugavpils', 'LV04': 'Bauskas', 'LV05': 'Cesu', 'LV02': 'Aluksnes', 'LV03': 'Balvu', 'LV01': 'Aizkraukles', 'LV08': 'Dobeles', 'LV09': 'Gulbenes', 'UG79': 'Kabarole', 'UG78': 'Iganga', 'DZ50': 'Ouargla', 'UG71': 'Masaka', 'UG70': 'Luwero', 'UG73': 'Nakasongola', 'UG72': 'Moyo', 'UG74': 'Sembabule', 'UG77': 'Arua', 'UG76': 'Tororo', 'HU01': 'Bacs-Kiskun', 'FRB3': 'Midi-Pyrenees', 'HU03': 'Bekes', 'HU02': 'Baranya', 'HU05': 'Budapest', 'HU04': 'Borsod-Abauj-Zemplen', 'HU07': 'Debrecen', 'HU06': 'Csongrad', 'HU09': 'Gyor-Moson-Sopron', 'HU08': 'Fejer', 'FRB8': "Provence-Alpes-Cote d'Azur", 'FRB9': 'Rhone-Alpes', 'DZ54': 'Tindouf', 'GBT7': 'Angus', 'SV02': 'Cabanas', 'DZ56': 'Tissemsilt', 'SV01': 'Ahuachapan', 'CAYT': 'Yukon Territory', 'SV07': 'La Union', 'SV06': 'La Paz', 'SV05': 'La Libertad', 'SI08': 'Brezice', 'SV04': 'Cuscatlan', 'IN23': 'Punjab', 'IN22': 'Puducherry', 'IN21': 'Orissa', 'IN20': 'Nagaland', 'IN26': 'Tripura', 'IN25': 'Tamil Nadu', 'IN24': 'Rajasthan', 'IN29': 'Sikkim', 'IN28': 'West Bengal', 'NZ10': 'Chatham Islands', 'TN14': 'El Kef', 'GR36': 'Argolis', 'GR37': 'Korinthia', 'GR34': 'Evvoia', 'GR35': 'Attiki', 'GR32': 'Fokis', 'GR33': 'Voiotia', 'GR30': 'Evritania', 'GR31': 'Aitolia kai Akarnania', 'GR38': 'Akhaia', 'GR39': 'Ilia', 'USVT': 'Vermont', 'GE48': 'Samtrediis Raioni', 'GE49': 'Senakis Raioni', 'USVA': 'Virginia', 'GE40': 'Onis Raioni', 'GE41': "Ozurget'is Raioni", 'GE42': "P'ot'i", 'GE43': 'Qazbegis Raioni', 'GE44': 'Qvarlis Raioni', 'GE45': "Rust'avi", 'GE46': "Sach'kheris Raioni", 'GE47': 'Sagarejos Raioni', 'TR48': 'Mugla', 'TR49': 'Mus', 'TR46': 'Kahramanmaras', 'TR44': 'Malatya', 'TR45': 'Manisa', 'TR43': 'Kutahya', 'TR40': 'Kirsehir', 'TR41': 'Kocaeli', 'SD29': 'Al Khartum', 'MKA8': 'Valandovo', 'BW09': 'South-East', 'BW08': 'North-East', 'BW05': 'Kgatleng', 'BW04': 'Kgalagadi', 'BW06': 'Kweneng', 'BW01': 'Central', 'BW03': 'Ghanzi', 'VN88': 'Dak Lak', 'SD27': 'Al Wusta', 'ID29': 'Maluku Utara', 'ID28': 'Maluku', 'ID21': 'Sulawesi Tengah', 'ID20': 'Sulawesi Selatan', 'ID23': 'Sulawesi Utara', 'ID22': 'Sulawesi Tenggara', 'ID25': 'Sumatera Selatan', 'ID24': 'Sumatera Barat', 'ID26': 'Sumatera Utara', 'AG01': 'Barbuda', 'AG03': 'Saint George', 'AG04': 'Saint John', 'AG05': 'Saint Mary', 'AG06': 'Saint Paul', 'AG07': 'Saint Peter', 'AG08': 'Saint Philip', 'AG09': 'Redonda', 'GBV7': 'North Ayrshire', 'GBV6': 'Moray', 'GBV1': 'Fife', 'MY08': 'Perlis', 'GBV3': 'Highland', 'GBV2': 'Glasgow City', 'RO06': 'Bistrita-Nasaud', 'CV07': 'Ribeira Grande', 'MKC1': 'Zajas', 'KE01': 'Central', 'KE02': 'Coast', 'KE03': 'Eastern', 'MKC5': 'Zletovo', 'KE05': 'Nairobi Area', 'KE06': 'North-Eastern', 'KE07': 'Nyanza', 'KE08': 'Rift Valley', 'KE09': 'Western', 'LV11': 'Jelgava', 'LV10': 'Jekabpils', 'LV13': 'Jurmala', 'LV12': 'Jelgavas', 'LV15': 'Kuldigas', 'LV14': 'Kraslavas', 'LV17': 'Liepajas', 'LV16': 'Liepaja', 'LV19': 'Ludzas', 'RO09': 'Brasov', 'RO08': 'Braila', 'MN25': 'Orhon', 'MN24': 'Govisumber', 'MN23': 'Darhan-Uul', 'MN22': 'Erdenet', 'MN21': 'Bulgan', 'MN20': 'Ulaanbaatar', 'FRC1': 'Alsace', 'ST01': 'Principe', 'ST02': 'Sao Tome', 'BG50': 'Pleven', 'IN18': 'Meghalaya', 'IN19': 'Karnataka', 'IN16': 'Maharashtra', 'IN17': 'Manipur', 'IN14': 'Lakshadweep', 'IN12': 'Jammu and Kashmir', 'IN13': 'Kerala', 'IN10': 'Haryana', 'IN11': 'Himachal Pradesh', 'HU16': 'Pest', 'USWY': 'Wyoming', 'HU17': 'Somogy', 'USWV': 'West Virginia', 'HU14': 'Nograd', 'HU15': 'Pecs', 'USWI': 'Wisconsin', 'BG58': 'Sofiya', 'HU12': 'Komarom-Esztergom', 'TM02': 'Balkan', 'USWA': 'Washington', 'HU13': 'Miskolc', 'KR18': 'Kwangju-jikhalsi', 'FRA1': 'Bourgogne', 'KR14': 'Kyongsang-bukto', 'KR15': 'Taegu-jikhalsi', 'KR16': 'Cholla-namdo', 'KR17': "Ch'ungch'ong-namdo", 'KR10': 'Pusan-jikhalsi', 'KR11': "Seoul-t'ukpyolsi", 'KR12': "Inch'on-jikhalsi", 'KR13': 'Kyonggi-do', 'PG20': 'National Capital', 'HU18': 'Szabolcs-Szatmar-Bereg', 'HU19': 'Szeged', 'GR21': 'Larisa', 'GR20': 'Arta', 'GR23': 'Kardhitsa', 'GR22': 'Trikala', 'GR25': 'Kerkira', 'GR24': 'Magnisia', 'GR27': 'Kefallinia', 'GR26': 'Levkas', 'GR29': 'Fthiotis', 'GR28': 'Zakinthos', 'GE59': 'Tsalkis Raioni', 'GE58': 'Tsalenjikhis Raioni', 'GE53': "T'erjolis Raioni", 'GE52': "T'elavis Raioni", 'GE51': "T'bilisi", 'GE50': 'Sighnaghis Raioni', 'GE57': "Ts'ageris Raioni", 'GE56': 'Tqibuli', 'GE55': "T'ianet'is Raioni", 'GE54': "T'et'ritsqaros Raioni", 'TR59': 'Tekirdag', 'NA07': 'Karibib', 'BH14': 'Madinat Hamad', 'TR50': 'Nevsehir', 'TR53': 'Rize', 'TR52': 'Ordu', 'TR55': 'Samsun', 'TO02': 'Tongatapu', 'TR57': 'Sinop', 'AT08': 'Vorarlberg', 'NA03': 'Boesmanland', 'NA02': 'Caprivi Oos', 'BH13': 'Ar Rifa', 'AT07': 'Tirol', 'AT06': 'Steiermark', 'NA09': 'Luderitz', 'MV05': 'Laamu', 'AT04': 'Oberosterreich', 'MV01': 'Seenu', 'GBQ8': 'Armagh', 'GBQ9': 'Ballymena', 'GBU7': 'East Renfrewshire', 'GBQ2': 'Wokingham', 'GBQ3': 'Wolverhampton', 'GBQ4': 'Worcestershire', 'GBQ5': 'York', 'GBQ6': 'Antrim', 'GBQ7': 'Ards', 'EE06': 'Kohtla-Jarve', 'EE07': 'Laanemaa', 'EE04': 'Jarvamaa', 'MN18': 'Tov', 'EE05': 'Jogevamaa', 'MN12': 'Hovd', 'EE02': 'Hiiumaa', 'MN10': 'Govi-Altay', 'MN11': 'Hentiy', 'MN16': 'Selenge', 'MN17': 'Suhbaatar', 'MN14': 'Omnogovi', 'MN15': 'Ovorhangay', 'GW02': 'Quinara', 'EE01': 'Harjumaa', 'SB10': 'Central', 'SB11': 'Western', 'SB12': 'Choiseul', 'SB13': 'Rennell and Bellona', 'MV36': 'Haa Alifu', 'IN09': 'Gujarat', 'IN01': 'Andaman and Nicobar Islands', 'IN03': 'Assam', 'IN02': 'Andhra Pradesh', 'IN05': 'Chandigarh', 'BS34': 'Sandy Point', 'IN07': 'Delhi', 'IN06': 'Dadra and Nagar Haveli', 'CY04': 'Nicosia', 'CY05': 'Limassol', 'CY06': 'Paphos', 'IN33': 'Goa', 'CY01': 'Famagusta', 'CY02': 'Kyrenia', 'CY03': 'Larnaca', 'MV30': 'Alifu', 'MG04': 'Toamasina', 'MG05': 'Antananarivo', 'MG06': 'Toliara', 'MG01': 'Antsiranana', 'MG02': 'Fianarantsoa', 'MG03': 'Mahajanga', 'KR06': 'Kangwon-do', 'KR05': "Ch'ungch'ong-bukto", 'KR03': 'Cholla-bukto', 'KR01': 'Cheju-do', 'MV31': 'Baa', 'SR14': 'Nickerie', 'SR15': 'Para', 'SR16': 'Paramaribo', 'SR17': 'Saramacca', 'SR10': 'Brokopondo', 'SR11': 'Commewijne', 'SR12': 'Coronie', 'SR13': 'Marowijne', 'SR18': 'Sipaliwini', 'SR19': 'Wanica', 'MV32': 'Dhaalu', 'MV33': 'Faafu ', 'GE64': 'Zugdidis Raioni', 'GE62': "Zestap'onis Raioni", 'GE63': 'Zugdidi', 'GE60': 'Tsqaltubo', 'GE61': 'Vanis Raioni', 'USPR': 'Puerto Rico', 'USPW': 'Palau', 'USPA': 'Pennsylvania', 'GH10': 'Upper East', 'GH11': 'Upper West', 'GBS7': 'Magherafelt', 'BG63': 'Vidin', 'BG62': 'Veliko Turnovo', 'BG61': 'Varna', 'BG60': 'Turgovishte', 'GBS4': 'Limavady', 'BG65': 'Yambol', 'BG64': 'Vratsa', 'GBS5': 'Lisburn', 'SM04': 'Faetano', 'SM05': 'Fiorentino', 'GBP9': 'Windsor and Maidenhead', 'GBP8': 'Wiltshire', 'GBP3': 'Warwickshire', 'GBP2': 'Warrington', 'GBP1': 'Wandsworth', 'GBS1': 'Dungannon', 'GBP7': 'Wigan', 'GBP6': 'West Sussex', 'GBP5': 'Westminster', 'GBP4': 'West Berkshire', 'DJ01': 'Ali Sabieh', 'DJ06': 'Dikhil', 'DJ07': 'Djibouti', 'DJ04': 'Obock', 'DJ05': 'Tadjoura', 'DJ08': 'Arta', 'LY58': 'Misratah', 'LY59': 'Sawfajjin', 'KH30': 'Pailin', 'NL02': 'Friesland', 'NL03': 'Gelderland', 'NL01': 'Drenthe', 'NL06': 'Noord-Brabant', 'NL07': 'Noord-Holland', 'NL04': 'Groningen', 'NL05': 'Limburg', 'NL08': 'Overijssel', 'NL09': 'Utrecht', 'MN05': 'Darhan', 'MN07': 'Dornogovi', 'MN06': 'Dornod', 'MN01': 'Arhangay', 'MN03': 'Bayan-Olgiy', 'MN02': 'Bayanhongor', 'LR20': 'Lofa', 'MN09': 'Dzavhan', 'MN08': 'Dundgovi', 'NE06': 'Tahoua', 'NE05': 'Niamey', 'JM17': 'Kingston', 'CH26': 'Jura', 'SB07': 'Isabel', 'SB06': 'Guadalcanal', 'SB03': 'Malaita', 'SB09': 'Temotu', 'SB08': 'Makira', 'PE23': 'Tacna', 'PE22': 'San Martin', 'PE21': 'Puno', 'PE20': 'Piura', 'PE25': 'Ucayali', 'PE24': 'Tumbes', 'MD79': 'Leova', 'MD76': 'Glodeni', 'PL79': 'Opolskie', 'PL78': 'Mazowieckie', 'MD77': 'Hincesti', 'PL75': 'Lubelskie', 'PL74': 'Lodzkie', 'PL77': 'Malopolskie', 'PL76': 'Lubuskie', 'MD74': 'Falesti', 'PL73': 'Kujawsko-Pomorskie', 'PL72': 'Dolnoslaskie', 'MD75': 'Floresti', 'MD73': 'Edinet', 'MD70': 'Donduseni', 'BF78': 'Zondoma', 'MD71': 'Drochia', 'SC19': 'Plaisance', 'BN08': 'Belait', 'BN09': 'Brunei and Muara', 'SC18': 'Mont Fleuri', 'BN07': 'Alibori', 'KP12': "P'yongyang-si", 'KP13': 'Yanggang-do', 'KP11': "P'yongan-bukto", 'KP17': 'Hamgyong-bukto', 'KP14': "Namp'o-si", 'KP15': "P'yongan-namdo", 'KP18': 'Najin Sonbong-si', 'SC13': "Grand' Anse", 'SC12': 'Glacis', 'GH01': 'Greater Accra', 'GH03': 'Brong-Ahafo', 'GH02': 'Ashanti', 'GH05': 'Eastern', 'GH04': 'Central', 'GH06': 'Northern', 'GH09': 'Western', 'GH08': 'Volta', 'BG56': 'Sliven', 'BG57': 'Smolyan', 'BG54': 'Shumen', 'BG55': 'Silistra', 'BG52': 'Razgrad', 'BG53': 'Ruse', 'RU90': 'Permskiy Kray', 'BG51': 'Plovdiv', 'TM05': 'Mary', 'TM04': 'Lebap', 'TM01': 'Ahal', 'TM03': 'Dashoguz', 'BG59': 'Stara Zagora', 'SE18': 'Sodermanlands Lan', 'HU28': 'Eger', 'RU91': 'Krasnoyarskiy Kray', 'CN11': 'Hunan', 'HT14': "Grand' Anse", 'KH29': 'Batdambang', 'KH25': 'Banteay Meanchey', 'NL15': 'Overijssel', 'NL16': 'Flevoland', 'NL11': 'Zuid-Holland', 'NL10': 'Zeeland', 'LS18': 'Quthing', 'LS19': 'Thaba-Tseka', 'LS10': 'Berea', 'LS11': 'Butha-Buthe', 'LS12': 'Leribe', 'LS13': 'Mafeteng', 'LS14': 'Maseru', 'LS15': 'Mohales Hoek', 'LS16': 'Mokhotlong', 'LS17': 'Qachas Nek', 'GBS6': 'Derry', 'SM01': 'Acquaviva', 'SM02': 'Chiesanuova', 'SM03': 'Domagnano', 'GBS2': 'Fermanagh', 'GBS3': 'Larne', 'SM06': 'Borgo Maggiore', 'SM07': 'San Marino', 'SM08': 'Monte Giardino', 'SM09': 'Serravalle', 'GBS8': 'Moyle', 'GBS9': 'Newry and Mourne', 'CZ90': 'Zlinsky kraj', 'MD90': 'Taraclia', 'MD91': 'Telenesti', 'MD92': 'Ungheni', 'CN18': 'Guizhou', 'CN19': 'Liaoning', 'CN10': 'Hebei', 'SE10': 'Dalarnas Lan', 'CN12': 'Hubei', 'CN13': 'Xinjiang', 'CN14': 'Xizang', 'CN15': 'Gansu', 'CN16': 'Guangxi', 'PE18': 'Moquegua', 'PE19': 'Pasco', 'PE16': 'Loreto', 'PE17': 'Madre de Dios', 'PE14': 'Lambayeque', 'PE15': 'Lima', 'PE12': 'Junin', 'PE13': 'La Libertad', 'PE10': 'Huanuco', 'PE11': 'Ica'}
21,486.25
85,919
0.602339
b7a9d3a60ea32292f1f1a315f0e465e4cf861159
236
py
Python
configs/semantic_guided/CE.py
hukkelas/full_body_anonymization
c61745b137c84ffb742ef6ab2f4721db4acf22b7
[ "MIT" ]
27
2022-01-06T20:15:24.000Z
2022-03-29T11:54:49.000Z
configs/semantic_guided/CE.py
hukkelas/full_body_anonymization
c61745b137c84ffb742ef6ab2f4721db4acf22b7
[ "MIT" ]
2
2022-03-17T06:04:23.000Z
2022-03-25T08:50:57.000Z
configs/semantic_guided/CE.py
hukkelas/full_body_anonymization
c61745b137c84ffb742ef6ab2f4721db4acf22b7
[ "MIT" ]
2
2022-01-07T13:16:59.000Z
2022-01-16T02:10:50.000Z
_base_config_ = ["base.py"] generator = dict( input_cse=True, use_cse=True ) discriminator=dict( pred_only_cse=False, pred_only_semantic=True ) loss = dict( gan_criterion=dict(type="segmentation", seg_weight=.1) )
15.733333
58
0.699153
b7ac37d5a23a4e9b74f4c14b649516c082ec539d
676
py
Python
test/compiler/test-encode.py
xupingmao/minipy
5bce2f238925eb92fe9ff7d935f59ef68daa257a
[ "MIT" ]
52
2016-07-11T10:14:35.000Z
2021-12-09T09:10:43.000Z
test/compiler/test-encode.py
xupingmao/snake
c956f151ed1ebd2faeaf1565352b59ca5a8fa0b4
[ "MIT" ]
13
2016-07-24T13:50:37.000Z
2019-03-02T06:56:18.000Z
test/compiler/test-encode.py
xupingmao/snake
c956f151ed1ebd2faeaf1565352b59ca5a8fa0b4
[ "MIT" ]
9
2017-01-27T10:46:04.000Z
2021-12-09T09:10:46.000Z
# -*- coding:utf-8 -*- # @author xupingmao <578749341@qq.com> # @since 2020/10/20 00:19:47 # @modified 2020/10/20 00:42:52 import sys sys.path.append("src/python") from mp_encode import * test_compile("assign-number") test_compile("assign-multi") test_compile("if-in")
25.037037
67
0.668639
b7ad32170df3a150ccda1de3243e006af407c590
3,719
py
Python
paragen/optim/__init__.py
godweiyang/ParaGen
9665d1244ea38a41fc06b4e0a7f6411985e2221f
[ "Apache-2.0" ]
null
null
null
paragen/optim/__init__.py
godweiyang/ParaGen
9665d1244ea38a41fc06b4e0a7f6411985e2221f
[ "Apache-2.0" ]
null
null
null
paragen/optim/__init__.py
godweiyang/ParaGen
9665d1244ea38a41fc06b4e0a7f6411985e2221f
[ "Apache-2.0" ]
null
null
null
from copy import deepcopy from inspect import getfullargspec import importlib import json import os import logging logger = logging.getLogger(__name__) from torch.optim.optimizer import Optimizer from paragen.optim.optimizer import Optimizer from paragen.utils.rate_schedulers import create_rate_scheduler from paragen.utils.runtime import Environment from paragen.utils.registry import setup_registry register_optim, create_optim, registry = setup_registry('optim', Optimizer, force_extend=False) modules_dir = os.path.dirname(__file__) for file in os.listdir(modules_dir): path = os.path.join(modules_dir, file) if ( not file.startswith('_') and not file.startswith('.') and (file.endswith('.py') or os.path.isdir(path)) ): module_name = file[:file.find('.py')] if file.endswith('.py') else file module = importlib.import_module('paragen.optim.' + module_name)
35.419048
112
0.633235
b7adb4099781c23875a3639ae37c4e4a5bb88239
2,860
py
Python
joyvillage/joy/views.py
IreneMercy/Joy-Village-Backup
f038e33aa5c28337bc20c6fcd3273ef37d283564
[ "MIT" ]
null
null
null
joyvillage/joy/views.py
IreneMercy/Joy-Village-Backup
f038e33aa5c28337bc20c6fcd3273ef37d283564
[ "MIT" ]
9
2021-03-19T09:58:55.000Z
2022-03-12T00:22:50.000Z
joyvillage/joy/views.py
IreneMercy/Joy-Foundation
f038e33aa5c28337bc20c6fcd3273ef37d283564
[ "MIT" ]
null
null
null
from __future__ import unicode_literals from django.shortcuts import render, redirect from django.http import HttpResponse, HttpResponseRedirect from .models import Events, Gallery, News, Careers, Partners from django.core.mail import send_mail,BadHeaderError from django.conf import settings from.forms import ContactForm from django.contrib import messages
29.484536
103
0.640909
b7ae3072a6046637d4bd29d21eabd8d449e98c65
274
py
Python
src/events/admin.py
cbsBiram/xarala__ssr
863e1362c786daa752b942b796f7a015211d2f1b
[ "FSFAP" ]
null
null
null
src/events/admin.py
cbsBiram/xarala__ssr
863e1362c786daa752b942b796f7a015211d2f1b
[ "FSFAP" ]
null
null
null
src/events/admin.py
cbsBiram/xarala__ssr
863e1362c786daa752b942b796f7a015211d2f1b
[ "FSFAP" ]
null
null
null
from django.contrib import admin from django_summernote.admin import SummernoteModelAdmin from .models import Event, Speaker admin.site.register(Event, EventAdmin) admin.site.register(Speaker)
22.833333
56
0.813869
b7af3d0ba516d34beefe1df3aa1a2a39558521ee
318
py
Python
python/cython_build.py
n1tk/batch_jaro_winkler
421c7e3a5bedce89e8c00216b90d32d1629073a2
[ "MIT" ]
22
2020-04-30T17:56:29.000Z
2022-01-19T21:05:15.000Z
python/cython_build.py
n1tk/batch_jaro_winkler
421c7e3a5bedce89e8c00216b90d32d1629073a2
[ "MIT" ]
2
2021-01-19T14:07:22.000Z
2021-11-24T16:32:46.000Z
python/cython_build.py
n1tk/batch_jaro_winkler
421c7e3a5bedce89e8c00216b90d32d1629073a2
[ "MIT" ]
3
2020-10-28T20:56:29.000Z
2022-02-25T23:29:05.000Z
from distutils.core import setup from distutils.extension import Extension from Cython.Build import cythonize import sys python_version = sys.version_info[0] setup( name='batch_jaro_winkler', ext_modules=cythonize([Extension('batch_jaro_winkler', ['cbatch_jaro_winkler.pyx'])], language_level=python_version) )
24.461538
118
0.811321
b7afa43603c9767401a62b1a4fe6fc631887605a
6,647
py
Python
venv/lib/python3.7/site-packages/google/type/postal_address_pb2.py
nicholasadamou/StockBird
257396479667863d4ee122ea46adb86087c9aa78
[ "Apache-2.0" ]
15
2020-06-29T08:33:39.000Z
2022-02-12T00:28:51.000Z
venv/lib/python3.7/site-packages/google/type/postal_address_pb2.py
nicholasadamou/StockBird
257396479667863d4ee122ea46adb86087c9aa78
[ "Apache-2.0" ]
21
2020-03-01T18:21:09.000Z
2020-05-26T14:49:08.000Z
venv/lib/python3.7/site-packages/google/type/postal_address_pb2.py
nicholasadamou/StockBird
257396479667863d4ee122ea46adb86087c9aa78
[ "Apache-2.0" ]
11
2020-06-29T08:40:24.000Z
2022-02-24T17:39:16.000Z
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/type/postal_address.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() DESCRIPTOR = _descriptor.FileDescriptor( name='google/type/postal_address.proto', package='google.type', syntax='proto3', serialized_options=_b('\n\017com.google.typeB\022PostalAddressProtoP\001ZFgoogle.golang.org/genproto/googleapis/type/postaladdress;postaladdress\242\002\003GTP'), serialized_pb=_b('\n google/type/postal_address.proto\x12\x0bgoogle.type\"\xfd\x01\n\rPostalAddress\x12\x10\n\x08revision\x18\x01 \x01(\x05\x12\x13\n\x0bregion_code\x18\x02 \x01(\t\x12\x15\n\rlanguage_code\x18\x03 \x01(\t\x12\x13\n\x0bpostal_code\x18\x04 \x01(\t\x12\x14\n\x0csorting_code\x18\x05 \x01(\t\x12\x1b\n\x13\x61\x64ministrative_area\x18\x06 \x01(\t\x12\x10\n\x08locality\x18\x07 \x01(\t\x12\x13\n\x0bsublocality\x18\x08 \x01(\t\x12\x15\n\raddress_lines\x18\t \x03(\t\x12\x12\n\nrecipients\x18\n \x03(\t\x12\x14\n\x0corganization\x18\x0b \x01(\tBu\n\x0f\x63om.google.typeB\x12PostalAddressProtoP\x01ZFgoogle.golang.org/genproto/googleapis/type/postaladdress;postaladdress\xa2\x02\x03GTPb\x06proto3') ) _POSTALADDRESS = _descriptor.Descriptor( name='PostalAddress', full_name='google.type.PostalAddress', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='revision', full_name='google.type.PostalAddress.revision', index=0, number=1, type=5, cpp_type=1, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='region_code', full_name='google.type.PostalAddress.region_code', index=1, number=2, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='language_code', full_name='google.type.PostalAddress.language_code', index=2, number=3, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='postal_code', full_name='google.type.PostalAddress.postal_code', index=3, number=4, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='sorting_code', full_name='google.type.PostalAddress.sorting_code', index=4, number=5, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='administrative_area', full_name='google.type.PostalAddress.administrative_area', index=5, number=6, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='locality', full_name='google.type.PostalAddress.locality', index=6, number=7, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='sublocality', full_name='google.type.PostalAddress.sublocality', index=7, number=8, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='address_lines', full_name='google.type.PostalAddress.address_lines', index=8, number=9, type=9, cpp_type=9, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='recipients', full_name='google.type.PostalAddress.recipients', index=9, number=10, type=9, cpp_type=9, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='organization', full_name='google.type.PostalAddress.organization', index=10, number=11, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=50, serialized_end=303, ) DESCRIPTOR.message_types_by_name['PostalAddress'] = _POSTALADDRESS _sym_db.RegisterFileDescriptor(DESCRIPTOR) PostalAddress = _reflection.GeneratedProtocolMessageType('PostalAddress', (_message.Message,), dict( DESCRIPTOR = _POSTALADDRESS, __module__ = 'google.type.postal_address_pb2' # @@protoc_insertion_point(class_scope:google.type.PostalAddress) )) _sym_db.RegisterMessage(PostalAddress) DESCRIPTOR._options = None # @@protoc_insertion_point(module_scope)
47.141844
711
0.746352
b7aff83ef7243e9bfde2d005caee3accba55ac07
612
py
Python
dataprep/tests/data_connector/test_integration.py
dylanzxc/dataprep
21ef62936eeec28495763f35fcb3cb07f71de6f6
[ "MIT" ]
1
2020-12-18T13:16:38.000Z
2020-12-18T13:16:38.000Z
dataprep/tests/data_connector/test_integration.py
bexxmodd/dataprep
3aaa626bfaf9270cf56ffb70280cbcd8031f3ac3
[ "MIT" ]
null
null
null
dataprep/tests/data_connector/test_integration.py
bexxmodd/dataprep
3aaa626bfaf9270cf56ffb70280cbcd8031f3ac3
[ "MIT" ]
null
null
null
from ...data_connector import Connector from os import environ
24.48
81
0.666667
b7b0446dcbe64c12f7cc04baa8e64d8c7155c9fb
6,294
py
Python
plot_helpers.py
aspuru-guzik-group/QNODE
1ec3767c7b574eaeb7b0ec05d1be54983f8972bd
[ "MIT" ]
14
2021-11-06T19:32:56.000Z
2022-02-08T19:53:28.000Z
plot_helpers.py
aspuru-guzik-group/QNODE
1ec3767c7b574eaeb7b0ec05d1be54983f8972bd
[ "MIT" ]
null
null
null
plot_helpers.py
aspuru-guzik-group/QNODE
1ec3767c7b574eaeb7b0ec05d1be54983f8972bd
[ "MIT" ]
null
null
null
import os import torch import numpy as np import math import matplotlib.pyplot as plt from matplotlib import cm from qutip import * import imageio plt.rcParams['axes.labelsize'] = 16 from matplotlib import rc rc('font', **{'family': 'serif', 'serif': ['Computer Modern']}) rc('text', usetex=True) def animate_recon(xt, xm, xe, title=''): """x is [ts,3]""" images = [] for x, label, col in zip([xt, xm, xe],['training dynamics', 'latent neural ode reconstruction','latent neural ode extrapolation' ], ['black','limegreen', 'blue']): for i, v in enumerate(x): bloch = bloch_format(Bloch()) bloch.add_vectors(v) bloch.vector_color =[col] bloch.render() s = x[:i+1] #print(v, s[-1]) bloch.axes.plot(s[:,1], -s[:,0], s[:,2], color=col) if label =='latent neural ode reconstruction': bloch.axes.plot(xt[:,1], -xt[:,0], xt[:,2], color='black') if label =='latent neural ode extrapolation': bloch.axes.plot(xt[:,1], -xt[:,0], xt[:,2], color='black') bloch.axes.plot(xm[:,1], -xm[:,0], xm[:,2], color='limegreen') plt.suptitle(label, fontdict={'color':col}) plt.savefig('exp/temp_file.png') images.append(imageio.imread('exp/temp_file.png')) imageio.mimsave('exp/'+title+'.gif', images, duration=0.05) def animate_traj(xt, title=''): """xt, xm is [ts,3] --> generate gif of both simultaneously""" images = [] for i, vt in enumerate(xt): bloch = bloch_format(Bloch()) bloch.add_vectors(vt) bloch.vector_color =['black'] bloch.render() t = xt[:i+1] bloch.axes.plot(t[:,1], -t[:,0], t[:,2], color='black', label='dynamics') #plt.legend(loc='lower center') #plt.suptitle('latent neural ode --', fontdict={'color':'limegreen'}) #plt.title('True quantum dynamics', fontdict={'color':'black'}) plt.savefig('exp/temp_file.png', bbox_inches='tight') images.append(imageio.imread('exp/temp_file.png')) imageio.mimsave('exp/'+title+'.gif', images, duration=0.05) def animate_recon_(xt, xm, title=''): """xt, xm is [ts,3] --> generate gif of both simultaneously""" images = [] for i, (vt, vm) in enumerate(zip(xt,xm)): bloch = bloch_format(Bloch()) bloch.add_vectors(vt) bloch.add_vectors(vm) bloch.vector_color =['black', 'limegreen'] bloch.render() t = xt[:i+1] m = xm[:i+1] bloch.axes.plot(t[:,1], -t[:,0], t[:,2], color='black', label='train') bloch.axes.plot(m[:,1], -m[:,0], m[:,2], color='limegreen', label='neural ode') #plt.legend(loc='lower center') plt.suptitle('latent neural ode --', fontdict={'color':'limegreen'}) plt.title('True quantum dynamics', fontdict={'color':'black'}) plt.savefig('exp/temp_file.png') images.append(imageio.imread('exp/temp_file.png')) imageio.mimsave('exp/'+title+'.gif', images, duration=0.05) def animate_single_traj(x, title=''): """x is [ts,3]""" images = [] for i, v in enumerate(x): bloch = Bloch() bloch.add_vectors(v) bloch.add_points(v) bloch.render() s = x[:i+1] print(v, s[-1]) bloch.axes.plot(s[:,1], -s[:,0], s[:,2], color='limegreen') plt.savefig('exp/temp_file.png') images.append(imageio.imread('exp/temp_file.png')) imageio.mimsave('exp/traj'+title+'.gif', images, duration=0.125) os.remove('exp/temp_file.png') def construct_gif(xs, title=''): """ constructs a gif of stationary bloch trajectories """ cmap = cm.get_cmap('Greens', len(xs)) cols = cmap(range(len(xs))) images = [] for i, x in enumerate(xs): filename='temp_file.png' plot_traj_bloch(x, filename) images.append(imageio.imread('exp/'+filename)) imageio.mimsave('exp/'+title+'.gif', images, duration=0.5) os.remove('exp/temp_file.png')
35.965714
167
0.58659
b7b1005f9392e0dbc05eef28e9be52e84c7d4a58
17,348
py
Python
state.py
Lekensteyn/wgll
11ac7925687bfc1866d3702f821230233fe3a8de
[ "MIT" ]
1
2021-11-27T17:29:43.000Z
2021-11-27T17:29:43.000Z
state.py
Lekensteyn/wgll
11ac7925687bfc1866d3702f821230233fe3a8de
[ "MIT" ]
null
null
null
state.py
Lekensteyn/wgll
11ac7925687bfc1866d3702f821230233fe3a8de
[ "MIT" ]
null
null
null
# State tracking for WireGuard protocol operations. # Author: Peter Wu <peter@lekensteyn.nl> # Licensed under the MIT license <http://opensource.org/licenses/MIT>. import base64 import hashlib import inspect import socket import traceback from noise_wg import NoiseWG, crypto_scalarmult_base, aead_encrypt, aead_decrypt class StateR0(Base): class StateI1(Base): fields = ['Tsend', 'Trecv'] class StateR1(Base): # SpubI and time are not really needed by the handshake, but perhaps this # could serve as debugging aid. fields = ['SpubI', 'time', 'Tsend', 'Trecv'] class Data(Base): class Field: def __init__(self, name, size, constructor=None, fixed=None): self.name = name self.size = size self.fixed = fixed if constructor is None: self._constructor = constructor
34.557769
85
0.606006
b7b19fe3229937c45439013a0185385ffb6134b0
2,007
py
Python
BAMF_Detect/modules/dendroid.py
bwall/bamfdetect
3b0b96a8b2285a1a4b3e3cf5ed1b5ad422b91ed1
[ "MIT" ]
152
2015-02-04T16:34:53.000Z
2021-07-27T19:00:40.000Z
BAMF_Detect/modules/dendroid.py
bwall/bamfdetect
3b0b96a8b2285a1a4b3e3cf5ed1b5ad422b91ed1
[ "MIT" ]
null
null
null
BAMF_Detect/modules/dendroid.py
bwall/bamfdetect
3b0b96a8b2285a1a4b3e3cf5ed1b5ad422b91ed1
[ "MIT" ]
30
2015-03-31T10:20:32.000Z
2022-02-09T16:17:04.000Z
from common import Modules, data_strings, load_yara_rules, AndroidParseModule, ModuleMetadata from base64 import b64decode from string import printable Modules.list.append(dendroid())
33.45
119
0.521176
b7b264987ed766841bcdbbf47f7266aa100f16c2
8,942
py
Python
corehq/ex-submodules/couchforms/tests/test_analytics.py
caktus/commcare-hq
fae9c0f792b4889b768252d3895d9d1884ce0d3b
[ "BSD-3-Clause" ]
null
null
null
corehq/ex-submodules/couchforms/tests/test_analytics.py
caktus/commcare-hq
fae9c0f792b4889b768252d3895d9d1884ce0d3b
[ "BSD-3-Clause" ]
40
2021-07-20T15:55:08.000Z
2022-03-25T17:21:36.000Z
corehq/ex-submodules/couchforms/tests/test_analytics.py
caktus/commcare-hq
fae9c0f792b4889b768252d3895d9d1884ce0d3b
[ "BSD-3-Clause" ]
null
null
null
import datetime import uuid from django.test import TestCase from mock import patch from requests import ConnectionError from couchforms.analytics import ( app_has_been_submitted_to_in_last_30_days, domain_has_submission_in_last_30_days, get_all_xmlns_app_id_pairs_submitted_to_in_domain, get_exports_by_form, get_first_form_submission_received, get_form_analytics_metadata, get_last_form_submission_received, get_number_of_forms_in_domain, update_analytics_indexes, ) from couchforms.models import XFormInstance, XFormError from pillowtop.es_utils import initialize_index_and_mapping from testapps.test_pillowtop.utils import process_pillow_changes from corehq.apps.es.tests.utils import es_test from corehq.elastic import get_es_new, send_to_elasticsearch from corehq.form_processor.interfaces.processor import FormProcessorInterface from corehq.form_processor.tests.utils import FormProcessorTestUtils from corehq.form_processor.utils import TestFormMetadata from corehq.pillows.mappings.xform_mapping import XFORM_INDEX_INFO from corehq.util.elastic import ensure_index_deleted from corehq.util.test_utils import ( DocTestMixin, disable_quickcache, get_form_ready_to_save, trap_extra_setup, ) TEST_ES_META = { XFORM_INDEX_INFO.index: XFORM_INDEX_INFO }
40.645455
113
0.674122
b7b2bf3009f886fb399b6a73378d628699d8010a
462
py
Python
src/pythae/models/svae/svae_config.py
eknag/benchmark_VAE
8b727f29a68aff7771c4c97aff15f75f88320e1f
[ "Apache-2.0" ]
1
2022-03-20T20:23:59.000Z
2022-03-20T20:23:59.000Z
src/pythae/models/svae/svae_config.py
eknag/benchmark_VAE
8b727f29a68aff7771c4c97aff15f75f88320e1f
[ "Apache-2.0" ]
null
null
null
src/pythae/models/svae/svae_config.py
eknag/benchmark_VAE
8b727f29a68aff7771c4c97aff15f75f88320e1f
[ "Apache-2.0" ]
null
null
null
from pydantic.dataclasses import dataclass from ...models import VAEConfig
27.176471
99
0.690476
b7b3ac20c4a0978bc24a666dd7cd9ac25c00bc3a
7,486
py
Python
amck/imat/download_data.py
aaronmckinstry706/imaterialist
ebed3f3bd9e231f0852aa30c7bbfafe94d5dbce1
[ "MIT" ]
null
null
null
amck/imat/download_data.py
aaronmckinstry706/imaterialist
ebed3f3bd9e231f0852aa30c7bbfafe94d5dbce1
[ "MIT" ]
null
null
null
amck/imat/download_data.py
aaronmckinstry706/imaterialist
ebed3f3bd9e231f0852aa30c7bbfafe94d5dbce1
[ "MIT" ]
null
null
null
# Parts of code taken from https://www.kaggle.com/aloisiodn/python-3-download-multi-proc-prog-bar-resume by Dourado. # Improvements on the original script: # * you can choose which dataset to download; # * uses threads instead of processes; # * unpacks data into .../label/id.jpg directory structure, which can be used easily via classes in PyTorch; # * performance-relevant parameters are command line arguments. # For performance parameters, the recommended values (from my machine; probably requires tweaking for others) are 100 # connection pools, 128 threads. Not all images with working URLs will be retrieved, but about 90-95% of them will. As # a consequence, to ensure that nearly all images have been downloaded, repeat the script 3-4 times. import argparse import io import json import logging import multiprocessing.pool as pool import pathlib import random import sys import typing import urllib3 import PIL.Image as Image from tqdm import tqdm # Get command line arguments. arg_parser = argparse.ArgumentParser( description='Downloads the data files using the links given in the JSON training, validation, and test files. ' 'Assumes that the files are stored in the directory data/metadata (relative to the current working ' 'directory). Training files will be written to data/training/label_id/image_id.jpg, validation files ' 'will be written to data/validation/label_id/image_id.jpg, and test files will be written to ' 'data/testing/image_id.jpg.') arg_parser.add_argument( '--num-pools', '-p', type=int, default=10, help='Number of connection pools to cache at one time.') arg_parser.add_argument( '--num-workers', '-w', type=int, default=8, help='Number of threads to perform downloads.') arg_parser.add_argument( '--verbose', '-v', action='count', help='Print additional output messages. Can be passed multiple times. Once ' 'prints additional status information, and two or more times prints ' 'debugging information.', default=0) arg_parser.add_argument( '--limit', '-l', type=int, default=sys.maxsize, help='Maximum number of files to download before stopping.') arg_parser.add_argument( '--re-download', action='store_true', default=False, help='Whether to re-download existing files.') arg_parser.add_argument( '--dataset', '-d', type=str, choices={'training', 'validation', 'testing'}, help='Which dataset to download.') parsed_args = arg_parser.parse_args() # Set up logging. urllib3.disable_warnings() LOGGER = logging.getLogger(__name__) STDOUT_HANDLER = logging.StreamHandler(sys.stdout) if parsed_args.verbose == 1: STDOUT_HANDLER.setLevel(logging.INFO) elif parsed_args.verbose >= 2: STDOUT_HANDLER.setLevel(logging.DEBUG) LOGGER.addHandler(STDOUT_HANDLER) LOGGER.setLevel(logging.DEBUG) # Initialize globals. failed_downloads = [] http = urllib3.PoolManager(num_pools=parsed_args.num_pools) training_base_dir = pathlib.Path('data/training') validation_base_dir = pathlib.Path('data/validation') testing_base_dir = pathlib.Path('data/testing') metadata_base_dir = pathlib.Path('data/metadata') with metadata_base_dir.joinpath('train.json').open('r') as training_urls_file: training_urls_json = json.load(training_urls_file) with metadata_base_dir.joinpath('validation.json').open('r') as validation_urls_file: validation_urls_json = json.load(validation_urls_file) with metadata_base_dir.joinpath('test.json').open('r') as testing_urls_file: testing_urls_json = json.load(testing_urls_file) num_training_images = len(training_urls_json['images']) num_validation_images = len(validation_urls_json['images']) num_testing_images = len(testing_urls_json['images']) LOGGER.info('{} training images, {} validation images, and {} testing images.'.format( num_training_images, num_validation_images, num_testing_images)) thread_pool = pool.ThreadPool(processes=parsed_args.num_workers) if parsed_args.dataset == 'training': training_image_info = [] for image_info, annotation_info in zip(training_urls_json['images'], training_urls_json['annotations']): training_image_info.append((image_info['url'][0], image_info['image_id'], annotation_info['label_id'], training_base_dir)) random.shuffle(training_image_info) with tqdm(total=len(training_image_info), desc='Training images') as t: for i, _ in enumerate(thread_pool.imap_unordered(download_labeled_image, training_image_info)): t.update(1) if i >= parsed_args.limit: break elif parsed_args.dataset == 'validation': validation_image_info = [] for image_info, annotation_info in zip(validation_urls_json['images'], validation_urls_json['annotations']): validation_image_info.append((image_info['url'][0], image_info['image_id'], annotation_info['label_id'], validation_base_dir)) random.shuffle(validation_image_info) with tqdm(total=len(validation_image_info), desc='Validation images') as t: for i, _ in enumerate(thread_pool.imap_unordered(download_labeled_image, validation_image_info)): t.update(1) if i >= parsed_args.limit: break elif parsed_args.dataset == 'testing': testing_image_info = [] for image_info in testing_urls_json['images']: testing_image_info.append((image_info['url'][0], image_info['image_id'], testing_base_dir)) random.shuffle(testing_image_info) with tqdm(total=len(testing_image_info), desc='Testing images') as t: for i, _ in enumerate(thread_pool.imap_unordered(download_unlabeled_image, testing_image_info)): t.update(1) if i >= parsed_args.limit: break LOGGER.info('{} images could not be retrieved.'.format(len(failed_downloads)))
41.821229
118
0.716137
b7b473cc7728c8bc405a3042f957fe877f0c27c2
790
py
Python
JTP Recap./2.Program_IO/function.py
SNP0301/Study_Python
bb7ce7a0d915131c281152e7faee5b57c290df6b
[ "MIT" ]
null
null
null
JTP Recap./2.Program_IO/function.py
SNP0301/Study_Python
bb7ce7a0d915131c281152e7faee5b57c290df6b
[ "MIT" ]
null
null
null
JTP Recap./2.Program_IO/function.py
SNP0301/Study_Python
bb7ce7a0d915131c281152e7faee5b57c290df6b
[ "MIT" ]
null
null
null
""" Function def function_name(arg1, arg2, ...) : <op 1> <op 2> ... Function with undefined amount of input def fn_name(*args) --> args' elements make tuple. kwargs = Keyword Parameter >>> def print_kwargs(**kwargs): ... print(kwargs) ... >>> print_kwargs(a=1) {'a':1} >>> print_kwargs(name='foo', age=3) {'age':3, 'name':'foo'} **args_name = make args_name as a dictionary clearing & assignment : element should be added in the last part of args Lambda : another method to make fn lambda arg1, arg2, .. : operation_of_fn >>> add = lambda a,b : a+b >>> result = add(3,4) >>> print(result) 7 lambda can return result with out expression 'return' Contents Source : https://wikidocs.net/24 """
22.571429
72
0.596203
b7b56be6d7b0d5e174db26b106b5f7914f624c31
2,437
py
Python
tweet/common.py
skiwheelr/URS
45746c945af2ea62a5ddb675c6a8e4e2fe4b5a93
[ "MIT" ]
4
2021-02-15T02:02:38.000Z
2022-03-04T16:38:44.000Z
tweet/common.py
skiwheelr/URS
45746c945af2ea62a5ddb675c6a8e4e2fe4b5a93
[ "MIT" ]
null
null
null
tweet/common.py
skiwheelr/URS
45746c945af2ea62a5ddb675c6a8e4e2fe4b5a93
[ "MIT" ]
2
2021-02-11T01:10:27.000Z
2021-02-25T19:20:04.000Z
all import tweepy, config, users, re, groupy from tweepy import OAuthHandler from tweepy import API print(tweepy.__version__) auth = OAuthHandler(config.consumer_key, config.consumer_secret) auth.set_access_token(config.access_token,config.access_token_secret) api = tweepy.API(auth) from groupy.client import Client client = Client.from_token(config.groupme_token) exp = r'\$([A-Z]{3,4})' one = [] two = [] three = [] all = [] #mrzackmorris for user in users.list[:1]: userID = user tweets = api.user_timeline(screen_name=userID,count=100, include_rts = False, tweet_mode='extended') for info in tweets: if re.findall(exp,info.full_text): for ticker in re.findall(exp,info.full_text): if ticker not in one: one.append(ticker) # print(user, " mentioned ", re.findall(exp,info.full_text)) print(user, "mentioned", one) #pharmdca for user in users.list[1:2]: userID = user tweets = api.user_timeline(screen_name=userID,count=100, include_rts = False, tweet_mode='extended') for info in tweets: if re.findall(exp,info.full_text): for ticker in re.findall(exp,info.full_text): if ticker not in two: two.append(ticker) # print(user, " mentioned ", re.findall(exp,info.full_text)) print(user, "mentioned", two) #ripster47 for user in users.list[2:3]: userID = user tweets = api.user_timeline(screen_name=userID,count=100, include_rts = False, tweet_mode='extended') for info in tweets: if re.findall(exp,info.full_text): for ticker in re.findall(exp,info.full_text): if ticker not in three: three.append(ticker) # print(user, " mentioned ", re.findall(exp,info.full_text)) print(user, "mentioned", three) a_set = set(one) b_set = set(two) c_set = set(three) if (a_set & b_set & c_set): all.append(a_set & b_set & c_set) print("All 3 mentioned ", all) messenger(all) else: print("Nothing Notable")
33.847222
120
0.636849
b7b6119291ad7a11b8a2999460f70e3f10db60c8
8,486
py
Python
crystalpy/examples/PlotData1D.py
oasys-kit/crystalpy
4852851c622ef914844178577dea4075e92cd8dd
[ "MIT" ]
null
null
null
crystalpy/examples/PlotData1D.py
oasys-kit/crystalpy
4852851c622ef914844178577dea4075e92cd8dd
[ "MIT" ]
null
null
null
crystalpy/examples/PlotData1D.py
oasys-kit/crystalpy
4852851c622ef914844178577dea4075e92cd8dd
[ "MIT" ]
null
null
null
""" ---OK--- """ from collections import OrderedDict import copy import numpy as np from crystalpy.examples.Values import Interval
32.389313
111
0.582371
b7b6ad2f30eeeef89f8be32e1b423aba5b40b98c
51
py
Python
src/deep_dialog/usersims/__init__.py
Yuqing2018/tcbot_python3
583ce1b670f7c67669ff437e69eb09832e784da6
[ "MIT" ]
null
null
null
src/deep_dialog/usersims/__init__.py
Yuqing2018/tcbot_python3
583ce1b670f7c67669ff437e69eb09832e784da6
[ "MIT" ]
null
null
null
src/deep_dialog/usersims/__init__.py
Yuqing2018/tcbot_python3
583ce1b670f7c67669ff437e69eb09832e784da6
[ "MIT" ]
null
null
null
from .usersim_rule import * from .realUser import *
25.5
27
0.784314
b7b6cb22cdbe422b0a500a1606789a7d83af799b
38,534
py
Python
hs_file_types/models/geofeature.py
tommac7/hydroshare
87c4543a55f98103d2614bf4c47f7904c3f9c029
[ "BSD-3-Clause" ]
null
null
null
hs_file_types/models/geofeature.py
tommac7/hydroshare
87c4543a55f98103d2614bf4c47f7904c3f9c029
[ "BSD-3-Clause" ]
null
null
null
hs_file_types/models/geofeature.py
tommac7/hydroshare
87c4543a55f98103d2614bf4c47f7904c3f9c029
[ "BSD-3-Clause" ]
null
null
null
import os import logging import shutil import zipfile import xmltodict from lxml import etree from osgeo import ogr, osr from django.core.exceptions import ValidationError from django.db import models, transaction from django.utils.html import strip_tags from django.template import Template, Context from dominate.tags import legend, table, tbody, tr, th, div from hs_core.models import Title, CoreMetaData from hs_core.hydroshare import utils from hs_core.forms import CoverageTemporalForm from hs_core.signals import post_add_geofeature_aggregation from hs_geographic_feature_resource.models import GeographicFeatureMetaDataMixin, \ OriginalCoverage, GeometryInformation, FieldInformation from base import AbstractFileMetaData, AbstractLogicalFile, FileTypeContext UNKNOWN_STR = "unknown" def extract_metadata_and_files(resource, res_file, file_type=True): """ validates shape files and extracts metadata :param resource: an instance of BaseResource :param res_file: an instance of ResourceFile :param file_type: A flag to control if extraction being done for file type or resource type :return: a dict of extracted metadata, a list file paths of shape related files on the temp directory, a list of resource files retrieved from iRODS for this processing """ shape_files, shp_res_files = get_all_related_shp_files(resource, res_file, file_type=file_type) temp_dir = os.path.dirname(shape_files[0]) if not _check_if_shape_files(shape_files): if res_file.extension.lower() == '.shp': err_msg = "There was a problem parsing the component files associated with " \ "{folder_path} as a geographic shapefile. This may be because a component " \ "file is corrupt or missing. The .shp, .shx, and .dbf shapefile component " \ "files are required. Other shapefile component files " \ "(.cpg, .prj, .sbn, .sbx, .xml, .fbn, .fbx, .ain, .aih, .atx, .ixs, .mxs) " \ "should also be added where available." err_msg = err_msg.format(folder_path=res_file.short_path) else: err_msg = "One or more dependent shape files are missing in the selected zip file " \ "or one or more files are not of shape file type." if os.path.isdir(temp_dir): shutil.rmtree(temp_dir) raise ValidationError(err_msg) shp_file = '' for f in shape_files: if f.lower().endswith('.shp'): shp_file = f break try: meta_dict = extract_metadata(shp_file_full_path=shp_file) return meta_dict, shape_files, shp_res_files except Exception as ex: # remove temp dir if os.path.isdir(temp_dir): shutil.rmtree(temp_dir) if file_type: msg = "GeoFeature file type. Error when setting file type. Error:{}" else: msg = "Failed to parse the .shp file. Error{}" msg = msg.format(ex.message) raise ValidationError(msg) def add_metadata(resource, metadata_dict, xml_file, logical_file=None): """ creates/updates metadata at resource and file level :param resource: an instance of BaseResource :param metadata_dict: dict containing extracted metadata :param xml_file: file path (on temp directory) of the xml file that is part of the geo feature files :param logical_file: an instance of GeoFeatureLogicalFile if metadata needs to be part of the logical file :return: """ # populate resource and logical file level metadata target_obj = logical_file if logical_file is not None else resource if "coverage" in metadata_dict.keys(): coverage_dict = metadata_dict["coverage"]['Coverage'] target_obj.metadata.coverages.all().filter(type='box').delete() target_obj.metadata.create_element('coverage', type=coverage_dict['type'], value=coverage_dict['value']) originalcoverage_dict = metadata_dict["originalcoverage"]['originalcoverage'] if target_obj.metadata.originalcoverage is not None: target_obj.metadata.originalcoverage.delete() target_obj.metadata.create_element('originalcoverage', **originalcoverage_dict) field_info_array = metadata_dict["field_info_array"] target_obj.metadata.fieldinformations.all().delete() for field_info in field_info_array: field_info_dict = field_info["fieldinformation"] target_obj.metadata.create_element('fieldinformation', **field_info_dict) geometryinformation_dict = metadata_dict["geometryinformation"] if target_obj.metadata.geometryinformation is not None: target_obj.metadata.geometryinformation.delete() target_obj.metadata.create_element('geometryinformation', **geometryinformation_dict) if xml_file: shp_xml_metadata_list = parse_shp_xml(xml_file) for shp_xml_metadata in shp_xml_metadata_list: if 'description' in shp_xml_metadata: # overwrite existing description metadata - at the resource level if not resource.metadata.description: abstract = shp_xml_metadata['description']['abstract'] resource.metadata.create_element('description', abstract=abstract) elif 'title' in shp_xml_metadata: title = shp_xml_metadata['title']['value'] title_element = resource.metadata.title if title_element.value.lower() == 'untitled resource': resource.metadata.update_element('title', title_element.id, value=title) if logical_file is not None: logical_file.dataset_name = title logical_file.save() elif 'subject' in shp_xml_metadata: # append new keywords to existing keywords - at the resource level existing_keywords = [subject.value.lower() for subject in resource.metadata.subjects.all()] keyword = shp_xml_metadata['subject']['value'] if keyword.lower() not in existing_keywords: resource.metadata.create_element('subject', value=keyword) # add keywords at the logical file level if logical_file is not None: if keyword not in logical_file.metadata.keywords: logical_file.metadata.keywords += [keyword] logical_file.metadata.save() def get_all_related_shp_files(resource, selected_resource_file, file_type): """ This helper function copies all the related shape files to a temp directory and return a list of those temp file paths as well as a list of existing related resource file objects :param resource: an instance of BaseResource to which the *selecetd_resource_file* belongs :param selected_resource_file: an instance of ResourceFile selected by the user to set GeoFeaureFile type (the file must be a .shp or a .zip file) :param file_type: a flag (True/False) to control resource VS file type actions :return: a list of temp file paths for all related shape files, and a list of corresponding resource file objects """ shape_temp_files = [] shape_res_files = [] temp_dir = '' if selected_resource_file.extension.lower() == '.shp': for f in resource.files.all(): if f.file_folder == selected_resource_file.file_folder: if f.extension.lower() == '.xml' and not f.file_name.lower().endswith('.shp.xml'): continue if f.extension.lower() in GeoFeatureLogicalFile.get_allowed_storage_file_types(): collect_shape_resource_files(f) for f in shape_res_files: temp_file = utils.get_file_from_irods(f) if not temp_dir: temp_dir = os.path.dirname(temp_file) else: file_temp_dir = os.path.dirname(temp_file) dst_dir = os.path.join(temp_dir, os.path.basename(temp_file)) shutil.copy(temp_file, dst_dir) shutil.rmtree(file_temp_dir) temp_file = dst_dir shape_temp_files.append(temp_file) elif selected_resource_file.extension.lower() == '.zip': temp_file = utils.get_file_from_irods(selected_resource_file) temp_dir = os.path.dirname(temp_file) if not zipfile.is_zipfile(temp_file): if os.path.isdir(temp_dir): shutil.rmtree(temp_dir) raise ValidationError('Selected file is not a zip file') zf = zipfile.ZipFile(temp_file, 'r') zf.extractall(temp_dir) zf.close() for dirpath, _, filenames in os.walk(temp_dir): for name in filenames: if name == selected_resource_file.file_name: # skip the user selected zip file continue file_path = os.path.abspath(os.path.join(dirpath, name)) shape_temp_files.append(file_path) shape_res_files.append(selected_resource_file) return shape_temp_files, shape_res_files def _check_if_shape_files(files, temp_files=True): """ checks if the list of file temp paths in *files* are part of shape files must have all these file extensions: (shp, shx, dbf) :param files: list of files located in temp directory in django if temp_file is True, otherwise list of resource files are from django db :param temp_files: a flag to treat list of files *files* as temp files or not :return: True/False """ # Note: this is the original function (check_fn_for_shp) in geo feature resource receivers.py # used by is_shapefiles # at least needs to have 3 mandatory files: shp, shx, dbf if len(files) >= 3: # check that there are no files with same extension if temp_files: # files are on temp directory file_extensions = set([os.path.splitext(os.path.basename(f).lower())[1] for f in files]) else: # files are in db file_extensions = set([f.extension.lower() for f in files]) if len(file_extensions) != len(files): return False # check if there is the xml file xml_file = '' for f in files: if temp_files: # files are on temp directory if f.lower().endswith('.shp.xml'): xml_file = f else: # files are in db if f.file_name.lower().endswith('.shp.xml'): xml_file = f if temp_files: # files are on temp directory file_names = set([os.path.splitext(os.path.basename(f))[0] for f in files if not f.lower().endswith('.shp.xml')]) else: # files are in db file_names = set([os.path.splitext(os.path.basename(f.file_name))[0] for f in files if not f.file_name.lower().endswith('.shp.xml')]) if len(file_names) > 1: # file names are not the same return False # check if xml file name matches with other file names if xml_file: # -8 for '.shp.xml' if temp_files: # files are on temp directory xml_file_name = os.path.basename(xml_file) else: # files are in db xml_file_name = xml_file.file_name if xml_file_name[:-8] not in file_names: return False for ext in file_extensions: if ext not in GeoFeatureLogicalFile.get_allowed_storage_file_types(): return False for ext in ('.shp', '.shx', '.dbf'): if ext not in file_extensions: return False else: return False # test if we can open the shp file if temp_files: # files are on temp directory shp_file = [f for f in files if f.lower().endswith('.shp')][0] driver = ogr.GetDriverByName('ESRI Shapefile') dataset = driver.Open(shp_file) if dataset is None: return False dataset = None return True def extract_metadata(shp_file_full_path): """ Collects metadata from a .shp file specified by *shp_file_full_path* :param shp_file_full_path: :return: returns a dict of collected metadata """ try: metadata_dict = {} # wgs84 extent parsed_md_dict = parse_shp(shp_file_full_path) if parsed_md_dict["wgs84_extent_dict"]["westlimit"] != UNKNOWN_STR: wgs84_dict = parsed_md_dict["wgs84_extent_dict"] # if extent is a point, create point type coverage if wgs84_dict["westlimit"] == wgs84_dict["eastlimit"] \ and wgs84_dict["northlimit"] == wgs84_dict["southlimit"]: coverage_dict = {"Coverage": {"type": "point", "value": { "east": wgs84_dict["eastlimit"], "north": wgs84_dict["northlimit"], "units": wgs84_dict["units"], "projection": wgs84_dict["projection"] }}} else: # otherwise, create box type coverage coverage_dict = {"Coverage": {"type": "box", "value": parsed_md_dict["wgs84_extent_dict"]}} metadata_dict["coverage"] = coverage_dict # original extent original_coverage_dict = {} original_coverage_dict["originalcoverage"] = {"northlimit": parsed_md_dict ["origin_extent_dict"]["northlimit"], "southlimit": parsed_md_dict ["origin_extent_dict"]["southlimit"], "westlimit": parsed_md_dict ["origin_extent_dict"]["westlimit"], "eastlimit": parsed_md_dict ["origin_extent_dict"]["eastlimit"], "projection_string": parsed_md_dict ["origin_projection_string"], "projection_name": parsed_md_dict["origin_projection_name"], "datum": parsed_md_dict["origin_datum"], "unit": parsed_md_dict["origin_unit"] } metadata_dict["originalcoverage"] = original_coverage_dict # field field_info_array = [] field_name_list = parsed_md_dict["field_meta_dict"]['field_list'] for field_name in field_name_list: field_info_dict_item = {} field_info_dict_item['fieldinformation'] = \ parsed_md_dict["field_meta_dict"]["field_attr_dict"][field_name] field_info_array.append(field_info_dict_item) metadata_dict['field_info_array'] = field_info_array # geometry geometryinformation = {"featureCount": parsed_md_dict["feature_count"], "geometryType": parsed_md_dict["geometry_type"]} metadata_dict["geometryinformation"] = geometryinformation return metadata_dict except: raise ValidationError("Parsing of shapefiles failed!") def parse_shp(shp_file_path): """ :param shp_file_path: full file path fo the .shp file output dictionary format shp_metadata_dict["origin_projection_string"]: original projection string shp_metadata_dict["origin_projection_name"]: origin_projection_name shp_metadata_dict["origin_datum"]: origin_datum shp_metadata_dict["origin_unit"]: origin_unit shp_metadata_dict["field_meta_dict"]["field_list"]: list [fieldname1, fieldname2...] shp_metadata_dict["field_meta_dict"]["field_attr_dic"]: dict {"fieldname": dict { "fieldName":fieldName, "fieldTypeCode":fieldTypeCode, "fieldType":fieldType, "fieldWidth:fieldWidth, "fieldPrecision:fieldPrecision" } } shp_metadata_dict["feature_count"]: feature count shp_metadata_dict["geometry_type"]: geometry_type shp_metadata_dict["origin_extent_dict"]: dict{"west": east, "north":north, "east":east, "south":south} shp_metadata_dict["wgs84_extent_dict"]: dict{"west": east, "north":north, "east":east, "south":south} """ shp_metadata_dict = {} # read shapefile driver = ogr.GetDriverByName('ESRI Shapefile') dataset = driver.Open(shp_file_path) # get layer layer = dataset.GetLayer() # get spatialRef from layer spatialRef_from_layer = layer.GetSpatialRef() if spatialRef_from_layer is not None: shp_metadata_dict["origin_projection_string"] = str(spatialRef_from_layer) prj_name = spatialRef_from_layer.GetAttrValue('projcs') if prj_name is None: prj_name = spatialRef_from_layer.GetAttrValue('geogcs') shp_metadata_dict["origin_projection_name"] = prj_name shp_metadata_dict["origin_datum"] = spatialRef_from_layer.GetAttrValue('datum') shp_metadata_dict["origin_unit"] = spatialRef_from_layer.GetAttrValue('unit') else: shp_metadata_dict["origin_projection_string"] = UNKNOWN_STR shp_metadata_dict["origin_projection_name"] = UNKNOWN_STR shp_metadata_dict["origin_datum"] = UNKNOWN_STR shp_metadata_dict["origin_unit"] = UNKNOWN_STR field_list = [] filed_attr_dic = {} field_meta_dict = {"field_list": field_list, "field_attr_dict": filed_attr_dic} shp_metadata_dict["field_meta_dict"] = field_meta_dict # get Attributes layerDefinition = layer.GetLayerDefn() for i in range(layerDefinition.GetFieldCount()): fieldName = layerDefinition.GetFieldDefn(i).GetName() field_list.append(fieldName) attr_dict = {} field_meta_dict["field_attr_dict"][fieldName] = attr_dict attr_dict["fieldName"] = fieldName fieldTypeCode = layerDefinition.GetFieldDefn(i).GetType() attr_dict["fieldTypeCode"] = fieldTypeCode fieldType = layerDefinition.GetFieldDefn(i).GetFieldTypeName(fieldTypeCode) attr_dict["fieldType"] = fieldType fieldWidth = layerDefinition.GetFieldDefn(i).GetWidth() attr_dict["fieldWidth"] = fieldWidth fieldPrecision = layerDefinition.GetFieldDefn(i).GetPrecision() attr_dict["fieldPrecision"] = fieldPrecision # get layer extent layer_extent = layer.GetExtent() # get feature count featureCount = layer.GetFeatureCount() shp_metadata_dict["feature_count"] = featureCount # get a feature from layer feature = layer.GetNextFeature() # get geometry from feature geom = feature.GetGeometryRef() # get geometry name shp_metadata_dict["geometry_type"] = geom.GetGeometryName() # reproject layer extent # source SpatialReference source = spatialRef_from_layer # target SpatialReference target = osr.SpatialReference() target.ImportFromEPSG(4326) # create two key points from layer extent left_upper_point = ogr.Geometry(ogr.wkbPoint) left_upper_point.AddPoint(layer_extent[0], layer_extent[3]) # left-upper right_lower_point = ogr.Geometry(ogr.wkbPoint) right_lower_point.AddPoint(layer_extent[1], layer_extent[2]) # right-lower # source map always has extent, even projection is unknown shp_metadata_dict["origin_extent_dict"] = {} shp_metadata_dict["origin_extent_dict"]["westlimit"] = layer_extent[0] shp_metadata_dict["origin_extent_dict"]["northlimit"] = layer_extent[3] shp_metadata_dict["origin_extent_dict"]["eastlimit"] = layer_extent[1] shp_metadata_dict["origin_extent_dict"]["southlimit"] = layer_extent[2] # reproject to WGS84 shp_metadata_dict["wgs84_extent_dict"] = {} if source is not None: # define CoordinateTransformation obj transform = osr.CoordinateTransformation(source, target) # project two key points left_upper_point.Transform(transform) right_lower_point.Transform(transform) shp_metadata_dict["wgs84_extent_dict"]["westlimit"] = left_upper_point.GetX() shp_metadata_dict["wgs84_extent_dict"]["northlimit"] = left_upper_point.GetY() shp_metadata_dict["wgs84_extent_dict"]["eastlimit"] = right_lower_point.GetX() shp_metadata_dict["wgs84_extent_dict"]["southlimit"] = right_lower_point.GetY() shp_metadata_dict["wgs84_extent_dict"]["projection"] = "WGS 84 EPSG:4326" shp_metadata_dict["wgs84_extent_dict"]["units"] = "Decimal degrees" else: shp_metadata_dict["wgs84_extent_dict"]["westlimit"] = UNKNOWN_STR shp_metadata_dict["wgs84_extent_dict"]["northlimit"] = UNKNOWN_STR shp_metadata_dict["wgs84_extent_dict"]["eastlimit"] = UNKNOWN_STR shp_metadata_dict["wgs84_extent_dict"]["southlimit"] = UNKNOWN_STR shp_metadata_dict["wgs84_extent_dict"]["projection"] = UNKNOWN_STR shp_metadata_dict["wgs84_extent_dict"]["units"] = UNKNOWN_STR return shp_metadata_dict def parse_shp_xml(shp_xml_full_path): """ Parse ArcGIS 10.X ESRI Shapefile Metadata XML. file to extract metadata for the following elements: title abstract keywords :param shp_xml_full_path: Expected fullpath to the .shp.xml file :return: a list of metadata dict """ metadata = [] try: if os.path.isfile(shp_xml_full_path): with open(shp_xml_full_path) as fd: xml_dict = xmltodict.parse(fd.read()) dataIdInfo_dict = xml_dict['metadata']['dataIdInfo'] if 'idCitation' in dataIdInfo_dict: if 'resTitle' in dataIdInfo_dict['idCitation']: if '#text' in dataIdInfo_dict['idCitation']['resTitle']: title_value = dataIdInfo_dict['idCitation']['resTitle']['#text'] else: title_value = dataIdInfo_dict['idCitation']['resTitle'] title_max_length = Title._meta.get_field('value').max_length if len(title_value) > title_max_length: title_value = title_value[:title_max_length-1] title = {'title': {'value': title_value}} metadata.append(title) if 'idAbs' in dataIdInfo_dict: description_value = strip_tags(dataIdInfo_dict['idAbs']) description = {'description': {'abstract': description_value}} metadata.append(description) if 'searchKeys' in dataIdInfo_dict: searchKeys_dict = dataIdInfo_dict['searchKeys'] if 'keyword' in searchKeys_dict: keyword_list = [] if type(searchKeys_dict["keyword"]) is list: keyword_list += searchKeys_dict["keyword"] else: keyword_list.append(searchKeys_dict["keyword"]) for k in keyword_list: metadata.append({'subject': {'value': k}}) except Exception: # Catch any exception silently and return an empty list # Due to the variant format of ESRI Shapefile Metadata XML # among different ArcGIS versions, an empty list will be returned # if any exception occurs metadata = [] finally: return metadata
44.547977
100
0.61338
b7b9397bbe8da7007b207fc6a20f4e6b29704b5a
1,313
py
Python
tests/test_node.py
mjholtkamp/py-iptree
97025f03247dbc91424898fd28f7be1448d5fce5
[ "Apache-2.0" ]
null
null
null
tests/test_node.py
mjholtkamp/py-iptree
97025f03247dbc91424898fd28f7be1448d5fce5
[ "Apache-2.0" ]
null
null
null
tests/test_node.py
mjholtkamp/py-iptree
97025f03247dbc91424898fd28f7be1448d5fce5
[ "Apache-2.0" ]
null
null
null
import unittest from iptree import IPNode
28.543478
62
0.552932
b7b981be89ff3733793d9540e9d6338ff12dd2df
208
py
Python
Codewars/8kyu/invert-values/Python/test.py
RevansChen/online-judge
ad1b07fee7bd3c49418becccda904e17505f3018
[ "MIT" ]
7
2017-09-20T16:40:39.000Z
2021-08-31T18:15:08.000Z
Codewars/8kyu/invert-values/Python/test.py
RevansChen/online-judge
ad1b07fee7bd3c49418becccda904e17505f3018
[ "MIT" ]
null
null
null
Codewars/8kyu/invert-values/Python/test.py
RevansChen/online-judge
ad1b07fee7bd3c49418becccda904e17505f3018
[ "MIT" ]
null
null
null
# Python - 3.4.3 Test.it('Basic Tests') Test.assert_equals(invert([1, 2, 3, 4, 5]), [-1, -2, -3, -4, -5]) Test.assert_equals(invert([1, -2, 3, -4, 5]), [-1, 2, -3, 4, -5]) Test.assert_equals(invert([]), [])
29.714286
65
0.548077
b7ba3cc002a49b7880bf396084b5e2214c7d5cdf
1,239
py
Python
locustfile_create_order.py
Ashutosh-Kaushik/ss-load-test-locust
286e3cecad39f5ce991717e117392332a9810d64
[ "Apache-2.0" ]
1
2022-03-31T05:34:33.000Z
2022-03-31T05:34:33.000Z
locustfile_create_order.py
Ashutosh-Kaushik/ss-load-test-locust
286e3cecad39f5ce991717e117392332a9810d64
[ "Apache-2.0" ]
null
null
null
locustfile_create_order.py
Ashutosh-Kaushik/ss-load-test-locust
286e3cecad39f5ce991717e117392332a9810d64
[ "Apache-2.0" ]
null
null
null
import csv import random import warnings import os from locust import HttpUser, task, between body = { "campaignid":"5kXk20gGDISJdM5el5IT", "walletamount":"0" } header = { "Host": "fkhapi.sastasundar.com", "Apptype": "N", "Appversion": "4.0.4", "Appversioncode": "109", "Deviceid": "81653dce-0dd2-4201-8916-4aecbdd89269", "Devicedensity": "320", "Devicedensitytype": "xhdpi", "Deviceheight": "1184", "Devicewidth": "768", "Devicename": "Unknown Google Nexus 4", "Deviceosinfo": "5.1", "Networkinfo": "Wifi", "Accesstoken": "PDWZ5pStjE", "Refdeviceid": "4dd29c0f2f8d1842", "Userid": "4937724", "Pincode": "700120", "Is_panindia": "0", "Warehouse_id": "1", "Content-Type": "application/json", "Content-Length": "56", "Accept-Encoding": "gzip, deflate", "User-Agent": "okhttp/5.0.0-alpha.2" }
25.8125
88
0.637611
b7bae45b9bc9f5897fbcca4960ef6f0a8e4b7699
1,358
py
Python
compy/plot/grid.py
tilleyd/compy
b63188341d0c66c0ecd810e29918e569c519b296
[ "MIT" ]
null
null
null
compy/plot/grid.py
tilleyd/compy
b63188341d0c66c0ecd810e29918e569c519b296
[ "MIT" ]
null
null
null
compy/plot/grid.py
tilleyd/compy
b63188341d0c66c0ecd810e29918e569c519b296
[ "MIT" ]
null
null
null
"""Contains the grid class to create multiple figures.""" from typing import Optional, Tuple from .figure import Figure import matplotlib.gridspec as gridspec import matplotlib.pyplot as plt
29.521739
78
0.581001
b7bb34b596fa5c54c79635a6e0d79f862d482ebf
30,005
py
Python
parallel_accel/shared/parallel_accel/shared/schemas/external.py
google/parallel_accel
b58fda1c3a22f2aaa9a97337d602cd72c49ee8be
[ "Apache-2.0" ]
1
2021-12-19T21:17:02.000Z
2021-12-19T21:17:02.000Z
parallel_accel/shared/parallel_accel/shared/schemas/external.py
google/parallel_accel
b58fda1c3a22f2aaa9a97337d602cd72c49ee8be
[ "Apache-2.0" ]
null
null
null
parallel_accel/shared/parallel_accel/shared/schemas/external.py
google/parallel_accel
b58fda1c3a22f2aaa9a97337d602cd72c49ee8be
[ "Apache-2.0" ]
null
null
null
# Copyright 2021 The ParallelAccel Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== """This module provides types definitions.""" import dataclasses import enum import json import time from typing import Any, Dict, List, Optional, Union import uuid import linear_algebra import marshmallow import marshmallow_dataclass import marshmallow_enum ##################################### # Utility functions # ##################################### def decode( schema: marshmallow.Schema, data: str, **kwargs ) -> dataclasses.dataclass: """Decodes input string using provided schema. Args: schema: Schema to be used for deserialization. data: JSON-encoded data to be deserialized. **kwargs: Extra keyworded arguments to be passed to `marshmallow.Schemas.loads` method. Returns: Deserialized `dataclasses.dataclass` object. """ return schema.loads(data, **kwargs) def encode( schema: marshmallow.Schema, data: dataclasses.dataclass, **kwargs ) -> str: """Encodes input data using provided schema. Args: schema: Schema to be used for serialization. data: Dataclass object to be serialized. **kwargs: Extra keyworded arguments to be passed to `marshmallow.Schemas.dumps` method. Returns: JSON-encoded serialized data. """ return schema.dumps(data, separators=(",", ":"), **kwargs) ##################################### # Types aliases # ##################################### OperatorsType = List[linear_algebra.ops.ProbBasisAxisSum] ##################################### # marshmallow helpers # ##################################### _SerializedLinearAlgebraObject = Dict[str, Any] _SerializedProbBasisAxisSums = List[List[Dict[str, Any]]] # `linear_algebra` offers only functions to dump and load objects from the JSON encoded # string, and does not support builtin dict objects. When we call json.dumps() # over already JSON encoded string, all quotation marks and brackets are # prefixed with the backslash. Instead, we can convert JSON object to the dict # type and reduce serialized object size. def _deserialize_linear_algebra_object(data: _SerializedLinearAlgebraObject) -> Any: """Deserializes linear_algebra object from dict type. Since `linear_algebra` does not provide function to load objects from builtin dict objects, we need some workaround here: first we dump the dict object into JSON encoded string, then parse them into `linear_algebra` object. Args: data: Dict encoded linear_algebra object. Returns: Deserialized linear_algebra object. """ return linear_algebra.read_json(json_text=json.dumps(data)) def _serialize_linear_algebra_object(obj: Any) -> _SerializedLinearAlgebraObject: """Serializes linear_algebra object to dict type. Since `linear_algebra` does not provide function to dump objects into builtin dict objects, we need some workaround here: first we dump the `linear_algebra` object into JSON encoded string, then parsing them into dict object. Args: data: linear_algebra object to be encoded. Returns: Serialized linear_algebra object. """ return json.loads(linear_algebra.to_json(obj)) Graph = marshmallow_dataclass.NewType( "Graph", linear_algebra.Graph, field=_LinearAlgebraField ) Operators = marshmallow_dataclass.NewType( "Operators", OperatorsType, field=_OperatorsField ) ParamResolver = marshmallow_dataclass.NewType( "ParamResolver", linear_algebra.ParamResolver, field=_LinearAlgebraField ) Result = marshmallow_dataclass.NewType("Result", linear_algebra.Result, field=_LinearAlgebraField) Sweepable = marshmallow_dataclass.NewType( "Sweepable", linear_algebra.study.Sweepable, field=_LinearAlgebraField ) ##################################### # Server side events # ##################################### ##################################### # API relevant types # ##################################### ##################################### # Jobs relevant types # ##################################### class JobStatus(enum.IntEnum): """Current job status. Attributes: NOT_STARTED: The job was added to the queue. IN_PROGRESS: The job is being processed. COMPLETE: Simulation has been completed successfully. ERROR: Simulation has failed. """ NOT_STARTED = 0 IN_PROGRESS = 1 COMPLETE = 2 ERROR = 3 ##################################### # Expectation job relevant types # ##################################### ######################################## # Noisy expectation job relevant types # ######################################## ##################################### # Sample job relevant types # ##################################### ##################################### # Jobs queue relevant types # ##################################### class JobType(enum.IntEnum): """Simulation job type. Attributes: SAMPLE: Sampling. EXPECTATION: Expectation values. NOISY_EXPECTATION: Noisy expectation values. """ SAMPLE = 0 EXPECTATION = 1 NOISY_EXPECTATION = 2 ##################################### # Tasks relevant types # ##################################### class TaskState(enum.IntEnum): """Current task state. Attributes: PENDING: Task is scheduled for execution. RUNNING: Task is running. DONE: Task is finished. """ PENDING = 0 RUNNING = 1 DONE = 2 ##################################### # Worker relevant types # ##################################### class WorkerState(enum.IntEnum): """ASIC worker state. Attributes: BOOTING: Worker is booting. ERROR: Worker encountered an error. IDLE: Worker is idling. OFFLINE: Worker is offline. PROCESSING_JOB: Worker is processing a job. SHUTTING_DOWN: Worker is shutting down. """ OFFLINE = 0 BOOTING = 1 SHUTTING_DOWN = 2 IDLE = 3 PROCESSING_JOB = 4 ERROR = 5 ##################################### # marshmallow schemas # ##################################### class _SSERenderer: """A helper class for serializing and deserializing objects to server side events message format. The server side event message is UTF-8 text data separated by a pair of newline characters. """ ( APIErrorSchema, ExpectationBatchJobContextSchema, ExpectationBatchJobResultSchema, ExpectationJobContextSchema, ExpectationJobResultSchema, ExpectationJobStatusEventSchema, ExpectationSweepJobContextSchema, ExpectationSweepJobResultSchema, JobProgressSchema, JobResultSchema, JobStatusEventSchema, JobSubmittedSchema, JobsQueueSchema, NoisyExpectationJobContextSchema, NoisyExpectationJobResultSchema, NoisyExpectationJobStatusEventSchema, PendingJobSchema, SampleBatchJobContextSchema, SampleBatchJobResultSchema, SampleJobContextSchema, SampleJobResultSchema, SampleJobStatusEventSchema, SampleSweepJobContextSchema, SampleSweepJobResultSchema, ServerSideEventSchema, StreamTimeoutEventSchema, TaskStatusEventSchema, TaskStatusSchema, TaskSubmittedSchema, WorkerSchema, ) = tuple( marshmallow_dataclass.class_schema(x, base_schema=y)() for x, y in ( (APIError, None), (ExpectationBatchJobContext, None), (ExpectationBatchJobResult, _BaseSchema), (ExpectationJobContext, None), (ExpectationJobResult, _BaseSchema), (ExpectationJobStatusEvent, _SSEBaseSchema), (ExpectationSweepJobContext, None), (ExpectationSweepJobResult, _BaseSchema), (JobProgress, None), (JobResult, _BaseSchema), (JobStatusEvent, _SSEBaseSchema), (JobSubmitted, None), (JobsQueue, None), (NoisyExpectationJobContext, None), (NoisyExpectationJobResult, _BaseSchema), (NoisyExpectationJobStatusEvent, _SSEBaseSchema), (PendingJob, None), (SampleBatchJobContext, None), (SampleBatchJobResult, _BaseSchema), (SampleJobContext, None), (SampleJobResult, _BaseSchema), (SampleJobStatusEvent, _SSEBaseSchema), (SampleSweepJobContext, None), (SampleSweepJobResult, _BaseSchema), (ServerSideEvent, _SSEBaseSchema), (StreamTimeoutEvent, _SSEBaseSchema), (TaskStatusEvent, _SSEBaseSchema), (TaskStatus, _BaseSchema), (TaskSubmitted, None), (Worker, _BaseSchema), ) )
28.549001
113
0.627629
b7bb41a1d668770a899b52a1a2113000001bd07c
1,040
py
Python
godot-toolkit/godot_config_file.py
WiggleWizard/godot-toolkit
e17b7666ed80e3ab25ee65c43eb1ba9b13634070
[ "MIT" ]
null
null
null
godot-toolkit/godot_config_file.py
WiggleWizard/godot-toolkit
e17b7666ed80e3ab25ee65c43eb1ba9b13634070
[ "MIT" ]
null
null
null
godot-toolkit/godot_config_file.py
WiggleWizard/godot-toolkit
e17b7666ed80e3ab25ee65c43eb1ba9b13634070
[ "MIT" ]
null
null
null
try: from configparser import RawConfigParser except ImportError: from ConfigParser import RawConfigParser
41.6
79
0.5
b7bd5a3b425952bf3f2c75d16b604d8c223988c4
683
py
Python
DMOJ/CCC/escape room.py
eddiegz/Personal-C
f7869826216e5c665f8f646502141f0dc680e545
[ "MIT" ]
3
2021-05-15T08:18:09.000Z
2021-05-17T04:41:57.000Z
DMOJ/CCC/escape room.py
eddiegz/Personal-C
f7869826216e5c665f8f646502141f0dc680e545
[ "MIT" ]
null
null
null
DMOJ/CCC/escape room.py
eddiegz/Personal-C
f7869826216e5c665f8f646502141f0dc680e545
[ "MIT" ]
null
null
null
import collections m=int(input()) n=int(input()) grid=[] for i in range(m): grid.append(list(map(int,input().split()))) factor=collections.defaultdict(list) print('yes' if dfs(0, 0) else 'no')
22.032258
58
0.513909
b7bd809bb95458cc851905998de0d036112332ab
2,556
py
Python
volume_loader.py
xeTaiz/deep-volumetric-ambient-occlusion
8492ad957f1440d5bf93139f7cf9ee4c7997b0e2
[ "MIT" ]
9
2020-08-24T20:03:17.000Z
2022-02-17T07:38:55.000Z
volume_loader.py
xeTaiz/deep-volumetric-ambient-occlusion
8492ad957f1440d5bf93139f7cf9ee4c7997b0e2
[ "MIT" ]
null
null
null
volume_loader.py
xeTaiz/deep-volumetric-ambient-occlusion
8492ad957f1440d5bf93139f7cf9ee4c7997b0e2
[ "MIT" ]
1
2021-07-12T01:39:24.000Z
2021-07-12T01:39:24.000Z
import os import pydicom import numpy as np import dicom_numpy from utils import hidden_errors from tf_utils import * from pathlib import Path def read_dicom_folder(dicom_folder, rescale=None): ''' Reads all .dcm files in `dicom_folder` and merges them to one volume Returns: The volume and the affine transformation from pixel indices to xyz coordinates ''' dss = [pydicom.dcmread(str(dicom_folder/dcm)) for dcm in os.listdir(dicom_folder) if dcm.endswith('.dcm')] vol, mat = dicom_numpy.combine_slices(dss, rescale) return vol, dss[0] def get_largest_dir(dirs, minsize=100): ''' Returns the dir with the most files from `dirs`''' m = max(dirs, key=lambda d: len(os.listdir(d)) if os.path.isdir(d) else 0) if len(os.listdir(m)) >= minsize: return m else: return None __all__ = ['read_dicom_folder', 'get_largest_dir', 'get_volume_gen', 'get_volume_dirs']
44.068966
127
0.620892
b7c03a0cfc79b571a75dfb907cc43fbd5d0b1bf0
5,056
py
Python
sudoku_solver/gui.py
andrewhalle/sudoku_solver
56b88c49a3637449507a9afa66ec3d617d2118a5
[ "MIT" ]
null
null
null
sudoku_solver/gui.py
andrewhalle/sudoku_solver
56b88c49a3637449507a9afa66ec3d617d2118a5
[ "MIT" ]
null
null
null
sudoku_solver/gui.py
andrewhalle/sudoku_solver
56b88c49a3637449507a9afa66ec3d617d2118a5
[ "MIT" ]
null
null
null
import sys from PyQt5.QtCore import Qt, QSize, QPoint from PyQt5.QtWidgets import QApplication, QDialog, QWidget, QLabel, QPushButton, QVBoxLayout, QHBoxLayout from PyQt5.QtGui import QPainter, QColor, QPen, QFont from .sudoku import Sudoku def main(): app = QApplication([]) gui = SudokuDialog() sys.exit(app.exec_())
36.637681
135
0.585443