content
stringlengths
1
1.04M
input_ids
listlengths
1
774k
ratio_char_token
float64
0.38
22.9
token_count
int64
1
774k
#!/usr/bin/env python #-*- coding: UTF-8 -*- import os import time import subprocess import shutil import sys os.chdir(sys.path[0]) print(os.getcwd()) cacheFolder = os.getcwd() + "/temp/" cacheFile = cacheFolder + "temp" caches = [] generalSize = "640X640" if(len(sys.argv) > 1) : wishSize = 640 * int(sys.argv[1]...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 2, 12, 9, 12, 19617, 25, 41002, 12, 23, 532, 9, 12, 198, 11748, 28686, 198, 11748, 640, 198, 11748, 850, 14681, 198, 11748, 4423, 346, 198, 11748, 25064, 198, 198, 418, 13, 354, 15...
2.352632
190
# Note taken from --> https://gist.github.com/JungeAlexander/6ce0a5213f3af56d7369 & https://stackoverflow.com/questions/714063/importing-modules-from-parent-folder/11158224#11158224 import os, sys, inspect current_dir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) parent_dir = os.path.dirn...
[ 2, 220, 5740, 2077, 422, 14610, 3740, 1378, 70, 396, 13, 12567, 13, 785, 14, 22396, 469, 38708, 14, 21, 344, 15, 64, 4309, 1485, 69, 18, 1878, 3980, 67, 22, 30803, 1222, 3740, 1378, 25558, 2502, 11125, 13, 785, 14, 6138, 507, 14, ...
2.721774
248
from datetime import datetime from os.path import dirname, join import pytest from city_scrapers_core.constants import COMMISSION, PASSED, TENTATIVE from city_scrapers_core.utils import file_response from freezegun import freeze_time from scrapy.settings import Settings from city_scrapers.spiders.chi_ssa_23 import Ch...
[ 6738, 4818, 8079, 1330, 4818, 8079, 198, 6738, 28686, 13, 6978, 1330, 26672, 3672, 11, 4654, 198, 198, 11748, 12972, 9288, 198, 6738, 1748, 62, 1416, 2416, 364, 62, 7295, 13, 9979, 1187, 1330, 22240, 40373, 11, 41752, 1961, 11, 309, 3...
2.7325
400
import subprocess filename = "../data/crackdump-01.csv" read()
[ 198, 11748, 850, 14681, 198, 198, 34345, 796, 366, 40720, 7890, 14, 6098, 441, 39455, 12, 486, 13, 40664, 1, 198, 198, 961, 3419, 198 ]
2.64
25
import logging from base64 import b64encode from asn1crypto.cms import CMSAttribute, ContentInfo, IssuerAndSerialNumber from cryptography.hazmat.primitives.asymmetric import padding from .asn1 import SCEPCMSAttributeType from .cryptoutils import digest_for_data, decrypt, digest_function_for_type from .enums import M...
[ 11748, 18931, 198, 6738, 2779, 2414, 1330, 275, 2414, 268, 8189, 198, 6738, 355, 77, 16, 29609, 78, 13, 46406, 1330, 16477, 4090, 926, 4163, 11, 14041, 12360, 11, 10585, 15573, 1870, 32634, 15057, 198, 6738, 45898, 13, 71, 1031, 6759, ...
3.104294
163
import pytest from sort import * @pytest.mark.parametrize( "input,expected", [ pytest.param( [4], [4] ), pytest.param( [5, 7, 6, 4], [4, 5, 6, 7] ), ], ) @pytest.mark.parametrize( "input,expected", [ pytest.param( [4], ...
[ 11748, 12972, 9288, 198, 198, 6738, 3297, 1330, 1635, 628, 198, 31, 9078, 9288, 13, 4102, 13, 17143, 316, 380, 2736, 7, 198, 220, 220, 220, 366, 15414, 11, 40319, 1600, 198, 220, 220, 220, 685, 198, 220, 220, 220, 220, 220, 220, 2...
1.543981
432
""" Created on 26 Dec 2016 @author: Bruno Beloff (bruno.beloff@southcoastscience.com) https://learn.adafruit.com/setting-up-io-python-library-on-beaglebone-black/port """ import serial import time from scs_core.sys.serial import Serial from scs_host.lock.lock import Lock # ---------------------------------------...
[ 37811, 198, 41972, 319, 2608, 4280, 1584, 198, 198, 31, 9800, 25, 31045, 3944, 2364, 357, 1671, 36909, 13, 6667, 2364, 31, 35782, 1073, 5773, 4234, 13, 785, 8, 198, 198, 5450, 1378, 35720, 13, 324, 1878, 4872, 13, 785, 14, 33990, 12...
4.559524
252
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. import os from random import random, seed from bertsum.others.utils import test_rouge def get_rouge(predictions, targets, temp_dir, random_seed=42): """ function to get the rouge metric for the prediction and the reference. Args: ...
[ 2, 15069, 357, 66, 8, 5413, 10501, 13, 198, 2, 49962, 739, 262, 17168, 13789, 13, 198, 198, 11748, 28686, 198, 6738, 4738, 1330, 4738, 11, 9403, 198, 198, 6738, 275, 861, 16345, 13, 847, 82, 13, 26791, 1330, 1332, 62, 472, 469, 62...
2.784615
390
from flask import Flask from .extensions import db from .models import Tree app = Flask(__name__) db.init_app(app) db.app = app # Create dummy secrey key so we can use sessions app.config['SECRET_KEY'] = '123456790' # Create in-memory database # app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite://data.sqlite' from .v...
[ 6738, 42903, 1330, 46947, 198, 198, 6738, 764, 2302, 5736, 1330, 20613, 198, 6738, 764, 27530, 1330, 12200, 198, 198, 1324, 796, 46947, 7, 834, 3672, 834, 8, 198, 9945, 13, 15003, 62, 1324, 7, 1324, 8, 198, 9945, 13, 1324, 796, 598,...
2.810606
132
import torch # https://discuss.pytorch.org/t/covariance-and-gradient-support/16217
[ 11748, 28034, 198, 198, 2, 3740, 1378, 15410, 1046, 13, 9078, 13165, 354, 13, 2398, 14, 83, 14, 66, 709, 2743, 590, 12, 392, 12, 49607, 12, 11284, 14, 1433, 24591, 198 ]
2.625
32
from django.apps import AppConfig
[ 6738, 42625, 14208, 13, 18211, 1330, 2034, 16934, 628 ]
3.888889
9
# Copyright (c) 2009 Doug Hellmann All rights reserved. # """ """ # end_pymotw_header import compileall import sys sys.path[:] = ["examples", "notthere"] print("sys.path =", sys.path) compileall.compile_path()
[ 2, 15069, 357, 66, 8, 3717, 15115, 5783, 9038, 1439, 2489, 10395, 13, 198, 2, 198, 37811, 198, 37811, 198, 198, 2, 886, 62, 79, 4948, 313, 86, 62, 25677, 198, 11748, 17632, 439, 198, 11748, 25064, 198, 198, 17597, 13, 6978, 58, 47...
2.789474
76
import yaml import argparse from datasets import get_dataset from diffusion.trainers import get_trainer # The first arg parser parses out only the --config argument, this argument is used to # load a yaml file containing key-values that override the defaults for the main parser below config_parser = parser = argparse....
[ 11748, 331, 43695, 198, 11748, 1822, 29572, 198, 6738, 40522, 1330, 651, 62, 19608, 292, 316, 198, 6738, 44258, 13, 27432, 364, 1330, 651, 62, 2213, 10613, 198, 198, 2, 383, 717, 1822, 30751, 13544, 274, 503, 691, 262, 1377, 11250, 45...
3.037879
264
# # PySNMP MIB module CIENA-CES-ACL-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CIENA-CES-ACL-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 17:31:34 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Ma...
[ 2, 198, 2, 9485, 15571, 7378, 337, 9865, 8265, 14514, 45510, 12, 34, 1546, 12, 2246, 43, 12, 8895, 33, 357, 4023, 1378, 16184, 76, 489, 8937, 13, 785, 14, 79, 893, 11632, 8, 198, 2, 7054, 45, 13, 16, 2723, 2393, 1378, 14, 14490,...
2.313321
6,546
import argparse from functools import partial from multiprocessing import Pool from pathlib import Path from PIL import Image from tqdm import tqdm parser = argparse.ArgumentParser() parser.add_argument(dest='base_dir', type=Path) parser.add_argument(dest='out_dir', type=Path) args = parser.parse_args() if __name...
[ 11748, 1822, 29572, 198, 6738, 1257, 310, 10141, 1330, 13027, 198, 6738, 18540, 305, 919, 278, 1330, 19850, 198, 6738, 3108, 8019, 1330, 10644, 198, 198, 6738, 350, 4146, 1330, 7412, 198, 6738, 256, 80, 36020, 1330, 256, 80, 36020, 198,...
3.070175
114
import requests from helpers.logHelper import logger symbolNamePairs = { "BITCOIN": "BTC", "ETHEREUM": "ETH", "DOGECOIN": "DOGE", } setting = settings()
[ 11748, 7007, 201, 198, 6738, 49385, 13, 6404, 47429, 1330, 49706, 201, 198, 201, 198, 1837, 23650, 5376, 47, 3468, 796, 1391, 201, 198, 220, 220, 220, 366, 26094, 8220, 1268, 1298, 366, 35964, 1600, 201, 198, 220, 220, 220, 366, 20702...
2.125
88
"""Operation on Streams that leave the shape of the stream unchanged""" import numpy as np import pandas as pd from vmpy.utils import cast_array_to_original_type # FTP based 7-zones with left bind edge set to -0.001 POWER_ZONES_THRESHOLD = [-0.001, 0.55, 0.75, 0.9, 1.05, 1.2, 1.5, 10.0] POWER_ZONES_THRESHOLD_DESC = ...
[ 37811, 32180, 319, 13860, 82, 326, 2666, 262, 5485, 286, 262, 4269, 21588, 37811, 198, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 19798, 292, 355, 279, 67, 198, 6738, 410, 3149, 88, 13, 26791, 1330, 3350, 62, 18747, 62, 1462, 62,...
2.617109
2,186
from cms.plugin_base import CMSPluginBase from cms.plugin_pool import plugin_pool from cms.models.pluginmodel import CMSPlugin from django.utils.translation import ugettext_lazy as _ from cms.models import Page from django.conf import settings from django.contrib.sites.shortcuts import get_current_site from arividam.ut...
[ 6738, 269, 907, 13, 33803, 62, 8692, 1330, 40773, 37233, 14881, 198, 6738, 269, 907, 13, 33803, 62, 7742, 1330, 13877, 62, 7742, 198, 6738, 269, 907, 13, 27530, 13, 33803, 19849, 1330, 40773, 37233, 198, 6738, 42625, 14208, 13, 26791, ...
3.33758
157
import os import re import requests import subprocess filename = 'requirements.txt' new_packages = [] with open(filename, 'r') as file: pattern = '(.*) == (.*)' packages = re.findall(pattern, file.read()) for package, version in packages: response = requests.get(f'https://pypi.org/pypi...
[ 11748, 28686, 201, 198, 11748, 302, 201, 198, 11748, 7007, 201, 198, 11748, 850, 14681, 201, 198, 201, 198, 34345, 796, 705, 8897, 18883, 13, 14116, 6, 201, 198, 3605, 62, 43789, 796, 17635, 201, 198, 201, 198, 4480, 1280, 7, 34345, ...
2.175943
557
n = int(input()) num = list(map(int , input().split())) d,m = map(int , input().split()) c= 0 for i in range(0,n-m+1): d_ = 0 for j in range(0,m): d_ += num[i+j] if d_ == d: c += 1 print(c)
[ 77, 796, 493, 7, 15414, 28955, 198, 198, 22510, 796, 1351, 7, 8899, 7, 600, 837, 5128, 22446, 35312, 3419, 4008, 198, 198, 67, 11, 76, 796, 3975, 7, 600, 837, 5128, 22446, 35312, 28955, 198, 66, 28, 657, 198, 198, 1640, 1312, 287,...
1.85
120
from collections import namedtuple from functools import partial import pytest import torch from sklearn.metrics import accuracy_score from sklearn.metrics import r2_score as sk_r2score from tests.helpers import seed_all from tests.helpers.testers import BATCH_SIZE, NUM_BATCHES, NUM_CLASSES, MetricTester from torchme...
[ 6738, 17268, 1330, 3706, 83, 29291, 198, 6738, 1257, 310, 10141, 1330, 13027, 198, 198, 11748, 12972, 9288, 198, 11748, 28034, 198, 6738, 1341, 35720, 13, 4164, 10466, 1330, 9922, 62, 26675, 198, 6738, 1341, 35720, 13, 4164, 10466, 1330, ...
2.426897
1,621
import hashlib import json import logging import re import uuid from django.db import models from django.db.models.signals import pre_save from django.dispatch import receiver from oldp.apps.cases.models import Case from oldp.apps.laws.models import Law logger = logging.getLogger(__name__) class ReferenceMarker(mo...
[ 11748, 12234, 8019, 198, 11748, 33918, 198, 11748, 18931, 198, 11748, 302, 198, 11748, 334, 27112, 198, 198, 6738, 42625, 14208, 13, 9945, 1330, 4981, 198, 6738, 42625, 14208, 13, 9945, 13, 27530, 13, 12683, 874, 1330, 662, 62, 21928, 1...
2.85084
1,428
#!/usr/bin/env python3 import os if os.geteuid() != 0: exit('This script requires root privileges.\nPlease try again with sudo.')
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 198, 11748, 28686, 198, 361, 28686, 13, 1136, 12496, 312, 3419, 14512, 657, 25, 198, 220, 220, 220, 8420, 10786, 1212, 4226, 4433, 6808, 18850, 13, 59, 77, 5492, 1949, 757, 351, ...
2.956522
46
import argparse from pathlib import Path import typing import numpy as np import scipy.spatial.distance from encoder.inference import Model as EncoderModel from synthesizer.inference import Synthesizer _NUM_ENROLLMENTS = 3 _NUM_VERIFICATIONS = 5 _WAV_FODLER = Path('/Users/dalei/Downloads/VCTK-Corpus/wav48') _TXT_FO...
[ 11748, 1822, 29572, 198, 6738, 3108, 8019, 1330, 10644, 198, 198, 11748, 19720, 198, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 629, 541, 88, 13, 2777, 34961, 13, 30246, 198, 198, 6738, 2207, 12342, 13, 259, 4288, 1330, 9104, 355, ...
2.697297
185
## system-config-printer ## Copyright (C) 2008, 2011 Red Hat, Inc. ## Authors: ## Tim Waugh <twaugh@redhat.com> ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation; either version 2 of the Lice...
[ 2235, 1080, 12, 11250, 12, 1050, 3849, 198, 198, 2235, 15069, 357, 34, 8, 3648, 11, 2813, 2297, 10983, 11, 3457, 13, 198, 2235, 46665, 25, 198, 2235, 220, 5045, 370, 1567, 1279, 4246, 1567, 31, 445, 5183, 13, 785, 29, 198, 198, 22...
2.677966
649
import mock import time import redis from pyramid import testing from kinto.core.utils import sqlalchemy from kinto.core.storage import exceptions from kinto.core.cache import (CacheBase, postgresql as postgresql_backend, redis as redis_backend, memory as memory_backend, ...
[ 11748, 15290, 198, 11748, 640, 198, 198, 11748, 2266, 271, 198, 6738, 27944, 1330, 4856, 198, 198, 6738, 479, 20424, 13, 7295, 13, 26791, 1330, 44161, 282, 26599, 198, 6738, 479, 20424, 13, 7295, 13, 35350, 1330, 13269, 198, 6738, 479, ...
2.45977
174
# Copyright (c) 2020, Xilinx # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this # list of conditions and the follow...
[ 2, 15069, 357, 66, 8, 12131, 11, 1395, 346, 28413, 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, 3...
3.516393
488
from selenium import webdriver as seledriver class WebDriver(object): """ The base class for controlling the browser in the webbrowser class. Selenium Webdriver wrapper class. """ def __init__(self, options = None): """ Initialize Class Parameters ---- options: str|list arguments o...
[ 6738, 384, 11925, 1505, 1330, 3992, 26230, 355, 384, 992, 38291, 198, 198, 4871, 5313, 32103, 7, 15252, 2599, 198, 220, 37227, 198, 220, 383, 2779, 1398, 329, 12755, 262, 6444, 287, 262, 3992, 40259, 1398, 13, 198, 220, 15300, 47477, ...
2.75082
610
# -*- coding: utf-8 -*- from collections import defaultdict import click from mygeotab import API, dates from mygeotab.ext import feed @click.command(help="A console data feeder example") @click.argument("database", nargs=1, required=True) @click.option("--user", "-u", prompt=True, help="A MyGeotab username") @cl...
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 198, 6738, 17268, 1330, 4277, 11600, 198, 198, 11748, 3904, 198, 198, 6738, 616, 469, 313, 397, 1330, 7824, 11, 9667, 198, 6738, 616, 469, 313, 397, 13, 2302, 1330, 37...
2.818548
248
from config import Config import psycopg2 from psycopg2.extras import Json, DictCursor import pdb import pandas as pd import os import time import cv2 from gesture_recognition import featurizer def orchestrator(): """Pull frames with confidence, accurate predictions from database and use them to generate new model...
[ 6738, 4566, 1330, 17056, 198, 11748, 17331, 22163, 70, 17, 198, 6738, 17331, 22163, 70, 17, 13, 2302, 8847, 1330, 449, 1559, 11, 360, 713, 34, 21471, 198, 11748, 279, 9945, 198, 11748, 19798, 292, 355, 279, 67, 198, 11748, 28686, 198,...
2.404623
5,494
import nmap import sys import os import multiprocessing import socket from colorama import Fore, Back, Style scanner = nmap.PortScanner()
[ 11748, 299, 8899, 198, 11748, 25064, 198, 11748, 28686, 198, 11748, 18540, 305, 919, 278, 198, 11748, 17802, 198, 6738, 3124, 1689, 1330, 4558, 11, 5157, 11, 17738, 198, 198, 35836, 1008, 796, 299, 8899, 13, 13924, 33351, 1008, 3419, 62...
2.867925
53
# -*- coding: utf-8 -*- # Generated by Django 1.11.15 on 2018-11-22 14:09 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 2, 2980, 515, 416, 37770, 352, 13, 1157, 13, 1314, 319, 2864, 12, 1157, 12, 1828, 1478, 25, 2931, 198, 6738, 11593, 37443, 834, 1330, 28000, 1098, 62, 17201, 874, 198,...
2.753623
69
import re import time from datetime import datetime, timedelta def test_mode_replay(eventgen_test_helper): """Test normal replay mode settings""" events = eventgen_test_helper("eventgen_replay.conf").get_events() # assert the event length is the same as sample file size assert len(events) == 12 pa...
[ 11748, 302, 198, 11748, 640, 198, 6738, 4818, 8079, 1330, 4818, 8079, 11, 28805, 12514, 628, 198, 4299, 1332, 62, 14171, 62, 260, 1759, 7, 15596, 5235, 62, 9288, 62, 2978, 525, 2599, 198, 220, 220, 220, 37227, 14402, 3487, 24788, 4235...
2.685348
1,481
#!/usr/bin/env python # Invalidates CDNs so the caches are refreshed import boto3 import os import time
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 198, 2, 17665, 689, 6458, 47503, 523, 262, 50177, 389, 47193, 198, 198, 11748, 275, 2069, 18, 198, 11748, 28686, 198, 11748, 640, 628 ]
3.242424
33
import pandas as pd import pytest from powersimdata.tests.mock_grid import MockGrid from powersimdata.tests.mock_scenario import MockScenario from powersimdata.tests.mock_scenario_info import MockScenarioInfo period_num = 4 # plant_id is the index mock_plant = { "plant_id": [101, 102, 103, 104, 105, 106], "b...
[ 11748, 19798, 292, 355, 279, 67, 198, 11748, 12972, 9288, 198, 198, 6738, 5635, 320, 7890, 13, 41989, 13, 76, 735, 62, 25928, 1330, 44123, 41339, 198, 6738, 5635, 320, 7890, 13, 41989, 13, 76, 735, 62, 1416, 39055, 1330, 44123, 3351, ...
2.250859
291
#!/usr/bin/env python3 # Copyright 2009-2017 BHG http://bw.org/ # Class inheritance is the fundamental part of OOP # allows you to extend your class by deriving properties/variables and methods from parent classes. # no longer providing default values. # it is bcz this is going to be the base class and it's ...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 2, 15069, 3717, 12, 5539, 347, 39, 38, 2638, 1378, 65, 86, 13, 2398, 14, 198, 198, 2, 5016, 24155, 318, 262, 7531, 636, 286, 440, 3185, 198, 2, 3578, 345, 284, 9117, 534, 139...
3.708696
230
"""Here are the db connection.""" import importlib import logging from mixer.settings import db_type from mixer.glogger import logger class Reader(object): """Helper to gen the reader class.""" def __init__(self, db_name): """Constructor.""" DB = getattr( importlib....
[ 37811, 4342, 389, 262, 20613, 4637, 526, 15931, 201, 198, 11748, 1330, 8019, 201, 198, 11748, 18931, 201, 198, 201, 198, 6738, 33938, 13, 33692, 1330, 20613, 62, 4906, 201, 198, 6738, 33938, 13, 4743, 519, 1362, 1330, 49706, 201, 198, ...
2.18254
252
# -------------- # import the libraries import numpy as np import pandas as pd import seaborn as sns from sklearn.model_selection import train_test_split import warnings warnings.filterwarnings('ignore') # Code starts here df = pd.read_csv(path) print(df.head()) X = df.drop('insuranceclaim',axis=1) y = df['insurancecl...
[ 2, 220, 26171, 198, 2, 1330, 262, 12782, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 19798, 292, 355, 279, 67, 198, 11748, 384, 397, 1211, 355, 3013, 82, 198, 6738, 1341, 35720, 13, 19849, 62, 49283, 1330, 4512, 62, 9288, 62, 35...
2.560626
767
# Definition for a binary tree node. # Do in order traversal. The in order traversal is monotonically increase # O(1) Space, can not use iterative method or recursive solution, both use space # class Solution(object): # first = TreeNode(None) # second = TreeNode(None) # prev = TreeNode(None) # def re...
[ 2, 30396, 329, 257, 13934, 5509, 10139, 13, 198, 198, 2, 2141, 287, 1502, 33038, 282, 13, 383, 287, 1502, 33038, 282, 318, 937, 18970, 1146, 2620, 198, 2, 440, 7, 16, 8, 4687, 11, 460, 407, 779, 11629, 876, 2446, 393, 45115, 4610,...
2.269129
379
import os from utils.Template_directory import * from utils.utilities import * import sys sys.path.append('../') from core.Renderer.FileRenderer import Renderer layer1 = [Experiment,Production] layer1_names = ['Experiment','Production'] Files = File
[ 11748, 28686, 198, 6738, 3384, 4487, 13, 30800, 62, 34945, 1330, 1635, 198, 6738, 3384, 4487, 13, 315, 2410, 1330, 1635, 198, 11748, 25064, 198, 17597, 13, 6978, 13, 33295, 10786, 40720, 11537, 198, 6738, 4755, 13, 49, 437, 11882, 13, ...
2.988636
88
# problem7.py # By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13. # What is the 10 001st prime number? i = 1 z = 1 while i < 10002: z += 1 if z > 1: for j in range(2, z): if z % j == 0: break else: i += ...
[ 2, 1917, 22, 13, 9078, 198, 198, 2, 2750, 13487, 262, 717, 2237, 6994, 3146, 25, 362, 11, 513, 11, 642, 11, 767, 11, 1367, 11, 290, 1511, 11, 356, 460, 766, 326, 262, 718, 400, 6994, 318, 1511, 13, 198, 2, 1867, 318, 262, 838,...
1.964497
169
import re import os if __name__ == '__main__': # Check if file with name Cache.txt exists if os.path.isfile('Cache.txt'): # If file exists, delete it os.remove('Cache.txt') # Create file with name Cache.txt name = input('Enter your name (Enter -1 to skip): ') while not name: ...
[ 11748, 302, 198, 11748, 28686, 628, 198, 198, 361, 11593, 3672, 834, 6624, 705, 834, 12417, 834, 10354, 198, 220, 220, 220, 1303, 6822, 611, 2393, 351, 1438, 34088, 13, 14116, 7160, 198, 220, 220, 220, 611, 28686, 13, 6978, 13, 4468, ...
2.466332
995
#================================================# # vector_scalar.py # based on: gsn_vec_scal_1.ncl, # gsn_vec_scal_2.ncl, # gsn_vec_scal_3.ncl #================================================# from pathlib import Path import numpy as np import xarray as xr import matplotlib.pyplot as plt impo...
[ 2, 10052, 4770, 2, 198, 2, 220, 15879, 62, 1416, 282, 283, 13, 9078, 198, 2, 220, 1912, 319, 25, 308, 16184, 62, 35138, 62, 1416, 282, 62, 16, 13, 77, 565, 11, 198, 2, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3...
2.761614
818
# -*- encoding: utf-8 -*- ### # Copyright 2019 Joël Perras <joel@nerderati.com> # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights ...
[ 2, 532, 9, 12, 21004, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 198, 21017, 198, 2, 15069, 13130, 5302, 26689, 75, 2448, 8847, 1279, 7639, 417, 31, 1008, 1082, 7246, 13, 785, 29, 198, 198, 2, 2448, 3411, 318, 29376, 7520, 11, 1479,...
3.054484
881
from redis import StrictRedis import logging # 准备配置类 class Config(object): """app配置类""" # DEBUG = True # 配置MySQL:指定数据库位置 SQLALCHEMY_DATABASE_URI = 'mysql://root:mysql@mysql@127.0.0.1:3306/information_new' # 禁用追踪mysql:因为mysql的性能差,如果再去追踪mysql的所有的修改,会再次浪费性能 SQLALCHEMY_TRACK_MODIFICATIONS = False ...
[ 6738, 2266, 271, 1330, 520, 2012, 7738, 271, 198, 11748, 18931, 198, 198, 2, 10263, 229, 228, 13783, 229, 165, 227, 235, 163, 121, 106, 163, 109, 119, 198, 4871, 17056, 7, 15252, 2599, 198, 220, 220, 220, 37227, 1324, 165, 227, 235,...
1.279955
893
from datetime import datetime from flask_wtf import Form from wtforms import ( BooleanField, DateTimeField, SelectField, SelectMultipleField, StringField, ) from wtforms.validators import DataRequired, URL from constants import GENRES, STATES
[ 6738, 4818, 8079, 1330, 4818, 8079, 198, 6738, 42903, 62, 86, 27110, 1330, 5178, 198, 6738, 266, 83, 23914, 1330, 357, 198, 220, 220, 220, 41146, 15878, 11, 198, 220, 220, 220, 7536, 7575, 15878, 11, 198, 220, 220, 220, 9683, 15878, ...
3.204819
83
import math import numpy as np """ A controller class which implements a joint feedforward controller by compensating for the desired acceleration torque and the desired gravity torque."""
[ 11748, 10688, 198, 198, 11748, 299, 32152, 355, 45941, 198, 198, 37811, 317, 10444, 1398, 543, 23986, 257, 6466, 3745, 11813, 198, 36500, 416, 7144, 803, 329, 262, 10348, 20309, 26415, 290, 262, 10348, 13522, 26415, 526, 15931, 628 ]
4.923077
39
# Copyright 2019 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
[ 2, 15069, 13130, 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.217247
12,083
from Module import AbstractModule
[ 6738, 19937, 1330, 27741, 26796, 628 ]
5.833333
6
from typing import Iterable import sqlalchemy as sa from scrapfishin.models import Recipe def grocery_list( s: sa.orm.Session, recipes: Iterable[Recipe] ) -> str: """ Format an iterable of Recipes into a Grocery List. Parameters ---------- s : sqlalchemy.orm.Session database ses...
[ 6738, 19720, 1330, 40806, 540, 198, 198, 11748, 44161, 282, 26599, 355, 473, 198, 198, 6738, 15881, 11084, 259, 13, 27530, 1330, 26694, 628, 198, 4299, 16918, 62, 4868, 7, 198, 220, 220, 220, 264, 25, 473, 13, 579, 13, 36044, 11, 19...
2.231132
636
#!/usr/bin/env python """NDG Security Attribute Authority test harness for unit test site 'A' NERC Data Grid Project """ __author__ = "P J Kershaw" __date__ = "24/09/08" __copyright__ = "(C) 2009 Science and Technology Facilities Council" __contact__ = "Philip.Kershaw@stfc.ac.uk" __revision__ = "$Id$" from os import ...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 37811, 8575, 38, 4765, 3460, 4163, 11416, 1332, 19356, 329, 4326, 1332, 2524, 705, 32, 6, 198, 198, 21479, 34, 6060, 24846, 4935, 198, 198, 37811, 198, 834, 9800, 834, 796, 366, 47, ...
1.908055
1,229
import random from tyckiting_client.ai import base from tyckiting_client import actions from tyckiting_client.ai.strategies import pipelineEscaping from tyckiting_client.ai.strategies import scanning from tyckiting_client.ai.strategies import uncertainTracking ''' Rules: like robin but in certain situations endangere...
[ 11748, 4738, 198, 198, 6738, 1259, 694, 1780, 62, 16366, 13, 1872, 1330, 2779, 198, 6738, 1259, 694, 1780, 62, 16366, 1330, 4028, 198, 6738, 1259, 694, 1780, 62, 16366, 13, 1872, 13, 2536, 2397, 444, 1330, 11523, 47051, 9269, 198, 673...
3.436364
110
""" Code related to face detection and manipulation """ #pip install facenet_pytorch from facenet_pytorch import MTCNN mtcnn = MTCNN(image_size=256, margin=80) # simplest ye olde trustworthy MTCNN for face detection with landmarks # my version of isOdd, should make a separate repo for it :D # the actual scaler...
[ 37811, 198, 220, 220, 220, 6127, 3519, 284, 1986, 13326, 290, 17512, 198, 37811, 198, 198, 2, 79, 541, 2721, 1777, 268, 316, 62, 9078, 13165, 354, 198, 198, 6738, 1777, 268, 316, 62, 9078, 13165, 354, 1330, 337, 4825, 6144, 198, 167...
3.314079
277
{%- if cookiecutter.copyright != "None" -%} # Copyright (c) {% now "utc", '%Y' %}, {{ cookiecutter.copyright }}. Unauthorised use, distribution or duplication is prohibited {% endif %} """ {{ cookiecutter.project_name }}. {{ cookiecutter.library_name }} """ from flask import Blueprint, jsonify from observability.log...
[ 90, 33963, 611, 19751, 8968, 353, 13, 22163, 4766, 14512, 366, 14202, 1, 532, 4, 92, 198, 2, 15069, 357, 66, 8, 1391, 4, 783, 366, 315, 66, 1600, 705, 4, 56, 6, 4064, 5512, 22935, 19751, 8968, 353, 13, 22163, 4766, 1782, 27422, ...
3.014563
206
#!/usr/bin/env python #-*- coding: utf-8 -*- import sys import os import pytest from mock import patch sys.path.insert(0, os.path.abspath('./')) from feuersoftware import PublicAPI TOKEN = '2xgRoQfoMGb4IveCDJIZqOO1l8hZZ5jT5mAw7SSk1otrFSq50IA2HIYB3luEpv7Vw8BWwG'\ 'Y2zV96VUkOF3FCZs2OP03qaTWF3CDrUHOKndvLIFTTgx...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 2, 12, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 198, 11748, 25064, 198, 11748, 28686, 198, 11748, 12972, 9288, 198, 6738, 15290, 1330, 8529, 198, 198, 17597, 13, 6978, ...
1.956432
964
# Generated by Django 3.1.2 on 2020-10-27 11:12 from django.conf import settings from django.db import migrations, models import django.db.models.deletion
[ 2, 2980, 515, 416, 37770, 513, 13, 16, 13, 17, 319, 12131, 12, 940, 12, 1983, 1367, 25, 1065, 198, 198, 6738, 42625, 14208, 13, 10414, 1330, 6460, 198, 6738, 42625, 14208, 13, 9945, 1330, 15720, 602, 11, 4981, 198, 11748, 42625, 142...
3.019231
52
"""Module for events adapter.""" import copy import logging import os from typing import List from aiohttp import ClientSession from aiohttp import hdrs from aiohttp import web from multidict import MultiDict EVENTS_HOST_SERVER = os.getenv("EVENTS_HOST_SERVER", "localhost") EVENTS_HOST_PORT = os.getenv("EVENTS_HOST_P...
[ 37811, 26796, 329, 2995, 21302, 526, 15931, 198, 11748, 4866, 198, 11748, 18931, 198, 11748, 28686, 198, 6738, 19720, 1330, 7343, 198, 198, 6738, 257, 952, 4023, 1330, 20985, 36044, 198, 6738, 257, 952, 4023, 1330, 289, 67, 3808, 198, 6...
2.018753
2,453
#!/usr/bin/python3 DOC="""feots_compare feots_compare is use to compare two FEOTS NetCDF output files and report simple statistics. Currently feots_compare will generate a histogram of log_{10}( |f_1 - f_2| ) where f_1 and f_2 are tracer fields from two FEOTS output files. Usage: feots_compare absdiff <file1> <fi...
[ 2, 48443, 14629, 14, 8800, 14, 29412, 18, 198, 198, 38715, 2625, 15931, 5036, 1747, 62, 5589, 533, 198, 198, 5036, 1747, 62, 5589, 533, 318, 779, 284, 8996, 734, 18630, 33472, 3433, 34, 8068, 5072, 3696, 290, 989, 2829, 7869, 13, 19...
2.830935
278
import importlib import json import os from oauth2client import client, crypt from opendc.util import exceptions, parameter_checker from opendc.util.exceptions import ClientError class Request: """WebSocket message to REST request mapping.""" def __init__(self, message=None): """"Initialize a Reques...
[ 11748, 1330, 8019, 198, 11748, 33918, 198, 11748, 28686, 198, 198, 6738, 267, 18439, 17, 16366, 1330, 5456, 11, 8194, 198, 198, 6738, 1034, 437, 66, 13, 22602, 1330, 13269, 11, 11507, 62, 9122, 263, 198, 6738, 1034, 437, 66, 13, 22602...
2.403135
1,786
# uncompyle6 version 3.7.4 # Python bytecode 3.7 (3394) # Decompiled from: Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)] # Embedded file name: T:\InGame\Gameplay\Scripts\Server\statistics\ranked_statistic.py # Compiled at: 2020-08-11 17:51:45 # Size of source mod 2**32: 58267 ...
[ 2, 34318, 2349, 21, 2196, 513, 13, 22, 13, 19, 198, 2, 11361, 18022, 8189, 513, 13, 22, 357, 2091, 5824, 8, 198, 2, 4280, 3361, 3902, 422, 25, 11361, 513, 13, 22, 13, 24, 357, 31499, 14, 85, 18, 13, 22, 13, 24, 25, 1485, 66,...
1.68128
5,657
# Import utils submodule import api.api # Decide to start seeing other people api.api.we_need_to_talk(break_up=False) import api # Create instance of MyClass my_instance = api.AppClass(value='class attribute value') # Print out class attribute value print(my_instance.attribute)
[ 2, 17267, 3384, 4487, 850, 21412, 198, 11748, 40391, 13, 15042, 198, 198, 2, 4280, 485, 284, 923, 4379, 584, 661, 198, 15042, 13, 15042, 13, 732, 62, 31227, 62, 1462, 62, 16620, 7, 9032, 62, 929, 28, 25101, 8, 198, 198, 11748, 403...
3.373494
83
import numba import autogalaxy as ag from autolens.point.point_dataset import PointDataset from autolens.point.point_solver import PointSolver from autolens.point.fit_point.fluxes import FitFluxes from autolens.point.fit_point.positions_image import FitPositionsImage from autolens.point.fit_point.positions_so...
[ 11748, 997, 7012, 201, 198, 201, 198, 11748, 1960, 519, 282, 6969, 355, 556, 201, 198, 201, 198, 6738, 1960, 349, 641, 13, 4122, 13, 4122, 62, 19608, 292, 316, 1330, 6252, 27354, 292, 316, 201, 198, 6738, 1960, 349, 641, 13, 4122, ...
2.891892
148
""" Plot a quartz class map for a drill core HSI cube. """ from __future__ import print_function import os import os.path as osp import matplotlib.pyplot as plt import numpy as np import pysptools.util as util import pysptools.eea as eea import pysptools.abundance_maps as amp if __name__ ==...
[ 37811, 201, 198, 43328, 257, 47969, 1398, 3975, 329, 257, 16007, 4755, 367, 11584, 23441, 13, 201, 198, 37811, 201, 198, 201, 198, 6738, 11593, 37443, 834, 1330, 3601, 62, 8818, 201, 198, 201, 198, 11748, 28686, 201, 198, 11748, 28686, ...
2.440559
715
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import math if __name__ == '__main__': print(func(5, 3)()) print(func(8, 10, 1)()) print(func(3, 5, 0)()) print(func(2, 2, 1)())
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 198, 11748, 10688, 628, 628, 198, 361, 11593, 3672, 834, 6624, 705, 834, 12417, 834, 10354, 198, 220, 220, 220, 3...
1.989899
99
'''from django.contrib.auth import get_user_model from django.test import TestCase #an extension of Python’s TestCase from django.urls import reverse, resolve from django.test import Client from .models import PremiumBlog from .views import ( BlogListView, BlogDetailView, ) class CustomUserTests(TestCa...
[ 7061, 6, 6738, 42625, 14208, 13, 3642, 822, 13, 18439, 1330, 651, 62, 7220, 62, 19849, 198, 6738, 42625, 14208, 13, 9288, 1330, 6208, 20448, 1303, 272, 7552, 286, 11361, 447, 247, 82, 6208, 20448, 198, 198, 6738, 42625, 14208, 13, 637...
2.295644
1,079
# Copyright 2018 DeepMind Technologies Limited. 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, 15069, 2864, 10766, 28478, 21852, 15302, 13, 1439, 2489, 10395, 13, 198, 2, 198, 2, 49962, 739, 262, 24843, 13789, 11, 10628, 362, 13, 15, 357, 1169, 366, 34156, 15341, 198, 2, 345, 743, 407, 779, 428, 2393, 2845, 287, 11846, 351...
3.381295
278
# -*- coding: utf-8 -*- r""" A policy that acts as a wrapper on another policy `P`, assumed to be *horizon dependent* (has to known :math:`T`), by implementing a "doubling trick": - starts to assume that :math:`T=T_0=1000`, and run the policy :math:`P(T_0)`, from :math:`t=1` to :math:`t=T_0`, - if :math:`t > T_0`, the...
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 81, 37811, 317, 2450, 326, 6529, 355, 257, 29908, 319, 1194, 2450, 4600, 47, 47671, 9672, 284, 307, 1635, 17899, 8637, 10795, 9, 357, 10134, 284, 1900, 1058, 11018, 25, ...
2.43969
11,731
myVarRed= "Red" myVarBlue= "Blue" print("Roses are Red. " + "Violets are Blue.") print("Roses are " + myVarRed + ". Violets are " + myVarBlue) myStr = "Roses are Red. " + "Violets are Blue." varStr = "Roses are " + myVarRed + ". Violets are " + myVarBlue print(myStr) print(varStr) name = "Joe" feet= 6 inches= 2 p...
[ 1820, 19852, 7738, 28, 366, 7738, 1, 198, 1820, 19852, 14573, 28, 366, 14573, 1, 198, 198, 4798, 7203, 49, 4629, 389, 2297, 13, 366, 1343, 366, 53, 952, 5289, 389, 4518, 19570, 198, 4798, 7203, 49, 4629, 389, 366, 1343, 616, 19852, ...
2.589474
285
__all__ = [ 'builder_android', ]
[ 834, 439, 834, 796, 685, 201, 198, 197, 6, 38272, 62, 19411, 3256, 201, 198, 60 ]
2.1875
16
from configparser import RawConfigParser CONTEXT = Context()
[ 6738, 4566, 48610, 1330, 16089, 16934, 46677, 628, 198, 198, 10943, 32541, 796, 30532, 3419, 198 ]
4
16
#!/usr/bin/env python import os import re import unasync # requires pip>=10.0 for PEP 518 support from setuptools import setup # Get the version (borrowed from SQLAlchemy) base_path = os.path.dirname(__file__) with open(os.path.join(base_path, "src", "urllib3", "__init__.py")) as fp: version = re.match(r".*__v...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 198, 11748, 28686, 198, 11748, 302, 198, 198, 11748, 555, 292, 13361, 220, 1303, 4433, 7347, 29, 28, 940, 13, 15, 329, 350, 8905, 642, 1507, 1104, 198, 6738, 900, 37623, 10141, 1330, ...
2.568047
169
from amplification.tasks.equals import EqualsTask from amplification.tasks.graph import GraphTask, MidpointTask from amplification.tasks.sum import SumTask from amplification.tasks.eval import EvalTask, EvalSumTask from amplification.tasks.iterate import IterTask from amplification.tasks.sat import SatTask
[ 6738, 50250, 13, 83, 6791, 13, 4853, 874, 1330, 7889, 874, 25714, 198, 6738, 50250, 13, 83, 6791, 13, 34960, 1330, 29681, 25714, 11, 7215, 4122, 25714, 198, 6738, 50250, 13, 83, 6791, 13, 16345, 1330, 5060, 25714, 198, 6738, 50250, 13...
4
77
class TestSimpleClass(object): """ Classes can still be used to organize collections of test cases, with each test being a Method on the Class, rather than a standalone function. """ x = 1 y = 2
[ 4871, 6208, 26437, 9487, 7, 15252, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 38884, 460, 991, 307, 973, 284, 16481, 17268, 286, 1332, 2663, 11, 351, 198, 220, 220, 220, 1123, 1332, 852, 257, 11789, 319, 262, 5016, 11, 213...
3.235294
68
# coding: utf8 from pybo import Config from pathlib import Path
[ 2, 19617, 25, 3384, 69, 23, 198, 6738, 12972, 2127, 1330, 17056, 198, 6738, 3108, 8019, 1330, 10644, 628 ]
3.421053
19
from globals_consts import NAMESPACE, cname
[ 6738, 15095, 874, 62, 1102, 6448, 1330, 399, 29559, 47, 11598, 11, 269, 3672 ]
3.071429
14
from city_scrapers_core.spiders import CityScrapersSpider from city_scrapers.mixins.wayne_commission import WayneCommissionMixin
[ 6738, 1748, 62, 1416, 2416, 364, 62, 7295, 13, 2777, 4157, 1330, 2254, 3351, 2416, 364, 41294, 198, 198, 6738, 1748, 62, 1416, 2416, 364, 13, 19816, 1040, 13, 43932, 62, 785, 3411, 1330, 13329, 50246, 35608, 259, 628 ]
3.358974
39
#!/usr/bin/env python __copyright__ = """ Copyright (c) 2020 Tananaev Denis Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, cop...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 834, 22163, 4766, 834, 796, 37227, 198, 15269, 357, 66, 8, 12131, 11818, 2271, 1990, 33089, 198, 198, 5990, 3411, 318, 29376, 7520, 11, 1479, 286, 3877, 11, 284, 597, 1048, 16727, 257,...
2.565697
2,717
import pytest @pytest.fixture(params=[None, False]) def sort(request): """ Valid values for the 'sort' parameter used in the Index setops methods (intersection, union, etc.) Caution: Don't confuse this one with the "sort" fixture used for DataFrame.append or concat. That one has ...
[ 11748, 12972, 9288, 628, 198, 31, 9078, 9288, 13, 69, 9602, 7, 37266, 41888, 14202, 11, 10352, 12962, 198, 4299, 3297, 7, 25927, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 48951, 3815, 329, 262, 705, 30619, 6, 11507, 973, ...
2.824561
171
# Copyright (c) 2018 Intel Corporation # # 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 i...
[ 2, 15069, 357, 66, 8, 2864, 8180, 10501, 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, ...
3.851852
189
# -*- coding: utf-8 -*- r""" # .---. .----------- # / \ __ / ------ # / / \( )/ ----- (`-') _ _(`-') <-. (`-')_ # ////// '\/ ` --- ( OO).-/( (OO ).-> .-> \( OO) ) .-> # //// / // : : --- (,------. \ .'_ (`-')----. ,...
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 81, 37811, 198, 1303, 220, 220, 220, 220, 220, 220, 220, 764, 6329, 13, 220, 220, 220, 220, 220, 220, 220, 220, 764, 32284, 198, 1303, 220, 220, 220, 220, 220, 220, ...
1.832883
2,220
import re from wtforms import validators from solr_admin import keycloak from solr_admin import models from solr_admin import solr from solr_admin.models import synonym_audit # The customized ModelView that is used for working with the synonyms. from solr_admin.services.get_stems import get_stems from solr_admin.s...
[ 198, 11748, 302, 198, 198, 6738, 266, 83, 23914, 1330, 4938, 2024, 198, 198, 6738, 1540, 81, 62, 28482, 1330, 1994, 565, 15877, 198, 6738, 1540, 81, 62, 28482, 1330, 4981, 198, 6738, 1540, 81, 62, 28482, 1330, 1540, 81, 198, 6738, 1...
3.525692
253
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # import torch from torch.optim import Optimizer
[ 2, 15069, 357, 66, 8, 3203, 11, 3457, 13, 290, 663, 29116, 13, 198, 2, 1439, 2489, 10395, 13, 198, 2, 198, 2, 770, 2723, 2438, 318, 11971, 739, 262, 5964, 1043, 287, 262, 198, 2, 38559, 24290, 2393, 287, 262, 6808, 8619, 286, 42...
3.920635
63
'todo list controller' import json from flask import request from flask import jsonify from flask import current_app import data.database as database def list_items(): 'GET todo list' current_app.logger.info('todo controller called, func: list') db = database.Database(current_app.config['CONN_STRING']) ...
[ 470, 24313, 1351, 10444, 6, 198, 11748, 33918, 198, 6738, 42903, 1330, 2581, 198, 198, 6738, 42903, 1330, 33918, 1958, 198, 6738, 42903, 1330, 1459, 62, 1324, 198, 198, 11748, 1366, 13, 48806, 355, 6831, 198, 198, 4299, 1351, 62, 23814,...
2.615917
578
""" The model package """ from models.gcn import GCN_2Layers from models.mlp import MLP_1h, MLP_2h from models.wgcn import WGCN, WGCN_embedding_classifier, WGCN_VocabEmbedding __all__ = [ "MLP_1h", "MLP_2h", "GCN_2Layers", "WGCN", "WGCN_embedding_classifier", "WGCN_VocabEmbedding", ]
[ 37811, 198, 464, 2746, 5301, 198, 37811, 198, 198, 6738, 4981, 13, 70, 31522, 1330, 20145, 45, 62, 17, 43, 6962, 198, 6738, 4981, 13, 4029, 79, 1330, 10373, 47, 62, 16, 71, 11, 10373, 47, 62, 17, 71, 198, 6738, 4981, 13, 86, 70,...
2.006452
155
# Advent of Code 2021, Day 14 # # Apply character insertion rules to a sequence of characters, # runs out of memory if you try to build up character strings, # so had to build dictionary of pairs of characters. # # AK, 14/12/2021 import time t0 = time.time() # Input file name f = 'sample.txt' f = 'input.txt' # Read ...
[ 2, 33732, 286, 6127, 33448, 11, 3596, 1478, 198, 2, 198, 2, 27967, 2095, 36075, 3173, 284, 257, 8379, 286, 3435, 11, 198, 2, 4539, 503, 286, 4088, 611, 345, 1949, 284, 1382, 510, 2095, 13042, 11, 198, 2, 523, 550, 284, 1382, 22155...
2.632231
484
''' This script illustrates training of an inflammation classifier for patches along SI joints ''' import argparse import os import shutil import pytorch_lightning as pl from torch.utils.data import DataLoader from neuralnets.util.io import print_frm from neuralnets.util.tools import set_seed from neuralnets.util.augm...
[ 7061, 6, 198, 1212, 4226, 21290, 3047, 286, 281, 20881, 1398, 7483, 329, 16082, 1863, 25861, 24039, 198, 7061, 6, 198, 11748, 1822, 29572, 198, 11748, 28686, 198, 11748, 4423, 346, 198, 11748, 12972, 13165, 354, 62, 2971, 768, 355, 458,...
2.225868
3,657
print("-----------------rule_1------------------")
[ 4798, 7203, 1783, 12, 25135, 62, 16, 1783, 438, 4943, 198 ]
4.636364
11
from flask import Flask from flask import render_template app = Flask(__name__) @app.route('/hello/<name>') @app.route('/user/<username>', methods=['POST','GET']) @app.route('/test/<num>') if __name__ == '__main__': app.run()
[ 6738, 42903, 1330, 46947, 198, 6738, 42903, 1330, 8543, 62, 28243, 198, 198, 1324, 796, 46947, 7, 834, 3672, 834, 8, 628, 198, 31, 1324, 13, 38629, 10786, 14, 31373, 14, 27, 3672, 29, 11537, 198, 198, 31, 1324, 13, 38629, 10786, 14,...
2.565217
92
# (c) Copyright IBM Corp. 2021 # (c) Copyright Instana Inc. 2021 from instana.propagators.binary_propagator import BinaryPropagator from instana.span_context import SpanContext import unittest
[ 2, 357, 66, 8, 15069, 19764, 11421, 13, 33448, 198, 2, 357, 66, 8, 15069, 2262, 2271, 3457, 13, 33448, 198, 198, 6738, 916, 2271, 13, 22930, 363, 2024, 13, 39491, 62, 22930, 363, 1352, 1330, 45755, 24331, 363, 1352, 198, 6738, 916, ...
3.403509
57
''' 实验名称:RGB灯带 版本:v1.0 日期:2019.7 作者:01Studio 说明:RGB灯带控制。 ''' from ws2812 import WS2812 from colors import * from machine import Pin import pyb #定义灯带连接引脚,Y11接口 LED = Pin('Y11',Pin.OUT,value=0) #构建RGB灯带对象,定义控制引脚和灯珠数量 strip = WS2812(spi_bus=LED, led_count=30) #灯带填色函数,灯珠数量为led_count #清空RGB灯带颜色 strip.show(fill_color(E...
[ 198, 7061, 6, 198, 22522, 252, 165, 103, 234, 28938, 235, 163, 100, 108, 171, 120, 248, 36982, 163, 223, 107, 30585, 99, 198, 48304, 17312, 105, 171, 120, 248, 85, 16, 13, 15, 198, 33768, 98, 17312, 253, 171, 120, 248, 23344, 13, ...
1.371585
366
from __future__ import with_statement import unittest from cStringIO import StringIO from format import format from prettyprinter import * from bindings import bindings import printervars if __name__ == "__main__": unittest.main()
[ 6738, 11593, 37443, 834, 1330, 351, 62, 26090, 198, 11748, 555, 715, 395, 198, 6738, 269, 10100, 9399, 1330, 10903, 9399, 198, 6738, 5794, 1330, 5794, 198, 6738, 2495, 1050, 3849, 1330, 1635, 198, 6738, 34111, 1330, 34111, 198, 11748, 2...
3.575758
66
#!/usr/bin/python3 # requires system Python and the python3-apt package import textwrap from collections import OrderedDict # Starting with Python 3.7, we could just use vanilla dicts import apt # ImportError? apt install python3-apt HELP_INFO = """Top-level package manager This tool lists all packages that aren't ma...
[ 2, 48443, 14629, 14, 8800, 14, 29412, 18, 198, 2, 4433, 1080, 11361, 290, 262, 21015, 18, 12, 2373, 5301, 198, 11748, 2420, 37150, 198, 6738, 17268, 1330, 14230, 1068, 35, 713, 1303, 17962, 351, 11361, 513, 13, 22, 11, 356, 714, 655...
2.644082
3,616
import csv import cv2 import numpy as np from keras.models import Sequential, load_model from keras.layers import Flatten, Dense, Lambda, Cropping2D, Dropout from keras.layers.convolutional import Conv2D from sklearn.model_selection import train_test_split from sklearn.utils import shuffle lines = [] path = 'C:/...
[ 11748, 269, 21370, 198, 11748, 269, 85, 17, 198, 11748, 299, 32152, 355, 45941, 198, 198, 6738, 41927, 292, 13, 27530, 1330, 24604, 1843, 11, 3440, 62, 19849, 198, 6738, 41927, 292, 13, 75, 6962, 1330, 1610, 41769, 11, 360, 1072, 11, ...
3.101299
385
# -*- coding:utf-8 -*- """ flskapp/helper.py ~~~~~~~~~~~~~~ Flask框架帮助方法 """ import os from random import randint import traceback import urllib2 from sharper.util.string import random_number from flask import get_flashed_messages, request, jsonify, current_app, logging, session import sys from ..lib.error ...
[ 2, 532, 9, 12, 19617, 25, 40477, 12, 23, 532, 9, 12, 198, 37811, 198, 220, 220, 220, 781, 8135, 1324, 14, 2978, 525, 13, 9078, 198, 220, 220, 220, 220, 15116, 8728, 4907, 628, 220, 220, 220, 46947, 162, 94, 228, 162, 252, 114, ...
1.522062
2,697
""" Here timestamps are updated in order to have elapsed times following a particular pattern/rule Author: Mattia Fraccaro """ import csv import time from datetime import datetime, timedelta from random import *
[ 37811, 198, 4342, 4628, 395, 9430, 389, 6153, 287, 1502, 284, 423, 42118, 1661, 1708, 257, 1948, 3912, 14, 25135, 198, 198, 13838, 25, 4705, 544, 1305, 4134, 12022, 198, 37811, 198, 198, 11748, 269, 21370, 198, 11748, 640, 198, 6738, ...
3.890909
55
# # Copyright 2015-2019, Institute for Systems Biology # # 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, 198, 2, 15069, 1853, 12, 23344, 11, 5136, 329, 11998, 24698, 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...
3.591362
301
from core.himesis import Himesis import cPickle as pickle from uuid import UUID
[ 198, 198, 6738, 4755, 13, 71, 999, 271, 1330, 367, 999, 271, 198, 11748, 269, 31686, 293, 355, 2298, 293, 198, 6738, 334, 27112, 1330, 471, 27586, 628 ]
2.964286
28
from easyprocess import EasyProcess from pyvirtualdisplay.smartdisplay import SmartDisplay from discogui.hover import active_rectangles
[ 6738, 2562, 14681, 1330, 16789, 18709, 198, 6738, 12972, 32844, 13812, 13, 27004, 13812, 1330, 10880, 23114, 198, 198, 6738, 1221, 519, 9019, 13, 43753, 1330, 4075, 62, 2554, 27787, 628, 628 ]
4.375
32
# -*- coding: utf-8 -*- # # Copyright (C) 2008-2013 Richard Liao <richard.liao.i@gmail.com> # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. # from __future__ import with_statement import inspect import textwrap impor...
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 2, 198, 2, 15069, 357, 34, 8, 3648, 12, 6390, 6219, 406, 13481, 1279, 7527, 446, 13, 75, 13481, 13, 72, 31, 14816, 13, 785, 29, 198, 2, 1439, 2489, 10395, 13, 198,...
3.076566
431
#!/usr/bin/env python import functools import numpy import hypothesis import hypothesis.extra.numpy import hypothesis.strategies import libnu.sum from test import eq arrays = functools.partial( hypothesis.extra.numpy.arrays, dtype=numpy.float32, unique=True, ) floats = hypothesis.strategies.floats(-1.0...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 198, 11748, 1257, 310, 10141, 198, 11748, 299, 32152, 198, 198, 11748, 14078, 198, 11748, 14078, 13, 26086, 13, 77, 32152, 198, 11748, 14078, 13, 2536, 2397, 444, 198, 198, 11748, 9195, ...
2.573477
279