content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
#!/usr/local/bin/python3
"""
Author: Kelly Sovacool
Email: kellysovacool@uky.edu
28 Sep 2017
Usage:
snp_subsample.py <snp-sites-dir> <output-filename-base> [--abundance-filter=<percent-cutoff> --output-filtered-fasta-dir=<filtered_dir> --skip-filter --num_subsamples=<num> --all-snps-all-loci --missing-cutoff=<perc... | [
2,
48443,
14629,
14,
12001,
14,
8800,
14,
29412,
18,
198,
37811,
198,
13838,
25,
9077,
6917,
330,
970,
198,
15333,
25,
885,
12810,
47272,
330,
970,
31,
84,
2584,
13,
15532,
198,
2078,
8621,
2177,
198,
198,
28350,
25,
198,
220,
220,
... | 2.35785 | 707 |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2015-2018 CERN.
#
# Invenio is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Tests for user profile models."""
import pytest
from invenio_accounts.models impo... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
198,
2,
770,
2393,
318,
636,
286,
554,
574,
952,
13,
198,
2,
15069,
357,
34,
8,
1853,
12,
7908,
327,
28778,
13,
198,
2,
198,
2,
554,
574,
952,
318,
1479,
3788... | 2.566038 | 901 |
import datetime
import logging
import time
from colorama import Fore
logging.getLogger('filelock').propagate = False
logging.basicConfig(
# filename='logger.log',
level=logging.INFO,
format='%(message)s'
)
logger = Logger(classic=True, logger_name='Default-Logger')
| [
11748,
4818,
8079,
198,
11748,
18931,
198,
11748,
640,
198,
198,
6738,
3124,
1689,
1330,
4558,
198,
198,
6404,
2667,
13,
1136,
11187,
1362,
10786,
7753,
5354,
27691,
22930,
37861,
796,
10352,
198,
6404,
2667,
13,
35487,
16934,
7,
198,
2... | 2.858586 | 99 |
import unittest
from unittest.mock import MagicMock
import luigi
import pandas as pd
from sklearn.ensemble import RandomForestClassifier
from redshells.train import TrainPairwiseSimilarityModel
if __name__ == '__main__':
unittest.main()
| [
11748,
555,
715,
395,
198,
6738,
555,
715,
395,
13,
76,
735,
1330,
6139,
44,
735,
198,
198,
11748,
300,
84,
25754,
198,
11748,
19798,
292,
355,
279,
67,
198,
6738,
1341,
35720,
13,
1072,
11306,
1330,
14534,
34605,
9487,
7483,
198,
1... | 3.049383 | 81 |
import asyncio
import sys
sys.path.insert(0, ".")
from aioscheduler import QueuedScheduler
asyncio.run(main())
| [
11748,
30351,
952,
198,
11748,
25064,
198,
198,
17597,
13,
6978,
13,
28463,
7,
15,
11,
366,
19570,
198,
198,
6738,
257,
4267,
1740,
18173,
1330,
4670,
1739,
50,
1740,
18173,
628,
628,
198,
292,
13361,
952,
13,
5143,
7,
12417,
28955,
... | 2.72093 | 43 |
import cv2
| [
11748,
269,
85,
17,
198
] | 2.2 | 5 |
# encoding: utf-8
from enum import Enum
from datetime import datetime, timedelta
import math
import pprint
from prawcore import exceptions
import langdetect
DAYS_IN_WEEK = 7
DAYS_IN_MONTH = 28
class Subreddit:
"""A class to retrieve and store information about subreddits"""
def auto_update(self, reddit, ... | [
2,
21004,
25,
3384,
69,
12,
23,
198,
198,
6738,
33829,
1330,
2039,
388,
198,
6738,
4818,
8079,
1330,
4818,
8079,
11,
28805,
12514,
198,
11748,
10688,
198,
11748,
279,
4798,
198,
6738,
279,
1831,
7295,
1330,
13269,
198,
11748,
42392,
1... | 2.502564 | 585 |
#!/usr/bin/env python
# Copyright 2016-2021 Biomedical Imaging Group Rotterdam, Departments of
# Medical Informatics and Radiology, Erasmus MC, Rotterdam, The Netherlands
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obt... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
2,
15069,
1584,
12,
1238,
2481,
8436,
35914,
48656,
4912,
18481,
353,
11043,
11,
2129,
32514,
286,
198,
2,
8366,
554,
18982,
873,
290,
5325,
12371,
11,
5256,
8597,
385,
13122,
11,... | 2.46329 | 2,942 |
import torch.nn as nn
import torch.nn.functional as F
from torch.distributions import Categorical
from common.utils import init
class FixedCategorical(Categorical):
"""
Categorical distribution object
"""
class Categorical(nn.Module):
"""
Categorical distribution (NN module)
"""
| [
11748,
28034,
13,
20471,
355,
299,
77,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
198,
6738,
28034,
13,
17080,
2455,
507,
1330,
327,
2397,
12409,
198,
6738,
2219,
13,
26791,
1330,
2315,
628,
198,
198,
4871,
10832,
34,
2397,
12... | 3.09 | 100 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'ipetrash'
# SOURCE: https://github.com/martinblech/xmltodict#roundtripping
# pip install xmltodict
import xmltodict
my_dict = {
'response': {
'status': 'good',
'last_updated': '2014-02-16T23:10:12Z',
}
}
print(xmltodict.unparse(... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
834,
9800,
834,
796,
705,
541,
21879,
1077,
6,
628,
198,
2,
311,
31033,
25,
3740,
1378,
12567,
13,
785,
14... | 2.420635 | 504 |
# Copyright (c) 2020 Cisco and/or its affiliates.
# 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 ag... | [
2,
15069,
357,
66,
8,
12131,
28289,
290,
14,
273,
663,
29116,
13,
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,
287,
11846,
351,
262,
1378... | 1.606571 | 9,740 |
from eve import Eve
from eve_sqlalchemy import SQL
from eve_sqlalchemy.validation import ValidatorSQL
from sqlalchemy.engine.url import URL
try:
from eve_docs import eve_docs
from flask.ext.bootstrap import Bootstrap
except ImportError:
Bootstrap = None
from utvsapi.tables import domain, Base, on_fetched_... | [
6738,
28001,
1330,
12882,
198,
6738,
28001,
62,
25410,
282,
26599,
1330,
16363,
198,
6738,
28001,
62,
25410,
282,
26599,
13,
12102,
341,
1330,
48951,
1352,
17861,
198,
6738,
44161,
282,
26599,
13,
18392,
13,
6371,
1330,
10289,
198,
198,
... | 2.695291 | 361 |
#!/usr/bin/env python
'''
Write to a yaml and json file for a list and dictionary variable
'''
import yaml
import json
if __name__ == "__main__":
main()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
7061,
6,
198,
16594,
284,
257,
331,
43695,
290,
33918,
2393,
329,
257,
1351,
290,
22155,
7885,
198,
7061,
6,
198,
198,
11748,
331,
43695,
198,
11748,
33918,
198,
198,
361,
11593,
3672,... | 2.839286 | 56 |
import argparse
import os
import json
import glob
from os.path import join as pjoin
from others.vocab_wrapper import VocabWrapper
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("-mode", default='word2vec', type=str, choices=['glove', 'word2vec'])
parser.add_argument("-d... | [
11748,
1822,
29572,
198,
11748,
28686,
198,
11748,
33918,
198,
11748,
15095,
198,
6738,
28686,
13,
6978,
1330,
4654,
355,
279,
22179,
198,
6738,
1854,
13,
18893,
397,
62,
48553,
1330,
47208,
397,
36918,
2848,
628,
198,
198,
361,
11593,
... | 2.822581 | 186 |
"""Modules for working with returns.
Offers common financial risk and performance metrics as found in [empyrical](https://github.com/quantopian/empyrical),
but Numba-compiled and optimized for 2-dim arrays.
## Accessors
You can access methods listed in `vectorbt.returns.accessors` as follows:
* `vectorbt.returns.ac... | [
37811,
5841,
5028,
329,
1762,
351,
5860,
13,
198,
198,
9362,
364,
2219,
3176,
2526,
290,
2854,
20731,
355,
1043,
287,
685,
45787,
2417,
605,
16151,
5450,
1378,
12567,
13,
785,
14,
40972,
37548,
14,
45787,
2417,
605,
828,
198,
4360,
39... | 2.890756 | 476 |
#%% [markdown]
## Strings (parte 1)
dir(str)
nome = 'Victor Mello'
nome
#Acessando um caracter de uma string
nome[0]
# nome[0] = 'P' #Erro! Strings são imutáveis
"""OBS: quando se tem uma string cujo conteúdo já possui
aspas simples, para evitar erro de sintaxe, tem-se 2 opções:
1) Delimitar a string com aspas du... | [
2,
16626,
685,
4102,
2902,
60,
198,
198,
2235,
4285,
654,
357,
3911,
68,
352,
8,
198,
198,
15908,
7,
2536,
8,
198,
77,
462,
796,
705,
21944,
273,
337,
11109,
6,
198,
77,
462,
198,
198,
2,
32,
919,
25440,
23781,
1097,
7321,
390,
... | 2.318257 | 1,216 |
import numpy as np
from numpy.testing import assert_allclose
from scipy.integrate import trapz
import pytest
from kinematic_snake.kinematic_snake import zero_mean_integral, project, KinematicSnake
# TODO Add more tests
| [
11748,
299,
32152,
355,
45941,
198,
6738,
299,
32152,
13,
33407,
1330,
6818,
62,
439,
19836,
198,
6738,
629,
541,
88,
13,
18908,
4873,
1330,
12840,
89,
198,
11748,
12972,
9288,
198,
198,
6738,
479,
7749,
1512,
62,
16184,
539,
13,
5116... | 3.125 | 72 |
import gym
import numpy as np
print(gym.__file__)
print(dir(gym))
env = gym.make('FrozenLake-v0')
q_table = np.zeros([env.observation_space.n, env.action_space.n])
print(env.render())
if __name__ == "__main__":
lr = 0.8
discount_factor = 0.95
num_episodes = 2000
reward_list = []
for i in rang... | [
11748,
11550,
198,
11748,
299,
32152,
355,
45941,
198,
198,
4798,
7,
1360,
76,
13,
834,
7753,
834,
8,
198,
4798,
7,
15908,
7,
1360,
76,
4008,
198,
198,
24330,
796,
11550,
13,
15883,
10786,
37,
42005,
43035,
12,
85,
15,
11537,
198,
... | 1.966443 | 596 |
# coding: utf-8
"""*****************************************************************************
* Copyright (C) 2018 Microchip Technology Inc. and its subsidiaries.
*
* Subject to your compliance with these terms, you may use Microchip software
* and any derivatives exclusively with Microchip products. It is your
* re... | [
2,
19617,
25,
3384,
69,
12,
23,
198,
37811,
17174,
17174,
4557,
35625,
198,
9,
15069,
357,
34,
8,
2864,
4527,
35902,
8987,
3457,
13,
290,
663,
34943,
13,
198,
9,
198,
9,
15540,
284,
534,
11846,
351,
777,
2846,
11,
345,
743,
779,
... | 4.08777 | 695 |
import datetime
from floodsystem.analysis import polyfit
from floodsystem.datafetcher import fetch_measure_levels
from floodsystem.stationdata import build_station_list, update_water_levels
from floodsystem.plot import plot_water_level_with_fit
from floodsystem.utils import sorted_by_key
if __name__ == "__main__":
... | [
11748,
4818,
8079,
198,
6738,
6947,
10057,
13,
20930,
1330,
7514,
11147,
198,
6738,
6947,
10057,
13,
7890,
34045,
2044,
1330,
21207,
62,
1326,
5015,
62,
46170,
198,
6738,
6947,
10057,
13,
17529,
7890,
1330,
1382,
62,
17529,
62,
4868,
11... | 3.482143 | 112 |
# series.py
# Copyright (c) 2013-2016 Pablo Acosta-Serafini
# See LICENSE for details
# pylint: disable=C0111,C0302,E0102,E0611,W0105
# PyPI imports
import numpy
import matplotlib.path
import matplotlib.pyplot as plt
from scipy.stats import linregress
from scipy.interpolate import InterpolatedUnivariateSpline
# Putil ... | [
2,
2168,
13,
9078,
198,
2,
15069,
357,
66,
8,
2211,
12,
5304,
33185,
4013,
39818,
12,
7089,
1878,
5362,
198,
2,
4091,
38559,
24290,
329,
3307,
198,
2,
279,
2645,
600,
25,
15560,
28,
34,
486,
1157,
11,
34,
15,
22709,
11,
36,
486,... | 2.155766 | 8,654 |
# coding: utf-8
from handlers.BaseHandler import RequestBaseHandler
import os
class GetFavicon(RequestBaseHandler):
"""发布数据接口""" | [
2,
19617,
25,
3384,
69,
12,
23,
198,
198,
6738,
32847,
13,
14881,
25060,
1330,
19390,
14881,
25060,
198,
11748,
28686,
628,
198,
4871,
3497,
37,
615,
4749,
7,
18453,
14881,
25060,
2599,
198,
220,
220,
220,
37227,
20998,
239,
30585,
22... | 2.54717 | 53 |
import os
import random
import tqdm
import shutil
train_p = 0.9
#val_p = 0.05
test_p = 0.05
root_dir = "contoured-cut-outlines"
all_dir = "all"
train_dir = "train"
val_dir = "val"
test_dir = "test"
if __name__ == "__main__":
data = os.listdir(os.path.join(root_dir, all_dir))
random.shuffle(data)
total_co... | [
11748,
28686,
198,
11748,
4738,
198,
11748,
256,
80,
36020,
198,
11748,
4423,
346,
198,
198,
27432,
62,
79,
796,
657,
13,
24,
198,
2,
2100,
62,
79,
796,
657,
13,
2713,
198,
9288,
62,
79,
796,
657,
13,
2713,
198,
198,
15763,
62,
... | 2.287356 | 522 |
import datetime
import logging
| [
11748,
4818,
8079,
198,
11748,
18931,
628
] | 4.571429 | 7 |
from django.urls import path
from .views import (
FriendRequestsView,
MyFriendsView,
create_follow_request,
accept_follow_request,
unfollow_request,
reject_follow_request,
accept_remote_follow_request,
reject_remote_follow_request,
UsersView
)
app_name = 'follow'
urlpatterns = [
... | [
6738,
42625,
14208,
13,
6371,
82,
1330,
3108,
198,
6738,
764,
33571,
1330,
357,
198,
220,
220,
220,
9182,
16844,
3558,
7680,
11,
198,
220,
220,
220,
2011,
36705,
7680,
11,
198,
220,
220,
220,
2251,
62,
27780,
62,
25927,
11,
198,
220... | 2.810096 | 416 |
def insertShiftArray(array, value):
'''
inserts a value in middle of array.
'''
if len(array)%2 !=0:
oddOrEven = 1
else:
oddOrEven = 0
half = len(array)//2 + oddOrEven
# print(array[:half] + [value] + array[half:])
return array[:half] + [value] + array[half:]
#insertShiftArray([1,2,4,5], 3)
#... | [
4299,
7550,
33377,
19182,
7,
18747,
11,
1988,
2599,
198,
220,
705,
7061,
198,
220,
42220,
257,
1988,
287,
3504,
286,
7177,
13,
198,
220,
705,
7061,
198,
220,
611,
18896,
7,
18747,
8,
4,
17,
14512,
15,
25,
198,
220,
220,
220,
5629,... | 2.378378 | 148 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# file_name : download_pdb.py
# time : 3/22/2019 13:54
# author : ruiyang
# email : ww_sry@163.com
# ------------------------------
import sys
import pandas as pd
import os
def download_pdb(name_list,outpath):
"""
:function: download pdb archive by pd... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
2393,
62,
3672,
1058,
4321,
62,
79,
9945,
13,
9078,
198,
2,
640,
220,
220,
220,
220,
220,
1058,
513,
... | 2.060278 | 647 |
'''
Generic st7735 128x128 LCD module on esp32
'''
from ili9XXX import ili9341, MADCTL_MY, MADCTL_MV
disp = ili9341(
mhz=3,
mosi=18,
clk=19,
cs=13,
dc=12,
rst=4,
power=-1,
backlight=15,
backlight_on=1,
width=128,
height=128,
start_x=2,
start_y=1,
invert=False,
... | [
7061,
6,
198,
46189,
336,
3324,
2327,
13108,
87,
12762,
23598,
8265,
319,
15024,
2624,
198,
7061,
6,
198,
198,
6738,
220,
2403,
24,
43145,
1330,
220,
2403,
24,
33660,
11,
45878,
4177,
43,
62,
26708,
11,
45878,
4177,
43,
62,
44,
53,
... | 1.758794 | 199 |
# Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Eric Larson <larson.eric.d@gmail.com>
# Joan Massich <mailsik@gmail.com>
# Guillaume Favelier <guillaume.favelier@gmail.com>
#
# License: Simplified BSD
import pytest
import warnings
def has_vtki():
"""Check that... | [
2,
46665,
25,
21000,
260,
20159,
3319,
1279,
1000,
87,
49078,
13,
4546,
3319,
31,
46813,
785,
12,
1845,
396,
3055,
13,
8310,
29,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7651,
42630,
1279,
75,
12613,
13,
35626,
13,
67,... | 2.123596 | 445 |
try:
from setuptools import setup
from setuptools import Extension
except ImportError:
from distutils.core import setup
from distutils.extension import Extension
#import distutils.sysconfig
with open("src/geocat/comp/version.py") as f:
exec(f.read())
setup(name="geocat.comp",
package_dir={
... | [
28311,
25,
198,
220,
220,
220,
422,
900,
37623,
10141,
1330,
9058,
198,
220,
220,
220,
422,
900,
37623,
10141,
1330,
27995,
198,
16341,
17267,
12331,
25,
198,
220,
220,
220,
422,
1233,
26791,
13,
7295,
1330,
9058,
198,
220,
220,
220,
... | 2.333333 | 255 |
import numpy as np
from NN3_tf import NN3_tf
from sklearn.model_selection import train_test_split
from nn_utils import crossover, Type, sort_by_fittest, read_dataset
X, Y = read_dataset(180, 500)
train_x, test_x, train_y, test_y = train_test_split(
X, Y, test_size=0.3, random_state=1)
X, Y = read_dataset(180, 5... | [
11748,
299,
32152,
355,
45941,
198,
6738,
399,
45,
18,
62,
27110,
1330,
399,
45,
18,
62,
27110,
198,
6738,
1341,
35720,
13,
19849,
62,
49283,
1330,
4512,
62,
9288,
62,
35312,
198,
6738,
299,
77,
62,
26791,
1330,
27668,
11,
5994,
11,... | 2.365539 | 621 |
"""Features
Scientific Machine Learning Benchmark:
A benchmark of regression models in chem- and materials informatics.
2020, Matthias Rupp, Citrine Informatics.
Features transform datasets.
"""
from smlb import DataValuedTransformation, IdentityTransformation, DataPipelineTransformation
class Features(DataValue... | [
37811,
23595,
198,
198,
23010,
811,
10850,
18252,
25187,
4102,
25,
220,
198,
32,
18335,
286,
20683,
4981,
287,
4607,
12,
290,
5696,
4175,
23372,
13,
198,
42334,
11,
45524,
4448,
371,
7211,
11,
15792,
7640,
554,
18982,
873,
13,
198,
19... | 3.916201 | 179 |
from SimPEG import Problem, Survey, Utils, Maps
import Convolution
import numpy as np
| [
6738,
3184,
47,
7156,
1330,
20647,
11,
13084,
11,
7273,
4487,
11,
20347,
198,
11748,
34872,
2122,
198,
11748,
299,
32152,
355,
45941,
628
] | 3.625 | 24 |
from django.conf.urls import patterns, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('_1327.information_pages.views',
url(r"create$", 'create', name='create'),
url(r"(?P<title>[\w-]+)/edit$", 'edit', name='edit'),
url(r"(?P<title>[\w-]+)/autosave$", 'autosave', name='autosave'),
... | [
6738,
42625,
14208,
13,
10414,
13,
6371,
82,
1330,
7572,
11,
19016,
198,
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
198,
28482,
13,
2306,
375,
29392,
3419,
198,
198,
6371,
33279,
82,
796,
7572,
10786,
62,
1485,
1983,
13,
170... | 2.594937 | 237 |
import random
forests=[]
forestload=[]
forestmaxload=[]
stones1=[]
stoneload=[]
stonemaxload=[]
frpl=[]
frpl1=[]
| [
11748,
4738,
198,
754,
6448,
28,
21737,
198,
29623,
2220,
28,
21737,
198,
29623,
9806,
2220,
28,
21737,
198,
28750,
16,
28,
21737,
198,
3743,
417,
1170,
28,
21737,
198,
3743,
368,
897,
2220,
28,
21737,
198,
8310,
489,
28,
21737,
198,
... | 2.354167 | 48 |
from yz.nav_tools import FrameInfo
from yz.params import *
from yz.rl_policy import PolicyNetwork, ValueNetwork
from yz.utils import soft_update_from_to
from ai2thor.controller import Controller
from collections import deque
import random
import numpy as np
import torch
import torch.nn as nn
import torch.optim as opt... | [
6738,
331,
89,
13,
28341,
62,
31391,
1330,
25184,
12360,
198,
6738,
331,
89,
13,
37266,
1330,
1635,
198,
6738,
331,
89,
13,
45895,
62,
30586,
1330,
7820,
26245,
11,
11052,
26245,
198,
6738,
331,
89,
13,
26791,
1330,
2705,
62,
19119,
... | 3.473118 | 93 |
test = {
'name': 'accumulate',
'points': 0,
'suites': [
{
'cases': [
{
'code': r"""
scm> (accumulate + 0 4 square)
30
""",
'hidden': False,
'locked': False
}
],
'scored': False,
'setup': r"""
scm> (load '... | [
9288,
796,
1391,
198,
220,
705,
3672,
10354,
705,
4134,
388,
5039,
3256,
198,
220,
705,
13033,
10354,
657,
11,
198,
220,
705,
2385,
2737,
10354,
685,
198,
220,
220,
220,
1391,
198,
220,
220,
220,
220,
220,
705,
33964,
10354,
685,
19... | 1.655028 | 716 |
r"""
communicate with interactive subprocess, such as GHCi, and get its output
>>> s = interact('ghci', ':t 1\n' + EOT)
>>> get_ghci_body(s)
'Prelude> :t 1\n1 :: (Num t) => t'
>>> s = interact('swipl', 'X = 1 - 1.\n' + EOT)
>>> get_swipl_body(s)
'?- X = 1 - 1.\nX = 1-1.'
>>> s = interact('python', 'import this\n' + ... | [
81,
37811,
198,
10709,
5344,
351,
14333,
850,
14681,
11,
884,
355,
46615,
72,
11,
290,
651,
663,
5072,
198,
198,
33409,
264,
796,
9427,
10786,
456,
979,
3256,
705,
25,
83,
352,
59,
77,
6,
1343,
412,
2394,
8,
198,
33409,
651,
62,
... | 1.97931 | 1,015 |
#!/usr/bin/env python3
# _*_ coding: utf-8 _*_
"""Iterate over extracted docx content.
:author: Shay Hill
:created: 6/28/2019
This package extracts docx text as::
[ # tables
[ # table
[ # row
[ # cell
"" # paragraph
]
]
... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
4808,
9,
62,
19617,
25,
3384,
69,
12,
23,
4808,
9,
62,
198,
37811,
29993,
378,
625,
21242,
2205,
87,
2695,
13,
198,
198,
25,
9800,
25,
34760,
3327,
198,
25,
25598,
25,
718... | 2.271949 | 3,155 |
# -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2018-2020 Fetch.AI Limited
#
# 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 ... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
16529,
26171,
198,
2,
198,
2,
220,
220,
15069,
2864,
12,
42334,
376,
7569,
13,
20185,
15302,
198,
2,
198,
2,
220,
220,
49962,
739,
262,
24843,
13789,
11,
10628,
3... | 2.966906 | 695 |
import base64
if __name__ == "__main__":
print convert("in.jpeg")
| [
11748,
2779,
2414,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
3601,
10385,
7203,
259,
13,
73,
22071,
4943,
198
] | 2.535714 | 28 |
"""
@author: rlk268@cornell.edu
test helper functions
"""
from havsim.calibration.helper import makeleadfolinfo, boundaryspeeds, interpolate
path_reconngsim = 'C:/Users/rlk268/OneDrive - Cornell University/important misc/pickle files/meng/reconngsim.pkl'
# reconstructed ngsim data
with open(path_reconngsim, 'rb'... | [
198,
37811,
198,
31,
9800,
25,
374,
75,
74,
25022,
31,
20772,
695,
13,
15532,
198,
198,
9288,
31904,
5499,
220,
198,
37811,
198,
198,
6738,
387,
14259,
320,
13,
9948,
571,
1358,
13,
2978,
525,
1330,
787,
28230,
9062,
10951,
11,
1864... | 2.462687 | 268 |
"""
Thunk (a.k.a. lazy objects) in PyPy.
To run on top of the thunk object space with the following command-line:
py.py -o thunk fibonacci.py
This is a typical Functional Programming Languages demo, computing the
Fibonacci sequence by using an infinite lazy linked list.
"""
try:
from __pypy__ import thunk ... | [
37811,
198,
817,
2954,
357,
64,
13,
74,
13,
64,
13,
16931,
5563,
8,
287,
9485,
20519,
13,
198,
2514,
1057,
319,
1353,
286,
262,
294,
2954,
2134,
2272,
351,
262,
1708,
3141,
12,
1370,
25,
628,
220,
220,
220,
12972,
13,
9078,
532,
... | 2.619792 | 384 |
# websocket_server -- WebSocket/HTTP server/client library
# https://github.com/CylonicRaider/websocket-server
"""
WebSocket protocol implementation.
client_handshake() and server_handshake() perform the appropriate operations
on mappings of HTTP headers; the WebSocketFile class implements the framing
protocol.
"""
... | [
2,
2639,
5459,
62,
15388,
1377,
5313,
39105,
14,
40717,
4382,
14,
16366,
5888,
198,
2,
3740,
1378,
12567,
13,
785,
14,
34,
2645,
9229,
21762,
1304,
14,
732,
1443,
5459,
12,
15388,
198,
198,
37811,
198,
13908,
39105,
8435,
7822,
13,
... | 2.214892 | 15,659 |
import cocpit
import cocpit.config as config # isort: split
import os
import time
import pandas as pd
import torch
def build_model():
"""
train ML models
"""
# loop through batch sizes, models, epochs, and/or folds
for batch_size in config.BATCH_SIZE:
print("BATCH SIZE: ", batch_size)
... | [
11748,
8954,
15544,
198,
198,
11748,
8954,
15544,
13,
11250,
355,
4566,
220,
1303,
318,
419,
25,
6626,
198,
11748,
28686,
198,
11748,
640,
198,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
28034,
628,
198,
4299,
1382,
62,
19849,
... | 2.361386 | 808 |
"""
receiveEther.py
Faris Ahmetasevic, Marco Banholzer, Nderim Shatri
This code receives raw ethernet packets, which were sent to a network using the scapy library.
"""
from scapy.all import conf
import struct
"""
This function returns the converted information of the packets.
:param data: the bytes data which get... | [
37811,
198,
260,
15164,
36,
490,
13,
9078,
198,
37,
20066,
7900,
4164,
589,
25531,
11,
16556,
10274,
3937,
9107,
11,
399,
1082,
320,
911,
26646,
198,
1212,
2438,
11583,
8246,
28475,
3262,
24624,
11,
543,
547,
1908,
284,
257,
3127,
126... | 3.586614 | 254 |
import json
from .core import Command, EntityRef, Resolvable
from .scoreboard import ScoreRef
from .nbt import Path, NBTStorable
| [
11748,
33918,
198,
198,
6738,
764,
7295,
1330,
9455,
11,
20885,
8134,
11,
1874,
349,
23765,
198,
6738,
764,
26675,
3526,
1330,
15178,
8134,
198,
6738,
764,
77,
18347,
1330,
10644,
11,
399,
19313,
1273,
10475,
198
] | 3.513514 | 37 |
# Copyright 2017 the pycolab Authors
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | [
2,
15069,
2177,
262,
12972,
4033,
397,
46665,
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,
287,
11846,
351,
262,
13789,
13,
198,
... | 3.676923 | 780 |
#!/usr/bin/env python
#
# ----------------------------------------------------------------------
#
# Brad T. Aagaard, U.S. Geological Survey
# Charles A. Williams, GNS Science
# Matthew G. Knepley, University of Chicago
#
# This code was developed as part of the Computational Infrastructure
# for Geodynamics (http://ge... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
198,
2,
16529,
23031,
198,
2,
198,
2,
8114,
309,
13,
317,
8126,
446,
11,
471,
13,
50,
13,
34246,
13084,
198,
2,
7516,
317,
13,
6484,
11,
402,
8035,
5800,
198,
2,
9308,
402,
... | 2.568019 | 419 |
import datetime as dt
import json
import os
import sys
import tensorflow as tf
import numpy as np
from subprocess import check_output
from itertools import zip_longest
def grouper(iterable, batch_size, fill_value=None):
""" Helper method for returning batches of size batch_size of a dataset.
grouper('ABC... | [
11748,
4818,
8079,
355,
288,
83,
198,
11748,
33918,
198,
11748,
28686,
198,
11748,
25064,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
850,
14681,
1330,
2198,
62,
22915,
198,
6738,
340,
... | 2.98 | 150 |
# Copyright (c) 2021 Xilinx, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# list of conditions and the f... | [
2,
15069,
357,
66,
8,
33448,
1395,
346,
28413,
11,
3457,
13,
198,
2,
1439,
2489,
10395,
13,
198,
2,
198,
2,
2297,
396,
3890,
290,
779,
287,
2723,
290,
13934,
5107,
11,
351,
393,
1231,
198,
2,
17613,
11,
389,
10431,
2810,
326,
26... | 2.573077 | 1,560 |
import pandas
from dnm_cohorts.person import Person
url = 'https://static-content.springer.com/esm/art%3A10.1038%2Fnature10989/MediaObjects/41586_2012_BFnature10989_MOESM11_ESM.xls'
def open_oroak_cohort():
""" get proband data from the O'Roak et al autism exome study
O'Roak et al. (2012) Nature 485:24... | [
198,
11748,
19798,
292,
198,
198,
6738,
288,
21533,
62,
1073,
71,
2096,
13,
6259,
1330,
7755,
198,
198,
6371,
796,
705,
5450,
1378,
12708,
12,
11299,
13,
34975,
3889,
13,
785,
14,
45798,
14,
433,
4,
18,
32,
940,
13,
940,
2548,
4,
... | 2.295983 | 473 |
from .resource import ResourceParser
| [
6738,
764,
31092,
1330,
20857,
46677,
628
] | 5.428571 | 7 |
import os
path = os.getcwd()
content = os.listdir(path)
last = 0
for f in content:
name, ext = os.path.splitext(f)
ep_num = name.split('x', 1)[1]
ep_num = int(ep_num.split(' -', 1)[0])
if ep_num != last + 1:
ep_num = last + 1
last += 1
season = name.split('x', 1)[0]
name = name.split(' - ', 1)[1]
new = f'{... | [
11748,
28686,
198,
198,
6978,
796,
28686,
13,
1136,
66,
16993,
3419,
198,
11299,
796,
28686,
13,
4868,
15908,
7,
6978,
8,
198,
12957,
796,
657,
628,
198,
1640,
277,
287,
2695,
25,
198,
197,
3672,
11,
1070,
796,
28686,
13,
6978,
13,
... | 2.167539 | 191 |
from OpenSSL import crypto
from socket import gethostname
import os
import array as arr
import subprocess
Major = 0
Minor = 0
Build = 0
with open('../../../../../demos/include/aws_application_version.h') as f:
for line in f:
if line.find('APP_VERSION_MAJOR') != -1:
x = line.split()
... | [
6738,
4946,
31127,
1330,
21473,
201,
198,
6738,
17802,
1330,
651,
4774,
3672,
201,
198,
11748,
28686,
201,
198,
11748,
7177,
355,
5240,
201,
198,
11748,
850,
14681,
201,
198,
201,
198,
24206,
796,
657,
201,
198,
39825,
796,
657,
201,
... | 2.275246 | 1,624 |
import base64
import binascii
import json
import re
import struct
import sys
import uuid
from typing import (
Any,
Callable,
Dict,
Type,
Union
)
# Util Functions
def toStr(s: Any) -> str:
"""
Convert a given type to a default string
:param s: item to convert to a string
:return: c... | [
11748,
2779,
2414,
198,
11748,
9874,
292,
979,
72,
198,
11748,
33918,
198,
11748,
302,
198,
11748,
2878,
198,
11748,
25064,
198,
11748,
334,
27112,
198,
198,
6738,
19720,
1330,
357,
198,
220,
220,
220,
4377,
11,
198,
220,
220,
220,
48... | 2.499393 | 1,648 |
#!/usr/bin/env python
from threading import Timer
import rospy
from geometry_msgs.msg import Twist, Pose2D, PoseStamped
from std_msgs.msg import *
from move_base_msgs.msg import *
from actionlib_msgs.msg import *
from apriltags_ros.msg import *
avalability = False
tagOne = False
tagTwo = False
checkCBPub = rospy.Pub... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
6738,
4704,
278,
1330,
5045,
263,
198,
198,
11748,
686,
2777,
88,
198,
6738,
22939,
62,
907,
14542,
13,
19662,
1330,
44088,
11,
37557,
17,
35,
11,
37557,
1273,
13322,
198,
6738,
... | 2.565789 | 228 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#---------------------------------------------------------------------------------
#
# ,--.
# | |-. ,---. ,---. ,--.--.,--,--,
# | .-. '| .-. :| .-. || .--'| \
# | `-' |\ --.' '-' '| | ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
10097,
1783,
12,
198,
2,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
22... | 2.276256 | 438 |
import sqlite3
from sqlite3.dbapi2 import DataError
import threading
import random
import string
from .datatypes import *
from .errors import *
# TODO: in-code documentation
# TODO: pragma values
QueryObjects = (RawReadObject, RawWriteObject,
CreateTableObject, AddColumnObject,
AddR... | [
11748,
44161,
578,
18,
198,
6738,
44161,
578,
18,
13,
9945,
15042,
17,
1330,
6060,
12331,
198,
11748,
4704,
278,
198,
198,
11748,
4738,
198,
11748,
4731,
198,
198,
6738,
764,
19608,
265,
9497,
1330,
1635,
198,
6738,
764,
48277,
1330,
... | 2.716346 | 208 |
# Test file in Python style
# sync-start:correct 770446101 __examples__/correct_checksums/a.js
code = 1
# sync-end:correct
# sync-start:correct2 322927876 __examples__/correct_checksums/a.js
genwebpack/khan-apollo/fragment-types.js genfiles/graphql_schema.json: $(shell find */graphql */*/graphql -name '*.py' -a ! -na... | [
2,
6208,
2393,
287,
11361,
3918,
198,
198,
2,
17510,
12,
9688,
25,
30283,
44586,
2598,
5333,
486,
11593,
1069,
12629,
834,
14,
30283,
62,
42116,
5700,
14,
64,
13,
8457,
198,
8189,
796,
352,
198,
2,
17510,
12,
437,
25,
30283,
198,
... | 2.597484 | 159 |
##
## Entry file when package is used as the main program.
##
if __name__ == '__main__':
from .main import main
main()
| [
2235,
198,
2235,
21617,
2393,
618,
5301,
318,
973,
355,
262,
1388,
1430,
13,
198,
2235,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
422,
764,
12417,
1330,
1388,
628,
220,
220,
220,
1388,
3... | 2.954545 | 44 |
import numpy as np
from abraia import Multiple
multiple = Multiple()
| [
11748,
299,
32152,
355,
45941,
198,
198,
6738,
450,
430,
544,
1330,
20401,
198,
198,
48101,
796,
20401,
3419,
628,
628,
628
] | 3.454545 | 22 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from shogitk.shogi import Coords, Move, BLACK, WHITE, DROP, PROMOTE
RANKNUM = {
'a': 1,
'b': 2,
'c': 3,
'd': 4,
'e': 5,
'f': 6,
'g': 7,
'h': 8,
'i': 9
}
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
6738,
427,
519,
270,
74,
13,
1477,
44381,
1330,
1766,
3669,
11,
10028,
11,
31963,
11,
44925,
11,
... | 1.653409 | 176 |
# Bessel function of 2nd kind Y_n(x) on the real line for n=0,1,2,3
y0 = lambda x: bessely(0,x)
y1 = lambda x: bessely(1,x)
y2 = lambda x: bessely(2,x)
y3 = lambda x: bessely(3,x)
plot([y0,y1,y2,y3],[0,10],[-4,1]) | [
2,
347,
7878,
2163,
286,
362,
358,
1611,
575,
62,
77,
7,
87,
8,
319,
262,
1103,
1627,
329,
299,
28,
15,
11,
16,
11,
17,
11,
18,
198,
88,
15,
796,
37456,
2124,
25,
7284,
325,
306,
7,
15,
11,
87,
8,
198,
88,
16,
796,
37456,
... | 1.901786 | 112 |
from inspect import isclass
import os
import importlib.util
import sys
import logging
from pkgutil import iter_modules
def find_class(classname, directory):
'''
Search the specified directory for a file containing a python
implementation with the specified class name
:param classname: cla... | [
6738,
10104,
1330,
318,
4871,
198,
11748,
28686,
198,
11748,
1330,
8019,
13,
22602,
198,
11748,
25064,
198,
11748,
18931,
198,
6738,
279,
10025,
22602,
1330,
11629,
62,
18170,
628,
198,
4299,
1064,
62,
4871,
7,
4871,
3672,
11,
8619,
259... | 2.348077 | 1,040 |
#!/usr/bin/python
# -*- coding: UTF-8 -*-
"""
main.py
@author ejnp
"""
from lexer import Lexer
from parser import Parser, ParserError
from visitors import BetaReduction
def interpret(input_string, print_reductions=False):
"""Performs normal order reduction on the given string lambda calculus
expression. Re... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
532,
9,
12,
19617,
25,
41002,
12,
23,
532,
9,
12,
198,
198,
37811,
198,
12417,
13,
9078,
198,
198,
31,
9800,
304,
73,
37659,
198,
37811,
198,
198,
6738,
31191,
263,
1330,
17210,
263,
... | 2.525641 | 468 |
from django.template import TemplateSyntaxError
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from django.http import Http404
from django.utils.encoding import smart_unicode
from django.template.loader import render_to_string
from django.utils.safestring import mark_safe
... | [
6738,
42625,
14208,
13,
28243,
1330,
37350,
13940,
41641,
12331,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
11299,
19199,
13,
27530,
1330,
14041,
6030,
198,
6738,
42625,
14208,
13,
4023,
13... | 2.354442 | 1,058 |
from math import gcd
fractions = list()
for numerator in range(10, 100):
for denominator in range(numerator+1, 100):
actual = numerator / denominator
a = numerator // 10
b = numerator % 10
c = denominator // 10
d = denominator % 10
if (b == 0 and d == 0) or (a == b and c == d) or (a != d and... | [
6738,
10688,
1330,
308,
10210,
198,
198,
69,
37810,
796,
1351,
3419,
198,
198,
1640,
5470,
1352,
287,
2837,
7,
940,
11,
1802,
2599,
198,
220,
329,
31457,
1352,
287,
2837,
7,
77,
6975,
1352,
10,
16,
11,
1802,
2599,
198,
220,
220,
2... | 2.402667 | 375 |
import datetime
import json
from django.conf import settings
from django.utils import timezone
| [
11748,
4818,
8079,
198,
11748,
33918,
198,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
26791,
1330,
640,
11340,
198
] | 3.84 | 25 |
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from datetime import datetime
import time
| [
6738,
384,
11925,
1505,
1330,
3992,
26230,
201,
198,
6738,
384,
11925,
1505,
13,
12384,
26230,
13,
11321,
13,
1525,
1330,
2750,
201,
198,
6738,
384,
11925,
1505,
13,
12384,
26230,
13,
11284,
13,
9019,
1330,
5313,
32103,
21321,
201,
198,... | 3.246753 | 77 |
import sqlite3 as sqlite
from SQLObjectStore import SQLObjectStore
class SQLiteObjectStore(SQLObjectStore):
"""SQLiteObjectStore implements an object store backed by a SQLite database.
See the SQLite docs or the DB API 2.0 docs for more information:
https://docs.python.org/2/library/sqlite3.html
... | [
11748,
44161,
578,
18,
355,
44161,
578,
198,
198,
6738,
16363,
10267,
22658,
1330,
16363,
10267,
22658,
628,
198,
4871,
16363,
578,
10267,
22658,
7,
17861,
10267,
22658,
2599,
198,
220,
220,
220,
37227,
17861,
578,
10267,
22658,
23986,
28... | 3 | 124 |
from django.conf import settings
from graphql import GraphQLError
from itdagene.graphql.loaders import Loaders
| [
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
4823,
13976,
1330,
29681,
48,
2538,
81,
1472,
198,
6738,
340,
67,
363,
1734,
13,
34960,
13976,
13,
2220,
364,
1330,
8778,
364,
628,
198
] | 3.323529 | 34 |
import click
import subprocess
import random
import string
import os
@click.group()
@cli.command()
@click.argument("runner")
@click.option("--editor", default="nano")
| [
11748,
3904,
198,
11748,
850,
14681,
198,
11748,
4738,
198,
11748,
4731,
198,
11748,
28686,
198,
198,
31,
12976,
13,
8094,
3419,
198,
198,
31,
44506,
13,
21812,
3419,
198,
31,
12976,
13,
49140,
7203,
16737,
4943,
198,
31,
12976,
13,
1... | 3.25 | 52 |
# Copyright 2015 Red Hat, 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 agre... | [
2,
15069,
1853,
2297,
10983,
11,
3457,
13,
198,
2,
198,
2,
220,
220,
220,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
345,
743,
198,
2,
220,
220,
220,
407,
779,
428,
2393,
2845,
287,
11846,... | 3.527523 | 218 |
# Copyright 2020 Huawei Technologies Co., Ltd
#
# 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... | [
2,
15069,
12131,
43208,
21852,
1766,
1539,
12052,
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,
287,
11846,
351,
262,
13789,
13,
198... | 2.303944 | 3,550 |
from armada_command import armada_api
| [
6738,
3211,
4763,
62,
21812,
1330,
3211,
4763,
62,
15042,
628,
198
] | 3.333333 | 12 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Main Controller
Created on Tue Aug 17 14:16:44 2021
Version: 1.0
Universidad Santo Tomás Tunja
Simulation
@author: Juana Valentina Mendoza Santamaría
@author: Alix Ivonne Chaparro Vasquez
presented to: Martha Susana Contreras Ortiz
"""
from random import randint
imp... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
37811,
198,
13383,
22741,
220,
198,
198,
41972,
319,
30030,
2447,
1596,
1478,
25,
1433,
25,
2598,
33448,
198,
... | 2.383633 | 3,055 |
from enum import IntEnum
from .responses import *
from .signatures import *
from .transactions import *
| [
6738,
33829,
1330,
2558,
4834,
388,
198,
198,
6738,
764,
16733,
274,
1330,
1635,
198,
6738,
764,
12683,
6691,
1330,
1635,
198,
6738,
764,
7645,
4658,
1330,
1635,
628
] | 3.655172 | 29 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# @Author: penghuailiang
# @Date : 1/1/20
"""
此脚本使用scipy.special绘制球谐函数
"""
import numpy as np
import matplotlib.pyplot as plt
from scipy.special import sph_harm
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import cm
theta_1d = np.linspace(0, np.pi, 181) # c... | [
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,
2488,
13838,
25,
3112,
456,
84,
603,
15483,
198,
2,
2488,
10430,
220,
1058,
352,
14,
16,
14,
1238,
198,
198,... | 1.87027 | 370 |
# Generated by Django 3.2.7 on 2021-11-23 11:44
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
513,
13,
17,
13,
22,
319,
33448,
12,
1157,
12,
1954,
1367,
25,
2598,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
test = {
'name': 'composed',
'points': 1,
'suites': [
{
'cases': [
{
'code': r"""
scm> ((composed add-one add-one) 2)
a1e11865670a42d05e20b9a3455dc457
# locked
""",
'hidden': False,
'locked': True
},
{
... | [
9288,
796,
1391,
198,
220,
705,
3672,
10354,
705,
5589,
1335,
3256,
198,
220,
705,
13033,
10354,
352,
11,
198,
220,
705,
2385,
2737,
10354,
685,
198,
220,
220,
220,
1391,
198,
220,
220,
220,
220,
220,
705,
33964,
10354,
685,
198,
22... | 1.643398 | 1,189 |
import sys
import genotypes
from graphviz import Digraph
from genotypes import PRIMITIVES
if __name__ == '__main__':
if len(sys.argv) != 2:
print("usage:\n python {} ARCH_NAME".format(sys.argv[0]))
sys.exit(1)
genotype_name = sys.argv[1]
try:
genotype = eval('genotypes.{}'.format(genotype_name))
... | [
11748,
25064,
198,
11748,
2429,
13567,
198,
6738,
4823,
85,
528,
1330,
7367,
1470,
198,
6738,
2429,
13567,
1330,
4810,
3955,
2043,
42472,
628,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
611,
18896,
7,
... | 2.517375 | 259 |
from meridien.settings.base import *
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '8ka@=25ffr7377i_s*$$6n_=sepb1jpwhrbbgviphal7q=(3zz'
# Database
# https://docs.djangoproject.com/en/3.0/ref/settings/#dat... | [
6738,
4017,
312,
2013,
13,
33692,
13,
8692,
1330,
1635,
198,
198,
2,
10729,
4261,
9050,
39410,
25,
836,
470,
1057,
351,
14257,
2900,
319,
287,
3227,
0,
198,
30531,
796,
6407,
198,
198,
2,
10729,
4261,
9050,
39410,
25,
1394,
262,
320... | 2.277628 | 371 |
"""
Problem Description:
Cody has a sequence of characters N. He likes a sequence if it contains his favourite sequence as a substring.
Given the sequence and his favourite sequence F, check whether the favourite sequence is present in the sequence.
Input:
The first line of input contains a single line T, which repres... | [
37811,
198,
40781,
12489,
25,
198,
34,
1118,
468,
257,
8379,
286,
3435,
399,
13,
679,
7832,
257,
8379,
611,
340,
4909,
465,
12507,
8379,
355,
257,
3293,
1806,
13,
198,
15056,
262,
8379,
290,
465,
12507,
8379,
376,
11,
2198,
1771,
26... | 3.140078 | 257 |
# -*- coding: utf-8 -*-
import sys
from typing import List
import requests
from alibabacloud_slb20140515.client import Client as Slb20140515Client
from alibabacloud_tea_openapi import models as open_api_models
from alibabacloud_slb20140515 import models as slb_20140515_models
if __name__ == '__main__':
Sample.... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
25064,
198,
198,
6738,
19720,
1330,
7343,
198,
11748,
7007,
198,
198,
6738,
435,
571,
397,
37779,
2778,
62,
6649,
65,
1264,
26598,
1314,
13,
16366,
1330,
20985,
3... | 2.735714 | 140 |
# all the imports
import psycopg2
import nltk
from robovest.portfolio import*
#nltk.download()
import tweepy
import os
import sqlite3
import datetime
import numpy as np
from nltk.sentiment.vader import SentimentIntensityAnalyzer
from flask import Flask, request, session, g, redirect, url_for, abort, \
render_templ... | [
2,
477,
262,
17944,
198,
11748,
17331,
22163,
70,
17,
198,
11748,
299,
2528,
74,
198,
6738,
3857,
709,
395,
13,
634,
13652,
1330,
9,
198,
2,
77,
2528,
74,
13,
15002,
3419,
198,
11748,
4184,
538,
88,
198,
11748,
28686,
198,
11748,
... | 2.623904 | 912 |
import concurrent.futures
import functools
import logging
from dataclasses import dataclass
from typing import Union, cast
from datahub.cli.cli_utils import set_env_variables_override_config
from datahub.configuration.common import OperationalError
from datahub.emitter.mcp import MetadataChangeProposalWrapper
from dat... | [
11748,
24580,
13,
69,
315,
942,
198,
11748,
1257,
310,
10141,
198,
11748,
18931,
198,
6738,
4818,
330,
28958,
1330,
4818,
330,
31172,
198,
6738,
19720,
1330,
4479,
11,
3350,
198,
198,
6738,
4818,
993,
549,
13,
44506,
13,
44506,
62,
26... | 3.125402 | 311 |
default_app_config = 'kv_settings.apps.KeyValueSettingsConfig'
| [
12286,
62,
1324,
62,
11250,
796,
705,
74,
85,
62,
33692,
13,
18211,
13,
9218,
11395,
26232,
16934,
6,
198
] | 3.15 | 20 |
# -*- coding: UTF-8 -*-
# Note: this is mainly required because using the Django test runner
# requires that apps under test have a 'models' module, even if it's
# just empty.
from flows import config
if config.FLOWS_STATE_STORE == 'flows.statestore.django_store':
from flows.statestore.django_store import StateM... | [
2,
532,
9,
12,
19617,
25,
41002,
12,
23,
532,
9,
12,
198,
198,
2,
5740,
25,
428,
318,
8384,
2672,
780,
1262,
262,
37770,
1332,
17490,
198,
2,
4433,
326,
6725,
739,
1332,
423,
257,
705,
27530,
6,
8265,
11,
772,
611,
340,
338,
1... | 3.336283 | 113 |
# coding=utf-8
"""
使用multiprocessing模块创建多进程
"""
import os
from multiprocessing import Process
# 子进程要执行的代码
if __name__ == '__main__':
print('Parent process %s.'% os.getpid())
for i in range(5):
p = Process(target=run_proc,args=(str(i),))
print('Process will start.')
p.start()
p.join... | [
2,
19617,
28,
40477,
12,
23,
198,
37811,
198,
45635,
18796,
101,
16680,
541,
305,
919,
278,
162,
101,
94,
161,
251,
245,
26344,
249,
161,
119,
118,
13783,
248,
32573,
249,
163,
101,
233,
198,
37811,
198,
11748,
28686,
198,
6738,
185... | 1.950276 | 181 |
from django.shortcuts import render
import time
import datetime
from server import models
# Create your views here.
| [
6738,
42625,
14208,
13,
19509,
23779,
1330,
8543,
198,
11748,
640,
198,
11748,
4818,
8079,
198,
198,
6738,
4382,
1330,
4981,
628,
198,
2,
13610,
534,
5009,
994,
13,
628,
628,
628,
198
] | 3.787879 | 33 |
import typing
import torch
import torchtraining as tt
import torchvision
| [
11748,
19720,
198,
198,
11748,
28034,
198,
11748,
28034,
34409,
355,
256,
83,
198,
11748,
28034,
10178,
628
] | 4.166667 | 18 |
from setuptools import setup
setup(
name="Pygments Snowball Plugin",
version = "1.0",
scripts = ['pygments_snowball.py'],
entry_points = """
[pygments.lexers]
snowball_lexer = pygments_snowball:SnowballLexer
""",
description = 'Pygments Lexer Plugin for Snowball',
license = '... | [
6738,
900,
37623,
10141,
1330,
9058,
198,
40406,
7,
198,
220,
220,
220,
1438,
2625,
20519,
11726,
7967,
1894,
42636,
1600,
198,
220,
220,
220,
2196,
796,
366,
16,
13,
15,
1600,
198,
220,
220,
220,
14750,
796,
37250,
9078,
11726,
62,
... | 2.456647 | 173 |
# -*- coding: utf-8 -*-
########### SVN repository information ###################
# $Date: 2017-10-23 11:39:16 -0500 (Mon, 23 Oct 2017) $
# $Author: vondreele $
# $Revision: 3136 $
# $URL: https://subversion.xray.aps.anl.gov/pyGSAS/trunk/imports/G2img_Rigaku.py $
# $Id: G2img_Rigaku.py 3136 2017-10-23 16:39:16Z vondre... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
7804,
21017,
20546,
45,
16099,
1321,
1303,
14468,
2235,
198,
2,
720,
10430,
25,
2177,
12,
940,
12,
1954,
1367,
25,
2670,
25,
1433,
532,
2713,
405,
357,
9069,
11,
2242,... | 2.278564 | 919 |
"""
Your chance to explore Loops and Turtles!
Authors: David Mutchler, Vibha Alangar, Matt Boutell, Dave Fisher,
Aaron Wilkin, their colleagues, and Shixin Yan.
"""
########################################################################
# DONE: 1.
# On Line 5 above, replace PUT_YOUR_NAME_HERE with your o... | [
37811,
198,
7120,
2863,
284,
7301,
6706,
2840,
290,
44356,
0,
198,
198,
30515,
669,
25,
3271,
337,
7140,
1754,
11,
569,
571,
3099,
978,
648,
283,
11,
4705,
40808,
695,
11,
9935,
14388,
11,
198,
220,
220,
220,
220,
220,
220,
220,
2... | 3.066558 | 616 |
# Part of the Fluid Corpus Manipulation Project (http://www.flucoma.org/)
# Copyright 2017-2019 University of Huddersfield.
# Licensed under the BSD-3 License.
# See license.md file in the project root for full license information.
# This project has received funding from the European Research Council (ERC)
# under the... | [
2,
2142,
286,
262,
1610,
27112,
44874,
35045,
1741,
4935,
357,
4023,
1378,
2503,
13,
35522,
785,
64,
13,
2398,
34729,
198,
2,
15069,
2177,
12,
23344,
2059,
286,
367,
4185,
364,
3245,
13,
198,
2,
49962,
739,
262,
347,
10305,
12,
18,
... | 2.821068 | 693 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.3 on 2016-11-11 23:24
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2980,
515,
416,
37770,
352,
13,
940,
13,
18,
319,
1584,
12,
1157,
12,
1157,
2242,
25,
1731,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
... | 2.73913 | 69 |
""" Linker utility. """
import logging
from collections import defaultdict
from .objectfile import ObjectFile, Image, get_object, RelocationEntry
from ..common import CompilerError
from .layout import Layout, Section, SectionData, SymbolDefinition, Align
from .layout import get_layout
from .debuginfo import SymbolIdAd... | [
37811,
7502,
263,
10361,
13,
37227,
198,
198,
11748,
18931,
198,
6738,
17268,
1330,
4277,
11600,
198,
6738,
764,
15252,
7753,
1330,
9515,
8979,
11,
7412,
11,
651,
62,
15252,
11,
4718,
5040,
30150,
198,
6738,
11485,
11321,
1330,
3082,
53... | 2.126216 | 11,203 |
from django.db import models
import uuid
# Create your models here.
| [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
11748,
334,
27112,
198,
198,
2,
13610,
534,
4981,
994,
13,
198
] | 3.45 | 20 |
from setuptools import setup
setup(
name='interactive_segmentation',
version='1.0',
packages=['annotate'],
license='MIT'
)
| [
6738,
900,
37623,
10141,
1330,
9058,
198,
198,
40406,
7,
198,
220,
220,
220,
1438,
11639,
3849,
5275,
62,
325,
5154,
341,
3256,
198,
220,
220,
220,
2196,
11639,
16,
13,
15,
3256,
198,
220,
220,
220,
10392,
28,
17816,
34574,
378,
6,
... | 2.545455 | 55 |