content stringlengths 1 1.05M | input_ids listlengths 1 883k | ratio_char_token float64 1 22.9 | token_count int64 1 883k |
|---|---|---|---|
help = '''Hey \n\n /signup nick: enter your nick and sign up \n\n /atm: see your balance \n\n /send nick amount: send this nick that amount of buxx \n '''
signup = '''Hi! Type /signup to sign up.'''
user_created = '''Created user. Welcome to Paybot '''
user_exists = '''User already exists '''
not_enough_buxx = '''Not... | [
16794,
796,
705,
7061,
10814,
220,
3467,
77,
59,
77,
1220,
12683,
929,
14428,
25,
3802,
534,
14428,
290,
1051,
510,
3467,
77,
59,
77,
1220,
265,
76,
25,
766,
534,
5236,
3467,
77,
59,
77,
1220,
21280,
14428,
2033,
25,
3758,
428,
14... | 2.831933 | 119 |
import os
import sys
import numpy as np
from PIL import Image
num=1
path ="/Users/pection/Documents/mn_furniture/AddwatermarkProgram/Lastday/"
#we shall store all the file names in this list
filelist=[]
for root, dirs, files in os.walk(path):
for file in files:
if(file.endswith(".jpg")):
filelis... | [
11748,
28686,
198,
11748,
25064,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
350,
4146,
1330,
7412,
198,
22510,
28,
16,
198,
6978,
796,
1,
14,
14490,
14,
14978,
14,
38354,
14,
10295,
62,
69,
700,
8089,
14,
4550,
7050,
4102,
15167,
... | 2.285511 | 704 |
import tensorflow as tf
from BrainML.activation import Activator
from BrainML.layers import *
from BrainML.optimizer import Optimizer
from tensorflow.python.util import deprecation
##deprecation._PRINT_DEPRECATION_WARNINGS = False
##tf.compat.v1.disable_eager_execution()
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = ... | [
11748,
11192,
273,
11125,
355,
48700,
198,
6738,
14842,
5805,
13,
48545,
1330,
13144,
1352,
198,
6738,
14842,
5805,
13,
75,
6962,
1330,
1635,
198,
6738,
14842,
5805,
13,
40085,
7509,
1330,
30011,
7509,
198,
6738,
11192,
273,
11125,
13,
... | 2.844961 | 129 |
#encoding=utf-8
import logging
import time
import collections
counter = collections.defaultdict(int)
count_times =collections.defaultdict(int)
| [
2,
12685,
7656,
28,
40477,
12,
23,
198,
11748,
18931,
198,
11748,
640,
628,
198,
11748,
17268,
198,
24588,
796,
17268,
13,
12286,
11600,
7,
600,
8,
198,
9127,
62,
22355,
796,
4033,
26448,
13,
12286,
11600,
7,
600,
8,
198,
220,
220,
... | 3.282609 | 46 |
"""
First of all a tree of N nodes must have exactly N-1 edges.
2 nodes need 1 edge to connect. 3 nodes need 2 edges to connect...
Just draw one or two, you will know it.
Valid tree don't have cycles, there are two ways to detect it.
DFS. and union find. Union find is more suitable in this sutuation.
1. Union find.
W... | [
37811,
198,
5962,
286,
477,
257,
5509,
286,
399,
13760,
1276,
423,
3446,
399,
12,
16,
13015,
13,
198,
17,
13760,
761,
352,
5743,
284,
2018,
13,
513,
13760,
761,
362,
13015,
284,
2018,
986,
198,
5703,
3197,
530,
393,
734,
11,
345,
... | 3.369492 | 590 |
"""Configuration class for icons updating."""
import os
from configparser import ConfigParser
_DESTINATION_NAME = 'dst'
_MAGICK_NAME = 'path'
_SOURCES_NAME = 'src'
| [
37811,
38149,
1398,
329,
17149,
19698,
526,
15931,
198,
198,
11748,
28686,
198,
6738,
4566,
48610,
1330,
17056,
46677,
628,
198,
62,
35,
6465,
1268,
6234,
62,
20608,
796,
705,
67,
301,
6,
198,
62,
45820,
11860,
62,
20608,
796,
705,
69... | 3 | 56 |
"""
Django settings for project project.
Generated by 'django-admin startproject' using Django 3.2.5.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.2/ref/settings/
"""
from datetime... | [
37811,
198,
35,
73,
14208,
6460,
329,
1628,
1628,
13,
198,
198,
8645,
515,
416,
705,
28241,
14208,
12,
28482,
923,
16302,
6,
1262,
37770,
513,
13,
17,
13,
20,
13,
198,
198,
1890,
517,
1321,
319,
428,
2393,
11,
766,
198,
5450,
1378... | 2.484806 | 3,554 |
#Author: Calvin Ryan
import sensor, image, time, pyb, ustruct, math, utime
if __name__ == "__main__":
########### SETUP STUFF
sensor.reset()
sensor.set_pixformat(sensor.RGB565)
sensor.set_framesize(sensor.QVGA)
sensor.skip_frames(time = 2000)
clock = time.clock()
i2c_obj = pyb.I2C(2, py... | [
2,
13838,
25,
25017,
6047,
198,
11748,
12694,
11,
2939,
11,
640,
11,
12972,
65,
11,
334,
7249,
11,
10688,
11,
3384,
524,
628,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
628,
220,
220,
220,
1303,
7804,
2235,
... | 2.272005 | 4,908 |
"""
This script was made to anaylse the relation between JEL and areas in ANPEC.
The idea is that checking the JEL code of each paper, it can be vizualized
whether some papers were published in area (from ANPEC meeting) not expected
by their JEL code.
"""
import os
import pandas as pd
import
| [
37811,
198,
1212,
4226,
373,
925,
284,
281,
323,
75,
325,
262,
8695,
1022,
449,
3698,
290,
3006,
287,
3537,
47,
2943,
13,
198,
198,
464,
2126,
318,
326,
10627,
262,
449,
3698,
2438,
286,
1123,
3348,
11,
340,
460,
307,
48569,
723,
... | 3.494118 | 85 |
"""This script tests garage.tf.spaces.dict functionality."""
import unittest
from garage.misc import ext
from garage.tf.envs import TfEnv
from tests.fixtures.envs.dummy import DummyDictEnv
| [
37811,
1212,
4226,
5254,
15591,
13,
27110,
13,
2777,
2114,
13,
11600,
11244,
526,
15931,
198,
11748,
555,
715,
395,
198,
198,
6738,
15591,
13,
44374,
1330,
1070,
198,
6738,
15591,
13,
27110,
13,
268,
14259,
1330,
309,
69,
4834,
85,
19... | 3.131148 | 61 |
import argparse
import os
import cv2
import numpy as np
import hdf5storage as hdf5
from scipy.io import loadmat
from matplotlib import pyplot as plt
from SpectralUtils import savePNG, projectToRGB
from EvalMetrics import computeMRAE
BIT_8 = 256
# read path
generated_folder_path = "F:\\NTIRE 2020\\spectral reconstru... | [
11748,
1822,
29572,
198,
11748,
28686,
198,
11748,
269,
85,
17,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
289,
7568,
20,
35350,
355,
289,
7568,
20,
198,
6738,
629,
541,
88,
13,
952,
1330,
3440,
6759,
198,
6738,
2603,
29487,
8019... | 3.073892 | 203 |
# -*- coding:utf-8 -*-
import gzip
import re
import http.cookiejar
import urllib.request
import urllib.parse
# from logreg.sender import use_sender, sender
| [
2,
532,
9,
12,
19617,
25,
40477,
12,
23,
532,
9,
12,
198,
11748,
308,
13344,
198,
11748,
302,
198,
11748,
2638,
13,
44453,
9491,
198,
11748,
2956,
297,
571,
13,
25927,
198,
11748,
2956,
297,
571,
13,
29572,
198,
2,
422,
2604,
2301... | 2.854545 | 55 |
import tokenize, operator
macro_list = {}
def pump_token(macro_stack, macro_queue, current, passthrough):
if isinstance(current, list): # an expansion.
for current in current:
pump_token(macro_stack, macro_queue, current, passthrough)
elif len(macro_stack) > 0:
if macro_stack[-1].p... | [
11748,
11241,
1096,
11,
10088,
198,
198,
20285,
305,
62,
4868,
796,
23884,
198,
198,
4299,
8901,
62,
30001,
7,
20285,
305,
62,
25558,
11,
15021,
62,
36560,
11,
1459,
11,
38836,
48476,
740,
2599,
198,
220,
220,
220,
611,
318,
39098,
... | 2.615983 | 1,414 |
#!/usr/bin/env python
from __future__ import print_function
import argparse
import carmcmc as cm
import numpy as np
import os
import plotutils.autocorr as ac
import sys
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('--input', required=True, metavar='FILE', help='input fil... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
198,
11748,
1822,
29572,
198,
11748,
1097,
76,
11215,
66,
355,
12067,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28686,
198,... | 2.330835 | 934 |
from revscoring.features import Feature, wikitext
from revscoring.features.modifiers import div, log, max, sub
parent = [
log(wikitext.revision.parent.chars + 1),
log(wikitext.revision.parent.tokens + 1),
log(wikitext.revision.parent.words + 1),
log(wikitext.revision.parent.uppercase_words + 1),
... | [
6738,
2710,
46536,
13,
40890,
1330,
27018,
11,
47145,
578,
742,
198,
6738,
2710,
46536,
13,
40890,
13,
4666,
13350,
1330,
2659,
11,
2604,
11,
3509,
11,
850,
628,
198,
198,
8000,
796,
685,
198,
220,
220,
220,
2604,
7,
20763,
578,
742... | 2.234915 | 1,707 |
# Copyright 2017, Google 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 source code must retain the above copyright
# notice, this list of conditions and the f... | [
2,
15069,
2177,
11,
3012,
3457,
13,
198,
2,
1439,
2489,
10395,
13,
198,
2,
198,
2,
2297,
396,
3890,
290,
779,
287,
2723,
290,
13934,
5107,
11,
351,
393,
1231,
198,
2,
17613,
11,
389,
10431,
2810,
326,
262,
1708,
3403,
389,
198,
... | 3.383686 | 662 |
from django.urls import reverse
from rest_framework.test import APITestCase
from rest_framework import status
from nose.tools import eq_
from faker import Faker
import factory
from ..models import Demand
from .factories import DemandFactory
from ..serializers import DemandSerializer
from droidio.users.test.factorie... | [
6738,
42625,
14208,
13,
6371,
82,
1330,
9575,
198,
198,
6738,
1334,
62,
30604,
13,
9288,
1330,
3486,
2043,
395,
20448,
198,
6738,
1334,
62,
30604,
1330,
3722,
198,
198,
6738,
9686,
13,
31391,
1330,
37430,
62,
198,
6738,
277,
3110,
133... | 3.778947 | 95 |
# https://leetcode.com/explore/learn/card/fun-with-arrays/527/searching-for-items-in-an-array/3250/
# time: O(n)
# space: O(n)
| [
2,
3740,
1378,
293,
316,
8189,
13,
785,
14,
20676,
382,
14,
35720,
14,
9517,
14,
12543,
12,
4480,
12,
3258,
592,
14,
20,
1983,
14,
12947,
278,
12,
1640,
12,
23814,
12,
259,
12,
272,
12,
18747,
14,
2624,
1120,
14,
198,
198,
2,
... | 2.133333 | 60 |
# coding=utf-8
# 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 ... | [
2,
19617,
28,
40477,
12,
23,
198,
2,
15069,
33448,
3012,
11419,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,... | 3.377432 | 257 |
#Copyright 2020 DB Engineering
#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, softwa... | [
2,
15269,
12131,
20137,
14044,
198,
198,
2,
26656,
15385,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
5832,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198,
2,
1639,
743... | 2.590909 | 2,552 |
#
# This is the library part of Anita, the Automated NetBSD Installation
# and Test Application.
#
import os
import pexpect
import re
import string
import subprocess
import sys
import time
import urllib
import urlparse
__version__='1.40'
# Your preferred NetBSD FTP mirror site.
# This is used only by the obsolete co... | [
2,
198,
2,
770,
318,
262,
5888,
636,
286,
38992,
11,
262,
17406,
515,
3433,
21800,
32588,
198,
2,
290,
6208,
15678,
13,
198,
2,
198,
198,
11748,
28686,
198,
11748,
613,
87,
806,
198,
11748,
302,
198,
11748,
4731,
198,
11748,
850,
... | 3.044835 | 1,762 |
# Copyright (c) 2019, Solitude Developers
#
# This source code is licensed under the BSD-3-Clause license found in the
# COPYING file in the root directory of this source tree
from typing import Mapping, Union, Optional # noqa
import os
import shutil
import tempfile
from functools import wraps
from collections import... | [
2,
15069,
357,
66,
8,
13130,
11,
4294,
3984,
34152,
198,
2,
198,
2,
770,
2723,
2438,
318,
11971,
739,
262,
347,
10305,
12,
18,
12,
2601,
682,
5964,
1043,
287,
262,
198,
2,
27975,
45761,
2393,
287,
262,
6808,
8619,
286,
428,
2723,
... | 2.849057 | 636 |
from abc import ABC, abstractmethod
from datetime import datetime
from typing import TYPE_CHECKING, Dict, Any, List, Optional
if TYPE_CHECKING:
from openwater.core import OpenWater
def __hash__(self):
return hash(self.id)
| [
6738,
450,
66,
1330,
9738,
11,
12531,
24396,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
6738,
19720,
1330,
41876,
62,
50084,
2751,
11,
360,
713,
11,
4377,
11,
7343,
11,
32233,
198,
198,
361,
41876,
62,
50084,
2751,
25,
198,
220,
... | 3.025 | 80 |
#!/usr/bin/env python
import struct
from elftools.elf.elffile import ELFFile
if __name__ == '__main__':
main()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
2878,
198,
198,
6738,
1288,
701,
10141,
13,
7046,
13,
417,
487,
576,
1330,
17852,
5777,
576,
628,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
... | 2.520833 | 48 |
from .attribute import process_attribute
| [
6738,
764,
42348,
1330,
1429,
62,
42348,
198
] | 5.125 | 8 |
import hashlib
from django.test import TestCase
from django.urls import reverse
from shortener.models import Url
| [
11748,
12234,
8019,
198,
198,
6738,
42625,
14208,
13,
9288,
1330,
6208,
20448,
198,
6738,
42625,
14208,
13,
6371,
82,
1330,
9575,
198,
198,
6738,
1790,
877,
13,
27530,
1330,
8799,
75,
628
] | 3.515152 | 33 |
import torch
import torch.nn as nn
from timm.loss import LabelSmoothingCrossEntropy
from pytorch_metric_learning import losses
| [
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
6738,
4628,
76,
13,
22462,
1330,
36052,
7556,
1025,
722,
21544,
14539,
28338,
198,
6738,
12972,
13165,
354,
62,
4164,
1173,
62,
40684,
1330,
9089,
628,
198
] | 3.394737 | 38 |
from rdflib import URIRef
from rdflib.namespace import DC, RDF, OWL, RDFS
from geontology import GeoOntology
ont = GeoOntology("geo_ontology.ttl", frmt='n3')
# print ont.serialize()
graph = ont.graph
print "InfoColumns"
for s, p, o in graph.triples(
(None, RDFS.subClassOf, URIRef('http://move.ugent.be/geod... | [
6738,
374,
67,
2704,
571,
1330,
37902,
4663,
891,
198,
6738,
374,
67,
2704,
571,
13,
14933,
10223,
1330,
6257,
11,
371,
8068,
11,
47210,
43,
11,
371,
8068,
50,
198,
198,
6738,
4903,
756,
1435,
1330,
32960,
45984,
1435,
628,
198,
756... | 1.908946 | 626 |
import os
import os.path as osp
import argparse
import random
parser = argparse.ArgumentParser(description='Emotiw dataset list producer')
args = parser.parse_args()
train = "/home/quxiaoye/disk/FR/Emotiw2018/data/Train_AFEW_all/Emotiw-faces"
test = "/home/quxiaoye/disk/FR/Emotiw2018/data/Val_AFEW/Emotiw-faces"
tr... | [
11748,
28686,
198,
11748,
28686,
13,
6978,
355,
267,
2777,
198,
11748,
1822,
29572,
198,
11748,
4738,
198,
198,
48610,
796,
1822,
29572,
13,
28100,
1713,
46677,
7,
11213,
11639,
10161,
5092,
86,
27039,
1351,
9920,
11537,
198,
198,
22046,
... | 2.442308 | 572 |
IMG_DIR = "/path/to/pictures"
IMG_POLL_RATE = 1 # minute
DWELL_TIME = 5 # seconds
FADE_TIME = 1 # seconds
REFRESH_RATE = 10 # milliseconds
| [
3955,
38,
62,
34720,
796,
12813,
6978,
14,
1462,
14,
18847,
942,
1,
198,
3955,
38,
62,
16402,
3069,
62,
49,
6158,
796,
352,
1303,
5664,
198,
198,
35,
8845,
3069,
62,
34694,
796,
642,
1303,
4201,
198,
37,
19266,
62,
34694,
796,
352... | 2.389831 | 59 |
#######################################################################
##
## Zed64 MetroComputer
##
## Unless a module otherwise marked,
## Copyright 2014, Michael T. Mayers (michael@tweakoz.com
## Provided under the Creative Commons Attribution License 3.0
## Please see https://creativecommons.org/licenses/by/3.0/us/... | [
29113,
29113,
4242,
21017,
198,
2235,
198,
2235,
46159,
2414,
12477,
34556,
198,
2235,
198,
2235,
17486,
257,
8265,
4306,
7498,
11,
198,
2235,
15069,
1946,
11,
3899,
309,
13,
1737,
364,
357,
76,
40302,
31,
83,
38695,
8590,
13,
785,
19... | 2.358127 | 726 |
# https://leetcode.com/problems/smallest-subsequence-of-distinct-characters/
# Return the lexicographically smallest subsequence of s that contains all the
# distinct characters of s exactly once.
# Note: This question is the same as 316: https://leetcode.com/problems/remove-
# duplicate-letters/
###################... | [
2,
3740,
1378,
293,
316,
8189,
13,
785,
14,
1676,
22143,
14,
17470,
395,
12,
7266,
43167,
12,
1659,
12,
17080,
4612,
12,
10641,
19858,
14,
198,
198,
2,
8229,
262,
31191,
291,
33145,
18197,
6399,
594,
286,
264,
326,
4909,
477,
262,
... | 4.18254 | 126 |
import boto3
import re
import datetime
import time
ec = boto3.client('ec2')
iam = boto3.client('iam')
"""
This function looks at *all* snapshots that have the tags "Type:Automated" and
"DeleteOn" containing the current day formatted as YYYY-MM-DD. The function will
delete the if the todays date is > than the "DeleteO... | [
11748,
275,
2069,
18,
198,
11748,
302,
198,
11748,
4818,
8079,
198,
11748,
640,
198,
198,
721,
796,
275,
2069,
18,
13,
16366,
10786,
721,
17,
11537,
198,
1789,
796,
275,
2069,
18,
13,
16366,
10786,
1789,
11537,
198,
198,
37811,
198,
... | 3.215686 | 102 |
'''OpenGL extension NV.fragment_program
This module customises the behaviour of the
OpenGL.raw.GL.NV.fragment_program to provide a more
Python-friendly API
'''
from OpenGL import platform, constants, constant, arrays
from OpenGL import extensions, wrapper
from OpenGL.GL import glget
import ctypes
from OpenGL.raw.GL.... | [
7061,
6,
11505,
8763,
7552,
23973,
13,
8310,
363,
434,
62,
23065,
198,
198,
1212,
8265,
2183,
2696,
262,
9172,
286,
262,
220,
198,
11505,
8763,
13,
1831,
13,
8763,
13,
27159,
13,
8310,
363,
434,
62,
23065,
284,
2148,
257,
517,
220,
... | 3.53271 | 107 |
from appr.commands.push import PushCmd as ApprPushCmd
from kpm.manifest_jsonnet import ManifestJsonnet
| [
6738,
598,
81,
13,
9503,
1746,
13,
14689,
1330,
23691,
40109,
355,
2034,
81,
49222,
40109,
198,
198,
6738,
479,
4426,
13,
805,
8409,
62,
17752,
3262,
1330,
36757,
41,
1559,
3262,
628
] | 3.181818 | 33 |
"""
Define the errors which may occur
"""
langMismatchWarning = "Classical language {} does not match output language {}"
langNotDefWarning = "Language {0} translation not found, check QASMToQuEST/langs/{0}.py exists"
noLangSpecWarning = "No language specified for screen print"
noSpecWarning = "Neither language nor out... | [
37811,
198,
7469,
500,
262,
8563,
543,
743,
3051,
198,
37811,
198,
17204,
44,
1042,
963,
20361,
796,
366,
9487,
605,
3303,
23884,
857,
407,
2872,
5072,
3303,
23884,
1,
198,
17204,
3673,
7469,
20361,
796,
366,
32065,
1391,
15,
92,
1105... | 3.870968 | 93 |
from common.matrix import Matrix
| [
6738,
2219,
13,
6759,
8609,
1330,
24936,
628
] | 4.25 | 8 |
# exercism exercise "transpose"
print(transpose("AB\nC"))
print(repr(transpose("AB\nC").split('\n')))
| [
2,
4208,
1042,
5517,
366,
7645,
3455,
1,
198,
198,
4798,
7,
7645,
3455,
7203,
6242,
59,
77,
34,
48774,
198,
4798,
7,
260,
1050,
7,
7645,
3455,
7203,
6242,
59,
77,
34,
11074,
35312,
10786,
59,
77,
6,
22305,
198
] | 2.512195 | 41 |
import h5py | [
11748,
289,
20,
9078
] | 2.75 | 4 |
from django.db import models
from django.utils.timezone import now
from django.core.validators import FileExtensionValidator
from django.contrib.auth import get_user_model
from django.contrib.postgres.fields import ArrayField
from django.db.models import (Func, Value, CharField, IntegerField)
from .shortcuts import up... | [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
42625,
14208,
13,
26791,
13,
2435,
11340,
1330,
783,
198,
6738,
42625,
14208,
13,
7295,
13,
12102,
2024,
1330,
9220,
11627,
3004,
47139,
1352,
198,
6738,
42625,
14208,
13,
3642,
822,
... | 3.406667 | 150 |
import OnePy as op
instrument = "000001"
ktype = "D"
start = "2017-01-01"
end = None
test = op.Tushare_to_MongoDB(database=instrument, collection=ktype)
test.data_to_db(code=instrument, start=start, end=end, ktype=ktype, autype="qfq", index=False)
| [
11748,
1881,
20519,
355,
1034,
198,
198,
259,
43872,
796,
366,
2388,
486,
1,
198,
74,
4906,
796,
366,
35,
1,
198,
9688,
796,
366,
5539,
12,
486,
12,
486,
1,
198,
437,
796,
6045,
198,
198,
9288,
796,
1034,
13,
51,
1530,
533,
62,
... | 2.475248 | 101 |
from __future__ import print_function
import h5py as h5f
import numpy as np
import six
import os
from .npy_generator import NpzGeneratorDataset
from .image import *
| [
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
198,
11748,
289,
20,
9078,
355,
289,
20,
69,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
2237,
198,
11748,
28686,
198,
198,
6738,
764,
77,
9078,
62,
8612,
1352,
1330,
399,
79,
... | 3.036364 | 55 |
import Distances as d
import pandas as pd
import numpy as np
| [
11748,
4307,
1817,
355,
288,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198
] | 3.210526 | 19 |
from django.contrib import admin
from .models import TipoDeGasto, PresupuestoDeGasto
admin.site.register(TipoDeGasto)
admin.site.register(PresupuestoDeGasto) | [
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
201,
198,
201,
198,
6738,
764,
27530,
1330,
23095,
78,
5005,
38,
459,
78,
11,
1763,
929,
84,
395,
78,
5005,
38,
459,
78,
201,
198,
201,
198,
28482,
13,
15654,
13,
30238,
7,
28434,
78... | 2.447761 | 67 |
#!/usr/bin/env python
# encoding: utf-8
"""
Validate a JavaScript file using eslint.
Author: Nate Silva
Copyright 2014 Nate Silva
License: MIT
"""
from __future__ import print_function
import sys
import os
import re
import time
import json
import subprocess
import tempfile
import hashlib
import shutil
def find_up_... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
21004,
25,
3384,
69,
12,
23,
198,
198,
37811,
198,
7762,
20540,
257,
11933,
2393,
1262,
1658,
75,
600,
13,
198,
198,
13838,
25,
23486,
23720,
198,
15269,
1946,
23486,
23720,
198,
... | 2.707749 | 1,355 |
# y = f(X)
# y = 2*x -10 # x>0
# y = 0# x=0
# y = 2 * abs(x) -1 # x<0
print(" ")
x = float(input())
y = 0
if x > 0:
y = 2*x -10
elif x == 0:
y = 0
else: #x<0
y = 2 * abs(x) -1
print ("y: ",y)
| [
2,
331,
796,
277,
7,
55,
8,
201,
198,
2,
331,
796,
362,
9,
87,
532,
940,
1303,
2124,
29,
15,
201,
198,
2,
331,
796,
657,
2,
2124,
28,
15,
201,
198,
2,
331,
796,
362,
1635,
2352,
7,
87,
8,
532,
16,
1303,
2124,
27,
15,
201... | 1.561644 | 146 |
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.optim
import torch.utils.data
import torch.nn.functional as F
from torch.nn import init
| [
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
11748,
28034,
13,
20471,
13,
1845,
29363,
198,
11748,
28034,
13,
1891,
2412,
13,
66,
463,
20471,
355,
269,
463,
20471,
198,
11748,
28034,
13,
40085,
198,
11748,
28034,
13,
... | 3.222222 | 63 |
import setuptools
exec(open('histoprep/_version.py').read())
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
setuptools.setup(
name="histoprep",
version=__version__,
author="jopo666",
scripts=['HistoPrep'],
author_email="jopo@birdlover.com",
description="... | [
11748,
900,
37623,
10141,
198,
198,
18558,
7,
9654,
10786,
10034,
404,
7856,
47835,
9641,
13,
9078,
27691,
961,
28955,
198,
198,
4480,
1280,
7203,
15675,
11682,
13,
9132,
1600,
366,
81,
1600,
21004,
2625,
40477,
12,
23,
4943,
355,
277,
... | 2.244592 | 601 |
import platform
from setuptools import Extension, setup
target = platform.system().lower()
extra_compile_args = []
if target.startswith('linux'):
extra_compile_args.append('-std=c++11')
ext = Extension(
name='depth_sort',
sources=['depth_sort.cpp'],
extra_compile_args=extra_compile_args,
)
setup(
... | [
11748,
3859,
198,
198,
6738,
900,
37623,
10141,
1330,
27995,
11,
9058,
198,
198,
16793,
796,
3859,
13,
10057,
22446,
21037,
3419,
198,
198,
26086,
62,
5589,
576,
62,
22046,
796,
17635,
198,
198,
361,
2496,
13,
9688,
2032,
342,
10786,
... | 2.542484 | 153 |
## @package Training_app
# Training code developed with Tensorflow Keras. Content: Unet, Unet++ and FCN
#
# @version 1
#
# Pontificia Universidad Javeriana
#
# Electronic Enginnering
#
# Developed by:
# - Andrea Juliana Ruiz Gomez
# Mail: <andrea_ruiz@javeriana.edu.co>
# GitHub: andrearuizg
# - Pedro E... | [
2235,
2488,
26495,
13614,
62,
1324,
198,
2,
13614,
2438,
4166,
351,
309,
22854,
11125,
17337,
292,
13,
14041,
25,
791,
316,
11,
791,
316,
4880,
290,
10029,
45,
198,
2,
220,
198,
2,
220,
2488,
9641,
352,
220,
198,
2,
198,
2,
26345,... | 3.136445 | 1,114 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import tensorflow as tf
import copy
from tf_image_segmentation.models.fcn_8s import FCN_8s
from tf_image_segmentation.utils.tf_records import read_tfrecord_and_decode_into_image_annotation_pair_tensors
from tf_image_segmentation.utils.training import get_valid_logits_and_l... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
11748,
4866,
198,
6738,
48700,
62,
9060,
62,
325,
5154,
341,
13,
27530,... | 2.424084 | 382 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'ipetrash'
try:
from PyQt4.QtCore import QSettings
except:
from PyQt5.QtCore import QSettings
if __name__ == '__main__':
config = QSettings('config.ini', QSettings.IniFormat)
counter = int(config.value('counter', 0))
config.setValue('... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
834,
9800,
834,
796,
705,
541,
21879,
1077,
6,
628,
198,
28311,
25,
198,
220,
220,
220,
422,
9485,
48,
83,... | 2.493421 | 152 |
#!/usr/bin/env python
__version__ = '0.9.6'
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
628,
198,
834,
9641,
834,
796,
705,
15,
13,
24,
13,
21,
6,
198
] | 2.090909 | 22 |
"""
Main test
"""
import unittest
import uuid
from api import APP
from flask import json
from api.models.user import User
from api.models.business import Business
from api.helpers import get_token
| [
37811,
198,
220,
220,
220,
8774,
1332,
198,
37811,
198,
11748,
555,
715,
395,
198,
11748,
334,
27112,
198,
6738,
40391,
1330,
43504,
198,
6738,
42903,
1330,
33918,
198,
6738,
40391,
13,
27530,
13,
7220,
1330,
11787,
198,
6738,
40391,
13... | 3.54386 | 57 |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
Topic: print
Desc :
"""
if __name__ == '__main__':
print_sepend()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
21004,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
33221,
25,
3601,
198,
24564,
1058,
220,
198,
37811,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,... | 2.232143 | 56 |
import yaml
| [
11748,
331,
43695,
628
] | 3.25 | 4 |
from django.db import models
from game.models import Game
| [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
983,
13,
27530,
1330,
3776,
198
] | 3.866667 | 15 |
import math
import matplotlib.pyplot as plt
from simpy import model
ax1 = plt.subplot(121)
ax2 = plt.subplot(122)
model_sin = model.TimedFunctionModel(math.sin)
model_cos = model.TimedFunctionModel(math.cos)
scope = model.ScopeModel(ax1, ax2)
| [
11748,
10688,
198,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
198,
6738,
985,
9078,
1330,
2746,
198,
198,
897,
16,
796,
458,
83,
13,
7266,
29487,
7,
19244,
8,
198,
897,
17,
796,
458,
83,
13,
7266,
29487,
7,... | 2.638298 | 94 |
bs=input("Enter basic salary:")
days=input("Enter no. of working days:")
ovrti=input("Enter no. of overtime working hrs:")
deduct=0
if days<6:
deduct=3500
salary=calci(bs,days,ovrti,deduct)
elif days>=6 and days<=12:
deduct=1000
salary= calci(bs,days,ovrti,deduct)
elif days>=13 and days<=18:
deduct=800
... | [
1443,
28,
15414,
7203,
17469,
4096,
9588,
25,
4943,
198,
12545,
28,
15414,
7203,
17469,
645,
13,
286,
1762,
1528,
25,
4943,
198,
709,
17034,
72,
28,
15414,
7203,
17469,
645,
13,
286,
17820,
1762,
36201,
25,
4943,
198,
9395,
4782,
28,
... | 2.294444 | 180 |
# class Song: # Song is name of Class, start with Capital letter
# def __init__(self, title="", author="", lyrics=tuple()): # constructor method called upon creation of object
# self.title = title
# self.author = author
# self.lyrics = lyrics
# # print(f"New Song made by Author: {s... | [
2,
1398,
10940,
25,
220,
1303,
10940,
318,
1438,
286,
5016,
11,
923,
351,
9747,
3850,
198,
2,
220,
220,
220,
220,
825,
11593,
15003,
834,
7,
944,
11,
3670,
2625,
1600,
1772,
2625,
1600,
15844,
28,
83,
29291,
3419,
2599,
220,
1303,
... | 2.337423 | 489 |
"""
Modules to configure Django's settings
"""
| [
37811,
198,
220,
220,
220,
3401,
5028,
284,
17425,
37770,
338,
6460,
198,
37811,
198
] | 3.4 | 15 |
from constants import STYLE_NORMAL, STYLE_BOLD, STYLE_ITALIC
from prefabs.text import write_autoline
from widgets.widget import WidgetByRect
from base_node import get_surface
from prefabs.surface import blit
from shape import Rect
import pygame
__all__ = [
'Text'
]
| [
6738,
38491,
1330,
3563,
56,
2538,
62,
35510,
42126,
11,
3563,
56,
2538,
62,
33,
15173,
11,
3563,
56,
2538,
62,
40579,
2149,
198,
6738,
7694,
8937,
13,
5239,
1330,
3551,
62,
2306,
14453,
198,
6738,
40803,
13,
42655,
1330,
370,
17484,
... | 3.067416 | 89 |
'''
Source codes for Python Machine Learning By Example 2nd Edition (Packt Publishing)
Chapter 5: Classifying Newsgroup Topic with Support Vector Machine
Author: Yuxi (Hayden) Liu
'''
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.datasets import fetch_20newsgroups
from nltk.corpus import nam... | [
7061,
6,
198,
7416,
12416,
329,
11361,
10850,
18252,
2750,
17934,
362,
358,
5061,
357,
11869,
83,
23499,
8,
198,
14126,
642,
25,
5016,
4035,
3000,
8094,
47373,
351,
7929,
20650,
10850,
198,
13838,
25,
575,
2821,
72,
357,
31306,
6559,
... | 2.755568 | 1,796 |
#-------------------------------------------------------------------------------
#
# Written by: David C. Morrill
#
# Date: 05/20/2005
#
# (c) Copyright 2005 by Enthought, Inc.
#
# Classes defined: KeyBinding, KeyBindings
#
#-------------------------------------------------------------------------------
""" Defines... | [
2,
10097,
24305,
198,
2,
198,
2,
220,
22503,
416,
25,
3271,
327,
13,
3461,
20190,
198,
2,
198,
2,
220,
7536,
25,
8870,
14,
1238,
14,
14315,
198,
2,
198,
2,
220,
357,
66,
8,
15069,
5075,
416,
2039,
28895,
11,
3457,
13,
198,
2,
... | 5.487455 | 279 |
#!/usr/bin/env python3
# -*-coding:utf-8 -*
import cocos
from cocos.text import HTMLLabel
from cocos.director import director
if __name__ == '__main__':
main() | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
66,
7656,
25,
40477,
12,
23,
532,
9,
198,
198,
11748,
8954,
418,
198,
6738,
8954,
418,
13,
5239,
1330,
7154,
44,
3069,
9608,
198,
6738,
8954,
418,
13,
35248,
1... | 2.578125 | 64 |
#
from nltk.tokenize import word_tokenize
from xml.dom import minidom
import progressbar
from time import sleep
input_file = 'data/dataset_output.txt'
num_lines = sum(1 for line in open(input_file))
read_file = open(input_file, 'r')
write_output_file = open('data/dataset_output_no_pronouns.txt', 'w')
pronouns = ['h... | [
2,
198,
6738,
299,
2528,
74,
13,
30001,
1096,
1330,
1573,
62,
30001,
1096,
198,
6738,
35555,
13,
3438,
1330,
949,
312,
296,
198,
11748,
4371,
5657,
198,
6738,
640,
1330,
3993,
198,
198,
15414,
62,
7753,
796,
705,
7890,
14,
19608,
29... | 2.279936 | 1,879 |
"""
Python3 Module
Summary:
User Input Manipulation
"""
import re
from string import ascii_lowercase
def bool_assignment(arg, patterns=None):
"""
Summary:
Enforces correct bool argment assignment
Arg:
:arg (*): arg which must be interpreted as either bool True or False
Returns:
... | [
37811,
198,
37906,
18,
19937,
198,
198,
22093,
25,
198,
220,
220,
220,
11787,
23412,
35045,
1741,
198,
198,
37811,
198,
11748,
302,
198,
6738,
4731,
1330,
355,
979,
72,
62,
21037,
7442,
628,
198,
4299,
20512,
62,
562,
16747,
7,
853,
... | 2.245981 | 1,244 |
import duckdb
from datetime import date
from dateutil.relativedelta import relativedelta
import os
import shutil
con = duckdb.connect(database='ldbc.duckdb', read_only=False)
# batches are selected from the [network_start_date, network_end_date) interval,
# each batch denotes a [batch_start_date, batch_end_date) wher... | [
11748,
22045,
9945,
198,
6738,
4818,
8079,
1330,
3128,
198,
6738,
3128,
22602,
13,
2411,
265,
1572,
12514,
1330,
48993,
1572,
12514,
198,
11748,
28686,
198,
11748,
4423,
346,
198,
198,
1102,
796,
22045,
9945,
13,
8443,
7,
48806,
11639,
... | 2.133735 | 7,971 |
try:
a=int(input("Please enter a number:"))
if 9<a<100:
a = str(a)
print(a[0])
print(a[1])
else:
print("no correct")
except:
print("no correct")
| [
28311,
25,
198,
220,
220,
220,
257,
28,
600,
7,
15414,
7203,
5492,
3802,
257,
1271,
11097,
4008,
198,
220,
220,
220,
611,
860,
27,
64,
27,
3064,
25,
198,
220,
220,
220,
220,
220,
220,
220,
257,
796,
965,
7,
64,
8,
198,
220,
22... | 1.873786 | 103 |
"""
Contains all the logic for running the game (game clock, per-frame logic, game state update generation, and so on)
""" | [
37811,
198,
4264,
1299,
477,
262,
9156,
329,
2491,
262,
983,
357,
6057,
8801,
11,
583,
12,
14535,
9156,
11,
983,
1181,
4296,
5270,
11,
290,
523,
319,
8,
198,
37811
] | 3.935484 | 31 |
import hypothesis
import torch
from hypothesis.nn.util import list_modules_with_type
| [
11748,
14078,
198,
11748,
28034,
198,
198,
6738,
14078,
13,
20471,
13,
22602,
1330,
1351,
62,
18170,
62,
4480,
62,
4906,
628,
628,
628
] | 3.791667 | 24 |
#!/usr/bin/python3
"""
Good morning! Here's your coding interview problem for today.
This problem was asked by Uber.
Given an array of integers, return a new array such that each element at index i of the new array is the product of all the numbers in the original array except the one at i.
For example, if our input... | [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
37811,
198,
10248,
3329,
0,
3423,
338,
534,
19617,
2720,
1917,
329,
1909,
13,
198,
198,
1212,
1917,
373,
1965,
416,
12024,
13,
198,
198,
15056,
281,
7177,
286,
37014,
11,
1441,
257,
649... | 2.980952 | 210 |
from django.core.management.base import NoArgsCommand, CommandError;
from ldap_login.ldapUtils import ldapManager;
from ldap_login.models import user,group,Role;
from datetime import datetime;
import traceback;
| [
6738,
42625,
14208,
13,
7295,
13,
27604,
13,
8692,
1330,
1400,
42035,
21575,
11,
9455,
12331,
26,
198,
6738,
300,
67,
499,
62,
38235,
13,
335,
499,
18274,
4487,
1330,
300,
67,
499,
13511,
26,
198,
6738,
300,
67,
499,
62,
38235,
13,
... | 2.871795 | 78 |
from rocketchat_API.APISections.base import RocketChatBase
| [
6738,
3881,
7569,
265,
62,
17614,
13,
2969,
1797,
478,
507,
13,
8692,
1330,
16920,
30820,
14881,
628
] | 3.333333 | 18 |
from django.db import models
from django.contrib.auth.models import User
from instances.models import Instance
| [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
27530,
1330,
11787,
198,
6738,
10245,
13,
27530,
1330,
2262,
590,
628,
198
] | 3.766667 | 30 |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import json
import warnings
import pulumi
import pulumi.runtime
from typing import Union
from . import utilities, tables
| [
2,
19617,
28,
40477,
12,
23,
198,
2,
17202,
39410,
25,
428,
2393,
373,
7560,
416,
262,
21624,
12994,
24118,
687,
10290,
357,
27110,
5235,
8,
16984,
13,
17202,
198,
2,
17202,
2141,
407,
4370,
416,
1021,
4556,
345,
821,
1728,
345,
760... | 3.886076 | 79 |
# ------
#----------------------------------------
'''
# 1
, .
'''
print ('1')
x = 0
for x in range (1,6,):
print (x,0)
'''
2
10 . 5.
'''
print ('2')
x = 98535254155
count = 0
while (x // 10) > 0:
if x % 10 == 5:
count += 1
x = x // 10
print(count)
'''
3
1 100. ... | [
2,
220,
220,
220,
220,
40103,
198,
2,
3880,
982,
198,
198,
7061,
6,
198,
2,
220,
352,
628,
220,
220,
220,
220,
220,
220,
837,
220,
220,
220,
220,
220,
764,
198,
7061,
6,
198,
4798,
19203,
16,
11537,
198,
87,
796,
657,
198,
164... | 2.030664 | 587 |
"""Configuration loader class."""
import ast
import logging
import os
import types
from operator import attrgetter
import pkg_resources
logger = logging.getLogger(__name__)
| [
37811,
38149,
40213,
1398,
526,
15931,
198,
198,
11748,
6468,
198,
11748,
18931,
198,
11748,
28686,
198,
11748,
3858,
198,
6738,
10088,
1330,
708,
81,
1136,
353,
198,
198,
11748,
279,
10025,
62,
37540,
198,
198,
6404,
1362,
796,
18931,
... | 3.54 | 50 |
import abc
from typing import AbstractSet
| [
11748,
450,
66,
198,
6738,
19720,
1330,
27741,
7248,
628
] | 4.3 | 10 |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
import numpy as np
import os
import pandas as pd
import testmodel
import imageio
if __name__ == "__main__":
#################### ######################
testpath = '/home/data/' #
result_folder_path = '/code/result/submission.csv' #
####################... | [
2,
0,
1220,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28686,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
1332,
19849,
198,... | 2.565657 | 297 |
from flask import Blueprint
from app.api.v1 import user, book, client, token
| [
6738,
42903,
1330,
39932,
198,
6738,
598,
13,
15042,
13,
85,
16,
1330,
2836,
11,
1492,
11,
5456,
11,
11241,
628
] | 3.714286 | 21 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = "Christian Heider Nielsen"
__doc__ = r"""
Created on 26-01-2021
"""
from enum import Enum
from typing import Tuple
import numpy
from matplotlib import patheffects, pyplot
__all__ = ["plot_median_labels", "show_values_on_bars"]
from ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
834,
9800,
834,
796,
366,
20298,
679,
1304,
31154,
1,
198,
834,
15390,
834,
796,
374,
37811,
628,
220,
220,
... | 2.150047 | 1,073 |
from dash import dash, dcc, html
from dash.dependencies import Input, Output
import plotly.graph_objs as go
import pandas as pd
url = 'csv/covidtesting.csv'
df = pd.read_csv(url)
app = dash.Dash()
# list = df.columns[1:]
# filter_options = []
# for option in list:
# filter_options.append({'label': str(option), ... | [
6738,
14470,
1330,
14470,
11,
288,
535,
11,
27711,
198,
6738,
14470,
13,
45841,
3976,
1330,
23412,
11,
25235,
198,
11748,
7110,
306,
13,
34960,
62,
672,
8457,
355,
467,
198,
11748,
19798,
292,
355,
279,
67,
198,
198,
6371,
796,
705,
... | 2.383065 | 248 |
###############################################################################################
from keras.models import Model, load_model
from PIL import Image
import numpy as np
import time
import cv2
import os
import logging
import pymongo
#import dlib
import requests
import appconfig
import json
cascade = cv2.Cas... | [
29113,
29113,
14468,
7804,
4242,
21017,
198,
6738,
41927,
292,
13,
27530,
1330,
9104,
11,
3440,
62,
19849,
198,
6738,
350,
4146,
1330,
7412,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
640,
198,
11748,
269,
85,
17,
198,
11748,
28686... | 2.584615 | 520 |
"""Object detection pipeline."""
import multiprocessing
import datetime
import time
import sys
import cv2
import numpy as np
import socket
import sharedmem
import mpipe
import coils
import util
DEVICE = int(sys.argv[1])
WIDTH = int(sys.argv[2])
HEIGHT = int(sys.argv[3])
DURATION = float(sys.argv[4]) # In se... | [
37811,
10267,
13326,
11523,
526,
15931,
198,
198,
11748,
18540,
305,
919,
278,
198,
11748,
4818,
8079,
198,
11748,
640,
198,
11748,
25064,
198,
11748,
269,
85,
17,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
17802,
198,
198,
11748,
... | 2.634263 | 1,255 |
# 110
for num in [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]:
print(num) | [
2,
9796,
201,
198,
1640,
997,
287,
685,
16,
11,
362,
11,
513,
11,
604,
11,
642,
11,
718,
11,
767,
11,
807,
11,
860,
11,
838,
5974,
201,
198,
220,
220,
220,
3601,
7,
22510,
8
] | 1.783784 | 37 |
#!/usr/bin/python
L = [1, 3, 6, 77, 34, 45, 26, 81]
result = ""
for number in L:
result = result + str(number)
print(result)
| [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
198,
43,
796,
685,
16,
11,
513,
11,
718,
11,
8541,
11,
4974,
11,
4153,
11,
2608,
11,
9773,
60,
198,
20274,
796,
13538,
198,
198,
1640,
1271,
287,
406,
25,
198,
220,
220,
220,
1255,
796,... | 2.275862 | 58 |
import maya.cmds as cmds
blendShapeEditor()._UI()
| [
11748,
743,
64,
13,
28758,
82,
355,
23991,
82,
198,
220,
220,
220,
220,
220,
220,
220,
220,
198,
2436,
437,
33383,
17171,
22446,
62,
10080,
3419,
198
] | 2.107143 | 28 |
"""
Basic test, just raises a TestWarning
"""
import support
raise support.TestWarning('A test of TestWarning. It is not an error')
| [
37811,
198,
26416,
1332,
11,
655,
12073,
257,
6208,
20361,
198,
37811,
198,
198,
11748,
1104,
198,
198,
40225,
1104,
13,
14402,
20361,
10786,
32,
1332,
286,
6208,
20361,
13,
632,
318,
407,
281,
4049,
11537,
198
] | 3.621622 | 37 |
import numpy as np
import tensorflow as tf
| [
11748,
299,
32152,
355,
45941,
198,
11748,
11192,
273,
11125,
355,
48700,
628,
628
] | 3.285714 | 14 |
from collections import deque
n, q = map(int, input().split())
graph = [[] for _ in range(n + 1)]
for i in range(n - 1):
a, b = map(int, input().split())
graph[a].append(b)
graph[b].append(a)
CD = []
for i in range(q):
e, f = map(int, input().split())
CD.append([e, f])
dist = [-1] * (n + 1)
dis... | [
6738,
17268,
1330,
390,
4188,
198,
198,
77,
11,
10662,
796,
3975,
7,
600,
11,
5128,
22446,
35312,
28955,
198,
198,
34960,
796,
16410,
60,
329,
4808,
287,
2837,
7,
77,
1343,
352,
15437,
198,
198,
1640,
1312,
287,
2837,
7,
77,
532,
... | 1.950617 | 324 |
# Copyright (c) 2010 Twilio 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,
357,
66,
8,
3050,
1815,
346,
952,
3457,
13,
198,
2,
220,
198,
2,
2448,
3411,
318,
29376,
7520,
11,
1479,
286,
3877,
11,
284,
597,
1048,
16727,
257,
4866,
198,
2,
286,
428,
3788,
290,
3917,
10314,
3696,
357,
1169,
366,
... | 1.921744 | 138,111 |
import copy
import logging
import math
import sys
from collections import defaultdict
from functools import reduce
from typing import (
Any,
Callable,
Dict,
Iterable,
List,
Optional,
Sequence,
Tuple,
Union,
)
import tabulate
from ortools.sat.python import cp_model
from ..model impo... | [
11748,
4866,
198,
11748,
18931,
198,
11748,
10688,
198,
11748,
25064,
198,
6738,
17268,
1330,
4277,
11600,
198,
6738,
1257,
310,
10141,
1330,
4646,
198,
6738,
19720,
1330,
357,
198,
220,
220,
220,
4377,
11,
198,
220,
220,
220,
4889,
540... | 2.943231 | 229 |
import pytest
from restclientaio._util import *
| [
198,
11748,
12972,
9288,
198,
198,
6738,
1334,
16366,
64,
952,
13557,
22602,
1330,
1635,
628,
198
] | 3.058824 | 17 |
# pylint: disable=redefined-outer-name
"""Test Experiments.
This test runs all problems and hyperparameter
pairs for 100 time steps. It only guarantees
correct API compatiblity and not the problem
performance metrics.
"""
import pytest
from torchrl import registry
from torchrl.cli.commands.run import do_run
proble... | [
2,
279,
2645,
600,
25,
15560,
28,
445,
18156,
12,
39605,
12,
3672,
198,
198,
37811,
14402,
8170,
6800,
13,
198,
198,
1212,
1332,
4539,
477,
2761,
290,
8718,
17143,
2357,
198,
79,
3468,
329,
1802,
640,
4831,
13,
632,
691,
19026,
198,... | 3.251572 | 159 |
import json
import time
import bs4
import numpy as np
import pandas as pd
import requests as rqs
url_apiV2 = r'https://api.guildwars2.com/v2'
working_dir = r'/home/ubuntu/'
with open(working_dir + 'item_nums', 'r') as f:
item_nums = [int(line[:-1]) for line in f]
price_data_fetch = []
... | [
11748,
33918,
201,
198,
11748,
640,
201,
198,
201,
198,
11748,
275,
82,
19,
201,
198,
11748,
299,
32152,
220,
220,
220,
355,
45941,
201,
198,
11748,
19798,
292,
220,
220,
355,
279,
67,
201,
198,
11748,
7007,
355,
374,
48382,
201,
19... | 1.907328 | 464 |
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from config import Config
app = Flask(__name__)
app.config.from_object(Config)
db = SQLAlchemy(app)
db.create_all()
db.session.commit()
# from flask import Flask
# from flask_babel import Babel
# from flask_babel import format_datetim... | [
6738,
42903,
1330,
46947,
201,
198,
6738,
42903,
62,
25410,
282,
26599,
1330,
16363,
2348,
26599,
201,
198,
6738,
4566,
1330,
17056,
201,
198,
201,
198,
1324,
796,
46947,
7,
834,
3672,
834,
8,
201,
198,
1324,
13,
11250,
13,
6738,
62,
... | 2.465909 | 264 |
# exercise 3.1.4
import numpy as np
from sklearn.feature_extraction.text import CountVectorizer
# Load the textDocs.txt as a long string into raw_file:
with open('../Data/textDocs.txt', 'r') as f:
raw_file = f.read()
# raw_file contains sentences seperated by newline characters,
# so we split by '\n':
corpus = ra... | [
2,
5517,
513,
13,
16,
13,
19,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
1341,
35720,
13,
30053,
62,
2302,
7861,
13,
5239,
1330,
2764,
38469,
7509,
198,
198,
2,
8778,
262,
2420,
23579,
82,
13,
14116,
355,
257,
890,
4731,
656,
... | 3.300676 | 592 |
from turtle import *
bgcolor("lime")
color("black","white")
shape("circle")
ht()
speed(1)
width(15)
gt(-365,-380)
begin_fill()
seth(90)
fd(20)
r(5,20)
r(4,60)
r(5,100)
r(5,120)
l(85,50)
r(10,25)
r(15,10)
r(15,40)
r(15,50)
r(10,90)
r(20,50)
r(20,25)
r(10,75)
r(30,20)
r(10,10)
l(30,50)
r(15,10)
r(10,20)
r(10,80)
r(10... | [
6738,
28699,
1330,
1635,
628,
198,
35904,
8043,
7203,
27299,
4943,
198,
8043,
7203,
13424,
2430,
11186,
4943,
198,
43358,
7203,
45597,
4943,
198,
4352,
3419,
198,
12287,
7,
16,
8,
198,
10394,
7,
1314,
8,
628,
198,
13655,
32590,
24760,
... | 1.630485 | 433 |
from django import forms
from django.core.validators import RegexValidator
from django.core.exceptions import ValidationError
from django_otp import user_has_device, devices_for_user
from magicauth import settings as magicauth_settings
| [
6738,
42625,
14208,
1330,
5107,
198,
6738,
42625,
14208,
13,
7295,
13,
12102,
2024,
1330,
797,
25636,
47139,
1352,
198,
6738,
42625,
14208,
13,
7295,
13,
1069,
11755,
1330,
3254,
24765,
12331,
198,
198,
6738,
42625,
14208,
62,
313,
79,
... | 3.567164 | 67 |