content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
import h5py
import os
import numpy as np | [
11748,
289,
20,
9078,
198,
11748,
28686,
198,
11748,
299,
32152,
355,
45941
] | 3.076923 | 13 |
import json
from notebook.base.handlers import APIHandler
from notebook.utils import url_path_join
import tornado
import os
import logging
import shutil
_extension_home_dir = os.path.join(os.environ["HOME"],'.jl-bookmarks')
if not os.path.exists(_extension_home_dir):
## Create <USER_HOME/.jl-bookmarks dir if it d... | [
11748,
33918,
198,
198,
6738,
20922,
13,
8692,
13,
4993,
8116,
1330,
7824,
25060,
198,
6738,
20922,
13,
26791,
1330,
19016,
62,
6978,
62,
22179,
198,
11748,
33718,
198,
11748,
28686,
198,
11748,
18931,
198,
11748,
4423,
346,
198,
198,
6... | 2.739837 | 369 |
#!/usr/bin/env python
import cgt
for (name,val) in cgt.__dict__.iteritems():
if not name.startswith("_"):
if not val.__doc__:
print "API function %s requires docstring!"%name
for (name,val) in cgt.core.__dict__.iteritems():
if isinstance(val, type) and issubclass(val, cgt.core.Op):
... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
11748,
269,
13655,
198,
1640,
357,
3672,
11,
2100,
8,
287,
269,
13655,
13,
834,
11600,
834,
13,
2676,
23814,
33529,
198,
220,
220,
220,
611,
407,
1438,
13,
9688,
2032,
342,
7203,
62,... | 2.292079 | 202 |
from django.db import models
from django.contrib.auth.models import AbstractUser
from django.contrib.auth import password_validation
from django import forms
# from django.contrib.auth import get_user_model
from django.utils.translation import gettext, gettext_lazy as _
# from django.contrib.auth.forms import UserCrea... | [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
27530,
1330,
27741,
12982,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
1330,
220,
9206,
62,
12102,
341,
198,
6738,
42625,
14208,
133... | 3.491071 | 112 |
from constants import *
from descriptors import *
| [
6738,
38491,
1330,
1635,
198,
6738,
12145,
669,
1330,
1635,
198
] | 4.545455 | 11 |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
# Author: Donny You(youansheng@gmail.com), Xiangtai(lxtpku@pku.edu.cn)
# Select Seg Model for img segmentation.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from lib.models.nets.asp_ocnet import AspOCNet
from... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
40477,
12,
23,
532,
9,
12,
198,
2,
6434,
25,
2094,
3281,
921,
7,
5832,
504,
31753,
31,
14816,
13,
785,
828,
45641,
83,
1872,
7,
75,
742,
79,
23063,
31... | 2.58377 | 382 |
import pandas as pd
import tempfile
import matplotlib.pyplot as plt
from collections import defaultdict
import pickle
import numpy as np
from sklearn.pipeline import Pipeline
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.svm import LinearSVC
from sklearn.feature_extraction.text import TfidfTr... | [
11748,
19798,
292,
355,
279,
67,
198,
11748,
20218,
7753,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
6738,
17268,
1330,
4277,
11600,
198,
11748,
2298,
293,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
1341,
357... | 2.701987 | 1,057 |
from twisted.internet import defer
from ooni.tests import is_internet_connected, bases
from ooni import geoip
| [
198,
6738,
19074,
13,
37675,
1330,
29135,
198,
198,
6738,
267,
14651,
13,
41989,
1330,
318,
62,
37675,
62,
15236,
11,
12536,
198,
6738,
267,
14651,
1330,
40087,
541,
628
] | 3.766667 | 30 |
# -*- coding: utf-8 -*-
import requests
import settings
import json
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
7007,
198,
11748,
6460,
198,
11748,
33918,
628,
628
] | 2.958333 | 24 |
count = int(input("[>] Enter count of tops: "))
graph = [(float("inf"), -1, -1)]
status = True
while True:
status = input("[>] Enter the element of graph (lenght, top 1, top 2): ")
if status:
status = tuple(map(int, status.split()))
graph.append(status)
else:
break
unified = {1... | [
198,
198,
9127,
796,
493,
7,
15414,
7203,
58,
37981,
6062,
954,
286,
21246,
25,
366,
4008,
198,
198,
34960,
796,
47527,
22468,
7203,
10745,
12340,
532,
16,
11,
532,
16,
15437,
198,
198,
13376,
796,
6407,
198,
198,
4514,
6407,
25,
19... | 2.245763 | 236 |
import numpy as np
import os
import sys
import tensorflow as tf
from collections import defaultdict
import cv2
# This is needed since the notebook is stored in the object_detection folder.
#sys.path.append("..")
#from object_detection.utils import ops as utils_ops
#from object_detection.utils import label_map_util
# ... | [
11748,
299,
32152,
355,
45941,
198,
11748,
28686,
198,
11748,
25064,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
6738,
17268,
1330,
4277,
11600,
198,
11748,
269,
85,
17,
198,
198,
2,
770,
318,
2622,
1201,
262,
20922,
318,
8574,
287,... | 2.770186 | 322 |
#!/usr/bin/env python
# Copyright (C) 2013-2014 Bastian Kleineidam
"""
Script to get arcamax comics and save the info in a JSON file for further processing.
"""
from __future__ import print_function
import codecs
import re
import sys
import os
import requests
sys.path.append(os.path.join(os.path.dirname(__file__), ".."... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
15069,
357,
34,
8,
2211,
12,
4967,
17520,
666,
15983,
500,
312,
321,
198,
37811,
198,
7391,
284,
651,
10389,
321,
897,
12770,
290,
3613,
262,
7508,
287,
257,
19449,
2393,
329,
225... | 2.368582 | 1,305 |
import itertools
from learntools.core import *
import learntools.python.solns.word_search as word_search_module
word_search = word_search_module.word_search
import learntools.python.solns.multi_word_search as mws_module
multi_word_search = mws_module.multi_word_search
import learntools.python.solns.diamond as d_modul... | [
11748,
340,
861,
10141,
198,
198,
6738,
26338,
10141,
13,
7295,
1330,
1635,
198,
198,
11748,
26338,
10141,
13,
29412,
13,
34453,
5907,
13,
4775,
62,
12947,
355,
1573,
62,
12947,
62,
21412,
198,
4775,
62,
12947,
796,
1573,
62,
12947,
6... | 2.611888 | 286 |
#!/usr/bin/env python
"""A simple developer-centric test script.
"""
import argparse
import os
import time
from dm_api.dm_api import DmApi, DmApiRv
# Get configuration from the environment.
# All the expected variables must be defined...
API_URL: str = os.environ['SQUONK_API_URL']
KEYCLOAK_URL: str = os.environ['SQUO... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
37811,
32,
2829,
8517,
12,
28577,
1332,
4226,
13,
198,
37811,
198,
11748,
1822,
29572,
198,
11748,
28686,
198,
11748,
640,
198,
198,
6738,
288,
76,
62,
15042,
13,
36020,
62,
15042,
133... | 2.386861 | 274 |
from threading import Thread
from multiprocessing import Process, Queue
from time import time
from numpy import array_split
# Process einfach durch Thread erstetzen, wenn multithreading statt processing gewünscht ist
if __name__ == "__main__":
main(16, 80000000)
| [
6738,
4704,
278,
1330,
14122,
198,
6738,
18540,
305,
919,
278,
1330,
10854,
11,
4670,
518,
198,
6738,
640,
1330,
640,
198,
6738,
299,
32152,
1330,
7177,
62,
35312,
628,
198,
2,
10854,
304,
10745,
620,
288,
2575,
14122,
1931,
301,
316,... | 3.238095 | 84 |
from autoencoders.VAE import VAE, VAEBallTrack
from keras.preprocessing.image import ImageDataGenerator
DATASET_SIZE = 11862
INPUT_SHAPE = (40, 40, 1)
datagen = ImageDataGenerator(
rescale=1./255,
validation_split=0.2,
horizontal_flip=True,
vertical_flip=True
)
# Allow horizontal flip as a mirror imag... | [
6738,
1960,
6571,
19815,
364,
13,
11731,
36,
1330,
13753,
36,
11,
13753,
36,
23410,
24802,
198,
6738,
41927,
292,
13,
3866,
36948,
13,
9060,
1330,
7412,
6601,
8645,
1352,
198,
198,
35,
1404,
1921,
2767,
62,
33489,
796,
1367,
4521,
17,... | 1.617043 | 974 |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import numpy as np
import os
import struct
import sys
import threading
import time
import yaml
import zmq
sys.path.append(os.path.join(os.path.dirname('__file__'), '..'))
from common.pilot_gloval_variable import MPVariable
if __name__ == '__main__':
# Load config
... | [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28686,
198,
11748,
2878,
198,
11748,
25064,
198,
11748,
4704,
278,
198,
11... | 2.342857 | 245 |
import numpy as np
from mpi4py import MPI
from tqdm import tqdm
from ..prob_calculators import get_p_cos1_given_xeff_q_a1, get_p_a1_given_xeff_q
comm = MPI.COMM_WORLD
pe = comm.Get_rank() # identity of this process (process element, sometimes called rank)
nprocs = comm.Get_size() # number of processes
root = nprocs... | [
11748,
299,
32152,
355,
45941,
198,
6738,
285,
14415,
19,
9078,
1330,
4904,
40,
198,
198,
6738,
256,
80,
36020,
1330,
256,
80,
36020,
198,
6738,
11485,
1676,
65,
62,
9948,
3129,
2024,
1330,
651,
62,
79,
62,
6966,
16,
62,
35569,
62,
... | 2.879699 | 133 |
"""
# https://code.google.com/p/promisedata/source/browse/#svn%2Ftrunk%2Feffort%2Falbrecht
Standard header:
"""
from __future__ import division,print_function
import sys
sys.dont_write_bytecode = True
from lib import *
"""
@attribute KLOC numeric
@attribute SCRN numeric
@attribute FORM numeric
@attribute FILE numer... | [
37811,
198,
2,
3740,
1378,
8189,
13,
13297,
13,
785,
14,
79,
14,
16963,
1417,
1045,
14,
10459,
14,
25367,
325,
31113,
21370,
77,
4,
17,
37,
2213,
2954,
4,
17,
14304,
487,
419,
4,
17,
41129,
4679,
21474,
198,
198,
23615,
13639,
25,... | 3.27907 | 129 |
import numpy as np
from Cython.Build import cythonize
from setuptools import Extension, find_packages, setup
with open("opteryx/version.py", "r") as v:
vers = v.read()
exec(vers) # nosec
with open("README.md", "r") as rm:
long_description = rm.read()
try:
with open("requirements.txt") as f:
requ... | [
11748,
299,
32152,
355,
45941,
198,
6738,
327,
7535,
13,
15580,
1330,
3075,
400,
261,
1096,
198,
6738,
900,
37623,
10141,
1330,
27995,
11,
1064,
62,
43789,
11,
9058,
198,
198,
4480,
1280,
7203,
404,
11471,
87,
14,
9641,
13,
9078,
1600... | 2.466425 | 551 |
# -*- coding: utf-8 -*-
import argparse
import JackFramework.SysBasic.define as sysdefine
# Parse the train model's para
class ArgsParser(object):
"""docstring for ArgsParser"""
@staticmethod
@staticmethod
@staticmethod
@staticmethod
@staticmethod
@staticmethod
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
1822,
29572,
198,
11748,
3619,
21055,
6433,
13,
44387,
26416,
13,
13086,
355,
25064,
13086,
628,
198,
2,
2547,
325,
262,
4512,
2746,
338,
31215,
198,
4871,
943,
1... | 2.893204 | 103 |
import os
import pickle
from tensorflow.keras.models import load_model
import tensorflow as tf
### chage the base path.
#prefix='/phanns'
prefix=''
path = os.path.abspath(__file__)
root_dir = os.path.dirname(path)
#fasta_dir = os.path.join(root_dir, 'fasta')
model_dir = os.path.join(root_dir, 'deca_model')
fasta_dir ... | [
11748,
28686,
198,
11748,
2298,
293,
198,
6738,
11192,
273,
11125,
13,
6122,
292,
13,
27530,
1330,
3440,
62,
19849,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
198,
21017,
442,
496,
262,
2779,
3108,
13,
198,
2,
40290,
11639,
14,
7... | 2.461255 | 271 |
from hvac_cli import cmd
import pytest
from tests.modified_environ import modified_environ
| [
6738,
289,
85,
330,
62,
44506,
1330,
23991,
198,
11748,
12972,
9288,
198,
6738,
5254,
13,
41771,
62,
268,
2268,
1330,
9518,
62,
268,
2268,
628,
628
] | 3.481481 | 27 |
import numpy as np
import torch
from torch.utils.serialization import load_lua
from coremltools.models.neural_network import NeuralNetworkBuilder
from coremltools.models import MLModel, datatypes
import _layers
from _layers import _get_layer_converter_fn
from _utils import _gen_layer_name
from _utils import _conve... | [
11748,
299,
32152,
355,
45941,
198,
11748,
28034,
198,
198,
6738,
28034,
13,
26791,
13,
46911,
1634,
1330,
3440,
62,
40211,
198,
198,
6738,
4755,
76,
2528,
10141,
13,
27530,
13,
710,
1523,
62,
27349,
1330,
47986,
26245,
32875,
198,
6738... | 2.269327 | 3,208 |
# Configuración necesaria para elasticsearch
INDEX_ELASTIC = "parse-speech"
HOST_ELASTIC = "http://localhost:8000"
| [
2,
17056,
333,
32009,
18840,
497,
728,
10312,
31215,
27468,
12947,
198,
198,
12115,
6369,
62,
3698,
11262,
2149,
796,
366,
29572,
12,
45862,
1,
198,
39,
10892,
62,
3698,
11262,
2149,
796,
366,
4023,
1378,
36750,
25,
33942,
1,
198
] | 2.829268 | 41 |
# Copyright 2019 IBM Corp.
#
# 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 required by applicable law or... | [
2,
15069,
13130,
19764,
11421,
13,
198,
2,
198,
2,
1439,
6923,
33876,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846... | 3.609272 | 302 |
import numpy as np
# import pandas as pd
from PetastormDataLoaders.PetastormDataModule import PetastormDataModule
from PetastormDataLoaders.PetastormDataLoader import TransformersDataLoader
# from petastorm.pytorch import DataLoader
from petastorm.transform import TransformSpec
from transformers import AutoTokenizer
... | [
11748,
299,
32152,
355,
45941,
198,
2,
1330,
19798,
292,
355,
279,
67,
198,
198,
6738,
4767,
459,
579,
6601,
8912,
364,
13,
25803,
459,
579,
6601,
26796,
1330,
4767,
459,
579,
6601,
26796,
198,
6738,
4767,
459,
579,
6601,
8912,
364,
... | 2.765873 | 504 |
#!/usr/bin/env python
from fragpy.min import optf
from fragpy.opt_param import param
''' RUN THIS PYHON SCRIPT
The following example corresponds to example2.inp
to be run as a python scrip rather than with
fragpy/fragpy.
'''
coord = [
['N1', -0.42041893 , -0.13177839 , -1.10917804,1 ],
['H1', -1.40858582 , ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
6738,
7956,
9078,
13,
1084,
1330,
2172,
69,
198,
6738,
7956,
9078,
13,
8738,
62,
17143,
1330,
5772,
198,
198,
7061,
6,
220,
32494,
12680,
350,
56,
39,
1340,
6374,
46023,
220,
198,
46... | 1.749565 | 2,871 |
#!/usr/bin/env python
################################################################################
# _ ____ ___ _____ _ _ _ _ #
# / \ / ___|_ _| |_ _|__ ___ | | | _(_) |_ #
# / _ \| | | | | |/ _ \ / _ \| | |/... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
29113,
29113,
14468,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4808,
220,
220,
220,
220,
1427,
46444,
220,
220,
220,
29343,
220,
220,
... | 1.949464 | 3,641 |
#!/usr/bin/env python
from distutils.core import setup
setup(name='pynode',
version='0.1.0',
description='A python module for building a python task worker run by node.js, providing two-way communication based on socket.io.',
author='Christopher S. Case',
author_email='chris.case@g33xnexus.com... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
6738,
1233,
26791,
13,
7295,
1330,
9058,
198,
198,
40406,
7,
3672,
11639,
79,
2047,
1098,
3256,
198,
220,
220,
220,
220,
220,
2196,
11639,
15,
13,
16,
13,
15,
3256,
198,
220,
... | 2.6 | 155 |
from django.conf.urls import patterns, url
from scout.properties import views
urlpatterns = patterns(
'',
url(r'^$', views.property_list_view, name='list'),
url(r'^add/$', views.property_add_view, name='add'),
url(r'^edit/(?P<pk>\d+)/$', views.property_edit_view, name='edit'),
) | [
6738,
42625,
14208,
13,
10414,
13,
6371,
82,
1330,
7572,
11,
19016,
198,
198,
6738,
24490,
13,
48310,
1330,
5009,
628,
198,
6371,
33279,
82,
796,
7572,
7,
198,
220,
220,
220,
705,
3256,
198,
220,
220,
220,
19016,
7,
81,
6,
61,
3,
... | 2.525424 | 118 |
from shape import shape
#.keys = the list of keys that are being pressed (since the last processed frame)
#.move - moves the birdy safely (and returns True if succeeded)
#.sets the next action for the bird (to jump or to fall, + indicators for how much to jump/fall)
#.gravity makes birdy fall/jump based on .jump and .... | [
198,
6738,
5485,
1330,
5485,
198,
2,
13,
13083,
796,
262,
1351,
286,
8251,
326,
389,
852,
12070,
357,
20777,
262,
938,
13686,
5739,
8,
198,
2,
13,
21084,
532,
6100,
262,
6512,
88,
11512,
357,
392,
5860,
6407,
611,
14131,
8,
198,
2... | 3.058394 | 137 |
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | [
2,
15069,
33448,
3012,
11419,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198,
2,
921,
743,
733... | 3.625532 | 235 |
#!/usr/bin/env python2
# Copyright (c) 2015-2016, NVIDIA CORPORATION. All rights reserved.
"""
Classify an image using individual model files
Use this script as an example to build your own tool
"""
from caffe.proto import caffe_pb2
import caffe
import argparse
import os
import time
import pydevd
from google.proto... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
17,
198,
2,
15069,
357,
66,
8,
1853,
12,
5304,
11,
15127,
23929,
44680,
6234,
13,
220,
1439,
2489,
10395,
13,
198,
198,
37811,
198,
9487,
1958,
281,
2939,
1262,
1981,
2746,
3696,
198,
198... | 2.333726 | 3,395 |
import os
from datetime import datetime
import logging
import requests
import json
import pandas as pd
from pycountry import countries
from git import Repo
from config_corona import ConfigCorona
# Set LOGGER
LOGGER = logging.getLogger()
LOGGER.setLevel(logging.DEBUG)
formatter = logging.Formatter(
'%(asctime)s -... | [
11748,
28686,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
11748,
18931,
198,
11748,
7007,
198,
11748,
33918,
198,
11748,
19798,
292,
355,
279,
67,
198,
6738,
12972,
19315,
1330,
2678,
198,
6738,
17606,
1330,
1432,
78,
198,
6738,
4566,
... | 2.295026 | 3,237 |
from cc3d import CompuCellSetup
from diffusion_steady_state_ext_potential_3DSteppables import diffusion_steady_state_ext_potential_3DSteppable
CompuCellSetup.register_steppable(steppable=diffusion_steady_state_ext_potential_3DSteppable(frequency=1))
CompuCellSetup.run()
| [
6738,
36624,
18,
67,
1330,
3082,
84,
28780,
40786,
198,
198,
6738,
44258,
62,
28044,
88,
62,
5219,
62,
2302,
62,
13059,
1843,
62,
18,
5258,
660,
381,
2977,
1330,
44258,
62,
28044,
88,
62,
5219,
62,
2302,
62,
13059,
1843,
62,
18,
5... | 2.824742 | 97 |
"""
Автор: Моисеенко Павел, группа № 1, подгруппа № 2.
Задание: разработайте скрипт с функцией, которая для ряда Фибо-
наччи, где количество элементов, n = 22, возвращает подмножество
значений или единственное значение (по вариантам). Для нахождения
элемента требуется использовать слайсы. Формирова... | [
37811,
198,
220,
220,
220,
12466,
238,
38857,
20375,
15166,
21169,
25,
12466,
250,
15166,
18849,
21727,
16843,
16843,
22177,
31583,
15166,
12466,
253,
16142,
38857,
16843,
30143,
11,
12466,
111,
21169,
35072,
140,
123,
140,
123,
16142,
2343... | 0.957965 | 452 |
if __name__ == '__main__':
S = Solution()
a = S.longestValidParentheses(")(((((()())()()))()(()))(")
print(a) | [
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
311,
796,
28186,
3419,
198,
220,
220,
220,
257,
796,
311,
13,
6511,
395,
47139,
24546,
39815,
7,
4943,
19510,
19510,
7,
3419,
28955,
3419,
... | 2.155172 | 58 |
import xarray as xr
import json
import time
import pandas as pd
import numpy as np
import warnings
from six import StringIO
from datetime import datetime
try:
from urllib.request import urlopen
except ImportError:
from urllib2 import urlopen
def get_asos(time_window, lat_range=None,
lon_range=N... | [
11748,
2124,
18747,
355,
2124,
81,
198,
11748,
33918,
198,
11748,
640,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
14601,
198,
198,
6738,
2237,
1330,
10903,
9399,
198,
6738,
4818,
8079,
1330,
48... | 1.954459 | 6,280 |
#
# from random import randint
# numeros = []
# cont = 0
# maior = 1
# menor = 99
# while cont <= 4:
# cont += 1
# gerar = randint(1,99)
# print(gerar)
# if gerar < menor:
# menor = gerar
# elif gerar > maior:
# maior = gerar
# gerar = str(gerar)
# numeros.append(gerar)
# pri... | [
2,
198,
2,
422,
4738,
1330,
43720,
600,
198,
2,
5470,
418,
796,
17635,
198,
2,
542,
796,
657,
198,
2,
17266,
1504,
796,
352,
198,
2,
1450,
273,
796,
7388,
198,
2,
981,
542,
19841,
604,
25,
198,
2,
220,
220,
220,
220,
542,
1585... | 2.113372 | 344 |
#!/usr/bin/env python3
"""
Given:
summary tab delimited file
Render:
- simple SHAPE profile
- shape profile with error bars
- modified, untreated, denatured mutation rate profiles and stderr shading
- depths for each sample FIXME: get log-scaled depths working again
- (above profiles should only be rendered for ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
37811,
198,
15056,
25,
198,
10638,
7400,
46728,
863,
2393,
198,
198,
45819,
25,
198,
532,
2829,
6006,
45721,
7034,
198,
532,
5485,
7034,
351,
4049,
9210,
198,
532,
9518,
11,
41539,... | 2.498771 | 2,849 |
from configparser import ConfigParser
from pathlib import Path
cfg = ConfigParser()
cfg.read('myapp.ini')
# same, get int
assert int(cfg['http']['port']) == cfg['http'].getint('port')
# direct get from section
output_filename = Path(cfg['default']['output'], 'my_output.html')
print(output_filename, cfg['http'].get('... | [
6738,
4566,
48610,
1330,
17056,
46677,
198,
6738,
3108,
8019,
1330,
10644,
198,
198,
37581,
796,
17056,
46677,
3419,
198,
37581,
13,
961,
10786,
1820,
1324,
13,
5362,
11537,
198,
198,
2,
976,
11,
651,
493,
198,
30493,
493,
7,
37581,
1... | 2.882883 | 333 |
from rest_framework import serializers
from django.db.models import fields
from core.models import Subscriber
| [
198,
6738,
1334,
62,
30604,
1330,
11389,
11341,
198,
198,
6738,
42625,
14208,
13,
9945,
13,
27530,
1330,
7032,
198,
6738,
4755,
13,
27530,
1330,
3834,
1416,
24735,
628,
628,
220
] | 3.741935 | 31 |
# -*- coding: utf-8 -*-
# Copyright (c) 2020, VMRaid Technologies and Contributors
# See license.txt
from __future__ import unicode_literals
import vmraid
import unittest
from bs4 import BeautifulSoup
from vmraid.utils import set_request
from vmraid.website.render import render
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
15069,
357,
66,
8,
12131,
11,
569,
13599,
1698,
21852,
290,
25767,
669,
198,
2,
4091,
5964,
13,
14116,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
8... | 3.267442 | 86 |
if __name__ == "__main__":
print(main(int(input())))
| [
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
3601,
7,
12417,
7,
600,
7,
15414,
3419,
22305,
198
] | 2.269231 | 26 |
from accounts.models import CustomUser
from accounts.api.serializers import UserSerializer
from rest_framework import viewsets
from rest_framework.authentication import SessionAuthentication
from rest_framework.permissions import IsAuthenticatedOrReadOnly
| [
6738,
5504,
13,
27530,
1330,
8562,
12982,
198,
6738,
5504,
13,
15042,
13,
46911,
11341,
1330,
11787,
32634,
7509,
198,
6738,
1334,
62,
30604,
1330,
5009,
1039,
198,
6738,
1334,
62,
30604,
13,
41299,
3299,
1330,
23575,
47649,
3299,
198,
... | 4.140625 | 64 |
import numpy as np
import pandas as pd
from keras.models import Model
from keras.layers import Dense, Embedding, Input, Dropout
from keras.layers.merge import concatenate
from keras.layers import Conv1D, BatchNormalization, Activation, GlobalMaxPooling1D
#from keras.utils import multi_gpu_model
from data_utils.evaluati... | [
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,
6738,
41927,
292,
13,
27530,
1330,
9104,
198,
6738,
41927,
292,
13,
75,
6962,
1330,
360,
1072,
11,
13302,
6048,
278,
11,
23412,
11,
14258,
448,
198,
6738,
41927... | 2.08618 | 2,518 |
# [h] center anchors
from hTools2.modules.fontutils import get_glyphs
from hTools2.modules.messages import no_font_open, no_glyph_selected
anchor_names = ['top', 'bottom']
f = CurrentFont()
if f is not None:
glyph_names = get_glyphs(f)
for glyph_name in glyph_names:
glyph = f[glyph_name]
a... | [
2,
685,
71,
60,
3641,
43360,
198,
198,
6738,
289,
33637,
17,
13,
18170,
13,
10331,
26791,
1330,
651,
62,
10853,
746,
82,
198,
6738,
289,
33637,
17,
13,
18170,
13,
37348,
1095,
1330,
645,
62,
10331,
62,
9654,
11,
645,
62,
10853,
74... | 2.153333 | 300 |
# -*- coding: utf-8 -*-
import platform
import shutil
import tempfile
import pytest
PLATFORM = platform.system().lower()
@pytest.fixture(scope="function", autouse=True)
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
3859,
198,
11748,
4423,
346,
198,
11748,
20218,
7753,
198,
198,
11748,
12972,
9288,
198,
198,
6489,
1404,
21389,
796,
3859,
13,
10057,
22446,
21037,
3419,
628,
198,... | 2.883333 | 60 |
# coding: utf-8
# ### Convolutional LSTM implementation with peephole connections
__author__='Dawood Al Chanti'
# In[1]:
import tensorflow as tf
from tensorflow.contrib.slim import add_arg_scope
from tensorflow.contrib.slim import layers
from tensorflow.contrib.layers.python.layers import initializers
# In[ ]:
#t... | [
198,
2,
19617,
25,
3384,
69,
12,
23,
198,
198,
2,
44386,
34872,
2122,
282,
406,
2257,
44,
7822,
351,
613,
538,
13207,
8787,
198,
834,
9800,
834,
11639,
35,
707,
702,
978,
609,
17096,
6,
198,
198,
2,
554,
58,
16,
5974,
198,
198,
... | 2.758221 | 517 |
import csv
#need to extract the fields "EPC" and "Local Name" from the csv file "module frames 23june2021.csv"
filename = 'module frames 23june2021.csv' #this will need to be changed based on what the file is called on whatever computer
with open(filename, 'r', newline='') as csv_file:
reader =... | [
11748,
269,
21370,
201,
198,
201,
198,
2,
31227,
284,
7925,
262,
7032,
366,
36,
5662,
1,
290,
366,
14565,
6530,
1,
422,
262,
269,
21370,
2393,
366,
21412,
13431,
2242,
73,
1726,
1238,
2481,
13,
40664,
1,
201,
198,
201,
198,
34345,
... | 2.42029 | 276 |
"""
Set up a simple Whoosh index and provide a few simple methods to update and
search it. To try at a REPL or from another module.
Here's some copypasta for, say, an iPython session:
article_root = "/Users/nikhilanand/Dropbox/wiki.nikhil.io.articles"
search_index = create_search_index(article_root)
updat... | [
37811,
198,
7248,
510,
257,
2829,
5338,
3768,
6376,
290,
2148,
257,
1178,
2829,
5050,
284,
4296,
290,
198,
12947,
340,
13,
1675,
1949,
379,
257,
45285,
393,
422,
1194,
8265,
13,
198,
198,
4342,
338,
617,
2243,
4464,
40197,
329,
11,
... | 2.714074 | 675 |
"""
The aim of this script is to create a database in hdf5 format
"""
# import copy
import time
import sys
from official_fcns import *
def create_hfd5_data_structure(hdf5file, groupname, num_trials, num_samples, max_trials=1000000):
"""
:param hdf5file: h5py.File
:param groupname:
:param num_trials: ... | [
37811,
198,
464,
4031,
286,
428,
4226,
318,
284,
2251,
257,
6831,
287,
289,
7568,
20,
5794,
198,
37811,
198,
198,
2,
1330,
4866,
198,
11748,
640,
198,
11748,
25064,
198,
6738,
1743,
62,
16072,
5907,
1330,
1635,
628,
198,
4299,
2251,
... | 2.286316 | 2,375 |
# Generated by Django 2.1.5 on 2019-02-07 16:25
from django.db import migrations, models
import django.db.models.deletion
import modelcluster.fields
| [
2,
2980,
515,
416,
37770,
362,
13,
16,
13,
20,
319,
13130,
12,
2999,
12,
2998,
1467,
25,
1495,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
198,
11748,
42625,
14208,
13,
9945,
13,
27530,
13,
2934,
1616,
295,
... | 2.960784 | 51 |
import turtle
for i in range(6):
turtle.forward(100)
turtle.right(60)
turtle.done()
| [
11748,
28699,
198,
1640,
1312,
287,
2837,
7,
21,
2599,
198,
220,
220,
220,
28699,
13,
11813,
7,
3064,
8,
198,
220,
220,
220,
28699,
13,
3506,
7,
1899,
8,
198,
83,
17964,
13,
28060,
3419,
198
] | 2.486486 | 37 |
#!/usr/bin/env python
import os
import glob
import argparse
# Set up command line arguments
parser = argparse.ArgumentParser()
parser.add_argument('-e', '--epitope_dir', type=str, required=True,
help='path to directory containing neoepiscope results'
)
parser.add_argument('-o', '--output_dir', type=str, req... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
28686,
198,
11748,
15095,
198,
11748,
1822,
29572,
198,
198,
2,
5345,
510,
3141,
1627,
7159,
198,
48610,
796,
1822,
29572,
13,
28100,
1713,
46677,
3419,
198,
48610,
13,
2860,... | 2.416159 | 656 |
"""
In this Bite we are going to parse a csv movie dataset to identify the
directors with the highest rated movies.
Write get_movies_by_director: use csv.DictReader to convert
movie_metadata.csv into a (default)dict of lists of Movie namedtuples.
Convert/filter the data:
Only extract director_name, movie_title, ... | [
37811,
198,
818,
428,
44540,
356,
389,
1016,
284,
21136,
257,
269,
21370,
3807,
27039,
284,
5911,
262,
198,
13445,
351,
262,
4511,
13178,
6918,
13,
198,
198,
16594,
651,
62,
76,
20526,
62,
1525,
62,
35248,
25,
779,
269,
21370,
13,
3... | 2.798126 | 1,174 |
from flask import Flask, render_template
import requests
import logging
from elasticapm.contrib.flask import ElasticAPM
app = Flask(__name__)
apm = ElasticAPM(app, logging=logging.INFO,
server_url="",
service_name="",
secret_token="",
use_elastic_tra... | [
6738,
42903,
1330,
46947,
11,
8543,
62,
28243,
198,
11748,
7007,
198,
11748,
18931,
198,
6738,
27468,
499,
76,
13,
3642,
822,
13,
2704,
2093,
1330,
48567,
2969,
44,
198,
198,
1324,
796,
46947,
7,
834,
3672,
834,
8,
198,
198,
499,
76... | 2.191489 | 188 |
import argparse
import os
import yaml
from collections import OrderedDict
import sys
from os import path
sys.path.append(path.dirname(path.abspath(__file__)))
import cwrap_parser
import nn_parse
import native_parse
import preprocess_declarations
import function_wrapper
from code_template import CodeTemplate
# Thi... | [
11748,
1822,
29572,
198,
11748,
28686,
198,
198,
11748,
331,
43695,
198,
6738,
17268,
1330,
14230,
1068,
35,
713,
198,
198,
11748,
25064,
198,
6738,
28686,
1330,
3108,
198,
17597,
13,
6978,
13,
33295,
7,
6978,
13,
15908,
3672,
7,
6978,
... | 2.67536 | 2,224 |
from django.db import connection
from django_mailbox.models import Message
import os
import sqlite3
def sizeof_formatter(num, suffix='B'):
'''
http://stackoverflow.com/a/1094933/3480790
'''
for unit in ['', 'Ki', 'Mi', 'Gi', 'Ti', 'Pi', 'Ei', 'Zi']:
if abs(num) < 1024.0:
return "... | [
6738,
42625,
14208,
13,
9945,
1330,
4637,
198,
6738,
42625,
14208,
62,
4529,
3524,
13,
27530,
1330,
16000,
198,
198,
11748,
28686,
198,
11748,
44161,
578,
18,
628,
198,
198,
4299,
39364,
62,
687,
1436,
7,
22510,
11,
35488,
11639,
33,
... | 2.16 | 175 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-11-14 18:30
from __future__ import unicode_literals
import datetime
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,
1157,
13,
20,
319,
2177,
12,
1157,
12,
1415,
1248,
25,
1270,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
... | 2.808219 | 73 |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
import asyncio
import click
import yo.yolog
import json
import structlog
logger = structlog.get_logger()
@click.command(name='watch-table')
@click.option('--database_url', envvar='DATABASE_URL')
@click.option('--table_name')
@click.option('--channel')
if __name__ == ... | [
2,
0,
1220,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
30351,
952,
198,
198,
11748,
3904,
198,
11748,
27406,
13,
88,
928,
198,
11748,
33918,
198,
11748,
2878,
6404,
... | 2.646154 | 130 |
# coding=utf-8
#数据合并与展平
#合并一维数组
import numpy as np
a = np.array([1, 2, 3])
b = np.array([4, 5, 6])
c = np.append(a, b)
print(c)
#上面使用append,下面使用concatenate
d = np.concatenate([a, b])
print(d)
#多维数组的合并
import numpy as np
a = np.arange(4).reshape(2, 2)
b = np.arange(4).reshape(2, 2)
#按行合并
c = np.append(a, b, axis = 0)
... | [
2,
19617,
28,
40477,
12,
23,
198,
2,
46763,
108,
162,
235,
106,
28938,
230,
33176,
114,
10310,
236,
161,
109,
243,
33176,
111,
198,
198,
2,
28938,
230,
33176,
114,
31660,
163,
119,
112,
46763,
108,
163,
119,
226,
198,
11748,
299,
... | 1.21267 | 663 |
# coding: utf-8
"""
ESPER API REFERENCE
OpenAPI spec version: 1.0.0
Contact: developer@esper.io
---------------------------------------------------------
Copyright 2019 Shoonya Enterprises Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the Li... | [
2,
19617,
25,
3384,
69,
12,
23,
198,
198,
37811,
198,
1546,
18973,
7824,
4526,
24302,
18310,
198,
198,
11505,
17614,
1020,
2196,
25,
352,
13,
15,
13,
15,
198,
17829,
25,
8517,
31,
274,
525,
13,
952,
198,
43801,
12,
198,
198,
15269... | 2.439041 | 4,298 |
# https://leetcode.com/problems/two-sum-iv-input-is-a-bst/description/
# brute-force algorithm, but in BST, finding a element is O(log(n)),that is the advantage
head = treeNode(2)
head.left = treeNode(1)
head.right = treeNode(3)
solution = Solution()
print(solution.findTarget(head,4)) | [
2,
3740,
1378,
293,
316,
8189,
13,
785,
14,
1676,
22143,
14,
11545,
12,
16345,
12,
452,
12,
15414,
12,
271,
12,
64,
12,
65,
301,
14,
11213,
14,
198,
2,
33908,
12,
3174,
11862,
11,
475,
287,
44992,
11,
4917,
257,
5002,
318,
440,
... | 2.803922 | 102 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | [
2,
19617,
28,
40477,
12,
23,
198,
2,
16529,
35937,
198,
2,
15069,
357,
66,
8,
5413,
10501,
13,
1439,
2489,
10395,
13,
198,
2,
49962,
739,
262,
17168,
13789,
13,
4091,
13789,
13,
14116,
287,
262,
1628,
6808,
329,
198,
2,
5964,
1321... | 3.385081 | 496 |
# -*- coding: utf-8 -*-
# From: https://github.com/alexa/skill-sample-python-helloworld-classes/blob/master/lambda/py/hello_world.py
import logging
from ask_sdk_core.skill_builder import SkillBuilder
from ask_sdk_core.dispatch_components import (
AbstractRequestHandler, AbstractExceptionHandler,
AbstractRequ... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
3574,
25,
3740,
1378,
12567,
13,
785,
14,
1000,
27865,
14,
42401,
12,
39873,
12,
29412,
12,
12758,
322,
1764,
12,
37724,
14,
2436,
672,
14,
9866,
14,
50033,
... | 3.365805 | 503 |
from setuptools import setup, find_packages
setup(
name="mysql-stream",
packages=find_packages(),
version='0.0.4',
description="simple and easy to use MySQL client and ORM library",
author="chenchong",
author_email='boy3565@163.com',
url="https://github.com/streamDream/mysql-stream",
ke... | [
6738,
900,
37623,
10141,
1330,
9058,
11,
1064,
62,
43789,
198,
198,
40406,
7,
198,
220,
220,
220,
1438,
2625,
28744,
13976,
12,
5532,
1600,
198,
220,
220,
220,
10392,
28,
19796,
62,
43789,
22784,
198,
220,
220,
220,
2196,
11639,
15,
... | 2.494382 | 178 |
import pandas as pd
import os
import numpy as np
from numerai.scoring import sharpe
import numerapi
class DataGetter:
""" Used to get latest data from numerapi, note that it is live,
so results might differ notebook is ran at different point in time."""
def __init__(self):
"""NumerAPI instance"""... | [
11748,
19798,
292,
355,
279,
67,
198,
11748,
28686,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
5470,
1872,
13,
46536,
1330,
13986,
431,
198,
11748,
5470,
15042,
628,
198,
4871,
6060,
3855,
353,
25,
198,
220,
220,
220,
37227,
16718,
... | 2.320381 | 1,261 |
__version__ = '0.7.4'
__author__ = "Massimiliano Pippi & Federico Frenguelli"
VERSION = __version__ # synonym
| [
834,
9641,
834,
796,
705,
15,
13,
22,
13,
19,
6,
198,
198,
834,
9800,
834,
796,
366,
20273,
26641,
10115,
350,
12715,
1222,
35089,
3713,
4848,
782,
518,
15516,
1,
198,
198,
43717,
796,
11593,
9641,
834,
220,
1303,
6171,
5177,
198
] | 2.627907 | 43 |
from django.contrib import admin
from . import models
@admin.register(models.Message)
@admin.register(models.Chat)
@admin.register(models.Member)
| [
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
6738,
764,
1330,
4981,
628,
198,
31,
28482,
13,
30238,
7,
27530,
13,
12837,
8,
628,
198,
31,
28482,
13,
30238,
7,
27530,
13,
30820,
8,
628,
198,
31,
28482,
13,
30238,
7,
27530,
... | 3.234043 | 47 |
# -*- coding: utf-8 -*-
"""SNF.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/15jbQLqhfFg0702_O2gy-0oXndCGRACOP
"""
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import pickle
#importing dataset
d... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
15571,
37,
13,
541,
2047,
65,
198,
198,
38062,
4142,
7560,
416,
1623,
4820,
2870,
13,
198,
198,
20556,
2393,
318,
5140,
379,
198,
220,
220,
220,
3740,
1378,
403... | 2.495748 | 1,176 |
"""
Replace label
"""
from collections.abc import Sequence
from typing import Tuple
import numpy as np
from numpy import dtype
from numpy.core.numeric import indices
from numpy.random import rand
from typing import Callable, Optional, Tuple
from ..pipeline.allocation_query import AllocationQuery
from ..pipeline.operat... | [
37811,
198,
3041,
5372,
6167,
198,
37811,
198,
6738,
17268,
13,
39305,
1330,
45835,
198,
6738,
19720,
1330,
309,
29291,
198,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
299,
32152,
1330,
288,
4906,
198,
6738,
299,
32152,
13,
7295,
13... | 3.314721 | 197 |
# Generated by Django 2.2.4 on 2019-09-07 19:33
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
362,
13,
17,
13,
19,
319,
13130,
12,
2931,
12,
2998,
678,
25,
2091,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
from datetime import timedelta
from transcriptic import Connection
import logging
import time
import threading
class StrateosAccessor(object):
"""
Retrieve protocols from Strateos
"""
SYNC_PERIOD = timedelta(minutes=10)
logger = logging.getLogger('intent_parser_strateos_accessor')
def... | [
6738,
4818,
8079,
1330,
28805,
12514,
198,
6738,
14687,
291,
1330,
26923,
198,
11748,
18931,
198,
11748,
640,
220,
198,
11748,
4704,
278,
198,
198,
4871,
4285,
378,
418,
15457,
273,
7,
15252,
2599,
198,
220,
220,
220,
37227,
198,
220,
... | 2.420479 | 459 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
import abc
import six
class RateLimiterBackend(six.with_metaclass(abc.ABCMeta, object)):
"""
A backend that implements an atomic ``lea... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
6738,
11593,
37443,
834,
1330,
7297,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
6738,
11593,... | 2.848397 | 343 |
from datetime import datetime
import re
import requests
from app.spider.spider_utils import get_int_from_str
ua = 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36'
headers = {
'User-Agent': ua
}
# 得到目前已有的所有news
# 得到一页的news
init_new... | [
6738,
4818,
8079,
1330,
4818,
8079,
198,
11748,
302,
198,
11748,
7007,
198,
6738,
598,
13,
2777,
1304,
13,
2777,
1304,
62,
26791,
1330,
651,
62,
600,
62,
6738,
62,
2536,
198,
198,
6413,
796,
705,
12982,
12,
36772,
25,
29258,
14,
20,... | 2.181208 | 149 |
from flask import request, render_template
def render_navbar(context, slot, payload): # pylint: disable=R0201,W0613
""" Base template slot """
chapter = request.args.get('chapter', '')
module = request.args.get('module', '')
return render_template("common/navbar.html", active_chapter=chapter, module=... | [
6738,
42903,
1330,
2581,
11,
8543,
62,
28243,
628,
198,
4299,
8543,
62,
28341,
5657,
7,
22866,
11,
10852,
11,
21437,
2599,
220,
1303,
279,
2645,
600,
25,
15560,
28,
49,
15,
1264,
11,
54,
3312,
1485,
198,
220,
220,
220,
37227,
7308,
... | 3.127273 | 110 |
from marshmallow import fields, post_load
from portals.wwits.apis.rest import BaseSchemaExcludeFields as Schema
from .models import ParmModel, WOLaborActivityModel
| [
6738,
22397,
42725,
1330,
7032,
11,
1281,
62,
2220,
198,
6738,
42604,
13,
1383,
896,
13,
499,
271,
13,
2118,
1330,
7308,
27054,
2611,
3109,
9152,
15878,
82,
355,
10011,
2611,
198,
6738,
764,
27530,
1330,
47796,
17633,
11,
370,
3535,
4... | 3.608696 | 46 |
import functools
import pathlib
import random
from unittest.mock import MagicMock
from unittest.mock import patch
import pytest
import cauldron
from cauldron import runner
def _mock_reload_module(history: dict, path: str, library_directory: str):
"""Mocked version of the runner.__init__._reload_module function.... | [
11748,
1257,
310,
10141,
198,
11748,
3108,
8019,
198,
11748,
4738,
198,
6738,
555,
715,
395,
13,
76,
735,
1330,
6139,
44,
735,
198,
6738,
555,
715,
395,
13,
76,
735,
1330,
8529,
198,
198,
11748,
12972,
9288,
198,
198,
11748,
269,
45... | 2.943662 | 568 |
import json
import re
import numpy
import dynet as dy
import random
# For BioASQ only when using years 1-4 as training and 5 as dev/test.
# Get rid of 2017/2018 plus 2016 in training.
# For competition, training get rid of 2017/2018 and test 2018.
bioclean = lambda t: re.sub('[.,?;*!%^&_+():-\[\]{}]', '', t.replace('... | [
11748,
33918,
198,
11748,
302,
198,
11748,
299,
32152,
198,
11748,
37860,
316,
355,
20268,
198,
11748,
4738,
198,
198,
2,
1114,
16024,
1921,
48,
691,
618,
1262,
812,
352,
12,
19,
355,
3047,
290,
642,
355,
1614,
14,
9288,
13,
198,
2,... | 2.892857 | 140 |
#
# Copyright 2018, 2020 Antoine Sanner
# 2019 Lars Pastewka
#
# ### MIT license
#
# 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 ... | [
2,
198,
2,
15069,
2864,
11,
12131,
3738,
42722,
2986,
1008,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13130,
31239,
11303,
413,
4914,
198,
2,
198,
2,
44386,
17168,
5964,
198,
2,
198,
2,
2448,
3411,
318,
29376,
7520... | 2.002538 | 1,970 |
import os
import json
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from matplotlib2tikz import save as tikz_save
from matplotlib2tikz import get_tikz_code
from .. import tensorflow
class Analyzer:
"""DeepOBS analyzer class to generate result plots or get other summaries.
Args:
... | [
11748,
28686,
198,
11748,
33918,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
6738,
2603,
29487,
8019,
17,
83,
1134,
89,
1330,
3613,
355,
... | 2.249986 | 17,949 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from importlib import import_module
from collectors.isrctn.spider import _make_start_urls
# Tests
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
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,
6738,
11593,
37443,
834,... | 3.341463 | 82 |
#!/usr/bin/env python
"""
Based entirely on Django's own ``setup.py``.
"""
from setuptools import setup, find_packages
from tagging.version import __version__
setup(
name = 'django-tagging',
version = __version__,
description = 'Generic tagging application for Django',
author = 'Jonathan Buchanan',
... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
37811,
198,
15001,
5000,
319,
37770,
338,
898,
7559,
40406,
13,
9078,
15506,
13,
198,
37811,
198,
6738,
900,
37623,
10141,
1330,
9058,
11,
1064,
62,
43789,
198,
198,
6738,
49620,
13,
9... | 2.407595 | 395 |
from setuptools import setup, find_packages
from pip._internal.req import parse_requirements
install_requirements = parse_requirements('requirements.txt', session=False)
reqs = [str(ir.req) for ir in install_requirements]
VERSION = '0.0.1'
DESCRIPTION = 'Covid-19 Data Extractor - India'
LONG_DESCRIPTION = 'Extracts ... | [
6738,
900,
37623,
10141,
1330,
9058,
11,
1064,
62,
43789,
198,
6738,
7347,
13557,
32538,
13,
42180,
1330,
21136,
62,
8897,
18883,
198,
198,
17350,
62,
8897,
18883,
796,
21136,
62,
8897,
18883,
10786,
8897,
18883,
13,
14116,
3256,
6246,
... | 2.708661 | 381 |
#
# AutoDock | Raccoon2
#
# Copyright 2013, Stefano Forli, Michel Sanner
# Molecular Graphics Lab
#
# The Scripps Research Institute
# _
# (,) T h e
# _/
# (.) S c r i p p s
# \_
# (,) R e s e a r c h
# ./
# ... | [
2,
220,
220,
220,
220,
220,
220,
220,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
11160,
35,
735,
930,
371,
8679,
261,
17,
198,
2,
198,
2,
220,
220,
220,
220,
220,
220,
15069,
2211,
11,
22350,
5733,
1114,
4528,
1... | 2.187398 | 1,841 |
import unittest
from unittest.mock import patch
from os import environ
from json import loads
import boto3 as boto
from botocore.exceptions import ClientError
from moto import mock_s3
from mongomock import MongoClient as MockMongoClient
from mongo_lambda_backup.handler import handler
@patch.dict(
environ,
{... | [
11748,
555,
715,
395,
198,
6738,
555,
715,
395,
13,
76,
735,
1330,
8529,
198,
6738,
28686,
1330,
551,
2268,
198,
6738,
33918,
1330,
15989,
198,
198,
11748,
275,
2069,
18,
355,
275,
2069,
198,
6738,
10214,
420,
382,
13,
1069,
11755,
... | 2.260317 | 315 |
import datetime
import os
import subprocess
import sys
from os import listdir
from zipfile import ZipFile
import zipfile
import pandas
import yaml
from feed_manager import FeedManager
from gtfspy import exports, filter, import_validator, timetable_validator, util
from gtfspy.gtfs import GTFS
from gtfspy.aggregate_sto... | [
11748,
4818,
8079,
198,
11748,
28686,
198,
11748,
850,
14681,
198,
11748,
25064,
198,
6738,
28686,
1330,
1351,
15908,
198,
6738,
19974,
7753,
1330,
38636,
8979,
198,
11748,
19974,
7753,
198,
198,
11748,
19798,
292,
198,
11748,
331,
43695,
... | 2.375796 | 785 |
from ggplib.util.symbols import SymbolFactory, ListTerm, Term
def rotate_90(x, y, x_cords, y_cords):
' anti-clockwise '
assert len(x_cords) == len(y_cords)
x_idx = x_cords.index(x)
y_idx = y_cords.index(y)
return x_cords[y_idx], y_cords[len(x_cords) - x_idx - 1]
symbol_factory = None
| [
6738,
308,
70,
489,
571,
13,
22602,
13,
1837,
2022,
10220,
1330,
38357,
22810,
11,
7343,
40596,
11,
35118,
628,
628,
198,
4299,
23064,
62,
3829,
7,
87,
11,
331,
11,
2124,
62,
66,
3669,
11,
331,
62,
66,
3669,
2599,
198,
220,
220,
... | 2.051948 | 154 |
from datetime import datetime
import time
from gpiozero import Button
import os
import pygame
from tinytag import TinyTag
from random import *
from guizero import *
from colorsys import hsv_to_rgb
import pyowm
### Switch, Pick, Update Functions
### Helpers for routine functions
###############
#picks a background c... | [
6738,
4818,
8079,
1330,
4818,
8079,
198,
11748,
640,
198,
6738,
27809,
952,
22570,
1330,
20969,
198,
11748,
28686,
198,
11748,
12972,
6057,
198,
6738,
7009,
12985,
1330,
20443,
24835,
198,
6738,
4738,
1330,
1635,
198,
6738,
915,
528,
3529... | 3.130669 | 1,301 |
#
# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope... | [
2,
198,
2,
15069,
357,
66,
8,
1946,
11,
18650,
290,
14,
273,
663,
29116,
13,
1439,
2489,
10395,
13,
198,
2,
198,
2,
770,
1430,
318,
1479,
3788,
26,
345,
460,
17678,
4163,
340,
290,
14,
273,
13096,
198,
2,
340,
739,
262,
2846,
... | 2.395589 | 5,895 |
# imports
import os
import collections
import tensorflow.nn as nn
from tensorflow.keras import Input,Model
from tensorflow.keras.utils import plot_model
from tensorflow.keras import layers, regularizers,activations
from utils import DotDict,configs
from models.DGV0.model_v0 import DGM
# end imports
# continue from 450... | [
2,
17944,
198,
11748,
28686,
198,
11748,
17268,
198,
11748,
11192,
273,
11125,
13,
20471,
355,
299,
77,
198,
6738,
11192,
273,
11125,
13,
6122,
292,
1330,
23412,
11,
17633,
198,
6738,
11192,
273,
11125,
13,
6122,
292,
13,
26791,
1330,
... | 2.352804 | 428 |
from kivy.app import App
from kivy.core.window import Window
from kivymd.uix.screen import MDScreen
| [
6738,
479,
452,
88,
13,
1324,
1330,
2034,
198,
6738,
479,
452,
88,
13,
7295,
13,
17497,
1330,
26580,
198,
6738,
479,
452,
4948,
67,
13,
84,
844,
13,
9612,
1330,
10670,
23901,
628
] | 2.970588 | 34 |
INPUT_CLASS_SUFFIX = "Input"
| [
1268,
30076,
62,
31631,
62,
12564,
5777,
10426,
796,
366,
20560,
1,
198
] | 2.230769 | 13 |
# -*- coding: utf-8 -*-
import numpy as np
import math
from sklearn.ensemble import GradientBoostingRegressor
from sklearn.metrics import mean_squared_error
import scipy as sp
Protein_Atom = ['C','N','O','S']
Ligand_Atom = ['C','N','O','S','P','F','Cl','Br','I']
aa_list = ['ALA','ARG','ASN','ASP','CYS','GLU','GLN','... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
628,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
10688,
198,
6738,
1341,
35720,
13,
1072,
11306,
1330,
17701,
1153,
45686,
278,
8081,
44292,
198,
6738,
1341,
35720,
13,
416... | 1.962437 | 27,554 |
from django.db import models
from signup.models import CustomUser
| [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
1051,
929,
13,
27530,
1330,
8562,
12982,
198
] | 3.882353 | 17 |
# -*- coding: utf-8 -*-
"""Top-level package for Tmux Session Helper."""
__author__ = """John Hardy"""
__email__ = 'john.hardy@me.com'
__version__ = '0.1.0'
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
37811,
9126,
12,
5715,
5301,
329,
309,
76,
2821,
23575,
5053,
525,
526,
15931,
198,
198,
834,
9800,
834,
796,
37227,
7554,
27583,
37811,
198,
834,
12888,
834,
796,
... | 2.373134 | 67 |
import scrapy
from jedeschule.utils import cleanjoin
from scrapy.shell import inspect_response
| [
11748,
15881,
88,
198,
6738,
474,
37507,
354,
2261,
13,
26791,
1330,
3424,
22179,
198,
6738,
15881,
88,
13,
29149,
1330,
10104,
62,
26209,
198
] | 3.8 | 25 |
from boiler import *
| [
6738,
36741,
1330,
1635,
198
] | 4.2 | 5 |