content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
#--------------------------------------------------------------------------------------------------------------------------
import os, sys, pandas, shlex, ntpath, pickle
from git import Repo
from collections import defaultdict
from pprint import pprint
#-----------------------------------------------------------------... | [
2,
10097,
43801,
438,
198,
11748,
28686,
11,
25064,
11,
19798,
292,
11,
427,
2588,
11,
299,
83,
6978,
11,
2298,
293,
198,
6738,
17606,
1330,
1432,
78,
198,
6738,
17268,
1330,
4277,
11600,
198,
6738,
279,
4798,
1330,
279,
4798,
198,
... | 2.335648 | 3,024 |
import pandas as pd
import numpy as np
import scipy as sp
import scipy.cluster
from .. import utils
from ..utils import safe_isinstance, MaskedModel
from ._masker import Masker
from numba import jit
import logging
log = logging.getLogger('shap')
class Tabular(Masker):
""" A common base class for TabularIndepende... | [
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
629,
541,
88,
355,
599,
198,
11748,
629,
541,
88,
13,
565,
5819,
198,
6738,
11485,
1330,
3384,
4487,
198,
6738,
11485,
26791,
1330,
3338,
62,
271,
39098,... | 2.345647 | 5,468 |
"""Autogenerated 2021-11-16T11:37:36.467856 by redcap_classfiles.py
"""
from ....pgrest import *
from ...constants import Constants
from ..rcconstants import REDCapConstants
from ..rcaptable import RcapTable
__all__ = ["RcapFearavoidanceBeliefsQuestionnaireV03Fabq"]
class RcapFearavoidanceBeliefsQuestionnaireV03Fa... | [
37811,
16541,
519,
877,
515,
33448,
12,
1157,
12,
1433,
51,
1157,
25,
2718,
25,
2623,
13,
24669,
23,
3980,
416,
2266,
11128,
62,
4871,
16624,
13,
9078,
198,
37811,
198,
198,
6738,
19424,
6024,
2118,
1330,
1635,
198,
6738,
2644,
9979,
... | 2.705344 | 655 |
from sqlalchemy.exc import IntegrityError
from . connect2db import session
from . models import User, Tag, Todo
| [
6738,
44161,
282,
26599,
13,
41194,
1330,
39348,
12331,
198,
198,
6738,
764,
2018,
17,
9945,
1330,
6246,
198,
6738,
764,
4981,
1330,
11787,
11,
17467,
11,
309,
24313,
628,
198,
220,
220,
220,
220,
628,
628,
628
] | 3.289474 | 38 |
# Copyright 2021 Hewlett Packard Enterprise Development LP
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modif... | [
2,
15069,
33448,
30446,
15503,
6400,
446,
14973,
7712,
18470,
198,
2,
198,
2,
2448,
3411,
318,
29376,
7520,
11,
1479,
286,
3877,
11,
284,
597,
1048,
16727,
257,
198,
2,
4866,
286,
428,
3788,
290,
3917,
10314,
3696,
357,
1169,
366,
2... | 3.078534 | 764 |
"""https://open.kattis.com/problems/pizza2"""
R, C = map(int, input().split())
print(100 * pow(1 - C/R, 2)) | [
37811,
5450,
1378,
9654,
13,
74,
1078,
271,
13,
785,
14,
1676,
22143,
14,
79,
9990,
17,
37811,
198,
198,
49,
11,
327,
796,
3975,
7,
600,
11,
5128,
22446,
35312,
28955,
198,
4798,
7,
3064,
1635,
7182,
7,
16,
532,
327,
14,
49,
11,... | 2.297872 | 47 |
from __future__ import absolute_import, unicode_literals
from django.core.management.base import BaseCommand
from django_comments.models import Comment
class Command(BaseCommand):
"Remove the given string from the comments"
| [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
11,
28000,
1098,
62,
17201,
874,
198,
198,
6738,
42625,
14208,
13,
7295,
13,
27604,
13,
8692,
1330,
7308,
21575,
198,
6738,
42625,
14208,
62,
15944,
13,
27530,
1330,
18957,
628,
198,
4871,... | 3.85 | 60 |
from contextlib import contextmanager
from testflows.core import *
import rbac.helper.errors as errors
from rbac.requirements import *
@TestFeature
@Name("show create role")
def feature(self, node="clickhouse1"):
"""Check show create role query syntax.
```sql
SHOW CREATE ROLE name
```
"""
no... | [
6738,
4732,
8019,
1330,
4732,
37153,
198,
198,
6738,
1332,
44041,
13,
7295,
1330,
1635,
198,
198,
11748,
374,
65,
330,
13,
2978,
525,
13,
48277,
355,
8563,
198,
6738,
374,
65,
330,
13,
8897,
18883,
1330,
1635,
198,
198,
31,
14402,
3... | 2.544757 | 391 |
##
#
from io import BytesIO
from aiohttp import ClientSession
from pyrogram import filters
from pyrogram.types import Message
from megumin import megux
aiohttpsession = ClientSession()
@megux.on_message(filters.command("carbon", prefixes=["/", "!"]))
| [
2235,
198,
2,
198,
198,
6738,
33245,
1330,
2750,
4879,
9399,
198,
198,
6738,
257,
952,
4023,
1330,
20985,
36044,
198,
6738,
12972,
39529,
1330,
16628,
198,
6738,
12972,
39529,
13,
19199,
1330,
16000,
198,
198,
6738,
17243,
7230,
1330,
1... | 3.225 | 80 |
import time
def get_lemma_id(your_fn,
lemma,
pos):
"""
FrameNet stores an identifier for each lemma.pos combination.
In this function, we retrieve it or generate a new one.
"""
chosen_lemma_id = None
target = f'{lemma}.{pos.lower()}'
for lu_id, lemma_pos ... | [
11748,
640,
628,
198,
198,
4299,
651,
62,
10671,
2611,
62,
312,
7,
14108,
62,
22184,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
443,
21672,
11,
198,
220,
220,
220,
220,
220,
220,
220... | 2.032666 | 949 |
import re
from appyter.fields import Field
from appyter.ext.re import re_full
class TextField(Field):
''' Representing a field that accepts a multi-line string
Be careful with this field, consider defining a constraint regex.
:param name: (str) A name that will be used to refer to the object as a variable and ... | [
11748,
302,
198,
6738,
598,
88,
353,
13,
25747,
1330,
7663,
198,
6738,
598,
88,
353,
13,
2302,
13,
260,
1330,
302,
62,
12853,
198,
198,
4871,
8255,
15878,
7,
15878,
2599,
198,
220,
705,
7061,
10858,
278,
257,
2214,
326,
18178,
257,
... | 3.709596 | 396 |
import shutil
from .Preset import Preset
from ..utils import root_path, stubs_path
| [
11748,
4423,
346,
198,
198,
6738,
764,
25460,
316,
1330,
1763,
316,
198,
6738,
11485,
26791,
1330,
6808,
62,
6978,
11,
17071,
82,
62,
6978,
628
] | 3.269231 | 26 |
from starlette.exceptions import HTTPException as StarletteHTTPException
| [
6738,
3491,
21348,
13,
1069,
11755,
1330,
14626,
16922,
355,
2907,
21348,
40717,
16922,
628
] | 4.933333 | 15 |
from .go_goiania import GoGoiania
from .rs_porto_alegre import RsPortoAlegre
| [
6738,
764,
2188,
62,
2188,
666,
544,
1330,
1514,
5247,
666,
544,
198,
6738,
764,
3808,
62,
634,
78,
62,
1000,
16694,
1330,
12820,
13924,
78,
32,
1455,
260,
198
] | 2.566667 | 30 |
from flask.helpers import url_for
from scripts import app
from flask import render_template, request, redirect
from scripts.tweepy_api import get_user_tweets
from scripts.preprocess import models_script
@app.route("/", methods=["POST", "GET"])
@app.route("/home", methods=["POST", "GET"])
tweets = []
@app.route("/home... | [
6738,
42903,
13,
16794,
364,
1330,
19016,
62,
1640,
198,
6738,
14750,
1330,
598,
198,
6738,
42903,
1330,
8543,
62,
28243,
11,
2581,
11,
18941,
198,
6738,
14750,
13,
83,
732,
538,
88,
62,
15042,
1330,
651,
62,
7220,
62,
83,
732,
1039... | 2.976 | 125 |
#!/usr/bin/env python3
# © 2015-16 James R. Barlow: github.com/jbarlow83
# This file is now an alias for __main__
# Consider removing in future releases
from ocrmypdf.__main__ import *
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
10673,
1853,
12,
1433,
3700,
371,
13,
2409,
9319,
25,
33084,
13,
785,
14,
73,
5657,
9319,
5999,
198,
198,
2,
770,
2393,
318,
783,
281,
16144,
329,
11593,
12417,
834,
198,
2,... | 2.968254 | 63 |
from typing import Dict, Tuple
SSL_TEST_PRIVATE_CA_CRT = b"""-----BEGIN CERTIFICATE-----
MIIDKTCCAhGgAwIBAgIUHoeobLQu3yMmraIDXDF+F6M4j9IwDQYJKoZIhvcNAQEL
BQAwRDENMAsGA1UECgwEQ2hpYTEQMA4GA1UEAwwHQ2hpYSBDQTEhMB8GA1UECwwY
T3JnYW5pYyBGYXJtaW5nIERpdmlzaW9uMB4XDTIyMDMyMzE3MjkyOVoXDTMyMDMy
MDE3MjkyOVowRDENMAsGA1UECgwEQ2hpYTE... | [
6738,
19720,
1330,
360,
713,
11,
309,
29291,
198,
198,
31127,
62,
51,
6465,
62,
4805,
3824,
6158,
62,
8141,
62,
9419,
51,
796,
275,
37811,
30934,
33,
43312,
327,
17395,
30643,
6158,
30934,
198,
8895,
2389,
42176,
4093,
10910,
38,
70,
... | 1.364904 | 28,898 |
import pygame, assets
from screen.title import TitleScreen
from screen.exit import WussScreen
pygame.font.init()
size = width, height = 640, 480
screen = pygame.display.set_mode(size)
pygame.display.set_caption("Super Extreme Tic-Tac-Toe")
assets.init(screen)
font = pygame.font.SysFont(assets.font, 16)
white = pygam... | [
11748,
12972,
6057,
11,
6798,
198,
6738,
3159,
13,
7839,
1330,
11851,
23901,
198,
6738,
3159,
13,
37023,
1330,
370,
1046,
23901,
198,
198,
9078,
6057,
13,
10331,
13,
15003,
3419,
198,
198,
7857,
796,
9647,
11,
6001,
796,
33759,
11,
23... | 2.743976 | 332 |
from __future__ import print_function
import json
import random
if __name__ == '__main__':
model_list = [
'random_forest_classification',
'xgboost_classification',
'xgboost_regression',
'single_deep_classification',
'single_deep_regression'
]
index = 0
model... | [
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
198,
11748,
33918,
198,
11748,
4738,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
2746,
62,
4868,
796,
685,
198,
220,
220,
220,
220,
... | 2.444444 | 819 |
# This file is a demo for the 'Isothermal_Monolith_Simulator' object
import sys
sys.path.append('../..')
from catalyst.isothermal_monolith_catalysis import *
# Read in data
exp_name = "CO2_H2O_CO_H2"
run = "08"
oldrun="07"
readfile = 'output/'+exp_name+'_model'+oldrun+'.json'
writefile = exp_name+"_model"+run+".json... | [
2,
770,
2393,
318,
257,
13605,
329,
262,
705,
3792,
49723,
62,
9069,
21446,
62,
8890,
8927,
6,
2134,
198,
11748,
25064,
198,
17597,
13,
6978,
13,
33295,
10786,
40720,
492,
11537,
198,
6738,
31357,
13,
271,
49723,
62,
2144,
21446,
62,
... | 2.219219 | 999 |
# Copyright 2018 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import contextlib
import logging
from core import perf_benchmark
from core import platforms
from telemetry.core import android_platform
from telemetry.core... | [
2,
15069,
2864,
383,
18255,
1505,
46665,
13,
1439,
2489,
10395,
13,
198,
2,
5765,
286,
428,
2723,
2438,
318,
21825,
416,
257,
347,
10305,
12,
7635,
5964,
326,
460,
307,
198,
2,
1043,
287,
262,
38559,
24290,
2393,
13,
198,
198,
11748... | 2.964573 | 1,242 |
import gdal, os
## List input raster files
os.chdir("YOUR_TARGET_DIRECTORY_THAT_HAS_THE_HDF5")
rasterFiles = os.listdir(os.getcwd())
print(rasterFiles)
fileExtension = ".tif"
## Open HDF file
#Ignores first file cause zero-based index so range 0
for i in range(0,len(rasterFiles)) :
#Get File Name Prefix
rast... | [
11748,
308,
31748,
11,
28686,
198,
198,
2235,
7343,
5128,
374,
1603,
3696,
198,
418,
13,
354,
15908,
7203,
56,
11698,
62,
51,
46095,
62,
17931,
23988,
15513,
62,
4221,
1404,
62,
39,
1921,
62,
10970,
62,
39,
8068,
20,
4943,
198,
81,
... | 2.782116 | 794 |
# -*- coding: utf-8 -*-
import pytest
from pytest import raises
import cottonformation as ctf
from cottonformation.res import s3
from pprint import pprint
from collections import OrderedDict
if __name__ == "__main__":
import os
basename = os.path.basename(__file__)
pytest.main([basename, "-s", "--tb=... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
12972,
9288,
198,
6738,
12972,
9288,
1330,
12073,
198,
11748,
15985,
1161,
355,
269,
27110,
198,
6738,
15985,
1161,
13,
411,
1330,
264,
18,
198,
6738,
279,
4... | 2.820513 | 117 |
"""
Manipulación de datos, trabajando con PANDAS
Script creado para la asignatura de Programación Avanzada en Python de la Escuela Internacional de Postgrados
Uso:
- Windows: python "08.manipulacion_de_datos/02.manipulacion_de_datos_pandas.py"
- Linux: python3 "08.manipulacion_de_datos/02.manipulacion_de_datos_panda... | [
37811,
198,
5124,
541,
377,
32009,
18840,
390,
4818,
418,
11,
491,
397,
1228,
25440,
369,
350,
6981,
1921,
198,
198,
7391,
269,
961,
78,
31215,
8591,
355,
570,
2541,
64,
390,
6118,
32009,
18840,
5184,
35410,
4763,
551,
11361,
390,
859... | 2.549425 | 870 |
# -*- coding: utf-8 -*-
import crowd4py
class BibAPI():
"""Wrapper of Crowd4py API
Specific wrapper of detection bibliographic task
"""
def __init__(self, api_info, project_info):
"""Initialize Crowd4py API object with api and project infomartion
Parameters
----------
... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
4315,
19,
9078,
198,
198,
4871,
43278,
17614,
33529,
198,
220,
220,
220,
37227,
36918,
2848,
286,
29452,
19,
9078,
7824,
198,
220,
220,
220,
17377,
29908,
286,
13... | 2.243243 | 1,887 |
import shutil
import tempfile
import time
import os
import random
import subprocess
import unittest
from basefs.keys import Key
from basefs.logs import Log
from . import utils
| [
11748,
4423,
346,
198,
11748,
20218,
7753,
198,
11748,
640,
198,
11748,
28686,
198,
11748,
4738,
198,
11748,
850,
14681,
198,
11748,
555,
715,
395,
198,
198,
6738,
2779,
9501,
13,
13083,
1330,
7383,
198,
6738,
2779,
9501,
13,
6404,
82,
... | 3.509804 | 51 |
# (c) 2020 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is dis... | [
2,
357,
66,
8,
12131,
2297,
10983,
3457,
13,
198,
2,
198,
2,
770,
2393,
318,
636,
286,
28038,
856,
198,
2,
198,
2,
28038,
856,
318,
1479,
3788,
25,
345,
460,
17678,
4163,
340,
290,
14,
273,
13096,
198,
2,
340,
739,
262,
2846,
... | 3.306818 | 352 |
#! /usr/bin/python
from math import *
d = 2
dmax = 20
largestx = 1
while d <= dmax :
if int(sqrt(d)) == sqrt(float(d)) :
d += 1
continue
sqrtd = sqrt(float(d))
num = int(sqrtd)
den = 1
found = False
while not found :
res = num**2 + - d*(den**2)
# pr... | [
2,
0,
1220,
14629,
14,
8800,
14,
29412,
198,
198,
6738,
10688,
1330,
1635,
198,
198,
67,
796,
362,
198,
67,
9806,
796,
1160,
198,
28209,
87,
796,
352,
198,
198,
4514,
288,
19841,
288,
9806,
1058,
628,
220,
220,
220,
611,
493,
7,
... | 1.742459 | 431 |
# Harmonic Oscillations
The harmonic oscillator is omnipresent in physics. Although you may think
of this as being related to springs, it, or an equivalent
mathematical representation, appears in just about any problem where a
mode is sitting near its potential energy minimum. At that point,
$\partial_x V(x)=0$, and ... | [
2,
17925,
9229,
440,
22360,
602,
198,
198,
464,
49239,
24969,
1352,
318,
40046,
2028,
287,
11887,
13,
4900,
345,
743,
892,
220,
198,
1659,
428,
355,
852,
3519,
284,
24747,
11,
340,
11,
393,
281,
7548,
198,
6759,
10024,
605,
10552,
1... | 2.445768 | 23,750 |
from .version import __version__
from .dataset_gen import *
from .models import * | [
6738,
764,
9641,
1330,
11593,
9641,
834,
220,
220,
198,
6738,
764,
19608,
292,
316,
62,
5235,
1330,
1635,
198,
6738,
764,
27530,
1330,
1635
] | 3.32 | 25 |
# Sahaana Iyer 8609 Batch B TE Computers
import random
import math
n = int(input("Enter number of points : "))
points = npoints(n)
print("The points are ", points)
k = int(input("Enter number of clusters : "))
kpoints = kpoints(k)
print("The cluster centers are ", kpoints)
point_cluster_cen... | [
2,
311,
12236,
2271,
314,
9860,
220,
220,
220,
220,
220,
220,
220,
220,
807,
31751,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
347,
963,
347,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13368,
22476,
364,
198,
11748,
... | 2.843407 | 364 |
import random
import timeit
import numpy as np
import torch
M = 8000000
#x = torch.randint(0, 100, (M, 3), dtype=torch.int16)
x = np.random.randint(0, 100, (M, 3), dtype=np.int16)
size = 20
print(timeit.timeit(sample1, number=10)) # fast
print(timeit.timeit(sample2, number=10)) # never finish
| [
11748,
4738,
198,
11748,
640,
270,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28034,
198,
198,
44,
796,
807,
10535,
198,
2,
87,
796,
28034,
13,
25192,
600,
7,
15,
11,
1802,
11,
357,
44,
11,
513,
828,
288,
4906,
28,
13165,
354... | 2.504202 | 119 |
#!/usr/bin/env python
# This python script checks the output file for an example to
# see if the results are close to expected values. This script may be
# run directly, and it is also called when "make test" is run from the
# main REGCOIL directory.
execfile('../testsCommon.py')
absoluteTolerance=0
numFailures = ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
2,
770,
21015,
4226,
8794,
262,
5072,
2393,
329,
281,
1672,
284,
220,
198,
2,
766,
611,
262,
2482,
389,
1969,
284,
2938,
3815,
13,
220,
770,
4226,
743,
307,
198,
2,
1057,
3264... | 2.515187 | 856 |
#!/usr/local/bin/python3
from faker import Faker
import pandas as pd
import datetime
import numpy as np
| [
2,
48443,
14629,
14,
12001,
14,
8800,
14,
29412,
18,
198,
198,
6738,
277,
3110,
1330,
376,
3110,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
4818,
8079,
198,
11748,
299,
32152,
355,
45941,
198
] | 2.916667 | 36 |
import json
data = """{
"name" : "Kunal",
"phone": "8888877777",
"email": {
"hide": "yes"
}
}"""
#Returns a python dictionary
info = json.loads(data)
print()
print(info)
print()
print("Name:" , info["name"])
#info is a dictionary object and email inside it is also a python dictionary, ... | [
11748,
33918,
198,
7890,
796,
37227,
90,
198,
220,
220,
220,
366,
3672,
1,
1058,
366,
42,
18835,
1600,
198,
220,
220,
220,
366,
4862,
1298,
366,
3459,
28011,
3324,
29331,
1600,
198,
220,
220,
220,
366,
12888,
1298,
1391,
198,
220,
2... | 2.802691 | 223 |
import argparse
import requests
if __name__ == '__main__':
args = _parse_args()
print_jokes(args.jokes_amount)
| [
11748,
1822,
29572,
198,
11748,
7007,
628,
628,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
26498,
796,
4808,
29572,
62,
22046,
3419,
198,
220,
220,
220,
3601,
62,
73,
3369,
7,
22046,
13,
... | 2.604167 | 48 |
import numpy as np, scipy.stats as st | [
11748,
299,
32152,
355,
45941,
11,
629,
541,
88,
13,
34242,
355,
336
] | 2.846154 | 13 |
# -*- coding: utf-8 -*-
import requests
#执行API调用存储响应
url='https://api.github.com/search/repositories?q=language:python&sort=stars'
r=requests.get(url)
print("Status code :",r.status_code)
#存储API响应
response_dict=r.json()
print("Total repositories: ",response_dict['total_count'] )
#和仓库有关的信息
repo_dicts=response_dict['... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
7007,
198,
198,
2,
33699,
100,
26193,
234,
17614,
164,
108,
225,
18796,
101,
27764,
246,
43636,
101,
161,
241,
235,
41753,
242,
198,
6371,
11639,
5450,
1378,... | 2.054726 | 201 |
# Searches for days in which Nairn's heatwave definition matches for each day
# Nairn et al. (2009). Definning and predicting Excessive Heat events, a National System
import numpy as np
# Loads text files with Excess Heat Factor (EHF) Values
TxtFileMel = np.loadtxt('melbourne.heatwaves.nairn.1960-2011.txt')
TxtFileM... | [
2,
42016,
2052,
329,
1528,
287,
543,
399,
958,
77,
338,
4894,
19204,
6770,
7466,
329,
1123,
1110,
198,
2,
399,
958,
77,
2123,
435,
13,
357,
10531,
737,
2896,
23062,
290,
25539,
1475,
45428,
12308,
2995,
11,
257,
2351,
4482,
198,
198... | 1.905847 | 2,634 |
# -*- coding: utf-8 -*-
import json
import os
import logging
from django.core.management import call_command
from django.test.client import Client
from networkapi.rack.models import Datacenter
from networkapi.test.test_case import NetworkApiTestCase
log = logging.getLogger(__name__)
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
33918,
198,
11748,
28686,
198,
11748,
18931,
198,
198,
6738,
42625,
14208,
13,
7295,
13,
27604,
1330,
869,
62,
21812,
198,
6738,
42625,
14208,
13,
9288,
13,
16366,
... | 3.222222 | 90 |
import numpy as np
import cv2
import torch
from PIL import Image
| [
11748,
299,
32152,
355,
45941,
198,
11748,
269,
85,
17,
198,
11748,
28034,
198,
6738,
350,
4146,
1330,
7412,
628,
628,
628,
198
] | 3.086957 | 23 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import torch
import torch.nn.functional as F
import torchvision.transforms.functional as tvF
from torch.utils.data import Dataset, DataLoader
from utils import load_hdr_as_tensor
import os
from sys import platform
import numpy as np
import random
from string import asci... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
28034,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
198,
11748,
28034,
10178,
13,
7645,
23914,
13... | 2.21449 | 4,541 |
"""Module containing class `ClipHdf5FileExporter`."""
import logging
import os
import h5py
from vesper.command.clip_exporter import ClipExporter
from vesper.command.command import CommandExecutionError
from vesper.singleton.archive import archive
from vesper.singleton.clip_manager import clip_manager
from vesper.si... | [
37811,
26796,
7268,
1398,
4600,
2601,
541,
39,
7568,
20,
8979,
3109,
26634,
63,
526,
15931,
628,
198,
11748,
18931,
198,
11748,
28686,
198,
198,
11748,
289,
20,
9078,
198,
198,
6738,
410,
274,
525,
13,
21812,
13,
15036,
62,
1069,
2663... | 2.318959 | 1,345 |
import sys
from aws_cli_utils.ec2.EC2CLI import EC2CLI
if __name__ == '__main__':
sys.exit(main())
| [
11748,
25064,
198,
198,
6738,
3253,
82,
62,
44506,
62,
26791,
13,
721,
17,
13,
2943,
17,
5097,
40,
1330,
13182,
17,
5097,
40,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
25064,
13,
... | 2.229167 | 48 |
from utils import *
import itertools
row_units = [cross(r, cols) for r in rows]
column_units = [cross(rows, c) for c in cols]
square_units = [cross(rs, cs) for rs in ('ABC','DEF','GHI') for cs in ('123','456','789')]
diagonal_units = [['A1', 'B2', 'C3', 'D4', 'E5', 'F6', 'G7', 'H8', 'I9'],
['I1', 'H... | [
198,
6738,
3384,
4487,
1330,
1635,
198,
11748,
340,
861,
10141,
198,
198,
808,
62,
41667,
796,
685,
19692,
7,
81,
11,
951,
82,
8,
329,
374,
287,
15274,
60,
198,
28665,
62,
41667,
796,
685,
19692,
7,
8516,
11,
269,
8,
329,
269,
2... | 2.719709 | 1,923 |
import factory
import factory.fuzzy
from factory.django import DjangoModelFactory
from pytest_factoryboy import register
from conferences.tests.factories import ConferenceFactory
from hotels.models import HotelRoom, HotelRoomReservation
from i18n.tests.factories import LanguageFactory
@register
@register
| [
11748,
8860,
198,
11748,
8860,
13,
69,
4715,
88,
198,
6738,
8860,
13,
28241,
14208,
1330,
37770,
17633,
22810,
198,
6738,
12972,
9288,
62,
69,
9548,
7081,
1330,
7881,
198,
198,
6738,
19993,
13,
41989,
13,
22584,
1749,
1330,
8785,
22810,... | 4.092105 | 76 |
from __future__ import absolute_import
from .api_constants import apilevel, threadsafety, paramstyle
from .connect import connect
from .constructors import Date, Time, Timestamp
from .exceptions import Error, InterfaceError, DatabaseError, ParameterError
from .data_types import STRING, BINARY, NUMBER, DATETIME, ROWID
... | [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
198,
6738,
764,
15042,
62,
9979,
1187,
1330,
2471,
576,
626,
11,
14390,
27925,
11,
5772,
7635,
198,
6738,
764,
8443,
1330,
2018,
198,
6738,
764,
41571,
669,
1330,
7536,
11,
3862,
11... | 3.391026 | 156 |
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import Point, Vector, Rectangle
from math import sqrt
from operator import itemgetter
_pts, elev = IN
# http://eprints.cs.vt.edu/archive/00000869/01/CS81017-R.pdf
pts = hull(_pts)
OUT = []
highPts, closePts, areas, dists = [], [], [], ... | [
11748,
537,
81,
198,
565,
81,
13,
4550,
26687,
10786,
2964,
1462,
10082,
15748,
11537,
198,
6738,
5231,
4147,
74,
13,
23067,
7391,
13,
10082,
15748,
1330,
6252,
11,
20650,
11,
48599,
9248,
198,
6738,
10688,
1330,
19862,
17034,
198,
6738... | 2.022355 | 671 |
import os
import sys
import logging
from avalon import io
from avalon import api as avalon
from avalon.vendor import Qt
from openpype import lib
from pyblish import api as pyblish
import openpype.hosts.photoshop
log = logging.getLogger("openpype.hosts.photoshop")
HOST_DIR = os.path.dirname(os.path.abspath(openpype.h... | [
11748,
28686,
198,
11748,
25064,
198,
11748,
18931,
198,
198,
6738,
37441,
261,
1330,
33245,
198,
6738,
37441,
261,
1330,
40391,
355,
37441,
261,
198,
6738,
37441,
261,
13,
85,
18738,
1330,
33734,
198,
6738,
1280,
79,
2981,
1330,
9195,
... | 2.684397 | 282 |
import csv, re
from flask import Blueprint, request
from . import *
from .utility import *
from .db_func import *
bp = Blueprint('member', __name__)
EMAIL_REGEX = re.compile(r"([A-Z0-9_.+-]+@[A-Z0-9-]+\.[A-Z0-9-.]+)", re.IGNORECASE)
@bp.route('/', methods=["POST"])
| [
11748,
269,
21370,
11,
302,
198,
6738,
42903,
1330,
39932,
11,
2581,
198,
198,
6738,
764,
1330,
1635,
198,
6738,
764,
315,
879,
1330,
1635,
198,
6738,
764,
9945,
62,
20786,
1330,
1635,
198,
198,
46583,
796,
39932,
10786,
19522,
3256,
... | 2.336207 | 116 |
'''
Problem Statement
Given an array of sorted numbers and a target sum, find a pair in the array whose sum is equal to the given target.
Write a function to return the indices of the two numbers (i.e. the pair) such that they add up to the given target.
Example 1:
Input: [1, 2, 3, 4, 6], target=6
Output: [1, 3]
Expla... | [
7061,
6,
198,
40781,
21983,
198,
15056,
281,
7177,
286,
23243,
3146,
290,
257,
2496,
2160,
11,
1064,
257,
5166,
287,
262,
7177,
3025,
2160,
318,
4961,
284,
262,
1813,
2496,
13,
198,
16594,
257,
2163,
284,
1441,
262,
36525,
286,
262,
... | 3.360179 | 447 |
# testscenarios: extensions to python unittest to allow declarative
# dependency injection ('scenarios') by tests.
#
# Copyright (c) 2009, Robert Collins <robertc@robertcollins.net>
# Copyright (c) 2010, 2011 Martin Pool <mbp@sourcefrog.net>
#
# Licensed under either the Apache License, Version 2.0 or the BSD 3-clau... | [
2,
220,
1332,
1416,
268,
13010,
25,
18366,
284,
21015,
555,
715,
395,
284,
1249,
2377,
283,
876,
198,
2,
220,
20203,
16954,
19203,
1416,
268,
13010,
11537,
416,
5254,
13,
198,
2,
198,
2,
15069,
357,
66,
8,
3717,
11,
5199,
14006,
1... | 3.460177 | 339 |
from collections import defaultdict
from scipy.signal import find_peaks_cwt
import numpy as np
from .utils import fill_tril_inplace
def consensus_domains(domains, weights):
"""
Returns consensus list of nonoverlapping segments.
Segments are 2-tuples given as half-open intervals [a,b).
"""
occ =... | [
6738,
17268,
1330,
4277,
11600,
198,
6738,
629,
541,
88,
13,
12683,
282,
1330,
1064,
62,
431,
4730,
62,
66,
46569,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
764,
26791,
1330,
6070,
62,
2213,
346,
62,
259,
5372,
628,
628,
198,
4... | 2.102293 | 567 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""Get artwork for media from fanart.tv"""
from utils import get_json, KODI_LANGUAGE, process_method_on_list, try_parse_int, ADDON_ID
from operator import itemgetter
import xbmcaddon
import datetime
class FanartTv(object):
"""get artwork from fanart.tv"""
... | [
2,
48443,
14629,
14,
8800,
14,
29412,
201,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
201,
198,
201,
198,
37811,
3855,
16257,
329,
2056,
422,
4336,
433,
13,
14981,
37811,
201,
198,
201,
198,
6738,
3384,
4487,
1... | 2.105148 | 3,186 |
"""
Scipy sparse linear solver with SuperLU backend.
"""
import numpy as np
from scipy.sparse import csc_matrix
from scipy.sparse.linalg import spsolve
class SciPySolver:
"""
Base class for scipy family solvers.
"""
def to_csc(self, A):
"""
Convert A to scipy.sparse.csc_matrix.
... | [
37811,
198,
3351,
541,
88,
29877,
14174,
1540,
332,
351,
3115,
41596,
30203,
13,
198,
37811,
198,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
629,
541,
88,
13,
82,
29572,
1330,
269,
1416,
62,
6759,
8609,
198,
6738,
629,
541,
... | 1.973799 | 687 |
cont = 0
for n in range(6):
v = float(input())
if v > 0:
cont += 1
print(f'{cont} valores positivos')
| [
3642,
796,
657,
198,
1640,
299,
287,
2837,
7,
21,
2599,
198,
220,
220,
220,
410,
796,
12178,
7,
15414,
28955,
198,
220,
220,
220,
611,
410,
1875,
657,
25,
198,
220,
220,
220,
220,
220,
220,
220,
542,
15853,
352,
198,
4798,
7,
69... | 2.107143 | 56 |
import numpy
def grid3D_to_zindex(x):
"""return the corresponding Morton z-indices for an array of 3D indices
:param x: input indices
:type x: numpy array of integers, of shape (3, whatever),
where n is the number of points
:returns: z, array of integers, of shape (whatever)
"""
... | [
11748,
299,
32152,
198,
198,
4299,
10706,
18,
35,
62,
1462,
62,
89,
9630,
7,
87,
2599,
198,
220,
220,
220,
37227,
7783,
262,
11188,
35766,
1976,
12,
521,
1063,
329,
281,
7177,
286,
513,
35,
36525,
198,
220,
220,
220,
220,
220,
220... | 2.273224 | 366 |
import sys
import os
__last_perc = -1
| [
11748,
25064,
201,
198,
11748,
28686,
201,
198,
201,
198,
834,
12957,
62,
525,
66,
796,
532,
16,
201
] | 2.210526 | 19 |
# Try to figure out what our allies will do on their next turn
| [
198,
220,
220,
220,
1303,
9993,
284,
3785,
503,
644,
674,
7681,
481,
466,
319,
511,
1306,
1210,
198
] | 3.578947 | 19 |
#Decrypt and annotate strings of Avaddon ransomware (05af0cf40590aef24b28fa04c6b4998b7ab3b7f26e60c507adb84f3d837778f2)
#
# Last tested on Binary Ninja version 2.1.2454-dev
import base64
import string
if 'Constructor' not in current_view.tag_types.keys():
bv.create_tag_type("Constructor", "🔨")
if 'Destructo... | [
2,
10707,
6012,
290,
24708,
378,
13042,
286,
5184,
48078,
49134,
357,
2713,
1878,
15,
12993,
1821,
36993,
64,
891,
1731,
65,
2078,
13331,
3023,
66,
21,
65,
28324,
23,
65,
22,
397,
18,
65,
22,
69,
2075,
68,
1899,
66,
35378,
324,
65... | 2.657944 | 535 |
# Copyright 2014 Rackspace
#
# 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 t... | [
2,
15069,
1946,
37927,
13200,
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,
428,
2393,
2845,
287,
11846,
351,
262,
13... | 2.165421 | 9,364 |
__all__ = ['matrix', 'bmat', 'mat', 'asmatrix']
import sys
import numeric as N
from numeric import concatenate, isscalar, binary_repr, identity
from numpy.lib.utils import issubdtype
# make translation table
_table = [None]*256
for k in range(256):
_table[k] = chr(k)
_table = ''.join(_table)
_numchars = '0123456... | [
834,
439,
834,
796,
37250,
6759,
8609,
3256,
705,
65,
6759,
3256,
705,
6759,
3256,
705,
292,
6759,
8609,
20520,
198,
198,
11748,
25064,
198,
11748,
35575,
355,
399,
198,
6738,
35575,
1330,
1673,
36686,
378,
11,
1189,
9948,
283,
11,
13... | 2.494061 | 4,546 |
import numpy as np
import os
import pytest
import random
import shutil
import tempfile
import torch
import torch.utils.data
from data.geo_unpickler import GeoUnpickler
@pytest.fixture
@pytest.mark.skip
| [
11748,
299,
32152,
355,
45941,
198,
11748,
28686,
198,
11748,
12972,
9288,
198,
11748,
4738,
198,
11748,
4423,
346,
198,
11748,
20218,
7753,
198,
11748,
28034,
198,
11748,
28034,
13,
26791,
13,
7890,
198,
198,
6738,
1366,
13,
469,
78,
6... | 2.960526 | 76 |
import logging
from os import path, rename
from time import strftime, gmtime
def create_logfile(filename, name='logger', with_stdout=False, level=logging.INFO):
'''
Create a logfile and rotate old logs.
Required arguments:
filename: the name of the file or path to the log.
Opt... | [
11748,
18931,
198,
198,
6738,
28686,
1330,
3108,
11,
36265,
198,
6738,
640,
1330,
965,
31387,
11,
308,
76,
2435,
198,
198,
4299,
2251,
62,
6404,
7753,
7,
34345,
11,
1438,
11639,
6404,
1362,
3256,
351,
62,
19282,
448,
28,
25101,
11,
... | 2.356187 | 598 |
from constants import KWErrorCode
if __name__ == "__main__":
# constants 검사
for error in KWErrorCode:
print(error)
assert (KWErrorCode.OP_ERR_NONE == KWErrorCode.OP_ERR_NONE)
assert (KWErrorCode.OP_ERR_NONE != KWErrorCode.OP_ERR_ORD_OVERFLOW0)
| [
6738,
38491,
1330,
509,
8845,
81,
1472,
10669,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
1303,
38491,
220,
166,
110,
222,
168,
8955,
198,
220,
220,
220,
329,
4049,
287,
509,
8845,
81,
147... | 2.076923 | 130 |
from airclass_module import HelicopterClass, AircraftClass
class PVOClass:
"""
Класс средств ПВО
Поля: название, высота поражения, количество людей в расчете, количество ракет в установке/количество снарядов (это же одно и то же, да?)
"""
def info(self):
"""Метод с информацией об объекте"... | [
6738,
1633,
4871,
62,
21412,
1330,
48574,
32563,
9487,
11,
30767,
9487,
628,
198,
4871,
350,
29516,
9487,
25,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
12466,
248,
30143,
16142,
21727,
21727,
220,
21727,
21169,
16843,
43666,
21727,
... | 1.32187 | 1,861 |
import doctest
doctest.testfile("addd.rst")
| [
11748,
10412,
395,
198,
4598,
310,
395,
13,
9288,
7753,
7203,
324,
1860,
13,
81,
301,
4943,
198
] | 2.444444 | 18 |
import argparse
import glob
import numpy as np
from six.moves import range
from dataloader import *
from tensorpack import *
from tensorpack.utils import logger
from tensorpack.tfutils.summary import add_moving_summary
from tensorpack.utils.gpu import get_num_gpu
from tensorpack.tfutils.scope_utils import auto_reuse_va... | [
11748,
1822,
29572,
198,
11748,
15095,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
2237,
13,
76,
5241,
1330,
2837,
198,
6738,
4818,
282,
1170,
263,
1330,
1635,
198,
6738,
11192,
273,
8002,
1330,
1635,
198,
6738,
11192,
273,
8002,
13,... | 2.465767 | 2,074 |
class Protocol:
"""
规定:
数据包头部占4字节
整型占4字节
字符串长度位占2字节
字符串不定长
"""
def __init__(self, bs=None):
"""
如果bs为None则代表需要创建一个数据包
否则代表需要解析一个数据包
"""
if bs:
self.bs = bytearray(bs)
else:
self.bs = bytearray(0)... | [
4871,
20497,
25,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
5525,
100,
226,
22522,
248,
171,
120,
248,
198,
220,
220,
220,
220,
220,
220,
220,
10545,
243,
108,
162,
235,
106,
44293,
227,
13783,
112,
32849,
101,
39355,
254,
19,
... | 1.035484 | 310 |
NUMBERS = ( 10, 21, 4, 45, 66, 93 )
for number in NUMBERS:
print(number if number % 2 == 0 else "", end=" ")
| [
41359,
33,
4877,
796,
357,
838,
11,
2310,
11,
604,
11,
4153,
11,
7930,
11,
10261,
1267,
198,
198,
1640,
1271,
287,
36871,
33,
4877,
25,
198,
220,
220,
220,
3601,
7,
17618,
611,
1271,
4064,
362,
6624,
657,
2073,
366,
1600,
886,
262... | 2.425532 | 47 |
#!/usr/bin/env python
# Copyright 2011 Tim Horton. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
2,
15069,
2813,
5045,
46051,
13,
1439,
2489,
10395,
13,
198,
2,
198,
2,
2297,
396,
3890,
290,
779,
287,
2723,
290,
13934,
5107,
11,
351,
393,
1231,
17613,
11,
198,
2,
389,
104... | 3.380952 | 399 |
#%%
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
from skimage.io import imread
from skimage.color import rgb2gray
images = list(map(lambda x: np.float32(rgb2gray(imread(x))), ['./Data/SR2_desmin_image.jpg', './Data/SR3_actin_image.jpg']))
#%%
fig, ax = plt.subplots(1, 1, figsize = (7, 5))
ax.h... | [
2,
16626,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
4,
6759,
29487,
8019,
26098,
198,
6738,
1341,
9060,
13,
952,
1330,
545,
961,
198,
6738,
1341,
9060,
13,
8043,
1330,
46140... | 2.316781 | 584 |
"""
This python script adds a new gdb command, "dump-guest-memory". It
should be loaded with "source dump-guest-memory.py" at the (gdb)
prompt.
Copyright (C) 2013, Red Hat, Inc.
Authors:
Laszlo Ersek <lersek@redhat.com>
Janosch Frank <frankja@linux.vnet.ibm.com>
This work is licensed under the terms of the GNU... | [
37811,
198,
1212,
21015,
4226,
6673,
257,
649,
308,
9945,
3141,
11,
366,
39455,
12,
5162,
395,
12,
31673,
1911,
632,
198,
21754,
307,
9639,
351,
366,
10459,
10285,
12,
5162,
395,
12,
31673,
13,
9078,
1,
379,
262,
357,
70,
9945,
8,
... | 2.135391 | 6,773 |
"""
_____________________________________________
|Problem : Write a program to compute simple|
|interest and compound interest given |
|principle,rate and time period. |
|-------------------------------------------|
| Approach: |
| We use the input() function to receive... | [
37811,
198,
10221,
2602,
29343,
198,
91,
40781,
1058,
19430,
257,
1430,
284,
24061,
2829,
91,
198,
91,
9446,
290,
13061,
1393,
1813,
220,
220,
220,
220,
220,
220,
930,
198,
91,
1050,
1939,
2480,
11,
4873,
290,
640,
2278,
13,
220,
22... | 2.494949 | 396 |
from enum import Enum
from PySide2.QtWidgets import QWidget
from PySide2.QtCore import Qt
| [
6738,
33829,
1330,
2039,
388,
198,
198,
6738,
9485,
24819,
17,
13,
48,
83,
54,
312,
11407,
1330,
1195,
38300,
198,
6738,
9485,
24819,
17,
13,
48,
83,
14055,
1330,
33734,
628,
198
] | 2.818182 | 33 |
#coding:utf-8
import re
import json
import time
import js2py
import logging
from scrapy.http import Request
from scrapy.selector import Selector
from WebHub.pornhub_type import PH_TYPES
from scrapy.contrib.spiders import CrawlSpider
| [
2,
66,
7656,
25,
40477,
12,
23,
198,
11748,
302,
198,
11748,
33918,
198,
11748,
640,
198,
11748,
44804,
17,
9078,
198,
11748,
18931,
198,
198,
6738,
15881,
88,
13,
4023,
1330,
19390,
198,
6738,
15881,
88,
13,
19738,
273,
1330,
9683,
... | 3.175676 | 74 |
#! /usr/bin/env python
import logging
import numpy as np
from .base_controller import BaseController
| [
2,
0,
1220,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
18931,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
764,
8692,
62,
36500,
1330,
7308,
22130,
628
] | 3.466667 | 30 |
from lyrebird import config
from pathlib import Path
import json
import codecs
| [
6738,
22404,
260,
16944,
1330,
4566,
198,
6738,
3108,
8019,
1330,
10644,
198,
11748,
33918,
198,
11748,
40481,
82,
628
] | 4 | 20 |
# Python 3.7.2
#
# Christian W Sigmon
# 2/19/2019 CMSC-416
#
# Problem: Sentences must be created from source texts using a model created based on clusters
# of text that makeup sentences.
#
# Example:
# python ngram.py 3 3 1399.txt 2554-0.txt 2600-0.txt
# Generates random sentences based on a specified n-gram... | [
2,
11361,
513,
13,
22,
13,
17,
198,
2,
198,
2,
4302,
370,
21984,
2144,
198,
2,
362,
14,
1129,
14,
23344,
40773,
34,
12,
35218,
198,
2,
198,
2,
20647,
25,
11352,
3007,
1276,
307,
2727,
422,
2723,
13399,
1262,
257,
2746,
2727,
191... | 2.396877 | 3,714 |
# A - Define Setup Time, Runtime, and Labor Rate variables
setup_time = var('setup_time', 0, '', number)
runtime = var('runtime', 0, '', number)
labor_rate = var('Labor Rate ($)', 0, '', currency)
# B - Compile Setup Cost and Cycle Cost
setup_cost = setup_time * labor_rate
cycle_cost = runtime * part.qty * labor_rate
... | [
2,
317,
532,
2896,
500,
31122,
3862,
11,
43160,
11,
290,
7882,
14806,
9633,
198,
40406,
62,
2435,
796,
1401,
10786,
40406,
62,
2435,
3256,
657,
11,
705,
3256,
1271,
8,
198,
43282,
796,
1401,
10786,
43282,
3256,
657,
11,
705,
3256,
1... | 3.226721 | 247 |
#!/usr/bin/python3
# -*- coding:utf-8 -*-
from pykafka import KafkaClient
from pykafka.common import OffsetType
from lofka_console import *
def main():
"""
主函数
:return:
"""
with open(os.path.join(sys.path[0], "config.json"), "r") as fp:
config = json.load(fp)
arg_map = ArgumentsMap(s... | [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
2,
532,
9,
12,
19617,
25,
40477,
12,
23,
532,
9,
12,
198,
198,
6738,
12972,
74,
1878,
4914,
1330,
46906,
11792,
198,
6738,
12972,
74,
1878,
4914,
13,
11321,
1330,
3242,
2617,
6030,
19... | 1.981897 | 1,381 |
import numpy as np
import tensorflow as tf
from tensorflow.keras.layers import *
| [
11748,
299,
32152,
355,
45941,
201,
198,
11748,
11192,
273,
11125,
355,
48700,
201,
198,
6738,
11192,
273,
11125,
13,
6122,
292,
13,
75,
6962,
1330,
1635,
201,
198,
201,
198
] | 2.774194 | 31 |
#!/usr/bin/env python
__author__ = "Felix Tempel"
__copyright__ = "Copyright 2020, ECG Sex Classification"
__credits__ = ["Felix Tempel"]
__license__ = "GPL"
__version__ = "1.0.1"
__maintainer__ = "Felix Tempel"
__email__ = "felixtempel95@hotmail.de"
__status__ = "Production"
from sklearn.model_selection import GridSe... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
834,
9800,
834,
796,
366,
42493,
844,
24189,
417,
1,
198,
834,
22163,
4766,
834,
796,
366,
15269,
12131,
11,
13182,
38,
14419,
40984,
1,
198,
834,
66,
20696,
834,
796,
14631,
42493,
... | 2.832402 | 179 |
from __future__ import (absolute_import, division,
print_function, unicode_literals)
from future.builtins import *
from .blocks import Block, Input
from .languages import language_codes
class Program(object):
"""For exporting blocks to a specfic block language."""
name = "Program" # ... | [
6738,
11593,
37443,
834,
1330,
357,
48546,
62,
11748,
11,
7297,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3601,
62,
8818,
11,
28000,
1098,
62,
17201... | 2.654412 | 408 |
#----------------------------------------------------------------------------#
# Imports
#----------------------------------------------------------------------------#
from flask import Flask, render_template, request, redirect, url_for
# from flask.ext.sqlalchemy import SQLAlchemy
import logging
from logging import F... | [
2,
10097,
10541,
2,
198,
2,
1846,
3742,
198,
2,
10097,
10541,
2,
198,
198,
6738,
42903,
1330,
46947,
11,
8543,
62,
28243,
11,
2581,
11,
18941,
11,
19016,
62,
1640,
198,
2,
422,
42903,
13,
2302,
13,
25410,
282,
26599,
1330,
16363,
... | 3.13738 | 939 |
# -*- coding: utf-8 -*-
# Author: XuMing <shibing624@126.com>
# Data: 17/10/16
# Brief:
import tensorflow as tf
v1 = tf.Variable(tf.constant(1.0, shape=[1]), name='v1')
v2 = tf.Variable(tf.constant(2.0, shape=[1]), name='v2')
v3 = v1 + v2
init_op = tf.global_variables_initializer()
saver = tf.train.Saver()
with tf.... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
6434,
25,
33591,
44,
278,
1279,
1477,
571,
278,
21,
1731,
31,
19420,
13,
785,
29,
198,
2,
6060,
25,
1596,
14,
940,
14,
1433,
198,
2,
22821,
25,
220,
198,
11748,... | 2.010571 | 473 |
from __future__ import absolute_import
import responses
from exam import fixture
from sentry.testutils import PluginTestCase
from sentry.utils import json
from sentry_plugins.splunk.plugin import SplunkPlugin
| [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
198,
11748,
9109,
198,
198,
6738,
2814,
1330,
29220,
198,
6738,
1908,
563,
13,
9288,
26791,
1330,
42636,
14402,
20448,
198,
6738,
1908,
563,
13,
26791,
1330,
33918,
198,
198,
6738,
19... | 3.944444 | 54 |
from __future__ import print_function, division, absolute_import, unicode_literals
import random
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import click
@click.command()
@click.argument("root_name")
@click.argument("data_file")
@click.argument("embedding_file")
@click.option("--max_plot", ... | [
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
11,
7297,
11,
4112,
62,
11748,
11,
28000,
1098,
62,
17201,
874,
198,
198,
11748,
4738,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
2603,
29487,
8... | 2.950704 | 142 |
"""
Django settings for abstain project.
Generated by 'django-admin startproject' using Django 3.1.2.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.1/ref/settings/
"""
import enviro... | [
37811,
198,
35,
73,
14208,
6460,
329,
16552,
391,
1628,
13,
198,
198,
8645,
515,
416,
705,
28241,
14208,
12,
28482,
923,
16302,
6,
1262,
37770,
513,
13,
16,
13,
17,
13,
198,
198,
1890,
517,
1321,
319,
428,
2393,
11,
766,
198,
5450... | 2.324471 | 1,843 |
import file1()
from datetime import date,import timedelta
for i in i:
crimes.point(float(incident['Y']), float(incident['X']), 0, 0)
crimes.save(outPathShp)
| [
11748,
2393,
16,
3419,
198,
6738,
4818,
8079,
1330,
3128,
11,
11748,
28805,
12514,
198,
220,
329,
1312,
287,
1312,
25,
198,
220,
6741,
13,
4122,
7,
22468,
7,
1939,
738,
17816,
56,
20520,
828,
12178,
7,
1939,
738,
17816,
55,
20520,
8... | 2.68254 | 63 |
import pymongo
cli = pymongo.MongoClient("mongodb+srv://dbuser:dbUser123@cluster0.6iawp.mongodb.net/myFirstDatabase?retryWrites=true&w=majority")
# print(*cli.list_database_names(),sep="\n")
db = cli["patika"]
print(*db.list_collection_names(),sep="\n")
col = db["153_yemeksepeti"]
# mydata={"adi":"ilhan","soyadi":"m"... | [
11748,
279,
4948,
25162,
220,
198,
44506,
796,
279,
4948,
25162,
13,
44,
25162,
11792,
7203,
31059,
375,
65,
10,
27891,
85,
1378,
9945,
7220,
25,
9945,
12982,
10163,
31,
565,
5819,
15,
13,
21,
544,
24142,
13,
31059,
375,
65,
13,
326... | 2.370787 | 178 |
# -*- coding: utf-8 -*-
"""Define project metadata
"""
__package_name__ = 'korona'
__description__ = 'Package for building html pages'
__url__ = 'https://github.com/bharadwajyarlagadda/korona'
__version__ = '0.4.3.-dev'
__author__ = 'Bharadwaj Yarlagadda'
__email__ = 'yarlagaddabharadwaj@gmail.com'
__license__ = 'MIT ... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
7469,
500,
1628,
20150,
198,
37811,
198,
198,
834,
26495,
62,
3672,
834,
796,
705,
74,
273,
4450,
6,
198,
834,
11213,
834,
796,
705,
27813,
329,
2615,
27711,
54... | 2.455224 | 134 |
import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
print('Found Package(s): ', setuptools.find_packages())
setuptools.setup(
name='webreg',
long_description=long_description,
long_description_content_type="text/markdown",
packages=setuptools.find_packages(),
ver... | [
11748,
900,
37623,
10141,
198,
198,
4480,
1280,
7203,
15675,
11682,
13,
9132,
1600,
366,
81,
4943,
355,
277,
71,
25,
198,
220,
220,
220,
890,
62,
11213,
796,
277,
71,
13,
961,
3419,
198,
198,
4798,
10786,
21077,
15717,
7,
82,
2599,
... | 2.471354 | 384 |
from abc import ABC, abstractmethod
| [
6738,
450,
66,
1330,
9738,
11,
12531,
24396,
628
] | 4.111111 | 9 |
__all__ = ['idis']
from . import instruction
instruction.extend()
from .f import idis
instruction.clean_up() | [
834,
439,
834,
796,
37250,
29207,
20520,
198,
198,
6738,
764,
1330,
12064,
198,
8625,
2762,
13,
2302,
437,
3419,
198,
6738,
764,
69,
1330,
4686,
271,
198,
8625,
2762,
13,
27773,
62,
929,
3419
] | 3.114286 | 35 |
from convlab2.policy.pg import PG
import os
import json | [
6738,
3063,
23912,
17,
13,
30586,
13,
6024,
1330,
23842,
198,
11748,
28686,
198,
11748,
33918
] | 3.4375 | 16 |
from __future__ import unicode_literals
from django.db import migrations, models
| [
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
201,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
201,
198,
201,
198
] | 3.269231 | 26 |
from django.db import models
from django.utils import timezone
from datetime import date
# Create your models here.
PRIORITY_CHOICES = (
(1, 'ONE (LOW)'),
(2, 'TWO'),
(3, 'THREE (NORMAL)'),
(4, 'FOUR'),
(5, 'FIVE (HIGH)'),
)
STATUS_CHOICES = (
(1, 'To do'),
(2, 'Doing'),
(3, 'Do... | [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
42625,
14208,
13,
26791,
1330,
640,
11340,
198,
6738,
4818,
8079,
1330,
3128,
628,
198,
2,
13610,
534,
4981,
994,
13,
198,
198,
4805,
41254,
9050,
62,
44899,
34444,
796,
357,
220,
6... | 2.318352 | 267 |
from delivery.dbapi import TaskActivityDbio, TaskDbio
from delivery.models import Task
| [
6738,
7585,
13,
9945,
15042,
1330,
15941,
16516,
43832,
952,
11,
15941,
43832,
952,
198,
6738,
7585,
13,
27530,
1330,
15941,
628
] | 4 | 22 |
from ..utils import Object
class GetChatMessageByDate(Object):
"""
Returns the last message sent in a chat no later than the specified date
Attributes:
ID (:obj:`str`): ``GetChatMessageByDate``
Args:
chat_id (:obj:`int`):
Chat identifier
date (:obj:`int`):
... | [
198,
198,
6738,
11485,
26791,
1330,
9515,
628,
198,
4871,
3497,
30820,
12837,
3886,
10430,
7,
10267,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
16409,
262,
938,
3275,
1908,
287,
257,
8537,
645,
1568,
621,
262,
7368,
3128,
22... | 2.420814 | 221 |