content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
#!/usr/bin/env python
#
# Author: GILLES Lionel aka topotam (@topotam77)
#
# Greetz : grenadine(@Greynardine), skar(@__skar), didakt(@inf0sec1), plissken, pixis(@HackAndDo), shutd0wn(@ _nwodtuhs)
# "Most of" the code stolen from dementor.py from @3xocyte ;)
import sys
import argparse
from impacket import system_er... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
220,
198,
2,
6434,
25,
402,
8267,
1546,
44286,
22430,
1353,
313,
321,
4275,
4852,
313,
321,
3324,
8,
198,
2,
220,
198,
2,
402,
2871,
89,
1058,
17236,
324,
500,
7,
31,
43887,
2... | 2.1752 | 1,621 |
import torch
from torch import nn
import torchvision.transforms as transforms
import matplotlib.pyplot as plt
from data_loader import data_load
from torch.autograd import Variable
import numpy as np
# torch.manual_seed(1) # reproducible
# Hyper Parameters
EPOCH = 20 # train the training data n times... | [
11748,
28034,
198,
6738,
28034,
1330,
299,
77,
198,
11748,
28034,
10178,
13,
7645,
23914,
355,
31408,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
6738,
1366,
62,
29356,
1330,
1366,
62,
2220,
198,
6738,
28034,
13,
... | 2.705607 | 214 |
# pylint: disable = attribute-defined-outside-init, too-few-public-methods
"""Module for serializing IIIF Annotation Lists"""
import json
from django.core.serializers import serialize
from django.core.serializers.base import SerializerDoesNotExist
from .base import Serializer as JSONSerializer
from django.contrib.auth ... | [
2,
279,
2645,
600,
25,
15560,
796,
11688,
12,
23211,
12,
43435,
12,
15003,
11,
1165,
12,
32146,
12,
11377,
12,
24396,
82,
198,
37811,
26796,
329,
11389,
2890,
2873,
5064,
1052,
38983,
44968,
37811,
198,
11748,
33918,
198,
6738,
42625,
... | 3.206422 | 218 |
from .tranco import Tranco | [
6738,
764,
2213,
47699,
1330,
833,
47699
] | 3.714286 | 7 |
"""
This function implements 1d Monte Carlo integration
"""
import numpy as np
def monte_1d(x, f, trials):
"""
Compute a 1D definite integral
Parameters
----------
f : function
User defined function.
x : numpy array
Integration domain.
trials : integer
Total numb... | [
37811,
198,
1212,
2163,
23986,
352,
67,
220,
22489,
40089,
11812,
198,
37811,
198,
198,
11748,
299,
32152,
355,
45941,
198,
198,
4299,
937,
660,
62,
16,
67,
7,
87,
11,
277,
11,
9867,
2599,
198,
220,
220,
37227,
220,
198,
220,
220,
... | 2.42616 | 237 |
import os
import tensorflow.compat.v1 as tf
import time
import numpy as np
# np.random._bit_generator = np.random.bit_generator
from augment import augment
| [
11748,
28686,
198,
11748,
11192,
273,
11125,
13,
5589,
265,
13,
85,
16,
355,
48700,
198,
11748,
640,
198,
11748,
299,
32152,
355,
45941,
198,
2,
45941,
13,
25120,
13557,
2545,
62,
8612,
1352,
796,
45941,
13,
25120,
13,
2545,
62,
8612,... | 3.16 | 50 |
from keras_retinanet.bin.train import train_main
from keras_retinanet import models
import glob
import numpy as np
from sklearn.metrics import f1_score
import os
if __name__ == '__main__':
os.chdir("../")
model_name = 'resnet101'
train_main(0, None, ["csv", "data/trn1.csv", "data/classes.csv",
... | [
6738,
41927,
292,
62,
1186,
259,
272,
316,
13,
8800,
13,
27432,
1330,
4512,
62,
12417,
198,
6738,
41927,
292,
62,
1186,
259,
272,
316,
1330,
4981,
198,
11748,
15095,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
1341,
35720,
13,
4164... | 1.990814 | 2,395 |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
from enum import Enum
__all__ = [
'IntegrationConnectorType',
'IntegrationMarketoConnectorOperator',
'IntegrationOperatorPropertiesKeys',
... | [
2,
19617,
28,
40477,
12,
23,
198,
2,
17202,
39410,
25,
428,
2393,
373,
7560,
416,
262,
21624,
12994,
26144,
35986,
13,
17202,
198,
2,
17202,
2141,
407,
4370,
416,
1021,
4556,
345,
821,
1728,
345,
760,
644,
345,
389,
1804,
0,
17202,
... | 2.98773 | 326 |
import numpy as np
import pickle
objects = ['cow', 'dog', 'person', 'horse', 'sheep', 'aeroplane', 'bird', 'bicycle', 'cat', 'motorbike', 'car']
for object_name in objects:
with open(object_name + '_part_separated_labels', 'rb') as f:
label = pickle.load(f)
with open(object_name + '_part_separated_... | [
11748,
299,
32152,
355,
45941,
198,
11748,
2298,
293,
198,
198,
48205,
796,
37250,
8232,
3256,
705,
9703,
3256,
705,
6259,
3256,
705,
30527,
3256,
220,
705,
7091,
538,
3256,
705,
25534,
20106,
1531,
3256,
705,
16944,
3256,
705,
65,
3529... | 2.264801 | 929 |
# Copyright (c) 2012 OpenStack Foundation.
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... | [
2,
15069,
357,
66,
8,
2321,
4946,
25896,
5693,
13,
198,
2,
1439,
2489,
10395,
13,
198,
2,
198,
2,
220,
220,
220,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
345,
743,
198,
2,
220,
220,
22... | 3.43956 | 546 |
import pytest
import asyncio
import os
import sys
# Workaround so we don't have to create a setup.py file for the project and
# install an editable version
sys.path.append(os.path.join(os.path.dirname(__file__), os.pardir))
from essential_cosmic.app import make_app
| [
11748,
12972,
9288,
198,
11748,
30351,
952,
198,
11748,
28686,
198,
11748,
25064,
198,
198,
2,
5521,
14145,
523,
356,
836,
470,
423,
284,
2251,
257,
9058,
13,
9078,
2393,
329,
262,
1628,
290,
198,
2,
2721,
281,
4370,
540,
2196,
198,
... | 3.202381 | 84 |
# Copyright (c) 2009 The Foundry Visionmongers Ltd. All Rights Reserved.
import nuke
import os, re, sys, math, time
from nukescripts import execute_panel
from nukescripts import panels
| [
2,
15069,
357,
66,
8,
3717,
383,
4062,
563,
19009,
31059,
364,
12052,
13,
220,
1439,
6923,
33876,
13,
198,
11748,
299,
4649,
198,
11748,
28686,
11,
302,
11,
25064,
11,
10688,
11,
640,
198,
6738,
299,
2724,
3798,
1968,
82,
1330,
1226... | 3.381818 | 55 |
# Copyright (C) 2013 Evan Ochsner
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2 of the License, or (at your
# option) any later version.
#
# This program is distributed in ... | [
2,
15069,
357,
34,
8,
2211,
220,
21523,
440,
354,
82,
1008,
198,
2,
198,
2,
770,
1430,
318,
1479,
3788,
26,
345,
460,
17678,
4163,
340,
290,
14,
273,
13096,
340,
198,
2,
739,
262,
2846,
286,
262,
22961,
3611,
5094,
13789,
355,
3... | 2.315732 | 30,944 |
# coding: utf-8
from flask import Flask
import mysql,os,re
from mysql import Pool
import properties
# 定义WEB容器(同时防止json以ascii解码返回)
app=Flask(__name__)
app.config['JSON_AS_ASCII'] = False
# 处理各模块中的自动注入以及组装各蓝图
# dir_path中为蓝图模块路径,例如需要引入的蓝图都在routes文件夹中,则传入参数'/routes'
print('加载数据库模块')
mysql.pool = Pool.Pool()
# print('加载... | [
2,
19617,
25,
3384,
69,
12,
23,
198,
6738,
42903,
1330,
46947,
198,
11748,
48761,
11,
418,
11,
260,
198,
6738,
48761,
1330,
19850,
198,
11748,
6608,
198,
198,
2,
10263,
106,
248,
20046,
231,
8845,
33,
22522,
117,
161,
247,
101,
7,
... | 1.352542 | 295 |
from setuptools import setup, find_packages
import os
with open("README.md", "r") as fh:
long_description = fh.read()
setup(
name='sysmontask',
version='1.3.9',
description='System Monitor With UI Like Windows',
url='https://github.com/KrispyCamel4u/SysMonTask',
author='Neeraj Kumar',
auth... | [
6738,
900,
37623,
10141,
1330,
9058,
11,
1064,
62,
43789,
198,
11748,
28686,
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,... | 2.399621 | 528 |
from typing import List
import random
from time import sleep
from tweepy import Client
from TwitterAPI import TwitterAPI
| [
198,
6738,
19720,
1330,
7343,
198,
11748,
4738,
198,
6738,
640,
1330,
3993,
198,
198,
6738,
4184,
538,
88,
1330,
20985,
198,
6738,
3009,
17614,
1330,
3009,
17614,
198
] | 4.241379 | 29 |
result = non_start('Hello', 'There')
print(result)
result = non_start('java', 'code')
print(result)
result = non_start('shotl', '')
print(result) | [
198,
20274,
796,
1729,
62,
9688,
10786,
15496,
3256,
705,
1858,
11537,
198,
4798,
7,
20274,
8,
198,
20274,
796,
1729,
62,
9688,
10786,
12355,
3256,
705,
8189,
11537,
198,
4798,
7,
20274,
8,
198,
20274,
796,
1729,
62,
9688,
10786,
9442... | 2.862745 | 51 |
import socket
import os
os.system("clear")
import colorama
from colorama import Fore, Back, Style, init
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.settimeout(5)
print("""
_ _
| |__ __ ___ _| | __ _
| '_ \ / _` \ \ /\ / / |/ /| |_
| | | | (_| |\ V V /| ... | [
11748,
17802,
198,
11748,
28686,
198,
418,
13,
10057,
7203,
20063,
4943,
198,
11748,
3124,
1689,
198,
6738,
3124,
1689,
1330,
4558,
11,
5157,
11,
17738,
11,
2315,
198,
82,
796,
17802,
13,
44971,
7,
44971,
13,
8579,
62,
1268,
2767,
11,... | 1.767742 | 310 |
# As comparison, the misleading plot when not turning the population number into a density
districts.plot(column='population', figsize=(12, 6), legend=True) | [
2,
1081,
7208,
11,
262,
15850,
7110,
618,
407,
6225,
262,
3265,
1271,
656,
257,
12109,
198,
17080,
2012,
82,
13,
29487,
7,
28665,
11639,
39748,
3256,
2336,
7857,
16193,
1065,
11,
718,
828,
8177,
28,
17821,
8
] | 4.105263 | 38 |
#!/usr/bin/env python
'Checks for standard headers and update version and copyright info in python files'
__url__ = 'http://github.com/silnrsi/pysilfont'
__copyright__ = 'Copyright (c) 2016 SIL International (http://www.sil.org)'
__license__ = 'Released under the MIT License (http://opensource.org/licenses/MIT)'
__auth... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
6,
7376,
4657,
329,
3210,
24697,
290,
4296,
2196,
290,
6634,
7508,
287,
21015,
3696,
6,
198,
834,
6371,
834,
796,
705,
4023,
1378,
12567,
13,
785,
14,
18217,
77,
3808,
72,
14,
79,
... | 3 | 240 |
import atexit
import logging
from inspect import isclass
from .common_executors import BaseExecutor
from .externel_executors import ExternalExecutorFabric
from .java import *
from .operations import Operation, Operations
from .python import *
from ..utils import isstring
logger = logging.getLogger(__name__)
atex... | [
11748,
379,
37023,
198,
11748,
18931,
198,
6738,
10104,
1330,
318,
4871,
198,
198,
6738,
764,
11321,
62,
18558,
315,
669,
1330,
7308,
23002,
38409,
198,
6738,
764,
1069,
759,
417,
62,
18558,
315,
669,
1330,
34579,
23002,
38409,
43957,
1... | 3.435185 | 108 |
for i in range(201, 0, -2):
print(i)
for i in range(100, 0, -1):
print(i)
| [
1640,
1312,
287,
2837,
7,
1264,
11,
657,
11,
532,
17,
2599,
198,
220,
220,
220,
3601,
7,
72,
8,
198,
198,
1640,
1312,
287,
2837,
7,
3064,
11,
657,
11,
532,
16,
2599,
198,
220,
220,
220,
3601,
7,
72,
8,
198
] | 1.930233 | 43 |
dias = int(input("Insira os dias para virarem segundos: "))
horas = int(input("Insira as horas para virarem segundos: "))
minutos = int(input("Insira os minutos para virarem segundos: "))
segundos = int(input("Insira os segundos para serem somados aos anteriores: "))
segundos += (dias * 86400) + (horas * 3600) + (minut... | [
67,
4448,
796,
493,
7,
15414,
7203,
20376,
8704,
28686,
2566,
292,
31215,
5709,
533,
76,
384,
70,
917,
418,
25,
366,
4008,
198,
17899,
292,
796,
493,
7,
15414,
7203,
20376,
8704,
355,
3076,
292,
31215,
5709,
533,
76,
384,
70,
917,
... | 2.457143 | 175 |
import tkinter as tk
import os
import random
import datetime
root = tk.Tk()
root.title("Motivation")
root.configure(background='white')
command=os.getcwd()+'/motivate/motivate.py'
quote=os.popen(command).read()
color=random.choice(['green','blue','purple','red','orange','brown','magenta','violet','maroon','olive','lim... | [
11748,
256,
74,
3849,
355,
256,
74,
198,
11748,
28686,
198,
11748,
4738,
198,
11748,
4818,
8079,
198,
198,
15763,
796,
256,
74,
13,
51,
74,
3419,
198,
15763,
13,
7839,
7203,
47733,
26939,
4943,
198,
15763,
13,
11250,
495,
7,
25249,
... | 2.729927 | 274 |
from django.apps import AppConfig
| [
6738,
42625,
14208,
13,
18211,
1330,
2034,
16934,
628
] | 3.888889 | 9 |
"""Test normalizing gesture recording data."""
import os
import numpy as np
from iotai_sensor_classification.recording import read_recordings
from iotai_sensor_classification.normalization import normalize_mean_std_dict
from data.gestures import linear_accelerometer
from iotai_sensor_classification.plot_util import co... | [
37811,
14402,
3487,
2890,
18342,
8296,
1366,
526,
15931,
198,
198,
11748,
28686,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
1312,
313,
1872,
62,
82,
22854,
62,
4871,
2649,
13,
8344,
1284,
1330,
1100,
62,
22105,
654,
198,
6738,
1312,... | 3.291339 | 127 |
import json
from random import choice
from typing import Set
import click
import sqlalchemy as sa
from faker import Faker
from schema import Book
from sqlalchemy.orm import sessionmaker
from pgsync.base import pg_engine
from pgsync.constants import DELETE, INSERT, TG_OP, TRUNCATE, UPDATE
from pgsync.utils import get_... | [
11748,
33918,
198,
6738,
4738,
1330,
3572,
198,
6738,
19720,
1330,
5345,
198,
198,
11748,
3904,
198,
11748,
44161,
282,
26599,
355,
473,
198,
6738,
277,
3110,
1330,
376,
3110,
198,
6738,
32815,
1330,
4897,
198,
6738,
44161,
282,
26599,
... | 2.558074 | 353 |
import requests
import json
aspace_url = 'http://localhost:8089'
username = 'admin'
password = 'admin'
repo_num = '2'
auth = requests.post(aspace_url+'/users/'+username+'/login?password='+password).json()
session = auth["session"]
headers = {'X-ArchivesSpace-Session':session}
for d in range(1,6):
resource_json = re... | [
11748,
7007,
198,
11748,
33918,
198,
198,
5126,
558,
62,
6371,
796,
705,
4023,
1378,
36750,
25,
1795,
4531,
6,
198,
29460,
796,
705,
28482,
6,
198,
28712,
796,
705,
28482,
6,
198,
260,
7501,
62,
22510,
796,
705,
17,
6,
198,
198,
1... | 2.876812 | 276 |
__author__ = 'Akshay'
| [
834,
9800,
834,
796,
705,
32,
50133,
323,
6,
628,
198
] | 2.181818 | 11 |
# -*- coding: utf-8 -*-
"""
:copyright: (C) 2010-2013 by Contrail Consortium.
"""
from threading import Thread
from conpaas.core.expose import expose
from conpaas.core.manager import BaseManager
from conpaas.core.manager import ManagerException
from conpaas.core.https.server import HttpJsonResponse, HttpErrorR... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
37811,
198,
220,
220,
220,
1058,
22163,
4766,
25,
357,
34,
8,
3050,
12,
6390,
416,
2345,
30224,
42727,
13,
198,
37811,
198,
198,
6738,
4704,
278,
1330,
14122,
198... | 3.125 | 136 |
import os
import sys
# enter path to the directory with the files
x = input('Absolute path of folder, from which empty subfolders are to be removed: ')
# check if path is valid
if not os.path.exists(x):
print('Invalid path\nTerminating program')
sys.exit()
# cleanup of empty subfolders
walk = list(os.walk('/home/n... | [
11748,
28686,
198,
11748,
25064,
198,
198,
2,
3802,
3108,
284,
262,
8619,
351,
262,
3696,
198,
87,
796,
5128,
10786,
24849,
3552,
3108,
286,
9483,
11,
422,
543,
6565,
850,
11379,
364,
389,
284,
307,
4615,
25,
705,
8,
198,
198,
2,
... | 2.919075 | 173 |
import unittest
import mock
from tempfile import NamedTemporaryFile
from pynxos.features.file_copy import FileCopy, FileTransferError
if __name__ == "__main__":
unittest.main() | [
11748,
555,
715,
395,
198,
11748,
15290,
198,
6738,
20218,
7753,
1330,
34441,
12966,
5551,
8979,
198,
198,
6738,
279,
2047,
87,
418,
13,
40890,
13,
7753,
62,
30073,
1330,
9220,
29881,
11,
9220,
43260,
12331,
628,
198,
361,
11593,
3672,
... | 3.155172 | 58 |
"""Jeff Bay's Object Calisthenics Rules."""
# 1. One level of indentation per method
# * Pylint's "checkers.refactoring", max-nested-blocks=1
# * Pylint's "checkers.design_analysis", max-branches=1
# * DONE
# 2. Don't use the ELSE keyword
import checkers.no_else
# * also Pylint's "checkers.refactoring", max-nested-bl... | [
37811,
19139,
4696,
338,
9515,
2199,
396,
831,
873,
14252,
526,
15931,
198,
198,
2,
352,
13,
1881,
1241,
286,
33793,
341,
583,
2446,
198,
2,
1635,
350,
2645,
600,
338,
366,
9122,
364,
13,
5420,
529,
3255,
1600,
3509,
12,
77,
7287,
... | 3.036842 | 380 |
# © 2020 Amgen Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | [
2,
220,
10673,
12131,
1703,
5235,
3457,
13,
1439,
2489,
10395,
13,
198,
2,
198,
2,
220,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
220,
345,
743,
407,
779,
428,
2393,
2845,
287,
11... | 3.509901 | 202 |
from .user import UserResource
from .movie import MovieResource,MovieAuthorResource
from .note import NoteResource, NoteAllResource
| [
6738,
764,
7220,
1330,
11787,
26198,
198,
6738,
764,
41364,
1330,
15875,
26198,
11,
25097,
13838,
26198,
198,
6738,
764,
11295,
1330,
5740,
26198,
11,
5740,
3237,
26198,
198
] | 4.551724 | 29 |
from Tkinter import *
from tkMessageBox import *
from tkFileDialog import *
from SQLinjector import *
import time
import websitedata
Home()
| [
6738,
309,
74,
3849,
1330,
1635,
198,
6738,
256,
74,
12837,
14253,
1330,
1635,
198,
6738,
256,
74,
8979,
44204,
1330,
1635,
198,
6738,
16363,
259,
752,
273,
1330,
1635,
198,
11748,
640,
198,
11748,
2639,
863,
1045,
198,
220,
220,
220,... | 3.040816 | 49 |
#!/usr/bin/env python3
# Copyright 2019 Mobvoi AI Lab, Beijing, China (author: Fangjun Kuang)
# Apache 2.0
import os
import sys
sys.path.insert(0, os.path.join(os.path.dirname(__file__), os.pardir))
import unittest
import numpy as np
import kaldi
if __name__ == '__main__':
unittest.main()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
2,
15069,
13130,
16540,
13038,
72,
9552,
3498,
11,
11618,
11,
2807,
357,
9800,
25,
24468,
29741,
12554,
648,
8,
198,
2,
24843,
362,
13,
15,
198,
198,
11748,
28686,
198,
1174... | 2.576271 | 118 |
from flask import Blueprint, request, render_template, jsonify
from flask_login import current_user
from src.controllers.supporting_lists.manage_lists import manage, update_item
from src.models.type import TypeDataAccess
from src.models.tag import TagDataAccess
from src.models.research_group import *
from src.models.st... | [
6738,
42903,
1330,
39932,
11,
2581,
11,
8543,
62,
28243,
11,
33918,
1958,
198,
6738,
42903,
62,
38235,
1330,
1459,
62,
7220,
198,
6738,
12351,
13,
3642,
36667,
13,
11284,
278,
62,
20713,
13,
805,
496,
62,
20713,
1330,
6687,
11,
4296,
... | 2.872464 | 690 |
# -*- coding: utf-8 -*-
# @Author: ander
# @Date: 2020-12-22 16:19:51
# @Last Modified by: ander
# @Last Modified time: 2020-12-22 16:25:49
import pdfplumber
from PyPDF2 import PdfFileReader, PdfFileWriter, PdfFileMerger
import os.path
from .utilities import mkdir
class PDFBot(object):
"""docstring for ExcelB... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2488,
13838,
25,
290,
263,
198,
2,
2488,
10430,
25,
220,
220,
12131,
12,
1065,
12,
1828,
1467,
25,
1129,
25,
4349,
198,
2,
2488,
5956,
40499,
416,
25,
220,
220,
... | 2.629032 | 124 |
# -*- coding: utf-8 -*-
###
# (C) Copyright [2019] Hewlett Packard Enterprise Development LP
#
# 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
#... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
21017,
198,
2,
357,
34,
8,
15069,
685,
23344,
60,
30446,
15503,
6400,
446,
14973,
7712,
18470,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
... | 3.767857 | 224 |
import zipcodes
import listings
import bnbcalendar
import finance
from pprint import pprint
if __name__ == "__main__":
region_average_revenue(zipcodes.get_all_cape_cod_zip_codes)
| [
11748,
19974,
40148,
198,
11748,
26890,
198,
11748,
275,
46803,
9948,
9239,
198,
11748,
9604,
198,
6738,
279,
4798,
1330,
279,
4798,
628,
220,
220,
220,
220,
220,
220,
220,
220,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
... | 2.811594 | 69 |
#
# demo_spam_classifier.py
#
# Multinomial Naive Bays Classifier.
#
# Based-on:
#
# https://www.udemy.com/data-science-and-machine-learning-with-python-hands-on/
# http://blog.datumbox.com/machine-learning-tutorial-the-naive-bayes-text-classifier/
#
import os
import io
import numpy
from pandas import DataFrame
from s... | [
2,
198,
2,
13605,
62,
2777,
321,
62,
4871,
7483,
13,
9078,
198,
2,
198,
2,
7854,
259,
49070,
11013,
425,
347,
592,
5016,
7483,
13,
198,
2,
198,
2,
13403,
12,
261,
25,
198,
2,
198,
2,
3740,
1378,
2503,
13,
463,
3065,
13,
785,
... | 3.206501 | 523 |
ports = [80, 433, 8080, 8000]
| [
3742,
796,
685,
1795,
11,
47407,
11,
4019,
1795,
11,
38055,
60,
628
] | 2.384615 | 13 |
#
# Copyright (c) nexB Inc. and others. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
# See http://www.apache.org/licenses/LICENSE-2.0 for the license text.
# See https://github.com/nexB/commoncode for support or download.
# See https://aboutcode.org for more information about nexB OSS projects.
#
import ... | [
2,
198,
2,
15069,
357,
66,
8,
497,
87,
33,
3457,
13,
290,
1854,
13,
1439,
2489,
10395,
13,
198,
2,
30628,
55,
12,
34156,
12,
33234,
7483,
25,
24843,
12,
17,
13,
15,
198,
2,
4091,
2638,
1378,
2503,
13,
43073,
13,
2398,
14,
677,... | 2.715043 | 2,453 |
""" Script to send prediction request.
Usage:
python predict.py --url=YOUR_KF_HOST/models/coco --input_image=YOUR_LOCAL_IMAGE
--output_image=OUTPUT_IMAGE_NAME.
This will save the prediction result as OUTPUT_IMAGE_NAME.
The output image is the input image with the detected bounding boxes.
"""
import argparse
imp... | [
37811,
12327,
284,
3758,
17724,
2581,
13,
198,
198,
28350,
25,
198,
220,
21015,
4331,
13,
9078,
1377,
6371,
28,
56,
11698,
62,
42,
37,
62,
39,
10892,
14,
27530,
14,
66,
25634,
1377,
15414,
62,
9060,
28,
56,
11698,
62,
29701,
1847,
... | 3.081761 | 159 |
from selenium import webdriver
browser = webdriver.Firefox()
browser.get('http://0.0.0.0:8000')
print(browser.title)
assert 'Django' in browser.title
| [
6738,
384,
11925,
1505,
1330,
3992,
26230,
198,
198,
40259,
796,
3992,
26230,
13,
13543,
12792,
3419,
198,
40259,
13,
1136,
10786,
4023,
1378,
15,
13,
15,
13,
15,
13,
15,
25,
33942,
11537,
198,
4798,
7,
40259,
13,
7839,
8,
198,
3049... | 2.849057 | 53 |
# Generated by Django 2.2.13 on 2020-07-23 16:13
from django.db import migrations
| [
2,
2980,
515,
416,
37770,
362,
13,
17,
13,
1485,
319,
12131,
12,
2998,
12,
1954,
1467,
25,
1485,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
628,
198
] | 2.741935 | 31 |
# Copyright (c) OpenMMLab. All rights reserved.
from .base import BaseWeightedLoss
from .binary_logistic_regression_loss import BinaryLogisticRegressionLoss
from .bmn_loss import BMNLoss
from .cross_entropy_loss import BCELossWithLogits, CrossEntropyLoss
from .hvu_loss import HVULoss
from .nll_loss import NLLLoss
from ... | [
2,
15069,
357,
66,
8,
4946,
44,
5805,
397,
13,
1439,
2489,
10395,
13,
198,
6738,
764,
8692,
1330,
7308,
25844,
276,
43,
793,
198,
6738,
764,
39491,
62,
6404,
2569,
62,
2301,
2234,
62,
22462,
1330,
45755,
11187,
2569,
8081,
2234,
43,... | 2.946927 | 358 |
from flask import Flask, render_template, url_for, request, redirect, send_from_directory, session, flash
from functools import wraps
from .db import init_db
from .models.object import Object
from .controllers.object import ObjectController
from .controllers.user import UserController
from flask import jsonify
| [
6738,
42903,
1330,
46947,
11,
8543,
62,
28243,
11,
19016,
62,
1640,
11,
2581,
11,
18941,
11,
3758,
62,
6738,
62,
34945,
11,
6246,
11,
7644,
198,
6738,
1257,
310,
10141,
1330,
27521,
198,
6738,
764,
9945,
1330,
2315,
62,
9945,
198,
6... | 4.105263 | 76 |
/home/runner/.cache/pip/pool/3a/e8/d9/6b866f26f3d0047a518cb59b619be509f29a97d30cbaa9657343abd771 | [
14,
11195,
14,
16737,
11757,
23870,
14,
79,
541,
14,
7742,
14,
18,
64,
14,
68,
23,
14,
67,
24,
14,
21,
65,
42240,
69,
2075,
69,
18,
67,
405,
2857,
64,
44085,
21101,
3270,
65,
21,
1129,
1350,
29022,
69,
1959,
64,
5607,
67,
1270... | 1.745455 | 55 |
"""
Django REST Framework serializers for the User API Accounts sub-application
"""
import json
import logging
import re
from django.conf import settings
from django.contrib.auth.models import User # lint-amnesty, pylint: disable=imported-auth-user
from django.core.exceptions import ObjectDoesNotExist
from django.u... | [
37811,
198,
35,
73,
14208,
30617,
25161,
11389,
11341,
329,
262,
11787,
7824,
35584,
850,
12,
31438,
198,
37811,
628,
198,
11748,
33918,
198,
11748,
18931,
198,
11748,
302,
198,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
... | 2.568663 | 8,782 |
from organize.utils import Path, find_unused_filename, splitglob, increment_filename_version
| [
6738,
16481,
13,
26791,
1330,
10644,
11,
1064,
62,
403,
1484,
62,
34345,
11,
6626,
4743,
672,
11,
18703,
62,
34345,
62,
9641,
628,
628,
628,
628,
628
] | 3.642857 | 28 |
from typing import Dict
import numpy as np
from actor.correspondence_actor import CorrespondenceActor
from shape.point_2d import Point2D
from shape.polyline_2d import Polyline2D
from shape.shape import Shape
| [
6738,
19720,
1330,
360,
713,
198,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
8674,
13,
10215,
5546,
594,
62,
11218,
1330,
34428,
594,
40277,
198,
6738,
5485,
13,
4122,
62,
17,
67,
1330,
6252,
17,
35,
198,
6738,
5485,
13,
35... | 3.5 | 60 |
#!/usr/bin/env python
# Copyright (c) 2018, Konstantinos Kamnitsas
#
# This program is free software; you can redistribute and/or modify
# it under the terms of the Apache License, Version 2.0. See the
# accompanying LICENSE file or read the terms at:
# http://www.apache.org/licenses/LICENSE-2.0
from __future__ impo... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
2,
15069,
357,
66,
8,
2864,
11,
17431,
18797,
11996,
12670,
77,
896,
292,
198,
2,
198,
2,
770,
1430,
318,
1479,
3788,
26,
345,
460,
17678,
4163,
290,
14,
273,
13096,
198,
2,
... | 3.114286 | 210 |
import pygame
import numpy as np
import colorsys
from typing import List, Union, Tuple
import os
from PyEvolv.grid_creator.Sidebar import Sidebar
from PyEvolv.assets.font import FONT | [
11748,
12972,
6057,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
7577,
893,
198,
6738,
19720,
1330,
7343,
11,
4479,
11,
309,
29291,
198,
11748,
28686,
198,
6738,
9485,
36,
10396,
85,
13,
25928,
62,
45382,
13,
24819,
5657,
1330,
12075... | 3.309091 | 55 |
#import util_preparation as up
import pandas as pd
import random
import os
import csv
from .models import *
PREVENT_DURATION = 60
START_PREVENT_DURATION = 120
END_PREVENT_DURATION = 120
| [
2,
11748,
7736,
62,
3866,
1845,
341,
355,
510,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
4738,
198,
11748,
28686,
198,
11748,
269,
21370,
198,
198,
6738,
764,
27530,
1330,
1635,
198,
198,
46437,
53,
3525,
62,
35,
4261,
6234,
... | 2.7 | 70 |
# -*- coding: utf-8 -*-
###############################################################################
#
# ZipFile
# Creates a zipped version of the specified Box file and returns a link to the new compressed file.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
29113,
29113,
7804,
4242,
21017,
198,
2,
198,
2,
38636,
8979,
198,
2,
7921,
274,
257,
1976,
3949,
2196,
286,
262,
7368,
8315,
2393,
290,
5860,
257,
2792,
284,
262... | 3.122951 | 1,220 |
from telegram.ext import ConversationHandler
class ConversationHandlerExt(ConversationHandler):
"""Расширяет оригинальный :class:`telegram.ext.ConversationHandler` возможностью вручную
установить `state`. Переопределяет конструктор, теперь обязателен только 1 параметр (states).
"""
def set_state(self... | [
6738,
573,
30536,
13,
2302,
1330,
42427,
25060,
628,
198,
4871,
42427,
25060,
11627,
7,
3103,
690,
341,
25060,
2599,
198,
220,
220,
220,
37227,
140,
254,
16142,
21727,
141,
230,
18849,
21169,
40623,
16843,
20375,
12466,
122,
21169,
18849,... | 1.758105 | 401 |
from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
import compas_ghpython
from compas.artists import PrimitiveArtist
from .artist import GHArtist
class PointArtist(GHArtist, PrimitiveArtist):
"""Artist for drawing points.
Parameters
----------
... | [
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
6738,
11593,
37443,
834,
1330,
7297,
198,
198,
11748,
552,
292,
62,
456,
29412,
198,
6738,
552,
292,
13,
433,
1023,
1330,
11460,
... | 2.659836 | 244 |
##Requires PIL (Pillow), and pytesseract
from PIL import Image
from pytesseract import image_to_string
img=Image.open('test.png')
print(image_to_string(img)) | [
2235,
39618,
350,
4146,
357,
47,
359,
322,
828,
290,
12972,
83,
408,
263,
529,
201,
198,
201,
198,
6738,
350,
4146,
1330,
7412,
201,
198,
6738,
12972,
83,
408,
263,
529,
1330,
2939,
62,
1462,
62,
8841,
201,
198,
201,
198,
9600,
28... | 2.530303 | 66 |
from datetime import datetime
import requests
import time
from etl import base
from utils.fence_helper import get_api_key, get_access_token
| [
6738,
4818,
8079,
1330,
4818,
8079,
198,
11748,
7007,
198,
11748,
640,
198,
198,
6738,
2123,
75,
1330,
2779,
198,
6738,
3384,
4487,
13,
69,
594,
62,
2978,
525,
1330,
651,
62,
15042,
62,
2539,
11,
651,
62,
15526,
62,
30001,
628
] | 3.380952 | 42 |
# -*- coding: utf-8 -*-
'''
#-------------------------------------------------------------------------------
# NATIONAL UNIVERSITY OF SINGAPORE - NUS
# SINGAPORE INSTITUTE FOR NEUROTECHNOLOGY - SINAPSE
# Singapore
# URL: http://www.sinapseinstitute.org
#-----------------------------------------------------------... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
201,
198,
7061,
6,
201,
198,
2,
10097,
24305,
201,
198,
2,
399,
29912,
49677,
9050,
3963,
311,
2751,
2969,
6965,
532,
399,
2937,
201,
198,
2,
311,
2751,
2969,
6965,
40589,
... | 2.190457 | 2,473 |
#!/usr/bin/python
import numpy as np
import IPython
from IPython.core.debugger import set_trace
NORTH = np.array([0, 1])
SOUTH = np.array([0, -1])
WEST = np.array([-1, 0])
EAST = np.array([1, 0])
STAY = np.array([0, 0])
TRANSLATION_TABLE = [
# [left, intended_direction, right]
[WEST, NORTH, EAST],
[EAS... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
6101,
7535,
198,
198,
6738,
6101,
7535,
13,
7295,
13,
24442,
1362,
1330,
900,
62,
40546,
198,
198,
35510,
4221,
796,
45941,
13,
18747,
26933,
1... | 2.066364 | 1,100 |
#!/usr/bin/env python3
"""
__main__.py - The main module for processing data and creating visual summaries
for this study.
"""
import os
import sys
from pathlib import Path
import etl
import pandas as pd
import ui.cli as cli
from file import YAMLFile
# ================================================================... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
37811,
198,
834,
12417,
834,
13,
9078,
532,
383,
1388,
8265,
329,
7587,
1366,
290,
4441,
5874,
30114,
3166,
198,
1640,
428,
2050,
13,
198,
37811,
198,
11748,
28686,
198,
11748,
250... | 3.514451 | 865 |
# Fix paths for imports to work in unit tests ----------------
if __name__ == "__main__":
from _fix_paths import fix_paths
fix_paths()
# ------------------------------------------------------------
# Load libraries ---------------------------------------------
from typing import Dict
import numpy as np
f... | [
2,
13268,
13532,
329,
17944,
284,
670,
287,
4326,
5254,
34400,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
422,
4808,
13049,
62,
6978,
82,
1330,
4259,
62,
6978,
82,
628,
220,
220,
220,
4259... | 2.673557 | 1,161 |
# -*- coding: utf-8 -*- | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12
] | 1.769231 | 13 |
import importlib
from parlai.core.agents import add_datapath_and_model_args
from parlai.core.build_data import modelzoo_path
from openchat.utils import (
inherit,
create_agent_from_opt_file_and_model_class,
)
from openchat.base import (
ParlaiGenerationAgent,
Seq2SeqLM,
ConvAI2Agent,
WizardOf... | [
11748,
1330,
8019,
198,
6738,
1582,
75,
1872,
13,
7295,
13,
49638,
1330,
751,
62,
19608,
499,
776,
62,
392,
62,
19849,
62,
22046,
198,
6738,
1582,
75,
1872,
13,
7295,
13,
11249,
62,
7890,
1330,
2746,
89,
2238,
62,
6978,
628,
198,
... | 2.607692 | 130 |
# Generated by Django 2.2.10 on 2020-04-12 13:56
import django.core.validators
from django.db import migrations, models
import django_countries.fields
| [
2,
2980,
515,
416,
37770,
362,
13,
17,
13,
940,
319,
12131,
12,
3023,
12,
1065,
1511,
25,
3980,
198,
198,
11748,
42625,
14208,
13,
7295,
13,
12102,
2024,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
198,
11748,
426... | 3.06 | 50 |
from setuptools import find_packages, setup
from pathlib import Path
NAME = 'model_lstm'
DESCRIPTION = 'LSTM model which classifies the sentiment of English sentences.'
URL = 'https://github.com/ofbennett/sentiment-analysis-app'
EMAIL = 'contact.me.ob@gmail.com'
AUTHOR = 'Oscar Bennett'
REQUIRES_PYTHON = '>=3.7.0'
ROO... | [
6738,
900,
37623,
10141,
1330,
1064,
62,
43789,
11,
9058,
198,
6738,
3108,
8019,
1330,
10644,
198,
198,
20608,
796,
705,
19849,
62,
75,
301,
76,
6,
198,
30910,
40165,
796,
705,
43,
2257,
44,
2746,
543,
1398,
6945,
262,
15598,
286,
3... | 2.320635 | 630 |
import gym
from gym import spaces
from ple import PLE
import numpy as np | [
11748,
11550,
198,
6738,
11550,
1330,
9029,
198,
6738,
3339,
1330,
350,
2538,
198,
11748,
299,
32152,
355,
45941
] | 3.789474 | 19 |
#!/usr/bin/env python
if __name__ == '__main__':
from argparse import ArgumentParser
from io import StringIO
import sys
arg_parser = ArgumentParser(description='I/O test')
arg_parser.add_argument('-o', dest='output', help='output file')
options = arg_parser.parse_args()
str_io = StringIO()
... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
422,
1822,
29572,
1330,
45751,
46677,
198,
220,
220,
220,
422,
33245,
1330,
10903,
9399,
198,
220,
22... | 2.46383 | 235 |
import json
from flask import Flask
from flasgger import Swagger
from globals import connected_devices, Oven
import os
import recipes
import ovens
import recipe_search_online
import db
from mqtt_shared import mqtt_manager, mqtt_topics
from constants import MONGO_URI, MONGO_URI_TEST
import argparse
fro... | [
11748,
33918,
201,
198,
201,
198,
6738,
42903,
1330,
46947,
201,
198,
6738,
781,
292,
26679,
1330,
2451,
7928,
201,
198,
6738,
15095,
874,
1330,
5884,
62,
42034,
11,
440,
574,
201,
198,
11748,
28686,
201,
198,
201,
198,
11748,
14296,
... | 2.730375 | 293 |
tabela = {'2': 'a',
'3':'d',
'5':'j',
'4':'g',
'6':'m',
'7':'p',
'8':'t',
'9': 'w',
'0': ' ',
}
| [
8658,
10304,
796,
1391,
6,
17,
10354,
705,
64,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
18,
10354,
6,
67,
3256,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
20,
10354,
6,
73,
3256,
198,
220,
... | 1.255319 | 141 |
# location
location = input("Job Location:\n")
pay = input("Payment:\n")
# Prints For decisions
no = "No thanks,I can find something Better"
doubt = "Without a doubt I'll take it"
sure = "Sure, I can work with that"
no_way = "No way!"
# Try and Except
try:
location = str(location)
pay = float(pay)
except:
... | [
2,
4067,
198,
24886,
796,
5128,
7203,
33308,
13397,
7479,
77,
4943,
198,
15577,
796,
5128,
7203,
19197,
434,
7479,
77,
4943,
198,
2,
12578,
82,
1114,
5370,
198,
3919,
796,
366,
2949,
5176,
11,
40,
460,
1064,
1223,
11625,
1,
198,
67,... | 2.384106 | 302 |
from slugify import slugify
from .resource import Resource
| [
6738,
31065,
1958,
1330,
31065,
1958,
198,
198,
6738,
764,
31092,
1330,
20857,
628
] | 4.357143 | 14 |
import tkinter as tk
from Data import Data
from EditClient import EditClient
#Arrumar!
#root = tk.Tk()
#app = SearchDate(master=root)
#app.mainloop()
#data = Data()
#data.db.close()
| [
11748,
256,
74,
3849,
355,
256,
74,
198,
6738,
6060,
1330,
6060,
198,
6738,
5312,
11792,
1330,
5312,
11792,
198,
198,
2,
3163,
6582,
283,
0,
198,
198,
2,
15763,
796,
256,
74,
13,
51,
74,
3419,
198,
2,
1324,
796,
11140,
10430,
7,
... | 2.628571 | 70 |
import boto3
import json
session = boto3.session.Session( profile_name= 'jmcore' )
dynamodb = session.resource( 'dynamodb', region_name= 'eu-west-1' )
table = dynamodb.Table( 'serverless_workshop' )
with open( "user-sets-data.json" ) as json_file:
users = json.load( json_file )
for user in users:
userID = use... | [
11748,
275,
2069,
18,
198,
11748,
33918,
198,
198,
29891,
796,
275,
2069,
18,
13,
29891,
13,
36044,
7,
7034,
62,
3672,
28,
705,
73,
76,
7295,
6,
1267,
198,
67,
4989,
375,
65,
796,
6246,
13,
31092,
7,
705,
67,
4989,
375,
65,
3256... | 2.358586 | 198 |
from sarsa_skel import *
if __name__ == '__main__':
plot_softmax("MiniGrid-Empty-6x6-v0")
| [
6738,
264,
945,
64,
62,
82,
7750,
1330,
1635,
628,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
7110,
62,
4215,
9806,
7203,
39234,
41339,
12,
40613,
12,
21,
87,
21,
12,
85,
15,
4943,
198
... | 2.227273 | 44 |
#
# @lc app=leetcode id=146 lang=python3
#
# [146] LRU Cache
#
# @lc code=start
# Your LRUCache object will be instantiated and called as such:
# obj = LRUCache(capacity)
# param_1 = obj.get(key)
# obj.put(key,value)
# @lc code=end
| [
2,
198,
2,
2488,
44601,
598,
28,
293,
316,
8189,
4686,
28,
20964,
42392,
28,
29412,
18,
198,
2,
198,
2,
685,
20964,
60,
37491,
52,
34088,
198,
2,
198,
2,
2488,
44601,
2438,
28,
9688,
628,
198,
198,
2,
3406,
37491,
9598,
4891,
21... | 2.510638 | 94 |
#!/usr/bin/env python
#
# Merge multiple JavaScript source code files into one.
#
# Usage:
# This script requires source files to have dependencies specified in them.
#
# Dependencies are specified with a comment of the form:
#
# // @requires <file path>
#
# e.g.
#
# // @requires Geo/DataSource.js
#
# This scri... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
198,
2,
39407,
3294,
11933,
2723,
2438,
3696,
656,
530,
13,
198,
2,
198,
2,
29566,
25,
198,
2,
770,
4226,
4433,
2723,
3696,
284,
423,
20086,
7368,
287,
606,
13,
198,
2,
198,
2... | 2.524842 | 2,999 |
"""The test file for transformer DNN"""
import ehrudite.core.dnn.transformer as transformer
import random
import tensorflow as tf
| [
37811,
464,
1332,
2393,
329,
47385,
360,
6144,
37811,
198,
198,
11748,
304,
11840,
463,
578,
13,
7295,
13,
67,
20471,
13,
7645,
16354,
355,
47385,
198,
11748,
4738,
198,
11748,
11192,
273,
11125,
355,
48700,
628,
628,
628,
628
] | 3.45 | 40 |
from unittest.mock import Mock
from asimov import Asset, constant
| [
6738,
555,
715,
395,
13,
76,
735,
1330,
44123,
198,
198,
6738,
355,
44273,
1330,
31433,
11,
6937,
628
] | 3.578947 | 19 |
import unittest
from datetime import date
from datamatch.similarities import (
StringSimilarity, DateSimilarity, JaroWinklerSimilarity, AbsoluteNumericalSimilarity, RelativeNumericalSimilarity
)
| [
11748,
555,
715,
395,
198,
6738,
4818,
8079,
1330,
3128,
198,
198,
6738,
4818,
321,
963,
13,
38610,
871,
1330,
357,
198,
220,
220,
220,
10903,
18925,
414,
11,
7536,
18925,
414,
11,
449,
12022,
54,
676,
1754,
18925,
414,
11,
36532,
4... | 3.474576 | 59 |
import pyeccodes.accessors as _
| [
11748,
279,
5948,
535,
4147,
13,
15526,
669,
355,
4808,
628
] | 3 | 11 |
#!/usr/bin/env python
# -*- coding: utf8 -*-
"""
The MetadataWizard(pymdwizard) software was developed by the
U.S. Geological Survey Fort Collins Science Center.
See: https://github.com/usgs/fort-pymdwizard for current project source code
See: https://usgs.github.io/fort-pymdwizard/ for current user documentation
See: ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
23,
532,
9,
12,
198,
37811,
198,
464,
3395,
14706,
54,
8669,
7,
79,
4948,
67,
86,
8669,
8,
3788,
373,
4166,
416,
262,
198,
52,
13,
50,
13,
... | 2.264125 | 4,354 |
from treadmill.infra.setup import base_provision
from treadmill.infra import configuration, constants, instances
from treadmill.api import ipa
| [
6738,
49246,
13,
10745,
430,
13,
40406,
1330,
2779,
62,
1676,
10178,
198,
6738,
49246,
13,
10745,
430,
1330,
8398,
11,
38491,
11,
10245,
198,
6738,
49246,
13,
15042,
1330,
20966,
64,
628
] | 4.363636 | 33 |
"""Denmark specific Form helpers."""
from django.core.exceptions import ValidationError
from django.forms import fields, widgets
from django.utils.translation import gettext_lazy as _
from .dk_municipalities import DK_MUNICIPALITIES
from .dk_postalcodes import DK_POSTALCODES
class DKPostalCodeField(fields.CharFiel... | [
37811,
21306,
4102,
2176,
5178,
49385,
526,
15931,
198,
198,
6738,
42625,
14208,
13,
7295,
13,
1069,
11755,
1330,
3254,
24765,
12331,
198,
6738,
42625,
14208,
13,
23914,
1330,
7032,
11,
40803,
198,
6738,
42625,
14208,
13,
26791,
13,
41519... | 3.392045 | 176 |
import unittest
from unittest import TestCase
from acceptance.browser import Browser
if __name__ == '__main__':
unittest.main()
| [
11748,
555,
715,
395,
198,
6738,
555,
715,
395,
1330,
6208,
20448,
198,
198,
6738,
13427,
13,
40259,
1330,
34270,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
555,
715,
395,
13,
12417,
... | 3.090909 | 44 |
# (c) 2021 Ruggero Rossi
# Load a Robosoc2d game state log
# supported version: 1.0.0 | [
2,
357,
66,
8,
33448,
19706,
1362,
78,
40696,
198,
2,
8778,
257,
3851,
418,
420,
17,
67,
983,
1181,
2604,
198,
2,
4855,
2196,
25,
352,
13,
15,
13,
15
] | 2.741935 | 31 |
import theano
import unittest
import numpy
from nose.plugins.skip import SkipTest
from theano import tensor as T
from theano.tensor.nnet import conv2d
from theano.sandbox import mkl
from theano.sandbox.mkl.basic_ops import U2IConv, I2U
from theano.sandbox.mkl.mkl_conv import Conv2D
numpy.random.seed(123)
if not mkl.m... | [
11748,
262,
5733,
198,
11748,
555,
715,
395,
198,
11748,
299,
32152,
198,
6738,
9686,
13,
37390,
13,
48267,
1330,
32214,
14402,
198,
6738,
262,
5733,
1330,
11192,
273,
355,
309,
198,
6738,
262,
5733,
13,
83,
22854,
13,
77,
3262,
1330,... | 2.594156 | 308 |
"""Unit tests for embedding Python code"""
import datetime
from pandas import DataFrame
from tests.utils import NormTestCase
| [
37811,
26453,
5254,
329,
11525,
12083,
11361,
2438,
37811,
198,
11748,
4818,
8079,
198,
198,
6738,
19798,
292,
1330,
6060,
19778,
198,
198,
6738,
5254,
13,
26791,
1330,
11220,
14402,
20448,
628
] | 4 | 32 |
# This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild
from pkg_resources import parse_version
import kaitaistruct
from kaitaistruct import KaitaiStruct, KaitaiStream, BytesIO
import collections
from enum import Enum
if parse_version(kaitaistruct.__version__) < parse_versi... | [
2,
770,
318,
257,
7560,
2393,
0,
4222,
4370,
2723,
764,
591,
88,
2393,
290,
779,
479,
4548,
1872,
12,
7249,
12,
5589,
5329,
284,
17884,
198,
198,
6738,
279,
10025,
62,
37540,
1330,
21136,
62,
9641,
198,
11748,
479,
4548,
64,
396,
... | 2.894531 | 256 |
import cv2
import numpy as np
| [
11748,
269,
85,
17,
198,
11748,
299,
32152,
355,
45941,
628,
628,
628,
198
] | 2.571429 | 14 |
from .base import BaseClient
from typing import Optional, Any, Dict, List, Union, Iterator
from .models import (
MarketHoliday,
MarketStatus,
Ticker,
TickerDetails,
TickerNews,
TickerTypes,
Sort,
Order,
AssetClass,
Locale,
Split,
Dividend,
DividendType,
Frequency,... | [
6738,
764,
8692,
1330,
7308,
11792,
198,
6738,
19720,
1330,
32233,
11,
4377,
11,
360,
713,
11,
7343,
11,
4479,
11,
40806,
1352,
198,
6738,
764,
27530,
1330,
357,
198,
220,
220,
220,
5991,
28115,
2567,
11,
198,
220,
220,
220,
5991,
1... | 2.470588 | 187 |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2011-2018 Ben Kurtovic <ben.kurtovic@gmail.com>
# Released under the terms of the MIT License. See LICENSE for details.
from __future__ import print_function, unicode_literals
from gitup import config
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
220,
532,
9,
12,
198,
2,
198,
2,
15069,
357,
34,
8,
2813,
12,
7908,
3932,
20642,
17215,
1279,
11722,
13,
74,
3325,
17215,
31,
14816,
13,
785,
29,
198,
2,
28728,
739,
262,
2846,
286,
... | 3.075 | 80 |
from cg import *
from random import randint
cg = CG()
n=20
c = [[Var("int") for i in range(n)] for i in range(n)]
a = [[Var("int") for i in range(n)] for i in range(n)]
b = [[Var("int") for i in range(n)] for i in range(n)]
m=100
for vs in a:
for v in vs:
cg.init(v, randint(0,m))
for vs in b:
for v... | [
6738,
269,
70,
1330,
1635,
198,
6738,
4738,
1330,
43720,
600,
198,
66,
70,
796,
29925,
3419,
198,
198,
77,
28,
1238,
198,
198,
66,
796,
16410,
19852,
7203,
600,
4943,
329,
1312,
287,
2837,
7,
77,
15437,
329,
1312,
287,
2837,
7,
77... | 1.856698 | 321 |
import os.path
from typing import Dict
import matplotlib.pyplot as plt
import pandas as pd
from sklearn import metrics
from sklearn.ensemble import RandomForestRegressor
from hyperparameter_tuning.study_functions import load_study
from root import ROOT_DIR
from weighted_mean_prediction.data_setup import get_encoded_s... | [
11748,
28686,
13,
6978,
198,
6738,
19720,
1330,
360,
713,
198,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
19798,
292,
355,
279,
67,
198,
6738,
1341,
35720,
1330,
20731,
198,
6738,
1341,
35720,
13,
1072,
... | 2.506849 | 803 |
# -*- coding: utf-8 -*-
import cv2
import os
import copy
import numpy as np
import math
# import Levenshtein
from cv2 import VideoWriter, VideoWriter_fourcc
import json
from tqdm import tqdm
from PIL import Image, ImageDraw, ImageFont
import shutil
def Frames2Video(frames_dir=""):
''' 将frames_dir下面的所有视频帧合成一个视频 '... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
269,
85,
17,
198,
11748,
28686,
198,
11748,
4866,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
10688,
198,
2,
1330,
1004,
574,
1477,
22006,
198,
6738,
269,
85,... | 1.889857 | 1,952 |
from datetime import datetime, timedelta
from typing import Dict, List, Optional
from pytz import timezone
from vnpy.trader.setting import SETTINGS
from vnpy.trader.constant import Exchange, Interval
from vnpy.trader.object import BarData, TickData, HistoryRequest
from vnpy.trader.utility import extract_vt_symbol
from... | [
6738,
4818,
8079,
1330,
4818,
8079,
11,
28805,
12514,
198,
6738,
19720,
1330,
360,
713,
11,
7343,
11,
32233,
198,
6738,
12972,
22877,
1330,
640,
11340,
198,
198,
6738,
410,
77,
9078,
13,
2213,
5067,
13,
33990,
1330,
25823,
51,
20754,
... | 1.708995 | 3,402 |
inp = open('input_d8.txt').read()
arr = [[0 for i in range(50)] for j in range(6)]
for i in inp.split('\n')[:-1]:
if i.startswith('rotate row'):
rotaterow(int(i.split('y=')[1].split(' ')[0]), int(i.split('by ')[1]))
elif i.startswith('rotate column'):
print(i)
rotatecol(int(i.split('x... | [
259,
79,
796,
1280,
10786,
15414,
62,
67,
23,
13,
14116,
27691,
961,
3419,
198,
198,
3258,
796,
16410,
15,
329,
1312,
287,
2837,
7,
1120,
15437,
329,
474,
287,
2837,
7,
21,
15437,
198,
198,
1640,
1312,
287,
287,
79,
13,
35312,
107... | 2.034749 | 259 |