content
stringlengths
1
1.04M
input_ids
listlengths
1
774k
ratio_char_token
float64
0.38
22.9
token_count
int64
1
774k
from django.contrib.auth import get_user_model from django.db import models from cajas.users.models.partner import Partner User = get_user_model() class Unit(models.Model): """ """ name = models.CharField( 'Nombre', max_length=255, ) partner = models.ForeignKey( Partner,...
[ 198, 6738, 42625, 14208, 13, 3642, 822, 13, 18439, 1330, 651, 62, 7220, 62, 19849, 198, 6738, 42625, 14208, 13, 9945, 1330, 4981, 198, 198, 6738, 269, 1228, 292, 13, 18417, 13, 27530, 13, 3911, 1008, 1330, 35532, 198, 12982, 796, 651,...
2.186508
504
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 6738, 11593, 37443, 834, 1330, 28000, 1098, 62, 17201, 874, 198, 198, 6738, 42625, 14208, 13, 9945, 1330, 15720, 602, 11, 4981, 628 ]
2.891892
37
#!/usr/bin/env python # # Copyright 2007 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 2, 198, 2, 15069, 4343, 3012, 3457, 13, 198, 2, 198, 2, 49962, 739, 262, 24843, 13789, 11, 10628, 362, 13, 15, 357, 1169, 366, 34156, 15341, 198, 2, 345, 743, 407, 779, 428, 2393, ...
2.859477
612
#!/usr/bin/env python # -*- coding: utf-8 -*- """ { "server": server['server'], "server_ipv6": "::", "server_port": int(server['server_port']), "local_address": "127.0.0.1", "local_port": 1080, "password": server['password'], "timeout": 300, "udp_timeout": 60, "method": method, "...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 37811, 198, 90, 198, 220, 220, 220, 366, 15388, 1298, 4382, 17816, 15388, 6, 4357, 198, 220, 220, 220, 366, 15388, 62...
2.412234
376
"""Song Models File.""" from mongoengine import (Document, EmbeddedDocument, EmbeddedDocumentListField, FloatField, IntField, ObjectIdField, StringField) class SongRatings(EmbeddedDocument): """Song Ratings Model.""" song_id = ObjectIdField(required=True) rating = IntField(min_v...
[ 37811, 44241, 32329, 9220, 526, 15931, 198, 198, 6738, 285, 25162, 18392, 1330, 357, 24941, 11, 13302, 47238, 24941, 11, 13302, 47238, 24941, 8053, 15878, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, ...
2.939024
246
from selenium import webdriver from selenium.webdriver.firefox.options import Options from selenium.common.exceptions import NoSuchElementException from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC ...
[ 6738, 384, 11925, 1505, 1330, 3992, 26230, 198, 6738, 384, 11925, 1505, 13, 12384, 26230, 13, 6495, 12792, 13, 25811, 1330, 18634, 198, 6738, 384, 11925, 1505, 13, 11321, 13, 1069, 11755, 1330, 1400, 16678, 20180, 16922, 198, 6738, 384, ...
3.421053
95
from index import * from v1 import *
[ 6738, 6376, 1330, 1635, 198, 6738, 410, 16, 1330, 1635, 198 ]
3.363636
11
import numpy as np import matplotlib.pyplot as plt rows,cols = 5, 9 Z1 = np.linspace(0,1,rows*cols).reshape(rows,cols) show_array(Z1, 'ops-where-before.png') Z2 = np.where(Z1 > 0.5, 0, 1) show_array(Z2, 'ops-where-after.png') Z1 = np.linspace(0,1,rows*cols).reshape(rows,cols) show_array(Z1, 'ops-maximum-before.png...
[ 11748, 299, 32152, 355, 45941, 198, 11748, 2603, 29487, 8019, 13, 9078, 29487, 355, 458, 83, 628, 198, 198, 8516, 11, 4033, 82, 796, 642, 11, 860, 198, 198, 57, 16, 796, 45941, 13, 21602, 10223, 7, 15, 11, 16, 11, 8516, 9, 4033, ...
2.071856
334
#!/usr/bin/python3 import pyglet from pyglet.gl import * import sys import math import time import numpy as np import random random.seed(7337) import sys sys.path.append("./libs") #sys.path.insert(0, "./db") #from db import * from objloader import * #from objloader_dbload import * from printfuncs...
[ 2, 48443, 14629, 14, 8800, 14, 29412, 18, 201, 198, 201, 198, 11748, 12972, 70, 1616, 201, 198, 6738, 12972, 70, 1616, 13, 4743, 1330, 1635, 201, 198, 201, 198, 11748, 25064, 201, 198, 11748, 10688, 201, 198, 11748, 640, 201, 198, 1...
2.114222
893
# -*- coding: utf-8 -*- """ lantz.errors ~~~~~~~~~~~~ Implements base classes for instrumentation related exceptions. They are useful to mix with specific exceptions from libraries or modules and therefore allowing code to catch them via lantz excepts without breaking specific ones. :copyr...
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 37811, 198, 220, 220, 220, 300, 46269, 13, 48277, 198, 220, 220, 220, 220, 15116, 8728, 628, 220, 220, 220, 1846, 1154, 902, 2779, 6097, 329, 8875, 341, 3519, 13269, 1...
3.383333
120
import boto3 import botocore import urllib2 import json # This method is suitable for IAM role. # This method is suitable for successful configuration. # This method is suitable for any other situation. # Get Client. # Input: String client type 'profile'|'temporary' # Output: Null.
[ 11748, 275, 2069, 18, 198, 11748, 10214, 420, 382, 198, 11748, 2956, 297, 571, 17, 198, 11748, 33918, 628, 198, 2, 770, 2446, 318, 11080, 329, 314, 2390, 2597, 13, 198, 198, 2, 770, 2446, 318, 11080, 329, 4388, 8398, 13, 198, 198, ...
3.406977
86
from turbogears.feed import feed FeedController = feed.FeedController
[ 6738, 14830, 519, 4127, 13, 12363, 1330, 3745, 198, 18332, 22130, 796, 3745, 13, 18332, 22130, 198 ]
4.117647
17
"""General-purpose test script for image-to-image translation. Once you have trained your model with train.py, you can use this script to test the model. It will load a saved model from '--checkpoints_dir' and save the results to '--results_dir'. It first creates model and dataset given the option. It will hard-code ...
[ 37811, 12218, 12, 29983, 1332, 4226, 329, 2939, 12, 1462, 12, 9060, 11059, 13, 198, 198, 7454, 345, 423, 8776, 534, 2746, 351, 4512, 13, 9078, 11, 345, 460, 779, 428, 4226, 284, 1332, 262, 2746, 13, 198, 1026, 481, 3440, 257, 7448, ...
3.323529
748
# program to split email to username and domain name # made by itsmeevil print("***Email Splitter***") email = input("\nEnter an email: ") sliced = email.split("@") # split string at "@" which will put it in an array- ["username", "domain name"] print(f"\nUsername: {sliced[0]}\nDomain name: {sliced[1]}")
[ 2, 1430, 284, 6626, 3053, 284, 20579, 290, 7386, 1438, 198, 2, 925, 416, 663, 1326, 23542, 198, 198, 4798, 7203, 8162, 15333, 13341, 1967, 8162, 4943, 198, 198, 12888, 796, 5128, 7203, 59, 77, 17469, 281, 3053, 25, 366, 8, 198, 198,...
2.924528
106
from async_service import background_trio_service import pytest import trio from ddht.tools.factories.alexandria import AdvertisementFactory from ddht.v5_1.alexandria.messages import AdvertiseMessage, PingMessage from ddht.v5_1.alexandria.radius_tracker import RadiusTracker @pytest.mark.trio @pytest.mark.trio @p...
[ 6738, 30351, 62, 15271, 1330, 4469, 62, 83, 27250, 62, 15271, 198, 11748, 12972, 9288, 198, 11748, 19886, 198, 198, 6738, 49427, 4352, 13, 31391, 13, 22584, 1749, 13, 1000, 87, 392, 7496, 1330, 39711, 22810, 198, 6738, 49427, 4352, 13, ...
2.870968
124
import logging from airflow.contrib.hooks.bigquery_hook import BigQueryHook from airflow.models import BaseOperator from airflow.utils import apply_defaults class BigQueryOperator(BaseOperator): """ Executes BigQuery SQL queries in a specific BigQuery database """ template_fields = ('bql',) templa...
[ 11748, 18931, 198, 198, 6738, 45771, 13, 3642, 822, 13, 25480, 82, 13, 14261, 22766, 62, 25480, 1330, 4403, 20746, 39, 566, 198, 6738, 45771, 13, 27530, 1330, 7308, 18843, 1352, 198, 6738, 45771, 13, 26791, 1330, 4174, 62, 12286, 82, ...
2.636023
533
import warnings warnings.filterwarnings("ignore") import os os.environ["TF_CPP_MIN_LOG_LEVEL"] = "3" import gym from BPG.ppo2 import PPO2 from BPG.ppo_policy import MlpPolicy env_id = "CartPole-v1" env = gym.make(env_id) model = PPO2(MlpPolicy, env, learning_rate=1e-4, verbose=1, tensorboard_log="MLP/", full_tensorb...
[ 198, 11748, 14601, 198, 40539, 654, 13, 24455, 40539, 654, 7203, 46430, 4943, 198, 11748, 28686, 198, 418, 13, 268, 2268, 14692, 10234, 62, 8697, 47, 62, 23678, 62, 25294, 62, 2538, 18697, 8973, 796, 366, 18, 1, 198, 198, 11748, 11550...
2.40293
273
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. from ax.core.arm import Arm from ax.core.generator_run import GeneratorRun from ax.utils.common.testutils import TestCase from ax.utils.testing.fake import ( get_arms, get_model_predictions, get_model_predictions...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 2, 15069, 357, 66, 8, 3203, 11, 3457, 13, 290, 663, 29116, 13, 1439, 6923, 33876, 13, 198, 198, 6738, 7877, 13, 7295, 13, 1670, 1330, 7057, 198, 6738, 7877, 13, 7295, 13, 8612,...
2.768817
186
from __future__ import absolute_import import sys import logging from frontera.logger import formatters CONSOLE = logging.StreamHandler(stream=sys.stdout) CONSOLE.setFormatter(formatters.CONSOLE)
[ 6738, 11593, 37443, 834, 1330, 4112, 62, 11748, 198, 11748, 25064, 198, 11748, 18931, 198, 198, 6738, 1216, 261, 49600, 13, 6404, 1362, 1330, 5794, 1010, 198, 198, 10943, 15821, 2538, 796, 18931, 13, 12124, 25060, 7, 5532, 28, 17597, 13...
3.245902
61
# Expresiones Regulares I # las expresiones reguales son una secuencia de caracteres que forman un patron de busqueda # Sirven para el trabajo de procesamiento de texto import re cadena = "Vamos a aprender expresiones regulares en python. python es un lenguaje de sintaxis sencilla" #buscarmos las palabre aprender #...
[ 2, 5518, 411, 295, 274, 3310, 377, 3565, 314, 198, 2, 39990, 1033, 411, 295, 274, 842, 723, 274, 3367, 555, 64, 792, 84, 29634, 390, 1097, 529, 68, 411, 8358, 329, 805, 555, 19686, 390, 1323, 421, 18082, 198, 198, 2, 7361, 574, ...
2.894587
351
from . import patch from .parameter import Parameter from .module import Module from .container import * from . import utils from .utils import make_method from .layers import * from .loss import * from .flat_param import FlatParam
[ 6738, 764, 1330, 8529, 198, 6738, 764, 17143, 2357, 1330, 25139, 2357, 198, 6738, 764, 21412, 1330, 19937, 198, 6738, 764, 34924, 1330, 1635, 198, 6738, 764, 1330, 3384, 4487, 198, 6738, 764, 26791, 1330, 787, 62, 24396, 198, 6738, 764,...
3.803279
61
from fileinput import FileInput from typing import Iterable import day07a if __name__ == "__main__": day07a.calculate_fuel_needed = calculate_fuel_needed input: "FileInput[str]" = FileInput() initial_positions = list(map(int, next(input).rstrip().split(","))) print(day07a.find_cheapest_position(in...
[ 6738, 2393, 15414, 1330, 9220, 20560, 198, 6738, 19720, 1330, 40806, 540, 198, 198, 11748, 1110, 2998, 64, 628, 628, 198, 361, 11593, 3672, 834, 6624, 366, 834, 12417, 834, 1298, 198, 220, 220, 220, 1110, 2998, 64, 13, 9948, 3129, 378...
2.888889
117
import math import phe.paillier as paillier pubkey, prikey = paillier.generate_paillier_keypair(n_length=1024) # TODO: fails when iterations more than 17 (key length 1024) irrational test intermittently fails. Result either incorrect (random) or overflow iterations = 17 # factorial test factorial = pubkey.encrypt(1) ...
[ 11748, 10688, 198, 11748, 279, 258, 13, 8957, 359, 959, 355, 14187, 359, 959, 198, 12984, 2539, 11, 1293, 2539, 796, 14187, 359, 959, 13, 8612, 378, 62, 8957, 359, 959, 62, 2539, 24874, 7, 77, 62, 13664, 28, 35500, 8, 198, 198, 2,...
2.695122
328
# author: Arlin Cherian, Kristin Bunyan, Michelle Wang, Berkay Bulut # date: 2021-11-18 """Downloads data csv data from the web to a local filepath as either a csv format Usage: src/download_data.py --url=<url> --out_file=<out_file> Options: --url=<url> URL from where to download the data (must be in sta...
[ 2, 1772, 25, 943, 2815, 19305, 666, 11, 14912, 259, 28515, 4121, 11, 16738, 15233, 11, 4312, 5568, 8510, 315, 198, 2, 3128, 25, 33448, 12, 1157, 12, 1507, 198, 198, 37811, 10002, 82, 1366, 269, 21370, 1366, 422, 262, 3992, 284, 257,...
2.792271
207
from time import sleep num = int(input('Digite um número inteiro de 4 digitos: ')) numero = str(num) print('Os digitos do número informado são: ') for c in range(0, 4): sleep(1) print(numero[c])
[ 6738, 640, 1330, 3993, 198, 22510, 796, 493, 7, 15414, 10786, 19511, 578, 23781, 299, 21356, 647, 78, 493, 68, 7058, 390, 604, 16839, 418, 25, 705, 4008, 198, 22510, 3529, 796, 965, 7, 22510, 8, 198, 4798, 10786, 16748, 16839, 418, ...
2.352273
88
from ctm_python_client.core.base import BaseJob
[ 6738, 269, 17209, 62, 29412, 62, 16366, 13, 7295, 13, 8692, 1330, 7308, 33308, 628 ]
3.266667
15
from serial import Serial from time import sleep from datetime import datetime import requests URL = 'http://127.0.0.1:8080/postLog' serial_connection = Serial('/dev/ttyACM0', 9600) while True: id = str(serial_connection.readline()) id = id.strip('\n') state = str(serial_connection.readline()) state...
[ 6738, 11389, 1330, 23283, 198, 6738, 640, 1330, 3993, 198, 6738, 4818, 8079, 1330, 4818, 8079, 198, 11748, 7007, 628, 198, 21886, 796, 705, 4023, 1378, 16799, 13, 15, 13, 15, 13, 16, 25, 1795, 1795, 14, 7353, 11187, 6, 198, 198, 469...
2.528736
174
# ##### BEGIN GPL LICENSE BLOCK ##### # # 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 License, or (at your option) any later version. # # This program is distrib...
[ 2, 46424, 347, 43312, 38644, 38559, 24290, 9878, 11290, 46424, 198, 2, 198, 2, 220, 770, 1430, 318, 1479, 3788, 26, 345, 460, 17678, 4163, 340, 290, 14, 273, 198, 2, 220, 13096, 340, 739, 262, 2846, 286, 262, 22961, 3611, 5094, 1378...
2.696098
2,050
var("x", NUMBER, default=50, min=10, max=301, handler=params) var("y", NUMBER, default=50, min=10, max=301, handler=params) var("r1", NUMBER, default=50, min=10, max=300, handler=params) var("r2", NUMBER, default=50, min=10, max=300, handler=params) paintcircle(x,y,r1,r2)
[ 628, 198, 7785, 7203, 87, 1600, 36871, 13246, 11, 4277, 28, 1120, 11, 949, 28, 940, 11, 3509, 28, 18938, 11, 21360, 28, 37266, 8, 198, 7785, 7203, 88, 1600, 36871, 13246, 11, 4277, 28, 1120, 11, 949, 28, 940, 11, 3509, 28, 18938, ...
2.387931
116
"""querying.py Functions for data discovery. """ import logging import os.path import pandas as pd from sqlalchemy import func, distinct import warnings import xarray as xr from . import database from .database import NCExperiment, NCFile, CFVariable, NCVar def get_experiments(session): """ Returns a Data...
[ 37811, 10819, 1112, 13, 9078, 198, 198, 24629, 2733, 329, 1366, 9412, 13, 198, 198, 37811, 198, 198, 11748, 18931, 198, 11748, 28686, 13, 6978, 198, 11748, 19798, 292, 355, 279, 67, 198, 6738, 44161, 282, 26599, 1330, 25439, 11, 7310, ...
2.437478
2,807
from threading import Thread import time """ The Cat class is a Thread by itself. There must be an __init__ calling Super __init__ with self as an argument. Also, there must be an "run" def. """
[ 6738, 4704, 278, 1330, 14122, 198, 11748, 640, 198, 198, 37811, 383, 5181, 1398, 318, 257, 14122, 416, 2346, 13, 1318, 1276, 307, 281, 11593, 15003, 834, 4585, 3115, 198, 834, 15003, 834, 351, 2116, 355, 281, 4578, 13, 4418, 11, 612, ...
3.769231
52
# IDEA: harvest.py? import sys import socket import simplejson as json from config import config dispatch_table = { "add-project" : add_project, "stop-project" : stop_project, "list-projects" : list_projects, "shutdown" : shutdown, } if len(sys.argv) == 1 or sys.argv[1] not in dispatch_table: p...
[ 2, 4522, 16412, 25, 13222, 13, 9078, 30, 198, 198, 11748, 25064, 198, 11748, 17802, 198, 11748, 2829, 17752, 355, 33918, 198, 198, 6738, 4566, 1330, 4566, 628, 198, 6381, 17147, 62, 11487, 796, 1391, 198, 220, 220, 220, 366, 2860, 12,...
2.627204
397
from datetime import datetime
[ 198, 6738, 4818, 8079, 1330, 4818, 8079, 628, 628, 628, 198 ]
3.363636
11
# Python Program to print Strong Numbers from 1 to N import math maximum = int(input(" Please Enter the Maximum Value: ")) for Number in range(1, maximum): Temp = Number Sum = 0 while(Temp > 0): Reminder = Temp % 10 Factorial = math.factorial(Reminder) Sum = Sum + Factorial ...
[ 2, 11361, 6118, 284, 3601, 13535, 27797, 422, 352, 284, 399, 198, 11748, 10688, 198, 198, 47033, 796, 493, 7, 15414, 7203, 4222, 6062, 262, 22246, 11052, 25, 366, 4008, 198, 198, 1640, 7913, 287, 2837, 7, 16, 11, 5415, 2599, 198, 22...
2.59375
160
# # pip install pyside6 # from PySide6 import QtWidgets, QtGui, QtCore import logging from glglue.ctypesmath.camera import FrameState import glglue.gl3.samplecontroller from glglue.gl3 import gizmo logger = logging.getLogger(__name__) logging.basicConfig(format='%(levelname)s:%(name)s:%(message)s', ...
[ 2, 198, 2, 7347, 2721, 279, 893, 485, 21, 198, 2, 198, 6738, 9485, 24819, 21, 1330, 33734, 54, 312, 11407, 11, 33734, 8205, 72, 11, 33734, 14055, 198, 11748, 18931, 198, 6738, 1278, 4743, 518, 13, 310, 9497, 11018, 13, 25695, 1330, ...
2.426471
204
import psyneulink as pnl import numpy as np import matplotlib.pyplot as plt #sample Hebb FeatureNames=['small','medium','large','red','yellow','blue','circle','rectangle','triangle'] # create a variable that corresponds to the size of our feature space sizeF = len(FeatureNames) small_red_circle = [1,0,0,1,0,0,1,0,0] ...
[ 11748, 17331, 710, 377, 676, 355, 279, 21283, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 2603, 29487, 8019, 13, 9078, 29487, 355, 458, 83, 198, 2, 39873, 679, 11848, 198, 198, 38816, 36690, 28, 17816, 17470, 41707, 24132, 41707, 11...
2.491003
389
import os, hashlib from cryptography.fernet import Fernet import base64 #import ast import json import module_postcode import datetime ''' Encrypt Mode : Fernet Decrypt Mode : Fernet Key size : 32bytes ''' # 키를 사용하기위해 만드는 로직 # 클라이언트에게 보낼 키를 암호화 # 클라이언트에게 받은 키를 복호화
[ 11748, 28686, 11, 12234, 8019, 198, 6738, 45898, 13, 69, 1142, 316, 1330, 38982, 316, 198, 11748, 2779, 2414, 198, 2, 11748, 6468, 198, 11748, 33918, 198, 11748, 8265, 62, 7353, 8189, 198, 11748, 4818, 8079, 628, 198, 198, 7061, 6, 19...
1.4
205
import os from skimage.transform import rescale import numpy as np import matplotlib.pyplot as plt from cv_class.proj1.code.student import vis_hybrid_image, load_image, save_image, my_imfilter, gen_hybrid_image resultsDir = '..' + os.sep + 'results' if not os.path.exists(resultsDir): os.mkdir(resultsDir) test_ima...
[ 11748, 28686, 198, 6738, 1341, 9060, 13, 35636, 1330, 6811, 1000, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 2603, 29487, 8019, 13, 9078, 29487, 355, 458, 83, 198, 6738, 269, 85, 62, 4871, 13, 1676, 73, 16, 13, 8189, 13, 50139, ...
2.454751
1,326
# Copyright 2019 The Feast Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wr...
[ 2, 15069, 13130, 383, 42936, 46665, 198, 2, 198, 2, 49962, 739, 262, 24843, 13789, 11, 10628, 362, 13, 15, 357, 1169, 366, 34156, 15341, 198, 2, 345, 743, 407, 779, 428, 2393, 2845, 287, 11846, 351, 262, 13789, 13, 198, 2, 921, 74...
2.941317
4,601
"""Reversi, by Al Sweigart al@inventwithpython.com A tile flipping game, also called reversi. More info https://en.wikipedia.org/wiki/Reversi""" __version__ = 1 # A version of this game is featured in the book, "Invent Your Own # Computer Games with Python. https://nostarch.com/inventwithpython import random, sys C...
[ 37811, 3041, 690, 72, 11, 416, 978, 19372, 328, 433, 435, 31, 259, 1151, 4480, 29412, 13, 785, 198, 198, 32, 17763, 33097, 983, 11, 635, 1444, 10372, 72, 13, 198, 5167, 7508, 3740, 1378, 268, 13, 31266, 13, 2398, 14, 15466, 14, 30...
2.310649
3,174
import pandas as pd import numpy as np import os from configs import general_config from data_helpers.utils import readNewFile,loadDict import logging import tensorflow as tf """ 将单词列表形式的句子转为句子列表形式的文档, 以"."、"?"、"!"为句子分隔符。 """
[ 11748, 19798, 292, 355, 279, 67, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 28686, 198, 6738, 4566, 82, 1330, 2276, 62, 11250, 198, 6738, 1366, 62, 16794, 364, 13, 26791, 1330, 1100, 3791, 8979, 11, 2220, 35, 713, 198, 11748, 189...
1.879032
124
import numpy as np import pandas as pd from apyori import apriori # Loading the Data data = pd.read_excel('Online_Retail.xlsx') data.head() # Exploring the columns of the data data.columns # Exploring the different regions of transactions data.Country.unique() # Stripping extra spaces in the descriptio...
[ 11748, 299, 32152, 355, 45941, 220, 198, 11748, 19798, 292, 355, 279, 67, 220, 198, 6738, 2471, 88, 10145, 1330, 2471, 7701, 72, 628, 628, 198, 2, 12320, 262, 6060, 220, 198, 7890, 796, 279, 67, 13, 961, 62, 1069, 5276, 10786, 14439...
2.685969
898
from prediction.endpoints import worker_microsoft as endpoints from prediction import request_utils
[ 6738, 17724, 13, 437, 13033, 1330, 8383, 62, 40485, 355, 886, 13033, 198, 6738, 17724, 1330, 2581, 62, 26791 ]
5.210526
19
# Copyright 2020-present NAVER Corp. Under BSD 3-clause license """ Evaluation with kapture objects """ import math from typing import Union, List, Tuple, Set from statistics import mean, median import kapture from kapture.algo.pose_operations import world_pose_transform_distance def evaluate_error_absolute(poses_...
[ 2, 15069, 12131, 12, 25579, 11746, 5959, 11421, 13, 4698, 347, 10305, 513, 12, 565, 682, 5964, 198, 198, 37811, 198, 36, 2100, 2288, 351, 479, 2373, 495, 5563, 198, 37811, 198, 198, 11748, 10688, 198, 6738, 19720, 1330, 4479, 11, 7343...
2.559391
1,709
#!/usr/bin/python # encoding: utf-8 DEBUG = True SQLALCHEMY_ECHO = True SQLALCHEMY_DATABASE_URI = 'mysql://root:mmm13579@127.0.0.1/mysql' SQLALCHEMY_TRACK_MODIFICATIONS = False SQLALCHEMY_ENCODING = 'utf-8'
[ 2, 48443, 14629, 14, 8800, 14, 29412, 198, 2, 21004, 25, 3384, 69, 12, 23, 198, 30531, 796, 6407, 198, 17861, 1847, 3398, 3620, 56, 62, 25994, 46, 796, 6407, 198, 17861, 1847, 3398, 3620, 56, 62, 35, 1404, 6242, 11159, 62, 47269, ...
2.134021
97
initial_health = 100 initial_bitcoins = 0 is_dead = False rooms = input().split('|') health = initial_health bitcoins = initial_bitcoins max_bitcoins = 0 for i in range(len(rooms)): command = rooms[i] tokens = command.split() if tokens[0] == 'potion': health_points = int(tokens[1]...
[ 36733, 62, 13948, 796, 1802, 201, 198, 36733, 62, 2545, 14624, 796, 657, 201, 198, 271, 62, 25124, 796, 10352, 201, 198, 201, 198, 9649, 796, 5128, 22446, 35312, 10786, 91, 11537, 201, 198, 201, 198, 13948, 796, 4238, 62, 13948, 201, ...
2.067742
620
import sys import pytest import toml from single_source.version import ( VERSION_REGEX, VersionNotFoundError, _get_version_from_metadata, _get_version_from_path, get_version, )
[ 11748, 25064, 198, 198, 11748, 12972, 9288, 198, 11748, 284, 4029, 198, 198, 6738, 2060, 62, 10459, 13, 9641, 1330, 357, 198, 220, 220, 220, 44156, 2849, 62, 31553, 6369, 11, 198, 220, 220, 220, 10628, 3673, 21077, 12331, 11, 198, 220...
2.582278
79
""" team_fouls_utils.py This function contains helpful functions for pulling in basketball data for use by team_fouls.py """ from typing import Union, List, Dict import pandas as pd from py_ball import playbyplay, boxscore, scoreboard, player from team_fouls_constants import TWO_MINUTES # Header information neede...
[ 37811, 198, 15097, 62, 69, 42033, 62, 26791, 13, 9078, 198, 198, 1212, 2163, 4909, 7613, 5499, 329, 198, 31216, 278, 287, 9669, 1366, 329, 779, 416, 198, 15097, 62, 69, 42033, 13, 9078, 198, 37811, 198, 198, 6738, 19720, 1330, 4479, ...
2.57458
2,856
import wave import AudioParse import AudioSteganography main()
[ 11748, 6769, 198, 11748, 13491, 10044, 325, 198, 11748, 13491, 7447, 1030, 4867, 198, 198, 12417, 3419 ]
3.705882
17
"""Utility functions for two- and three-dimensional vectors.""" __all__ = [ "quaternion_mult", "quaternion_from_angle_axis", "angle_axis_from_quaternion", "quaternion_conjugate", "rotate_vector", "thick_diagonal", "rotation_matrix", "rotation_about_z", "z_to_vector", "angle_of_v...
[ 37811, 18274, 879, 5499, 329, 734, 12, 290, 1115, 12, 19577, 30104, 526, 15931, 198, 198, 834, 439, 834, 796, 685, 198, 220, 220, 220, 366, 421, 9205, 295, 62, 16680, 1600, 198, 220, 220, 220, 366, 421, 9205, 295, 62, 6738, 62, 92...
2.307269
8,351
import inspect """ An immutable class representing a command, which is anything that has a side effect or is asynchronous. """
[ 11748, 10104, 198, 198, 37811, 198, 2025, 40139, 1398, 10200, 257, 3141, 11, 543, 318, 1997, 326, 468, 257, 1735, 198, 10760, 393, 318, 39354, 13, 198, 37811, 198 ]
4.413793
29
my_func(2, 3, 4, 5, 6, a=7, b=8)
[ 198, 1820, 62, 20786, 7, 17, 11, 513, 11, 604, 11, 642, 11, 718, 11, 257, 28, 22, 11, 275, 28, 23, 8, 198 ]
1.416667
24
# Learning rate parameters BASE_LR = 0.001 EPOCH_DECAY = 30 # number of epochs after which the Learning rate is decayed exponentially. DECAY_WEIGHT = 0.1 # factor by which the learning rate is reduced. # DATASET INFO NUM_CLASSES = 6 # set the number of classes in your dataset DATA_DIR = 'output_dataset/' # ...
[ 201, 198, 2, 18252, 2494, 10007, 201, 198, 33, 11159, 62, 35972, 796, 657, 13, 8298, 201, 198, 8905, 46, 3398, 62, 41374, 4792, 796, 1542, 1303, 1271, 286, 36835, 82, 706, 543, 262, 18252, 2494, 318, 875, 16548, 35529, 13, 201, 198,...
2.908284
338
import logging import sys import time from abc import ABCMeta, abstractmethod import serial import six logger = logging.getLogger(__name__) @six.add_metaclass(ABCMeta)
[ 11748, 18931, 198, 11748, 25064, 198, 11748, 640, 198, 6738, 450, 66, 1330, 9738, 48526, 11, 12531, 24396, 198, 198, 11748, 11389, 198, 11748, 2237, 628, 198, 6404, 1362, 796, 18931, 13, 1136, 11187, 1362, 7, 834, 3672, 834, 8, 628, 1...
3.125
56
import unittest, tempfile, os from pychemy.peptide_sets import * import random import numpy as np AA_dict = {1:'A', 2:'C', 3:'D', 4:'E', 5:'F', 6:'G', 7:'H', 8:'I', 9:'L', 10:'K', 11:'M', 12:'N', 13:'P', 14:'Q', 15:'R', 16:'S', 17:'T', 18:'V', 19:'W', 20:'Y'} ############################### ######...
[ 11748, 555, 715, 395, 11, 20218, 7753, 11, 28686, 198, 6738, 12972, 26599, 13, 431, 457, 485, 62, 28709, 1330, 1635, 198, 11748, 4738, 198, 198, 11748, 299, 32152, 355, 45941, 198, 198, 3838, 62, 11600, 796, 1391, 16, 32105, 32, 3256,...
3.231707
246
""" Objects related to data downloads from the public PTF data server. Based on information and examples in Should work in python 2 and 3. """ import requests import pandas as pd from future.standard_library import install_aliases install_aliases() from urllib.request import urlopen import os __all__ = ['PTFImages'...
[ 37811, 198, 10267, 82, 3519, 284, 1366, 21333, 422, 262, 1171, 350, 10234, 1366, 4382, 13, 13403, 319, 1321, 290, 6096, 198, 259, 220, 220, 198, 198, 19926, 670, 287, 21015, 362, 290, 513, 13, 198, 37811, 198, 11748, 7007, 198, 11748,...
2.204775
2,471
import unittest from analog_noise_estimator import laplacians
[ 11748, 555, 715, 395, 198, 198, 6738, 15075, 62, 3919, 786, 62, 395, 320, 1352, 1330, 8591, 489, 330, 1547 ]
3.1
20
#!/usr/bin/env python3 import re import sys import codecs inputfile = codecs.open(sys.argv[1], mode='r', encoding='utf-8', errors='replace') lineprefix = re.compile(r'^(?P<time>\d+)\s+(?P<rss>\d+)\s+(?P<cpu>\d+\.\d+)\s+(?P<th>\d+) (?P<msg>.*)$') pkgre = re.compile(r'^(?P<result>(?:FAIL|ok |\? ))\tgithub.com/...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 198, 11748, 302, 198, 11748, 25064, 198, 11748, 40481, 82, 628, 628, 198, 198, 15414, 7753, 796, 40481, 82, 13, 9654, 7, 17597, 13, 853, 85, 58, 16, 4357, 4235, 11639, 81, 3256, ...
2.16868
2,235
from .timefrequency_convert import * from .timefrequency_crud import * from .timefrequency_identify import * from .timefrequency_resolution import *
[ 6738, 764, 2435, 35324, 62, 1102, 1851, 1330, 1635, 198, 6738, 764, 2435, 35324, 62, 6098, 463, 1330, 1635, 198, 6738, 764, 2435, 35324, 62, 738, 1958, 1330, 1635, 198, 6738, 764, 2435, 35324, 62, 29268, 1330, 1635, 628 ]
3.846154
39
from todolist_backend.models.classes import BaseODM
[ 6738, 284, 67, 349, 396, 62, 1891, 437, 13, 27530, 13, 37724, 1330, 7308, 3727, 44, 628, 628 ]
3.055556
18
__URL_EU = 'https://api-eu.restb.ai' __URL_US = 'https://api-us.restb.ai' __ENDPOINT = '/vision/v2/predict' __ENDPOINT_MULTIPREDICT = '/vision/v2/multipredict' __MODELS = [ 're_roomtype_global_v2', 're_exterior_styles', 're_features_v3', 're_logo', 're_appliances_v2', 're_compliance', 're_co...
[ 834, 21886, 62, 19684, 796, 705, 5450, 1378, 15042, 12, 12496, 13, 2118, 65, 13, 1872, 6, 198, 834, 21886, 62, 2937, 796, 705, 5450, 1378, 15042, 12, 385, 13, 2118, 65, 13, 1872, 6, 198, 834, 1677, 6322, 46, 12394, 796, 31051, 101...
1.95189
291
# -*- coding: utf-8 -*- """ Created on Wed Jun 9 14:01:42 2021 @author: Ghozy El Fatih """ import matplotlib.pyplot as plt import numpy as np import pandas as pd import scipy.interpolate as inter from PIL import Image #load gambar semblance path_gambar = "IMAGE_PATH\\" path_pick = "PICK_PATH\\normpick"...
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 201, 198, 37811, 201, 198, 41972, 319, 3300, 7653, 220, 860, 1478, 25, 486, 25, 3682, 33448, 201, 198, 201, 198, 31, 9800, 25, 402, 8873, 7357, 2574, 12301, 4449, 201, 198,...
2.091568
1,103
# -*- coding: utf-8 -*- __name__ = 'google_streetview' __author__ = 'Richard Wen' __email__ = 'rrwen.dev@gmail.com' __version__ = '1.2.9' __license__ = 'MIT' __description__ = 'A command line tool and module for Google Street View Image API.' __long_description_content_type__='text/markdown' __keywords__ = [ ...
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 201, 198, 201, 198, 834, 3672, 834, 796, 705, 13297, 62, 25662, 1177, 6, 201, 198, 834, 9800, 834, 796, 705, 22245, 31164, 6, 201, 198, 834, 12888, 834, 796, 705, 21062, ...
2.492188
384
task_estimated_time = 25 # minutes tasks_arriving_distribution_params = 20, 6 # normal distribution with mean 20 and sd 6
[ 198, 35943, 62, 395, 15655, 62, 2435, 796, 1679, 1303, 2431, 198, 83, 6791, 62, 283, 380, 1075, 62, 17080, 3890, 62, 37266, 796, 1160, 11, 718, 1303, 3487, 6082, 351, 1612, 1160, 290, 45647, 718, 198 ]
3.324324
37
a = ('zero', 'um', 'dois', 'três', 'quatro', 'cinco', 'seis', 'sete', 'oito', 'nove', 'dez', 'onze', 'doze', 'treze', 'cartoze', 'quinze') n = int(input('DIGITE UM NÚMERO DE 0 A 15: ')) if n > 15 or n < 0: while True: n = int(input('DIGITE UM NÚMERO DE 0 A 15: ')) if 0 <= n <= 15: break ...
[ 64, 796, 19203, 22570, 3256, 705, 388, 3256, 705, 4598, 271, 3256, 705, 2213, 25792, 82, 3256, 705, 421, 47756, 3256, 705, 17879, 1073, 3256, 705, 325, 271, 3256, 705, 2617, 68, 3256, 705, 78, 10094, 3256, 705, 77, 659, 3256, 705, 2...
1.945652
184
import importlib import os testdir = os.path.dirname(os.path.realpath("__file__")) srcdir = 'src/main/python/daggit' abs_path = os.path.join(testdir, srcdir)
[ 11748, 1330, 8019, 198, 11748, 28686, 198, 198, 9288, 15908, 796, 28686, 13, 6978, 13, 15908, 3672, 7, 418, 13, 6978, 13, 5305, 6978, 7203, 834, 7753, 834, 48774, 198, 10677, 15908, 796, 705, 10677, 14, 12417, 14, 29412, 14, 67, 9460,...
2.580645
62
import setuptools with open("README.md", "r", encoding="utf-8") as fh: long_description = fh.read() setuptools.setup( name="rfm", version="1.0.7", author="Suresh Sonwane", author_email="sonwanesuresh739@gmail.com", description="Python Package for RFM Analysis and Customer Segmentatio...
[ 11748, 900, 37623, 10141, 201, 198, 201, 198, 4480, 1280, 7203, 15675, 11682, 13, 9132, 1600, 366, 81, 1600, 21004, 2625, 40477, 12, 23, 4943, 355, 277, 71, 25, 201, 198, 220, 220, 220, 890, 62, 11213, 796, 277, 71, 13, 961, 3419, ...
2.341709
398
#!/usr/bin/env python import cv2 as cv import numpy as np import matplotlib.pyplot as plt cap = cv.VideoCapture(0) plt.ion() fig = plt.figure(figsize=(10,3)) fig.suptitle('histogram') ax = fig.add_axes([-0.25,0,1,1]) im = ax.imshow(np.zeros((480,640)),'gray',vmin=0,vmax=255) ax.set_axis_off(); ax2 = fig.add_axes([...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 198, 11748, 269, 85, 17, 355, 269, 85, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 2603, 29487, 8019, 13, 9078, 29487, 355, 458, 83, 198, 198, 11128, 796, 269, 85, 13, 10798, 496...
1.884956
339
import logging from sklearn.ensemble import RandomForestRegressor from skopt.space import Integer from lib.models import SKModel
[ 11748, 18931, 198, 198, 6738, 1341, 35720, 13, 1072, 11306, 1330, 14534, 34605, 8081, 44292, 198, 6738, 1341, 8738, 13, 13200, 1330, 34142, 198, 198, 6738, 9195, 13, 27530, 1330, 14277, 17633, 628 ]
4
33
#!/usr/bin/python # -*- coding: utf-8 -*- from web import template from configuration import WEBSITE_NAME, ADMIN_VERSION from auth import get_logged_user, get_logoff_url from model import get_exposed_managed_tables import os rootpath = os.path.abspath(os.path.dirname(__file__)) admin_template_path = templat...
[ 2, 48443, 14629, 14, 8800, 14, 29412, 201, 198, 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 201, 198, 6738, 3992, 1330, 11055, 201, 198, 6738, 8398, 1330, 12887, 4462, 12709, 62, 20608, 11, 5984, 23678, 62, 43717, 201,...
2.791045
134
__version__='0.41-beta'
[ 834, 9641, 834, 11639, 15, 13, 3901, 12, 31361, 6, 198 ]
2.181818
11
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import serial import click import platform import glob import json import signal import sys from itertools import cycle from influxdb import InfluxDBClient serial_port = serial.Serial() client = None progress_pool = cycle(["_ ", "__ ", "___"]) @click.command() @click.o...
[ 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, 11389, 198, 11748, 3904, 198, 11748, 3859, 198, 11748, 15095, 198, 11748, 33918, 198, 11748, 6737, 198, ...
1.957559
2,851
# Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use ...
[ 2, 49962, 284, 262, 24843, 10442, 5693, 357, 1921, 37, 8, 739, 530, 393, 517, 198, 2, 18920, 5964, 11704, 13, 220, 4091, 262, 28536, 2393, 9387, 351, 198, 2, 428, 670, 329, 3224, 1321, 5115, 6634, 9238, 13, 198, 2, 383, 7054, 37, ...
3.637771
323
"""Converts images to TFRecords file format with Example protos.""" import os import sys import glob import json import tensorflow as tf from PIL import Image import tifffile import numpy as np import Utils from Label import class2label def convertTo( input_path_list, output_path, class_label_file_path...
[ 37811, 3103, 24040, 4263, 284, 24958, 6690, 3669, 2393, 5794, 351, 17934, 1237, 418, 526, 15931, 198, 198, 11748, 28686, 198, 11748, 25064, 198, 11748, 15095, 198, 11748, 33918, 198, 11748, 11192, 273, 11125, 355, 48700, 198, 6738, 350, 4...
1.816817
1,332
import os import numpy as np import pandas as pd import glob as glob import matplotlib.pyplot as plt # import scipy.stats # import seaborn as sns # from sklearn import metrics as skm import math from collections import Counter import networkx as nx import matplotlib.lines as mlines from itertools import combinations im...
[ 11748, 28686, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 19798, 292, 355, 279, 67, 198, 11748, 15095, 355, 15095, 198, 11748, 2603, 29487, 8019, 13, 9078, 29487, 355, 458, 83, 198, 2, 1330, 629, 541, 88, 13, 34242, 198, 2, 1330, ...
2.021696
3,503
# -*- coding: utf-8 -*- import click import platform import tcfcli.common.base_infor as infor from tcfcli.help.message import ConfigureHelp as help from tcfcli.common.user_config import UserConfig from tcfcli.common.operation_msg import Operation version = platform.python_version() if version >= '3': from functoo...
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 198, 11748, 3904, 198, 11748, 3859, 198, 11748, 256, 12993, 44506, 13, 11321, 13, 8692, 62, 259, 1640, 355, 1167, 273, 198, 6738, 256, 12993, 44506, 13, 16794, 13, 20500...
2.059024
1,762
#!/usr/bin/env python """ 4. Use TextFSM to parse the 'show arp' output from a Juniper SRX (see link below). Extract the following fields into tabular data: MAC Address, Address, Name, Interface. https://github.com/ktbyers/pyplus_course/blob/master/class4/exercises/ex4_junos_show_arp.txt """
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 198, 37811, 198, 19, 13, 5765, 8255, 10652, 44, 284, 21136, 262, 705, 12860, 610, 79, 6, 5072, 422, 257, 7653, 9346, 16808, 55, 357, 3826, 2792, 2174, 737, 220, 198, 11627, 974, 262,...
2.901961
102
"""Import a file from Illumina BaseSpace.""" import atexit import gzip import os import time import traceback from pathlib import Path from requests import RequestException, Session from resolwe.process import ( BooleanField, FileField, GroupField, IntegerField, Persistence, Process, Secr...
[ 37811, 20939, 257, 2393, 422, 39256, 1437, 7308, 14106, 526, 15931, 198, 198, 11748, 379, 37023, 198, 11748, 308, 13344, 198, 11748, 28686, 198, 11748, 640, 198, 11748, 12854, 1891, 198, 6738, 3108, 8019, 1330, 10644, 198, 198, 6738, 7007...
2.225077
3,892
import re if __name__ == '__main__': filename = 'data/wiki_humble_monthly.txt' verbose = True bundles = build_dictionary(filename, verbose) print(bundles)
[ 11748, 302, 628, 628, 628, 198, 361, 11593, 3672, 834, 6624, 705, 834, 12417, 834, 10354, 198, 220, 220, 220, 29472, 796, 705, 7890, 14, 15466, 62, 71, 10344, 62, 8424, 306, 13, 14116, 6, 198, 220, 220, 220, 15942, 577, 796, 6407, ...
2.528571
70
''' Manage Azure Database for MySQL servers. ''' from .. pyaz_utils import _call_az from . import db, flexible_server, server, server_logs
[ 7061, 6, 198, 5124, 496, 22134, 24047, 329, 33476, 9597, 13, 198, 7061, 6, 198, 6738, 11485, 12972, 1031, 62, 26791, 1330, 4808, 13345, 62, 1031, 198, 6738, 764, 1330, 20613, 11, 12846, 62, 15388, 11, 4382, 11, 4382, 62, 6404, 82, 6...
3.255814
43
import pandas as pd import numpy as np from pathlib import Path from sklearn.preprocessing import QuantileTransformer, StandardScaler, LabelEncoder from utils import read_data from config import UTILITY if __name__=="__main__": print("Reading data") train = read_data("train") test = read_data("t...
[ 11748, 19798, 292, 355, 279, 67, 198, 11748, 299, 32152, 355, 45941, 198, 6738, 3108, 8019, 1330, 10644, 198, 6738, 1341, 35720, 13, 3866, 36948, 1330, 16972, 576, 8291, 16354, 11, 8997, 3351, 36213, 11, 36052, 27195, 12342, 198, 198, 6...
2.364683
521
import os import logging from logging.handlers import RotatingFileHandler # Set the logs VERBOSITY = os.getenv( "VERBOSITY", "debug" ) # info as default, #debug for local dev LOG_PATH = os.getenv("LOG_PATH", "./logs") # Define the logs # Set verbosity ROWS = 40 COLUMNS = 40 MAX_PROB = 2 MAX_TICK = 60
[ 11748, 28686, 198, 11748, 18931, 198, 6738, 18931, 13, 4993, 8116, 1330, 18481, 803, 8979, 25060, 198, 198, 2, 5345, 262, 17259, 198, 5959, 33, 2640, 9050, 796, 28686, 13, 1136, 24330, 7, 198, 220, 220, 220, 366, 5959, 33, 2640, 9050,...
2.652542
118
str = 'ABC' print Solution().convert(str, 1)
[ 198, 2536, 796, 705, 24694, 6, 198, 4798, 28186, 22446, 1102, 1851, 7, 2536, 11, 352, 8 ]
2.647059
17
#!/usr/bin/env python """ Lists key(s) detail(s) visible to the supplied Cosm user API key To use this script you must create a text file containing your API key and pass it to this script using the --keyfile argument as follows: List all keys visible to supplied key: $ key_view.py --keyfile=/path/to/apikey/file Li...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 198, 37811, 198, 43, 1023, 1994, 7, 82, 8, 3703, 7, 82, 8, 7424, 284, 262, 14275, 10437, 76, 2836, 7824, 1994, 198, 198, 2514, 779, 428, 4226, 345, 1276, 2251, 257, 2420, 2393, 726...
2.831144
533
import logging import torch from torch.nn import functional as F import torch.nn as nn import torch.utils.checkpoint as cp from mmcv.runner.checkpoint import open_mmlab_model_urls, load_state_dict from torch.nn.modules.batchnorm import _BatchNorm import os import os.path as osp import pkgutil import time i...
[ 11748, 18931, 201, 198, 11748, 28034, 201, 198, 6738, 28034, 13, 20471, 1330, 10345, 355, 376, 201, 198, 11748, 28034, 13, 20471, 355, 299, 77, 201, 198, 11748, 28034, 13, 26791, 13, 9122, 4122, 355, 31396, 201, 198, 6738, 8085, 33967, ...
2.551451
1,137
#!/usr/bin/env python3 import pprint import collections if __name__ == '__main__': with open('day6_input.txt') as f: data = [line for line in f.read().split("\n") if line != ''] pprint.pprint(solve1(data)) pprint.pprint(solve2(data))
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 198, 11748, 279, 4798, 198, 11748, 17268, 628, 198, 198, 361, 11593, 3672, 834, 6624, 705, 834, 12417, 834, 10354, 198, 220, 220, 220, 351, 1280, 10786, 820, 21, 62, 15414, 13, 1...
2.376147
109
from typing import NamedTuple, Optional # =======================
[ 6738, 19720, 1330, 34441, 51, 29291, 11, 32233, 628, 198, 198, 2, 36658, 50155, 628 ]
4.666667
15
"""Custom type definitions""" import pathlib # noqa: F401 import typing PathOrString = typing.Union[str, pathlib.Path] OptionalString = typing.Optional[str] StringList = typing.List[str] AnyList = typing.List[typing.Any] OptionalStringList = typing.Union[OptionalString, StringList] DictOfAny = typing.Dict[str, typing...
[ 37811, 15022, 2099, 17336, 37811, 198, 11748, 3108, 8019, 220, 1303, 645, 20402, 25, 376, 21844, 198, 11748, 19720, 198, 198, 15235, 5574, 10100, 796, 19720, 13, 38176, 58, 2536, 11, 3108, 8019, 13, 15235, 60, 198, 30719, 10100, 796, 19...
3.111111
117
# -*- coding: utf-8 -*- """ Created on Tue Jul 6 16:53:38 2021 @author: keikei """ """ There are n children standing in a line. Each child is assigned a rating value given in the integer array ratings. You are giving candies to these children subjected to the following requirements: Each child must have at least...
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 37811, 198, 41972, 319, 30030, 5979, 220, 718, 1467, 25, 4310, 25, 2548, 33448, 198, 198, 31, 9800, 25, 885, 522, 72, 198, 37811, 198, 198, 37811, 220, 198, 1858, 389,...
3.774436
133
from __future__ import annotations from .vector import T as vector from .point import T as point from .piece import T as piece from .plf import T as plf
[ 6738, 11593, 37443, 834, 1330, 37647, 198, 6738, 764, 31364, 1330, 309, 355, 15879, 198, 6738, 764, 4122, 1330, 309, 355, 966, 198, 6738, 764, 12239, 1330, 309, 355, 3704, 198, 6738, 764, 489, 69, 1330, 309, 355, 458, 69, 198 ]
3.731707
41
################################################################################# # Copyright (c) 2018-2021, Texas Instruments Incorporated - http://www.ti.com # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditio...
[ 29113, 29113, 14468, 2, 198, 2, 15069, 357, 66, 8, 2864, 12, 1238, 2481, 11, 3936, 43953, 3457, 40132, 532, 2638, 1378, 2503, 13, 20259, 13, 785, 198, 2, 1439, 6923, 33876, 13, 198, 2, 198, 2, 2297, 396, 3890, 290, 779, 287, 2723,...
4.31891
624
from typing import Tuple from ground.base import Relation from ground.hints import (Multisegment, Polygon) from hypothesis import given from orient.planar import (multisegment_in_polygon, segment_in_polygon) from tests.utils import (LINEAR_COMPOUND_RELATIONS, ...
[ 6738, 19720, 1330, 309, 29291, 198, 198, 6738, 2323, 13, 8692, 1330, 4718, 341, 198, 6738, 2323, 13, 71, 29503, 1330, 357, 15205, 786, 5154, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, ...
1.926496
585
import numpy as np from mountainlab_pytools import mdaio processor_name='ephys.synthesize_random_firings' processor_version='0.14' def synthesize_random_firings(*,firings_out,K=20,samplerate=30000,duration=60): """ Synthesize random waveforms for use in creating a synthetic timeseries dataset Parameters ...
[ 11748, 299, 32152, 355, 45941, 198, 198, 6738, 8598, 23912, 62, 9078, 31391, 1330, 285, 6814, 952, 198, 198, 41341, 62, 3672, 11639, 27446, 893, 13, 1837, 429, 956, 1096, 62, 25120, 62, 69, 343, 654, 6, 198, 41341, 62, 9641, 11639, ...
2.320904
885
import threading import logging import inspect from talon import cron, noise, Context from user.utils import context_active class _HandlerMapper(object): """Maps contexts to custom handlers. Workaround for contexts being unable to be added directly. """ def add(self, context, handler, priority=0)...
[ 11748, 4704, 278, 198, 11748, 18931, 198, 11748, 10104, 198, 198, 6738, 3305, 261, 1330, 1067, 261, 11, 7838, 11, 30532, 198, 6738, 2836, 13, 26791, 1330, 4732, 62, 5275, 628, 198, 198, 4871, 4808, 25060, 44, 11463, 7, 15252, 2599, 19...
2.824561
1,083
# Return the first 10 surface indices of an UnstructuredGrid. # from pyvista import examples grid = examples.load_hexbeam() ind = grid.surface_indices() ind[:10] # doctest:+SKIP # Expected: ## pyvista_ndarray([ 0, 2, 36, 27, 7, 8, 81, 1, 18, 4])
[ 2, 8229, 262, 717, 838, 4417, 36525, 286, 281, 791, 7249, 1522, 41339, 13, 198, 2, 198, 6738, 12972, 85, 12523, 1330, 6096, 198, 25928, 796, 6096, 13, 2220, 62, 33095, 40045, 3419, 198, 521, 796, 10706, 13, 42029, 62, 521, 1063, 341...
2.597938
97
from django import forms from .models import Temperature class TemperatureCreateForm(forms.ModelForm): """ Temperature create form """
[ 6738, 42625, 14208, 1330, 5107, 628, 198, 6738, 764, 27530, 1330, 34467, 628, 198, 4871, 34467, 16447, 8479, 7, 23914, 13, 17633, 8479, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 34467, 2251, 1296, 198, 220, 220, 220, 37227, ...
3.595238
42
import cv2 import urllib2 import numpy as np import sys host = "192.168.1.85:8080" if len(sys.argv)>1: host = sys.argv[1] hoststr = 'http://' + host + '/?action=stream' print 'Streaming ' + hoststr print 'Print Esc to quit' stream=urllib2.urlopen(hoststr) bytes='' while True: bytes+=stream.read(1024) a = b...
[ 11748, 269, 85, 17, 198, 11748, 2956, 297, 571, 17, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 25064, 198, 4774, 796, 366, 17477, 13, 14656, 13, 16, 13, 5332, 25, 1795, 1795, 1, 198, 361, 18896, 7, 17597, 13, 853, 85, 8, 29, ...
1.982249
338
import sys input = sys.stdin.readline xmax, ymax = list(map(int, input().split())) x, y = list(map(int, input().split())) posx, posy = 0, 0 while(x != 0 or y != 0): posx += x posy += y if posx < 0: posx = 0 if posx > xmax: posx = xmax if posy < 0: posy = 0 if posy > ...
[ 11748, 25064, 198, 15414, 796, 25064, 13, 19282, 259, 13, 961, 1370, 198, 198, 87, 9806, 11, 331, 9806, 796, 1351, 7, 8899, 7, 600, 11, 5128, 22446, 35312, 3419, 4008, 628, 198, 87, 11, 331, 796, 1351, 7, 8899, 7, 600, 11, 5128, ...
1.930233
215
## # Copyright (c) 2010-2017 Apple 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 applicable l...
[ 2235, 198, 2, 15069, 357, 66, 8, 3050, 12, 5539, 4196, 3457, 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, ...
2.466543
19,891
from .sensitivity import solve_sensitivity from .monte_carlo import solve_monte_carlo from ..model_parser import ModelParser
[ 6738, 764, 82, 40545, 1330, 8494, 62, 82, 40545, 198, 6738, 764, 2144, 660, 62, 7718, 5439, 1330, 8494, 62, 2144, 660, 62, 7718, 5439, 198, 198, 6738, 11485, 19849, 62, 48610, 1330, 9104, 46677 ]
3.571429
35