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 sys.path.append('./package_one') sys.path.append('./package_two') import parent print("----") print("'parent' package is located as two different directories under 'package_one' and 'package_two'") print("it's __path__ contains both of those paths cause it's a namespace package and it doesn't require subpa...
[ 11748, 25064, 198, 198, 17597, 13, 6978, 13, 33295, 7, 4458, 14, 26495, 62, 505, 11537, 198, 17597, 13, 6978, 13, 33295, 7, 4458, 14, 26495, 62, 11545, 11537, 198, 11748, 2560, 198, 198, 4798, 7203, 650, 4943, 198, 4798, 7203, 6, 80...
3.596838
253
import pytest import json from mlm.loaders import Corpus, Hypotheses, Predictions, ScoredCorpus TEST_DICT = { 'utt1': { 'ref': "BERT", 'hyp_1': {'score': -7, 'text': "ERNIE"}, 'hyp_2': {'score': -8.5, 'text': "ELMo"} }, 'utt0': { 'ref': " This is true. ", 'hyp_...
[ 11748, 12972, 9288, 198, 198, 11748, 33918, 198, 198, 6738, 25962, 76, 13, 2220, 364, 1330, 44874, 11, 21209, 31690, 274, 11, 14322, 9278, 11, 1446, 1850, 45680, 385, 628, 198, 51, 6465, 62, 35, 18379, 796, 1391, 198, 220, 220, 220, ...
1.964286
252
import os import random import shutil from collections import Counter import Automold as am import cv2 import matplotlib.pyplot as plt class DataGenerator: """ Used to generate new samples using various methods. """ def get_lp_annotations(self, imgs_dir): """ Get all LP character annotations (i...
[ 11748, 28686, 198, 11748, 4738, 198, 11748, 4423, 346, 198, 6738, 17268, 1330, 15034, 198, 198, 11748, 17406, 727, 355, 716, 198, 11748, 269, 85, 17, 198, 11748, 2603, 29487, 8019, 13, 9078, 29487, 355, 458, 83, 628, 198, 4871, 6060, ...
1.92239
8,401
import logging log = logging.getLogger(__name__) if __name__ == "__main__": from Settings import Settings top = Top() top.settings = Settings() top.settings.detailed_print = False top.x = (Settings(), Settings()) top.a = [1, 2, 3] print(top)
[ 11748, 18931, 198, 198, 6404, 796, 18931, 13, 1136, 11187, 1362, 7, 834, 3672, 834, 8, 628, 198, 198, 361, 11593, 3672, 834, 6624, 366, 834, 12417, 834, 1298, 198, 220, 220, 220, 422, 16163, 1330, 16163, 628, 220, 220, 220, 1353, 79...
2.59434
106
''' Define dataQC class - Objects can have multiple ranges describing good, suspicious values - Where suspicious and good ranges overlap, data will be classified as good - **rates and flat must be in units of min (for now) - **each method takes a pandas df with values of interest in col 1 and datetimes col 0 - **each m...
[ 7061, 6, 198, 7469, 500, 1366, 48, 34, 1398, 198, 12, 35832, 460, 423, 3294, 16069, 12059, 922, 11, 13678, 3815, 198, 12, 6350, 13678, 290, 922, 16069, 21721, 11, 1366, 481, 307, 10090, 355, 922, 198, 12, 12429, 9700, 290, 6228, 127...
2.173433
3,350
# Code créé par Gabriel Taillon le 6 Septembre 2020 import os import sys import numpy as np # Glossary # - *A*: Data space # - *&lambda*: Process intensity (function for non-homogeneous) # - PP: Point Process # - HPP: Homogeneous Poisson Process # - NHPP: Non-Homogeneous Poisson Process # - MPP: Mixed Poisson Process ...
[ 2, 6127, 1067, 2634, 2634, 1582, 17371, 11940, 23027, 443, 718, 2362, 368, 4679, 12131, 198, 11748, 28686, 198, 11748, 25064, 198, 11748, 299, 32152, 355, 45941, 198, 198, 2, 45970, 560, 198, 2, 532, 1635, 32, 47026, 6060, 2272, 198, ...
2.458585
4,141
""" This script checks for the new episodes of any TV series or anime. Enter the path name accordingly. """ import os import sys from utils import is_internet_connected, path_check, zero_prefix from new_episode_check import tv_episode_check, anime_episode_check # Browse the TV Series folder # Browse the Anime...
[ 37811, 770, 4226, 8794, 329, 262, 649, 8640, 286, 597, 3195, 2168, 393, 11984, 13, 198, 220, 220, 220, 6062, 262, 3108, 1438, 16062, 13, 198, 37811, 198, 198, 11748, 28686, 198, 11748, 25064, 198, 198, 6738, 3384, 4487, 1330, 318, 62,...
2.827586
290
#!/data/ganesh/Software/anaconda/bin/python -tt # E-MAIL:- gsivaraman@anl.gov # import modules used here from __future__ import print_function import sys import pybel from time import time from numpy import * from numba import jit import json """ kernprof -l script.py python -m line_profiler script.py.lprof Unc...
[ 2, 48443, 7890, 14, 1030, 5069, 14, 25423, 14, 272, 330, 13533, 14, 8800, 14, 29412, 532, 926, 220, 220, 220, 220, 198, 2, 412, 12, 5673, 4146, 21912, 220, 308, 82, 452, 283, 10546, 31, 272, 75, 13, 9567, 198, 2, 1330, 13103, 97...
2.450295
2,032
from pathlib import Path import pandas as pd import geopandas as gp from analysis.lib.geometry import unique_sjoin data_dir = Path("data") boundaries_dir = data_dir / "boundaries" def add_spatial_joins(df): """Add spatial joins needed for network analysis. Parameters ---------- df : GeoDataFrame ...
[ 6738, 3108, 8019, 1330, 10644, 198, 198, 11748, 19798, 292, 355, 279, 67, 198, 11748, 30324, 392, 292, 355, 27809, 198, 198, 6738, 3781, 13, 8019, 13, 469, 15748, 1330, 3748, 62, 82, 22179, 628, 198, 7890, 62, 15908, 796, 10644, 7203,...
2.243197
1,764
# -*- coding: utf-8 -*- """ Tencent is pleased to support the open source community by making BK-BASE 蓝鲸基础平台 available. Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. BK-BASE 蓝鲸基础平台 is licensed under the MIT License. License for BK-BASE 蓝鲸基础平台: ------------------------------------------...
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 37811, 198, 24893, 1087, 318, 10607, 284, 1104, 262, 1280, 2723, 2055, 416, 1642, 347, 42, 12, 33, 11159, 5525, 241, 251, 165, 110, 116, 161, 253, 118, 163, 94, 222, ...
3.469526
443
from cached_property import cached_property from app import db from models.concept import as_concept_openalex_id # refresh materialized view mid.author_concept_for_api_mv (1200 seconds)
[ 6738, 39986, 62, 26745, 1330, 39986, 62, 26745, 198, 6738, 598, 1330, 20613, 198, 6738, 4981, 13, 43169, 1330, 355, 62, 43169, 62, 9654, 1000, 87, 62, 312, 198, 198, 2, 14976, 2587, 1143, 1570, 3095, 13, 9800, 62, 43169, 62, 1640, 6...
3.596154
52
#!/usr/bin/env python # # GrovePi Library for using the Grove - I2C Motor Driver(http://www.seeedstudio.com/depot/Grove-I2C-Motor-Driver-p-907.html) # # The GrovePi connects the Raspberry Pi and Grove sensors. You can learn more about GrovePi here: http://www.dexterindustries.com/GrovePi # # Have a question about thi...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 2, 198, 2, 24144, 38729, 10074, 329, 1262, 262, 24144, 532, 314, 17, 34, 12533, 12434, 7, 4023, 1378, 2503, 13, 325, 2308, 19149, 952, 13, 785, 14, 10378, 313, 14, 42921, 303, 12, ...
3.524272
515
from django.apps import AppConfig
[ 6738, 42625, 14208, 13, 18211, 1330, 2034, 16934, 628 ]
3.888889
9
import itk image_type = itk.Image[itk.F, 3] output_type = itk.Image[itk.UC, 3] file_name = 'O:\\images\\HPFcere_vol\\HPF_rotated_tif\\median_then_gaussian_filter.nrrd' reader = itk.ImageFileReader[image_type].New() writer = itk.ImageFileWriter[output_type].New() writerTestCopy = itk.ImageFileWriter[output_type].New(...
[ 11748, 340, 74, 198, 198, 9060, 62, 4906, 796, 340, 74, 13, 5159, 58, 270, 74, 13, 37, 11, 513, 60, 198, 22915, 62, 4906, 796, 340, 74, 13, 5159, 58, 270, 74, 13, 9598, 11, 513, 60, 198, 198, 7753, 62, 3672, 796, 705, 46, 25...
2.844007
609
import json import os from urllib.parse import urlparse
[ 11748, 33918, 198, 11748, 28686, 198, 6738, 2956, 297, 571, 13, 29572, 1330, 19016, 29572, 628 ]
3.5625
16
''' All modification made by Cambricon Corporation: © 2022 Cambricon Corporation All rights reserved. All other contributions: Copyright (c) 2014--2022, the respective contributors All rights reserved. For the list of contributors go to https://github.com/pytorch/pytorch/graphs/contributors Redistribution and use in so...
[ 7061, 6, 198, 3237, 17613, 925, 416, 21456, 1173, 261, 10501, 25, 10673, 33160, 21456, 1173, 261, 10501, 198, 3237, 2489, 10395, 13, 198, 3237, 584, 9284, 25, 198, 15269, 357, 66, 8, 1946, 438, 1238, 1828, 11, 262, 11756, 20420, 198, ...
3.422901
655
from argparse import ArgumentParser from loguru import logger from ..tasks import DATASETS_TASKS, TASKS from . import BaseAutoNLPCommand from .common import COL_MAPPING_HELP
[ 6738, 1822, 29572, 1330, 45751, 46677, 198, 198, 6738, 2604, 14717, 1330, 49706, 198, 198, 6738, 11485, 83, 6791, 1330, 360, 1404, 1921, 32716, 62, 51, 1921, 27015, 11, 309, 1921, 27015, 198, 6738, 764, 1330, 7308, 27722, 32572, 5662, 2...
3.068966
58
from collections import defaultdict """ --- Day 4: High-Entropy Passphrases --- A new system policy has been put in place that requires all accounts to use a passphrase instead of simply a password. A passphrase consists of a series of words (lowercase letters) separated by spaces. To ensure security, a valid passph...
[ 6738, 17268, 1330, 4277, 11600, 198, 198, 37811, 198, 6329, 3596, 604, 25, 3334, 12, 14539, 28338, 6251, 746, 81, 1386, 11420, 198, 198, 32, 649, 1080, 2450, 468, 587, 1234, 287, 1295, 326, 4433, 477, 5504, 284, 779, 257, 1208, 34675,...
3.340619
549
from multiprocessing import Pool, cpu_count try: _pools = cpu_count() except NotImplementedError: _pools = 4 def chop(list_, n): "Chop list_ into n chunks. Returns a list." # could look into itertools also, might be implemented there size = len(list_) each = size // n if each == 0: each =...
[ 6738, 18540, 305, 919, 278, 1330, 19850, 11, 42804, 62, 9127, 198, 198, 28311, 25, 198, 220, 220, 220, 4808, 7742, 82, 796, 42804, 62, 9127, 3419, 198, 16341, 1892, 3546, 1154, 12061, 12331, 25, 198, 220, 220, 220, 4808, 7742, 82, 7...
2.122699
978
#! /usr/bin/env python3 # coding: utf-8 import MeCab import unicodedata mt = MeCab.Tagger('-Ochasen') lyrics = [] for lyric in open('lyrics.txt'): tmp_list = [] lyric = unicodedata.normalize('NFKC', str(lyric)) node = mt.parseToNode(lyric) while node: if node.feature.startswith('名詞') or node...
[ 2, 0, 1220, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 2, 19617, 25, 3384, 69, 12, 23, 198, 198, 11748, 2185, 34, 397, 198, 11748, 28000, 9043, 1045, 628, 198, 16762, 796, 2185, 34, 397, 13, 51, 7928, 10786, 12, 46, 354, 292, 2...
2.158672
271
user_input = input("Please enter a word: ") if user_input == user_input[::-1]: print('OK') else: print('NOT') """ PRINTS OK ON CASE PALINDROME OR NOT OTHERWISE """
[ 7220, 62, 15414, 796, 5128, 7203, 5492, 3802, 257, 1573, 25, 366, 8, 198, 361, 2836, 62, 15414, 6624, 2836, 62, 15414, 58, 3712, 12, 16, 5974, 198, 220, 220, 220, 3601, 10786, 11380, 11537, 198, 17772, 25, 198, 220, 220, 220, 3601, ...
2.544118
68
from .distributed import gpu_indices, ompi_size, ompi_rank from .philly_env import get_master_ip, get_git_hash from .summary import summary __all__ = [ 'gpu_indices', 'ompi_size', 'ompi_rank', 'get_master_ip', 'summary', 'get_git_hash', ]
[ 6738, 764, 17080, 6169, 1330, 308, 19944, 62, 521, 1063, 11, 267, 3149, 72, 62, 7857, 11, 267, 3149, 72, 62, 43027, 198, 6738, 764, 746, 6548, 62, 24330, 1330, 651, 62, 9866, 62, 541, 11, 651, 62, 18300, 62, 17831, 198, 6738, 764,...
2.557895
95
#!/usr/bin/python2 #coding=utf-8 #Author Angga Kurniawan #Ngapain?? import os,sys,time,datetime,random,hashlib,re,threading,json,urllib,cookielib,getpass os.system('rm -rf .txt') for n in range(1000): nmbr = random.randint(1111111, 9999999) sys.stdout = open('.txt', 'a') print(nmbr) ...
[ 2, 48443, 14629, 14, 8800, 14, 29412, 17, 201, 198, 2, 66, 7656, 28, 40477, 12, 23, 201, 198, 2, 13838, 2895, 4908, 509, 700, 544, 8149, 201, 198, 2, 45, 43554, 391, 3548, 201, 198, 11748, 28686, 11, 17597, 11, 2435, 11, 19608, ...
1.935092
5,839
#!/usr/bin/env python3 import mock import garecovery.bitcoin_config from garecovery.clargs import DEFAULT_SUBACCOUNT_SEARCH_DEPTH from .util import AuthServiceProxy, datafile, get_output, raise_IOError, verify_txs garecovery.bitcoin_config.open = raise_IOError sub_depth = DEFAULT_SUBACCOUNT_SEARCH_DEPTH key_depth =...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 198, 11748, 15290, 198, 198, 11748, 308, 533, 1073, 548, 13, 35395, 62, 11250, 198, 6738, 308, 533, 1073, 548, 13, 565, 22046, 1330, 5550, 38865, 62, 50, 10526, 26861, 28270, 62, ...
2.083387
1,547
from operator import le from tkinter import N import PreProcess as pr from hazm import Normalizer,Stemmer from os import listdir from os.path import isfile, join
[ 6738, 10088, 1330, 443, 201, 198, 6738, 256, 74, 3849, 1330, 399, 201, 198, 11748, 3771, 18709, 355, 778, 201, 198, 6738, 11595, 76, 1330, 14435, 7509, 11, 1273, 368, 647, 201, 198, 6738, 28686, 1330, 1351, 15908, 201, 198, 6738, 2868...
3.34
50
import unittest from itertools import product from unittest.mock import MagicMock, patch from src.analysis import * class TestSCOUTSAnalysis(unittest.TestCase): """Tests all functions (and other elements) from src.analysis module.""" @classmethod def setUpClass(cls) -> None: """Loads data used fo...
[ 11748, 555, 715, 395, 198, 6738, 340, 861, 10141, 1330, 1720, 198, 6738, 555, 715, 395, 13, 76, 735, 1330, 6139, 44, 735, 11, 8529, 198, 198, 6738, 12351, 13, 20930, 1330, 1635, 628, 198, 4871, 6208, 6173, 2606, 4694, 32750, 7, 403,...
2.224025
2,281
from typing import Callable, Awaitable, NoReturn import aiohttp import asyncio from asyncio.exceptions import TimeoutError import time import re import logging from . import kafka from . import config from .message import EndpointStatus async def endpoint_task( cfg: "config.EndpointConfig", output: Callable[[...
[ 6738, 19720, 1330, 4889, 540, 11, 5851, 4548, 540, 11, 1400, 13615, 198, 198, 11748, 257, 952, 4023, 198, 11748, 30351, 952, 198, 6738, 30351, 952, 13, 1069, 11755, 1330, 3862, 448, 12331, 198, 11748, 640, 198, 11748, 302, 198, 11748, ...
2.818471
314
__author__ = 'Frederick' from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions from PageObjects.pages.locators import Locator from selenium.common.exceptions import StaleElementReferenceException, NoSuchElementExce...
[ 834, 9800, 834, 796, 705, 30847, 41556, 6, 198, 198, 6738, 384, 11925, 1505, 13, 12384, 26230, 13, 11321, 13, 1525, 1330, 2750, 198, 6738, 384, 11925, 1505, 13, 12384, 26230, 13, 11284, 13, 9019, 1330, 5313, 32103, 21321, 198, 6738, 3...
3.890323
155
import discord from discord.ext import commands from asyncdagpi import ImageFeatures
[ 11748, 36446, 198, 6738, 36446, 13, 2302, 1330, 9729, 198, 6738, 355, 2047, 10210, 363, 14415, 1330, 7412, 23595, 198 ]
4.25
20
import pandas as pd def summarize(vars, df): ''' this function prints out descriptive statistics in the similar way that Stata function sum does. Args: pandas column of a df Output: None (print out) ''' num = max([len(i) for i in vars]) if num < 13: num = 13 print("{} |...
[ 11748, 19798, 292, 355, 279, 67, 198, 198, 4299, 35743, 7, 85, 945, 11, 47764, 2599, 198, 220, 220, 220, 705, 7061, 198, 220, 220, 220, 428, 2163, 20842, 503, 35644, 7869, 287, 262, 2092, 835, 326, 520, 1045, 2163, 2160, 857, 13, ...
1.943604
2,181
from gameinterface import minecraftinterface import cv2 from PIL import Image mci = minecraftinterface.Win10MinecraftApp() while True: sc = mci.get_screen(5) if sc is not None: render_image(sc) image = Image.fromarray(sc)
[ 6738, 983, 39994, 1330, 6164, 3323, 39994, 198, 11748, 269, 85, 17, 198, 6738, 350, 4146, 1330, 7412, 628, 628, 198, 198, 76, 979, 796, 6164, 3323, 39994, 13, 16643, 940, 39194, 4677, 3419, 628, 198, 198, 4514, 6407, 25, 198, 220, 2...
2.618557
97
from .formatters import * from .handlers import * from .utils import *
[ 6738, 764, 18982, 1010, 1330, 1635, 198, 6738, 764, 4993, 8116, 1330, 1635, 198, 6738, 764, 26791, 1330, 1635, 198 ]
3.55
20
# -*- coding: utf-8 -*- """This module contains test cases for ensuring gate addition and functionality is working properly in the library. """ import random import unittest import numpy as np from quac_qiskit.stat import get_vec_angle, kl_dist_smoothing, discrete_one_samp_ks, choose_index class StatTestCase(unittes...
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 198, 37811, 1212, 8265, 4909, 1332, 2663, 329, 13359, 8946, 3090, 290, 11244, 318, 1762, 6105, 198, 259, 262, 5888, 13, 198, 37811, 198, 11748, 4738, 198, 11748, 555, 71...
3.149351
154
import pytest from rtcclient.client import RTCClient import requests from utils_test import _search_path @pytest.fixture(scope="function")
[ 11748, 12972, 9288, 198, 6738, 374, 83, 535, 75, 1153, 13, 16366, 1330, 371, 4825, 11792, 198, 11748, 7007, 198, 6738, 3384, 4487, 62, 9288, 1330, 4808, 12947, 62, 6978, 628, 198, 31, 9078, 9288, 13, 69, 9602, 7, 29982, 2625, 8818, ...
3.204545
44
import matplotlib as mpl import matplotlib.pyplot as plt import numpy as np import scipy as sci import pandas as pd plt.style.use('ggplot') x=(1,2) y=(170.02,197.47) plt.title("Distribution of Spending in January") plt.bar(x,y,color='red') plt.xticks([]) plt.ylabel("$ Amount spent on category") plt.xlabel("Healthy Va...
[ 11748, 2603, 29487, 8019, 355, 285, 489, 198, 11748, 2603, 29487, 8019, 13, 9078, 29487, 355, 458, 83, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 629, 541, 88, 355, 20681, 198, 11748, 19798, 292, 355, 279, 67, 198, 198, 489, 83, ...
2.335404
161
#!/usr/bin/env python import multiprocessing import os import random from time import sleep import redis import rediscluster from schwifty import IBAN from .bics import DUTCH_BICS __author__ = "Giuseppe Chiesa" __copyright__ = "Copyright 2017, Giuseppe Chiesa" __credits__ = ["Giuseppe Chiesa"] __license__ = "BSD" __...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 11748, 18540, 305, 919, 278, 198, 11748, 28686, 198, 11748, 4738, 198, 6738, 640, 1330, 3993, 198, 198, 11748, 2266, 271, 198, 11748, 2266, 271, 565, 5819, 198, 6738, 5513, 86, 24905, ...
1.476244
1,789
import gtk import subprocess import re import logging PUBLIC = 'public' NO_IP = '---.---.---.---' IP_REGEX = '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' """ Abstract base class that represents a network interface. """ """ A dummy 'interface' that fetches the public IP that identifies this computer on the intern...
[ 11748, 308, 30488, 198, 11748, 850, 14681, 198, 11748, 302, 198, 11748, 18931, 198, 198, 5105, 32936, 796, 705, 11377, 6, 198, 15285, 62, 4061, 796, 705, 6329, 13, 6329, 13, 6329, 13, 6329, 6, 198, 4061, 62, 31553, 6369, 796, 44438, ...
2.94709
189
import time from turtle import Turtle, Screen import score from paddle import Paddle from ball import Ball from score import Score screen = Screen() screen.setup(width=800, height=600) screen.bgcolor("black") screen.title("Pong") screen.tracer(0) ball = Ball() score = Score() paddle_right = Paddle((350, 0)) paddle...
[ 11748, 640, 198, 6738, 28699, 1330, 33137, 11, 15216, 198, 198, 11748, 4776, 198, 6738, 39517, 1330, 350, 37382, 198, 6738, 2613, 1330, 6932, 198, 6738, 4776, 1330, 15178, 628, 198, 9612, 796, 15216, 3419, 198, 198, 9612, 13, 40406, 7, ...
2.501119
447
# Definition for a binary tree node. # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None
[ 2, 30396, 329, 257, 13934, 5509, 10139, 13, 198, 2, 1398, 12200, 19667, 25, 198, 2, 220, 220, 220, 220, 825, 11593, 15003, 834, 7, 944, 11, 2124, 2599, 198, 2, 220, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 2100, 796, 2124, 1...
2.035714
84
from .classifier_wrapper import SupervisedClassifierRelevancyIndex # noqa: F401 from .libsvm_hik import LibSvmHikRelevancyIndex # noqa: F401
[ 6738, 764, 4871, 7483, 62, 48553, 1330, 3115, 16149, 9487, 7483, 3041, 2768, 3883, 15732, 220, 1303, 645, 20402, 25, 376, 21844, 198, 6738, 764, 8019, 82, 14761, 62, 71, 1134, 1330, 7980, 50, 14761, 39, 1134, 3041, 2768, 3883, 15732, ...
2.918367
49
"""A helper class to encrypt and decrypt passwords. Example and documentation provided at the link below is pre-req for understanding this helper. https://www.dlitz.net/software/pycrypto/api/current/Crypto.Cipher.AES-module.html Some key points from the documentation: The block size determines the AES key size: 16 ...
[ 37811, 32, 31904, 1398, 284, 34117, 290, 42797, 21442, 13, 198, 198, 16281, 290, 10314, 2810, 379, 262, 2792, 2174, 318, 662, 12, 42180, 329, 198, 4625, 5646, 428, 31904, 13, 198, 198, 5450, 1378, 2503, 13, 25404, 4224, 13, 3262, 14, ...
3.283109
1,042
"""NLP Preprocessing Pipeline.""" # Import libraries import nltk import numpy as np from nltk.stem.porter import PorterStemmer # Instantiate stemmer stemmer = PorterStemmer() # Tokenize function def tokenize(sentence): """Take a sentence and break it into individual linguistic units. :param:...
[ 37811, 45, 19930, 3771, 36948, 37709, 526, 15931, 201, 198, 201, 198, 2, 17267, 12782, 201, 198, 11748, 299, 2528, 74, 201, 198, 11748, 299, 32152, 355, 45941, 201, 198, 6738, 299, 2528, 74, 13, 927, 13, 26634, 1330, 20890, 1273, 368,...
2.620424
519
from argparse import ArgumentParser import csv import logging import os import urllib from wolkenatlas import constants parser = ArgumentParser() parser.add_argument('-m', '--vector-model', type=str, help='vector model to use.', required=True, choices=['fasttext', ...
[ 6738, 1822, 29572, 1330, 45751, 46677, 198, 11748, 269, 21370, 198, 11748, 18931, 198, 11748, 28686, 198, 11748, 2956, 297, 571, 198, 198, 6738, 266, 349, 3464, 265, 21921, 1330, 38491, 198, 198, 48610, 796, 45751, 46677, 3419, 198, 48610...
2.096497
2,798
s = "bobbobob" count = 0 for i in range(len(s)-2): if s[i:i+3] == "bob": count += 1 print("Number of times bob occurs is: " + str(count))
[ 82, 796, 366, 65, 21963, 672, 672, 1, 201, 198, 9127, 796, 657, 201, 198, 201, 198, 1640, 1312, 287, 2837, 7, 11925, 7, 82, 13219, 17, 2599, 201, 198, 220, 220, 220, 611, 264, 58, 72, 25, 72, 10, 18, 60, 6624, 366, 65, 672, ...
2
80
from nastranpy.bdf.cards.card import Card
[ 6738, 299, 459, 2596, 9078, 13, 65, 7568, 13, 27761, 13, 9517, 1330, 5172, 628 ]
2.866667
15
from lxml import etree from proxypool.schemas.proxy import Proxy from proxypool.crawlers.base import BaseCrawler BASE_URL = "http://www.xiladaili.com/" MAX_PAGE = 5 class XiladailiCrawler(BaseCrawler): """ xiladaili crawler, http://www.xiladaili.com/ """ urls = ["http://www.xiladaili.com/"] de...
[ 6738, 300, 19875, 1330, 2123, 631, 198, 198, 6738, 14793, 4464, 970, 13, 1416, 4411, 292, 13, 36436, 1330, 38027, 198, 6738, 14793, 4464, 970, 13, 66, 1831, 8116, 13, 8692, 1330, 7308, 34, 39464, 628, 198, 33, 11159, 62, 21886, 796, ...
2.112565
382
import sys if len(sys.argv) != 2: print("Cantidad errónea de argumentos.") print("\nUSO: checker.py archivo_a_comprobar.txt") exit(3) # Abro los archivos de configuración arr_file_pointers = [] for i in range(1, 5): try: arr_file_pointers.append(open("LSD/%02i.txt" % (i), "rt", ...
[ 11748, 25064, 628, 628, 628, 198, 198, 361, 18896, 7, 17597, 13, 853, 85, 8, 14512, 362, 25, 198, 220, 220, 220, 3601, 7203, 34, 415, 32482, 11454, 10205, 39718, 390, 4578, 418, 19570, 198, 220, 220, 220, 3601, 7203, 59, 77, 2937, ...
2.125676
740
#!/usr/bin/python3 a = bytearray(b'\xFB\x00\x00\x3E\x00\x0B\x00\x36\x00\x01\x00\x02\x00\x03\x00\x00') b = bytearray(b'\xFB\x00\x00\x3E\x00\x0B\x00\x36\x00\x01\x00\x02\x00\x03\x00\x00') if a != b: print("different") else: print("equal")
[ 2, 48443, 14629, 14, 8800, 14, 29412, 18, 198, 198, 64, 796, 416, 83, 451, 2433, 7, 65, 6, 59, 87, 26001, 59, 87, 405, 59, 87, 405, 59, 87, 18, 36, 59, 87, 405, 59, 87, 15, 33, 59, 87, 405, 59, 87, 2623, 59, 87, 405, 59,...
1.56051
157
from __future__ import division, absolute_import from __future__ import print_function, unicode_literals import numpy as np import pylab import matplotlib import du from .plot_training_curves import plot_training_curves # TODO factor out pylab.show() into a global setting to flip between # saving a figure, showing,...
[ 6738, 11593, 37443, 834, 1330, 7297, 11, 4112, 62, 11748, 198, 6738, 11593, 37443, 834, 1330, 3601, 62, 8818, 11, 28000, 1098, 62, 17201, 874, 198, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 279, 2645, 397, 198, 11748, 2603, 29487,...
1.898354
1,397
import json import os from dynamicdns.models import Error, ConfigProvider from dynamicdns.aws.boto3wrapper import Boto3Wrapper
[ 11748, 33918, 198, 11748, 28686, 198, 198, 6738, 8925, 67, 5907, 13, 27530, 1330, 13047, 11, 17056, 29495, 198, 6738, 8925, 67, 5907, 13, 8356, 13, 65, 2069, 18, 48553, 1330, 347, 2069, 18, 36918, 2848, 628, 198 ]
3.421053
38
import numpy as np import pandas
[ 11748, 299, 32152, 355, 45941, 198, 11748, 19798, 292, 198 ]
3.3
10
#!/usr/bin/env python3 # https://www.hackerrank.com/challenges/finding-the-percentage/problem n = int(input()) gradebook = {line[0]: list(map(float, line[1:])) for line in [input().split() for _ in range(n)]} print('{:.2f}'.format(sum(gradebook[input()])/3))
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 198, 2, 3740, 1378, 2503, 13, 31153, 8056, 962, 13, 785, 14, 36747, 34120, 14, 41070, 12, 1169, 12, 25067, 496, 14, 45573, 198, 198, 77, 796, 493, 7, 15414, 28955, 198, 9526, 2...
2.594059
101
#!/usr/bin/env python # vim: noet:ts=4:sts=4:sw=4 import unittest import functools import pprint from .dispatch import introspect_function from .dispatch import function_accepts_args from .dispatch import Handler from .dispatch import Dispatcher # TEST: demonstrate the use of legacy Handler class TestHandler(unitte...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 2, 43907, 25, 645, 316, 25, 912, 28, 19, 25, 6448, 28, 19, 25, 2032, 28, 19, 198, 198, 11748, 555, 715, 395, 198, 11748, 1257, 310, 10141, 198, 11748, 279, 4798, 198, 198, 6738, ...
3.318627
612
import numpy as np from pydrake.all import VectorSystem
[ 11748, 299, 32152, 355, 45941, 198, 6738, 279, 5173, 33788, 13, 439, 1330, 20650, 11964 ]
3.666667
15
# ------------------------------------------------------------------------- # # Part of the CodeChecker project, under the Apache License v2.0 with # LLVM Exceptions. See LICENSE for license information. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception # # ---------------------------------------------------...
[ 2, 16529, 45537, 198, 2, 198, 2, 220, 2142, 286, 262, 6127, 9787, 263, 1628, 11, 739, 262, 24843, 13789, 410, 17, 13, 15, 351, 198, 2, 220, 27140, 15996, 1475, 11755, 13, 4091, 38559, 24290, 329, 5964, 1321, 13, 198, 2, 220, 30628...
2.155198
4,665
""" View functions for routes in the blueprint for '/<program>' paths. """ import json import uuid import flask import sqlalchemy import yaml from sheepdog import auth from sheepdog import dictionary from sheepdog import models from sheepdog import utils from sheepdog.blueprint.routes.views.program import project fr...
[ 37811, 198, 7680, 5499, 329, 11926, 287, 262, 30881, 329, 31051, 27, 23065, 29, 6, 13532, 13, 198, 37811, 198, 198, 11748, 33918, 198, 11748, 334, 27112, 198, 198, 11748, 42903, 198, 11748, 44161, 282, 26599, 198, 11748, 331, 43695, 198...
2.227116
3,474
# -*- coding: utf-8 -*- """ Created on Fri Apr 27 08:38:10 2018 @author: Lionel Massoulard """ from inspect import signature import networkx as nx from aikit.enums import StepCategories from aikit.ml_machine import hyper_parameters as hp from aikit.model_definition import DICO_NAME_KLASS from aikit.tools.graph_help...
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 37811, 198, 41972, 319, 19480, 2758, 2681, 8487, 25, 2548, 25, 940, 2864, 198, 198, 31, 9800, 25, 44286, 5674, 2852, 446, 198, 37811, 198, 198, 6738, 10104, 1330, 9877, ...
2.297244
1,524
from flask import render_template, redirect, request, session, Blueprint from flask import Flask,current_app from flask import g from flask import Response from flask import abort blueprint = Blueprint response = Response request = request redirect = redirect abort = abort render_template = render_template session = s...
[ 6738, 42903, 1330, 8543, 62, 28243, 11, 18941, 11, 2581, 11, 6246, 11, 39932, 198, 6738, 42903, 1330, 46947, 11, 14421, 62, 1324, 198, 6738, 42903, 1330, 308, 198, 6738, 42903, 1330, 18261, 198, 6738, 42903, 1330, 15614, 198, 198, 17585...
4.041237
97
import uuid from flask_restful import Resource, reqparse, abort, fields, marshal_with, marshal from App.models.movie_user import MovieUser from App.apis.movie_user.model_utils import get_user from App.apis.api_constant import HTTP_CREATE_SUCCESS, USER_ACTION_LOGIN, USER_ACTION_REGISTER, HTTP_SUCCESS from App.ext impor...
[ 11748, 334, 27112, 198, 198, 6738, 42903, 62, 2118, 913, 1330, 20857, 11, 43089, 29572, 11, 15614, 11, 7032, 11, 22397, 282, 62, 4480, 11, 22397, 282, 198, 6738, 2034, 13, 27530, 13, 41364, 62, 7220, 1330, 15875, 12982, 198, 6738, 203...
2.461378
479
from cs1robots import * import time load_world("worlds/rain1.wld") hubo=Robot(beepers=6 , avenue=3 , street=6 , orientation="S") hubo.set_trace("red") hubo.set_pause(0.02) time.sleep(1) hubo.drop_beeper() hubo.move() while not hubo.on_beeper(): if hubo.right_is_clear(): hubo.drop_beeper() hubo.move(...
[ 6738, 50115, 16, 22609, 1747, 1330, 1635, 198, 11748, 640, 198, 2220, 62, 6894, 7203, 6894, 82, 14, 3201, 16, 13, 86, 335, 4943, 198, 40140, 78, 28, 14350, 313, 7, 1350, 538, 364, 28, 21, 837, 36132, 28, 18, 837, 4675, 28, 21, 8...
2.029126
206
filename = 'C:/Users/江淼/Desktop/2019train/converter/tensorflow_model/converted.pb' print_graph_nodes(filename)
[ 198, 34345, 796, 705, 34, 14079, 14490, 14, 162, 109, 253, 162, 115, 120, 14, 36881, 14, 23344, 27432, 14, 1102, 332, 353, 14, 83, 22854, 11125, 62, 19849, 14, 1102, 13658, 13, 40842, 6, 198, 4798, 62, 34960, 62, 77, 4147, 7, 3434...
2.434783
46
REQUIRED_CONFIG = [ ("twitch", "clientid"), ("twitch", "secret"), ("streamers",), ]
[ 2200, 10917, 37819, 62, 10943, 16254, 796, 685, 198, 220, 220, 220, 5855, 31844, 1600, 366, 16366, 312, 12340, 198, 220, 220, 220, 5855, 31844, 1600, 366, 21078, 12340, 198, 220, 220, 220, 5855, 5532, 364, 1600, 828, 198, 60, 198 ]
2.341463
41
import networkx as nx import numpy as np import math from tqdm import tqdm from . import helperfunctions as hf class mf_ising_system(): """ A class to calculate mean field Ising Maximisation Influence problem for a single agent. ... Attributes ---------- graph : networkx graph ...
[ 198, 11748, 3127, 87, 355, 299, 87, 220, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 10688, 220, 220, 198, 6738, 256, 80, 36020, 1330, 256, 80, 36020, 628, 198, 198, 6738, 764, 1330, 31904, 12543, 2733, 355, 289, 69, 628, 198, 4...
2.092557
8,330
"""Installation script for f90nml. Additional configuration settings are in ``setup.cfg``. :copyright: Copyright 2014 Marshall Ward, see AUTHORS for details. :license: Apache License, Version 2.0, see LICENSE for details. """ import os import sys try: from setuptools import setup from setuptools import Comma...
[ 37811, 30838, 4226, 329, 277, 3829, 77, 4029, 13, 198, 198, 17699, 8398, 6460, 389, 287, 7559, 40406, 13, 37581, 15506, 13, 198, 198, 25, 22163, 4766, 25, 15069, 1946, 13606, 12150, 11, 766, 37195, 20673, 329, 3307, 13, 198, 25, 43085...
2.749275
690
import ast import _ast from nimoy.ast_tools.feature_blocks import FeatureBlockTransformer from nimoy.ast_tools.feature_blocks import FeatureBlockRuleEnforcer
[ 11748, 6468, 198, 11748, 4808, 459, 198, 6738, 299, 320, 726, 13, 459, 62, 31391, 13, 30053, 62, 27372, 1330, 27018, 12235, 8291, 16354, 198, 6738, 299, 320, 726, 13, 459, 62, 31391, 13, 30053, 62, 27372, 1330, 27018, 12235, 31929, 48...
3.613636
44
import os import sys import pickle import time import numpy as np import pandas as pd import torch import matplotlib.pyplot as plt from matplotlib.ticker import MultipleLocator import matplotlib.gridspec as gridspec from matplotlib.ticker import FormatStrFormatter EXPS = ['rosenbrock_D20'] ALGORITHMS = ['sphereboth',...
[ 11748, 28686, 198, 11748, 25064, 198, 11748, 2298, 293, 198, 11748, 640, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 19798, 292, 355, 279, 67, 198, 11748, 28034, 198, 11748, 2603, 29487, 8019, 13, 9078, 29487, 355, 458, 83, 198, 673...
2.576208
269
from django.core.cache.backends.base import BaseCache, InvalidCacheBackendError from django.core.exceptions import ImproperlyConfigured from django.utils import importlib from django.utils.encoding import smart_unicode, smart_str from django.utils.datastructures import SortedDict try: import cPickle as pickle exce...
[ 6738, 42625, 14208, 13, 7295, 13, 23870, 13, 1891, 2412, 13, 8692, 1330, 7308, 30562, 11, 17665, 30562, 7282, 437, 12331, 198, 6738, 42625, 14208, 13, 7295, 13, 1069, 11755, 1330, 12205, 525, 306, 16934, 1522, 198, 6738, 42625, 14208, 1...
2.703533
651
import pandas as pd import os import re import json import numpy as np from load import load_embedding # data_dir = os.path.join(os.path.dirname(__file__), '../../../data') data_dir = os.path.join(os.path.dirname(__file__), '..\\..\\data\\external') # data_dir = os.path.join(os.path.dirname(__file__), '..\\..\\data') ...
[ 11748, 19798, 292, 355, 279, 67, 198, 11748, 28686, 198, 11748, 302, 198, 11748, 33918, 198, 11748, 299, 32152, 355, 45941, 198, 6738, 3440, 1330, 3440, 62, 20521, 12083, 198, 198, 2, 1366, 62, 15908, 796, 28686, 13, 6978, 13, 22179, ...
2.637097
124
import pytest def test_device_stack(api): """Test device dual stack functionality """ config = api.config() p1, p2 = config.ports.port(name='p1').port(name='p2') d = config.devices.device(name='d')[-1] e = d.ethernets.ethernet()[-1] e.port_name = p1.name e.name = 'e' e.mac = '00:01...
[ 11748, 12972, 9288, 628, 198, 4299, 1332, 62, 25202, 62, 25558, 7, 15042, 2599, 198, 220, 220, 220, 37227, 14402, 3335, 10668, 8931, 11244, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 4566, 796, 40391, 13, 11250, 3419, 198, 220, 22...
1.795918
686
""" @author: A. G. Sreejith """ ######################################### ### Import Libraries and Functions ######################################### import os import numpy as np import astropy.modeling.functional_models as am import csc_functions as csc from astropy.io import ascii import scipy.speci...
[ 37811, 201, 198, 31, 9800, 25, 317, 13, 402, 13, 311, 631, 73, 342, 201, 198, 37811, 201, 198, 201, 198, 29113, 7804, 2, 201, 198, 21017, 220, 220, 220, 17267, 46267, 290, 40480, 201, 198, 29113, 7804, 2, 201, 198, 11748, 28686, 2...
1.927649
1,935
"""Tests the collector module.""" import unittest from .mock import MockBackend from .. import collector from ..abc_backend import ( ACTIVITY_TEMPLATE_DEFINITION, ServiceColorTemplateEntity, ) class TestCollectorDataStore(unittest.TestCase): """CollectorDataStore tests""" def test_init(self) -> Non...
[ 198, 37811, 51, 3558, 262, 22967, 8265, 526, 15931, 198, 198, 11748, 555, 715, 395, 198, 6738, 764, 76, 735, 1330, 44123, 7282, 437, 198, 6738, 11485, 1330, 22967, 198, 6738, 11485, 39305, 62, 1891, 437, 1330, 357, 198, 220, 220, 220,...
1.760041
1,942
from ovf import OvfFile import os import numpy as np import random import copy
[ 6738, 19643, 69, 1330, 46941, 69, 8979, 198, 11748, 28686, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 4738, 198, 11748, 4866, 628 ]
3.478261
23
# Implementar dicho métodos para obtener la segmentación de una imagen import cv2 import numpy as np import matplotlib.pyplot as plt import matplotlib.lines as mlines from PIL import Image, ImageOps A = imageToArray("imagen4.jpg") plt.subplot(2, 4, 1) plt.title('Imagen Original') plt.imshow(A, cmap='gray') m, n = A....
[ 2, 48282, 283, 36638, 78, 285, 25125, 375, 418, 31215, 909, 83, 877, 8591, 10618, 32009, 18840, 390, 555, 64, 3590, 268, 198, 11748, 269, 85, 17, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 2603, 29487, 8019, 13, 9078, 29487, 355,...
2.022514
1,066
# -*- coding: utf-8 -*- """ Created on Fri Dec 18 22:59:59 2020 @author: Christian """ import numpy as np import matplotlib.pyplot as plt # fig, ax = plt.subplots() # function to be omptimzied def fitness(individual, Environment): """ In this case getting fitness from our result is trivial """ ...
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 37811, 198, 41972, 319, 19480, 4280, 1248, 2534, 25, 3270, 25, 3270, 12131, 198, 198, 31, 9800, 25, 4302, 198, 37811, 628, 198, 11748, 299, 32152, 355, 45941, 198, 11748...
2.816794
131
import tkinter as tk from query_main import Query root = tk.Tk() root.title('SER 531 Team 6 - Q.A.L.D.') def returnEntry(arg=None): """Gets the result from Entry and return it to the Label""" q = Query() result = myEntry.get() parsed_result = q.parse(result) resultLabel.config(text=parsed_result)...
[ 11748, 256, 74, 3849, 355, 256, 74, 198, 6738, 12405, 62, 12417, 1330, 43301, 198, 198, 15763, 796, 256, 74, 13, 51, 74, 3419, 198, 15763, 13, 7839, 10786, 35009, 642, 3132, 4816, 718, 532, 1195, 13, 32, 13, 43, 13, 35, 2637, 8, ...
2.433333
480
# -*- coding: utf-8 -*- # Author: Hao Xiang <haxiang@g.ucla.edu> # License: TDG-Attribution-NonCommercial-NoDistrib import math import torch import torch.nn as nn import torch.nn.functional as F def conv3x3(in_planes, out_planes, stride=1, bias=False): """3x3 convolution with padding""" return nn.Conv2d(in...
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 2, 6434, 25, 367, 5488, 45641, 1279, 71, 897, 15483, 31, 70, 13, 36616, 64, 13, 15532, 29, 198, 2, 13789, 25, 13320, 38, 12, 8086, 3890, 12, 15419, 48401, 12, 2949, ...
2.625628
398
print('='*8,'Lista de Convidados','='*8) from module import interface from time import sleep lc = [] while True: interface.menu('Menu Principal') op = interface.options('Adicionar convidados', 'Ver lista de convidados', 'Sair do Programa') if op == 1: while True: sleep(1) in...
[ 4798, 10786, 11639, 9, 23, 4032, 8053, 64, 390, 1482, 16921, 22484, 41707, 11639, 9, 23, 8, 198, 6738, 8265, 1330, 7071, 198, 6738, 640, 1330, 3993, 198, 198, 44601, 796, 17635, 198, 4514, 6407, 25, 198, 220, 220, 220, 7071, 13, 262...
1.922101
552
#sortear a ordem dos alunos import random n1 = input('aluno 1: ') n2 = input('aluno 2: ') n3 = input('aluno 3: ') n4 = input('aluno 4: ') l = [n1, n2, n3, n4] random.shuffle(l) print('a ordem é {}'.format(l))
[ 2, 30619, 451, 257, 2760, 368, 23430, 435, 403, 418, 198, 11748, 4738, 198, 77, 16, 796, 5128, 10786, 282, 36909, 352, 25, 705, 8, 198, 77, 17, 796, 5128, 10786, 282, 36909, 362, 25, 705, 8, 198, 77, 18, 796, 5128, 10786, 282, 3...
2.122449
98
#!/usr/bin/python # ============================================================================== # Author: Tao Li (taoli@ucsd.edu) # Date: May 30, 2015 # Question: 120-Triangle # Link: https://leetcode.com/problems/triangle/ # ============================================================================== # ...
[ 2, 48443, 14629, 14, 8800, 14, 29412, 198, 2, 38093, 25609, 28, 198, 2, 6434, 25, 220, 220, 32120, 7455, 357, 8326, 11106, 31, 1229, 21282, 13, 15532, 8, 198, 2, 7536, 25, 220, 220, 220, 220, 1737, 1542, 11, 1853, 198, 2, 18233, ...
3.346479
355
from gcn.dataset_readers.reader import GCN_reader
[ 6738, 308, 31522, 13, 19608, 292, 316, 62, 961, 364, 13, 46862, 1330, 20145, 45, 62, 46862, 198 ]
2.777778
18
import qbittorrentapi from qbittorrentapi import TorrentStates from bgmi import config from bgmi.plugin.download import BaseDownloadService, DownloadStatus
[ 11748, 10662, 65, 715, 273, 1156, 15042, 198, 6738, 10662, 65, 715, 273, 1156, 15042, 1330, 43399, 42237, 198, 198, 6738, 275, 70, 11632, 1330, 4566, 198, 6738, 275, 70, 11632, 13, 33803, 13, 15002, 1330, 7308, 10002, 16177, 11, 10472, ...
3.674419
43
import os, sys sys.path.insert(0, os.path.abspath('../../')) from astromlp import __version__ # Project information project = 'astromlp' copyright = '2022, Nuno Ramos Carvalho' author = 'Nuno Ramos Carvalho' version = __version__ # General configuration extensions = ['sphinx.ext.autodoc', 'sphinx.ext.napoleon'...
[ 198, 11748, 28686, 11, 25064, 198, 198, 17597, 13, 6978, 13, 28463, 7, 15, 11, 28686, 13, 6978, 13, 397, 2777, 776, 10786, 40720, 40720, 6, 4008, 198, 198, 6738, 6468, 398, 34431, 1330, 11593, 9641, 834, 628, 198, 2, 4935, 1321, 198...
2.698413
189
import os from BUG.Layers.Layer import Pooling from BUG.load_package import p import numpy # 梯度裁剪
[ 11748, 28686, 198, 198, 6738, 347, 7340, 13, 43, 6962, 13, 49925, 1330, 19850, 278, 198, 6738, 347, 7340, 13, 2220, 62, 26495, 1330, 279, 198, 11748, 299, 32152, 628, 628, 628, 198, 2, 220, 10545, 95, 107, 41753, 99, 32518, 223, 302...
2.355556
45
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2020/12/10 20:22 # @Author : uyplayer # @Site : uyplayer.pw # @File : nn_tutorial.py # @Software: PyCharm # https://pytorch.org/tutorials/beginner/nn_tutorial.html # dependency library import numpy as np import pandas as pd import math im...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 201, 198, 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 201, 198, 2, 2488, 7575, 220, 220, 220, 1058, 12131, 14, 1065, 14, 940, 1160, 25, 1828, 201, 198, 2, 2488, 13838, 2...
2.302738
621
from enum import Enum
[ 6738, 33829, 1330, 2039, 388 ]
4.2
5
import tensorflow as tf import numpy as np from collections import deque import random,sys NUM_CHANNELS = 4 # image channels IMAGE_SIZE = 84 # 84x84 pixel images SEED = 17 # random initialization seed NUM_ACTIONS = 4 # number of actions for this game BATCH_SIZE = 32 INITIAL_EPSILON = 1.0 GAMMA = 0.99 RMS_LEARNING_...
[ 11748, 11192, 273, 11125, 355, 48700, 198, 11748, 299, 32152, 355, 45941, 198, 6738, 17268, 1330, 390, 4188, 198, 11748, 4738, 11, 17597, 198, 198, 41359, 62, 3398, 22846, 37142, 796, 604, 220, 1303, 2939, 9619, 198, 3955, 11879, 62, 33...
2.443299
194
__author__ = 'Kalyan' # Score you will get if you pass all the tests. max_marks = 25 problem1_notes = ''' Find the highest common factor of 2 positive numbers which are given in their prime factorized form defined in problem1 You must return the result in a valid prime factorized form as described in problem1. Inval...
[ 834, 9800, 834, 796, 705, 42, 3400, 272, 6, 198, 198, 2, 15178, 345, 481, 651, 611, 345, 1208, 477, 262, 5254, 13, 198, 9806, 62, 14306, 796, 1679, 198, 198, 45573, 16, 62, 17815, 796, 705, 7061, 198, 16742, 262, 4511, 2219, 5766,...
3.718062
227
#!/usr/bin/env python import os import joblib import argparse from PIL import Image from util import draw_bb_on_img from constants import MODEL_PATH from face_recognition import preprocessing if __name__ == '__main__': main()
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 198, 11748, 28686, 198, 11748, 1693, 8019, 198, 11748, 1822, 29572, 198, 6738, 350, 4146, 1330, 7412, 198, 6738, 7736, 1330, 3197, 62, 11848, 62, 261, 62, 9600, 198, 6738, 38491, 1330, ...
3.146667
75
# SPDX-FileCopyrightText: 2017 Radomir Dopieralski for Adafruit Industries # # SPDX-License-Identifier: MIT """ `adafruit_rgb_display.rgb` ==================================================== Base class for all RGB Display devices * Author(s): Radomir Dopieralski, Michael McWethy """ import time try: import nu...
[ 2, 30628, 55, 12, 8979, 15269, 8206, 25, 2177, 5325, 296, 343, 360, 404, 959, 874, 4106, 329, 1215, 1878, 4872, 20171, 198, 2, 198, 2, 30628, 55, 12, 34156, 12, 33234, 7483, 25, 17168, 198, 198, 37811, 198, 63, 324, 1878, 4872, 62...
2.25283
3,710
from .vgg16 import VGG16Partitioned from .stage0 import Stage0 from .stage1 import Stage1
[ 6738, 764, 85, 1130, 1433, 1330, 569, 11190, 1433, 7841, 653, 276, 198, 6738, 764, 14247, 15, 1330, 15371, 15, 198, 6738, 764, 14247, 16, 1330, 15371, 16, 198 ]
3.103448
29
import tempfile from json import dumps import requests from langdetect import DetectorFactory from langdetect.lang_detect_exception import LangDetectException from django.conf import settings from urllib.parse import urlparse from urlextract import URLExtract from openbook.settings import ALERT_HOOK_URL from openbook...
[ 11748, 20218, 7753, 198, 6738, 33918, 1330, 45514, 198, 198, 11748, 7007, 198, 6738, 42392, 15255, 478, 1330, 4614, 9250, 22810, 198, 6738, 42392, 15255, 478, 13, 17204, 62, 15255, 478, 62, 1069, 4516, 1330, 16332, 47504, 16922, 198, 6738...
3.110032
309
from utils.utils import * from utils.textJustification import textJustification from bs4 import BeautifulSoup from pathlib import Path def __findAttr(s, i): """gone back till a namespace and returns the word in between""" l = "" i -= 1 while s[i] != " ": l = "".join((l, s[i])) i -=...
[ 6738, 3384, 4487, 13, 26791, 1330, 1635, 198, 6738, 3384, 4487, 13, 5239, 5703, 2649, 1330, 2420, 5703, 2649, 198, 6738, 275, 82, 19, 1330, 23762, 50, 10486, 198, 6738, 3108, 8019, 1330, 10644, 628, 628, 628, 198, 4299, 11593, 19796, ...
1.988466
867
# coding: utf-8 # # Copyright 2013 Google Inc. 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 ...
[ 2, 19617, 25, 3384, 69, 12, 23, 198, 2, 198, 2, 15069, 2211, 3012, 3457, 13, 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,...
3.024803
887
from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import sys import tensorflow as tf os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' # mute low-priority warnings from below line from tensorflow.examples.tutorials.mnist import input_data import numpy as np...
[ 6738, 11593, 37443, 834, 1330, 4112, 62, 11748, 198, 6738, 11593, 37443, 834, 1330, 7297, 198, 6738, 11593, 37443, 834, 1330, 3601, 62, 8818, 198, 198, 11748, 28686, 198, 11748, 25064, 198, 198, 11748, 11192, 273, 11125, 355, 48700, 198, ...
2.344648
766
from typing import List from .mcts import GameInterface, GameState from .quarto_logic import Quarto, State class QuartoState(Quarto): """class inheriting both class"""
[ 6738, 19720, 1330, 7343, 198, 6738, 764, 76, 310, 82, 1330, 3776, 39317, 11, 3776, 9012, 198, 6738, 764, 36008, 78, 62, 6404, 291, 1330, 48748, 78, 11, 1812, 198, 198, 4871, 48748, 78, 9012, 7, 4507, 433, 78, 2599, 198, 220, 220, ...
3.372549
51
from django.contrib import admin from .models import AddProduct from .models import OrderProduct # Register your models here. admin.site.register(AddProduct) admin.site.register(OrderProduct)
[ 6738, 42625, 14208, 13, 3642, 822, 1330, 13169, 201, 198, 6738, 764, 27530, 1330, 3060, 15667, 201, 198, 6738, 764, 27530, 1330, 8284, 15667, 201, 198, 2, 17296, 534, 4981, 994, 13, 201, 198, 28482, 13, 15654, 13, 30238, 7, 4550, 1566...
3.535714
56
import warnings from copy import copy from collections import defaultdict from typing import Union, Sequence, TYPE_CHECKING from avalanche.training.plugins.strategy_plugin import StrategyPlugin if TYPE_CHECKING: from avalanche.evaluation import PluginMetric from avalanche.logging import StrategyLogger from...
[ 11748, 14601, 198, 6738, 4866, 1330, 4866, 198, 6738, 17268, 1330, 4277, 11600, 198, 6738, 19720, 1330, 4479, 11, 45835, 11, 41876, 62, 50084, 2751, 198, 6738, 44128, 13, 34409, 13, 37390, 13, 2536, 4338, 62, 33803, 1330, 20561, 37233, ...
2.611921
1,577
import unittest import numpy as np import faiss ''' Converts the tutorial: https://github.com/facebookresearch/faiss/wiki/Getting-started for FAISS (Facebook AI Similarity Search) to a unittest to ensure FAISS is set up correctly on the machine. ''' DIMENSIONS = 64 DATABASE_SIZE = 100000 NUM_QUERIES = 10000 FIXED_SEE...
[ 11748, 555, 715, 395, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 24685, 747, 198, 198, 7061, 6, 198, 3103, 24040, 262, 11808, 25, 3740, 1378, 12567, 13, 785, 14, 19024, 34033, 14, 13331, 747, 14, 15466, 14, 20570, 12, 46981, 198,...
2.626582
158
from .base import * ObjectTypes.add_type("cone", "Cone") PropertyPanel.add_properties("cone", ConeProperties)
[ 6738, 764, 8692, 1330, 1635, 628, 198, 198, 10267, 31431, 13, 2860, 62, 4906, 7203, 49180, 1600, 366, 34, 505, 4943, 198, 21746, 26639, 13, 2860, 62, 48310, 7203, 49180, 1600, 327, 505, 2964, 18200, 8, 198 ]
3.054054
37
import unittest import lipsum import math if __name__ == '__main__': unittest.main()
[ 11748, 555, 715, 395, 198, 11748, 11914, 388, 198, 11748, 10688, 198, 198, 361, 11593, 3672, 834, 6624, 705, 834, 12417, 834, 10354, 198, 220, 220, 220, 555, 715, 395, 13, 12417, 3419, 198 ]
2.647059
34