content
stringlengths 1
1.04M
| input_ids
sequencelengths 1
774k
| ratio_char_token
float64 0.38
22.9
| token_count
int64 1
774k
|
---|---|---|---|
import os
import glob
import subprocess
from setuptools import setup, find_packages
from distutils import log
import sys
BUILD_CUAEV = '--cuaev' in sys.argv
if BUILD_CUAEV:
sys.argv.remove('--cuaev')
if not BUILD_CUAEV:
log.warn("Will not install cuaev") # type: ignore
with open("README.md", "r") as fh:
long_description = fh.read()
setup(
name='torchani',
description='PyTorch implementation of ANI',
long_description=long_description,
long_description_content_type="text/markdown",
url='https://github.com/aiqm/torchani',
author='Xiang Gao',
author_email='[email protected]',
license='MIT',
packages=find_packages(),
include_package_data=True,
use_scm_version=True,
setup_requires=['setuptools_scm'],
install_requires=[
'torch',
'lark-parser',
'requests',
'importlib_metadata',
],
**cuaev_kwargs()
)
| [
11748,
28686,
198,
11748,
15095,
198,
11748,
850,
14681,
198,
6738,
900,
37623,
10141,
1330,
9058,
11,
1064,
62,
43789,
198,
6738,
1233,
26791,
1330,
2604,
198,
11748,
25064,
198,
198,
19499,
26761,
62,
43633,
14242,
53,
796,
705,
438,
66,
6413,
1990,
6,
287,
25064,
13,
853,
85,
198,
361,
20571,
26761,
62,
43633,
14242,
53,
25,
198,
220,
220,
220,
25064,
13,
853,
85,
13,
28956,
10786,
438,
66,
6413,
1990,
11537,
198,
198,
361,
407,
20571,
26761,
62,
43633,
14242,
53,
25,
198,
220,
220,
220,
2604,
13,
40539,
7203,
8743,
407,
2721,
269,
6413,
1990,
4943,
220,
1303,
2099,
25,
8856,
198,
198,
4480,
1280,
7203,
15675,
11682,
13,
9132,
1600,
366,
81,
4943,
355,
277,
71,
25,
198,
220,
220,
220,
890,
62,
11213,
796,
277,
71,
13,
961,
3419,
628,
628,
198,
198,
40406,
7,
198,
220,
220,
220,
1438,
11639,
13165,
3147,
72,
3256,
198,
220,
220,
220,
6764,
11639,
20519,
15884,
354,
7822,
286,
3537,
40,
3256,
198,
220,
220,
220,
890,
62,
11213,
28,
6511,
62,
11213,
11,
198,
220,
220,
220,
890,
62,
11213,
62,
11299,
62,
4906,
2625,
5239,
14,
4102,
2902,
1600,
198,
220,
220,
220,
19016,
11639,
5450,
1378,
12567,
13,
785,
14,
1872,
80,
76,
14,
13165,
3147,
72,
3256,
198,
220,
220,
220,
1772,
11639,
55,
15483,
402,
5488,
3256,
198,
220,
220,
220,
1772,
62,
12888,
11639,
80,
292,
7568,
70,
774,
9019,
404,
31,
14816,
13,
785,
3256,
198,
220,
220,
220,
5964,
11639,
36393,
3256,
198,
220,
220,
220,
10392,
28,
19796,
62,
43789,
22784,
198,
220,
220,
220,
2291,
62,
26495,
62,
7890,
28,
17821,
11,
198,
220,
220,
220,
779,
62,
1416,
76,
62,
9641,
28,
17821,
11,
198,
220,
220,
220,
9058,
62,
47911,
28,
17816,
2617,
37623,
10141,
62,
1416,
76,
6,
4357,
198,
220,
220,
220,
2721,
62,
47911,
41888,
198,
220,
220,
220,
220,
220,
220,
220,
705,
13165,
354,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
705,
75,
668,
12,
48610,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
705,
8897,
3558,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
705,
11748,
8019,
62,
38993,
3256,
198,
220,
220,
220,
16589,
198,
220,
220,
220,
12429,
66,
6413,
1990,
62,
46265,
22046,
3419,
198,
8,
198
] | 2.392208 | 385 |
#!/usr/bin/env python3
from six.moves import getoutput
import os.path
from os import chdir
directory = os.path.dirname(os.path.abspath(__file__))
chdir(directory)
print('Working directory set to {}'.format(directory))
proto_path = os.path.join('..', 'schema')
python_out = os.path.join('..', 'reblockstorer', 'proto')
out_pb2 = os.path.join(python_out, '*pb2*.py')
protos = os.path.join(proto_path, '*.proto')
endpoint_proto = os.path.join(proto_path, 'endpoint.proto')
print(getoutput('protoc --proto_path={} --python_out={} {}'.
format(proto_path, python_out, protos)))
print(getoutput('python -m grpc_tools.protoc --proto_path={} \
--python_out={} --grpc_python_out={} {}'.
format(proto_path, python_out, python_out, endpoint_proto)))
print(getoutput('sed -i.bak \'s/^\\(import.*_pb2\\)/from . \\1/\' {}'.
format(out_pb2)))
print('Done.')
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
6738,
2237,
13,
76,
5241,
1330,
651,
22915,
198,
11748,
28686,
13,
6978,
198,
6738,
28686,
1330,
442,
15908,
198,
198,
34945,
796,
28686,
13,
6978,
13,
15908,
3672,
7,
418,
13,
6978,
13,
397,
2777,
776,
7,
834,
7753,
834,
4008,
198,
354,
15908,
7,
34945,
8,
198,
4798,
10786,
28516,
8619,
900,
284,
23884,
4458,
18982,
7,
34945,
4008,
198,
198,
1676,
1462,
62,
6978,
796,
28686,
13,
6978,
13,
22179,
10786,
492,
3256,
705,
15952,
2611,
11537,
198,
29412,
62,
448,
796,
28686,
13,
6978,
13,
22179,
10786,
492,
3256,
705,
260,
9967,
8095,
81,
3256,
705,
1676,
1462,
11537,
198,
448,
62,
40842,
17,
796,
28686,
13,
6978,
13,
22179,
7,
29412,
62,
448,
11,
705,
9,
40842,
17,
24620,
9078,
11537,
198,
11235,
418,
796,
28686,
13,
6978,
13,
22179,
7,
1676,
1462,
62,
6978,
11,
705,
24620,
1676,
1462,
11537,
198,
437,
4122,
62,
1676,
1462,
796,
28686,
13,
6978,
13,
22179,
7,
1676,
1462,
62,
6978,
11,
705,
437,
4122,
13,
1676,
1462,
11537,
198,
198,
4798,
7,
1136,
22915,
10786,
11235,
420,
1377,
1676,
1462,
62,
6978,
34758,
92,
1377,
29412,
62,
448,
34758,
92,
23884,
4458,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5794,
7,
1676,
1462,
62,
6978,
11,
21015,
62,
448,
11,
1237,
418,
22305,
198,
4798,
7,
1136,
22915,
10786,
29412,
532,
76,
1036,
14751,
62,
31391,
13,
11235,
420,
1377,
1676,
1462,
62,
6978,
34758,
92,
3467,
198,
197,
438,
29412,
62,
448,
34758,
92,
1377,
2164,
14751,
62,
29412,
62,
448,
34758,
92,
23884,
4458,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5794,
7,
1676,
1462,
62,
6978,
11,
21015,
62,
448,
11,
21015,
62,
448,
11,
36123,
62,
1676,
1462,
22305,
198,
198,
4798,
7,
1136,
22915,
10786,
36622,
532,
72,
13,
65,
461,
34373,
82,
14,
61,
6852,
7,
11748,
15885,
62,
40842,
17,
6852,
20679,
6738,
764,
26867,
16,
14,
43054,
23884,
4458,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5794,
7,
448,
62,
40842,
17,
22305,
198,
4798,
10786,
45677,
2637,
8,
198
] | 2.364116 | 379 |
# -*- coding: utf-8 -*-
import sys
import inspect
import getopt
import traceback
from exceptions import *
write = sys.stdout.write
err = sys.stderr.write
def trim(docstring):
"""Intelligently undent given docstring."""
if not docstring:
return ''
# Convert tabs to spaces (following the normal Python rules)
# and split into a list of lines:
lines = docstring.expandtabs().splitlines()
# Determine minimum indentation (first line doesn't count):
indent = sys.maxint
for line in lines[1:]:
stripped = line.lstrip()
if stripped:
indent = min(indent, len(line) - len(stripped))
# Remove indentation (first line is special):
trimmed = [lines[0].strip()]
if indent < sys.maxint:
for line in lines[1:]:
trimmed.append(line[indent:].rstrip())
# Strip off trailing and leading blank lines:
while trimmed and not trimmed[-1]:
trimmed.pop()
while trimmed and not trimmed[0]:
trimmed.pop(0)
# Return a single string:
return '\n'.join(trimmed)
def catcher(target, help_func):
'''Catches all exceptions and prints human-readable information on them
'''
try:
return target()
except UnknownCommand, e:
err("unknown command: '%s'\n" % e)
except AmbiguousCommand, e:
err("command '%s' is ambiguous:\n %s\n" %
(e.args[0], ' '.join(e.args[1])))
except ParseError, e:
err('%s: %s\n' % (e.args[0], e.args[1]))
help_func(e.args[0])
except getopt.GetoptError, e:
err('error: %s\n' % e)
help_func()
except FOError, e:
err('%s\n' % e)
except KeyboardInterrupt:
err('interrupted!\n')
except SystemExit:
raise
except:
err('unknown exception encountered')
raise
raise Abort
try:
from functools import wraps
except ImportError: | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
25064,
198,
11748,
10104,
198,
11748,
651,
8738,
198,
11748,
12854,
1891,
198,
198,
6738,
13269,
1330,
1635,
220,
628,
198,
13564,
796,
25064,
13,
19282,
448,
13,
13564,
198,
8056,
796,
25064,
13,
301,
1082,
81,
13,
13564,
628,
198,
4299,
15797,
7,
15390,
8841,
2599,
198,
197,
37811,
5317,
2976,
1473,
3318,
298,
1813,
2205,
8841,
526,
15931,
198,
197,
361,
407,
2205,
8841,
25,
198,
197,
197,
7783,
10148,
198,
197,
2,
38240,
22524,
284,
9029,
357,
27780,
278,
262,
3487,
11361,
3173,
8,
198,
197,
2,
290,
6626,
656,
257,
1351,
286,
3951,
25,
198,
197,
6615,
796,
2205,
8841,
13,
11201,
392,
8658,
82,
22446,
35312,
6615,
3419,
198,
197,
2,
45559,
3810,
5288,
33793,
341,
357,
11085,
1627,
1595,
470,
954,
2599,
198,
197,
521,
298,
796,
25064,
13,
9806,
600,
198,
197,
1640,
1627,
287,
3951,
58,
16,
25,
5974,
198,
197,
197,
33565,
1496,
796,
1627,
13,
75,
36311,
3419,
198,
197,
197,
361,
18818,
25,
198,
197,
197,
197,
521,
298,
796,
949,
7,
521,
298,
11,
18896,
7,
1370,
8,
532,
18896,
7,
33565,
1496,
4008,
198,
197,
2,
17220,
33793,
341,
357,
11085,
1627,
318,
2041,
2599,
198,
197,
2213,
320,
1150,
796,
685,
6615,
58,
15,
4083,
36311,
3419,
60,
198,
197,
361,
33793,
1279,
25064,
13,
9806,
600,
25,
198,
197,
197,
1640,
1627,
287,
3951,
58,
16,
25,
5974,
198,
197,
197,
197,
2213,
320,
1150,
13,
33295,
7,
1370,
58,
521,
298,
25,
4083,
81,
36311,
28955,
198,
197,
2,
18508,
572,
25462,
290,
3756,
9178,
3951,
25,
198,
197,
4514,
40325,
290,
407,
40325,
58,
12,
16,
5974,
198,
197,
197,
2213,
320,
1150,
13,
12924,
3419,
198,
197,
4514,
40325,
290,
407,
40325,
58,
15,
5974,
198,
197,
197,
2213,
320,
1150,
13,
12924,
7,
15,
8,
198,
197,
2,
8229,
257,
2060,
4731,
25,
198,
197,
7783,
705,
59,
77,
4458,
22179,
7,
2213,
320,
1150,
8,
628,
198,
198,
4299,
32408,
7,
16793,
11,
1037,
62,
20786,
2599,
198,
220,
220,
220,
705,
7061,
34,
20981,
477,
13269,
290,
20842,
1692,
12,
46155,
1321,
319,
606,
198,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
1949,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
2496,
3419,
198,
220,
220,
220,
2845,
16185,
21575,
11,
304,
25,
198,
220,
220,
220,
220,
220,
220,
220,
11454,
7203,
34680,
3141,
25,
705,
4,
82,
6,
59,
77,
1,
4064,
304,
8,
198,
220,
220,
220,
2845,
12457,
29709,
21575,
11,
304,
25,
198,
220,
220,
220,
220,
220,
220,
220,
11454,
7203,
21812,
705,
4,
82,
6,
318,
27102,
7479,
77,
220,
220,
220,
4064,
82,
59,
77,
1,
4064,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
357,
68,
13,
22046,
58,
15,
4357,
705,
45302,
22179,
7,
68,
13,
22046,
58,
16,
60,
22305,
198,
220,
220,
220,
2845,
2547,
325,
12331,
11,
304,
25,
198,
220,
220,
220,
220,
220,
220,
220,
11454,
10786,
4,
82,
25,
4064,
82,
59,
77,
6,
4064,
357,
68,
13,
22046,
58,
15,
4357,
304,
13,
22046,
58,
16,
60,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
1037,
62,
20786,
7,
68,
13,
22046,
58,
15,
12962,
198,
220,
220,
220,
2845,
651,
8738,
13,
3855,
8738,
12331,
11,
304,
25,
198,
220,
220,
220,
220,
220,
220,
220,
11454,
10786,
18224,
25,
4064,
82,
59,
77,
6,
4064,
304,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1037,
62,
20786,
3419,
198,
220,
220,
220,
2845,
11895,
12331,
11,
304,
25,
198,
220,
220,
220,
220,
220,
220,
220,
11454,
10786,
4,
82,
59,
77,
6,
4064,
304,
8,
198,
220,
220,
220,
2845,
31973,
9492,
3622,
25,
198,
220,
220,
220,
220,
220,
220,
220,
11454,
10786,
46037,
0,
59,
77,
11537,
198,
220,
220,
220,
2845,
4482,
30337,
25,
198,
220,
220,
220,
220,
220,
220,
220,
5298,
198,
220,
220,
220,
2845,
25,
198,
220,
220,
220,
220,
220,
220,
220,
11454,
10786,
34680,
6631,
12956,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
5298,
628,
220,
220,
220,
5298,
2275,
419,
198,
198,
28311,
25,
198,
220,
220,
220,
422,
1257,
310,
10141,
1330,
27521,
198,
16341,
17267,
12331,
25
] | 2.482143 | 728 |
# a = [-10, -2, 0, 5, 66, 77, 99, 102, 239, 567, 875, 934]
# print(encontra_impares(a)) | [
2,
257,
796,
25915,
940,
11,
532,
17,
11,
657,
11,
642,
11,
7930,
11,
8541,
11,
7388,
11,
15143,
11,
32817,
11,
642,
3134,
11,
807,
2425,
11,
860,
2682,
60,
628,
198,
2,
3601,
7,
268,
3642,
430,
62,
11011,
3565,
7,
64,
4008
] | 1.934783 | 46 |
from .Collection import Collection
from me.storage.data_config import DataType
from datetime import datetime
from me.logger import MeLogger, DEBUG
| [
6738,
764,
36307,
1330,
12251,
198,
6738,
502,
13,
35350,
13,
7890,
62,
11250,
1330,
6060,
6030,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
6738,
502,
13,
6404,
1362,
1330,
2185,
11187,
1362,
11,
16959,
628,
198
] | 3.921053 | 38 |
import sys
from django.core.management.base import BaseCommand
from ... import models
from ...ocr import walk
| [
11748,
25064,
198,
6738,
42625,
14208,
13,
7295,
13,
27604,
13,
8692,
1330,
7308,
21575,
198,
6738,
2644,
1330,
4981,
198,
6738,
2644,
1696,
1330,
2513,
198
] | 4.074074 | 27 |
import requests as req
import sys
import json
request = req.get('https://economia.awesomeapi.com.br/json/all')
cotacoes = json.loads(request.text)
consultas = ["USD", "ARS", "EUR", "BTC"]
if(len(sys.argv) > 1):
consultas = sys.argv[1:]
print("1 BRL ==")
exibeCotacoes(consultas)
| [
11748,
7007,
355,
43089,
198,
11748,
25064,
198,
11748,
33918,
198,
198,
25927,
796,
43089,
13,
1136,
10786,
5450,
1378,
13926,
544,
13,
707,
5927,
15042,
13,
785,
13,
1671,
14,
17752,
14,
439,
11537,
198,
25557,
330,
3028,
796,
33918,
13,
46030,
7,
25927,
13,
5239,
8,
198,
198,
5936,
586,
292,
796,
14631,
29072,
1600,
366,
27415,
1600,
366,
36,
4261,
1600,
366,
35964,
8973,
198,
361,
7,
11925,
7,
17597,
13,
853,
85,
8,
1875,
352,
2599,
198,
220,
220,
5725,
292,
796,
25064,
13,
853,
85,
58,
16,
47715,
198,
198,
4798,
7203,
16,
347,
7836,
796,
2625,
8,
198,
1069,
32438,
34,
313,
330,
3028,
7,
5936,
586,
292,
8,
198
] | 2.456897 | 116 |
import logging
import urllib
import json
import base64
import typing as t
from galaxy.http import create_client_session, handle_exception
from galaxy.api.errors import AccessDenied, AuthenticationRequired
logger = logging.getLogger(__name__)
| [
11748,
18931,
198,
11748,
2956,
297,
571,
198,
11748,
33918,
198,
11748,
2779,
2414,
198,
11748,
19720,
355,
256,
198,
198,
6738,
16161,
13,
4023,
1330,
2251,
62,
16366,
62,
29891,
11,
5412,
62,
1069,
4516,
198,
6738,
16161,
13,
15042,
13,
48277,
1330,
8798,
21306,
798,
11,
48191,
37374,
628,
198,
6404,
1362,
796,
18931,
13,
1136,
11187,
1362,
7,
834,
3672,
834,
8,
628,
628
] | 3.701493 | 67 |
# -*- coding: utf-8 -*-
from django.apps import AppConfig
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
42625,
14208,
13,
18211,
1330,
2034,
16934,
628
] | 2.565217 | 23 |
import progressbar
import pythonwhois
def is_registered(site):
"""Check if a domain has an WHOIS record."""
try:
details = pythonwhois.get_whois(site)
except pythonwhois.shared.WhoisException as e:
print(f"Exception for {site}")
print(e)
return False
return not details["raw"][0].startswith("No match for")
# https://raw.githubusercontent.com/dominictarr/random-name/master/first-names.txt
names = read_from_file("english-adjectives.txt")
sites = [f"{name}.me" for name in names]
# https://raw.githubusercontent.com/datmt/English-Verbs/master/verbsList
# names = read_from_file('verbs.txt')
# sites = ['{}.it'.format(name) for name in names]
sites = [f"{name}.com" for name in generate_by_pattern("CVCV")]
print(len(sites))
i = 0
ava_sites = []
for site in progressbar.progressbar(sites):
if " " in site:
i += 1
continue
if not is_registered(site):
print(site)
ava_sites.append(site)
print(ava_sites)
# from joblib import Parallel, delayed
# import multiprocessing
# # what are your inputs, and what operation do you want to
# # perform on each input. For example...
# names = read_from_file('first-names.txt')
# def is_registered(site):
# """Check if a domain has an WHOIS record."""
# details = pythonwhois.get_whois(site)
# return not details['raw'][0].startswith('No match for')
# num_cores = multiprocessing.cpu_count()
# results = Parallel(n_jobs=num_cores)(delayed(is_registered)(i) for i in sites)
# print(results)
| [
11748,
4371,
5657,
198,
11748,
21015,
8727,
271,
628,
198,
4299,
318,
62,
33736,
7,
15654,
2599,
198,
220,
220,
220,
37227,
9787,
611,
257,
7386,
468,
281,
19494,
1797,
1700,
526,
15931,
198,
220,
220,
220,
1949,
25,
198,
220,
220,
220,
220,
220,
220,
220,
3307,
796,
21015,
8727,
271,
13,
1136,
62,
8727,
271,
7,
15654,
8,
198,
220,
220,
220,
2845,
21015,
8727,
271,
13,
28710,
13,
8241,
271,
16922,
355,
304,
25,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
7,
69,
1,
16922,
329,
1391,
15654,
92,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
7,
68,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
10352,
198,
220,
220,
220,
1441,
407,
3307,
14692,
1831,
1,
7131,
15,
4083,
9688,
2032,
342,
7203,
2949,
2872,
329,
4943,
628,
628,
198,
2,
3740,
1378,
1831,
13,
12567,
43667,
13,
785,
14,
3438,
259,
713,
3258,
14,
25120,
12,
3672,
14,
9866,
14,
11085,
12,
14933,
13,
14116,
198,
14933,
796,
1100,
62,
6738,
62,
7753,
7203,
39126,
12,
324,
752,
1083,
13,
14116,
4943,
198,
49315,
796,
685,
69,
1,
90,
3672,
27422,
1326,
1,
329,
1438,
287,
3891,
60,
198,
2,
3740,
1378,
1831,
13,
12567,
43667,
13,
785,
14,
19608,
16762,
14,
15823,
12,
13414,
1443,
14,
9866,
14,
46211,
8053,
198,
2,
3891,
796,
1100,
62,
6738,
62,
7753,
10786,
46211,
13,
14116,
11537,
198,
2,
5043,
796,
37250,
90,
27422,
270,
4458,
18982,
7,
3672,
8,
329,
1438,
287,
3891,
60,
198,
49315,
796,
685,
69,
1,
90,
3672,
27422,
785,
1,
329,
1438,
287,
7716,
62,
1525,
62,
33279,
7203,
34,
15922,
53,
4943,
60,
198,
4798,
7,
11925,
7,
49315,
4008,
198,
198,
72,
796,
657,
198,
4170,
62,
49315,
796,
17635,
198,
1640,
2524,
287,
4371,
5657,
13,
33723,
5657,
7,
49315,
2599,
198,
220,
220,
220,
611,
366,
366,
287,
2524,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1312,
15853,
352,
198,
220,
220,
220,
220,
220,
220,
220,
2555,
198,
220,
220,
220,
611,
407,
318,
62,
33736,
7,
15654,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
7,
15654,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1196,
64,
62,
49315,
13,
33295,
7,
15654,
8,
198,
4798,
7,
4170,
62,
49315,
8,
628,
198,
2,
422,
1693,
8019,
1330,
42945,
11,
11038,
198,
2,
1330,
18540,
305,
919,
278,
198,
198,
2,
1303,
644,
389,
534,
17311,
11,
290,
644,
4905,
466,
345,
765,
284,
198,
2,
1303,
1620,
319,
1123,
5128,
13,
1114,
1672,
986,
198,
2,
3891,
796,
1100,
62,
6738,
62,
7753,
10786,
11085,
12,
14933,
13,
14116,
11537,
198,
2,
825,
318,
62,
33736,
7,
15654,
2599,
198,
2,
220,
220,
220,
220,
37227,
9787,
611,
257,
7386,
468,
281,
19494,
1797,
1700,
526,
15931,
198,
2,
220,
220,
220,
220,
3307,
796,
21015,
8727,
271,
13,
1136,
62,
8727,
271,
7,
15654,
8,
198,
2,
220,
220,
220,
220,
1441,
407,
3307,
17816,
1831,
6,
7131,
15,
4083,
9688,
2032,
342,
10786,
2949,
2872,
329,
11537,
198,
198,
2,
997,
62,
66,
2850,
796,
18540,
305,
919,
278,
13,
36166,
62,
9127,
3419,
198,
198,
2,
2482,
796,
42945,
7,
77,
62,
43863,
28,
22510,
62,
66,
2850,
5769,
12381,
16548,
7,
271,
62,
33736,
5769,
72,
8,
329,
1312,
287,
5043,
8,
198,
2,
3601,
7,
43420,
8,
198
] | 2.688266 | 571 |
"""
zoom.tools
"""
import datetime
import logging
import os
from markdown import Markdown
from zoom.response import RedirectResponse
import zoom.helpers
from zoom.helpers import abs_url_for, url_for_page, url_for
from zoom.utils import trim, dedup
from zoom.render import apply_helpers
one_day = datetime.timedelta(1)
one_week = one_day * 7
one_hour = datetime.timedelta(hours=1)
one_minute = datetime.timedelta(minutes=1)
def now():
"""Return the current datetime"""
return datetime.datetime.now()
def today():
"""Return the current date
>>> today() == datetime.date.today()
True
"""
return datetime.date.today()
def yesterday(any_date=None):
"""Return date for yesterday
>>> yesterday(datetime.date(2017, 12, 4))
datetime.date(2017, 12, 3)
>>> yesterday(datetime.date(2017, 1, 1))
datetime.date(2016, 12, 31)
"""
return (any_date or today()) - one_day
def tomorrow(any_date=None):
"""Return date for tomorrow
>>> tomorrow(datetime.date(2017, 12, 3))
datetime.date(2017, 12, 4)
>>> tomorrow(datetime.date(2016, 12, 31))
datetime.date(2017, 1, 1)
"""
return (any_date or today()) + one_day
def first_day_of_the_month(any_date):
"""returns the first day of the month for any date
>>> first_day_of_the_month(datetime.date(2016, 12, 31))
datetime.date(2016, 12, 1)
"""
return datetime.date(any_date.year, any_date.month, 1)
def last_day_of_the_month(any_date):
"""returns the last day of the month for any date
>>> last_day_of_the_month(datetime.date(2016, 2, 1))
datetime.date(2016, 2, 29)
>>> last_day_of_the_month(datetime.datetime(2016, 2, 1, 1, 1, 1))
datetime.date(2016, 2, 29)
"""
next_month = any_date.replace(day=28) + datetime.timedelta(days=4)
return first_day_of_the_month(next_month) - one_day
def first_day_of_next_month(any_date):
"""returns the first day of next month for any date
>>> first_day_of_next_month(datetime.date(2016, 2, 1))
datetime.date(2016, 3, 1)
"""
return last_day_of_the_month(any_date) + one_day
def last_day_of_next_month(any_date):
"""returns the last day of next month for any date
>>> last_day_of_next_month(datetime.date(2016, 2, 1))
datetime.date(2016, 3, 31)
"""
return last_day_of_the_month(first_day_of_next_month(any_date))
def first_day_of_last_month(any_date):
"""Returns the first day of last month for any date
>>> first_day_of_last_month(datetime.date(2016, 1, 21))
datetime.date(2015, 12, 1)
"""
return first_day_of_the_month(last_day_of_last_month(any_date))
def last_day_of_last_month(any_date):
"""Returns the first day of last month for any date
>>> last_day_of_last_month(datetime.date(2016, 1, 21))
datetime.date(2015, 12, 31)
"""
return first_day_of_the_month(any_date) - one_day
def this_month(any_date):
"""Returns date range for last month for any date
>>> this_month(datetime.date(2016, 1, 21))
(datetime.date(2016, 1, 1), datetime.date(2016, 1, 31))
"""
return (first_day_of_the_month(any_date), last_day_of_the_month(any_date))
def next_month(any_date):
"""Returns date range for next month for any date
>>> next_month(datetime.date(2016, 1, 21))
(datetime.date(2016, 2, 1), datetime.date(2016, 2, 29))
"""
return (first_day_of_next_month(any_date), last_day_of_next_month(any_date))
def last_month(any_date):
"""Returns date range for last month for any date
>>> last_month(datetime.date(2016, 1, 21))
(datetime.date(2015, 12, 1), datetime.date(2015, 12, 31))
"""
return (first_day_of_last_month(any_date), last_day_of_last_month(any_date))
def how_long(time1, time2):
"""Returns a string that describes the difference between two times.
>>> import time
>>> now = now()
>>> how_long(now, now)
'a moment'
>>> how_long(now, now + one_minute / 3)
'20 seconds'
>>> how_long(now, now + one_hour / 3)
'20 minutes'
>>> how_long(now, now + one_day / 3)
'8 hours'
>>> how_long(now, now + one_day)
'1 day'
>>> how_long(now, now + 2 * one_day)
'2 days'
>>> how_long(now, now + 15 * one_day)
'2 weeks'
>>> how_long(now, now + 35 * one_day)
'over a month'
>>> how_long(now, now + 65 * one_day)
'over 2 months'
>>> how_long(now, now + 361 * one_day)
'almost a year'
>>> how_long(now, now + 20 * one_minute)
'20 minutes'
>>> how_long(now, now + 2 * 365 * one_day)
'almost two years'
>>> how_long(now, now + 3.25 * 365 * one_day)
'over 3 years'
>>> how_long(now, now + 1.25 * 365 * one_day)
'over a year'
>>> how_long(today(), tomorrow(today()))
'1 day'
>>> how_long(today(), now + one_week)
'7 days'
>>> how_long(now, time.time())
'a moment'
>>> failed = False
>>> try:
... how_long(now, None)
... except TypeError:
... failed = True
>>> failed
True
"""
#pylint: disable=R0912
def as_datetime(anytime):
"""Convert value to datetime"""
if isinstance(anytime, datetime.datetime):
return anytime
elif isinstance(anytime, datetime.date):
return datetime.datetime(anytime.year, anytime.month, anytime.day)
elif anytime is None:
msg = 'date, datetime or timestamp required (None passed)'
raise TypeError(msg)
else:
return datetime.datetime.fromtimestamp(anytime)
diff = as_datetime(time2) - as_datetime(time1)
if diff.days > 365*2:
result = 'over %d years' % (diff.days / 365)
elif diff.days > 365*1.75:
result = 'almost two years'
elif diff.days > 365:
result = 'over a year'
elif diff.days > 360:
result = 'almost a year'
elif diff.days > 60:
result = 'over %d months' % (diff.days / 30)
elif diff.days > 30:
result = 'over a month'
elif diff.days > 14:
result = '%d weeks' % (diff.days / 7)
elif diff.days > 1:
result = '%d days' % diff.days
elif diff.days == 1:
result = '1 day'
elif diff.seconds > 3600:
result = '%d hours' % int(diff.seconds / 3600)
elif diff.seconds > 60:
result = '%d minutes' % int(diff.seconds / 60)
elif diff.seconds > 0:
result = '%d seconds' % int(diff.seconds)
else:
result = 'a moment'
return result
def how_long_ago(anytime, since=None):
"""
Returns a string that describes the difference between any time and now.
>>> now = now()
>>> how_long_ago(now - datetime.timedelta(1) * 2)
'2 days ago'
>>> how_long_ago(now + 20 * one_minute)
'19 minutes from now'
>>> how_long_ago(now - 20 * one_minute)
'20 minutes ago'
>>> how_long_ago(now - 20 * one_minute, now - 10 * one_minute)
'10 minutes ago'
"""
right_now = since or now()
if anytime < right_now:
return how_long(anytime, right_now) + ' ago'
else:
return how_long(right_now, anytime) + ' from now'
def is_listy(obj):
"""test to see if an object will iterate like a list
>>> is_listy([1,2,3])
True
>>> is_listy(set([3,4,5]))
True
>>> is_listy((3,4,5))
True
>>> is_listy(dict(a=1, b=2))
False
>>> is_listy('123')
False
"""
return isinstance(obj, (list, tuple, set))
def ensure_listy(obj):
"""ensure object is wrapped in a list if it can't behave like one
>>> ensure_listy('not listy')
['not listy']
>>> ensure_listy(['already listy'])
['already listy']
>>> ensure_listy([])
[]
"""
if is_listy(obj):
return obj
return [obj]
def redirect_to(*args, **kwargs):
"""Return a redirect response for a URL."""
return Redirector(*args, **kwargs)
def home(view=None):
"""Redirect to application home.
"""
if view:
return redirect_to(url_for_page(view))
return redirect_to(url_for_page())
def unisafe(val):
"""safely convert to unicode
>>> unisafe(None)
''
>>> unisafe(b'123')
'123'
>>> unisafe(
... b'\\xe3\\x81\\x93\\xe3\\x82\\x93\\xe3\\x81\\xab\\xe3\\x81'
... b'\\xa1\\xe3\\x81\\xaf\\xe4\\xb8\\x96\\xe7\\x95\\x8c'
... )
'こんにちは世界'
>>> unisafe(1)
'1'
"""
if val is None:
return ''
elif isinstance(val, bytes):
try:
val = val.decode('utf-8')
except:
val = val.decode('Latin-1')
elif not isinstance(val, str):
val = str(val)
return val
def websafe(content):
"""Return htmlquoted version of content
>>> websafe(b'This could be <problematic>')
'This could be <problematic>'
"""
return hide_helpers(htmlquote(unisafe(content)))
def htmlquote(text):
"""Encodes `text` for raw use in HTML.
>>> htmlquote(u"<'&\\">")
'<'&">'
>>> htmlquote("<'&\\">")
'<'&">'
"""
replacements = (
('&', '&'),
('<', '<'),
('>', '>'),
("'", '''),
('"', '"'),
)
for replacement in replacements:
text = text.replace(*replacement)
return text
def get_markdown_converter():
"""Return a configured markdown converter
>>> markdown("a [[wikilink]] test")
'<p>a <a class="wikilink" href="wikilink.html">wikilink</a> test</p>'
>>> markdown("a [[wikilink.html]] test")
'<p>a [[wikilink.html]] test</p>'
"""
extras = ['tables', 'def_list', 'wikilinks', 'toc']
configs = {'wikilinks': [('build_url', url_builder)]}
converter = Markdown(extensions=extras, extension_configs=configs)
return converter
markdown_converter = get_markdown_converter() # TODO: decorator instead?
def markdown(content):
"""Transform content with markdown
>>> markdown('this **is** bold')
'<p>this <strong>is</strong> bold</p>'
"""
return markdown_converter.convert(trim(content))
def load(pathname, encoding='utf-8'):
"""Read a file and return the contents"""
logger = logging.getLogger(__name__)
logger.debug('load %r', pathname)
with open(pathname, encoding=encoding) as reader:
return reader.read()
def load_content(pathname, *args, **kwargs):
"""Load a content file and use it to format parameters
"""
isfile = os.path.isfile
if not isfile(pathname):
for extension in ['html', 'md', 'txt']:
if isfile(pathname + '.' + extension):
pathname = pathname + '.' + extension
break
template = load(pathname)
if template:
content = apply_helpers(template, None, [kwargs]).format(*args, **kwargs)
if pathname.endswith('.html'):
result = content
else:
result = markdown(content)
return result
return ''
def load_template(name, default=None):
"""
Load a template from the theme folder.
Templates usually have .html file extensions and this module
will assume that's what is desired unless otherwise specified.
"""
site = zoom.system.request.site
app = zoom.system.request.app
templates_paths = dedup(app.templates_paths + site.templates_paths)
if not '.' in name:
name = name + '.html'
if '/' in name or '\\' in name:
raise Exception(
'Unable to use specified template path. '
'Templates are located in theme folders.'
)
# return 'got stuff'
return site.templates.setdefault(name, load_template_file(name, default))
def get_template(template_name='default', theme='default'):
"""Get site page template"""
logger = logging.getLogger(__name__)
path = zoom.system.site.themes_path
pathname = os.path.realpath(
os.path.join(path, theme, template_name + '.html')
)
if os.path.isfile(pathname):
logger.debug('get_template %r', pathname)
with open(pathname, 'rb') as reader:
return reader.read().decode('utf8')
else:
if template_name == 'default':
logger.error(
'default template %s missing',
os.path.realpath(pathname),
)
raise zoom.exceptions.ThemeTemplateMissingException(
'Default template missing %r' % pathname
)
logger.warning(
'template %r missing',
pathname,
)
return get_template('default', theme)
def zoompath(*args):
"""Returns the location of a standard Zoom asset"""
realpath = os.path.realpath
dirname = os.path.dirname
join = os.path.join
return realpath(join(realpath(dirname(zoom.__file__)), '..', *args))
def hide_helpers(content):
"""prevent helper requests from being filled"""
return content.replace('{{', '[[raw!').replace('}}', '-raw]]')
def restore_helpers(content):
"""Restores content helpers to their usual form"""
return content.replace('[[raw!', '{{').replace('-raw]]', '}}')
| [
37811,
198,
220,
220,
220,
19792,
13,
31391,
198,
37811,
198,
198,
11748,
4818,
8079,
198,
11748,
18931,
198,
11748,
28686,
198,
198,
6738,
1317,
2902,
1330,
2940,
2902,
198,
6738,
19792,
13,
26209,
1330,
2297,
1060,
31077,
198,
11748,
19792,
13,
16794,
364,
198,
6738,
19792,
13,
16794,
364,
1330,
2352,
62,
6371,
62,
1640,
11,
19016,
62,
1640,
62,
7700,
11,
19016,
62,
1640,
198,
6738,
19792,
13,
26791,
1330,
15797,
11,
4648,
929,
198,
6738,
19792,
13,
13287,
1330,
4174,
62,
16794,
364,
198,
198,
505,
62,
820,
796,
4818,
8079,
13,
16514,
276,
12514,
7,
16,
8,
198,
505,
62,
10464,
796,
530,
62,
820,
1635,
767,
198,
505,
62,
9769,
796,
4818,
8079,
13,
16514,
276,
12514,
7,
24425,
28,
16,
8,
198,
505,
62,
11374,
796,
4818,
8079,
13,
16514,
276,
12514,
7,
1084,
1769,
28,
16,
8,
628,
198,
4299,
783,
33529,
198,
220,
220,
220,
37227,
13615,
262,
1459,
4818,
8079,
37811,
198,
220,
220,
220,
1441,
4818,
8079,
13,
19608,
8079,
13,
2197,
3419,
628,
198,
4299,
1909,
33529,
198,
220,
220,
220,
37227,
13615,
262,
1459,
3128,
628,
220,
220,
220,
13163,
1909,
3419,
6624,
4818,
8079,
13,
4475,
13,
40838,
3419,
198,
220,
220,
220,
6407,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
1441,
4818,
8079,
13,
4475,
13,
40838,
3419,
628,
198,
4299,
7415,
7,
1092,
62,
4475,
28,
14202,
2599,
198,
220,
220,
220,
37227,
13615,
3128,
329,
7415,
628,
220,
220,
220,
13163,
7415,
7,
19608,
8079,
13,
4475,
7,
5539,
11,
1105,
11,
604,
4008,
198,
220,
220,
220,
4818,
8079,
13,
4475,
7,
5539,
11,
1105,
11,
513,
8,
628,
220,
220,
220,
13163,
7415,
7,
19608,
8079,
13,
4475,
7,
5539,
11,
352,
11,
352,
4008,
198,
220,
220,
220,
4818,
8079,
13,
4475,
7,
5304,
11,
1105,
11,
3261,
8,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
1441,
357,
1092,
62,
4475,
393,
1909,
28955,
532,
530,
62,
820,
628,
198,
4299,
9439,
7,
1092,
62,
4475,
28,
14202,
2599,
198,
220,
220,
220,
37227,
13615,
3128,
329,
9439,
628,
220,
220,
220,
13163,
9439,
7,
19608,
8079,
13,
4475,
7,
5539,
11,
1105,
11,
513,
4008,
198,
220,
220,
220,
4818,
8079,
13,
4475,
7,
5539,
11,
1105,
11,
604,
8,
628,
220,
220,
220,
13163,
9439,
7,
19608,
8079,
13,
4475,
7,
5304,
11,
1105,
11,
3261,
4008,
198,
220,
220,
220,
4818,
8079,
13,
4475,
7,
5539,
11,
352,
11,
352,
8,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
1441,
357,
1092,
62,
4475,
393,
1909,
28955,
1343,
530,
62,
820,
628,
198,
4299,
717,
62,
820,
62,
1659,
62,
1169,
62,
8424,
7,
1092,
62,
4475,
2599,
198,
220,
220,
220,
37227,
7783,
82,
262,
717,
1110,
286,
262,
1227,
329,
597,
3128,
628,
220,
220,
220,
13163,
717,
62,
820,
62,
1659,
62,
1169,
62,
8424,
7,
19608,
8079,
13,
4475,
7,
5304,
11,
1105,
11,
3261,
4008,
198,
220,
220,
220,
4818,
8079,
13,
4475,
7,
5304,
11,
1105,
11,
352,
8,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
1441,
4818,
8079,
13,
4475,
7,
1092,
62,
4475,
13,
1941,
11,
597,
62,
4475,
13,
8424,
11,
352,
8,
628,
198,
4299,
938,
62,
820,
62,
1659,
62,
1169,
62,
8424,
7,
1092,
62,
4475,
2599,
198,
220,
220,
220,
37227,
7783,
82,
262,
938,
1110,
286,
262,
1227,
329,
597,
3128,
628,
220,
220,
220,
13163,
938,
62,
820,
62,
1659,
62,
1169,
62,
8424,
7,
19608,
8079,
13,
4475,
7,
5304,
11,
362,
11,
352,
4008,
198,
220,
220,
220,
4818,
8079,
13,
4475,
7,
5304,
11,
362,
11,
2808,
8,
628,
220,
220,
220,
13163,
938,
62,
820,
62,
1659,
62,
1169,
62,
8424,
7,
19608,
8079,
13,
19608,
8079,
7,
5304,
11,
362,
11,
352,
11,
352,
11,
352,
11,
352,
4008,
198,
220,
220,
220,
4818,
8079,
13,
4475,
7,
5304,
11,
362,
11,
2808,
8,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
1306,
62,
8424,
796,
597,
62,
4475,
13,
33491,
7,
820,
28,
2078,
8,
1343,
4818,
8079,
13,
16514,
276,
12514,
7,
12545,
28,
19,
8,
198,
220,
220,
220,
1441,
717,
62,
820,
62,
1659,
62,
1169,
62,
8424,
7,
19545,
62,
8424,
8,
532,
530,
62,
820,
628,
198,
4299,
717,
62,
820,
62,
1659,
62,
19545,
62,
8424,
7,
1092,
62,
4475,
2599,
198,
220,
220,
220,
37227,
7783,
82,
262,
717,
1110,
286,
1306,
1227,
329,
597,
3128,
628,
220,
220,
220,
13163,
717,
62,
820,
62,
1659,
62,
19545,
62,
8424,
7,
19608,
8079,
13,
4475,
7,
5304,
11,
362,
11,
352,
4008,
198,
220,
220,
220,
4818,
8079,
13,
4475,
7,
5304,
11,
513,
11,
352,
8,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
1441,
938,
62,
820,
62,
1659,
62,
1169,
62,
8424,
7,
1092,
62,
4475,
8,
1343,
530,
62,
820,
628,
198,
4299,
938,
62,
820,
62,
1659,
62,
19545,
62,
8424,
7,
1092,
62,
4475,
2599,
198,
220,
220,
220,
37227,
7783,
82,
262,
938,
1110,
286,
1306,
1227,
329,
597,
3128,
628,
220,
220,
220,
13163,
938,
62,
820,
62,
1659,
62,
19545,
62,
8424,
7,
19608,
8079,
13,
4475,
7,
5304,
11,
362,
11,
352,
4008,
198,
220,
220,
220,
4818,
8079,
13,
4475,
7,
5304,
11,
513,
11,
3261,
8,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
1441,
938,
62,
820,
62,
1659,
62,
1169,
62,
8424,
7,
11085,
62,
820,
62,
1659,
62,
19545,
62,
8424,
7,
1092,
62,
4475,
4008,
628,
198,
4299,
717,
62,
820,
62,
1659,
62,
12957,
62,
8424,
7,
1092,
62,
4475,
2599,
198,
220,
220,
220,
37227,
35561,
262,
717,
1110,
286,
938,
1227,
329,
597,
3128,
628,
220,
220,
220,
13163,
717,
62,
820,
62,
1659,
62,
12957,
62,
8424,
7,
19608,
8079,
13,
4475,
7,
5304,
11,
352,
11,
2310,
4008,
198,
220,
220,
220,
4818,
8079,
13,
4475,
7,
4626,
11,
1105,
11,
352,
8,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
1441,
717,
62,
820,
62,
1659,
62,
1169,
62,
8424,
7,
12957,
62,
820,
62,
1659,
62,
12957,
62,
8424,
7,
1092,
62,
4475,
4008,
628,
198,
4299,
938,
62,
820,
62,
1659,
62,
12957,
62,
8424,
7,
1092,
62,
4475,
2599,
198,
220,
220,
220,
37227,
35561,
262,
717,
1110,
286,
938,
1227,
329,
597,
3128,
628,
220,
220,
220,
13163,
938,
62,
820,
62,
1659,
62,
12957,
62,
8424,
7,
19608,
8079,
13,
4475,
7,
5304,
11,
352,
11,
2310,
4008,
198,
220,
220,
220,
4818,
8079,
13,
4475,
7,
4626,
11,
1105,
11,
3261,
8,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
1441,
717,
62,
820,
62,
1659,
62,
1169,
62,
8424,
7,
1092,
62,
4475,
8,
532,
530,
62,
820,
628,
198,
4299,
428,
62,
8424,
7,
1092,
62,
4475,
2599,
198,
220,
220,
220,
37227,
35561,
3128,
2837,
329,
938,
1227,
329,
597,
3128,
628,
220,
220,
220,
13163,
428,
62,
8424,
7,
19608,
8079,
13,
4475,
7,
5304,
11,
352,
11,
2310,
4008,
198,
220,
220,
220,
357,
19608,
8079,
13,
4475,
7,
5304,
11,
352,
11,
352,
828,
4818,
8079,
13,
4475,
7,
5304,
11,
352,
11,
3261,
4008,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
1441,
357,
11085,
62,
820,
62,
1659,
62,
1169,
62,
8424,
7,
1092,
62,
4475,
828,
938,
62,
820,
62,
1659,
62,
1169,
62,
8424,
7,
1092,
62,
4475,
4008,
628,
198,
4299,
1306,
62,
8424,
7,
1092,
62,
4475,
2599,
198,
220,
220,
220,
37227,
35561,
3128,
2837,
329,
1306,
1227,
329,
597,
3128,
628,
220,
220,
220,
13163,
1306,
62,
8424,
7,
19608,
8079,
13,
4475,
7,
5304,
11,
352,
11,
2310,
4008,
198,
220,
220,
220,
357,
19608,
8079,
13,
4475,
7,
5304,
11,
362,
11,
352,
828,
4818,
8079,
13,
4475,
7,
5304,
11,
362,
11,
2808,
4008,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
1441,
357,
11085,
62,
820,
62,
1659,
62,
19545,
62,
8424,
7,
1092,
62,
4475,
828,
938,
62,
820,
62,
1659,
62,
19545,
62,
8424,
7,
1092,
62,
4475,
4008,
628,
198,
4299,
938,
62,
8424,
7,
1092,
62,
4475,
2599,
198,
220,
220,
220,
37227,
35561,
3128,
2837,
329,
938,
1227,
329,
597,
3128,
628,
220,
220,
220,
13163,
938,
62,
8424,
7,
19608,
8079,
13,
4475,
7,
5304,
11,
352,
11,
2310,
4008,
198,
220,
220,
220,
357,
19608,
8079,
13,
4475,
7,
4626,
11,
1105,
11,
352,
828,
4818,
8079,
13,
4475,
7,
4626,
11,
1105,
11,
3261,
4008,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
1441,
357,
11085,
62,
820,
62,
1659,
62,
12957,
62,
8424,
7,
1092,
62,
4475,
828,
938,
62,
820,
62,
1659,
62,
12957,
62,
8424,
7,
1092,
62,
4475,
4008,
628,
198,
4299,
703,
62,
6511,
7,
2435,
16,
11,
640,
17,
2599,
198,
220,
220,
220,
37227,
35561,
257,
4731,
326,
8477,
262,
3580,
1022,
734,
1661,
13,
628,
220,
220,
220,
13163,
1330,
640,
198,
220,
220,
220,
13163,
783,
796,
783,
3419,
628,
220,
220,
220,
13163,
703,
62,
6511,
7,
2197,
11,
783,
8,
198,
220,
220,
220,
705,
64,
2589,
6,
628,
220,
220,
220,
13163,
703,
62,
6511,
7,
2197,
11,
783,
1343,
530,
62,
11374,
1220,
513,
8,
198,
220,
220,
220,
705,
1238,
4201,
6,
628,
220,
220,
220,
13163,
703,
62,
6511,
7,
2197,
11,
783,
1343,
530,
62,
9769,
1220,
513,
8,
198,
220,
220,
220,
705,
1238,
2431,
6,
628,
220,
220,
220,
13163,
703,
62,
6511,
7,
2197,
11,
783,
1343,
530,
62,
820,
1220,
513,
8,
198,
220,
220,
220,
705,
23,
2250,
6,
628,
220,
220,
220,
13163,
703,
62,
6511,
7,
2197,
11,
783,
1343,
530,
62,
820,
8,
198,
220,
220,
220,
705,
16,
1110,
6,
628,
220,
220,
220,
13163,
703,
62,
6511,
7,
2197,
11,
783,
1343,
362,
1635,
530,
62,
820,
8,
198,
220,
220,
220,
705,
17,
1528,
6,
628,
220,
220,
220,
13163,
703,
62,
6511,
7,
2197,
11,
783,
1343,
1315,
1635,
530,
62,
820,
8,
198,
220,
220,
220,
705,
17,
2745,
6,
628,
220,
220,
220,
13163,
703,
62,
6511,
7,
2197,
11,
783,
1343,
3439,
1635,
530,
62,
820,
8,
198,
220,
220,
220,
705,
2502,
257,
1227,
6,
628,
220,
220,
220,
13163,
703,
62,
6511,
7,
2197,
11,
783,
1343,
6135,
1635,
530,
62,
820,
8,
198,
220,
220,
220,
705,
2502,
362,
1933,
6,
628,
220,
220,
220,
13163,
703,
62,
6511,
7,
2197,
11,
783,
1343,
47744,
1635,
530,
62,
820,
8,
198,
220,
220,
220,
705,
28177,
257,
614,
6,
628,
220,
220,
220,
13163,
703,
62,
6511,
7,
2197,
11,
783,
1343,
1160,
1635,
530,
62,
11374,
8,
198,
220,
220,
220,
705,
1238,
2431,
6,
628,
220,
220,
220,
13163,
703,
62,
6511,
7,
2197,
11,
783,
1343,
362,
1635,
21268,
1635,
530,
62,
820,
8,
198,
220,
220,
220,
705,
28177,
734,
812,
6,
628,
220,
220,
220,
13163,
703,
62,
6511,
7,
2197,
11,
783,
1343,
513,
13,
1495,
1635,
21268,
1635,
530,
62,
820,
8,
198,
220,
220,
220,
705,
2502,
513,
812,
6,
628,
220,
220,
220,
13163,
703,
62,
6511,
7,
2197,
11,
783,
1343,
352,
13,
1495,
1635,
21268,
1635,
530,
62,
820,
8,
198,
220,
220,
220,
705,
2502,
257,
614,
6,
628,
220,
220,
220,
13163,
703,
62,
6511,
7,
40838,
22784,
9439,
7,
40838,
3419,
4008,
198,
220,
220,
220,
705,
16,
1110,
6,
628,
220,
220,
220,
13163,
703,
62,
6511,
7,
40838,
22784,
783,
1343,
530,
62,
10464,
8,
198,
220,
220,
220,
705,
22,
1528,
6,
628,
220,
220,
220,
13163,
703,
62,
6511,
7,
2197,
11,
640,
13,
2435,
28955,
198,
220,
220,
220,
705,
64,
2589,
6,
628,
220,
220,
220,
13163,
4054,
796,
10352,
198,
220,
220,
220,
13163,
1949,
25,
198,
220,
220,
220,
2644,
220,
220,
220,
703,
62,
6511,
7,
2197,
11,
6045,
8,
198,
220,
220,
220,
2644,
2845,
5994,
12331,
25,
198,
220,
220,
220,
2644,
220,
220,
220,
4054,
796,
6407,
198,
220,
220,
220,
13163,
4054,
198,
220,
220,
220,
6407,
628,
220,
220,
220,
37227,
198,
220,
220,
220,
1303,
79,
2645,
600,
25,
15560,
28,
49,
2931,
1065,
628,
220,
220,
220,
825,
355,
62,
19608,
8079,
7,
1092,
2435,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
3103,
1851,
1988,
284,
4818,
8079,
37811,
198,
220,
220,
220,
220,
220,
220,
220,
611,
318,
39098,
7,
1092,
2435,
11,
4818,
8079,
13,
19608,
8079,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
17949,
198,
220,
220,
220,
220,
220,
220,
220,
1288,
361,
318,
39098,
7,
1092,
2435,
11,
4818,
8079,
13,
4475,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
4818,
8079,
13,
19608,
8079,
7,
1092,
2435,
13,
1941,
11,
17949,
13,
8424,
11,
17949,
13,
820,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1288,
361,
17949,
318,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
31456,
796,
705,
4475,
11,
4818,
8079,
393,
41033,
2672,
357,
14202,
3804,
33047,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5298,
5994,
12331,
7,
19662,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
4818,
8079,
13,
19608,
8079,
13,
6738,
16514,
27823,
7,
1092,
2435,
8,
628,
220,
220,
220,
814,
796,
355,
62,
19608,
8079,
7,
2435,
17,
8,
532,
355,
62,
19608,
8079,
7,
2435,
16,
8,
628,
220,
220,
220,
611,
814,
13,
12545,
1875,
21268,
9,
17,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1255,
796,
705,
2502,
4064,
67,
812,
6,
4064,
357,
26069,
13,
12545,
1220,
21268,
8,
198,
220,
220,
220,
1288,
361,
814,
13,
12545,
1875,
21268,
9,
16,
13,
2425,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1255,
796,
705,
28177,
734,
812,
6,
198,
220,
220,
220,
1288,
361,
814,
13,
12545,
1875,
21268,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1255,
796,
705,
2502,
257,
614,
6,
198,
220,
220,
220,
1288,
361,
814,
13,
12545,
1875,
11470,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1255,
796,
705,
28177,
257,
614,
6,
198,
220,
220,
220,
1288,
361,
814,
13,
12545,
1875,
3126,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1255,
796,
705,
2502,
4064,
67,
1933,
6,
4064,
357,
26069,
13,
12545,
1220,
1542,
8,
198,
220,
220,
220,
1288,
361,
814,
13,
12545,
1875,
1542,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1255,
796,
705,
2502,
257,
1227,
6,
198,
220,
220,
220,
1288,
361,
814,
13,
12545,
1875,
1478,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1255,
796,
705,
4,
67,
2745,
6,
4064,
357,
26069,
13,
12545,
1220,
767,
8,
198,
220,
220,
220,
1288,
361,
814,
13,
12545,
1875,
352,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1255,
796,
705,
4,
67,
1528,
6,
4064,
814,
13,
12545,
198,
220,
220,
220,
1288,
361,
814,
13,
12545,
6624,
352,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1255,
796,
705,
16,
1110,
6,
198,
220,
220,
220,
1288,
361,
814,
13,
43012,
1875,
4570,
405,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1255,
796,
705,
4,
67,
2250,
6,
4064,
493,
7,
26069,
13,
43012,
1220,
4570,
405,
8,
198,
220,
220,
220,
1288,
361,
814,
13,
43012,
1875,
3126,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1255,
796,
705,
4,
67,
2431,
6,
4064,
493,
7,
26069,
13,
43012,
1220,
3126,
8,
198,
220,
220,
220,
1288,
361,
814,
13,
43012,
1875,
657,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1255,
796,
705,
4,
67,
4201,
6,
4064,
493,
7,
26069,
13,
43012,
8,
198,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1255,
796,
705,
64,
2589,
6,
198,
220,
220,
220,
1441,
1255,
198,
198,
4299,
703,
62,
6511,
62,
3839,
7,
1092,
2435,
11,
1201,
28,
14202,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
16409,
257,
4731,
326,
8477,
262,
3580,
1022,
597,
640,
290,
783,
13,
628,
220,
220,
220,
13163,
783,
796,
783,
3419,
628,
220,
220,
220,
13163,
703,
62,
6511,
62,
3839,
7,
2197,
532,
4818,
8079,
13,
16514,
276,
12514,
7,
16,
8,
1635,
362,
8,
198,
220,
220,
220,
705,
17,
1528,
2084,
6,
628,
220,
220,
220,
13163,
703,
62,
6511,
62,
3839,
7,
2197,
1343,
1160,
1635,
530,
62,
11374,
8,
198,
220,
220,
220,
705,
1129,
2431,
422,
783,
6,
628,
220,
220,
220,
13163,
703,
62,
6511,
62,
3839,
7,
2197,
532,
1160,
1635,
530,
62,
11374,
8,
198,
220,
220,
220,
705,
1238,
2431,
2084,
6,
628,
220,
220,
220,
13163,
703,
62,
6511,
62,
3839,
7,
2197,
532,
1160,
1635,
530,
62,
11374,
11,
783,
532,
838,
1635,
530,
62,
11374,
8,
198,
220,
220,
220,
705,
940,
2431,
2084,
6,
628,
220,
220,
220,
37227,
198,
220,
220,
220,
826,
62,
2197,
796,
1201,
393,
783,
3419,
198,
220,
220,
220,
611,
17949,
1279,
826,
62,
2197,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
703,
62,
6511,
7,
1092,
2435,
11,
826,
62,
2197,
8,
1343,
705,
2084,
6,
198,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
703,
62,
6511,
7,
3506,
62,
2197,
11,
17949,
8,
1343,
705,
422,
783,
6,
628,
198,
4299,
318,
62,
4868,
88,
7,
26801,
2599,
198,
220,
220,
220,
37227,
9288,
284,
766,
611,
281,
2134,
481,
11629,
378,
588,
257,
1351,
628,
220,
220,
220,
13163,
318,
62,
4868,
88,
26933,
16,
11,
17,
11,
18,
12962,
198,
220,
220,
220,
6407,
628,
220,
220,
220,
13163,
318,
62,
4868,
88,
7,
2617,
26933,
18,
11,
19,
11,
20,
60,
4008,
198,
220,
220,
220,
6407,
628,
220,
220,
220,
13163,
318,
62,
4868,
88,
19510,
18,
11,
19,
11,
20,
4008,
198,
220,
220,
220,
6407,
628,
220,
220,
220,
13163,
318,
62,
4868,
88,
7,
11600,
7,
64,
28,
16,
11,
275,
28,
17,
4008,
198,
220,
220,
220,
10352,
628,
220,
220,
220,
13163,
318,
62,
4868,
88,
10786,
10163,
11537,
198,
220,
220,
220,
10352,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
1441,
318,
39098,
7,
26801,
11,
357,
4868,
11,
46545,
11,
900,
4008,
628,
198,
4299,
4155,
62,
4868,
88,
7,
26801,
2599,
198,
220,
220,
220,
37227,
641,
495,
2134,
318,
12908,
287,
257,
1351,
611,
340,
460,
470,
17438,
588,
530,
628,
220,
220,
220,
13163,
4155,
62,
4868,
88,
10786,
1662,
1351,
88,
11537,
198,
220,
220,
220,
37250,
1662,
1351,
88,
20520,
628,
220,
220,
220,
13163,
4155,
62,
4868,
88,
7,
17816,
282,
1493,
1351,
88,
6,
12962,
198,
220,
220,
220,
37250,
282,
1493,
1351,
88,
20520,
628,
220,
220,
220,
13163,
4155,
62,
4868,
88,
26933,
12962,
198,
220,
220,
220,
17635,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
611,
318,
62,
4868,
88,
7,
26801,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
26181,
198,
220,
220,
220,
1441,
685,
26801,
60,
628,
628,
198,
4299,
18941,
62,
1462,
46491,
22046,
11,
12429,
46265,
22046,
2599,
198,
220,
220,
220,
37227,
13615,
257,
18941,
2882,
329,
257,
10289,
526,
15931,
198,
220,
220,
220,
1441,
2297,
1060,
273,
46491,
22046,
11,
12429,
46265,
22046,
8,
628,
198,
4299,
1363,
7,
1177,
28,
14202,
2599,
198,
220,
220,
220,
37227,
7738,
1060,
284,
3586,
1363,
13,
628,
220,
220,
220,
37227,
198,
220,
220,
220,
611,
1570,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
18941,
62,
1462,
7,
6371,
62,
1640,
62,
7700,
7,
1177,
4008,
198,
220,
220,
220,
1441,
18941,
62,
1462,
7,
6371,
62,
1640,
62,
7700,
28955,
628,
198,
4299,
555,
271,
8635,
7,
2100,
2599,
198,
220,
220,
220,
37227,
21230,
306,
10385,
284,
28000,
1098,
628,
220,
220,
220,
13163,
555,
271,
8635,
7,
14202,
8,
198,
220,
220,
220,
10148,
628,
220,
220,
220,
13163,
555,
271,
8635,
7,
65,
6,
10163,
11537,
198,
220,
220,
220,
705,
10163,
6,
628,
220,
220,
220,
13163,
555,
271,
8635,
7,
198,
220,
220,
220,
2644,
220,
220,
220,
220,
275,
6,
6852,
27705,
18,
6852,
87,
6659,
6852,
87,
6052,
6852,
27705,
18,
6852,
87,
6469,
6852,
87,
6052,
6852,
27705,
18,
6852,
87,
6659,
6852,
87,
397,
6852,
27705,
18,
6852,
87,
6659,
6,
198,
220,
220,
220,
2644,
220,
220,
220,
220,
275,
6,
6852,
27865,
16,
6852,
27705,
18,
6852,
87,
6659,
6852,
87,
1878,
6852,
27705,
19,
6852,
30894,
23,
6852,
87,
4846,
6852,
27705,
22,
6852,
87,
3865,
6852,
87,
23,
66,
6,
198,
220,
220,
220,
2644,
1267,
198,
220,
220,
220,
705,
46036,
22174,
28618,
2515,
94,
31676,
10310,
244,
45911,
234,
6,
628,
220,
220,
220,
13163,
555,
271,
8635,
7,
16,
8,
198,
220,
220,
220,
705,
16,
6,
628,
220,
220,
220,
37227,
198,
220,
220,
220,
611,
1188,
318,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
10148,
198,
220,
220,
220,
1288,
361,
318,
39098,
7,
2100,
11,
9881,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
1949,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1188,
796,
1188,
13,
12501,
1098,
10786,
40477,
12,
23,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
2845,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1188,
796,
1188,
13,
12501,
1098,
10786,
49022,
12,
16,
11537,
198,
220,
220,
220,
1288,
361,
407,
318,
39098,
7,
2100,
11,
965,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
1188,
796,
965,
7,
2100,
8,
198,
220,
220,
220,
1441,
1188,
628,
198,
4299,
2639,
8635,
7,
11299,
2599,
198,
220,
220,
220,
37227,
13615,
27711,
421,
5191,
2196,
286,
2695,
628,
220,
220,
220,
13163,
2639,
8635,
7,
65,
6,
1212,
714,
307,
1279,
45573,
1512,
29,
11537,
198,
220,
220,
220,
705,
1212,
714,
307,
1222,
2528,
26,
45573,
1512,
5,
13655,
26,
6,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
1441,
7808,
62,
16794,
364,
7,
6494,
22708,
7,
403,
271,
8635,
7,
11299,
22305,
628,
198,
4299,
27711,
22708,
7,
5239,
2599,
198,
220,
220,
220,
37227,
27195,
4147,
4600,
5239,
63,
329,
8246,
779,
287,
11532,
13,
628,
220,
220,
220,
13163,
27711,
22708,
7,
84,
1,
27,
6,
5,
6852,
5320,
4943,
198,
220,
220,
220,
705,
5,
2528,
26,
5,
2,
2670,
26,
5,
696,
26,
5,
421,
313,
26,
5,
13655,
26,
6,
628,
220,
220,
220,
13163,
27711,
22708,
7203,
27,
6,
5,
6852,
5320,
4943,
198,
220,
220,
220,
705,
5,
2528,
26,
5,
2,
2670,
26,
5,
696,
26,
5,
421,
313,
26,
5,
13655,
26,
6,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
36205,
796,
357,
198,
220,
220,
220,
220,
220,
220,
220,
19203,
5,
3256,
705,
5,
696,
26,
33809,
198,
220,
220,
220,
220,
220,
220,
220,
19203,
27,
3256,
705,
5,
2528,
26,
33809,
198,
220,
220,
220,
220,
220,
220,
220,
19203,
29,
3256,
705,
5,
13655,
26,
33809,
198,
220,
220,
220,
220,
220,
220,
220,
5855,
6,
1600,
705,
5,
2,
2670,
26,
33809,
198,
220,
220,
220,
220,
220,
220,
220,
19203,
1,
3256,
705,
5,
421,
313,
26,
33809,
198,
220,
220,
220,
1267,
198,
220,
220,
220,
329,
9014,
287,
36205,
25,
198,
220,
220,
220,
220,
220,
220,
220,
2420,
796,
2420,
13,
33491,
46491,
35666,
5592,
8,
198,
220,
220,
220,
1441,
2420,
628,
198,
4299,
651,
62,
4102,
2902,
62,
1102,
332,
353,
33529,
198,
220,
220,
220,
37227,
13615,
257,
17839,
1317,
2902,
38394,
628,
220,
220,
220,
13163,
1317,
2902,
7203,
64,
16410,
20763,
346,
676,
11907,
1332,
4943,
198,
220,
220,
220,
705,
27,
79,
29,
64,
1279,
64,
1398,
2625,
20763,
346,
676,
1,
13291,
2625,
20763,
346,
676,
13,
6494,
5320,
20763,
346,
676,
3556,
64,
29,
1332,
3556,
79,
29,
6,
628,
220,
220,
220,
13163,
1317,
2902,
7203,
64,
16410,
20763,
346,
676,
13,
6494,
11907,
1332,
4943,
198,
220,
220,
220,
705,
27,
79,
29,
64,
16410,
20763,
346,
676,
13,
6494,
11907,
1332,
3556,
79,
29,
6,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
33849,
796,
37250,
83,
2977,
3256,
705,
4299,
62,
4868,
3256,
705,
20763,
346,
2973,
3256,
705,
40301,
20520,
198,
220,
220,
220,
4566,
82,
796,
1391,
6,
20763,
346,
2973,
10354,
685,
10786,
11249,
62,
6371,
3256,
19016,
62,
38272,
15437,
92,
198,
220,
220,
220,
38394,
796,
2940,
2902,
7,
2302,
5736,
28,
2302,
8847,
11,
7552,
62,
11250,
82,
28,
11250,
82,
8,
198,
220,
220,
220,
1441,
38394,
628,
198,
4102,
2902,
62,
1102,
332,
353,
796,
651,
62,
4102,
2902,
62,
1102,
332,
353,
3419,
220,
1303,
16926,
46,
25,
11705,
1352,
2427,
30,
628,
198,
4299,
1317,
2902,
7,
11299,
2599,
198,
220,
220,
220,
37227,
41762,
2695,
351,
1317,
2902,
628,
220,
220,
220,
13163,
1317,
2902,
10786,
5661,
12429,
271,
1174,
10758,
11537,
198,
220,
220,
220,
705,
27,
79,
29,
5661,
1279,
11576,
29,
271,
3556,
11576,
29,
10758,
3556,
79,
29,
6,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
1441,
1317,
2902,
62,
1102,
332,
353,
13,
1102,
1851,
7,
2213,
320,
7,
11299,
4008,
628,
198,
4299,
3440,
7,
6978,
3672,
11,
21004,
11639,
40477,
12,
23,
6,
2599,
198,
220,
220,
220,
37227,
5569,
257,
2393,
290,
1441,
262,
10154,
37811,
628,
220,
220,
220,
49706,
796,
18931,
13,
1136,
11187,
1362,
7,
834,
3672,
834,
8,
198,
220,
220,
220,
49706,
13,
24442,
10786,
2220,
4064,
81,
3256,
3108,
3672,
8,
198,
220,
220,
220,
351,
1280,
7,
6978,
3672,
11,
21004,
28,
12685,
7656,
8,
355,
9173,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
9173,
13,
961,
3419,
628,
198,
4299,
3440,
62,
11299,
7,
6978,
3672,
11,
1635,
22046,
11,
12429,
46265,
22046,
2599,
198,
220,
220,
220,
37227,
8912,
257,
2695,
2393,
290,
779,
340,
284,
5794,
10007,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
318,
7753,
796,
28686,
13,
6978,
13,
4468,
576,
628,
220,
220,
220,
611,
407,
318,
7753,
7,
6978,
3672,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
329,
7552,
287,
37250,
6494,
3256,
705,
9132,
3256,
705,
14116,
6,
5974,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
318,
7753,
7,
6978,
3672,
1343,
705,
2637,
1343,
7552,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3108,
3672,
796,
3108,
3672,
1343,
705,
2637,
1343,
7552,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2270,
628,
220,
220,
220,
11055,
796,
3440,
7,
6978,
3672,
8,
198,
220,
220,
220,
611,
11055,
25,
198,
220,
220,
220,
220,
220,
220,
220,
2695,
796,
4174,
62,
16794,
364,
7,
28243,
11,
6045,
11,
685,
46265,
22046,
35944,
18982,
46491,
22046,
11,
12429,
46265,
22046,
8,
198,
220,
220,
220,
220,
220,
220,
220,
611,
3108,
3672,
13,
437,
2032,
342,
7,
4458,
6494,
6,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1255,
796,
2695,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1255,
796,
1317,
2902,
7,
11299,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
1255,
198,
220,
220,
220,
1441,
10148,
628,
198,
4299,
3440,
62,
28243,
7,
3672,
11,
4277,
28,
14202,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
8778,
257,
11055,
422,
262,
7505,
9483,
13,
628,
220,
220,
220,
5825,
17041,
3221,
423,
764,
6494,
2393,
18366,
290,
428,
8265,
198,
220,
220,
220,
481,
7048,
326,
338,
644,
318,
10348,
4556,
4306,
7368,
13,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
2524,
796,
19792,
13,
10057,
13,
25927,
13,
15654,
198,
220,
220,
220,
598,
796,
19792,
13,
10057,
13,
25927,
13,
1324,
198,
220,
220,
220,
24019,
62,
6978,
82,
796,
4648,
929,
7,
1324,
13,
11498,
17041,
62,
6978,
82,
1343,
2524,
13,
11498,
17041,
62,
6978,
82,
8,
628,
220,
220,
220,
611,
407,
705,
2637,
287,
1438,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1438,
796,
1438,
1343,
45302,
6494,
6,
628,
220,
220,
220,
611,
31051,
6,
287,
1438,
393,
705,
6852,
6,
287,
1438,
25,
198,
220,
220,
220,
220,
220,
220,
220,
5298,
35528,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
3118,
540,
284,
779,
7368,
11055,
3108,
13,
220,
705,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
12966,
17041,
389,
5140,
287,
7505,
24512,
2637,
198,
220,
220,
220,
220,
220,
220,
220,
1267,
628,
220,
220,
220,
1303,
1441,
705,
23442,
3404,
6,
198,
220,
220,
220,
1441,
2524,
13,
11498,
17041,
13,
2617,
12286,
7,
3672,
11,
3440,
62,
28243,
62,
7753,
7,
3672,
11,
4277,
4008,
198,
198,
4299,
651,
62,
28243,
7,
28243,
62,
3672,
11639,
12286,
3256,
7505,
11639,
12286,
6,
2599,
198,
220,
220,
220,
37227,
3855,
2524,
2443,
11055,
37811,
628,
220,
220,
220,
49706,
796,
18931,
13,
1136,
11187,
1362,
7,
834,
3672,
834,
8,
198,
220,
220,
220,
3108,
796,
19792,
13,
10057,
13,
15654,
13,
1169,
6880,
62,
6978,
628,
220,
220,
220,
3108,
3672,
796,
28686,
13,
6978,
13,
5305,
6978,
7,
198,
220,
220,
220,
220,
220,
220,
220,
28686,
13,
6978,
13,
22179,
7,
6978,
11,
7505,
11,
11055,
62,
3672,
1343,
45302,
6494,
11537,
198,
220,
220,
220,
1267,
198,
220,
220,
220,
611,
28686,
13,
6978,
13,
4468,
576,
7,
6978,
3672,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
49706,
13,
24442,
10786,
1136,
62,
28243,
4064,
81,
3256,
3108,
3672,
8,
198,
220,
220,
220,
220,
220,
220,
220,
351,
1280,
7,
6978,
3672,
11,
705,
26145,
11537,
355,
9173,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
9173,
13,
961,
22446,
12501,
1098,
10786,
40477,
23,
11537,
198,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
611,
11055,
62,
3672,
6624,
705,
12286,
10354,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
49706,
13,
18224,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
12286,
11055,
4064,
82,
4814,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
28686,
13,
6978,
13,
5305,
6978,
7,
6978,
3672,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5298,
19792,
13,
1069,
11755,
13,
47863,
30800,
43730,
16922,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
19463,
11055,
4814,
4064,
81,
6,
4064,
3108,
3672,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
49706,
13,
43917,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
28243,
4064,
81,
4814,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3108,
3672,
11,
198,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
651,
62,
28243,
10786,
12286,
3256,
7505,
8,
198,
198,
4299,
40565,
3361,
776,
46491,
22046,
2599,
198,
220,
220,
220,
37227,
35561,
262,
4067,
286,
257,
3210,
40305,
11171,
37811,
198,
220,
220,
220,
1103,
6978,
796,
28686,
13,
6978,
13,
5305,
6978,
198,
220,
220,
220,
26672,
3672,
796,
28686,
13,
6978,
13,
15908,
3672,
198,
220,
220,
220,
4654,
796,
28686,
13,
6978,
13,
22179,
198,
220,
220,
220,
1441,
1103,
6978,
7,
22179,
7,
5305,
6978,
7,
15908,
3672,
7,
89,
4207,
13,
834,
7753,
834,
36911,
705,
492,
3256,
1635,
22046,
4008,
628,
198,
4299,
7808,
62,
16794,
364,
7,
11299,
2599,
198,
220,
220,
220,
37227,
3866,
1151,
31904,
7007,
422,
852,
5901,
37811,
198,
220,
220,
220,
1441,
2695,
13,
33491,
10786,
27007,
3256,
705,
30109,
1831,
13679,
737,
33491,
10786,
11709,
3256,
705,
12,
1831,
11907,
11537,
628,
198,
4299,
11169,
62,
16794,
364,
7,
11299,
2599,
198,
220,
220,
220,
37227,
19452,
2850,
2695,
49385,
284,
511,
6678,
1296,
37811,
198,
220,
220,
220,
1441,
2695,
13,
33491,
10786,
30109,
1831,
0,
3256,
705,
27007,
27691,
33491,
10786,
12,
1831,
11907,
3256,
705,
11709,
11537,
628
] | 2.369754 | 5,528 |
# -*- coding: utf-8 -*-
import json
import os
import requests
import urllib.request
import time
import re
from bs4 import BeautifulSoup
from slackclient import SlackClient
from flask import Flask, request, make_response, render_template, jsonify
from selenium import webdriver
# 바꼈지롱
app = Flask(__name__)
app.config['JSON_AS_ASCII'] = False
with open('SlackBotKey.json') as f:
slackKeys = json.load(f)
slack_token = slackKeys["slack_token"]
slack_client_id = slackKeys["slack_client_id"]
slack_client_secret = slackKeys["slack_client_secret"]
slack_verification = slackKeys["slack_verification"]
sc = SlackClient(slack_token)
# 메인페이지 함수
@app.route("/", methods=["GET"])
# 사용자의 입력에 대한 분석 결과를 return하는 함수.
# DialogFlow를 통해 사용자의 입력에 대응하는 Intent와 Speech를 return.
# event handle 함수
# 사용자의 입력을 처리하는 함수
# 사용자의 입력에 매칭되는 event를 찾는다.
@app.route("/listening", methods=["GET", "POST"])
# Intent가 Bugs로 판단되면 실행.
# 벅스뮤직 인기순위 1~10위 곡 제목 + 아티스트 크롤링 함수
# Intent가 Default Welcome Intent로 판단되면 실행.
# Intent가 Road Address로 판단되면 실행.
# Intent가 제대로 정의되지 않으면 실행.
# Main함수
if __name__ == '__main__':
app.run('0.0.0.0', port=8080)
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
33918,
198,
11748,
28686,
198,
11748,
7007,
198,
11748,
2956,
297,
571,
13,
25927,
198,
11748,
640,
198,
11748,
302,
198,
6738,
275,
82,
19,
1330,
23762,
50,
10486,
198,
6738,
30740,
16366,
1330,
36256,
11792,
198,
6738,
42903,
1330,
46947,
11,
2581,
11,
787,
62,
26209,
11,
8543,
62,
28243,
11,
33918,
1958,
198,
6738,
384,
11925,
1505,
1330,
3992,
26230,
198,
198,
2,
31619,
108,
242,
166,
120,
230,
168,
100,
222,
167,
94,
109,
198,
198,
1324,
796,
46947,
7,
834,
3672,
834,
8,
198,
1324,
13,
11250,
17816,
40386,
62,
1921,
62,
42643,
3978,
20520,
796,
10352,
198,
198,
4480,
1280,
10786,
11122,
441,
20630,
9218,
13,
17752,
11537,
355,
277,
25,
198,
220,
220,
220,
30740,
40729,
796,
33918,
13,
2220,
7,
69,
8,
198,
6649,
441,
62,
30001,
796,
30740,
40729,
14692,
6649,
441,
62,
30001,
8973,
198,
6649,
441,
62,
16366,
62,
312,
796,
30740,
40729,
14692,
6649,
441,
62,
16366,
62,
312,
8973,
198,
6649,
441,
62,
16366,
62,
21078,
796,
30740,
40729,
14692,
6649,
441,
62,
16366,
62,
21078,
8973,
198,
6649,
441,
62,
332,
2649,
796,
30740,
40729,
14692,
6649,
441,
62,
332,
2649,
8973,
198,
1416,
796,
36256,
11792,
7,
6649,
441,
62,
30001,
8,
628,
198,
2,
31619,
102,
242,
35975,
116,
169,
236,
246,
35975,
112,
168,
100,
222,
220,
47991,
101,
168,
230,
246,
198,
31,
1324,
13,
38629,
7203,
14,
1600,
5050,
28,
14692,
18851,
8973,
8,
628,
198,
198,
2,
23821,
8955,
168,
248,
102,
168,
252,
238,
35975,
246,
23821,
252,
227,
167,
254,
98,
168,
245,
238,
31619,
234,
222,
47991,
250,
31619,
114,
226,
168,
226,
251,
220,
166,
110,
108,
166,
111,
120,
167,
98,
120,
1441,
47991,
246,
167,
232,
242,
220,
47991,
101,
168,
230,
246,
13,
198,
2,
21269,
519,
37535,
167,
98,
120,
220,
169,
228,
113,
47991,
112,
23821,
8955,
168,
248,
102,
168,
252,
238,
35975,
246,
23821,
252,
227,
167,
254,
98,
168,
245,
238,
31619,
234,
222,
35975,
239,
47991,
246,
167,
232,
242,
39168,
168,
247,
222,
24709,
167,
98,
120,
1441,
13,
628,
198,
2,
1785,
5412,
220,
47991,
101,
168,
230,
246,
628,
198,
2,
23821,
8955,
168,
248,
102,
168,
252,
238,
35975,
246,
23821,
252,
227,
167,
254,
98,
35975,
226,
23821,
110,
246,
167,
99,
105,
47991,
246,
167,
232,
242,
220,
47991,
101,
168,
230,
246,
198,
2,
23821,
8955,
168,
248,
102,
168,
252,
238,
35975,
246,
23821,
252,
227,
167,
254,
98,
168,
245,
238,
31619,
100,
97,
168,
117,
255,
167,
238,
246,
167,
232,
242,
1785,
167,
98,
120,
23821,
108,
122,
167,
232,
242,
46695,
97,
13,
198,
31,
1324,
13,
38629,
7203,
14,
4868,
3101,
1600,
5050,
28,
14692,
18851,
1600,
366,
32782,
8973,
8,
628,
198,
2,
39168,
166,
108,
222,
44991,
167,
94,
250,
220,
169,
234,
238,
46695,
101,
167,
238,
246,
167,
102,
112,
23821,
233,
97,
169,
244,
231,
13,
198,
2,
31619,
110,
227,
168,
232,
97,
167,
106,
97,
168,
100,
223,
23821,
251,
116,
166,
116,
108,
168,
230,
250,
168,
250,
226,
352,
93,
940,
168,
250,
226,
220,
166,
111,
94,
23821,
254,
250,
167,
103,
102,
1343,
23821,
243,
226,
169,
233,
108,
168,
232,
97,
169,
232,
116,
220,
169,
223,
105,
167,
94,
97,
167,
100,
223,
220,
47991,
101,
168,
230,
246,
628,
198,
2,
39168,
166,
108,
222,
15161,
19134,
39168,
167,
94,
250,
220,
169,
234,
238,
46695,
101,
167,
238,
246,
167,
102,
112,
23821,
233,
97,
169,
244,
231,
13,
628,
198,
2,
39168,
166,
108,
222,
5567,
17917,
167,
94,
250,
220,
169,
234,
238,
46695,
101,
167,
238,
246,
167,
102,
112,
23821,
233,
97,
169,
244,
231,
13,
628,
198,
2,
39168,
166,
108,
222,
23821,
254,
250,
167,
234,
222,
167,
94,
250,
23821,
254,
243,
35975,
246,
167,
238,
246,
168,
100,
222,
23821,
243,
232,
168,
250,
120,
167,
102,
112,
23821,
233,
97,
169,
244,
231,
13,
628,
198,
2,
8774,
47991,
101,
168,
230,
246,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
598,
13,
5143,
10786,
15,
13,
15,
13,
15,
13,
15,
3256,
2493,
28,
1795,
1795,
8,
198
] | 1.556164 | 730 |
"""A COCO annotation writer."""
import datetime
import json
from discolight.params.params import Params
from .types import AnnotationWriter
class COCO(AnnotationWriter):
"""A COCO annotation writer."""
def __init__(self, annotations_file):
"""Construct a COCO annotation writer."""
self.annotations_file = annotations_file
self.coco_json = {
"info": {
"year":
datetime.datetime.now().year,
"version":
1,
"description":
"Discolight augmented images",
"contributor":
"",
"url":
"",
"date_created":
datetime.datetime.utcnow().replace(
tzinfo=datetime.timezone.utc).isoformat(),
},
"categories": [],
"images": [],
"annotations": [],
"licenses": [],
}
self.image_counter = 0
self.annotation_counter = 0
self.category_counter = 0
self.license_counter = 0
self.unknown_license_id = None
self.old_license_id_to_new = {}
self.old_category_id_to_new = {}
self.class_idx_category_id = {}
def __enter__(self):
"""Open the annotation writer for writing."""
return self
def __exit__(self, _exc_type, _exc_val, _exc_tb):
"""Close the annotation writer for writing."""
with open(self.annotations_file, "w") as annotations_fp:
json.dump(self.coco_json, annotations_fp)
@staticmethod
def params():
"""Return a Params object describing constructor parameters."""
return Params().add(
"annotations_file",
"The path to the JSON file to write the annotations to", str, "",
True)
def get_image_license_id(self, annotations):
"""Retrieve the license ID of an image based on its annotations."""
licens = None
if len(annotations) > 1:
licens = annotations[0].additional_info[
"image_license"] if "image_license" in annotations[
0].additional_info else None
if licens is None and self.unknown_license_id is None:
self.unknown_license_id = self.license_counter
self.license_counter += 1
self.coco_json["licenses"].append({
"id": self.unknown_license_id,
"url": "",
"name": "Unknown"
})
return self.unknown_license_id
if licens is None and self.unknown_license_id is not None:
return self.unknown_license_id
new_license_id = self.old_license_id_to_new.get(
str(licens["id"]), None)
if new_license_id is None:
new_license_id = self.license_counter
self.license_counter += 1
self.old_license_id_to_new[str(licens["id"])] = new_license_id
self.coco_json["licenses"].append({
"id": new_license_id,
"url": licens["url"],
"name": licens["name"]
})
return new_license_id
return new_license_id
def get_annotation_category_id(self, annotation):
"""Retrieve the category ID of an annotation."""
if "category" in annotation.additional_info:
category = annotation.additional_info["category"]
new_category_id = self.old_category_id_to_new.get(
str(category["id"]), None)
if new_category_id is None:
new_category_id = self.category_counter
self.category_counter += 1
self.old_category_id_to_new[str(
category["id"])] = new_category_id
self.coco_json["categories"].append({
"id":
new_category_id,
"name":
category["name"],
"supercategory":
category["supercategory"]
})
return new_category_id
return new_category_id
category_id = self.class_idx_category_id.get(str(annotation.class_idx),
None)
if category_id is None:
category_id = self.category_counter
self.category_counter += 1
self.class_idx_category_id[str(annotation.class_idx)] = category_id
self.coco_json["categories"].append({
"id":
category_id,
"name":
"class{}".format(annotation.class_idx),
"supercategory":
"none"
})
return category_id
return category_id
def write_annotations_for_image(self, image_name, image, annotations):
"""Write annotations for the given image."""
height, width, _ = image.shape
image_id = self.image_counter
self.image_counter += 1
self.coco_json["images"].append({
"id":
image_id,
"license":
self.get_image_license_id(annotations),
"file_name":
image_name,
"height":
height,
"width":
width,
"date_captured":
datetime.datetime.utcnow().replace(
tzinfo=datetime.timezone.utc).isoformat()
})
for annotation in annotations:
annotation_id = self.annotation_counter
self.annotation_counter += 1
self.coco_json["annotations"].append({
"id":
annotation_id,
"image_id":
image_id,
"category_id":
self.get_annotation_category_id(annotation),
"bbox": [
annotation.x_min, annotation.y_min,
annotation.x_max - annotation.x_min,
annotation.y_max - annotation.y_min
],
"area": (annotation.x_max - annotation.x_min) *
(annotation.y_max - annotation.y_max),
"segmentation": [],
"iscrowd":
0
})
| [
37811,
32,
327,
4503,
46,
23025,
6260,
526,
15931,
198,
11748,
4818,
8079,
198,
11748,
33918,
198,
6738,
1221,
349,
432,
13,
37266,
13,
37266,
1330,
2547,
4105,
198,
6738,
764,
19199,
1330,
1052,
38983,
34379,
628,
198,
4871,
327,
4503,
46,
7,
2025,
38983,
34379,
2599,
628,
220,
220,
220,
37227,
32,
327,
4503,
46,
23025,
6260,
526,
15931,
628,
220,
220,
220,
825,
11593,
15003,
834,
7,
944,
11,
37647,
62,
7753,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
42316,
257,
327,
4503,
46,
23025,
6260,
526,
15931,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
34574,
602,
62,
7753,
796,
37647,
62,
7753,
628,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
66,
25634,
62,
17752,
796,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
10951,
1298,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
1941,
1298,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4818,
8079,
13,
19608,
8079,
13,
2197,
22446,
1941,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
9641,
1298,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
352,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
11213,
1298,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
15642,
349,
432,
30259,
4263,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
3642,
2455,
273,
1298,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
6371,
1298,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
4475,
62,
25598,
1298,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4818,
8079,
13,
19608,
8079,
13,
315,
66,
2197,
22446,
33491,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
256,
89,
10951,
28,
19608,
8079,
13,
2435,
11340,
13,
315,
66,
737,
26786,
18982,
22784,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8964,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
66,
26129,
1298,
685,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
17566,
1298,
685,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
34574,
602,
1298,
685,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
677,
4541,
1298,
685,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
1782,
628,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
9060,
62,
24588,
796,
657,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
1236,
14221,
62,
24588,
796,
657,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
22872,
62,
24588,
796,
657,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
43085,
62,
24588,
796,
657,
628,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
34680,
62,
43085,
62,
312,
796,
6045,
628,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
727,
62,
43085,
62,
312,
62,
1462,
62,
3605,
796,
23884,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
727,
62,
22872,
62,
312,
62,
1462,
62,
3605,
796,
23884,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
4871,
62,
312,
87,
62,
22872,
62,
312,
796,
23884,
628,
220,
220,
220,
825,
11593,
9255,
834,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
11505,
262,
23025,
6260,
329,
3597,
526,
15931,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
2116,
628,
220,
220,
220,
825,
11593,
37023,
834,
7,
944,
11,
4808,
41194,
62,
4906,
11,
4808,
41194,
62,
2100,
11,
4808,
41194,
62,
83,
65,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
26125,
262,
23025,
6260,
329,
3597,
526,
15931,
198,
220,
220,
220,
220,
220,
220,
220,
351,
1280,
7,
944,
13,
34574,
602,
62,
7753,
11,
366,
86,
4943,
355,
37647,
62,
46428,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
33918,
13,
39455,
7,
944,
13,
66,
25634,
62,
17752,
11,
37647,
62,
46428,
8,
628,
220,
220,
220,
2488,
12708,
24396,
198,
220,
220,
220,
825,
42287,
33529,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
13615,
257,
2547,
4105,
2134,
12059,
23772,
10007,
526,
15931,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
2547,
4105,
22446,
2860,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
34574,
602,
62,
7753,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
464,
3108,
284,
262,
19449,
2393,
284,
3551,
262,
37647,
284,
1600,
965,
11,
366,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6407,
8,
628,
220,
220,
220,
825,
651,
62,
9060,
62,
43085,
62,
312,
7,
944,
11,
37647,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
9781,
30227,
262,
5964,
4522,
286,
281,
2939,
1912,
319,
663,
37647,
526,
15931,
198,
220,
220,
220,
220,
220,
220,
220,
8240,
796,
6045,
628,
220,
220,
220,
220,
220,
220,
220,
611,
18896,
7,
34574,
602,
8,
1875,
352,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8240,
796,
37647,
58,
15,
4083,
2860,
1859,
62,
10951,
58,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
9060,
62,
43085,
8973,
611,
366,
9060,
62,
43085,
1,
287,
37647,
58,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
657,
4083,
2860,
1859,
62,
10951,
2073,
6045,
628,
220,
220,
220,
220,
220,
220,
220,
611,
8240,
318,
6045,
290,
2116,
13,
34680,
62,
43085,
62,
312,
318,
6045,
25,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
34680,
62,
43085,
62,
312,
796,
2116,
13,
43085,
62,
24588,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
43085,
62,
24588,
15853,
352,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
66,
25634,
62,
17752,
14692,
677,
4541,
1,
4083,
33295,
15090,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
312,
1298,
2116,
13,
34680,
62,
43085,
62,
312,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
6371,
1298,
366,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
3672,
1298,
366,
20035,
1,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
32092,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
2116,
13,
34680,
62,
43085,
62,
312,
628,
220,
220,
220,
220,
220,
220,
220,
611,
8240,
318,
6045,
290,
2116,
13,
34680,
62,
43085,
62,
312,
318,
407,
6045,
25,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
2116,
13,
34680,
62,
43085,
62,
312,
628,
220,
220,
220,
220,
220,
220,
220,
649,
62,
43085,
62,
312,
796,
2116,
13,
727,
62,
43085,
62,
312,
62,
1462,
62,
3605,
13,
1136,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
965,
7,
677,
641,
14692,
312,
8973,
828,
6045,
8,
628,
220,
220,
220,
220,
220,
220,
220,
611,
649,
62,
43085,
62,
312,
318,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
649,
62,
43085,
62,
312,
796,
2116,
13,
43085,
62,
24588,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
43085,
62,
24588,
15853,
352,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
727,
62,
43085,
62,
312,
62,
1462,
62,
3605,
58,
2536,
7,
677,
641,
14692,
312,
8973,
15437,
796,
649,
62,
43085,
62,
312,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
66,
25634,
62,
17752,
14692,
677,
4541,
1,
4083,
33295,
15090,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
312,
1298,
649,
62,
43085,
62,
312,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
6371,
1298,
8240,
14692,
6371,
33116,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
3672,
1298,
8240,
14692,
3672,
8973,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
32092,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
649,
62,
43085,
62,
312,
628,
220,
220,
220,
220,
220,
220,
220,
1441,
649,
62,
43085,
62,
312,
628,
220,
220,
220,
825,
651,
62,
1236,
14221,
62,
22872,
62,
312,
7,
944,
11,
23025,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
9781,
30227,
262,
6536,
4522,
286,
281,
23025,
526,
15931,
198,
220,
220,
220,
220,
220,
220,
220,
611,
366,
22872,
1,
287,
23025,
13,
2860,
1859,
62,
10951,
25,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6536,
796,
23025,
13,
2860,
1859,
62,
10951,
14692,
22872,
8973,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
649,
62,
22872,
62,
312,
796,
2116,
13,
727,
62,
22872,
62,
312,
62,
1462,
62,
3605,
13,
1136,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
965,
7,
22872,
14692,
312,
8973,
828,
6045,
8,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
649,
62,
22872,
62,
312,
318,
6045,
25,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
649,
62,
22872,
62,
312,
796,
2116,
13,
22872,
62,
24588,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
22872,
62,
24588,
15853,
352,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
727,
62,
22872,
62,
312,
62,
1462,
62,
3605,
58,
2536,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6536,
14692,
312,
8973,
15437,
796,
649,
62,
22872,
62,
312,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
66,
25634,
62,
17752,
14692,
66,
26129,
1,
4083,
33295,
15090,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
312,
1298,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
649,
62,
22872,
62,
312,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
3672,
1298,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6536,
14692,
3672,
33116,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
16668,
22872,
1298,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6536,
14692,
16668,
22872,
8973,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
32092,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
649,
62,
22872,
62,
312,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
649,
62,
22872,
62,
312,
628,
220,
220,
220,
220,
220,
220,
220,
6536,
62,
312,
796,
2116,
13,
4871,
62,
312,
87,
62,
22872,
62,
312,
13,
1136,
7,
2536,
7,
1236,
14221,
13,
4871,
62,
312,
87,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6045,
8,
628,
220,
220,
220,
220,
220,
220,
220,
611,
6536,
62,
312,
318,
6045,
25,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6536,
62,
312,
796,
2116,
13,
22872,
62,
24588,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
22872,
62,
24588,
15853,
352,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
4871,
62,
312,
87,
62,
22872,
62,
312,
58,
2536,
7,
1236,
14221,
13,
4871,
62,
312,
87,
15437,
796,
6536,
62,
312,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
66,
25634,
62,
17752,
14692,
66,
26129,
1,
4083,
33295,
15090,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
312,
1298,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6536,
62,
312,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
3672,
1298,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
4871,
90,
92,
1911,
18982,
7,
1236,
14221,
13,
4871,
62,
312,
87,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
16668,
22872,
1298,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
23108,
1,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
32092,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
6536,
62,
312,
628,
220,
220,
220,
220,
220,
220,
220,
1441,
6536,
62,
312,
628,
220,
220,
220,
825,
3551,
62,
34574,
602,
62,
1640,
62,
9060,
7,
944,
11,
2939,
62,
3672,
11,
2939,
11,
37647,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
16594,
37647,
329,
262,
1813,
2939,
526,
15931,
198,
220,
220,
220,
220,
220,
220,
220,
6001,
11,
9647,
11,
4808,
796,
2939,
13,
43358,
628,
220,
220,
220,
220,
220,
220,
220,
2939,
62,
312,
796,
2116,
13,
9060,
62,
24588,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
9060,
62,
24588,
15853,
352,
628,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
66,
25634,
62,
17752,
14692,
17566,
1,
4083,
33295,
15090,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
312,
1298,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2939,
62,
312,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
43085,
1298,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
1136,
62,
9060,
62,
43085,
62,
312,
7,
34574,
602,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
7753,
62,
3672,
1298,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2939,
62,
3672,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
17015,
1298,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6001,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
10394,
1298,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
9647,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
4475,
62,
27144,
1522,
1298,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4818,
8079,
13,
19608,
8079,
13,
315,
66,
2197,
22446,
33491,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
256,
89,
10951,
28,
19608,
8079,
13,
2435,
11340,
13,
315,
66,
737,
26786,
18982,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
32092,
628,
220,
220,
220,
220,
220,
220,
220,
329,
23025,
287,
37647,
25,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23025,
62,
312,
796,
2116,
13,
1236,
14221,
62,
24588,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
1236,
14221,
62,
24588,
15853,
352,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
66,
25634,
62,
17752,
14692,
34574,
602,
1,
4083,
33295,
15090,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
312,
1298,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23025,
62,
312,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
9060,
62,
312,
1298,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2939,
62,
312,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
22872,
62,
312,
1298,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
1136,
62,
1236,
14221,
62,
22872,
62,
312,
7,
1236,
14221,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
65,
3524,
1298,
685,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23025,
13,
87,
62,
1084,
11,
23025,
13,
88,
62,
1084,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23025,
13,
87,
62,
9806,
532,
23025,
13,
87,
62,
1084,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23025,
13,
88,
62,
9806,
532,
23025,
13,
88,
62,
1084,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
16589,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
20337,
1298,
357,
1236,
14221,
13,
87,
62,
9806,
532,
23025,
13,
87,
62,
1084,
8,
1635,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
357,
1236,
14221,
13,
88,
62,
9806,
532,
23025,
13,
88,
62,
9806,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
325,
5154,
341,
1298,
685,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
2304,
3986,
1298,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
657,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
32092,
198
] | 1.924081 | 3,293 |
from django.conf import settings
from django.utils.module_loading import import_string
from rest_framework.exceptions import AuthenticationFailed
from game.authentication.base_websocket_authentication import (
AbstractWebsocketAuthentication,
)
from game.models import AppUser
def authenticate_websocket(auth_header: str) -> AppUser:
"""Acts like authentication backends in Django.
Takes auth string from websocket authentication event
Returns AppUser instance or raises AuthenticationFailed
"""
for AuthClassString in settings.WEBSOCKET_AUTHENTICATION_CLASSES:
AuthClass = import_string(AuthClassString)
auth_instance: AbstractWebsocketAuthentication = AuthClass()
response = auth_instance.authenticate_auth_header(
auth_header=auth_header
)
if response:
return response[0]
raise AuthenticationFailed(
'No suitable AUTHENTICATION_CLASS to authenticate '
f'auth header "{auth_header}"'
)
| [
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
26791,
13,
21412,
62,
25138,
1330,
1330,
62,
8841,
198,
6738,
1334,
62,
30604,
13,
1069,
11755,
1330,
48191,
37,
6255,
198,
198,
6738,
983,
13,
41299,
3299,
13,
8692,
62,
732,
1443,
5459,
62,
41299,
3299,
1330,
357,
198,
220,
220,
220,
27741,
1135,
1443,
5459,
47649,
3299,
11,
198,
8,
198,
6738,
983,
13,
27530,
1330,
2034,
12982,
628,
198,
4299,
8323,
5344,
62,
732,
1443,
5459,
7,
18439,
62,
25677,
25,
965,
8,
4613,
2034,
12982,
25,
198,
220,
220,
220,
37227,
6398,
82,
588,
18239,
736,
2412,
287,
37770,
13,
198,
220,
220,
220,
33687,
6284,
4731,
422,
2639,
5459,
18239,
1785,
198,
220,
220,
220,
16409,
2034,
12982,
4554,
393,
12073,
48191,
37,
6255,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
329,
26828,
9487,
10100,
287,
6460,
13,
8845,
4462,
11290,
2767,
62,
32,
24318,
3525,
2149,
6234,
62,
31631,
1546,
25,
198,
220,
220,
220,
220,
220,
220,
220,
26828,
9487,
796,
1330,
62,
8841,
7,
30515,
9487,
10100,
8,
198,
220,
220,
220,
220,
220,
220,
220,
6284,
62,
39098,
25,
27741,
1135,
1443,
5459,
47649,
3299,
796,
26828,
9487,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2882,
796,
6284,
62,
39098,
13,
41299,
5344,
62,
18439,
62,
25677,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6284,
62,
25677,
28,
18439,
62,
25677,
198,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
611,
2882,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
2882,
58,
15,
60,
198,
220,
220,
220,
5298,
48191,
37,
6255,
7,
198,
220,
220,
220,
220,
220,
220,
220,
705,
2949,
11080,
37195,
3525,
2149,
6234,
62,
31631,
284,
8323,
5344,
705,
198,
220,
220,
220,
220,
220,
220,
220,
277,
6,
18439,
13639,
45144,
18439,
62,
25677,
92,
30543,
198,
220,
220,
220,
1267,
198
] | 3.012012 | 333 |
import spacy
# Carga el modelo en_core_web_sm
nlp = spacy.load("en_core_web_sm")
# Imprime en pantalla los nombres de los componentes del pipeline
print(nlp.pipe_names)
# Imprime en pantalla el pipeline entero de tuples (name, component)
print(nlp.pipeline)
| [
11748,
599,
1590,
198,
198,
2,
327,
853,
64,
1288,
2746,
78,
551,
62,
7295,
62,
12384,
62,
5796,
198,
21283,
79,
796,
599,
1590,
13,
2220,
7203,
268,
62,
7295,
62,
12384,
62,
5796,
4943,
198,
198,
2,
1846,
35505,
551,
15857,
30315,
22346,
299,
2381,
411,
390,
22346,
7515,
274,
1619,
11523,
198,
4798,
7,
21283,
79,
13,
34360,
62,
14933,
8,
198,
198,
2,
1846,
35505,
551,
15857,
30315,
1288,
11523,
920,
3529,
390,
12777,
2374,
357,
3672,
11,
7515,
8,
198,
4798,
7,
21283,
79,
13,
79,
541,
4470,
8,
198
] | 2.747368 | 95 |
#!/usr/bin/env python
import lib_robotis_xm430 as xm430
import sys
import time
# import rospy
# from o2as_precision_gripper.srv import *
######################################################################################################
#outer gripper related functions
###############################################################################################################
#inner gripper related functions
####linear motor
##########################################################################################
#for calibration of linear motor
# if __name__ == "__main__":
#initialise the class here
gripper = PrecisionGripper()
# rospy.init_node("combined_gripper_server")
# # serial_port = rospy.get_param("serial_port")
# # rospy.loginfo("Starting up on serial port: " + serial_port)
# my_service = rospy.Service('combined_gripper_command', PrecisionGripperCommand, gripper.my_callback)
# rospy.loginfo("Service combined_gripper is ready")
# rospy.spin()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
9195,
62,
305,
13645,
271,
62,
87,
76,
31794,
355,
2124,
76,
31794,
198,
11748,
25064,
198,
11748,
640,
198,
2,
1330,
686,
2777,
88,
198,
2,
422,
267,
17,
292,
62,
3866,
16005,
62,
70,
380,
2848,
13,
27891,
85,
1330,
1635,
628,
220,
220,
220,
1303,
29113,
29113,
29113,
4242,
2,
198,
220,
220,
220,
1303,
39605,
11120,
2848,
3519,
5499,
198,
220,
220,
220,
1303,
29113,
29113,
29113,
7804,
4242,
2235,
198,
220,
220,
220,
1303,
5083,
11120,
2848,
3519,
5499,
198,
220,
220,
220,
1303,
21017,
29127,
5584,
198,
220,
220,
220,
1303,
29113,
29113,
14468,
7804,
2,
198,
220,
220,
220,
1303,
1640,
36537,
286,
14174,
5584,
628,
198,
2,
611,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
2,
36733,
786,
262,
1398,
994,
198,
70,
380,
2848,
796,
39281,
38,
380,
2848,
3419,
198,
2,
686,
2777,
88,
13,
15003,
62,
17440,
7203,
24011,
1389,
62,
70,
380,
2848,
62,
15388,
4943,
198,
2,
1303,
11389,
62,
634,
796,
686,
2777,
88,
13,
1136,
62,
17143,
7203,
46911,
62,
634,
4943,
198,
2,
1303,
686,
2777,
88,
13,
6404,
10951,
7203,
22851,
510,
319,
11389,
2493,
25,
366,
1343,
11389,
62,
634,
8,
198,
198,
2,
616,
62,
15271,
796,
686,
2777,
88,
13,
16177,
10786,
24011,
1389,
62,
70,
380,
2848,
62,
21812,
3256,
39281,
38,
380,
2848,
21575,
11,
11120,
2848,
13,
1820,
62,
47423,
8,
198,
2,
686,
2777,
88,
13,
6404,
10951,
7203,
16177,
5929,
62,
70,
380,
2848,
318,
3492,
4943,
198,
2,
686,
2777,
88,
13,
39706,
3419,
198
] | 3.658182 | 275 |
from . import test_adapters
from . import test_explore
from . import test_image
from . import test_metrics
from . import test_missing
from . import test_numeric
from . import test_shaping
from . import test_text
| [
6738,
764,
1330,
1332,
62,
324,
12126,
198,
6738,
764,
1330,
1332,
62,
20676,
382,
198,
6738,
764,
1330,
1332,
62,
9060,
198,
6738,
764,
1330,
1332,
62,
4164,
10466,
198,
6738,
764,
1330,
1332,
62,
45688,
198,
6738,
764,
1330,
1332,
62,
77,
39223,
198,
6738,
764,
1330,
1332,
62,
1477,
9269,
198,
6738,
764,
1330,
1332,
62,
5239,
198
] | 3.47541 | 61 |
"""
Provide quantilized form of torch.nn.modules.activation
"""
import torch
import torch.nn as nn
import torch.nn.functional as F
from .number import directquant, alldirectquant
| [
37811,
198,
15946,
485,
5554,
346,
1143,
1296,
286,
28034,
13,
20471,
13,
18170,
13,
48545,
198,
37811,
198,
198,
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
198,
198,
6738,
764,
17618,
1330,
1277,
40972,
11,
477,
12942,
40972,
628,
198
] | 3.45283 | 53 |
import dbus
import logging
import RequestQueue
log = logging.getLogger(__name__)
## The main interface for the Charon file service.
#
# This contains the main interface definition for the Charon file service.
# It is exposed over DBus as the "nl.ultimaker.charon" service, with
# "/nl/ultimaker/charon" as its object path and all functions registered
# in the "nl.ultimaker.charon" interface name.
#
# The file service maintains a queue of jobs that need to be processed.
# See RequestQueue for details on this process.
#
# Note: This class does not currently use type hinting since type hints,
# dbus-python decorators and Python 3.4 do not mix well.
| [
11748,
288,
10885,
198,
11748,
18931,
198,
198,
11748,
19390,
34991,
198,
198,
6404,
796,
18931,
13,
1136,
11187,
1362,
7,
834,
3672,
834,
8,
198,
198,
2235,
220,
383,
1388,
7071,
329,
262,
3178,
261,
2393,
2139,
13,
198,
2,
198,
2,
220,
220,
770,
4909,
262,
1388,
7071,
6770,
329,
262,
3178,
261,
2393,
2139,
13,
198,
2,
220,
220,
632,
318,
7362,
625,
360,
16286,
355,
262,
366,
21283,
13,
586,
320,
3110,
13,
354,
8045,
1,
2139,
11,
351,
198,
2,
220,
220,
12813,
21283,
14,
586,
320,
3110,
14,
354,
8045,
1,
355,
663,
2134,
3108,
290,
477,
5499,
6823,
198,
2,
220,
220,
287,
262,
366,
21283,
13,
586,
320,
3110,
13,
354,
8045,
1,
7071,
1438,
13,
198,
2,
198,
2,
220,
220,
383,
2393,
2139,
16047,
257,
16834,
286,
3946,
326,
761,
284,
307,
13686,
13,
198,
2,
220,
220,
4091,
19390,
34991,
329,
3307,
319,
428,
1429,
13,
198,
2,
198,
2,
220,
220,
5740,
25,
770,
1398,
857,
407,
3058,
779,
2099,
9254,
278,
1201,
2099,
20269,
11,
198,
2,
220,
220,
288,
10885,
12,
29412,
11705,
2024,
290,
11361,
513,
13,
19,
466,
407,
5022,
880,
13,
198
] | 3.376884 | 199 |
from HelpersCsv import ParseCsv, WriteCsv
import argparse
import sys
parser = argparse.ArgumentParser()
parser.add_argument('--path', '-p', help="path of input data", type=str)
parser.add_argument('--hasheaders', '-hh', help="if file has headers", type=int, default=0)
parser.add_argument('--distance', '-d', help="pass 1 for manhattan and 2 for euclidean", type=int)
if __name__ == '__main__':
args = parser.parse_args()
pcsv = ParseCsv(args.path, has_headers=args.hasheaders)
data = pcsv.get_data()
distances = calculate_distance(data, args.distance)
wcsv = WriteCsv(filename='distances.txt')
wcsv.write_data(distances)
| [
6738,
10478,
364,
34,
21370,
1330,
2547,
325,
34,
21370,
11,
19430,
34,
21370,
198,
11748,
1822,
29572,
198,
11748,
25064,
198,
198,
48610,
796,
1822,
29572,
13,
28100,
1713,
46677,
3419,
198,
48610,
13,
2860,
62,
49140,
10786,
438,
6978,
3256,
705,
12,
79,
3256,
1037,
2625,
6978,
286,
5128,
1366,
1600,
2099,
28,
2536,
8,
198,
48610,
13,
2860,
62,
49140,
10786,
438,
10134,
50145,
3256,
705,
12,
12337,
3256,
1037,
2625,
361,
2393,
468,
24697,
1600,
2099,
28,
600,
11,
4277,
28,
15,
8,
198,
48610,
13,
2860,
62,
49140,
10786,
438,
30246,
3256,
705,
12,
67,
3256,
1037,
2625,
6603,
352,
329,
582,
12904,
290,
362,
329,
304,
36616,
485,
272,
1600,
2099,
28,
600,
8,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
26498,
796,
30751,
13,
29572,
62,
22046,
3419,
628,
220,
220,
220,
279,
40664,
796,
2547,
325,
34,
21370,
7,
22046,
13,
6978,
11,
468,
62,
50145,
28,
22046,
13,
10134,
50145,
8,
198,
220,
220,
220,
1366,
796,
279,
40664,
13,
1136,
62,
7890,
3419,
628,
220,
220,
220,
18868,
796,
15284,
62,
30246,
7,
7890,
11,
26498,
13,
30246,
8,
628,
220,
220,
220,
266,
40664,
796,
19430,
34,
21370,
7,
34345,
11639,
17080,
1817,
13,
14116,
11537,
198,
220,
220,
220,
266,
40664,
13,
13564,
62,
7890,
7,
17080,
1817,
8,
198
] | 2.822511 | 231 |
#!/usr/bin/python
# Launcher for building vcl
import os
import subprocess
import sys
def main():
""" VCL builder script """
# find path to helper script
script_path = os.path.dirname(os.path.abspath(sys.argv[0]))
vcl_build = f"{script_path}/{sys.argv[1]}"
# find path to vpp/vcl source code
base_path = os.path.dirname(os.path.abspath(sys.argv[1]))
vpp_path = f"{base_path}/external/com_github_fdio_vpp_vcl"
# find path to dst folder
dst_path = os.path.dirname(os.path.abspath(sys.argv[2]))
# build vcl
subprocess.run([vcl_build, vpp_path, dst_path])
if __name__ == "__main__":
main()
| [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
198,
2,
26385,
329,
2615,
410,
565,
198,
198,
11748,
28686,
198,
11748,
850,
14681,
198,
11748,
25064,
628,
198,
4299,
1388,
33529,
198,
220,
220,
220,
37227,
569,
5097,
27098,
4226,
37227,
628,
220,
220,
220,
1303,
1064,
3108,
284,
31904,
4226,
198,
220,
220,
220,
4226,
62,
6978,
796,
28686,
13,
6978,
13,
15908,
3672,
7,
418,
13,
6978,
13,
397,
2777,
776,
7,
17597,
13,
853,
85,
58,
15,
60,
4008,
198,
220,
220,
220,
410,
565,
62,
11249,
796,
277,
1,
90,
12048,
62,
6978,
92,
14,
90,
17597,
13,
853,
85,
58,
16,
60,
36786,
628,
220,
220,
220,
1303,
1064,
3108,
284,
410,
381,
14,
85,
565,
2723,
2438,
198,
220,
220,
220,
2779,
62,
6978,
796,
28686,
13,
6978,
13,
15908,
3672,
7,
418,
13,
6978,
13,
397,
2777,
776,
7,
17597,
13,
853,
85,
58,
16,
60,
4008,
198,
220,
220,
220,
410,
381,
62,
6978,
796,
277,
1,
90,
8692,
62,
6978,
92,
14,
22615,
14,
785,
62,
12567,
62,
16344,
952,
62,
85,
381,
62,
85,
565,
1,
628,
220,
220,
220,
1303,
1064,
3108,
284,
29636,
9483,
198,
220,
220,
220,
29636,
62,
6978,
796,
28686,
13,
6978,
13,
15908,
3672,
7,
418,
13,
6978,
13,
397,
2777,
776,
7,
17597,
13,
853,
85,
58,
17,
60,
4008,
628,
220,
220,
220,
1303,
1382,
410,
565,
198,
220,
220,
220,
850,
14681,
13,
5143,
26933,
85,
565,
62,
11249,
11,
410,
381,
62,
6978,
11,
29636,
62,
6978,
12962,
628,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
1388,
3419,
198
] | 2.3213 | 277 |
import hoomd
from hoomd import md
hoomd.context.initialize()
# Create a 10x10x10 simple cubic lattice of particles with type name A
hoomd.init.create_lattice(
unitcell=hoomd.lattice.sc(a=2.0, type_name='A'), n=10)
# Specify Lennard-Jones interactions between particle pairs
nl = md.nlist.cell()
lj = md.pair.lj(r_cut=3.0, nlist=nl)
lj.pair_coeff.set('A', 'A', epsilon=1.0, sigma=1.0)
# Integrate at constant temperature
md.integrate.mode_standard(dt=0.005)
hoomd.md.integrate.langevin(group=hoomd.group.all(), kT=1.2, seed=4)
hoomd.run(10e3)
hoomd.dump.dcd('lj.dcd', period=1000, overwrite=True)
hoomd.dump.gsd('lj.gsd', period=1000, group=hoomd.group.all(), overwrite=True)
# Run for 10,000 time steps
hoomd.run(10e3)
| [
11748,
289,
4207,
67,
198,
6738,
289,
4207,
67,
1330,
45243,
198,
71,
4207,
67,
13,
22866,
13,
36733,
1096,
3419,
198,
198,
2,
13610,
257,
838,
87,
940,
87,
940,
2829,
27216,
47240,
501,
286,
13166,
351,
2099,
1438,
317,
198,
71,
4207,
67,
13,
15003,
13,
17953,
62,
75,
1078,
501,
7,
198,
220,
220,
220,
4326,
3846,
28,
71,
4207,
67,
13,
75,
1078,
501,
13,
1416,
7,
64,
28,
17,
13,
15,
11,
2099,
62,
3672,
11639,
32,
33809,
299,
28,
940,
8,
198,
198,
2,
18291,
1958,
28423,
446,
12,
25784,
12213,
1022,
18758,
14729,
198,
21283,
796,
45243,
13,
77,
4868,
13,
3846,
3419,
198,
75,
73,
796,
45243,
13,
24874,
13,
75,
73,
7,
81,
62,
8968,
28,
18,
13,
15,
11,
299,
4868,
28,
21283,
8,
198,
75,
73,
13,
24874,
62,
1073,
14822,
13,
2617,
10786,
32,
3256,
705,
32,
3256,
304,
862,
33576,
28,
16,
13,
15,
11,
264,
13495,
28,
16,
13,
15,
8,
198,
198,
2,
15995,
4873,
379,
6937,
5951,
198,
9132,
13,
18908,
4873,
13,
14171,
62,
20307,
7,
28664,
28,
15,
13,
22544,
8,
198,
71,
4207,
67,
13,
9132,
13,
18908,
4873,
13,
75,
858,
7114,
7,
8094,
28,
71,
4207,
67,
13,
8094,
13,
439,
22784,
479,
51,
28,
16,
13,
17,
11,
9403,
28,
19,
8,
198,
198,
71,
4207,
67,
13,
5143,
7,
940,
68,
18,
8,
198,
198,
71,
4207,
67,
13,
39455,
13,
67,
10210,
10786,
75,
73,
13,
67,
10210,
3256,
2278,
28,
12825,
11,
49312,
28,
17821,
8,
198,
71,
4207,
67,
13,
39455,
13,
14542,
67,
10786,
75,
73,
13,
14542,
67,
3256,
2278,
28,
12825,
11,
1448,
28,
71,
4207,
67,
13,
8094,
13,
439,
22784,
49312,
28,
17821,
8,
198,
198,
2,
5660,
329,
838,
11,
830,
640,
4831,
198,
71,
4207,
67,
13,
5143,
7,
940,
68,
18,
8,
198
] | 2.299685 | 317 |
##
# The MIT License (MIT)
#
# Copyright (c) 2016 Stefan Wendler
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
##
from __future__ import unicode_literals
import pygame
import blockext
import edubot.snapext
from edubot.snapext.joystick.constants import ALL_JS, ALL_AXIS, ALL_BUTTONS, AXIS, BUTTONS
from edubot.snapext.joystick.mappings import JS_MAPPINGS
| [
2235,
198,
2,
383,
17168,
13789,
357,
36393,
8,
198,
2,
198,
2,
15069,
357,
66,
8,
1584,
28842,
21042,
1754,
198,
2,
198,
2,
2448,
3411,
318,
29376,
7520,
11,
1479,
286,
3877,
11,
284,
597,
1048,
16727,
257,
4866,
198,
2,
286,
428,
3788,
290,
3917,
10314,
3696,
357,
1169,
366,
25423,
12340,
284,
1730,
198,
2,
287,
262,
10442,
1231,
17504,
11,
1390,
1231,
17385,
262,
2489,
198,
2,
284,
779,
11,
4866,
11,
13096,
11,
20121,
11,
7715,
11,
14983,
11,
850,
43085,
11,
290,
14,
273,
3677,
198,
2,
9088,
286,
262,
10442,
11,
290,
284,
8749,
6506,
284,
4150,
262,
10442,
318,
198,
2,
30760,
284,
466,
523,
11,
2426,
284,
262,
1708,
3403,
25,
198,
2,
198,
2,
383,
2029,
6634,
4003,
290,
428,
7170,
4003,
2236,
307,
3017,
287,
198,
2,
477,
9088,
393,
8904,
16690,
286,
262,
10442,
13,
198,
2,
198,
2,
3336,
47466,
3180,
36592,
2389,
1961,
366,
1921,
3180,
1600,
42881,
34764,
56,
3963,
15529,
509,
12115,
11,
7788,
32761,
6375,
198,
2,
8959,
49094,
11,
47783,
2751,
21728,
5626,
40880,
5390,
3336,
34764,
11015,
3963,
34482,
3398,
1565,
5603,
25382,
11,
198,
2,
376,
46144,
7473,
317,
16652,
2149,
37232,
33079,
48933,
5357,
44521,
1268,
10913,
2751,
12529,
13,
3268,
8005,
49261,
50163,
3336,
198,
2,
37195,
20673,
6375,
27975,
38162,
9947,
367,
15173,
4877,
9348,
43031,
19146,
7473,
15529,
47666,
3955,
11,
29506,
25552,
6375,
25401,
198,
2,
43031,
25382,
11,
7655,
2767,
16879,
3268,
3537,
40282,
3963,
27342,
10659,
11,
309,
9863,
6375,
25401,
54,
24352,
11,
5923,
1797,
2751,
16034,
11,
198,
2,
16289,
3963,
6375,
3268,
7102,
45,
24565,
13315,
3336,
47466,
6375,
3336,
23210,
6375,
25401,
5550,
1847,
20754,
3268,
198,
2,
3336,
47466,
13,
198,
2235,
198,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
11748,
12972,
6057,
198,
198,
11748,
24003,
365,
742,
198,
11748,
1225,
549,
313,
13,
16184,
1758,
742,
198,
198,
6738,
1225,
549,
313,
13,
16184,
1758,
742,
13,
2633,
13915,
13,
9979,
1187,
1330,
11096,
62,
20120,
11,
11096,
62,
25922,
1797,
11,
11096,
62,
47526,
11357,
50,
11,
43051,
1797,
11,
21728,
11357,
50,
198,
6738,
1225,
549,
313,
13,
16184,
1758,
742,
13,
2633,
13915,
13,
76,
39242,
1330,
26755,
62,
44,
24805,
20754,
628,
198
] | 3.533505 | 388 |
from unittest import mock
from know_me.profile import models
def test_get_media_resource_upload_path():
"""
Media Resources should be stored with their original filename in a
folder titled ``know-me/users/{id}/media-resources``.
"""
resource = mock.Mock(name="Mock Media Resource")
resource.km_user.id = 1
filename = "foo.jpg"
expected = "know-me/users/{id}/media-resources/{file}".format(
file=filename, id=resource.km_user.id
)
result = models.get_media_resource_upload_path(resource, filename)
assert result == expected
def test_get_profile_item_image_upload_path():
"""
Profile item images should be stored with their original filename in
a directory titled ``know-me/users/{id}/profile-images``.
"""
profile_item = mock.Mock(name="Mock Profile Item")
profile_item.topic.profile.km_user.id = 1
filename = "image.jpg"
result = models.get_profile_item_image_upload_path(profile_item, filename)
expected = "know-me/users/{id}/profile-images/{file}".format(
file=filename, id=profile_item.topic.profile.km_user.id
)
assert result == expected
| [
6738,
555,
715,
395,
1330,
15290,
198,
198,
6738,
760,
62,
1326,
13,
13317,
1330,
4981,
628,
198,
4299,
1332,
62,
1136,
62,
11431,
62,
31092,
62,
25850,
62,
6978,
33529,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
6343,
13864,
815,
307,
8574,
351,
511,
2656,
29472,
287,
257,
198,
220,
220,
220,
9483,
11946,
7559,
16275,
12,
1326,
14,
18417,
14,
90,
312,
92,
14,
11431,
12,
37540,
15506,
13,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
8271,
796,
15290,
13,
44,
735,
7,
3672,
2625,
44,
735,
6343,
20857,
4943,
198,
220,
220,
220,
8271,
13,
13276,
62,
7220,
13,
312,
796,
352,
628,
220,
220,
220,
29472,
796,
366,
21943,
13,
9479,
1,
628,
220,
220,
220,
2938,
796,
366,
16275,
12,
1326,
14,
18417,
14,
90,
312,
92,
14,
11431,
12,
37540,
14,
90,
7753,
92,
1911,
18982,
7,
198,
220,
220,
220,
220,
220,
220,
220,
2393,
28,
34345,
11,
4686,
28,
31092,
13,
13276,
62,
7220,
13,
312,
198,
220,
220,
220,
1267,
628,
220,
220,
220,
1255,
796,
4981,
13,
1136,
62,
11431,
62,
31092,
62,
25850,
62,
6978,
7,
31092,
11,
29472,
8,
198,
220,
220,
220,
6818,
1255,
6624,
2938,
628,
198,
4299,
1332,
62,
1136,
62,
13317,
62,
9186,
62,
9060,
62,
25850,
62,
6978,
33529,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
13118,
2378,
4263,
815,
307,
8574,
351,
511,
2656,
29472,
287,
198,
220,
220,
220,
257,
8619,
11946,
7559,
16275,
12,
1326,
14,
18417,
14,
90,
312,
92,
14,
13317,
12,
17566,
15506,
13,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
7034,
62,
9186,
796,
15290,
13,
44,
735,
7,
3672,
2625,
44,
735,
13118,
9097,
4943,
198,
220,
220,
220,
7034,
62,
9186,
13,
26652,
13,
13317,
13,
13276,
62,
7220,
13,
312,
796,
352,
198,
220,
220,
220,
29472,
796,
366,
9060,
13,
9479,
1,
628,
220,
220,
220,
1255,
796,
4981,
13,
1136,
62,
13317,
62,
9186,
62,
9060,
62,
25850,
62,
6978,
7,
13317,
62,
9186,
11,
29472,
8,
198,
220,
220,
220,
2938,
796,
366,
16275,
12,
1326,
14,
18417,
14,
90,
312,
92,
14,
13317,
12,
17566,
14,
90,
7753,
92,
1911,
18982,
7,
198,
220,
220,
220,
220,
220,
220,
220,
2393,
28,
34345,
11,
4686,
28,
13317,
62,
9186,
13,
26652,
13,
13317,
13,
13276,
62,
7220,
13,
312,
198,
220,
220,
220,
1267,
198,
220,
220,
220,
6818,
1255,
6624,
2938,
198
] | 2.803398 | 412 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
###########################################
# (c) 2016-2020 Polyvios Pratikakis
# [email protected]
###########################################
#__all__ = ['utils']
''' empty '''
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
29113,
7804,
21017,
198,
2,
357,
66,
8,
1584,
12,
42334,
12280,
85,
4267,
1736,
265,
1134,
27321,
198,
2,
7514,
85,
4267,
31,
873,
13,
25718,
13,
2164,
198,
29113,
7804,
21017,
198,
198,
2,
834,
439,
834,
796,
37250,
26791,
20520,
198,
7061,
6,
6565,
705,
7061,
198
] | 3.121622 | 74 |
# coding=utf-8
"""List II - In-place functions: Reverse, Sort and Extend.
Examples with in-place list functions. In-place functions changes
the original object and return None after calling it.
"""
def do_something_magical(animes, tvshows):
"""Use some list methods."""
animes.reverse()
print("Inverted anime list: {}".format(animes))
# >>> Inverted anime list: ['Sakurasou no Pet na Kanojo', 'Shigatsu Wa Kimi No Uso', 'Shingeki no Kyojin']
tvshows.sort()
print("Sorted TV Shows list: {}".format(tvshows))
# >>> Sorted TV Shows list: ['Pirates Of The Caribean', 'Sherlock Holmes', 'Star Wars']
animes.extend(tvshows)
new_list = animes
print("Concatenated lists: {}".format(new_list))
# >>> Concatenated lists: ['Sakurasou no Pet na Kanojo', 'Shigatsu Wa Kimi No Uso', 'Shingeki no Kyojin', 'Pirates Of The Caribean', 'Sherlock Holmes', 'Star Wars']
if __name__ == '__main__':
animes = ["Shingeki no Kyojin", "Shigatsu Wa Kimi No Uso",
"Sakurasou no Pet na Kanojo"]
tvshows = ["Star Wars", "Pirates Of The Caribean", "Sherlock Holmes"]
print("Original Anime List: {}".format(animes))
# >>> Original Anime List: ['Shingeki no Kyojin', 'Shigatsu Wa Kimi No Uso', 'Sakurasou no Pet na Kanojo']
print("Original TV Shows List: {}".format(tvshows))
# >>> Original TV Shows List: ['Star Wars', 'Pirates Of The Caribean', 'Sherlock Holmes']
do_something_magical(animes, tvshows)
| [
2,
19617,
28,
40477,
12,
23,
198,
37811,
8053,
2873,
532,
554,
12,
5372,
5499,
25,
31849,
11,
33947,
290,
46228,
13,
628,
220,
220,
220,
21066,
351,
287,
12,
5372,
1351,
5499,
13,
554,
12,
5372,
5499,
2458,
198,
220,
220,
220,
262,
2656,
2134,
290,
1441,
6045,
706,
4585,
340,
13,
198,
37811,
628,
198,
4299,
466,
62,
18927,
62,
19726,
605,
7,
272,
999,
11,
31557,
49596,
2599,
198,
220,
220,
220,
37227,
11041,
617,
1351,
5050,
526,
15931,
198,
220,
220,
220,
281,
999,
13,
50188,
3419,
198,
220,
220,
220,
3601,
7203,
818,
13658,
11984,
1351,
25,
23884,
1911,
18982,
7,
272,
999,
4008,
198,
220,
220,
220,
1303,
13163,
554,
13658,
11984,
1351,
25,
37250,
50,
461,
17786,
280,
645,
4767,
12385,
509,
5733,
7639,
3256,
705,
2484,
328,
19231,
15329,
6502,
72,
1400,
471,
568,
3256,
705,
50,
722,
39548,
645,
509,
8226,
18594,
20520,
198,
220,
220,
220,
31557,
49596,
13,
30619,
3419,
198,
220,
220,
220,
3601,
7203,
50,
9741,
3195,
25156,
1351,
25,
23884,
1911,
18982,
7,
14981,
49596,
4008,
198,
220,
220,
220,
1303,
13163,
311,
9741,
3195,
25156,
1351,
25,
37250,
46772,
689,
3226,
383,
17152,
11025,
3256,
705,
28782,
5354,
17628,
3256,
705,
8248,
6176,
20520,
198,
220,
220,
220,
281,
999,
13,
2302,
437,
7,
14981,
49596,
8,
198,
220,
220,
220,
649,
62,
4868,
796,
281,
999,
198,
220,
220,
220,
3601,
7203,
3103,
9246,
268,
515,
8341,
25,
23884,
1911,
18982,
7,
3605,
62,
4868,
4008,
198,
220,
220,
220,
1303,
13163,
1482,
9246,
268,
515,
8341,
25,
37250,
50,
461,
17786,
280,
645,
4767,
12385,
509,
5733,
7639,
3256,
705,
2484,
328,
19231,
15329,
6502,
72,
1400,
471,
568,
3256,
705,
50,
722,
39548,
645,
509,
8226,
18594,
3256,
705,
46772,
689,
3226,
383,
17152,
11025,
3256,
705,
28782,
5354,
17628,
3256,
705,
8248,
6176,
20520,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
281,
999,
796,
14631,
50,
722,
39548,
645,
509,
8226,
18594,
1600,
366,
2484,
328,
19231,
15329,
6502,
72,
1400,
471,
568,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
50,
461,
17786,
280,
645,
4767,
12385,
509,
5733,
7639,
8973,
198,
220,
220,
220,
31557,
49596,
796,
14631,
8248,
6176,
1600,
366,
46772,
689,
3226,
383,
17152,
11025,
1600,
366,
28782,
5354,
17628,
8973,
198,
220,
220,
220,
3601,
7203,
20556,
27812,
7343,
25,
23884,
1911,
18982,
7,
272,
999,
4008,
198,
220,
220,
220,
1303,
13163,
13745,
27812,
7343,
25,
37250,
50,
722,
39548,
645,
509,
8226,
18594,
3256,
705,
2484,
328,
19231,
15329,
6502,
72,
1400,
471,
568,
3256,
705,
50,
461,
17786,
280,
645,
4767,
12385,
509,
5733,
7639,
20520,
198,
220,
220,
220,
3601,
7203,
20556,
3195,
25156,
7343,
25,
23884,
1911,
18982,
7,
14981,
49596,
4008,
198,
220,
220,
220,
1303,
13163,
13745,
3195,
25156,
7343,
25,
37250,
8248,
6176,
3256,
705,
46772,
689,
3226,
383,
17152,
11025,
3256,
705,
28782,
5354,
17628,
20520,
198,
220,
220,
220,
466,
62,
18927,
62,
19726,
605,
7,
272,
999,
11,
31557,
49596,
8,
198
] | 2.8 | 525 |
import ald
import numpy as np
import h5py
U0 = 1.0
tauR = 1.2
alpha = 1.2
particle = ald.Pareto(U0=U0, tauR=tauR, alpha=alpha)
flow = ald.ZeroVelocity()
domain = ald.Box()
ic = ald.InitialConfig(
x=ald.Uniform(domain.left, domain.right),
y=ald.Uniform(domain.left, domain.right),
theta=ald.Uniform(0, 2 * np.pi),
)
cfg = ald.Config(particle, domain, N=204_800, dt=1e-4, Nt=40_000_000)
kernel = ald.RTPFreespaceKernel()
compiler = ald.RTPCompiler(kernel, cfg, flow, ic)
compiler.compile()
simulator = ald.RTPSimulator(cfg, compiler)
file = "U{:.3f}tauR{:.3f}free.h5".format(U0, tauR)
# create an empty file
# with h5py.File(file, "w") as f:
# pass
configsaver = ald.ConfigSaver(
ald.RangedRunner.from_backward_count(stop=cfg.Nt, freq=10000, count=200),
file,
variables=["x", "y"],
unwrap=[True, True],
)
# range to compute stats on configuration and print time.
runner = ald.RangedRunner(start=0, stop=cfg.Nt, freq=10000)
# setup callbacks.
# x = ald.DisplacementMeanVariance(runner, "x", unwrap=True)
# y = ald.DisplacementMeanVariance(runner, "y", unwrap=True)
# y = ald.MeanVariance(runner, "y", unwrap=True)
callbacks = [configsaver, ald.ETA(runner)]
simulator.run(cfg, callbacks=callbacks)
# save particle, domain and simulation attributes.
cfg.save2h5(file)
# # save mean variance of x
# x.save2h5(file, "x")
# y.save2h5(file, "y")
| [
11748,
257,
335,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
289,
20,
9078,
198,
198,
52,
15,
796,
352,
13,
15,
198,
83,
559,
49,
796,
352,
13,
17,
198,
26591,
796,
352,
13,
17,
198,
3911,
1548,
796,
257,
335,
13,
47,
533,
1462,
7,
52,
15,
28,
52,
15,
11,
256,
559,
49,
28,
83,
559,
49,
11,
17130,
28,
26591,
8,
198,
198,
11125,
796,
257,
335,
13,
28667,
46261,
11683,
3419,
198,
27830,
796,
257,
335,
13,
14253,
3419,
628,
198,
291,
796,
257,
335,
13,
24243,
16934,
7,
198,
220,
220,
220,
2124,
28,
1940,
13,
3118,
6933,
7,
27830,
13,
9464,
11,
7386,
13,
3506,
828,
198,
220,
220,
220,
331,
28,
1940,
13,
3118,
6933,
7,
27830,
13,
9464,
11,
7386,
13,
3506,
828,
198,
220,
220,
220,
262,
8326,
28,
1940,
13,
3118,
6933,
7,
15,
11,
362,
1635,
45941,
13,
14415,
828,
198,
8,
628,
198,
37581,
796,
257,
335,
13,
16934,
7,
3911,
1548,
11,
7386,
11,
399,
28,
18638,
62,
7410,
11,
288,
83,
28,
16,
68,
12,
19,
11,
399,
83,
28,
1821,
62,
830,
62,
830,
8,
198,
198,
33885,
796,
257,
335,
13,
49,
7250,
37,
6037,
10223,
42,
7948,
3419,
198,
5589,
5329,
796,
257,
335,
13,
14181,
5662,
3361,
5329,
7,
33885,
11,
30218,
70,
11,
5202,
11,
14158,
8,
198,
198,
5589,
5329,
13,
5589,
576,
3419,
198,
198,
14323,
8927,
796,
257,
335,
13,
14181,
3705,
320,
8927,
7,
37581,
11,
17050,
8,
198,
198,
7753,
796,
366,
52,
90,
25,
13,
18,
69,
92,
83,
559,
49,
90,
25,
13,
18,
69,
92,
5787,
13,
71,
20,
1911,
18982,
7,
52,
15,
11,
256,
559,
49,
8,
198,
2,
2251,
281,
6565,
2393,
198,
2,
351,
289,
20,
9078,
13,
8979,
7,
7753,
11,
366,
86,
4943,
355,
277,
25,
198,
2,
220,
220,
220,
220,
1208,
198,
11250,
82,
8770,
796,
257,
335,
13,
16934,
50,
8770,
7,
198,
220,
220,
220,
257,
335,
13,
49,
5102,
49493,
13,
6738,
62,
1891,
904,
62,
9127,
7,
11338,
28,
37581,
13,
45,
83,
11,
2030,
80,
28,
49388,
11,
954,
28,
2167,
828,
198,
220,
220,
220,
2393,
11,
198,
220,
220,
220,
9633,
28,
14692,
87,
1600,
366,
88,
33116,
198,
220,
220,
220,
7379,
2416,
41888,
17821,
11,
6407,
4357,
198,
8,
628,
198,
2,
2837,
284,
24061,
9756,
319,
8398,
290,
3601,
640,
13,
198,
16737,
796,
257,
335,
13,
49,
5102,
49493,
7,
9688,
28,
15,
11,
2245,
28,
37581,
13,
45,
83,
11,
2030,
80,
28,
49388,
8,
198,
2,
9058,
869,
10146,
13,
198,
2,
2124,
796,
257,
335,
13,
7279,
489,
5592,
5308,
272,
23907,
590,
7,
16737,
11,
366,
87,
1600,
7379,
2416,
28,
17821,
8,
198,
2,
331,
796,
257,
335,
13,
7279,
489,
5592,
5308,
272,
23907,
590,
7,
16737,
11,
366,
88,
1600,
7379,
2416,
28,
17821,
8,
198,
198,
2,
331,
796,
257,
335,
13,
5308,
272,
23907,
590,
7,
16737,
11,
366,
88,
1600,
7379,
2416,
28,
17821,
8,
198,
13345,
10146,
796,
685,
11250,
82,
8770,
11,
257,
335,
13,
20892,
7,
16737,
15437,
198,
198,
14323,
8927,
13,
5143,
7,
37581,
11,
869,
10146,
28,
13345,
10146,
8,
198,
198,
2,
3613,
18758,
11,
7386,
290,
18640,
12608,
13,
198,
37581,
13,
21928,
17,
71,
20,
7,
7753,
8,
198,
2,
1303,
3613,
1612,
24198,
286,
2124,
198,
2,
2124,
13,
21928,
17,
71,
20,
7,
7753,
11,
366,
87,
4943,
198,
2,
331,
13,
21928,
17,
71,
20,
7,
7753,
11,
366,
88,
4943,
198
] | 2.302829 | 601 |
#Skrip alfa
from requests import get
from bs4 import BeautifulSoup as bs
import pandas as pd
hari = input('Tanggal? (dua digit): \n')
bulan = input('Bulan? (dua digit): \n')
tahun = input('Tahun? (empat digit): \n')
x = bulan+'/'+hari+'/'+tahun
halaman_detik = [str(i) for i in range(1, 21)]
#https://news.detik.com/indeks?date=12%2F10%2F2019
kabeh_sup_detik = []
kabeh_judul = []
kabeh_link = []
for i in halaman_detik:
indeks_lengkap = 'https://news.detik.com/indeks/'+ i +'?date='+ x
#print(indeks_lengkap)
a = get(indeks_lengkap)
sup_a = bs(a.text, 'html5lib')
kabeh_sup_detik.append(sup_a)
for i in sup_a.select('h3', class_="media-title"):
a = i.get_text()
#b = a.get_text()
kabeh_judul.append(a)
for i in sup_a.select('h3', class_="media-title"):
a = i.find('a')
b = a['href']
kabeh_link.append(b)
#print(len(kabeh_link))
#print(len(kabeh_judul))
angka = [ada_angka(i) for i in kabeh_judul]
#print(len(angka))
data_detik = pd.DataFrame({'judul': kabeh_judul,
'tautan' : kabeh_link,
'ada_angka': angka})
berita_dg_angka = data_detik.loc[data_detik['ada_angka'] == True]
#print(berita_dg_angka)
identitas = x.replace('/', '_')
berita_dg_angka.to_csv(identitas+ '_' +'angka_dalam_detik.csv')
from time import sleep
for row in berita_dg_angka.itertuples():
print ("Judul : \n", row.judul)
print ("Tautan : \n", row.tautan)
sleep(1.5)
| [
2,
15739,
5528,
435,
13331,
198,
198,
6738,
7007,
1330,
651,
198,
6738,
275,
82,
19,
1330,
23762,
50,
10486,
355,
275,
82,
198,
11748,
19798,
292,
355,
279,
67,
198,
198,
49573,
796,
5128,
10786,
43909,
13528,
30,
357,
646,
64,
16839,
2599,
3467,
77,
11537,
198,
15065,
272,
796,
5128,
10786,
33481,
272,
30,
357,
646,
64,
16839,
2599,
3467,
77,
11537,
198,
83,
993,
403,
796,
5128,
10786,
51,
993,
403,
30,
357,
368,
8071,
16839,
2599,
3467,
77,
11537,
198,
87,
796,
4807,
272,
10,
26488,
6,
10,
49573,
10,
26488,
6,
10,
83,
993,
403,
198,
198,
14201,
10546,
62,
15255,
1134,
796,
685,
2536,
7,
72,
8,
329,
1312,
287,
2837,
7,
16,
11,
2310,
15437,
198,
198,
2,
5450,
1378,
10827,
13,
15255,
1134,
13,
785,
14,
521,
2573,
30,
4475,
28,
1065,
4,
17,
37,
940,
4,
17,
37,
23344,
198,
74,
11231,
71,
62,
37330,
62,
15255,
1134,
796,
17635,
198,
74,
11231,
71,
62,
10456,
377,
796,
17635,
198,
74,
11231,
71,
62,
8726,
796,
17635,
198,
1640,
1312,
287,
10284,
10546,
62,
15255,
1134,
25,
198,
220,
220,
220,
773,
2573,
62,
75,
1516,
74,
499,
796,
705,
5450,
1378,
10827,
13,
15255,
1134,
13,
785,
14,
521,
2573,
14,
6,
10,
1312,
1343,
30960,
4475,
11639,
10,
2124,
198,
220,
220,
220,
1303,
4798,
7,
521,
2573,
62,
75,
1516,
74,
499,
8,
198,
220,
220,
220,
257,
796,
651,
7,
521,
2573,
62,
75,
1516,
74,
499,
8,
198,
220,
220,
220,
7418,
62,
64,
796,
275,
82,
7,
64,
13,
5239,
11,
705,
6494,
20,
8019,
11537,
198,
220,
220,
220,
479,
11231,
71,
62,
37330,
62,
15255,
1134,
13,
33295,
7,
37330,
62,
64,
8,
628,
220,
220,
220,
329,
1312,
287,
7418,
62,
64,
13,
19738,
10786,
71,
18,
3256,
1398,
62,
2625,
11431,
12,
7839,
1,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
257,
796,
1312,
13,
1136,
62,
5239,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
65,
796,
257,
13,
1136,
62,
5239,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
479,
11231,
71,
62,
10456,
377,
13,
33295,
7,
64,
8,
198,
220,
220,
220,
329,
1312,
287,
7418,
62,
64,
13,
19738,
10786,
71,
18,
3256,
1398,
62,
2625,
11431,
12,
7839,
1,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
257,
796,
1312,
13,
19796,
10786,
64,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
275,
796,
257,
17816,
33257,
20520,
198,
220,
220,
220,
220,
220,
220,
220,
479,
11231,
71,
62,
8726,
13,
33295,
7,
65,
8,
628,
198,
2,
4798,
7,
11925,
7,
74,
11231,
71,
62,
8726,
4008,
198,
2,
4798,
7,
11925,
7,
74,
11231,
71,
62,
10456,
377,
4008,
198,
648,
4914,
796,
685,
4763,
62,
648,
4914,
7,
72,
8,
329,
1312,
287,
479,
11231,
71,
62,
10456,
377,
60,
198,
2,
4798,
7,
11925,
7,
648,
4914,
4008,
198,
7890,
62,
15255,
1134,
796,
279,
67,
13,
6601,
19778,
15090,
6,
10456,
377,
10354,
479,
11231,
71,
62,
10456,
377,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
83,
2306,
272,
6,
1058,
479,
11231,
71,
62,
8726,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
4763,
62,
648,
4914,
10354,
3550,
4914,
30072,
628,
198,
527,
5350,
62,
67,
70,
62,
648,
4914,
796,
1366,
62,
15255,
1134,
13,
17946,
58,
7890,
62,
15255,
1134,
17816,
4763,
62,
648,
4914,
20520,
6624,
6407,
60,
198,
2,
4798,
7,
527,
5350,
62,
67,
70,
62,
648,
4914,
8,
198,
738,
21416,
796,
2124,
13,
33491,
10786,
14,
3256,
705,
62,
11537,
198,
527,
5350,
62,
67,
70,
62,
648,
4914,
13,
1462,
62,
40664,
7,
738,
21416,
10,
705,
62,
6,
1343,
6,
648,
4914,
62,
31748,
321,
62,
15255,
1134,
13,
40664,
11537,
198,
198,
6738,
640,
1330,
3993,
198,
198,
1640,
5752,
287,
18157,
5350,
62,
67,
70,
62,
648,
4914,
13,
270,
861,
84,
2374,
33529,
198,
220,
220,
220,
3601,
5855,
26141,
377,
1058,
3467,
77,
1600,
5752,
13,
10456,
377,
8,
198,
220,
220,
220,
3601,
5855,
51,
2306,
272,
1058,
3467,
77,
1600,
5752,
13,
83,
2306,
272,
8,
198,
220,
220,
220,
3993,
7,
16,
13,
20,
8,
198
] | 2.006849 | 730 |
from aws_cdk import (
aws_ec2 as ec2,
core
)
| [
6738,
3253,
82,
62,
10210,
74,
1330,
357,
198,
220,
220,
220,
3253,
82,
62,
721,
17,
355,
9940,
17,
11,
198,
220,
220,
220,
4755,
198,
8,
198
] | 1.827586 | 29 |
#!/usr/bin/python
# 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.
# This script configures collectd to send metric data to the
# logstash server port 25826
# The environment variable logstash_ip is expected to be set up
import os
with open("/etc/collectd/collectd.conf.d/tosca_elk.conf", "w") as fh:
fh.write("""
LoadPlugin network
<Plugin network>
Server "%s" "25826"
</Plugin>
""" % (os.environ['logstash_ip']))
| [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
198,
2,
220,
220,
220,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
345,
743,
198,
2,
220,
220,
220,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
921,
743,
7330,
198,
2,
220,
220,
220,
257,
4866,
286,
262,
13789,
379,
198,
2,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
2638,
1378,
2503,
13,
43073,
13,
2398,
14,
677,
4541,
14,
43,
2149,
24290,
12,
17,
13,
15,
198,
2,
198,
2,
220,
220,
220,
17486,
2672,
416,
9723,
1099,
393,
4987,
284,
287,
3597,
11,
3788,
198,
2,
220,
220,
220,
9387,
739,
262,
13789,
318,
9387,
319,
281,
366,
1921,
3180,
1,
29809,
1797,
11,
42881,
198,
2,
220,
220,
220,
34764,
11015,
6375,
7102,
49828,
11053,
3963,
15529,
509,
12115,
11,
2035,
4911,
393,
17142,
13,
4091,
262,
198,
2,
220,
220,
220,
13789,
329,
262,
2176,
3303,
15030,
21627,
290,
11247,
198,
2,
220,
220,
220,
739,
262,
13789,
13,
198,
198,
2,
770,
4226,
4566,
942,
2824,
67,
284,
3758,
18663,
1366,
284,
262,
198,
2,
2604,
301,
1077,
4382,
2493,
37528,
2075,
198,
2,
383,
2858,
7885,
2604,
301,
1077,
62,
541,
318,
2938,
284,
307,
900,
510,
198,
11748,
28686,
198,
4480,
1280,
7203,
14,
14784,
14,
33327,
67,
14,
33327,
67,
13,
10414,
13,
67,
14,
83,
418,
6888,
62,
417,
74,
13,
10414,
1600,
366,
86,
4943,
355,
277,
71,
25,
198,
220,
220,
220,
277,
71,
13,
13564,
7203,
15931,
198,
220,
220,
220,
220,
220,
220,
220,
8778,
37233,
3127,
198,
220,
220,
220,
220,
220,
220,
220,
1279,
37233,
3127,
29,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
9652,
36521,
82,
1,
366,
25600,
2075,
1,
198,
220,
220,
220,
220,
220,
220,
220,
7359,
37233,
29,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
4064,
357,
418,
13,
268,
2268,
17816,
6404,
301,
1077,
62,
541,
20520,
4008,
198
] | 2.883721 | 344 |
from typing import List, Optional
import signal
import sys
from . import __version__, __title__
from .api import Api
from .github_handler import GithubHandler
from .config_creator import ConfigCreator
from .lib.ci_exception import SilentAbortException
from .lib.gravity import define_arguments_recursive, construct_component
from .lib.module_arguments import ModuleArgumentParser, ModuleNamespace, IncorrectParameterError
from .lib.utils import Uninterruptible, format_traceback
from .main import Main
from .modules.error_state import GlobalErrorState
from .nonci import Nonci
from .poll import Poll
from .submit import Submit
if __name__ == "__main__":
exit_code = main()
sys.exit(exit_code)
| [
6738,
19720,
1330,
7343,
11,
32233,
198,
11748,
6737,
198,
11748,
25064,
198,
198,
6738,
764,
1330,
11593,
9641,
834,
11,
11593,
7839,
834,
198,
6738,
764,
15042,
1330,
5949,
72,
198,
6738,
764,
12567,
62,
30281,
1330,
38994,
25060,
198,
6738,
764,
11250,
62,
45382,
1330,
17056,
16719,
273,
198,
6738,
764,
8019,
13,
979,
62,
1069,
4516,
1330,
25083,
4826,
419,
16922,
198,
6738,
764,
8019,
13,
46453,
1330,
8160,
62,
853,
2886,
62,
8344,
30753,
11,
5678,
62,
42895,
198,
6738,
764,
8019,
13,
21412,
62,
853,
2886,
1330,
19937,
28100,
1713,
46677,
11,
19937,
36690,
10223,
11,
3457,
47315,
36301,
12331,
198,
6738,
764,
8019,
13,
26791,
1330,
791,
3849,
3622,
856,
11,
5794,
62,
40546,
1891,
198,
6738,
764,
12417,
1330,
8774,
198,
6738,
764,
18170,
13,
18224,
62,
5219,
1330,
8060,
12331,
9012,
198,
6738,
764,
13159,
979,
1330,
8504,
979,
198,
6738,
764,
30393,
1330,
12868,
198,
6738,
764,
46002,
1330,
39900,
628,
628,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
8420,
62,
8189,
796,
1388,
3419,
198,
220,
220,
220,
25064,
13,
37023,
7,
37023,
62,
8189,
8,
198
] | 3.607143 | 196 |
# -*- coding: utf-8 -*-
# __author__ : py_lee
# __time__ : '18-12-14 下午2:54'
import re
from rest_framework import serializers
from rest_framework.validators import UniqueTogetherValidator
from user_operation.models import UserFav, UserLeavingMessage, UserAddress
from goods.serializer import UserFavGoodsSerializers
from DjangoVue.settings import MOBILE_REGSTER
class UserFavDetialSerializers(serializers.ModelSerializer):
"""
用户收藏的详情
为了能获取用户收藏的商品的详细信息,所以需要将GoodsSerializers进行嵌套
"""
goods = UserFavGoodsSerializers()
class LeaveMessageSerializers(serializers.ModelSerializer):
"""
用户留言相关的Serializer
"""
# 自定义user字段,是个隐藏域,默认获取的是当前登录状态的user
user = serializers.HiddenField(
default=serializers.CurrentUserDefault()
)
add_time = serializers.DateTimeField(read_only=True, format='%Y-%m-%d %H:%M')
class AddressSerializers(serializers.ModelSerializer):
"""
用户收货地址相关的Serializer
"""
user = serializers.HiddenField(
default=serializers.CurrentUserDefault()
)
add_time = serializers.DateTimeField(read_only=True, format='%Y-%m-%d %H:%M')
province = serializers.CharField(max_length=100, required=True, allow_null=False, label='省份', error_messages={
'max_length': '格式有误',
'required': '省份必填'
})
city = serializers.CharField(max_length=100, required=True, allow_null=False, label='城市', error_messages={
'max_length': '格式有误',
'required': '城市必填'
})
district = serializers.CharField(max_length=100, required=True, allow_null=False, label='区域', error_messages={
'max_length': '格式有误',
'required': '区域必填'
})
address = serializers.CharField(max_length=100, required=True, allow_null=False, label='详细地址', error_messages={
'max_length': '格式有误',
'required': '详细地址必填'
})
signer_name = serializers.CharField(max_length=100, required=True, allow_null=False, label='收件人', error_messages={
'required': '必须填写姓名'
})
signer_mobile = serializers.CharField(max_length=11, min_length=11, required=True, label='收件人手机号', allow_null=False)
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
11593,
9800,
834,
1058,
12972,
62,
7197,
198,
2,
11593,
2435,
834,
220,
220,
1058,
705,
1507,
12,
1065,
12,
1415,
220,
10310,
233,
39355,
230,
17,
25,
4051,
6,
198,
11748,
302,
198,
6738,
1334,
62,
30604,
1330,
11389,
11341,
198,
6738,
1334,
62,
30604,
13,
12102,
2024,
1330,
30015,
41631,
47139,
1352,
198,
198,
6738,
2836,
62,
27184,
13,
27530,
1330,
11787,
37,
615,
11,
11787,
3123,
2703,
12837,
11,
11787,
20231,
198,
6738,
7017,
13,
46911,
7509,
1330,
11787,
37,
615,
10248,
82,
32634,
11341,
198,
6738,
37770,
53,
518,
13,
33692,
1330,
13070,
3483,
2538,
62,
31553,
41809,
628,
198,
198,
4871,
11787,
37,
615,
11242,
498,
32634,
11341,
7,
46911,
11341,
13,
17633,
32634,
7509,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
13328,
242,
101,
22755,
115,
162,
242,
114,
164,
245,
237,
21410,
46237,
99,
46349,
227,
198,
220,
220,
220,
220,
10310,
118,
12859,
228,
47797,
121,
164,
236,
115,
20998,
244,
18796,
101,
22755,
115,
162,
242,
114,
164,
245,
237,
21410,
161,
243,
228,
161,
241,
223,
21410,
46237,
99,
163,
119,
228,
46479,
94,
162,
223,
107,
11,
33699,
222,
20015,
98,
165,
250,
222,
17358,
223,
49546,
10248,
82,
32634,
11341,
32573,
249,
26193,
234,
161,
113,
234,
25001,
245,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
7017,
796,
11787,
37,
615,
10248,
82,
32634,
11341,
3419,
628,
198,
4871,
17446,
12837,
32634,
11341,
7,
46911,
11341,
13,
17633,
32634,
7509,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
13328,
242,
101,
22755,
115,
45911,
247,
164,
101,
222,
33566,
116,
17739,
111,
21410,
32634,
7509,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
1303,
5525,
229,
103,
22522,
248,
20046,
231,
7220,
27764,
245,
162,
106,
113,
11,
42468,
10310,
103,
49694,
238,
164,
245,
237,
161,
253,
253,
11,
165,
119,
246,
164,
106,
97,
164,
236,
115,
20998,
244,
21410,
42468,
37605,
241,
30298,
235,
163,
247,
119,
37605,
243,
163,
232,
35050,
222,
223,
21410,
7220,
198,
220,
220,
220,
2836,
796,
11389,
11341,
13,
41691,
15878,
7,
198,
220,
220,
220,
220,
220,
220,
220,
4277,
28,
46911,
11341,
13,
11297,
12982,
19463,
3419,
198,
220,
220,
220,
1267,
198,
220,
220,
220,
751,
62,
2435,
796,
11389,
11341,
13,
10430,
7575,
15878,
7,
961,
62,
8807,
28,
17821,
11,
5794,
11639,
4,
56,
12,
4,
76,
12,
4,
67,
4064,
39,
25,
4,
44,
11537,
628,
198,
4871,
17917,
32634,
11341,
7,
46911,
11341,
13,
17633,
32634,
7509,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
13328,
242,
101,
22755,
115,
162,
242,
114,
164,
112,
100,
28839,
108,
161,
251,
222,
33566,
116,
17739,
111,
21410,
32634,
7509,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
2836,
796,
11389,
11341,
13,
41691,
15878,
7,
198,
220,
220,
220,
220,
220,
220,
220,
4277,
28,
46911,
11341,
13,
11297,
12982,
19463,
3419,
198,
220,
220,
220,
1267,
198,
220,
220,
220,
751,
62,
2435,
796,
11389,
11341,
13,
10430,
7575,
15878,
7,
961,
62,
8807,
28,
17821,
11,
5794,
11639,
4,
56,
12,
4,
76,
12,
4,
67,
4064,
39,
25,
4,
44,
11537,
198,
220,
220,
220,
8473,
796,
11389,
11341,
13,
12441,
15878,
7,
9806,
62,
13664,
28,
3064,
11,
2672,
28,
17821,
11,
1249,
62,
8423,
28,
25101,
11,
6167,
11639,
40367,
223,
20015,
121,
3256,
4049,
62,
37348,
1095,
34758,
198,
220,
220,
220,
220,
220,
220,
220,
705,
9806,
62,
13664,
10354,
705,
43718,
120,
28156,
237,
17312,
231,
46237,
107,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
705,
35827,
10354,
705,
40367,
223,
20015,
121,
33232,
227,
161,
94,
104,
6,
198,
220,
220,
220,
32092,
198,
220,
220,
220,
1748,
796,
11389,
11341,
13,
12441,
15878,
7,
9806,
62,
13664,
28,
3064,
11,
2672,
28,
17821,
11,
1249,
62,
8423,
28,
25101,
11,
6167,
11639,
161,
253,
236,
30585,
224,
3256,
4049,
62,
37348,
1095,
34758,
198,
220,
220,
220,
220,
220,
220,
220,
705,
9806,
62,
13664,
10354,
705,
43718,
120,
28156,
237,
17312,
231,
46237,
107,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
705,
35827,
10354,
705,
161,
253,
236,
30585,
224,
33232,
227,
161,
94,
104,
6,
198,
220,
220,
220,
32092,
198,
220,
220,
220,
4783,
796,
11389,
11341,
13,
12441,
15878,
7,
9806,
62,
13664,
28,
3064,
11,
2672,
28,
17821,
11,
1249,
62,
8423,
28,
25101,
11,
6167,
11639,
44293,
118,
161,
253,
253,
3256,
4049,
62,
37348,
1095,
34758,
198,
220,
220,
220,
220,
220,
220,
220,
705,
9806,
62,
13664,
10354,
705,
43718,
120,
28156,
237,
17312,
231,
46237,
107,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
705,
35827,
10354,
705,
44293,
118,
161,
253,
253,
33232,
227,
161,
94,
104,
6,
198,
220,
220,
220,
32092,
198,
220,
220,
220,
2209,
796,
11389,
11341,
13,
12441,
15878,
7,
9806,
62,
13664,
28,
3064,
11,
2672,
28,
17821,
11,
1249,
62,
8423,
28,
25101,
11,
6167,
11639,
46237,
99,
163,
119,
228,
28839,
108,
161,
251,
222,
3256,
4049,
62,
37348,
1095,
34758,
198,
220,
220,
220,
220,
220,
220,
220,
705,
9806,
62,
13664,
10354,
705,
43718,
120,
28156,
237,
17312,
231,
46237,
107,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
705,
35827,
10354,
705,
46237,
99,
163,
119,
228,
28839,
108,
161,
251,
222,
33232,
227,
161,
94,
104,
6,
198,
220,
220,
220,
32092,
628,
220,
220,
220,
1051,
263,
62,
3672,
796,
11389,
11341,
13,
12441,
15878,
7,
9806,
62,
13664,
28,
3064,
11,
2672,
28,
17821,
11,
1249,
62,
8423,
28,
25101,
11,
6167,
11639,
162,
242,
114,
20015,
114,
21689,
3256,
4049,
62,
37348,
1095,
34758,
198,
220,
220,
220,
220,
220,
220,
220,
705,
35827,
10354,
705,
33232,
227,
165,
94,
119,
161,
94,
104,
37863,
247,
34650,
241,
28938,
235,
6,
198,
220,
220,
220,
32092,
198,
220,
220,
220,
1051,
263,
62,
24896,
796,
11389,
11341,
13,
12441,
15878,
7,
9806,
62,
13664,
28,
1157,
11,
949,
62,
13664,
28,
1157,
11,
2672,
28,
17821,
11,
6167,
11639,
162,
242,
114,
20015,
114,
21689,
33699,
233,
17312,
118,
20998,
115,
3256,
1249,
62,
8423,
28,
25101,
8,
198
] | 2.011396 | 1,053 |
from .utils import get_gitignored
EXCLUDE_DOC = {'*.md', '*.doc', '*.docx', '*.txt', '*.pdf', }
EXCLUDE_CONFIG = {'*.cfg', '*.ini', '*.conf', }
EXCLUDE_YAML = {'*.yml', '*.yaml', }
EXCLUDE_BASH = {'*.sh', }
EXCLUDE_GIT = {'.git', '.gitignore', }
EXCLUDE_DOCKER = {'Dockerfile', '.dockerignore', }
EXCLUDE_VIRTUALENV = {'venv', 'virtualenv'}
EXCLUDE_DEVELOPMENT_TOOLS = {'.idea', }
EXCLUDE_IMAGES = {'*.png', '*.jpg', '*.jpeg', '*.bmp', '*.gif', }
EXCLUDE_AUDIO = {'*.png', '*.jpg', '*.jpeg', '*.bmp', '*.gif', }
EXCLUDE_VIDEO = {'*.mkv', '*.avi', }
EXCLUDE_MEDIA = EXCLUDE_AUDIO | EXCLUDE_IMAGES | EXCLUDE_VIDEO
EXCLUDE_PYCOMPILE = {'*.pyc', '__pycache__', }
EXCLUDE_SETUPTOOLS_FILES = {'build', 'dist', '*.egg-info', }
EXCLUDE_PYTHON_BUILD_FILES = EXCLUDE_PYCOMPILE | EXCLUDE_SETUPTOOLS_FILES
EXCLUDE_GITIGNORED = get_gitignored()
EXCLUDE_RECOMMENDED = EXCLUDE_DOC | EXCLUDE_GIT | EXCLUDE_DEVELOPMENT_TOOLS | EXCLUDE_VIRTUALENV | \
EXCLUDE_MEDIA | EXCLUDE_PYTHON_BUILD_FILES | EXCLUDE_GITIGNORED
| [
6738,
764,
26791,
1330,
651,
62,
18300,
570,
1850,
628,
198,
6369,
5097,
52,
7206,
62,
38715,
796,
1391,
6,
24620,
9132,
3256,
705,
24620,
15390,
3256,
705,
24620,
15390,
87,
3256,
705,
24620,
14116,
3256,
705,
24620,
12315,
3256,
1782,
198,
198,
6369,
5097,
52,
7206,
62,
10943,
16254,
796,
1391,
6,
24620,
37581,
3256,
705,
24620,
5362,
3256,
705,
24620,
10414,
3256,
1782,
198,
6369,
5097,
52,
7206,
62,
56,
2390,
43,
796,
1391,
6,
24620,
88,
4029,
3256,
705,
24620,
88,
43695,
3256,
1782,
198,
198,
6369,
5097,
52,
7206,
62,
33,
11211,
796,
1391,
6,
24620,
1477,
3256,
1782,
198,
6369,
5097,
52,
7206,
62,
38,
2043,
796,
1391,
4458,
18300,
3256,
45302,
18300,
46430,
3256,
1782,
198,
6369,
5097,
52,
7206,
62,
35,
11290,
1137,
796,
1391,
6,
35,
12721,
7753,
3256,
45302,
45986,
46430,
3256,
1782,
198,
6369,
5097,
52,
7206,
62,
53,
48771,
25620,
1677,
53,
796,
1391,
6,
574,
85,
3256,
705,
32844,
24330,
6,
92,
198,
6369,
5097,
52,
7206,
62,
7206,
18697,
3185,
10979,
62,
10468,
3535,
50,
796,
1391,
4458,
485,
64,
3256,
1782,
198,
198,
6369,
5097,
52,
7206,
62,
3955,
25552,
796,
1391,
6,
24620,
11134,
3256,
705,
24620,
9479,
3256,
705,
24620,
73,
22071,
3256,
705,
24620,
65,
3149,
3256,
705,
24620,
27908,
3256,
1782,
198,
6369,
5097,
52,
7206,
62,
48877,
9399,
796,
1391,
6,
24620,
11134,
3256,
705,
24620,
9479,
3256,
705,
24620,
73,
22071,
3256,
705,
24620,
65,
3149,
3256,
705,
24620,
27908,
3256,
1782,
198,
6369,
5097,
52,
7206,
62,
42937,
796,
1391,
6,
24620,
28015,
85,
3256,
705,
24620,
15820,
3256,
1782,
198,
6369,
5097,
52,
7206,
62,
30733,
3539,
796,
7788,
5097,
52,
7206,
62,
48877,
9399,
930,
7788,
5097,
52,
7206,
62,
3955,
25552,
930,
7788,
5097,
52,
7206,
62,
42937,
198,
198,
6369,
5097,
52,
7206,
62,
47,
56,
9858,
11901,
2538,
796,
1391,
6,
24620,
9078,
66,
3256,
705,
834,
9078,
23870,
834,
3256,
1782,
198,
6369,
5097,
52,
7206,
62,
28480,
8577,
10468,
3535,
50,
62,
46700,
1546,
796,
1391,
6,
11249,
3256,
705,
17080,
3256,
705,
24620,
33856,
12,
10951,
3256,
1782,
198,
6369,
5097,
52,
7206,
62,
47,
56,
4221,
1340,
62,
19499,
26761,
62,
46700,
1546,
796,
7788,
5097,
52,
7206,
62,
47,
56,
9858,
11901,
2538,
930,
7788,
5097,
52,
7206,
62,
28480,
8577,
10468,
3535,
50,
62,
46700,
1546,
198,
198,
6369,
5097,
52,
7206,
62,
38,
2043,
16284,
32023,
796,
651,
62,
18300,
570,
1850,
3419,
198,
198,
6369,
5097,
52,
7206,
62,
2200,
9858,
44,
49361,
796,
7788,
5097,
52,
7206,
62,
38715,
930,
7788,
5097,
52,
7206,
62,
38,
2043,
930,
7788,
5097,
52,
7206,
62,
7206,
18697,
3185,
10979,
62,
10468,
3535,
50,
930,
7788,
5097,
52,
7206,
62,
53,
48771,
25620,
1677,
53,
930,
3467,
198,
220,
220,
220,
7788,
5097,
52,
7206,
62,
30733,
3539,
930,
7788,
5097,
52,
7206,
62,
47,
56,
4221,
1340,
62,
19499,
26761,
62,
46700,
1546,
930,
7788,
5097,
52,
7206,
62,
38,
2043,
16284,
32023,
198
] | 1.990138 | 507 |
#Source: http://code.activestate.com/recipes/578948-flattening-an-arbitrarily-nested-list-in-python/
def flatten(lis):
"""Given a list, possibly nested to any level, return it flattened."""
new_lis = []
for item in lis:
if type(item) == type([]):
new_lis.extend(flatten(item))
else:
new_lis.append(item)
return new_lis
| [
198,
2,
7416,
25,
2638,
1378,
8189,
13,
15791,
44146,
13,
785,
14,
8344,
18636,
14,
3553,
4531,
2780,
12,
2704,
1078,
3101,
12,
272,
12,
283,
2545,
39000,
12,
77,
7287,
12,
4868,
12,
259,
12,
29412,
14,
198,
4299,
27172,
268,
7,
27999,
2599,
198,
220,
220,
220,
37227,
15056,
257,
1351,
11,
5457,
28376,
284,
597,
1241,
11,
1441,
340,
45096,
526,
15931,
198,
220,
220,
220,
649,
62,
27999,
796,
17635,
198,
220,
220,
220,
329,
2378,
287,
300,
271,
25,
198,
220,
220,
220,
220,
220,
220,
220,
611,
2099,
7,
9186,
8,
6624,
2099,
7,
21737,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
649,
62,
27999,
13,
2302,
437,
7,
2704,
41769,
7,
9186,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
649,
62,
27999,
13,
33295,
7,
9186,
8,
198,
220,
220,
220,
1441,
649,
62,
27999,
198
] | 2.26506 | 166 |
from django.urls import path, re_path
from . import views
app_name = 'categorias'
urlpatterns = [
path('', views.index, name='index'),
path('crear_categoria', views.crear_categoria, name='crear_categoria'),
path('process_new_categories', views.process_new_categories, name='process_new_categories'),
path('ver_categoria/<int:categoria_id>', views.ver_categoria, name='ver_categoria'),
re_path(r'^delete_category/(?P<pk>[0-9]+)/$', views.delete_category, name='delete_category'),
path('index_flutter', views.index_flutter, name='index_flutter'),
path('process_new_categories_flutter', views.process_new_categories_flutter, name='process_new_categories_flutter'),
path('delete_category_flutter', views.delete_category_flutter, name='delete_category_flutter'),
path('ver_categoria_flutter', views.ver_categoria_flutter, name='ver_categoria_flutter'),
]
| [
6738,
42625,
14208,
13,
6371,
82,
1330,
3108,
11,
302,
62,
6978,
201,
198,
6738,
764,
1330,
5009,
201,
198,
201,
198,
1324,
62,
3672,
796,
705,
66,
47467,
4448,
6,
201,
198,
6371,
33279,
82,
796,
685,
201,
198,
220,
220,
220,
3108,
10786,
3256,
5009,
13,
9630,
11,
1438,
11639,
9630,
33809,
201,
198,
220,
220,
220,
3108,
10786,
7513,
283,
62,
66,
2397,
7661,
3256,
5009,
13,
7513,
283,
62,
66,
2397,
7661,
11,
1438,
11639,
7513,
283,
62,
66,
2397,
7661,
33809,
201,
198,
220,
220,
220,
3108,
10786,
14681,
62,
3605,
62,
66,
26129,
3256,
5009,
13,
14681,
62,
3605,
62,
66,
26129,
11,
1438,
11639,
14681,
62,
3605,
62,
66,
26129,
33809,
201,
198,
220,
220,
220,
3108,
10786,
332,
62,
66,
2397,
7661,
14,
27,
600,
25,
66,
2397,
7661,
62,
312,
29,
3256,
5009,
13,
332,
62,
66,
2397,
7661,
11,
1438,
11639,
332,
62,
66,
2397,
7661,
33809,
201,
198,
220,
220,
220,
302,
62,
6978,
7,
81,
6,
61,
33678,
62,
22872,
29006,
30,
47,
27,
79,
74,
36937,
15,
12,
24,
48688,
20679,
3,
3256,
5009,
13,
33678,
62,
22872,
11,
1438,
11639,
33678,
62,
22872,
33809,
201,
198,
220,
220,
220,
3108,
10786,
9630,
62,
2704,
10381,
3256,
5009,
13,
9630,
62,
2704,
10381,
11,
1438,
11639,
9630,
62,
2704,
10381,
33809,
201,
198,
220,
220,
220,
3108,
10786,
14681,
62,
3605,
62,
66,
26129,
62,
2704,
10381,
3256,
5009,
13,
14681,
62,
3605,
62,
66,
26129,
62,
2704,
10381,
11,
1438,
11639,
14681,
62,
3605,
62,
66,
26129,
62,
2704,
10381,
33809,
201,
198,
220,
220,
220,
3108,
10786,
33678,
62,
22872,
62,
2704,
10381,
3256,
5009,
13,
33678,
62,
22872,
62,
2704,
10381,
11,
1438,
11639,
33678,
62,
22872,
62,
2704,
10381,
33809,
201,
198,
220,
220,
220,
3108,
10786,
332,
62,
66,
2397,
7661,
62,
2704,
10381,
3256,
5009,
13,
332,
62,
66,
2397,
7661,
62,
2704,
10381,
11,
1438,
11639,
332,
62,
66,
2397,
7661,
62,
2704,
10381,
33809,
201,
198,
201,
198,
60,
201,
198
] | 2.643275 | 342 |
"""
These meta-datasources operate on :class:`revscoring.Datasource`'s that return
a flat `dict` of key-value pairs (aka a "table") and filter ("select") keys
and/or weight values.
.. autoclass:: revscoring.datasources.meta.selectors.tfidf
.. autoclass:: revscoring.datasources.meta.selectors.filter_keys
"""
from collections import defaultdict
from math import log
from ..datasource import Datasource
class tfidf(Datasource):
"""
Selects a subset of a frequency table based on term utility and applies
TF-iDF weighting.
:Parameters:
table_datasource : :class:`revscoring.Datasource`
A datasource that generates a dict of term frequency counts
max_terms : `int`
The maximum number of terms that will be selected. The terms
with the highest proportional representation in a label class
are selected.
weight : `bool`
Should TF-iDF weighting be applied to output counts?
boolean : `bool`
Normalize counts to 0 (not in document) and 1 (in document). Note
that negative frequencies will be converted to -1.
name : `str`
A name for the datasource.
"""
class filter_keys(Datasource):
"""
Selects a subset of features (key/values) based a set of keys.
:Parameters:
table_datasource : :class:`revscoring.Datasource`
A datasource that generates a table including only the specified
keys
keys : `iterable` ( `hashable` )
The keys to select from the table
name : `str`
A name for the datasource.
"""
| [
37811,
198,
4711,
13634,
12,
19608,
292,
2203,
8076,
319,
1058,
4871,
25,
63,
18218,
46536,
13,
27354,
292,
1668,
63,
6,
82,
326,
1441,
198,
64,
6228,
4600,
11600,
63,
286,
1994,
12,
8367,
14729,
357,
8130,
257,
366,
11487,
4943,
290,
8106,
5855,
19738,
4943,
8251,
198,
392,
14,
273,
3463,
3815,
13,
198,
198,
492,
1960,
420,
31172,
3712,
2710,
46536,
13,
19608,
292,
2203,
13,
28961,
13,
19738,
669,
13,
27110,
312,
69,
198,
198,
492,
1960,
420,
31172,
3712,
2710,
46536,
13,
19608,
292,
2203,
13,
28961,
13,
19738,
669,
13,
24455,
62,
13083,
198,
198,
37811,
198,
198,
6738,
17268,
1330,
4277,
11600,
198,
6738,
10688,
1330,
2604,
198,
198,
6738,
11485,
19608,
292,
1668,
1330,
16092,
292,
1668,
628,
198,
4871,
48700,
312,
69,
7,
27354,
292,
1668,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
9683,
82,
257,
24637,
286,
257,
8373,
3084,
1912,
319,
3381,
10361,
290,
8991,
198,
220,
220,
220,
24958,
12,
72,
8068,
3463,
278,
13,
628,
220,
220,
220,
1058,
48944,
25,
198,
220,
220,
220,
220,
220,
220,
220,
3084,
62,
19608,
292,
1668,
1058,
1058,
4871,
25,
63,
18218,
46536,
13,
27354,
292,
1668,
63,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
317,
19395,
1668,
326,
18616,
257,
8633,
286,
3381,
8373,
9853,
198,
220,
220,
220,
220,
220,
220,
220,
3509,
62,
38707,
1058,
4600,
600,
63,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
383,
5415,
1271,
286,
2846,
326,
481,
307,
6163,
13,
220,
383,
2846,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
351,
262,
4511,
27111,
10552,
287,
257,
6167,
1398,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
389,
6163,
13,
198,
220,
220,
220,
220,
220,
220,
220,
3463,
1058,
4600,
30388,
63,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
10358,
24958,
12,
72,
8068,
3463,
278,
307,
5625,
284,
5072,
9853,
30,
198,
220,
220,
220,
220,
220,
220,
220,
25131,
1058,
4600,
30388,
63,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
14435,
1096,
9853,
284,
657,
357,
1662,
287,
3188,
8,
290,
352,
357,
259,
3188,
737,
220,
5740,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
326,
4633,
19998,
481,
307,
11513,
284,
532,
16,
13,
198,
220,
220,
220,
220,
220,
220,
220,
1438,
1058,
4600,
2536,
63,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
317,
1438,
329,
262,
19395,
1668,
13,
198,
220,
220,
220,
37227,
628,
198,
198,
4871,
8106,
62,
13083,
7,
27354,
292,
1668,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
9683,
82,
257,
24637,
286,
3033,
357,
2539,
14,
27160,
8,
1912,
257,
900,
286,
8251,
13,
628,
220,
220,
220,
1058,
48944,
25,
198,
220,
220,
220,
220,
220,
220,
220,
3084,
62,
19608,
292,
1668,
1058,
1058,
4871,
25,
63,
18218,
46536,
13,
27354,
292,
1668,
63,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
317,
19395,
1668,
326,
18616,
257,
3084,
1390,
691,
262,
7368,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8251,
198,
220,
220,
220,
220,
220,
220,
220,
8251,
1058,
4600,
2676,
540,
63,
357,
4600,
17831,
540,
63,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
383,
8251,
284,
2922,
422,
262,
3084,
198,
220,
220,
220,
220,
220,
220,
220,
1438,
1058,
4600,
2536,
63,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
317,
1438,
329,
262,
19395,
1668,
13,
198,
220,
220,
220,
37227,
198
] | 2.637821 | 624 |
import argparse
import logging
import os
import time
from .helper import notify
from .state import QuitNow, TimedState
if __name__ == '__main__':
logging.basicConfig(format='%(asctime)s: %(message)s', level=logging.INFO)
main()
| [
11748,
1822,
29572,
198,
11748,
18931,
198,
11748,
28686,
198,
11748,
640,
198,
198,
6738,
764,
2978,
525,
1330,
19361,
198,
6738,
764,
5219,
1330,
48887,
3844,
11,
5045,
276,
9012,
628,
628,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
18931,
13,
35487,
16934,
7,
18982,
11639,
4,
7,
292,
310,
524,
8,
82,
25,
4064,
7,
20500,
8,
82,
3256,
1241,
28,
6404,
2667,
13,
10778,
8,
198,
220,
220,
220,
1388,
3419,
198
] | 2.892857 | 84 |
import os
import scipy.misc #
import numpy as np
from model import DCGAN
from utils import pp, visualize, to_json, show_all_variables
import tensorflow as tf
flags = tf.app.flags
flags.DEFINE_integer("epoch", 25, "Epoch to train [25]")
flags.DEFINE_float("learning_rate", 0.0002, "Learning rate of for adam [0.0002]")
flags.DEFINE_float("beta1", 0.5, "Momentum term of adam [0.5]")
flags.DEFINE_integer("train_size", np.inf, "The size of train images [np.inf]")
flags.DEFINE_integer("batch_size", 64, "The size of batch images [64]")
flags.DEFINE_integer("input_height", 108, "The size of image to use (will be center cropped). [108]")
flags.DEFINE_integer("input_width", None, "The size of image to use (will be center cropped). If None, same value as input_height [None]")
flags.DEFINE_integer("output_height", 64, "The size of the output images to produce [64]")
flags.DEFINE_integer("output_width", None, "The size of the output images to produce. If None, same value as output_height [None]")
flags.DEFINE_string("dataset", "celebA", "The name of dataset [celebA, mnist, lsun]")
flags.DEFINE_string("input_fname_pattern", "*.jpg", "Glob pattern of filename of input images [*]")
flags.DEFINE_string("checkpoint_dir", "checkpoint", "Directory name to save the checkpoints [checkpoint]")
flags.DEFINE_string("sample_dir", "samples", "Directory name to save the image samples [samples]")
flags.DEFINE_boolean("train", False, "True for training, False for testing [False]")
flags.DEFINE_boolean("crop", False, "True for training, False for testing [False]")
flags.DEFINE_boolean("visualize", False, "True for visualizing, False for nothing [False]")
FLAGS = flags.FLAGS | [
11748,
28686,
198,
11748,
629,
541,
88,
13,
44374,
1303,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
2746,
1330,
6257,
45028,
198,
6738,
3384,
4487,
1330,
9788,
11,
38350,
11,
284,
62,
17752,
11,
905,
62,
439,
62,
25641,
2977,
198,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
198,
33152,
796,
48700,
13,
1324,
13,
33152,
198,
33152,
13,
7206,
29940,
62,
41433,
7203,
538,
5374,
1600,
1679,
11,
366,
13807,
5374,
284,
4512,
685,
1495,
60,
4943,
198,
33152,
13,
7206,
29940,
62,
22468,
7203,
40684,
62,
4873,
1600,
657,
13,
34215,
11,
366,
41730,
2494,
286,
329,
23197,
685,
15,
13,
34215,
60,
4943,
198,
33152,
13,
7206,
29940,
62,
22468,
7203,
31361,
16,
1600,
657,
13,
20,
11,
366,
29252,
298,
388,
3381,
286,
23197,
685,
15,
13,
20,
60,
4943,
198,
33152,
13,
7206,
29940,
62,
41433,
7203,
27432,
62,
7857,
1600,
45941,
13,
10745,
11,
366,
464,
2546,
286,
4512,
4263,
685,
37659,
13,
10745,
60,
4943,
198,
33152,
13,
7206,
29940,
62,
41433,
7203,
43501,
62,
7857,
1600,
5598,
11,
366,
464,
2546,
286,
15458,
4263,
685,
2414,
60,
4943,
198,
33152,
13,
7206,
29940,
62,
41433,
7203,
15414,
62,
17015,
1600,
15495,
11,
366,
464,
2546,
286,
2939,
284,
779,
357,
10594,
307,
3641,
48998,
737,
685,
15711,
60,
4943,
198,
33152,
13,
7206,
29940,
62,
41433,
7203,
15414,
62,
10394,
1600,
6045,
11,
366,
464,
2546,
286,
2939,
284,
779,
357,
10594,
307,
3641,
48998,
737,
1002,
6045,
11,
976,
1988,
355,
5128,
62,
17015,
685,
14202,
60,
4943,
198,
33152,
13,
7206,
29940,
62,
41433,
7203,
22915,
62,
17015,
1600,
5598,
11,
366,
464,
2546,
286,
262,
5072,
4263,
284,
4439,
685,
2414,
60,
4943,
198,
33152,
13,
7206,
29940,
62,
41433,
7203,
22915,
62,
10394,
1600,
6045,
11,
366,
464,
2546,
286,
262,
5072,
4263,
284,
4439,
13,
1002,
6045,
11,
976,
1988,
355,
5072,
62,
17015,
685,
14202,
60,
4943,
198,
33152,
13,
7206,
29940,
62,
8841,
7203,
19608,
292,
316,
1600,
366,
49840,
65,
32,
1600,
366,
464,
1438,
286,
27039,
685,
49840,
65,
32,
11,
285,
77,
396,
11,
300,
19155,
60,
4943,
198,
33152,
13,
7206,
29940,
62,
8841,
7203,
15414,
62,
69,
3672,
62,
33279,
1600,
366,
24620,
9479,
1600,
366,
9861,
672,
3912,
286,
29472,
286,
5128,
4263,
36338,
4943,
198,
33152,
13,
7206,
29940,
62,
8841,
7203,
9122,
4122,
62,
15908,
1600,
366,
9122,
4122,
1600,
366,
43055,
1438,
284,
3613,
262,
36628,
685,
9122,
4122,
60,
4943,
198,
33152,
13,
7206,
29940,
62,
8841,
7203,
39873,
62,
15908,
1600,
366,
82,
12629,
1600,
366,
43055,
1438,
284,
3613,
262,
2939,
8405,
685,
82,
12629,
60,
4943,
198,
33152,
13,
7206,
29940,
62,
2127,
21052,
7203,
27432,
1600,
10352,
11,
366,
17821,
329,
3047,
11,
10352,
329,
4856,
685,
25101,
60,
4943,
198,
33152,
13,
7206,
29940,
62,
2127,
21052,
7203,
31476,
1600,
10352,
11,
366,
17821,
329,
3047,
11,
10352,
329,
4856,
685,
25101,
60,
4943,
198,
33152,
13,
7206,
29940,
62,
2127,
21052,
7203,
41464,
1096,
1600,
10352,
11,
366,
17821,
329,
5874,
2890,
11,
10352,
329,
2147,
685,
25101,
60,
4943,
198,
38948,
50,
796,
9701,
13,
38948,
50
] | 3.144737 | 532 |
from .base_3droi_head import Base3DRoIHead
from .bbox_heads import PartA2BboxHead
from .mask_heads import PointwiseSemanticHead
from .part_aggregation_roi_head import PartAggregationROIHead
from .roi_extractors import Single3DRoIAwareExtractor, SingleRoIExtractor
__all__ = [
'Base3DRoIHead', 'PartAggregationROIHead', 'PointwiseSemanticHead',
'Single3DRoIAwareExtractor', 'PartA2BboxHead', 'SingleRoIExtractor'
]
| [
6738,
764,
8692,
62,
18,
22285,
72,
62,
2256,
1330,
7308,
18,
7707,
78,
40,
13847,
198,
6738,
764,
65,
3524,
62,
16600,
1330,
2142,
32,
17,
33,
3524,
13847,
198,
6738,
764,
27932,
62,
16600,
1330,
6252,
3083,
13900,
5109,
13847,
198,
6738,
764,
3911,
62,
9460,
43068,
62,
305,
72,
62,
2256,
1330,
2142,
46384,
43068,
13252,
40,
13847,
198,
6738,
764,
305,
72,
62,
2302,
974,
669,
1330,
14206,
18,
7707,
78,
3539,
1574,
11627,
40450,
11,
14206,
15450,
10008,
742,
40450,
198,
198,
834,
439,
834,
796,
685,
198,
220,
220,
220,
705,
14881,
18,
7707,
78,
40,
13847,
3256,
705,
7841,
46384,
43068,
13252,
40,
13847,
3256,
705,
12727,
3083,
13900,
5109,
13847,
3256,
198,
220,
220,
220,
705,
28008,
18,
7707,
78,
3539,
1574,
11627,
40450,
3256,
705,
7841,
32,
17,
33,
3524,
13847,
3256,
705,
28008,
15450,
10008,
742,
40450,
6,
198,
60,
198
] | 2.801325 | 151 |
from pathlib import Path
import pytest
@pytest.fixture # type: ignore
| [
6738,
3108,
8019,
1330,
10644,
198,
198,
11748,
12972,
9288,
628,
198,
31,
9078,
9288,
13,
69,
9602,
220,
1303,
2099,
25,
8856,
198
] | 3.083333 | 24 |
# path: lib/processors
# filename: loop.py
# description: WSGI application image file processors
'''
# make python2 strings and dictionaries behave like python3
from __future__ import unicode_literals
try:
from builtins import dict, str
except ImportError:
from __builtin__ import dict, str
Copyright 2017 Mark Madere
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.
'''
''' external imports
'''
import copy
''' internal imports
'''
import classes.processor
''' classes
'''
class Loop(classes.processor.Processor):
'''
Description:
Loop over a set of data to do more processing
Usage:
type: lib.processors.loop.Loop
''' | [
2,
3108,
25,
9195,
14,
14681,
669,
198,
2,
29472,
25,
9052,
13,
9078,
198,
2,
6764,
25,
25290,
18878,
3586,
2939,
2393,
20399,
198,
7061,
6,
220,
198,
2,
787,
21015,
17,
13042,
290,
48589,
3166,
17438,
588,
21015,
18,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
28311,
25,
198,
197,
6738,
3170,
1040,
1330,
8633,
11,
965,
198,
16341,
17267,
12331,
25,
198,
197,
6738,
11593,
18780,
259,
834,
1330,
8633,
11,
965,
198,
197,
628,
197,
15269,
2177,
2940,
4627,
567,
628,
197,
26656,
15385,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
197,
5832,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198,
197,
1639,
743,
7330,
257,
4866,
286,
262,
13789,
379,
628,
197,
4023,
1378,
2503,
13,
43073,
13,
2398,
14,
677,
4541,
14,
43,
2149,
24290,
12,
17,
13,
15,
628,
197,
28042,
2672,
416,
9723,
1099,
393,
4987,
284,
287,
3597,
11,
3788,
198,
197,
17080,
6169,
739,
262,
13789,
318,
9387,
319,
281,
366,
1921,
3180,
1,
29809,
1797,
11,
198,
197,
54,
10554,
12425,
34764,
11015,
6375,
7102,
49828,
11053,
3963,
15529,
509,
12115,
11,
2035,
4911,
393,
17142,
13,
198,
197,
6214,
262,
13789,
329,
262,
2176,
3303,
15030,
21627,
290,
198,
197,
2475,
20597,
739,
262,
13789,
13,
198,
7061,
6,
198,
198,
7061,
6,
7097,
17944,
198,
7061,
6,
198,
11748,
4866,
198,
198,
7061,
6,
5387,
17944,
198,
7061,
6,
198,
11748,
6097,
13,
41341,
198,
198,
7061,
6,
6097,
198,
7061,
6,
198,
4871,
26304,
7,
37724,
13,
41341,
13,
18709,
273,
2599,
628,
197,
7061,
6,
198,
197,
11828,
25,
198,
197,
197,
198,
197,
197,
39516,
625,
257,
900,
286,
1366,
284,
466,
517,
7587,
198,
197,
198,
197,
28350,
25,
198,
197,
198,
197,
197,
4906,
25,
9195,
13,
14681,
669,
13,
26268,
13,
39516,
198,
197,
7061,
6
] | 3.478395 | 324 |
'''
Copyright 2015 Serendio Inc.
Author - Satish Palaniappan
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.
'''
__author__ = "Satish Palaniappan"
import numpy as np
from sklearn import cluster, datasets, preprocessing
import pickle
import gensim
import time
import re
import tokenize
from scipy import spatial
# 3M word google dataset of pretrained 300D vectors
model = gensim.models.Word2Vec.load_word2vec_format('vectors.bin', binary=True)
model.init_sims(replace=True)
#### getting all vecs from w2v using the inbuilt syn0 list see code
# X = model.syn0
# ### scaling feature vecs
# min_max_scaler = preprocessing.MinMaxScaler()
# X_Scaled_Feature_Vecs = min_max_scaler.fit_transform(X)
# X_Scaled_Feature_Vecs = X
# W2V = dict(zip(model.vocab, X_Scaled_Feature_Vecs))
#Cosine Distance
# from scipy import spatial
# dataSetI = model["travel"]
# dataSetII = model["travelling"]
# result = 1 - spatial.distance.cosine(dataSetI, dataSetII)
# print(result)
X_Scaled_Feature_Vecs=[]
for word in model.vocab:
X_Scaled_Feature_Vecs.append(model[word])
# ######## Interested Categories
cat = [
"advertising",
"beauty",
"business",
"celebrity",
"diy craft",
"entertainment",
"family",
"fashion",
"food",
"general",
"health",
"lifestyle",
"music",
"news",
"pop",
"culture",
"social",
"media",
"sports",
"technology",
"travel",
"video games"
]
nums = range(0,22)
num2cat = dict(zip(nums, cat))
catVec=[]
# load from C file output
for c in cat:
try:
catVec.append(model[c.lower()])
except:
words = c.split()
A = np.add(np.array(model[words[0].lower()]),np.array(model[words[1].lower()]))
M = np.multiply(A,A)
lent=0
for i in M:
lent+=i
V = np.divide(A,lent)
catVec.append(list(V))
# kmeans
##### better code
t0 = time.time()
# Assign Max_Iter to 1 (ONE) if u just want to fit vectors around seeds
kmeans = cluster.KMeans(n_clusters=22, init=np.array(catVec), max_iter=1).fit(X_Scaled_Feature_Vecs)
#kmeans = cluster.KMeans(n_clusters=22, init=np.array(catVec), max_iter=900).fit(X_Scaled_Feature_Vecs)
print(str(time.time()-t0))
print(kmeans.inertia_)
###### After Fiting the Cluster Centers are recomputed : update catVec (Order Preserved)
catVec = kmeans.cluster_centers_
# #test
# for c in catVec:
# print(num2cat[kmeans.predict(c)[0]])
##### save best for future use
save_obj(kmeans,"clusterSmall")
KM = load_obj("clusterSmall")
# Cluster_lookUP = dict(zip(model.vocab, KM.labels_))
Cluster_lookUP = dict()
for word in model.vocab:
Cluster_lookUP[word] = KM.predict(model[word])[0]
## Precomputing the cosine similarities
Cosine_Similarity = dict()
for k in Cluster_lookUP.keys():
Cosine_Similarity[k] = 1 - spatial.distance.cosine(model[k], catVec[Cluster_lookUP[k]])
#check
print(num2cat[Cluster_lookUP["flight"]] + " "+str(Cosine_Similarity["flight"]))
print(num2cat[Cluster_lookUP["gamecube"]] +" "+str(Cosine_Similarity["gamecube"]))
#Saving Models
save_obj(Cluster_lookUP,"Cluster_lookUP")
save_obj(Cosine_Similarity,"Cosine_Similarity")
save_obj(num2cat,"num2cat")
save_obj(catVec,"catVec")
| [
7061,
6,
198,
15269,
1853,
30175,
358,
952,
3457,
13,
198,
13838,
532,
7031,
680,
3175,
5411,
381,
272,
198,
198,
26656,
15385,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
921,
743,
7330,
257,
4866,
286,
262,
13789,
379,
198,
198,
4023,
1378,
2503,
13,
43073,
13,
2398,
14,
677,
4541,
14,
43,
2149,
24290,
12,
17,
13,
15,
198,
198,
28042,
2672,
416,
9723,
1099,
393,
4987,
284,
287,
3597,
11,
198,
43776,
9387,
739,
262,
13789,
318,
9387,
319,
281,
366,
1921,
3180,
1,
29809,
1797,
11,
42881,
34764,
11015,
6375,
7102,
49828,
11053,
3963,
15529,
509,
12115,
11,
2035,
4911,
393,
17142,
13,
198,
6214,
262,
13789,
329,
262,
2176,
3303,
15030,
21627,
290,
11247,
739,
262,
13789,
13,
198,
7061,
6,
198,
834,
9800,
834,
796,
366,
20245,
680,
3175,
5411,
381,
272,
1,
628,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
1341,
35720,
1330,
13946,
11,
40522,
11,
662,
36948,
198,
11748,
2298,
293,
198,
11748,
308,
641,
320,
198,
11748,
640,
198,
11748,
302,
198,
11748,
11241,
1096,
198,
6738,
629,
541,
88,
1330,
21739,
628,
198,
2,
513,
44,
1573,
23645,
27039,
286,
2181,
13363,
5867,
35,
30104,
198,
19849,
796,
308,
641,
320,
13,
27530,
13,
26449,
17,
53,
721,
13,
2220,
62,
4775,
17,
35138,
62,
18982,
10786,
303,
5217,
13,
8800,
3256,
13934,
28,
17821,
8,
198,
19849,
13,
15003,
62,
82,
12078,
7,
33491,
28,
17821,
8,
198,
198,
4242,
1972,
477,
1569,
6359,
422,
266,
17,
85,
1262,
262,
287,
18780,
6171,
15,
1351,
766,
2438,
198,
198,
2,
1395,
796,
2746,
13,
28869,
15,
198,
198,
2,
44386,
20796,
3895,
1569,
6359,
198,
2,
949,
62,
9806,
62,
1416,
36213,
796,
662,
36948,
13,
9452,
11518,
3351,
36213,
3419,
198,
2,
1395,
62,
3351,
3021,
62,
38816,
62,
53,
721,
82,
796,
949,
62,
9806,
62,
1416,
36213,
13,
11147,
62,
35636,
7,
55,
8,
198,
198,
2,
1395,
62,
3351,
3021,
62,
38816,
62,
53,
721,
82,
796,
1395,
198,
198,
2,
370,
17,
53,
796,
8633,
7,
13344,
7,
19849,
13,
18893,
397,
11,
1395,
62,
3351,
3021,
62,
38816,
62,
53,
721,
82,
4008,
198,
198,
2,
36734,
500,
34600,
198,
2,
422,
629,
541,
88,
1330,
21739,
198,
198,
2,
1366,
7248,
40,
796,
2746,
14692,
35927,
8973,
198,
2,
1366,
7248,
3978,
796,
2746,
14692,
83,
5758,
2680,
8973,
198,
2,
1255,
796,
352,
532,
21739,
13,
30246,
13,
6966,
500,
7,
7890,
7248,
40,
11,
1366,
7248,
3978,
8,
198,
2,
3601,
7,
20274,
8,
198,
198,
55,
62,
3351,
3021,
62,
38816,
62,
53,
721,
82,
28,
21737,
198,
1640,
1573,
287,
2746,
13,
18893,
397,
25,
198,
220,
220,
220,
1395,
62,
3351,
3021,
62,
38816,
62,
53,
721,
82,
13,
33295,
7,
19849,
58,
4775,
12962,
198,
198,
2,
46424,
21017,
12033,
276,
45486,
198,
9246,
796,
685,
198,
1,
34442,
1600,
198,
1,
40544,
88,
1600,
198,
1,
22680,
1600,
198,
1,
49840,
1671,
414,
1600,
198,
1,
67,
7745,
5977,
1600,
198,
1,
298,
1425,
434,
1600,
198,
1,
17989,
1600,
198,
1,
25265,
1600,
198,
1,
19425,
1600,
198,
1,
24622,
1600,
198,
1,
13948,
1600,
198,
1,
75,
42004,
1600,
198,
1,
28965,
1600,
198,
1,
10827,
1600,
198,
1,
12924,
1600,
198,
1,
25584,
1600,
198,
1,
14557,
1600,
198,
1,
11431,
1600,
198,
1,
32945,
1600,
198,
1,
45503,
1600,
198,
1,
35927,
1600,
198,
1,
15588,
1830,
1,
198,
60,
198,
198,
77,
5700,
796,
2837,
7,
15,
11,
1828,
8,
198,
22510,
17,
9246,
796,
8633,
7,
13344,
7,
77,
5700,
11,
3797,
4008,
198,
198,
9246,
53,
721,
28,
21737,
198,
2,
3440,
422,
327,
2393,
5072,
198,
1640,
269,
287,
3797,
25,
198,
220,
220,
220,
1949,
25,
198,
220,
220,
220,
220,
220,
220,
220,
3797,
53,
721,
13,
33295,
7,
19849,
58,
66,
13,
21037,
3419,
12962,
198,
220,
220,
220,
2845,
25,
198,
220,
220,
220,
220,
220,
220,
220,
2456,
796,
269,
13,
35312,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
317,
796,
45941,
13,
2860,
7,
37659,
13,
18747,
7,
19849,
58,
10879,
58,
15,
4083,
21037,
3419,
46570,
37659,
13,
18747,
7,
19849,
58,
10879,
58,
16,
4083,
21037,
3419,
60,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
337,
796,
45941,
13,
16680,
541,
306,
7,
32,
11,
32,
8,
198,
220,
220,
220,
220,
220,
220,
220,
26269,
28,
15,
198,
220,
220,
220,
220,
220,
220,
220,
329,
1312,
287,
337,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26269,
47932,
72,
198,
220,
220,
220,
220,
220,
220,
220,
569,
796,
45941,
13,
7146,
485,
7,
32,
11,
75,
298,
8,
198,
220,
220,
220,
220,
220,
220,
220,
3797,
53,
721,
13,
33295,
7,
4868,
7,
53,
4008,
198,
2,
479,
1326,
504,
198,
4242,
2,
1365,
2438,
198,
83,
15,
796,
640,
13,
2435,
3419,
198,
2,
2195,
570,
5436,
62,
29993,
284,
352,
357,
11651,
8,
611,
334,
655,
765,
284,
4197,
30104,
1088,
11904,
198,
74,
1326,
504,
796,
13946,
13,
42,
5308,
504,
7,
77,
62,
565,
13654,
28,
1828,
11,
2315,
28,
37659,
13,
18747,
7,
9246,
53,
721,
828,
3509,
62,
2676,
28,
16,
737,
11147,
7,
55,
62,
3351,
3021,
62,
38816,
62,
53,
721,
82,
8,
198,
2,
74,
1326,
504,
796,
13946,
13,
42,
5308,
504,
7,
77,
62,
565,
13654,
28,
1828,
11,
2315,
28,
37659,
13,
18747,
7,
9246,
53,
721,
828,
3509,
62,
2676,
28,
12865,
737,
11147,
7,
55,
62,
3351,
3021,
62,
38816,
62,
53,
721,
82,
8,
198,
4798,
7,
2536,
7,
2435,
13,
2435,
3419,
12,
83,
15,
4008,
198,
4798,
7,
74,
1326,
504,
13,
259,
861,
544,
62,
8,
628,
198,
4242,
2235,
2293,
376,
1780,
262,
38279,
22223,
389,
664,
296,
17128,
1058,
4296,
3797,
53,
721,
357,
18743,
1763,
8520,
8,
198,
9246,
53,
721,
796,
479,
1326,
504,
13,
565,
5819,
62,
1087,
364,
62,
198,
198,
2,
1303,
9288,
198,
2,
329,
269,
287,
3797,
53,
721,
25,
198,
2,
220,
220,
220,
220,
3601,
7,
22510,
17,
9246,
58,
74,
1326,
504,
13,
79,
17407,
7,
66,
38381,
15,
11907,
8,
198,
198,
4242,
2,
3613,
1266,
329,
2003,
779,
198,
21928,
62,
26801,
7,
74,
1326,
504,
553,
565,
5819,
18712,
4943,
198,
42,
44,
796,
3440,
62,
26801,
7203,
565,
5819,
18712,
4943,
198,
2,
38279,
62,
5460,
8577,
796,
8633,
7,
13344,
7,
19849,
13,
18893,
397,
11,
46646,
13,
23912,
1424,
62,
4008,
198,
2601,
5819,
62,
5460,
8577,
796,
8633,
3419,
198,
1640,
1573,
287,
2746,
13,
18893,
397,
25,
198,
220,
220,
220,
38279,
62,
5460,
8577,
58,
4775,
60,
796,
46646,
13,
79,
17407,
7,
19849,
58,
4775,
12962,
58,
15,
60,
198,
198,
2235,
3771,
785,
48074,
262,
8615,
500,
20594,
198,
198,
36734,
500,
62,
18925,
414,
796,
8633,
3419,
198,
1640,
479,
287,
38279,
62,
5460,
8577,
13,
13083,
33529,
198,
220,
220,
220,
10437,
500,
62,
18925,
414,
58,
74,
60,
796,
352,
532,
21739,
13,
30246,
13,
6966,
500,
7,
19849,
58,
74,
4357,
3797,
53,
721,
58,
2601,
5819,
62,
5460,
8577,
58,
74,
11907,
8,
198,
198,
2,
9122,
198,
4798,
7,
22510,
17,
9246,
58,
2601,
5819,
62,
5460,
8577,
14692,
22560,
8973,
60,
1343,
366,
220,
220,
43825,
2536,
7,
36734,
500,
62,
18925,
414,
14692,
22560,
8973,
4008,
198,
4798,
7,
22510,
17,
9246,
58,
2601,
5819,
62,
5460,
8577,
14692,
6057,
40296,
8973,
60,
1343,
1,
220,
220,
43825,
2536,
7,
36734,
500,
62,
18925,
414,
14692,
6057,
40296,
8973,
4008,
198,
198,
2,
50,
2703,
32329,
198,
21928,
62,
26801,
7,
2601,
5819,
62,
5460,
8577,
553,
2601,
5819,
62,
5460,
8577,
4943,
198,
21928,
62,
26801,
7,
36734,
500,
62,
18925,
414,
553,
36734,
500,
62,
18925,
414,
4943,
198,
21928,
62,
26801,
7,
22510,
17,
9246,
553,
22510,
17,
9246,
4943,
198,
21928,
62,
26801,
7,
9246,
53,
721,
553,
9246,
53,
721,
4943,
198
] | 2.620262 | 1,372 |
from pgpelib.restore import to_torch_module
from typing import List, Optional
import sys
import torch
from torch import nn
import numpy as np
import gym
import pybullet_envs
from time import sleep
from copy import deepcopy
if __name__ == "__main__":
main(*(sys.argv[1:]))
| [
6738,
23241,
30242,
571,
13,
2118,
382,
1330,
284,
62,
13165,
354,
62,
21412,
198,
6738,
19720,
1330,
7343,
11,
32233,
198,
11748,
25064,
198,
11748,
28034,
198,
6738,
28034,
1330,
299,
77,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
11550,
198,
11748,
12972,
15065,
1616,
62,
268,
14259,
198,
6738,
640,
1330,
3993,
198,
6738,
4866,
1330,
2769,
30073,
628,
628,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
1388,
46491,
7,
17597,
13,
853,
85,
58,
16,
47715,
4008,
628
] | 3.122222 | 90 |
import pickle
import numpy as np
# import garage.misc.logger as logger
from dowel import logger
from dowel import tabular
import ast_toolbox.mcts.MDP as MDP
class ASTParams:
"""Structure that stores internal parameters for AST.
Parameters
----------
max_steps : int, optional
The maximum search depth.
"""
class AdaptiveStressTest:
"""The AST wrapper for MCTS using the actions in env.action_space.
Parameters
----------
p : :py:class:`ast_toolbox.mcts.AdaptiveStressTesting.ASTParams`
The AST parameters
env : :py:class:`ast_toolbox.envs.go_explore_ast_env.GoExploreASTEnv`.
The environment.
top_paths : :py:class:`ast_toolbox.mcts.BoundedPriorityQueues`, optional
The bounded priority queue to store top-rewarded trajectories.
"""
def reset_step_count(self):
"""Reset the env step count.
"""
self.step_count = 0
def initialize(self):
"""Initialize training variables.
Returns
----------
env_reset :
The reset result from the env.
"""
self._isterminal = False
self._reward = 0.0
self.action_seq = []
self.trajectory_reward = 0.0
return self.env.reset()
def update(self, action):
"""Update the environment as well as the assosiated parameters.
Parameters
----------
action : :py:class:`ast_toolbox.mcts.AdaptiveStressTesting.ASTAction`
The AST action.
Returns
----------
obs : :py:class:`numpy.ndarry`
The observation from the env step.
reward : float
The reward from the env step.
done : bool
The terminal indicator from the env step.
info : dict
The env info from the env step.
"""
self.step_count += 1
obs, reward, done, info = self.env.step(action.get())
self._isterminal = done
self._reward = reward
self.action_seq.append(action)
self.trajectory_reward += reward
if done:
self.top_paths.enqueue(self.action_seq, self.trajectory_reward, make_copy=True)
self.logging()
return obs, reward, done, info
def logging(self):
"""Logging the training information.
"""
if self.params.log_tabular and self.iter <= self.params.n_itr:
if self.step_count % self.params.log_interval == 0:
self.iter += 1
logger.log(' ')
tabular.record('StepNum', self.step_count)
record_num = 0
if self.params.log_dir is not None:
if self.step_count == self.params.log_interval: # first time logging
best_actions = []
else:
with open(self.params.log_dir + '/best_actions.p', 'rb') as f:
best_actions = pickle.load(f)
best_actions.append(np.array([x.get() for x in self.top_paths.pq[0][0]]))
with open(self.params.log_dir + '/best_actions.p', 'wb') as f:
pickle.dump(best_actions, f)
for (topi, path) in enumerate(self.top_paths):
tabular.record('reward ' + str(topi), path[1])
record_num += 1
for topi_left in range(record_num, self.top_paths.N):
tabular.record('reward ' + str(topi_left), 0)
logger.log(tabular)
logger.dump_all(self.step_count)
tabular.clear()
def isterminal(self):
"""Check whether the current path is finished.
Returns
----------
isterinal : bool
Whether the current path is finished.
"""
return self._isterminal
def get_reward(self):
"""Get the current AST reward.
Returns
----------
reward : bool
The AST reward.
"""
return self._reward
def random_action(self):
"""Randomly sample an action for the rollout.
Returns
----------
action : :py:class:`ast_toolbox.mcts.AdaptiveStressTesting.ASTAction`
The sampled action.
"""
return ASTAction(self.env.action_space.sample())
def explore_action(self, s, tree):
"""Randomly sample an action for the exploration.
Parameters
----------
s : :py:class:`ast_toolbox.mcts.AdaptiveStressTesting.ASTState`
The current state.
tree : dict
The searching tree.
Returns
----------
action : :py:class:`ast_toolbox.mcts.AdaptiveStressTesting.ASTAction`
The sampled action.
"""
return ASTAction(self.env.action_space.sample())
def transition_model(self):
"""Generate the transition model used in MCTS.
Returns
----------
transition_model : :py:class:`ast_toolbox.mcts.MDP.TransitionModel`
The transition model.
"""
return MDP.TransitionModel(get_initial_state, get_next_state, isterminal, self.params.max_steps, go_to_state)
class ASTState:
"""The AST state.
Parameters
----------
t_index : int
The index of the timestep.
parent : :py:class:`ast_toolbox.mcts.AdaptiveStressTesting.ASTState`
The parent state.
action : :py:class:`ast_toolbox.mcts.AdaptiveStressTesting.ASTAction`
The action leading to this state.
"""
def __hash__(self):
"""The redefined hashing method.
Returns
----------
hash : int
The hashing result.
"""
if self.parent is None:
return hash((self.t_index, None, hash(self.action)))
else:
return hash((self.t_index, self.parent.hash, hash(self.action)))
def __eq__(self, other):
"""The redefined equal method.
Returns
----------
is_equal : bool
Whether the two states are equal.
"""
return hash(self) == hash(other)
def get_action_sequence(s):
"""Get the action sequence that leads to the state.
Parameters
----------
s : :py:class:`ast_toolbox.mcts.AdaptiveStressTesting.ASTState`
The target state.
Returns
----------
actions : list[:py:class:`ast_toolbox.mcts.AdaptiveStressTesting.ASTAction`]
The action sequences leading to the target state.
"""
actions = []
while s.parent is not None:
actions.append(s.action)
s = s.parent
actions = list(reversed(actions))
return actions
| [
11748,
2298,
293,
198,
198,
11748,
299,
32152,
355,
45941,
198,
2,
1330,
15591,
13,
44374,
13,
6404,
1362,
355,
49706,
198,
6738,
47276,
417,
1330,
49706,
198,
6738,
47276,
417,
1330,
7400,
934,
198,
198,
11748,
6468,
62,
25981,
3524,
13,
76,
310,
82,
13,
44,
6322,
355,
337,
6322,
628,
198,
4871,
29273,
10044,
4105,
25,
198,
220,
220,
220,
37227,
1273,
5620,
326,
7000,
5387,
10007,
329,
29273,
13,
628,
220,
220,
220,
40117,
198,
220,
220,
220,
24200,
438,
198,
220,
220,
220,
3509,
62,
20214,
1058,
493,
11,
11902,
198,
220,
220,
220,
220,
220,
220,
220,
383,
5415,
2989,
6795,
13,
628,
220,
220,
220,
37227,
628,
198,
4871,
30019,
425,
1273,
601,
14402,
25,
198,
220,
220,
220,
37227,
464,
29273,
29908,
329,
337,
4177,
50,
1262,
262,
4028,
287,
17365,
13,
2673,
62,
13200,
13,
628,
220,
220,
220,
40117,
198,
220,
220,
220,
24200,
438,
198,
220,
220,
220,
279,
1058,
1058,
9078,
25,
4871,
25,
63,
459,
62,
25981,
3524,
13,
76,
310,
82,
13,
48003,
425,
1273,
601,
44154,
13,
1921,
7250,
283,
4105,
63,
198,
220,
220,
220,
220,
220,
220,
220,
383,
29273,
10007,
198,
220,
220,
220,
17365,
1058,
1058,
9078,
25,
4871,
25,
63,
459,
62,
25981,
3524,
13,
268,
14259,
13,
2188,
62,
20676,
382,
62,
459,
62,
24330,
13,
5247,
35433,
11262,
4834,
85,
44646,
198,
220,
220,
220,
220,
220,
220,
220,
383,
2858,
13,
198,
220,
220,
220,
1353,
62,
6978,
82,
1058,
1058,
9078,
25,
4871,
25,
63,
459,
62,
25981,
3524,
13,
76,
310,
82,
13,
33,
6302,
22442,
414,
15681,
947,
47671,
11902,
198,
220,
220,
220,
220,
220,
220,
220,
383,
49948,
8475,
16834,
284,
3650,
1353,
12,
260,
904,
276,
20134,
1749,
13,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
825,
13259,
62,
9662,
62,
9127,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
4965,
316,
262,
17365,
2239,
954,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
9662,
62,
9127,
796,
657,
628,
220,
220,
220,
825,
41216,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
24243,
1096,
3047,
9633,
13,
628,
220,
220,
220,
220,
220,
220,
220,
16409,
198,
220,
220,
220,
220,
220,
220,
220,
24200,
438,
198,
220,
220,
220,
220,
220,
220,
220,
17365,
62,
42503,
1058,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
383,
13259,
1255,
422,
262,
17365,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13557,
1694,
1084,
282,
796,
10352,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13557,
260,
904,
796,
657,
13,
15,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
2673,
62,
41068,
796,
17635,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
9535,
752,
652,
62,
260,
904,
796,
657,
13,
15,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
2116,
13,
24330,
13,
42503,
3419,
628,
220,
220,
220,
825,
4296,
7,
944,
11,
2223,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
10260,
262,
2858,
355,
880,
355,
262,
840,
418,
12931,
10007,
13,
628,
220,
220,
220,
220,
220,
220,
220,
40117,
198,
220,
220,
220,
220,
220,
220,
220,
24200,
438,
198,
220,
220,
220,
220,
220,
220,
220,
2223,
1058,
1058,
9078,
25,
4871,
25,
63,
459,
62,
25981,
3524,
13,
76,
310,
82,
13,
48003,
425,
1273,
601,
44154,
13,
1921,
5603,
596,
63,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
383,
29273,
2223,
13,
628,
220,
220,
220,
220,
220,
220,
220,
16409,
198,
220,
220,
220,
220,
220,
220,
220,
24200,
438,
198,
220,
220,
220,
220,
220,
220,
220,
10201,
1058,
1058,
9078,
25,
4871,
25,
63,
77,
32152,
13,
358,
6532,
63,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
383,
13432,
422,
262,
17365,
2239,
13,
198,
220,
220,
220,
220,
220,
220,
220,
6721,
1058,
12178,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
383,
6721,
422,
262,
17365,
2239,
13,
198,
220,
220,
220,
220,
220,
220,
220,
1760,
1058,
20512,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
383,
12094,
16916,
422,
262,
17365,
2239,
13,
198,
220,
220,
220,
220,
220,
220,
220,
7508,
1058,
8633,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
383,
17365,
7508,
422,
262,
17365,
2239,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
9662,
62,
9127,
15853,
352,
198,
220,
220,
220,
220,
220,
220,
220,
10201,
11,
6721,
11,
1760,
11,
7508,
796,
2116,
13,
24330,
13,
9662,
7,
2673,
13,
1136,
28955,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13557,
1694,
1084,
282,
796,
1760,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13557,
260,
904,
796,
6721,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
2673,
62,
41068,
13,
33295,
7,
2673,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
9535,
752,
652,
62,
260,
904,
15853,
6721,
198,
220,
220,
220,
220,
220,
220,
220,
611,
1760,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
4852,
62,
6978,
82,
13,
268,
36560,
7,
944,
13,
2673,
62,
41068,
11,
2116,
13,
9535,
752,
652,
62,
260,
904,
11,
787,
62,
30073,
28,
17821,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
6404,
2667,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
10201,
11,
6721,
11,
1760,
11,
7508,
628,
220,
220,
220,
825,
18931,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
11187,
2667,
262,
3047,
1321,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
611,
2116,
13,
37266,
13,
6404,
62,
8658,
934,
290,
2116,
13,
2676,
19841,
2116,
13,
37266,
13,
77,
62,
270,
81,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
2116,
13,
9662,
62,
9127,
4064,
2116,
13,
37266,
13,
6404,
62,
3849,
2100,
6624,
657,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
2676,
15853,
352,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
49706,
13,
6404,
10786,
705,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7400,
934,
13,
22105,
10786,
8600,
33111,
3256,
2116,
13,
9662,
62,
9127,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1700,
62,
22510,
796,
657,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
2116,
13,
37266,
13,
6404,
62,
15908,
318,
407,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
2116,
13,
9662,
62,
9127,
6624,
2116,
13,
37266,
13,
6404,
62,
3849,
2100,
25,
220,
1303,
717,
640,
18931,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1266,
62,
4658,
796,
17635,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
351,
1280,
7,
944,
13,
37266,
13,
6404,
62,
15908,
1343,
31051,
13466,
62,
4658,
13,
79,
3256,
705,
26145,
11537,
355,
277,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1266,
62,
4658,
796,
2298,
293,
13,
2220,
7,
69,
8,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1266,
62,
4658,
13,
33295,
7,
37659,
13,
18747,
26933,
87,
13,
1136,
3419,
329,
2124,
287,
2116,
13,
4852,
62,
6978,
82,
13,
79,
80,
58,
15,
7131,
15,
11907,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
351,
1280,
7,
944,
13,
37266,
13,
6404,
62,
15908,
1343,
31051,
13466,
62,
4658,
13,
79,
3256,
705,
39346,
11537,
355,
277,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2298,
293,
13,
39455,
7,
13466,
62,
4658,
11,
277,
8,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
357,
4852,
72,
11,
3108,
8,
287,
27056,
378,
7,
944,
13,
4852,
62,
6978,
82,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7400,
934,
13,
22105,
10786,
260,
904,
705,
1343,
965,
7,
4852,
72,
828,
3108,
58,
16,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1700,
62,
22510,
15853,
352,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
1353,
72,
62,
9464,
287,
2837,
7,
22105,
62,
22510,
11,
2116,
13,
4852,
62,
6978,
82,
13,
45,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7400,
934,
13,
22105,
10786,
260,
904,
705,
1343,
965,
7,
4852,
72,
62,
9464,
828,
657,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
49706,
13,
6404,
7,
8658,
934,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
49706,
13,
39455,
62,
439,
7,
944,
13,
9662,
62,
9127,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7400,
934,
13,
20063,
3419,
628,
220,
220,
220,
825,
318,
23705,
282,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
9787,
1771,
262,
1459,
3108,
318,
5201,
13,
628,
220,
220,
220,
220,
220,
220,
220,
16409,
198,
220,
220,
220,
220,
220,
220,
220,
24200,
438,
198,
220,
220,
220,
220,
220,
220,
220,
318,
353,
1292,
1058,
20512,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
10127,
262,
1459,
3108,
318,
5201,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
2116,
13557,
1694,
1084,
282,
628,
220,
220,
220,
825,
651,
62,
260,
904,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
3855,
262,
1459,
29273,
6721,
13,
628,
220,
220,
220,
220,
220,
220,
220,
16409,
198,
220,
220,
220,
220,
220,
220,
220,
24200,
438,
198,
220,
220,
220,
220,
220,
220,
220,
6721,
1058,
20512,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
383,
29273,
6721,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
2116,
13557,
260,
904,
628,
220,
220,
220,
825,
4738,
62,
2673,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
29531,
306,
6291,
281,
2223,
329,
262,
38180,
13,
628,
220,
220,
220,
220,
220,
220,
220,
16409,
198,
220,
220,
220,
220,
220,
220,
220,
24200,
438,
198,
220,
220,
220,
220,
220,
220,
220,
2223,
1058,
1058,
9078,
25,
4871,
25,
63,
459,
62,
25981,
3524,
13,
76,
310,
82,
13,
48003,
425,
1273,
601,
44154,
13,
1921,
5603,
596,
63,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
383,
35846,
2223,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
29273,
12502,
7,
944,
13,
24330,
13,
2673,
62,
13200,
13,
39873,
28955,
628,
220,
220,
220,
825,
7301,
62,
2673,
7,
944,
11,
264,
11,
5509,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
29531,
306,
6291,
281,
2223,
329,
262,
13936,
13,
628,
220,
220,
220,
220,
220,
220,
220,
40117,
198,
220,
220,
220,
220,
220,
220,
220,
24200,
438,
198,
220,
220,
220,
220,
220,
220,
220,
264,
1058,
1058,
9078,
25,
4871,
25,
63,
459,
62,
25981,
3524,
13,
76,
310,
82,
13,
48003,
425,
1273,
601,
44154,
13,
11262,
9012,
63,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
383,
1459,
1181,
13,
198,
220,
220,
220,
220,
220,
220,
220,
5509,
1058,
8633,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
383,
10342,
5509,
13,
628,
220,
220,
220,
220,
220,
220,
220,
16409,
198,
220,
220,
220,
220,
220,
220,
220,
24200,
438,
198,
220,
220,
220,
220,
220,
220,
220,
2223,
1058,
1058,
9078,
25,
4871,
25,
63,
459,
62,
25981,
3524,
13,
76,
310,
82,
13,
48003,
425,
1273,
601,
44154,
13,
1921,
5603,
596,
63,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
383,
35846,
2223,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
29273,
12502,
7,
944,
13,
24330,
13,
2673,
62,
13200,
13,
39873,
28955,
628,
220,
220,
220,
825,
6801,
62,
19849,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
8645,
378,
262,
6801,
2746,
973,
287,
337,
4177,
50,
13,
628,
220,
220,
220,
220,
220,
220,
220,
16409,
198,
220,
220,
220,
220,
220,
220,
220,
24200,
438,
198,
220,
220,
220,
220,
220,
220,
220,
6801,
62,
19849,
1058,
1058,
9078,
25,
4871,
25,
63,
459,
62,
25981,
3524,
13,
76,
310,
82,
13,
44,
6322,
13,
8291,
653,
17633,
63,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
383,
6801,
2746,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
337,
6322,
13,
8291,
653,
17633,
7,
1136,
62,
36733,
62,
5219,
11,
651,
62,
19545,
62,
5219,
11,
318,
23705,
282,
11,
2116,
13,
37266,
13,
9806,
62,
20214,
11,
467,
62,
1462,
62,
5219,
8,
628,
198,
4871,
29273,
9012,
25,
198,
220,
220,
220,
37227,
464,
29273,
1181,
13,
628,
220,
220,
220,
40117,
198,
220,
220,
220,
24200,
438,
198,
220,
220,
220,
256,
62,
9630,
1058,
493,
198,
220,
220,
220,
220,
220,
220,
220,
383,
6376,
286,
262,
4628,
395,
538,
13,
198,
220,
220,
220,
2560,
1058,
1058,
9078,
25,
4871,
25,
63,
459,
62,
25981,
3524,
13,
76,
310,
82,
13,
48003,
425,
1273,
601,
44154,
13,
11262,
9012,
63,
198,
220,
220,
220,
220,
220,
220,
220,
383,
2560,
1181,
13,
198,
220,
220,
220,
2223,
1058,
1058,
9078,
25,
4871,
25,
63,
459,
62,
25981,
3524,
13,
76,
310,
82,
13,
48003,
425,
1273,
601,
44154,
13,
1921,
5603,
596,
63,
198,
220,
220,
220,
220,
220,
220,
220,
383,
2223,
3756,
284,
428,
1181,
13,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
825,
11593,
17831,
834,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
464,
2266,
18156,
49544,
2446,
13,
628,
220,
220,
220,
220,
220,
220,
220,
16409,
198,
220,
220,
220,
220,
220,
220,
220,
24200,
438,
198,
220,
220,
220,
220,
220,
220,
220,
12234,
1058,
493,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
383,
49544,
1255,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
611,
2116,
13,
8000,
318,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
12234,
19510,
944,
13,
83,
62,
9630,
11,
6045,
11,
12234,
7,
944,
13,
2673,
22305,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
12234,
19510,
944,
13,
83,
62,
9630,
11,
2116,
13,
8000,
13,
17831,
11,
12234,
7,
944,
13,
2673,
22305,
628,
220,
220,
220,
825,
11593,
27363,
834,
7,
944,
11,
584,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
464,
2266,
18156,
4961,
2446,
13,
628,
220,
220,
220,
220,
220,
220,
220,
16409,
198,
220,
220,
220,
220,
220,
220,
220,
24200,
438,
198,
220,
220,
220,
220,
220,
220,
220,
318,
62,
40496,
1058,
20512,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
10127,
262,
734,
2585,
389,
4961,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
12234,
7,
944,
8,
6624,
12234,
7,
847,
8,
628,
198,
198,
4299,
651,
62,
2673,
62,
43167,
7,
82,
2599,
198,
220,
220,
220,
37227,
3855,
262,
2223,
8379,
326,
5983,
284,
262,
1181,
13,
628,
220,
220,
220,
40117,
198,
220,
220,
220,
24200,
438,
198,
220,
220,
220,
264,
1058,
1058,
9078,
25,
4871,
25,
63,
459,
62,
25981,
3524,
13,
76,
310,
82,
13,
48003,
425,
1273,
601,
44154,
13,
11262,
9012,
63,
198,
220,
220,
220,
220,
220,
220,
220,
383,
2496,
1181,
13,
628,
220,
220,
220,
16409,
198,
220,
220,
220,
24200,
438,
198,
220,
220,
220,
4028,
1058,
1351,
58,
25,
9078,
25,
4871,
25,
63,
459,
62,
25981,
3524,
13,
76,
310,
82,
13,
48003,
425,
1273,
601,
44154,
13,
1921,
5603,
596,
63,
60,
198,
220,
220,
220,
220,
220,
220,
220,
383,
2223,
16311,
3756,
284,
262,
2496,
1181,
13,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
4028,
796,
17635,
198,
220,
220,
220,
981,
264,
13,
8000,
318,
407,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
4028,
13,
33295,
7,
82,
13,
2673,
8,
198,
220,
220,
220,
220,
220,
220,
220,
264,
796,
264,
13,
8000,
198,
220,
220,
220,
4028,
796,
1351,
7,
260,
690,
276,
7,
4658,
4008,
198,
220,
220,
220,
1441,
4028,
198
] | 2.174012 | 3,086 |
# pylama:ignore=E722,E303
import json
import sys
import re
from functools import update_wrapper
from datetime import datetime
import urllib.error
import urllib.parse
import urllib.request
import time
import m3u8
| [
2,
279,
2645,
1689,
25,
46430,
28,
36,
22,
1828,
11,
36,
22572,
198,
11748,
33918,
198,
11748,
25064,
198,
11748,
302,
198,
6738,
1257,
310,
10141,
1330,
4296,
62,
48553,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
11748,
2956,
297,
571,
13,
18224,
198,
11748,
2956,
297,
571,
13,
29572,
198,
11748,
2956,
297,
571,
13,
25927,
198,
11748,
640,
198,
198,
11748,
285,
18,
84,
23,
628,
628,
198
] | 3.013889 | 72 |
import os
import matplotlib as mpl
import matplotlib.pyplot as plt
from .simulator import Simulator
| [
11748,
28686,
198,
198,
11748,
2603,
29487,
8019,
355,
285,
489,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
198,
6738,
764,
14323,
8927,
1330,
13942,
628,
198
] | 3.25 | 32 |
# Copyright 2020 Google LLC
#
# 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.
"""Tests for fairness indicators metrics."""
from __future__ import absolute_import
from __future__ import division
# Standard __future__ imports
from __future__ import print_function
import math
from absl.testing import parameterized
import apache_beam as beam
from apache_beam.testing import util
import numpy as np
import tensorflow as tf
from tensorflow_model_analysis.addons.fairness.metrics import fairness_indicators
from tensorflow_model_analysis.eval_saved_model import testutil
from tensorflow_model_analysis.metrics import metric_types
from tensorflow_model_analysis.metrics import metric_util
# Todo(b/147497357): Add counter test once we have counter setup.
if __name__ == '__main__':
tf.test.main()
| [
2,
15069,
12131,
3012,
11419,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198,
2,
921,
743,
7330,
257,
4866,
286,
262,
13789,
379,
198,
2,
198,
2,
220,
220,
220,
220,
3740,
1378,
2503,
13,
43073,
13,
2398,
14,
677,
4541,
14,
43,
2149,
24290,
12,
17,
13,
15,
198,
2,
198,
2,
17486,
2672,
416,
9723,
1099,
393,
4987,
284,
287,
3597,
11,
3788,
198,
2,
9387,
739,
262,
13789,
318,
9387,
319,
281,
366,
1921,
3180,
1,
29809,
1797,
11,
198,
2,
42881,
34764,
11015,
6375,
7102,
49828,
11053,
3963,
15529,
509,
12115,
11,
2035,
4911,
393,
17142,
13,
198,
2,
4091,
262,
13789,
329,
262,
2176,
3303,
15030,
21627,
290,
198,
2,
11247,
739,
262,
13789,
13,
198,
37811,
51,
3558,
329,
22692,
21337,
20731,
526,
15931,
198,
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
6738,
11593,
37443,
834,
1330,
7297,
198,
2,
8997,
11593,
37443,
834,
17944,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
198,
11748,
10688,
198,
6738,
2352,
75,
13,
33407,
1330,
11507,
1143,
198,
11748,
2471,
4891,
62,
40045,
355,
15584,
198,
6738,
2471,
4891,
62,
40045,
13,
33407,
1330,
7736,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
6738,
11192,
273,
11125,
62,
19849,
62,
20930,
13,
39996,
13,
22043,
1108,
13,
4164,
10466,
1330,
22692,
62,
521,
44549,
198,
6738,
11192,
273,
11125,
62,
19849,
62,
20930,
13,
18206,
62,
82,
9586,
62,
19849,
1330,
1332,
22602,
198,
6738,
11192,
273,
11125,
62,
19849,
62,
20930,
13,
4164,
10466,
1330,
18663,
62,
19199,
198,
6738,
11192,
273,
11125,
62,
19849,
62,
20930,
13,
4164,
10466,
1330,
18663,
62,
22602,
628,
198,
198,
2,
309,
24313,
7,
65,
14,
20198,
38073,
27277,
2599,
3060,
3753,
1332,
1752,
356,
423,
3753,
9058,
13,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
48700,
13,
9288,
13,
12417,
3419,
198
] | 3.702857 | 350 |
#!/usr/bin/python
"""
ZetCode wxPython tutorial
In this example we work with wx.KeyEvent.
author: Jan Bodnar
website: www.zetcode.com
last modified: April 2018
"""
import wx
if __name__ == '__main__':
main()
| [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
198,
37811,
198,
57,
316,
10669,
266,
87,
37906,
11808,
198,
198,
818,
428,
1672,
356,
670,
351,
266,
87,
13,
9218,
9237,
13,
198,
198,
9800,
25,
2365,
26285,
23955,
198,
732,
12485,
25,
7324,
13,
89,
316,
8189,
13,
785,
198,
12957,
9518,
25,
3035,
2864,
198,
37811,
198,
198,
11748,
266,
87,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
1388,
3419,
198
] | 2.638554 | 83 |
#! /usr/bin/env python
# www7.py -- display the contents of a URL in a Text widget
# - set window title
# - make window resizable
# - update display while reading
import sys
import urllib
from Tkinter import *
main()
| [
2,
0,
1220,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
2,
7324,
22,
13,
9078,
1377,
3359,
262,
10154,
286,
257,
10289,
287,
257,
8255,
26295,
198,
2,
532,
900,
4324,
3670,
198,
2,
532,
787,
4324,
581,
13821,
198,
2,
532,
4296,
3359,
981,
3555,
198,
198,
11748,
25064,
198,
11748,
2956,
297,
571,
198,
6738,
309,
74,
3849,
1330,
1635,
198,
198,
12417,
3419,
198
] | 3.235294 | 68 |
#!/usr/bin/env python
# coding: utf-8
# Copyright © 2015 Wieland Hoffmann
# License: MIT, see LICENSE for details
from flask.ext.sqlalchemy import SQLAlchemy
from sqlalchemy.dialects.postgresql import JSONB, UUID
db = SQLAlchemy()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
19617,
25,
3384,
69,
12,
23,
198,
2,
15069,
10673,
1853,
370,
8207,
392,
21890,
9038,
198,
2,
13789,
25,
17168,
11,
766,
38559,
24290,
329,
3307,
198,
6738,
42903,
13,
2302,
13,
25410,
282,
26599,
1330,
16363,
2348,
26599,
198,
6738,
44161,
282,
26599,
13,
38969,
478,
82,
13,
7353,
34239,
13976,
1330,
19449,
33,
11,
471,
27586,
198,
198,
9945,
796,
16363,
2348,
26599,
3419,
628
] | 2.987179 | 78 |
import torch
import torch.nn as nn
import numpy as np
import cv2
import matplotlib.pyplot as plt
a=torch.randn(6,6,3)
a_s = a.numpy()
im=cv2.imread('./assets/dog.jpg')
plt.imshow(im)
plt.show() | [
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
269,
85,
17,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
198,
64,
28,
13165,
354,
13,
25192,
77,
7,
21,
11,
21,
11,
18,
8,
198,
64,
62,
82,
796,
257,
13,
77,
32152,
3419,
198,
198,
320,
28,
33967,
17,
13,
320,
961,
7,
4458,
14,
19668,
14,
9703,
13,
9479,
11537,
198,
489,
83,
13,
320,
12860,
7,
320,
8,
198,
489,
83,
13,
12860,
3419
] | 2.142857 | 91 |
# -*- coding: utf-8 -*-
from jetfactory.schema import fields, Schema
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
6738,
12644,
69,
9548,
13,
15952,
2611,
1330,
7032,
11,
10011,
2611,
628,
628
] | 2.517241 | 29 |
import sympy
| [
11748,
10558,
88,
628,
628
] | 3.2 | 5 |
# Generated by Django 3.2.2 on 2021-05-15 19:29
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
| [
2,
2980,
515,
416,
37770,
513,
13,
17,
13,
17,
319,
33448,
12,
2713,
12,
1314,
678,
25,
1959,
198,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
198,
11748,
42625,
14208,
13,
9945,
13,
27530,
13,
2934,
1616,
295,
628
] | 3.019231 | 52 |
import os.path
from urllib.parse import urlparse
class Link:
"""Represents a Link on a page, links are equivalent in the following circumstances:
* They have the same domain
* They have the same path (after being resolved to an absolute path)
* They may have diffenent schemes (so https and http of the same link are considered equivalent)
* They may not have a different port (so www.example.com and www.example.com:123 are considered different
Attributes:
url (string): The complete url, either as the normalised original href (if the path was absolute) or as
derived from combining the href of the link with the page being crawled (if the href is relative)
# Design note: This class is pretty complex, but knowing any old nonsense can be in the href of the links
on webpages, and my desire to ensure I can _know_ that different looking hrefs lead to the same
ultimate page (and to be able to easily compare two different links, no matter what they look
like, and no matter where we are in the website heirachy) leads to this complexity. If this
class can be comprehensive and correct then it makes the rest of this task _much_ easier and
makes it trivial to avoid graphing loops when traversing a heirarch of pages.
"""
url = None
def __init__(self, crawled_page, href):
"""Initialise
Args:
crawled_page: The domain that is being crawled, used to construct links from relative urls
href: The href of the link to parse
Raises:
InvalidPathError: If the href tries to escape the root of the domain
UnknownSchemeError: If the href is an unknown url scheme (only http, and https are known)
"""
self._raw_crawled_page = crawled_page
self._raw_href = href
self.crawled_scheme, self.crawled_netloc, self.crawled_path, _, _, _ = urlparse(crawled_page)
self.scheme, self.netloc, self.path, _, _, _ = urlparse(href)
self._raw_scheme = self.scheme
if self.scheme == "":
self.scheme = self.crawled_scheme
self._raw_netloc = self.netloc
if self.netloc == "":
self.netloc = self.crawled_netloc
# Parse the domains and ports
self.crawled_domain, self.crawled_port = self._parse_netloc(self.crawled_netloc, self.crawled_scheme)
self.domain, self.port = self._parse_netloc(self.netloc, self.scheme)
# Parse the subpaths
self.crawled_subdir = self._parse_subdir(self.crawled_path)
self.subdir = self._parse_subdir(self.path)
# Construct our final absolute path
if self._is_relative_path():
self.absolute_path = self._join_paths(self.crawled_subdir, self.path)
else:
self.absolute_path = self.path
# Test for paths that are escaping from the root of the domain
self.normalised_netloc_and_path = self._join_netloc_and_path()
self.url = self._construct_url()
def in_crawled_domain(self):
"""Check if the link is within the originally crawled domain
Returns:
bool: True if the Link is within the crawled domain
"""
return self.domain == self.crawled_domain
def _join_paths(self, subdir, path):
"""Joins a subdir with a path to produce a clean, absolute path
"""
abspath = self._path_to_abspath(path)
if subdir == "":
return abspath
else:
return "{subdir}{abspath}".format(
subdir=subdir,
abspath=abspath,
)
def _construct_url(self):
"""Return a parsed and cleaned url
Returns:
string: The parsed and cleaned url with only scheme, domain, port, and path parts
"""
if self.scheme == "":
scheme_separator = ""
else:
scheme_separator = ":"
return "{scheme}{scheme_separator}//{netloc_and_path}".format(
scheme=self.scheme,
scheme_separator=scheme_separator,
netloc_and_path=self.normalised_netloc_and_path
)
def _join_netloc_and_path(self):
"""Join the netlocation and the path together and normalise the path
Returns:
None
Raises:
InvalidPathError: Raised if the path tries to escape the root of the domain (like
www.example.com/../../foo.html)
"""
# If we join the netloc and the absolute path together and then normalise the string,
# if does not start with the netloc we know there was enough upwards directory
# traversal to escape from the root
netloc_and_path = "{netloc}{path}".format(netloc=self.netloc, path=self.absolute_path)
normalised_url = os.path.normpath(netloc_and_path)
if not normalised_url.startswith(self.netloc):
raise InvalidPathError()
return normalised_url
def _is_relative_path(self):
"""Checks if the href is a relative path
Returns:
bool: True if the href was a relative url
"""
href_is_relative = not self._raw_href.startswith("/")
return self._raw_netloc == "" and href_is_relative
def _parse_subdir(self, path):
"""Parses the subdir from the filepath
Args:
path (string): The path from the url
Returns:
string: The subdirectory the path includes
"""
return os.path.dirname(path)
def _parse_netloc(self, netloc, scheme):
"""Parse a netloc to a domain and port
Args:
netloc (string): The netloc of the url
scheme (string): The original scheme of the url
Returns:
tuple(domain: str, port: int): The domain and port
"""
if ":" in netloc:
return tuple(netloc.split(":"))
else:
return (
netloc,
self._default_port_for_scheme(scheme),
)
def _default_port_for_scheme(self, scheme):
"""Returnt the default port for a particular scheme
"""
scheme_lower_case = scheme.lower()
if scheme_lower_case == "http":
return 80
elif scheme_lower_case == "https":
return 443
else:
raise UnknownSchemeError("Unknown scheme {}".format(scheme))
def __hash__(self):
"""We are implementing this so we can keep a dict of all the visited links
making it trivial, and O(1) operation to know if we have already crawled
"""
return hash(self.normalised_netloc_and_path)
| [
11748,
28686,
13,
6978,
198,
198,
6738,
2956,
297,
571,
13,
29572,
1330,
19016,
29572,
628,
628,
198,
4871,
7502,
25,
198,
220,
220,
220,
37227,
6207,
6629,
257,
7502,
319,
257,
2443,
11,
6117,
389,
7548,
287,
262,
1708,
5917,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1635,
1119,
423,
262,
976,
7386,
198,
220,
220,
220,
220,
220,
220,
220,
1635,
1119,
423,
262,
976,
3108,
357,
8499,
852,
12939,
284,
281,
4112,
3108,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1635,
1119,
743,
423,
814,
268,
298,
16546,
357,
568,
3740,
290,
2638,
286,
262,
976,
2792,
389,
3177,
7548,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1635,
1119,
743,
407,
423,
257,
1180,
2493,
357,
568,
7324,
13,
20688,
13,
785,
290,
7324,
13,
20688,
13,
785,
25,
10163,
389,
3177,
1180,
628,
220,
220,
220,
220,
220,
220,
220,
49213,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
19016,
357,
8841,
2599,
383,
1844,
19016,
11,
2035,
355,
262,
3487,
1417,
2656,
13291,
357,
361,
262,
3108,
373,
4112,
8,
393,
355,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
10944,
422,
19771,
262,
13291,
286,
262,
2792,
351,
262,
2443,
852,
45668,
357,
361,
262,
13291,
318,
3585,
8,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
8495,
3465,
25,
770,
1398,
318,
2495,
3716,
11,
475,
6970,
597,
1468,
18149,
460,
307,
287,
262,
13291,
286,
262,
6117,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
319,
3992,
31126,
11,
290,
616,
6227,
284,
4155,
314,
460,
4808,
16275,
62,
326,
1180,
2045,
13291,
82,
1085,
284,
262,
976,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8713,
2443,
357,
392,
284,
307,
1498,
284,
3538,
8996,
734,
1180,
6117,
11,
645,
2300,
644,
484,
804,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
588,
11,
290,
645,
2300,
810,
356,
389,
287,
262,
3052,
28625,
35586,
8,
5983,
284,
428,
13357,
13,
1002,
428,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1398,
460,
307,
9815,
290,
3376,
788,
340,
1838,
262,
1334,
286,
428,
4876,
4808,
29482,
62,
4577,
290,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1838,
340,
20861,
284,
3368,
23360,
722,
23607,
618,
33038,
278,
257,
28625,
998,
286,
5468,
13,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
19016,
796,
6045,
628,
220,
220,
220,
825,
11593,
15003,
834,
7,
944,
11,
45668,
62,
7700,
11,
13291,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
24243,
786,
628,
220,
220,
220,
220,
220,
220,
220,
943,
14542,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
45668,
62,
7700,
25,
383,
7386,
326,
318,
852,
45668,
11,
973,
284,
5678,
6117,
422,
3585,
2956,
7278,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13291,
25,
383,
13291,
286,
262,
2792,
284,
21136,
628,
220,
220,
220,
220,
220,
220,
220,
7567,
2696,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
17665,
15235,
12331,
25,
1002,
262,
13291,
8404,
284,
6654,
262,
6808,
286,
262,
7386,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
16185,
27054,
1326,
12331,
25,
1002,
262,
13291,
318,
281,
6439,
19016,
7791,
357,
8807,
2638,
11,
290,
3740,
389,
1900,
8,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13557,
1831,
62,
66,
49263,
62,
7700,
796,
45668,
62,
7700,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13557,
1831,
62,
33257,
796,
13291,
628,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
66,
49263,
62,
15952,
1326,
11,
2116,
13,
66,
49263,
62,
3262,
17946,
11,
2116,
13,
66,
49263,
62,
6978,
11,
4808,
11,
4808,
11,
4808,
796,
19016,
29572,
7,
66,
49263,
62,
7700,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
15952,
1326,
11,
2116,
13,
3262,
17946,
11,
2116,
13,
6978,
11,
4808,
11,
4808,
11,
4808,
796,
19016,
29572,
7,
33257,
8,
628,
220,
220,
220,
220,
220,
220,
220,
2116,
13557,
1831,
62,
15952,
1326,
796,
2116,
13,
15952,
1326,
198,
220,
220,
220,
220,
220,
220,
220,
611,
2116,
13,
15952,
1326,
6624,
366,
1298,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
15952,
1326,
796,
2116,
13,
66,
49263,
62,
15952,
1326,
628,
220,
220,
220,
220,
220,
220,
220,
2116,
13557,
1831,
62,
3262,
17946,
796,
2116,
13,
3262,
17946,
198,
220,
220,
220,
220,
220,
220,
220,
611,
2116,
13,
3262,
17946,
6624,
366,
1298,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
3262,
17946,
796,
2116,
13,
66,
49263,
62,
3262,
17946,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
2547,
325,
262,
18209,
290,
14090,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
66,
49263,
62,
27830,
11,
2116,
13,
66,
49263,
62,
634,
796,
2116,
13557,
29572,
62,
3262,
17946,
7,
944,
13,
66,
49263,
62,
3262,
17946,
11,
2116,
13,
66,
49263,
62,
15952,
1326,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
27830,
11,
2116,
13,
634,
796,
2116,
13557,
29572,
62,
3262,
17946,
7,
944,
13,
3262,
17946,
11,
2116,
13,
15952,
1326,
8,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
2547,
325,
262,
850,
6978,
82,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
66,
49263,
62,
7266,
15908,
796,
2116,
13557,
29572,
62,
7266,
15908,
7,
944,
13,
66,
49263,
62,
6978,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
7266,
15908,
796,
2116,
13557,
29572,
62,
7266,
15908,
7,
944,
13,
6978,
8,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
28407,
674,
2457,
4112,
3108,
198,
220,
220,
220,
220,
220,
220,
220,
611,
2116,
13557,
271,
62,
43762,
62,
6978,
33529,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
48546,
62,
6978,
796,
2116,
13557,
22179,
62,
6978,
82,
7,
944,
13,
66,
49263,
62,
7266,
15908,
11,
2116,
13,
6978,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
48546,
62,
6978,
796,
2116,
13,
6978,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
6208,
329,
13532,
326,
389,
25071,
422,
262,
6808,
286,
262,
7386,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
11265,
1417,
62,
3262,
17946,
62,
392,
62,
6978,
796,
2116,
13557,
22179,
62,
3262,
17946,
62,
392,
62,
6978,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
6371,
796,
2116,
13557,
41571,
62,
6371,
3419,
628,
220,
220,
220,
825,
287,
62,
66,
49263,
62,
27830,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
9787,
611,
262,
2792,
318,
1626,
262,
6198,
45668,
7386,
628,
220,
220,
220,
220,
220,
220,
220,
16409,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
20512,
25,
6407,
611,
262,
7502,
318,
1626,
262,
45668,
7386,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
2116,
13,
27830,
6624,
2116,
13,
66,
49263,
62,
27830,
628,
220,
220,
220,
825,
4808,
22179,
62,
6978,
82,
7,
944,
11,
850,
15908,
11,
3108,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
9908,
1040,
257,
850,
15908,
351,
257,
3108,
284,
4439,
257,
3424,
11,
4112,
3108,
628,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
2352,
6978,
796,
2116,
13557,
6978,
62,
1462,
62,
397,
2777,
776,
7,
6978,
8,
198,
220,
220,
220,
220,
220,
220,
220,
611,
850,
15908,
6624,
366,
1298,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
2352,
6978,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
45144,
7266,
15908,
18477,
397,
2777,
776,
92,
1911,
18982,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
850,
15908,
28,
7266,
15908,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2352,
6978,
28,
397,
2777,
776,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1267,
628,
220,
220,
220,
825,
4808,
41571,
62,
6371,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
13615,
257,
44267,
290,
20750,
19016,
628,
220,
220,
220,
220,
220,
220,
220,
16409,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4731,
25,
383,
44267,
290,
20750,
19016,
351,
691,
7791,
11,
7386,
11,
2493,
11,
290,
3108,
3354,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
611,
2116,
13,
15952,
1326,
6624,
366,
1298,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7791,
62,
25512,
1352,
796,
13538,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7791,
62,
25512,
1352,
796,
366,
11097,
628,
220,
220,
220,
220,
220,
220,
220,
1441,
45144,
15952,
1326,
18477,
15952,
1326,
62,
25512,
1352,
92,
1003,
90,
3262,
17946,
62,
392,
62,
6978,
92,
1911,
18982,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7791,
28,
944,
13,
15952,
1326,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7791,
62,
25512,
1352,
28,
15952,
1326,
62,
25512,
1352,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2010,
17946,
62,
392,
62,
6978,
28,
944,
13,
11265,
1417,
62,
3262,
17946,
62,
392,
62,
6978,
198,
220,
220,
220,
220,
220,
220,
220,
1267,
628,
220,
220,
220,
825,
4808,
22179,
62,
3262,
17946,
62,
392,
62,
6978,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
18234,
262,
2010,
24886,
290,
262,
3108,
1978,
290,
3487,
786,
262,
3108,
628,
220,
220,
220,
220,
220,
220,
220,
16409,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6045,
628,
220,
220,
220,
220,
220,
220,
220,
7567,
2696,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
17665,
15235,
12331,
25,
7567,
1417,
611,
262,
3108,
8404,
284,
6654,
262,
6808,
286,
262,
7386,
357,
2339,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7324,
13,
20688,
13,
785,
14,
40720,
40720,
21943,
13,
6494,
8,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
1002,
356,
4654,
262,
2010,
17946,
290,
262,
4112,
3108,
1978,
290,
788,
3487,
786,
262,
4731,
11,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
611,
857,
407,
923,
351,
262,
2010,
17946,
356,
760,
612,
373,
1576,
21032,
8619,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
33038,
282,
284,
6654,
422,
262,
6808,
198,
220,
220,
220,
220,
220,
220,
220,
2010,
17946,
62,
392,
62,
6978,
796,
45144,
3262,
17946,
18477,
6978,
92,
1911,
18982,
7,
3262,
17946,
28,
944,
13,
3262,
17946,
11,
3108,
28,
944,
13,
48546,
62,
6978,
8,
198,
220,
220,
220,
220,
220,
220,
220,
3487,
1417,
62,
6371,
796,
28686,
13,
6978,
13,
27237,
6978,
7,
3262,
17946,
62,
392,
62,
6978,
8,
628,
220,
220,
220,
220,
220,
220,
220,
611,
407,
3487,
1417,
62,
6371,
13,
9688,
2032,
342,
7,
944,
13,
3262,
17946,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5298,
17665,
15235,
12331,
3419,
628,
220,
220,
220,
220,
220,
220,
220,
1441,
3487,
1417,
62,
6371,
628,
220,
220,
220,
825,
4808,
271,
62,
43762,
62,
6978,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
7376,
4657,
611,
262,
13291,
318,
257,
3585,
3108,
628,
220,
220,
220,
220,
220,
220,
220,
16409,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
20512,
25,
6407,
611,
262,
13291,
373,
257,
3585,
19016,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
13291,
62,
271,
62,
43762,
796,
407,
2116,
13557,
1831,
62,
33257,
13,
9688,
2032,
342,
7203,
14,
4943,
628,
220,
220,
220,
220,
220,
220,
220,
1441,
2116,
13557,
1831,
62,
3262,
17946,
6624,
13538,
290,
13291,
62,
271,
62,
43762,
628,
220,
220,
220,
825,
4808,
29572,
62,
7266,
15908,
7,
944,
11,
3108,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
47,
945,
274,
262,
850,
15908,
422,
262,
2393,
6978,
628,
220,
220,
220,
220,
220,
220,
220,
943,
14542,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3108,
357,
8841,
2599,
383,
3108,
422,
262,
19016,
628,
220,
220,
220,
220,
220,
220,
220,
16409,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4731,
25,
383,
850,
34945,
262,
3108,
3407,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
28686,
13,
6978,
13,
15908,
3672,
7,
6978,
8,
628,
220,
220,
220,
825,
4808,
29572,
62,
3262,
17946,
7,
944,
11,
2010,
17946,
11,
7791,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
10044,
325,
257,
2010,
17946,
284,
257,
7386,
290,
2493,
628,
220,
220,
220,
220,
220,
220,
220,
943,
14542,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2010,
17946,
357,
8841,
2599,
383,
2010,
17946,
286,
262,
19016,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7791,
357,
8841,
2599,
383,
2656,
7791,
286,
262,
19016,
628,
220,
220,
220,
220,
220,
220,
220,
16409,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
46545,
7,
27830,
25,
965,
11,
2493,
25,
493,
2599,
383,
7386,
290,
2493,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
611,
366,
11097,
287,
2010,
17946,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
46545,
7,
3262,
17946,
13,
35312,
7,
2404,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2010,
17946,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13557,
12286,
62,
634,
62,
1640,
62,
15952,
1326,
7,
15952,
1326,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1267,
628,
220,
220,
220,
825,
4808,
12286,
62,
634,
62,
1640,
62,
15952,
1326,
7,
944,
11,
7791,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
9781,
333,
429,
262,
4277,
2493,
329,
257,
1948,
7791,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
7791,
62,
21037,
62,
7442,
796,
7791,
13,
21037,
3419,
628,
220,
220,
220,
220,
220,
220,
220,
611,
7791,
62,
21037,
62,
7442,
6624,
366,
4023,
1298,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
4019,
198,
220,
220,
220,
220,
220,
220,
220,
1288,
361,
7791,
62,
21037,
62,
7442,
6624,
366,
5450,
1298,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
40384,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5298,
16185,
27054,
1326,
12331,
7203,
20035,
7791,
23884,
1911,
18982,
7,
15952,
1326,
4008,
628,
220,
220,
220,
825,
11593,
17831,
834,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
1135,
389,
15427,
428,
523,
356,
460,
1394,
257,
8633,
286,
477,
262,
8672,
6117,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1642,
340,
20861,
11,
290,
440,
7,
16,
8,
4905,
284,
760,
611,
356,
423,
1541,
45668,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
12234,
7,
944,
13,
11265,
1417,
62,
3262,
17946,
62,
392,
62,
6978,
8,
198
] | 2.391381 | 2,854 |
import os
from utils import tsv, www
from gig2 import _utils
from gig2._utils import log
| [
11748,
28686,
198,
198,
6738,
3384,
4487,
1330,
256,
21370,
11,
7324,
198,
198,
6738,
12526,
17,
1330,
4808,
26791,
198,
6738,
12526,
17,
13557,
26791,
1330,
2604,
628
] | 3.172414 | 29 |
import onnx
from onnx import optimizer
from onnx import numpy_helper
import numpy as np
import argparse
DATA_TYPES = {
np.float32: 1,
np.float16: 10
}
if __name__ == "__main__":
main()
| [
11748,
319,
77,
87,
198,
6738,
319,
77,
87,
1330,
6436,
7509,
198,
6738,
319,
77,
87,
1330,
299,
32152,
62,
2978,
525,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
1822,
29572,
628,
198,
26947,
62,
9936,
47,
1546,
796,
1391,
198,
220,
220,
220,
45941,
13,
22468,
2624,
25,
352,
11,
220,
198,
220,
220,
220,
45941,
13,
22468,
1433,
25,
838,
198,
92,
628,
628,
628,
628,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
1388,
3419,
198
] | 2.348315 | 89 |
# Generated by Django 3.1.4 on 2022-03-06 18:34
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
| [
2,
2980,
515,
416,
37770,
513,
13,
16,
13,
19,
319,
33160,
12,
3070,
12,
3312,
1248,
25,
2682,
198,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
198,
11748,
42625,
14208,
13,
9945,
13,
27530,
13,
2934,
1616,
295,
628
] | 3.019231 | 52 |
'''
Created on Jun 28, 2017
@author: make ma
'''
from threading import Thread
class ServerProcess(Thread):
'''
classdocs
'''
| [
7061,
6,
198,
41972,
319,
7653,
2579,
11,
2177,
198,
198,
31,
9800,
25,
787,
17266,
198,
7061,
6,
198,
198,
6738,
4704,
278,
1330,
14122,
198,
198,
4871,
9652,
18709,
7,
16818,
2599,
198,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
1398,
31628,
198,
220,
220,
220,
705,
7061,
628,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220
] | 2.257143 | 70 |
import inspect
from collections.abc import Coroutine as CoroutineBase
from functools import partial
from types import CodeType, FunctionType
from typing import Any
| [
11748,
10104,
198,
6738,
17268,
13,
39305,
1330,
2744,
28399,
355,
2744,
28399,
14881,
198,
6738,
1257,
310,
10141,
1330,
13027,
198,
6738,
3858,
1330,
6127,
6030,
11,
15553,
6030,
198,
6738,
19720,
1330,
4377,
628,
628,
628,
198
] | 4.358974 | 39 |
import os, json
META = None
PATH = os.path.dirname(os.path.realpath(__file__))
with open(f'{PATH}/META.json') as fp:
META = json.load(fp)
OUTPUT = []
for index in META:
transmit_range = META[index]["transmit_range"]
amount_nodes = META[index]["amount_nodes"]
routing_protocol = META[index]["routing_protocol"]
buffer_size = META[index]["buffer_size"]
overhead_ratio = None
latency_avg = None
delivery_prob = None
try:
with open(f'{PATH}/the-one/reports/DTN_Simulation_{index}_MessageStatsReport.txt') as fp:
for line in fp:
if 'overhead_ratio' in line:
overhead_ratio = float(line.replace('overhead_ratio: ', ''))
elif 'latency_avg' in line:
latency_avg = float(line.replace('latency_avg: ', ''))
elif 'delivery_prob' in line:
delivery_prob = float(line.replace('delivery_prob: ', ''))
except:
pass
OUTPUT.append({
"routing_protocol": routing_protocol,
"transmit_range": transmit_range,
"buffer_size": buffer_size,
"amount_nodes": amount_nodes,
"overhead_ratio": overhead_ratio,
"latency_avg": latency_avg,
"delivery_prob": delivery_prob,
})
with open(f'{PATH}/DATA.json', 'w') as fp:
json.dump(OUTPUT, fp, indent=2)
| [
11748,
28686,
11,
33918,
198,
198,
44,
20892,
796,
6045,
198,
34219,
796,
28686,
13,
6978,
13,
15908,
3672,
7,
418,
13,
6978,
13,
5305,
6978,
7,
834,
7753,
834,
4008,
198,
198,
4480,
1280,
7,
69,
6,
90,
34219,
92,
14,
44,
20892,
13,
17752,
11537,
355,
277,
79,
25,
198,
220,
220,
220,
337,
20892,
796,
33918,
13,
2220,
7,
46428,
8,
198,
198,
2606,
7250,
3843,
796,
17635,
198,
198,
1640,
6376,
287,
337,
20892,
25,
198,
220,
220,
220,
21937,
62,
9521,
796,
337,
20892,
58,
9630,
7131,
1,
7645,
2781,
62,
9521,
8973,
198,
220,
220,
220,
2033,
62,
77,
4147,
796,
337,
20892,
58,
9630,
7131,
1,
17287,
62,
77,
4147,
8973,
198,
220,
220,
220,
28166,
62,
11235,
4668,
796,
337,
20892,
58,
9630,
7131,
1,
81,
13660,
62,
11235,
4668,
8973,
198,
220,
220,
220,
11876,
62,
7857,
796,
337,
20892,
58,
9630,
7131,
1,
22252,
62,
7857,
8973,
198,
220,
220,
220,
16965,
62,
10366,
952,
796,
6045,
198,
220,
220,
220,
24812,
62,
615,
70,
796,
6045,
198,
220,
220,
220,
7585,
62,
1676,
65,
796,
6045,
198,
220,
220,
220,
1949,
25,
198,
220,
220,
220,
220,
220,
220,
220,
351,
1280,
7,
69,
6,
90,
34219,
92,
14,
1169,
12,
505,
14,
48922,
14,
24544,
45,
62,
8890,
1741,
23330,
9630,
92,
62,
12837,
29668,
19100,
13,
14116,
11537,
355,
277,
79,
25,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
1627,
287,
277,
79,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
705,
2502,
2256,
62,
10366,
952,
6,
287,
1627,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
16965,
62,
10366,
952,
796,
12178,
7,
1370,
13,
33491,
10786,
2502,
2256,
62,
10366,
952,
25,
46083,
10148,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1288,
361,
705,
15460,
1387,
62,
615,
70,
6,
287,
1627,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
24812,
62,
615,
70,
796,
12178,
7,
1370,
13,
33491,
10786,
15460,
1387,
62,
615,
70,
25,
46083,
10148,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1288,
361,
705,
12381,
6315,
62,
1676,
65,
6,
287,
1627,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7585,
62,
1676,
65,
796,
12178,
7,
1370,
13,
33491,
10786,
12381,
6315,
62,
1676,
65,
25,
46083,
10148,
4008,
198,
220,
220,
220,
2845,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1208,
198,
220,
220,
220,
16289,
30076,
13,
33295,
15090,
198,
220,
220,
220,
220,
220,
220,
220,
366,
81,
13660,
62,
11235,
4668,
1298,
28166,
62,
11235,
4668,
11,
198,
220,
220,
220,
220,
220,
220,
220,
366,
7645,
2781,
62,
9521,
1298,
21937,
62,
9521,
11,
198,
220,
220,
220,
220,
220,
220,
220,
366,
22252,
62,
7857,
1298,
11876,
62,
7857,
11,
198,
220,
220,
220,
220,
220,
220,
220,
366,
17287,
62,
77,
4147,
1298,
2033,
62,
77,
4147,
11,
198,
220,
220,
220,
220,
220,
220,
220,
366,
2502,
2256,
62,
10366,
952,
1298,
16965,
62,
10366,
952,
11,
198,
220,
220,
220,
220,
220,
220,
220,
366,
15460,
1387,
62,
615,
70,
1298,
24812,
62,
615,
70,
11,
198,
220,
220,
220,
220,
220,
220,
220,
366,
12381,
6315,
62,
1676,
65,
1298,
7585,
62,
1676,
65,
11,
198,
220,
220,
220,
32092,
198,
220,
220,
220,
220,
220,
220,
220,
220,
198,
4480,
1280,
7,
69,
6,
90,
34219,
92,
14,
26947,
13,
17752,
3256,
705,
86,
11537,
355,
277,
79,
25,
198,
220,
220,
220,
33918,
13,
39455,
7,
2606,
7250,
3843,
11,
277,
79,
11,
33793,
28,
17,
8,
198
] | 2.052239 | 670 |
from src.database import SqliteDatabase
| [
6738,
12351,
13,
48806,
1330,
311,
13976,
578,
38105,
198,
197,
198,
197,
198,
197,
628,
197,
628
] | 2.777778 | 18 |
#!/usr/bin/env python3
import os
import sys
import time
sys.path.append(os.getcwd()+'/CPDP')
sys.path.append(os.getcwd()+'/JinEnv')
sys.path.append(os.getcwd()+'/lib')
import CPDP
import JinEnv
from casadi import *
from scipy.integrate import solve_ivp
import scipy.io as sio
# ---------------------------------------load environment---------------------------------------
env = JinEnv.SinglePendulum()
env.initDyn(l=1, m=1, damping_ratio=0.1)
env.initCost(wu=.01)
# ---------------------------create optimal control object ----------------------------------------
oc = CPDP.COCSys()
beta = SX.sym('beta')
dyn = beta*env.f
oc.setAuxvarVariable(vertcat(beta,env.cost_auxvar))
oc.setStateVariable(env.X)
oc.setControlVariable(env.U)
oc.setDyn(dyn)
path_cost = beta * env.path_cost
oc.setPathCost(path_cost)
oc.setFinalCost(env.final_cost)
# set initial condition
ini_state = [0.0, 0.0]
# ---------------------- define the loss function and interface function ------------------
# define the interface (only for the state)
interface_fn = Function('interface', [oc.state], [oc.state[0]])
diff_interface_fn = Function('diff_interface', [oc.state], [jacobian(oc.state[0], oc.state)])
# --------------------------- create waypoints using ground truth ----------------------------------------
T = 1
true_parameter = [2, 1, 1]
true_time_grid, true_opt_sol = oc.cocSolver(ini_state, T, true_parameter)
# env.play_animation(len=1, dt=true_time_grid[1] - true_time_grid[0], state_traj=true_opt_sol(true_time_grid)[:, 0:oc.n_state])
time_tau = true_time_grid[[1, 3, 6, 7, 9]]
waypoints = np.zeros((time_tau.size, interface_fn.numel_out()))
for k, t in enumerate(time_tau):
waypoints[k,:] = interface_fn(true_opt_sol(t)[0:oc.n_state]).full().flatten()
# --------------------------- learning process --------------------------------
lr = 1e-2
loss_trace, parameter_trace = [], []
current_parameter = np.array([1, 0.5, 1.5])
parameter_trace += [current_parameter.tolist()]
for j in range(int(100)):
# initial guess of trajectory based on initial parameters
time_grid, opt_sol = oc.cocSolver(ini_state, T, current_parameter)
# # Establish the auxiliary control system
auxsys_sol = oc.auxSysSolver(time_grid, opt_sol, current_parameter)
# Use the chain rule
loss, diff_loss = getloss_corrections(time_tau, waypoints, opt_sol, auxsys_sol)
# update
current_parameter -= lr * diff_loss
current_parameter[0] = fmax(current_parameter[0], 0.00000001) # projection
loss_trace += [loss]
parameter_trace += [current_parameter.tolist()]
# print
print('iter:', j, 'loss:', loss_trace[-1].tolist())
# save the results
save_data = {'parameter_trace': parameter_trace,
'loss_trace': loss_trace,
'learning_rate': lr,
'true_parameter':true_parameter,
'waypoints':waypoints,
'time_grid':time_tau,
'T':T}
# sio.savemat('../data/pendulum_results_2.mat', {'results': save_data}) | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
11748,
28686,
198,
11748,
25064,
198,
11748,
640,
198,
17597,
13,
6978,
13,
33295,
7,
418,
13,
1136,
66,
16993,
3419,
10,
26488,
34,
5760,
47,
11537,
198,
17597,
13,
6978,
13,
33295,
7,
418,
13,
1136,
66,
16993,
3419,
10,
26488,
41,
259,
4834,
85,
11537,
198,
17597,
13,
6978,
13,
33295,
7,
418,
13,
1136,
66,
16993,
3419,
10,
26488,
8019,
11537,
198,
11748,
327,
5760,
47,
198,
11748,
17297,
4834,
85,
198,
6738,
6124,
9189,
1330,
1635,
198,
6738,
629,
541,
88,
13,
18908,
4873,
1330,
8494,
62,
452,
79,
198,
11748,
629,
541,
88,
13,
952,
355,
264,
952,
628,
198,
2,
20368,
26866,
2220,
2858,
3880,
26866,
198,
24330,
796,
17297,
4834,
85,
13,
28008,
47,
437,
14452,
3419,
198,
24330,
13,
15003,
35,
2047,
7,
75,
28,
16,
11,
285,
28,
16,
11,
21151,
278,
62,
10366,
952,
28,
15,
13,
16,
8,
198,
24330,
13,
15003,
13729,
7,
43812,
28,
13,
486,
8,
198,
198,
2,
220,
22369,
6329,
17953,
16586,
1630,
2134,
20368,
982,
198,
420,
796,
327,
5760,
47,
13,
34,
4503,
44387,
3419,
198,
31361,
796,
44205,
13,
37047,
10786,
31361,
11537,
198,
67,
2047,
796,
12159,
9,
24330,
13,
69,
198,
420,
13,
2617,
32,
2821,
7785,
43015,
7,
1851,
9246,
7,
31361,
11,
24330,
13,
15805,
62,
14644,
7785,
4008,
198,
420,
13,
2617,
9012,
43015,
7,
24330,
13,
55,
8,
198,
420,
13,
2617,
15988,
43015,
7,
24330,
13,
52,
8,
198,
420,
13,
2617,
35,
2047,
7,
67,
2047,
8,
198,
6978,
62,
15805,
796,
12159,
1635,
17365,
13,
6978,
62,
15805,
198,
420,
13,
2617,
15235,
13729,
7,
6978,
62,
15805,
8,
198,
420,
13,
2617,
19006,
13729,
7,
24330,
13,
20311,
62,
15805,
8,
198,
2,
900,
4238,
4006,
198,
5362,
62,
5219,
796,
685,
15,
13,
15,
11,
657,
13,
15,
60,
628,
198,
2,
41436,
438,
8160,
262,
2994,
2163,
290,
7071,
2163,
34400,
438,
198,
2,
8160,
262,
7071,
357,
8807,
329,
262,
1181,
8,
198,
39994,
62,
22184,
796,
15553,
10786,
39994,
3256,
685,
420,
13,
5219,
4357,
685,
420,
13,
5219,
58,
15,
11907,
8,
198,
26069,
62,
39994,
62,
22184,
796,
15553,
10786,
26069,
62,
39994,
3256,
685,
420,
13,
5219,
4357,
685,
30482,
672,
666,
7,
420,
13,
5219,
58,
15,
4357,
267,
66,
13,
5219,
8,
12962,
628,
198,
2,
220,
22369,
6329,
2251,
835,
13033,
1262,
2323,
3872,
20368,
982,
198,
51,
796,
352,
198,
7942,
62,
17143,
2357,
796,
685,
17,
11,
352,
11,
352,
60,
198,
7942,
62,
2435,
62,
25928,
11,
2081,
62,
8738,
62,
34453,
796,
267,
66,
13,
66,
420,
50,
14375,
7,
5362,
62,
5219,
11,
309,
11,
2081,
62,
17143,
2357,
8,
198,
2,
17365,
13,
1759,
62,
11227,
341,
7,
11925,
28,
16,
11,
288,
83,
28,
7942,
62,
2435,
62,
25928,
58,
16,
60,
532,
2081,
62,
2435,
62,
25928,
58,
15,
4357,
1181,
62,
9535,
73,
28,
7942,
62,
8738,
62,
34453,
7,
7942,
62,
2435,
62,
25928,
38381,
45299,
657,
25,
420,
13,
77,
62,
5219,
12962,
198,
198,
2435,
62,
83,
559,
796,
2081,
62,
2435,
62,
25928,
30109,
16,
11,
513,
11,
718,
11,
767,
11,
860,
11907,
198,
1014,
13033,
796,
45941,
13,
9107,
418,
19510,
2435,
62,
83,
559,
13,
7857,
11,
7071,
62,
22184,
13,
22510,
417,
62,
448,
3419,
4008,
198,
1640,
479,
11,
256,
287,
27056,
378,
7,
2435,
62,
83,
559,
2599,
198,
220,
220,
220,
835,
13033,
58,
74,
11,
47715,
796,
7071,
62,
22184,
7,
7942,
62,
8738,
62,
34453,
7,
83,
38381,
15,
25,
420,
13,
77,
62,
5219,
35944,
12853,
22446,
2704,
41769,
3419,
628,
198,
2,
220,
22369,
6329,
4673,
1429,
20368,
198,
14050,
796,
352,
68,
12,
17,
198,
22462,
62,
40546,
11,
11507,
62,
40546,
796,
685,
4357,
17635,
198,
14421,
62,
17143,
2357,
796,
45941,
13,
18747,
26933,
16,
11,
657,
13,
20,
11,
352,
13,
20,
12962,
198,
17143,
2357,
62,
40546,
15853,
685,
14421,
62,
17143,
2357,
13,
83,
349,
396,
3419,
60,
198,
1640,
474,
287,
2837,
7,
600,
7,
3064,
8,
2599,
198,
220,
220,
220,
1303,
4238,
4724,
286,
22942,
1912,
319,
4238,
10007,
198,
220,
220,
220,
640,
62,
25928,
11,
2172,
62,
34453,
796,
267,
66,
13,
66,
420,
50,
14375,
7,
5362,
62,
5219,
11,
309,
11,
1459,
62,
17143,
2357,
8,
198,
220,
220,
220,
1303,
1303,
10062,
17148,
262,
37419,
1630,
1080,
198,
220,
220,
220,
27506,
17597,
62,
34453,
796,
267,
66,
13,
14644,
44387,
50,
14375,
7,
2435,
62,
25928,
11,
2172,
62,
34453,
11,
1459,
62,
17143,
2357,
8,
198,
220,
220,
220,
1303,
5765,
262,
6333,
3896,
198,
220,
220,
220,
2994,
11,
814,
62,
22462,
796,
651,
22462,
62,
30283,
507,
7,
2435,
62,
83,
559,
11,
835,
13033,
11,
2172,
62,
34453,
11,
27506,
17597,
62,
34453,
8,
198,
220,
220,
220,
1303,
4296,
198,
220,
220,
220,
1459,
62,
17143,
2357,
48185,
300,
81,
1635,
814,
62,
22462,
198,
220,
220,
220,
1459,
62,
17143,
2357,
58,
15,
60,
796,
277,
9806,
7,
14421,
62,
17143,
2357,
58,
15,
4357,
657,
13,
10535,
486,
8,
220,
1303,
20128,
198,
220,
220,
220,
2994,
62,
40546,
15853,
685,
22462,
60,
198,
220,
220,
220,
11507,
62,
40546,
15853,
685,
14421,
62,
17143,
2357,
13,
83,
349,
396,
3419,
60,
198,
220,
220,
220,
1303,
3601,
198,
220,
220,
220,
3601,
10786,
2676,
25,
3256,
474,
11,
705,
22462,
25,
3256,
2994,
62,
40546,
58,
12,
16,
4083,
83,
349,
396,
28955,
628,
198,
2,
3613,
262,
2482,
198,
21928,
62,
7890,
796,
1391,
6,
17143,
2357,
62,
40546,
10354,
11507,
62,
40546,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
22462,
62,
40546,
10354,
2994,
62,
40546,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
40684,
62,
4873,
10354,
300,
81,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
7942,
62,
17143,
2357,
10354,
7942,
62,
17143,
2357,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
1014,
13033,
10354,
1014,
13033,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
2435,
62,
25928,
10354,
2435,
62,
83,
559,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
51,
10354,
51,
92,
198,
198,
2,
264,
952,
13,
21928,
6759,
10786,
40720,
7890,
14,
37038,
14452,
62,
43420,
62,
17,
13,
6759,
3256,
1391,
6,
43420,
10354,
3613,
62,
7890,
30072
] | 2.67263 | 1,118 |
# simple math
ab = input().split()
cd = input().split()
t = int(input())
dist_x = abs(int(ab[0]) - int(cd[0]))
dist_y = abs(int(ab[1]) - int(cd[1]))
dist = dist_x + dist_y
if t >= dist and t % 2 == dist % 2:
print("Y")
else:
print("N") | [
2,
2829,
10688,
198,
198,
397,
796,
5128,
22446,
35312,
3419,
198,
10210,
796,
5128,
22446,
35312,
3419,
198,
83,
796,
493,
7,
15414,
28955,
198,
17080,
62,
87,
796,
2352,
7,
600,
7,
397,
58,
15,
12962,
532,
493,
7,
10210,
58,
15,
60,
4008,
198,
17080,
62,
88,
796,
2352,
7,
600,
7,
397,
58,
16,
12962,
532,
493,
7,
10210,
58,
16,
60,
4008,
198,
17080,
796,
1233,
62,
87,
1343,
1233,
62,
88,
198,
361,
256,
18189,
1233,
290,
256,
4064,
362,
6624,
1233,
4064,
362,
25,
198,
197,
4798,
7203,
56,
4943,
198,
17772,
25,
198,
197,
4798,
7203,
45,
4943
] | 2.245283 | 106 |
import requests
| [
11748,
7007,
198
] | 5.333333 | 3 |
from PyPDF3 import PdfFileReader, PdfFileWriter
import tkinter as tk
from tkinter import filedialog
root = tk.Tk()
root.withdraw()
path = filedialog.askopenfilename()
file = open(path, "rb")
pdf = PdfFileReader(file)
writer = PdfFileWriter()
writer.appendPagesFromReader(pdf)
metadata = pdf.getDocumentInfo()
writer.addMetadata(metadata)
writer.addMetadata({"/Title": input("Enter title: ")})
writer.addMetadata({"/Author": input("Enter author: ")})
writer.addMetadata({"/Subject": input("Enter subject: ")})
writer.addMetadata({"/Keywords": input("Enter keywords: ")})
temp = path.split(".")
temp[-2] += "_tagged"
save_path = ".".join(temp)
output = open(save_path, "wb")
writer.write(output)
output.close()
file.close()
| [
6738,
9485,
20456,
18,
1330,
350,
7568,
8979,
33634,
11,
350,
7568,
8979,
34379,
198,
11748,
256,
74,
3849,
355,
256,
74,
198,
6738,
256,
74,
3849,
1330,
5717,
498,
519,
198,
198,
15763,
796,
256,
74,
13,
51,
74,
3419,
198,
15763,
13,
4480,
19334,
3419,
198,
198,
6978,
796,
5717,
498,
519,
13,
2093,
9654,
34345,
3419,
198,
7753,
796,
1280,
7,
6978,
11,
366,
26145,
4943,
198,
12315,
796,
350,
7568,
8979,
33634,
7,
7753,
8,
198,
16002,
796,
350,
7568,
8979,
34379,
3419,
198,
198,
16002,
13,
33295,
47798,
4863,
33634,
7,
12315,
8,
198,
38993,
796,
37124,
13,
1136,
24941,
12360,
3419,
198,
16002,
13,
2860,
9171,
14706,
7,
38993,
8,
198,
198,
16002,
13,
2860,
9171,
14706,
7,
4895,
14,
19160,
1298,
5128,
7203,
17469,
3670,
25,
366,
8,
30072,
198,
16002,
13,
2860,
9171,
14706,
7,
4895,
14,
13838,
1298,
5128,
7203,
17469,
1772,
25,
366,
8,
30072,
198,
16002,
13,
2860,
9171,
14706,
7,
4895,
14,
19776,
1298,
5128,
7203,
17469,
2426,
25,
366,
8,
30072,
198,
16002,
13,
2860,
9171,
14706,
7,
4895,
14,
9218,
10879,
1298,
5128,
7203,
17469,
26286,
25,
366,
8,
30072,
198,
198,
29510,
796,
3108,
13,
35312,
7203,
19570,
198,
29510,
58,
12,
17,
60,
15853,
45434,
12985,
2004,
1,
198,
21928,
62,
6978,
796,
366,
526,
13,
22179,
7,
29510,
8,
198,
198,
22915,
796,
1280,
7,
21928,
62,
6978,
11,
366,
39346,
4943,
198,
16002,
13,
13564,
7,
22915,
8,
198,
22915,
13,
19836,
3419,
198,
7753,
13,
19836,
3419,
198
] | 2.832685 | 257 |
from __future__ import division
import torch
from torch import nn
| [
6738,
11593,
37443,
834,
1330,
7297,
198,
198,
11748,
28034,
198,
6738,
28034,
1330,
299,
77,
628,
628
] | 3.888889 | 18 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-07-17 16:42
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2980,
515,
416,
37770,
352,
13,
940,
13,
22,
319,
2177,
12,
2998,
12,
1558,
1467,
25,
3682,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
198,
11748,
42625,
14208,
13,
9945,
13,
27530,
13,
2934,
1616,
295,
628
] | 2.73913 | 69 |
from django.shortcuts import render, get_object_or_404
from django.db.models import Q
from django.utils import timezone
from rest_framework import pagination, generics, views, status, mixins
from rest_framework.response import Response
from rest_framework.views import APIView
from rest_framework.parsers import JSONParser
import socket
import requests
import uuid
import re
import json
from .serializers import UserSerializer, PostSerializer, CommentSerializer, UserFriendSerializer
from .paginators import PostPagination, CommentPagination
from friends.models import Follow, FriendRequest,FollowManager
from users.models import User, Node, NodeSetting
from comments.models import Comment
from posts.models import Post
from friends.views import follows, standardize_url, get_user, friends
from requests.auth import HTTPBasicAuth
import requests
import socket
import uuid
import traceback
# Checks if we have enabled sharing posts with other servers
# When you add a remote host as a user, you need to make sure to add the HOST
# field. That way we know what the hostname is of the remote host. We need this
# because some groups might not even send the remote host header, and so we
# wouldn't know who they are.
# TODO: Verify
| [
6738,
42625,
14208,
13,
19509,
23779,
1330,
8543,
11,
651,
62,
15252,
62,
273,
62,
26429,
198,
6738,
42625,
14208,
13,
9945,
13,
27530,
1330,
1195,
198,
6738,
42625,
14208,
13,
26791,
1330,
640,
11340,
198,
198,
6738,
1334,
62,
30604,
1330,
42208,
1883,
11,
1152,
873,
11,
5009,
11,
3722,
11,
5022,
1040,
198,
6738,
1334,
62,
30604,
13,
26209,
1330,
18261,
198,
6738,
1334,
62,
30604,
13,
33571,
1330,
3486,
3824,
769,
198,
6738,
1334,
62,
30604,
13,
79,
945,
364,
1330,
19449,
46677,
198,
198,
11748,
17802,
198,
11748,
7007,
198,
11748,
334,
27112,
198,
11748,
302,
198,
11748,
33918,
198,
6738,
764,
46911,
11341,
1330,
11787,
32634,
7509,
11,
2947,
32634,
7509,
11,
18957,
32634,
7509,
11,
11787,
23331,
32634,
7509,
198,
198,
6738,
764,
79,
23183,
2024,
1330,
2947,
47,
363,
1883,
11,
18957,
47,
363,
1883,
198,
198,
6738,
2460,
13,
27530,
1330,
7281,
11,
9182,
18453,
11,
7155,
13511,
198,
6738,
2985,
13,
27530,
1330,
11787,
11,
19081,
11,
19081,
34149,
198,
6738,
3651,
13,
27530,
1330,
18957,
198,
6738,
6851,
13,
27530,
1330,
2947,
198,
198,
6738,
2460,
13,
33571,
1330,
5679,
11,
3210,
1096,
62,
6371,
11,
651,
62,
7220,
11,
2460,
198,
198,
6738,
7007,
13,
18439,
1330,
14626,
26416,
30515,
198,
11748,
7007,
198,
11748,
17802,
198,
11748,
334,
27112,
198,
11748,
12854,
1891,
628,
198,
2,
47719,
611,
356,
423,
9343,
7373,
6851,
351,
584,
9597,
198,
198,
2,
1649,
345,
751,
257,
6569,
2583,
355,
257,
2836,
11,
345,
761,
284,
787,
1654,
284,
751,
262,
367,
10892,
198,
2,
2214,
13,
1320,
835,
356,
760,
644,
262,
2583,
3672,
318,
286,
262,
6569,
2583,
13,
775,
761,
428,
198,
2,
780,
617,
2628,
1244,
407,
772,
3758,
262,
6569,
2583,
13639,
11,
290,
523,
356,
198,
2,
3636,
470,
760,
508,
484,
389,
13,
628,
198,
2,
16926,
46,
25,
49899,
628,
628,
628,
198
] | 3.905956 | 319 |
# niw
import re
from nltk.tokenize import sent_tokenize
from string import punctuation
from solvers.solver_helpers import RubertForMasking, AbstractSolver
| [
2,
299,
14246,
198,
198,
11748,
302,
198,
6738,
299,
2528,
74,
13,
30001,
1096,
1330,
1908,
62,
30001,
1096,
198,
6738,
4731,
1330,
21025,
2288,
198,
198,
6738,
1540,
690,
13,
82,
14375,
62,
16794,
364,
1330,
11667,
4835,
1890,
44,
30463,
11,
27741,
50,
14375,
628
] | 3.291667 | 48 |
"""
This module provides classes to create and manage transactions.
"""
import uuid
import datetime
from fintool.db import DbFactory
from fintool.logging import LoggingHelper
class Error(Exception):
"""Base class for all errors in this module.
"""
class MissingFieldError(Error):
"""
Raised when trying to convert a dictionary that misses a required field
into a transaction.
"""
class InvalidFieldValueError(Error):
"""
Raised when the user tries to assign an invalid value to some field.
"""
class InvalidTransactionError(Error):
"""
Raised when the user passes an invalid transaction object to the
transaction manager.
"""
class InvalidFieldError(Error):
"""
Raised when the user requests a value for an invalid field.
"""
class Transaction:
"""
A type to define a transaction object.
"""
ID = 'id'
TYPE = 'type'
TAGS = 'tags'
DATE = 'date'
AMOUNT = 'amount'
SUPPORTED_TYPES = {'income', 'outcome'}
def __init__(self, t_type, t_tags, t_date, t_amount, t_id=None):
"""Do input validation on arguments and initialize fields.
Raise InvalidFieldValueError if argument is not expected or has
invalid format.
Args:
t_id (str): a guid
t_type (str): transaction type (income/outcome)
t_tags (str): a | separated list of words
t_date (str): a date with YYYY-MM-DD format
t_amount (float): a floating point number representing
the exchanged amount
"""
if t_type in self.SUPPORTED_TYPES:
self.type = t_type
else:
raise InvalidFieldValueError(
f'Invalid value {t_type} for transaction type'
)
try:
self.tags = set(t_tags.split('|'))
except AttributeError:
raise InvalidFieldValueError(
f'Invalid value {t_tags} for transaction tags'
)
try:
datetime.datetime.strptime(t_date, '%Y-%m-%d')
self.date = t_date
except ValueError:
raise InvalidFieldValueError(
f'Invalid value {t_date} for transaction date'
)
try:
self.amount = float(t_amount)
except ValueError:
raise InvalidFieldValueError(
f"Invalid value {t_amount} for transaction amount"
)
self.id = t_id if t_id else uuid.uuid4().hex
self._fields = {
self.ID: self.id,
self.TYPE: self.type,
self.DATE: self.date,
self.AMOUNT: self.amount,
self.TAGS: self.tags
}
@classmethod
def from_dict(cls, data):
"""
Create a transaction instance from a dict object.
"""
try:
transaction = Transaction(
data[cls.TYPE],
data[cls.TAGS],
data[cls.DATE],
data[cls.AMOUNT],
data[cls.ID] if cls.ID in data else None
)
except KeyError as key_error:
raise MissingFieldError(f'Input dict is missing: {key_error}')
# keep id if was provided in data
if cls.ID in data:
transaction.id = data[cls.ID]
return transaction
def serialize(self):
"""
Convert the transaction instance into a dictionary.
"""
return {
self.ID: self.id,
self.TYPE: self.type,
self.DATE: self.date,
self.AMOUNT: self.amount,
self.TAGS: '|'.join(self.tags)
}
def get_value(self, field):
"""
Return the corresponding value for the given key.
"""
try:
return self._fields[field]
except KeyError:
raise InvalidFieldError(f'{field} is not supported')
def __str__(self):
"""
Return a human-readable representation of the transaction instance.
"""
return f'{self.id}\t{self.date}\t{self.type}\t{self.amount}'\
f'\t{self.tags}'
class TransactionManager:
"""
A class to define the behavior of an object that knows how to manage
transactions.
"""
TRANSACTION_COLLECTION = 'records'
def __init__(self):
"""
Initialize instance.
"""
self._logger = LoggingHelper.get_logger(self.__class__.__name__)
self._db = DbFactory.get_db('csv')()
def create_transaction_list(self, dicts):
"""
Create a list of Transaction instances from a list of dictionaries.
"""
return [Transaction.from_dict(d) for d in dicts]
def save_transaction(self, transaction):
"""Save a transaction in db.
Args:
transaction (Transaction): object to be saved in db
"""
# TODO: need to get db type from cfg
# TODO: need to inject db object so that we can test with mock data
self._logger.debug('saving transaction in db')
self._db.add_record(
record=transaction.serialize(),
collection=self.TRANSACTION_COLLECTION
)
def filter_transactions(self, transactions, filters):
"""
Filter a list of transaction based on a set of key-values
"""
result = []
# collect transactions matching any filter value only
for transaction in transactions:
for key, value in filters.items():
try:
match = value & transaction.tags if key == Transaction.TAGS \
else value == transaction.get_value(key)
if match:
result.append(transaction)
break
except InvalidFieldError:
pass # no problem, field doesn't exists
return result
def get_transactions(self, filters=None):
"""Get transactions from db and apply a set of filters.
"""
self._logger.debug(
'getting transactions from db using filters = %s', filters
)
records = self._db.get_records(self.TRANSACTION_COLLECTION)
transactions = self.create_transaction_list(records)
if filters:
transactions = self.filter_transactions(transactions, filters)
return transactions
def remove_transaction(self, data):
"""Make sure that data contains a value for id field and use it
to remove a transaction from db.
"""
try:
id_value = data[Transaction.ID]
except KeyError:
raise MissingFieldError(f'missing field {Transaction.ID}')
self._logger.debug('removing transaction %s', id_value)
self._db.remove_record(
Transaction.ID,
id_value,
self.TRANSACTION_COLLECTION
)
def update_transaction(self, data):
"""Update a transaction in db by using the provided id and data.
"""
self._logger.debug('updating transaction %s with %s', data.id, data)
if isinstance(data, Transaction):
self._db.edit_record(
Transaction.ID,
data.id,
data.serialize(),
self.TRANSACTION_COLLECTION
)
else:
raise InvalidTransactionError('invalid transaction object')
| [
37811,
198,
1212,
8265,
3769,
6097,
284,
2251,
290,
6687,
8945,
13,
198,
37811,
628,
198,
11748,
334,
27112,
198,
11748,
4818,
8079,
198,
198,
6738,
277,
600,
970,
13,
9945,
1330,
360,
65,
22810,
198,
6738,
277,
600,
970,
13,
6404,
2667,
1330,
5972,
2667,
47429,
628,
198,
4871,
13047,
7,
16922,
2599,
198,
220,
220,
220,
37227,
14881,
1398,
329,
477,
8563,
287,
428,
8265,
13,
198,
220,
220,
220,
37227,
628,
198,
4871,
25639,
15878,
12331,
7,
12331,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
7567,
1417,
618,
2111,
284,
10385,
257,
22155,
326,
18297,
257,
2672,
2214,
198,
220,
220,
220,
656,
257,
8611,
13,
198,
220,
220,
220,
37227,
628,
198,
4871,
17665,
15878,
11395,
12331,
7,
12331,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
7567,
1417,
618,
262,
2836,
8404,
284,
8333,
281,
12515,
1988,
284,
617,
2214,
13,
198,
220,
220,
220,
37227,
628,
198,
4871,
17665,
48720,
12331,
7,
12331,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
7567,
1417,
618,
262,
2836,
8318,
281,
12515,
8611,
2134,
284,
262,
198,
220,
220,
220,
8611,
4706,
13,
198,
220,
220,
220,
37227,
628,
198,
4871,
17665,
15878,
12331,
7,
12331,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
7567,
1417,
618,
262,
2836,
7007,
257,
1988,
329,
281,
12515,
2214,
13,
198,
220,
220,
220,
37227,
628,
198,
4871,
45389,
25,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
317,
2099,
284,
8160,
257,
8611,
2134,
13,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
4522,
796,
705,
312,
6,
198,
220,
220,
220,
41876,
796,
705,
4906,
6,
198,
220,
220,
220,
37801,
50,
796,
705,
31499,
6,
198,
220,
220,
220,
360,
6158,
796,
705,
4475,
6,
198,
220,
220,
220,
3001,
28270,
796,
705,
17287,
6,
198,
220,
220,
220,
43333,
1961,
62,
9936,
47,
1546,
796,
1391,
6,
12519,
3256,
705,
448,
2958,
6,
92,
198,
220,
220,
220,
825,
11593,
15003,
834,
7,
944,
11,
256,
62,
4906,
11,
256,
62,
31499,
11,
256,
62,
4475,
11,
256,
62,
17287,
11,
256,
62,
312,
28,
14202,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
5211,
5128,
21201,
319,
7159,
290,
41216,
7032,
13,
628,
220,
220,
220,
220,
220,
220,
220,
35123,
17665,
15878,
11395,
12331,
611,
4578,
318,
407,
2938,
393,
468,
198,
220,
220,
220,
220,
220,
220,
220,
12515,
5794,
13,
628,
220,
220,
220,
220,
220,
220,
220,
943,
14542,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
256,
62,
312,
357,
2536,
2599,
220,
220,
220,
220,
220,
220,
220,
220,
257,
10103,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
256,
62,
4906,
357,
2536,
2599,
220,
220,
220,
220,
220,
220,
8611,
2099,
357,
12519,
14,
448,
2958,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
256,
62,
31499,
357,
2536,
2599,
220,
220,
220,
220,
220,
220,
257,
930,
11266,
1351,
286,
2456,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
256,
62,
4475,
357,
2536,
2599,
220,
220,
220,
220,
220,
220,
257,
3128,
351,
575,
26314,
56,
12,
12038,
12,
16458,
5794,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
256,
62,
17287,
357,
22468,
2599,
220,
220,
257,
12462,
966,
1271,
10200,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
262,
22112,
2033,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
611,
256,
62,
4906,
287,
2116,
13,
40331,
15490,
1961,
62,
9936,
47,
1546,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
4906,
796,
256,
62,
4906,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5298,
17665,
15878,
11395,
12331,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
277,
6,
44651,
1988,
1391,
83,
62,
4906,
92,
329,
8611,
2099,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1267,
628,
220,
220,
220,
220,
220,
220,
220,
1949,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
31499,
796,
900,
7,
83,
62,
31499,
13,
35312,
10786,
91,
6,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
2845,
3460,
4163,
12331,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5298,
17665,
15878,
11395,
12331,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
277,
6,
44651,
1988,
1391,
83,
62,
31499,
92,
329,
8611,
15940,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1267,
628,
220,
220,
220,
220,
220,
220,
220,
1949,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4818,
8079,
13,
19608,
8079,
13,
2536,
457,
524,
7,
83,
62,
4475,
11,
705,
4,
56,
12,
4,
76,
12,
4,
67,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
4475,
796,
256,
62,
4475,
198,
220,
220,
220,
220,
220,
220,
220,
2845,
11052,
12331,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5298,
17665,
15878,
11395,
12331,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
277,
6,
44651,
1988,
1391,
83,
62,
4475,
92,
329,
8611,
3128,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1267,
628,
220,
220,
220,
220,
220,
220,
220,
1949,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
17287,
796,
12178,
7,
83,
62,
17287,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2845,
11052,
12331,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5298,
17665,
15878,
11395,
12331,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
277,
1,
44651,
1988,
1391,
83,
62,
17287,
92,
329,
8611,
2033,
1,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1267,
628,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
312,
796,
256,
62,
312,
611,
256,
62,
312,
2073,
334,
27112,
13,
12303,
312,
19,
22446,
33095,
628,
220,
220,
220,
220,
220,
220,
220,
2116,
13557,
25747,
796,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
2389,
25,
2116,
13,
312,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
25216,
25,
2116,
13,
4906,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
35,
6158,
25,
2116,
13,
4475,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
2390,
28270,
25,
2116,
13,
17287,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
42197,
50,
25,
2116,
13,
31499,
198,
220,
220,
220,
220,
220,
220,
220,
1782,
628,
220,
220,
220,
2488,
4871,
24396,
198,
220,
220,
220,
825,
422,
62,
11600,
7,
565,
82,
11,
1366,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
13610,
257,
8611,
4554,
422,
257,
8633,
2134,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
1949,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8611,
796,
45389,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1366,
58,
565,
82,
13,
25216,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1366,
58,
565,
82,
13,
42197,
50,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1366,
58,
565,
82,
13,
35,
6158,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1366,
58,
565,
82,
13,
2390,
28270,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1366,
58,
565,
82,
13,
2389,
60,
611,
537,
82,
13,
2389,
287,
1366,
2073,
6045,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
2845,
7383,
12331,
355,
1994,
62,
18224,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5298,
25639,
15878,
12331,
7,
69,
6,
20560,
8633,
318,
4814,
25,
1391,
2539,
62,
18224,
92,
11537,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
1394,
4686,
611,
373,
2810,
287,
1366,
198,
220,
220,
220,
220,
220,
220,
220,
611,
537,
82,
13,
2389,
287,
1366,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8611,
13,
312,
796,
1366,
58,
565,
82,
13,
2389,
60,
628,
220,
220,
220,
220,
220,
220,
220,
1441,
8611,
628,
220,
220,
220,
825,
11389,
1096,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
38240,
262,
8611,
4554,
656,
257,
22155,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
2389,
25,
2116,
13,
312,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
25216,
25,
2116,
13,
4906,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
35,
6158,
25,
2116,
13,
4475,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
2390,
28270,
25,
2116,
13,
17287,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
42197,
50,
25,
705,
91,
4458,
22179,
7,
944,
13,
31499,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1782,
628,
220,
220,
220,
825,
651,
62,
8367,
7,
944,
11,
2214,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
8229,
262,
11188,
1988,
329,
262,
1813,
1994,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
1949,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
2116,
13557,
25747,
58,
3245,
60,
198,
220,
220,
220,
220,
220,
220,
220,
2845,
7383,
12331,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5298,
17665,
15878,
12331,
7,
69,
6,
90,
3245,
92,
318,
407,
4855,
11537,
628,
220,
220,
220,
825,
11593,
2536,
834,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
8229,
257,
1692,
12,
46155,
10552,
286,
262,
8611,
4554,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
277,
6,
90,
944,
13,
312,
32239,
83,
90,
944,
13,
4475,
32239,
83,
90,
944,
13,
4906,
32239,
83,
90,
944,
13,
17287,
92,
6,
59,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
277,
6,
59,
83,
90,
944,
13,
31499,
92,
6,
628,
198,
4871,
45389,
13511,
25,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
317,
1398,
284,
8160,
262,
4069,
286,
281,
2134,
326,
4206,
703,
284,
6687,
198,
220,
220,
220,
8945,
13,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
44069,
44710,
62,
25154,
16779,
2849,
796,
705,
8344,
3669,
6,
628,
220,
220,
220,
825,
11593,
15003,
834,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
20768,
1096,
4554,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13557,
6404,
1362,
796,
5972,
2667,
47429,
13,
1136,
62,
6404,
1362,
7,
944,
13,
834,
4871,
834,
13,
834,
3672,
834,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13557,
9945,
796,
360,
65,
22810,
13,
1136,
62,
9945,
10786,
40664,
11537,
3419,
628,
220,
220,
220,
825,
2251,
62,
7645,
2673,
62,
4868,
7,
944,
11,
8633,
82,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
13610,
257,
1351,
286,
45389,
10245,
422,
257,
1351,
286,
48589,
3166,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
685,
48720,
13,
6738,
62,
11600,
7,
67,
8,
329,
288,
287,
8633,
82,
60,
628,
220,
220,
220,
825,
3613,
62,
7645,
2673,
7,
944,
11,
8611,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
16928,
257,
8611,
287,
20613,
13,
628,
220,
220,
220,
220,
220,
220,
220,
943,
14542,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8611,
357,
48720,
2599,
2134,
284,
307,
7448,
287,
20613,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
16926,
46,
25,
761,
284,
651,
20613,
2099,
422,
30218,
70,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
16926,
46,
25,
761,
284,
8677,
20613,
2134,
523,
326,
356,
460,
1332,
351,
15290,
1366,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13557,
6404,
1362,
13,
24442,
10786,
29336,
8611,
287,
20613,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13557,
9945,
13,
2860,
62,
22105,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1700,
28,
7645,
2673,
13,
46911,
1096,
22784,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4947,
28,
944,
13,
5446,
15037,
44710,
62,
25154,
16779,
2849,
198,
220,
220,
220,
220,
220,
220,
220,
1267,
628,
220,
220,
220,
825,
8106,
62,
7645,
4658,
7,
944,
11,
8945,
11,
16628,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
25853,
257,
1351,
286,
8611,
1912,
319,
257,
900,
286,
1994,
12,
27160,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
1255,
796,
17635,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
2824,
8945,
12336,
597,
8106,
1988,
691,
198,
220,
220,
220,
220,
220,
220,
220,
329,
8611,
287,
8945,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
1994,
11,
1988,
287,
16628,
13,
23814,
33529,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1949,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2872,
796,
1988,
1222,
8611,
13,
31499,
611,
1994,
6624,
45389,
13,
42197,
50,
3467,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2073,
1988,
6624,
8611,
13,
1136,
62,
8367,
7,
2539,
8,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
2872,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1255,
13,
33295,
7,
7645,
2673,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2270,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2845,
17665,
15878,
12331,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1208,
220,
1303,
645,
1917,
11,
2214,
1595,
470,
7160,
628,
220,
220,
220,
220,
220,
220,
220,
1441,
1255,
628,
220,
220,
220,
825,
651,
62,
7645,
4658,
7,
944,
11,
16628,
28,
14202,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
3855,
8945,
422,
20613,
290,
4174,
257,
900,
286,
16628,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13557,
6404,
1362,
13,
24442,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
37210,
8945,
422,
20613,
1262,
16628,
796,
4064,
82,
3256,
16628,
198,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
4406,
796,
2116,
13557,
9945,
13,
1136,
62,
8344,
3669,
7,
944,
13,
5446,
15037,
44710,
62,
25154,
16779,
2849,
8,
198,
220,
220,
220,
220,
220,
220,
220,
8945,
796,
2116,
13,
17953,
62,
7645,
2673,
62,
4868,
7,
8344,
3669,
8,
628,
220,
220,
220,
220,
220,
220,
220,
611,
16628,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8945,
796,
2116,
13,
24455,
62,
7645,
4658,
7,
7645,
4658,
11,
16628,
8,
628,
220,
220,
220,
220,
220,
220,
220,
1441,
8945,
628,
220,
220,
220,
825,
4781,
62,
7645,
2673,
7,
944,
11,
1366,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
12050,
1654,
326,
1366,
4909,
257,
1988,
329,
4686,
2214,
290,
779,
340,
198,
220,
220,
220,
220,
220,
220,
220,
284,
4781,
257,
8611,
422,
20613,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
1949,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4686,
62,
8367,
796,
1366,
58,
48720,
13,
2389,
60,
198,
220,
220,
220,
220,
220,
220,
220,
2845,
7383,
12331,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5298,
25639,
15878,
12331,
7,
69,
1101,
747,
278,
2214,
1391,
48720,
13,
2389,
92,
11537,
628,
220,
220,
220,
220,
220,
220,
220,
2116,
13557,
6404,
1362,
13,
24442,
10786,
2787,
5165,
8611,
4064,
82,
3256,
4686,
62,
8367,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13557,
9945,
13,
28956,
62,
22105,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
45389,
13,
2389,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4686,
62,
8367,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
5446,
15037,
44710,
62,
25154,
16779,
2849,
198,
220,
220,
220,
220,
220,
220,
220,
1267,
628,
220,
220,
220,
825,
4296,
62,
7645,
2673,
7,
944,
11,
1366,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
10260,
257,
8611,
287,
20613,
416,
1262,
262,
2810,
4686,
290,
1366,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13557,
6404,
1362,
13,
24442,
10786,
929,
38734,
8611,
4064,
82,
351,
4064,
82,
3256,
1366,
13,
312,
11,
1366,
8,
198,
220,
220,
220,
220,
220,
220,
220,
611,
318,
39098,
7,
7890,
11,
45389,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13557,
9945,
13,
19312,
62,
22105,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
45389,
13,
2389,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1366,
13,
312,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1366,
13,
46911,
1096,
22784,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
5446,
15037,
44710,
62,
25154,
16779,
2849,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5298,
17665,
48720,
12331,
10786,
259,
12102,
8611,
2134,
11537,
198
] | 2.198944 | 3,408 |
from algoplex.api.common.exchange_access import ExchangeAccess
from algoplex.api.common.maket_data_subscriber import MarketDataSubscriber
from algoplex.api.order import Order
from algoplex.api.execution import Execution
import time
| [
6738,
435,
70,
643,
87,
13,
15042,
13,
11321,
13,
1069,
3803,
62,
15526,
1330,
12516,
15457,
198,
6738,
435,
70,
643,
87,
13,
15042,
13,
11321,
13,
76,
461,
316,
62,
7890,
62,
7266,
1416,
24735,
1330,
5991,
6601,
7004,
1416,
24735,
198,
6738,
435,
70,
643,
87,
13,
15042,
13,
2875,
1330,
8284,
198,
6738,
435,
70,
643,
87,
13,
15042,
13,
18558,
1009,
1330,
37497,
198,
11748,
640,
628
] | 3.236111 | 72 |
import pytest
import fnmatch
import os
from pathlib import Path
from eobox.sampledata import get_dataset
from eobox.vector import convert_polygons_to_lines
from eobox.vector import calc_distance_to_border
@pytest.fixture
| [
11748,
12972,
9288,
198,
11748,
24714,
15699,
198,
11748,
28686,
198,
6738,
3108,
8019,
1330,
10644,
198,
198,
6738,
304,
672,
1140,
13,
37687,
10137,
1045,
1330,
651,
62,
19608,
292,
316,
198,
6738,
304,
672,
1140,
13,
31364,
1330,
10385,
62,
35428,
70,
684,
62,
1462,
62,
6615,
198,
6738,
304,
672,
1140,
13,
31364,
1330,
42302,
62,
30246,
62,
1462,
62,
20192,
628,
198,
198,
31,
9078,
9288,
13,
69,
9602,
628,
198
] | 3.026667 | 75 |
#x= 'Global x'
print("\nTesting Global and Local Scope")
test()
print(x)
m=min([3,4,5,6])
print(m)
print("\nTesting Enclosing Scope")
outer() | [
2,
87,
28,
705,
22289,
2124,
6,
198,
4798,
7203,
59,
77,
44154,
8060,
290,
10714,
41063,
4943,
198,
9288,
3419,
198,
4798,
7,
87,
8,
198,
198,
76,
28,
1084,
26933,
18,
11,
19,
11,
20,
11,
21,
12962,
198,
4798,
7,
76,
8,
198,
198,
4798,
7203,
59,
77,
44154,
2039,
565,
2752,
41063,
4943,
198,
198,
39605,
3419
] | 2.360656 | 61 |
'''
Created on Sep 29, 2017
@author: Liza Dayoub
'''
import requests
from requests.packages.urllib3 import disable_warnings
from requests.packages.urllib3.exceptions import InsecureRequestWarning
class ApiSession(object):
'''
classdocs
'''
def __init__(self, **kwargs):
'''
Constructor
'''
self.url = kwargs.get('url')
self.username = kwargs.get('username')
self.password = kwargs.get('password')
self.insecure = kwargs.get('insecure') or True
self.auth = kwargs.get('auth') or False
cfg = kwargs.get('cfg')
if cfg:
self.url = cfg.get('url') or self.url
self.url = self.url.strip('/')
self.username = cfg.get('username') or self.username
self.password = cfg.get('password') or self.password
if cfg.get('xpack'):
self.auth = True
if not self.url:
raise AttributeError('URL can not be empty')
self.session = requests.Session()
if self.insecure:
disable_warnings(InsecureRequestWarning)
self.session.verify = False
if self.auth and self.username and self.password:
self.session.auth = (self.username, self.password)
| [
7061,
6,
198,
41972,
319,
8621,
2808,
11,
2177,
198,
198,
31,
9800,
25,
406,
23638,
3596,
12944,
198,
7061,
6,
198,
198,
11748,
7007,
198,
6738,
7007,
13,
43789,
13,
333,
297,
571,
18,
1330,
15560,
62,
40539,
654,
198,
6738,
7007,
13,
43789,
13,
333,
297,
571,
18,
13,
1069,
11755,
1330,
554,
22390,
18453,
20361,
628,
198,
4871,
5949,
72,
36044,
7,
15252,
2599,
198,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
1398,
31628,
198,
220,
220,
220,
705,
7061,
628,
220,
220,
220,
825,
11593,
15003,
834,
7,
944,
11,
12429,
46265,
22046,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
220,
220,
220,
220,
28407,
273,
198,
220,
220,
220,
220,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
6371,
796,
479,
86,
22046,
13,
1136,
10786,
6371,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
29460,
796,
479,
86,
22046,
13,
1136,
10786,
29460,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
28712,
796,
479,
86,
22046,
13,
1136,
10786,
28712,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
259,
22390,
796,
479,
86,
22046,
13,
1136,
10786,
259,
22390,
11537,
393,
6407,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
18439,
796,
479,
86,
22046,
13,
1136,
10786,
18439,
11537,
393,
10352,
628,
220,
220,
220,
220,
220,
220,
220,
30218,
70,
796,
479,
86,
22046,
13,
1136,
10786,
37581,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
611,
30218,
70,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
6371,
796,
30218,
70,
13,
1136,
10786,
6371,
11537,
393,
2116,
13,
6371,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
6371,
796,
2116,
13,
6371,
13,
36311,
10786,
14,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
29460,
796,
30218,
70,
13,
1136,
10786,
29460,
11537,
393,
2116,
13,
29460,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
28712,
796,
30218,
70,
13,
1136,
10786,
28712,
11537,
393,
2116,
13,
28712,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
30218,
70,
13,
1136,
10786,
87,
8002,
6,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
18439,
796,
6407,
628,
220,
220,
220,
220,
220,
220,
220,
611,
407,
2116,
13,
6371,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5298,
3460,
4163,
12331,
10786,
21886,
460,
407,
307,
6565,
11537,
628,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
29891,
796,
7007,
13,
36044,
3419,
628,
220,
220,
220,
220,
220,
220,
220,
611,
2116,
13,
259,
22390,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
15560,
62,
40539,
654,
7,
818,
22390,
18453,
20361,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
29891,
13,
332,
1958,
796,
10352,
198,
220,
220,
220,
220,
220,
220,
220,
611,
2116,
13,
18439,
290,
2116,
13,
29460,
290,
2116,
13,
28712,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
29891,
13,
18439,
796,
357,
944,
13,
29460,
11,
2116,
13,
28712,
8,
198
] | 2.223386 | 573 |
# Entry Point #######################################################
lengths = list(map(int, open('day10.txt').read().split(',')))
string = hash(256, lengths)
print(string[0] * string[1]) # = 46600
| [
198,
2,
21617,
6252,
1303,
29113,
14468,
4242,
2235,
198,
198,
13664,
82,
796,
1351,
7,
8899,
7,
600,
11,
1280,
10786,
820,
940,
13,
14116,
27691,
961,
22446,
35312,
7,
41707,
22305,
198,
8841,
796,
12234,
7,
11645,
11,
20428,
8,
198,
198,
4798,
7,
8841,
58,
15,
60,
1635,
4731,
58,
16,
12962,
1303,
796,
604,
2791,
405,
198
] | 3.311475 | 61 |
import os
import subprocess
import sys
import git
from tools.config import Config
from tools.logger import log_error, log_info
def exit_if_not_executed_in_ide_environment():
'''This part checks if environment variables is set or not.'''
if not ("OSSRH_USER" and "OSSRH_PASSWD" and "GPG_SIGNING_PASSWD" and "BINTRAY_USER" and "BINTRAY_TOKEN") in os.environ:
log_error("Please use CobiGen IDE initialized console and set the variables OSSRH_USER, OSSRH_PASSWD, GPG_SIGNING_PASSWD, BINTRAY_USER, and BINTRAY_TOKEN in the variables-customized.bat.")
sys.exit()
def is_valid_branch(config: Config) -> bool:
'''This Method is responsible for checking branches in repository with branch entered by user'''
if git.cmd.Git(config.root_path).execute(
["git", "ls-remote", "--heads", "origin", config.branch_to_be_released, "|", "wc", "-l"]) == "":
log_info("Branch is not known remotely.")
is_branch_valid = False
else:
log_info("Branch is valid.")
is_branch_valid = True
return is_branch_valid
| [
11748,
28686,
198,
11748,
850,
14681,
198,
11748,
25064,
198,
198,
11748,
17606,
198,
198,
6738,
4899,
13,
11250,
1330,
17056,
198,
6738,
4899,
13,
6404,
1362,
1330,
2604,
62,
18224,
11,
2604,
62,
10951,
628,
198,
4299,
8420,
62,
361,
62,
1662,
62,
18558,
7241,
62,
259,
62,
485,
62,
38986,
33529,
198,
220,
220,
220,
705,
7061,
1212,
636,
8794,
611,
2858,
9633,
318,
900,
393,
407,
2637,
7061,
198,
220,
220,
220,
611,
407,
5855,
2640,
12562,
39,
62,
29904,
1,
290,
366,
2640,
12562,
39,
62,
47924,
22332,
1,
290,
366,
38,
6968,
62,
50,
3528,
15871,
62,
47924,
22332,
1,
290,
366,
33,
12394,
30631,
62,
29904,
1,
290,
366,
33,
12394,
30631,
62,
10468,
43959,
4943,
287,
28686,
13,
268,
2268,
25,
198,
220,
220,
220,
220,
220,
220,
220,
2604,
62,
18224,
7203,
5492,
779,
327,
13411,
13746,
33497,
23224,
8624,
290,
900,
262,
9633,
440,
5432,
48587,
62,
29904,
11,
440,
5432,
48587,
62,
47924,
22332,
11,
402,
6968,
62,
50,
3528,
15871,
62,
47924,
22332,
11,
347,
12394,
30631,
62,
29904,
11,
290,
347,
12394,
30631,
62,
10468,
43959,
287,
262,
9633,
12,
23144,
1143,
13,
8664,
19570,
198,
220,
220,
220,
220,
220,
220,
220,
25064,
13,
37023,
3419,
628,
198,
4299,
318,
62,
12102,
62,
1671,
3702,
7,
11250,
25,
17056,
8,
4613,
20512,
25,
198,
220,
220,
220,
705,
7061,
1212,
11789,
318,
4497,
329,
10627,
13737,
287,
16099,
351,
8478,
5982,
416,
2836,
7061,
6,
628,
220,
220,
220,
611,
17606,
13,
28758,
13,
38,
270,
7,
11250,
13,
15763,
62,
6978,
737,
41049,
7,
198,
220,
220,
220,
220,
220,
220,
220,
14631,
18300,
1600,
366,
7278,
12,
47960,
1600,
366,
438,
16600,
1600,
366,
47103,
1600,
4566,
13,
1671,
3702,
62,
1462,
62,
1350,
62,
30147,
11,
366,
91,
1600,
366,
86,
66,
1600,
27444,
75,
8973,
8,
6624,
366,
1298,
198,
220,
220,
220,
220,
220,
220,
220,
2604,
62,
10951,
7203,
33,
25642,
318,
407,
1900,
19863,
19570,
198,
220,
220,
220,
220,
220,
220,
220,
318,
62,
1671,
3702,
62,
12102,
796,
10352,
198,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
2604,
62,
10951,
7203,
33,
25642,
318,
4938,
19570,
198,
220,
220,
220,
220,
220,
220,
220,
318,
62,
1671,
3702,
62,
12102,
796,
6407,
198,
220,
220,
220,
1441,
318,
62,
1671,
3702,
62,
12102,
628,
198
] | 2.665012 | 403 |
#!/usr/bin/env python
from flask import Flask, request, jsonify
import numpy as np
import deco
import requests
import csv
import json
import argparse
parser = argparse.ArgumentParser(description='Exports keras model to serving format')
parser.add_argument('--port', action="store", dest="port", default=4000)
parser.add_argument('--vocab_path', action="store", dest="vocab_path")
parser.add_argument('--model_path', action="store", dest="model_path")
parser.add_argument('--serving_url', action="store", dest="serving_url")
parser.add_argument('--static_folder', action="store", dest="static_folder", default="./static")
args = parser.parse_args()
tokenizer = deco.tokenizers.SentencepieceTokenizer(args.vocab_path, args.model_path)
app = Flask(__name__, static_folder=args.static_folder', static_url_path="/static")
SEQ_LEN = 128
@app.route('/predict', methods=['POST'])
if __name__ == '__main__':
app.run(host= '0.0.0.0',debug=True,port=args.port)
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
6738,
42903,
1330,
46947,
11,
2581,
11,
33918,
1958,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
875,
78,
198,
11748,
7007,
198,
11748,
269,
21370,
198,
11748,
33918,
198,
11748,
1822,
29572,
198,
198,
48610,
796,
1822,
29572,
13,
28100,
1713,
46677,
7,
11213,
11639,
3109,
3742,
41927,
292,
2746,
284,
7351,
5794,
11537,
198,
48610,
13,
2860,
62,
49140,
10786,
438,
634,
3256,
2223,
2625,
8095,
1600,
2244,
2625,
634,
1600,
4277,
28,
27559,
8,
198,
48610,
13,
2860,
62,
49140,
10786,
438,
18893,
397,
62,
6978,
3256,
2223,
2625,
8095,
1600,
2244,
2625,
18893,
397,
62,
6978,
4943,
198,
48610,
13,
2860,
62,
49140,
10786,
438,
19849,
62,
6978,
3256,
2223,
2625,
8095,
1600,
2244,
2625,
19849,
62,
6978,
4943,
198,
48610,
13,
2860,
62,
49140,
10786,
438,
31293,
62,
6371,
3256,
2223,
2625,
8095,
1600,
2244,
2625,
31293,
62,
6371,
4943,
198,
48610,
13,
2860,
62,
49140,
10786,
438,
12708,
62,
43551,
3256,
2223,
2625,
8095,
1600,
2244,
2625,
12708,
62,
43551,
1600,
4277,
28,
1911,
14,
12708,
4943,
198,
198,
22046,
796,
30751,
13,
29572,
62,
22046,
3419,
198,
198,
30001,
7509,
796,
875,
78,
13,
30001,
11341,
13,
31837,
594,
12239,
30642,
7509,
7,
22046,
13,
18893,
397,
62,
6978,
11,
26498,
13,
19849,
62,
6978,
8,
198,
198,
1324,
796,
46947,
7,
834,
3672,
834,
11,
9037,
62,
43551,
28,
22046,
13,
12708,
62,
43551,
3256,
9037,
62,
6371,
62,
6978,
35922,
12708,
4943,
198,
5188,
48,
62,
43,
1677,
796,
13108,
198,
198,
31,
1324,
13,
38629,
10786,
14,
79,
17407,
3256,
5050,
28,
17816,
32782,
6,
12962,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
598,
13,
5143,
7,
4774,
28,
705,
15,
13,
15,
13,
15,
13,
15,
3256,
24442,
28,
17821,
11,
634,
28,
22046,
13,
634,
8,
198
] | 3.028391 | 317 |
import csv
import time
import json
import requests
import urllib3
import importlib
import sys
import copy
import arrow
import os
import pytz
import configparser
MAX_RETRY_NUM = 10
RETRY_WAIT_TIME_IN_SEC = 30
MAX_MESSAGE_LENGTH = 10000
MAX_DATA_SIZE = 4000000
MAX_PACKET_SIZE = 5000000
def send_data(log_data):
""" Sends parsed metric data to InsightFinder """
send_data_time = time.time()
# prepare data for metric streaming agent
to_send_data_dict = {"metricData": json.dumps(log_data),
"licenseKey": config_vars['license_key'],
"projectName": config_vars['project_name'],
"userName": config_vars['user_name'],
"agentType": "LogFileReplay"}
to_send_data_json = json.dumps(to_send_data_dict)
# send the data
post_url = config_vars['server_url'] + "/customprojectrawdata"
send_data_to_receiver(post_url, to_send_data_json, len(log_data))
print("--- Send data time: %s seconds ---" + str(time.time() - send_data_time))
if __name__ == "__main__":
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
importlib.reload(sys)
CHUNK_SIZE = 1000
config_vars, csv_vars = get_agent_config_vars()
omit = csv_vars['omit_columns']
with open(config_vars['file_name'], encoding='utf-8') as csvfile:
data = []
count = 0
size = 0
reader = csv.DictReader(csvfile)
for row in reader:
entry = {}
entry['tag'] = row[csv_vars['instance_field']]
timestamp = arrow.get(row[csv_vars['timestamp_field']], csv_vars['timestamp_format'], tzinfo=csv_vars['timestamp_timezone'])
# convert timezone to utc required by api
timestamp = timestamp.to(pytz.utc)
entry['eventId'] = timestamp.timestamp() * 1000
entry['data'] = {}
for header in row:
if header not in omit:
entry['data'][header] = row[header]
new_entry = copy.deepcopy(entry)
# Check length of log message and truncate if too long
if len(new_entry['data']) > MAX_MESSAGE_LENGTH:
new_entry['data'] = new_entry['data'][0:MAX_MESSAGE_LENGTH - 1]
# Check size of entry and overall packet size
entry_size = sys.getsizeof(json.dumps(new_entry))
if size + entry_size >= MAX_DATA_SIZE:
send_data(data)
size = 0
count = 0
data = []
# Add the log entry to send
data.append(new_entry)
size += entry_size
count += 1
# Chunk number of log entries
if count >= CHUNK_SIZE:
send_data(data)
size = 0
count = 0
data = []
if count != 0:
send_data(data)
| [
11748,
269,
21370,
198,
11748,
640,
198,
11748,
33918,
198,
11748,
7007,
198,
11748,
2956,
297,
571,
18,
198,
11748,
1330,
8019,
198,
11748,
25064,
198,
11748,
4866,
198,
11748,
15452,
198,
11748,
28686,
198,
11748,
12972,
22877,
198,
11748,
4566,
48610,
198,
198,
22921,
62,
2200,
40405,
62,
41359,
796,
838,
198,
2200,
40405,
62,
15543,
2043,
62,
34694,
62,
1268,
62,
23683,
796,
1542,
198,
22921,
62,
44,
1546,
4090,
8264,
62,
43,
49494,
796,
33028,
198,
22921,
62,
26947,
62,
33489,
796,
604,
10535,
198,
22921,
62,
47,
8120,
2767,
62,
33489,
796,
642,
10535,
198,
198,
4299,
3758,
62,
7890,
7,
6404,
62,
7890,
2599,
198,
220,
220,
220,
37227,
311,
2412,
44267,
18663,
1366,
284,
39917,
37,
5540,
37227,
198,
220,
220,
220,
3758,
62,
7890,
62,
2435,
796,
640,
13,
2435,
3419,
198,
220,
220,
220,
1303,
8335,
1366,
329,
18663,
11305,
5797,
198,
220,
220,
220,
284,
62,
21280,
62,
7890,
62,
11600,
796,
19779,
4164,
1173,
6601,
1298,
33918,
13,
67,
8142,
7,
6404,
62,
7890,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
43085,
9218,
1298,
4566,
62,
85,
945,
17816,
43085,
62,
2539,
6,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
16302,
5376,
1298,
4566,
62,
85,
945,
17816,
16302,
62,
3672,
6,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
7220,
5376,
1298,
4566,
62,
85,
945,
17816,
7220,
62,
3672,
6,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
25781,
6030,
1298,
366,
11187,
8979,
3041,
1759,
20662,
198,
220,
220,
220,
284,
62,
21280,
62,
7890,
62,
17752,
796,
33918,
13,
67,
8142,
7,
1462,
62,
21280,
62,
7890,
62,
11600,
8,
628,
220,
220,
220,
1303,
3758,
262,
1366,
198,
220,
220,
220,
1281,
62,
6371,
796,
4566,
62,
85,
945,
17816,
15388,
62,
6371,
20520,
1343,
12813,
23144,
16302,
1831,
7890,
1,
198,
220,
220,
220,
3758,
62,
7890,
62,
1462,
62,
260,
39729,
7,
7353,
62,
6371,
11,
284,
62,
21280,
62,
7890,
62,
17752,
11,
18896,
7,
6404,
62,
7890,
4008,
198,
220,
220,
220,
3601,
7203,
6329,
16290,
1366,
640,
25,
4064,
82,
4201,
11420,
1,
1343,
965,
7,
2435,
13,
2435,
3419,
532,
3758,
62,
7890,
62,
2435,
4008,
628,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
2956,
297,
571,
18,
13,
40223,
62,
40539,
654,
7,
333,
297,
571,
18,
13,
1069,
11755,
13,
818,
22390,
18453,
20361,
8,
198,
220,
220,
220,
1330,
8019,
13,
260,
2220,
7,
17597,
8,
198,
220,
220,
220,
5870,
4944,
42,
62,
33489,
796,
8576,
198,
220,
220,
220,
4566,
62,
85,
945,
11,
269,
21370,
62,
85,
945,
796,
651,
62,
25781,
62,
11250,
62,
85,
945,
3419,
198,
220,
220,
220,
42848,
796,
269,
21370,
62,
85,
945,
17816,
296,
270,
62,
28665,
82,
20520,
198,
220,
220,
220,
351,
1280,
7,
11250,
62,
85,
945,
17816,
7753,
62,
3672,
6,
4357,
21004,
11639,
40477,
12,
23,
11537,
355,
269,
21370,
7753,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1366,
796,
17635,
198,
220,
220,
220,
220,
220,
220,
220,
954,
796,
657,
198,
220,
220,
220,
220,
220,
220,
220,
2546,
796,
657,
198,
220,
220,
220,
220,
220,
220,
220,
9173,
796,
269,
21370,
13,
35,
713,
33634,
7,
40664,
7753,
8,
198,
220,
220,
220,
220,
220,
220,
220,
329,
5752,
287,
9173,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5726,
796,
23884,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5726,
17816,
12985,
20520,
796,
5752,
58,
40664,
62,
85,
945,
17816,
39098,
62,
3245,
6,
11907,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41033,
796,
15452,
13,
1136,
7,
808,
58,
40664,
62,
85,
945,
17816,
16514,
27823,
62,
3245,
20520,
4357,
269,
21370,
62,
85,
945,
17816,
16514,
27823,
62,
18982,
6,
4357,
256,
89,
10951,
28,
40664,
62,
85,
945,
17816,
16514,
27823,
62,
2435,
11340,
6,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
10385,
640,
11340,
284,
3384,
66,
2672,
416,
40391,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41033,
796,
41033,
13,
1462,
7,
9078,
22877,
13,
315,
66,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5726,
17816,
15596,
7390,
20520,
796,
41033,
13,
16514,
27823,
3419,
1635,
8576,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5726,
17816,
7890,
20520,
796,
23884,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
13639,
287,
5752,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
13639,
407,
287,
42848,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5726,
17816,
7890,
6,
7131,
25677,
60,
796,
5752,
58,
25677,
60,
198,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
649,
62,
13000,
796,
4866,
13,
22089,
30073,
7,
13000,
8,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
6822,
4129,
286,
2604,
3275,
290,
40122,
378,
611,
1165,
890,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
18896,
7,
3605,
62,
13000,
17816,
7890,
6,
12962,
1875,
25882,
62,
44,
1546,
4090,
8264,
62,
43,
49494,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
649,
62,
13000,
17816,
7890,
20520,
796,
649,
62,
13000,
17816,
7890,
6,
7131,
15,
25,
22921,
62,
44,
1546,
4090,
8264,
62,
43,
49494,
532,
352,
60,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
6822,
2546,
286,
5726,
290,
4045,
19638,
2546,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5726,
62,
7857,
796,
25064,
13,
11407,
1096,
1659,
7,
17752,
13,
67,
8142,
7,
3605,
62,
13000,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
2546,
1343,
5726,
62,
7857,
18189,
25882,
62,
26947,
62,
33489,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3758,
62,
7890,
7,
7890,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2546,
796,
657,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
954,
796,
657,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1366,
796,
17635,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
3060,
262,
2604,
5726,
284,
3758,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1366,
13,
33295,
7,
3605,
62,
13000,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2546,
15853,
5726,
62,
7857,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
954,
15853,
352,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
609,
2954,
1271,
286,
2604,
12784,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
954,
18189,
5870,
4944,
42,
62,
33489,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3758,
62,
7890,
7,
7890,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2546,
796,
657,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
954,
796,
657,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1366,
796,
17635,
198,
220,
220,
220,
220,
220,
220,
220,
611,
954,
14512,
657,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3758,
62,
7890,
7,
7890,
8,
628
] | 2.069817 | 1,418 |
import pytest
@pytest.mark.skip('not implemented')
| [
11748,
12972,
9288,
628,
198,
31,
9078,
9288,
13,
4102,
13,
48267,
10786,
1662,
9177,
11537,
198
] | 3.117647 | 17 |
# -*-coding:utf-8 -*-
"""
一个函数包括输入参数和输出参数
"""
# 定义函数
# 调用函数
result = calulus(2)
print(result)
# 参数必须要正确地写入函数中,函数的参数也可以为多个
def fruit_function(fruit1, fruit2):
"""
fruits = fruit1 + " " + fruit2
return fruits
"""
lst = [];
lst.append(fruit1)
lst.append(fruit2)
return lst
# 调用函数
result = fruit_function("apple", "banana")
print(result)
# 取绝对值
# 调用函数
my_abs(-1)
# 空函数
# 返回多个值,函数可以返回多个值吗?答案是肯定的额
import math
x, y = move(100, 100, 60, math.pi / 6)
print(x, y)
r = move(100, 100, 60, math.pi / 6)
print(r)
# 乘方
# 调用函数
print("2^5:%d" % power(2, 5))
print(add_end())
# 函数的参数改为可变参数
print(calc(1, 2, 3, 4, 5, 6))
nums = [1, 2, 3]
print(calc(*nums))
person('Michael', 30)
person('Bob', 35, city='Beijing')
person('Adam', 45, gender='M', job='Engineer')
# *args是可变参数,args接收的是一个tuple;
# **kw是关键字参数,kw接收的是一个dict
func(1, 2)
func(1, 2, c=3)
func(1, 2, 3, 'a', 'b')
func(1, 2, 3, 'a', 'b', x=99)
args = (1, 2, 3, 4, 5)
kw = {'x': 99}
func(*args, **kw)
# 递归函数
print("5!=%d" %fact(5))
# 尾递归优化
# 列表,偶数在前,奇数在后
A = [3,1,2,4]
print(sortArrayByParity(A))
| [
2,
532,
9,
12,
66,
7656,
25,
40477,
12,
23,
532,
9,
12,
198,
198,
37811,
198,
31660,
10310,
103,
49035,
121,
46763,
108,
44293,
227,
162,
233,
105,
164,
122,
241,
17739,
98,
20998,
224,
46763,
108,
161,
240,
234,
164,
122,
241,
49035,
118,
20998,
224,
46763,
108,
198,
37811,
628,
198,
2,
10263,
106,
248,
20046,
231,
49035,
121,
46763,
108,
628,
198,
2,
5525,
108,
225,
18796,
101,
49035,
121,
46763,
108,
198,
20274,
796,
2386,
23515,
7,
17,
8,
198,
4798,
7,
20274,
8,
628,
198,
2,
10263,
237,
224,
46763,
108,
33232,
227,
165,
94,
119,
17358,
223,
29826,
96,
163,
94,
106,
28839,
108,
37863,
247,
17739,
98,
49035,
121,
46763,
108,
40792,
171,
120,
234,
49035,
121,
46763,
108,
21410,
20998,
224,
46763,
108,
20046,
253,
20998,
107,
20015,
98,
10310,
118,
13783,
248,
10310,
103,
198,
4299,
8234,
62,
8818,
7,
34711,
16,
11,
8234,
17,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
15921,
796,
8234,
16,
1343,
366,
366,
1343,
8234,
17,
198,
220,
220,
220,
1441,
15921,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
300,
301,
796,
25787,
198,
220,
220,
220,
300,
301,
13,
33295,
7,
34711,
16,
8,
198,
220,
220,
220,
300,
301,
13,
33295,
7,
34711,
17,
8,
198,
220,
220,
220,
1441,
300,
301,
628,
198,
2,
5525,
108,
225,
18796,
101,
49035,
121,
46763,
108,
198,
20274,
796,
8234,
62,
8818,
7203,
18040,
1600,
366,
3820,
2271,
4943,
198,
4798,
7,
20274,
8,
628,
198,
2,
10263,
237,
244,
163,
119,
251,
43380,
117,
161,
222,
120,
628,
198,
2,
5525,
108,
225,
18796,
101,
49035,
121,
46763,
108,
198,
1820,
62,
8937,
32590,
16,
8,
628,
198,
2,
13328,
102,
118,
49035,
121,
46763,
108,
628,
198,
2,
5525,
123,
242,
32368,
252,
13783,
248,
10310,
103,
161,
222,
120,
171,
120,
234,
49035,
121,
46763,
108,
20998,
107,
20015,
98,
32573,
242,
32368,
252,
13783,
248,
10310,
103,
161,
222,
120,
28938,
245,
171,
120,
253,
163,
18433,
162,
94,
230,
42468,
164,
224,
107,
22522,
248,
21410,
165,
95,
251,
198,
11748,
10688,
628,
198,
198,
87,
11,
331,
796,
1445,
7,
3064,
11,
1802,
11,
3126,
11,
10688,
13,
14415,
1220,
718,
8,
198,
4798,
7,
87,
11,
331,
8,
198,
81,
796,
1445,
7,
3064,
11,
1802,
11,
3126,
11,
10688,
13,
14415,
1220,
718,
8,
198,
4798,
7,
81,
8,
628,
198,
2,
220,
20046,
246,
43095,
628,
198,
2,
5525,
108,
225,
18796,
101,
49035,
121,
46763,
108,
198,
4798,
7203,
17,
61,
20,
25,
4,
67,
1,
4064,
1176,
7,
17,
11,
642,
4008,
628,
198,
198,
4798,
7,
2860,
62,
437,
28955,
628,
198,
2,
10263,
229,
121,
46763,
108,
21410,
20998,
224,
46763,
108,
162,
242,
117,
10310,
118,
20998,
107,
20998,
246,
20998,
224,
46763,
108,
628,
198,
4798,
7,
9948,
66,
7,
16,
11,
362,
11,
513,
11,
604,
11,
642,
11,
718,
4008,
198,
77,
5700,
796,
685,
16,
11,
362,
11,
513,
60,
198,
4798,
7,
9948,
66,
46491,
77,
5700,
4008,
628,
198,
198,
6259,
10786,
13256,
3256,
1542,
8,
198,
6259,
10786,
18861,
3256,
3439,
11,
1748,
11639,
3856,
11030,
11537,
198,
6259,
10786,
23159,
3256,
4153,
11,
5279,
11639,
44,
3256,
1693,
11639,
13798,
263,
11537,
628,
198,
2,
1635,
22046,
42468,
20998,
107,
20998,
246,
20998,
224,
46763,
108,
171,
120,
234,
22046,
162,
236,
98,
162,
242,
114,
21410,
42468,
31660,
10310,
103,
83,
29291,
26,
198,
2,
12429,
46265,
42468,
17739,
111,
165,
242,
106,
27764,
245,
20998,
224,
46763,
108,
11,
46265,
162,
236,
98,
162,
242,
114,
21410,
42468,
31660,
10310,
103,
11600,
628,
198,
20786,
7,
16,
11,
362,
8,
198,
20786,
7,
16,
11,
362,
11,
269,
28,
18,
8,
198,
20786,
7,
16,
11,
362,
11,
513,
11,
705,
64,
3256,
705,
65,
11537,
198,
20786,
7,
16,
11,
362,
11,
513,
11,
705,
64,
3256,
705,
65,
3256,
2124,
28,
2079,
8,
198,
198,
22046,
796,
357,
16,
11,
362,
11,
513,
11,
604,
11,
642,
8,
198,
46265,
796,
1391,
6,
87,
10354,
7388,
92,
198,
20786,
46491,
22046,
11,
12429,
46265,
8,
628,
198,
2,
16268,
222,
240,
37605,
240,
49035,
121,
46763,
108,
198,
4798,
7203,
20,
0,
28,
4,
67,
1,
4064,
22584,
7,
20,
4008,
198,
198,
2,
10263,
108,
122,
34460,
240,
37605,
240,
27670,
246,
44293,
244,
198,
198,
2,
10263,
230,
245,
26193,
101,
171,
120,
234,
161,
223,
35050,
243,
108,
28839,
101,
30298,
235,
171,
120,
234,
25001,
229,
46763,
108,
28839,
101,
28938,
236,
198,
198,
32,
796,
685,
18,
11,
16,
11,
17,
11,
19,
60,
198,
4798,
7,
30619,
19182,
3886,
47,
6806,
7,
32,
4008,
198
] | 1.388471 | 798 |
from . import class_
| [
6738,
764,
1330,
1398,
62,
628
] | 3.666667 | 6 |
#
# 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 aodhclient import client as ac
from aodhclient import exceptions
from heat.engine.clients import client_plugin
CLIENT_NAME = 'aodh'
| [
2,
198,
2,
220,
220,
220,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
345,
743,
198,
2,
220,
220,
220,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
921,
743,
7330,
198,
2,
220,
220,
220,
257,
4866,
286,
262,
13789,
379,
198,
2,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
2638,
1378,
2503,
13,
43073,
13,
2398,
14,
677,
4541,
14,
43,
2149,
24290,
12,
17,
13,
15,
198,
2,
198,
2,
220,
220,
220,
17486,
2672,
416,
9723,
1099,
393,
4987,
284,
287,
3597,
11,
3788,
198,
2,
220,
220,
220,
9387,
739,
262,
13789,
318,
9387,
319,
281,
366,
1921,
3180,
1,
29809,
1797,
11,
42881,
198,
2,
220,
220,
220,
34764,
11015,
6375,
7102,
49828,
11053,
3963,
15529,
509,
12115,
11,
2035,
4911,
393,
17142,
13,
4091,
262,
198,
2,
220,
220,
220,
13789,
329,
262,
2176,
3303,
15030,
21627,
290,
11247,
198,
2,
220,
220,
220,
739,
262,
13789,
13,
198,
198,
6738,
257,
375,
71,
16366,
1330,
5456,
355,
936,
198,
6738,
257,
375,
71,
16366,
1330,
13269,
198,
198,
6738,
4894,
13,
18392,
13,
565,
2334,
1330,
5456,
62,
33803,
198,
198,
5097,
28495,
62,
20608,
796,
705,
64,
375,
71,
6,
628
] | 3.341121 | 214 |
#!/usr/bin/env python3
import argparse
import asyncio
import json
import logging
import os
import socket
import ssl
import sys
import time
from queue import Queue
import paho.mqtt.client as mqtt
SERVER_ADDRESS = ('localhost', 2598)
# Logging Configuration
logging.basicConfig(level=logging.INFO, stream=sys.stdout)
logger = logging.getLogger(__name__)
handler = logging.FileHandler('n2kparserlite.log')
handler.setLevel(logging.ERROR)
formatter = logging.Formatter('%(asctime)s-%(name)s-%(message)s')
handler.setFormatter(formatter)
logger.addHandler(handler)
# AsyncIO Event Loop
event_loop = asyncio.get_event_loop()
CONFIG = dict()
DEVICE_NAME = ''
DEVICE_ID = ''
INFLUX_SOCKET = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
PAYLOAD_QUEUE = Queue(maxsize=50)
def on_connect(mqttc, obj, flags, rc):
"""MQTT Callback Function upon connecting to MQTT Broker"""
if rc == 0:
logger.debug("MQTT CONNECT rc: " + str(rc))
logger.info("Succesfully Connected to MQTT Broker")
def on_publish(mqttc, obj, mid):
"""MQTT Callback Function upon publishing to MQTT Broker"""
logger.debug("MQTT PUBLISH: mid: " + str(mid))
def on_disconnect(mqttc, obj, rc):
"""MQTT Callback Fucntion upon diconnecting from Broker"""
if rc == 0:
logger.debug("MQTT DISCONNECTED: rc: " + str(rc))
logger.debug("Disconnected Successfully from MQTT Broker")
def setup_mqtt_client(mqtt_conf, mqtt_client):
"""Configure MQTT Client based on Configuration"""
if mqtt_conf['TLS']['enable']:
logger.info("TLS Setup for Broker")
logger.info("checking TLS_Version")
tls = mqtt_conf['TLS']['tls_version']
if tls == 'tlsv1.2':
tlsVersion = ssl.PROTOCOL_TLSv1_2
elif tls == "tlsv1.1":
tlsVersion = ssl.PROTOCOL_TLSv1_1
elif tls == "tlsv1":
tlsVersion = ssl.PROTOCOL_TLSv1
else:
logger.info("Unknown TLS version - ignoring")
tlsVersion = None
if not mqtt_conf['TLS']['insecure']:
logger.info("Searching for Certificates in certdir")
CERTS_DIR = mqtt_conf['TLS']['certs']['certdir']
if os.path.isdir(CERTS_DIR):
logger.info("certdir exists")
CA_CERT_FILE = os.path.join(CERTS_DIR, mqtt_conf['TLS']['certs']['cafile'])
CERT_FILE = os.path.join(CERTS_DIR, mqtt_conf['TLS']['certs']['certfile'])
KEY_FILE = os.path.join(CERTS_DIR, mqtt_conf['TLS']['certs']['keyfile'])
mqtt_client.tls_set(ca_certs=CA_CERT_FILE, certfile=CERT_FILE, keyfile=KEY_FILE, cert_reqs=ssl.CERT_REQUIRED, tls_version=tlsVersion)
else:
logger.error("certdir does not exist.. check path")
sys.exit()
else:
mqtt_client.tls_set(ca_certs=None, certfile=None, keyfile=None, cert_reqs=ssl.CERT_NONE, tls_version=tlsVersion)
mqtt_client.tls_insecure_set(True)
if mqtt_conf['username'] and mqtt_conf['password']:
logger.info("setting username and password for Broker")
mqtt_client.username_pw_set(mqtt_conf['username'], mqtt_conf['password'])
return mqtt_client
async def nmea2k_stream_client(address, nmea2k_conf, mqttc):
"""Stream Client for reading incoming NMEA2000 Data"""
global PAYLOAD_QUEUE
PGNS = list(map(int, nmea2k_conf['pgnConfigs'].keys()))
logger.debug('STREAM-CLIENT: Connecting To {} Port {}'.format(*address))
reader, _ = await asyncio.open_connection(*address)
logger.info('STREAM-CLIENT: Reading from N2KD Stream Server')
mqttc.loop_start()
while True:
try:
data = await reader.readuntil(separator=b'\n')
if data:
raw_data = data.decode().split('\n')[0]
nmea2k_data = json.loads(raw_data)
del nmea2k_data['prio']
del nmea2k_data['dst']
if nmea2k_data['pgn'] in PGNS:
logger.debug('STREAM-CLIENT:[PGN:{}] Description: {}'.format(nmea2k_data['pgn'], nmea2k_data['description']))
# logger.debug(nmea2k_data)
if 'fromSource' in list(nmea2k_conf['pgnConfigs'][str(nmea2k_data['pgn'])].keys()):
logger.info('STREAM-CLIENT:[PGN:{}] PGN Source Filter for {} ,SOURCE: {}'.format(
nmea2k_data['pgn'],
nmea2k_data['description'],
nmea2k_data['src'],
))
if nmea2k_data['src'] != nmea2k_conf['pgnConfigs'][str(nmea2k_data['pgn'])]['fromSource']:
logger.info('STREAM-CLIENT:[PGN:{}] Skipping data: {} With SRC: {}'.format(
nmea2k_data['pgn'],
nmea2k_data['description'],
nmea2k_data['src'],
))
continue
# go to next incoming data
# Create a set of all available fields from the incoming frame
incoming_fields = set(nmea2k_data['fields'].keys())
fields_from_conf = set(nmea2k_conf['pgnConfigs'][str(nmea2k_data['pgn'])]['fieldLabels'])
logger.debug(f'STREAM-CLIENT: Fields To Log: {fields_from_conf.intersection(incoming_fields)}')
try:
for selected_field in fields_from_conf.intersection(incoming_fields):
if isinstance(nmea2k_data['fields'][selected_field], str):
lineproto_payload = '{},src=nmea2k,pgnSrc={} {}="{}" {}\n'.format(
nmea2k_data['description'].replace(" ", "").lower(),
nmea2k_data['src'],
selected_field.replace(" ", "").lower(),
nmea2k_data['fields'][selected_field],
time.time_ns(),
)
else:
lineproto_payload = '{},src=nmea2k,pgnSrc={} {}={} {}\n'.format(
nmea2k_data['description'].replace(" ", "").lower(),
nmea2k_data['src'],
selected_field.replace(" ", "").lower(),
nmea2k_data['fields'][selected_field],
time.time_ns(),
)
if PAYLOAD_QUEUE.full():
logger.info('STREAM-CLIENT: Queue Full -> Publish Data')
hf_task = asyncio.create_task(send_data(mqttc))
await hf_task
else:
# logger.info('STREAM-CLIENT: Pushing data to Payload Queue')
PAYLOAD_QUEUE.put_nowait(lineproto_payload)
except Exception as e:
logger.error(e)
else:
log.error('STREAM-CLIENT: No Data')
return
time.sleep(0.1)
except Exception as e:
logger.error(e)
logger.error('Error during Stream Reading')
break
mqttc.loop_stop()
def parse_args():
"""Parse Arguments for configuration file"""
parser = argparse.ArgumentParser(description='CLI to store Actisense-NGT Gateway values to InfluxDB and publish via MQTT')
parser.add_argument('--config', '-c', type=str, required=True, help='JSON configuraton file with path')
return parser.parse_args()
def main():
"""Initialization"""
args = parse_args()
if not os.path.isfile(args.config):
logger.error("configuration file not readable. Check path to configuration file")
sys.exit()
global CONFIG
with open(args.config, 'r') as config_file:
CONFIG = json.load(config_file)
global DEVICE_NAME, DEVICE_ID
DEVICE_NAME = CONFIG['device']['name']
DEVICE_ID = CONFIG['device']['ID']
MQTT_CONF = CONFIG['mqtt']
NMEA2K_CONF = CONFIG['nmea2k']
mqttc = mqtt.Client(client_id=f'{DEVICE_NAME}/{DEVICE_ID}-NMEA2K')
mqttc = setup_mqtt_client(MQTT_CONF, mqttc)
mqttc.on_connect = on_connect
mqttc.on_publish = on_publish
mqttc.on_disconnect = on_disconnect
mqttc.connect(CONFIG['mqtt']['broker'], CONFIG['mqtt']['port'])
logger.info('AsyncIO - Event Loop - Start reading from Stream Server')
try:
event_loop.run_until_complete(
nmea2k_stream_client(
SERVER_ADDRESS,
NMEA2K_CONF,
mqttc
)
)
except KeyboardInterrupt:
logger.exception('CTRL+C Pressed')
pass
finally:
mqttc.disconnect()
logger.info('closing event loop')
PAYLOAD_QUEUE.queue.clear()
event_loop.close()
if __name__ == "__main__":
main()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
11748,
1822,
29572,
198,
11748,
30351,
952,
198,
11748,
33918,
198,
11748,
18931,
198,
11748,
28686,
198,
11748,
17802,
198,
11748,
264,
6649,
198,
11748,
25064,
198,
11748,
640,
198,
6738,
16834,
1330,
4670,
518,
198,
198,
11748,
279,
17108,
13,
76,
80,
926,
13,
16366,
355,
285,
80,
926,
198,
198,
35009,
5959,
62,
2885,
7707,
7597,
796,
19203,
36750,
3256,
1679,
4089,
8,
198,
198,
2,
5972,
2667,
28373,
198,
6404,
2667,
13,
35487,
16934,
7,
5715,
28,
6404,
2667,
13,
10778,
11,
4269,
28,
17597,
13,
19282,
448,
8,
198,
6404,
1362,
796,
18931,
13,
1136,
11187,
1362,
7,
834,
3672,
834,
8,
198,
198,
30281,
796,
18931,
13,
8979,
25060,
10786,
77,
17,
74,
48610,
36890,
13,
6404,
11537,
198,
30281,
13,
2617,
4971,
7,
6404,
2667,
13,
24908,
8,
198,
198,
687,
1436,
796,
18931,
13,
8479,
1436,
10786,
4,
7,
292,
310,
524,
8,
82,
12,
4,
7,
3672,
8,
82,
12,
4,
7,
20500,
8,
82,
11537,
198,
30281,
13,
2617,
8479,
1436,
7,
687,
1436,
8,
198,
6404,
1362,
13,
2860,
25060,
7,
30281,
8,
198,
198,
2,
1081,
13361,
9399,
8558,
26304,
198,
15596,
62,
26268,
796,
30351,
952,
13,
1136,
62,
15596,
62,
26268,
3419,
628,
198,
10943,
16254,
796,
8633,
3419,
198,
7206,
27389,
62,
20608,
796,
10148,
198,
7206,
27389,
62,
2389,
796,
10148,
198,
1268,
3697,
31235,
62,
50,
11290,
2767,
796,
17802,
13,
44971,
7,
44971,
13,
8579,
62,
1268,
2767,
11,
17802,
13,
50,
11290,
62,
35,
10761,
2390,
8,
198,
198,
4537,
56,
35613,
62,
48,
8924,
8924,
796,
4670,
518,
7,
9806,
7857,
28,
1120,
8,
628,
198,
4299,
319,
62,
8443,
7,
76,
80,
926,
66,
11,
26181,
11,
9701,
11,
48321,
2599,
198,
220,
220,
220,
37227,
49215,
15751,
4889,
1891,
15553,
2402,
14320,
284,
337,
48,
15751,
2806,
6122,
37811,
198,
220,
220,
220,
611,
48321,
6624,
657,
25,
198,
220,
220,
220,
220,
220,
220,
220,
49706,
13,
24442,
7203,
49215,
15751,
7102,
48842,
48321,
25,
366,
1343,
965,
7,
6015,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
49706,
13,
10951,
7203,
5606,
535,
274,
2759,
8113,
276,
284,
337,
48,
15751,
2806,
6122,
4943,
628,
198,
4299,
319,
62,
12984,
1836,
7,
76,
80,
926,
66,
11,
26181,
11,
3095,
2599,
198,
220,
220,
220,
37227,
49215,
15751,
4889,
1891,
15553,
2402,
12407,
284,
337,
48,
15751,
2806,
6122,
37811,
198,
220,
220,
220,
49706,
13,
24442,
7203,
49215,
15751,
24676,
9148,
18422,
25,
3095,
25,
366,
1343,
965,
7,
13602,
4008,
628,
198,
4299,
319,
62,
6381,
8443,
7,
76,
80,
926,
66,
11,
26181,
11,
48321,
2599,
198,
220,
220,
220,
37227,
49215,
15751,
4889,
1891,
376,
1229,
429,
295,
2402,
288,
4749,
1606,
278,
422,
2806,
6122,
37811,
198,
220,
220,
220,
611,
48321,
6624,
657,
25,
198,
220,
220,
220,
220,
220,
220,
220,
49706,
13,
24442,
7203,
49215,
15751,
13954,
10943,
48842,
1961,
25,
48321,
25,
366,
1343,
965,
7,
6015,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
49706,
13,
24442,
7203,
7279,
15236,
16282,
2759,
422,
337,
48,
15751,
2806,
6122,
4943,
198,
198,
4299,
9058,
62,
76,
80,
926,
62,
16366,
7,
76,
80,
926,
62,
10414,
11,
285,
80,
926,
62,
16366,
2599,
198,
220,
220,
220,
37227,
16934,
495,
337,
48,
15751,
20985,
1912,
319,
28373,
37811,
628,
220,
220,
220,
611,
285,
80,
926,
62,
10414,
17816,
51,
6561,
6,
7131,
6,
21633,
6,
5974,
198,
220,
220,
220,
220,
220,
220,
220,
49706,
13,
10951,
7203,
51,
6561,
31122,
329,
2806,
6122,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
49706,
13,
10951,
7203,
41004,
33855,
62,
14815,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
256,
7278,
796,
285,
80,
926,
62,
10414,
17816,
51,
6561,
6,
7131,
6,
83,
7278,
62,
9641,
20520,
198,
220,
220,
220,
220,
220,
220,
220,
611,
256,
7278,
6624,
705,
83,
7278,
85,
16,
13,
17,
10354,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
256,
7278,
14815,
796,
264,
6649,
13,
4805,
2394,
4503,
3535,
62,
51,
6561,
85,
16,
62,
17,
198,
220,
220,
220,
220,
220,
220,
220,
1288,
361,
256,
7278,
6624,
366,
83,
7278,
85,
16,
13,
16,
1298,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
256,
7278,
14815,
796,
264,
6649,
13,
4805,
2394,
4503,
3535,
62,
51,
6561,
85,
16,
62,
16,
198,
220,
220,
220,
220,
220,
220,
220,
1288,
361,
256,
7278,
6624,
366,
83,
7278,
85,
16,
1298,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
256,
7278,
14815,
796,
264,
6649,
13,
4805,
2394,
4503,
3535,
62,
51,
6561,
85,
16,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
49706,
13,
10951,
7203,
20035,
33855,
2196,
532,
15482,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
256,
7278,
14815,
796,
6045,
198,
220,
220,
220,
220,
220,
220,
220,
611,
407,
285,
80,
926,
62,
10414,
17816,
51,
6561,
6,
7131,
6,
259,
22390,
6,
5974,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
49706,
13,
10951,
7203,
18243,
278,
329,
14965,
811,
689,
287,
5051,
15908,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
327,
1137,
4694,
62,
34720,
796,
285,
80,
926,
62,
10414,
17816,
51,
6561,
6,
7131,
6,
22583,
82,
6,
7131,
6,
22583,
15908,
20520,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
28686,
13,
6978,
13,
9409,
343,
7,
34,
1137,
4694,
62,
34720,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
49706,
13,
10951,
7203,
22583,
15908,
7160,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7257,
62,
34,
17395,
62,
25664,
796,
28686,
13,
6978,
13,
22179,
7,
34,
1137,
4694,
62,
34720,
11,
285,
80,
926,
62,
10414,
17816,
51,
6561,
6,
7131,
6,
22583,
82,
6,
7131,
6,
66,
1878,
576,
6,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
327,
17395,
62,
25664,
796,
28686,
13,
6978,
13,
22179,
7,
34,
1137,
4694,
62,
34720,
11,
285,
80,
926,
62,
10414,
17816,
51,
6561,
6,
7131,
6,
22583,
82,
6,
7131,
6,
22583,
7753,
6,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
35374,
62,
25664,
796,
28686,
13,
6978,
13,
22179,
7,
34,
1137,
4694,
62,
34720,
11,
285,
80,
926,
62,
10414,
17816,
51,
6561,
6,
7131,
6,
22583,
82,
6,
7131,
6,
2539,
7753,
6,
12962,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
285,
80,
926,
62,
16366,
13,
83,
7278,
62,
2617,
7,
6888,
62,
22583,
82,
28,
8141,
62,
34,
17395,
62,
25664,
11,
5051,
7753,
28,
34,
17395,
62,
25664,
11,
1994,
7753,
28,
20373,
62,
25664,
11,
5051,
62,
42180,
82,
28,
45163,
13,
34,
17395,
62,
2200,
10917,
37819,
11,
256,
7278,
62,
9641,
28,
83,
7278,
14815,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
49706,
13,
18224,
7203,
22583,
15908,
857,
407,
2152,
492,
2198,
3108,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
25064,
13,
37023,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
285,
80,
926,
62,
16366,
13,
83,
7278,
62,
2617,
7,
6888,
62,
22583,
82,
28,
14202,
11,
5051,
7753,
28,
14202,
11,
1994,
7753,
28,
14202,
11,
5051,
62,
42180,
82,
28,
45163,
13,
34,
17395,
62,
45,
11651,
11,
256,
7278,
62,
9641,
28,
83,
7278,
14815,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
285,
80,
926,
62,
16366,
13,
83,
7278,
62,
259,
22390,
62,
2617,
7,
17821,
8,
198,
220,
220,
220,
220,
198,
220,
220,
220,
611,
285,
80,
926,
62,
10414,
17816,
29460,
20520,
290,
285,
80,
926,
62,
10414,
17816,
28712,
6,
5974,
198,
220,
220,
220,
220,
220,
220,
220,
49706,
13,
10951,
7203,
33990,
20579,
290,
9206,
329,
2806,
6122,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
285,
80,
926,
62,
16366,
13,
29460,
62,
79,
86,
62,
2617,
7,
76,
80,
926,
62,
10414,
17816,
29460,
6,
4357,
285,
80,
926,
62,
10414,
17816,
28712,
6,
12962,
198,
220,
220,
220,
220,
198,
220,
220,
220,
1441,
285,
80,
926,
62,
16366,
628,
198,
292,
13361,
825,
299,
1326,
64,
17,
74,
62,
5532,
62,
16366,
7,
21975,
11,
299,
1326,
64,
17,
74,
62,
10414,
11,
285,
80,
926,
66,
2599,
198,
220,
220,
220,
37227,
12124,
20985,
329,
3555,
15619,
399,
11682,
32,
11024,
6060,
37811,
198,
220,
220,
220,
3298,
38444,
35613,
62,
48,
8924,
8924,
198,
220,
220,
220,
23842,
8035,
796,
1351,
7,
8899,
7,
600,
11,
299,
1326,
64,
17,
74,
62,
10414,
17816,
79,
4593,
16934,
82,
6,
4083,
13083,
3419,
4008,
198,
220,
220,
220,
49706,
13,
24442,
10786,
2257,
32235,
12,
5097,
28495,
25,
8113,
278,
1675,
23884,
4347,
23884,
4458,
18982,
46491,
21975,
4008,
198,
220,
220,
220,
9173,
11,
4808,
796,
25507,
30351,
952,
13,
9654,
62,
38659,
46491,
21975,
8,
628,
220,
220,
220,
49706,
13,
10951,
10786,
2257,
32235,
12,
5097,
28495,
25,
11725,
422,
399,
17,
42,
35,
13860,
9652,
11537,
198,
220,
220,
220,
285,
80,
926,
66,
13,
26268,
62,
9688,
3419,
198,
220,
220,
220,
981,
6407,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1949,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1366,
796,
25507,
9173,
13,
961,
28446,
7,
25512,
1352,
28,
65,
6,
59,
77,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
1366,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8246,
62,
7890,
796,
1366,
13,
12501,
1098,
22446,
35312,
10786,
59,
77,
11537,
58,
15,
60,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
299,
1326,
64,
17,
74,
62,
7890,
796,
33918,
13,
46030,
7,
1831,
62,
7890,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1619,
299,
1326,
64,
17,
74,
62,
7890,
17816,
3448,
78,
20520,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1619,
299,
1326,
64,
17,
74,
62,
7890,
17816,
67,
301,
20520,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
299,
1326,
64,
17,
74,
62,
7890,
17816,
79,
4593,
20520,
287,
23842,
8035,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
49706,
13,
24442,
10786,
2257,
32235,
12,
5097,
28495,
33250,
6968,
45,
29164,
92,
60,
12489,
25,
23884,
4458,
18982,
7,
77,
1326,
64,
17,
74,
62,
7890,
17816,
79,
4593,
6,
4357,
299,
1326,
64,
17,
74,
62,
7890,
17816,
11213,
20520,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
49706,
13,
24442,
7,
77,
1326,
64,
17,
74,
62,
7890,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
705,
6738,
7416,
6,
287,
1351,
7,
77,
1326,
64,
17,
74,
62,
10414,
17816,
79,
4593,
16934,
82,
6,
7131,
2536,
7,
77,
1326,
64,
17,
74,
62,
7890,
17816,
79,
4593,
6,
12962,
4083,
13083,
3419,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
49706,
13,
10951,
10786,
2257,
32235,
12,
5097,
28495,
33250,
6968,
45,
29164,
92,
60,
350,
16630,
8090,
25853,
329,
23884,
837,
47690,
25,
23884,
4458,
18982,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
299,
1326,
64,
17,
74,
62,
7890,
17816,
79,
4593,
6,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
299,
1326,
64,
17,
74,
62,
7890,
17816,
11213,
6,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
299,
1326,
64,
17,
74,
62,
7890,
17816,
10677,
6,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
15306,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
299,
1326,
64,
17,
74,
62,
7890,
17816,
10677,
20520,
14512,
299,
1326,
64,
17,
74,
62,
10414,
17816,
79,
4593,
16934,
82,
6,
7131,
2536,
7,
77,
1326,
64,
17,
74,
62,
7890,
17816,
79,
4593,
6,
12962,
7131,
6,
6738,
7416,
6,
5974,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
49706,
13,
10951,
10786,
2257,
32235,
12,
5097,
28495,
33250,
6968,
45,
29164,
92,
60,
3661,
4501,
1366,
25,
23884,
2080,
311,
7397,
25,
23884,
4458,
18982,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
299,
1326,
64,
17,
74,
62,
7890,
17816,
79,
4593,
6,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
299,
1326,
64,
17,
74,
62,
7890,
17816,
11213,
6,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
299,
1326,
64,
17,
74,
62,
7890,
17816,
10677,
6,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
15306,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2555,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
467,
284,
1306,
15619,
1366,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
13610,
257,
900,
286,
477,
1695,
7032,
422,
262,
15619,
5739,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
15619,
62,
25747,
796,
900,
7,
77,
1326,
64,
17,
74,
62,
7890,
17816,
25747,
6,
4083,
13083,
28955,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7032,
62,
6738,
62,
10414,
796,
900,
7,
77,
1326,
64,
17,
74,
62,
10414,
17816,
79,
4593,
16934,
82,
6,
7131,
2536,
7,
77,
1326,
64,
17,
74,
62,
7890,
17816,
79,
4593,
6,
12962,
7131,
6,
3245,
17822,
1424,
6,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
49706,
13,
24442,
7,
69,
6,
2257,
32235,
12,
5097,
28495,
25,
23948,
1675,
5972,
25,
1391,
25747,
62,
6738,
62,
10414,
13,
3849,
5458,
7,
259,
4976,
62,
25747,
38165,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1949,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
6163,
62,
3245,
287,
7032,
62,
6738,
62,
10414,
13,
3849,
5458,
7,
259,
4976,
62,
25747,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
318,
39098,
7,
77,
1326,
64,
17,
74,
62,
7890,
17816,
25747,
6,
7131,
34213,
62,
3245,
4357,
965,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1627,
1676,
1462,
62,
15577,
2220,
796,
705,
90,
5512,
10677,
28,
77,
1326,
64,
17,
74,
11,
79,
4593,
50,
6015,
34758,
92,
23884,
2625,
90,
36786,
23884,
59,
77,
4458,
18982,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
299,
1326,
64,
17,
74,
62,
7890,
17816,
11213,
6,
4083,
33491,
7203,
33172,
366,
11074,
21037,
22784,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
299,
1326,
64,
17,
74,
62,
7890,
17816,
10677,
6,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6163,
62,
3245,
13,
33491,
7203,
33172,
366,
11074,
21037,
22784,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
299,
1326,
64,
17,
74,
62,
7890,
17816,
25747,
6,
7131,
34213,
62,
3245,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
640,
13,
2435,
62,
5907,
22784,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1627,
1676,
1462,
62,
15577,
2220,
796,
705,
90,
5512,
10677,
28,
77,
1326,
64,
17,
74,
11,
79,
4593,
50,
6015,
34758,
92,
23884,
34758,
92,
23884,
59,
77,
4458,
18982,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
299,
1326,
64,
17,
74,
62,
7890,
17816,
11213,
6,
4083,
33491,
7203,
33172,
366,
11074,
21037,
22784,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
299,
1326,
64,
17,
74,
62,
7890,
17816,
10677,
6,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6163,
62,
3245,
13,
33491,
7203,
33172,
366,
11074,
21037,
22784,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
299,
1326,
64,
17,
74,
62,
7890,
17816,
25747,
6,
7131,
34213,
62,
3245,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
640,
13,
2435,
62,
5907,
22784,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
38444,
35613,
62,
48,
8924,
8924,
13,
12853,
33529,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
49706,
13,
10951,
10786,
2257,
32235,
12,
5097,
28495,
25,
4670,
518,
6462,
4613,
8525,
1836,
6060,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
289,
69,
62,
35943,
796,
30351,
952,
13,
17953,
62,
35943,
7,
21280,
62,
7890,
7,
76,
80,
926,
66,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
25507,
289,
69,
62,
35943,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
49706,
13,
10951,
10786,
2257,
32235,
12,
5097,
28495,
25,
350,
8023,
1366,
284,
7119,
2220,
4670,
518,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
38444,
35613,
62,
48,
8924,
8924,
13,
1996,
62,
2197,
4548,
7,
1370,
1676,
1462,
62,
15577,
2220,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2845,
35528,
355,
304,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
49706,
13,
18224,
7,
68,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2604,
13,
18224,
10786,
2257,
32235,
12,
5097,
28495,
25,
1400,
6060,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
640,
13,
42832,
7,
15,
13,
16,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2845,
35528,
355,
304,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
49706,
13,
18224,
7,
68,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
49706,
13,
18224,
10786,
12331,
1141,
13860,
11725,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2270,
198,
220,
220,
220,
220,
198,
220,
220,
220,
285,
80,
926,
66,
13,
26268,
62,
11338,
3419,
628,
198,
4299,
21136,
62,
22046,
33529,
198,
220,
220,
220,
37227,
10044,
325,
20559,
2886,
329,
8398,
2393,
37811,
628,
220,
220,
220,
30751,
796,
1822,
29572,
13,
28100,
1713,
46677,
7,
11213,
11639,
5097,
40,
284,
3650,
2191,
271,
1072,
12,
10503,
51,
29916,
3815,
284,
4806,
22564,
11012,
290,
7715,
2884,
337,
48,
15751,
11537,
198,
220,
220,
220,
30751,
13,
2860,
62,
49140,
10786,
438,
11250,
3256,
705,
12,
66,
3256,
2099,
28,
2536,
11,
2672,
28,
17821,
11,
1037,
11639,
40386,
4566,
333,
13951,
2393,
351,
3108,
11537,
198,
220,
220,
220,
1441,
30751,
13,
29572,
62,
22046,
3419,
628,
198,
4299,
1388,
33529,
198,
220,
220,
220,
37227,
24243,
1634,
37811,
198,
220,
220,
220,
26498,
796,
21136,
62,
22046,
3419,
628,
220,
220,
220,
611,
407,
28686,
13,
6978,
13,
4468,
576,
7,
22046,
13,
11250,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
49706,
13,
18224,
7203,
11250,
3924,
2393,
407,
31744,
13,
6822,
3108,
284,
8398,
2393,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
25064,
13,
37023,
3419,
198,
220,
220,
220,
220,
198,
220,
220,
220,
3298,
25626,
198,
220,
220,
220,
351,
1280,
7,
22046,
13,
11250,
11,
705,
81,
11537,
355,
4566,
62,
7753,
25,
198,
220,
220,
220,
220,
220,
220,
220,
25626,
796,
33918,
13,
2220,
7,
11250,
62,
7753,
8,
628,
220,
220,
220,
3298,
5550,
27389,
62,
20608,
11,
5550,
27389,
62,
2389,
198,
220,
220,
220,
5550,
27389,
62,
20608,
796,
25626,
17816,
25202,
6,
7131,
6,
3672,
20520,
198,
220,
220,
220,
5550,
27389,
62,
2389,
796,
25626,
17816,
25202,
6,
7131,
6,
2389,
20520,
198,
220,
220,
220,
337,
48,
15751,
62,
10943,
37,
796,
25626,
17816,
76,
80,
926,
20520,
198,
220,
220,
220,
399,
11682,
32,
17,
42,
62,
10943,
37,
796,
25626,
17816,
77,
1326,
64,
17,
74,
20520,
628,
220,
220,
220,
285,
80,
926,
66,
796,
285,
80,
926,
13,
11792,
7,
16366,
62,
312,
28,
69,
6,
90,
7206,
27389,
62,
20608,
92,
14,
90,
7206,
27389,
62,
2389,
92,
12,
45,
11682,
32,
17,
42,
11537,
198,
220,
220,
220,
285,
80,
926,
66,
796,
9058,
62,
76,
80,
926,
62,
16366,
7,
49215,
15751,
62,
10943,
37,
11,
285,
80,
926,
66,
8,
628,
220,
220,
220,
285,
80,
926,
66,
13,
261,
62,
8443,
796,
319,
62,
8443,
198,
220,
220,
220,
285,
80,
926,
66,
13,
261,
62,
12984,
1836,
796,
319,
62,
12984,
1836,
198,
220,
220,
220,
285,
80,
926,
66,
13,
261,
62,
6381,
8443,
796,
319,
62,
6381,
8443,
628,
220,
220,
220,
285,
80,
926,
66,
13,
8443,
7,
10943,
16254,
17816,
76,
80,
926,
6,
7131,
6,
7957,
6122,
6,
4357,
25626,
17816,
76,
80,
926,
6,
7131,
6,
634,
6,
12962,
628,
220,
220,
220,
49706,
13,
10951,
10786,
42367,
9399,
532,
8558,
26304,
532,
7253,
3555,
422,
13860,
9652,
11537,
198,
220,
220,
220,
1949,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1785,
62,
26268,
13,
5143,
62,
28446,
62,
20751,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
299,
1326,
64,
17,
74,
62,
5532,
62,
16366,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
18871,
5959,
62,
2885,
7707,
7597,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
399,
11682,
32,
17,
42,
62,
10943,
37,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
285,
80,
926,
66,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
2845,
31973,
9492,
3622,
25,
198,
220,
220,
220,
220,
220,
220,
220,
49706,
13,
1069,
4516,
10786,
4177,
7836,
10,
34,
350,
2790,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
1208,
198,
220,
220,
220,
3443,
25,
198,
220,
220,
220,
220,
220,
220,
220,
285,
80,
926,
66,
13,
6381,
8443,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
49706,
13,
10951,
10786,
565,
2752,
1785,
9052,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
38444,
35613,
62,
48,
8924,
8924,
13,
36560,
13,
20063,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
1785,
62,
26268,
13,
19836,
3419,
628,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
1388,
3419,
198
] | 1.876097 | 4,899 |
#!/usr/bin/env python
# coding: utf-8
# In[ ]:
import tweepy
import pandas as pd
import numpy as np
import webbrowser
import time
from tweepy import OAuthHandler
import json
import csv
import re
import string
import os
# In[ ]:
key = "VEyxpXLGHG9USYhM7spHVKl36"
secret = "FG61nlBuLR7mb6UCPGxHH4UdMqwYNwL6aFhDt9gQJcaChblOkL"
callback_url = "oob"
auth = tweepy.OAuthHandler(key, secret, callback_url)
redirect_url = auth.get_authorization_url()
webbrowser.open(redirect_url)
pin_input = input("Enter Pin Value : ")
auth.get_access_token(pin_input)
# In[ ]:
api = tweepy.API(auth)
# In[ ]:
lonely_list = 'need help OR lonely OR alone OR feeling lonely OR love me OR dead inside OR i want to die OR #Ineedtotalk OR i need OR all alone'
anxiety_list = "I just can’t OR I’m fine OR Overthinking OR I tried OR I'm okay OR Help me OR I'm fine OR I need OR Left out OR Worry OR Nervous"
stress_list = "very hard OR incredibly OR stressed OR sad OR tired OR It's not easy being OR tension OR selfcare OR insomnia OR trauma OR awake"
# In[ ]:
lonely_tweets = pd.DataFrame(columns = ['username', 'acctdesc', 'location', 'usercreatedts', 'tweetcreatedts',
'retweetcount', 'text', 'hashtags'])
anxiety_tweets = pd.DataFrame(columns = ['username', 'acctdesc', 'location', 'usercreatedts', 'tweetcreatedts',
'retweetcount', 'text', 'hashtags'])
stress_tweets = pd.DataFrame(columns = ['username', 'acctdesc', 'location', 'usercreatedts', 'tweetcreatedts',
'retweetcount', 'text', 'hashtags'])
# In[ ]:
# In[ ]:
numTweets = 2500
numRuns = 1
# In[ ]:
scraptweets(lonely_list, numTweets, numRuns, lonely_tweets)
# In[ ]:
scraptweets(anxiety_list, numTweets, numRuns, anxiety_tweets)
# In[ ]:
scraptweets(stress_list, numTweets, numRuns, stress_tweets)
# In[ ]:
lonely_tweets['text'] = lonely_tweets['text'].str.replace(r'[^\x00-\x7F]+', '', regex=True)
# In[ ]:
anxiety_tweets['text'] = anxiety_tweets['text'].str.replace(r'[^\x00-\x7F]+', '', regex=True)
# In[ ]:
stress_tweets['text'] = stress_tweets['text'].str.replace(r'[^\x00-\x7F]+', '', regex=True)
# In[ ]:
lonely_tweets.to_csv('lonely_tweets.csv')
anxiety_tweets.to_csv('anxiety_tweets.csv')
stress_tweets.to_csv('stress_tweets.csv')
# In[ ]:
normal_list = '-stress OR -lonely OR -anxious OR -alone OR -sad OR -tension OR -help OR -die OR -miss OR -need'
# In[ ]:
normal_tweets = pd.DataFrame(columns = ['username', 'acctdesc', 'location', 'usercreatedts', 'tweetcreatedts',
'retweetcount', 'text', 'hashtags'])
# In[ ]:
# In[ ]:
numTweets_1 = 2000
numRuns_1 = 1
# In[ ]:
scraprecenttweets(normal_list, numTweets_1, numRuns_1, normal_tweets)
# In[ ]:
normal_tweets.to_csv('normal_tweets.csv')
# In[ ]:
lonely_tweets.to_csv('lonely_tweets_2.csv')
anxiety_tweets.to_csv('anxiety_tweets_2.csv')
stress_tweets.to_csv('stress_tweets_2.csv')
# In[ ]:
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
19617,
25,
3384,
69,
12,
23,
198,
198,
2,
554,
58,
2361,
25,
628,
198,
11748,
4184,
538,
88,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
3992,
40259,
198,
11748,
640,
198,
6738,
4184,
538,
88,
1330,
440,
30515,
25060,
198,
11748,
33918,
198,
11748,
269,
21370,
198,
11748,
302,
198,
11748,
4731,
198,
11748,
28686,
628,
198,
2,
554,
58,
2361,
25,
628,
198,
2539,
796,
366,
6089,
28391,
79,
32457,
17511,
38,
24,
2937,
56,
71,
44,
22,
2777,
39,
47191,
75,
2623,
1,
198,
21078,
796,
366,
30386,
5333,
21283,
38374,
35972,
22,
2022,
21,
9598,
6968,
87,
16768,
19,
52,
67,
44,
80,
86,
40760,
86,
43,
21,
64,
37,
71,
35,
83,
24,
70,
48,
41,
6888,
1925,
2436,
18690,
43,
1,
198,
47423,
62,
6371,
796,
366,
78,
672,
1,
198,
18439,
796,
4184,
538,
88,
13,
23621,
1071,
25060,
7,
2539,
11,
3200,
11,
23838,
62,
6371,
8,
198,
445,
1060,
62,
6371,
796,
6284,
13,
1136,
62,
9800,
1634,
62,
6371,
3419,
198,
732,
11848,
808,
2655,
13,
9654,
7,
445,
1060,
62,
6371,
8,
198,
11635,
62,
15414,
796,
5128,
7203,
17469,
13727,
11052,
1058,
366,
8,
198,
18439,
13,
1136,
62,
15526,
62,
30001,
7,
11635,
62,
15414,
8,
628,
198,
2,
554,
58,
2361,
25,
628,
198,
15042,
796,
4184,
538,
88,
13,
17614,
7,
18439,
8,
628,
198,
2,
554,
58,
2361,
25,
628,
198,
75,
505,
306,
62,
4868,
796,
705,
31227,
1037,
6375,
21757,
6375,
3436,
6375,
4203,
21757,
6375,
1842,
502,
6375,
2636,
2641,
6375,
1312,
765,
284,
4656,
6375,
1303,
40,
31227,
83,
313,
971,
6375,
1312,
761,
6375,
477,
3436,
6,
198,
272,
35753,
62,
4868,
796,
366,
40,
655,
460,
447,
247,
83,
6375,
314,
447,
247,
76,
3734,
6375,
3827,
28973,
6375,
314,
3088,
6375,
314,
1101,
8788,
6375,
10478,
502,
6375,
314,
1101,
3734,
6375,
314,
761,
6375,
9578,
503,
6375,
370,
5152,
6375,
399,
712,
516,
1,
198,
41494,
62,
4868,
796,
366,
548,
1327,
6375,
8131,
6375,
15033,
6375,
6507,
6375,
10032,
6375,
632,
338,
407,
2562,
852,
6375,
12097,
6375,
2116,
6651,
6375,
47104,
6375,
14649,
6375,
21693,
1,
628,
198,
2,
554,
58,
2361,
25,
628,
198,
75,
505,
306,
62,
83,
732,
1039,
796,
279,
67,
13,
6601,
19778,
7,
28665,
82,
796,
37250,
29460,
3256,
705,
330,
310,
20147,
3256,
705,
24886,
3256,
705,
43298,
15978,
912,
3256,
705,
83,
7277,
25598,
912,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
1186,
7277,
9127,
3256,
705,
5239,
3256,
705,
17831,
31499,
6,
12962,
198,
272,
35753,
62,
83,
732,
1039,
796,
279,
67,
13,
6601,
19778,
7,
28665,
82,
796,
37250,
29460,
3256,
705,
330,
310,
20147,
3256,
705,
24886,
3256,
705,
43298,
15978,
912,
3256,
705,
83,
7277,
25598,
912,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
1186,
7277,
9127,
3256,
705,
5239,
3256,
705,
17831,
31499,
6,
12962,
198,
41494,
62,
83,
732,
1039,
796,
279,
67,
13,
6601,
19778,
7,
28665,
82,
796,
37250,
29460,
3256,
705,
330,
310,
20147,
3256,
705,
24886,
3256,
705,
43298,
15978,
912,
3256,
705,
83,
7277,
25598,
912,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
1186,
7277,
9127,
3256,
705,
5239,
3256,
705,
17831,
31499,
6,
12962,
628,
198,
2,
554,
58,
2361,
25,
628,
198,
198,
2,
554,
58,
2361,
25,
628,
198,
22510,
32665,
1039,
796,
33507,
198,
22510,
10987,
82,
796,
352,
628,
198,
2,
554,
58,
2361,
25,
628,
198,
1416,
430,
457,
732,
1039,
7,
75,
505,
306,
62,
4868,
11,
997,
32665,
1039,
11,
997,
10987,
82,
11,
21757,
62,
83,
732,
1039,
8,
628,
198,
2,
554,
58,
2361,
25,
628,
198,
1416,
430,
457,
732,
1039,
7,
272,
35753,
62,
4868,
11,
997,
32665,
1039,
11,
997,
10987,
82,
11,
9751,
62,
83,
732,
1039,
8,
628,
198,
2,
554,
58,
2361,
25,
628,
198,
1416,
430,
457,
732,
1039,
7,
41494,
62,
4868,
11,
997,
32665,
1039,
11,
997,
10987,
82,
11,
5503,
62,
83,
732,
1039,
8,
628,
198,
2,
554,
58,
2361,
25,
628,
198,
75,
505,
306,
62,
83,
732,
1039,
17816,
5239,
20520,
796,
21757,
62,
83,
732,
1039,
17816,
5239,
6,
4083,
2536,
13,
33491,
7,
81,
6,
58,
61,
59,
87,
405,
12,
59,
87,
22,
37,
48688,
3256,
705,
3256,
40364,
28,
17821,
8,
628,
198,
2,
554,
58,
2361,
25,
628,
198,
272,
35753,
62,
83,
732,
1039,
17816,
5239,
20520,
796,
9751,
62,
83,
732,
1039,
17816,
5239,
6,
4083,
2536,
13,
33491,
7,
81,
6,
58,
61,
59,
87,
405,
12,
59,
87,
22,
37,
48688,
3256,
705,
3256,
40364,
28,
17821,
8,
628,
198,
2,
554,
58,
2361,
25,
628,
198,
41494,
62,
83,
732,
1039,
17816,
5239,
20520,
796,
5503,
62,
83,
732,
1039,
17816,
5239,
6,
4083,
2536,
13,
33491,
7,
81,
6,
58,
61,
59,
87,
405,
12,
59,
87,
22,
37,
48688,
3256,
705,
3256,
40364,
28,
17821,
8,
628,
198,
2,
554,
58,
2361,
25,
628,
198,
75,
505,
306,
62,
83,
732,
1039,
13,
1462,
62,
40664,
10786,
75,
505,
306,
62,
83,
732,
1039,
13,
40664,
11537,
198,
272,
35753,
62,
83,
732,
1039,
13,
1462,
62,
40664,
10786,
272,
35753,
62,
83,
732,
1039,
13,
40664,
11537,
198,
41494,
62,
83,
732,
1039,
13,
1462,
62,
40664,
10786,
41494,
62,
83,
732,
1039,
13,
40664,
11537,
628,
198,
2,
554,
58,
2361,
25,
628,
198,
11265,
62,
4868,
796,
705,
12,
41494,
6375,
532,
75,
505,
306,
6375,
532,
272,
48392,
6375,
532,
17749,
6375,
532,
82,
324,
6375,
532,
83,
3004,
6375,
532,
16794,
6375,
532,
11979,
6375,
532,
3927,
6375,
532,
31227,
6,
628,
198,
2,
554,
58,
2361,
25,
628,
198,
11265,
62,
83,
732,
1039,
796,
279,
67,
13,
6601,
19778,
7,
28665,
82,
796,
37250,
29460,
3256,
705,
330,
310,
20147,
3256,
705,
24886,
3256,
705,
43298,
15978,
912,
3256,
705,
83,
7277,
25598,
912,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
1186,
7277,
9127,
3256,
705,
5239,
3256,
705,
17831,
31499,
6,
12962,
628,
198,
2,
554,
58,
2361,
25,
628,
198,
198,
2,
554,
58,
2361,
25,
628,
198,
22510,
32665,
1039,
62,
16,
796,
4751,
198,
22510,
10987,
82,
62,
16,
796,
352,
628,
198,
2,
554,
58,
2361,
25,
628,
198,
1416,
2416,
49921,
83,
732,
1039,
7,
11265,
62,
4868,
11,
997,
32665,
1039,
62,
16,
11,
997,
10987,
82,
62,
16,
11,
3487,
62,
83,
732,
1039,
8,
628,
198,
2,
554,
58,
2361,
25,
628,
198,
11265,
62,
83,
732,
1039,
13,
1462,
62,
40664,
10786,
11265,
62,
83,
732,
1039,
13,
40664,
11537,
628,
198,
2,
554,
58,
2361,
25,
628,
198,
75,
505,
306,
62,
83,
732,
1039,
13,
1462,
62,
40664,
10786,
75,
505,
306,
62,
83,
732,
1039,
62,
17,
13,
40664,
11537,
198,
272,
35753,
62,
83,
732,
1039,
13,
1462,
62,
40664,
10786,
272,
35753,
62,
83,
732,
1039,
62,
17,
13,
40664,
11537,
198,
41494,
62,
83,
732,
1039,
13,
1462,
62,
40664,
10786,
41494,
62,
83,
732,
1039,
62,
17,
13,
40664,
11537,
628,
198,
2,
554,
58,
2361,
25,
628,
628,
198
] | 2.239852 | 1,355 |
expected_output = {
"version": {
"build_time": "08:13:43 Apr 7, 2021",
"firmware_ver": "18r.1.00h",
"install_time": "07:14:32 Jun 1, 2021",
"slot": {
"L1/0": {
"name": "L1/0",
"primary_ver": "18r.1.00h",
"secondary_ver": "18r.1.00h",
"status": "ACTIVE",
},
"L2/0": {
"name": "L2/0",
"primary_ver": "18r.1.00h",
"secondary_ver": "18r.1.00h",
"status": "ACTIVE",
},
"L3/0": {
"name": "L3/0",
"primary_ver": "18r.1.00h",
"secondary_ver": "18r.1.00h",
"status": "ACTIVE",
},
"L4/0": {
"name": "L4/0",
"primary_ver": "18r.1.00h",
"secondary_ver": "18r.1.00h",
"status": "ACTIVE",
},
"L5/0": {
"name": "L5/0",
"primary_ver": "18r.1.00h",
"secondary_ver": "18r.1.00h",
"status": "ACTIVE",
},
"L6/0": {
"name": "L6/0",
"primary_ver": "18r.1.00h",
"secondary_ver": "18r.1.00h",
"status": "ACTIVE",
},
"L7/0": {
"name": "L7/0",
"primary_ver": "18r.1.00h",
"secondary_ver": "18r.1.00h",
"status": "ACTIVE",
},
"L8/0": {
"name": "L8/0",
"primary_ver": "18r.1.00h",
"secondary_ver": "18r.1.00h",
"status": "ACTIVE",
},
"M1": {
"name": "M1",
"primary_ver": "18r.1.00h",
"secondary_ver": "18r.1.00h",
"status": "ACTIVE",
},
"M2": {
"name": "M2",
"primary_ver": "18r.1.00h",
"secondary_ver": "18r.1.00h",
"status": "STANDBY",
},
},
"system_uptime": "94days 8hrs 25mins 29secs",
}
}
| [
40319,
62,
22915,
796,
1391,
198,
220,
220,
220,
366,
9641,
1298,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
366,
11249,
62,
2435,
1298,
366,
2919,
25,
1485,
25,
3559,
2758,
220,
767,
11,
33448,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
366,
69,
2533,
1574,
62,
332,
1298,
366,
1507,
81,
13,
16,
13,
405,
71,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
366,
17350,
62,
2435,
1298,
366,
2998,
25,
1415,
25,
2624,
7653,
220,
352,
11,
33448,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
366,
43384,
1298,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
43,
16,
14,
15,
1298,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
3672,
1298,
366,
43,
16,
14,
15,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
39754,
62,
332,
1298,
366,
1507,
81,
13,
16,
13,
405,
71,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
38238,
62,
332,
1298,
366,
1507,
81,
13,
16,
13,
405,
71,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
13376,
1298,
366,
10659,
9306,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8964,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
43,
17,
14,
15,
1298,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
3672,
1298,
366,
43,
17,
14,
15,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
39754,
62,
332,
1298,
366,
1507,
81,
13,
16,
13,
405,
71,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
38238,
62,
332,
1298,
366,
1507,
81,
13,
16,
13,
405,
71,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
13376,
1298,
366,
10659,
9306,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8964,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
43,
18,
14,
15,
1298,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
3672,
1298,
366,
43,
18,
14,
15,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
39754,
62,
332,
1298,
366,
1507,
81,
13,
16,
13,
405,
71,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
38238,
62,
332,
1298,
366,
1507,
81,
13,
16,
13,
405,
71,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
13376,
1298,
366,
10659,
9306,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8964,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
43,
19,
14,
15,
1298,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
3672,
1298,
366,
43,
19,
14,
15,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
39754,
62,
332,
1298,
366,
1507,
81,
13,
16,
13,
405,
71,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
38238,
62,
332,
1298,
366,
1507,
81,
13,
16,
13,
405,
71,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
13376,
1298,
366,
10659,
9306,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8964,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
43,
20,
14,
15,
1298,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
3672,
1298,
366,
43,
20,
14,
15,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
39754,
62,
332,
1298,
366,
1507,
81,
13,
16,
13,
405,
71,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
38238,
62,
332,
1298,
366,
1507,
81,
13,
16,
13,
405,
71,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
13376,
1298,
366,
10659,
9306,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8964,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
43,
21,
14,
15,
1298,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
3672,
1298,
366,
43,
21,
14,
15,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
39754,
62,
332,
1298,
366,
1507,
81,
13,
16,
13,
405,
71,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
38238,
62,
332,
1298,
366,
1507,
81,
13,
16,
13,
405,
71,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
13376,
1298,
366,
10659,
9306,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8964,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
43,
22,
14,
15,
1298,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
3672,
1298,
366,
43,
22,
14,
15,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
39754,
62,
332,
1298,
366,
1507,
81,
13,
16,
13,
405,
71,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
38238,
62,
332,
1298,
366,
1507,
81,
13,
16,
13,
405,
71,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
13376,
1298,
366,
10659,
9306,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8964,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
43,
23,
14,
15,
1298,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
3672,
1298,
366,
43,
23,
14,
15,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
39754,
62,
332,
1298,
366,
1507,
81,
13,
16,
13,
405,
71,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
38238,
62,
332,
1298,
366,
1507,
81,
13,
16,
13,
405,
71,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
13376,
1298,
366,
10659,
9306,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8964,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
44,
16,
1298,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
3672,
1298,
366,
44,
16,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
39754,
62,
332,
1298,
366,
1507,
81,
13,
16,
13,
405,
71,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
38238,
62,
332,
1298,
366,
1507,
81,
13,
16,
13,
405,
71,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
13376,
1298,
366,
10659,
9306,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8964,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
44,
17,
1298,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
3672,
1298,
366,
44,
17,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
39754,
62,
332,
1298,
366,
1507,
81,
13,
16,
13,
405,
71,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
38238,
62,
332,
1298,
366,
1507,
81,
13,
16,
13,
405,
71,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
13376,
1298,
366,
2257,
6981,
17513,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8964,
198,
220,
220,
220,
220,
220,
220,
220,
8964,
198,
220,
220,
220,
220,
220,
220,
220,
366,
10057,
62,
37623,
524,
1298,
366,
5824,
12545,
807,
71,
3808,
1679,
42951,
2808,
2363,
82,
1600,
198,
220,
220,
220,
1782,
198,
92,
198
] | 1.435831 | 1,535 |
from .FPN import *
from .PAN import * | [
6738,
764,
5837,
45,
1330,
1635,
220,
198,
6738,
764,
47,
1565,
1330,
1635,
220
] | 2.6 | 15 |
def main():
"""Generate reStructuredText README from Markdown.
The ``main()`` function is also registered in the setup entry points.
Convertion example::
import ipster.command_line
ipster.command_line.main()
"""
readme_in = 'README.md'
readme_out = 'README.rst'
try:
from pypandoc import convert_file
readme = convert_file(readme_in, 'rst')
with open(readme_out, 'w') as f:
f.write(readme)
except ImportError as e:
print(e)
| [
4299,
1388,
33529,
198,
220,
220,
220,
37227,
8645,
378,
302,
44909,
1522,
8206,
20832,
11682,
422,
2940,
2902,
13,
198,
220,
220,
220,
383,
7559,
12417,
3419,
15506,
2163,
318,
635,
6823,
287,
262,
9058,
5726,
2173,
13,
628,
220,
220,
220,
38240,
295,
1672,
3712,
628,
220,
220,
220,
220,
220,
220,
220,
1330,
20966,
1706,
13,
21812,
62,
1370,
198,
220,
220,
220,
220,
220,
220,
220,
20966,
1706,
13,
21812,
62,
1370,
13,
12417,
3419,
628,
220,
220,
220,
37227,
198,
220,
220,
220,
1100,
1326,
62,
259,
796,
705,
15675,
11682,
13,
9132,
6,
198,
220,
220,
220,
1100,
1326,
62,
448,
796,
705,
15675,
11682,
13,
81,
301,
6,
198,
220,
220,
220,
1949,
25,
198,
220,
220,
220,
220,
220,
220,
220,
422,
279,
4464,
392,
420,
1330,
10385,
62,
7753,
198,
220,
220,
220,
220,
220,
220,
220,
1100,
1326,
796,
10385,
62,
7753,
7,
961,
1326,
62,
259,
11,
705,
81,
301,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
351,
1280,
7,
961,
1326,
62,
448,
11,
705,
86,
11537,
355,
277,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
277,
13,
13564,
7,
961,
1326,
8,
198,
220,
220,
220,
2845,
17267,
12331,
355,
304,
25,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
7,
68,
8,
198
] | 2.29646 | 226 |
#!/usr/bin/env python
# Thanks to https://github.com/ritchielawrence/cmdow
# For providing help for treating Win32 API
import re
import os
from argparse import ArgumentParser
import win32gui
import win32api
import win32console
import win32process
from win32com.client import GetObject
from win_maximize.parent_tree import parent_tree
CURRENT_PROCESS_TREE = parent_tree(os.getpid())
# Check if found window handle is parent process of this script
if __name__ == "__main__":
main()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
2,
6930,
284,
3740,
1378,
12567,
13,
785,
14,
46510,
8207,
707,
6784,
14,
28758,
322,
198,
2,
1114,
4955,
1037,
329,
13622,
7178,
2624,
7824,
198,
198,
11748,
302,
198,
11748,
28686,
198,
6738,
1822,
29572,
1330,
45751,
46677,
198,
198,
11748,
1592,
2624,
48317,
198,
11748,
1592,
2624,
15042,
198,
11748,
1592,
2624,
41947,
198,
11748,
1592,
2624,
14681,
198,
198,
6738,
1592,
2624,
785,
13,
16366,
1330,
3497,
10267,
198,
198,
6738,
1592,
62,
9806,
48439,
13,
8000,
62,
21048,
1330,
2560,
62,
21048,
628,
198,
198,
34,
39237,
62,
4805,
4503,
7597,
62,
51,
11587,
796,
2560,
62,
21048,
7,
418,
13,
1136,
35317,
28955,
628,
198,
220,
220,
220,
1303,
6822,
611,
1043,
4324,
5412,
318,
2560,
1429,
286,
428,
4226,
628,
628,
628,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
1388,
3419,
198
] | 3.210191 | 157 |
import json
from django import template
register = template.Library()
@register.filter
| [
11748,
33918,
198,
198,
6738,
42625,
14208,
1330,
11055,
198,
198,
30238,
796,
11055,
13,
23377,
3419,
628,
198,
31,
30238,
13,
24455,
198
] | 3.791667 | 24 |
from raccgen import generate
build = generate.build
pair = generate.racc | [
6738,
3444,
66,
5235,
1330,
7716,
198,
198,
11249,
796,
7716,
13,
11249,
198,
24874,
796,
7716,
13,
81,
4134
] | 3.65 | 20 |
from django.db import models
from django.core.exceptions import ValidationError
from django.core.validators import MaxValueValidator, MinValueValidator
import uuid
# def validate_color(color):
# match = re.search(r'^#(?:[0-9a-fA-F]{3}){1,2}$', color)
# if match == False:
# raise ValidationError(
# _('%(color)s is not an even number'),
# params={'color': color},
# )
class Car(models.Model):
'''
Car Model
'''
unique_id = models.UUIDField(default=uuid.uuid4(), editable=False)
make = models.CharField(max_length=56, blank=False, null=False)
color = models.CharField(max_length=56, blank=False, null=False)
production_year = models.IntegerField(blank=False, validators=[
MaxValueValidator(2021),
MinValueValidator(1960),
])
avg_fuel_consumption_per_100km = models.DecimalField(blank=False, null=False, max_digits=5, decimal_places=2,
validators=[
MaxValueValidator(20),
MinValueValidator(2),
])
max_passengers = models.PositiveIntegerField(blank=False, null=False,
validators=[
MinValueValidator(1),
MaxValueValidator(10),
])
created_at = models.DateTimeField(auto_now_add=True)
| [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
42625,
14208,
13,
7295,
13,
1069,
11755,
1330,
3254,
24765,
12331,
198,
6738,
42625,
14208,
13,
7295,
13,
12102,
2024,
1330,
5436,
11395,
47139,
1352,
11,
1855,
11395,
47139,
1352,
198,
11748,
334,
27112,
628,
198,
2,
825,
26571,
62,
8043,
7,
8043,
2599,
198,
2,
220,
220,
220,
220,
2872,
796,
302,
13,
12947,
7,
81,
6,
61,
2,
7,
27514,
58,
15,
12,
24,
64,
12,
69,
32,
12,
37,
60,
90,
18,
92,
19953,
16,
11,
17,
92,
3,
3256,
3124,
8,
198,
2,
220,
220,
220,
220,
611,
2872,
6624,
10352,
25,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
5298,
3254,
24765,
12331,
7,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4808,
10786,
4,
7,
8043,
8,
82,
318,
407,
281,
772,
1271,
33809,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
42287,
34758,
6,
8043,
10354,
3124,
5512,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
1267,
628,
198,
4871,
1879,
7,
27530,
13,
17633,
2599,
198,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
1879,
9104,
198,
220,
220,
220,
705,
7061,
628,
220,
220,
220,
3748,
62,
312,
796,
4981,
13,
52,
27586,
15878,
7,
12286,
28,
12303,
312,
13,
12303,
312,
19,
22784,
4370,
540,
28,
25101,
8,
198,
220,
220,
220,
787,
796,
4981,
13,
12441,
15878,
7,
9806,
62,
13664,
28,
3980,
11,
9178,
28,
25101,
11,
9242,
28,
25101,
8,
198,
220,
220,
220,
3124,
796,
4981,
13,
12441,
15878,
7,
9806,
62,
13664,
28,
3980,
11,
9178,
28,
25101,
11,
9242,
28,
25101,
8,
198,
220,
220,
220,
3227,
62,
1941,
796,
4981,
13,
46541,
15878,
7,
27190,
28,
25101,
11,
4938,
2024,
41888,
198,
220,
220,
220,
220,
220,
220,
220,
5436,
11395,
47139,
1352,
7,
1238,
2481,
828,
198,
220,
220,
220,
220,
220,
220,
220,
1855,
11395,
47139,
1352,
7,
38503,
828,
198,
220,
220,
220,
33761,
198,
220,
220,
220,
42781,
62,
25802,
62,
5936,
24098,
62,
525,
62,
3064,
13276,
796,
4981,
13,
10707,
4402,
15878,
7,
27190,
28,
25101,
11,
9242,
28,
25101,
11,
3509,
62,
12894,
896,
28,
20,
11,
32465,
62,
23625,
28,
17,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4938,
2024,
41888,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5436,
11395,
47139,
1352,
7,
1238,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1855,
11395,
47139,
1352,
7,
17,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
33761,
198,
220,
220,
220,
3509,
62,
6603,
9302,
796,
4981,
13,
21604,
1800,
46541,
15878,
7,
27190,
28,
25101,
11,
9242,
28,
25101,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4938,
2024,
41888,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1855,
11395,
47139,
1352,
7,
16,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5436,
11395,
47139,
1352,
7,
940,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
33761,
198,
220,
220,
220,
2727,
62,
265,
796,
4981,
13,
10430,
7575,
15878,
7,
23736,
62,
2197,
62,
2860,
28,
17821,
8,
198
] | 1.801325 | 906 |
from __future__ import absolute_import, print_function, unicode_literals
from wolframclient.language.expression import WLInputExpression, WLSymbolFactory
wl = WLSymbolFactory()
"""A factory of :class:`~wolframclient.language.expression.WLSymbol` instances without any particular context.
This instance of :class:`~wolframclient.language.expression.WLSymbolFactory` is conveniently used
by calling its attributes. The following code represents various Wolfram Language expressions::
# Now
wl.Now
# Quantity[3, "Hours"]
wl.Quantity(3, "Hours")
# Select[PrimeQ, {1,2,3,4}]
wl.Select(wl.PrimeQ, [1, 2, 3, 4])
Represent symbols in various contexts::
>>> wl.Developer.PackedArrayQ
Developer`PackedArrayQ
>>> wl.Global.f
Global`f
Specify a context and a subcontext::
>>> wl.MyContext.MySubContext.SymbolName
MyContext`MySubContext`SymbolName
"""
System = wl.System
"""A factory of :class:`~wolframclient.language.expression.WLSymbol` instances having ``System``` context.
See :class:`~wolframclient.language.expression.WLSymbolFactory` for more details.
Represent a symbol in the System context::
>>> System.ImageIdentify
System`ImageIdentify
"""
Global = wl.Global
"""A factory of :class:`~wolframclient.language.expression.WLSymbol` instances having ``Global``` context.
See :class:`~wolframclient.language.expression.WLSymbolFactory` and
:class:`~wolframclient.language.expression.WLSymbolFactory` for more details.
Represent a symbol in the Global context::
>>> Global.mySymbol
Global`mySymbol
Represent a function call to a function::
>>> Global.myFunction('foo')
Global`myFunction['foo']
"""
# Sphinx seems to bug on this one, and picks an outdated the docstring when declared in __init__.
wlexpr = WLInputExpression
""" Represent Wolfram Language expressions with input form strings.
Convenient alias for :class:`~wolframclient.language.expression.WLInputExpression`.
Represent an expression::
>>> wlexpr('Select[Range[10], EvenQ]')
(Select[Range[10], EvenQ])
Represent a pure function that squares an input argument::
>>> wlexpr('# ^ 2 &' )
(# ^ 2 &)
"""
__all__ = ["wl", "System", "Global", "wlexpr"]
| [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
11,
3601,
62,
8818,
11,
28000,
1098,
62,
17201,
874,
198,
198,
6738,
17481,
859,
16366,
13,
16129,
13,
38011,
1330,
370,
43,
20560,
16870,
2234,
11,
370,
6561,
88,
23650,
22810,
198,
198,
40989,
796,
370,
6561,
88,
23650,
22810,
3419,
198,
37811,
32,
8860,
286,
1058,
4871,
25,
63,
93,
18829,
859,
16366,
13,
16129,
13,
38011,
13,
54,
6561,
88,
23650,
63,
10245,
1231,
597,
1948,
4732,
13,
198,
198,
1212,
4554,
286,
1058,
4871,
25,
63,
93,
18829,
859,
16366,
13,
16129,
13,
38011,
13,
54,
6561,
88,
23650,
22810,
63,
318,
29801,
973,
198,
1525,
4585,
663,
12608,
13,
383,
1708,
2438,
6870,
2972,
8662,
859,
15417,
14700,
3712,
628,
220,
220,
220,
1303,
2735,
198,
220,
220,
220,
266,
75,
13,
3844,
198,
220,
220,
220,
1303,
39789,
58,
18,
11,
366,
39792,
8973,
198,
220,
220,
220,
266,
75,
13,
31208,
7,
18,
11,
366,
39792,
4943,
198,
220,
220,
220,
1303,
9683,
58,
26405,
48,
11,
1391,
16,
11,
17,
11,
18,
11,
19,
92,
60,
198,
220,
220,
220,
266,
75,
13,
17563,
7,
40989,
13,
26405,
48,
11,
685,
16,
11,
362,
11,
513,
11,
604,
12962,
198,
198,
40171,
14354,
287,
2972,
26307,
3712,
628,
220,
220,
220,
13163,
266,
75,
13,
45351,
13,
47,
6021,
19182,
48,
198,
220,
220,
220,
23836,
63,
47,
6021,
19182,
48,
628,
220,
220,
220,
13163,
266,
75,
13,
22289,
13,
69,
198,
220,
220,
220,
8060,
63,
69,
198,
198,
22882,
1958,
257,
4732,
290,
257,
850,
22866,
3712,
628,
220,
220,
220,
13163,
266,
75,
13,
3666,
21947,
13,
3666,
7004,
21947,
13,
13940,
23650,
5376,
198,
220,
220,
220,
2011,
21947,
63,
3666,
7004,
21947,
63,
13940,
23650,
5376,
628,
198,
37811,
198,
198,
11964,
796,
266,
75,
13,
11964,
198,
37811,
32,
8860,
286,
1058,
4871,
25,
63,
93,
18829,
859,
16366,
13,
16129,
13,
38011,
13,
54,
6561,
88,
23650,
63,
10245,
1719,
7559,
11964,
15506,
63,
4732,
13,
198,
198,
6214,
1058,
4871,
25,
63,
93,
18829,
859,
16366,
13,
16129,
13,
38011,
13,
54,
6561,
88,
23650,
22810,
63,
329,
517,
3307,
13,
198,
198,
40171,
257,
6194,
287,
262,
4482,
4732,
3712,
628,
220,
220,
220,
13163,
4482,
13,
5159,
33234,
1958,
198,
220,
220,
220,
4482,
63,
5159,
33234,
1958,
198,
198,
37811,
198,
198,
22289,
796,
266,
75,
13,
22289,
198,
37811,
32,
8860,
286,
1058,
4871,
25,
63,
93,
18829,
859,
16366,
13,
16129,
13,
38011,
13,
54,
6561,
88,
23650,
63,
10245,
1719,
7559,
22289,
15506,
63,
4732,
13,
198,
198,
6214,
1058,
4871,
25,
63,
93,
18829,
859,
16366,
13,
16129,
13,
38011,
13,
54,
6561,
88,
23650,
22810,
63,
290,
198,
25,
4871,
25,
63,
93,
18829,
859,
16366,
13,
16129,
13,
38011,
13,
54,
6561,
88,
23650,
22810,
63,
329,
517,
3307,
13,
198,
198,
40171,
257,
6194,
287,
262,
8060,
4732,
3712,
628,
220,
220,
220,
13163,
8060,
13,
1820,
13940,
23650,
198,
220,
220,
220,
8060,
63,
1820,
13940,
23650,
198,
198,
40171,
257,
2163,
869,
284,
257,
2163,
3712,
628,
220,
220,
220,
13163,
8060,
13,
1820,
22203,
10786,
21943,
11537,
198,
220,
220,
220,
8060,
63,
1820,
22203,
17816,
21943,
20520,
198,
198,
37811,
198,
198,
2,
45368,
28413,
2331,
284,
5434,
319,
428,
530,
11,
290,
11103,
281,
23572,
262,
2205,
8841,
618,
6875,
287,
11593,
15003,
834,
13,
198,
86,
2588,
1050,
796,
370,
43,
20560,
16870,
2234,
198,
37811,
10858,
8662,
859,
15417,
14700,
351,
5128,
1296,
13042,
13,
198,
198,
3103,
48109,
16144,
329,
1058,
4871,
25,
63,
93,
18829,
859,
16366,
13,
16129,
13,
38011,
13,
54,
43,
20560,
16870,
2234,
44646,
198,
198,
40171,
281,
5408,
3712,
628,
220,
220,
220,
13163,
266,
2588,
1050,
10786,
17563,
58,
17257,
58,
940,
4357,
3412,
48,
60,
11537,
198,
220,
220,
220,
357,
17563,
58,
17257,
58,
940,
4357,
3412,
48,
12962,
198,
198,
40171,
257,
5899,
2163,
326,
24438,
281,
5128,
4578,
3712,
628,
220,
220,
220,
13163,
266,
2588,
1050,
10786,
2,
10563,
362,
1222,
6,
1267,
198,
220,
220,
220,
17426,
10563,
362,
1222,
8,
198,
198,
37811,
628,
198,
834,
439,
834,
796,
14631,
40989,
1600,
366,
11964,
1600,
366,
22289,
1600,
366,
86,
2588,
1050,
8973,
198
] | 3.083218 | 721 |
import time
from typing import Iterable, Optional, Sequence
import orjson
from django.http import HttpRequest, HttpResponse
from django.utils.translation import ugettext as _
from zerver.decorator import REQ, has_request_variables, internal_notify_view, process_client
from zerver.lib.response import json_error, json_success
from zerver.lib.validator import (
check_bool,
check_int,
check_list,
check_string,
to_non_negative_int,
)
from zerver.models import Client, UserProfile, get_client, get_user_profile_by_id
from zerver.tornado.event_queue import fetch_events, get_client_descriptor, process_notification
from zerver.tornado.exceptions import BadEventQueueIdError
from zerver.tornado.handlers import AsyncDjangoHandler
@internal_notify_view(True)
@has_request_variables
@internal_notify_view(True)
@has_request_variables
@has_request_variables
| [
11748,
640,
198,
6738,
19720,
1330,
40806,
540,
11,
32233,
11,
45835,
198,
198,
11748,
393,
17752,
198,
6738,
42625,
14208,
13,
4023,
1330,
367,
29281,
18453,
11,
367,
29281,
31077,
198,
6738,
42625,
14208,
13,
26791,
13,
41519,
1330,
334,
1136,
5239,
355,
4808,
198,
198,
6738,
1976,
18497,
13,
12501,
273,
1352,
1330,
4526,
48,
11,
468,
62,
25927,
62,
25641,
2977,
11,
5387,
62,
1662,
1958,
62,
1177,
11,
1429,
62,
16366,
198,
6738,
1976,
18497,
13,
8019,
13,
26209,
1330,
33918,
62,
18224,
11,
33918,
62,
13138,
198,
6738,
1976,
18497,
13,
8019,
13,
12102,
1352,
1330,
357,
198,
220,
220,
220,
2198,
62,
30388,
11,
198,
220,
220,
220,
2198,
62,
600,
11,
198,
220,
220,
220,
2198,
62,
4868,
11,
198,
220,
220,
220,
2198,
62,
8841,
11,
198,
220,
220,
220,
284,
62,
13159,
62,
31591,
62,
600,
11,
198,
8,
198,
6738,
1976,
18497,
13,
27530,
1330,
20985,
11,
11787,
37046,
11,
651,
62,
16366,
11,
651,
62,
7220,
62,
13317,
62,
1525,
62,
312,
198,
6738,
1976,
18497,
13,
45910,
4533,
13,
15596,
62,
36560,
1330,
21207,
62,
31534,
11,
651,
62,
16366,
62,
20147,
1968,
273,
11,
1429,
62,
1662,
2649,
198,
6738,
1976,
18497,
13,
45910,
4533,
13,
1069,
11755,
1330,
7772,
9237,
34991,
7390,
12331,
198,
6738,
1976,
18497,
13,
45910,
4533,
13,
4993,
8116,
1330,
1081,
13361,
35,
73,
14208,
25060,
628,
198,
31,
32538,
62,
1662,
1958,
62,
1177,
7,
17821,
8,
198,
198,
31,
10134,
62,
25927,
62,
25641,
2977,
198,
198,
31,
32538,
62,
1662,
1958,
62,
1177,
7,
17821,
8,
198,
31,
10134,
62,
25927,
62,
25641,
2977,
198,
198,
31,
10134,
62,
25927,
62,
25641,
2977,
198
] | 3.080702 | 285 |
"""Accessors for NAMD FEP datasets.
"""
from os.path import dirname, join
from glob import glob
from .. import Bunch
def load_tyr2ala():
"""Load the NAMD tyrosine to alanine mutation dataset.
Returns
-------
data : Bunch
Dictionary-like object, the interesting attributes are:
- 'data' : the data files by alchemical leg
- 'DESCR': the full description of the dataset
"""
module_path = dirname(__file__)
data = {'forward': glob(join(module_path, 'tyr2ala/in-aqua/forward/*.fepout.bz2')),
'backward': glob(join(module_path, 'tyr2ala/in-aqua/backward/*.fepout.bz2'))}
with open(join(module_path, 'tyr2ala', 'descr.rst')) as rst_file:
fdescr = rst_file.read()
return Bunch(data=data,
DESCR=fdescr)
| [
37811,
15457,
669,
329,
399,
28075,
376,
8905,
40522,
13,
198,
198,
37811,
198,
198,
6738,
28686,
13,
6978,
1330,
26672,
3672,
11,
4654,
198,
6738,
15095,
1330,
15095,
198,
198,
6738,
11485,
1330,
347,
3316,
198,
198,
4299,
3440,
62,
774,
81,
17,
6081,
33529,
198,
220,
220,
220,
37227,
8912,
262,
399,
28075,
1259,
4951,
500,
284,
435,
272,
500,
15148,
27039,
13,
628,
220,
220,
220,
16409,
198,
220,
220,
220,
35656,
198,
220,
220,
220,
1366,
1058,
347,
3316,
198,
220,
220,
220,
220,
220,
220,
220,
28261,
12,
2339,
2134,
11,
262,
3499,
12608,
389,
25,
628,
220,
220,
220,
220,
220,
220,
220,
532,
705,
7890,
6,
1058,
262,
1366,
3696,
416,
435,
31379,
1232,
198,
220,
220,
220,
220,
220,
220,
220,
532,
705,
30910,
9419,
10354,
262,
1336,
6764,
286,
262,
27039,
628,
220,
220,
220,
37227,
628,
220,
220,
220,
8265,
62,
6978,
796,
26672,
3672,
7,
834,
7753,
834,
8,
198,
220,
220,
220,
1366,
796,
1391,
6,
11813,
10354,
15095,
7,
22179,
7,
21412,
62,
6978,
11,
705,
774,
81,
17,
6081,
14,
259,
12,
36129,
64,
14,
11813,
15211,
13,
69,
538,
448,
13,
65,
89,
17,
11537,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
1891,
904,
10354,
15095,
7,
22179,
7,
21412,
62,
6978,
11,
705,
774,
81,
17,
6081,
14,
259,
12,
36129,
64,
14,
1891,
904,
15211,
13,
69,
538,
448,
13,
65,
89,
17,
6,
4008,
92,
628,
220,
220,
220,
351,
1280,
7,
22179,
7,
21412,
62,
6978,
11,
705,
774,
81,
17,
6081,
3256,
705,
20147,
81,
13,
81,
301,
6,
4008,
355,
374,
301,
62,
7753,
25,
198,
220,
220,
220,
220,
220,
220,
220,
277,
20147,
81,
796,
374,
301,
62,
7753,
13,
961,
3419,
628,
220,
220,
220,
1441,
347,
3316,
7,
7890,
28,
7890,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
22196,
9419,
28,
16344,
3798,
81,
8,
628
] | 2.368732 | 339 |
import pandas as pd
import ta
# Load data
df = pd.read_csv('ui.csv', sep=',')
# Clean nan values
df = ta.utils.dropna(df)
print('roc')
print(ta.momentum.roc(close=df['close']),40)
print('-----------------------------------')
print('rsi')
print(ta.momentum.rsi(close=df['close']),14)
print('-----------------------------------')
print('bollinger_mavg')
print(ta.volatility.bollinger_mavg(close=df['close']),200)
print('-----------------------------------')
print('aroon')
print(ta.trend.aroon_up(close=df['close']),200)
print(ta.trend.aroon_down(close=df['close']),200)
print('-----------------------------------')
print('dpo')
print(ta.trend.dpo(close=df['close']),200)
print('-----------------------------------')
print('ema_indicator')
print(ta.trend.ema_indicator(close=df['close']),200)
print('-----------------------------------')
print('sma_indicator')
print(ta.trend.sma_indicator(close=df['close']),200)
print('-----------------------------------')
print('trix')
print(ta.trend.trix(close=df['close']),200)
print('-----------------------------------')
print('cumulative_return')
print(ta.others.cumulative_return(close=df['close']),200)
print('-----------------------------------')
print('daily_log_return')
print(ta.others.daily_log_return(close=df['close']),200)
print('-----------------------------------')
print('daily_return')
print(ta.others.daily_return(close=df['close']),200)
print('-----------------------------------')
| [
11748,
19798,
292,
355,
279,
67,
198,
11748,
20486,
198,
198,
2,
8778,
1366,
198,
7568,
796,
279,
67,
13,
961,
62,
40664,
10786,
9019,
13,
40664,
3256,
41767,
28,
3256,
11537,
198,
198,
2,
5985,
15709,
3815,
198,
7568,
796,
20486,
13,
26791,
13,
14781,
2616,
7,
7568,
8,
198,
198,
4798,
10786,
12204,
11537,
198,
4798,
7,
8326,
13,
32542,
298,
388,
13,
12204,
7,
19836,
28,
7568,
17816,
19836,
20520,
828,
1821,
8,
198,
4798,
10786,
3880,
6329,
11537,
198,
4798,
10786,
3808,
72,
11537,
198,
4798,
7,
8326,
13,
32542,
298,
388,
13,
3808,
72,
7,
19836,
28,
7568,
17816,
19836,
20520,
828,
1415,
8,
198,
4798,
10786,
3880,
6329,
11537,
198,
4798,
10786,
65,
692,
3889,
62,
76,
615,
70,
11537,
198,
4798,
7,
8326,
13,
10396,
18486,
13,
65,
692,
3889,
62,
76,
615,
70,
7,
19836,
28,
7568,
17816,
19836,
20520,
828,
2167,
8,
198,
4798,
10786,
3880,
6329,
11537,
198,
4798,
10786,
283,
2049,
11537,
198,
4798,
7,
8326,
13,
83,
10920,
13,
283,
2049,
62,
929,
7,
19836,
28,
7568,
17816,
19836,
20520,
828,
2167,
8,
198,
4798,
7,
8326,
13,
83,
10920,
13,
283,
2049,
62,
2902,
7,
19836,
28,
7568,
17816,
19836,
20520,
828,
2167,
8,
198,
4798,
10786,
3880,
6329,
11537,
198,
4798,
10786,
67,
7501,
11537,
198,
4798,
7,
8326,
13,
83,
10920,
13,
67,
7501,
7,
19836,
28,
7568,
17816,
19836,
20520,
828,
2167,
8,
198,
4798,
10786,
3880,
6329,
11537,
198,
4798,
10786,
19687,
62,
521,
26407,
11537,
198,
4798,
7,
8326,
13,
83,
10920,
13,
19687,
62,
521,
26407,
7,
19836,
28,
7568,
17816,
19836,
20520,
828,
2167,
8,
198,
4798,
10786,
3880,
6329,
11537,
198,
4798,
10786,
82,
2611,
62,
521,
26407,
11537,
198,
4798,
7,
8326,
13,
83,
10920,
13,
82,
2611,
62,
521,
26407,
7,
19836,
28,
7568,
17816,
19836,
20520,
828,
2167,
8,
198,
4798,
10786,
3880,
6329,
11537,
198,
4798,
10786,
83,
8609,
11537,
198,
4798,
7,
8326,
13,
83,
10920,
13,
83,
8609,
7,
19836,
28,
7568,
17816,
19836,
20520,
828,
2167,
8,
198,
4798,
10786,
3880,
6329,
11537,
198,
4798,
10786,
36340,
13628,
62,
7783,
11537,
198,
4798,
7,
8326,
13,
847,
82,
13,
36340,
13628,
62,
7783,
7,
19836,
28,
7568,
17816,
19836,
20520,
828,
2167,
8,
198,
4798,
10786,
3880,
6329,
11537,
198,
4798,
10786,
29468,
62,
6404,
62,
7783,
11537,
198,
4798,
7,
8326,
13,
847,
82,
13,
29468,
62,
6404,
62,
7783,
7,
19836,
28,
7568,
17816,
19836,
20520,
828,
2167,
8,
198,
4798,
10786,
3880,
6329,
11537,
198,
4798,
10786,
29468,
62,
7783,
11537,
198,
4798,
7,
8326,
13,
847,
82,
13,
29468,
62,
7783,
7,
19836,
28,
7568,
17816,
19836,
20520,
828,
2167,
8,
198,
4798,
10786,
3880,
6329,
11537,
198
] | 3.132609 | 460 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author: dpaslaru
# @Date: 2014-09-17 18:36:03
# @Last Modified by: dpaslaru
# @Last Modified time: 2014-09-17 19:40:59
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2488,
13838,
25,
288,
44429,
75,
11493,
198,
2,
2488,
10430,
25,
220,
220,
1946,
12,
2931,
12,
1558,
1248,
25,
2623,
25,
3070,
198,
2,
2488,
5956,
40499,
416,
25,
220,
220,
288,
44429,
75,
11493,
198,
2,
2488,
5956,
40499,
640,
25,
1946,
12,
2931,
12,
1558,
678,
25,
1821,
25,
3270,
198
] | 2.177215 | 79 |
#!/usr/bin/env python3
"""
Script for extracting a JSON payload for plotting from VarScan VCF files
annotated with VEP.
Only samples with calls are returned.
If a file containing Ensembl IDs (one per line) is supplied, only records
associated with the IDs are returned.
Requirements:
* Python 3.x
* PyVCF 0.6.7 <https://pyvcf.readthedocs.org>
* Click 5.1 <http://click.pocoo.org/>
Input requirements:
* VCF output from VarScan (may contain more than one samples).
* May or may not be gzipped.
* Must have been annotated using VEP with the `--allele_number` flag.
This tool was tested using VCF files generated using:
* VarScan v2.3.7 (mpileup2cns).
* VEP (Ensembl tools 77, GRCh 38 assembly).
Copyright (c) 2015 Leiden University Medical Center <http://lumc.nl>
All rights reserved.
"""
import json
import os
import re
import sys
from functools import partial
from os import path
import click
import vcf
from pybedtools import BedTool, Interval
__author__ = "Wibowo Arindrarto"
__contact__ = "[email protected]"
__all__ = []
# Mapping of VEP consequence to its predicted impact
# Source: http://www.ensembl.org/info/genome/variation/predicted_data.html
VEP_IMPACTS = {
"TFBS_amplification": "MODIFIER",
"regulatory_region_amplification": "MODIFIER",
"5_prime_UTR_variant": "MODIFIER",
"regulatory_region_ablation": "MODERATE",
"start_lost": "HIGH",
"intron_variant": "MODIFIER",
"inframe_insertion": "HIGH",
"non_coding_transcript_exon_variant": "MODIFIER",
"synonymous_variant": "LOW",
"mature_miRNA_variant": "MODIFIER",
"splice_donor_variant": "MODERATE",
"3_prime_UTR_variant": "MODIFIER",
"feature_truncation": "MODIFIER",
"TF_binding_site_variant": "MODIFIER",
"splice_acceptor_variant": "MODERATE",
"transcript_amplification": "HIGH",
"upstream_gene_variant": "MODIFIER",
"stop_lost": "HIGH",
"stop_retained_variant": "LOW",
"inframe_deletion": "HIGH",
"TFBS_ablation": "MODIFIER",
"stop_gained": "HIGH",
"regulatory_region_variant": "MODIFIER",
"incomplete_terminal_codon_variant": "LOW",
"intergenic_variant": "MODIFIER",
"downstream_gene_variant": "MODIFIER",
"splice_region_variant": "LOW",
"transcript_ablation": "HIGH",
"protein_altering_variant": "HIGH",
"frameshift_variant": "HIGH",
"feature_elongation": "MODIFIER",
"NMD_transcript_variant": "MODIFIER",
"coding_sequence_variant": "MODIFIER",
"missense_variant": "HIGH",
"non_coding_transcript_variant": "MODIFIER",
}
CSQ_NAME = "CSQ"
af_1kg_below_1pct = partial(af_below, 0.01, "1KG_P3_AF")
af_1kg_below_5pct = partial(af_below, 0.05, "1KG_P3_AF")
all_af_subpop_below_1pct = partial(all_af_subpop_below, 0.01)
all_af_subpop_below_5pct = partial(all_af_subpop_below, 0.05)
def vcfrec2interval(record):
"""Given a VCF record object, return a pybedtools Interval object."""
# NOTE: we need to do coordinate conversion manually
return Interval(record.CHROM, record.POS - 1, record.POS)
def make_record_extractor(reader, csq_info_name=CSQ_NAME):
"""Creates a function for extracting the records of the given VCF."""
# regex for checking whether a string can be converted to int
is_int = re.compile(r'^([-+]?\d+)L?$')
# regex for checking whether a string can be converted to float
is_decimal = re.compile(r'^([-+]?\d*\.?\d+(?:[eE][-+]?[0-9]+)?)$')
# samples in this VCF file
samples = reader.samples
split_attrs = set(["Consequence", "Existing_variation", "TREMBL"])
# Assumes the VEP formatting is given as the last space-separated
# string in the VCF header.
vep_keys = reader.infos[csq_info_name].desc.split(" ")[-1].split("|")
def convert_token(tok):
"""Given a string token, tries to convert it to int or float
if possible. Empty strings are converted to None."""
if isinstance(tok, str):
if is_int.match(tok):
return int(tok)
if is_decimal.match(tok):
return float(tok)
if not tok:
return
return tok
def get_s_alleles(sample_call, alleles):
"""Given a sample call and all the alleles present in a VCF record,
return the alleles called in the sample and its number."""
phase_char = sample_call.gt_phase_char()
num_alleles = sample_call.data.GT.split(phase_char)
allele_nums = [int(n) for n in num_alleles]
return [alleles.__getitem__(n) for n in allele_nums], allele_nums
def get_vep_impact(vep_cons):
"""Given a VEP consequence string, return its impact. If there are
multiple consequences, returns the most severe impact."""
if "&" in vep_cons:
vep_conss = vep_cons.split("&")
impacts = set([get_vep_impact(v) for v in vep_conss])
if len(impacts) == 1:
return impacts.pop()
elif "HIGH" in impacts:
return "HIGH"
elif "MODERATE" in impacts:
return "MODERATE"
elif "LOW" in impacts:
return "LOW"
elif "MODIFIER" in impacts:
return "MODIFIER"
assert False
return VEP_IMPACTS.get(vep_cons, "UNKNOWN")
def parse_raw_vep(raw_str, keep_ampersand):
"""Parses the given raw VEP string into a dictionary. If the number
of fields and values do not match, None is returned."""
values = [convert_token(x) for x in raw_str.split("|")]
if len(vep_keys) == len(values):
res = {k: v for k, v in zip(vep_keys, values) if v is not None}
assert "impact" not in res
res["impact"] = get_vep_impact(res["Consequence"])
if not keep_ampersand:
for attr in split_attrs:
res = split_if_exists(res, attr)
return res
raise click.ClickException("Unexpected VEP values in string '{0}'"
"".format(raw_str))
def extract_sample_data(record, sample, vep_data, hotspot_ivals):
"""Given a record, a sample name, and a parsed VEP annotation, return
the sample data."""
alleles = [record.REF] + [str(x) for x in record.ALT]
call = record.genotype(sample)
data = call.data
if data.GT is None or not call.called:
vep_data = []
varscan_ok = {}
else:
s_alleles, s_allele_nums = get_s_alleles(call, alleles)
vep_data = [v for v in vep_data
if int(v.get("ALLELE_NUM")) in s_allele_nums]
varscan_data = [(k, convert_token(getattr(data, k)))
for k in data._fields]
genotype = "{0}/{0}".format(s_alleles[0]) if len(s_alleles) == 1 \
else "/".join(s_alleles)
varscan_data += [
("CHROM", record.CHROM),
("POS", record.POS),
("REF", record.REF),
("ALT", [str(a) for a in record.ALT]),
("alleles", s_alleles),
("genotype", genotype)]
in_hotspot = None
if hotspot_ivals is not None:
ival = vcfrec2interval(record)
in_hotspot = bool(hotspot_ivals.any_hits(ival))
varscan_data.append(("is_in_hotspot", in_hotspot))
# custom af keys
af = {}
for custom_info_key in ("GONL", "GONL_AF", "P3", "P3_AF",
"P3_AFR_AF", "P3_AMR_AF", "P3_EAS_AF",
"P3_EUR_AF", "P3_SAS_AF"):
key_val = vep_data[0].get(custom_info_key)
if key_val is not None:
key_val = list(map(str, [key_val]))
custom_info_key = custom_info_key.replace("P3", "1KG_P3")
key_val = map(lambda x: ":".join(x),
zip([str(x) for x in record.ALT], key_val))
af[custom_info_key] = list(key_val)
for k, v in af.items():
varscan_data.append((k, v))
varscan_ok = {k: v for k, v in varscan_data}
filters = []
clean_bases_ratio = \
(varscan_ok["RD"] + varscan_ok["AD"]) / varscan_ok["DP"]
clean_filter_ok = clean_bases_ratio > 0.2
if not af_1kg_below_5pct(varscan_ok, vep_data):
filters.append("1KGAFAtLeast5Pct")
if not all_af_subpop_below_5pct(varscan_ok, vep_data):
filters.append("SubpopAFAtLeast5Pct")
if not clean_filter_ok:
filters.append("LowQualBases")
assert "filters" not in varscan_ok
varscan_ok["filters"] = filters
return {
"sample": sample,
"vep": vep_data,
"varscan": varscan_ok,
}
def extractor(gene_ids, keep_ampersand, filter_goi, hotspot_ivals,
record):
"""Function for extracting records into a dictionary."""
toi_ids = set([toi_id for ids in gene_ids.values()
for toi_id in ids])
onames_key = "Existing_variation"
csq_values = record.INFO[csq_info_name]
vep_data = [parse_raw_vep(x, keep_ampersand) for x in csq_values]
# select only variants affecting genes of interest
if filter_goi:
goi_data = [x for x in vep_data if x.get("Gene") in gene_ids]
else:
goi_data = [x for x in vep_data]
toi_data = list(map(annotate_toi, goi_data))
sample_data = [extract_sample_data(record, k, toi_data, hotspot_ivals)
for k in samples]
return sample_data
return extractor
def group(extracted_iter, sample_names, gene_ids):
"""Given the raw dictionary results, group into per-sample,
per-gene dictionary."""
samples = {s: {} for s in sample_names}
dns = ("vep", "varscan")
for lined in extracted_iter:
for sampled in lined:
sample = sampled["sample"]
entry = {dn: sampled[dn] for dn in dns}
# select only variants with VEP annotation
if entry["vep"]:
for gene_id in gene_ids:
if gene_id not in samples[sample]:
samples[sample][gene_id] = []
gene_varscan = entry["varscan"]
gene_vep = [x for x in entry["vep"]
if x["Gene"] == gene_id]
if gene_vep:
gene_entry = {
"vep": gene_vep,
"varscan": gene_varscan,
"sample": sample,
"gene": gene_id
}
samples[sample][gene_id].append(gene_entry)
return samples
def parse_id_file(fh):
"""Parses the given ID file handle into a dictionary between ENSG IDs and
ENST IDs."""
# discard header line
fh.readline()
id_mapping = {gid: tid.split(",")
for gid, _, tid in (line.strip().split("\t") for line in fh)}
return id_mapping
@click.command()
@click.argument("id_file",
type=click.File())
@click.argument("input_vcf",
type=click.Path(dir_okay=False))
@click.option("--keep-amp", default=False, is_flag=True,
help="Whether to keep ampersand-separated VEP values as strings"
"or split them into a list.")
@click.option("--hotspots", default=None,
type=click.Path(exists=True, file_okay=True, dir_okay=False),
help="Path to a BED file containing hotspots region. The "
"regions will be annotated in the output JSON file.")
@click.option("--sample-id", type=str,
help="Set VCF sample name to the given value. If there are "
"more than one samples in the VCF, this flag is ignored.")
# TODO: add option for pretty output (default now is compact)
if __name__ == "__main__":
main.__doc__ = __doc__
main()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
37811,
198,
7391,
329,
37895,
257,
19449,
21437,
329,
29353,
422,
12372,
33351,
569,
22495,
3696,
198,
34574,
515,
351,
569,
8905,
13,
198,
198,
10049,
8405,
351,
3848,
389,
4504,
13,
198,
198,
1532,
257,
2393,
7268,
2039,
4428,
75,
32373,
357,
505,
583,
1627,
8,
318,
14275,
11,
691,
4406,
198,
32852,
351,
262,
32373,
389,
4504,
13,
198,
198,
42249,
25,
198,
220,
220,
220,
1635,
11361,
513,
13,
87,
198,
220,
220,
220,
1635,
9485,
15922,
37,
657,
13,
21,
13,
22,
1279,
5450,
1378,
9078,
85,
12993,
13,
961,
83,
704,
420,
82,
13,
2398,
29,
198,
220,
220,
220,
1635,
6914,
642,
13,
16,
1279,
4023,
1378,
12976,
13,
79,
420,
2238,
13,
2398,
15913,
198,
198,
20560,
5359,
25,
198,
220,
220,
220,
1635,
569,
22495,
5072,
422,
12372,
33351,
357,
11261,
3994,
517,
621,
530,
8405,
737,
198,
220,
220,
220,
1635,
1737,
393,
743,
407,
307,
308,
89,
3949,
13,
198,
220,
220,
220,
1635,
12039,
423,
587,
24708,
515,
1262,
569,
8905,
351,
262,
4600,
438,
6765,
293,
62,
17618,
63,
6056,
13,
198,
198,
1212,
2891,
373,
6789,
1262,
569,
22495,
3696,
7560,
1262,
25,
198,
220,
220,
220,
1635,
12372,
33351,
410,
17,
13,
18,
13,
22,
357,
3149,
576,
929,
17,
66,
5907,
737,
198,
220,
220,
220,
1635,
569,
8905,
357,
4834,
4428,
75,
4899,
8541,
11,
10863,
1925,
4353,
10474,
737,
628,
198,
15269,
357,
66,
8,
1853,
1004,
14029,
2059,
8366,
3337,
1279,
4023,
1378,
75,
388,
66,
13,
21283,
29,
198,
3237,
2489,
10395,
13,
198,
198,
37811,
198,
198,
11748,
33918,
198,
11748,
28686,
198,
11748,
302,
198,
11748,
25064,
198,
6738,
1257,
310,
10141,
1330,
13027,
198,
6738,
28686,
1330,
3108,
198,
198,
11748,
3904,
198,
11748,
410,
12993,
198,
6738,
12972,
3077,
31391,
1330,
15585,
25391,
11,
4225,
2100,
198,
198,
834,
9800,
834,
796,
366,
54,
571,
322,
78,
943,
521,
81,
433,
78,
1,
198,
834,
32057,
834,
796,
366,
86,
13,
283,
521,
81,
433,
78,
31,
75,
388,
66,
13,
21283,
1,
198,
198,
834,
439,
834,
796,
17635,
198,
198,
2,
337,
5912,
286,
569,
8905,
12921,
284,
663,
11001,
2928,
198,
2,
8090,
25,
2638,
1378,
2503,
13,
1072,
2022,
75,
13,
2398,
14,
10951,
14,
5235,
462,
14,
25641,
341,
14,
28764,
5722,
62,
7890,
13,
6494,
198,
6089,
47,
62,
3955,
44938,
4694,
796,
1391,
198,
220,
220,
220,
366,
10234,
4462,
62,
321,
489,
2649,
1298,
366,
33365,
5064,
38311,
1600,
198,
220,
220,
220,
366,
2301,
21386,
62,
36996,
62,
321,
489,
2649,
1298,
366,
33365,
5064,
38311,
1600,
198,
220,
220,
220,
366,
20,
62,
35505,
62,
3843,
49,
62,
25641,
415,
1298,
366,
33365,
5064,
38311,
1600,
198,
220,
220,
220,
366,
2301,
21386,
62,
36996,
62,
397,
7592,
1298,
366,
33365,
1137,
6158,
1600,
198,
220,
220,
220,
366,
9688,
62,
33224,
1298,
366,
39,
18060,
1600,
198,
220,
220,
220,
366,
600,
1313,
62,
25641,
415,
1298,
366,
33365,
5064,
38311,
1600,
198,
220,
220,
220,
366,
259,
14535,
62,
28463,
295,
1298,
366,
39,
18060,
1600,
198,
220,
220,
220,
366,
13159,
62,
66,
7656,
62,
7645,
6519,
62,
1069,
261,
62,
25641,
415,
1298,
366,
33365,
5064,
38311,
1600,
198,
220,
220,
220,
366,
28869,
6704,
62,
25641,
415,
1298,
366,
43,
3913,
1600,
198,
220,
220,
220,
366,
76,
1300,
62,
11632,
27204,
62,
25641,
415,
1298,
366,
33365,
5064,
38311,
1600,
198,
220,
220,
220,
366,
22018,
501,
62,
9099,
273,
62,
25641,
415,
1298,
366,
33365,
1137,
6158,
1600,
198,
220,
220,
220,
366,
18,
62,
35505,
62,
3843,
49,
62,
25641,
415,
1298,
366,
33365,
5064,
38311,
1600,
198,
220,
220,
220,
366,
30053,
62,
2213,
19524,
341,
1298,
366,
33365,
5064,
38311,
1600,
198,
220,
220,
220,
366,
10234,
62,
30786,
62,
15654,
62,
25641,
415,
1298,
366,
33365,
5064,
38311,
1600,
198,
220,
220,
220,
366,
22018,
501,
62,
13635,
273,
62,
25641,
415,
1298,
366,
33365,
1137,
6158,
1600,
198,
220,
220,
220,
366,
7645,
6519,
62,
321,
489,
2649,
1298,
366,
39,
18060,
1600,
198,
220,
220,
220,
366,
929,
5532,
62,
70,
1734,
62,
25641,
415,
1298,
366,
33365,
5064,
38311,
1600,
198,
220,
220,
220,
366,
11338,
62,
33224,
1298,
366,
39,
18060,
1600,
198,
220,
220,
220,
366,
11338,
62,
1186,
1328,
62,
25641,
415,
1298,
366,
43,
3913,
1600,
198,
220,
220,
220,
366,
259,
14535,
62,
2934,
1616,
295,
1298,
366,
39,
18060,
1600,
198,
220,
220,
220,
366,
10234,
4462,
62,
397,
7592,
1298,
366,
33365,
5064,
38311,
1600,
198,
220,
220,
220,
366,
11338,
62,
70,
1328,
1298,
366,
39,
18060,
1600,
198,
220,
220,
220,
366,
2301,
21386,
62,
36996,
62,
25641,
415,
1298,
366,
33365,
5064,
38311,
1600,
198,
220,
220,
220,
366,
259,
20751,
62,
23705,
282,
62,
19815,
261,
62,
25641,
415,
1298,
366,
43,
3913,
1600,
198,
220,
220,
220,
366,
3849,
38516,
62,
25641,
415,
1298,
366,
33365,
5064,
38311,
1600,
198,
220,
220,
220,
366,
2902,
5532,
62,
70,
1734,
62,
25641,
415,
1298,
366,
33365,
5064,
38311,
1600,
198,
220,
220,
220,
366,
22018,
501,
62,
36996,
62,
25641,
415,
1298,
366,
43,
3913,
1600,
198,
220,
220,
220,
366,
7645,
6519,
62,
397,
7592,
1298,
366,
39,
18060,
1600,
198,
220,
220,
220,
366,
48693,
62,
282,
20212,
62,
25641,
415,
1298,
366,
39,
18060,
1600,
198,
220,
220,
220,
366,
19298,
5069,
2135,
62,
25641,
415,
1298,
366,
39,
18060,
1600,
198,
220,
220,
220,
366,
30053,
62,
21537,
341,
1298,
366,
33365,
5064,
38311,
1600,
198,
220,
220,
220,
366,
45,
12740,
62,
7645,
6519,
62,
25641,
415,
1298,
366,
33365,
5064,
38311,
1600,
198,
220,
220,
220,
366,
66,
7656,
62,
43167,
62,
25641,
415,
1298,
366,
33365,
5064,
38311,
1600,
198,
220,
220,
220,
366,
3927,
1072,
62,
25641,
415,
1298,
366,
39,
18060,
1600,
198,
220,
220,
220,
366,
13159,
62,
66,
7656,
62,
7645,
6519,
62,
25641,
415,
1298,
366,
33365,
5064,
38311,
1600,
198,
92,
198,
7902,
48,
62,
20608,
796,
366,
7902,
48,
1,
628,
628,
198,
1878,
62,
16,
10025,
62,
35993,
62,
16,
79,
310,
796,
13027,
7,
1878,
62,
35993,
11,
657,
13,
486,
11,
366,
16,
42,
38,
62,
47,
18,
62,
8579,
4943,
198,
1878,
62,
16,
10025,
62,
35993,
62,
20,
79,
310,
796,
13027,
7,
1878,
62,
35993,
11,
657,
13,
2713,
11,
366,
16,
42,
38,
62,
47,
18,
62,
8579,
4943,
198,
439,
62,
1878,
62,
7266,
12924,
62,
35993,
62,
16,
79,
310,
796,
13027,
7,
439,
62,
1878,
62,
7266,
12924,
62,
35993,
11,
657,
13,
486,
8,
198,
439,
62,
1878,
62,
7266,
12924,
62,
35993,
62,
20,
79,
310,
796,
13027,
7,
439,
62,
1878,
62,
7266,
12924,
62,
35993,
11,
657,
13,
2713,
8,
628,
198,
4299,
410,
12993,
8344,
17,
3849,
2100,
7,
22105,
2599,
198,
220,
220,
220,
37227,
15056,
257,
569,
22495,
1700,
2134,
11,
1441,
257,
12972,
3077,
31391,
4225,
2100,
2134,
526,
15931,
198,
220,
220,
220,
1303,
24550,
25,
356,
761,
284,
466,
20435,
11315,
14500,
198,
220,
220,
220,
1441,
4225,
2100,
7,
22105,
13,
3398,
33676,
11,
1700,
13,
37997,
532,
352,
11,
1700,
13,
37997,
8,
628,
198,
4299,
787,
62,
22105,
62,
2302,
40450,
7,
46862,
11,
269,
31166,
62,
10951,
62,
3672,
28,
7902,
48,
62,
20608,
2599,
198,
220,
220,
220,
37227,
16719,
274,
257,
2163,
329,
37895,
262,
4406,
286,
262,
1813,
569,
22495,
526,
15931,
628,
220,
220,
220,
1303,
40364,
329,
10627,
1771,
257,
4731,
460,
307,
11513,
284,
493,
198,
220,
220,
220,
318,
62,
600,
796,
302,
13,
5589,
576,
7,
81,
6,
61,
26933,
19529,
60,
30,
59,
67,
28988,
43,
30,
3,
11537,
198,
220,
220,
220,
1303,
40364,
329,
10627,
1771,
257,
4731,
460,
307,
11513,
284,
12178,
198,
220,
220,
220,
318,
62,
12501,
4402,
796,
302,
13,
5589,
576,
7,
81,
6,
61,
26933,
19529,
60,
30,
59,
67,
9,
17405,
30,
59,
67,
33747,
27514,
58,
68,
36,
7131,
19529,
60,
30,
58,
15,
12,
24,
60,
28988,
10091,
3,
11537,
198,
220,
220,
220,
1303,
8405,
287,
428,
569,
22495,
2393,
198,
220,
220,
220,
8405,
796,
9173,
13,
82,
12629,
198,
220,
220,
220,
6626,
62,
1078,
3808,
796,
900,
7,
14692,
34,
40819,
594,
1600,
366,
3109,
9665,
62,
25641,
341,
1600,
366,
51,
40726,
9148,
8973,
8,
198,
220,
220,
220,
1303,
2195,
8139,
262,
569,
8905,
33313,
318,
1813,
355,
262,
938,
2272,
12,
25512,
515,
198,
220,
220,
220,
1303,
4731,
287,
262,
569,
22495,
13639,
13,
198,
220,
220,
220,
1569,
79,
62,
13083,
796,
9173,
13,
10745,
418,
58,
6359,
80,
62,
10951,
62,
3672,
4083,
20147,
13,
35312,
7203,
366,
38381,
12,
16,
4083,
35312,
7203,
91,
4943,
628,
220,
220,
220,
825,
10385,
62,
30001,
7,
83,
482,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
15056,
257,
4731,
11241,
11,
8404,
284,
10385,
340,
284,
493,
393,
12178,
198,
220,
220,
220,
220,
220,
220,
220,
611,
1744,
13,
33523,
13042,
389,
11513,
284,
6045,
526,
15931,
198,
220,
220,
220,
220,
220,
220,
220,
611,
318,
39098,
7,
83,
482,
11,
965,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
318,
62,
600,
13,
15699,
7,
83,
482,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
493,
7,
83,
482,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
318,
62,
12501,
4402,
13,
15699,
7,
83,
482,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
12178,
7,
83,
482,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
407,
284,
74,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
284,
74,
628,
220,
220,
220,
825,
651,
62,
82,
62,
6765,
829,
7,
39873,
62,
13345,
11,
28654,
829,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
15056,
257,
6291,
869,
290,
477,
262,
28654,
829,
1944,
287,
257,
569,
22495,
1700,
11,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
262,
28654,
829,
1444,
287,
262,
6291,
290,
663,
1271,
526,
15931,
198,
220,
220,
220,
220,
220,
220,
220,
7108,
62,
10641,
796,
6291,
62,
13345,
13,
13655,
62,
40715,
62,
10641,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
997,
62,
6765,
829,
796,
6291,
62,
13345,
13,
7890,
13,
19555,
13,
35312,
7,
40715,
62,
10641,
8,
198,
220,
220,
220,
220,
220,
220,
220,
45907,
62,
77,
5700,
796,
685,
600,
7,
77,
8,
329,
299,
287,
997,
62,
6765,
829,
60,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
685,
6765,
829,
13,
834,
1136,
9186,
834,
7,
77,
8,
329,
299,
287,
45907,
62,
77,
5700,
4357,
45907,
62,
77,
5700,
628,
220,
220,
220,
825,
651,
62,
303,
79,
62,
48240,
7,
303,
79,
62,
5936,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
15056,
257,
569,
8905,
12921,
4731,
11,
1441,
663,
2928,
13,
1002,
612,
389,
198,
220,
220,
220,
220,
220,
220,
220,
3294,
6948,
11,
5860,
262,
749,
6049,
2928,
526,
15931,
198,
220,
220,
220,
220,
220,
220,
220,
611,
366,
5,
1,
287,
1569,
79,
62,
5936,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1569,
79,
62,
5936,
82,
796,
1569,
79,
62,
5936,
13,
35312,
7203,
5,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
12751,
796,
900,
26933,
1136,
62,
303,
79,
62,
48240,
7,
85,
8,
329,
410,
287,
1569,
79,
62,
5936,
82,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
18896,
7,
11011,
8656,
8,
6624,
352,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
12751,
13,
12924,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1288,
361,
366,
39,
18060,
1,
287,
12751,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
366,
39,
18060,
1,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1288,
361,
366,
33365,
1137,
6158,
1,
287,
12751,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
366,
33365,
1137,
6158,
1,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1288,
361,
366,
43,
3913,
1,
287,
12751,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
366,
43,
3913,
1,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1288,
361,
366,
33365,
5064,
38311,
1,
287,
12751,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
366,
33365,
5064,
38311,
1,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6818,
10352,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
569,
8905,
62,
3955,
44938,
4694,
13,
1136,
7,
303,
79,
62,
5936,
11,
366,
4944,
44706,
4943,
628,
220,
220,
220,
825,
21136,
62,
1831,
62,
303,
79,
7,
1831,
62,
2536,
11,
1394,
62,
696,
364,
392,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
47,
945,
274,
262,
1813,
8246,
569,
8905,
4731,
656,
257,
22155,
13,
1002,
262,
1271,
198,
220,
220,
220,
220,
220,
220,
220,
286,
7032,
290,
3815,
466,
407,
2872,
11,
6045,
318,
4504,
526,
15931,
198,
220,
220,
220,
220,
220,
220,
220,
3815,
796,
685,
1102,
1851,
62,
30001,
7,
87,
8,
329,
2124,
287,
8246,
62,
2536,
13,
35312,
7203,
91,
4943,
60,
198,
220,
220,
220,
220,
220,
220,
220,
611,
18896,
7,
303,
79,
62,
13083,
8,
6624,
18896,
7,
27160,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
581,
796,
1391,
74,
25,
410,
329,
479,
11,
410,
287,
19974,
7,
303,
79,
62,
13083,
11,
3815,
8,
611,
410,
318,
407,
6045,
92,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6818,
366,
48240,
1,
407,
287,
581,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
581,
14692,
48240,
8973,
796,
651,
62,
303,
79,
62,
48240,
7,
411,
14692,
34,
40819,
594,
8973,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
407,
1394,
62,
696,
364,
392,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
708,
81,
287,
6626,
62,
1078,
3808,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
581,
796,
6626,
62,
361,
62,
1069,
1023,
7,
411,
11,
708,
81,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
581,
198,
220,
220,
220,
220,
220,
220,
220,
5298,
3904,
13,
8164,
16922,
7203,
52,
42072,
569,
8905,
3815,
287,
4731,
705,
90,
15,
92,
29653,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
1911,
18982,
7,
1831,
62,
2536,
4008,
628,
220,
220,
220,
825,
7925,
62,
39873,
62,
7890,
7,
22105,
11,
6291,
11,
1569,
79,
62,
7890,
11,
33915,
13059,
62,
10336,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
15056,
257,
1700,
11,
257,
6291,
1438,
11,
290,
257,
44267,
569,
8905,
23025,
11,
1441,
198,
220,
220,
220,
220,
220,
220,
220,
262,
6291,
1366,
526,
15931,
198,
220,
220,
220,
220,
220,
220,
220,
28654,
829,
796,
685,
22105,
13,
31688,
60,
1343,
685,
2536,
7,
87,
8,
329,
2124,
287,
1700,
13,
31429,
60,
198,
220,
220,
220,
220,
220,
220,
220,
869,
796,
1700,
13,
5235,
8690,
7,
39873,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1366,
796,
869,
13,
7890,
628,
220,
220,
220,
220,
220,
220,
220,
611,
1366,
13,
19555,
318,
6045,
393,
407,
869,
13,
7174,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1569,
79,
62,
7890,
796,
17635,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
410,
945,
5171,
62,
482,
796,
23884,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
264,
62,
6765,
829,
11,
264,
62,
6765,
293,
62,
77,
5700,
796,
651,
62,
82,
62,
6765,
829,
7,
13345,
11,
28654,
829,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1569,
79,
62,
7890,
796,
685,
85,
329,
410,
287,
1569,
79,
62,
7890,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
493,
7,
85,
13,
1136,
7203,
1847,
2538,
2538,
62,
41359,
48774,
287,
264,
62,
6765,
293,
62,
77,
5700,
60,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
410,
945,
5171,
62,
7890,
796,
47527,
74,
11,
10385,
62,
30001,
7,
1136,
35226,
7,
7890,
11,
479,
22305,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
479,
287,
1366,
13557,
25747,
60,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2429,
8690,
796,
45144,
15,
92,
14,
90,
15,
92,
1911,
18982,
7,
82,
62,
6765,
829,
58,
15,
12962,
611,
18896,
7,
82,
62,
6765,
829,
8,
6624,
352,
3467,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2073,
12813,
1911,
22179,
7,
82,
62,
6765,
829,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
410,
945,
5171,
62,
7890,
15853,
685,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5855,
3398,
33676,
1600,
1700,
13,
3398,
33676,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5855,
37997,
1600,
1700,
13,
37997,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5855,
31688,
1600,
1700,
13,
31688,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5855,
31429,
1600,
685,
2536,
7,
64,
8,
329,
257,
287,
1700,
13,
31429,
46570,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5855,
6765,
829,
1600,
264,
62,
6765,
829,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5855,
5235,
8690,
1600,
2429,
8690,
15437,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
287,
62,
17398,
13059,
796,
6045,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
33915,
13059,
62,
10336,
318,
407,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2473,
796,
410,
12993,
8344,
17,
3849,
2100,
7,
22105,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
287,
62,
17398,
13059,
796,
20512,
7,
17398,
13059,
62,
10336,
13,
1092,
62,
71,
896,
7,
2473,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
410,
945,
5171,
62,
7890,
13,
33295,
7,
7203,
271,
62,
259,
62,
17398,
13059,
1600,
287,
62,
17398,
13059,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
2183,
6580,
8251,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6580,
796,
23884,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
2183,
62,
10951,
62,
2539,
287,
5855,
38,
1340,
43,
1600,
366,
38,
1340,
43,
62,
8579,
1600,
366,
47,
18,
1600,
366,
47,
18,
62,
8579,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
47,
18,
62,
8579,
49,
62,
8579,
1600,
366,
47,
18,
62,
2390,
49,
62,
8579,
1600,
366,
47,
18,
62,
36,
1921,
62,
8579,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
47,
18,
62,
36,
4261,
62,
8579,
1600,
366,
47,
18,
62,
50,
1921,
62,
8579,
1,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1994,
62,
2100,
796,
1569,
79,
62,
7890,
58,
15,
4083,
1136,
7,
23144,
62,
10951,
62,
2539,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
1994,
62,
2100,
318,
407,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1994,
62,
2100,
796,
1351,
7,
8899,
7,
2536,
11,
685,
2539,
62,
2100,
60,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2183,
62,
10951,
62,
2539,
796,
2183,
62,
10951,
62,
2539,
13,
33491,
7203,
47,
18,
1600,
366,
16,
42,
38,
62,
47,
18,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1994,
62,
2100,
796,
3975,
7,
50033,
2124,
25,
366,
25,
1911,
22179,
7,
87,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
19974,
26933,
2536,
7,
87,
8,
329,
2124,
287,
1700,
13,
31429,
4357,
1994,
62,
2100,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6580,
58,
23144,
62,
10951,
62,
2539,
60,
796,
1351,
7,
2539,
62,
2100,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
479,
11,
410,
287,
6580,
13,
23814,
33529,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
410,
945,
5171,
62,
7890,
13,
33295,
19510,
74,
11,
410,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
410,
945,
5171,
62,
482,
796,
1391,
74,
25,
410,
329,
479,
11,
410,
287,
410,
945,
5171,
62,
7890,
92,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
16628,
796,
17635,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3424,
62,
65,
1386,
62,
10366,
952,
796,
3467,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
357,
85,
945,
5171,
62,
482,
14692,
35257,
8973,
1343,
410,
945,
5171,
62,
482,
14692,
2885,
8973,
8,
1220,
410,
945,
5171,
62,
482,
14692,
6322,
8973,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3424,
62,
24455,
62,
482,
796,
3424,
62,
65,
1386,
62,
10366,
952,
1875,
657,
13,
17,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
407,
6580,
62,
16,
10025,
62,
35993,
62,
20,
79,
310,
7,
85,
945,
5171,
62,
482,
11,
1569,
79,
62,
7890,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
16628,
13,
33295,
7203,
16,
42,
38,
8579,
2953,
3123,
459,
20,
47,
310,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
407,
477,
62,
1878,
62,
7266,
12924,
62,
35993,
62,
20,
79,
310,
7,
85,
945,
5171,
62,
482,
11,
1569,
79,
62,
7890,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
16628,
13,
33295,
7203,
7004,
12924,
8579,
2953,
3123,
459,
20,
47,
310,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
407,
3424,
62,
24455,
62,
482,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
16628,
13,
33295,
7203,
20535,
46181,
33,
1386,
4943,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6818,
366,
10379,
1010,
1,
407,
287,
410,
945,
5171,
62,
482,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
410,
945,
5171,
62,
482,
14692,
10379,
1010,
8973,
796,
16628,
628,
220,
220,
220,
220,
220,
220,
220,
1441,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
39873,
1298,
6291,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
303,
79,
1298,
1569,
79,
62,
7890,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
85,
945,
5171,
1298,
410,
945,
5171,
62,
482,
11,
198,
220,
220,
220,
220,
220,
220,
220,
1782,
628,
220,
220,
220,
825,
7925,
273,
7,
70,
1734,
62,
2340,
11,
1394,
62,
696,
364,
392,
11,
8106,
62,
2188,
72,
11,
33915,
13059,
62,
10336,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1700,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
22203,
329,
37895,
4406,
656,
257,
22155,
526,
15931,
628,
220,
220,
220,
220,
220,
220,
220,
284,
72,
62,
2340,
796,
900,
26933,
1462,
72,
62,
312,
329,
220,
2340,
287,
9779,
62,
2340,
13,
27160,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
284,
72,
62,
312,
287,
220,
2340,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
319,
1047,
62,
2539,
796,
366,
3109,
9665,
62,
25641,
341,
1,
628,
220,
220,
220,
220,
220,
220,
220,
269,
31166,
62,
27160,
796,
1700,
13,
10778,
58,
6359,
80,
62,
10951,
62,
3672,
60,
198,
220,
220,
220,
220,
220,
220,
220,
1569,
79,
62,
7890,
796,
685,
29572,
62,
1831,
62,
303,
79,
7,
87,
11,
1394,
62,
696,
364,
392,
8,
329,
2124,
287,
269,
31166,
62,
27160,
60,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
2922,
691,
17670,
13891,
10812,
286,
1393,
198,
220,
220,
220,
220,
220,
220,
220,
611,
8106,
62,
2188,
72,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
467,
72,
62,
7890,
796,
685,
87,
329,
2124,
287,
1569,
79,
62,
7890,
611,
2124,
13,
1136,
7203,
39358,
4943,
287,
9779,
62,
2340,
60,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
467,
72,
62,
7890,
796,
685,
87,
329,
2124,
287,
1569,
79,
62,
7890,
60,
198,
220,
220,
220,
220,
220,
220,
220,
284,
72,
62,
7890,
796,
1351,
7,
8899,
7,
34574,
378,
62,
1462,
72,
11,
467,
72,
62,
7890,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
6291,
62,
7890,
796,
685,
2302,
974,
62,
39873,
62,
7890,
7,
22105,
11,
479,
11,
284,
72,
62,
7890,
11,
33915,
13059,
62,
10336,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
479,
287,
8405,
60,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
6291,
62,
7890,
628,
220,
220,
220,
1441,
7925,
273,
628,
198,
4299,
1448,
7,
2302,
20216,
62,
2676,
11,
6291,
62,
14933,
11,
9779,
62,
2340,
2599,
198,
220,
220,
220,
37227,
15056,
262,
8246,
22155,
2482,
11,
1448,
656,
583,
12,
39873,
11,
198,
220,
220,
220,
583,
12,
70,
1734,
22155,
526,
15931,
198,
220,
220,
220,
8405,
796,
1391,
82,
25,
23884,
329,
264,
287,
6291,
62,
14933,
92,
198,
220,
220,
220,
288,
5907,
796,
5855,
303,
79,
1600,
366,
85,
945,
5171,
4943,
198,
220,
220,
220,
329,
16566,
287,
21242,
62,
2676,
25,
198,
220,
220,
220,
220,
220,
220,
220,
329,
35846,
287,
16566,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6291,
796,
35846,
14692,
39873,
8973,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5726,
796,
1391,
32656,
25,
35846,
58,
32656,
60,
329,
288,
77,
287,
288,
5907,
92,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
2922,
691,
17670,
351,
569,
8905,
23025,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
5726,
14692,
303,
79,
1,
5974,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
9779,
62,
312,
287,
9779,
62,
2340,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
9779,
62,
312,
407,
287,
8405,
58,
39873,
5974,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8405,
58,
39873,
7131,
70,
1734,
62,
312,
60,
796,
17635,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
9779,
62,
85,
945,
5171,
796,
5726,
14692,
85,
945,
5171,
8973,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
9779,
62,
303,
79,
796,
685,
87,
329,
2124,
287,
5726,
14692,
303,
79,
8973,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
2124,
14692,
39358,
8973,
6624,
9779,
62,
312,
60,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
9779,
62,
303,
79,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
9779,
62,
13000,
796,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
303,
79,
1298,
9779,
62,
303,
79,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
85,
945,
5171,
1298,
9779,
62,
85,
945,
5171,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
39873,
1298,
6291,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
70,
1734,
1298,
9779,
62,
312,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1782,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8405,
58,
39873,
7131,
70,
1734,
62,
312,
4083,
33295,
7,
70,
1734,
62,
13000,
8,
198,
220,
220,
220,
1441,
8405,
628,
198,
4299,
21136,
62,
312,
62,
7753,
7,
69,
71,
2599,
198,
220,
220,
220,
37227,
47,
945,
274,
262,
1813,
4522,
2393,
5412,
656,
257,
22155,
1022,
412,
8035,
38,
32373,
290,
198,
220,
220,
220,
12964,
2257,
32373,
526,
15931,
198,
220,
220,
220,
1303,
27537,
13639,
1627,
198,
220,
220,
220,
277,
71,
13,
961,
1370,
3419,
198,
220,
220,
220,
4686,
62,
76,
5912,
796,
1391,
70,
312,
25,
29770,
13,
35312,
7,
2430,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
308,
312,
11,
4808,
11,
29770,
287,
357,
1370,
13,
36311,
22446,
35312,
7203,
59,
83,
4943,
329,
1627,
287,
277,
71,
38165,
198,
220,
220,
220,
1441,
4686,
62,
76,
5912,
628,
198,
31,
12976,
13,
21812,
3419,
198,
31,
12976,
13,
49140,
7203,
312,
62,
7753,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2099,
28,
12976,
13,
8979,
28955,
198,
31,
12976,
13,
49140,
7203,
15414,
62,
85,
12993,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2099,
28,
12976,
13,
15235,
7,
15908,
62,
482,
323,
28,
25101,
4008,
198,
31,
12976,
13,
18076,
7203,
438,
14894,
12,
696,
1600,
4277,
28,
25101,
11,
318,
62,
32109,
28,
17821,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1037,
2625,
15354,
284,
1394,
716,
19276,
392,
12,
25512,
515,
569,
8905,
3815,
355,
13042,
1,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
273,
6626,
606,
656,
257,
1351,
19570,
198,
31,
12976,
13,
18076,
7203,
438,
17398,
40793,
1600,
4277,
28,
14202,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2099,
28,
12976,
13,
15235,
7,
1069,
1023,
28,
17821,
11,
2393,
62,
482,
323,
28,
17821,
11,
26672,
62,
482,
323,
28,
25101,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1037,
2625,
15235,
284,
257,
347,
1961,
2393,
7268,
33915,
40793,
3814,
13,
383,
366,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
2301,
507,
481,
307,
24708,
515,
287,
262,
5072,
19449,
2393,
19570,
198,
31,
12976,
13,
18076,
7203,
438,
39873,
12,
312,
1600,
2099,
28,
2536,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1037,
2625,
7248,
569,
22495,
6291,
1438,
284,
262,
1813,
1988,
13,
1002,
612,
389,
366,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
3549,
621,
530,
8405,
287,
262,
569,
22495,
11,
428,
6056,
318,
9514,
19570,
198,
2,
16926,
46,
25,
751,
3038,
329,
2495,
5072,
357,
12286,
783,
318,
16001,
8,
628,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
628,
220,
220,
220,
1388,
13,
834,
15390,
834,
796,
11593,
15390,
834,
198,
220,
220,
220,
1388,
3419,
198
] | 2.057793 | 5,935 |
import simuvex
from itertools import count
fastpath_data_counter = count()
#pylint:disable=arguments-differ
from simuvex.s_options import ABSTRACT_MEMORY, CGC_NO_SYMBOLIC_RECEIVE_LENGTH
| [
11748,
985,
45177,
87,
198,
6738,
340,
861,
10141,
1330,
954,
198,
198,
7217,
6978,
62,
7890,
62,
24588,
796,
954,
3419,
198,
220,
220,
220,
1303,
79,
2645,
600,
25,
40223,
28,
853,
2886,
12,
26069,
263,
198,
198,
6738,
985,
45177,
87,
13,
82,
62,
25811,
1330,
9564,
18601,
10659,
62,
44,
3620,
15513,
11,
327,
15916,
62,
15285,
62,
23060,
10744,
3535,
2149,
62,
2200,
5222,
9306,
62,
43,
49494,
198
] | 2.594595 | 74 |
import datetime
data = datetime.datetime.now()
data1 = data.strftime("%d-%m-%Y %H:%M:%S")
import pandas as pd
url = 'https://raw.githubusercontent.com/AlanTurist/Greece_covid19/master/region_greece.csv'
df = pd.read_csv(url,index_col=0, sep=",") | [
11748,
4818,
8079,
198,
7890,
796,
4818,
8079,
13,
19608,
8079,
13,
2197,
3419,
198,
7890,
16,
796,
1366,
13,
2536,
31387,
7203,
4,
67,
12,
4,
76,
12,
4,
56,
4064,
39,
25,
4,
44,
25,
4,
50,
4943,
198,
198,
11748,
19798,
292,
355,
279,
67,
198,
6371,
796,
705,
5450,
1378,
1831,
13,
12567,
43667,
13,
785,
14,
36235,
17483,
396,
14,
38,
631,
344,
62,
66,
709,
312,
1129,
14,
9866,
14,
36996,
62,
70,
631,
344,
13,
40664,
6,
198,
7568,
796,
279,
67,
13,
961,
62,
40664,
7,
6371,
11,
9630,
62,
4033,
28,
15,
11,
41767,
28,
2430,
8
] | 2.320755 | 106 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.