content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
#reads each line and adds the entire document
s = 0
try:
while(True):
line = input()
if line != "":
line = (" ".join(line.split())).split(' ')
for i in range(0,len(line)):
s += int(line[i])
else:
break
except EOFError:
pass
print(s)
| [
2,
40779,
1123,
1627,
290,
6673,
262,
2104,
3188,
198,
198,
82,
796,
657,
198,
28311,
25,
198,
220,
220,
220,
981,
7,
17821,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
1627,
796,
5128,
3419,
198,
220,
220,
220,
220,
220,
220,
... | 1.927273 | 165 |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
Reduces the size of a model file by stripping the optimizer.
Assumes we are working with a TorchAgent
"""... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
201,
198,
201,
198,
2,
15069,
357,
66,
8,
3203,
11,
3457,
13,
290,
663,
29116,
13,
201,
198,
2,
770,
2723,
2438,
318,
11971,
739,
262,
17168,
5964,
1043,
287,
262,
201,
198,
2,
38... | 3.09434 | 212 |
# -*- coding: utf-8 -*-
from django.core.management.base import BaseCommand
from apps.authentication.models import OnlineUser as User
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
6738,
42625,
14208,
13,
7295,
13,
27604,
13,
8692,
1330,
7308,
21575,
198,
198,
6738,
6725,
13,
41299,
3299,
13,
27530,
1330,
7467,
12982,
355,
11787,
628
] | 3.261905 | 42 |
import os
import numpy as np
from datetime import date, datetime, timedelta
from GPRIBatchProcessFunctions import *
import pickle
import time
import pylab as plt
## In Python3 Shell: exec(open('Main.py').read())
main()
| [
11748,
28686,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
4818,
8079,
1330,
3128,
11,
4818,
8079,
11,
28805,
12514,
198,
6738,
402,
4805,
9865,
963,
18709,
24629,
2733,
1330,
1635,
198,
11748,
2298,
293,
198,
11748,
640,
198,
11748,
... | 3.169014 | 71 |
#!/usr/bin/python
"""Given a regtest result tree, prints an HTML summary to a file.
See HTML skeleton in tests/regtest.html.
"""
import os
import re
import sys
import numpy as np
import matplotlib.pyplot as plt
SUMMARY_ROW = """\
<tfoot style="font-weight: bold; text-align: right">
<tr>
<td>
%(name)s
</td>
... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
37811,
15056,
257,
842,
9288,
1255,
5509,
11,
20842,
281,
11532,
10638,
284,
257,
2393,
13,
198,
198,
6214,
11532,
18328,
287,
5254,
14,
2301,
9288,
13,
6494,
13,
198,
37811,
198,
198,
11748,... | 2.483481 | 3,723 |
# -*- coding: utf-8 -*-
from tccli.services.cii.cii_client import action_caller
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
6738,
256,
535,
4528,
13,
30416,
13,
979,
72,
13,
979,
72,
62,
16366,
1330,
2223,
62,
13345,
263,
198,
220,
220,
220,
220
] | 2.179487 | 39 |
from simple.gRPC.Fields import Fixed
import unittest | [
6738,
2829,
13,
70,
49,
5662,
13,
15878,
82,
1330,
10832,
198,
11748,
555,
715,
395
] | 3.25 | 16 |
import numpy as np
from deepscratch.models.layers.activations.activation import Activation
# https://github.com/eriklindernoren/ML-From-Scratch/blob/master/mlfromscratch/deep_learning/activation_functions.py
# https://github.com/eriklindernoren/ML-From-Scratch/blob/master/mlfromscratch/deep_learning/activatio... | [
11748,
299,
32152,
355,
45941,
198,
6738,
2769,
1416,
36722,
13,
27530,
13,
75,
6962,
13,
15791,
602,
13,
48545,
1330,
13144,
341,
628,
220,
220,
220,
1303,
3740,
1378,
12567,
13,
785,
14,
263,
1134,
75,
521,
1142,
29578,
14,
5805,
... | 2.627306 | 271 |
courseJson=[
{
'Course_Name': 'Introduction to Engineering Design',
'Code': 'DES130',
'Course_Text': 'Introduction to Engineering Design is a core, multidisciplinary course offered with an aim to ignite the young minds with concepts in design and innovation. Using the tools and skills learnt... | [
17319,
41,
1559,
41888,
198,
220,
220,
220,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
705,
49046,
62,
5376,
10354,
705,
21906,
284,
14044,
8495,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
705,
10669,
10354,
705,
30910,
12952,
... | 3.682848 | 1,236 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from PIL import Image
for i in range(10):
image = Image.open('output{:08d}.png'.format(i))
newImage = []
for item in image.getdata():
if item[:4] == (0, 0, 0 , 0): #將透明區(0,0,0,0)轉成(255,255,255)
newImage.append((255, 255, 255... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
350,
4146,
1330,
7412,
198,
1640,
1312,
287,
2837,
7,
940,
2599,
198,
220,
220,
220,
2939,
796,
7412,
13,
9654,... | 1.911197 | 259 |
from datetime import datetime, date, timedelta
import os
import sys; sys.path += ['/var/canvas/common', '../../common']
import yaml
from boto.s3.connection import S3Connection
from configuration import aws
# results format
# {
# 'start_time': start_time,
# 'end_time': end_time,
# 'time': (end... | [
6738,
4818,
8079,
1330,
4818,
8079,
11,
3128,
11,
28805,
12514,
198,
11748,
28686,
198,
11748,
25064,
26,
25064,
13,
6978,
15853,
685,
26488,
7785,
14,
5171,
11017,
14,
11321,
3256,
705,
40720,
40720,
11321,
20520,
198,
11748,
331,
43695,... | 2.32567 | 261 |
#!/usr/bin/env python3
import sys
from threading import Thread, Event
print("INIT 1 0")
run = 1
pool = []
while run or pool:
command, id, *name = sys.stdin.readline().split()
if command == "RESOLVE":
Resolve(id, *name)
#print("print", pool)
#pool[-1].start()
elif command == "CANCEL... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
11748,
25064,
198,
6738,
4704,
278,
1330,
14122,
11,
8558,
198,
198,
4798,
7203,
1268,
2043,
352,
657,
4943,
198,
5143,
796,
352,
198,
7742,
796,
17635,
198,
198,
4514,
1057,
393,
... | 2.285714 | 147 |
"""
Copyright BOOSTRY Co., Ltd.
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 distr... | [
37811,
198,
15269,
347,
6684,
2257,
18276,
1766,
1539,
12052,
13,
198,
198,
26656,
15385,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
5832,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
1... | 2.103118 | 1,668 |
# Define a function that will check if the given
# number is perfect and return a boolean value.
# Ask they user how many perfect numbers they want.
count = input("How many perfect numbers do you want? (Recommend less than 4, as any higher can take a loooong time): ")
try:
# Try to convert the user input to an i... | [
2,
2896,
500,
257,
2163,
326,
481,
2198,
611,
262,
1813,
198,
2,
1271,
318,
2818,
290,
1441,
257,
25131,
1988,
13,
628,
198,
2,
16981,
484,
2836,
703,
867,
2818,
3146,
484,
765,
13,
198,
9127,
796,
5128,
7203,
2437,
867,
2818,
314... | 3.129213 | 356 |
"""
Contraction Clustering (RASTER):
Reference Implementation in Python with an Example
(c) 2016 - 2020 Fraunhofer-Chalmers Centre for Industrial Mathematics
Algorithm development and implementation:
Gregor Ulm (gregor.ulm@fcc.chalmers.se)
Requirements:
. Python 3
For a description of the algorithm including relevan... | [
37811,
198,
4264,
7861,
1012,
436,
1586,
357,
49,
1921,
5781,
2599,
198,
26687,
46333,
287,
11361,
351,
281,
17934,
198,
7,
66,
8,
1584,
532,
12131,
39313,
403,
71,
30288,
12,
1925,
282,
11056,
9072,
329,
19034,
39448,
198,
198,
2348,... | 2.605926 | 675 |
from .output import population_status,infected
from .utils import colorscale_okabe_ito
import matplotlib.pyplot as plt
__all__ = ["population_status", "infected"]
# covid 19 specific parameters
plt.rcParams.update({
"axes.prop_cycle": plt.cycler('color',
list(colorscale_okabe_ito... | [
6738,
764,
22915,
1330,
3265,
62,
13376,
11,
27816,
276,
198,
6738,
764,
26791,
1330,
7577,
38765,
62,
482,
11231,
62,
10094,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
198,
834,
439,
834,
796,
14631,
39748,
62... | 2.300926 | 216 |
from .fortiosapi import FortiOSAPI
| [
6738,
764,
3319,
4267,
15042,
1330,
6401,
35742,
17614,
198
] | 3.5 | 10 |
from PyZ3950 import asn1
oids = {}
oids['Z3950'] = {'oid': asn1.OidVal([1, 2, 840, 10003]), 'val': [1, 2, 840, 10003]}
oids['Z3950']['ATTRS'] = {'oid': asn1.OidVal([1, 2, 840, 10003, 3]), 'val': [1, 2, 840, 10003, 3]}
oids['Z3950']['DIAG'] = {'oid': asn1.OidVal([1, 2, 840, 10003, 4]), 'val': [1, 2, 840, 10003, 4]}
oids... | [
6738,
9485,
57,
2670,
1120,
1330,
355,
77,
16,
198,
10994,
796,
23884,
198,
10994,
17816,
57,
2670,
1120,
20520,
796,
1391,
6,
1868,
10354,
355,
77,
16,
13,
46,
312,
7762,
26933,
16,
11,
362,
11,
48777,
11,
8576,
18,
46570,
705,
2... | 1.841856 | 19,811 |
# Make sure to have CoppeliaSim running, with followig scene loaded:
#
# scenes/movementViaRemoteApi.ttt
#
# Do not launch simulation, then run this script
#
# The client side (i.e. this script) depends on:
#
# sim.py, simConst.py, and the remote API library available
# in programming/remoteApiBindings/lib/lib
# Additi... | [
2,
6889,
1654,
284,
423,
1766,
381,
25418,
8890,
2491,
11,
351,
1061,
328,
3715,
9639,
25,
198,
2,
198,
2,
8188,
14,
21084,
434,
30754,
36510,
32,
14415,
13,
926,
83,
198,
2,
198,
2,
2141,
407,
4219,
18640,
11,
788,
1057,
428,
4... | 2.535852 | 2,329 |
# test modified version of MulticoreTSNE
from MulticoreTSNE import MulticoreTSNE as TSNE
from sklearn.datasets import load_digits
from sklearn.preprocessing import StandardScaler, MinMaxScaler
import numpy as np
from matplotlib import pyplot as plt
import multiprocessing
print(TSNE.__version__)
ncpu = multiproces... | [
2,
1332,
9518,
2196,
286,
7854,
291,
382,
4694,
12161,
198,
198,
6738,
7854,
291,
382,
4694,
12161,
1330,
7854,
291,
382,
4694,
12161,
355,
26136,
12161,
198,
198,
6738,
1341,
35720,
13,
19608,
292,
1039,
1330,
3440,
62,
12894,
896,
1... | 2.457557 | 483 |
#-*- coding: utf8 -*-
import sys
from lib import SimpleDBTool, DBTool, DBFactory
if __name__ == "__main__":
sql = 'SELECT username FROM core_customer Limit 1;'
res = SimpleDBTool.query('edm_web', sql)
print res
# (('test',),)
res = SimpleDBTool.redis.incr('test:123', 2)
print re... | [
2,
12,
9,
12,
19617,
25,
3384,
69,
23,
532,
9,
12,
201,
198,
201,
198,
11748,
25064,
201,
198,
6738,
9195,
1330,
17427,
11012,
25391,
11,
360,
19313,
970,
11,
20137,
22810,
201,
198,
201,
198,
201,
198,
361,
11593,
3672,
834,
6624... | 2.225602 | 789 |
from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^request_type_method/(?P<test_case>\w+).html$', views.request_type_method),
url(r'^header_body_data/(?P<test_case>\w+).html$', views.header_body_data),
url(r'^form_data/(?P<test_case>\w+).html$', views.form_data),
url(r'^cooki... | [
6738,
42625,
14208,
13,
10414,
13,
6371,
82,
1330,
19016,
198,
198,
6738,
764,
1330,
5009,
628,
198,
6371,
33279,
82,
796,
685,
198,
220,
220,
220,
19016,
7,
81,
6,
61,
25927,
62,
4906,
62,
24396,
29006,
30,
47,
27,
9288,
62,
7442... | 2.251534 | 163 |
from datetime import datetime
import subprocess
from time import sleep
from models.result import Result
import json
from database import Base, db_session, engine
from schedule import every, repeat, run_pending
@repeat(every(30).minutes)
if __name__ == '__main__':
run_speed_test()
while True:
run... | [
6738,
4818,
8079,
1330,
4818,
8079,
198,
11748,
850,
14681,
198,
6738,
640,
1330,
3993,
198,
6738,
4981,
13,
20274,
1330,
25414,
198,
11748,
33918,
198,
6738,
6831,
1330,
7308,
11,
20613,
62,
29891,
11,
3113,
198,
6738,
7269,
1330,
790,... | 2.949153 | 118 |
from sublime_plugin import WindowCommand
from ..libraries.tools import save_setting
from ..libraries.paths import folder_explorer
class DeviotChangeBuildFolderCommand(WindowCommand):
"""
Adds extra libraries folder path from the settings
""" | [
6738,
41674,
62,
33803,
1330,
26580,
21575,
198,
6738,
11485,
75,
11127,
13,
31391,
1330,
3613,
62,
33990,
198,
6738,
11485,
75,
11127,
13,
6978,
82,
1330,
9483,
62,
20676,
11934,
198,
198,
4871,
6245,
5151,
19400,
15580,
41092,
21575,
... | 3.848485 | 66 |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
import numpy as np
import torch
import torch.nn as nn
from ss_baselines.common.utils import Flatten... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
2,
15069,
357,
66,
8,
3203,
11,
3457,
13,
290,
663,
29116,
13,
198,
2,
1439,
2489,
10395,
13,
198,
198,
2,
770,
2723,
2438,
318,
11971,
739,
262,
5964,
1043,
287,
262,
1... | 2.111538 | 1,040 |
# django imports
from django.contrib.contenttypes.models import ContentType
# permissions imports
import permissions.utils
from permissions.models import Role
# workflows imports
from workflows.conf import settings
from workflows.models import (StateInheritanceBlock, State, StateObjectHistory, StateObjectRelation,
... | [
2,
42625,
14208,
17944,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
11299,
19199,
13,
27530,
1330,
14041,
6030,
198,
198,
2,
21627,
17944,
198,
11748,
21627,
13,
26791,
198,
6738,
21627,
13,
27530,
1330,
20934,
198,
2,
670,
44041,
17944... | 2.776536 | 4,296 |
"""
This file compares DictConfig methods with the corresponding
methods of standard python's dict.
The following methods are compared:
__contains__
__delitem__
__eq__
__getitem__
__setitem__
get
pop
keys
values
items
We have separate test classes for the following cases:
Te... | [
37811,
198,
1212,
2393,
23008,
360,
713,
16934,
5050,
351,
262,
11188,
198,
24396,
82,
286,
3210,
21015,
338,
8633,
13,
198,
464,
1708,
5050,
389,
3688,
25,
198,
220,
220,
220,
11593,
3642,
1299,
834,
198,
220,
220,
220,
11593,
12381,... | 2.053817 | 10,034 |
from connect import *
import clr
import wpf
clr.AddReference("PresentationFramework")
clr.AddReference("PresentationCore")
from System.Collections.Generic import List, Dictionary
from System.Windows import MessageBox
import sys, os
import json
RayStationScriptsPath = os.environ["USERPROFILE"] + r"\DeskTop\RayStatio... | [
6738,
2018,
1330,
1635,
198,
198,
11748,
537,
81,
198,
11748,
266,
79,
69,
198,
565,
81,
13,
4550,
26687,
7203,
34695,
341,
21055,
6433,
4943,
198,
565,
81,
13,
4550,
26687,
7203,
34695,
341,
14055,
4943,
198,
198,
6738,
4482,
13,
5... | 3.002198 | 455 |
import struct
import subprocess
import threading
from time import sleep
from scapy.layers.dot11 import Dot11, Dot11Elt, sendp, Dot11Deauth, RadioTap
from termcolor import cprint
from pywiface.models import Station, AP
from pywiface.threads import ScannerThread
| [
11748,
2878,
198,
11748,
850,
14681,
198,
11748,
4704,
278,
198,
6738,
640,
1330,
3993,
198,
198,
6738,
629,
12826,
13,
75,
6962,
13,
26518,
1157,
1330,
22875,
1157,
11,
22875,
1157,
36,
2528,
11,
3758,
79,
11,
22875,
1157,
5005,
1843... | 3.3125 | 80 |
# coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
# TOOD(Eric Ayers):... | [
2,
19617,
28,
40477,
12,
23,
198,
2,
15069,
1946,
41689,
1628,
20420,
357,
3826,
27342,
9865,
3843,
20673,
13,
9132,
737,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
3826,
38559,
24290,
737,
198,
198,
6738,
1... | 3.507692 | 195 |
# static qstrs, should be sorted
# extracted from micropython/py/makeqstrdata.py
static_qstr_list = [
"",
"__dir__", # Put __dir__ after empty qstr for builtin dir() to work
"\n",
" ",
"*",
"/",
"<module>",
"_",
"__call__",
"__class__",
"__delitem__",
"__enter__",
"_... | [
2,
9037,
10662,
2536,
82,
11,
815,
307,
23243,
198,
2,
21242,
422,
12314,
1773,
7535,
14,
9078,
14,
15883,
80,
2536,
7890,
13,
9078,
198,
198,
12708,
62,
80,
2536,
62,
4868,
796,
685,
198,
220,
220,
220,
366,
1600,
198,
220,
220,
... | 1.915066 | 1,354 |
# Copyright (C) 2013 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2013 Isaku Yamahata <yamahata at valinux co jp>
#
# 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://... | [
2,
15069,
357,
34,
8,
2211,
399,
3974,
261,
21821,
290,
44735,
10501,
13,
198,
2,
15069,
357,
34,
8,
2211,
1148,
8719,
14063,
993,
1045,
1279,
88,
321,
993,
1045,
379,
1188,
259,
2821,
763,
474,
79,
29,
198,
2,
198,
2,
49962,
73... | 3.115502 | 329 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
parLaser.py: Defines a class for writing laser strings into a flash.par file.
Created by Scott Feister on Wed Feb 14 13:39:38 2018
See two examples towards the bottom of this document.
Note: Make sure to use FLASH setup flags to increase beam and pulse count as need... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
1845,
43,
6005,
13,
9078,
25,
2896,
1127,
257,
1398,
329,
3597,
12855,
13042,
656,
257,
7644,
13,
184... | 2.404948 | 4,850 |
import os
import re
import sys
import time
from subprocess import PIPE, run
from types import ModuleType
from typing import Union
import docker
import requests
import storm.__main__ as storm
from lazycluster import Runtime, RuntimeGroup, RuntimeManager, RuntimeTask
from .config import RUNTIME_DOCKER_IMAGE, RUNTIME_N... | [
11748,
28686,
198,
11748,
302,
198,
11748,
25064,
198,
11748,
640,
198,
6738,
850,
14681,
1330,
350,
4061,
36,
11,
1057,
198,
6738,
3858,
1330,
19937,
6030,
198,
6738,
19720,
1330,
4479,
198,
198,
11748,
36253,
198,
11748,
7007,
198,
11... | 3.375796 | 314 |
# -*- coding:Utf-8 -*-
"""
.. currentmodule:: pylayers.antprop.channelc
VectChannel Class
=================
.. autosummary::
:toctree: generated/
VectChannel.__init__
VectChannel.show3_old
VectChannel.show3
ScalChannel Class
=================
.. autosummary::
:toctree: generated/
ScalChannel.__... | [
2,
532,
9,
12,
19617,
25,
18274,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
492,
1459,
21412,
3712,
279,
2645,
6962,
13,
415,
22930,
13,
17620,
66,
198,
198,
53,
478,
29239,
5016,
198,
4770,
28,
628,
198,
492,
44619,
388,
6874,
37... | 1.796992 | 8,911 |
class Error(Exception):
"""Base class for exceptions in this module."""
pass
class InputError(Error):
"""Exception raised for errors in the input.
Attributes:
expression -- input expression in which the error occurred
message -- explanation of the error
"""
#The MI... | [
4871,
13047,
7,
16922,
2599,
198,
220,
220,
220,
37227,
14881,
1398,
329,
13269,
287,
428,
8265,
526,
15931,
198,
220,
220,
220,
1208,
198,
220,
220,
220,
220,
220,
220,
220,
220,
198,
4871,
23412,
12331,
7,
12331,
2599,
198,
220,
2... | 3.558897 | 399 |
import json
import click
import pickle
from ledgertools.read import read_file
from ledgertools.version import __version__
@click.group(help='CLI tools for working with ledger')
@click.version_option(version=__version__, prog_name='Ledger Tools')
@cli.command(help='Import ledger style file')
@click.option('-f', '--f... | [
11748,
33918,
198,
11748,
3904,
198,
11748,
2298,
293,
198,
198,
6738,
2957,
70,
861,
10141,
13,
961,
1330,
1100,
62,
7753,
198,
6738,
2957,
70,
861,
10141,
13,
9641,
1330,
11593,
9641,
834,
198,
198,
31,
12976,
13,
8094,
7,
16794,
... | 3.152542 | 236 |
#!/usr/bin/env python3
import psycopg2
import os
# Database Name
DB_NAME = "news"
# Filename
FILENAME = "log_analysis.txt"
# queries
first_query = "select title,views from view_article limit 3"
second_query = "select * from view_author"
third_query = "select * from view_error_log where percent_error > 1"
# to stor... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
11748,
17331,
22163,
70,
17,
198,
11748,
28686,
198,
198,
2,
24047,
6530,
198,
11012,
62,
20608,
796,
366,
10827,
1,
198,
198,
2,
7066,
12453,
198,
46700,
1677,
10067,
796,
... | 2.610405 | 865 |
#!/usr/bin/python
import sqlite3, json, os
import logging, sys
from collections import defaultdict
from nameparser import HumanName
#
# This script moves candidate information from filename.json into the sqlite3 database
#
# !!! UPDATE HERE WHENEVER THE DATABASE TABLE SCHEMA CHANGE !!!
#
# The order matter when we wa... | [
2,
48443,
14629,
14,
8800,
14,
29412,
220,
198,
11748,
44161,
578,
18,
11,
33918,
11,
28686,
198,
11748,
18931,
11,
25064,
198,
6738,
17268,
1330,
4277,
11600,
198,
6738,
1438,
48610,
1330,
5524,
5376,
198,
198,
2,
198,
2,
770,
4226,
... | 2.839487 | 1,950 |
# Python solution for 'Find all non-consecutive numbers' codewars question.
# Level: 7 kyu
# Tags: FUNDAMENTALS AND ARRAYS.
# Author: Jack Brokenshire
# Date: 05/08/2020
import unittest
def all_non_consecutive(arr):
"""
Find all the elements of an array that are non consecutive. A number is non consecutive i... | [
2,
11361,
4610,
329,
705,
16742,
477,
1729,
12,
1102,
4552,
425,
3146,
6,
14873,
413,
945,
1808,
13,
198,
2,
5684,
25,
767,
479,
24767,
198,
2,
44789,
25,
29397,
35,
2390,
3525,
23333,
5357,
5923,
3861,
16309,
13,
198,
2,
6434,
25... | 2.927215 | 316 |
# Copyright 2016 OVH SAS
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | [
2,
15069,
1584,
440,
53,
39,
35516,
198,
2,
1439,
6923,
33876,
13,
198,
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,
42... | 2.714559 | 522 |
import pygame
import cmg
from cmg.color import Colors
from cmg.color import Color
from cmg import math
from study_tool import card_attributes
from study_tool.card import Card
from study_tool.card_attributes import *
from study_tool.entities.entity import Entity
from study_tool.russian.word import AccentedText
from stud... | [
11748,
12972,
6057,
198,
11748,
269,
11296,
198,
6738,
269,
11296,
13,
8043,
1330,
29792,
198,
6738,
269,
11296,
13,
8043,
1330,
5315,
198,
6738,
269,
11296,
1330,
10688,
198,
6738,
2050,
62,
25981,
1330,
2657,
62,
1078,
7657,
198,
6738... | 2.132479 | 936 |
import os
import json
from pprint import pprint, pformat
from mpi4py import MPI
import math
from nas4candle.nasapi.evaluator import Evaluator
from nas4candle.nasapi.search import util, Search
from nas4candle.nasapi.search.nas.agent import nas_ppo_sync_a3c
logger = util.conf_logger('nas4candle.nasapi.search.nas.ppo_a... | [
11748,
28686,
198,
11748,
33918,
198,
6738,
279,
4798,
1330,
279,
4798,
11,
279,
18982,
198,
6738,
285,
14415,
19,
9078,
1330,
4904,
40,
198,
11748,
10688,
198,
198,
6738,
25221,
19,
46188,
293,
13,
24716,
15042,
13,
18206,
84,
1352,
... | 2.6 | 290 |
# GetScraped V2.5.1
# github.com/kendalled
### possible regexp: [^\s@<>]+@[^\s@<>]+\.[^\s@<>]+
### Backup regexp: '[\w.]+@[\w.]+'
import requests
import re
import unicodecsv as csv
import pandas as pd
# Negative Email Endings
#TODO: remove %20 from beginning
negatives = ['domain.net','group.calendar.google','yourema... | [
2,
3497,
3351,
31951,
569,
17,
13,
20,
13,
16,
198,
2,
33084,
13,
785,
14,
74,
437,
4262,
198,
21017,
1744,
40364,
79,
25,
685,
61,
59,
82,
31,
27,
37981,
10,
31,
58,
61,
59,
82,
31,
27,
37981,
10,
59,
3693,
61,
59,
82,
31... | 2.361528 | 733 |
import numpy as np
| [
11748,
299,
32152,
355,
45941,
628,
628,
628,
628,
628,
628,
628,
628,
628,
198
] | 2.466667 | 15 |
"""Test the code status enum."""
from astoria.common.code_status import CodeStatus
def test_code_status_enum() -> None:
"""Test that CodeStatus has the right values."""
assert CodeStatus.STARTING.value == "code_starting"
assert CodeStatus.RUNNING.value == "code_running"
assert CodeStatus.KILLED.value... | [
37811,
14402,
262,
2438,
3722,
33829,
526,
15931,
198,
198,
6738,
6468,
7661,
13,
11321,
13,
8189,
62,
13376,
1330,
6127,
19580,
628,
198,
4299,
1332,
62,
8189,
62,
13376,
62,
44709,
3419,
4613,
6045,
25,
198,
220,
220,
220,
37227,
14... | 3 | 160 |
import time
from pylmcp import Object
from pylmcp.server import Server
from pylmcp.uxas import AutomationRequestValidator, UxASConfig
# Create bridge configuration
bridge_cfg = UxASConfig()
bridge_cfg += AutomationRequestValidator()
with Server(bridge_cfg=bridge_cfg) as server:
try:
obj = Object(class_nam... | [
11748,
640,
198,
6738,
279,
2645,
76,
13155,
1330,
9515,
198,
6738,
279,
2645,
76,
13155,
13,
15388,
1330,
9652,
198,
6738,
279,
2645,
76,
13155,
13,
2821,
292,
1330,
17406,
341,
18453,
47139,
1352,
11,
471,
87,
1921,
16934,
198,
198,... | 2.48 | 200 |
import pytest
import numpy as np
import numpy.testing as npt
from lenstronomy.Util import constants as const
from hierarc.Likelihood.LensLikelihood.td_mag_likelihood import TDMagLikelihood
from hierarc.Likelihood.LensLikelihood.td_mag_magnitude_likelihood import TDMagMagnitudeLikelihood
from lenstronomy.Util.data_util ... | [
11748,
12972,
9288,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
299,
32152,
13,
33407,
355,
299,
457,
198,
6738,
18896,
301,
1313,
9145,
13,
18274,
346,
1330,
38491,
355,
1500,
198,
6738,
13550,
5605,
13,
7594,
11935,
13,
49479,
759... | 3.137097 | 124 |
import numpy as np
from math import log
day_in_seconds = 24. * 60. * 60.
def ecdf(vals, x, eps=1e-12):
"""
Compute empirical cdf: P(X <= x) over the values vals
"""
return np.sum(vals <= x, dtype=np.float32) / (np.shape(vals)[0] + eps)
def format_runtime(runtime):
""" """
return '{}s = {}m... | [
11748,
299,
32152,
355,
45941,
198,
6738,
10688,
1330,
2604,
198,
198,
820,
62,
259,
62,
43012,
796,
1987,
13,
1635,
3126,
13,
1635,
3126,
13,
628,
198,
198,
4299,
9940,
7568,
7,
12786,
11,
2124,
11,
304,
862,
28,
16,
68,
12,
1065... | 2.421687 | 166 |
import collections
import pandas
import numpy
import itertools
if __name__ == "__main__":
main() | [
11748,
17268,
201,
198,
11748,
19798,
292,
201,
198,
11748,
299,
32152,
201,
198,
11748,
340,
861,
10141,
201,
198,
201,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
201,
198,
220,
220,
220,
1388,
3419
] | 2.74359 | 39 |
# This part will be responsible for downloading the zotero collected PDFs | [
2,
770,
636,
481,
307,
4497,
329,
22023,
262,
1976,
313,
3529,
7723,
12960,
82
] | 4.866667 | 15 |
from flask import Flask
import requests, json
from flask import render_template
from RepeatedTimer import RepeatedTimer
from flask_socketio import SocketIO, emit
from threading import Thread
from gevent import monkey as curious_george
import redis
import datetime as dt
from rejson import Client, Path
from SetEncoder im... | [
6738,
42903,
1330,
46947,
198,
11748,
7007,
11,
33918,
198,
6738,
42903,
1330,
8543,
62,
28243,
198,
6738,
30558,
515,
48801,
1330,
30558,
515,
48801,
198,
6738,
42903,
62,
44971,
952,
1330,
47068,
9399,
11,
27588,
198,
6738,
4704,
278,
... | 2.905512 | 381 |
'''Navier-Stokes and Euler equations solver implemented in Python
Triple periodic spectral method in space
4th order Runge–Kutta method in time
Auther: Jia Cheng Hu (University of Waterloo, Canada)
'''
from pysif.spectral_method import *
| [
7061,
6,
45,
19492,
12,
1273,
3369,
290,
412,
18173,
27490,
1540,
332,
9177,
287,
11361,
198,
198,
14824,
1154,
27458,
37410,
2446,
287,
2272,
198,
19,
400,
1502,
5660,
469,
1906,
42,
315,
8326,
2446,
287,
640,
198,
198,
32,
12866,
... | 3.394366 | 71 |
import os
import sys
import site
# Add virtualenv site packages
site.addsitedir('/home/attendance/.virtualenvs/attendance/lib/python3.5/site-packages')
sys.path.insert(0, '/var/www/html/class-list')
# Fired up virtualenv before include application
activate_this = '/home/attendance/.virtualenvs/attendance/bin/activat... | [
11748,
28686,
198,
11748,
25064,
198,
11748,
2524,
198,
198,
2,
3060,
7166,
24330,
2524,
10392,
198,
15654,
13,
2860,
82,
863,
343,
10786,
14,
11195,
14,
1078,
437,
590,
11757,
32844,
268,
14259,
14,
1078,
437,
590,
14,
8019,
14,
2941... | 3 | 181 |
#
# Autogenerated by Thrift Compiler (0.12.0)
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
# options string: py
#
from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException
from thrift.protocol.TProtocol import TProtocolException
from thrift.TRecursive impo... | [
2,
198,
2,
5231,
519,
877,
515,
416,
16283,
2135,
3082,
5329,
357,
15,
13,
1065,
13,
15,
8,
198,
2,
198,
2,
8410,
5626,
48483,
4725,
48481,
7013,
15986,
311,
11335,
14603,
7013,
35876,
25003,
7013,
15986,
8410,
2751,
198,
2,
198,
... | 2.467598 | 787 |
from __future__ import division
import cPickle
import numpy as np
import math
import random
import os as os
from scipy import misc
from skimage import color
from tensorflow.examples.tutorials.mnist import input_data
import tensorflow as tf
#import matplotlib.pyplot as plot1
#def graph_plot(x, y, xlab, ylab):
#plot... | [
6738,
11593,
37443,
834,
1330,
7297,
198,
11748,
269,
31686,
293,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
10688,
198,
11748,
4738,
198,
11748,
28686,
355,
28686,
198,
6738,
629,
541,
88,
1330,
12747,
198,
6738,
1341,
9060,
1330,
... | 1.861055 | 2,958 |
#!/usr/bin/env python
# encoding: utf-8
"""
@author: 'Administrator'
@contact:
@time:
"""
#!/usr/bin/python
# encoding: utf-8
# ================ 直接创建DataFrame
from pyspark.sql import SparkSession
from pyspark.sql import Row
spark = SparkSession.builder.appName('test').getOrCreate()
sc = spark.sparkContext
# spa... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
21004,
25,
3384,
69,
12,
23,
628,
198,
37811,
198,
31,
9800,
25,
220,
705,
41862,
12392,
6,
198,
31,
32057,
25,
220,
220,
198,
31,
2435,
25,
220,
198,
37811,
198,
198,
2,
4844... | 2.257566 | 1,553 |
from .pgcb import Pgcb, PgcbHome, PgcbFilter | [
6738,
764,
6024,
21101,
1330,
350,
70,
21101,
11,
350,
70,
21101,
16060,
11,
350,
70,
21101,
22417
] | 2.444444 | 18 |
#!/usr/bin/python2.7
# -*- coding: utf-8 -*-
# analyze.py
#
# Copyright © 214 Intel Corporation
#
# Author: Quanxian Wang <quanxian.wang@intel.com>
# Zhang Xiaoyan <zhang.xiaoyanx@intel.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General ... | [
2,
48443,
14629,
14,
8800,
14,
29412,
17,
13,
22,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
16602,
13,
9078,
198,
2,
198,
2,
15069,
10673,
28277,
8180,
10501,
198,
2,
198,
2,
6434,
25,
42312,
... | 1.812545 | 12,467 |
# shopping_cart.py
#from pprint import pprint
import pandas as pd
import datetime
import time
products = [
{"id":1, "name": "Chocolate Sandwich Cookies", "department": "snacks", "aisle": "cookies cakes", "price": 3.50},
{"id":2, "name": "All-Seasons Salt", "department": "pantry", "aisle": "spices seasonings... | [
2,
9735,
62,
26674,
13,
9078,
198,
198,
2,
6738,
279,
4798,
1330,
279,
4798,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
4818,
8079,
198,
11748,
640,
628,
198,
198,
29498,
796,
685,
198,
220,
220,
220,
19779,
312,
1298,
16,
... | 2.52324 | 3,012 |
import os
import sys
import platform
import multiprocessing
from distutils.core import run_setup
from setuptools import find_packages
from numpy.distutils.command.build_ext import build_ext
from numpy.distutils.core import setup, Extension
from io import open
# Global constants
ncpus = multiprocessing.cpu_count()
this... | [
11748,
28686,
198,
11748,
25064,
198,
11748,
3859,
198,
11748,
18540,
305,
919,
278,
198,
6738,
1233,
26791,
13,
7295,
1330,
1057,
62,
40406,
198,
6738,
900,
37623,
10141,
1330,
1064,
62,
43789,
198,
6738,
299,
32152,
13,
17080,
26791,
... | 2.326967 | 1,309 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'Tomasz Czaja'
__version__ = '0.0.1'
import sys
import time
from pathlib import Path
import signal
import RPi.GPIO as GPIO
from PIL import Image, ImageDraw, ImageFont
from ST7789 import ST7789
from audioplayer import AudioPlayer
# Press the green button in... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
834,
9800,
834,
796,
705,
13787,
292,
89,
327,
89,
27792,
6,
198,
834,
9641,
834,
796,
705,
15,
13,
15,
13,
... | 2.165192 | 339 |
'''
This module parses the input arguments and extracts the necessary
data structures from it, then calls the appropriate functions to
process it.
'''
import sys
import getpass
from Subgraph import *
from Multiprocessing import *
def dispatch(json_file_name):
'''
Looks at input JSON file and determines
... | [
7061,
6,
198,
1212,
8265,
13544,
274,
262,
5128,
7159,
290,
32139,
262,
3306,
198,
7890,
8573,
422,
340,
11,
788,
3848,
262,
5035,
5499,
284,
198,
14681,
340,
13,
198,
198,
7061,
6,
198,
198,
11748,
25064,
198,
11748,
651,
6603,
198... | 2.943613 | 869 |
# Copyright (C) 2012 Ion Torrent Systems, Inc. All Rights Reserved
from django import http, template
from django.core import urlresolvers
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.auth.decorators import login_required, permission_required
from django.core.cache imp... | [
2,
15069,
357,
34,
8,
2321,
36404,
43399,
11998,
11,
3457,
13,
1439,
6923,
33876,
198,
6738,
42625,
14208,
1330,
2638,
11,
11055,
198,
6738,
42625,
14208,
13,
7295,
1330,
19016,
411,
349,
690,
198,
6738,
42625,
14208,
13,
10414,
1330,
... | 2.630885 | 3,186 |
# Generated by Django 3.2.9 on 2021-12-31 13:38
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
513,
13,
17,
13,
24,
319,
33448,
12,
1065,
12,
3132,
1511,
25,
2548,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
from django.db import models
import random
import numpy as np
| [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
11748,
4738,
198,
11748,
299,
32152,
355,
45941,
628
] | 3.705882 | 17 |
# Copyright 2021 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | [
2,
15069,
33448,
3012,
11419,
13,
1439,
6923,
33876,
13,
198,
2,
220,
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,
... | 3.62069 | 232 |
import arcade
SCREEN_WIDTH = 500
SCREEN_HEIGHT = 600
class MyApplication(arcade.Window):
"""
Main application class.
"""
def on_draw(self):
"""
Render the screen.
"""
arcade.start_render()
def on_mouse_press(self, x, y, button, key_modifiers):
"""
... | [
11748,
27210,
198,
198,
6173,
2200,
1677,
62,
54,
2389,
4221,
796,
5323,
198,
6173,
2200,
1677,
62,
13909,
9947,
796,
10053,
628,
198,
4871,
2011,
23416,
7,
5605,
671,
13,
27703,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
... | 2.243902 | 205 |
from django.apps import AppConfig
| [
6738,
42625,
14208,
13,
18211,
1330,
2034,
16934,
628
] | 3.888889 | 9 |
#!/usr/bin/env python
#############################################################################
#
# VFRAME
# MIT License
# Copyright (c) 2020 Adam Harvey and VFRAME
# https://vframe.io
#
#############################################################################
import os
from os.path import join
import sys
fr... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
29113,
29113,
7804,
4242,
2,
198,
2,
198,
2,
569,
10913,
10067,
198,
2,
17168,
13789,
198,
2,
15069,
357,
66,
8,
12131,
7244,
14943,
290,
569,
10913,
10067,
198,
2,
3740,
1378,
... | 2.974298 | 1,673 |
import os
import io
import json
from google.cloud import vision
from google.protobuf.json_format import MessageToJson
from joblib import Parallel, delayed
import argparse
os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = ""
client = vision.ImageAnnotatorClient()
if __name__ == '__main__':
# construct the argument p... | [
11748,
28686,
198,
11748,
33245,
198,
11748,
33918,
198,
6738,
23645,
13,
17721,
1330,
5761,
198,
6738,
23645,
13,
11235,
672,
3046,
13,
17752,
62,
18982,
1330,
16000,
2514,
41,
1559,
198,
6738,
1693,
8019,
1330,
42945,
11,
11038,
198,
... | 2.77628 | 371 |
import discord
from discord.ext import commands
from discord.utils import get | [
11748,
36446,
198,
6738,
36446,
13,
2302,
1330,
9729,
198,
6738,
36446,
13,
26791,
1330,
651
] | 4.8125 | 16 |
import sys
from Util import write_list_to_file
from ProgramParser import ProgramParser
if __name__ == '__main__':
main()
| [
11748,
25064,
198,
6738,
7273,
346,
1330,
3551,
62,
4868,
62,
1462,
62,
7753,
198,
6738,
6118,
46677,
1330,
6118,
46677,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
1388,
3419,
198
] | 3.121951 | 41 |
from rest_framework.serializers import ModelSerializer
from .models import Hint
| [
6738,
1334,
62,
30604,
13,
46911,
11341,
1330,
9104,
32634,
7509,
198,
6738,
764,
27530,
1330,
367,
600,
628
] | 4.263158 | 19 |
"""
此脚本负责 - 手工运行游戏或者用AI运行游戏
"""
import sys
import cv2
from utils.util import create_image_from_state
from game.confs import Action_Type, Block_Type, Confs
from game.tetris_engine import tetris_engine
import json
import numpy as np
if __name__ == "__main__":
# human_play()
ai_play("outputs/q_36... | [
37811,
201,
198,
29826,
97,
164,
226,
248,
17312,
105,
164,
112,
253,
164,
112,
96,
532,
10545,
231,
233,
32432,
98,
32573,
238,
26193,
234,
162,
116,
116,
22755,
237,
22755,
244,
38519,
18796,
101,
20185,
32573,
238,
26193,
234,
162,... | 1.960894 | 179 |
from smpr3d.util import *
from smpr3d.algorithm import *
from smpr3d.setup import *
import torch as th
import os
import numpy as np
# salloc -C gpu -N 2 -t 30 -c 10 --gres=gpu:8 -A m1759 --ntasks-per-node=8
# srun -N 2 python ./admm_smatrix_dist_pytorch.py
# module purge
# module load pytorch/v1.4.0-gpu
# module list
... | [
6738,
895,
1050,
18,
67,
13,
22602,
1330,
1635,
198,
6738,
895,
1050,
18,
67,
13,
282,
42289,
1330,
1635,
198,
6738,
895,
1050,
18,
67,
13,
40406,
1330,
1635,
198,
11748,
28034,
355,
294,
198,
11748,
28686,
198,
11748,
299,
32152,
3... | 2.170673 | 2,912 |
import csv
from collections import Counter
from crispy_forms.utils import render_crispy_form
from django.conf import settings
from django.contrib import messages
from django.contrib.auth.mixins import LoginRequiredMixin, UserPassesTestMixin
from django.db.models import Sum, Count
from django.forms.models import model_... | [
11748,
269,
21370,
198,
6738,
17268,
1330,
15034,
198,
198,
6738,
42807,
62,
23914,
13,
26791,
1330,
8543,
62,
66,
2442,
9078,
62,
687,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
3642,
822,
1330,
6218,
... | 3.475096 | 261 |
import tensorflow as tf
import cv2
from imageio import mimsave
from IPython.display import display as display_fn
from IPython.display import Image
def load_img(path_to_img):
'''
Loads an image and convert it to a tensor with longer side to 512
:param path_to_img (str): directory path to image
... | [
11748,
11192,
273,
11125,
355,
48700,
201,
198,
11748,
269,
85,
17,
201,
198,
6738,
2939,
952,
1330,
285,
12078,
1015,
201,
198,
6738,
6101,
7535,
13,
13812,
1330,
3359,
355,
3359,
62,
22184,
201,
198,
6738,
6101,
7535,
13,
13812,
133... | 2.281065 | 676 |
import yaml
c = Conf()
| [
11748,
331,
43695,
628,
198,
66,
796,
7326,
3419,
198
] | 2.5 | 10 |
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
# can use the below import should you choose to initialize the weights of your Net
import torch.nn.init as I
import torchvision.models
from neuralnets.mobilenet_v1 import MobileNet
from neuralnets.modelcomponents import *
| [
11748,
299,
32152,
355,
45941,
198,
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
198,
2,
460,
779,
262,
2174,
1330,
815,
345,
3853,
284,
41216,
262,
19590,
286,
534,
3433... | 3.690476 | 84 |
"""Data loader."""
import torch
from torch.utils.data.sampler import RandomSampler
from .kinetics import Kinetics
_DATASETS = {
"kinetics": Kinetics,
}
def construct_loader(cfg, split):
"""
Constructs the data loader for the given dataset.
Args:
cfg (CfgNode): configs. Details can be found... | [
37811,
6601,
40213,
526,
15931,
628,
198,
11748,
28034,
198,
198,
6738,
28034,
13,
26791,
13,
7890,
13,
37687,
20053,
1330,
14534,
16305,
20053,
198,
6738,
764,
5116,
14596,
1330,
16645,
14596,
198,
198,
62,
35,
1404,
1921,
32716,
796,
... | 2.370115 | 435 |
import sqlite3
from nltk.sentiment.vader import SentimentIntensityAnalyzer
# Set the file paths
db_path ='D:/Workspace-Github/saproject/data/foursquare.db'
# connect and write to database
conn = sqlite3.connect(db_path)
c = conn.cursor()
c.execute('SELECT tid, tip FROM tips;')
results = c.fetchall()
for ... | [
11748,
44161,
578,
18,
201,
198,
6738,
299,
2528,
74,
13,
34086,
3681,
13,
85,
5067,
1330,
11352,
3681,
5317,
6377,
37702,
9107,
201,
198,
201,
198,
2,
5345,
262,
2393,
13532,
201,
198,
9945,
62,
6978,
796,
6,
35,
14079,
23044,
1022... | 2.552632 | 228 |
import pyarrow as pa
import pyarrow.flight as flight
import base64
import cmd
import json
import struct
import sys
from time import sleep, time
pa.enable_signal_handlers(True)
def wait_for_connection(client):
"""Perform a blocking check that a connection can be made to the server"""
try:
client.wait_... | [
11748,
12972,
6018,
355,
14187,
198,
11748,
12972,
6018,
13,
22560,
355,
5474,
198,
11748,
2779,
2414,
198,
11748,
23991,
198,
11748,
33918,
198,
11748,
2878,
198,
11748,
25064,
198,
6738,
640,
1330,
3993,
11,
640,
198,
198,
8957,
13,
2... | 2.535268 | 2,963 |
# Generated by Django 4.0.3 on 2022-03-11 21:29
from django.db import migrations, models
import django.db.models.deletion
| [
2,
2980,
515,
416,
37770,
604,
13,
15,
13,
18,
319,
33160,
12,
3070,
12,
1157,
2310,
25,
1959,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
198,
11748,
42625,
14208,
13,
9945,
13,
27530,
13,
2934,
1616,
295,
... | 2.818182 | 44 |
#!/usr/bin/env python3
import unittest
import numpy as np
from sympy import Eq, symbols
from main import sympy_simplex, LP
aufgabe1 = LP( # Blatt 2
np.matrix('2 0 6; -2 8 4; 3 6 5'),
np.matrix('10; 12; 20'),
np.matrix('2; 1; 3; 0; 0; 0'),
[4, 5, 6])
kreise_example = LP( # Book Page 31
np.matrix(... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
11748,
555,
715,
395,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
10558,
88,
1330,
412,
80,
11,
14354,
198,
198,
6738,
1388,
1330,
10558,
88,
62,
14323,
11141,
11,
18470,
... | 1.950943 | 265 |
import copy
import json
import logging
import os
from xia2.Driver.DriverFactory import DriverFactory
from xia2.Handlers.Phil import PhilIndex
logger = logging.getLogger("xia2.Wrappers.Dials.RefineBravaisSettings")
def RefineBravaisSettings(DriverType=None):
"""A factory for RefineBravaisSettingsWrapper classes.... | [
11748,
4866,
198,
11748,
33918,
198,
11748,
18931,
198,
11748,
28686,
198,
198,
6738,
2124,
544,
17,
13,
32103,
13,
32103,
22810,
1330,
12434,
22810,
198,
6738,
2124,
544,
17,
13,
12885,
8116,
13,
18673,
1330,
4543,
15732,
198,
198,
640... | 3.271318 | 129 |
# Converted "manually" from EMSABTAG.H
from mapitags import PT_UNSPECIFIED, PT_NULL, PT_I2, PT_LONG, PT_R4, \
PT_DOUBLE, PT_CURRENCY, PT_APPTIME, PT_ERROR, \
PT_BOOLEAN, PT_OBJECT, PT_I8, PT_STRING8, PT_UNICODE, \
PT_SYSTIME, PT_CLSID, PT_BINARY, PT_SHO... | [
2,
43433,
366,
805,
935,
1,
422,
17228,
4090,
19313,
4760,
13,
39,
201,
198,
6738,
3975,
270,
3775,
1330,
19310,
62,
4944,
48451,
28343,
11,
19310,
62,
33991,
11,
19310,
62,
40,
17,
11,
19310,
62,
43,
18494,
11,
19310,
62,
49,
19,... | 1.612599 | 38,606 |
import textwrap
from .attribute_name import AttributeName
| [
11748,
2420,
37150,
198,
6738,
764,
42348,
62,
3672,
1330,
3460,
4163,
5376,
628
] | 4.214286 | 14 |
import os
import gensim
from gensim.utils import simple_preprocess
from nltk.stem import WordNetLemmatizer, SnowballStemmer
from src.consts import (
SubtopicSummaryType,
LDA_SUBTOPIC_KEY_WORDS_PATH,
LDA_SUBTOPIC_KEY_PHRASES_PATH,
LDA_SUBTOPIC_N_WORDS_PATH,
LDA_SUBTOPIC_SENTENCE_PATH,
SUBTOPIC_... | [
11748,
28686,
198,
198,
11748,
308,
641,
320,
198,
6738,
308,
641,
320,
13,
26791,
1330,
2829,
62,
3866,
14681,
198,
6738,
299,
2528,
74,
13,
927,
1330,
9678,
7934,
43,
368,
6759,
7509,
11,
7967,
1894,
1273,
368,
647,
198,
198,
6738... | 2.191899 | 2,444 |
import random
from sherlockpipe.scoring.SignalSelector import SignalSelector, SignalSelection
| [
11748,
4738,
198,
6738,
15059,
5354,
34360,
13,
46536,
13,
11712,
282,
17563,
273,
1330,
26484,
17563,
273,
11,
26484,
4653,
1564,
198
] | 4.086957 | 23 |
# Give a name to describe this model. The name should conform to python variable naming conventions, and should be
# only a single word.
model_name = 'ner_text'
# Tags are used to describe the performance of a model. These simple keywords can help people decide whether your model
# is appropriate to use for their situ... | [
2,
13786,
257,
1438,
284,
6901,
428,
2746,
13,
383,
1438,
815,
17216,
284,
21015,
7885,
19264,
21396,
11,
290,
815,
307,
198,
2,
691,
257,
2060,
1573,
13,
198,
19849,
62,
3672,
796,
705,
1008,
62,
5239,
6,
198,
198,
2,
44789,
389,... | 4.029851 | 201 |
import random
import requests
import json
from flask import Flask
from app import create_app, init_app
from app.models import *
from faker import Faker
faker = Faker()
valid_email = "matthewkantor@gmail.com"
valid_password = "password"
valid_user = "mattkantor"
app = create_app()
seed()
| [
11748,
4738,
198,
198,
11748,
7007,
198,
11748,
33918,
198,
198,
6738,
42903,
1330,
46947,
198,
198,
6738,
598,
1330,
2251,
62,
1324,
11,
2315,
62,
1324,
198,
6738,
598,
13,
27530,
1330,
1635,
198,
6738,
277,
3110,
1330,
376,
3110,
19... | 2.923077 | 104 |
# -*- coding: utf-8 -*-
"""
Created on Mon Nov 4 19:56:24 2019
@author: William
"""
import cv2
import winsound
import time
goal = 25
n = 0
cv2.VideoCapture(0).release
HAARPATH = "haarcascade/haarcascade_frontalface_default.xml"
cap=cv2.VideoCapture(0)
face_detect=cv2.CascadeClassifier(HAARPATH)
f... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
201,
198,
37811,
201,
198,
41972,
319,
2892,
5267,
220,
604,
678,
25,
3980,
25,
1731,
13130,
201,
198,
201,
198,
31,
9800,
25,
3977,
201,
198,
37811,
201,
198,
201,
198,
... | 1.97193 | 570 |
MESSAGE_DICT = {
'17':"Feed me!",
'33':"Things could be going better. :-(",
'65':"Do I want to do work: NOP. :-/",
'18':"This isn't the largest program I have every stored.",
'34':"I am happy!",
'66':"My processor is idling! :p",
'20':"Instructions! OM, NOP, NOP, NOP!",
'36':"I am very h... | [
44,
1546,
4090,
8264,
62,
35,
18379,
796,
1391,
198,
220,
220,
220,
705,
1558,
10354,
1,
18332,
502,
40754,
198,
220,
220,
220,
705,
2091,
10354,
1,
22248,
714,
307,
1016,
1365,
13,
1058,
30420,
1600,
198,
220,
220,
220,
705,
2996,
... | 2.540909 | 220 |
import json
from rest_framework.response import Response
from rest_framework import status
from rest_framework.views import APIView
from rest_framework.permissions import IsAuthenticated
from rest_framework.decorators import api_view, permission_classes
from django.db.transaction import atomic
from django.shortcuts i... | [
11748,
33918,
198,
198,
6738,
1334,
62,
30604,
13,
26209,
1330,
18261,
198,
6738,
1334,
62,
30604,
1330,
3722,
198,
6738,
1334,
62,
30604,
13,
33571,
1330,
3486,
3824,
769,
198,
6738,
1334,
62,
30604,
13,
525,
8481,
1330,
1148,
47649,
... | 3.468293 | 205 |
import os
import csv
import shutil
from copy import deepcopy
from exceptions import TypeError
from django.db.models.signals import pre_save, post_save
from django.db import models
from django.utils import simplejson
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.t... | [
11748,
28686,
198,
11748,
269,
21370,
198,
11748,
4423,
346,
198,
198,
6738,
4866,
1330,
2769,
30073,
198,
6738,
13269,
1330,
5994,
12331,
198,
198,
6738,
42625,
14208,
13,
9945,
13,
27530,
13,
12683,
874,
1330,
662,
62,
21928,
11,
1281... | 2.836332 | 5,780 |
import versioneer # https://github.com/warner/python-versioneer
from setuptools import setup
setup(name="finddata",
version=versioneer.get_version(), #"0.2.2",
cmdclass=versioneer.get_cmdclass(),
description = "Find data files using ONCat",
author = "Pete Peterson",
author_email = "peters... | [
11748,
2196,
28153,
1303,
3740,
1378,
12567,
13,
785,
14,
5767,
1008,
14,
29412,
12,
690,
7935,
263,
198,
6738,
900,
37623,
10141,
1330,
9058,
198,
198,
40406,
7,
3672,
2625,
19796,
7890,
1600,
198,
220,
220,
220,
220,
220,
2196,
28,
... | 2.573529 | 272 |
# ===============================================================================
# Copyright 2021 ross
#
# 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/LICE... | [
2,
38093,
25609,
855,
198,
2,
15069,
33448,
686,
824,
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,
1... | 2.959147 | 563 |
# coding: utf-8
"""
Salt Edge Account Information API
API Reference for services # noqa: E501
OpenAPI spec version: 5.0.0
Contact: support@saltedge.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class Attempt(object):
... | [
2,
19617,
25,
3384,
69,
12,
23,
198,
198,
37811,
198,
220,
220,
220,
13754,
13113,
10781,
6188,
7824,
628,
220,
220,
220,
7824,
20984,
329,
2594,
220,
1303,
645,
20402,
25,
412,
33548,
628,
220,
220,
220,
4946,
17614,
1020,
2196,
25... | 2.353568 | 13,986 |
"""`oteapi.plugins` module."""
from .factories import create_strategy, load_strategies
__all__ = ("create_strategy", "load_strategies")
| [
37811,
63,
1258,
15042,
13,
37390,
63,
8265,
526,
15931,
198,
6738,
764,
22584,
1749,
1330,
2251,
62,
2536,
4338,
11,
3440,
62,
2536,
2397,
444,
198,
198,
834,
439,
834,
796,
5855,
17953,
62,
2536,
4338,
1600,
366,
2220,
62,
2536,
2... | 2.978261 | 46 |