content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
from collections import namedtuple
import numpy as np
import talib
from jesse.helpers import get_candle_source
from jesse.helpers import slice_candles
MAMA = namedtuple('MAMA', ['mama', 'fama'])
def mama(candles: np.ndarray, fastlimit: float = 0.5, slowlimit: float = 0.05, source_type: str = "close",
sequ... | [
6738,
17268,
1330,
3706,
83,
29291,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
3305,
571,
198,
198,
6738,
474,
35270,
13,
16794,
364,
1330,
651,
62,
46188,
293,
62,
10459,
198,
6738,
474,
35270,
13,
16794,
364,
1330,
16416,
... | 2.590659 | 364 |
if __name__ == '__main__':
num_people = int(input())
people_info = list()
for i in range(num_people):
age, name = input().split(' ')
single_people = {
'key': i,
'age': int(age),
'name': name
}
people_info.append(single_people)
peopl... | [
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
997,
62,
15332,
796,
493,
7,
15414,
28955,
198,
220,
220,
220,
661,
62,
10951,
796,
1351,
3419,
628,
220,
220,
220,
329,
1312,
287,
2837,
7,
2... | 2.105263 | 209 |
__all__ = ["LateXActions"]
from endplay.dealer.actions.base import BaseActions
from endplay.types import Denom, Player
from io import StringIO
import endplay.stats as stats
import matplotlib.pyplot as plt | [
171,
119,
123,
834,
439,
834,
796,
14631,
26302,
55,
32,
2733,
8973,
198,
198,
6738,
886,
1759,
13,
31769,
263,
13,
4658,
13,
8692,
1330,
7308,
32,
2733,
198,
6738,
886,
1759,
13,
19199,
1330,
5601,
296,
11,
7853,
198,
6738,
33245,
... | 3.169231 | 65 |
__all__ = ["DAT_restraint", "static_DAT_restraint"]
from paprika.restraints.restraints import DAT_restraint, static_DAT_restraint
| [
834,
439,
834,
796,
14631,
35,
1404,
62,
2118,
16947,
1600,
366,
12708,
62,
35,
1404,
62,
2118,
16947,
8973,
198,
198,
6738,
20461,
28716,
13,
2118,
15517,
13,
2118,
15517,
1330,
360,
1404,
62,
2118,
16947,
11,
9037,
62,
35,
1404,
6... | 2.869565 | 46 |
import numpy as np
import scipy.interpolate
import time
from liegroups import SE3
from pyslam.utils import stackmul, bilinear_interpolate
from numba import guvectorize, float32, float64
SE3_ODOT_SHAPE = np.empty(6)
@guvectorize([(float32[:], float32[:], float32[:, :]),
(float64[:], float64[:], float... | [
11748,
299,
32152,
355,
45941,
198,
11748,
629,
541,
88,
13,
3849,
16104,
378,
198,
11748,
640,
198,
198,
6738,
6486,
24432,
1330,
7946,
18,
198,
6738,
279,
893,
2543,
13,
26791,
1330,
8931,
76,
377,
11,
47027,
259,
451,
62,
3849,
1... | 2.14895 | 1,571 |
from pox.core import core
from pox.openflow import *
import pox.openflow.libopenflow_01 as of
from pox.lib.packet.arp import arp
from pox.lib.packet.ipv4 import ipv4
from pox.lib.addresses import EthAddr, IPAddr
log = core.getLogger()
import time
import random
import pox.log.color
IDLE_TIMEOUT = 10
LOADBALANCER_MAC =... | [
6738,
745,
87,
13,
7295,
1330,
4755,
198,
6738,
745,
87,
13,
9654,
11125,
1330,
1635,
198,
11748,
745,
87,
13,
9654,
11125,
13,
8019,
9654,
11125,
62,
486,
355,
286,
198,
6738,
745,
87,
13,
8019,
13,
8002,
316,
13,
5117,
1330,
610... | 2.440476 | 168 |
from django.test import TestCase
from django_generic.db_expressions import db_replace
from tests.factories import ExampleModelFactory
from tests.models import ExampleModel
| [
6738,
42625,
14208,
13,
9288,
1330,
6208,
20448,
198,
198,
6738,
42625,
14208,
62,
41357,
13,
9945,
62,
42712,
507,
1330,
20613,
62,
33491,
198,
6738,
5254,
13,
22584,
1749,
1330,
17934,
17633,
22810,
198,
6738,
5254,
13,
27530,
1330,
1... | 4.046512 | 43 |
import random
from cs.structures import BinomialHeap
class TestBinomialHeap:
"""
This class only contains tests exclusive to Binomial Heaps.
All other common heap functionality tests are located in heap_test.py.
"""
@staticmethod
| [
11748,
4738,
198,
198,
6738,
50115,
13,
7249,
942,
1330,
20828,
49070,
1544,
499,
628,
198,
4871,
6208,
33,
259,
49070,
1544,
499,
25,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
770,
1398,
691,
4909,
5254,
8568,
284,
20828,
49070,... | 3.298701 | 77 |
# FastAPI
import os
import urllib
from typing import List, Optional
import databases as databases
import sqlalchemy
from fastapi import FastAPI, Request
from fastapi.responses import JSONResponse, FileResponse
from fastapi.middleware.cors import CORSMiddleware
# Model
from starlette.staticfiles import StaticFiles
f... | [
2,
12549,
17614,
198,
11748,
28686,
198,
11748,
2956,
297,
571,
198,
6738,
19720,
1330,
7343,
11,
32233,
198,
198,
11748,
20083,
355,
20083,
198,
11748,
44161,
282,
26599,
198,
6738,
3049,
15042,
1330,
12549,
17614,
11,
19390,
198,
6738,
... | 2.504207 | 1,545 |
#Define error Pred-> Predicted value,Value-> Real value ,error->Type of error
| [
2,
7469,
500,
4049,
220,
14322,
3784,
14322,
5722,
1988,
11,
11395,
3784,
6416,
1988,
837,
18224,
3784,
6030,
286,
4049,
201
] | 3.590909 | 22 |
# 执行用时:40 ms, 在所有 Python3 提交中击败了75.83%的用户
# 内存消耗:14.8 MB, 在所有 Python3 提交中击败了77.06%的用户
————————————————
版权声明:本文为CSDN博主「黑黑白白君」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/m0_37621024/article/details/117857152
| [
2,
10545,
231,
100,
26193,
234,
18796,
101,
33768,
114,
171,
120,
248,
1821,
13845,
11,
10263,
250,
101,
33699,
222,
17312,
231,
11361,
18,
10545,
237,
238,
12859,
97,
40792,
49035,
119,
164,
112,
98,
12859,
228,
2425,
13,
5999,
4,
... | 0.946939 | 245 |
# Build script for bookstore
# This (re)creates or refreshes the bookstore UniVerse workspace
import os
import u2py
if __name__ == "__main__":
a = BookstoreSetup()
a.run()
| [
2,
10934,
4226,
329,
44346,
198,
2,
770,
357,
260,
8,
20123,
274,
393,
17434,
956,
262,
44346,
43376,
13414,
325,
44573,
198,
11748,
28686,
198,
11748,
334,
17,
9078,
628,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
... | 2.794118 | 68 |
import requests
from bs4 import BeautifulSoup
import xlsxwriter
Page=286
filename='农业标准化信息'
# url='http://sfq.ahqi.gov.cn/demoQuery/list?pageNow=2&demoCode=&demoName=&assumeUnit=&cityId=0&productId=&demoBatch=&mgrMode=&demoLevel=&beginYear='
workbook = xlsxwriter.Workbook('./'+filename+'.xlsx')
worksheet = workb... | [
11748,
7007,
201,
198,
6738,
275,
82,
19,
1330,
23762,
50,
10486,
201,
198,
11748,
2124,
7278,
87,
16002,
201,
198,
9876,
28,
27033,
201,
198,
34345,
11639,
37863,
250,
10310,
248,
43718,
229,
49035,
228,
44293,
244,
46479,
94,
162,
2... | 1.612802 | 1,281 |
from unittest import TestCase
from unittest.mock import MagicMock, patch
import pigpio
from pirgblight import generate_app
| [
6738,
555,
715,
395,
1330,
6208,
20448,
201,
198,
6738,
555,
715,
395,
13,
76,
735,
1330,
6139,
44,
735,
11,
8529,
201,
198,
201,
198,
11748,
12967,
79,
952,
201,
198,
6738,
12276,
70,
2436,
432,
1330,
7716,
62,
1324,
201,
198
] | 3 | 43 |
import logging
import numpy as np
from tqdm import tqdm
from ..base import BaseDataset, BaseModel, BaseTask
from .schemas import PrepareTaskSchema
logging.basicConfig(level=logging.INFO, format="%(asctime)s %(levelname)s %(message)s")
class StatsTask(BaseTask):
"""Get some basic stats for a dataset """
s... | [
11748,
18931,
198,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
256,
80,
36020,
1330,
256,
80,
36020,
198,
198,
6738,
11485,
8692,
1330,
7308,
27354,
292,
316,
11,
7308,
17633,
11,
7308,
25714,
198,
6738,
764,
1416,
4411,
292,
1330,
... | 2.273616 | 614 |
import argparse
import os
from interactsh import *
import random
import requests
import time
import sys
from urllib import parse as urlparse
import base64
import json
import random
from uuid import uuid4
from base64 import b64encode, b64decode
from Crypto.Cipher import AES, PKCS1_OAEP
from Crypto.PublicKey import RSA
... | [
198,
11748,
1822,
29572,
198,
11748,
28686,
198,
6738,
9427,
1477,
1330,
1635,
198,
11748,
4738,
198,
11748,
7007,
198,
11748,
640,
198,
11748,
25064,
198,
6738,
2956,
297,
571,
1330,
21136,
355,
19016,
29572,
198,
11748,
2779,
2414,
198,... | 2.825203 | 246 |
# Copyright (c) 2019, Moritz E. Beber.
#
# 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... | [
2,
15069,
357,
66,
8,
13130,
11,
3461,
4224,
412,
13,
1355,
527,
13,
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,
3... | 2.974654 | 434 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter
import os
def parse_args():
"""Parse input arguments
"""
parser = ArgumentParser()
parser.add_argument('--video_list',
help=('video list'),
default='list.txt')
pa... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
1822,
29572,
1330,
45751,
46677,
11,
45751,
7469,
13185,
22087,
8479,
1436,
198,
11748,
28686,
198,
198,
4299,
2113... | 2.447115 | 208 |
from plone.testing import z2
from plone.app.testing import (
PloneSandboxLayer,
PLONE_INTEGRATION_TESTING,
IntegrationTesting,
TEST_USER_NAME,
TEST_USER_ID,
login,
setRoles,
)
SOUP_FIXTURE = SoupFixture()
SOUP_INTEGRATION_TESTING = IntegrationTesting(bases=(SOUP_FIXTURE,),
... | [
6738,
458,
505,
13,
33407,
1330,
1976,
17,
198,
6738,
458,
505,
13,
1324,
13,
33407,
1330,
357,
198,
220,
220,
220,
1345,
505,
18471,
3524,
49925,
11,
198,
220,
220,
220,
9297,
11651,
62,
12394,
7156,
49,
6234,
62,
51,
6465,
2751,
... | 2.07027 | 185 |
import tensorflow as tf
import time
import numpy as np
flags = tf.flags
logging = tf.logging
flags.DEFINE_string(
"model", "small",
"A type of model. Possible options are: small, medium, large.")
flags.DEFINE_string("data_path", None, "data_path")
flags.DEFINE_bool("use_fp16", False,
"Train... | [
11748,
11192,
273,
11125,
355,
48700,
198,
11748,
640,
198,
11748,
299,
32152,
355,
45941,
628,
198,
33152,
796,
48700,
13,
33152,
198,
6404,
2667,
796,
48700,
13,
6404,
2667,
198,
198,
33152,
13,
7206,
29940,
62,
8841,
7,
198,
220,
2... | 2.189529 | 955 |
import subprocess
from django.conf import settings
from django.core.management.base import BaseCommand
HELP_TEXT = """Compile webpack bundles"""
| [
11748,
850,
14681,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
7295,
13,
27604,
13,
8692,
1330,
7308,
21575,
628,
198,
39,
3698,
47,
62,
32541,
796,
37227,
7293,
576,
3992,
8002,
36344,
37811,
628
] | 3.7 | 40 |
from .serialiser import *
from . import json_serialiser | [
6738,
764,
46911,
5847,
1330,
1635,
198,
198,
6738,
764,
1330,
33918,
62,
46911,
5847
] | 3.733333 | 15 |
ADAMSLegacyDict = {'STATEID':39112,'PARCELID':39112,'TAXPARCELID':0,'PARCELDATE':693,'TAXROLLYEAR':39112,'OWNERNME1':38430,'OWNERNME2':11188,'PSTLADRESS':38382,'SITEADRESS':22632,'ADDNUMPREFIX':28,'ADDNUM':22632,'ADDNUMSUFFIX':755,'PREFIX':6195,'STREETNAME':22632,'STREETTYPE':19752,'SUFFIX':0,'LANDMARKNAME':116,'UNITTY... | [
2885,
2390,
8634,
1533,
1590,
35,
713,
796,
1391,
6,
44724,
2389,
10354,
2670,
14686,
4032,
47,
25793,
3698,
2389,
10354,
2670,
14686,
4032,
5603,
27481,
25793,
3698,
2389,
10354,
15,
4032,
47,
25793,
24639,
6158,
10354,
48528,
4032,
5603... | 2.208464 | 25,237 |
MAX_ACCOUNT_BALANCE = 1000000
MAX_NUM_SHARES = 2_147_483_647
MAX_SHARE_PRICE = 5000
MAX_OPEN_POSITIONS = 5
MAX_STEPS = 20000
INITIAL_ACCOUNT_BALANCE = 1000 | [
22921,
62,
26861,
28270,
62,
33,
1847,
19240,
796,
1802,
2388,
198,
22921,
62,
41359,
62,
9693,
1503,
1546,
796,
362,
62,
20198,
62,
38783,
62,
33981,
198,
22921,
62,
42597,
62,
4805,
8476,
796,
23336,
198,
22921,
62,
3185,
1677,
62,
... | 2.26087 | 69 |
"""
Requests related to the ODM Adapter
http://rws-webhelp.s3.amazonaws.com/WebHelp_ENG/solutions/clinical_data_audits/index.html#odm-adapter
"""
from . import RWSAuthorizedGetRequest, QueryOptionGetRequest
class AuditRecordsRequest(QueryOptionGetRequest):
"""Clinical Audit Records Dataset"""
KNOWN_QUERY_OP... | [
37811,
198,
16844,
3558,
3519,
284,
262,
440,
23127,
43721,
198,
198,
4023,
1378,
81,
18504,
12,
12384,
16794,
13,
82,
18,
13,
33103,
8356,
13,
785,
14,
13908,
22087,
62,
26808,
14,
82,
14191,
14,
47367,
62,
7890,
62,
3885,
896,
14,... | 2.56811 | 1,894 |
import collections
from collections import OrderedDict
from typing import Dict
import msgpack
from common.serializers.mapping_serializer import MappingSerializer
from common.serializers.stream_serializer import StreamSerializer
class MsgPackSerializer(MappingSerializer, StreamSerializer):
"""
http://msgpack... | [
11748,
17268,
198,
6738,
17268,
1330,
14230,
1068,
35,
713,
198,
6738,
19720,
1330,
360,
713,
198,
198,
11748,
31456,
8002,
198,
6738,
2219,
13,
46911,
11341,
13,
76,
5912,
62,
46911,
7509,
1330,
337,
5912,
32634,
7509,
198,
6738,
2219,... | 2.683333 | 480 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
from builtins import str
from builtins import object
import sys
import os
import time
import re
import atexit
try:
import readline # Work around GH-2230
except ImportError:
pass # all that will ha... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
11,
7297,
11,
3601,
62,
8818,
198,
198,
6738,
3170,
1040,
1330,
... | 2.285886 | 5,810 |
#!/usr/bin/python3
from collections import Counter
# Load input
with open("input.txt", "r") as f:
ids = [l.strip() for l in f]
# Solution 1
# Could be faster to make the counter objects once?
two_letter_ids = [id for id in ids if 2 in Counter(id).values()]
three_letter_ids = [id for id in ids if 3 in Counter(id... | [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
198,
6738,
17268,
1330,
15034,
198,
198,
2,
8778,
5128,
198,
4480,
1280,
7203,
15414,
13,
14116,
1600,
366,
81,
4943,
355,
277,
25,
198,
220,
220,
220,
220,
2340,
796,
685,
75,
13,
36... | 2.568513 | 343 |
from typing import List
from abc import abstractmethod
import threading
from journey11.src.interface.srcsink import SrcSink
from journey11.src.interface.capability import Capability
from journey11.src.interface.srcsinkpingnotification import SrcSinkPingNotification
from journey11.src.interface.srcsinkping import SrcSin... | [
6738,
19720,
1330,
7343,
198,
6738,
450,
66,
1330,
12531,
24396,
198,
11748,
4704,
278,
198,
6738,
7002,
1157,
13,
10677,
13,
39994,
13,
10677,
82,
676,
1330,
311,
6015,
50,
676,
198,
6738,
7002,
1157,
13,
10677,
13,
39994,
13,
11128,... | 3.910345 | 145 |
import json
import os,fnmatch
#from graph_tool.all import *
import csv
pattern = "*.metadata.json"
listOfFiles=os.listdir('.')
data = {}
data['ruby_package'] = []
for root, dirs, files in os.walk("."):
package_name= root.strip("./")
#print "-----------"
print package_name
for entry in files:
... | [
11748,
33918,
198,
11748,
28686,
11,
22184,
15699,
198,
2,
6738,
4823,
62,
25981,
13,
439,
1330,
1635,
198,
11748,
269,
21370,
198,
198,
33279,
796,
366,
24620,
38993,
13,
17752,
1,
198,
4868,
5189,
25876,
28,
418,
13,
4868,
15908,
10... | 1.887155 | 833 |
"""Unit tests for the Jenkins CI integration."""
from __future__ import unicode_literals
import json
import kgb
import reviewboard
from django.utils.encoding import force_bytes
from django.utils.six.moves.urllib.error import HTTPError
from django.utils.six.moves.urllib.parse import urlencode
from djblets.conditions ... | [
37811,
26453,
5254,
329,
262,
21835,
14514,
11812,
526,
15931,
198,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
11748,
33918,
198,
198,
11748,
14211,
65,
198,
11748,
2423,
3526,
198,
6738,
42625,
14208,
13,
... | 1.895642 | 8,078 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from os import system
main() # chama o main, primeira funcao a ser executada
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
6738,
28686,
1330,
1080,
628,
628,
198,
12417,
3419,
220,
1303,
442,
1689,
267,
1388,
11,
6994,
8704,
25439,
5488,... | 2.632653 | 49 |
#!/usr/bin/python
"""
Setup tools script for DTN-RM Site Agent.
To Install:
python setup-agent.py build install --force
Copyright 2017 California Institute of Technology
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may ... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
37811,
198,
40786,
4899,
4226,
329,
24311,
45,
12,
29138,
14413,
15906,
13,
198,
2514,
15545,
25,
198,
220,
220,
220,
21015,
9058,
12,
25781,
13,
9078,
1382,
2721,
1377,
3174,
198,
15269,
217... | 2.535673 | 855 |
import pandas as pd
if __name__ == '__main__':
top3()
| [
11748,
19798,
292,
355,
279,
67,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
1353,
18,
3419,
198
] | 2.259259 | 27 |
import argparse
import os
from comparator import *
from imgcomparing import *
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument("ref", help="Reference image image")
parser.add_argument("tar", help="Target image image")
parser.add_argument("--diff", help="Compare images ... | [
11748,
1822,
29572,
198,
11748,
28686,
198,
198,
6738,
4616,
1352,
1330,
1635,
198,
6738,
33705,
5589,
1723,
1330,
1635,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
30751,
796,
1822,
29572,
13... | 2.542345 | 614 |
import cv2, torch
from dl.data.txtrecog import datasets
from dl.models import FOTSRes50
from dl.data.utils.converter import toVisualizeQuadsTextRGBimg
if __name__ == '__main__':
model = FOTSRes50(chars=datasets.SynthText_char_labels_without_upper_blank, input_shape=(None, None, 3), feature_height=8).cuda()
mo... | [
11748,
269,
85,
17,
11,
28034,
198,
198,
6738,
288,
75,
13,
7890,
13,
14116,
8344,
519,
1330,
40522,
198,
6738,
288,
75,
13,
27530,
1330,
376,
33472,
4965,
1120,
198,
6738,
288,
75,
13,
7890,
13,
26791,
13,
1102,
332,
353,
1330,
2... | 2.235686 | 751 |
# Generated by Django 3.1 on 2020-08-26 11:35
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
513,
13,
16,
319,
12131,
12,
2919,
12,
2075,
1367,
25,
2327,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.966667 | 30 |
import pytest
from dlapp.collection import Element
from dlapp.collection import LookupCls
from dlapp.collection import List
from dlapp.collection import ListIndexError
@pytest.fixture
@pytest.fixture
| [
11748,
12972,
9288,
198,
198,
6738,
288,
75,
1324,
13,
43681,
1330,
11703,
198,
6738,
288,
75,
1324,
13,
43681,
1330,
6803,
929,
2601,
82,
198,
6738,
288,
75,
1324,
13,
43681,
1330,
7343,
198,
6738,
288,
75,
1324,
13,
43681,
1330,
7... | 3.301587 | 63 |
from datetime import datetime, date, time, timedelta
from django.conf import settings
from calendartools.utils import timedelta_to_total_seconds
# Enables a templatetag override which ensures that nothing within the {% url
# %} templatetag is translated.
NO_URL_TRANSLATION = True
CALENDAR_APP_LABEL = getattr(settings... | [
6738,
4818,
8079,
1330,
4818,
8079,
11,
3128,
11,
640,
11,
28805,
12514,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
2386,
437,
433,
10141,
13,
26791,
1330,
28805,
12514,
62,
1462,
62,
23350,
62,
43012,
198,
198,
2,
203... | 2.80667 | 2,069 |
from autosklearn.classification import AutoSklearnClassifier
from autosklearn.regression import AutoSklearnRegressor
from autosklearn.metrics import make_scorer
from .classification import get_X_Y_data, split_dataset, get_random_filename
from sklearn import metrics
import pandas as pd
import os
from settings.default im... | [
6738,
44619,
74,
35720,
13,
4871,
2649,
1330,
11160,
15739,
35720,
9487,
7483,
198,
6738,
44619,
74,
35720,
13,
2301,
2234,
1330,
11160,
15739,
35720,
8081,
44292,
198,
6738,
44619,
74,
35720,
13,
4164,
10466,
1330,
787,
62,
1416,
11934,
... | 2.860963 | 187 |
import bpy
import mathutils
from . import _common
| [
11748,
275,
9078,
198,
11748,
10688,
26791,
198,
6738,
764,
1330,
4808,
11321,
628
] | 3.642857 | 14 |
from netCDF4 import Dataset as ns
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
from matplotlib.patches import Rectangle, Ellipse
from matplotlib.patches import Polygon
from matplotlib.collections import PatchCollection
import os
gs = gridspec.GridSpec... | [
6738,
220,
220,
2010,
34,
8068,
19,
1330,
16092,
292,
316,
355,
36545,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
198,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
2603,
29487,
8019,
... | 2.283051 | 2,897 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | [
2,
19617,
28,
40477,
12,
23,
198,
2,
16529,
35937,
198,
2,
15069,
357,
66,
8,
5413,
10501,
13,
1439,
2489,
10395,
13,
198,
2,
49962,
739,
262,
17168,
13789,
13,
4091,
13789,
13,
14116,
287,
262,
1628,
6808,
329,
198,
2,
5964,
1321... | 3.097098 | 896 |
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
# File : inspect.py
# Author : Jiayuan Mao
# Email : maojiayuan@gmail.com
# Date : 07/05/2018
#
# This file is part of Jacinle.
# Distributed under terms of the MIT license.
"""
Code inspection tools.
"""
import inspect
from . import _inspect_mate
__all__ = ['clas... | [
2,
0,
1220,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
9220,
220,
220,
1058,
10104,
13,
9078,
198,
2,
6434,
1058,
29380,
323,
7258,
22828,
198,
2,
9570,
220,
105... | 2.631579 | 152 |
from flask_sqlalchemy import SQLAlchemy
db = SQLAlchemy()
def connect_to_db(app):
"""Connect the database to our Flask app."""
# Configure to use our PstgreSQL database
app.config["SQLALCHEMY_DATABASE_URI"] = "postgresql:///tracker"
app.config["SQLALCHEMY_TRACK_MODIFICATIONS"] = False
db.app = ... | [
6738,
42903,
62,
25410,
282,
26599,
1330,
16363,
2348,
26599,
628,
198,
9945,
796,
16363,
2348,
26599,
3419,
628,
198,
4299,
2018,
62,
1462,
62,
9945,
7,
1324,
2599,
198,
220,
220,
220,
37227,
13313,
262,
6831,
284,
674,
46947,
598,
5... | 2.658228 | 158 |
import torch
from torch import nn
from torch.utils.data import DataLoader
from torchvision.transforms import ToTensor
# Cuando se haga paquete como tal, podremos borrar las dos siguientes lineas
from sys import path
path.append('C:\\Users\\AntonioJ\\Trabajo\\PyTorch\\PyTorchKafkaDataset\\src')
from TrainingKafkaDatas... | [
11748,
28034,
198,
6738,
28034,
1330,
299,
77,
198,
6738,
28034,
13,
26791,
13,
7890,
1330,
6060,
17401,
198,
6738,
28034,
10178,
13,
7645,
23914,
1330,
1675,
51,
22854,
198,
198,
2,
14496,
25440,
384,
289,
8126,
14187,
421,
14471,
401,... | 2.406593 | 819 |
import os,sys
import numpy as np
import caffe
import xml.etree.ElementTree as ET
| [
11748,
28686,
11,
17597,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
21121,
198,
11748,
35555,
13,
316,
631,
13,
20180,
27660,
355,
12152,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220
] | 2.513514 | 37 |
from tkinter import *
import cv2
from PIL import Image, ImageTk
if __name__ == "__main__":
main() | [
6738,
256,
74,
3849,
1330,
1635,
198,
11748,
269,
85,
17,
198,
6738,
350,
4146,
1330,
7412,
11,
7412,
51,
74,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
1388,
3419
] | 2.615385 | 39 |
# -*- coding: utf-8 -*-
from helpers import *
def executives(update, context):
"""List executives for the document"""
m = re.match("/executives\\s+(.+)", update.message.text)
if not m:
update.message.reply_text(I_DONT_UNDERSTAND)
return
name_or_id = m.groups()[0].lower().strip()
l... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
6738,
49385,
1330,
1635,
628,
198,
4299,
12353,
7,
19119,
11,
4732,
2599,
198,
220,
220,
220,
37227,
8053,
12353,
329,
262,
3188,
37811,
198,
220,
220,
220,
285,
... | 2.268362 | 708 |
from __future__ import annotations
from logzero import logger
from selenium.webdriver.common.by import By
from selenium.webdriver.firefox.webdriver import WebDriver
from selenium.webdriver.support.select import Select
from driver_singleton import DriverSingleton
from utilities import requires_url
| [
6738,
11593,
37443,
834,
1330,
37647,
198,
198,
6738,
2604,
22570,
1330,
49706,
198,
6738,
384,
11925,
1505,
13,
12384,
26230,
13,
11321,
13,
1525,
1330,
2750,
198,
6738,
384,
11925,
1505,
13,
12384,
26230,
13,
6495,
12792,
13,
12384,
2... | 3.909091 | 77 |
from wasmer import wasi, Store, ImportObject, Module, Instance
from enum import IntEnum
import os
import pytest
import subprocess
import sys
here = os.path.dirname(os.path.realpath(__file__))
TEST_BYTES = open(here + '/wasi.wasm', 'rb').read()
| [
6738,
373,
647,
1330,
373,
72,
11,
9363,
11,
17267,
10267,
11,
19937,
11,
2262,
590,
198,
6738,
33829,
1330,
2558,
4834,
388,
198,
11748,
28686,
198,
11748,
12972,
9288,
198,
11748,
850,
14681,
198,
11748,
25064,
198,
198,
1456,
796,
... | 2.916667 | 84 |
import face_model
import argparse
import cv2
import sys
import numpy as np
from mxnet2pytorch import *
from model_pytorch import *
import torch
parser = argparse.ArgumentParser(description='face model test')
# general
parser.add_argument('--image-size', default='112,112', help='')
parser.add_argument('--model', defaul... | [
11748,
1986,
62,
19849,
198,
11748,
1822,
29572,
198,
11748,
269,
85,
17,
198,
11748,
25064,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
285,
87,
3262,
17,
9078,
13165,
354,
1330,
1635,
198,
6738,
2746,
62,
9078,
13165,
354,
1330,
... | 2.188312 | 924 |
from __future__ import division, absolute_import, print_function
import numpy as np
import scipy.sparse as ss
import scipy.sparse.csgraph as ssc
import warnings
from ..mini_six import range
from ._betweenness import betweenness
| [
6738,
11593,
37443,
834,
1330,
7297,
11,
4112,
62,
11748,
11,
3601,
62,
8818,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
629,
541,
88,
13,
82,
29572,
355,
37786,
198,
11748,
629,
541,
88,
13,
82,
29572,
13,
6359,
34960,
355,
26... | 3.578125 | 64 |
# -*- coding: utf-8 -*-
"""Predicates for checking a node's type."""
from typing import Tuple, Type, Union
from .utils import node_predicate
from ..typing import NodePredicate
from ....dsl import (
Abundance, BaseEntity, BiologicalProcess, CentralDogma, ComplexAbundance, CompositeAbundance, Gene, ListAbundance,
... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
37811,
39156,
16856,
329,
10627,
257,
10139,
338,
2099,
526,
15931,
198,
198,
6738,
19720,
1330,
309,
29291,
11,
5994,
11,
4479,
198,
198,
6738,
764,
26791,
1330,
1... | 2.4164 | 939 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
49962,
284,
1012,
280,
1082,
64,
11,
3457,
13,
739,
530,
198,
2,
393,
517,
18920,
5964,
11704,
13,
220,
4091,
26... | 3.547804 | 387 |
from django.contrib import admin
from undp_extra_features.models import ProjectYearSummary
admin.site.register(ProjectYearSummary, ProjectYearSummaryAdmin)
| [
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
198,
6738,
3318,
79,
62,
26086,
62,
40890,
13,
27530,
1330,
4935,
17688,
22093,
628,
198,
198,
28482,
13,
15654,
13,
30238,
7,
16775,
17688,
22093,
11,
4935,
17688,
22093,
46787,
8,
... | 3.809524 | 42 |
"""Helper function to create a trainer for a given model.
Adapted from https://github.com/atomistic-machine-learning/schnetpack/blob/dev/src/schnetpack/utils/script_utils/training.py
"""
import os
import json
import nff
import torch
from torch.optim import Adam
| [
37811,
47429,
2163,
284,
2251,
257,
21997,
329,
257,
1813,
2746,
13,
198,
198,
48003,
276,
422,
3740,
1378,
12567,
13,
785,
14,
37696,
2569,
12,
30243,
12,
40684,
14,
82,
1349,
316,
8002,
14,
2436,
672,
14,
7959,
14,
10677,
14,
82,
... | 3.283951 | 81 |
#!/usr/bin/env python
#Variaveis Globais
c = 0
ac = 0
#Entrada do Usuario
print('')
n1 = int(input('Informe um valor: '))
n2 = int(input('Informe outro valor: '))
#Logica do programa
while c < n2:
ac += n1
c += 1
print('')
print(f'{n1} x {n2} =', (ac))
print('')
print('FIM ')
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
53,
10312,
303,
271,
40713,
15152,
198,
66,
796,
657,
198,
330,
796,
657,
198,
2,
14539,
81,
4763,
466,
471,
2385,
4982,
198,
4798,
7,
7061,
8,
198,
77,
16,
796,
493,
7,
15414... | 2.05036 | 139 |
# -----------------------------------------------------------------------------
# Copyright (c) 2014--, The Qiita Development Team.
#
# Distributed under the terms of the BSD 3-clause License.
#
# The full license is in the file LICENSE, distributed with this software.
# ------------------------------------------------... | [
2,
16529,
32501,
198,
2,
15069,
357,
66,
8,
1946,
438,
11,
383,
21924,
5350,
7712,
4816,
13,
198,
2,
198,
2,
4307,
6169,
739,
262,
2846,
286,
262,
347,
10305,
513,
12,
565,
682,
13789,
13,
198,
2,
198,
2,
383,
1336,
5964,
318,
... | 1.842781 | 14,095 |
# Retrieve functions
import requests
import config as cfg
def getVector(text):
"""
Calls an external service to get the 512 dimensional vector representation of a piece of text.
"""
url = cfg.use_vectoriser
res = requests.post(url, json={'text': text})
res_dictionary = res.json()
return res_dictionary['vecto... | [
2,
4990,
30227,
5499,
198,
11748,
7007,
198,
11748,
4566,
355,
30218,
70,
628,
198,
4299,
651,
38469,
7,
5239,
2599,
198,
197,
37811,
198,
220,
27592,
281,
7097,
2139,
284,
651,
262,
22243,
38517,
15879,
10552,
286,
257,
3704,
286,
24... | 2.563697 | 3,603 |
# Remove "http://sn" login_url
import logging
# logger.basicConfig(filename=f"{__name__}.log")
logger = logging.getLogger(__name__)
sHandler = logging.StreamHandler()
sHandler.setLevel(logging.INFO)
logger.addHandler(sHandler)
logfilenode = __file__.rsplit('.')[0]
handler = logging.FileHandler(f"{logfilenode}.log")
han... | [
2,
17220,
366,
4023,
1378,
16184,
1,
17594,
62,
6371,
198,
11748,
18931,
198,
2,
49706,
13,
35487,
16934,
7,
34345,
28,
69,
1,
90,
834,
3672,
834,
27422,
6404,
4943,
198,
6404,
1362,
796,
18931,
13,
1136,
11187,
1362,
7,
834,
3672,
... | 2.369987 | 773 |
from django.apps import AppConfig
| [
6738,
42625,
14208,
13,
18211,
1330,
2034,
16934,
628
] | 3.888889 | 9 |
import vrep_api.vrep as vrep
CLIENTID = 0
VALID_ERROR_CODES = (0, 1)
GLOBALID = -1
MOTOR_NAME_TEMPLATES = ['flv', 'mlv', 'blv', 'brv', 'mrv', 'frv', 'flh', 'mlh', \
'blh', 'brh', 'mrh', 'frh']
DEFAULT_BIASES = (.925, 1) # To correct for model imbalances
| [
11748,
410,
7856,
62,
15042,
13,
85,
7856,
355,
410,
7856,
198,
198,
5097,
28495,
2389,
796,
657,
198,
23428,
2389,
62,
24908,
62,
34,
3727,
1546,
796,
357,
15,
11,
352,
8,
198,
8763,
9864,
1847,
2389,
796,
532,
16,
198,
44,
2394,... | 1.886667 | 150 |
#!/usr/bin/env python
#import argparse
#from glob import glob
from os.path import join as jp
from os.path import abspath
import os
import sys
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('-s', "--variant", help="raw variant (.vcf) file", required=True)
parser.add_argument('-b', "--bwaindex",... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
11748,
1822,
29572,
198,
2,
6738,
15095,
1330,
15095,
198,
198,
6738,
28686,
13,
6978,
1330,
4654,
355,
474,
79,
198,
6738,
28686,
13,
6978,
1330,
2352,
6978,
198,
11748,
28686,
198... | 2.839529 | 1,614 |
from django.urls import path
from django.urls import include
from uploadapp import views
from .views import *
urlpatterns = [
path('file', FileUploadView.as_view()),
path('columns', columns.as_view()),
]
| [
6738,
42625,
14208,
13,
6371,
82,
1330,
3108,
198,
6738,
42625,
14208,
13,
6371,
82,
1330,
2291,
198,
6738,
9516,
1324,
1330,
5009,
198,
6738,
764,
33571,
1330,
1635,
198,
6371,
33279,
82,
796,
685,
628,
220,
220,
220,
3108,
10786,
77... | 2.972222 | 72 |
# -*- coding: utf-8 -*-
"""
Tests Messaging backends base module.
"""
from __future__ import unicode_literals
from django.test import TestCase
from onadata.apps.messaging.backends.base import call_backend
from onadata.apps.messaging.tests.test_base import (_create_message,
... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
51,
3558,
10626,
3039,
736,
2412,
2779,
8265,
13,
198,
37811,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
6738,
42625,
14208,
... | 2.271318 | 387 |
# Generated by Django 4.0 on 2021-12-10 05:37
from django.db import migrations
| [
2,
2980,
515,
416,
37770,
604,
13,
15,
319,
33448,
12,
1065,
12,
940,
8870,
25,
2718,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
628
] | 2.892857 | 28 |
import ldap
from django.contrib.auth.backends import ModelBackend
from django.contrib.auth.models import User
# Django LDAP package (inspiration for multple atttempts)
# https://django-auth-ldap.readthedocs.io/en/latest/custombehavior.html
# Auth backend: https://docs.djangoproject.com/en/3.0/topics/auth/customizin... | [
11748,
300,
67,
499,
198,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
1891,
2412,
1330,
9104,
7282,
437,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
27530,
1330,
11787,
628,
198,
2,
37770,
27178,
2969,
5301,
357,... | 2.901316 | 152 |
import numpy as np
from sklearn.svm import SVR
import matplotlib.pylab as plt
import pandas as pd
import time
path = '/Users/kanghaidong/Desktop/haidong/github-reper/Machine-learning-regression-algorithm/data/stock_pinganyinhang.csv'
df=pd.read_csv(path,encoding='GBK')
y = df[['closePrice']].values
df = df.dropna(axi... | [
11748,
299,
32152,
355,
45941,
198,
6738,
1341,
35720,
13,
82,
14761,
1330,
311,
13024,
198,
11748,
2603,
29487,
8019,
13,
79,
2645,
397,
355,
458,
83,
198,
11748,
19798,
292,
355,
279,
67,
628,
198,
11748,
640,
198,
6978,
796,
31051,... | 2.210797 | 389 |
#!/usr/bin/python3
import os
import sys
import argparse
import socket
import fcntl
import struct
import getpass
import configparser
from subprocess import run, Popen, PIPE
from dotenv import load_dotenv
from collections import OrderedDict
host_iface = None
def restart_wireguard():
'''
Restarts the wireguard ... | [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
198,
11748,
28686,
198,
11748,
25064,
198,
11748,
1822,
29572,
198,
11748,
17802,
198,
11748,
277,
66,
429,
75,
198,
11748,
2878,
198,
11748,
651,
6603,
198,
11748,
4566,
48610,
198,
6738,
... | 2.296228 | 4,348 |
from ..model import app
from .usuario_controller import UsuarioController
from .discente_controller import DiscenteController
from .docente_controller import DocenteController
from .tecnico_controller import TecnicoController
from .portaria_controller import PortariaController
from .direcao_controller import DirecaoCon... | [
6738,
11485,
19849,
1330,
598,
198,
6738,
764,
385,
84,
4982,
62,
36500,
1330,
471,
2385,
4982,
22130,
198,
6738,
764,
6381,
1087,
68,
62,
36500,
1330,
3167,
1087,
68,
22130,
198,
6738,
764,
15390,
21872,
62,
36500,
1330,
14432,
21872,
... | 3.829365 | 252 |
# -*- coding: utf-8 -*-
from django.shortcuts import get_object_or_404, render_to_response
from django.template import RequestContext, Context, loader
from django.utils.html import strip_tags
from urlparse import urljoin
from BeautifulSoup import BeautifulSoup, Comment
import re
from wikis.models.articles import Artic... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
42625,
14208,
13,
19509,
23779,
1330,
651,
62,
15252,
62,
273,
62,
26429,
11,
8543,
62,
1462,
62,
26209,
220,
198,
6738,
42625,
14208,
13,
28243,
1330,
19390,
2194... | 2.474962 | 659 |
import multiprocessing
# We sub-class multiprocessing.pool.Pool instead of multiprocessing.Pool
# because the latter is only a wrapper function, not a proper class.
| [
11748,
18540,
305,
919,
278,
628,
198,
198,
2,
775,
850,
12,
4871,
18540,
305,
919,
278,
13,
7742,
13,
27201,
2427,
286,
18540,
305,
919,
278,
13,
27201,
198,
2,
780,
262,
6846,
318,
691,
257,
29908,
2163,
11,
407,
257,
1774,
1398... | 3.652174 | 46 |
import os
import platform
import logging
import json
import shutil
import tempfile
import time
import uuid
from pathlib import Path
from unittest import skipIf
import pytest
import boto3
from parameterized import parameterized_class
from samcli.lib.utils.resources import (
AWS_APIGATEWAY_RESTAPI,
AWS_LAMBDA_... | [
11748,
28686,
198,
11748,
3859,
198,
198,
11748,
18931,
198,
11748,
33918,
198,
11748,
4423,
346,
198,
11748,
20218,
7753,
198,
11748,
640,
198,
11748,
334,
27112,
198,
6738,
3108,
8019,
1330,
10644,
198,
6738,
555,
715,
395,
1330,
14267,... | 2.898387 | 620 |
import tempfile
import torch
import torch.nn.functional as F
from determined.pytorch import DataLoader, PyTorchTrial, PyTorchTrialContext
from torch.utils.data import random_split
from torch_geometric.loader.dataloader import Collater
from torch_geometric.datasets import TUDataset
from torch_geometric.nn import (
... | [
11748,
20218,
7753,
198,
198,
11748,
28034,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
198,
6738,
5295,
13,
9078,
13165,
354,
1330,
6060,
17401,
11,
9485,
15884,
354,
51,
4454,
11,
9485,
15884,
354,
51,
4454,
21947,
198,
6738,
... | 2.860335 | 179 |
# @Time : 2020/7/7
# @Author : Yupeng Hou
# @Email : houyupeng@ruc.edu.cn
# UPDATE
# @Time : 2020/9/18, 2020/9/21, 2020/8/31
# @Author : Yupeng Hou, Yushuo Chen, Kaiyuan Li
# @email : houyupeng@ruc.edu.cn, chenyushuo@ruc.edu.cn, tsotfsk@outlook.com
"""
recbole.data.dataloader.knowledge_dataloader
##############... | [
2,
2488,
7575,
220,
220,
1058,
12131,
14,
22,
14,
22,
198,
2,
2488,
13838,
1058,
575,
929,
1516,
33790,
198,
2,
2488,
15333,
220,
1058,
289,
280,
88,
929,
1516,
31,
622,
66,
13,
15532,
13,
31522,
198,
198,
2,
35717,
198,
2,
2488... | 2.477681 | 1,949 |
import torch
from torch.utils import data
from transformers import AutoTokenizer
from .augment import Augmenter
# map lm name to huggingface's pre-trained model names
lm_mp = {'roberta': 'roberta-base',
'distilbert': 'distilbert-base-uncased'}
class DittoDataset(data.Dataset):
"""EM dataset"""
d... | [
11748,
28034,
198,
198,
6738,
28034,
13,
26791,
1330,
1366,
198,
6738,
6121,
364,
1330,
11160,
30642,
7509,
198,
198,
6738,
764,
559,
5154,
1330,
2447,
434,
263,
198,
198,
2,
3975,
300,
76,
1438,
284,
46292,
2550,
338,
662,
12,
35311,... | 1.880534 | 1,423 |
from micromlgen.utils import jinja, check_type
def is_pca(clf):
"""Test if classifier can be ported"""
return check_type(clf, 'PCA')
def port_pca(clf, **kwargs):
"""Port a PCA"""
return jinja('pca/pca.jinja', {
'arrays': {
'components': clf.components_,
'mean': clf.me... | [
6738,
12314,
398,
75,
5235,
13,
26791,
1330,
474,
259,
6592,
11,
2198,
62,
4906,
628,
198,
4299,
318,
62,
79,
6888,
7,
565,
69,
2599,
198,
220,
220,
220,
37227,
14402,
611,
1398,
7483,
460,
307,
49702,
37811,
198,
220,
220,
220,
1... | 1.984615 | 195 |
from floodsystem.stationdata import build_station_list
from Task2C import run | [
6738,
6947,
10057,
13,
17529,
7890,
1330,
1382,
62,
17529,
62,
4868,
198,
6738,
15941,
17,
34,
1330,
1057,
220
] | 3.9 | 20 |
"""
Profile the time needed for retrieval.
We consider retrieval in a corpus of 1M videos, 1K videos are added, 10K queries are retrieved.
Calculate the time needed for adding 1K videos, and performing retrieval for 10K queries.
1, Data Loading time is ignored, consider it is hidden by computation time.
2, Sort time i... | [
37811,
198,
37046,
262,
640,
2622,
329,
45069,
13,
198,
1135,
2074,
45069,
287,
257,
35789,
286,
352,
44,
5861,
11,
352,
42,
5861,
389,
2087,
11,
838,
42,
20743,
389,
29517,
13,
198,
9771,
3129,
378,
262,
640,
2622,
329,
4375,
352,
... | 2.449074 | 1,728 |
__author__ = 'Aaron Yang'
__email__ = 'byang971@usc.edu'
__date__ = '8/24/2020 11:04 PM' | [
834,
9800,
834,
796,
705,
34451,
10998,
6,
198,
834,
12888,
834,
796,
705,
1525,
648,
24,
4869,
31,
16241,
13,
15532,
6,
198,
834,
4475,
834,
796,
705,
23,
14,
1731,
14,
42334,
1367,
25,
3023,
3122,
6
] | 2.25641 | 39 |
#!/usr/bin/python3
"""
Główna funckja do szyfrowania danych
"""
if __name__ == "__main__":
import sys
print(decrypt(encrypt(sys.argv[1], sys.argv[2]), sys.argv[2]))
| [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
37811,
198,
38,
41615,
10205,
675,
64,
1257,
694,
6592,
466,
264,
7357,
69,
808,
5411,
288,
1092,
354,
198,
37811,
628,
628,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298... | 2.119048 | 84 |
"""
Given an array of non-negative integers nums, you are initially positioned at the first index of the array.
Each element in the array represents your maximum jump length at that position.
Your goal is to reach the last index in the minimum number of jumps.
You can assume that you can always reach the last index.... | [
37811,
198,
15056,
281,
7177,
286,
1729,
12,
31591,
37014,
997,
82,
11,
345,
389,
7317,
19378,
379,
262,
717,
6376,
286,
262,
7177,
13,
198,
198,
10871,
5002,
287,
262,
7177,
6870,
534,
5415,
4391,
4129,
379,
326,
2292,
13,
198,
198... | 3.262626 | 198 |
# -*- coding:utf8 -*-
from .snippets import * # pylint: disable=W0401,W0614
| [
2,
532,
9,
12,
19617,
25,
40477,
23,
532,
9,
12,
198,
6738,
764,
16184,
3974,
1039,
1330,
1635,
220,
1303,
279,
2645,
600,
25,
15560,
28,
54,
3023,
486,
11,
54,
3312,
1415,
628,
628,
628,
628,
628,
628,
628,
628
] | 2.190476 | 42 |
from __future__ import print_function
import matplotlib.pyplot as plt
import numpy as np
from sklearn.pipeline import Pipeline
import sys
from causeway.candidate_filter import get_weights_for_lr_classifier
from nlpypline.util import print_indented
| [
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
1341,
35720,
13,
79,
541,
4470,
1330,
37709,
198,
11748,
25064,
198,
198,
... | 3.346667 | 75 |
import keras
from keras.datasets import mnist
from keras.models import Sequential
from keras.layers import Dense, Dropout, Flatten
from keras.layers import Conv2D, MaxPooling2D
import numpy as np
batch_size = 128
num_classes = 10
epochs = 12
# input image dimensions
img_rows, img_cols = 28, 28
# the da... | [
11748,
41927,
292,
201,
198,
6738,
41927,
292,
13,
19608,
292,
1039,
1330,
285,
77,
396,
201,
198,
6738,
41927,
292,
13,
27530,
1330,
24604,
1843,
201,
198,
6738,
41927,
292,
13,
75,
6962,
1330,
360,
1072,
11,
14258,
448,
11,
1610,
... | 2.255018 | 847 |
from textToBraille import numOfChar
from textToBraille import specialChar
charsPerLine = 13 | [
6738,
2420,
2514,
42333,
8270,
1330,
997,
5189,
12441,
198,
6738,
2420,
2514,
42333,
8270,
1330,
2041,
12441,
198,
198,
354,
945,
5990,
13949,
796,
1511
] | 3.538462 | 26 |
import argparse
import torch
import os
import numpy as np
import json
from models.ddm import ddm
# from avgg import vgg16_bn
from datetime import datetime
from torch.utils.tensorboard import SummaryWriter
from tqdm import tqdm
if __name__ == '__main__':
args = parse_args()
os.environ['CUDA_VISIBLE_DEVICES'] ... | [
11748,
1822,
29572,
198,
11748,
28034,
198,
11748,
28686,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
33918,
198,
6738,
4981,
13,
1860,
76,
1330,
288,
36020,
198,
2,
422,
1196,
1130,
1330,
410,
1130,
1433,
62,
9374,
198,
6738,
4818,... | 2.219834 | 1,442 |
import numpy as np
import cv2
from pathlib import Path
import click
FLIP_FRAME = True
@click.command()
@click.option('--dir', default='imgs', help='Destination directory', required=True)
@click.option('--flip', default=True, help='Flip frames', required=True)
@click.option('--capl', default=3, help='Video capture ind... | [
11748,
299,
32152,
355,
45941,
198,
11748,
269,
85,
17,
198,
6738,
3108,
8019,
1330,
10644,
198,
11748,
3904,
198,
198,
3697,
4061,
62,
10913,
10067,
796,
6407,
198,
198,
31,
12976,
13,
21812,
3419,
198,
31,
12976,
13,
18076,
10786,
4... | 3.03871 | 155 |
import click
import os
from ..generators import *
from flask.cli import with_appcontext
from flask import current_app
from ..installers import FlaskSQLAlchemyInstaller
@click.group(help="Commands for generating files")
@click.command(help="Generate a new route")
@click.argument("name")
@click.argument("url_rules", ... | [
11748,
3904,
198,
11748,
28686,
198,
6738,
11485,
8612,
2024,
1330,
1635,
198,
6738,
42903,
13,
44506,
1330,
351,
62,
1324,
22866,
198,
6738,
42903,
1330,
1459,
62,
1324,
198,
6738,
11485,
17350,
364,
1330,
46947,
17861,
2348,
26599,
1579... | 3.243094 | 181 |
import unittest
import logging
from .common import UniqueResource, NormalTest, NormalTestTwo
log = logging.getLogger(__name__)
| [
11748,
555,
715,
395,
198,
11748,
18931,
198,
6738,
764,
11321,
1330,
30015,
26198,
11,
14435,
14402,
11,
14435,
14402,
7571,
198,
6404,
796,
18931,
13,
1136,
11187,
1362,
7,
834,
3672,
834,
8,
628,
628,
628,
198
] | 3.5 | 38 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2018-05-26 10:14
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,
1157,
319,
2864,
12,
2713,
12,
2075,
838,
25,
1415,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
6738,... | 2.791045 | 67 |
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
import os
from pathlib import Path
from typing import Any, Generator, Optional
import pytest
import torch
from _pytest.monkeypatch import MonkeyPatch
from torch.nn.modules import Module
import torchgeo.models.resnet
from to... | [
2,
15069,
357,
66,
8,
5413,
10501,
13,
1439,
2489,
10395,
13,
198,
2,
49962,
739,
262,
17168,
13789,
13,
198,
198,
11748,
28686,
198,
6738,
3108,
8019,
1330,
10644,
198,
6738,
19720,
1330,
4377,
11,
35986,
11,
32233,
198,
198,
11748,
... | 2.860759 | 316 |
import numpy as np
import gym
import matplotlib.pyplot as plt
import pylab as pl
from dm_control import suite
from code_slac.env.dm_control import DmControlEnvForPytorch
# render function does not work in the base class
# (AttributeError: 'Environment' object has no attribute 'render')
| [
11748,
299,
32152,
355,
45941,
198,
11748,
11550,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
279,
2645,
397,
355,
458,
198,
6738,
288,
76,
62,
13716,
1330,
18389,
198,
198,
6738,
2438,
62,
6649,
330,
13,... | 3.263736 | 91 |
import socket
from copy import deepcopy
from datetime import datetime
import sqlalchemy as s
from authlib.jose import jwt
from sqlalchemy.dialects import postgresql
from sqlalchemy.orm import backref, relationship
from buildkite.benchmark.run import MockRun, repos_with_benchmark_groups
from config import Config
from ... | [
11748,
17802,
198,
6738,
4866,
1330,
2769,
30073,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
198,
11748,
44161,
282,
26599,
355,
264,
198,
6738,
6284,
8019,
13,
73,
577,
1330,
474,
46569,
198,
6738,
44161,
282,
26599,
13,
38969,
478,... | 3.656 | 125 |
# Space: O(n)
# Time: O(n)
| [
198,
2,
4687,
25,
440,
7,
77,
8,
198,
2,
3862,
25,
440,
7,
77,
8,
628,
628,
628,
628
] | 1.75 | 20 |
"""Support for NuHeat thermostats."""
from datetime import timedelta
import logging
from nuheat.config import SCHEDULE_HOLD, SCHEDULE_RUN, SCHEDULE_TEMPORARY_HOLD
from homeassistant.components.climate import ClimateDevice
from homeassistant.components.climate.const import (
CURRENT_HVAC_HEAT,
CURRENT_HVAC_IDL... | [
37811,
15514,
329,
21733,
39596,
10811,
1712,
1381,
526,
15931,
198,
6738,
4818,
8079,
1330,
28805,
12514,
198,
11748,
18931,
198,
198,
6738,
14364,
25080,
13,
11250,
1330,
22374,
1961,
24212,
62,
39,
15173,
11,
22374,
1961,
24212,
62,
49... | 2.397971 | 2,661 |
#!/usr/bin/env python
from __future__ import print_function
import sys
import rospy
import gazebo_msgs
from gazebo_msgs.msg import LinkState
from gazebo_msgs.srv import SetLinkState
from gazebo_msgs.srv import GetLinkState
from motor_drive.msg import MotorPair_Float
from tf import transformations as tf_transform
fro... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
198,
11748,
25064,
198,
11748,
686,
2777,
88,
198,
11748,
308,
1031,
1765,
78,
62,
907,
14542,
198,
6738,
308,
1031,
1765,
78,
... | 2.480682 | 880 |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import os
import unittest
from pytext.common.constants import DatasetFieldName, VocabMeta
from pytext.config.field_config import EmbedInitStrategy
from pytext.fields import TextFeatureField
from pytext.utils import embedding... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
15069,
357,
66,
8,
3203,
11,
3457,
13,
290,
663,
29116,
13,
1439,
6923,
33876,
198,
198,
11748,
28686,
198,
11748,
555,
715,
395,
198,
198,
6738,
12972,
5239,
13,
11321,
13,
... | 3.029412 | 170 |
"""
SCHEMAS: The schemas are important in order to serialize and deserialize the data.
"""
from .user import User as UserSchema
from .sensor import Sensor as SensorSchema
from .seism import Seism as SeismSchema
| [
37811,
198,
50,
3398,
3620,
1921,
25,
383,
3897,
5356,
389,
1593,
287,
1502,
284,
11389,
1096,
290,
748,
48499,
1096,
262,
1366,
13,
198,
37811,
198,
198,
6738,
764,
7220,
1330,
11787,
355,
11787,
27054,
2611,
198,
6738,
764,
82,
2285... | 3.419355 | 62 |