content
stringlengths
1
1.04M
input_ids
listlengths
1
774k
ratio_char_token
float64
0.38
22.9
token_count
int64
1
774k
"""Methods for handling probability distributions.""" import numpy import pandas import scipy.stats from gewittergefahr.gg_utils import error_checking FEATURE_NAMES_KEY = 'feature_names' FEATURE_MEANS_KEY = 'feature_means' COVARIANCE_MATRIX_KEY = 'covariance_matrix' COVAR_MATRIX_INVERSE_KEY = 'covar_matrix_inverse' C...
[ 37811, 46202, 329, 9041, 12867, 24570, 526, 15931, 198, 198, 11748, 299, 32152, 198, 11748, 19798, 292, 198, 11748, 629, 541, 88, 13, 34242, 198, 6738, 308, 413, 1967, 469, 69, 993, 81, 13, 1130, 62, 26791, 1330, 4049, 62, 41004, 198,...
2.370356
7,833
import gzip from logging.handlers import TimedRotatingFileHandler import os import shutil
[ 11748, 308, 13344, 198, 6738, 18931, 13, 4993, 8116, 1330, 5045, 276, 24864, 803, 8979, 25060, 198, 11748, 28686, 198, 11748, 4423, 346, 628, 198 ]
3.68
25
import json import os import re import subprocess import sys from time import sleep import requests SIGNATURE = ( "This formatting comment was generated automatically by a script in" " [uc-cdis/wool](https://github.com/uc-cdis/wool)." ) ASK_FOR_FORMAT_COMMIT = ["wool", "black", "please format my code"] d...
[ 11748, 33918, 198, 11748, 28686, 198, 11748, 302, 198, 11748, 850, 14681, 198, 11748, 25064, 198, 6738, 640, 1330, 3993, 198, 198, 11748, 7007, 628, 198, 46224, 40086, 796, 357, 198, 220, 220, 220, 366, 1212, 33313, 2912, 373, 7560, 633...
2.423775
3,693
# # Quadroscope - entry point # # The four camera system for raspberries. # import os, os.path, sys, json, time, thread, datetime, logging import picamera logging.basicConfig(filename='camera.log', level=logging.DEBUG) from quadlib.utils import log from quadlib import convert from quadlib.updater import Updat...
[ 2, 198, 2, 220, 220, 48447, 29982, 532, 5726, 966, 198, 2, 198, 2, 220, 220, 383, 1440, 4676, 1080, 329, 374, 5126, 20853, 13, 198, 2, 220, 220, 220, 198, 198, 11748, 28686, 11, 28686, 13, 6978, 11, 25064, 11, 33918, 11, 640, 11...
2.711033
1,142
# Copyright (c) 2015 Hewlett-Packard Development Company, L.P. # # 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...
[ 2, 15069, 357, 66, 8, 1853, 30446, 15503, 12, 11869, 446, 7712, 5834, 11, 406, 13, 47, 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, 239...
3.547445
274
#!/usr/bin/env python from twisted.internet import reactor from twisted.web.resource import Resource from twisted.web.server import Site import os, sys sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) from pyws.adapters._twisted import serve from server import server #noinspection ...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 198, 6738, 19074, 13, 37675, 1330, 21905, 198, 6738, 19074, 13, 12384, 13, 31092, 1330, 20857, 198, 6738, 19074, 13, 12384, 13, 15388, 1330, 14413, 198, 198, 11748, 28686, 11, 25064, 198...
3.1
140
from django.apps import AppConfig
[ 6738, 42625, 14208, 13, 18211, 1330, 2034, 16934, 628 ]
3.888889
9
from multiprocessing import Pool as ProcessPool from multiprocessing.dummy import Pool as ThreadPool from common import timed NUM_WORKERS = 8 # four cores def fib(n): """Calculate the n-th element of Fibonacci.""" a, b = 1, 1 while n > 1: a, b = b, a + b n -= 1 return a timed(fib, ...
[ 6738, 18540, 305, 919, 278, 1330, 19850, 355, 10854, 27201, 198, 6738, 18540, 305, 919, 278, 13, 67, 13513, 1330, 19850, 355, 14122, 27201, 198, 6738, 2219, 1330, 28805, 198, 198, 41359, 62, 33249, 4877, 796, 807, 220, 1303, 1440, 21758...
2.448387
310
""" Communicate with a Keysight 3458A digital multimeter. """ from . import equipment from .dmm import DMM @equipment(manufacturer=r'Keysight', model=r'3458A')
[ 37811, 198, 30813, 5344, 351, 257, 26363, 432, 513, 29334, 32, 4875, 1963, 16912, 13, 198, 37811, 198, 6738, 764, 1330, 5112, 198, 6738, 764, 67, 3020, 1330, 360, 12038, 628, 198, 31, 4853, 4667, 7, 48119, 15051, 28, 81, 6, 40729, 4...
3.056604
53
import time import torch from queue import Queue import numpy as np def binary_accuracy(preds, y): """ Returns accuracy per batch, i.e. if you get 8/10 right, this returns 0.8, NOT 8 """ #round predictions to the closest integer rounded_preds = torch.round(torch.sigmoid(preds)) correct = (roun...
[ 11748, 640, 198, 11748, 28034, 198, 6738, 16834, 1330, 4670, 518, 198, 11748, 299, 32152, 355, 45941, 198, 198, 4299, 13934, 62, 4134, 23843, 7, 28764, 82, 11, 331, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 16409, 9922, 583...
2.918919
148
## cover.py import array import numpy as np import numpy.typing as npt import scipy.sparse as sp from numpy.typing import ArrayLike from scipy.sparse import csc_matrix, diags from scipy.sparse.csgraph import minimum_spanning_tree,connected_components from .distance import * from .distance import is_dist_like from .uti...
[ 2235, 3002, 13, 9078, 198, 11748, 7177, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 299, 32152, 13, 774, 13886, 355, 299, 457, 198, 11748, 629, 541, 88, 13, 82, 29572, 355, 599, 198, 6738, 299, 32152, 13, 774, 13886, 1330, 15690, ...
2.978066
2,234
if __name__ == '__main__': import argparse parser = argparse.ArgumentParser() parser.add_argument('--storage_bucket', type=str) args = parser.parse_args() mnisttrain(args.storage_bucket)
[ 198, 361, 11593, 3672, 834, 6624, 705, 834, 12417, 834, 10354, 198, 220, 220, 220, 1330, 1822, 29572, 628, 220, 220, 220, 30751, 796, 1822, 29572, 13, 28100, 1713, 46677, 3419, 198, 220, 220, 220, 30751, 13, 2860, 62, 49140, 10786, 43...
2.64557
79
import sys import time import netlink import numpy as np import utils from read_bfee import BeamformReader from realtime_graph import RealtimeGraph if __name__ == "__main__": rxChains = "ABC" #utils.configure_rx_chains(rxChains) gType = "default" if len(sys.argv) == 2: gType = sys.argv[1] ...
[ 11748, 25064, 198, 11748, 640, 198, 198, 11748, 2010, 8726, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 3384, 4487, 198, 6738, 1100, 62, 19881, 1453, 1330, 25855, 687, 33634, 198, 6738, 1103, 2435, 62, 34960, 1330, 6416, 2435, 37065, ...
2.222591
301
from .create import CreateTodoForm
[ 6738, 764, 17953, 1330, 13610, 51, 24313, 8479, 198 ]
3.888889
9
""" Functions for monkey patching functions in other modules. See https://en.wikipedia.org/wiki/Monkey_patch There are other excellent libraries for this, which unfortunately don't excactly match our use case: - https://github.com/christophercrouzet/gorilla - https://github.com/iki/monkeypatch - https://github.com/thea...
[ 37811, 198, 24629, 2733, 329, 21657, 8529, 278, 5499, 287, 584, 13103, 13, 4091, 3740, 1378, 268, 13, 31266, 13, 2398, 14, 15466, 14, 9069, 2539, 62, 17147, 198, 1858, 389, 584, 6275, 12782, 329, 428, 11, 543, 12716, 836, 470, 2859, ...
2.979412
680
import logging from types import TracebackType from typing import Optional, cast from common.exception_enums import ExceptionGroup from common.exception_handler import ExceptionHandler from dask.utils import funcname from distributed import Scheduler, Worker from distributed.diagnostics.plugin import SchedulerPlugin, ...
[ 11748, 18931, 198, 6738, 3858, 1330, 34912, 1891, 6030, 198, 6738, 19720, 1330, 32233, 11, 3350, 198, 198, 6738, 2219, 13, 1069, 4516, 62, 268, 5700, 1330, 35528, 13247, 198, 6738, 2219, 13, 1069, 4516, 62, 30281, 1330, 35528, 25060, 19...
4.229167
96
t=0 s=0 for i in range(1,500): t=i for j in range(1,t): if(t%j==0): s=s+j if s==i: print(s,end=" ") s=0 t=0
[ 83, 28, 15, 201, 198, 82, 28, 15, 201, 198, 1640, 1312, 287, 2837, 7, 16, 11, 4059, 2599, 201, 198, 220, 220, 220, 256, 28, 72, 201, 198, 220, 220, 220, 329, 474, 287, 2837, 7, 16, 11, 83, 2599, 201, 198, 220, 220, 220, 220,...
1.386555
119
# Generated by Django 3.1.8 on 2021-07-20 00:47 import dictators.dictators_game.models from django.db import migrations, models
[ 2, 2980, 515, 416, 37770, 513, 13, 16, 13, 23, 319, 33448, 12, 2998, 12, 1238, 3571, 25, 2857, 198, 198, 11748, 20591, 13, 11600, 2024, 62, 6057, 13, 27530, 198, 6738, 42625, 14208, 13, 9945, 1330, 15720, 602, 11, 4981, 628 ]
3.095238
42
from django.conf.urls import include, url from django.contrib import messages as django_messages from django.templatetags.static import static from django.shortcuts import redirect from django.urls import reverse from django.utils.html import format_html from django.utils.translation import ugettext_lazy as _ import s...
[ 6738, 42625, 14208, 13, 10414, 13, 6371, 82, 1330, 2291, 11, 19016, 198, 6738, 42625, 14208, 13, 3642, 822, 1330, 6218, 355, 42625, 14208, 62, 37348, 1095, 198, 6738, 42625, 14208, 13, 11498, 489, 265, 316, 3775, 13, 12708, 1330, 9037, ...
3.266667
315
""" Get API information encoded in C files. See ``find_function`` for how functions should be formatted, and ``read_order`` for how the order of the functions should be specified. """ import sys, os, re import md5 import textwrap from os.path import join __docformat__ = 'restructuredtext' # The files under src/ tha...
[ 37811, 198, 3855, 7824, 1321, 30240, 287, 327, 3696, 13, 198, 198, 6214, 7559, 19796, 62, 8818, 15506, 329, 703, 5499, 815, 307, 39559, 11, 290, 198, 15506, 961, 62, 2875, 15506, 329, 703, 262, 1502, 286, 262, 5499, 815, 307, 198, 2...
1.935902
2,933
""" Base class for RoBO algorithms. """ import george import numpy from orion.algo.base import BaseAlgorithm from robo.acquisition_functions.ei import EI from robo.acquisition_functions.lcb import LCB from robo.acquisition_functions.log_ei import LogEI from robo.acquisition_functions.pi import PI from robo.initial_desi...
[ 37811, 198, 14881, 1398, 329, 5564, 8202, 16113, 13, 198, 37811, 198, 11748, 4903, 3643, 198, 11748, 299, 32152, 198, 6738, 393, 295, 13, 282, 2188, 13, 8692, 1330, 7308, 2348, 42289, 198, 6738, 686, 2127, 13, 43561, 10027, 62, 12543, ...
2.431529
4,250
from demo.my_logger import getLogger testing()
[ 6738, 13605, 13, 1820, 62, 6404, 1362, 1330, 651, 11187, 1362, 628, 198, 198, 33407, 3419, 198 ]
2.941176
17
import tensorflow as tf import numpy as np def read_and_decode_batch(filename_queue, batch_size, capacity, min_after_dequeue): """Dequeue a batch of data from the TFRecord. Args: filename_queue: Filename Queue of the TFRecord. batch_size: How many records dequeued each time. capacity: The...
[ 11748, 11192, 273, 11125, 355, 48700, 201, 198, 11748, 299, 32152, 355, 45941, 201, 198, 201, 198, 201, 198, 4299, 1100, 62, 392, 62, 12501, 1098, 62, 43501, 7, 34345, 62, 36560, 11, 15458, 62, 7857, 11, 5339, 11, 949, 62, 8499, 62,...
2.140709
2,793
from .hub_interface import * # noqa from .model import * # noqa
[ 6738, 764, 40140, 62, 39994, 1330, 1635, 220, 1303, 645, 20402, 198, 6738, 764, 19849, 1330, 1635, 220, 1303, 645, 20402 ]
3.095238
21
# Copyright (c) 2012 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. # All Rights Reserved # # 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...
[ 2, 15069, 357, 66, 8, 2321, 20472, 402, 28610, 265, 2638, 1378, 70, 28610, 265, 13, 2398, 14, 198, 2, 15069, 357, 66, 8, 2321, 6186, 13, 785, 11, 3457, 13, 393, 663, 29116, 13, 198, 2, 1439, 6923, 33876, 198, 2, 198, 2, 2448, ...
3.305065
849
# type: ignore[misc] """yt-dlg module that contains util functions. Attributes: YOUTUBEDL_BIN (string): Youtube-dl binary filename. """ from __future__ import annotations import locale import math import os import subprocess import sys from pathlib import Path from .info import __appname__ IS_WINDOWS = os.nam...
[ 2, 2099, 25, 8856, 58, 44374, 60, 198, 37811, 20760, 12, 25404, 70, 8265, 326, 4909, 7736, 5499, 13, 198, 198, 29021, 25, 628, 220, 220, 220, 7013, 51, 10526, 1961, 43, 62, 33, 1268, 357, 8841, 2599, 27431, 12, 25404, 13934, 29472, ...
2.468236
3,101
"""Permit List module""" import json import falcon import jsend import sentry_sdk from screendoor_sdk.screendoor import Screendoor class PermitList(): """Permit List class""" scrndr = None scrndr_proj_id = None logger_name = '' referred_label_map = { 'MOD - Referred' : "Mayor's Office of D...
[ 37811, 5990, 2781, 7343, 8265, 37811, 198, 11748, 33918, 198, 11748, 24215, 1102, 198, 11748, 474, 21280, 198, 11748, 1908, 563, 62, 21282, 74, 198, 6738, 629, 260, 437, 2675, 62, 21282, 74, 13, 1416, 260, 437, 2675, 1330, 1446, 260, ...
1.932584
4,539
# Copyright 2020 Mathew Odden <mathewrodden@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
[ 2, 15069, 12131, 6550, 6391, 440, 4742, 1279, 6759, 6391, 305, 4742, 31, 14816, 13, 785, 29, 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, 239...
2.470229
655
from .helpers import Importer if __name__ == '__main__': run()
[ 6738, 764, 16794, 364, 1330, 1846, 26634, 628, 198, 198, 361, 11593, 3672, 834, 6624, 705, 834, 12417, 834, 10354, 198, 220, 220, 220, 1057, 3419, 198 ]
2.592593
27
bl_info = { "name": "Torque Terrain (TER) format", "author": "port", "version": (0, 0, 1), "blender": (2, 76, 0), "location": "File > Import > Torque Terrain", "description": "Import Torque Terrain (TER) files", "warning": "", "support": "COMMUNITY", "category": "Import-Export" } if...
[ 2436, 62, 10951, 796, 1391, 198, 220, 220, 220, 366, 3672, 1298, 366, 15884, 4188, 3813, 3201, 357, 5781, 8, 5794, 1600, 198, 220, 220, 220, 366, 9800, 1298, 366, 634, 1600, 198, 220, 220, 220, 366, 9641, 1298, 357, 15, 11, 657, 1...
2.255583
403
#!/usr/bin/env python """Define Class `FastaSplitter` which splits a fasta file into smaller files each containing `reads_per_split` reads.""" import os import os.path as op import sys from pbcore.io import FastaWriter from pbtranscript.Utils import mkdir from pbtranscript.io.ContigSetReaderWrapper import ContigSetR...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 37811, 7469, 500, 5016, 4600, 22968, 64, 26568, 1967, 63, 543, 30778, 257, 3049, 64, 2393, 656, 198, 17470, 263, 3696, 1123, 7268, 4600, 40779, 62, 525, 62, 35312, 63, 9743, 526, 15931...
2.143382
1,904
import torch import numpy as np import pickle import matplotlib.pyplot as plt n_ring = 16 hbar = 1.0 k = 1.0 kbt = 0.1 beta = 10.0 with open('tmp.pkl', 'rb') as f: pos, pot, kin = pickle.load(f) pot = torch.stack(pot).mean() kin = torch.stack(kin).mean() print(pot + kin) pos = torch.stack(pos).flatten() hist,...
[ 11748, 28034, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 2298, 293, 198, 11748, 2603, 29487, 8019, 13, 9078, 29487, 355, 458, 83, 198, 198, 77, 62, 1806, 796, 1467, 198, 71, 5657, 796, 352, 13, 15, 198, 74, 796, 352, 13, 15, ...
2.124567
289
class NoCurrentVersionFound(KeyError): """ No version node of the a particular parent node could be found """ pass class VersionDoesNotBelongToNode(AssertionError): """ The version that is trying to be attached does not belong to the parent node """ pass
[ 198, 198, 4871, 1400, 11297, 14815, 21077, 7, 9218, 12331, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 1400, 2196, 10139, 286, 262, 257, 1948, 2560, 10139, 714, 307, 1043, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 1208, ...
3.11828
93
import matplotlib.pyplot as plt import matplotlib as mpl import pandas as pd from pathlib import Path import re filename = Path('courantnumber_max-rfile.out') mpl.rcParams['font.family'] = 'serif' mpl.rcParams['font.serif'] = 'Computer Modern' mpl.rcParams['font.size'] = 18 mpl.rcParams['mathtext.fontset'] = 'cm' mpl...
[ 11748, 2603, 29487, 8019, 13, 9078, 29487, 355, 458, 83, 198, 11748, 2603, 29487, 8019, 355, 285, 489, 198, 11748, 19798, 292, 355, 279, 67, 198, 6738, 3108, 8019, 1330, 10644, 198, 11748, 302, 198, 198, 34345, 796, 10644, 10786, 43220,...
2.657534
438
# -*- coding: utf-8 -*- from django import forms from django.forms import inlineformset_factory from django.utils.translation import ugettext_lazy as _ from djangosige.apps.cadastro.models import Pessoa, Endereco, Telefone, Email, Site, Banco, Documento EnderecoFormSet = inlineformset_factory( ...
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 201, 198, 201, 198, 6738, 42625, 14208, 1330, 5107, 201, 198, 6738, 42625, 14208, 13, 23914, 1330, 26098, 687, 2617, 62, 69, 9548, 201, 198, 6738, 42625, 14208, 13, 26791, 13...
2.505495
364
# common.py TRANSLATE = [('->', '$\\rightarrow$'), ('...', '\\dots '), ('[', '$[$'), (']', '$]$'), ('_', '\\_')]
[ 2, 2219, 13, 9078, 198, 198, 5446, 1565, 8634, 6158, 796, 685, 10786, 3784, 3256, 705, 3, 6852, 3506, 6018, 3, 33809, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 19203, 986, 3256, 705, 6852, 67, 1747, 705, 828...
1.541284
109
import warnings import numpy as np import pandas as pd warnings.filterwarnings("ignore") url = "https://data.rivm.nl/covid-19/COVID-19_aantallen_gemeente_per_dag.csv" def get_data(url: str = url) -> pd.DataFrame: """ Get data from url url: url to csv """ return pd.read_csv(url, sep=";", parse_...
[ 11748, 14601, 198, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 19798, 292, 355, 279, 67, 198, 198, 40539, 654, 13, 24455, 40539, 654, 7203, 46430, 4943, 198, 198, 6371, 796, 366, 5450, 1378, 7890, 13, 380, 14761, 13, 21283, 14, 66...
2.518519
594
from django.conf import settings from DashboardManagement.common import helper from Referral import models as refer_models
[ 6738, 42625, 14208, 13, 10414, 1330, 6460, 198, 198, 6738, 16189, 3526, 48032, 13, 11321, 1330, 31904, 198, 6738, 33973, 1373, 1330, 4981, 355, 3522, 62, 27530, 628 ]
4.464286
28
""" from https://github.com/keithito/tacotron """ print(1) from text import cmudict, pinyin _pad = "_" _punctuation = "!'(),.:;? " _special = "-" _letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" _silences = ["@sp", "@spn", "@sil"] # Prepend "@" to ARPAbet symbols to ensure uniqueness (some are the ...
[ 37811, 422, 3740, 1378, 12567, 13, 785, 14, 365, 342, 10094, 14, 83, 330, 313, 1313, 37227, 198, 4798, 7, 16, 8, 628, 198, 6738, 2420, 1330, 12067, 463, 713, 11, 279, 3541, 259, 198, 198, 62, 15636, 796, 45434, 1, 198, 62, 79, 1...
1.928571
462
import cog from pathlib import Path import torch import pixray import yaml import pathlib import os import yaml from cogrun import create_temporary_copy
[ 11748, 43072, 198, 6738, 3108, 8019, 1330, 10644, 198, 11748, 28034, 198, 11748, 279, 844, 2433, 198, 11748, 331, 43695, 198, 11748, 3108, 8019, 198, 11748, 28686, 198, 11748, 331, 43695, 198, 198, 6738, 43072, 5143, 1330, 2251, 62, 11498...
3.5
44
# -*- coding: utf8 -*- from __future__ import absolute_import, division, print_function from __future__ import unicode_literals from pylero.base_polarion import BasePolarion class BuildTestResults(BasePolarion): """Object to handle the Polarion WSDL tns2:BuildTestResults class Attributes: error_count...
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 23, 532, 9, 12, 198, 6738, 11593, 37443, 834, 1330, 4112, 62, 11748, 11, 7297, 11, 3601, 62, 8818, 198, 6738, 11593, 37443, 834, 1330, 28000, 1098, 62, 17201, 874, 198, 6738, 12972, 1754, 78, 13...
2.178273
359
# Generated by Django 2.1.2 on 2018-12-09 05:48 from django.db import migrations, models
[ 2, 2980, 515, 416, 37770, 362, 13, 16, 13, 17, 319, 2864, 12, 1065, 12, 2931, 8870, 25, 2780, 198, 198, 6738, 42625, 14208, 13, 9945, 1330, 15720, 602, 11, 4981, 628 ]
2.84375
32
import numpy as np import math iris = [1.43, -0.4, 0.23] softmax(iris, 3) # array([0.684, 0.11 , 0.206])
[ 11748, 299, 32152, 355, 45941, 198, 11748, 10688, 220, 198, 198, 29616, 796, 685, 16, 13, 3559, 11, 532, 15, 13, 19, 11, 657, 13, 1954, 60, 198, 198, 4215, 9806, 7, 29616, 11, 513, 8, 220, 198, 2, 7177, 26933, 15, 13, 41580, 11,...
2.018519
54
import torch from elf.segmentation.features import compute_rag
[ 11748, 28034, 198, 6738, 23878, 13, 325, 5154, 341, 13, 40890, 1330, 24061, 62, 22562, 628, 628 ]
3.882353
17
#-*- coding: utf-8 -*- import os.path as p import os import cv2 as cv import numpy as np if __name__ == '__main__': global startNum, name load_images() print('[increasing number]_[x]_[y]_[width]_[height]_[name].jpg will be annoated in file name!') name = input('Name?') startNum = int(input('Number? (1 is r...
[ 2, 12, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 11748, 28686, 13, 6978, 355, 279, 198, 11748, 28686, 198, 11748, 269, 85, 17, 355, 269, 85, 198, 11748, 299, 32152, 355, 45941, 198, 220, 220, 198, 361, 11593, 3672, 83...
2.536946
203
from enum import Enum from typing import NamedTuple
[ 6738, 33829, 1330, 2039, 388, 198, 6738, 19720, 1330, 34441, 51, 29291, 628, 198 ]
3.857143
14
from typing import Callable, List, ClassVar, Sequence import attr from event_manager.event import Event from event_manager.exchanges import ORDER_EXCHANGE from .order_line import OrderLine @attr.s
[ 6738, 19720, 1330, 4889, 540, 11, 7343, 11, 5016, 19852, 11, 45835, 198, 11748, 708, 81, 198, 6738, 1785, 62, 37153, 13, 15596, 1330, 8558, 198, 198, 6738, 1785, 62, 37153, 13, 1069, 36653, 1330, 38678, 62, 6369, 3398, 27746, 198, 673...
3.571429
56
#!/usr/bin/env python # # Copyright 2018 Google Inc. # # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Create the asset.""" import argparse import common import os import shutil import subprocess import utils # This is basically all the deps of g++-multilib-...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 2, 198, 2, 15069, 2864, 3012, 3457, 13, 198, 2, 198, 2, 5765, 286, 428, 2723, 2438, 318, 21825, 416, 257, 347, 10305, 12, 7635, 5964, 326, 460, 307, 198, 2, 1043, 287, 262, 38559, ...
2.524144
1,139
from collections import OrderedDict import torch import torch.optim as optim import torch.distributed as dist from .vsr_model import VSRModel from .networks import define_generator, define_discriminator from .networks.vgg_nets import VGGFeatureExtractor from .optim import define_criterion, define_lr_schedule from uti...
[ 6738, 17268, 1330, 14230, 1068, 35, 713, 198, 198, 11748, 28034, 198, 11748, 28034, 13, 40085, 355, 6436, 198, 11748, 28034, 13, 17080, 6169, 355, 1233, 198, 198, 6738, 764, 14259, 81, 62, 19849, 1330, 569, 12562, 17633, 198, 6738, 764,...
3.470149
134
import io import base64 import requests from typing import Dict, List from .utils import retry, return_curl_or_response class ViImageClient: """ Search and Encoding of Images """ @return_curl_or_response('json') @retry() def search_image( self, collection_name: str, ima...
[ 11748, 33245, 198, 11748, 2779, 2414, 198, 11748, 7007, 198, 6738, 19720, 1330, 360, 713, 11, 7343, 198, 6738, 764, 26791, 1330, 1005, 563, 11, 1441, 62, 66, 6371, 62, 273, 62, 26209, 198, 198, 4871, 16049, 5159, 11792, 25, 198, 220, ...
2.256447
3,529
from . import DiscretePGM, PotentialTable, CliqueTreeInference, LoopyBPInference import networkx as nx import pandas import numpy as np class BayesNet(DiscretePGM): ''' Implementation of a simple Bayesian Network.''' def __init__(self, digraph, cardinalities=[], var_names=[]): ''' Construct bayes...
[ 198, 6738, 764, 1330, 8444, 8374, 6968, 44, 11, 32480, 10962, 11, 1012, 2350, 27660, 818, 4288, 11, 6706, 11081, 20866, 818, 4288, 198, 11748, 3127, 87, 355, 299, 87, 198, 11748, 19798, 292, 198, 11748, 299, 32152, 355, 45941, 198, 19...
2.079452
365
from django.contrib.gis import admin from adventure import models from utils.admin_helper import AdminBase admin.site.register([models.Track, models.PointOfInterest], AdminBase) admin.site.register([models.Note, models.FeatureType])
[ 6738, 42625, 14208, 13, 3642, 822, 13, 70, 271, 1330, 13169, 198, 198, 6738, 8855, 1330, 4981, 198, 6738, 3384, 4487, 13, 28482, 62, 2978, 525, 1330, 32053, 14881, 198, 198, 28482, 13, 15654, 13, 30238, 26933, 27530, 13, 24802, 11, 49...
3.522388
67
""" Joomla Information Gathering """ from common.colors import red, green, bg, G, R, W, Y, G , good , bad , run , info , end , que import re import requests # Find Joomla version and check it on exploit-db
[ 37811, 449, 4207, 5031, 6188, 36397, 37227, 198, 6738, 2219, 13, 4033, 669, 1330, 2266, 11, 4077, 11, 275, 70, 11, 402, 11, 371, 11, 370, 11, 575, 11, 402, 837, 922, 837, 2089, 837, 1057, 837, 7508, 837, 886, 837, 8358, 198, 11748...
3.306452
62
# Copyright 2020 Rubrik, Inc. # # 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, copy, modify, merge, publish, distri...
[ 2, 15069, 12131, 6256, 12602, 11, 3457, 13, 198, 2, 198, 2, 220, 2448, 3411, 318, 29376, 7520, 11, 1479, 286, 3877, 11, 284, 597, 1048, 16727, 257, 4866, 198, 2, 220, 286, 428, 3788, 290, 3917, 10314, 3696, 357, 1169, 366, 25423, ...
2.96868
894
from traduki.sqla import initialize __all__ = (initialize.__name__)
[ 6738, 2083, 11308, 13, 31166, 5031, 1330, 41216, 198, 198, 834, 439, 834, 796, 357, 36733, 1096, 13, 834, 3672, 834, 8, 198 ]
3
23
import unittest from even_last import checkio if __name__ == "__main__": # pragma: no cover unittest.main()
[ 11748, 555, 715, 395, 198, 198, 6738, 772, 62, 12957, 1330, 2198, 952, 628, 198, 198, 361, 11593, 3672, 834, 6624, 366, 834, 12417, 834, 1298, 220, 1303, 23864, 2611, 25, 645, 3002, 198, 220, 220, 220, 555, 715, 395, 13, 12417, 3419...
2.659091
44
import spotipy from spotipy.oauth2 import SpotifyClientCredentials import json import random class spotify_api: """ Class that uses that spotify api to get a random song depending on the mood of the user. """ def __init__(self, emotion): """ Constructor initialiazes spotify instance...
[ 11748, 4136, 541, 88, 198, 6738, 4136, 541, 88, 13, 12162, 1071, 17, 1330, 26778, 11792, 34, 445, 14817, 198, 11748, 33918, 198, 11748, 4738, 198, 198, 4871, 4136, 1958, 62, 15042, 25, 198, 220, 220, 220, 37227, 198, 220, 220, 220, ...
2.350282
1,062
# 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, ...
1.960159
13,554
# ============================================================================= # Copyright (c) 2016, Cisco Systems, Inc # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # Redistributions of sour...
[ 2, 38093, 25609, 198, 2, 15069, 357, 66, 8, 1584, 11, 28289, 11998, 11, 3457, 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, 104...
2.422892
4,377
# # # Helper functions used by the modules. # # import pygame def tsub(tup1, tup2): """ Subtracts tup1 elements from tup2 elements. """ return (tup1[0]-tup2[0], tup1[1]-tup2[1]) def tadd(tup1, tup2): """ Adds the elements of tup1 and tup2. """ return (tup1[0]+tup2[0], tup1[1]+tup2[1]) def tflip(tu...
[ 2, 198, 2, 198, 2, 220, 220, 220, 5053, 525, 5499, 973, 416, 262, 13103, 13, 198, 2, 198, 2, 198, 11748, 12972, 6057, 198, 198, 4299, 256, 7266, 7, 83, 929, 16, 11, 256, 929, 17, 2599, 198, 220, 220, 220, 37227, 3834, 83, 974,...
2.279661
236
from hypermodel.utilities.hm_shell import sh from hypermodel.kubeflow.deploy_dev import deploy_to_dev import logging import sys
[ 6738, 8718, 19849, 13, 315, 2410, 13, 23940, 62, 29149, 1330, 427, 198, 6738, 8718, 19849, 13, 74, 549, 891, 9319, 13, 2934, 1420, 62, 7959, 1330, 6061, 62, 1462, 62, 7959, 198, 198, 11748, 18931, 198, 11748, 25064, 198 ]
3.225
40
from sqlalchemy import Column, ForeignKey, Index, Integer from sqlalchemy.orm import backref, relationship from grouper.models.base.model_base import Model class GroupServiceAccount(Model): """Service accounts owned by a group. A group may own zero or more service accounts. This table holds the mapping betw...
[ 6738, 44161, 282, 26599, 1330, 29201, 11, 8708, 9218, 11, 12901, 11, 34142, 198, 6738, 44161, 282, 26599, 13, 579, 1330, 736, 5420, 11, 2776, 198, 198, 6738, 1132, 525, 13, 27530, 13, 8692, 13, 19849, 62, 8692, 1330, 9104, 628, 198, ...
3.033133
332
#!/usr/bin/env python3 """ Author : reidloeffler <reidloeffler@localhost> Date : 2021-11-23 Purpose: Assignment 12 """ import argparse import sys # -------------------------------------------------- def get_args(): """Get command-line arguments""" parser = argparse.ArgumentParser( description='Pyt...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 37811, 198, 13838, 1058, 302, 312, 24617, 487, 1754, 1279, 260, 312, 24617, 487, 1754, 31, 36750, 29, 198, 10430, 220, 220, 1058, 33448, 12, 1157, 12, 1954, 198, 30026, 3455, 25, ...
2.047354
1,077
from django.urls import path, include from .api import urls app_name = 'imc' urlpatterns = [ path( 'api/growth-curve/imc/', include(urls.imc_curves_patterns_api) ), ]
[ 6738, 42625, 14208, 13, 6371, 82, 1330, 3108, 11, 2291, 198, 6738, 764, 15042, 1330, 2956, 7278, 198, 198, 1324, 62, 3672, 796, 705, 320, 66, 6, 198, 198, 6371, 33279, 82, 796, 685, 198, 220, 220, 220, 3108, 7, 198, 220, 220, 220,...
2.097826
92
import ast from matrix_tools import * transformations = numpy.loadtxt("Data/AllDetOfOne.txt") transformations = numpy.reshape(transformations, (len(transformations) / 3, 3, 3)) with open("Data/NiggliBasis.txt") as f: lines = f.readlines() num_of_lines = len(lines) n_basis_file = open("Data/NiggliBasis.txt", "r") ...
[ 11748, 6468, 198, 6738, 17593, 62, 31391, 1330, 1635, 198, 198, 35636, 602, 796, 299, 32152, 13, 2220, 14116, 7203, 6601, 14, 3237, 11242, 5189, 3198, 13, 14116, 4943, 198, 35636, 602, 796, 299, 32152, 13, 3447, 1758, 7, 35636, 602, 1...
2.557093
289
from djangocities.user.query import * from djangocities.cities.query import * from djangocities.sites.query import * from djangocities.pages.query import *
[ 6738, 42625, 648, 420, 871, 13, 7220, 13, 22766, 1330, 1635, 198, 6738, 42625, 648, 420, 871, 13, 66, 871, 13, 22766, 1330, 1635, 198, 6738, 42625, 648, 420, 871, 13, 49315, 13, 22766, 1330, 1635, 198, 6738, 42625, 648, 420, 871, 13...
3.183673
49
#!/usr/bin/python # -*- coding: UTF-8 -*- import os import dlib import cv2 import pickle from sklearn.svm import SVC from cam.models import dlib_model, classifier_model FaceDetection = dlib.get_frontal_face_detector() # face recognition sp = dlib.shape_predictor(dlib_model.pose_predictor_model_location()) Description...
[ 2, 48443, 14629, 14, 8800, 14, 29412, 198, 2, 532, 9, 12, 19617, 25, 41002, 12, 23, 532, 9, 12, 198, 11748, 28686, 198, 11748, 288, 8019, 198, 11748, 269, 85, 17, 198, 11748, 2298, 293, 198, 6738, 1341, 35720, 13, 82, 14761, 1330,...
2.710843
166
# -*-- coding: utf-8 -* def discretize(self, Npoint=-1): """Returns the discretize version of the SurfRing Parameters ---------- self: SurfRing A SurfRing object Npoint : int Number of point on each line (Default value = -1 => use the line default discretization) Returns --...
[ 2, 532, 9, 438, 19617, 25, 3384, 69, 12, 23, 532, 9, 198, 4299, 1221, 1186, 1096, 7, 944, 11, 399, 4122, 10779, 16, 2599, 198, 220, 220, 220, 37227, 35561, 262, 1221, 1186, 1096, 2196, 286, 262, 43771, 39687, 628, 220, 220, 220, ...
2.661088
239
mapping = {foo: bar for<caret>
[ 76, 5912, 796, 1391, 21943, 25, 2318, 329, 27, 6651, 83, 29 ]
2.5
12
from ..utils.generic_utils import deserialize_object from .rollout_mcts import * from .evaluation_mcts import * from .rl_evaluation_mcts import *
[ 6738, 11485, 26791, 13, 41357, 62, 26791, 1330, 748, 48499, 1096, 62, 15252, 198, 6738, 764, 2487, 448, 62, 76, 310, 82, 1330, 1635, 198, 6738, 764, 18206, 2288, 62, 76, 310, 82, 1330, 1635, 198, 6738, 764, 45895, 62, 18206, 2288, 6...
2.979592
49
# This is free software licensed under the MIT license. # Copyright (c) 2021 Samarth Ramesh <samarthr1@outlook.com> # You should have recived a copy of the MIT license with this file. In case you ahve not, visit https://github.com/samarth-ramsh/mtlaucher
[ 2, 770, 318, 1479, 3788, 11971, 739, 262, 17168, 5964, 13, 198, 2, 15069, 357, 66, 8, 33448, 3409, 11999, 371, 1047, 71, 1279, 37687, 11999, 81, 16, 31, 448, 5460, 13, 785, 29, 198, 2, 921, 815, 423, 664, 1572, 257, 4866, 286, 2...
3.355263
76
# Copyright notice: # Copyright Members of the EMI Collaboration, 2013. # # See www.eu-emi.eu for details on the copyright holders # # 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...
[ 2, 220, 220, 15069, 4003, 25, 198, 2, 220, 220, 15069, 220, 12688, 286, 262, 412, 8895, 37322, 341, 11, 2211, 13, 198, 2, 198, 2, 220, 220, 4091, 7324, 13, 12496, 12, 43967, 13, 12496, 329, 3307, 319, 262, 6634, 16392, 198, 2, 1...
3.050201
498
import numpy as np from sklearn.metrics import accuracy_score, f1_score
[ 11748, 299, 32152, 355, 45941, 198, 6738, 1341, 35720, 13, 4164, 10466, 1330, 9922, 62, 26675, 11, 277, 16, 62, 26675, 628, 628 ]
3.26087
23
"""empty message Revision ID: 140_service_id_null_for_drafts Revises: 130_acknowledged_at_column Create Date: 2015-06-22 10:42:37.274484 """ # revision identifiers, used by Alembic. revision = '140_service_id_null_for_drafts' down_revision = '130_acknowledged_at_column' from alembic import op import sqlalchemy as s...
[ 37811, 28920, 3275, 198, 198, 18009, 1166, 4522, 25, 12713, 62, 15271, 62, 312, 62, 8423, 62, 1640, 62, 35679, 82, 198, 18009, 2696, 25, 11323, 62, 441, 2197, 37436, 62, 265, 62, 28665, 198, 16447, 7536, 25, 1853, 12, 3312, 12, 1828...
2.722689
119
import setuptools with open("README.md", "r") as fh: long_description = fh.read() setuptools.setup( name="django-lazy-services", version="0.0.3", author="Gordon Wrigley", author_email="gordon.wrigley@gmail.com", description="A helper for switching between test and production versions of a serv...
[ 11748, 900, 37623, 10141, 198, 198, 4480, 1280, 7203, 15675, 11682, 13, 9132, 1600, 366, 81, 4943, 355, 277, 71, 25, 198, 220, 220, 220, 890, 62, 11213, 796, 277, 71, 13, 961, 3419, 198, 198, 2617, 37623, 10141, 13, 40406, 7, 198, ...
2.69708
274
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( parse_duration, str_to_int, )
[ 6738, 11593, 37443, 834, 1330, 28000, 1098, 62, 17201, 874, 198, 198, 11748, 302, 198, 198, 6738, 764, 11321, 1330, 14151, 11627, 40450, 198, 6738, 11485, 26791, 1330, 357, 198, 220, 220, 220, 21136, 62, 32257, 11, 198, 220, 220, 220, ...
2.94
50
import math import random FIRST_DIVISOR = 2 LOWER_LIMIT = 1 UPPER_LIMIT = 100 RULE = 'Answer "yes" if given number is prime. Otherwise answer "no".'
[ 11748, 10688, 198, 11748, 4738, 198, 198, 39776, 2257, 62, 33569, 1797, 1581, 796, 362, 198, 43, 36048, 62, 43, 3955, 2043, 796, 352, 198, 8577, 18973, 62, 43, 3955, 2043, 796, 1802, 198, 198, 49, 24212, 796, 705, 33706, 366, 8505, ...
2.684211
57
# -*- coding: utf-8 -*- from flask import Blueprint, request,json from pusher import pusher blueprint = Blueprint('guest', __name__) @blueprint.route('/new/guest', methods=['POST'])
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 6738, 42903, 1330, 39932, 11, 2581, 11, 17752, 198, 6738, 4192, 372, 1330, 4192, 372, 198, 198, 17585, 4798, 796, 39932, 10786, 5162, 395, 3256, 11593, 3672, 834, 8, 198...
2.904762
63
from flask import jsonify from flask_testing import TestCase from src.models import db from src.app import create_app from src.models.task import Task
[ 6738, 42903, 1330, 33918, 1958, 198, 6738, 42903, 62, 33407, 1330, 6208, 20448, 198, 198, 6738, 12351, 13, 27530, 1330, 20613, 198, 6738, 12351, 13, 1324, 1330, 2251, 62, 1324, 198, 6738, 12351, 13, 27530, 13, 35943, 1330, 15941, 198 ]
3.8
40
import torch from snn_layers import SpikeTensor def validate_snn(net, test_loader, device, criterion, timesteps): """Perform validation for SNN""" print("Performing validation for SNN") # switch to evaluate mode net.eval() correct = 0 with torch.no_grad(): for data_test, target in t...
[ 11748, 28034, 198, 6738, 3013, 77, 62, 75, 6962, 1330, 26309, 51, 22854, 628, 198, 4299, 26571, 62, 16184, 77, 7, 3262, 11, 1332, 62, 29356, 11, 3335, 11, 34054, 11, 4628, 395, 25386, 2599, 198, 220, 220, 220, 37227, 5990, 687, 2120...
2.306834
717
"""Script to train pixelCNN on the CIFAR10 dataset.""" import random as rn import time import matplotlib import matplotlib.pyplot as plt import numpy as np import tensorflow as tf from tensorflow import keras class MaskedConv2D(keras.layers.Layer): """Convolutional layers with masks. Convolutional layers wi...
[ 198, 37811, 7391, 284, 4512, 17465, 18474, 319, 262, 327, 5064, 1503, 940, 27039, 526, 15931, 198, 11748, 4738, 355, 374, 77, 198, 11748, 640, 198, 198, 11748, 2603, 29487, 8019, 198, 11748, 2603, 29487, 8019, 13, 9078, 29487, 355, 458,...
2.563991
2,977
from flask import Flask, request, Response import json import pymongo from flask_cors import CORS from bson.json_util import dumps, loads import os from azure.storage.blob import BlockBlobService, PublicAccess from celery import Celery import subprocess import uuid app = Flask(__name__) CORS(app) db_cli...
[ 6738, 42903, 1330, 46947, 11, 2581, 11, 18261, 201, 198, 11748, 33918, 201, 198, 11748, 279, 4948, 25162, 201, 198, 6738, 42903, 62, 66, 669, 1330, 327, 20673, 201, 198, 6738, 275, 1559, 13, 17752, 62, 22602, 1330, 45514, 11, 15989, 2...
2.425065
774
# -*- coding: utf-8 -*- from square.api_helper import APIHelper from square.http.api_response import ApiResponse from square.api.base_api import BaseApi from square.http.auth.o_auth_2 import OAuth2 class TerminalApi(BaseApi): """A Controller to access Endpoints in the square API.""" def create_terminal_che...
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 198, 6738, 6616, 13, 15042, 62, 2978, 525, 1330, 7824, 47429, 198, 6738, 6616, 13, 4023, 13, 15042, 62, 26209, 1330, 5949, 72, 31077, 198, 6738, 6616, 13, 15042, 13, 8...
2.322189
6,431
#!/usr/bin/env python3 import argparse import subprocess import sys import os from pathlib import Path import get_paths if __name__ == "__main__": main()
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 198, 11748, 1822, 29572, 198, 11748, 850, 14681, 198, 11748, 25064, 198, 11748, 28686, 198, 6738, 3108, 8019, 1330, 10644, 198, 198, 11748, 651, 62, 6978, 82, 628, 628, 628, 198, 1...
2.830508
59
""" ================================= Parallel reconstruction using CSD ================================= This example shows how to use parallelism (multiprocessing) using ``peaks_from_model`` in order to speedup the signal reconstruction process. For this example will we use the same initial steps as we used in :ref:...
[ 37811, 198, 10052, 28, 198, 10044, 29363, 25056, 1262, 9429, 35, 198, 10052, 28, 198, 198, 1212, 1672, 2523, 703, 284, 779, 10730, 1042, 357, 16680, 541, 305, 919, 278, 8, 1262, 198, 15506, 431, 4730, 62, 6738, 62, 19849, 15506, 287, ...
2.137143
1,750
from factory import Faker, make_factory from factory.alchemy import SQLAlchemyModelFactory from lms import models from tests.factories.attributes import ( H_DISPLAY_NAME, H_USERNAME, OAUTH_CONSUMER_KEY, RESOURCE_LINK_ID, USER_ID, ) GradingInfo = make_factory( models.GradingInfo, FACTORY_CL...
[ 6738, 8860, 1330, 376, 3110, 11, 787, 62, 69, 9548, 198, 6738, 8860, 13, 282, 26599, 1330, 16363, 2348, 26599, 17633, 22810, 198, 198, 6738, 300, 907, 1330, 4981, 198, 6738, 5254, 13, 22584, 1749, 13, 1078, 7657, 1330, 357, 198, 220, ...
2.314214
401
# Generated by Django 3.0.4 on 2020-03-31 16:04 from django.db import migrations, models import markdownx.models
[ 2, 2980, 515, 416, 37770, 513, 13, 15, 13, 19, 319, 12131, 12, 3070, 12, 3132, 1467, 25, 3023, 198, 198, 6738, 42625, 14208, 13, 9945, 1330, 15720, 602, 11, 4981, 198, 11748, 1317, 2902, 87, 13, 27530, 628 ]
2.948718
39
import json import re import threading import websocket from platypush.backend import Backend from platypush.message.event.music import MusicPlayEvent, MusicPauseEvent, \ MusicStopEvent, NewPlayingTrackEvent, PlaylistChangeEvent, VolumeChangeEvent, \ PlaybackConsumeModeChangeEvent, PlaybackSingleModeChangeEve...
[ 11748, 33918, 198, 11748, 302, 198, 11748, 4704, 278, 198, 198, 11748, 2639, 5459, 198, 198, 6738, 40315, 4464, 1530, 13, 1891, 437, 1330, 5157, 437, 198, 6738, 40315, 4464, 1530, 13, 20500, 13, 15596, 13, 28965, 1330, 7849, 11002, 9237...
3.062603
607
from pkg import Foo foo = Foo
[ 6738, 279, 10025, 1330, 36080, 198, 198, 21943, 796, 36080 ]
3
10
#!/usr/bin/env python3 from mutagen.mp4 import MP4, MP4Cover from pathlib import Path import re album_dir = Path('.') artist, album, date = re.fullmatch('(.+) - (.+) \((\d{4})\)', album_dir.resolve().name).groups() tracks = [p.name for p in album_dir.glob('*.m4a')] total_tracks = len(tracks) with open('cover.jpg', '...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 6738, 4517, 11286, 13, 3149, 19, 1330, 4904, 19, 11, 4904, 19, 27245, 198, 6738, 3108, 8019, 1330, 10644, 198, 11748, 302, 198, 198, 40916, 62, 15908, 796, 10644, 10786, 2637, 8, ...
2.257053
319
from hyper.http20.huffman import HuffmanDecoder, HuffmanEncoder from hyper.http20.huffman_constants import REQUEST_CODES,REQUEST_CODES_LENGTH
[ 6738, 8718, 13, 4023, 1238, 13, 71, 1648, 805, 1330, 14721, 805, 10707, 12342, 11, 14721, 805, 27195, 12342, 198, 6738, 8718, 13, 4023, 1238, 13, 71, 1648, 805, 62, 9979, 1187, 1330, 4526, 35780, 62, 34, 3727, 1546, 11, 2200, 35780, ...
2.86
50
# Copyright 2018 Dinar Gabbasov <https://it-projects.info/team/GabbasovDinar> # License MIT (https://opensource.org/licenses/MIT). from odoo import fields, models
[ 2, 15069, 2864, 360, 22050, 402, 6485, 292, 709, 1279, 5450, 1378, 270, 12, 42068, 13, 10951, 14, 15097, 14, 38, 6485, 292, 709, 35, 22050, 29, 198, 2, 13789, 17168, 357, 5450, 1378, 44813, 1668, 13, 2398, 14, 677, 4541, 14, 36393, ...
3.09434
53
from django.apps import AppConfig class MusicPublisherConfig(AppConfig): """Configuration for Music Publisher app. Attributes: label (str): app label name (str): app name verbose_name (str): app verbose name """ name = 'music_publisher' label = 'music_publisher' verb...
[ 6738, 42625, 14208, 13, 18211, 1330, 2034, 16934, 628, 198, 4871, 7849, 46471, 16934, 7, 4677, 16934, 2599, 628, 220, 220, 220, 37227, 38149, 329, 7849, 28045, 598, 13, 628, 220, 220, 220, 49213, 25, 198, 220, 220, 220, 220, 220, 220,...
2.792
125
""" script for data preprocessing """ import os import shutil import pandas as pd from config.cfg import cfg def process_gender_imgs(): """ process gender images :return: """ m_filenames, f_filenames = split_by_attribute('gender') if not os.path.exists(os.path.join(cfg['gender_base_dir'], ...
[ 37811, 198, 12048, 329, 1366, 662, 36948, 198, 37811, 198, 198, 11748, 28686, 198, 11748, 4423, 346, 198, 198, 11748, 19798, 292, 355, 279, 67, 198, 198, 6738, 4566, 13, 37581, 1330, 30218, 70, 628, 198, 198, 4299, 1429, 62, 8388, 62,...
2.126524
656
""" The static source provides a column for inserting static data. It's incredibly simple and not terribly useful, but it can come in handy from time to time. For example, if you want to fill a column with a 'coming soon...' message, you could use a static column. """ from __future__ import absolute_import from blinga...
[ 37811, 198, 464, 9037, 2723, 3769, 257, 5721, 329, 19319, 9037, 1366, 13, 632, 338, 8131, 198, 36439, 290, 407, 22121, 4465, 11, 475, 340, 460, 1282, 287, 15728, 422, 640, 284, 640, 13, 198, 1890, 1672, 11, 611, 345, 765, 284, 6070,...
3.879195
149
from spacy_transformers import TransformerData import srsly
[ 6738, 599, 1590, 62, 35636, 364, 1330, 3602, 16354, 6601, 198, 11748, 264, 3808, 306, 628 ]
3.8125
16
""" Video playback from sdcard/pico flash/eve's connected flash example """ import sys import video2 as demo if __name__ == "__main__": sdcard, eve = eve_init() eve.calibrate() while 1: demo.start(sdcard, eve)
[ 37811, 7623, 16388, 422, 45647, 9517, 14, 79, 3713, 7644, 14, 44655, 338, 5884, 7644, 1672, 37227, 198, 198, 11748, 25064, 198, 11748, 2008, 17, 355, 13605, 198, 220, 220, 220, 220, 198, 361, 11593, 3672, 834, 6624, 366, 834, 12417, 8...
2.526316
95
# -*- coding: utf-8 -*- from ckan.cli.cli import ckan def test_build_and_clean(cli, ckan_config, tmpdir, monkeypatch): """After build, there are some folders with assets inside `%(ckan.storage_path)/webassets`. And after cleaning they must be empty. """ monkeypatch.setitem(ckan_config, u'ckan.s...
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 628, 198, 6738, 269, 27541, 13, 44506, 13, 44506, 1330, 269, 27541, 628, 198, 4299, 1332, 62, 11249, 62, 392, 62, 27773, 7, 44506, 11, 269, 27541, 62, 11250, 11, 45218, 159...
2.447059
340
"""Pydantic can convert a model instance to a dictionary, or json string""" from pydantic_lib.utils import Movie movie = Movie(title='Friday the 13th', year_of_release=1980, rating='R', box_office='U$93M') movie_as_dict = movie.dict(exclude={'cast'}) movie_as_json = movie.json(exclude={'cast'}) print(movie_as_dict) ...
[ 37811, 47, 5173, 5109, 460, 10385, 257, 2746, 4554, 284, 257, 22155, 11, 393, 33918, 4731, 37811, 198, 6738, 279, 5173, 5109, 62, 8019, 13, 26791, 1330, 15875, 198, 198, 41364, 796, 15875, 7, 7839, 11639, 20610, 262, 1511, 400, 3256, ...
2.865546
119
from collections import Counter, defaultdict import csv import requests CSV_URL = 'https://raw.githubusercontent.com/pybites/SouthParkData/master/by-season/Season-{}.csv' # noqa E501 def get_season_csv_file(season): """Receives a season int, and downloads loads in its corresponding CSV_URL""" with r...
[ 6738, 17268, 1330, 15034, 11, 4277, 11600, 198, 11748, 269, 21370, 198, 198, 11748, 7007, 198, 198, 7902, 53, 62, 21886, 796, 705, 5450, 1378, 1831, 13, 12567, 43667, 13, 785, 14, 9078, 2545, 274, 14, 14942, 25478, 6601, 14, 9866, 14,...
2.77709
323