content
stringlengths
1
1.04M
input_ids
listlengths
1
774k
ratio_char_token
float64
0.38
22.9
token_count
int64
1
774k
import cv2 # import OpenCv lib cap = cv2.VideoCapture(0) # create cap object # set the format into MJPG in the FourCC format # cap.set(cv2.CAP_PROP_FOURCC,cv2.VideoWriter_fourcc('M','J','P','G')) cap.set(cv2.CAP_PROP_FOURCC,cv2.VideoWriter_fourcc('J','P','E','G')) if not cap.isOp...
[ 11748, 269, 85, 17, 220, 220, 220, 220, 220, 220, 197, 197, 197, 197, 197, 220, 220, 220, 220, 220, 220, 220, 1303, 1330, 4946, 34, 85, 9195, 198, 11128, 796, 269, 85, 17, 13, 10798, 49630, 7, 15, 8, 220, 220, 220, 220, 220, 2...
2.016216
370
""" Module for unit tests for translations """ import unittest from translator import french_to_english, english_to_french class TranslationTest(unittest.TestCase): """This Class contains the unit tests for translations""" def test_french_to_english(self): """This method tests the French to English ...
[ 37811, 198, 26796, 329, 4326, 5254, 329, 25231, 198, 37811, 198, 198, 11748, 555, 715, 395, 198, 198, 6738, 33417, 1330, 48718, 62, 1462, 62, 39126, 11, 46932, 62, 1462, 62, 69, 3532, 198, 198, 4871, 33322, 14402, 7, 403, 715, 395, ...
2.804428
271
for value in range(1,11): print(str(value))
[ 1640, 1988, 287, 2837, 7, 16, 11, 1157, 2599, 198, 220, 220, 220, 3601, 7, 2536, 7, 8367, 4008 ]
2.473684
19
import operator import sys sys.path.append("..") from collections import defaultdict, namedtuple from intcode import IntCodeMachine, open_file # The logic is as follows. # If we would fall into a gap otherwise, we jump (NOT A T // OR T J) # We jump early, that is a gap at B or C if we have an out, that is we can move ...
[ 11748, 10088, 198, 11748, 25064, 198, 17597, 13, 6978, 13, 33295, 7203, 492, 4943, 198, 6738, 17268, 1330, 4277, 11600, 11, 3706, 83, 29291, 198, 6738, 493, 8189, 1330, 2558, 10669, 37573, 11, 1280, 62, 7753, 198, 198, 2, 383, 9156, 3...
2.826087
184
from .party_affiliation import PartyAffiliation
[ 6738, 764, 10608, 62, 2001, 15547, 1330, 3615, 35191, 15547, 628 ]
4.454545
11
# Desenvolva um programa que leia o comprimento de três retas e diga ao usuário se elas podem # ou não formar um triângulo. r1 = int(input('Valor do primeiro segmento: ')) r2 = int(input('Valor do segundo segmento: ')) r3 = int(input('Valor do terceiro segmento: ')) if r1 < r2 + r3 and r2 < r1 + r3 and r3 < r1 + r2: ...
[ 2, 2935, 268, 10396, 6862, 23781, 1430, 64, 8358, 443, 544, 267, 552, 3036, 50217, 390, 491, 25792, 82, 1005, 292, 304, 3100, 64, 257, 78, 514, 84, 6557, 27250, 384, 1288, 292, 24573, 368, 198, 2, 267, 84, 299, 28749, 1296, 283, 2...
2.395722
187
name='Noaman Monther Mahmood' job='Full-Stack Mobile Developer' header= 'This Job is Done By' desc='And it is one of the requirements to be accepted in th Full-Stack Development Bootcamp \nthat is implemented by Computiq and and GIZ Interview'
[ 198, 3672, 11639, 2949, 10546, 2892, 490, 31556, 702, 6, 198, 21858, 11639, 13295, 12, 25896, 12173, 23836, 6, 198, 25677, 28, 705, 1212, 15768, 318, 24429, 2750, 6, 198, 20147, 11639, 1870, 340, 318, 530, 286, 262, 5359, 284, 307, 62...
3.8125
64
#!/usr/bin/env python # Copyright 2008-2018 Univa Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 198, 2, 15069, 3648, 12, 7908, 791, 12151, 10501, 198, 2, 198, 2, 49962, 739, 262, 24843, 13789, 11, 10628, 362, 13, 15, 357, 1169, 366, 34156, 15341, 198, 2, 345, 743, 407, 779, 4...
3.740385
208
from __future__ import absolute_import from __future__ import division from __future__ import print_function from .dataset_utils import image_to_tfexample from json import dump from numpy import arange, empty, array, empty_like from numpy.random import shuffle from os import walk from PIL import Image from six.moves im...
[ 6738, 11593, 37443, 834, 1330, 4112, 62, 11748, 198, 6738, 11593, 37443, 834, 1330, 7297, 198, 6738, 11593, 37443, 834, 1330, 3601, 62, 8818, 198, 6738, 764, 19608, 292, 316, 62, 26791, 1330, 2939, 62, 1462, 62, 27110, 20688, 198, 6738,...
2.508961
558
# -*- coding: utf-8 -*- """ Ilustra el método de Newton-Raphson @author: Nicolas Guarin-Zapata """ from __future__ import division, print_function import numpy as np import matplotlib.pyplot as plt plt.rcParams["mathtext.fontset"] = "cm" plt.rcParams["axes.spines.top"] = False plt.rcParams["axes.spines.ri...
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 201, 198, 37811, 201, 198, 33666, 436, 430, 1288, 285, 25125, 24313, 390, 17321, 12, 49, 6570, 1559, 201, 198, 201, 198, 31, 9800, 25, 29737, 1962, 17714, 12, 57, 499, 1045...
1.945392
879
from metaflow_test import MetaflowTest, ExpectationFailed, steps, tag class CardExtensionsImportTest(MetaflowTest): """ - Requires on tests/extensions/packages to be installed. """ PRIORITY = 5 @tag('card(type="card_ext_init_b",save_errors=False)') @tag('card(type="card_ext_init_a",save_erro...
[ 6738, 1138, 1878, 9319, 62, 9288, 1330, 3395, 1878, 9319, 14402, 11, 23600, 341, 37, 6255, 11, 4831, 11, 7621, 628, 198, 4871, 5172, 11627, 5736, 20939, 14402, 7, 9171, 1878, 9319, 14402, 2599, 198, 220, 220, 220, 37227, 198, 220, 220...
2.530612
196
from yapf.yapflib.yapf_api import FormatFile import sys # using yapf library taken from https://github.com/google/yapf/ # version v0.28.0 # take the source path sourcePath = sys.argv[1] # take the first argument as the filepath # then update the targeted code with their format corrected. # this function returns an arr...
[ 6738, 331, 499, 69, 13, 88, 499, 2704, 571, 13, 88, 499, 69, 62, 15042, 1330, 18980, 8979, 198, 11748, 25064, 198, 2, 1262, 331, 499, 69, 5888, 2077, 422, 3740, 1378, 12567, 13, 785, 14, 13297, 14, 88, 499, 69, 14, 198, 2, 2196,...
3.493976
166
""" Copyright (c) Lukas Hedegaard. All Rights Reserved. Included in the OpenDR Toolit with permission from the author. """ from typing import Tuple, Union import torch from torch import Tensor from torch.nn.modules.pooling import ( AdaptiveAvgPool1d, AdaptiveAvgPool2d, AdaptiveAvgPool3d, AdaptiveMaxPo...
[ 37811, 198, 15269, 357, 66, 8, 28102, 292, 30920, 26470, 446, 13, 1439, 6923, 33876, 13, 198, 818, 10341, 287, 262, 4946, 7707, 16984, 270, 351, 7170, 422, 262, 1772, 13, 198, 37811, 198, 198, 6738, 19720, 1330, 309, 29291, 11, 4479, ...
2.623306
738
import pandas as pd import numpy as np import data_inputs, evaluate_EWRs #-------------------------------------------------------------------------------------------------- def sum_events(events): '''returns a sum of events''' return int(round(events.sum(), 0)) def get_frequency(events): '''Returns the f...
[ 11748, 19798, 292, 355, 279, 67, 198, 11748, 299, 32152, 355, 45941, 198, 198, 11748, 1366, 62, 15414, 82, 11, 13446, 62, 6217, 31273, 198, 2, 10097, 3880, 438, 198, 198, 4299, 2160, 62, 31534, 7, 31534, 2599, 198, 220, 220, 220, 70...
2.006166
3,730
# Crie um programa que leia o nome e o preço de vários produtos. # O programa deverá perguntar se o usuário vai continuar ou não. No final, mostre: # A) qual é o total gasto na compra. # B) quantos produtos custam mais de R$1000. # C) qual é o nome do produto mais barato. n = '' p = 0 t = 0 c = 0 b_p = 0 # preço produ...
[ 2, 327, 5034, 23781, 1430, 64, 8358, 443, 544, 267, 299, 462, 304, 267, 662, 16175, 78, 390, 410, 6557, 380, 418, 40426, 315, 418, 13, 198, 2, 440, 1430, 64, 390, 332, 6557, 583, 70, 2797, 283, 384, 267, 514, 84, 6557, 27250, 41...
2.091133
406
import os import sys import logging sys.path.append(os.path.dirname(os.path.realpath(__file__))) from sdc_etl_libs.database_helpers.SnowflakeDatabase import SnowflakeDatabase from sdc_etl_libs.database_helpers.NexusDatabase import NexusDatabase from sdc_etl_libs.database_helpers.MySqlDatabase import MySqlDatabase from...
[ 198, 11748, 28686, 198, 11748, 25064, 198, 11748, 18931, 198, 17597, 13, 6978, 13, 33295, 7, 418, 13, 6978, 13, 15908, 3672, 7, 418, 13, 6978, 13, 5305, 6978, 7, 834, 7753, 834, 22305, 198, 6738, 264, 17896, 62, 316, 75, 62, 8019, ...
2.651163
215
import dataiku def delete_orphaned_datasets(client=None, project_key=None, drop_data=False, dry_run=True): """Delete datasets that are not linked to any recipe. """ prj = client.get_project(project_key) flow = prj.get_flow() graph = flow.get_graph() cpt = 0 for name, props in graph.nodes.it...
[ 11748, 1366, 28643, 198, 198, 4299, 12233, 62, 13425, 22739, 62, 19608, 292, 1039, 7, 16366, 28, 14202, 11, 1628, 62, 2539, 28, 14202, 11, 4268, 62, 7890, 28, 25101, 11, 5894, 62, 5143, 28, 17821, 2599, 198, 220, 220, 220, 37227, 38...
2.14375
320
#!/usr/bin/env python3 from urllib.request import urlopen from urllib.parse import unquote import base64 import re n3ro_rss_link = input("N3RO SIP002 URIs: ").strip() data = urlopen(n3ro_rss_link).read() links = base64.b64decode(data).decode() for link in links.splitlines(): matcher = re.match(r"ss://(.+)@(.+)#(....
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 6738, 2956, 297, 571, 13, 25927, 1330, 19016, 9654, 198, 6738, 2956, 297, 571, 13, 29572, 1330, 555, 22708, 198, 11748, 2779, 2414, 198, 11748, 302, 198, 198, 77, 18, 305, 62, 42...
2.317829
258
import math from itertools import islice from time import ctime print(ctime()) print("" "fibonacci algorithms.py") print("Iterative positive and negative") print(ctime()) print(ctime()) print("expected Output:") print( "-832040 514229 -317811 196418 -121393 75025 -46368 28657 -17711 " "10946 -6765...
[ 11748, 10688, 198, 6738, 340, 861, 10141, 1330, 318, 75, 501, 198, 6738, 640, 1330, 269, 2435, 198, 198, 4798, 7, 310, 524, 28955, 628, 198, 4798, 7203, 1, 198, 220, 220, 220, 220, 220, 366, 69, 571, 261, 44456, 16113, 13, 9078, 4...
2.755497
1,137
# Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
[ 2, 15069, 33448, 3012, 11419, 198, 2, 198, 2, 49962, 739, 262, 24843, 13789, 11, 10628, 362, 13, 15, 357, 1169, 366, 34156, 15341, 198, 2, 345, 743, 407, 779, 428, 2393, 2845, 287, 11846, 351, 262, 13789, 13, 198, 2, 921, 743, 733...
3.428571
301
import pytesseract from PIL import Image img = Image.open("flag.png") text = pytesseract.image_to_string(img) print(rot_encode(7)(text)) if __name__ == '__main__': pass
[ 11748, 12972, 83, 408, 263, 529, 198, 6738, 350, 4146, 1330, 7412, 198, 198, 9600, 796, 7412, 13, 9654, 7203, 32109, 13, 11134, 4943, 198, 5239, 796, 12972, 83, 408, 263, 529, 13, 9060, 62, 1462, 62, 8841, 7, 9600, 8, 628, 628, 19...
2.432432
74
import json import requests import sys import yaml from bs4 import BeautifulSoup from os.path import exists from os import mkdir, environ if __name__ == '__main__': reposUrl = '' authToken = '' if len(sys.argv) > 1: reposUrl = sys.argv[1] authToken = sys.argv[2] else: # an o...
[ 11748, 33918, 198, 11748, 7007, 198, 11748, 25064, 198, 11748, 331, 43695, 198, 6738, 275, 82, 19, 1330, 23762, 50, 10486, 198, 6738, 28686, 13, 6978, 1330, 7160, 198, 6738, 28686, 1330, 33480, 15908, 11, 551, 2268, 628, 628, 198, 361, ...
1.978084
2,464
#------------------------------------------------------------------------------ # Copyright (c) 2013, Nucleic Development Team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file COPYING.txt, distributed with this software. #-------------------------------------------------...
[ 2, 10097, 26171, 198, 2, 15069, 357, 66, 8, 2211, 11, 399, 14913, 291, 7712, 4816, 13, 198, 2, 198, 2, 4307, 6169, 739, 262, 2846, 286, 262, 40499, 347, 10305, 13789, 13, 198, 2, 198, 2, 383, 1336, 5964, 318, 287, 262, 2393, 279...
2.787619
1,050
import os import platform import pytest _is_win = bool(os.environ.get('IS_WIN', None)) _is_macos = bool(os.environ.get('IS_MAC', None)) _is_linux = not _is_macos and not _is_win windows_mark = pytest.mark.unittest if _is_win else pytest.mark.ignore macos_mark = pytest.mark.unittest if _is_macos else pytest.mark.igno...
[ 11748, 28686, 198, 11748, 3859, 198, 198, 11748, 12972, 9288, 198, 198, 62, 271, 62, 5404, 796, 20512, 7, 418, 13, 268, 2268, 13, 1136, 10786, 1797, 62, 37620, 3256, 6045, 4008, 198, 62, 271, 62, 20285, 418, 796, 20512, 7, 418, 13, ...
2.337209
516
if __name__ == '__main__': print(navigation_schmavigation([l.strip() for l in open('input/12')])) print(navigation_schmavigation_2([l.strip() for l in open('input/12')]))
[ 628, 628, 198, 361, 11593, 3672, 834, 6624, 705, 834, 12417, 834, 10354, 198, 220, 220, 220, 3601, 7, 28341, 7065, 62, 20601, 76, 615, 7065, 26933, 75, 13, 36311, 3419, 329, 300, 287, 1280, 10786, 15414, 14, 1065, 11537, 60, 4008, 1...
2.486486
74
from invoke import task @task
[ 6738, 26342, 1330, 4876, 198, 31, 35943, 198 ]
3.75
8
#!/usr/bin/python import re import json import datetime from . import pdk import logging logger = logging.getLogger(__name__)
[ 2, 48443, 14629, 14, 8800, 14, 29412, 198, 11748, 302, 198, 11748, 33918, 198, 11748, 4818, 8079, 198, 6738, 764, 1330, 279, 34388, 198, 11748, 18931, 198, 6404, 1362, 796, 18931, 13, 1136, 11187, 1362, 7, 834, 3672, 834, 8, 198 ]
3.073171
41
""" File defining custom template tags for our project """ # Core Django imports from django import template from django.utils.safestring import mark_safe # app-imports from posts.models import Post # third-party imports import markdown register = template.Library() @register.simple_tag def total_posts(): """...
[ 37811, 9220, 16215, 2183, 11055, 15940, 329, 674, 1628, 37227, 198, 198, 2, 7231, 37770, 17944, 198, 6738, 42625, 14208, 1330, 11055, 198, 6738, 42625, 14208, 13, 26791, 13, 49585, 395, 1806, 1330, 1317, 62, 21230, 198, 198, 2, 598, 12,...
3.403794
369
import os import pytest import torch import tests.base.utils as tutils from pytorch_lightning import Trainer from pytorch_lightning.callbacks import ModelCheckpoint from pytorch_lightning.core import memory from pytorch_lightning.trainer.distrib_parts import ( parse_gpu_ids, determine_root_gpu_device, ) from ...
[ 11748, 28686, 198, 198, 11748, 12972, 9288, 198, 11748, 28034, 198, 198, 11748, 5254, 13, 8692, 13, 26791, 355, 9732, 4487, 198, 6738, 12972, 13165, 354, 62, 2971, 768, 1330, 31924, 198, 6738, 12972, 13165, 354, 62, 2971, 768, 13, 13345...
2.302506
3,990
from django.apps import AppConfig
[ 6738, 42625, 14208, 13, 18211, 1330, 2034, 16934, 628 ]
3.888889
9
## -*- encoding: utf-8 -*- """ This file (./integration_doctest.sage) was *autogenerated* from ./integration.tex, with sagetex.sty version 2011/05/27 v2.3.1. It contains the contents of all the sageexample environments from this file. You should be able to doctest this file with: sage -t ./integration_doctest.sage It i...
[ 2235, 532, 9, 12, 21004, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 37811, 198, 1212, 2393, 357, 19571, 18908, 1358, 62, 4598, 310, 395, 13, 82, 496, 8, 373, 1635, 2306, 519, 877, 515, 9, 422, 24457, 18908, 1358, 13, 16886, 11, 198,...
2.168917
3,185
# Generated by Django 3.0.2 on 2020-07-21 00:58 from django.conf import settings from django.db import migrations, models import django.db.models.deletion
[ 2, 2980, 515, 416, 37770, 513, 13, 15, 13, 17, 319, 12131, 12, 2998, 12, 2481, 3571, 25, 3365, 198, 198, 6738, 42625, 14208, 13, 10414, 1330, 6460, 198, 6738, 42625, 14208, 13, 9945, 1330, 15720, 602, 11, 4981, 198, 11748, 42625, 14...
3.019231
52
""" Заголовок пакета """ default_app_config = 'multimeter.apps.MultimeterConfig' # pylint: disable=invalid-name
[ 37811, 12466, 245, 16142, 140, 111, 25443, 119, 25443, 110, 25443, 118, 12466, 123, 16142, 31583, 16843, 20375, 16142, 37227, 198, 198, 12286, 62, 1324, 62, 11250, 796, 705, 16680, 16912, 13, 18211, 13, 15205, 16912, 16934, 6, 220, 1303, ...
2.235294
51
#!/usr/bin/env python3 import itertools import sys MASK = 0xffffff # did I implement this correctly? assert forward(*map(bytes.fromhex, ('1211100a0908020100', '20796c6c6172'))) == b'\xc0\x49\xa5\x38\x5a\xdc' if len(sys.argv) < 2: print(f"Usage: python3 {sys.argv[0]} <hex>...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 11748, 340, 861, 10141, 198, 11748, 25064, 198, 198, 31180, 42, 796, 657, 87, 12927, 487, 628, 628, 198, 2, 750, 314, 3494, 428, 9380, 30, 198, 30493, 2651, 46491, 8899, 7, 33661...
2.153153
444
if __name__ == '__main__': n = int(input()) student_marks = {} for _ in range(n): name, *line = input().split() scores = list(map(float, line)) student_marks[name] = scores query_name = input() average = sum(student_marks[query_name])/ len(student_marks[query_name]) print...
[ 361, 11593, 3672, 834, 6624, 705, 834, 12417, 834, 10354, 198, 220, 220, 220, 299, 796, 493, 7, 15414, 28955, 198, 220, 220, 220, 3710, 62, 14306, 796, 23884, 198, 220, 220, 220, 329, 4808, 287, 2837, 7, 77, 2599, 198, 220, 220, 2...
3.304511
266
/home/runner/.cache/pip/pool/aa/b2/26/72bdb8c2f74308cbc5f71d13cb1f12d650ade8623046fcee026be0fd38
[ 14, 11195, 14, 16737, 11757, 23870, 14, 79, 541, 14, 7742, 14, 7252, 14, 65, 17, 14, 2075, 14, 4761, 65, 9945, 23, 66, 17, 69, 4524, 21495, 66, 15630, 20, 69, 4869, 67, 1485, 21101, 16, 69, 1065, 67, 17544, 671, 4521, 19214, 351...
1.811321
53
''' Run NASQM created by Dustin Tracy (dtracy.uf@gmail.com) This program is used to automate NASQM job creations. You'll find the parameters to change in the file nasqm_user_input.py ''' import argparse import time from pynasqm.initialize import initialize from pynasqm.inputceon import InputCeon from pynasqm.write impo...
[ 7061, 6, 198, 10987, 7210, 48, 44, 198, 25598, 416, 37616, 31140, 357, 67, 2213, 1590, 13, 3046, 31, 14816, 13, 785, 8, 198, 1212, 1430, 318, 973, 284, 43511, 7210, 48, 44, 1693, 28443, 13, 198, 1639, 1183, 1064, 262, 10007, 284, ...
2.603715
2,584
# coding=utf-8 # Development server from slideatlas import create_app app = create_app() # app.run(host='0.0.0.0', port=8080) if __name__ == "__main__": print "To run:\ngunicorn run_gunicorn:app -b localhost:8080 -w 4"
[ 2, 19617, 28, 40477, 12, 23, 198, 198, 2, 7712, 4382, 198, 6738, 10649, 265, 21921, 1330, 2251, 62, 1324, 198, 1324, 796, 2251, 62, 1324, 3419, 198, 2, 598, 13, 5143, 7, 4774, 11639, 15, 13, 15, 13, 15, 13, 15, 3256, 2493, 28, ...
2.488889
90
import os import helpers from compas_fab.backends import RosClient from compas_fab.robots import PlanningScene import compas HERE = os.path.dirname(__file__) MAX_STEP = 0.01 # Load assembly filename = os.path.join(HERE, 'assembly.json') assembly = compas.json_load(filename) with RosClient() as client: robot = ...
[ 11748, 28686, 198, 198, 11748, 49385, 198, 6738, 552, 292, 62, 36434, 13, 1891, 2412, 1330, 10018, 11792, 198, 6738, 552, 292, 62, 36434, 13, 22609, 1747, 1330, 21913, 36542, 198, 198, 11748, 552, 292, 198, 198, 39, 9338, 796, 28686, ...
2.538462
390
from __future__ import annotations import typing as t import enum from sqlalchemy import ( Column, Integer, String, ForeignKey, MetaData, Table, JSON, ) from sqlalchemy.orm import ( relationship, RelationshipProperty, ) from ...common.sqlalchemy import ( declarative_base, R...
[ 6738, 11593, 37443, 834, 1330, 37647, 198, 11748, 19720, 355, 256, 198, 11748, 33829, 198, 6738, 44161, 282, 26599, 1330, 357, 198, 220, 220, 220, 29201, 11, 198, 220, 220, 220, 34142, 11, 198, 220, 220, 220, 10903, 11, 198, 220, 220,...
2.75
148
#!/usr/bin/env python # Line too long - pylint: disable=C0301 # Invalid name - pylint: disable=C0103 """ Copyright (c) 2004-Present Pivotal Software, Inc. This program and the accompanying materials are made available under the terms of the under the Apache License, Version 2.0 (the "License"); you may not use this ...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 2, 6910, 1165, 890, 532, 279, 2645, 600, 25, 15560, 28, 34, 3070, 486, 198, 2, 17665, 1438, 220, 532, 279, 2645, 600, 25, 15560, 28, 34, 486, 3070, 198, 198, 37811, 198, 15269, 357...
2.322037
5,636
import os import csv total_months=0 total=0 last_pl=0 average_change=0 change_in_pl=0 total_change=0 ginc_profits=0 gdec_profits=0 prev_change_in_pl=0 ginc_profits_month="" gdec_profits_month="" csvpath=os.path.join("..", "Resources", "budget_data.csv") with open (csvpath, newline="") as csvfile: csvreader=...
[ 11748, 28686, 198, 11748, 269, 21370, 198, 198, 23350, 62, 41537, 28, 15, 198, 23350, 28, 15, 198, 12957, 62, 489, 28, 15, 198, 23913, 62, 3803, 28, 15, 198, 3803, 62, 259, 62, 489, 28, 15, 198, 23350, 62, 3803, 28, 15, 198, 165...
2.328302
795
import sys import threading import os import subprocess import time import signal class Basher(): """ Class to execute any command given as a subprocess in a new thread. You can wait for execution to finish or execute in the background and check the output frequently. """ # Init function ...
[ 11748, 25064, 198, 11748, 4704, 278, 198, 11748, 28686, 198, 11748, 850, 14681, 198, 11748, 640, 198, 11748, 6737, 198, 198, 4871, 6455, 372, 33529, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 5016, 284, 12260, 597, 3141, 1813, 355, ...
2.260083
1,438
import sys import numpy as np import re #tag = sys.argv[len(sys.argv)-1] #for each log file for num in range(len(sys.argv)-1): inp = sys.argv[num+1] print('################################################################################') print("File#", num , " ", inp) print('################################...
[ 11748, 25064, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 302, 198, 198, 2, 12985, 796, 25064, 13, 853, 85, 58, 11925, 7, 17597, 13, 853, 85, 13219, 16, 60, 628, 198, 2, 1640, 1123, 2604, 2393, 198, 1640, 997, 287, 2837, 7, 11...
2.075272
3,215
import nltk lines = [] with open("foitext.txt", 'r') as f: for line in f: lines.append(strip_non_ascii(line)) narratives = [x[x.rfind('|')+1:].strip() for x in lines] tokens_list = [nltk.wordpunct_tokenize(x) for x in narratives] # pos_list = [nltk.pos_tag(x) for x in tokens_list] tokens = [] for x in tokens_list...
[ 11748, 299, 2528, 74, 198, 198, 6615, 796, 17635, 198, 4480, 1280, 7203, 6513, 578, 742, 13, 14116, 1600, 705, 81, 11537, 355, 277, 25, 198, 197, 1640, 1627, 287, 277, 25, 198, 197, 197, 6615, 13, 33295, 7, 36311, 62, 13159, 62, 2...
2.307368
475
''' This module implements a listen attend and spell classifier. ''' from __future__ import absolute_import, division, print_function import tensorflow as tf from neuralnetworks.classifiers.classifier import Classifier from neuralnetworks.las_elements import Listener from neuralnetworks.beam_search_speller import Beam...
[ 7061, 6, 198, 1212, 8265, 23986, 257, 6004, 5262, 290, 4822, 1398, 7483, 13, 198, 7061, 6, 198, 6738, 11593, 37443, 834, 1330, 4112, 62, 11748, 11, 7297, 11, 3601, 62, 8818, 198, 198, 11748, 11192, 273, 11125, 355, 48700, 198, 6738, ...
2.050882
1,985
from basketball_reference_web_scraper.data import TEAM_ABBREVIATIONS_TO_TEAM, POSITION_ABBREVIATIONS_TO_POSITION from basketball_reference_web_scraper.parsers.common import COLUMN_RENAMER, COLUMN_PARSER, \ find_team_column, parse_souped_row_given_header_columns, split_header_columns, get_all_tables_with_soup __tot...
[ 6738, 9669, 62, 35790, 62, 12384, 62, 1416, 38545, 13, 7890, 1330, 33536, 62, 6242, 40438, 12861, 18421, 62, 10468, 62, 9328, 2390, 11, 28069, 17941, 62, 6242, 40438, 12861, 18421, 62, 10468, 62, 37997, 17941, 198, 6738, 9669, 62, 35790...
2.292683
246
import h2o from Benchmarker.experiment import Experiment import Benchmarker.config as config import Benchmarker.utils as utils import warnings from optparse import OptionParser from Benchmarker.utils import init_journal, close_journal import numbers import Benchmarker.metaopt.fakegame as fg import Benchmarker....
[ 11748, 289, 17, 78, 201, 198, 6738, 25187, 4102, 263, 13, 23100, 3681, 1330, 29544, 201, 198, 11748, 25187, 4102, 263, 13, 11250, 355, 4566, 201, 198, 11748, 25187, 4102, 263, 13, 26791, 355, 3384, 4487, 201, 198, 11748, 14601, 201, 1...
2.5517
1,412
#!/usr/bin/env python import RPi.GPIO as gpio import os import time import subprocess import sys import signal import threading import datetime # Volume controls day_volume = 70 night_volume = 100 # Control box IO key_channel = 22 button_channel = 7 armed_indicator_channel = 18 activated_indicator_channel = 29 # ...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 198, 11748, 25812, 72, 13, 16960, 9399, 355, 27809, 952, 198, 11748, 28686, 198, 11748, 640, 198, 11748, 850, 14681, 198, 11748, 25064, 198, 11748, 6737, 198, 11748, 4704, 278, 198, 1174...
2.662835
783
"""Callbacks.""" import gin from alpacka.agents.callbacks import graph_size_callback # Configure callbacks in this module to ensure they're accessible via the # alpacka.agents.callbacks.* namespace. GraphSizeCallback = configure_callback(graph_size_callback.GraphSizeCallback) # pylint: disable=invalid-name
[ 37811, 14134, 10146, 526, 15931, 198, 198, 11748, 39733, 198, 198, 6738, 435, 8002, 64, 13, 49638, 13, 13345, 10146, 1330, 4823, 62, 7857, 62, 47423, 628, 198, 2, 17056, 495, 869, 10146, 287, 428, 8265, 284, 4155, 484, 821, 9857, 2884...
3.539326
89
#!/bin/env python # -*- coding: utf-8 -*- # encoding=utf-8 vi:ts=4:sw=4:expandtab:ft=python #====================================================================== # # Copyright (c) 2017 Baidu.com, Inc. All Rights Reserved # #====================================================================== """ @Desc: dist_base_fl...
[ 2, 48443, 8800, 14, 24330, 21015, 198, 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 2, 21004, 28, 40477, 12, 23, 25357, 25, 912, 28, 19, 25, 2032, 28, 19, 25, 11201, 392, 8658, 25, 701, 28, 29412, 198, 2, 239...
1.933229
5,122
# -*- coding: utf-8 -*- # -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------...
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 2, 16529, 1783, 10541, 198, 2, 15069, 357, 66, 8, 5413, 10501, 13, 1439, 2489, 10395, 13, 198, 2, 49962, 739, 262, 17168, 13789, 13, 4091, 13789, 13, 14116, 287, 262, ...
5.411765
85
#!/usr/bin/env python # encoding: utf-8 # # This file is part of graphics-lib. # # Copyright (c) 2020, 2021, 2022 Bernardo Fichera <bernardo.fichera@gmail.com> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Softwar...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 2, 21004, 25, 3384, 69, 12, 23, 198, 2, 198, 2, 220, 220, 220, 770, 2393, 318, 636, 286, 9382, 12, 8019, 13, 198, 2, 198, 2, 220, 220, 220, 15069, 357, 66, 8, 12131, 11, 33448,...
3.283293
413
# coding: utf-8 import pytest from pytest import approx import numpy as np from ....types.angle import Bearing from ....types.array import StateVector, CovarianceMatrix from ....types.detection import Detection from ....types.state import State from ..linear import LinearGaussian from ..nonlinear import ( Combined...
[ 2, 19617, 25, 3384, 69, 12, 23, 198, 11748, 12972, 9288, 198, 6738, 12972, 9288, 1330, 5561, 198, 11748, 299, 32152, 355, 45941, 198, 198, 6738, 19424, 19199, 13, 9248, 1330, 28834, 198, 6738, 19424, 19199, 13, 18747, 1330, 1812, 38469,...
3.655172
116
from flask import Flask,render_template,url_for,request import pandas as pd import pickle import traceback import ast import sklearn import xgboost pickledModel = pickle.load(open('../app/public/latePaymentsModel.pkl','rb')) app = Flask(__name__) @app.route('/') @app.route('/process',methods=["POST"]) if __name__ =...
[ 6738, 42903, 1330, 46947, 11, 13287, 62, 28243, 11, 6371, 62, 1640, 11, 25927, 198, 11748, 19798, 292, 355, 279, 67, 198, 11748, 2298, 293, 198, 11748, 12854, 1891, 198, 11748, 6468, 198, 11748, 1341, 35720, 198, 11748, 2124, 70, 39521,...
2.795276
127
"""OwnYourResponses: turns likes, replies, etc. into posts on your web site. Polls your social network activity and creates new posts on your web site (via Micropub) for public Facebook comments and likes, Instagram likes, and Twitter @-replies, retweets, and favorites. """ import logging import json import urllib.err...
[ 37811, 23858, 7120, 19309, 684, 274, 25, 4962, 7832, 11, 20616, 11, 3503, 13, 656, 6851, 319, 534, 3992, 2524, 13, 198, 198, 47, 33421, 534, 1919, 3127, 3842, 290, 8075, 649, 6851, 319, 534, 3992, 2524, 357, 8869, 198, 25437, 1773, ...
2.597555
2,209
## ssh -L 16006:127.0.0.1:16006 mb2775@ogg.cs.bath.ac.uk import torch from models import XNOR_VGG import torchvision from torchvision import transforms import argparse import binop import torch.utils.tensorboard as tensorboard import os from datetime import datetime import time def accuracy(output, target, topk=(1,))...
[ 2235, 26678, 532, 43, 26143, 21, 25, 16799, 13, 15, 13, 15, 13, 16, 25, 1433, 28041, 285, 65, 1983, 2425, 31, 10332, 13, 6359, 13, 37648, 13, 330, 13, 2724, 198, 11748, 28034, 198, 6738, 4981, 1330, 1395, 35510, 62, 53, 11190, 198...
2.482759
2,146
""" This module provides a solver for the spin-boson model at zero temperature using the hierarchy equations of motion (HEOM) method. """ # Authors: Shahnawaz Ahmed, Neill Lambert # Contact: shahnawaz.ahmed95@gmail.com import numpy as np from copy import copy from qutip import Qobj, qeye from qutip.states import en...
[ 37811, 198, 1212, 8265, 3769, 257, 1540, 332, 329, 262, 7906, 12, 39565, 261, 2746, 379, 6632, 5951, 198, 3500, 262, 18911, 27490, 286, 6268, 357, 13909, 2662, 8, 2446, 13, 198, 37811, 198, 2, 46665, 25, 911, 15386, 707, 1031, 21157, ...
2.094902
5,100
#!/usr/bin/env python from typing import Optional import sys import time import dpkt import pycozmo if __name__ == '__main__': main()
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 198, 6738, 19720, 1330, 32233, 198, 11748, 25064, 198, 11748, 640, 198, 198, 11748, 288, 79, 21841, 198, 198, 11748, 12972, 1073, 89, 5908, 628, 628, 198, 361, 11593, 3672, 834, 6624, ...
2.735849
53
"""Optimum-Path Forest standard definitions. """ import pickle import numpy as np import opfython.math.distance as d import opfython.stream.loader as loader import opfython.utils.exception as e import opfython.utils.logging as l from opfython.core import Subgraph logger = l.get_logger(__name__) class OPF: """...
[ 37811, 27871, 2847, 12, 15235, 9115, 3210, 17336, 13, 198, 37811, 198, 198, 11748, 2298, 293, 198, 198, 11748, 299, 32152, 355, 45941, 198, 198, 11748, 1034, 69, 7535, 13, 11018, 13, 30246, 355, 288, 198, 11748, 1034, 69, 7535, 13, 55...
2.43038
2,054
#!/usr/bin/env python """Record default module version and symlinks as shortcuts""" import os import re import sys from datetime import datetime from pathlib import Path def read_and_record_shortcuts(path, filename): """Read content of the directory, check validity, record to YAML file""" path = Path(path) ...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 198, 37811, 23739, 4277, 8265, 2196, 290, 5659, 28751, 355, 32953, 37811, 198, 198, 11748, 28686, 198, 11748, 302, 198, 11748, 25064, 198, 6738, 4818, 8079, 1330, 4818, 8079, 198, 6738, ...
2.164426
967
import unittest from countryfinder.country_finder import find_countries
[ 11748, 555, 715, 395, 198, 198, 6738, 1499, 22805, 13, 19315, 62, 22805, 1330, 1064, 62, 9127, 1678, 628, 198 ]
3.75
20
# Copyright 2014-2015 PUNCH Cyber Analytics Group # # 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 applica...
[ 2, 220, 220, 15069, 1946, 12, 4626, 350, 47461, 15101, 30437, 4912, 198, 2, 198, 2, 220, 220, 49962, 739, 262, 24843, 13789, 11, 10628, 362, 13, 15, 357, 1169, 366, 34156, 15341, 198, 2, 220, 220, 345, 743, 407, 779, 428, 2393, 28...
3.533937
221
from game import * from random import * # elementos e seus ids # 1-fogo # 2-agua # 3-terra # 4-ar p1 = Player("P1","Guerreiro","Masculino","Indiano") ws1 = [ #Weapon(id ,element ,price ,rarity ,strength ,speed), Weapon( 1 ,randint(1,4),randint(10,200),randint(1,5),randint(10,100),randint...
[ 6738, 983, 1330, 1635, 198, 6738, 4738, 1330, 1635, 198, 2, 5002, 418, 304, 384, 385, 220, 2340, 198, 2, 352, 12, 69, 24076, 198, 2, 362, 12, 363, 6413, 198, 2, 513, 12, 353, 430, 198, 2, 604, 12, 283, 198, 79, 16, 796, 7853, ...
2.141189
942
# Copyright 2017 The TensorFlow Authors. 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 applica...
[ 2, 15069, 2177, 383, 309, 22854, 37535, 46665, 13, 1439, 6923, 33876, 13, 198, 2, 198, 2, 49962, 739, 262, 24843, 13789, 11, 10628, 362, 13, 15, 357, 1169, 366, 34156, 15341, 198, 2, 345, 743, 407, 779, 428, 2393, 2845, 287, 11846, ...
2.516129
1,736
from django.conf.urls import url, include from django.contrib.auth.decorators import login_required from django.urls import path from . import views from rest_framework.routers import DefaultRouter app_name = 'djangobasic' # Create a router and register our viewsets with it. router = DefaultRouter() router.regist...
[ 6738, 42625, 14208, 13, 10414, 13, 6371, 82, 1330, 19016, 11, 2291, 198, 6738, 42625, 14208, 13, 3642, 822, 13, 18439, 13, 12501, 273, 2024, 1330, 17594, 62, 35827, 198, 6738, 42625, 14208, 13, 6371, 82, 1330, 3108, 198, 198, 6738, 76...
2.876161
323
# Copyright (c) 2018 PaddlePaddle Authors. 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 app...
[ 2, 220, 220, 15069, 357, 66, 8, 2864, 350, 37382, 47, 37382, 46665, 13, 1439, 6923, 33876, 13, 198, 2, 198, 2, 49962, 739, 262, 24843, 13789, 11, 10628, 362, 13, 15, 357, 1169, 366, 34156, 15341, 198, 2, 345, 743, 407, 779, 428, ...
3.520833
288
from .uploads_images import custom_upload_to
[ 6738, 764, 39920, 62, 17566, 1330, 2183, 62, 25850, 62, 1462, 198 ]
3.75
12
import pickle get_random_pgm_groups()
[ 11748, 2298, 293, 198, 198, 1136, 62, 25120, 62, 6024, 76, 62, 24432, 3419, 198 ]
2.6
15
# Copyright (C) 2021 rezasf - All Rights Reserved import random res = random.randint(0,40) count = 1 while True: daf =int(input("ye adad vared kon: ")) if daf == res : print("bad az "+ str(count) +" bar talash"+" shoma bordid") break elif daf > res : print("bro pain") coun...
[ 2, 15069, 357, 34, 8, 33448, 302, 89, 292, 69, 532, 1439, 6923, 33876, 198, 11748, 4738, 198, 411, 796, 4738, 13, 25192, 600, 7, 15, 11, 1821, 8, 198, 9127, 796, 352, 198, 198, 4514, 6407, 25, 198, 220, 220, 220, 288, 1878, 796,...
2.135135
185
import magnetovis as mvs import paraview.simple as pvs time = [2015,3,20,0,0,0] # time not used if coord_sys = GSM coord_sys = 'GSM' M=7.788E22 dipoleFieldSourceDisplay, renderView, dipoleFieldSource = mvs.dipole_field(time, M, coord_sys) # create a new 'Glyph' glyph = pvs.Glyph(registrationName='-- Glyph', Input=di...
[ 11748, 19972, 709, 271, 355, 285, 14259, 198, 11748, 1582, 615, 769, 13, 36439, 355, 279, 14259, 198, 198, 2435, 796, 685, 4626, 11, 18, 11, 1238, 11, 15, 11, 15, 11, 15, 60, 1303, 640, 407, 973, 611, 6349, 62, 17597, 796, 402, ...
2.578431
306
import functions as f import random import numpy as np import matplotlib.pyplot as plt import json def crawl2(url, depth, first_call = 0, home_tags = None): ''' Crawl the yt web graph and return relevance index upto defined depth. ''' print("---\tat depth = {}".format(depth)) if depth == 0: return [] tags =...
[ 11748, 5499, 355, 277, 198, 11748, 4738, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 2603, 29487, 8019, 13, 9078, 29487, 355, 458, 83, 198, 11748, 33918, 198, 198, 4299, 27318, 17, 7, 6371, 11, 6795, 11, 717, 62, 13345, 796, 657, ...
2.506732
817
import numpy as np import innvestigate import innvestigate.utils as iutils import innvestigate.utils.visualizations as ivis
[ 11748, 299, 32152, 355, 45941, 198, 198, 11748, 3527, 4223, 10055, 198, 11748, 3527, 4223, 10055, 13, 26791, 355, 1312, 26791, 198, 11748, 3527, 4223, 10055, 13, 26791, 13, 41464, 4582, 355, 21628, 271, 628, 628, 628, 198 ]
3.447368
38
from django.db import models import uuid from model_utils.models import TimeStampedModel from django.conf import settings # Create your models here.
[ 6738, 42625, 14208, 13, 9945, 1330, 4981, 198, 11748, 334, 27112, 198, 6738, 2746, 62, 26791, 13, 27530, 1330, 3862, 1273, 13322, 17633, 198, 6738, 42625, 14208, 13, 10414, 1330, 6460, 628, 198, 198, 2, 13610, 534, 4981, 994, 13, 628, ...
3.690476
42
import platform, sublime, sublime_plugin
[ 11748, 3859, 11, 41674, 11, 41674, 62, 33803, 628, 198 ]
4.3
10
from ..common.trex_exceptions import * from ..utils.common import * from ..utils.text_tables import TRexTextTable, print_table_with_header from ..utils import parsing_opts
[ 6738, 11485, 11321, 13, 83, 21510, 62, 1069, 11755, 1330, 1635, 198, 6738, 11485, 26791, 13, 11321, 1330, 1635, 198, 6738, 11485, 26791, 13, 5239, 62, 83, 2977, 1330, 7579, 1069, 8206, 10962, 11, 3601, 62, 11487, 62, 4480, 62, 25677, ...
3.145161
62
import turtle import pyperclip as pc class TreeBuild: """ Display how our tree looks like. """ @staticmethod @staticmethod class SquareBracketToCurlyBracket: """ [[ ]] -> {{}} or [] -> {} or [[...[]...]] -> {{..{}..}} """ if __name__ == "__main__": rep = "y" while rep == "y" or rep == ...
[ 11748, 28699, 198, 11748, 12972, 525, 15036, 355, 40653, 628, 198, 198, 4871, 12200, 15580, 25, 198, 220, 220, 220, 37227, 16531, 703, 674, 5509, 3073, 588, 13, 37227, 628, 220, 220, 220, 2488, 12708, 24396, 628, 220, 220, 220, 2488, ...
2.071739
460
import pickle import os import json from sentence_transformers import SentenceTransformer if __name__ == "__main__": model = SentenceTransformer('distiluse-base-multilingual-cased', device='cuda') # path = ['./chat_text/poetry.txt', './chat_text/chat_text.txt'] # path = ['./chat_text/chat_text.txt', './cha...
[ 11748, 2298, 293, 198, 11748, 28686, 198, 11748, 33918, 198, 6738, 6827, 62, 35636, 364, 1330, 11352, 594, 8291, 16354, 198, 198, 361, 11593, 3672, 834, 6624, 366, 834, 12417, 834, 1298, 198, 220, 220, 220, 2746, 796, 11352, 594, 8291, ...
1.946878
1,073
from numbers import Number from typing import Type import numpy as np import torch # taken from https://stackoverflow.com/questions/18376935/best-practice-for-equality-in-python def nested_equal(a, b): """ Compare two objects recursively by element, handling numpy objects. Assumes hashable items are no...
[ 6738, 3146, 1330, 7913, 198, 6738, 19720, 1330, 5994, 198, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 28034, 628, 198, 198, 2, 2077, 422, 3740, 1378, 25558, 2502, 11125, 13, 785, 14, 6138, 507, 14, 1507, 2718, 3388, 2327, 14, 134...
2.456464
379
from werkzeug.utils import ImportStringError from flask.config import Config class LazyValue(object): """ This class may be used to lazy resolve config after importing local overrides. For example: REDIS_URL = "redis://localhost:6379/0" CELERY_BROKER_URL = LazyValue(lambda conf: conf['REDIS_URL'])...
[ 6738, 266, 9587, 2736, 1018, 13, 26791, 1330, 17267, 10100, 12331, 198, 6738, 42903, 13, 11250, 1330, 17056, 628, 198, 4871, 406, 12582, 11395, 7, 15252, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 770, 1398, 743, 307, 973, 2...
2.870588
170
#!/usr/bin/env python3 """ This file contains configs that could not be inferred from the default values provided by PyTorch. If PyTorch optimizers and lr_schedulers had type annotations then we could infer everything. default values that cannot be inferred: - tuple - None - required parameters (no default value) Som...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 198, 37811, 198, 1212, 2393, 4909, 4566, 82, 326, 714, 407, 307, 41240, 422, 262, 4277, 3815, 198, 41279, 416, 9485, 15884, 354, 13, 1002, 9485, 15884, 354, 6436, 11341, 290, 300, ...
3.152091
263
# -*- coding: utf-8 -*- """Miscellaneous utils of the package.""" import copy import inspect import itertools import logging import os import pickle import random from collections import defaultdict from glob import glob from statistics import mean from typing import List import numpy as np log = logging.getLogger(_...
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 198, 37811, 31281, 25673, 3384, 4487, 286, 262, 5301, 526, 15931, 198, 11748, 4866, 198, 11748, 10104, 198, 11748, 340, 861, 10141, 198, 11748, 18931, 198, 11748, 28686, 1...
2.223219
4,126
import pandas as pd import collections import numpy as np def count_top_words_in_genre(genre, lyrics_df): """ Detect the language of the text. Parameters ---------- genre : str genre like 'Hip-Hop' or 'Pop' lyrics_df : pandas dataframe clean dataframe ...
[ 11748, 19798, 292, 355, 279, 67, 198, 11748, 17268, 198, 11748, 299, 32152, 355, 45941, 198, 198, 4299, 954, 62, 4852, 62, 10879, 62, 259, 62, 35850, 7, 35850, 11, 15844, 62, 7568, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220...
2.516941
1,033
import logging import torch import numpy as np import common.utils.torchhelper as th import common.trainloop.context as ctx import common.trainloop.hooks as hooks import common.trainloop.data as data
[ 11748, 18931, 198, 198, 11748, 28034, 198, 11748, 299, 32152, 355, 45941, 198, 198, 11748, 2219, 13, 26791, 13, 13165, 354, 2978, 525, 355, 294, 198, 11748, 2219, 13, 27432, 26268, 13, 22866, 355, 269, 17602, 198, 11748, 2219, 13, 27432...
3.409836
61
# ---------------------------------------------------------------------------- # Copyright (c) 2016-2021, QIIME 2 development team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file LICENSE, distributed with this software. # ------------------------------------------------...
[ 2, 16529, 10541, 198, 2, 15069, 357, 66, 8, 1584, 12, 1238, 2481, 11, 1195, 40, 12789, 362, 2478, 1074, 13, 198, 2, 198, 2, 4307, 6169, 739, 262, 2846, 286, 262, 40499, 347, 10305, 13789, 13, 198, 2, 198, 2, 383, 1336, 5964, 318...
2.193858
1,042
from datetime import datetime import time import sys sys.path.insert(1, sys.path[0] + '/lib') from pexpect import pxssh, TIMEOUT CRNL = '\r\n' DEBUG_VERBOSE_PRINTING = False # experimentally derived that a sequence of tries with delays of # 1, 5, 25, 125 secs worked to surmount a 1-second delay (via `tc` test) RETRY...
[ 6738, 4818, 8079, 1330, 4818, 8079, 198, 11748, 640, 198, 11748, 25064, 198, 198, 17597, 13, 6978, 13, 28463, 7, 16, 11, 25064, 13, 6978, 58, 15, 60, 1343, 31051, 8019, 11537, 198, 6738, 613, 87, 806, 1330, 279, 87, 45824, 11, 20460...
2.823529
119
import os import signal import subprocess from behave import given, when, then from test.behave_utils import utils from gppylib.commands.base import Command @when('the standby host goes down') def _handle_sigpipe(): """ Work around https://bugs.python.org/issue1615376, which is not fixed until Python 3.2...
[ 11748, 28686, 198, 11748, 6737, 198, 11748, 850, 14681, 198, 198, 6738, 17438, 1330, 1813, 11, 618, 11, 788, 198, 6738, 1332, 13, 1350, 14150, 62, 26791, 1330, 3384, 4487, 198, 6738, 308, 381, 2645, 571, 13, 9503, 1746, 13, 8692, 1330...
2.647783
406
from groupon import Version __author__ = "Allan Bunch" __copyright__ = "Copyright (C) 2010 Webframeworks LLC" __license__ = """Copyright 2010 Webframeworks LLC Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the Licen...
[ 6738, 1448, 261, 1330, 10628, 198, 198, 834, 9800, 834, 796, 366, 3237, 272, 347, 3316, 1, 198, 834, 22163, 4766, 834, 796, 366, 15269, 357, 34, 8, 3050, 5313, 19298, 19653, 11419, 1, 198, 834, 43085, 834, 796, 37227, 15269, 3050, 5...
2.648571
350
import json from time import sleep import requests from cloudaio import tlsexpert import uuid import random s = requests.session() stylecode = 'DB5074-101' stop = False storage = {} sizes = ['9'] cookie = '_abck=42D4E2E416589130C76B07375A19C056~-1~YAAQwArGF1ovWzJ1AQAAFVlARAS+j6F2rlSe4zrahotRz7GSQSWK5sEIKBw84/F206ZvoZUy...
[ 11748, 33918, 198, 6738, 640, 1330, 3993, 198, 11748, 7007, 198, 6738, 6279, 64, 952, 1330, 256, 75, 8044, 11766, 198, 11748, 334, 27112, 198, 11748, 4738, 198, 82, 796, 7007, 13, 29891, 3419, 198, 7635, 8189, 796, 705, 11012, 1120, 4...
1.776275
961
import streamlit as st import pandas as pd import numpy as np import datetime import plotly.express as px import base64
[ 11748, 4269, 18250, 355, 336, 198, 11748, 19798, 292, 355, 279, 67, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 4818, 8079, 198, 11748, 7110, 306, 13, 42712, 355, 279, 87, 198, 11748, 2779, 2414 ]
3.4
35
import argparse import logging import os from multiprocessing import Pool from distutils.util import strtobool import tensorflow as tf import numpy as np import json from pathlib import Path from generic.data_provider.iterator import Iterator from generic.tf_utils.evaluator import Evaluator from generic.tf_utils.opt...
[ 11748, 1822, 29572, 198, 11748, 18931, 198, 11748, 28686, 198, 6738, 18540, 305, 919, 278, 1330, 19850, 198, 6738, 1233, 26791, 13, 22602, 1330, 965, 83, 672, 970, 198, 198, 11748, 11192, 273, 11125, 355, 48700, 198, 198, 11748, 299, 32...
2.274634
6,292
""" Generally speaking, compass provides a command line util that is used a) as a management script (like django-admin.py) doing for example setup work, adding plugins to a project etc), and b) can compile the sass source files into CSS. While generally project-based, starting with 0.10, compass supposedly sup...
[ 37811, 198, 37058, 5486, 11, 31855, 3769, 257, 3141, 1627, 7736, 326, 318, 973, 198, 220, 257, 8, 355, 257, 4542, 4226, 357, 2339, 42625, 14208, 12, 28482, 13, 9078, 8, 1804, 329, 1672, 198, 220, 220, 220, 9058, 670, 11, 4375, 20652...
2.431663
3,373
import time import unittest from selenium import webdriver from selenium.webdriver.common.keys import Keys if __name__ == '__main__': unittest.main()
[ 11748, 640, 198, 11748, 555, 715, 395, 198, 6738, 384, 11925, 1505, 1330, 3992, 26230, 198, 6738, 384, 11925, 1505, 13, 12384, 26230, 13, 11321, 13, 13083, 1330, 26363, 198, 198, 361, 11593, 3672, 834, 6624, 705, 834, 12417, 834, 10354,...
3.019608
51
from motor.frameworks.asyncio import pymongo_class_wrapper from app.api.api_v2.endpoints import job from typing import Any, List from app.models.tool.job import JobCompositeInResponse, JobInDb, JobInRequest, JobInResponse, JobProgressResponse, JobUpdateModel from app.models.mongo_id import ObjectIdInReq, ObjectIdInR...
[ 198, 6738, 5584, 13, 19298, 19653, 13, 292, 13361, 952, 1330, 279, 4948, 25162, 62, 4871, 62, 48553, 198, 6738, 598, 13, 15042, 13, 15042, 62, 85, 17, 13, 437, 13033, 1330, 1693, 198, 6738, 19720, 1330, 4377, 11, 7343, 198, 6738, 59...
3.314754
305
# Generated by Django 3.1.5 on 2021-02-08 11:06 from django.db import migrations, models import django.db.models.deletion
[ 2, 2980, 515, 416, 37770, 513, 13, 16, 13, 20, 319, 33448, 12, 2999, 12, 2919, 1367, 25, 3312, 198, 198, 6738, 42625, 14208, 13, 9945, 1330, 15720, 602, 11, 4981, 198, 11748, 42625, 14208, 13, 9945, 13, 27530, 13, 2934, 1616, 295, ...
2.818182
44
from shared.const import APPDIR, TMPDIR, TRACEDIR, PUBDIR, BINDIR, CROSSGENDIR from performance.common import remove_directory
[ 6738, 4888, 13, 9979, 1330, 3486, 5760, 4663, 11, 21232, 5760, 4663, 11, 7579, 2246, 1961, 4663, 11, 350, 10526, 34720, 11, 347, 12115, 4663, 11, 8740, 18420, 38, 10619, 4663, 198, 6738, 2854, 13, 11321, 1330, 4781, 62, 34945 ]
3.15
40
import unittest import numpy as np import chainer from chainer import optimizer_hooks from chainer import optimizers from chainer import testing _backend_params = [ # NumPy {}, {'use_ideep': 'always'}, # CuPy {'use_cuda': True, 'cuda_device': 0}, {'use_cuda': True, 'cuda_device': 1}, # C...
[ 11748, 555, 715, 395, 198, 198, 11748, 299, 32152, 355, 45941, 198, 198, 11748, 6333, 263, 198, 6738, 6333, 263, 1330, 6436, 7509, 62, 25480, 82, 198, 6738, 6333, 263, 1330, 6436, 11341, 198, 6738, 6333, 263, 1330, 4856, 628, 198, 62,...
2.385621
306
from restaurants.api.views import RestaurantViewSet from rest_framework.routers import DefaultRouter router = DefaultRouter() router.register(r'', RestaurantViewSet, basename='restaurants') urlpatterns = router.urls # from django.urls import path # from .views import ( RestaurantListView, RestaurantDetailView, # Re...
[ 6738, 10808, 13, 15042, 13, 33571, 1330, 26078, 7680, 7248, 198, 6738, 1334, 62, 30604, 13, 472, 1010, 1330, 15161, 49, 39605, 198, 198, 472, 353, 796, 15161, 49, 39605, 3419, 198, 472, 353, 13, 30238, 7, 81, 6, 3256, 26078, 7680, 7...
3.035714
224
import socket import sys __author__ = 'Gus' HOST = '' PORT = 8889 p = 0 e = 0 s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) print('--Socket created--') try: s.bind((HOST, PORT)) except socket.error as msg: print('Bind failed. Error Code : ' + str(msg[0]) + ' Message ' + msg[1]) sys.exit() print(...
[ 11748, 17802, 198, 11748, 25064, 198, 198, 834, 9800, 834, 796, 705, 38, 385, 6, 198, 198, 39, 10892, 796, 10148, 198, 15490, 796, 807, 39121, 198, 79, 796, 657, 198, 68, 796, 657, 198, 82, 796, 17802, 13, 44971, 7, 44971, 13, 857...
1.967509
554
# encoding: utf-8 # author: BrikerMan # contact: eliyar917@gmail.com # blog: https://eliyar.biz # file: base_processor.py # time: 2019-05-21 11:27 import collections import logging import operator from typing import List, Optional, Union, Dict, Any import numpy as np from tensorflow.python.keras.preprocessing.seque...
[ 2, 21004, 25, 3384, 69, 12, 23, 198, 198, 2, 1772, 25, 25866, 6122, 5124, 198, 2, 2800, 25, 1288, 7745, 283, 24, 1558, 31, 14816, 13, 785, 198, 2, 4130, 25, 3740, 1378, 417, 7745, 283, 13, 42189, 198, 198, 2, 2393, 25, 2779, 6...
2.095499
911