content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
"""Utils for wheel."""
from contextlib import suppress
from pathlib import Path
import re
import shutil
from .utils import run_command, build_arch
RE_WHEEL_PLATFORM = re.compile(r"^(?P<name>.*-)cp\d{2}m?-linux_\w+\.whl$")
ARCH_PLAT = {
"amd64": "linux_x86_64",
"i386": "linux_i686",
"aarch6... | [
37811,
18274,
4487,
329,
7825,
526,
15931,
201,
198,
6738,
4732,
8019,
1330,
18175,
201,
198,
6738,
3108,
8019,
1330,
10644,
201,
198,
11748,
302,
201,
198,
11748,
4423,
346,
201,
198,
201,
198,
6738,
764,
26791,
1330,
1057,
62,
21812,
... | 2.21517 | 646 |
"""
PACKNET - c0mplh4cks
INTERFACE
"""
# === Importing Dependencies === #
import socket
from time import time
from .standards import encode, decode
from . import ADDR, MAC
# === Interface === #
| [
37811,
628,
47035,
12884,
220,
532,
220,
269,
15,
76,
489,
71,
19,
4657,
628,
23255,
49836,
628,
198,
37811,
628,
628,
198,
198,
2,
24844,
17267,
278,
37947,
3976,
24844,
1303,
198,
11748,
17802,
198,
6738,
640,
1330,
640,
198,
6738,
... | 3.144928 | 69 |
import argparse
from smp_manifold_learning.differentiable_models.utils import create_dir_if_not_exist
parser = argparse.ArgumentParser(allow_abbrev=False)
parser.add_argument("-d", "--dir_path", default='../plot/ecmnn/', type=str)
if __name__ == '__main__':
args = parser.parse_args()
dir_path = args.dir_pat... | [
11748,
1822,
29572,
198,
6738,
895,
79,
62,
805,
361,
727,
62,
40684,
13,
39799,
3379,
62,
27530,
13,
26791,
1330,
2251,
62,
15908,
62,
361,
62,
1662,
62,
38476,
628,
198,
48610,
796,
1822,
29572,
13,
28100,
1713,
46677,
7,
12154,
6... | 2.679104 | 134 |
# Generated by Django 3.0.3 on 2020-08-13 18:04
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
513,
13,
15,
13,
18,
319,
12131,
12,
2919,
12,
1485,
1248,
25,
3023,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
#
# Copyright (c) 2017 Electronic Arts Inc. All Rights Reserved
#
import uuid
# https://stackoverflow.com/questions/1181919/python-base-36-encoding/1181924
def base36encode(number, alphabet='0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'):
"""Converts an integer to a base36 string."""
if not isinstance(number, (int,... | [
2,
198,
2,
15069,
357,
66,
8,
2177,
19508,
11536,
3457,
13,
1439,
6923,
33876,
220,
198,
2,
628,
198,
11748,
334,
27112,
198,
198,
2,
3740,
1378,
25558,
2502,
11125,
13,
785,
14,
6138,
507,
14,
16817,
1129,
1129,
14,
29412,
12,
86... | 2.531136 | 273 |
from __future__ import annotations
from dataclasses import dataclass, Field
from datetime import datetime, timedelta
from typing import Union, Optional, Tuple, List
from parse import parse
from med import Med, MedRegistry, DOSAGE_PARSE_FORMAT
DEFAULT_LOG_FILE = 'logs/med.log'
DEFAULT_DATE_TIME_FORMAT = r'%m/%d/%Y %H... | [
6738,
11593,
37443,
834,
1330,
37647,
198,
6738,
4818,
330,
28958,
1330,
4818,
330,
31172,
11,
7663,
198,
6738,
4818,
8079,
1330,
4818,
8079,
11,
28805,
12514,
198,
6738,
19720,
1330,
4479,
11,
32233,
11,
309,
29291,
11,
7343,
198,
198,... | 2.91453 | 117 |
# -*- coding: utf-8 -*-
"""
Created on Mon Feb 26 17:15:36 2018
@author: Raj
"""
import pycroscopy as px
from pycroscopy.processing.fft import FrequencyFilter
import pyUSID as usid
import numpy as np
from scipy import signal as sps
from ffta.load import get_utils
from ffta import pixel
from matplotlib import pyplot... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
2892,
3158,
2608,
1596,
25,
1314,
25,
2623,
2864,
198,
198,
31,
9800,
25,
13308,
198,
37811,
198,
198,
11748,
12972,
19915,
1416,
11081,
355,
279... | 2.621681 | 3,201 |
import pytest
from calvin.runtime.north.plugins.port import queue
from calvin.runtime.north.calvin_token import Token
from calvin.runtime.north.plugins.port.queue.common import QueueEmpty
from calvin.runtime.north.plugins.port.queue.test.test_collect_unordered import TestCollectUnorderedFIFO
pytest_unittest = pytest.m... | [
11748,
12972,
9288,
198,
198,
6738,
2386,
7114,
13,
43282,
13,
43588,
13,
37390,
13,
634,
1330,
16834,
198,
6738,
2386,
7114,
13,
43282,
13,
43588,
13,
9948,
7114,
62,
30001,
1330,
29130,
198,
6738,
2386,
7114,
13,
43282,
13,
43588,
1... | 2.983607 | 122 |
import matplotlib.pyplot as plt
import pandas as pd
from pathlib import Path
import nixio as nix
fnbase = Path.joinpath(Path.home(), 'Chaos', 'work')
fnraw = str(Path.joinpath(fnbase,
'_Lab_Zimmer/calcium_imaging/results/N2/urx/shift210421/20120705Pflp178GCaMP5kshift210421W7URXx2.log'))
... | [
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
19798,
292,
355,
279,
67,
198,
198,
6738,
3108,
8019,
1330,
10644,
198,
198,
11748,
299,
844,
952,
355,
299,
844,
198,
198,
22184,
8692,
796,
10644,
13,
22179,
6978,... | 2.386014 | 715 |
#############################################################################
# Copyright (c) Wolf Vollprecht, QuantStack #
# #
# Distributed under the terms of the BSD 3-Clause License. #
# ... | [
29113,
29113,
7804,
4242,
2,
198,
2,
15069,
357,
66,
8,
8662,
569,
692,
3866,
21474,
11,
16972,
25896,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
... | 2.638456 | 2,564 |
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
def rules_nixpkgs_dependencies(rules_nixpkgs_name = "io_tweag_rules_nixpkgs"):
"""Load repositories required by r... | [
2220,
7203,
31,
65,
41319,
62,
31391,
1003,
31391,
14,
11249,
62,
4299,
82,
14,
260,
7501,
25,
4023,
13,
65,
48274,
1600,
366,
4023,
62,
17474,
4943,
198,
2220,
7203,
31,
65,
41319,
62,
31391,
1003,
31391,
14,
11249,
62,
4299,
82,
... | 2.033985 | 2,148 |
from inspect import isclass
from inspect import signature
from _dependencies.exceptions import DependencyError
# Messages.
default_class_value_template = """
{owner} has a default value of {argument!r} argument set to {value!r} class.
You should either change the name of the argument into '{argument}_class'
... | [
6738,
10104,
1330,
318,
4871,
198,
6738,
10104,
1330,
9877,
198,
198,
6738,
4808,
45841,
3976,
13,
1069,
11755,
1330,
37947,
1387,
12331,
628,
628,
628,
198,
198,
2,
43534,
13,
628,
198,
12286,
62,
4871,
62,
8367,
62,
28243,
796,
3722... | 3.721154 | 104 |
import matplotlib.pyplot as plt
import numpy as np
from sklearn.metrics import accuracy_score
from sklearn.linear_model import LogisticRegression
from sklearn.svm import SVC
from sklearn.gaussian_process import GaussianProcessClassifier
from sklearn.gaussian_process.kernels import RBF
from sklearn import datasets
i... | [
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
1341,
35720,
13,
4164,
10466,
1330,
9922,
62,
26675,
198,
6738,
1341,
35720,
13,
29127,
62,
19849,
1330,
5972,
2569,
8081,
2234... | 3.47 | 100 |
from datetime import datetime, timedelta
from math import inf as infinity
from statistics import mean
| [
6738,
4818,
8079,
1330,
4818,
8079,
11,
28805,
12514,
198,
6738,
10688,
1330,
1167,
355,
37174,
198,
6738,
7869,
1330,
1612,
628
] | 4.681818 | 22 |
import requests
import re
from bs4 import BeautifulSoup
import indexParser
source = DataSource()
| [
11748,
7007,
198,
11748,
302,
198,
6738,
275,
82,
19,
1330,
23762,
50,
10486,
198,
11748,
6376,
46677,
628,
198,
198,
10459,
796,
6060,
7416,
3419,
198
] | 3.703704 | 27 |
# Generated by Django 3.0.2 on 2020-02-02 05:09
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
513,
13,
15,
13,
17,
319,
12131,
12,
2999,
12,
2999,
8870,
25,
2931,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
import numpy as np
import traceback
import multiprocessing as mp
from tqdm import tqdm
from best_shape_fit import *
from data import PlusShapeModel
configs = [
# 'plus_shape.conditional_cinn_4',
# 'plus_shape.conditional_cinn_8',
# 'plus_shape.conditional_hint_4_full',
... | [
11748,
299,
32152,
355,
45941,
201,
198,
11748,
12854,
1891,
201,
198,
11748,
18540,
305,
919,
278,
355,
29034,
201,
198,
6738,
256,
80,
36020,
1330,
256,
80,
36020,
201,
198,
201,
198,
6738,
1266,
62,
43358,
62,
11147,
1330,
1635,
20... | 1.923561 | 1,112 |
import time
from config import CONFIG
| [
11748,
640,
198,
198,
6738,
4566,
1330,
25626,
628,
628,
198
] | 3.909091 | 11 |
from botto.core.bot import Botto
db = Botto.db
# pylint: disable=no-member
| [
6738,
3005,
78,
13,
7295,
13,
13645,
1330,
14835,
78,
198,
198,
9945,
796,
14835,
78,
13,
9945,
198,
198,
2,
279,
2645,
600,
25,
15560,
28,
3919,
12,
19522,
628,
628,
628,
628,
628
] | 2.457143 | 35 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author : Jinzhong Xu
# @Contact : jinzhongxu@csu.ac.cn
# @Time : 10/12/2020 3:56 PM
# @File : parse_arguments.py
# @Software: PyCharm
import os
from optparse import OptionParser
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
201,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
201,
198,
2,
2488,
13838,
220,
1058,
17297,
23548,
506,
33591,
201,
198,
2,
2488,
17829,
1058,
474,
259,
23548,
506,
... | 2.185841 | 113 |
import math
first_num = Integer(10)
print(first_num.value)
second_num = Integer.from_roman("IV")
print(second_num.value)
print(Integer.from_float("2.6"))
print(Integer.from_string(2.6))
| [
11748,
10688,
628,
198,
198,
11085,
62,
22510,
796,
34142,
7,
940,
8,
198,
4798,
7,
11085,
62,
22510,
13,
8367,
8,
198,
198,
12227,
62,
22510,
796,
34142,
13,
6738,
62,
47119,
7203,
3824,
4943,
198,
4798,
7,
12227,
62,
22510,
13,
... | 2.616438 | 73 |
""" Low level tests for the InvenTree API """
from rest_framework.test import APITestCase
from rest_framework import status
from django.urls import reverse
from django.contrib.auth import get_user_model
class APITests(APITestCase):
""" Tests for the InvenTree API """
fixtures = [
'location',
... | [
37811,
7754,
1241,
5254,
329,
262,
554,
574,
27660,
7824,
37227,
198,
198,
6738,
1334,
62,
30604,
13,
9288,
1330,
3486,
2043,
395,
20448,
198,
6738,
1334,
62,
30604,
1330,
3722,
198,
198,
6738,
42625,
14208,
13,
6371,
82,
1330,
9575,
... | 2.552097 | 739 |
from unittest import TestCase
from girepo.formatter import beautify_text
| [
6738,
555,
715,
395,
1330,
6208,
20448,
198,
198,
6738,
308,
557,
7501,
13,
687,
1436,
1330,
3566,
1958,
62,
5239,
628
] | 3.409091 | 22 |
c = float(input('Digite a temperatura para ser convertida: '))
f = ((9*c)/5)+32
print('A temperatura de {}ºC, é igual a {}ºF!'.format(c, f))
| [
66,
796,
12178,
7,
15414,
10786,
19511,
578,
257,
4124,
2541,
64,
31215,
1055,
10385,
3755,
25,
705,
4008,
201,
198,
69,
796,
14808,
24,
9,
66,
20679,
20,
47762,
2624,
201,
198,
4798,
10786,
32,
4124,
2541,
64,
390,
23884,
36165,
34... | 2.31746 | 63 |
import math
import os
from random import *
import data_loader
import model_s2i
import util
import flags
import errno
import json
import numpy as np
import tensorflow as tf
from seqeval.metrics import accuracy_score
from seqeval.metrics import f1_score
from seqeval.metrics import precision_score
from seqeval.metrics im... | [
11748,
10688,
198,
11748,
28686,
198,
6738,
4738,
1330,
1635,
198,
198,
11748,
1366,
62,
29356,
198,
11748,
2746,
62,
82,
17,
72,
198,
11748,
7736,
198,
11748,
9701,
198,
11748,
11454,
3919,
198,
11748,
33918,
198,
11748,
299,
32152,
35... | 2.158271 | 7,266 |
import os
import random
import torch
import pandas as pd
import torchvision.transforms.functional as T_F
from torch.utils.data import Dataset
from PIL import Image
class BehaviorCloneDataset(Dataset):
"""
Behavioral cloning dataset.
I referred to https://pytorch.org/tutorials/beginner/data_loading_tutoria... | [
11748,
28686,
198,
11748,
4738,
198,
11748,
28034,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
28034,
10178,
13,
7645,
23914,
13,
45124,
355,
309,
62,
37,
198,
6738,
28034,
13,
26791,
13,
7890,
1330,
16092,
292,
316,
198,
6738,
... | 2.871795 | 351 |
# Generated by Django 1.11.14 on 2018-08-22 09:57
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
352,
13,
1157,
13,
1415,
319,
2864,
12,
2919,
12,
1828,
7769,
25,
3553,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.90625 | 32 |
import struct
import array
def mac2str(mac):
"""Converts mac address to string .
Args:
mac: 6 bytes mac address
Returns:
readable string
"""
return '%02x:%02x:%02x:%02x:%02x:%02x'%tuple(int(x) for x in struct.unpack('BBBBBB', mac))
def str2mac... | [
11748,
2878,
198,
11748,
7177,
198,
198,
4299,
8352,
17,
2536,
7,
20285,
2599,
198,
220,
220,
220,
37227,
3103,
24040,
8352,
2209,
284,
4731,
764,
198,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
943,
14542,
25,
198,
220,... | 2.01711 | 526 |
#!/usr/bin/env python
#coding=utf-8
"""
moveit_ik_demo.py - Version 0.1 2014-01-14
Use inverse kinemtatics to move the end effector to a specified pose
Created for the Pi Robot Project: http://www.pirobot.org
Copyleft (c) 2014 Patrick Goebel. All lefts reserved.
This program is free software;... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
66,
7656,
28,
40477,
12,
23,
198,
37811,
198,
220,
220,
220,
1445,
270,
62,
1134,
62,
9536,
78,
13,
9078,
532,
10628,
657,
13,
16,
1946,
12,
486,
12,
1415,
198,
220,
220,
220,... | 2.893216 | 796 |
"""
OpenNEM primary schema adapted to support multiple energy sources
Currently supported:
- NEM
- WEM
"""
from decimal import Decimal
from typing import Optional
from dictalchemy import DictableModel
from geoalchemy2 import Geometry
from shapely import wkb
from sqlalchemy import (
JSON,
Boo... | [
37811,
198,
220,
220,
220,
4946,
45,
3620,
4165,
32815,
16573,
284,
1104,
3294,
2568,
4237,
628,
220,
220,
220,
16888,
4855,
25,
628,
220,
220,
220,
532,
399,
3620,
198,
220,
220,
220,
532,
370,
3620,
198,
37811,
198,
198,
6738,
324... | 2.449153 | 1,062 |
name = 'data_service'
| [
3672,
796,
705,
7890,
62,
15271,
6,
198
] | 2.75 | 8 |
# -*- coding: UTF-8 -*-
# This file is forked from Piracast (July 2014): https://github.com/codemonkeyricky/piracast
#
import re
import time
from util import get_stdout
cmd_killall_wpa_spplicant = 'killall wpa_supplicant'
cmd_killall_hostapd = 'killall hostapd'
cmd_iwlist_wlan0_scan = 'iwlist wl... | [
2,
532,
9,
12,
19617,
25,
41002,
12,
23,
532,
9,
12,
198,
198,
2,
220,
220,
220,
220,
770,
2393,
318,
329,
9091,
422,
10334,
330,
459,
357,
16157,
1946,
2599,
3740,
1378,
12567,
13,
785,
14,
19815,
7966,
365,
2417,
17479,
14,
40... | 2.830357 | 224 |
from pyramid.response import Response
from pyramid.view import view_config
# from ..sample_data import MOCK_DATA
from sqlalchemy.exc import DBAPIError, IntegrityError
from pyramid.httpexceptions import HTTPFound, HTTPNotFound, HTTPUnauthorized, HTTPBadRequest
from pyramid.security import NO_PERMISSION_REQUIRED, remembe... | [
6738,
27944,
13,
26209,
1330,
18261,
198,
6738,
27944,
13,
1177,
1330,
1570,
62,
11250,
198,
2,
422,
11485,
39873,
62,
7890,
1330,
337,
11290,
62,
26947,
198,
6738,
44161,
282,
26599,
13,
41194,
1330,
20137,
17614,
12331,
11,
39348,
123... | 3.515152 | 165 |
from typing import Union, Sized
import numpy as np
import torch
from torch.utils.data import Sampler
from utils.command_line_logger import CommandLineLogger
class InfiniteSampler(Sampler):
"""
InfiniteSampler Class:
Sampler for torch.utils.data.DataLoader that loops over the dataset indefinitely, shuffl... | [
6738,
19720,
1330,
4479,
11,
311,
1143,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28034,
198,
6738,
28034,
13,
26791,
13,
7890,
1330,
3409,
20053,
198,
198,
6738,
3384,
4487,
13,
21812,
62,
1370,
62,
6404,
1362,
1330,
9455,
... | 2.535311 | 708 |
import abc
import importlib
import json
import os
import sys
from typing import Union, Callable, Any
from primehub.utils import group_required, create_logger, PrimeHubException
from primehub.utils.core import CommandContainer
from primehub.utils.decorators import cmd # noqa: F401
from primehub.utils.display import Di... | [
11748,
450,
66,
198,
11748,
1330,
8019,
198,
11748,
33918,
198,
11748,
28686,
198,
11748,
25064,
198,
6738,
19720,
1330,
4479,
11,
4889,
540,
11,
4377,
198,
198,
6738,
6994,
40140,
13,
26791,
1330,
1448,
62,
35827,
11,
2251,
62,
6404,
... | 2.428041 | 1,077 |
"""
The protocol for the werewolf game
"""
import os
import socket
import sys
from .api import ChunckedData, ReceiveThread, _recv, TimeLock, KillableThread, ReadInput
| [
37811,
198,
464,
8435,
329,
262,
547,
18829,
983,
198,
37811,
198,
198,
11748,
28686,
198,
11748,
17802,
198,
11748,
25064,
198,
6738,
764,
15042,
1330,
40958,
694,
276,
6601,
11,
797,
15164,
16818,
11,
4808,
8344,
85,
11,
3862,
25392,
... | 3.428571 | 49 |
# -*- coding: utf-8 -*-
"""Main module."""
import json
import logging
# this only works with post-19.7.1 gunicorn to pull in commit 610596c9
# which logs separate format and args
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
37811,
13383,
8265,
526,
15931,
198,
11748,
33918,
198,
11748,
18931,
628,
198,
2,
428,
691,
2499,
351,
1281,
12,
1129,
13,
22,
13,
16,
2485,
291,
1211,
284,
2834... | 3.033333 | 60 |
from rest_framework_extensions.routers import NestedRegistryItem
from posthog.api.routing import DefaultRouterPlusPlus
from .api import hooks, license
| [
6738,
1334,
62,
30604,
62,
2302,
5736,
13,
472,
1010,
1330,
399,
7287,
8081,
4592,
7449,
198,
198,
6738,
1281,
31897,
13,
15042,
13,
81,
13660,
1330,
15161,
49,
39605,
17860,
17860,
198,
198,
6738,
764,
15042,
1330,
26569,
11,
5964,
6... | 3.666667 | 42 |
# -*- coding: utf-8 -*-
# Copyright 2020 Green Valley Belgium NV
#
# 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 appl... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
15069,
12131,
3469,
6916,
15664,
23973,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
... | 3.696532 | 346 |
from __future__ import unicode_literals
import frappe | [
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
11748,
5306,
27768
] | 3.785714 | 14 |
# coding=utf-8
import requests
import getpass
from requests.auth import HTTPBasicAuth
import xml.etree.ElementTree as ET
API_URL = "Place vCD URL Here" #Cloud API URL ending in /api/
EDGE_NAME = 'Place Edge Name Here' #Edge Gateway Name
SYSLOG_IP = 'Place Syslog IP Here' #IP of syslog server
USERNAME = 'Place Usernam... | [
2,
19617,
28,
40477,
12,
23,
198,
11748,
7007,
198,
11748,
651,
6603,
198,
6738,
7007,
13,
18439,
1330,
14626,
26416,
30515,
198,
11748,
35555,
13,
316,
631,
13,
20180,
27660,
355,
12152,
628,
198,
17614,
62,
21886,
796,
366,
27271,
4... | 3.04698 | 149 |
# Installed python3-praw, geany and ffmpeg from debian
# and others from pip
# Made a Reddit account, set up an application and added its client id and secret
# made a white noise video named noise.mkv and downloaded 3 pieces of music as music{0-1}.mp3
import praw
from PIL import Image, ImageDraw, ImageFont
import url... | [
2,
2262,
4262,
21015,
18,
12,
79,
1831,
11,
4903,
1092,
290,
31246,
43913,
422,
50001,
198,
2,
290,
1854,
422,
7347,
198,
2,
14446,
257,
10750,
1848,
11,
900,
510,
281,
3586,
290,
2087,
663,
5456,
4686,
290,
3200,
198,
2,
925,
257... | 2.128051 | 2,499 |
# -*- coding: utf8 -*-
"""
Services
"""
from __future__ import absolute_import, division, print_function
from .base_service import BaseService
from .shot_detector_service import ShotDetectorPlotService
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
23,
532,
9,
12,
198,
198,
37811,
198,
220,
220,
220,
6168,
220,
198,
37811,
198,
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
11,
7297,
11,
3601,
62,
8818,
198,
198,
6738,
764,
8692,
6... | 3.230769 | 65 |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""
@version: 0.1
@author: pjgao
@city: Nanjing
@file: __init__.py.py
@time: 2018/12/10 16:22
"""
__version__ = '0.1.1' | [
2,
0,
1220,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
31,
9641,
25,
657,
13,
16,
198,
31,
9800,
25,
220,
279,
73,
4908,
78,
198,
31,
19205,
25,
18008,
49... | 1.912088 | 91 |
# -*- coding: utf-8 -*-
from .jsonrpc import validate_jsonrpc_request
from .jussi import finalize_jussi_response
from .jussi import convert_to_jussi_request
from .limits import check_limits
from .caching import get_response
from .caching import cache_response
from .update_block_num import update_last_irreversible_bloc... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
6738,
764,
17752,
81,
14751,
1330,
26571,
62,
17752,
81,
14751,
62,
25927,
198,
6738,
764,
73,
1046,
72,
1330,
2457,
1096,
62,
73,
1046,
72,
62,
26209,
198,
6738,... | 3.084906 | 106 |
# ---
# jupyter:
# jupytext:
# cell_metadata_filter: all
# notebook_metadata_filter: all,-language_info
# text_representation:
# extension: .py
# format_name: percent
# format_version: '1.2'
# jupytext_version: 1.2.1
# kernelspec:
# display_name: Python 3
# language: pyth... | [
2,
11420,
198,
2,
474,
929,
88,
353,
25,
198,
2,
220,
220,
474,
929,
88,
5239,
25,
198,
2,
220,
220,
220,
220,
2685,
62,
38993,
62,
24455,
25,
477,
198,
2,
220,
220,
220,
220,
20922,
62,
38993,
62,
24455,
25,
477,
12095,
16129... | 3.748707 | 1,353 |
#!/usr/bin/env python
import glob
import os
import sys
from bokeh.io import output_file
from bokeh.models import SingleIntervalTicker
from bokeh.plotting import figure, show
if __name__ == '__main__':
if len(sys.argv) < 4:
print(f'USAGE: {sys.argv[0]} <owner> <project> <stack> <run> [label ...]')
... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
15095,
198,
11748,
28686,
198,
11748,
25064,
198,
198,
6738,
1489,
365,
71,
13,
952,
1330,
5072,
62,
7753,
198,
6738,
1489,
365,
71,
13,
27530,
1330,
14206,
9492,
2100,
51,... | 1.971631 | 282 |
CAMERA_MODEL_OPENCV_PINHOLE: str = "opencv_pinhole"
CAMERA_MODEL_OPENCV_FISHEYE: str = "opencv_fisheye"
CAMERA_MODEL_PD_FISHEYE: str = "pd_fisheye"
| [
34,
2390,
46461,
62,
33365,
3698,
62,
3185,
24181,
53,
62,
44032,
32298,
2538,
25,
965,
796,
366,
9654,
33967,
62,
11635,
13207,
1,
198,
34,
2390,
46461,
62,
33365,
3698,
62,
3185,
24181,
53,
62,
37,
1797,
13909,
48743,
25,
965,
796... | 1.897436 | 78 |
import unittest
from collections import Counter
import flask
import json
from panoptes_aggregation.reducers.question_reducer import process_data, question_reducer
from panoptes_aggregation.reducers.test_utils import extract_in_data
extracted_data = [
{'a': 1, 'b': 1},
{'a': 1},
{'b': 1, 'c': 1},
{'b': ... | [
11748,
555,
715,
395,
198,
6738,
17268,
1330,
15034,
198,
11748,
42903,
198,
11748,
33918,
198,
6738,
3425,
404,
4879,
62,
9460,
43068,
13,
445,
1229,
364,
13,
25652,
62,
445,
48915,
1330,
1429,
62,
7890,
11,
1808,
62,
445,
48915,
198... | 2.073171 | 369 |
# 3. Принтер дат. Напишите программу, которая считывает от пользователя
# строковое значение, содержащее дату в формате дд/мм/гггг. Она должна
# напечатать дату в формате 12 марта 2018 г.
main()
| [
2,
513,
13,
12466,
253,
21169,
18849,
22177,
20375,
16843,
21169,
12466,
112,
16142,
20375,
13,
12466,
251,
16142,
140,
123,
18849,
141,
230,
18849,
20375,
16843,
12466,
123,
21169,
25443,
111,
21169,
16142,
43108,
43108,
35072,
11,
12466,
... | 0.985149 | 202 |
# Port from https://github.com/zuzak/owo
"""MIT License
Original substitutions: Copyright (c) 2018 Eva (Nepeta)
JavaScript library: Copyright (c) 2019 Douglas Gardner <douglas@chippy.ch>
Python library: Copyright (c) 2019 tekofu
Permission is hereby granted, free of charge, to any person obtaining a copy... | [
2,
4347,
422,
3740,
1378,
12567,
13,
785,
14,
89,
10277,
461,
14,
322,
78,
198,
198,
37811,
36393,
13789,
198,
198,
20556,
21436,
3508,
25,
15069,
357,
66,
8,
2864,
32355,
357,
45,
538,
17167,
8,
198,
29584,
7391,
5888,
25,
220,
2... | 2.368681 | 811 |
import json
import urllib.parse
from .lib.gethttp import getHttpPage | [
11748,
33918,
198,
11748,
2956,
297,
571,
13,
29572,
198,
6738,
764,
8019,
13,
1136,
4023,
1330,
651,
43481,
9876
] | 3.4 | 20 |
import unittest
import vdebug.dbgp
import xml.etree.ElementTree as ET
| [
11748,
555,
715,
395,
198,
11748,
410,
24442,
13,
9945,
31197,
198,
11748,
35555,
13,
316,
631,
13,
20180,
27660,
355,
12152,
198
] | 3.043478 | 23 |
# coding: utf-8
# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | [
2,
19617,
25,
3384,
69,
12,
23,
198,
2,
15069,
357,
66,
8,
1584,
11,
12131,
11,
18650,
290,
14,
273,
663,
29116,
13,
220,
1439,
2489,
10395,
13,
198,
2,
770,
3788,
318,
10668,
12,
36612,
284,
345,
739,
262,
14499,
2448,
33532,
1... | 2.444292 | 2,908 |
from sg.sg_base import GatewayBaseTest
from remote.remote_util import RemoteMachineShellConnection
import time
help_string = ['This script creates an init service to run a sync_gateway instance.',
'If you want to install more than one service instance',
'create additional services with di... | [
6738,
264,
70,
13,
45213,
62,
8692,
1330,
29916,
14881,
14402,
198,
6738,
6569,
13,
47960,
62,
22602,
1330,
21520,
37573,
23248,
32048,
198,
11748,
640,
198,
198,
16794,
62,
8841,
796,
37250,
1212,
4226,
8075,
281,
2315,
2139,
284,
1057... | 2.492308 | 390 |
#!/usr/bin/env python
import argparse
import math
import os
import pathlib
import re
from rich.console import Console
from rich.progress import Progress
if __name__ == "__main__":
main()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
1822,
29572,
198,
11748,
10688,
198,
11748,
28686,
198,
11748,
3108,
8019,
198,
11748,
302,
198,
198,
6738,
5527,
13,
41947,
1330,
24371,
198,
6738,
5527,
13,
33723,
1330,
18... | 3.174603 | 63 |
from flask import Flask, render_template, request, url_for, flash, redirect
from werkzeug.exceptions import abort
app = Flask(__name__)
app.config['SECRET_KEY'] = 'mA7OumwKVZQr9ousrge1OVQxQr51WEs7'
@app.route('/')
@app.route('/info')
@app.route('/algo') | [
6738,
42903,
1330,
46947,
11,
8543,
62,
28243,
11,
2581,
11,
19016,
62,
1640,
11,
7644,
11,
18941,
198,
6738,
266,
9587,
2736,
1018,
13,
1069,
11755,
1330,
15614,
628,
198,
1324,
796,
46947,
7,
834,
3672,
834,
8,
198,
1324,
13,
1125... | 2.433962 | 106 |
from pathlib import Path
from black import format_str, FileMode
from autoflake import fix_code
from pyheck import snake
from genpy import (
FromImport,
Import,
Assign,
Suite,
Collection,
ImportAs,
Return,
For,
If,
Raise,
Statement,
)
from anchorpy.coder.accounts import _accou... | [
6738,
3108,
8019,
1330,
10644,
198,
6738,
2042,
1330,
5794,
62,
2536,
11,
9220,
19076,
198,
6738,
1960,
1659,
27180,
1330,
4259,
62,
8189,
198,
6738,
12972,
258,
694,
1330,
17522,
198,
6738,
2429,
9078,
1330,
357,
198,
220,
220,
220,
... | 2.320809 | 346 |
import numpy as np
import sys
sys.path.append('../../../tools/')
import fitting_functions
import os
import scipy.io as sio
import scipy.optimize
import tqdm
if __name__ == "__main__":
file_names = [ ('090711e_0006',), ('090811c_0002',), ('090811d_0002','090811d_0004',),
('091111a_0001', '091111a_0003')... | [
11748,
299,
32152,
355,
45941,
198,
198,
11748,
25064,
198,
17597,
13,
6978,
13,
33295,
10786,
40720,
40720,
40720,
31391,
14,
11537,
198,
11748,
15830,
62,
12543,
2733,
198,
198,
11748,
28686,
198,
198,
11748,
629,
541,
88,
13,
952,
35... | 2.081871 | 855 |
# -*- coding: utf-8 -*-
# Thanks to https://github.com/ericsun99/Shufflenet-v2-Pytorch
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
from collections import OrderedDict
from torch.nn import init
import math
__all__ = ['shufflenet_v2', 'ShuffleNetV2']
if ... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
6930,
284,
3740,
1378,
12567,
13,
785,
14,
263,
873,
403,
2079,
14,
2484,
1648,
11925,
316,
12,
85,
17,
12,
20519,
13165,
354,
198,
11748,
28034,
198,
11748,
28034,... | 2.734043 | 188 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright © 2017
#
# Distributed under terms of the MIT license.
import click
import datetime
import logging
import logging.config
import multiprocessing
import os
import sys
import uuid
from utilities import get_features_from_geojson
from utilities import get_organi... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
198,
2,
15069,
10673,
2177,
198,
2,
198,
2,
4307,
6169,
739,
2846,
286,
262,
17168,
5964,
13,
198,
198,
11748,
3... | 3.009677 | 310 |
from src.models.version_model import VersionModel
| [
6738,
12351,
13,
27530,
13,
9641,
62,
19849,
1330,
10628,
17633,
628,
628
] | 4.076923 | 13 |
width = 300
height = 450
box_size = 35
x = width / box_size
y = height / box_size
File = "/interface/kirk.gif"
| [
10394,
796,
5867,
198,
17015,
796,
18523,
198,
3524,
62,
7857,
796,
3439,
198,
87,
796,
9647,
1220,
3091,
62,
7857,
198,
88,
796,
6001,
1220,
3091,
62,
7857,
198,
8979,
796,
12813,
39994,
14,
74,
14232,
13,
27908,
1,
628
] | 2.731707 | 41 |
"""add skipped_transaction level column
Revision ID: f775fb87f5ff
Revises: be27a2794f75
Create Date: 2022-01-12 22:32:24.949547
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "f775fb87f5ff"
down_revision = "be27a2794f75"
branch_labels = None
depends_on = None
... | [
37811,
2860,
26684,
62,
7645,
2673,
1241,
5721,
198,
198,
18009,
1166,
4522,
25,
277,
34483,
21855,
5774,
69,
20,
487,
198,
18009,
2696,
25,
307,
1983,
64,
1983,
5824,
69,
2425,
198,
16447,
7536,
25,
33160,
12,
486,
12,
1065,
2534,
... | 2.596774 | 124 |
import sqlite3
sqlite3.register_adapter(Point, adapt_point)
con = sqlite3.connect(":memory:")
cur = con.cursor()
p = Point(4.0, -3.2)
cur.execute("select ?", (p,))
print(cur.fetchone()[0])
con.close()
| [
11748,
44161,
578,
18,
198,
198,
25410,
578,
18,
13,
30238,
62,
324,
3429,
7,
12727,
11,
6068,
62,
4122,
8,
198,
198,
1102,
796,
44161,
578,
18,
13,
8443,
7,
1298,
31673,
25,
4943,
198,
22019,
796,
369,
13,
66,
21471,
3419,
198,
... | 2.303371 | 89 |
# schedule 0.5.0
import schedule
import time
# 1분마다 호출
schedule.every().minutes.do(job)
while True:
schedule.run_pending()
time.sleep(1) | [
2,
7269,
657,
13,
20,
13,
15,
198,
198,
11748,
7269,
198,
11748,
640,
198,
198,
2,
352,
167,
114,
226,
167,
100,
230,
46695,
97,
220,
169,
246,
116,
168,
114,
250,
198,
15952,
5950,
13,
16833,
22446,
1084,
1769,
13,
4598,
7,
218... | 2.041667 | 72 |
import os
from dotenv import load_dotenv
from pathlib import Path
env_path = Path('.') / '.env'
load_dotenv(dotenv_path=env_path)
############################# CONNECTION TO ELASTICSEARCH LOCALHOST #############################
# username = os.environ.get('ELASTICSEARCH_USERNAME_LOCALHOST')
# password = os.environ.g... | [
11748,
28686,
198,
198,
6738,
16605,
24330,
1330,
3440,
62,
26518,
24330,
198,
6738,
3108,
8019,
1330,
10644,
198,
198,
24330,
62,
6978,
796,
10644,
10786,
2637,
8,
1220,
45302,
24330,
6,
198,
2220,
62,
26518,
24330,
7,
26518,
24330,
62... | 3.255507 | 227 |
from itertools import *
import benchbase
from benchbase import with_text, children, nochange
############################################################
# Benchmarks
############################################################
if __name__ == "__main__":
benchbase.main(BenchMark)
| [
6738,
340,
861,
10141,
1330,
1635,
198,
198,
11748,
7624,
8692,
198,
6738,
7624,
8692,
1330,
351,
62,
5239,
11,
1751,
11,
645,
3803,
198,
198,
29113,
14468,
7804,
4242,
198,
2,
25187,
14306,
198,
29113,
14468,
7804,
4242,
628,
198,
19... | 4.461538 | 65 |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from .. import _utilitie... | [
2,
19617,
28,
40477,
12,
23,
198,
2,
17202,
39410,
25,
428,
2393,
373,
7560,
416,
262,
21624,
12994,
24118,
687,
10290,
357,
27110,
5235,
8,
16984,
13,
17202,
198,
2,
17202,
2141,
407,
4370,
416,
1021,
4556,
345,
821,
1728,
345,
760... | 2.87027 | 370 |
# Copyright (C) 2017-2019 New York University,
# University at Buffalo,
# Illinois Institute of Technology.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of th... | [
2,
15069,
357,
34,
8,
2177,
12,
23344,
968,
1971,
2059,
11,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2059,
379,
14905,
11,
198,
2,
220,
220... | 2.914812 | 1,573 |
import hmac
import hashlib
import base64
import json
import re
import time
def extractAndValidateBody(
body: str,
key: str = "",
signature: str = "",
isBase64: bool = False,
with_validate: bool = True,
) -> dict:
"""
Basic parsing of the body, including optional validation ... | [
11748,
289,
20285,
201,
198,
11748,
12234,
8019,
201,
198,
11748,
2779,
2414,
201,
198,
11748,
33918,
201,
198,
11748,
302,
201,
198,
11748,
640,
201,
198,
201,
198,
201,
198,
4299,
7925,
1870,
7762,
20540,
25842,
7,
201,
198,
220,
22... | 2.217033 | 1,456 |
from airflow import version
print(version.version) | [
6738,
45771,
1330,
2196,
198,
4798,
7,
9641,
13,
9641,
8
] | 4.545455 | 11 |
from jetconf.data import BaseDatastore
| [
6738,
12644,
10414,
13,
7890,
1330,
7308,
27354,
459,
382,
628
] | 3.636364 | 11 |
# -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2016 OSGeo
#
# 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 3 ... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
29113,
29113,
7804,
2,
198,
2,
198,
2,
15069,
357,
34,
8,
1584,
7294,
10082,
78,
198,
2,
198,
2,
770,
1430,
318,
1479,
3788,
25,
345,
460,
17678,
4163,
340,
290,
1... | 4.01581 | 253 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Login middleware tests"""
# System imports
import logging
from mock import MagicMock, patch
from datetime import datetime, timedelta
from django.http import HttpRequest
from django.conf import settings
from django.contrib import auth
from django.urls import reverse
# P... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
47790,
3504,
1574,
5254,
37811,
198,
198,
2,
4482,
17944,
198,
11748,
18931,
198,
6738,
15290,
1330,
6139,
44,
7... | 2.682432 | 1,480 |
from sklearn.svm import SVR
from data_science_layer.machine_learning.base_regressor import BaseRegressor
| [
6738,
1341,
35720,
13,
82,
14761,
1330,
311,
13024,
198,
6738,
1366,
62,
16801,
62,
29289,
13,
30243,
62,
40684,
13,
8692,
62,
2301,
44292,
1330,
7308,
8081,
44292,
628,
198
] | 3.451613 | 31 |
ips = [
'10.0.0.5',
'10.5.3.1',
'192.168.11.10',
'2.2.2.2',
'100.0.0.1',
'20.3.2.4'
]
print(sort_ips(ips))
| [
198,
220,
220,
220,
220,
220,
220,
220,
220,
198,
2419,
796,
685,
198,
197,
6,
940,
13,
15,
13,
15,
13,
20,
3256,
198,
197,
6,
940,
13,
20,
13,
18,
13,
16,
3256,
198,
197,
6,
17477,
13,
14656,
13,
1157,
13,
940,
3256,
198,
... | 1.351064 | 94 |
# -*- coding: utf-8 -*-
"""
glusternodestate.py
:copyright: (c) 2013 by Aravinda VK
:license: BSD, GPL v2, see LICENSE for more details.
"""
import argparse
import errno
import os
from functools import wraps
import sys
import requests
from glusterfstools import volumes
import nodestatedb as _db
from conf... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
220,
220,
220,
1278,
436,
1142,
375,
44146,
13,
9078,
628,
220,
220,
220,
1058,
22163,
4766,
25,
357,
66,
8,
2211,
416,
317,
4108,
22261,
45917,
198,
220,
... | 2.54386 | 285 |
print(decrypt([5, 7, 1, 4], 3))
print(decrypt([1, 2, 3, 4], 0))
print(decrypt([2, 4, 9, 3], -2))
| [
198,
198,
4798,
7,
12501,
6012,
26933,
20,
11,
767,
11,
352,
11,
604,
4357,
513,
4008,
198,
4798,
7,
12501,
6012,
26933,
16,
11,
362,
11,
513,
11,
604,
4357,
657,
4008,
198,
4798,
7,
12501,
6012,
26933,
17,
11,
604,
11,
860,
11,... | 1.941176 | 51 |
import requests
from bs4 import BeautifulSoup
import csv
cont = 0
i = 0
j = 0
source = requests.get('https://lol.gamepedia.com/LPL/2021_Season/Spring_Season/Scoreboards/Week_10').text
soup = BeautifulSoup(source, 'html.parser')
times = soup.find_all('span', "teamname")
kills = soup.find_all('div', "sb-footer-item s... | [
11748,
7007,
198,
6738,
275,
82,
19,
1330,
23762,
50,
10486,
198,
11748,
269,
21370,
198,
198,
3642,
796,
657,
198,
72,
796,
657,
198,
73,
796,
657,
628,
198,
10459,
796,
7007,
13,
1136,
10786,
5450,
1378,
47288,
13,
6057,
50235,
13... | 2.223906 | 594 |
#!/usr/bin/env python
#
# ryw_benchmark.py
#
# This source file is part of the FoundationDB open source project
#
# Copyright 2013-2018 Apple Inc. and the FoundationDB project authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
#... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
198,
2,
374,
88,
86,
62,
26968,
4102,
13,
9078,
198,
2,
198,
2,
770,
2723,
2393,
318,
636,
286,
262,
5693,
11012,
1280,
2723,
1628,
198,
2,
198,
2,
15069,
2211,
12,
7908,
4196... | 2.645455 | 660 |
#!/bin/env python
import os,sys
#Root of spify src directory
SPIFY_SRC_DIR = os.path.join(os.getcwd(),'..')
#Name your parser
spify_parser_name = "ExampleIFP"
spify_parser_params = []
#Specify parameters
spify_parser_params.append(
{
'name':'boolOption',
'type':'bool',
'shortDesc':'My Boolean Option',
... | [
2,
48443,
8800,
14,
24330,
21015,
198,
198,
11748,
28686,
11,
17597,
198,
198,
2,
30016,
286,
599,
1958,
12351,
8619,
198,
4303,
5064,
56,
62,
50,
7397,
62,
34720,
796,
28686,
13,
6978,
13,
22179,
7,
418,
13,
1136,
66,
16993,
22784,... | 2.343802 | 1,210 |
import streamlit as st
| [
11748,
4269,
18250,
355,
336,
201
] | 3.833333 | 6 |
import requests
from bs4 import BeautifulSoup
import mysql.connector
conn = mysql.connector.connect(host="localhost", user="root", password="root", database="pokedex", port=8889)
cursor = conn.cursor(buffered=True)
# connexion et récupération des données / parse du site
#response = requests.get("https://pokemondb.n... | [
11748,
7007,
198,
198,
6738,
275,
82,
19,
1330,
23762,
50,
10486,
198,
198,
11748,
48761,
13,
8443,
273,
198,
37043,
796,
48761,
13,
8443,
273,
13,
8443,
7,
4774,
2625,
36750,
1600,
2836,
2625,
15763,
1600,
9206,
2625,
15763,
1600,
68... | 2.052817 | 852 |
import subprocess
import arcpy
from arcpy import env
import sqlite3
import xml.etree.ElementTree
import os
import json
import zipfile
from arcpy import mapping
import os
from xml.dom.minidom import parse
from datetime import datetime
import time
import copy
import shutil
import types
import ConfigParser
import copy
imp... | [
11748,
850,
14681,
198,
11748,
10389,
9078,
198,
6738,
10389,
9078,
1330,
17365,
198,
11748,
44161,
578,
18,
198,
11748,
35555,
13,
316,
631,
13,
20180,
27660,
198,
11748,
28686,
198,
11748,
33918,
198,
11748,
19974,
7753,
198,
6738,
1038... | 2.703756 | 1,411 |
"Testcases for text messages"
from .. import Case
from bobot.Rule import Rule
from bobot.Response import Text
responseAsTextDict = Case.Case([
Rule({
'match': 'text',
'response': {
'text': 'Waiting for text'
}
})
], [
{
'expected': [Case.Expectation('Waiting fo... | [
1,
14402,
33964,
329,
2420,
6218,
1,
628,
198,
6738,
11485,
1330,
8913,
198,
6738,
29202,
313,
13,
31929,
1330,
14330,
198,
6738,
29202,
313,
13,
31077,
1330,
8255,
198,
198,
26209,
1722,
8206,
35,
713,
796,
8913,
13,
20448,
26933,
19... | 2.181063 | 602 |
#!/usr/bin/env python
# Copyright (c) 2019 VMware, Inc. All Rights Reserved.
# SPDX-License-Identifier: BSD-2 License
# The full license information can be found in LICENSE.txt
# in the root directory of this project.
import uuid
from sqlalchemy.orm import joinedload
from sqlalchemy.sql import func
from axon.db.sql.... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
15069,
357,
66,
8,
13130,
37754,
11,
3457,
13,
1439,
6923,
33876,
13,
198,
2,
30628,
55,
12,
34156,
12,
33234,
7483,
25,
347,
10305,
12,
17,
13789,
198,
2,
383,
1336,
5964,
1321... | 3.296 | 125 |
from py3dbp import Packer, Bin, Item
packer = Packer()
packer.add_bin(Bin('small', 300,300,200,5))
packer.add_bin(Bin('big', 500,600,400,8))
packer.add_item(Item('Producto 1',45,60,70,0.5))
packer.add_item(Item('Producto 2',30,50,30,0.7))
packer.add_item(Item('Producto 3',20,70,70,1))
packer.add_item(Item('Producto ... | [
6738,
12972,
18,
9945,
79,
1330,
6400,
263,
11,
20828,
11,
9097,
198,
198,
8002,
263,
796,
6400,
263,
3419,
198,
198,
8002,
263,
13,
2860,
62,
8800,
7,
33,
259,
10786,
17470,
3256,
5867,
11,
6200,
11,
2167,
11,
20,
4008,
198,
8002... | 2.438746 | 351 |
# 🚨 Don't change the code below 👇
print("Welcome to the Love Calculator!")
name1 = input("What is your name? \n")
name2 = input("What is their name? \n")
# 🚨 Don't change the code above 👆
#Write your code below this line 👇
names_concat = name1.lower() + name2.lower()
names_true_total = names_concat.count('t') +... | [
2,
12520,
248,
101,
2094,
470,
1487,
262,
2438,
2174,
50169,
229,
198,
4798,
7203,
14618,
284,
262,
5896,
43597,
2474,
8,
198,
3672,
16,
796,
5128,
7203,
2061,
318,
534,
1438,
30,
3467,
77,
4943,
198,
3672,
17,
796,
5128,
7203,
2061... | 2.790698 | 301 |
import pandas as pd
import os
import pymorphy2
from sklearn.preprocessing import MinMaxScaler
from sklearn.feature_extraction.text import CountVectorizer, TfidfVectorizer
import numpy as np
import pickle
PATH = 'models/'
with open(os.path.join(PATH, 'tfidf.pkl'), 'rb') as f:
tfidf = pickle.load(f)
tim... | [
11748,
19798,
292,
355,
279,
67,
201,
198,
11748,
28686,
201,
198,
11748,
12972,
4491,
6883,
17,
201,
198,
6738,
1341,
35720,
13,
3866,
36948,
1330,
1855,
11518,
3351,
36213,
201,
198,
6738,
1341,
35720,
13,
30053,
62,
2302,
7861,
13,
... | 2.179487 | 273 |
import rebound
import unittest
import math
import numpy as np
if __name__ == "__main__":
unittest.main()
| [
11748,
23623,
198,
11748,
555,
715,
395,
198,
11748,
10688,
198,
11748,
299,
32152,
355,
45941,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
555,
715,
395,
13,
12417,
3419,
198
] | 2.820513 | 39 |
from typing import Dict, Optional
from datasets import datasets
import torch
from torch.utils.data import DataLoader
from catalyst.contrib import nn
from catalyst.contrib.models.cv.encoders import ResnetEncoder
from catalyst.data.dataset.self_supervised import SelfSupervisedDatasetWrapper
def add_arguments(parser) ... | [
6738,
19720,
1330,
360,
713,
11,
32233,
198,
198,
6738,
40522,
1330,
40522,
198,
11748,
28034,
198,
6738,
28034,
13,
26791,
13,
7890,
1330,
6060,
17401,
198,
198,
6738,
31357,
13,
3642,
822,
1330,
299,
77,
198,
6738,
31357,
13,
3642,
... | 2.59185 | 1,595 |
import spotipy
import sys
import musicbrainzngs
from spotipy.oauth2 import SpotifyClientCredentials
from requests import get, exceptions
from json import loads
from dateparser import parse
from pandas import DataFrame, read_excel
from bs4 import BeautifulSoup
from time import sleep
from datetime import datetime, timede... | [
11748,
4136,
541,
88,
198,
11748,
25064,
198,
11748,
2647,
27825,
89,
782,
82,
198,
6738,
4136,
541,
88,
13,
12162,
1071,
17,
1330,
26778,
11792,
34,
445,
14817,
198,
6738,
7007,
1330,
651,
11,
13269,
198,
6738,
33918,
1330,
15989,
19... | 2.375979 | 383 |
"""Tests for the pushbullet component."""
| [
37811,
51,
3558,
329,
262,
4574,
15065,
1616,
7515,
526,
15931,
198
] | 3.5 | 12 |
# -*- coding: utf-8 -*-
"""Tests for processing.querying module."""
from os.path import expanduser
from nose.tools import assert_equal, assert_true
from string import Template
from sosia.establishing import connect_database
from sosia.processing import base_query, count_citations, create_queries,\
query_pubs_by_... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
51,
3558,
329,
7587,
13,
10819,
1112,
8265,
526,
15931,
198,
198,
6738,
28686,
13,
6978,
1330,
4292,
7220,
198,
198,
6738,
9686,
13,
31391,
1330,
6818,
62,
40496,... | 3.01227 | 163 |
# swgpy
from swgpy import app, utility, weather
from swgpy.weather import WeatherEvent, WeatherSequence
# modules
import random
service_mgr = kernel.serviceManager()
weather_svc = service_mgr.weatherService()
#This script is called every 30 minutes.
#Weather duration is now set in minutes: weather_event(duration(mins... | [
2,
1509,
70,
9078,
198,
6738,
1509,
70,
9078,
1330,
598,
11,
10361,
11,
6193,
198,
6738,
1509,
70,
9078,
13,
23563,
1330,
15615,
9237,
11,
15615,
44015,
594,
198,
198,
2,
13103,
198,
11748,
4738,
198,
15271,
62,
76,
2164,
796,
9720,... | 2.828313 | 996 |
#!/usr/bin/env python
# blou
# Raspberry Car v1.xx
# MIT Licence - Tom Wersinger https://github.com/tomplays/raspberry-car/
import RPi.GPIO as io
import time
# pins attribution
#motor A
in3_pin = 4
in4_pin = 17
#motor B
in1_pin = 27
in2_pin = 22
#Blinking orange leds
o_pin = 24
or_pin = 23
# always stop motors a... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
698,
280,
198,
2,
24244,
1879,
410,
16,
13,
5324,
198,
2,
17168,
10483,
594,
532,
4186,
370,
364,
3889,
3740,
1378,
12567,
13,
785,
14,
83,
6316,
592,
14,
81,
17653,
12,
7718,
... | 2.187311 | 662 |
from drf_writable_nested import WritableNestedModelSerializer, UniqueFieldsMixin
from rest_framework import serializers
from api_recipes.models import Recipe, Ingredient, Food, Step, User
class FoodSerializer(UniqueFieldsMixin, serializers.ModelSerializer):
"""Food serializer."""
class StepSerializer(UniqueFie... | [
6738,
1553,
69,
62,
8933,
540,
62,
77,
7287,
1330,
12257,
540,
45,
7287,
17633,
32634,
7509,
11,
30015,
15878,
82,
35608,
259,
198,
6738,
1334,
62,
30604,
1330,
11389,
11341,
198,
198,
6738,
40391,
62,
8344,
18636,
13,
27530,
1330,
26... | 3.315789 | 247 |
# coding=utf8
# Copyright 2018 JDCLOUD.COM
#
# 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 ... | [
2,
19617,
28,
40477,
23,
198,
198,
2,
15069,
2864,
28591,
5097,
2606,
35,
13,
9858,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
... | 3.73743 | 179 |
from django.contrib import admin
from django.utils.translation import ugettext_lazy as _
from ella.core.admin import PublishableAdmin, ListingInlineAdmin, RelatedInlineAdmin
from ella.articles.models import Article
admin.site.register(Article, ArticleAdmin)
| [
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
6738,
42625,
14208,
13,
26791,
13,
41519,
1330,
334,
1136,
5239,
62,
75,
12582,
355,
4808,
198,
198,
6738,
304,
8466,
13,
7295,
13,
28482,
1330,
8525,
1836,
540,
46787,
11,
7343,
27... | 3.493333 | 75 |