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 lauztat.calculators import FrequentistCalculator, AsymptoticCalculator
from lauztat.config import Config
from lauztat.parameters import POI
from lauztat.hypotests import Discovery
import numpy as np
import os
import matplotlib as mpl
mpl.use('Agg')
pwd = os.path.dirname(__file__)
bounds = (0.1, 3... | [
11748,
12972,
9288,
198,
198,
6738,
300,
559,
89,
83,
265,
13,
9948,
3129,
2024,
1330,
22192,
298,
396,
9771,
3129,
1352,
11,
1081,
4948,
457,
6210,
9771,
3129,
1352,
198,
6738,
300,
559,
89,
83,
265,
13,
11250,
1330,
17056,
198,
67... | 2.488789 | 223 |
# Generated by Django 3.0.9 on 2020-08-11 20:50
from django.db import migrations, models
import djmoney.models.fields
| [
2,
2980,
515,
416,
37770,
513,
13,
15,
13,
24,
319,
12131,
12,
2919,
12,
1157,
1160,
25,
1120,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
198,
11748,
42625,
26316,
13,
27530,
13,
25747,
628
] | 3 | 40 |
from PySide2 import QtCore, QtGui
from dwpicker.geometry import (
DIRECTIONS, get_topleft_rect, get_bottomleft_rect, get_topright_rect,
get_bottomright_rect, get_left_side_rect, get_right_side_rect,
get_top_side_rect, get_bottom_side_rect, proportional_rect)
from dwpicker.painting import (
draw_selec... | [
198,
198,
6738,
9485,
24819,
17,
1330,
33734,
14055,
11,
33734,
8205,
72,
198,
198,
6738,
288,
24142,
15799,
13,
469,
15748,
1330,
357,
198,
220,
220,
220,
42242,
11053,
11,
651,
62,
83,
643,
701,
62,
2554,
11,
651,
62,
22487,
9464,... | 2.837563 | 197 |
# This file was automatically generated by SWIG (http://www.swig.org).
# Version 1.3.35
#
# Don't modify this file, modify the SWIG interface instead.
# This file is compatible with both classic and new-style classes.
import _ubigraph
import new
new_instancemethod = new.instancemethod
try:
_swig_property = propert... | [
2,
770,
2393,
373,
6338,
7560,
416,
12672,
3528,
357,
4023,
1378,
2503,
13,
2032,
328,
13,
2398,
737,
198,
2,
10628,
352,
13,
18,
13,
2327,
198,
2,
198,
2,
2094,
470,
13096,
428,
2393,
11,
13096,
262,
12672,
3528,
7071,
2427,
13,
... | 2.846429 | 560 |
import os
import luigi
from luigi.contrib.external_program import ExternalProgramTask
from wespipeline import utils
class GetProgram(ExternalProgramTask):
"""Task user for downloading and giving execution permissions to the 2bit program.
The task gives execute permissions to the conversion utility for 2bit f... | [
11748,
28686,
198,
11748,
300,
84,
25754,
198,
6738,
300,
84,
25754,
13,
3642,
822,
13,
22615,
62,
23065,
1330,
34579,
15167,
25714,
198,
6738,
266,
9774,
541,
4470,
1330,
3384,
4487,
220,
198,
198,
4871,
3497,
15167,
7,
41506,
15167,
... | 2.969474 | 1,769 |
#!/usr/bin/env python
#
# Copyright (c) 2005-2009 Jaroslav Gresula
#
# Distributed under the MIT license (See accompanying file
# LICENSE.txt or copy at http://jagpdf.org/LICENSE.txt)
#
import os
import math
import jagpdf
import jag.testlib as testlib
if __name__ == "__main__":
test_main()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
198,
2,
15069,
357,
66,
8,
5075,
12,
10531,
15374,
26388,
402,
411,
4712,
198,
2,
198,
2,
4307,
6169,
739,
262,
17168,
5964,
357,
6214,
19249,
2393,
198,
2,
38559,
24290,
13,
14... | 2.820755 | 106 |
import time
import numpy as np
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
from email.header import Header
import smtplib
from_addr = "reposter@sina.com"
password = ""
| [
11748,
640,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
3053,
13,
76,
524,
13,
5239,
1330,
337,
3955,
2767,
2302,
198,
6738,
3053,
13,
76,
524,
13,
16680,
541,
433,
1330,
337,
3955,
3620,
586,
541,
433,
198,
6738,
3053,
13,
25677... | 2.945205 | 73 |
from typing import Tuple
import numpy as np
def log_spaced(max_num: int, points_per_decate: int = 15) -> np.ndarray:
"""Generate an array of log spaced integers smaller than L"""
decades = np.log10(max_num)
series: np.ndarray = np.unique(
np.logspace(
start=0,
stop=decades... | [
6738,
19720,
1330,
309,
29291,
198,
198,
11748,
299,
32152,
355,
45941,
628,
198,
4299,
2604,
62,
2777,
2286,
7,
9806,
62,
22510,
25,
493,
11,
2173,
62,
525,
62,
12501,
378,
25,
493,
796,
1315,
8,
4613,
45941,
13,
358,
18747,
25,
... | 2.131818 | 220 |
with open('./flag') as f:
flag = f.read().strip()
print('''
________ .__ ______
/ _____/ __ __ ____ ______ ______ ____ ____ | | ___________ / __ \
/ \ ___| | \_/ __ \ / ___// ___// ___\/ __ \| | _/ __ \_ __ \> <
\ \_\ \ | /\... | [
4480,
1280,
7,
4458,
14,
32109,
11537,
355,
277,
25,
198,
220,
220,
220,
6056,
796,
277,
13,
961,
22446,
36311,
3419,
198,
198,
4798,
7,
7061,
6,
198,
220,
220,
2602,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2... | 1.74954 | 543 |
from typing import List
from random import randint
from utils import create_random_list, measure
@measure
if __name__ == "__main__":
main()
| [
6738,
19720,
1330,
7343,
198,
6738,
4738,
1330,
43720,
600,
198,
6738,
3384,
4487,
1330,
2251,
62,
25120,
62,
4868,
11,
3953,
628,
198,
198,
31,
1326,
5015,
628,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
... | 3.170213 | 47 |
from google.appengine.ext import ndb
import webapp2
import db_models
import json
| [
6738,
23645,
13,
1324,
18392,
13,
2302,
1330,
299,
9945,
198,
11748,
3992,
1324,
17,
198,
11748,
20613,
62,
27530,
198,
11748,
33918,
198
] | 3.375 | 24 |
# Generated by Django 3.1.13 on 2021-11-11 09:28
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
513,
13,
16,
13,
1485,
319,
33448,
12,
1157,
12,
1157,
7769,
25,
2078,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.875 | 32 |
from typing import Iterable
from django.utils.translation import gettext_lazy
from rest_framework_friendly_errors import settings
def validation_failed_dict(
items: Iterable,
dict_code: int = 1001,
dict_message: str = 'Validation Failed'
):
"""Generate dict for failed validation in format of DRF-frie... | [
6738,
19720,
1330,
40806,
540,
198,
198,
6738,
42625,
14208,
13,
26791,
13,
41519,
1330,
651,
5239,
62,
75,
12582,
198,
6738,
1334,
62,
30604,
62,
13120,
62,
48277,
1330,
6460,
628,
198,
4299,
21201,
62,
47904,
62,
11600,
7,
198,
220,... | 2.598639 | 441 |
import subprocess
from benchmark_runner.common.logger.logger_time_stamp import logger
from benchmark_runner.common.ssh.ssh_exceptions import SSHSubprocessError
from benchmark_runner.main.environment_variables import environment_variables
class SSH:
"""
This class run local SSH commands
"""
def run(s... | [
198,
11748,
850,
14681,
198,
6738,
18335,
62,
16737,
13,
11321,
13,
6404,
1362,
13,
6404,
1362,
62,
2435,
62,
301,
696,
1330,
49706,
198,
6738,
18335,
62,
16737,
13,
11321,
13,
45824,
13,
45824,
62,
1069,
11755,
1330,
33825,
7004,
146... | 2.217391 | 598 |
import os
from setuptools import setup
here = os.path.abspath(os.path.dirname(__file__))
setup(
name = "multicube",
version = "0.0.0",
author = "Vlas Sokolov",
author_email = "vlas145@gmail.com",
description = ("Tools for processing multiple component spectra."),
long_description=read('READM... | [
11748,
28686,
198,
6738,
900,
37623,
10141,
1330,
9058,
198,
198,
1456,
796,
28686,
13,
6978,
13,
397,
2777,
776,
7,
418,
13,
6978,
13,
15908,
3672,
7,
834,
7753,
834,
4008,
198,
198,
40406,
7,
198,
220,
220,
220,
1438,
796,
366,
... | 2.601156 | 173 |
#!/usr/bin/env python3
#################################################################################
# #
# Program purpose: Test whether two lines are parallel. #
# Program Author : Happi Yvan <ivensteinpoke... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
29113,
29113,
14468,
2,
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,
220,
220,
220,
22... | 2.038462 | 598 |
from ctypes import *
import ctypes
SharedBuffer = SharedBuffer_def(10,1.0,b"Hola")
print("Size of Shared Buffer : %d \n"%(sizeof(SharedBuffer)))
SHM_name = "testSHM3"
from multiprocessing import shared_memory, resource_tracker
shm = shared_memory.SharedMemory(name=SHM_name, size=sizeof(SharedBuffer), create=False... | [
6738,
269,
19199,
1330,
1635,
198,
11748,
269,
19199,
198,
198,
2484,
1144,
28632,
796,
39403,
28632,
62,
4299,
7,
940,
11,
16,
13,
15,
11,
65,
1,
39,
5708,
4943,
198,
198,
4798,
7203,
10699,
286,
39403,
47017,
1058,
220,
4064,
67,
... | 2.599278 | 277 |
#!/usr/bin/env python3
"""
Benchmark on the struct module for FASTCALL.
http://bugs.python.org/issue29300
Created at 2017-02-02 by Victor STINNER.
"""
import pyperf
runner = pyperf.Runner()
runner.timeit('int.to_bytes(1, 4, "little")',
'to_bytes(1, 4, "little")',
setup='to_bytes = int.t... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
37811,
198,
44199,
4102,
319,
262,
2878,
8265,
329,
376,
1921,
4825,
7036,
13,
198,
198,
4023,
1378,
32965,
13,
29412,
13,
2398,
14,
21949,
1959,
6200,
198,
198,
41972,
379,
2177,
... | 2.102459 | 244 |
import contextlib
import textwrap
import secrets
import subprocess
import pathlib
import functools
import pytest
import portend
import requests
import jaraco.envs
import munch
from twine import settings
@pytest.fixture()
@pytest.fixture()
def make_settings(pypirc):
"""Returns a factory function for settings.S... | [
11748,
4732,
8019,
198,
11748,
2420,
37150,
198,
11748,
13141,
198,
11748,
850,
14681,
198,
11748,
3108,
8019,
198,
11748,
1257,
310,
10141,
198,
198,
11748,
12972,
9288,
198,
11748,
2493,
437,
198,
11748,
7007,
198,
11748,
17379,
10602,
... | 2.34903 | 361 |
from coalib.bearlib.abstractions.Linter import linter
from dependency_management.requirements.DistributionRequirement import (
DistributionRequirement)
from coalib.results.RESULT_SEVERITY import RESULT_SEVERITY
from coalib.settings.Setting import typed_list
@linter(executable='cppcheck',
use_stdout=False,... | [
6738,
5655,
571,
13,
33227,
8019,
13,
397,
8709,
507,
13,
43,
3849,
1330,
300,
3849,
198,
6738,
20203,
62,
27604,
13,
8897,
18883,
13,
20344,
3890,
16844,
24615,
1330,
357,
198,
220,
220,
220,
27484,
16844,
24615,
8,
198,
6738,
5655,
... | 2.247967 | 738 |
# Necessary imports. Provides library functions to ease writing tests.
from lib import prebuild, testcase, SUBMITTY_INSTALL_DIR
import subprocess
import os
import glob
############################################################################
# COPY THE ASSIGNMENT FROM THE SAMPLE ASSIGNMENTS DIRECTORIES
SAMPLE_AS... | [
2,
19652,
408,
560,
17944,
13,
47081,
5888,
5499,
284,
10152,
3597,
5254,
13,
198,
6738,
9195,
1330,
662,
11249,
11,
1332,
7442,
11,
28932,
36393,
9936,
62,
38604,
7036,
62,
34720,
198,
198,
11748,
850,
14681,
198,
11748,
28686,
198,
... | 3.528796 | 191 |
# -*- coding: utf-8 -*-
import os
import sphinx_rtd_theme
# sys.path.insert(0, os.path.abspath('.'))
def get_version():
"""
:return: # The short X.Y version.
"""
return ".".join(os.environ.get('MFMODULE_VERSION',
'unknown.unknown').split('.')[0:-1])
def get_releas... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
28686,
198,
11748,
599,
20079,
87,
62,
81,
8671,
62,
43810,
198,
2,
25064,
13,
6978,
13,
28463,
7,
15,
11,
28686,
13,
6978,
13,
397,
2777,
776,
10786,
26... | 3.031128 | 2,827 |
import os
from datetime import datetime
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
virtualenv_path = '/usr/lib/ckan'
def test_dynamic_menu(host):
"""Test menu.json is prepopulated with old ... | [
11748,
28686,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
198,
11748,
1332,
10745,
430,
13,
26791,
13,
504,
856,
62,
16737,
198,
198,
9288,
10745,
430,
62,
4774,
82,
796,
1332,
10745,
430,
13,
26791,
13,
504,
856,
62,
16737,
13,
2... | 2.716912 | 272 |
__author__ = 'traff'
import threading
import os
import sys
import tempfile
from _prof_imports import Stats, FuncStat, Function
try:
execfile=execfile #Not in Py3k
except NameError:
#We must redefine it in Py3k if it's not already there
| [
834,
9800,
834,
796,
705,
9535,
487,
6,
198,
198,
11748,
4704,
278,
198,
11748,
28686,
198,
11748,
25064,
198,
11748,
20218,
7753,
198,
6738,
4808,
5577,
62,
320,
3742,
1330,
20595,
11,
11138,
66,
17126,
11,
15553,
198,
198,
28311,
25... | 2.94186 | 86 |
#!/usr/bin/python3
from gui import Gui
if __name__ == '__main__':
Gui.run()
| [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
6738,
11774,
1330,
1962,
72,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
1962,
72,
13,
5143,
3419,
198
] | 2.25 | 36 |
import bs4
import json
import os
import requests
from utils import (get_content, get_soup, create_dir, write_image, save_json)
BASE_URL = 'https://www.shonenjump.com'
RENSAI_URL = BASE_URL + '/j/rensai/'
ARCHIVES_URL = RENSAI_URL + 'archives.html'
LIST_URL = RENSAI_URL + 'list/'
if __name__ == '__main__':
shonen... | [
11748,
275,
82,
19,
198,
11748,
33918,
198,
11748,
28686,
198,
11748,
7007,
198,
198,
6738,
3384,
4487,
1330,
357,
1136,
62,
11299,
11,
651,
62,
82,
10486,
11,
2251,
62,
15908,
11,
3551,
62,
9060,
11,
3613,
62,
17752,
8,
198,
198,
... | 2.451128 | 133 |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""
Module that contains different graphic items
"""
from __future__ import print_function, division, absolute_import
from Qt.QtCore import Qt, Signal, QObject, QPoint, QPointF
from Qt.QtWidgets import QGraphicsItem
from Qt.QtGui import QColor
class BaseGraphicsItem(... | [
2,
0,
1220,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
37811,
198,
26796,
326,
4909,
1180,
13028,
3709,
198,
37811,
198,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
... | 2.715278 | 288 |
import datetime
import numpy as np
import networkx as nx
import concurrent.futures
from functools import partial
PRINT_TIME=False
def disc(samples1, samples2, kernel, is_parallel=True, *args, **kwargs):
''' Discrepancy between 2 samples '''
d = 0
if not is_parallel:
for s1 in samples1:
for s2 in s... | [
11748,
4818,
8079,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
3127,
87,
355,
299,
87,
198,
11748,
24580,
13,
69,
315,
942,
198,
6738,
1257,
310,
10141,
1330,
13027,
198,
4805,
12394,
62,
34694,
28,
25101,
628,
628,
198,
198,
4299... | 2.482004 | 1,417 |
# -*- coding: utf-8 -*-
"""
Created on Tue Jul 25 10:42:21 2017
@author: Keerthi
"""
#from subseq_gen import subseq_rule
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
201,
198,
37811,
201,
198,
41972,
319,
30030,
5979,
1679,
838,
25,
3682,
25,
2481,
2177,
201,
198,
201,
198,
31,
9800,
25,
3873,
263,
400,
72,
201,
198,
37811,
201,
198,
... | 1.541985 | 131 |
from .metrics.sequence_labeling import classification_report, precision_recall_fscore_support | [
6738,
764,
4164,
10466,
13,
43167,
62,
18242,
278,
1330,
17923,
62,
13116,
11,
15440,
62,
8344,
439,
62,
69,
26675,
62,
11284
] | 4.043478 | 23 |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | [
2,
16529,
1783,
10541,
198,
2,
15069,
357,
66,
8,
5413,
10501,
13,
1439,
2489,
10395,
13,
198,
2,
49962,
739,
262,
17168,
13789,
13,
4091,
13789,
13,
14116,
287,
262,
1628,
6808,
329,
5964,
1321,
13,
198,
2,
16529,
1783,
10541,
198,... | 3.339019 | 469 |
# -*- coding: utf-8 -*-
"""
Created on Tue Dec 02 17:32:15 2014
@author: jaco_da
"""
import unittest
from sqpdfo.runtime import *
from sqpdfo.sqpdfo_global_variables import set_threshold, set_check_condition
from sqpdfo.sqpdfo import sqpdfo_
from numpy import array, zeros, arange, double
from numpy.testing import as... | [
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
30030,
4280,
7816,
1596,
25,
2624,
25,
1314,
1946,
198,
198,
31,
9800,
25,
474,
10602,
62,
6814,
198,
37811,
198,
198,
11748,
555,
715,
39... | 2.001943 | 4,633 |
# -*- coding: utf-8 -*-
# snapshottest: v1 - https://goo.gl/zC4yUc
from __future__ import unicode_literals
from pysnap import Snapshot
snapshots = Snapshot()
snapshots['TestJestConfig.test_read[BIN] 1'] = {'/srv/unittests/node_modules/.bin/jest'}
snapshots['TestJestConfig.test_read[CONFIG_FILE] 1'] = {'jest.config... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
11495,
1477,
24879,
25,
410,
16,
532,
3740,
1378,
42469,
13,
4743,
14,
89,
34,
19,
88,
52,
66,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
19... | 2.432584 | 178 |
# File: Q (Python 2.4)
from pandac.PandaModules import *
mainStoryTier = [
'MainStory',
'Chapter 1',
'Chapter 2',
'Chapter 3']
mainStoryTier2 = [
'RavenCoveStory']
weaponUnlockTier = [
'WeaponDoll',
'WeaponDagger',
'WeaponGrenade',
'WeaponStaff']
level4WeaponTier = [
'PirateLore... | [
2,
9220,
25,
1195,
357,
37906,
362,
13,
19,
8,
198,
198,
6738,
19798,
330,
13,
47,
5282,
5841,
5028,
1330,
1635,
198,
12417,
11605,
35252,
796,
685,
198,
220,
220,
220,
705,
13383,
11605,
3256,
198,
220,
220,
220,
705,
14126,
352,
... | 2.36862 | 529 |
# -*- coding: utf-8 -*-
"""Generate a default configuration-file section for fn_sentinelone"""
def config_section_data():
"""
Produce add the default configuration section to app.config,
for fn_sentinelone when called by `resilient-circuits config [-c|-u]`
"""
config_data = None
config_data ... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
37811,
8645,
378,
257,
4277,
8398,
12,
7753,
2665,
329,
24714,
62,
34086,
20538,
505,
37811,
628,
198,
4299,
4566,
62,
5458,
62,
7890,
33529,
198,
220,
220,
220,
... | 3.522505 | 511 |
import sys
import os
import warnings
from random import randint
from collections import OrderedDict
import numpy as np
import pytest
from mmgroup import MM0, MMSpace, MMV
from mmgroup.generators import gen_leech3_op_vector_word
from mmgroup.clifford12 import leech3matrix_echelon
from mmgroup.clifford12 import leech3... | [
11748,
25064,
198,
11748,
28686,
198,
11748,
14601,
198,
198,
6738,
4738,
1330,
43720,
600,
198,
6738,
17268,
1330,
14230,
1068,
35,
713,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
12972,
9288,
198,
198,
6738,
8085,
8094,
1330,
... | 2.504619 | 1,732 |
import jwt
from django.conf import settings
from datetime import datetime, timedelta
JWT_SECRET = settings.SECRET_KEY
JWT_ALGORITHM = settings.JWT_ALGORITHM
JWT_EXP_DELTA_SECONDS = settings.JWT_EXP_DELTA_SECONDS
COOKIE_MAX_AGE = 365 * 24 * 60 * 60
| [
11748,
474,
46569,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
4818,
8079,
1330,
4818,
8079,
11,
28805,
12514,
198,
198,
41,
39386,
62,
23683,
26087,
796,
6460,
13,
23683,
26087,
62,
20373,
198,
41,
39386,
62,
1847,
38,
... | 2.171875 | 128 |
# coding: utf-8
# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------... | [
198,
2,
19617,
25,
3384,
69,
12,
23,
198,
2,
16529,
45537,
198,
2,
15069,
357,
66,
8,
5413,
10501,
13,
1439,
2489,
10395,
13,
198,
2,
49962,
739,
262,
17168,
13789,
13,
4091,
13789,
13,
14116,
287,
262,
1628,
6808,
329,
198,
2,
... | 3.940909 | 220 |
from models2 import Department, Employee, db
from app2 import app
db.drop_all()
db.create_all()
d1 = Department(dept_code="mktg", dept_name="Marketing",phone="897-9999")
d2 = Department(dept_code="acct", dept_name="Accounting",phone="111-5429")
river = Employee(name="River Bottom", state="NY", dept_code="mktg")
summe... | [
6738,
4981,
17,
1330,
2732,
11,
36824,
11,
20613,
198,
6738,
598,
17,
1330,
598,
198,
198,
9945,
13,
14781,
62,
439,
3419,
198,
9945,
13,
17953,
62,
439,
3419,
198,
198,
67,
16,
796,
2732,
7,
2934,
457,
62,
8189,
2625,
76,
21841,
... | 2.651786 | 224 |
import torch
from torch.utils.data import DataLoader, Dataset
from PIL import Image
from torchvision import transforms
import torchvision.transforms.functional as FT
import os
from random import randint
import numpy as np
import random
from utils import decode_segmap
opj = os.path.join
if __nam... | [
11748,
28034,
201,
198,
6738,
28034,
13,
26791,
13,
7890,
1330,
6060,
17401,
11,
16092,
292,
316,
201,
198,
6738,
350,
4146,
1330,
7412,
201,
198,
6738,
28034,
10178,
1330,
31408,
201,
198,
11748,
28034,
10178,
13,
7645,
23914,
13,
4512... | 2.518717 | 187 |
from django.test import TestCase, Client
from django.conf import settings
# Create your tests here.
from feeds.models import Source, Post, Enclosure, WebProxy
from feeds.utils import read_feed, find_proxies, get_proxy, fix_relative
from django.utils import timezone
from django.urls import reverse
from datetime impor... | [
6738,
42625,
14208,
13,
9288,
1330,
6208,
20448,
11,
20985,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
198,
2,
13610,
534,
5254,
994,
13,
198,
6738,
21318,
13,
27530,
1330,
8090,
11,
2947,
11,
2039,
17966,
11,
5313,
44148,
1... | 2.300341 | 293 |
import datetime
import json
import discord
from discord.ext import commands
| [
11748,
4818,
8079,
198,
11748,
33918,
198,
198,
11748,
36446,
198,
6738,
36446,
13,
2302,
1330,
9729,
628,
198
] | 4.157895 | 19 |
# Copyright (C) 2020-2022 The opuntiaOS Project Authors.
# + Contributed by Nikita Melekhin <nimelehin@gmail.com>
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from Parser.Parser import Parser
from Generator.IRManager import IRManager
from Generator.BinWriter... | [
2,
15069,
357,
34,
8,
12131,
12,
1238,
1828,
383,
1034,
2797,
544,
2640,
4935,
46665,
13,
198,
2,
220,
1343,
2345,
6169,
416,
11271,
5350,
2185,
293,
14636,
259,
1279,
77,
524,
293,
20079,
31,
14816,
13,
785,
29,
198,
2,
220,
198,... | 3.394231 | 104 |
# Define here the models for your scraped items
#
# See documentation in:
# https://docs.scrapy.org/en/latest/topics/items.html
import scrapy
# class ProductScraperItem(scrapy.Item):
# # define the fields for your item here like:
# # name = scrapy.Field()
# pass
| [
2,
2896,
500,
994,
262,
4981,
329,
534,
15881,
276,
3709,
198,
2,
198,
2,
4091,
10314,
287,
25,
198,
2,
3740,
1378,
31628,
13,
1416,
2416,
88,
13,
2398,
14,
268,
14,
42861,
14,
4852,
873,
14,
23814,
13,
6494,
198,
198,
11748,
15... | 2.79 | 100 |
#!/usr/bin/env python
# Copyright 2019 Google LLC
#
# 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... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
2,
15069,
13130,
3012,
11419,
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,
... | 2.852535 | 1,085 |
"""
1772. Sort Features by Popularity
Medium
You are given a string array features where features[i] is a single word that represents the name of a feature of the latest product you are working on. You have made a survey where users have reported which features they like. You are given a string array responses, where ... | [
37811,
198,
1558,
4761,
13,
33947,
17571,
416,
22623,
414,
198,
31205,
198,
198,
1639,
389,
1813,
257,
4731,
7177,
3033,
810,
3033,
58,
72,
60,
318,
257,
2060,
1573,
326,
6870,
262,
1438,
286,
257,
3895,
286,
262,
3452,
1720,
345,
3... | 3.885781 | 429 |
import hashlib
import os
os.chdir('C:/Users/Sai Charan/Desktop/Studies/522-Advance_Data_Mining/PROJECT')
output_file_path = "OUTPUT.txt"
input_file_path = "FINALOP.txt"
#2
completed_lines_hash = set()
#3
output_file = open(output_file_path, "w")
#4
for line in open(input_file_path, "r"):
#5
hashValue = hashlib.md... | [
11748,
12234,
8019,
198,
11748,
28686,
198,
198,
418,
13,
354,
15908,
10786,
34,
14079,
14490,
14,
50,
1872,
3178,
272,
14,
36881,
14,
45833,
14,
49542,
12,
2782,
19259,
62,
6601,
62,
44,
3191,
14,
31190,
23680,
11537,
198,
198,
22915... | 3.451477 | 474 |
#=========================================================================
'''
Project:Lecture - Structural Wind Engineering WS16-17
Chair of Structural Analysis @ TUM - A. Michalski, R. Wuchner, M. Pentek
MDoF system solver using direct time integration - Generalized-Alpha Schemem,
a monolithic form... | [
2,
23926,
2559,
28,
198,
7061,
6,
198,
16775,
25,
43,
478,
495,
532,
32112,
1523,
3086,
14044,
25290,
1433,
12,
1558,
198,
220,
220,
220,
220,
220,
220,
220,
9369,
286,
32112,
1523,
14691,
2488,
309,
5883,
532,
317,
13,
2843,
874,
... | 3.583333 | 360 |
# Write_a_function
# Created by JKChang
# 14/08/2018, 10:58
# Tag:
# Description: https://www.hackerrank.com/challenges/write-a-function/problem
# In the Gregorian calendar three criteria must be taken into account to identify leap years:
# The year can be evenly divided by 4, is a leap year, unless:
# The year can be... | [
2,
19430,
62,
64,
62,
8818,
198,
2,
15622,
416,
449,
42,
1925,
648,
198,
2,
1478,
14,
2919,
14,
7908,
11,
838,
25,
3365,
198,
2,
17467,
25,
198,
2,
12489,
25,
3740,
1378,
2503,
13,
31153,
8056,
962,
13,
785,
14,
36747,
34120,
... | 3.246667 | 150 |
"""Tests of the optimization trajectory comparison workflow.
Scientific Machine Learning Benchmark:
A benchmark of regression models in chem- and materials informatics.
2020, Citrine Informatics.
"""
import pytest
pytest.importorskip("sklearn")
import smlb
def test_optimization_trajectories():
"""Ensure that ... | [
37811,
51,
3558,
286,
262,
23989,
22942,
7208,
30798,
13,
198,
198,
23010,
811,
10850,
18252,
25187,
4102,
25,
198,
32,
18335,
286,
20683,
4981,
287,
4607,
12,
290,
5696,
4175,
23372,
13,
198,
42334,
11,
15792,
7640,
554,
18982,
873,
... | 2.880753 | 478 |
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from app.api.config import SQLALCHEMY_DATABASE_URI
from app.api.models import Base
# Create our sqlite3 database
engine = create_engine(
SQLALCHEMY_DATABASE_URI,
# By default SQLite will only allow one thread to communicate with it,... | [
6738,
44161,
282,
26599,
1330,
2251,
62,
18392,
198,
6738,
44161,
282,
26599,
13,
579,
1330,
6246,
10297,
198,
198,
6738,
598,
13,
15042,
13,
11250,
1330,
16363,
1847,
3398,
3620,
56,
62,
35,
1404,
6242,
11159,
62,
47269,
198,
6738,
5... | 3.374502 | 251 |
"""TD3-BC agent configuration."""
import dataclasses
from typing import Optional
from acme.adders import reverb as adders_reverb
import optax
@dataclasses.dataclass
class TD3BCConfig:
"""TD3-BC configuration."""
policy_optimizer: Optional[optax.GradientTransformation] = None
critic_optimizer: Optional[o... | [
37811,
21016,
18,
12,
2749,
5797,
8398,
526,
15931,
198,
11748,
4818,
330,
28958,
198,
6738,
19720,
1330,
32233,
198,
198,
6738,
936,
1326,
13,
45940,
1330,
302,
19011,
355,
751,
364,
62,
260,
19011,
198,
11748,
2172,
897,
628,
198,
3... | 2.869333 | 375 |
"""
separate personal standard groups.
Revision ID: 2a6c63397399
Revises: 9fd4589cc82c
Create Date: 2018-05-23 17:17:51.205891
"""
import sqlalchemy as sa
from alembic import op
from alembic.context import get_context # noqa: F401
from sqlalchemy.dialects.postgresql.base import PGDialect
from sqlalchemy.orm.session ... | [
37811,
198,
25512,
378,
2614,
3210,
2628,
13,
198,
198,
18009,
1166,
4522,
25,
362,
64,
21,
66,
21,
29626,
4790,
2079,
198,
18009,
2696,
25,
860,
16344,
2231,
4531,
535,
6469,
66,
198,
16447,
7536,
25,
2864,
12,
2713,
12,
1954,
1596... | 2.35485 | 2,804 |
"""
Read and write data of go-eCharger wallbox.
"""
import os
import logging
import requests
import plugin_collection
log = logging.getLogger("GoEcharger")
class goeDevice():
''' Phases
0b00ABCDEF
A ... phase 3, in front of the contactor
B ... phase 2 in front of the contactor
C ... | [
37811,
198,
5569,
290,
3551,
1366,
286,
467,
12,
68,
28316,
263,
3355,
3524,
13,
198,
37811,
198,
11748,
28686,
198,
11748,
18931,
198,
11748,
7007,
198,
198,
11748,
13877,
62,
43681,
198,
198,
6404,
796,
18931,
13,
1136,
11187,
1362,
... | 2.362768 | 419 |
import math
import mindspore
from mindspore.common.parameter import Parameter
import mindspore.nn as nn
import mindspore.ops as ops
from mindspore.common.initializer import initializer, HeUniform, Uniform, _calculate_fan_in_and_fan_out | [
11748,
10688,
198,
11748,
2000,
2777,
382,
198,
6738,
2000,
2777,
382,
13,
11321,
13,
17143,
2357,
1330,
25139,
2357,
198,
11748,
2000,
2777,
382,
13,
20471,
355,
299,
77,
198,
11748,
2000,
2777,
382,
13,
2840,
355,
39628,
198,
6738,
... | 3.219178 | 73 |
import uuid
import time
import enum
| [
11748,
334,
27112,
198,
11748,
640,
198,
11748,
33829,
198
] | 3.6 | 10 |
import torch
import numpy as np
from typing import Any
from typing import Dict
from typing import Union
from typing import Optional
from cftool.ml import Metrics
from cftool.misc import is_numeric
from cftool.misc import timing_context
from ...misc.toolkit import *
from ..base import ModelBase
from ...types import t... | [
11748,
28034,
198,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
19720,
1330,
4377,
198,
6738,
19720,
1330,
360,
713,
198,
6738,
19720,
1330,
4479,
198,
6738,
19720,
1330,
32233,
198,
6738,
269,
701,
970,
13,
4029,
1330,
3395,
104... | 3.176768 | 198 |
# -*- coding: utf-8
from django.apps import AppConfig
import os
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
198,
6738,
42625,
14208,
13,
18211,
1330,
2034,
16934,
198,
11748,
28686,
628
] | 2.826087 | 23 |
from dataclasses import dataclass
from viewdom import html
from viewdom_wired import component
@component()
@dataclass
@component()
@dataclass
| [
6738,
4818,
330,
28958,
1330,
4818,
330,
31172,
198,
198,
6738,
1570,
3438,
1330,
27711,
198,
6738,
1570,
3438,
62,
44236,
1330,
7515,
628,
198,
31,
42895,
3419,
198,
31,
19608,
330,
31172,
628,
198,
31,
42895,
3419,
198,
31,
19608,
3... | 3.363636 | 44 |
import PIL.Image as Image
import numpy as np
import tensorflow as tf
import tensorflow_hub as hub
from ..main import image_analysis | [
11748,
350,
4146,
13,
5159,
355,
7412,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
11748,
11192,
273,
11125,
62,
40140,
355,
12575,
198,
198,
6738,
11485,
12417,
1330,
2939,
62,
20930
] | 3.473684 | 38 |
import datetime
from task_base import TaskBase
# Cohen-Sutherland implementation | [
11748,
4818,
8079,
198,
6738,
4876,
62,
8692,
1330,
15941,
14881,
198,
198,
2,
17154,
12,
50,
45384,
7822
] | 4.263158 | 19 |
import serial.rs485
import libscrc
import sys
sPort = 'COM4'
req_init = "000300fc0000842b000300fc0000842b"
req_ids_loop = ["ff4306064246ff4306064246", "ff5006003381",
"ff500601f241", "ff500602b240", "ff5006037380", "ff5006043242", "ff500605f382"]
req_data = bytes.fromhex("030029001b")
req_bat_active... | [
11748,
11389,
13,
3808,
32642,
198,
11748,
9195,
1416,
6015,
198,
11748,
25064,
198,
198,
82,
13924,
796,
705,
9858,
19,
6,
198,
42180,
62,
15003,
796,
366,
830,
6200,
16072,
2388,
23,
3682,
65,
830,
6200,
16072,
2388,
23,
3682,
65,
... | 1.998295 | 1,173 |
from turtle import *
import turtle
CoderMohit = turtle.Screen()
CoderMohit.bgcolor('white')
for angle in range (0,360,15):
setheading(angle)
forward(100)
write(str(angle)+'`')
backward(100)
CoderMohit.mainloop() | [
6738,
28699,
1330,
1635,
201,
198,
11748,
28699,
201,
198,
34,
12342,
38443,
270,
796,
28699,
13,
23901,
3419,
201,
198,
201,
198,
34,
12342,
38443,
270,
13,
35904,
8043,
10786,
11186,
11537,
201,
198,
201,
198,
201,
198,
1640,
9848,
... | 2.346154 | 104 |
# -*- coding: utf-8 -*-
"""
Execution module to handle MetalK8s sysctl.
"""
import configparser
import pathlib
from salt.exceptions import CommandExecutionError
import salt.utils.files
__virtualname__ = "metalk8s_sysctl"
# Order in this list defines the precedence
SYSCTL_CFG_DIRECTORIES = [
"/run/sysctl.d",
... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
23002,
1009,
8265,
284,
5412,
12136,
42,
23,
82,
25064,
34168,
13,
198,
37811,
198,
198,
11748,
4566,
48610,
198,
11748,
3108,
8019,
198,
198,
6738,
8268,
13... | 2.411726 | 1,535 |
import rospy
from rospy import TransportException
from tf2_msgs.msg import TFMessage
from tf2_ros import TransformListener, InvalidArgumentException, TimeoutException, Buffer
from tf2_server.srv import RequestTransformStream, RequestTransformStreamRequest, RequestTransformStreamResponse
| [
11748,
686,
2777,
88,
198,
6738,
686,
2777,
88,
1330,
19940,
16922,
198,
6738,
48700,
17,
62,
907,
14542,
13,
19662,
1330,
24958,
12837,
198,
6738,
48700,
17,
62,
4951,
1330,
26981,
33252,
11,
17665,
28100,
1713,
16922,
11,
3862,
448,
... | 4.25 | 68 |
from .form import BarcodeForm
from .reader import InputDeviceReader
| [
6738,
764,
687,
1330,
2409,
8189,
8479,
198,
6738,
764,
46862,
1330,
23412,
24728,
33634,
628,
198
] | 4.117647 | 17 |
""" Plugin related endpoints """
| [
37811,
42636,
3519,
886,
13033,
37227,
198
] | 4.714286 | 7 |
import os, aiohttp
import urllib.parse
from bs4 import BeautifulSoup
| [
11748,
28686,
11,
257,
952,
4023,
198,
11748,
2956,
297,
571,
13,
29572,
198,
6738,
275,
82,
19,
1330,
23762,
50,
10486,
198,
220,
220,
220,
220,
198,
220,
220,
220,
220,
198
] | 2.393939 | 33 |
#! /usr/bin/env python
#
#
# Calculates coordinates of window corners of given raster dataset.
# It's just a simple helper for testing and debugging WKT Raster.
#
##############################################################################
# Copyright (C) 2009 Mateusz Loskot <mateusz@loskot.net>
#
# This program is ... | [
2,
0,
1220,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
198,
2,
198,
2,
27131,
689,
22715,
286,
4324,
14371,
286,
1813,
374,
1603,
27039,
13,
198,
2,
632,
338,
655,
257,
2829,
31904,
329,
4856,
290,
28769,
370,
42176,
371,
1603,
13... | 2.893137 | 1,020 |
#!/usr/bin/env python3
"""
@Filename: detections.py
@Author: dulanj
@Time: 19/02/2022 09:33
"""
import logging
import os
import time
import cv2
from sports_event_detection.extras.params import database_update_frequency, save_video
from sports_event_detection.utils.storage import Storage
from sports_eve... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
37811,
198,
31,
35063,
25,
220,
220,
220,
4886,
507,
13,
9078,
198,
31,
13838,
25,
220,
220,
220,
220,
220,
288,
377,
272,
73,
198,
31,
7575,
25,
220,
220,
220,
220,
220,
220... | 3 | 147 |
"""This program will flip a coin repeatedly, keeping track of heads and tails.
By Ted Silbernagel
"""
import random
from typing import Any
if __name__ == '__main__':
print('This program will flip a coin and keep track of how many heads/tails you got.')
flip_coin()
| [
37811,
1212,
1430,
481,
14283,
257,
10752,
7830,
11,
5291,
2610,
286,
6665,
290,
30514,
13,
198,
3886,
11396,
4243,
33900,
363,
417,
198,
37811,
198,
198,
11748,
4738,
198,
6738,
19720,
1330,
4377,
628,
628,
198,
361,
11593,
3672,
834,
... | 3.558442 | 77 |
#!/usr/bin/env python
"""Compress the hashes list using Golomb coding."""
import math
import sys
from bitstring import BitArray, Bits, BitStream
import gflags
FLAGS = gflags.FLAGS
gflags.DEFINE_integer("hash_length", 8, "Length of each hash in bytes.")
gflags.DEFINE_integer("two_power", 47, "Power of 2 for M (M=2*... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
37811,
7293,
601,
262,
46621,
1351,
1262,
26849,
2381,
19617,
526,
15931,
198,
198,
11748,
10688,
198,
11748,
25064,
198,
198,
6738,
1643,
8841,
1330,
4722,
19182,
11,
44733,
11,
4722,
1... | 2.313333 | 1,950 |
# This file is part of Viper - https://github.com/viper-framework/viper
# See the file 'LICENSE' for copying permission.
import os
import sys
import glob
import atexit
import readline
import traceback
import requests
import json
import argparse
from viper.common.out import print_error
from viper.common.colors import ... | [
2,
770,
2393,
318,
636,
286,
34517,
532,
3740,
1378,
12567,
13,
785,
14,
8903,
525,
12,
30604,
14,
8903,
525,
198,
2,
4091,
262,
2393,
705,
43,
2149,
24290,
6,
329,
23345,
7170,
13,
198,
198,
11748,
28686,
198,
11748,
25064,
198,
... | 3 | 431 |
import requests
import json
from urllib.request import urlopen
from bs4 import BeautifulSoup
from multiprocessing import Pool
from model import Reviews
"""from
VARIABLES
"""
header={
'Accept':'*/*',
'Accept-Encoding':'gzip, deflate',
'Accept-Language':'en-US,en;q=0.5',
'Content-Length':'5... | [
11748,
7007,
198,
11748,
33918,
198,
6738,
2956,
297,
571,
13,
25927,
1330,
19016,
9654,
198,
198,
6738,
275,
82,
19,
1330,
23762,
50,
10486,
198,
6738,
18540,
305,
919,
278,
1330,
19850,
198,
6738,
2746,
1330,
20871,
198,
37811,
6738,
... | 2.033926 | 619 |
import datetime
import pandas as pd
from vc.data_io import files
# Object to hold Brazilian cities temperature data.
| [
11748,
4818,
8079,
201,
198,
201,
198,
11748,
19798,
292,
355,
279,
67,
201,
198,
6738,
410,
66,
13,
7890,
62,
952,
1330,
3696,
201,
198,
201,
198,
201,
198,
2,
9515,
284,
1745,
17036,
4736,
5951,
1366,
13,
201,
198
] | 3.097561 | 41 |
# Copyright 2021 The LUCI Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file.
from recipe_engine.post_process import StepSuccess, LogEquals, StepTextEquals
from recipe_engine.post_process import StepException, StepFailure
fr... | [
2,
15069,
33448,
383,
406,
9598,
40,
46665,
13,
1439,
2489,
10395,
13,
198,
2,
5765,
286,
428,
2723,
2438,
318,
21825,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
198,
2,
326,
460,
307,
1043,
287,
262,
38559,
24290,
2393,
13,
... | 3.353846 | 130 |
import os
from typing import List
from PyQt5.QtGui import QFont, QPixmap
from PyQt5.QtWidgets import (
QTabWidget, QGridLayout, QLabel,
QPushButton, QDialog, QMessageBox,
QStyleFactory
)
from PyQt5.QtCore import Qt, pyqtSignal
import emoji
from serial import SerialException
from mindpong.view.utils impo... | [
11748,
28686,
198,
6738,
19720,
1330,
7343,
198,
198,
6738,
9485,
48,
83,
20,
13,
48,
83,
8205,
72,
1330,
1195,
23252,
11,
1195,
47,
844,
8899,
198,
6738,
9485,
48,
83,
20,
13,
48,
83,
54,
312,
11407,
1330,
357,
198,
220,
220,
2... | 2.705179 | 251 |
# (C) Datadog, Inc. 2018-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
import pytest
from datadog_checks.elastic.metrics import (
health_stats_for_version,
node_system_stats_for_version,
pshard_stats_for_version,
stats_for_version,
)
@pytest.mark.unit
@pyte... | [
2,
357,
34,
8,
16092,
324,
519,
11,
3457,
13,
2864,
12,
25579,
198,
2,
1439,
2489,
10395,
198,
2,
49962,
739,
257,
513,
12,
565,
682,
347,
10305,
3918,
5964,
357,
3826,
38559,
24290,
8,
198,
11748,
12972,
9288,
198,
198,
6738,
481... | 1.825692 | 2,312 |
# -*- coding: utf-8 -*-
# Copyright © Spyder Project Contributors
# Licensed under the terms of the MIT License
# (see spyder/__init__.py for details)
"""Kite install utilities test."""
# Local imports
import os
import re
import sys
# Third-party imports
import pytest
# Local imports
from spyder.plugins.completion... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
15069,
10673,
23688,
1082,
4935,
25767,
669,
198,
2,
49962,
739,
262,
2846,
286,
262,
17168,
13789,
198,
2,
357,
3826,
13997,
1082,
14,
834,
15003,
834,
13,
90... | 2.974659 | 513 |
from neurogym.wrappers.monitor import Monitor
from neurogym.wrappers.noise import Noise
from neurogym.wrappers.pass_reward import PassReward
from neurogym.wrappers.pass_action import PassAction
from neurogym.wrappers.reaction_time import ReactionTime
from neurogym.wrappers.side_bias import SideBias
from neurogym.wrappe... | [
6738,
7669,
1360,
76,
13,
29988,
11799,
13,
41143,
1330,
18289,
198,
6738,
7669,
1360,
76,
13,
29988,
11799,
13,
3919,
786,
1330,
30964,
198,
6738,
7669,
1360,
76,
13,
29988,
11799,
13,
6603,
62,
260,
904,
1330,
6251,
48123,
198,
6738... | 2.373786 | 412 |
import json
import os
import shutil
import subprocess
from pathlib import Path
import pytest
from .helpers import create, get_umamba, random_string
@pytest.fixture(scope="session")
| [
11748,
33918,
198,
11748,
28686,
198,
11748,
4423,
346,
198,
11748,
850,
14681,
198,
6738,
3108,
8019,
1330,
10644,
198,
198,
11748,
12972,
9288,
198,
198,
6738,
764,
16794,
364,
1330,
2251,
11,
651,
62,
388,
31842,
11,
4738,
62,
8841,
... | 3.315789 | 57 |
from time import sleep
import socket
import threading
'''import dominate
def create_doc():
doc = dominate.document(title="My favorite page")
with doc:
with tags.div():
tags.attr(cls="body")
tags.p("lorem ipsum")
'''
if __name__ == "__main__":
main()
| [
6738,
640,
1330,
3993,
198,
11748,
17802,
198,
11748,
4704,
278,
198,
7061,
6,
11748,
17863,
198,
198,
4299,
2251,
62,
15390,
33529,
198,
220,
220,
220,
2205,
796,
17863,
13,
22897,
7,
7839,
2625,
3666,
4004,
2443,
4943,
198,
220,
220... | 2.387097 | 124 |
from lexibank_deepadungpalaung import Dataset
from lingpy import *
from lingpy.compare.partial import Partial
wl = Wordlist.from_cldf(Dataset().cldf_dir.joinpath('cldf-metadata.json'))
i = 0
for idx, tokens in wl.iter_rows('tokens'):
#print(idx, tokens)
for segment in tokens.n:
if not segment:
... | [
6738,
31191,
571,
962,
62,
22089,
324,
2150,
18596,
1942,
70,
1330,
16092,
292,
316,
198,
6738,
18459,
9078,
1330,
1635,
198,
6738,
18459,
9078,
13,
5589,
533,
13,
47172,
1330,
43689,
198,
198,
40989,
796,
9678,
4868,
13,
6738,
62,
66... | 2.067686 | 916 |
import couchdb
import logging
log = logging.getLogger(__name__)
# merges d2 in d1, keeps values from d1
# taken from scilifelab
def merge(d1, d2):
""" Will merge dictionary d2 into dictionary d1.
On the case of finding the same key, the one in d1 will be used.
:param d1: Dictionary object
:param s2... | [
11748,
18507,
9945,
198,
11748,
18931,
198,
198,
6404,
796,
18931,
13,
1136,
11187,
1362,
7,
834,
3672,
834,
8,
628,
628,
198,
2,
4017,
3212,
288,
17,
287,
288,
16,
11,
7622,
3815,
422,
288,
16,
198,
2,
2077,
422,
629,
346,
361,
... | 2.060209 | 382 |
import os
import random
from pathlib import Path, PosixPath
from typing import Any, List, Set
import pytest
from pytest_envvars.django_utils import get_base_envvars, is_django_project
def pytest_addoption(parser):
"""Parse pytest.ini env_files section"""
group = parser.getgroup("envvars")
group.addoptio... | [
11748,
28686,
198,
11748,
4738,
198,
6738,
3108,
8019,
1330,
10644,
11,
18574,
844,
15235,
198,
6738,
19720,
1330,
4377,
11,
7343,
11,
5345,
198,
198,
11748,
12972,
9288,
198,
198,
6738,
12972,
9288,
62,
24330,
85,
945,
13,
28241,
14208... | 2.304275 | 1,801 |
# Copyright 2016-present CERN – European Organization for Nuclear Research
#
# 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... | [
2,
220,
220,
220,
220,
15069,
1584,
12,
25579,
327,
28778,
784,
3427,
12275,
329,
19229,
4992,
198,
2,
198,
2,
220,
220,
220,
220,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
220,
2... | 2.82009 | 2,001 |
from PyInstaller.utils.hooks import (
collect_data_files,
copy_metadata,
collect_submodules
)
datas = copy_metadata('kivymd')
hiddenimports = collect_submodules('kivymd')
datas = collect_data_files('kivymd') | [
6738,
9485,
15798,
263,
13,
26791,
13,
25480,
82,
1330,
357,
198,
220,
220,
220,
2824,
62,
7890,
62,
16624,
11,
220,
198,
220,
220,
220,
4866,
62,
38993,
11,
198,
220,
220,
220,
2824,
62,
7266,
18170,
198,
8,
198,
198,
19608,
292,... | 2.611765 | 85 |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
# @Author: Jialiang Shi
from sonarqube.utils.rest_client import RestClient
from sonarqube.utils.config import (
API_USERS_SEARCH_ENDPOINT,
API_USERS_CREATE_ENDPOINT,
API_USERS_UPDATE_ENDPOINT,
API_USERS_CHANGE_PASSWORD_ENDPOINT,
API_USERS_GROUPS_ENDPOINT,... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
40477,
12,
23,
532,
9,
12,
198,
2,
2488,
13838,
25,
449,
498,
15483,
16380,
198,
6738,
3367,
283,
421,
1350,
13,
26791,
13,
2118,
62,
16366,
1330,
8324,
... | 2.404136 | 1,789 |
import pandas as pd
import numpy as np
from keras.utils import np_utils
class PhaseDataset(object):
"""
PhaseDataset
"""
phases = ['regP', 'regS', 'tele', 'N']
x_indices = ['PER', 'RECT', 'PLANS', 'INANG1', 'INANG3', 'HMXMN', 'HVRATP', 'HVRAT', 'NAB', 'TAB',
'HTOV1', 'HTOV2', 'HTOV... | [
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
41927,
292,
13,
26791,
1330,
45941,
62,
26791,
198,
198,
4871,
18983,
27354,
292,
316,
7,
15252,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
1898... | 1.81983 | 2,592 |
# -*- coding: utf-8 -*- {{{
# vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et:
#
# Copyright 2020, Battelle Memorial Institute.
#
# 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... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
22935,
90,
198,
2,
43907,
25,
900,
277,
12685,
28,
40477,
12,
23,
10117,
28,
29412,
1509,
28,
19,
40379,
28,
19,
39747,
28,
19,
2123,
25,
198,
2,
198,
2,
15069,
12131,
... | 2.184738 | 15,162 |
import pytest
from ...utilities import colors
| [
11748,
12972,
9288,
198,
198,
6738,
2644,
315,
2410,
1330,
7577,
628,
628
] | 3.846154 | 13 |
import rospy
from sensor_msgs.msg import Image
from std_msgs.msg import Int16
from cv_bridge import CvBridge
import cv2
import numpy as np
# pip install pillow
from PIL import Image
from tensorflow.examples.tutorials.mnist import input_data
import tensorflow as tf
if __name__ == '__main__':
#rospy.i... | [
11748,
686,
2777,
88,
198,
6738,
12694,
62,
907,
14542,
13,
19662,
1330,
7412,
198,
6738,
14367,
62,
907,
14542,
13,
19662,
1330,
2558,
1433,
198,
6738,
269,
85,
62,
9458,
1330,
327,
85,
37385,
198,
11748,
269,
85,
17,
198,
11748,
2... | 2.588957 | 163 |
# Refaça o DESAFIO 051, lendo o primeiro termo e a razão de uma PA,
# mostrando os 10 primeiros termos da progressão usando a estrutura while.
p = int(input('Primeiro termo:'))
r = int(input('Razão pa:'))
i = 1
s = 10
c = 1
print('{}!'.format(p), end=' = ')
print(p, end=' => ')
while i != 0:
while s != 1:
p... | [
2,
6524,
64,
50041,
267,
22196,
8579,
9399,
657,
4349,
11,
22096,
78,
267,
6994,
7058,
3381,
78,
304,
257,
374,
1031,
28749,
390,
334,
2611,
8147,
11,
198,
2,
749,
25192,
78,
28686,
838,
6994,
72,
4951,
3381,
418,
12379,
4371,
28749... | 2.145594 | 261 |
# -*- coding: utf-8 -*-
from memcached_status import view
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
1066,
66,
2317,
62,
13376,
1330,
1570,
198
] | 2.521739 | 23 |
# The web functionality
import pork | [
2,
383,
3992,
11244,
198,
198,
11748,
18128
] | 4.5 | 8 |
# -*- coding: utf-8 -*-
# @Time : 2021/1/3
# @Author : Lart Pang
# @GitHub : https://github.com/lartpang
import os
import re
from openpyxl import Workbook, load_workbook
from openpyxl.utils import get_column_letter
from openpyxl.worksheet.worksheet import Worksheet
# Thanks:
# - Python_Openpyxl: https://www.cn... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2488,
7575,
220,
220,
220,
1058,
33448,
14,
16,
14,
18,
198,
2,
2488,
13838,
220,
1058,
406,
433,
350,
648,
198,
2,
2488,
38,
270,
16066,
220,
1058,
3740,
1378,
... | 2.413408 | 179 |
# Copyright 2018, Erlang Solutions Ltd, and S2HC Sweden AB
#
# 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... | [
2,
15069,
2864,
11,
5256,
17204,
23555,
12052,
11,
290,
311,
17,
16045,
10710,
9564,
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,
... | 2.793154 | 1,373 |
from tkinter import *
from quiz_brain import QuizBrain
THEME_COLOR = "#375362"
FONT = ("Arial", 20, "italic")
# def call_check_answer(self) -> str:
# is_correct = self.quiz.check_answer()
# if is_correct:
# print('You are right!')
# return 'True'
# else:
# ... | [
6738,
256,
74,
3849,
1330,
1635,
198,
6738,
38964,
62,
27825,
1330,
2264,
528,
44687,
198,
198,
4221,
3620,
36,
62,
46786,
796,
25113,
22318,
35667,
1,
198,
37,
35830,
796,
5855,
32,
4454,
1600,
1160,
11,
366,
1287,
291,
4943,
628,
... | 2.088398 | 181 |
from pyboltzmann.generic_classes import *
from .binary_tree import BinaryTree
__all__ = ["CombinatorialClass",
"ZeroAtomClass",
"LAtomClass",
"UAtomClass",
"ProdClass",
"SetClass",
"DerivedClass",
"LDerivedClass",
"UDerived... | [
6738,
12972,
25593,
89,
9038,
13,
41357,
62,
37724,
1330,
1635,
198,
6738,
764,
39491,
62,
21048,
1330,
45755,
27660,
198,
834,
439,
834,
796,
14631,
20575,
20900,
498,
9487,
1600,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220... | 1.815451 | 233 |
# Ke Chen
# knutchen@ucsd.edu
# HTS-AT: A HIERARCHICAL TOKEN-SEMANTIC AUDIO TRANSFORMER FOR SOUND CLASSIFICATION AND DETECTION
# Convert the DESED dataset
import numpy as np
import os
import librosa
import config
from utils import float32_to_int16
import soundfile as sf
if __name__ == '__main__':
main()
| [
2,
3873,
12555,
198,
2,
638,
315,
6607,
31,
1229,
21282,
13,
15532,
198,
2,
367,
4694,
12,
1404,
25,
317,
36210,
1137,
31315,
20151,
5390,
43959,
12,
50,
3620,
8643,
2149,
41260,
9399,
44069,
21389,
1137,
7473,
311,
15919,
42715,
3064... | 2.845455 | 110 |