content
stringlengths
1
1.04M
input_ids
listlengths
1
774k
ratio_char_token
float64
0.38
22.9
token_count
int64
1
774k
import sys import numpy as np def safe_isinstance(obj, class_path_str): # this function is copy-paste from the code of the SHAP Python library # Copyright (c) 2018 Scott Lundberg """ Acts as a safe version of isinstance without having to explicitly import packages which may not exist in the users...
[ 11748, 25064, 198, 11748, 299, 32152, 355, 45941, 628, 198, 4299, 3338, 62, 271, 39098, 7, 26801, 11, 1398, 62, 6978, 62, 2536, 2599, 198, 220, 220, 220, 1303, 428, 2163, 318, 4866, 12, 34274, 422, 262, 2438, 286, 262, 6006, 2969, 1...
2.696477
738
# this file imports custom routes into the experiment server from flask import Blueprint, render_template, request, jsonify, Response, abort, current_app from jinja2 import TemplateNotFound from functools import wraps from sqlalchemy import or_ from psiturk.psiturk_config import PsiturkConfig from psiturk.experiment_...
[ 2, 428, 2393, 17944, 2183, 11926, 656, 262, 6306, 4382, 198, 198, 6738, 42903, 1330, 39932, 11, 8543, 62, 28243, 11, 2581, 11, 33918, 1958, 11, 18261, 11, 15614, 11, 1459, 62, 1324, 198, 6738, 474, 259, 6592, 17, 1330, 37350, 3673, ...
4.149083
436
from __future__ import print_function import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from PIL import Image import matplotlib.pyplot as plt import cv2 import os import time import warnings import torchvision.transforms as transforms import torchvision.models as models ...
[ 6738, 11593, 37443, 834, 1330, 3601, 62, 8818, 198, 198, 11748, 28034, 198, 11748, 28034, 13, 20471, 355, 299, 77, 198, 11748, 28034, 13, 20471, 13, 45124, 355, 376, 198, 11748, 28034, 13, 40085, 355, 6436, 198, 198, 6738, 350, 4146, ...
3.238806
134
import pandas as pd import numpy as np from rdtools import energy_from_power import pytest @pytest.fixture @pytest.fixture
[ 11748, 19798, 292, 355, 279, 67, 198, 11748, 299, 32152, 355, 45941, 198, 6738, 374, 28664, 10141, 1330, 2568, 62, 6738, 62, 6477, 198, 11748, 12972, 9288, 628, 198, 31, 9078, 9288, 13, 69, 9602, 628, 198, 31, 9078, 9288, 13, 69, 96...
2.78
50
import copy import unittest from pathlib import Path import ignite import ignite.metrics as metrics import torch.nn as nn import torch.optim as optim from ignite.metrics import Precision, Recall, MetricsLambda from transfer_nlp.plugins.config import ExperimentConfig from transfer_nlp.plugins.regularizers import L1 fr...
[ 11748, 4866, 198, 11748, 555, 715, 395, 198, 6738, 3108, 8019, 1330, 10644, 198, 198, 11748, 44794, 198, 11748, 44794, 13, 4164, 10466, 355, 20731, 198, 11748, 28034, 13, 20471, 355, 299, 77, 198, 11748, 28034, 13, 40085, 355, 6436, 198...
1.999429
1,752
#!/usr/bin/env python # coding: utf-8 import sys sys.path.append('../isoclique') import isoclique as ic import networkx as nx import random import time if __name__ == '__main__': E = nx.karate_club_graph().edges() ''' encode_method=None E = [[x,y] for x,y in E] ''' ''' # generate a graph...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 2, 19617, 25, 3384, 69, 12, 23, 198, 198, 11748, 25064, 198, 17597, 13, 6978, 13, 33295, 10786, 40720, 271, 38679, 2350, 11537, 198, 11748, 318, 38679, 2350, 355, 14158, 198, 11748, 31...
2.145704
803
""" module to run with the -m flag python -m async_sched.client.stop_schedule "Task 1" --list_schedules 1 """ import argparse from async_sched.client.client import stop_schedule from async_sched.utils import DEFAULT_HOST, DEFAULT_PORT __all__ = ['NAME', 'get_argparse', 'main'] NAME = 'stop_schedule' if __name...
[ 37811, 198, 21412, 284, 1057, 351, 262, 532, 76, 6056, 198, 198, 29412, 532, 76, 30351, 62, 1416, 704, 13, 16366, 13, 11338, 62, 15952, 5950, 366, 25714, 352, 1, 1377, 4868, 62, 1416, 704, 5028, 352, 198, 198, 37811, 198, 11748, 182...
2.536232
207
import os if __name__ == "__main__": main()
[ 11748, 28686, 628, 198, 361, 11593, 3672, 834, 6624, 366, 834, 12417, 834, 1298, 198, 220, 220, 220, 1388, 3419, 198 ]
2.380952
21
import numpy as np # ======================================================== # # Environment-specific cost functions: # # ======================================================== # # Cost function for a whole trajectory: #
[ 11748, 299, 32152, 355, 45941, 628, 198, 2, 46111, 4770, 1421, 18604, 198, 2, 220, 198, 2, 9344, 12, 11423, 1575, 5499, 25, 198, 2, 628, 198, 198, 2, 46111, 4770, 1421, 18604, 198, 2, 220, 198, 2, 6446, 2163, 329, 257, 2187, 22942...
4.833333
48
from .. import * import math
[ 6738, 11485, 1330, 1635, 198, 11748, 10688, 198 ]
3.625
8
from titan.dodo_pkg.layer import LayerConfig
[ 6738, 48047, 13, 67, 24313, 62, 35339, 13, 29289, 1330, 34398, 16934, 628 ]
3.538462
13
# Copyright 2021 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, 33448, 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.801037
2,508
import multiprocessing print("cpu count is", multiprocessing.cpu_count())
[ 11748, 18540, 305, 919, 278, 198, 4798, 7203, 36166, 954, 318, 1600, 18540, 305, 919, 278, 13, 36166, 62, 9127, 28955, 198 ]
3.363636
22
from abc import ABCMeta, abstractmethod
[ 6738, 450, 66, 1330, 9738, 48526, 11, 12531, 24396, 628 ]
4.1
10
import json import lzma import struct import logging from typing import Tuple, Iterator, List from lzma import LZMAError, LZMADecompressor from toolkit.uf2.uf2 import UF2 log = logging.getLogger(__name__)
[ 11748, 33918, 198, 11748, 300, 89, 2611, 198, 11748, 2878, 198, 11748, 18931, 198, 6738, 19720, 1330, 309, 29291, 11, 40806, 1352, 11, 7343, 198, 6738, 300, 89, 2611, 1330, 406, 57, 5673, 12331, 11, 406, 57, 44, 2885, 721, 3361, 44292...
2.888889
72
#!/usr/bin/env python3 import unittest from collections import OrderedDict from thrift.test.sample_structs.ttypes import DummyStruct, Struct from thrift.util import struct_to_dict
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 11748, 555, 715, 395, 198, 6738, 17268, 1330, 14230, 1068, 35, 713, 198, 198, 6738, 5636, 2135, 13, 9288, 13, 39873, 62, 7249, 82, 13, 83, 19199, 1330, 360, 13513, 44909, 11, 321...
3.25
56
import os from abc import abstractmethod from collections.abc import Sequence from ..options_merger import OptionsMerger
[ 11748, 28686, 198, 6738, 450, 66, 1330, 12531, 24396, 198, 6738, 17268, 13, 39305, 1330, 45835, 198, 198, 6738, 11485, 25811, 62, 647, 1362, 1330, 18634, 13102, 1362, 628 ]
4.241379
29
# Copyright © 2021 Ingram Micro Inc. All rights reserved. import sys from dj_cqrs.constants import NO_QUEUE from dj_cqrs.management.commands.cqrs_sync import Command as SyncCommand from dj_cqrs.registries import MasterRegistry from django.core.management.base import BaseCommand, CommandError
[ 2, 220, 15069, 10673, 33448, 44211, 4527, 3457, 13, 1439, 2489, 10395, 13, 198, 198, 11748, 25064, 198, 198, 6738, 42625, 62, 66, 80, 3808, 13, 9979, 1187, 1330, 8005, 62, 48, 8924, 8924, 198, 6738, 42625, 62, 66, 80, 3808, 13, 2760...
3.348315
89
import torch from .misc import config_to_string def _load_pretraining_dict(model, state_dict): """Load state dictionary from a pre-training snapshot This is an even less strict version of `model.load_state_dict(..., False)`, which also ignores parameters from `state_dict` that don't have the same sha...
[ 11748, 28034, 198, 198, 6738, 764, 44374, 1330, 4566, 62, 1462, 62, 8841, 628, 628, 198, 198, 4299, 4808, 2220, 62, 5310, 24674, 62, 11600, 7, 19849, 11, 1181, 62, 11600, 2599, 198, 220, 220, 220, 37227, 8912, 1181, 22155, 422, 257, ...
2.852234
291
# import tensorflow as tf # def get_pretrained_classfier(path = '/home/jupyter-ivanljh123/Simulating-Brain-signal-to-control-Hand-Movement-using-GPT2/pretrained/09_0.92'): # #load pretrained model # model = tf.keras.models.load_model(path) # model.trainable = False # return model import mne impor...
[ 198, 198, 2, 1330, 11192, 273, 11125, 355, 48700, 198, 198, 2, 825, 651, 62, 5310, 13363, 62, 4871, 69, 959, 7, 6978, 796, 31051, 11195, 14, 73, 929, 88, 353, 12, 13809, 75, 73, 71, 10163, 14, 8890, 8306, 12, 44687, 12, 12683, 2...
2.930586
461
import random from selenium.webdriver.common.by import By from ui_test.page.base_page import BasePage
[ 11748, 4738, 198, 6738, 384, 11925, 1505, 13, 12384, 26230, 13, 11321, 13, 1525, 1330, 2750, 198, 6738, 334, 72, 62, 9288, 13, 7700, 13, 8692, 62, 7700, 1330, 7308, 9876, 628 ]
3.21875
32
# -------------------------------------------------------- # Fast R-CNN # Copyright (c) 2015 Microsoft # Licensed under The MIT License [see LICENSE_fast_rcnn for details] # Written by Ross Girshick # -------------------------------------------------------- import numpy as np from distutils.core import setup from dist...
[ 2, 20368, 22369, 198, 2, 12549, 371, 12, 18474, 198, 2, 15069, 357, 66, 8, 1853, 5413, 198, 2, 49962, 739, 383, 17168, 13789, 685, 3826, 38559, 24290, 62, 7217, 62, 6015, 20471, 329, 3307, 60, 198, 2, 22503, 416, 9847, 23837, 1477, ...
2.979253
241
#!/usr/bin/env python # coding: utf-8 # In[ ]: # This Python 3 environment comes with many helpful analytics libraries installed # It is defined by the kaggle/python docker image: https://github.com/kaggle/docker-python # For example, here's several helpful packages to load in import numpy as np # linear algebra i...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 2, 19617, 25, 3384, 69, 12, 23, 198, 198, 2, 554, 58, 2361, 25, 628, 198, 2, 770, 11361, 513, 2858, 2058, 351, 867, 7613, 23696, 12782, 6589, 198, 2, 632, 318, 5447, 416, 262, 47...
2.896928
1,009
import logging import pathlib import pkg_resources from mopidy import config, ext __version__ = pkg_resources.get_distribution("Mopidy-YTMusic").version logger = logging.getLogger(__name__)
[ 11748, 18931, 198, 11748, 3108, 8019, 198, 198, 11748, 279, 10025, 62, 37540, 198, 198, 6738, 285, 404, 19325, 1330, 4566, 11, 1070, 198, 198, 834, 9641, 834, 796, 279, 10025, 62, 37540, 13, 1136, 62, 17080, 3890, 7203, 44, 404, 19325...
3.046875
64
from loaddata import TitanicData, HousePriceData, CervicalCancerData from models import Classifier, Regressor import json import os import argparse if __name__ == '__main__': # arguments parser = argparse.ArgumentParser() parser.add_argument('--model', type=str, choices=['LR','DT','RF','XGB','DNN'],...
[ 6738, 3440, 7890, 1330, 41184, 6601, 11, 2097, 18124, 6601, 11, 327, 712, 605, 34, 8250, 6601, 198, 6738, 4981, 1330, 5016, 7483, 11, 3310, 44292, 198, 11748, 33918, 198, 11748, 28686, 220, 198, 11748, 1822, 29572, 628, 198, 220, 220, ...
2.637523
549
"Main" import sys from detection.detection import capture_video, run_detection if __name__ == '__main__': VIDEO = sys.argv[1] XML = sys.argv[2] CAP, CAR_CASCADE = capture_video(VIDEO, XML) run_detection(CAP, CAR_CASCADE)
[ 1, 13383, 1, 198, 198, 11748, 25064, 198, 6738, 13326, 13, 15255, 3213, 1330, 8006, 62, 15588, 11, 1057, 62, 15255, 3213, 198, 198, 361, 11593, 3672, 834, 6624, 705, 834, 12417, 834, 10354, 198, 220, 220, 220, 35507, 796, 25064, 13, ...
2.438776
98
'''pyCis - Python Console Intelligence System'''
[ 7061, 6, 9078, 34, 271, 532, 11361, 24371, 9345, 4482, 7061, 6, 198, 220, 220, 220, 220 ]
3.117647
17
import os import argparse from pydub import AudioSegment from pydub.utils import make_chunks if __name__ == "__main__": parser = argparse.ArgumentParser(description="script to split audio files into chunks") parser.add_argument('--seconds', type=int, default=None, help='if set to None...
[ 11748, 28686, 198, 11748, 1822, 29572, 198, 6738, 279, 5173, 549, 1330, 13491, 41030, 434, 198, 6738, 279, 5173, 549, 13, 26791, 1330, 787, 62, 354, 14125, 628, 198, 198, 361, 11593, 3672, 834, 6624, 366, 834, 12417, 834, 1298, 198, 2...
2.584229
279
import abc from sqlparse.sql import Token from ..exceptions import SQLDecodeError from .sql_tokens import AliasableToken, SQLToken from . import query as query_module from typing import Union as U
[ 11748, 450, 66, 198, 198, 6738, 44161, 29572, 13, 25410, 1330, 29130, 198, 198, 6738, 11485, 1069, 11755, 1330, 16363, 10707, 1098, 12331, 198, 6738, 764, 25410, 62, 83, 482, 641, 1330, 978, 4448, 540, 30642, 11, 16363, 30642, 198, 6738...
3.45
60
import time from print_running_function import print_running_function # Hackish method to import from another directory # Useful while xendit-python isn't released yet to the public import importlib.machinery loader = importlib.machinery.SourceFileLoader("xendit", "../xendit/__init__.py") xendit = loader.lo...
[ 11748, 640, 201, 198, 201, 198, 6738, 3601, 62, 20270, 62, 8818, 1330, 3601, 62, 20270, 62, 8818, 201, 198, 201, 198, 2, 18281, 680, 2446, 284, 1330, 422, 1194, 8619, 201, 198, 2, 49511, 981, 2124, 437, 270, 12, 29412, 2125, 470, ...
3
117
############################################################################## # # Copyright (c) 2007 Zope Foundation and Contributors. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOFTWARE IS PROVIDED "AS I...
[ 29113, 29113, 7804, 4242, 2235, 198, 2, 198, 2, 15069, 357, 66, 8, 4343, 1168, 3008, 5693, 290, 25767, 669, 13, 198, 2, 198, 2, 770, 3788, 318, 2426, 284, 262, 8617, 286, 262, 1168, 3008, 5094, 13789, 11, 198, 2, 10628, 362, 13, ...
2.84101
673
# Copyright 2020 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, 12131, 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...
2.959577
1,039
# Array # Given an array A of integers, return true if and only if it is a valid mountain array. # # Recall that A is a mountain array if and only if: # # A.length >= 3 # There exists some i with 0 < i < A.length - 1 such that: # A[0] < A[1] < ... A[i-1] < A[i] # A[i] > A[i+1] > ... > A[B.length - 1] # # # Example 1: ...
[ 2, 15690, 198, 198, 2, 11259, 281, 7177, 317, 286, 37014, 11, 1441, 2081, 611, 290, 691, 611, 340, 318, 257, 4938, 8598, 7177, 13, 198, 2, 198, 2, 44536, 326, 317, 318, 257, 8598, 7177, 611, 290, 691, 611, 25, 198, 2, 198, 2, ...
2.318182
220
from uuid import UUID from ..exceptions import CheckError
[ 6738, 334, 27112, 1330, 471, 27586, 198, 198, 6738, 11485, 1069, 11755, 1330, 6822, 12331, 628, 628, 198 ]
3.5
18
import numpy as np import librosa, librosa.display import matplotlib.pyplot as plt FIG_SIZE = (15,10) file = "/home/jack/Documents/python/PycharmProjects/untitled2/show the wav/dog.wav" signal, sample_rate = librosa.load(file, sr=22050) plt.figure(figsize=FIG_SIZE) librosa.display.waveplot(signal, sample_rate, alph...
[ 11748, 299, 32152, 355, 45941, 198, 11748, 9195, 4951, 64, 11, 9195, 4951, 64, 13, 13812, 198, 11748, 2603, 29487, 8019, 13, 9078, 29487, 355, 458, 83, 198, 198, 16254, 62, 33489, 796, 357, 1314, 11, 940, 8, 198, 198, 7753, 796, 128...
2.364486
321
import os import functools import tools import tensorflow as tf import numpy as np import pickle import pathlib import off_policy from dreamer import Dreamer, setup_dreamer, create_envs, count_steps, make_dataset, parse_dreamer_args if __name__ == '__main__': args, remaining = parse_dreamer_args() main(args.log...
[ 11748, 28686, 198, 11748, 1257, 310, 10141, 198, 11748, 4899, 198, 11748, 11192, 273, 11125, 355, 48700, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 2298, 293, 198, 11748, 3108, 8019, 198, 11748, 572, 62, 30586, 198, 6738, 4320, 263, ...
3.111111
108
from notebook_utils import synthesize from utils import hparams as hp import utils.text.cleaners as cleaners from scipy.io import wavfile import numpy as np import string import argparse SAMPLE_RATE = 22050 parser = argparse.ArgumentParser() parser.add_argument( '-t','--text', help='Input text', default='Đó ...
[ 6738, 20922, 62, 26791, 1330, 24983, 1096, 198, 6738, 3384, 4487, 1330, 289, 37266, 355, 27673, 198, 198, 11748, 3384, 4487, 13, 5239, 13, 27773, 364, 355, 50102, 198, 6738, 629, 541, 88, 13, 952, 1330, 266, 615, 7753, 198, 11748, 299...
2.555556
549
5351 4c69 7465 2066 6f72 6d61 7420 3300 0400 0101 0040 2020 0000 003b 0000 0000 0000 0000 0000 0000 0000 003b 0000 0001 0000 0000 0000 0000 0000 0001 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0500 0000 0603 e200 0000 0026 03fb 03f1 03ec 03f6 03e7 03e2 0000 0000 ...
[ 20, 35273, 604, 66, 3388, 8915, 2996, 1160, 2791, 718, 69, 4761, 718, 67, 5333, 8915, 1238, 4747, 405, 198, 3023, 405, 5534, 486, 3571, 1821, 12131, 17643, 3571, 18, 65, 17643, 17643, 198, 2388, 17643, 17643, 17643, 17643, 3571, 18, 6...
3.089201
31,502
from django.apps import AppConfig
[ 6738, 42625, 14208, 13, 18211, 1330, 2034, 16934, 628 ]
3.888889
9
import numpy as np import sys
[ 198, 11748, 299, 32152, 355, 45941, 198, 11748, 25064, 628 ]
3.2
10
# Copyright © 2018, D-Tech, LLC, All Rights Reserved. # Disclaimer: This software is provided "AS IS" without warrantees. # D-Tech, LLC has no oblication to provide any maintainence, update # or support for this software. Under no circumstances shall D-Tech, # LLC be liable to any parties for direct, indirect, s...
[ 2, 15069, 10673, 2864, 11, 360, 12, 17760, 11, 11419, 11, 1439, 6923, 33876, 13, 220, 198, 2, 3167, 17111, 25, 770, 3788, 318, 2810, 366, 1921, 3180, 1, 1231, 8084, 2841, 13, 220, 220, 198, 2, 360, 12, 17760, 11, 11419, 468, 645, ...
2.812903
310
import wmi _wmi_handle = None
[ 11748, 266, 11632, 198, 198, 62, 86, 11632, 62, 28144, 796, 6045 ]
2.5
12
import datetime import os import uuid import copy import json import shutil import threading import time from abc import ABC, abstractmethod from pathlib import Path from typing import Union, Optional, Tuple from ludwig.api import LudwigModel from ludwig.backend import RAY, initialize_backend from ludwig.callbacks imp...
[ 11748, 4818, 8079, 198, 11748, 28686, 198, 11748, 334, 27112, 198, 11748, 4866, 198, 11748, 33918, 198, 11748, 4423, 346, 198, 11748, 4704, 278, 198, 11748, 640, 198, 6738, 450, 66, 1330, 9738, 11, 12531, 24396, 198, 6738, 3108, 8019, 1...
3.103512
541
import sys import cv2 import numpy as np if __name__=='__main__': # Create SIFT object sift = cv2.xfeatures2d.SIFT_create() # Create Flann Matcher Object flann = cv2.FlannBasedMatcher(dict(algorithm = 0, trees = 5), dict(checks = 50)) # Gets list of image files from arguments files = sys.argv...
[ 11748, 25064, 198, 11748, 269, 85, 17, 198, 11748, 299, 32152, 355, 45941, 198, 198, 361, 11593, 3672, 834, 855, 6, 834, 12417, 834, 10354, 198, 220, 220, 220, 1303, 13610, 311, 32297, 2134, 198, 220, 220, 220, 264, 2135, 796, 269, ...
2.164719
1,797
# Copyright (c) 2017-2018 Wind River Systems, 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...
[ 2, 15069, 357, 66, 8, 2177, 12, 7908, 3086, 5866, 11998, 11, 3457, 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, ...
2.342298
818
import argparse import os import textwrap import deployment_options import utils if __name__ == "__main__": main()
[ 11748, 1822, 29572, 198, 11748, 28686, 198, 11748, 2420, 37150, 198, 198, 11748, 14833, 62, 25811, 198, 11748, 3384, 4487, 628, 628, 198, 198, 361, 11593, 3672, 834, 6624, 366, 834, 12417, 834, 1298, 198, 220, 220, 220, 1388, 3419, 198 ...
3.04878
41
# SPDX-FileCopyrightText: 2022 Geoffrey Lentner # SPDX-License-Identifier: Apache-2.0 """Automated tests for HyperShell."""
[ 2, 30628, 55, 12, 8979, 15269, 8206, 25, 33160, 42803, 43751, 1008, 198, 2, 30628, 55, 12, 34156, 12, 33234, 7483, 25, 24843, 12, 17, 13, 15, 198, 198, 37811, 38062, 515, 5254, 329, 15079, 23248, 526, 15931, 198 ]
3.205128
39
import logging from datetime import timedelta, date import progressbar import structlog from collections import defaultdict from django.core.management.base import BaseCommand from django.utils import timezone, dateparse from ...actions.accounts import create_invoices from ...models import Account logger = structl...
[ 11748, 18931, 198, 6738, 4818, 8079, 1330, 28805, 12514, 11, 3128, 198, 198, 11748, 4371, 5657, 198, 11748, 2878, 6404, 198, 6738, 17268, 1330, 4277, 11600, 198, 6738, 42625, 14208, 13, 7295, 13, 27604, 13, 8692, 1330, 7308, 21575, 198, ...
3.885057
87
from collections import namedtuple import concurrent import io import json import os import pathlib import pickle import tarfile import boto3 import imageio import numpy as np import utils ClassInfo = namedtuple('ClassInfo', ['wnid', 'cid', 'synset', 'wikipedia_pages', 'gloss'])
[ 6738, 17268, 1330, 3706, 83, 29291, 198, 11748, 24580, 198, 11748, 33245, 198, 11748, 33918, 198, 11748, 28686, 198, 11748, 3108, 8019, 198, 11748, 2298, 293, 198, 11748, 13422, 7753, 198, 198, 11748, 275, 2069, 18, 198, 11748, 2939, 952,...
3.298851
87
""" Contains the Encoder-Decoder model for image captioning """ import torch.nn as nn from cnn import CNN from rnn import RNN from transformer import Transformer class CaptioningModel(nn.Module): """ Image captioning model """ def forward(self, images, captions, predict=False): """ Forward pass of ...
[ 37811, 49850, 262, 14711, 12342, 12, 10707, 12342, 2746, 329, 2939, 8305, 278, 220, 37227, 198, 198, 11748, 28034, 13, 20471, 355, 299, 77, 198, 6738, 269, 20471, 1330, 8100, 198, 6738, 374, 20471, 1330, 371, 6144, 198, 6738, 47385, 133...
3.105263
152
from pyspark import SparkContext import json import gzip import marshal ''' Configuration Parameters ''' tweetsFile = "/tmp/ist169518/out_*/part*" outFileProcessedDataset = "/tmp/ist169518/filtered-scored" # Emotional Lexicons # csv files with first column with the word, and second with the score separated with comm...
[ 6738, 279, 893, 20928, 1330, 17732, 21947, 198, 11748, 33918, 198, 11748, 308, 13344, 198, 11748, 22397, 282, 198, 198, 7061, 6, 28373, 40117, 705, 7061, 198, 198, 83, 732, 1039, 8979, 796, 12813, 22065, 14, 396, 1433, 3865, 1507, 14, ...
2.723183
1,156
# -*- coding: utf-8 -*- import logging from . import instrumentation from .dotdict import dotdict ################################################################## ### defaults and constants ################################################################## PRE = 'pre' POST = 'post' DEFAULT_MAX_HISTORY_SIZE = 2 I...
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 198, 11748, 18931, 198, 198, 6738, 764, 1330, 8875, 341, 198, 6738, 764, 26518, 11600, 1330, 16605, 11600, 198, 198, 29113, 29113, 2235, 198, 21017, 26235, 290, 38491, 198...
5.756923
325
import rumps import requests import json API_URL = 'https://koinex.in/api/ticker' UPDATE_INTERVAL = 60 CURRENCIES = { 'Bitcoin': 'BTC', 'Ethereum': 'ETH', 'Ripple': 'XRP', 'Litecoin': 'LTC', 'Bitcoin Cash': 'BCH', } if __name__ == "__main__": KoinexStatusBarApp().run()
[ 11748, 7440, 862, 198, 11748, 7007, 198, 11748, 33918, 198, 198, 17614, 62, 21886, 796, 705, 5450, 1378, 7204, 500, 87, 13, 259, 14, 15042, 14, 83, 15799, 6, 198, 198, 16977, 62, 41358, 23428, 796, 3126, 198, 198, 34, 31302, 24181, ...
2.282443
131
# Generated by Django 2.1.7 on 2019-05-03 02:36 from django.db import migrations
[ 2, 2980, 515, 416, 37770, 362, 13, 16, 13, 22, 319, 13130, 12, 2713, 12, 3070, 7816, 25, 2623, 198, 198, 6738, 42625, 14208, 13, 9945, 1330, 15720, 602, 628 ]
2.766667
30
# -*- coding: utf-8 -*- """ Created on Tue Apr 20 13:32:20 2021 #--- ag csv results to single file based on dashboard_dbs #--- Murilo Vianna (murilodsv@gmail.com) #--- Jul, 2021. #--- Dev-log in: https://github.com/Murilodsv/py-jules @author: muril """ # DEBUG import os; os.chdir('C:/Murilo/py-jules'...
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 37811, 198, 41972, 319, 30030, 2758, 1160, 1511, 25, 2624, 25, 1238, 33448, 628, 220, 220, 220, 1303, 6329, 556, 269, 21370, 2482, 284, 2060, 2393, 1912, 319, 30415, 62,...
1.995512
1,337
""" With a physics component, you can fly. Well, not for long. You'll shortly fall to your death. """ import pymunk import whoosh.maths from whoosh.components.base import BaseComponent class PhysicsComponent(BaseComponent): """ Useful for recreating Angry Birds. GameWorld.add_blob will automatically add t...
[ 37811, 198, 3152, 257, 11887, 7515, 11, 345, 460, 6129, 13, 198, 5779, 11, 407, 329, 890, 13, 198, 1639, 1183, 8972, 2121, 284, 534, 1918, 13, 198, 37811, 198, 11748, 279, 4948, 2954, 198, 11748, 508, 3768, 13, 11018, 82, 198, 6738,...
2.444105
1,637
from Class.rqlite import rqlite import subprocess, socket, psutil, json, time
[ 6738, 5016, 13, 81, 13976, 578, 1330, 374, 13976, 578, 198, 11748, 850, 14681, 11, 17802, 11, 26692, 22602, 11, 33918, 11, 640, 198 ]
3.25
24
""" str - string """ print('aspas simples') print("aspas duplas") print(123456) # integer, conversao implicita para string print("essa é uma 'string' (str).") print('essa é uma "string" (str).') print('essa é uma \'string\' (str).') print("essa é uma \"string\" (str).") # '\' caracter de escape print('essa é uma \n...
[ 37811, 198, 2536, 532, 4731, 198, 37811, 198, 198, 4798, 10786, 5126, 292, 985, 2374, 11537, 198, 4798, 7203, 5126, 292, 14184, 292, 4943, 198, 4798, 7, 10163, 29228, 8, 220, 1303, 18253, 11, 3453, 5488, 16992, 64, 31215, 4731, 198, 4...
2.696203
158
#!/usr/bin/env python ########################################################################### # # Written in 2009 by Ian Katz <ijk5@mit.edu> # Terms: WTFPL (http://sam.zoy.org/wtfpl/) # See COPYING and WARRANTY files included in this distribution # #####################################...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 29113, 29113, 7804, 21017, 198, 2, 220, 220, 220, 220, 198, 2, 220, 220, 220, 22503, 287, 3717, 416, 12930, 36290, 1279, 45961, 20, 31, 2781, 13, 15532, 29, 220, 220, 220, 220, 220, ...
2.672302
769
import numpy as np import matplotlib from matplotlib import colors from matplotlib import cm import matplotlib.pyplot as plt import folium from folium.plugins import HeatMap from folium.plugins import MarkerCluster from loci.analytics import bbox, kwds_freq from wordcloud import WordCloud from pysal.viz.mapclassify imp...
[ 11748, 299, 32152, 355, 45941, 198, 11748, 2603, 29487, 8019, 198, 6738, 2603, 29487, 8019, 1330, 7577, 198, 6738, 2603, 29487, 8019, 1330, 12067, 198, 11748, 2603, 29487, 8019, 13, 9078, 29487, 355, 458, 83, 198, 11748, 5955, 1505, 198, ...
2.214953
2,889
from flask import Blueprint, request, jsonify import pymongo client = pymongo.MongoClient('localhost',27017) db = client.TCGA_Slide_DB dsa = Blueprint('dsa', __name__) @dsa.route('/annotations', methods=['POST','OPTIONS']) @dsa.route('/annotations', methods=['GET','OPTIONS'])
[ 6738, 42903, 1330, 39932, 11, 2581, 11, 33918, 1958, 198, 11748, 279, 4948, 25162, 198, 198, 16366, 796, 279, 4948, 25162, 13, 44, 25162, 11792, 10786, 36750, 3256, 1983, 29326, 8, 198, 9945, 796, 5456, 13, 4825, 9273, 62, 11122, 485, ...
2.772277
101
import urllib # make response
[ 11748, 2956, 297, 571, 198, 198, 2, 787, 2882, 198, 220, 220, 220, 220, 198 ]
2.4
15
from unittest import mock from django.urls import reverse from parameterized import parameterized from rest_framework import status from api.applications.models import PartyOnApplication from lite_content.lite_api.strings import PartyErrors from api.parties.enums import PartyType, SubType from api.parties.models impo...
[ 6738, 555, 715, 395, 1330, 15290, 198, 198, 6738, 42625, 14208, 13, 6371, 82, 1330, 9575, 198, 6738, 11507, 1143, 1330, 11507, 1143, 198, 6738, 1334, 62, 30604, 1330, 3722, 198, 198, 6738, 40391, 13, 1324, 677, 602, 13, 27530, 1330, 3...
3.818966
116
from datetime import datetime theTime = '2019-12-20 10:22:00' theTime = datetime.strptime(theTime, '%Y-%m-%d %H:%M:%S') print(theTime)
[ 6738, 4818, 8079, 1330, 4818, 8079, 198, 198, 1169, 7575, 796, 705, 23344, 12, 1065, 12, 1238, 838, 25, 1828, 25, 405, 6, 198, 1169, 7575, 796, 4818, 8079, 13, 2536, 457, 524, 7, 1169, 7575, 11, 705, 4, 56, 12, 4, 76, 12, 4, 6...
2.213115
61
import importlib import sys
[ 11748, 1330, 8019, 198, 11748, 25064, 198 ]
4
7
#!C:\Python27\python.exe -u #!/usr/bin/env python import MySQLdb import hashlib import cgi import uuid print "Content-type: text/html" print print """ <html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <titl...
[ 2, 0, 34, 7479, 37906, 1983, 59, 29412, 13, 13499, 532, 84, 198, 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 198, 11748, 33476, 9945, 198, 11748, 12234, 8019, 198, 11748, 269, 12397, 198, 11748, 334, 27112, 198, 198, 4798, 366, ...
2.577941
680
from .reminders import Reminders Default = Reminders
[ 6738, 764, 2787, 29700, 1330, 3982, 29700, 198, 19463, 796, 3982, 29700, 198 ]
4.076923
13
# # Copyright (c) 2013, Prometheus Research, LLC # Released under MIT license, see `LICENSE` for details. # from .check import maybe, oneof, choiceof, listof, tupleof, dictof, raises from .core import Test, Field, Record from .ctl import Control from .load import locate, Location from .run import run, main from .std ...
[ 2, 198, 2, 15069, 357, 66, 8, 2211, 11, 42696, 4992, 11, 11419, 198, 2, 28728, 739, 17168, 5964, 11, 766, 4600, 43, 2149, 24290, 63, 329, 3307, 13, 198, 2, 628, 198, 6738, 764, 9122, 1330, 3863, 11, 530, 1659, 11, 3572, 1659, 11...
3.504505
111
import torch import torch.nn as nn class EvonormPrimitive(nn.Module): """Abstract base class for the evonorm primitive layers """ class PrimitiveAdd(EvonormPrimitive): """ Primitive Add Operation """ class PrimitiveMul(EvonormPrimitive): """Primitive Multiply Operation """ class PrimitiveDiv...
[ 11748, 28034, 198, 11748, 28034, 13, 20471, 355, 299, 77, 198, 198, 4871, 4319, 261, 579, 23828, 1800, 7, 20471, 13, 26796, 2599, 198, 220, 220, 220, 37227, 23839, 2779, 1398, 329, 262, 819, 261, 579, 20049, 11685, 198, 220, 220, 220,...
2.817699
1,130
import spotipy from spotipy.oauth2 import SpotifyClientCredentials from dotenv import load_dotenv load_dotenv() lz_uri = 'spotify:artist:36QJpDe2go2KgaRleHCDTp' client_credentials_manager = SpotifyClientCredentials(client_id='CLIENT_ID', client_secret='CLIENT_SECRET') spotify =...
[ 11748, 4136, 541, 88, 198, 6738, 4136, 541, 88, 13, 12162, 1071, 17, 1330, 26778, 11792, 34, 445, 14817, 198, 6738, 16605, 24330, 1330, 3440, 62, 26518, 24330, 198, 198, 2220, 62, 26518, 24330, 3419, 198, 198, 75, 89, 62, 9900, 796, ...
2.371747
269
import logging
[ 11748, 18931, 628, 198 ]
4.25
4
# Copyright 2010-2016, Google 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 ...
[ 2, 15069, 3050, 12, 5304, 11, 3012, 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, 262, 1708, 3403, ...
1.848193
4,980
from ..graph import Arc, ArcType, Node, NodeType, Graph, GraphType, GraphSet from ..gcn import GCN import tensorflow as tf import numpy as np tf.compat.v1.disable_eager_execution()
[ 6738, 11485, 34960, 1330, 10173, 11, 10173, 6030, 11, 19081, 11, 19081, 6030, 11, 29681, 11, 29681, 6030, 11, 29681, 7248, 198, 6738, 11485, 70, 31522, 1330, 20145, 45, 198, 198, 11748, 11192, 273, 11125, 355, 48700, 198, 11748, 299, 32...
2.907692
65
#!/usr/bin/env python #----------------------------------------------------------------------- # twitter-user-search # - performs a search for users matching a certain query #----------------------------------------------------------------------- from twitter import * #----------------------------------------------...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 198, 2, 10097, 26866, 198, 2, 17044, 12, 7220, 12, 12947, 198, 2, 220, 532, 17706, 257, 2989, 329, 2985, 12336, 257, 1728, 12405, 198, 2, 10097, 26866, 198, 198, 6738, 17044, 1330, 1...
4.94863
292
#!/usr/bin/env python3 # You are probably well aware of the 'birthday paradox' # https://en.wikipedia.org/wiki/Birthday_problem # Let's try simulating it # You will need a list for the 365 day calendar # You will need a set number of people (e.g. 25) # During each 'trial' you do the following # Choose a person # Git ...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 198, 2, 921, 389, 2192, 880, 3910, 286, 262, 705, 24280, 820, 22226, 6, 198, 2, 3740, 1378, 268, 13, 31266, 13, 2398, 14, 15466, 14, 38480, 820, 62, 45573, 198, 2, 3914, 338, ...
2.737463
339
from datetime import datetime, timedelta import numpy as np import pytest from pytest import fixture from vanilla_option_pricing.option import VanillaOption, option_list_to_pandas_dataframe, \ pandas_dataframe_to_option_list @fixture @fixture
[ 6738, 4818, 8079, 1330, 4818, 8079, 11, 28805, 12514, 198, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 12972, 9288, 198, 6738, 12972, 9288, 1330, 29220, 198, 198, 6738, 16858, 62, 18076, 62, 1050, 6345, 13, 18076, 1330, 33897, 19722, ...
3.083333
84
from flask import Flask from flask_sqlalchemy import SQLAlchemy from flask_caching import Cache
[ 6738, 42903, 1330, 46947, 198, 6738, 42903, 62, 25410, 282, 26599, 1330, 16363, 2348, 26599, 198, 6738, 42903, 62, 66, 8103, 1330, 34088, 628 ]
4.041667
24
from inspect import formatargvalues import discord, datetime, db, time, os import pandas as pd from discord import Embed from discord.ext.commands import Cog, command from apscheduler.schedulers.asyncio import AsyncIOScheduler from apscheduler.triggers.cron import CronTrigger # from discord_components import Button, Bu...
[ 6738, 10104, 1330, 5794, 853, 27160, 198, 11748, 36446, 11, 4818, 8079, 11, 20613, 11, 640, 11, 28686, 198, 11748, 19798, 292, 355, 279, 67, 198, 6738, 36446, 1330, 13302, 276, 198, 6738, 36446, 13, 2302, 13, 9503, 1746, 1330, 327, 51...
2.653226
248
import logging from ._version import __version__ __all__ = [ "__version__", ] logger = logging.getLogger(__name__) logging.basicConfig()
[ 11748, 18931, 198, 198, 6738, 47540, 9641, 1330, 11593, 9641, 834, 198, 198, 834, 439, 834, 796, 685, 198, 220, 220, 220, 366, 834, 9641, 834, 1600, 198, 60, 198, 198, 6404, 1362, 796, 18931, 13, 1136, 11187, 1362, 7, 834, 3672, 834...
2.769231
52
from pygame_rl.scenario.gridworld.envs.gridworld_v0 import GridworldV0 from pygame_rl.scenario.gridworld.envs.gridworld_v1 import GridworldV1
[ 6738, 12972, 6057, 62, 45895, 13, 1416, 39055, 13, 25928, 6894, 13, 268, 14259, 13, 25928, 6894, 62, 85, 15, 1330, 24846, 6894, 53, 15, 198, 6738, 12972, 6057, 62, 45895, 13, 1416, 39055, 13, 25928, 6894, 13, 268, 14259, 13, 25928, ...
2.730769
52
#! /usr/bin/env python # -*- coding: utf-8 -*- # 该脚本平均每小时提交 4万5千多条URL # 推荐 0.3s,方便及时停止抓取, 一天提交10万~15万 URL PS:因为URL一旦提交到队列中,就不可修改 # python qiniu_big_fetch.py <ak> <sk> <bucket> <zone(z0 z1)> <file_path> <sleep_time> import urlparse, hmac, hashlib, base64, commands, sys, time def Qiniu_token(access_key, secret_key...
[ 2, 0, 1220, 14629, 14, 8800, 14, 24330, 21015, 198, 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 2, 5525, 107, 98, 164, 226, 248, 17312, 105, 33176, 111, 161, 251, 229, 162, 107, 237, 22887, 237, 33768, 35050, ...
1.947143
1,400
# Exercício Python 041: A Confederação Nacional de Natação precisa de um programa que leia o ano de nascimento de um atleta e mostre sua categoria, de acordo com a idade: # - Até 9 anos: MIRIM # - Até 14 anos: INFANTIL # - Até 19 anos: JÚNIOR # - Até 25 anos: SÊNIOR # - Acima de 25 anos: MASTER from datetime import da...
[ 2, 1475, 2798, 8836, 66, 952, 11361, 657, 3901, 25, 317, 16986, 64, 16175, 28749, 399, 330, 1538, 390, 399, 1045, 16175, 28749, 3718, 9160, 390, 23781, 1430, 64, 8358, 443, 544, 267, 281, 78, 390, 299, 3372, 3681, 78, 390, 23781, 37...
2.383285
347
""" Description: Author: Jiaqi Gu (jqgu@utexas.edu) Date: 2021-03-31 17:48:41 LastEditors: Jiaqi Gu (jqgu@utexas.edu) LastEditTime: 2021-09-26 00:51:50 """ from typing import Tuple import torch import torch.nn as nn from pyutils.config import configs from pyutils.datasets import get_dataset from pyutils.loss import A...
[ 37811, 198, 11828, 25, 198, 13838, 25, 449, 544, 40603, 1962, 357, 73, 80, 5162, 31, 315, 1069, 292, 13, 15532, 8, 198, 10430, 25, 33448, 12, 3070, 12, 3132, 1596, 25, 2780, 25, 3901, 198, 5956, 18378, 669, 25, 449, 544, 40603, 19...
2.677871
357
""" Graphviz extensions for Markdown. Renders the output inline, eliminating the need to configure an output directory. Supports outputs types of SVG and PNG. The output will be taken from the filename specified in the tag. Example: {% dot attack_plan.svg digraph G { rankdir=LR Earth [peripheries=...
[ 37811, 198, 37065, 85, 528, 18366, 329, 2940, 2902, 13, 198, 49, 7338, 262, 5072, 26098, 11, 18591, 262, 761, 284, 17425, 281, 5072, 198, 34945, 13, 198, 198, 15979, 2096, 23862, 3858, 286, 45809, 290, 36182, 13, 383, 5072, 481, 307, ...
2.565476
336
from django.conf import settings from django.core.management import call_command, get_commands, load_command_class from django.core.management.base import BaseCommand, CommandError from django.db import connection from django_tenants.utils import get_tenant_model, get_public_schema_name class BaseTenantCommand(Base...
[ 6738, 42625, 14208, 13, 10414, 1330, 6460, 198, 6738, 42625, 14208, 13, 7295, 13, 27604, 1330, 869, 62, 21812, 11, 651, 62, 9503, 1746, 11, 3440, 62, 21812, 62, 4871, 198, 6738, 42625, 14208, 13, 7295, 13, 27604, 13, 8692, 1330, 7308,...
2.465315
937
######################################################## # run_rt.py # Author: Jamie Zhu <jimzhu@GitHub> # Created: 2014/2/6 # Last updated: 2014/5/8 # Implemented approach: CloudPred # Evaluation metrics: MAE, NMAE, RMSE, MRE, NPRE ######################################################## import numpy as np ...
[ 29113, 14468, 7804, 201, 198, 2, 1057, 62, 17034, 13, 9078, 220, 201, 198, 2, 6434, 25, 17826, 33144, 1279, 73, 320, 89, 13415, 31, 38, 270, 16066, 29, 201, 198, 2, 15622, 25, 1946, 14, 17, 14, 21, 201, 198, 2, 4586, 6153, 25, ...
2.948332
929
import torch import torch.nn as nn import torch.nn.functional as functional class upsampling(nn.Module): ''' net from Deeper depth prediction with fully convolutional residual networks Args of __init__(): in_channels: the # of channels of the input out_channels: the # of chann...
[ 11748, 28034, 198, 11748, 28034, 13, 20471, 355, 299, 77, 198, 11748, 28034, 13, 20471, 13, 45124, 355, 10345, 198, 198, 4871, 19649, 321, 11347, 7, 20471, 13, 26796, 2599, 198, 220, 220, 220, 220, 198, 220, 220, 220, 705, 7061, 198, ...
2.10559
1,127
import math import torch import torch.nn as nn from .GeneralModels import BasicBlock
[ 11748, 10688, 198, 11748, 28034, 198, 11748, 28034, 13, 20471, 355, 299, 77, 198, 6738, 764, 12218, 5841, 1424, 1330, 14392, 12235, 628 ]
3.73913
23
#CodeFights #Given a year, return the century it is in. The first century spans from the year 1 up to and including the year 100, the second - from the year 101 up to and including the year 200, etc.
[ 2, 10669, 37, 2337, 198, 2, 15056, 257, 614, 11, 1441, 262, 4289, 340, 318, 287, 13, 383, 717, 4289, 32727, 422, 262, 614, 352, 510, 284, 290, 1390, 262, 614, 1802, 11, 262, 1218, 532, 422, 262, 614, 8949, 510, 284, 290, 1390, 2...
3.98
50
from raspador import Pilot, UserInteractor, BrowserInteractor from typing import Dict, List
[ 6738, 374, 5126, 7079, 1330, 21697, 11, 11787, 9492, 11218, 11, 34270, 9492, 11218, 198, 6738, 19720, 1330, 360, 713, 11, 7343 ]
4.136364
22
# GENERATED VERSION FILE # TIME: Thu May 6 12:37:04 2021 __version__ = '1.2.0+unknown' short_version = '1.2.0' version_info = (1, 2, 0)
[ 2, 24700, 1137, 11617, 44156, 2849, 45811, 198, 2, 20460, 25, 26223, 1737, 220, 718, 1105, 25, 2718, 25, 3023, 33448, 198, 198, 834, 9641, 834, 796, 705, 16, 13, 17, 13, 15, 10, 34680, 6, 198, 19509, 62, 9641, 796, 705, 16, 13, ...
2.262295
61
import pybullet_data import pybullet as p import numpy as np if __name__ == '__main__': p.connect(p.GUI) p.setAdditionalSearchPath(pybullet_data.getDataPath()) plane = p.createCollisionShape(p.GEOM_PLANE) p.changeDynamics(plane, -1, lateralFriction=1) p.createMultiBody(0, plane) p.setGravity...
[ 11748, 12972, 15065, 1616, 62, 7890, 198, 11748, 12972, 15065, 1616, 355, 279, 198, 11748, 299, 32152, 355, 45941, 628, 198, 198, 361, 11593, 3672, 834, 6624, 705, 834, 12417, 834, 10354, 628, 220, 220, 220, 279, 13, 8443, 7, 79, 13, ...
2.34359
195
from get_classification_file_with_original_annotation import get_image_label_dict_from_original_annotation, get_classification_file_based_on_label original_annotation_path="/git/PaDiM-master/assets_new_new/data/2021-03-05/json_for_classification" image_data_root="/git/PaDiM-master/kangqiang_result/segment_image_resul...
[ 6738, 651, 62, 4871, 2649, 62, 7753, 62, 4480, 62, 14986, 62, 1236, 14221, 1330, 220, 651, 62, 9060, 62, 18242, 62, 11600, 62, 6738, 62, 14986, 62, 1236, 14221, 11, 651, 62, 4871, 2649, 62, 7753, 62, 3106, 62, 261, 62, 18242, 198,...
2.793249
237
#!/usr/bin/python """ This application reads key value pairs from the command line input and writes to a dictionary, which is then written to a config file The preferred file extension is .cfg """ import signal import sys import HackPSUconfig as config #Initialize a dictionary and define the save and configFile variab...
[ 2, 48443, 14629, 14, 8800, 14, 29412, 198, 37811, 198, 1212, 3586, 9743, 1994, 1988, 14729, 422, 262, 3141, 1627, 5128, 290, 6797, 284, 257, 22155, 11, 543, 318, 788, 3194, 284, 257, 4566, 2393, 198, 464, 9871, 2393, 7552, 318, 764, ...
3.431034
406
# Generated by Django 3.1.6 on 2021-02-20 12:26 from django.db import migrations, models
[ 2, 2980, 515, 416, 37770, 513, 13, 16, 13, 21, 319, 33448, 12, 2999, 12, 1238, 1105, 25, 2075, 198, 198, 6738, 42625, 14208, 13, 9945, 1330, 15720, 602, 11, 4981, 628 ]
2.84375
32
import logging from abc import ABC from abc import abstractmethod from typing import List import torch logger = logging.getLogger(__name__)
[ 11748, 18931, 198, 6738, 450, 66, 1330, 9738, 198, 6738, 450, 66, 1330, 12531, 24396, 198, 6738, 19720, 1330, 7343, 198, 198, 11748, 28034, 198, 198, 6404, 1362, 796, 18931, 13, 1136, 11187, 1362, 7, 834, 3672, 834, 8, 628, 198 ]
3.512195
41
import os from src.utils.utils import load_config def test_load_config(): """Test the load_config function""" config = load_config(".env.test") assert config["app_name"] == os.getenv("APP_NAME") assert config["parameters_path"] == os.getenv("PARAMETERS_PATH") assert config["artifact_path"] == os...
[ 11748, 28686, 198, 6738, 12351, 13, 26791, 13, 26791, 1330, 3440, 62, 11250, 628, 198, 4299, 1332, 62, 2220, 62, 11250, 33529, 198, 220, 220, 220, 37227, 14402, 262, 3440, 62, 11250, 2163, 37811, 628, 220, 220, 220, 4566, 796, 3440, 6...
2.64557
316
import logging from django import forms from django.core.files import File from django.core.files.storage import default_storage from django.core.files.uploadedfile import UploadedFile from django.utils.crypto import get_random_string from django.utils.translation import gettext_lazy as _ logger = logging.getLogger(_...
[ 11748, 18931, 198, 198, 6738, 42625, 14208, 1330, 5107, 198, 6738, 42625, 14208, 13, 7295, 13, 16624, 1330, 9220, 198, 6738, 42625, 14208, 13, 7295, 13, 16624, 13, 35350, 1330, 4277, 62, 35350, 198, 6738, 42625, 14208, 13, 7295, 13, 166...
2.058778
1,293
#!/usr/bin/python import sys import re import pandas as pd import csv if sys.argv[1].startswith("-f"): col_number = int(sys.argv[1][2]) - 1 input_file = sys.argv[2] else: col_number = 0 input_file = sys.argv[1] name_dict = {} with open("Homo_sapiens.GRCh37.75.gtf", "r") as f: for line in f: i...
[ 2, 48443, 14629, 14, 8800, 14, 29412, 201, 198, 201, 198, 11748, 25064, 201, 198, 11748, 302, 201, 198, 11748, 19798, 292, 355, 279, 67, 201, 198, 11748, 269, 21370, 201, 198, 201, 198, 361, 25064, 13, 853, 85, 58, 16, 4083, 9688, ...
2.069717
459
#Array """ Idea: let forward[i] = nums[0]*nums[1]*...*nums[i-1] ,backward[i] = backward[i] = nums[i+1]*nums[i+2]*...*nums[n], then, res[i] = forward[i]*backward[i] """ import unittest unittest.main()
[ 2, 19182, 198, 198, 37811, 198, 41452, 64, 25, 198, 1616, 2651, 58, 72, 60, 796, 997, 82, 58, 15, 60, 9, 77, 5700, 58, 16, 60, 9, 986, 9, 77, 5700, 58, 72, 12, 16, 60, 837, 1891, 904, 58, 72, 60, 796, 19528, 58, 72, 60, ...
1.827586
116