content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
from django.contrib import admin
from .models import Composition, Contest, Vote, Content
admin.site.register(Content)
admin.site.register(Composition)
admin.site.register(Contest)
admin.site.register(Vote)
| [
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
6738,
764,
27530,
1330,
955,
9150,
11,
27297,
11,
19175,
11,
14041,
198,
198,
28482,
13,
15654,
13,
30238,
7,
19746,
8,
198,
28482,
13,
15654,
13,
30238,
7,
5377,
9150,
8,
198,
28... | 3.393443 | 61 |
import threading
import typing
import nacl.signing
import time
import typing as tp
import logging.config
from .istation import IStation, StationData, STATION_VERSION, Measurement
from ..drivers.sds011 import SDS011_MODEL, SDS011
from collections import deque
from connectivity.config.logging import LOGGING_CONFIG
logg... | [
11748,
4704,
278,
198,
11748,
19720,
198,
11748,
299,
37779,
13,
12683,
278,
198,
11748,
640,
198,
11748,
19720,
355,
256,
79,
198,
11748,
18931,
13,
11250,
198,
198,
6738,
764,
396,
341,
1330,
314,
12367,
11,
9327,
6601,
11,
3563,
62... | 3.202614 | 153 |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
from app.models.Model import Model
from flask_restful import abort
import sqlite3
"""
A class that factorizes the behavior of models used for the API
"""
# | [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
598,
13,
27530,
13,
17633,
1330,
9104,
198,
6738,
42903,
62,
2118,
913,
1330,
15614,
198,
11748,
44161,
578,
18,
1... | 3.045455 | 66 |
"""
* The Lock class controls multiple servos to latch the door shut before the rocket spins up.
* Author: Aaron Borger <aborger@nnu.edu (307)534-6265>
"""
from devices.device import Device
import RPi.GPIO as GPIO
SERVO_PIN = 14
ZERO = 2.5
NINETY = 7.5
ONE_EIGHTY = 12.5
| [
37811,
198,
198,
9,
383,
13656,
1398,
6973,
3294,
1113,
418,
284,
43140,
262,
3420,
4423,
878,
262,
10701,
37621,
510,
13,
198,
198,
9,
6434,
25,
12139,
12182,
1362,
1279,
4820,
1362,
31,
20471,
84,
13,
15532,
357,
22996,
8,
20,
268... | 2.715686 | 102 |
'''
Generate features for outlier detection.
'''
import json
import sys
from certstream_analytics.analysers import WordSegmentation
from certstream_analytics.analysers import IDNADecoder
from certstream_analytics.analysers import FeaturesGenerator
def main(max_count=None):
'''
The record is assumed to be sto... | [
7061,
6,
198,
8645,
378,
3033,
329,
503,
2505,
13326,
13,
198,
7061,
6,
198,
198,
11748,
33918,
198,
11748,
25064,
198,
198,
6738,
5051,
5532,
62,
38200,
14094,
13,
272,
26266,
364,
1330,
9678,
41030,
14374,
198,
6738,
5051,
5532,
62,... | 2.363218 | 435 |
import torch
import numpy as np
from torch.nn import functional as F
import torch.nn as nn
from torch.autograd import Variable
| [
11748,
28034,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
28034,
13,
20471,
1330,
10345,
355,
376,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
6738,
28034,
13,
2306,
519,
6335,
1330,
35748,
628,
628,
198
] | 3.540541 | 37 |
# -*- coding: utf-8 -*-
import numpy
#only accept order = numpy.nan or 0
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
299,
32152,
628,
198,
2,
8807,
2453,
1502,
796,
299,
32152,
13,
12647,
393,
657,
628
] | 2.451613 | 31 |
from .storage import DatabaseManager | [
6738,
764,
35350,
1330,
24047,
13511
] | 6 | 6 |
if __name__ == "__main__":
main()
| [
628,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
1388,
3419,
198
] | 2.1 | 20 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import ConfigParser
from helpers import get_abs_path
DEFAULT_CFG_FILEPATH = 'locust-swarm.cfg'
DEFAULT_MASTER_ROLE_NAME = 'locust-master'
DEFAULT_SLAVE_ROLE_NAME = 'locust-slave'
DEFAULT_MASTER_BOOTSTRAP_DIR = './bootstrap-master'
DEFAULT_SLAVE_BOOTSTRAP_DIR = './bootstr... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
17056,
46677,
198,
6738,
49385,
1330,
651,
62,
8937,
62,
6978,
628,
198,
7206,
38865,
62,
22495,
38,
62,
... | 2.425414 | 181 |
#-------by HYH -------#
import numpy as np
pCan=0.001
pNon=0.999
pPosCan=0.8
pPosNon=0.1
z='positive'
if 'positive'==z:
p=[pPosCan*pCan,pPosNon*pNon]
else:
p=[(1-pPosCan)*pCan,(1-pPosNon)*pNon]
p=p/np.sum(p)
print('The probability of having cancer given the %s test:\n'% z,'\n',p[0])
print('The probability of cancer f... | [
2,
26866,
1525,
43624,
39,
35656,
2,
198,
11748,
299,
32152,
355,
45941,
198,
79,
6090,
28,
15,
13,
8298,
198,
79,
15419,
28,
15,
13,
17032,
198,
79,
21604,
6090,
28,
15,
13,
23,
198,
79,
21604,
15419,
28,
15,
13,
16,
198,
89,
... | 2.182927 | 164 |
import argparse, os, sys
from nit import generate_tile, generate_tile_from_initials, generate_initials_from_string
my_parser = argparse.ArgumentParser(prog="name initials tile generator",
usage="$(prog)s [options] name save_path",
description="Gen... | [
11748,
1822,
29572,
11,
28686,
11,
25064,
198,
6738,
13759,
1330,
7716,
62,
40927,
11,
7716,
62,
40927,
62,
6738,
62,
36733,
82,
11,
7716,
62,
36733,
82,
62,
6738,
62,
8841,
198,
198,
1820,
62,
48610,
796,
1822,
29572,
13,
28100,
17... | 2.641148 | 418 |
import pandas as pd
labels = pd.read_csv('../Fusion_dummy_His_MUT_joined.csv', header=0)
# line = pd.read_csv('../../Line1.csv', header=0)
line = pd.read_csv('../EC_cyclin_expression.csv', header=0)
# line['name'] = line['Proteomics_Participant_ID']
# line = line.drop(['Proteomics_Participant_ID', 'Histologic_type', ... | [
11748,
19798,
292,
355,
279,
67,
198,
198,
23912,
1424,
796,
279,
67,
13,
961,
62,
40664,
10786,
40720,
37,
4241,
62,
67,
13513,
62,
6653,
62,
44,
3843,
62,
46416,
13,
40664,
3256,
13639,
28,
15,
8,
198,
2,
1627,
796,
279,
67,
1... | 2.285199 | 554 |
#Ler o ano de nascimento de um jovem e verificar se ele está na hora de alistar, se está muito cedo
#para isso ou já passou do momento certo
from datetime import date
nascimento = int(input("Digite o ano do seu nascimento: "));
sexo = str(input("Você é homem ou mulher? Digite H para homem e M se for mulher: ")).u... | [
2,
43,
263,
267,
281,
78,
390,
299,
3372,
3681,
78,
390,
23781,
474,
659,
76,
304,
3326,
811,
283,
384,
9766,
1556,
6557,
12385,
3076,
64,
390,
435,
47229,
11,
384,
1556,
6557,
285,
5013,
78,
269,
24757,
201,
198,
2,
1845,
64,
3... | 2.146091 | 486 |
from click.testing import CliRunner
import os
import py
import pytest
import builtins
import sys
from typing import Any
from tests import DATA_DIR
from xaitk_saliency.utils.bin.sal_on_coco_dets import sal_on_coco_dets
from importlib.util import find_spec
deps = ['kwcoco']
specs = [find_spec(dep) for dep in deps]
is... | [
6738,
3904,
13,
33407,
1330,
1012,
72,
49493,
198,
11748,
28686,
198,
11748,
12972,
198,
11748,
12972,
9288,
198,
11748,
3170,
1040,
198,
11748,
25064,
198,
6738,
19720,
1330,
4377,
198,
198,
6738,
5254,
1330,
42865,
62,
34720,
198,
198,
... | 2.372131 | 1,830 |
from setuptools import find_packages, setup
import pathlib as pl
DISTNAME = "gumbi"
DESCRIPTION = "Gaussian Process Model Building Interface"
AUTHOR = "John Goertz"
AUTHOR_EMAIL = ""
URL = "https://github.com/JohnGoertz/Gumbi"
LICENSE = "Apache 2.0"
PROJECT_ROOT = pl.Path(__file__).resolve().parent
REQUIRE... | [
6738,
900,
37623,
10141,
1330,
1064,
62,
43789,
11,
9058,
201,
198,
11748,
3108,
8019,
355,
458,
201,
198,
201,
198,
35,
8808,
20608,
796,
366,
70,
2178,
72,
1,
201,
198,
30910,
40165,
796,
366,
35389,
31562,
10854,
9104,
11819,
26491... | 2.609555 | 607 |
""" Cisco_IOS_XR_mpls_te_datatypes
This module contains a collection of generally useful
derived YANG data types.
Copyright (c) 2013\-2017 by Cisco Systems, Inc.
All rights reserved.
"""
from collections import OrderedDict
from ydk.types import Entity, EntityPath, Identity, Enum, YType, YLeaf, YLeafList, YList, Le... | [
37811,
28289,
62,
40,
2640,
62,
55,
49,
62,
76,
489,
82,
62,
660,
62,
19608,
265,
9497,
220,
198,
198,
1212,
8265,
4909,
257,
4947,
286,
4143,
4465,
198,
34631,
575,
15567,
1366,
3858,
13,
198,
198,
15269,
357,
66,
8,
2211,
41441,... | 2.19214 | 6,412 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2018-05-05 01:00
from __future__ import unicode_literals
from django.db import migrations
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2980,
515,
416,
37770,
352,
13,
1157,
319,
2864,
12,
2713,
12,
2713,
5534,
25,
405,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
6738,... | 2.754717 | 53 |
"""
Advent of Code: Day 03 Part 1
tldr: most prevalent bit
"""
from collections import defaultdict
if __name__ == "__main__":
main()
| [
37811,
198,
2782,
1151,
286,
6127,
25,
3596,
7643,
2142,
352,
198,
83,
335,
81,
25,
749,
21854,
1643,
198,
37811,
628,
198,
6738,
17268,
1330,
4277,
11600,
628,
628,
628,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
... | 2.959184 | 49 |
#!/usr/bin/env python3
#
# Scrape reports from https://crsreports.congress.gov.
#
# This site provides many of the same reports that
# are available through our own archive, but only as
# PDFs and only with versions as of the site launch
# date and going forward.
from collections import OrderedDict
import datetime
imp... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
198,
2,
1446,
13484,
3136,
422,
3740,
1378,
66,
3808,
48922,
13,
36801,
601,
13,
9567,
13,
198,
2,
198,
2,
770,
2524,
3769,
867,
286,
262,
976,
3136,
326,
198,
2,
389,
169... | 2.961538 | 338 |
# Create a light and set its specular color to bright green.
#
import pyvista as pv
light = pv.Light()
light.specular_color = '#00FF00'
light.specular_color
# Expected:
## (0.0, 1.0, 0.0)
| [
2,
13610,
257,
1657,
290,
900,
663,
1020,
934,
3124,
284,
6016,
4077,
13,
198,
2,
198,
11748,
12972,
85,
12523,
355,
279,
85,
198,
2971,
796,
279,
85,
13,
15047,
3419,
198,
2971,
13,
4125,
10440,
62,
8043,
796,
705,
2,
405,
5777,
... | 2.540541 | 74 |
import logging
from operator import attrgetter
from pathlib import Path
from typing import List
from opennem.db import get_database_engine
from opennem.db.views.queries import (
get_all_views_query,
get_query_drop_view,
get_view_unique_index_query,
)
from .continuous_aggregates import (
create_continu... | [
11748,
18931,
198,
6738,
10088,
1330,
708,
81,
1136,
353,
198,
6738,
3108,
8019,
1330,
10644,
198,
6738,
19720,
1330,
7343,
198,
198,
6738,
1280,
77,
368,
13,
9945,
1330,
651,
62,
48806,
62,
18392,
198,
6738,
1280,
77,
368,
13,
9945,
... | 2.323944 | 2,556 |
#!/usr/bin/env python
#
# Copyright 2017 Phedorabot
#
# 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,
2,
198,
2,
15069,
2177,
350,
704,
273,
397,
313,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
345,
743,
198,
2,
407,
779,
... | 3.041369 | 1,402 |
#!/usr/bin/env python2.6
"""
Unit test of web.claims application as a complete Django WSGI web service.
"""
from __future__ import print_function
import unittest
import httplib
import urllib2, urllib
import logging, sys
import os.path
import datetime
import base64
import subprocess, time
import json
logger= logging.ge... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
17,
13,
21,
198,
37811,
198,
26453,
1332,
286,
3992,
13,
6604,
82,
3586,
355,
257,
1844,
37770,
25290,
18878,
3992,
2139,
13,
198,
37811,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,... | 2.39961 | 1,026 |
# Generated by Django 2.1.7 on 2019-03-21 13:17
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
362,
13,
16,
13,
22,
319,
13130,
12,
3070,
12,
2481,
1511,
25,
1558,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
# -*- coding: utf-8 -*-
"""
Conversion factors and units, in cgs. To convert a given value, in cgs, to the desired units,
divide by that unit.
Example:
The speed of light in km·s⁻¹ would be
c_km = c / km
"""
# length
cm = 1.
m = 1e2
km = 1e5
AU = 1.4959787066e13
ly = 9.460730472e17
pc = 3.0856776e18
kpc = 1e3 * pc... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
3103,
9641,
5087,
290,
4991,
11,
287,
269,
14542,
13,
1675,
10385,
257,
1813,
1988,
11,
287,
269,
14542,
11,
284,
262,
10348,
4991,
11,
198,
7146,
485,
416... | 1.943734 | 391 |
import openml
import numpy as np
from sklearn.ensemble import RandomForestClassifier
from sklearn.compose import ColumnTransformer
from sklearn.preprocessing import StandardScaler, OneHotEncoder
| [
11748,
1280,
4029,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
1341,
35720,
13,
1072,
11306,
1330,
14534,
34605,
9487,
7483,
198,
6738,
1341,
35720,
13,
785,
3455,
1330,
29201,
8291,
16354,
198,
6738,
1341,
35720,
13,
3866,
36948,
1330... | 3.96 | 50 |
''' Utilities for manipulating package-level settings. '''
import json
from pathlib import Path
import os
from io import open
import warnings
from .utils import listify
__all__ = ['set_option', 'set_options', 'get_option']
_config_name = 'pybids_config.json'
conf_path = str(Path(__file__).absolute().parent.joinpat... | [
7061,
6,
41086,
329,
29349,
5301,
12,
5715,
6460,
13,
705,
7061,
198,
198,
11748,
33918,
198,
6738,
3108,
8019,
1330,
10644,
198,
11748,
28686,
198,
6738,
33245,
1330,
1280,
198,
11748,
14601,
198,
198,
6738,
764,
26791,
1330,
1351,
195... | 2.481818 | 1,320 |
"""
Keyword extraction methods.
These accept lists of strings as arguments.
"""
from .pos import POSTokenizer
from .rake import RAKETokenizer
from .apriori import AprioriTokenizer
from .overkill import OverkillTokenizer
| [
37811,
198,
9218,
4775,
22236,
5050,
13,
198,
4711,
2453,
8341,
286,
13042,
355,
7159,
13,
198,
37811,
198,
198,
6738,
764,
1930,
1330,
24582,
4233,
7509,
198,
6738,
764,
33788,
1330,
371,
10206,
2767,
4233,
7509,
198,
6738,
764,
499,
... | 3.683333 | 60 |
from pm4py.algo.filtering.log.attributes import attributes_filter
from pm4py.algo.filtering.log.end_activities import end_activities_filter
from pm4py.algo.filtering.log.start_activities import start_activities_filter
from pm4py.algo.filtering.log.variants import variants_filter
from pm4py.objects.conversion.log import... | [
6738,
9114,
19,
9078,
13,
282,
2188,
13,
10379,
20212,
13,
6404,
13,
1078,
7657,
1330,
12608,
62,
24455,
198,
6738,
9114,
19,
9078,
13,
282,
2188,
13,
10379,
20212,
13,
6404,
13,
437,
62,
15791,
871,
1330,
886,
62,
15791,
871,
62,
... | 3.07672 | 378 |
# coding: utf-8
from abc import ABCMeta, abstractmethod
| [
2,
19617,
25,
3384,
69,
12,
23,
198,
198,
6738,
450,
66,
1330,
9738,
48526,
11,
12531,
24396,
628,
628
] | 3 | 20 |
# -*- coding: utf-8 -*-
import re
import scrapy
from scrapy.crawler import CrawlerProcess
from scrapy.linkextractors.lxmlhtml import LxmlLinkExtractor
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
302,
198,
11748,
15881,
88,
198,
6738,
15881,
88,
13,
66,
39464,
1330,
20177,
1754,
18709,
198,
6738,
15881,
88,
13,
2815,
365,
742,
974,
669,
13,
75,
19875,
64... | 2.903846 | 52 |
from wildfireassessment.ops import * #my package
import numpy as np
import matplotlib.pyplot as plt
from pathlib import Path
from skimage import morphology
from skimage.transform import resize
import pandas as pd
import geopandas as gpd
import pickle
from sklearn.impute import SimpleImputer
from sklearn.ensemble import... | [
6738,
44508,
562,
21687,
13,
2840,
1330,
1635,
1303,
1820,
5301,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
6738,
3108,
8019,
1330,
10644,
198,
6738,
1341,
9060,
1330,
46320,
1... | 2.055123 | 2,957 |
# -*- coding: utf-8 -*-
# !/usr/bin/env python3
"""
@author: zhuyuehui
@contact: zhuyuehui02@meituan.com
@time: 2021/11/6 12:57 下午
"""
name = "PyAirwave"
from .PyAirwave import AirWave
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
5145,
14,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
37811,
198,
31,
9800,
25,
1976,
71,
4669,
518,
71,
9019,
198,
31,
32057,
25,
1976,
71,
4669,
518,
71,
9019,
... | 2.043956 | 91 |
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
setup(name = 'Adafruit_CharLCD',
version = '1.0.0',
author = 'Tony DiCola',
author_email = 'tdicola@adafruit.com',
description = 'Library to drive character LCD display and plate.',
license = 'M... | [
6738,
304,
89,
62,
40406,
1330,
779,
62,
2617,
37623,
10141,
198,
1904,
62,
2617,
37623,
10141,
3419,
198,
6738,
900,
37623,
10141,
1330,
9058,
11,
1064,
62,
43789,
198,
198,
40406,
7,
3672,
220,
197,
197,
197,
197,
28,
705,
2782,
1... | 2.408163 | 245 |
import explorerhat as eh
from time import sleep
CHAR_TABLE = [['1','2','3'],['4','5','6'],['7','8','9'],['*','0','#']]
while True:
ch = decode_key(key_pressed(), CHAR_TABLE)
print('%s pressed' % ch)
wait_for_release()
sleep(0.1)
| [
11748,
39349,
5183,
355,
32622,
198,
6738,
640,
1330,
3993,
198,
198,
38019,
62,
38148,
796,
16410,
6,
16,
41707,
17,
41707,
18,
6,
4357,
17816,
19,
41707,
20,
41707,
21,
6,
4357,
17816,
22,
41707,
23,
41707,
24,
6,
4357,
17816,
9,
... | 2.330275 | 109 |
# Name: Linsey Schaap
# Student number: 11036109
"""
This script convert a csv file into a JSON format.
"""
import csv
import json
csvbestand = open("reizigerskilometers.csv", "r")
jsonbestand = open("reizigerskilometers.json", "w")
namen = ("Vervoerswijze", "Periode", "Provincie", "Afstand")
bestand = csv.DictRead... | [
2,
6530,
25,
5164,
4397,
35756,
499,
198,
2,
13613,
1271,
25,
9796,
2623,
14454,
198,
37811,
198,
1212,
4226,
10385,
257,
269,
21370,
2393,
656,
257,
19449,
5794,
13,
198,
37811,
198,
198,
11748,
269,
21370,
198,
11748,
33918,
628,
19... | 2.752874 | 174 |
from . import data, update_handlers | [
6738,
764,
1330,
1366,
11,
4296,
62,
4993,
8116
] | 3.888889 | 9 |
"""Unit tests for pyatv.protocols.mrp.variant."""
import pytest
from pyatv.support.variant import read_variant, write_variant
| [
37811,
26453,
5254,
329,
12972,
265,
85,
13,
11235,
4668,
82,
13,
43395,
79,
13,
25641,
415,
526,
15931,
198,
11748,
12972,
9288,
198,
198,
6738,
12972,
265,
85,
13,
11284,
13,
25641,
415,
1330,
1100,
62,
25641,
415,
11,
3551,
62,
2... | 2.770833 | 48 |
#!/usr/bin/env python3'
# coding = utf-8
########################################################################################
##
## Maintainer: stefan.kull@gmail.com
## Inspired by: https://github.com/somervda/ourbotmanager_ros.git
##
## Input: Analog potentiometer 1 + 2 + 3 (+4 )
## Output: micro-ROS node (ROS2) ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
6,
198,
2,
19617,
796,
3384,
69,
12,
23,
198,
29113,
29113,
14468,
7804,
198,
2235,
198,
2235,
337,
2913,
10613,
25,
336,
891,
272,
13,
74,
724,
31,
14816,
13,
785,
198,
2235,
45827... | 2.967235 | 763 |
RAW_QUEUES = {
"example_timed_set": {
"job_factory": lambda rawparam: {
"path": "example.Print",
"params": {
"test": rawparam
}
}
}
} | [
20530,
62,
48,
8924,
35409,
796,
1391,
198,
220,
366,
20688,
62,
16514,
276,
62,
2617,
1298,
1391,
198,
220,
220,
220,
366,
21858,
62,
69,
9548,
1298,
37456,
8246,
17143,
25,
1391,
198,
220,
220,
220,
220,
220,
366,
6978,
1298,
366,... | 1.965517 | 87 |
"""
Functions to download example data from public repositories.
"""
from .base import InputFiles, InputFilesWithSession
import os
import os.path as op
from pathlib import Path
def get_s3_register(subject_id, site, raw_keys, deriv_keys):
"""Get the S3 keys for a single subject's input files
Parameters
... | [
37811,
198,
24629,
2733,
284,
4321,
1672,
1366,
422,
1171,
38072,
13,
198,
198,
37811,
198,
6738,
764,
8692,
1330,
23412,
25876,
11,
23412,
25876,
3152,
36044,
198,
11748,
28686,
198,
11748,
28686,
13,
6978,
355,
1034,
198,
6738,
3108,
... | 2.038864 | 10,601 |
import os
import boto3
AMI = os.environ['AMI']
INSTANCE_TYPE = os.environ['INSTANCE_TYPE']
KEY_NAME = os.environ['KEY_NAME']
SUBNET_ID = os.environ['SUBNET_ID']
ec2 = boto3.resource('ec2')
| [
11748,
28686,
198,
11748,
275,
2069,
18,
198,
198,
43870,
796,
28686,
13,
268,
2268,
17816,
43870,
20520,
198,
38604,
19240,
62,
25216,
796,
28686,
13,
268,
2268,
17816,
38604,
19240,
62,
25216,
20520,
198,
20373,
62,
20608,
796,
28686,
... | 2.358025 | 81 |
############################################################
# -*- coding: utf-8 -*-
#
# # # # # # #
# ## ## # ## # #
# # # # # # # # # # #
# # ## # ## ## ######
# # # # # # #
#
# Python-based Tool for interaction with the 10micron mounts
# GUI with PyQT5 fo... | [
29113,
14468,
7804,
4242,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
198,
2,
220,
220,
220,
220,
220,
220,
1303,
220,
220,
1303,
220,
1303,
220,
220,
1303,
220,
220,
1303,
220,
220,
220,
1303,
198,
2,... | 2.891089 | 404 |
import re
import renderer
LINK_PATTERN = re.compile(r'(^|\s)(http(?:s)?://[^ \<]+\w)')
class LinkRenderer(renderer.RenderBase):
'''
Converts standalone http or https links in text into the Markdown
equivalent, so
lorem ipsum http://www.example.com, etc
becomes
lorem ipsum [h... | [
198,
198,
11748,
302,
198,
198,
11748,
9851,
11882,
628,
198,
198,
43,
17248,
62,
47,
1404,
31800,
796,
302,
13,
5589,
576,
7,
81,
6,
7,
61,
91,
59,
82,
5769,
4023,
7,
27514,
82,
19427,
1378,
58,
61,
3467,
27,
48688,
59,
86,
8... | 2.420382 | 157 |
import niGraphParser
import niGraph
import sys
import glob
import os
import random
import time
import re
from matplotlib import pyplot
import networkx as nx
import networkx.algorithms.shortest_paths.dense as dense
import xml.etree.ElementTree as ET
import networkx.algorithms.simple_paths as nxPaths
graphsDir = "..\Da... | [
11748,
37628,
37065,
46677,
198,
11748,
37628,
37065,
198,
198,
11748,
25064,
198,
11748,
15095,
198,
11748,
28686,
198,
11748,
4738,
198,
11748,
640,
198,
11748,
302,
198,
6738,
2603,
29487,
8019,
1330,
12972,
29487,
198,
11748,
3127,
87,
... | 2.661905 | 210 |
#------------------------------------------------------
# import
#------------------------------------------------------
import os
import cv2
#------------------------------------------------------
# global
#------------------------------------------------------
LINE_COLOR = (0, 0, 255)
LINE_THICKNESS = 10
FONT_STYLE... | [
2,
3880,
19351,
438,
198,
2,
1330,
198,
2,
3880,
19351,
438,
198,
11748,
28686,
198,
11748,
269,
85,
17,
198,
198,
2,
3880,
19351,
438,
198,
2,
3298,
198,
2,
3880,
19351,
438,
198,
24027,
62,
46786,
796,
357,
15,
11,
657,
11,
14... | 3.979167 | 144 |
import os
| [
11748,
28686,
628
] | 3.666667 | 3 |
import csv
import argparse
parser = argparse.ArgumentParser(description='parameters for cleaning a csv file')
parser.add_argument(
'--columns',
type=int,
nargs="+",
default=[],
help="The columns to remove. Usage: --rows 0 1 10 25",
)
parser.add_argument(
'--file',
type=str,
default=... | [
11748,
269,
21370,
198,
11748,
1822,
29572,
198,
198,
48610,
796,
1822,
29572,
13,
28100,
1713,
46677,
7,
11213,
11639,
17143,
7307,
329,
12724,
257,
269,
21370,
2393,
11537,
198,
198,
48610,
13,
2860,
62,
49140,
7,
198,
220,
220,
220,
... | 2.537102 | 283 |
#! /usr/bin/env python
# -*- coding:utf-8 -*-
__author__ = ["Rachel P. B. Moraes", "Igor Montagner", "Fabio Miranda"]
import rospy
import numpy as np
import tf
import math
import cv2
import time
from geometry_msgs.msg import Twist, Vector3, Pose
from nav_msgs.msg import Odometry
from sensor_msgs.msg import Image, Co... | [
2,
0,
1220,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
40477,
12,
23,
532,
9,
12,
198,
198,
834,
9800,
834,
796,
14631,
44045,
350,
13,
347,
13,
3461,
64,
274,
1600,
366,
40,
7053,
5575,
363,
1008,
1600,
... | 2.67284 | 324 |
###################################################
# 智能小车1.0 -- 舵机模块
#
# @author chenph
# @date 2018/5/15
###################################################
import RPi.GPIO as GPIO
import time
# 初始模块
# 舵机左转
# 舵机右转
if __name__ == "__main__":
try:
... | [
29113,
14468,
21017,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
10545,
247,
118,
47797,
121,
22887,
237,
164,
121,
99,
16,
13,
15,
1377,
5525,
230,
113,
17312,
118,
162,
101,
94,
161,
251,
245,
... | 1.806691 | 269 |
# -*- coding: utf-8 -*-
import pytest
from darjeeling.core import (TestOutcome,
TestCoverage,
FileLine,
FileLineSet)
@pytest.fixture
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
12972,
9288,
198,
198,
6738,
288,
283,
18015,
10809,
13,
7295,
1330,
357,
14402,
7975,
2958,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220... | 1.602837 | 141 |
# coding=utf-8
# Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless re... | [
2,
19617,
28,
40477,
12,
23,
198,
2,
15069,
357,
66,
8,
13130,
11,
15127,
23929,
44680,
6234,
13,
220,
1439,
2489,
10395,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198... | 2.127071 | 9,294 |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
@author: julian
Read (and write?) molden .freq files
"""
import numpy
import string
from molsys.util.constants import angstrom, kcalmol
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
17,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
31,
9800,
25,
474,
377,
666,
220,
220,
198,
5569,
357,
392,
3551,
10091,
15936,
268,
764,
19503,
80,
... | 2.60274 | 73 |
################################################################################
# Author: Fanyang Cheng
# Date: 04/07/2021
# Description: This program read the weekly gas average price txt file as input
# and draw a graph for to show the data.
###########################################################################... | [
29113,
29113,
14468,
198,
2,
6434,
25,
376,
1092,
648,
27692,
198,
2,
7536,
25,
8702,
14,
2998,
14,
1238,
2481,
198,
2,
12489,
25,
770,
1430,
1100,
262,
10273,
3623,
2811,
2756,
256,
742,
2393,
355,
5128,
198,
2,
290,
3197,
257,
4... | 4.360825 | 97 |
# JSON API classes
import brainspell
from article_helpers import *
from base_handler import *
from search_helpers import *
from user_account_helpers import *
# For GitHub OAuth
import requests
import urllib.parse
import os
import hashlib
REQ_DESC = "The fields to search through. 'x' is experiments, 'p' is PMID, 'r' ... | [
2,
19449,
7824,
6097,
198,
198,
11748,
14290,
23506,
198,
6738,
2708,
62,
16794,
364,
1330,
1635,
198,
6738,
2779,
62,
30281,
1330,
1635,
198,
6738,
2989,
62,
16794,
364,
1330,
1635,
198,
6738,
2836,
62,
23317,
62,
16794,
364,
1330,
1... | 2.314132 | 4,288 |
#!/usr/bin/env python3
# This file is covered by the LICENSE file in the root of this project.
import imp
import os
import time
import numpy as np
from matplotlib import pyplot as plt
import torch
import torch.backends.cudnn as cudnn
from torch import nn
import __init__ as booger
from tasks.semantic.modules.segment... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
770,
2393,
318,
5017,
416,
262,
38559,
24290,
2393,
287,
262,
6808,
286,
428,
1628,
13,
198,
198,
11748,
848,
198,
11748,
28686,
198,
11748,
640,
198,
198,
11748,
299,
32152,
... | 3.071429 | 126 |
import random
import settings
import finance_utils
import asyncio
import aiohttp
from time import strftime
from datetime import date
from sanic import Sanic, response
from sanic.response import json
app = Sanic()
@app.route('/vitruvina', methods=['POST'])
if __name__ == '__main__':
app.run(host='0.0.0.0... | [
11748,
4738,
198,
11748,
6460,
198,
11748,
9604,
62,
26791,
220,
198,
11748,
30351,
952,
198,
11748,
257,
952,
4023,
628,
198,
6738,
640,
1330,
965,
31387,
198,
6738,
4818,
8079,
1330,
3128,
198,
198,
6738,
5336,
291,
1330,
2986,
291,
... | 2.853448 | 116 |
# flake8: noqa
"""
Copyright 2020 - Present Okta, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in ... | [
2,
781,
539,
23,
25,
645,
20402,
198,
37811,
198,
15269,
12131,
532,
21662,
6762,
8326,
11,
3457,
13,
198,
198,
26656,
15385,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
5832,
743,
407,
779,
42... | 3.517241 | 232 |
#Import necessary modules
import arcpy
from arcpy.sa import *
import numpy
#Check-out necessary extensions
arcpy.CheckOutExtension('Spatial')
#Set input parameters
elevation_raster = arcpy.GetParameterAsText(0)
conRL = arcpy.GetParameter(1)
conRL_ouRaster = arcpy.GetParameterAsText(2)
conH2OSat = arcpy.GetParameter(3... | [
2,
20939,
3306,
13103,
198,
11748,
10389,
9078,
198,
6738,
10389,
9078,
13,
11400,
1330,
1635,
198,
11748,
299,
32152,
198,
198,
2,
9787,
12,
448,
3306,
18366,
198,
5605,
9078,
13,
9787,
7975,
11627,
3004,
10786,
4561,
34961,
11537,
198... | 3.037118 | 458 |
from caffe2.python import core
from hypothesis import given
import caffe2.python.hypothesis_test_util as hu
import caffe2.python.serialized_test.serialized_test_util as serial
import hypothesis.strategies as st
import numpy as np
if __name__ == "__main__":
import unittest
unittest.main()
| [
628,
628,
198,
6738,
21121,
17,
13,
29412,
1330,
4755,
198,
6738,
14078,
1330,
1813,
198,
11748,
21121,
17,
13,
29412,
13,
36362,
313,
8497,
62,
9288,
62,
22602,
355,
289,
84,
198,
11748,
21121,
17,
13,
29412,
13,
46911,
1143,
62,
9... | 3.080808 | 99 |
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import llnl.util.tty as tty
import llnl.util.tty.color as color
import spack.paths
def shell_init_instructions(cmd, equ... | [
2,
15069,
2211,
12,
1238,
2481,
13914,
45036,
3549,
2351,
4765,
11,
11419,
290,
584,
198,
2,
1338,
441,
4935,
34152,
13,
4091,
262,
1353,
12,
5715,
27975,
38162,
9947,
2393,
329,
3307,
13,
198,
2,
198,
2,
30628,
55,
12,
34156,
12,
... | 2.294679 | 733 |
"""
MIT License
Copyright (c) 2018 Samuel Wilder
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish,... | [
37811,
198,
36393,
13789,
198,
198,
15269,
357,
66,
8,
2864,
17100,
6183,
263,
198,
198,
5990,
3411,
318,
29376,
7520,
11,
1479,
286,
3877,
11,
284,
597,
1048,
16727,
257,
4866,
198,
1659,
428,
3788,
290,
3917,
10314,
3696,
357,
1169,... | 2.71064 | 3,252 |
# %%
# %%
import pandas as pd
import numpy as np
import pathlib
import matplotlib
import matplotlib.pyplot as plt
from our_plot_config import derived_dir, fig_dir, raw_dir, setplotstyle
from kappas import do_one_period
setplotstyle()
# %%
# Input files
f_cereal = raw_dir / 'cereal.parquet'
f_airlines = raw_dir / 'a... | [
2,
43313,
198,
2,
43313,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
3108,
8019,
198,
198,
11748,
2603,
29487,
8019,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
198,
673... | 2.355781 | 787 |
# Copyright (c) 2021 Graphcore Ltd. All rights reserved.
class Module:
"""
Callable class from which user-defined layers can inherit.
The #build method should be overriden and should build the subgraph.
The benefit of inheriting from this class rather than passing a function is
that you can save input ten... | [
2,
15069,
357,
66,
8,
33448,
29681,
7295,
12052,
13,
1439,
2489,
10395,
13,
198,
4871,
19937,
25,
198,
220,
220,
220,
37227,
198,
220,
4889,
540,
1398,
422,
543,
2836,
12,
23211,
11685,
460,
16955,
13,
628,
220,
383,
1303,
11249,
24... | 3.944444 | 126 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import cv2
import os
import time
import oxuva
from scripts import *
if __name__ == '__main__':
main()
| [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
6738,
11593,
37443,
834,
1330,
7297,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
198,
11748,
1822,
29572,
198,
11748,
269,
85,
17,
198,
11748,
28686,
198,
11748,
640,
198... | 3.287671 | 73 |
# Import classes from your brand new package
from naive_tree import GeneTree
from naive_tree import GeneNetwork
# Create an object of Mammals class & call a method of it
myTree = GeneTree()
myTree.build_network()
myTree.print_gene_network_summary()
myTree.gene_network.print_test_edge(4140)
# then get network between ... | [
2,
17267,
6097,
422,
534,
4508,
649,
5301,
198,
6738,
24354,
62,
21048,
1330,
13005,
27660,
198,
6738,
24354,
62,
21048,
1330,
13005,
26245,
198,
198,
2,
13610,
281,
2134,
286,
39502,
874,
1398,
1222,
869,
257,
2446,
286,
340,
198,
18... | 2.855346 | 318 |
#!/usr/bin/python
import numpy as np
from scipy import optimize
from sympy import *
import matplotlib.pyplot as plt
import pdb
import random
import os
# Symbolic function to evaluate shape functions
shape_functions=lambda x: np.matrix([(1-x)/DX,x/DX])
xn = np.array([0.,1.])
DX = 1.
## required for plotting residu... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
629,
541,
88,
1330,
27183,
198,
6738,
10558,
88,
1330,
1635,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
279,
9945... | 2.268082 | 1,507 |
# Copyright (C) 2018 Alpha Griffin
# @%@~LICENSE~@%@
from . import config, TokenError
from bitcash.format import public_key_to_address
from os import path
import sqlite3
from hashlib import sha256
| [
2,
15069,
357,
34,
8,
2864,
12995,
16525,
198,
2,
2488,
4,
31,
93,
43,
2149,
24290,
93,
31,
4,
31,
198,
198,
6738,
764,
1330,
4566,
11,
29130,
12331,
198,
198,
6738,
1643,
30350,
13,
18982,
1330,
1171,
62,
2539,
62,
1462,
62,
21... | 3.060606 | 66 |
import json
from configparser import ConfigParser
from subprocess import PIPE, Popen
from .archivesspace import ArchivesSpaceClient
from .helpers import create_tag, format_aspace_date, get_closest_dates
| [
11748,
33918,
198,
6738,
4566,
48610,
1330,
17056,
46677,
198,
6738,
850,
14681,
1330,
350,
4061,
36,
11,
8099,
268,
198,
198,
6738,
764,
998,
452,
408,
10223,
1330,
22275,
14106,
11792,
198,
6738,
764,
16794,
364,
1330,
2251,
62,
12985... | 3.596491 | 57 |
import pytest
from conftest import twitter_session, BASE_URL
from utils import get_home_tweets
# status list to tweet
status_list = {"We welcome you to MSD family :)", "Hello World !!"}
@pytest.mark.run(order=1) ## ording test cases -- make tweet first as first test case
@pytest.mark.parametrize("status_text", status... | [
11748,
12972,
9288,
198,
6738,
369,
701,
395,
1330,
17044,
62,
29891,
11,
49688,
62,
21886,
198,
6738,
3384,
4487,
1330,
651,
62,
11195,
62,
83,
732,
1039,
198,
198,
2,
3722,
1351,
284,
6126,
198,
13376,
62,
4868,
796,
19779,
1135,
... | 3.011445 | 699 |
import pickle
import operator
import re
prog = re.compile( r"^([\^\~\&\|])\((\w+),?(\w+)?\)$" )
with open("sha_decoded.pp", "r") as file:
_h, _REFERENCES_, _DEPENDENCY_ ,_INV_DEP_, _COST_ = pickle.load( file )
inv_refs = {v: k for k, v in _REFERENCES_.iteritems()}
#sorted_COST = sorted(_COST_.items(), key=operator.i... | [
11748,
2298,
293,
198,
11748,
10088,
198,
11748,
302,
198,
1676,
70,
796,
302,
13,
5589,
576,
7,
374,
1,
61,
26933,
59,
61,
59,
93,
59,
5,
59,
91,
12962,
59,
19510,
59,
86,
10,
828,
30,
38016,
86,
10,
19427,
22725,
3,
1,
1267,... | 1.847375 | 819 |
import os
from channels.routing import ChannelNameRouter, ProtocolTypeRouter
from django.core.asgi import get_asgi_application
from notifications import consumers
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'notifs.settings')
application = ProtocolTypeRouter(
{
'http': get_asgi_application(),
... | [
11748,
28686,
198,
198,
6738,
9619,
13,
81,
13660,
1330,
11102,
5376,
49,
39605,
11,
20497,
6030,
49,
39605,
198,
6738,
42625,
14208,
13,
7295,
13,
292,
12397,
1330,
651,
62,
292,
12397,
62,
31438,
198,
198,
6738,
19605,
1330,
7008,
1... | 2.38191 | 199 |
import threading
# pls thinking about if there not use mutex...
# you must try it, comment the line 12 and the line 14...
mutex = threading.Lock()
num = 0
if __name__ == "__main__":
main()
| [
11748,
4704,
278,
198,
198,
2,
458,
82,
3612,
546,
611,
612,
407,
779,
4517,
1069,
986,
198,
2,
345,
1276,
1949,
340,
11,
2912,
262,
1627,
1105,
290,
262,
1627,
1478,
986,
198,
21973,
1069,
796,
4704,
278,
13,
25392,
3419,
198,
22... | 2.756757 | 74 |
import contextlib
import pathlib
import shutil
import sys
import tempfile
import typing as ty
import click
import click_pathlib
import jsonlines
import numpy as np
import spacy
import ujson as json
from typing import Any, Dict, List, Literal, Optional, TextIO
from typing_extensions import TypedDict
from decofre.form... | [
11748,
4732,
8019,
198,
11748,
3108,
8019,
198,
11748,
4423,
346,
198,
11748,
25064,
198,
11748,
20218,
7753,
198,
11748,
19720,
355,
1259,
198,
198,
11748,
3904,
198,
11748,
3904,
62,
6978,
8019,
198,
11748,
33918,
6615,
198,
11748,
299,... | 2.124861 | 2,691 |
"""
Migration script for the job state history table
"""
from __future__ import print_function
import datetime
import logging
from sqlalchemy import Column, DateTime, ForeignKey, Integer, MetaData, String, Table
from galaxy.model.custom_types import TrimmedString
from galaxy.model.migrate.versions.util import create... | [
37811,
198,
44,
4254,
4226,
329,
262,
1693,
1181,
2106,
3084,
198,
37811,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
198,
11748,
4818,
8079,
198,
11748,
18931,
198,
198,
6738,
44161,
282,
26599,
1330,
29201,
11,
7536,
7575... | 2.360494 | 405 |
#!/usr/bin/env python3
"""
Deploy DST configuration using Ansible.
Copyright (c) 2020, Copyright (c) 2020, Cisco Systems, Inc. or its affiliates
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redis... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
37811,
198,
49322,
360,
2257,
8398,
1262,
28038,
856,
13,
198,
198,
15269,
357,
66,
8,
12131,
11,
15069,
357,
66,
8,
12131,
11,
28289,
11998,
11,
3457,
13,
393,
663,
29116,
198,
... | 3.571429 | 567 |
#######################################################################
# Godot RST File to MediaWiki converter #
#######################################################################
import re
import pandas as pd
import sys
source=sys.argv[1]
with open(source) as file:
... | [
29113,
29113,
4242,
21017,
201,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1793,
313,
371,
2257,
9220,
284,
6343,
32603,
38394,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
22... | 2.630081 | 246 |
# Yu Zhang yz2729
# Lab 2 Date: 09/23/21
import RPi.GPIO as GPIO
import pygame # Import pygame graphics library
import time
import os # for OS calls
CODERUN = True
GPIO.setmode(GPIO.BCM)
GPIO.setup(17,GPIO.IN,pull_up_down = GPIO.PUD_UP)
GPIO.add_event_detect(17, GPIO.FALLING, callback=GPIO17_callback, bo... | [
2,
10605,
19439,
331,
89,
1983,
1959,
198,
2,
3498,
362,
220,
7536,
25,
7769,
14,
1954,
14,
2481,
198,
11748,
25812,
72,
13,
16960,
9399,
355,
50143,
198,
11748,
12972,
6057,
220,
220,
220,
220,
1303,
17267,
12972,
6057,
9382,
5888,
... | 2.271784 | 964 |
from abc import ABCMeta, abstractmethod
import numpy as np
_epsilon = np.finfo('double').eps
| [
6738,
450,
66,
1330,
9738,
48526,
11,
12531,
24396,
198,
198,
11748,
299,
32152,
355,
45941,
628,
198,
62,
538,
18217,
261,
796,
45941,
13,
69,
10951,
10786,
23352,
27691,
25386,
628,
628,
198
] | 2.941176 | 34 |
# This file will consist of some wrapper for using MySQL
# It is mainly used for preparing and calling mysql cli
import logging
from mysql_autoxtrabackup.general_conf import path_config
from mysql_autoxtrabackup.general_conf.generalops import GeneralClass
from mysql_autoxtrabackup.process_runner.process_runner import ... | [
2,
770,
2393,
481,
3473,
286,
617,
29908,
329,
1262,
33476,
198,
2,
632,
318,
8384,
973,
329,
10629,
290,
4585,
48761,
537,
72,
198,
11748,
18931,
198,
198,
6738,
48761,
62,
23736,
742,
25619,
441,
929,
13,
24622,
62,
10414,
1330,
3... | 3.73 | 100 |
# Faça um programa que leia 5 valores e guarde-os em uma lista, no final mostre qual é o maior e o menor valor e qual
# A sua posição na lista
valores = list() # cria uma lista
for c in range(0, 5):
valores.append(int(input(f'Digite um valor para a posição {c}: '))) # inserindo os números dentro da lista
print(f... | [
2,
18350,
50041,
23781,
1430,
64,
8358,
443,
544,
642,
1188,
2850,
304,
4860,
68,
12,
418,
795,
334,
2611,
1351,
64,
11,
645,
2457,
749,
260,
4140,
38251,
267,
17266,
1504,
304,
267,
1450,
273,
1188,
273,
304,
4140,
198,
2,
317,
4... | 2.321023 | 352 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# ---
# jupyter:
# jupytext:
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.4'
# jupytext_version: 1.1.4
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# ---
# # S_El... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
11420,
198,
2,
474,
929,
88,
353,
25,
198,
2,
220,
220,
474,
929,
88,
5239,
25,
198,
2,
220,
220,
220,
2... | 2.442211 | 995 |
from gssa.core import search
from gssa.graph_search import breadth_first_search
from gssa.secretenv import author_first, author_last, vancouver_author
author = author_first + ' ' + author_last
publist = search(author, nres=100, overwrite=False)
breadth_first_search(publist[:100], levels=2, filters=(has_author, sp... | [
6738,
308,
824,
64,
13,
7295,
1330,
2989,
198,
6738,
308,
824,
64,
13,
34960,
62,
12947,
1330,
32483,
62,
11085,
62,
12947,
198,
6738,
308,
824,
64,
13,
21078,
24330,
1330,
1772,
62,
11085,
11,
1772,
62,
12957,
11,
410,
10264,
62,
... | 3.12381 | 105 |
from . import data
from . import cube
from . import rss
from . import spectrum1d
from . import ssplibrary
from . import parameters
from . import fit_profile
from . import header
import copyreg as copy_reg
from types import *
copy_reg.pickle(MethodType, _pickle_method, _unpickle_method)
| [
6738,
764,
1330,
1366,
198,
6738,
764,
1330,
23441,
198,
6738,
764,
1330,
374,
824,
198,
6738,
764,
1330,
10958,
16,
67,
198,
6738,
764,
1330,
264,
22018,
4115,
198,
6738,
764,
1330,
10007,
198,
6738,
764,
1330,
4197,
62,
13317,
198,
... | 3.356322 | 87 |
import math
| [
11748,
10688,
201
] | 4 | 3 |
from random import choice, gauss, random
from neat.config import ConfigParameter
# TODO: There is probably a lot of room for simplification of these classes using metaprogramming.
| [
6738,
4738,
1330,
3572,
11,
31986,
1046,
11,
4738,
198,
6738,
15049,
13,
11250,
1330,
17056,
36301,
198,
198,
2,
16926,
46,
25,
1318,
318,
2192,
257,
1256,
286,
2119,
329,
7106,
2649,
286,
777,
6097,
1262,
1138,
499,
39529,
2229,
13,
... | 4.181818 | 44 |
import numpy as np
import cv2
import os
import caffe
from scipy.spatial.distance import cosine
image_folder = './images'
output_folder = './features'
model = './train/code/sphereface_deploy.prototxt'
weights = './train/result/sphereface_model.caffemodel'
net = caffe.Net(model, weights, caffe.TEST)
if __name__ == '__m... | [
11748,
299,
32152,
355,
45941,
198,
11748,
269,
85,
17,
198,
11748,
28686,
198,
11748,
21121,
198,
6738,
629,
541,
88,
13,
2777,
34961,
13,
30246,
1330,
8615,
500,
198,
198,
9060,
62,
43551,
796,
705,
19571,
17566,
6,
198,
22915,
62,
... | 2.554974 | 191 |
""" Common helpers in the grid package """
__all__ = ['isNestedInstance', 'pretty_size_print']
def isNestedInstance(obj, cl):
""" Test for sub-classes types
I could not find a universal test
keywords
--------
obj: object instance
object to test
cl: Class
... | [
37811,
8070,
49385,
287,
262,
10706,
5301,
37227,
198,
198,
834,
439,
834,
796,
37250,
271,
45,
7287,
33384,
3256,
705,
37784,
62,
7857,
62,
4798,
20520,
198,
198,
4299,
318,
45,
7287,
33384,
7,
26801,
11,
537,
2599,
198,
220,
220,
... | 2.178528 | 829 |
from deepjets.generate import generate_events
for event in generate_events('w_vincia.config', 1, write_to='vincia.hepmc', shower='vincia', random_state=1, verbosity=0):
pass
for event, weight in generate_events('w.config', 1, write_to='dire.hepmc', shower='dire', random_state=1, verbosity=0):
print weight
| [
6738,
2769,
73,
1039,
13,
8612,
378,
1330,
7716,
62,
31534,
198,
198,
1640,
1785,
287,
7716,
62,
31534,
10786,
86,
62,
85,
1939,
544,
13,
11250,
3256,
352,
11,
3551,
62,
1462,
11639,
85,
1939,
544,
13,
258,
4426,
66,
3256,
14643,
... | 2.756522 | 115 |
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | [
2,
198,
2,
49962,
284,
262,
24843,
10442,
5693,
357,
1921,
37,
8,
739,
530,
198,
2,
393,
517,
18920,
5964,
11704,
13,
220,
4091,
262,
28536,
2393,
198,
2,
9387,
351,
428,
670,
329,
3224,
1321,
198,
2,
5115,
6634,
9238,
13,
220,
... | 3.804781 | 251 |
import Sticks
import stick
import time
import pygame
pygame.init()
board = pygame.display.set_mode((400, 400))
while 1:
for e in pygame.event.get():
if e.type == pygame.KEYDOWN and e.key == pygame.K_TAB:
print("pressed tab")
"""
# ///---=== FIND STICK TEST ===---
ex1 = Sticks.Sticks()
ex1.n... | [
11748,
520,
3378,
198,
11748,
4859,
198,
11748,
640,
198,
11748,
12972,
6057,
198,
198,
9078,
6057,
13,
15003,
3419,
198,
3526,
796,
12972,
6057,
13,
13812,
13,
2617,
62,
14171,
19510,
7029,
11,
7337,
4008,
198,
198,
4514,
352,
25,
19... | 2.024423 | 737 |
# Generated by Django 3.1.2 on 2020-11-30 02:52
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
513,
13,
16,
13,
17,
319,
12131,
12,
1157,
12,
1270,
7816,
25,
4309,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
'''This plots the results of the parameter sweep for the OOHI
example.
'''
from os import mkdir
from os.path import isdir
from pickle import load
from numpy import arange, array, atleast_2d, hstack, sum, where, zeros
from matplotlib.pyplot import close, colorbar, imshow, set_cmap, subplots
from mpl_toolkits.axes_grid1 ... | [
7061,
6,
1212,
21528,
262,
2482,
286,
262,
11507,
16085,
329,
262,
440,
12096,
40,
198,
20688,
13,
198,
7061,
6,
198,
6738,
28686,
1330,
33480,
15908,
198,
6738,
28686,
13,
6978,
1330,
318,
15908,
198,
6738,
2298,
293,
1330,
3440,
198... | 1.92015 | 2,129 |
from DHT import DHT_Read
import paho.mqtt.client as mqtt
import json
import requests
import time
try:
file=open("config.json", "r")
json_str = file.read()
file.close()
except:
raise KeyError("Error opening config file. Please check.")
config_json = json.loads(json_str)
url = config_jso... | [
6738,
360,
6535,
1330,
360,
6535,
62,
5569,
198,
11748,
279,
17108,
13,
76,
80,
926,
13,
16366,
355,
285,
80,
926,
198,
11748,
33918,
198,
11748,
7007,
198,
11748,
640,
198,
198,
28311,
25,
198,
220,
220,
220,
220,
220,
220,
220,
... | 2.478842 | 449 |
from django.shortcuts import render
import json
from urllib.error import HTTPError
import urllib
# Create your views here.
| [
6738,
42625,
14208,
13,
19509,
23779,
1330,
8543,
198,
11748,
33918,
198,
6738,
2956,
297,
571,
13,
18224,
1330,
14626,
12331,
198,
11748,
2956,
297,
571,
198,
2,
13610,
534,
5009,
994,
13,
198
] | 3.617647 | 34 |
"""The module for loading MANE Transcript mappings to genes."""
from typing import Dict, Optional, List
import pandas as pd
from uta_tools import MANE_SUMMARY_PATH, logger
class MANETranscriptMappings:
"""The MANE Transcript mappings class."""
def __init__(self, mane_data_path: str = MANE_SUMMARY_PATH) -> ... | [
37811,
464,
8265,
329,
11046,
17254,
36,
42978,
285,
39242,
284,
10812,
526,
15931,
198,
6738,
19720,
1330,
360,
713,
11,
32233,
11,
7343,
198,
198,
11748,
19798,
292,
355,
279,
67,
198,
198,
6738,
3384,
64,
62,
31391,
1330,
17254,
36... | 2.371671 | 826 |
# ------------------------------------------------------------------------------
# Copyright (c) Microsoft
# Licensed under the MIT License.
# Written by Tianheng Cheng(tianhengcheng@gmail.com)
# ------------------------------------------------------------------------------
from .aflw import AFLW
from .cofw import COF... | [
2,
16529,
26171,
198,
2,
15069,
357,
66,
8,
5413,
198,
2,
49962,
739,
262,
17168,
13789,
13,
198,
2,
22503,
416,
20834,
31753,
27692,
7,
83,
666,
31753,
2395,
782,
31,
14816,
13,
785,
8,
198,
2,
16529,
26171,
198,
198,
6738,
764,
... | 3.53012 | 166 |
import tensorflow as tf
from merlin.spec import Spec, Default
| [
11748,
11192,
273,
11125,
355,
48700,
198,
198,
6738,
4017,
2815,
13,
16684,
1330,
18291,
11,
15161,
628
] | 3.555556 | 18 |
"""Digest tests."""
import unittest
from ocfl.ntree import Ntree
class TestAll(unittest.TestCase):
"""TestAll class to run tests."""
def test01_encode(self):
"""Test encode."""
nt = Ntree()
self.assertEqual(nt.encode(''), '')
self.assertEqual(nt.encode('a'), 'a')
self.... | [
37811,
19511,
395,
5254,
526,
15931,
198,
11748,
555,
715,
395,
198,
6738,
267,
66,
2704,
13,
429,
631,
1330,
399,
21048,
628,
198,
4871,
6208,
3237,
7,
403,
715,
395,
13,
14402,
20448,
2599,
198,
220,
220,
220,
37227,
14402,
3237,
... | 2.052142 | 1,611 |