content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
import pytest
from PyQt5 import QtWidgets
from pymodaq.daq_utils.plotting.viewerND.viewerND_main import ViewerND
@pytest.fixture
| [
11748,
12972,
9288,
198,
198,
6738,
9485,
48,
83,
20,
1330,
33734,
54,
312,
11407,
198,
6738,
12972,
4666,
30188,
13,
48539,
62,
26791,
13,
29487,
889,
13,
1177,
263,
8575,
13,
1177,
263,
8575,
62,
12417,
1330,
3582,
263,
8575,
628,
... | 2.64 | 50 |
import os
import shutil
from .file import create_config_file, load_config_file, load_css_file, \
load_data_file, load_js_file, load_template_file
from .util import generate_id
| [
11748,
28686,
198,
11748,
4423,
346,
198,
6738,
764,
7753,
1330,
2251,
62,
11250,
62,
7753,
11,
3440,
62,
11250,
62,
7753,
11,
3440,
62,
25471,
62,
7753,
11,
3467,
198,
220,
220,
220,
3440,
62,
7890,
62,
7753,
11,
3440,
62,
8457,
... | 2.897059 | 68 |
import numpy as np
import cv2
import cv2.cv as cv
import facetracker
import traceback
from SimpleCV import *
from video import create_capture
from common import clock, draw_str
import pdb
help_message = '''
USAGE: facedetect.py [--cascade <cascade_fn>] [--nested-cascade <cascade_fn>] [<video_source>]
'''
... | [
11748,
299,
32152,
355,
45941,
201,
198,
11748,
269,
85,
17,
201,
198,
11748,
269,
85,
17,
13,
33967,
355,
269,
85,
201,
198,
11748,
1777,
21879,
10735,
201,
198,
11748,
12854,
1891,
201,
198,
6738,
17427,
33538,
1330,
1635,
201,
198,... | 1.788353 | 2,301 |
#!/usr/bin/env python
# coding: utf-8
# StimulationDevice class demonstration
# =====================================
#
# Assumptions:
# - This is intended to function as a generic device class for multiprimary stimulators.
# - devices are additive
# - calibration is stationary
# - expect values as W/m2/nm
# In[1]:... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
19617,
25,
3384,
69,
12,
23,
198,
198,
2,
41669,
1741,
24728,
1398,
13646,
198,
2,
46111,
1421,
198,
2,
220,
198,
2,
2195,
388,
8544,
25,
198,
2,
532,
770,
318,
5292,
284,
216... | 2.911524 | 1,345 |
"""
Author: Andres Andreu < andres at neurofuzzsecurity dot com >
Company: neuroFuzz, LLC
Date: 12/31/2015
Last Modified: 06/17/2016
functions to facilitate TCP port scanning via raw sockets
BSD 3-Clause License
Copyright (c) 2015-2016, Andres Andreu, neuroFuzz LLC
All rights ... | [
37811,
198,
220,
220,
220,
6434,
25,
843,
411,
10948,
84,
1279,
290,
411,
379,
7669,
69,
4715,
12961,
16605,
401,
1875,
198,
220,
220,
220,
5834,
25,
7669,
37,
4715,
11,
11419,
198,
220,
220,
220,
7536,
25,
1105,
14,
3132,
14,
462... | 2.925553 | 994 |
from copy import deepcopy
import immutables
import pytest
from skepticoin.humans import computer
from skepticoin.params import SASHIMI_PER_COIN, MAX_COINBASE_RANDOM_DATA_SIZE
from skepticoin.coinstate import CoinState
from skepticoin.consensus import (
construct_minable_summary_genesis,
# construct_minable_sum... | [
6738,
4866,
1330,
2769,
30073,
198,
11748,
2296,
315,
2977,
198,
11748,
12972,
9288,
198,
198,
6738,
11200,
3713,
259,
13,
40205,
1330,
3644,
198,
6738,
11200,
3713,
259,
13,
37266,
1330,
311,
11211,
3955,
40,
62,
18973,
62,
8220,
1268,... | 2.73461 | 731 |
#!/usr/bin/env python
from pygame import midi
import time
import os
"""
this code is for reading a generic midi keyboard
references I used to make this code:
https://stackoverflow.com/questions/1554896/getting-input-from-midi-devices-live-python
https://www.pygame.org/docs/ref/midi.html
https://stackoverflow.com/que... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
6738,
12972,
6057,
1330,
3095,
72,
198,
11748,
640,
198,
11748,
28686,
628,
198,
37811,
198,
5661,
2438,
318,
329,
3555,
257,
14276,
3095,
72,
10586,
198,
198,
5420,
4972,
314,
973,
28... | 2.713043 | 460 |
import sys
import os
import shutil
is_exe_file = getattr(sys, 'frozen', False)
if is_exe_file:
# If the application is run as a bundle, the pyInstaller bootloader
# extends the sys module by a flag frozen=True and sets the app
# path into variable _MEIPASS'.
APPLICATION_PATH = sys._MEIPASS
... | [
11748,
25064,
201,
198,
11748,
28686,
201,
198,
11748,
4423,
346,
201,
198,
201,
198,
271,
62,
13499,
62,
7753,
796,
651,
35226,
7,
17597,
11,
705,
69,
42005,
3256,
10352,
8,
201,
198,
201,
198,
361,
318,
62,
13499,
62,
7753,
25,
... | 1.978011 | 1,046 |
"""Syscall Class."""
from typing import Callable
from ..models import MipsProgram
class Syscall:
"""Syscall Class, callable."""
def __init__(self, function: Callable[[MipsProgram], None], number: int):
"""Create Syscall."""
self.function = function
if function.__doc__:
se... | [
37811,
44387,
13345,
5016,
526,
15931,
198,
6738,
19720,
1330,
4889,
540,
198,
198,
6738,
11485,
27530,
1330,
337,
2419,
15167,
628,
198,
4871,
311,
893,
13345,
25,
198,
220,
220,
220,
37227,
44387,
13345,
5016,
11,
869,
540,
526,
15931... | 2.355491 | 346 |
# Improve /data/raw/deaths_and_episodes_S01_S06.csv
import pandas as pd
import re
if __name__ == '__main__':
main()
| [
2,
20580,
1220,
7890,
14,
1831,
14,
22595,
82,
62,
392,
62,
538,
8052,
62,
50,
486,
62,
50,
3312,
13,
40664,
198,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
302,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
... | 2.372549 | 51 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__modify__ = "GiriNeko"
__Email___ = "king@ineko.cc"
__author__ = "XiaoLin"
__email__ = "lolilin@outlook.com"
__license__ = "MIT"
__version__ = "1.0"
__status__ = "Production"
import os, re, requests, configparser, json, signal, logging as log, coloredlogs
from mutagen.mp... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
834,
4666,
1958,
834,
796,
366,
38,
14783,
45,
988,
78,
1,
198,
834,
15333,
17569,
796,
366,
3364,
31,
500,
72... | 1.883462 | 8,006 |
# Make sure our GEO data is loaded
from django.test import TestCase
from services.models import LebanonRegion, ServiceArea
| [
2,
6889,
1654,
674,
402,
4720,
1366,
318,
9639,
198,
6738,
42625,
14208,
13,
9288,
1330,
6208,
20448,
198,
6738,
2594,
13,
27530,
1330,
16849,
47371,
11,
4809,
30547,
628
] | 4.133333 | 30 |
import torch
import torch.nn.functional as F
from torch.autograd import Function
from torch.autograd.function import once_differentiable
from . import affine_grid_cuda
| [
11748,
28034,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
198,
6738,
28034,
13,
2306,
519,
6335,
1330,
15553,
198,
6738,
28034,
13,
2306,
519,
6335,
13,
8818,
1330,
1752,
62,
39799,
3379,
198,
198,
6738,
764,
1330,
1527,
500,
6... | 3.5625 | 48 |
if cur == first:
first = first.nextNode
else:
pre = first
while pre.nextNode != cur:
pre = pre.nextNode
pre.nextNode = cur.nextNode | [
361,
1090,
6624,
717,
25,
201,
198,
197,
11085,
796,
717,
13,
19545,
19667,
201,
198,
17772,
25,
201,
198,
197,
3866,
796,
717,
201,
198,
197,
4514,
662,
13,
19545,
19667,
14512,
1090,
25,
201,
198,
197,
197,
3866,
796,
662,
13,
1... | 2.433333 | 60 |
from ..layer_operation import LayerOperation
import tensorflow as tf
import re
| [
6738,
11485,
29289,
62,
27184,
1330,
34398,
32180,
201,
198,
11748,
11192,
273,
11125,
355,
48700,
201,
198,
11748,
302,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198
] | 3 | 30 |
import os
from glob import glob
import numpy as np
from PIL import Image
import matplotlib.pyplot as plt
from tqdm import tqdm
ACTIVE = True
STD = 0
ITERATION = 470000
MODEL_NAME = 'height_1024_val_False_without_error'
dir_image = './checkpoints/Over_{}_std/Image/Test/{}/{}'.format(STD, MODEL_NAME, ITERATION)
dir_... | [
11748,
28686,
198,
6738,
15095,
1330,
15095,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
350,
4146,
1330,
7412,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
6738,
256,
80,
36020,
1330,
256,
80,
36020,
628,
198,
... | 2.330992 | 1,139 |
import logging
import json
from pathlib import Path
import urllib.request
import itertools as it
from zensols.actioncli import persisted
from zensols.dlqaclass import (
CorpusReader,
CorpusReaderFactory,
CorpusParserFactory,
)
logger = logging.getLogger(__name__)
CorpusParserFactory.register(SquadCorpus... | [
11748,
18931,
198,
11748,
33918,
198,
6738,
3108,
8019,
1330,
10644,
198,
11748,
2956,
297,
571,
13,
25927,
198,
11748,
340,
861,
10141,
355,
340,
198,
6738,
1976,
641,
10220,
13,
2673,
44506,
1330,
33264,
198,
6738,
1976,
641,
10220,
1... | 3.158333 | 120 |
"""Methods pertaining to loading and configuring CTA "L" station data."""
import logging
from pathlib import Path
from confluent_kafka import avro
from confluent_kafka.avro import ClientError
from .train import Train
from .turnstile import Turnstile
from .producer import Producer
logger = logging.getLogger(__name__)... | [
37811,
46202,
27113,
284,
11046,
290,
4566,
870,
327,
5603,
366,
43,
1,
4429,
1366,
526,
15931,
198,
11748,
18931,
198,
6738,
3108,
8019,
1330,
10644,
198,
198,
6738,
1013,
28216,
62,
74,
1878,
4914,
1330,
1196,
305,
198,
6738,
1013,
... | 2.164502 | 1,155 |
# -*- coding: utf-8 -*-
import os
import logging
import gitlab
from settings import GIT_SETTINGS
from settings import MAIL_SETTINGS
from settings import LOG_SETTINGS
from settings import MAIL_NOTIFY_ENABLE
from custome_logging import BufferingSMTPHandler
from custome_logging import ConsoleHandler
if __name__ ... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
28686,
198,
11748,
18931,
198,
198,
11748,
17606,
23912,
198,
198,
6738,
6460,
1330,
402,
2043,
62,
28480,
51,
20754,
198,
6738,
6460,
1330,
8779,
4146,
62,
28480,
... | 3.061947 | 113 |
from globibot.lib.helpers import parsing as p
from collections import namedtuple
DiceRoll = namedtuple('DiceRoll', ['count', 'face_count', 'modifier'])
dice_types = { 'd4', 'd6', 'd8', 'd10', 'd12', 'd20' }
dice_type_grammar = p.one_of(p.string, *dice_types)
dice_grammar = (
p.maybe(p.integer) +
(dice_type_... | [
6738,
15095,
571,
313,
13,
8019,
13,
16794,
364,
1330,
32096,
355,
279,
198,
198,
6738,
17268,
1330,
3706,
83,
29291,
198,
198,
35,
501,
26869,
796,
3706,
83,
29291,
10786,
35,
501,
26869,
3256,
37250,
9127,
3256,
705,
2550,
62,
9127,... | 2.199219 | 256 |
#!/usr/bin/env python
# Block everyone you've muted, and vice-versa.
from argparse import ArgumentParser
import time
from tqdm import tqdm
from tweettools import get_client
if __name__ == '__main__':
main()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
9726,
2506,
345,
1053,
38952,
11,
290,
7927,
12,
690,
64,
13,
198,
198,
6738,
1822,
29572,
1330,
45751,
46677,
198,
11748,
640,
198,
6738,
256,
80,
36020,
1330,
256,
80,
36020,
19... | 3.042857 | 70 |
from django.shortcuts import render
from django.shortcuts import get_object_or_404, HttpResponseRedirect
from django.urls import reverse, reverse_lazy
from django.db import transaction
from django.forms import inlineformset_factory
from django.views.generic import ListView, CreateView, UpdateView, DeleteView
from djan... | [
6738,
42625,
14208,
13,
19509,
23779,
1330,
8543,
198,
198,
6738,
42625,
14208,
13,
19509,
23779,
1330,
651,
62,
15252,
62,
273,
62,
26429,
11,
367,
29281,
31077,
7738,
1060,
198,
6738,
42625,
14208,
13,
6371,
82,
1330,
9575,
11,
9575,
... | 3.425676 | 148 |
'''
Copyright (c) The Dojo Foundation 2011. All Rights Reserved.
Copyright (c) IBM Corporation 2008, 2011. All Rights Reserved.
'''
import weakref
class ServiceLauncherBase(object):
'''Base class for service launcher.'''
def start_service(self, serviceName, token, serviceManager, appData):
'''
... | [
7061,
6,
198,
15269,
357,
66,
8,
383,
2141,
7639,
5693,
2813,
13,
1439,
6923,
33876,
13,
198,
15269,
357,
66,
8,
19764,
10501,
3648,
11,
2813,
13,
1439,
6923,
33876,
13,
198,
7061,
6,
198,
11748,
4939,
5420,
198,
198,
4871,
4809,
... | 2.767647 | 340 |
from socket import error as socket_error
from django import forms
from django.conf import settings
from django.conf.urls import patterns, url
from django.contrib import admin
from django.contrib import messages
from django.contrib.admin import SimpleListFilter
from django.contrib.auth.admin import GroupAdmin, UserAdmi... | [
6738,
17802,
1330,
4049,
355,
17802,
62,
18224,
198,
198,
6738,
42625,
14208,
1330,
5107,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
10414,
13,
6371,
82,
1330,
7572,
11,
19016,
198,
6738,
42625,
14208,
... | 3 | 1,557 |
from typing import List
import msgpack
import json
import pytest
from main import Example, ExampleChild, encode_example, decode_example, encode_example_proto, decode_example_proto
from random import randint, choice, random
from string import ascii_letters, digits
import pickle
single = gen_test_obj(1)
_100 = gen_test... | [
6738,
19720,
1330,
7343,
198,
11748,
31456,
8002,
198,
11748,
33918,
198,
11748,
12972,
9288,
198,
6738,
1388,
1330,
17934,
11,
17934,
16424,
11,
37773,
62,
20688,
11,
36899,
62,
20688,
11,
37773,
62,
20688,
62,
1676,
1462,
11,
36899,
6... | 2.586885 | 305 |
# -*- coding: utf-8 -*-
import os
import sys
import numpy as np
import torch
from ncc import LOGGER
from ncc import tasks
from ncc.data.kd.teacher_out_dataset import (
TeacherOutDataset,
)
from ncc.utils import checkpoint_utils
from ncc.utils import utils
from ncc.utils.file_ops.yaml_io import load_yaml
from ncc... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
28686,
198,
11748,
25064,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28034,
198,
198,
6738,
299,
535,
1330,
41605,
30373,
198,
6738,
299,
535,
1330,
... | 2.652695 | 167 |
#!/usr/bin/env python3
import collections
import datetime
import shutil
from typing import Any, Callable, List
Partition = collections.namedtuple("Partition", [
'device',
'mountpoint'
])
Meminfo = collections.namedtuple('Meminfo', [
'total',
'free',
'cached',
'used',
])
... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
11748,
17268,
198,
11748,
4818,
8079,
198,
11748,
4423,
346,
198,
6738,
19720,
1330,
4377,
11,
4889,
540,
11,
7343,
628,
198,
7841,
653,
796,
17268,
13,
13190,
83,
29291,
7203... | 2.576389 | 144 |
from sublime import Region
from WrapAsYouType.tests.command_test_base import WrapAsYouTypeCommandTestBase
class TestWrapAsYouTypeCommandNormal(WrapAsYouTypeCommandTestBase):
"""Test WrapAsYouTypeCommand under "normal" editing behavior."""
def test_cpp_block_comments(self):
"""Test WrapAsYouTypeComma... | [
6738,
41674,
1330,
17718,
198,
198,
6738,
41028,
1722,
1639,
6030,
13,
41989,
13,
21812,
62,
9288,
62,
8692,
1330,
41028,
1722,
1639,
6030,
21575,
14402,
14881,
628,
198,
4871,
6208,
54,
2416,
1722,
1639,
6030,
21575,
26447,
7,
54,
2416... | 1.945817 | 13,159 |
# vim:fileencoding=utf-8:noet
from __future__ import (unicode_literals, division, absolute_import, print_function)
import subprocess
from traceback import print_exc
__version__ = "2.8.3"
| [
2,
43907,
25,
7753,
12685,
7656,
28,
40477,
12,
23,
25,
3919,
316,
198,
6738,
11593,
37443,
834,
1330,
357,
46903,
1098,
62,
17201,
874,
11,
7297,
11,
4112,
62,
11748,
11,
3601,
62,
8818,
8,
198,
198,
11748,
850,
14681,
198,
6738,
... | 3.015873 | 63 |
import keras.backend as K
import numpy as np
import tensorflow as tf
from tensorflow.python.platform import flags
from attack_utils import gen_adv_loss
from keras.models import save_model
import time
import sys
FLAGS = flags.FLAGS
EVAL_FREQUENCY = 1000
BATCH_SIZE = 64
BATCH_EVAL_NUM = 100
def batch_eval(tf_inputs, t... | [
11748,
41927,
292,
13,
1891,
437,
355,
509,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
6738,
11192,
273,
11125,
13,
29412,
13,
24254,
1330,
9701,
198,
6738,
1368,
62,
26791,
1330,
2429,
62,
32225... | 2.23139 | 1,115 |
from datetime import timedelta
from airflow.utils.dates import days_ago
from airflow import DAG
from airflow.operators.bash_operator import BashOperator
default_args = {
'owner': 'Yilin',
'start_date': days_ago(2),
'depends_on_past': False,
'retries': 1,
'retry_delay': timedelta(minutes=1)
}
dag = DAG(
'... | [
6738,
4818,
8079,
1330,
28805,
12514,
198,
198,
6738,
45771,
13,
26791,
13,
19581,
1330,
1528,
62,
3839,
198,
6738,
45771,
1330,
360,
4760,
198,
6738,
45771,
13,
3575,
2024,
13,
41757,
62,
46616,
1330,
15743,
18843,
1352,
198,
198,
1228... | 2.690821 | 207 |
"Unit test to check Python bpo-45074."
import asyncio
import sys
import pytest
pytestmark = pytest.mark.asyncio
PIPE_MAX_SIZE = 4 * 1024 * 1024 + 1
@pytest.mark.xfail(sys.platform == "win32", reason="bpo-45074")
| [
1,
26453,
1332,
284,
2198,
11361,
275,
7501,
12,
17885,
4524,
526,
198,
198,
11748,
30351,
952,
198,
11748,
25064,
198,
198,
11748,
12972,
9288,
198,
198,
9078,
9288,
4102,
796,
12972,
9288,
13,
4102,
13,
292,
13361,
952,
198,
198,
47... | 2.595238 | 84 |
import multiprocessing
import random
import time
from threading import current_thread
import rx
from rx.scheduler import ThreadPoolScheduler
from rx import operators as ops
# calculate cpu count, using which will create a ThreadPoolScheduler
thread_count = multiprocessing.cpu_count()
thread_pool_scheduler = ThreadPoolS... | [
11748,
18540,
305,
919,
278,
198,
11748,
4738,
198,
11748,
640,
198,
6738,
4704,
278,
1330,
1459,
62,
16663,
198,
11748,
374,
87,
198,
6738,
374,
87,
13,
1416,
704,
18173,
1330,
14122,
27201,
50,
1740,
18173,
198,
6738,
374,
87,
1330,... | 2.769231 | 325 |
from .estimators import EmpiricalMeanSL, GLMSL, StepwiseSL
from .stackers import SuperLearner
| [
6738,
764,
395,
320,
2024,
1330,
2295,
4063,
605,
5308,
272,
8634,
11,
10188,
5653,
43,
11,
5012,
3083,
8634,
198,
6738,
764,
25558,
364,
1330,
3115,
14961,
1008,
198
] | 3.133333 | 30 |
# -*- coding: utf-8 -*-
""" Print a json file with the participants information for their badges."""
import json
import logging as log
from optparse import make_option
from collections import OrderedDict
from django.core.management.base import BaseCommand, CommandError
from assopy import models as assopy_mod... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
12578,
257,
33918,
2393,
351,
262,
6809,
1321,
329,
511,
37583,
526,
15931,
198,
198,
11748,
33918,
198,
11748,
18931,
355,
2604,
198,
6738,
220,
220,
2172,
29572,
... | 3.013986 | 143 |
""" A series of helper functions and constants related to rendering """
SCREEN_WIDTH = 10
SCREEN_HEIGHT = 10
CAMERA_WIDTH = SCREEN_WIDTH
CAMERA_HEIGHT = SCREEN_HEIGHT
WORLD_WIDTH = 30
WORLD_HEIGHT = 30
CHUNK_WIDTH = 10
CHUNK_HEIGHT = 10
# Max number of chunks from the player to load
CHUNK_LOAD_DISTANCE = 1 | [
37811,
317,
2168,
286,
31904,
5499,
290,
38491,
3519,
284,
14837,
37227,
198,
198,
6173,
2200,
1677,
62,
54,
2389,
4221,
796,
838,
198,
6173,
2200,
1677,
62,
13909,
9947,
796,
838,
198,
198,
34,
2390,
46461,
62,
54,
2389,
4221,
796,
... | 2.496 | 125 |
# -*- coding: utf-8 -*-
"""Wrapper to run JSPEC from the command line.
:copyright: Copyright (c) 2017 RadiaSoft LLC. All Rights Reserved.
:license: http://www.apache.org/licenses/LICENSE-2.0.html
"""
from __future__ import absolute_import, division, print_function
from pykern import pkio
from pykern import pksubproce... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
36918,
2848,
284,
1057,
449,
48451,
422,
262,
3141,
1627,
13,
198,
198,
25,
22163,
4766,
25,
15069,
357,
66,
8,
2177,
5325,
544,
18380,
11419,
13,
220,
1439,
69... | 2.355685 | 343 |
import smart_imports
smart_imports.all()
TEST_FREEDOM = float(666)
| [
198,
11748,
4451,
62,
320,
3742,
198,
198,
27004,
62,
320,
3742,
13,
439,
3419,
628,
198,
51,
6465,
62,
37,
2200,
1961,
2662,
796,
12178,
7,
27310,
8,
628
] | 2.4 | 30 |
"""Open API written in Python for making your own Smash Bros: Melee AI
Python3 only
Currently only works on Linux/OSX
"""
from melee.dolphin import Dolphin
from melee.logger import Logger
from melee.gamestate import GameState
from melee.enums import Stage, Menu, Character, Button, Action, ProjectileSubtype
from melee.c... | [
37811,
11505,
7824,
3194,
287,
11361,
329,
1642,
534,
898,
18214,
14266,
25,
21058,
9552,
198,
37906,
18,
691,
198,
21327,
691,
2499,
319,
7020,
14,
2640,
55,
198,
37811,
198,
6738,
16837,
13,
67,
27161,
1330,
44576,
198,
6738,
16837,
... | 4.071429 | 112 |
from posixpath import split
import threading
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from PyQt5.QtCore import *
from PyQt5.uic import loadUiType
from pytube import YouTube
from pytube import Playlist
from pytube.cli import on_progress
from threading import Thread
import os
from os import path
import s... | [
6738,
1426,
844,
6978,
1330,
6626,
198,
11748,
4704,
278,
198,
6738,
9485,
48,
83,
20,
13,
48,
83,
8205,
72,
1330,
1635,
198,
6738,
9485,
48,
83,
20,
13,
48,
83,
54,
312,
11407,
1330,
1635,
198,
6738,
9485,
48,
83,
20,
13,
48,
... | 2.420091 | 219 |
from tensorflow import expand_dims
from tensorflow import tile
from tensorflow.python.framework import ops
from tensorflow.python.framework import tensor_shape
from tensorflow.python.layers import base
from tensorflow.python.ops import init_ops
from tensorflow.python.ops import math_ops
from tensorflow.python.op... | [
6738,
11192,
273,
11125,
1330,
4292,
62,
67,
12078,
201,
198,
6738,
11192,
273,
11125,
1330,
17763,
201,
198,
6738,
11192,
273,
11125,
13,
29412,
13,
30604,
1330,
39628,
201,
198,
6738,
11192,
273,
11125,
13,
29412,
13,
30604,
1330,
111... | 2.678715 | 2,988 |
import time
import logging
logging.basicConfig(level=logging.DEBUG)
from redis import StrictRedis
from rq import Queue
from apscheduler.schedulers.blocking import BlockingScheduler
import sys
sys.path.append('/d1lod')
from d1lod import jobs
conn = StrictRedis(host='redis', port='6379')
queues = {
'default': Que... | [
11748,
640,
198,
11748,
18931,
198,
6404,
2667,
13,
35487,
16934,
7,
5715,
28,
6404,
2667,
13,
30531,
8,
198,
198,
6738,
2266,
271,
1330,
520,
2012,
7738,
271,
198,
6738,
374,
80,
1330,
4670,
518,
198,
6738,
257,
862,
1740,
18173,
1... | 2.810398 | 327 |
import os
import argparse
import soccer
from os import listdir
from os.path import isfile, join, exists
################################################################################
# run: python3 estimate_openpose.py --path_to_data ~/path/to/data/ --openpose_dir ~/path/to/openpose
###############################... | [
11748,
28686,
198,
11748,
1822,
29572,
198,
11748,
11783,
198,
6738,
28686,
1330,
1351,
15908,
198,
6738,
28686,
13,
6978,
1330,
318,
7753,
11,
4654,
11,
7160,
628,
198,
29113,
29113,
14468,
198,
2,
1057,
25,
21015,
18,
8636,
62,
9654,
... | 3.247159 | 352 |
from __future__ import absolute_import, unicode_literals
import textwrap
from django.utils.safestring import SafeData
from django.test import TestCase
__all__ = ('FeinCMSTests',)
class FeinCMSTests(TestCase):
"""Tests the ``markupmirror.feincms`` module that provides integration
into FeinCMS as page conte... | [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
11,
28000,
1098,
62,
17201,
874,
198,
11748,
2420,
37150,
198,
198,
6738,
42625,
14208,
13,
26791,
13,
49585,
395,
1806,
1330,
19978,
6601,
198,
198,
6738,
42625,
14208,
13,
9288,
1330,
62... | 2.390728 | 1,057 |
from django.contrib import admin
from django.conf import settings
from .models import Scooter, ScooterActivity
admin.site.register(Scooter, ScooterAdmin)
admin.site.register(ScooterActivity, ScooterActivityAdmin) | [
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
764,
27530,
1330,
1446,
25141,
11,
1446,
25141,
16516,
628,
198,
28482,
13,
15654,
13,
30238,
7,
3351,
25141,
11,
1446,
25141,
46... | 3.689655 | 58 |
'''Create a function/method that takes a string and return the word count. The string will be a sentence.
Input Format
A string
Constraints
No
Output Format
Word count
Sample Input 0
This is test
Sample Output 0
3
Sample Input 1
Test Demo
Sample Output 1
2
Sample Input 2
Prakash
Sample Output 2
1'''
#solu... | [
7061,
6,
16447,
257,
2163,
14,
24396,
326,
2753,
257,
4731,
290,
1441,
262,
1573,
954,
13,
383,
4731,
481,
307,
257,
6827,
13,
198,
198,
20560,
18980,
198,
198,
32,
4731,
198,
198,
3103,
2536,
6003,
198,
198,
2949,
198,
198,
26410,
... | 3.095652 | 115 |
from .objectJSON import ObjectJSON
| [
198,
6738,
764,
15252,
40386,
1330,
9515,
40386,
198
] | 4 | 9 |
"Malagasy config with language-specific information."
from pynini import *
from pynini.lib import byte
from config import utils
GRAPHEMES = union(byte.LOWER, "'", "-", "@",
"à", "â", "è", "é", "ê", "ë",
"ì", "ò", "ô", "ù", "n̈", "ñ")
INITIAL_PUNCTUATION = utils.DEFAULT_INITIAL_PUN... | [
1,
15029,
363,
4107,
4566,
351,
3303,
12,
11423,
1321,
526,
198,
198,
6738,
279,
2047,
5362,
1330,
1635,
198,
6738,
279,
2047,
5362,
13,
8019,
1330,
18022,
198,
6738,
4566,
1330,
3384,
4487,
198,
198,
10761,
31300,
3620,
1546,
796,
64... | 2.440191 | 627 |
# -*- coding: UTF-8 -*-
# Copyright 2009-2018 Rumma & Ko Ltd
# License: BSD, see file LICENSE for more details.
"""
Defines Lino's **Python serializer and deserializer**. See
:doc:`Specification </specs/dpy>`.
"""
from __future__ import unicode_literals
from __future__ import print_function
# from future import stan... | [
2,
532,
9,
12,
19617,
25,
41002,
12,
23,
532,
9,
12,
198,
2,
15069,
3717,
12,
7908,
25463,
2611,
1222,
17634,
12052,
198,
2,
13789,
25,
347,
10305,
11,
766,
2393,
38559,
24290,
329,
517,
3307,
13,
198,
198,
37811,
198,
7469,
1127,... | 2.445013 | 4,692 |
from model.move import Move
| [
6738,
2746,
13,
21084,
1330,
10028,
628
] | 4.142857 | 7 |
from setuptools import find_packages, setup
setup(
name="tqp",
version="0.5.1",
description="An opinionated library for pub/sub over SQS and SNS",
url="https://github.com/4Catalyzer/tqp",
author="Giacomo Tagliabue",
author_email="giacomo@gmail.com",
license="MIT",
python_requires=">=3.6... | [
6738,
900,
37623,
10141,
1330,
1064,
62,
43789,
11,
9058,
198,
198,
40406,
7,
198,
220,
220,
220,
1438,
2625,
83,
80,
79,
1600,
198,
220,
220,
220,
2196,
2625,
15,
13,
20,
13,
16,
1600,
198,
220,
220,
220,
6764,
2625,
2025,
4459,
... | 2.27897 | 466 |
#!/usr/bin/env python
# __BEGIN_LICENSE__
# Copyright (C) 2008-2010 United States Government as represented by
# the Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
# __END_LICENSE__
from django.contrib.auth.models import User
if __name__ == '__main__':
main()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
11593,
33,
43312,
62,
43,
2149,
24290,
834,
198,
2,
15069,
357,
34,
8,
3648,
12,
10333,
1578,
1829,
5070,
355,
7997,
416,
198,
2,
262,
22998,
286,
262,
2351,
15781,
261,
2306,
8... | 3.216495 | 97 |
from setuptools import find_packages, setup
setup(
name='src',
packages=find_packages(),
version='0.1.0',
description='Experiments to accompany "Measuring Corpus Bias via First-Order Co-occurrence',
author='Daniel Smarda',
license='MIT',
)
| [
6738,
900,
37623,
10141,
1330,
1064,
62,
43789,
11,
9058,
198,
198,
40406,
7,
198,
220,
220,
220,
1438,
11639,
10677,
3256,
198,
220,
220,
220,
10392,
28,
19796,
62,
43789,
22784,
198,
220,
220,
220,
2196,
11639,
15,
13,
16,
13,
15,... | 2.912088 | 91 |
# coding=utf-8
# Copyright (C) 2020 NumS Development Team.
#
# 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... | [
2,
19617,
28,
40477,
12,
23,
198,
2,
15069,
357,
34,
8,
12131,
31835,
50,
7712,
4816,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393... | 3.212276 | 391 |
#! python
# -*- coding: utf-8 -*-
"""
Created on Wed Jan 25 13:30:52 2017
@author: Adam Deller, UNIVERSITY COLLEGE LONDON.
Tools for calculating the Stark effect in Rydberg helium
using the Numerov method.
Based on:
Stark structure of the Rydberg states of alkali-metal atoms
M. L. Zimmerman et al. Phys.... | [
2,
0,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
3300,
2365,
1679,
1511,
25,
1270,
25,
4309,
2177,
198,
198,
31,
9800,
25,
7244,
360,
12368,
11,
49677,
9050,
20444,
2538,
826... | 1.872176 | 9,427 |
from django.test import TestCase
from contact.models import Contact
from company.models import Company
from users.models import User
| [
6738,
42625,
14208,
13,
9288,
1330,
6208,
20448,
198,
198,
6738,
2800,
13,
27530,
1330,
14039,
198,
6738,
1664,
13,
27530,
1330,
5834,
198,
6738,
2985,
13,
27530,
1330,
11787,
628
] | 4.354839 | 31 |
# -*- coding: utf-8 -*-
# Copyright 2016 Open Permissions Platform Coalition
# 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,
1584,
4946,
2448,
8481,
19193,
15135,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779... | 2.448061 | 2,243 |
import itertools
import torch
import torch.nn as nn
import numpy as np
class Anchors(nn.Module):
"""
adapted and modified from https://github.com/google/automl/blob/master/efficientdet/anchors.py by Zylo117
"""
def forward(self, image, dtype=torch.float32):
"""Generates multiscale anchor bo... | [
11748,
340,
861,
10141,
198,
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
11748,
299,
32152,
355,
45941,
628,
628,
198,
4871,
29253,
669,
7,
20471,
13,
26796,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
1657... | 2.145804 | 1,406 |
SUPERUSUARIO = 1
ADMINISTRADOR = 2
USUARIO = 3 | [
40331,
1137,
2937,
52,
1503,
9399,
796,
352,
198,
2885,
23678,
1797,
5446,
2885,
1581,
796,
362,
198,
2937,
52,
1503,
9399,
796,
513
] | 1.916667 | 24 |
#!/usr/bin/env python3
import argparse
import gzip
import collections
import yaml
import vcf
import sys
if __name__ == "__main__":
main()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
11748,
1822,
29572,
198,
11748,
308,
13344,
198,
11748,
17268,
198,
11748,
331,
43695,
198,
11748,
410,
12993,
198,
11748,
25064,
628,
628,
198,
361,
11593,
3672,
834,
6624,
366... | 2.826923 | 52 |
import json, util
import numpy as np
from collections import defaultdict
if __name__ == "__main__":
print_results(util.find_data_directory())
| [
11748,
33918,
11,
7736,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
17268,
1330,
4277,
11600,
628,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
3601,
62,
43420,
7,
22602,
13,
19796,
62,
789... | 3.23913 | 46 |
""" Cisco_IOS_XR_tunnel_l2tun_oper
This module contains a collection of YANG definitions
for Cisco IOS\-XR tunnel\-l2tun package operational data.
This module contains definitions
for the following management objects\:
l2tp\: L2TP operational data
l2tpv2\: l2tpv2
Copyright (c) 2013\-2017 by Cisco Systems, Inc.
... | [
37811,
28289,
62,
40,
2640,
62,
55,
49,
62,
28286,
4954,
62,
75,
17,
28286,
62,
3575,
220,
198,
198,
1212,
8265,
4909,
257,
4947,
286,
575,
15567,
17336,
198,
1640,
28289,
314,
2640,
41441,
55,
49,
13275,
41441,
75,
17,
28286,
5301,... | 1.391106 | 178,182 |
from django.utils.html import strip_tags
from django.core.mail import EmailMultiAlternatives
from markdown2 import markdown
from django.db import models
from email_service.constants import ATTACHMENT_TYPE_CHOICES
| [
6738,
42625,
14208,
13,
26791,
13,
6494,
1330,
10283,
62,
31499,
198,
6738,
42625,
14208,
13,
7295,
13,
4529,
1330,
9570,
29800,
23081,
2929,
198,
6738,
1317,
2902,
17,
1330,
1317,
2902,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
498... | 3.6 | 60 |
from mutagen.easyid3 import EasyID3
from mutagen.id3 import ID3, TORY, TYER, TPUB, APIC, USLT, COMM
from mutagen.mp4 import MP4, MP4Cover
from mutagen.flac import Picture, FLAC
from mutagen.oggvorbis import OggVorbis
from mutagen.oggopus import OggOpus
import urllib.request
import base64
from spotdl.metadata import E... | [
6738,
4517,
11286,
13,
38171,
312,
18,
1330,
16789,
2389,
18,
198,
6738,
4517,
11286,
13,
312,
18,
1330,
4522,
18,
11,
309,
15513,
11,
24412,
1137,
11,
309,
5105,
33,
11,
3486,
2149,
11,
1294,
27734,
11,
22240,
198,
6738,
4517,
1128... | 2.232444 | 3,261 |
from output.models.ms_data.model_groups.mg_l004_xsd.mg_l004 import (
Doc,
Foo,
)
__all__ = [
"Doc",
"Foo",
]
| [
6738,
5072,
13,
27530,
13,
907,
62,
7890,
13,
19849,
62,
24432,
13,
11296,
62,
75,
22914,
62,
87,
21282,
13,
11296,
62,
75,
22914,
1330,
357,
198,
220,
220,
220,
14432,
11,
198,
220,
220,
220,
36080,
11,
198,
8,
198,
198,
834,
4... | 1.909091 | 66 |
import datetime
from haystack import indexes
from .models import Hashtag
| [
11748,
4818,
8079,
198,
6738,
27678,
25558,
1330,
39199,
198,
6738,
764,
27530,
1330,
21059,
12985,
220,
628
] | 4.166667 | 18 |
#!/usr/bin/env python
"""
_GetParentAndGrandParentInfo_
Figure out parentage information for a file in WMBS. This will return
information about a file's parent and it's grand parent such as the
lfn, id and whether or not the file is merged. This will also determine
whether or not the file is a redneck parent or redn... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
37811,
198,
62,
3855,
24546,
1870,
23581,
24546,
12360,
62,
198,
198,
11337,
503,
2560,
496,
1321,
329,
257,
2393,
287,
30376,
4462,
13,
220,
770,
481,
1441,
198,
17018,
546,
257,
2393... | 3.725664 | 113 |
from CommonCode.queryExecutor import QueryExecuter
from CommonCode.strings import Strings
from Enums.databaseTables import Tables
from Searcher.searcherHelper import SearcherHelper
from Searcher.sercherConfig import SearcherConfig
from protobuff.entity_pb2 import StatusEnum
from protobuff.workertype_pb2 import UNKNOWN_... | [
6738,
8070,
10669,
13,
22766,
23002,
38409,
1330,
43301,
23002,
11894,
198,
6738,
8070,
10669,
13,
37336,
1330,
4285,
654,
198,
6738,
2039,
5700,
13,
48806,
51,
2977,
1330,
33220,
198,
6738,
42016,
2044,
13,
325,
283,
2044,
47429,
1330,
... | 3.684211 | 95 |
if foo: # reiz: tp
...
...
if foo: # reiz: tp
with foo:
...
with bar:
...
if foo:
...
if foo:
...
...
...
if foo:
with foo:
...
if foo:
with foo:
...
with bar:
...
with baz:
...
| [
361,
22944,
25,
220,
1303,
302,
528,
25,
256,
79,
198,
220,
220,
220,
2644,
198,
220,
220,
220,
2644,
198,
198,
361,
22944,
25,
220,
1303,
302,
528,
25,
256,
79,
198,
220,
220,
220,
351,
22944,
25,
198,
220,
220,
220,
220,
220,
... | 1.652941 | 170 |
# ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
# ------------------------------------
from torch import nn
import models
# pylint: disable=no-member
class Decoder(nn.Module):
"""
Decoder network
"""
| [
2,
20368,
650,
198,
2,
15069,
357,
66,
8,
5413,
10501,
13,
198,
2,
49962,
739,
262,
17168,
5964,
13,
198,
2,
20368,
650,
198,
6738,
28034,
1330,
299,
77,
198,
11748,
4981,
198,
198,
2,
279,
2645,
600,
25,
15560,
28,
3919,
12,
19... | 3.929577 | 71 |
from kedro.pipeline import node
from kedro_viz.data_access.repositories import (
GraphEdgesRepository,
GraphNodesRepository,
)
from kedro_viz.models.graph import GraphEdge, GraphNode
| [
6738,
479,
276,
305,
13,
79,
541,
4470,
1330,
10139,
198,
198,
6738,
479,
276,
305,
62,
85,
528,
13,
7890,
62,
15526,
13,
260,
1930,
270,
1749,
1330,
357,
198,
220,
220,
220,
29681,
7407,
3212,
6207,
13264,
11,
198,
220,
220,
220,... | 2.694444 | 72 |
#coding:utf-8
#
# PROGRAM/MODULE: saturnin-sdk
# FILE: examples/dummy/api.py
# DESCRIPTION: API for Dummy microservice
# CREATED: 18.12.2019
#
# The contents of this file are subject to the MIT License
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this softwar... | [
2,
66,
7656,
25,
40477,
12,
23,
198,
2,
198,
2,
46805,
14,
33365,
24212,
25,
3332,
700,
259,
12,
21282,
74,
198,
2,
45811,
25,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6096,
14,
67,
13513,
14,
15042,
13,
9078,
198,
2,... | 2.73887 | 1,168 |
#!/usr/bin/env python
from pyrl.components import Energy, Name
from pyrl.components.action import SimpleAction, ponder
from pyrl.resources import Messages
from pyrl.world_helpers import ActionProcessor, act
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
6738,
279,
2417,
75,
13,
5589,
3906,
1330,
6682,
11,
6530,
198,
6738,
279,
2417,
75,
13,
5589,
3906,
13,
2673,
1330,
17427,
12502,
11,
37375,
198,
6738,
279,
2417,
75,
13,
37540,
133... | 3.409836 | 61 |
#!/usr/bin/env python
#-*- coding:utf-8 -*-
'''
Pentestdb, a database for penetration test.
Copyright (c) 2015 alpha1e0
'''
import os
import sys
import logging
import types
import re
import urlparse
import urllib
import ConfigParser
from lxml import etree
import yaml
from colorama import Fore, Style
from appdirs im... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
12,
9,
12,
19617,
25,
40477,
12,
23,
532,
9,
12,
198,
198,
7061,
6,
198,
47,
298,
395,
9945,
11,
257,
6831,
329,
23271,
1332,
13,
198,
15269,
357,
66,
8,
1853,
17130,
16,
68... | 1.651533 | 4,141 |
# Author: Simon Liedtke <liedtke.simon@googlemail.com>
#
# This module was developed with funding provided by
# the Google Summer of Code (2013).
import fnmatch
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
import pytest
from sunpy.database.commands import AddEntry, RemoveEntry, EditEn... | [
2,
6434,
25,
11288,
406,
798,
83,
365,
1279,
18511,
83,
365,
13,
14323,
261,
31,
13297,
4529,
13,
785,
29,
198,
2,
198,
2,
770,
8265,
373,
4166,
351,
4918,
2810,
416,
198,
2,
262,
3012,
10216,
286,
6127,
357,
6390,
737,
198,
198... | 3.289017 | 173 |
"""
Base class for Backlog all object
"""
from .. import exceptions
class BacklogBase:
"""
Base class is identified by id and class name
"""
_endpoint = None
_crud_func = ('all', 'get', 'filter', 'create', 'update', 'delete')
@property
def from_json(self, response):
"""
... | [
37811,
198,
14881,
1398,
329,
5157,
6404,
477,
2134,
198,
37811,
198,
198,
6738,
11485,
1330,
13269,
628,
198,
4871,
5157,
6404,
14881,
25,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
7308,
1398,
318,
5174,
416,
4686,
290,
1398,
14... | 2.226371 | 857 |
from unittest import mock
from django.test import TestCase
from rest_framework.fields import CharField
from ..serializers import ContentField
class ContentFieldTestCase(TestCase):
"""
Tests the ContentField serializer field.
"""
def test_existing_fields(self):
"""
Tests that the val... | [
6738,
555,
715,
395,
1330,
15290,
198,
198,
6738,
42625,
14208,
13,
9288,
1330,
6208,
20448,
198,
6738,
1334,
62,
30604,
13,
25747,
1330,
3178,
15878,
198,
198,
6738,
11485,
46911,
11341,
1330,
14041,
15878,
628,
198,
4871,
14041,
15878,
... | 2.241135 | 564 |
'''
列表生成表达式
'''
l = [i for i in range(10) if i % 2 == 0]
print(l) # [0, 2, 4, 6, 8]
# 与上述写法等价
l = []
for i in range(10):
if i % 2 == 0:
l.append(i)
'''
字典生成表达式
'''
d = {i: i + 10 for i in range(10)}
print(d) # {0: 10, 1: 11, 2: 12, 3: 13, 4: 14, 5: 15, 6: 16, 7: 17, 8: 18, 9: 19}
# 与上述写法等价
d = {}
for i in range(10... | [
7061,
6,
198,
26344,
245,
26193,
101,
37955,
22755,
238,
26193,
101,
164,
122,
122,
28156,
237,
198,
7061,
6,
198,
75,
796,
685,
72,
329,
1312,
287,
2837,
7,
940,
8,
611,
1312,
4064,
362,
6624,
657,
60,
198,
4798,
7,
75,
8,
220,... | 1.478992 | 357 |
import nextcord, random, datetime
from typing import List
from util.loaders.json import get_path
from util.constants import Emojis
""" TicTacToe """
"""Wordle"""
EMOJI_CODES = Emojis.EMOJI_CODES
cwd = get_path()
popular_words = open(cwd + "/game/wordle/popular.txt").read().splitlines()
all_words = set(word.str... | [
11748,
1306,
66,
585,
11,
4738,
11,
4818,
8079,
198,
6738,
19720,
1330,
7343,
198,
6738,
7736,
13,
2220,
364,
13,
17752,
1330,
651,
62,
6978,
198,
6738,
7736,
13,
9979,
1187,
1330,
2295,
13210,
271,
198,
198,
37811,
309,
291,
51,
33... | 2.425116 | 3,679 |
# -*- coding: utf-8 -*-
"""
orm sql schema package.
"""
from pyrin.packaging.base import Package
class ORMSQLSchemaPackage(Package):
"""
orm sql schema package class.
"""
NAME = __name__
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
579,
44161,
32815,
5301,
13,
198,
37811,
198,
198,
6738,
279,
2417,
259,
13,
8002,
3039,
13,
8692,
1330,
15717,
628,
198,
4871,
6375,
5653,
48,
6561,
2395,
... | 2.5875 | 80 |
from math import sqrt
m = 2000000
nums = range(2,m)
primes = [2]
s = 2
for n in nums:
prime = True
for j in primes:
if(n%j==0):
prime = False
break
if(prime):
i = 2
while (i*n < m and i*n in nums):
nums.remove(nums.index(i*n))
i+=1
... | [
6738,
10688,
1330,
19862,
17034,
198,
76,
796,
939,
2388,
198,
77,
5700,
796,
2837,
7,
17,
11,
76,
8,
198,
1050,
999,
796,
685,
17,
60,
198,
82,
796,
362,
198,
1640,
299,
287,
997,
82,
25,
198,
220,
220,
220,
6994,
796,
6407,
... | 1.716981 | 212 |
# -*- coding: utf-8 -*-
##############################################################################
#
# India-GST
#
# Merlin Tecsol Pvt. Ltd.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Fre... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
29113,
29113,
7804,
4242,
2235,
198,
2,
198,
2,
220,
220,
220,
3794,
12,
38,
2257,
198,
2,
198,
2,
220,
220,
220,
32918,
48257,
34453,
18367,
83,
13,
12052,
13,
198,... | 2.43535 | 843 |
import pyeccodes.accessors as _
| [
11748,
279,
5948,
535,
4147,
13,
15526,
669,
355,
4808,
628
] | 3 | 11 |
"""
Test utilities for LKPY tests.
"""
import os
import os.path
import logging
from contextlib import contextmanager
import numpy as np
from .. import matrix
import pytest
from lenskit.datasets import MovieLens, ML100K
_log = logging.getLogger(__name__)
ml_test = MovieLens('ml-latest-small')
ml100k = ML100K()
... | [
37811,
198,
14402,
20081,
329,
406,
42,
47,
56,
5254,
13,
198,
37811,
198,
198,
11748,
28686,
198,
11748,
28686,
13,
6978,
198,
11748,
18931,
198,
6738,
4732,
8019,
1330,
4732,
37153,
198,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
... | 2.328982 | 383 |
from pprint import pprint
| [
6738,
279,
4798,
1330,
279,
4798,
628
] | 3.857143 | 7 |
"""Train and test bigram classifier"""
import dga_classifier.data as data
from keras.layers.core import Dense
from keras.models import Sequential
import sklearn
from sklearn import feature_extraction
from sklearn.cross_validation import train_test_split
def build_model(max_features):
"""Builds logistic regression... | [
37811,
44077,
290,
1332,
1263,
859,
1398,
7483,
37811,
198,
11748,
288,
4908,
62,
4871,
7483,
13,
7890,
355,
1366,
198,
6738,
41927,
292,
13,
75,
6962,
13,
7295,
1330,
360,
1072,
198,
6738,
41927,
292,
13,
27530,
1330,
24604,
1843,
19... | 2.108152 | 1,239 |
import torch
from torch.utils.tensorboard import SummaryWriter
from torch.utils.data import DataLoader
from torch import autograd
import time
import os
import fire
import random
import numpy as np
from nasmc.models import NonlinearSSM, NonlinearSSMProposal
from nasmc.datasets import NonlinearSSMDataset
from nasmc.... | [
11748,
28034,
198,
198,
6738,
28034,
13,
26791,
13,
83,
22854,
3526,
1330,
21293,
34379,
198,
6738,
28034,
13,
26791,
13,
7890,
1330,
6060,
17401,
198,
198,
6738,
28034,
1330,
1960,
519,
6335,
198,
198,
11748,
640,
198,
11748,
28686,
19... | 3.067164 | 134 |
from setuptools import setup
setup(
name='desktopsort',
version='1.1',
packages=['desksort'],
url='',
license='',
author='MasterOfAllEvil',
description=''
)
| [
6738,
900,
37623,
10141,
1330,
9058,
198,
198,
40406,
7,
198,
220,
220,
220,
1438,
11639,
8906,
21841,
2840,
419,
3256,
198,
220,
220,
220,
2196,
11639,
16,
13,
16,
3256,
198,
220,
220,
220,
10392,
28,
17816,
8906,
591,
419,
6,
4357... | 2.384615 | 78 |
#!/usr/bin/python
# -*- coding= utf-8 -*-
import sys
import os
import time
import string
from threading import current_thread
from collections import deque as ThreadQueue
import traceback
from autocomplete import *
from scrollFrame import VerticalScrolledFrame
import math
OS_name = os.name
icom... | [
2,
48443,
14629,
14,
8800,
14,
29412,
201,
198,
2,
532,
9,
12,
19617,
28,
3384,
69,
12,
23,
532,
9,
12,
201,
198,
201,
198,
11748,
25064,
201,
198,
11748,
28686,
201,
198,
11748,
640,
201,
198,
11748,
4731,
201,
198,
201,
198,
6... | 2.373483 | 1,071 |
from aiogram import Dispatcher, Bot
from data import config
bot = Bot(token=config.BOT_TOKEN, parse_mode="HTML")
dp = Dispatcher(bot, loop=config.loop)
| [
6738,
257,
72,
21857,
1330,
3167,
8071,
2044,
11,
18579,
198,
6738,
1366,
1330,
4566,
198,
198,
13645,
796,
18579,
7,
30001,
28,
11250,
13,
33,
2394,
62,
10468,
43959,
11,
21136,
62,
14171,
2625,
28656,
4943,
198,
26059,
796,
3167,
80... | 2.886792 | 53 |
print('=== IDENTIFICANDO VOGAIS =====')
words = ('Computador', 'Programaçao', 'Cadeira', 'Mousepad', 'Fone')
vogais = ('a', 'e', 'i', 'o', 'u')
for c in words:
print(f'\nNa palavra {c} temos', end=' ')
for v in c:
if v.lower() in 'aeiou':
print(v, end='')
| [
4798,
10786,
18604,
4522,
3525,
30643,
6981,
46,
569,
7730,
32,
1797,
29335,
11537,
198,
10879,
796,
19203,
5377,
1996,
7079,
3256,
705,
15167,
64,
16175,
5488,
3256,
705,
34,
671,
8704,
3256,
705,
39643,
15636,
3256,
705,
37,
505,
1153... | 2.028571 | 140 |
#!/usr/bin/env python
###############################################################################
# $Id$
#
# Project: GDAL/OGR Test Suite
# Purpose: Test read functionality for OGR XLSX driver.
# Author: Even Rouault <even dot rouault at mines dash paris dot org>
#
##############################################... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
29113,
29113,
7804,
4242,
21017,
198,
2,
720,
7390,
3,
198,
2,
198,
2,
4935,
25,
220,
27044,
1847,
14,
49656,
6208,
26264,
198,
2,
32039,
25,
220,
6208,
1100,
11244,
329,
440,
10761,... | 4.105986 | 1,019 |
exp = str(input('Digite uma expressão: '))
pilha = []
for v in exp:
if v == '(':
pilha.append('(')
elif v == ')':
if len(pilha) > 0:
pilha.pop()
else:
pilha.append(')')
break
print('A expressão é valida' if len(pilha) == 0 else 'O expressão não é valid... | [
11201,
796,
965,
7,
15414,
10786,
19511,
578,
334,
2611,
4911,
28749,
25,
705,
4008,
198,
79,
346,
3099,
796,
17635,
198,
1640,
410,
287,
1033,
25,
198,
220,
220,
220,
611,
410,
6624,
29513,
10354,
198,
220,
220,
220,
220,
220,
220,... | 1.905882 | 170 |
# Copyright 2021, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Part of "Nuitka", an optimizing Python compiler that is compatible and
# integrates with CPython, but also works on its own.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in complianc... | [
2,
220,
220,
220,
220,
15069,
33448,
11,
17356,
9075,
268,
11,
6920,
1462,
25,
5568,
13,
71,
323,
268,
31,
14816,
13,
785,
198,
2,
198,
2,
220,
220,
220,
220,
2142,
286,
366,
45,
5013,
4914,
1600,
281,
45780,
11361,
17050,
326,
... | 3.391213 | 478 |
"""Generate target."""
from itertools import chain
import json
from pathlib import Path
import shlex
import subprocess
from tempfile import NamedTemporaryFile
import typing as t
import yaml
from sausage.engines import JinjaEngine
from sausage.wildcards import (
get_wildcard_candidates, has_wildcard, replace_wild... | [
37811,
8645,
378,
2496,
526,
15931,
198,
198,
6738,
340,
861,
10141,
1330,
6333,
198,
11748,
33918,
198,
6738,
3108,
8019,
1330,
10644,
198,
11748,
427,
2588,
198,
11748,
850,
14681,
198,
6738,
20218,
7753,
1330,
34441,
12966,
5551,
8979,... | 2.149128 | 1,777 |
#!/usr/bin/env python
##############################################################################
##
# This file is part of Sardana
##
# http://www.sardana-controls.org/
##
# Copyright 2011 CELLS / ALBA Synchrotron, Bellaterra, Spain
##
# Sardana is free software: you can redistribute it and/or modify
# it under th... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
29113,
29113,
7804,
4242,
2235,
198,
2235,
198,
2,
770,
2393,
318,
636,
286,
46997,
2271,
198,
2235,
198,
2,
2638,
1378,
2503,
13,
82,
446,
2271,
12,
13716,
82,
13,
2398,
14,
... | 3.010138 | 1,381 |
fruits = ['apple', 'banana', 'carrot', 'pear', 'cherries']
del fruits[0]
print(fruits)
| [
69,
50187,
796,
37250,
18040,
3256,
705,
3820,
2271,
3256,
705,
7718,
10599,
3256,
705,
431,
283,
3256,
705,
2044,
1678,
20520,
198,
12381,
15921,
58,
15,
60,
198,
4798,
7,
69,
50187,
8,
198
] | 2.485714 | 35 |
import sys
from panda3d.core import TextNode
from direct.showbase.ShowBase import ShowBase
from direct.gui.DirectGui import DirectLabel
from metagui.gui import SizeSpec
from metagui.gui import WholeScreen
from metagui.gui import HorizontalFrame
from metagui.gui import VerticalFrame
from metagui.gui import Empty
from ... | [
11748,
25064,
198,
198,
6738,
279,
5282,
18,
67,
13,
7295,
1330,
8255,
19667,
198,
6738,
1277,
13,
12860,
8692,
13,
15307,
14881,
1330,
5438,
14881,
198,
6738,
1277,
13,
48317,
13,
13470,
8205,
72,
1330,
4128,
33986,
198,
198,
6738,
1... | 1.676895 | 1,108 |
"""Generated message classes for vpcaccess version v1alpha1.
API for managing VPC access connectors.
"""
# NOTE: This file is autogenerated and should not be edited by hand.
from __future__ import absolute_import
from apitools.base.protorpclite import messages as _messages
from apitools.base.py import encoding
from ... | [
37811,
8645,
515,
3275,
6097,
329,
410,
14751,
15526,
2196,
410,
16,
26591,
16,
13,
198,
198,
17614,
329,
11149,
569,
5662,
1895,
34472,
13,
198,
37811,
198,
2,
24550,
25,
770,
2393,
318,
1960,
519,
877,
515,
290,
815,
407,
307,
130... | 3.23017 | 7,312 |
# !/usr/bin/env python
# coding: utf-8
import json
from pathlib import Path
import joblib
import numpy as np
HERE = Path(__file__).parent
DATA_ROOT = HERE.joinpath('../../data')
SPLITS = ['train', 'val', 'test']
def list2vec(a_list):
"""convert a list representing part of a sharded dataset into one big numpy a... | [
2,
5145,
14,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
19617,
25,
3384,
69,
12,
23,
198,
11748,
33918,
198,
6738,
3108,
8019,
1330,
10644,
198,
198,
11748,
1693,
8019,
198,
11748,
299,
32152,
355,
45941,
198,
198,
39,
9338,
796,
10... | 2.261905 | 462 |