content
stringlengths
1
1.04M
input_ids
listlengths
1
774k
ratio_char_token
float64
0.38
22.9
token_count
int64
1
774k
from email import header import json from flask import Flask, render_template, jsonify, request from dotenv import load_dotenv import os import sys import requests # database intialization from modules.database import NetworkDB db = NetworkDB() db.create_tables() from modules.graph import Graphs from modules.handler ...
[ 6738, 3053, 1330, 13639, 198, 11748, 33918, 198, 6738, 42903, 1330, 46947, 11, 8543, 62, 28243, 11, 33918, 1958, 11, 2581, 198, 6738, 16605, 24330, 1330, 3440, 62, 26518, 24330, 198, 11748, 28686, 198, 11748, 25064, 198, 11748, 7007, 198,...
2.739583
288
#!/usr/bin/env python3 import numpy import pylab import pickle import itertools a_arr, m_hist, cor_hist=pickle.load(open("results.pickle","rb")) e=numpy.loadtxt("eigenval.csv", delimiter=",") v=numpy.loadtxt("eigenvec.csv", delimiter=",") v = v @ numpy.diag(e) group_ans = numpy.loadtxt("group_hier.csv", delimiter=",...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 198, 11748, 299, 32152, 198, 11748, 279, 2645, 397, 198, 11748, 2298, 293, 198, 11748, 340, 861, 10141, 198, 198, 64, 62, 3258, 11, 285, 62, 10034, 11, 1162, 62, 10034, 28, 27729...
2.144681
940
import database import csv import sklearn import pandas as pd import numpy as np import matplotlib.pyplot as plt import xlsxwriter as xl import dill as pickle from io import BytesIO # This function is used to predict any model the user uploads to the flask app. # Depending on user's settings the funct...
[ 11748, 6831, 201, 198, 11748, 269, 21370, 201, 198, 11748, 1341, 35720, 201, 198, 11748, 19798, 292, 355, 279, 67, 201, 198, 11748, 299, 32152, 355, 45941, 220, 201, 198, 11748, 2603, 29487, 8019, 13, 9078, 29487, 355, 458, 83, 220, 2...
3.223077
130
#!/bin/env python import argparse if __name__ == "__main__": main()
[ 2, 48443, 8800, 14, 24330, 21015, 198, 11748, 1822, 29572, 198, 198, 361, 11593, 3672, 834, 6624, 366, 834, 12417, 834, 1298, 198, 220, 220, 220, 1388, 3419, 198 ]
2.517241
29
from PIL import Image if __name__ == "__main__": print("Starting main") main()
[ 6738, 350, 4146, 1330, 7412, 198, 198, 361, 11593, 3672, 834, 6624, 366, 834, 12417, 834, 1298, 198, 220, 3601, 7203, 22851, 1388, 4943, 198, 220, 1388, 3419, 198 ]
2.896552
29
"""For evaluating ARMA terms using an emulation For evaluating ARMA terms using an emulation. Two classes, Arma and ArmaForecast. Arma is for general use, where ARMA terms before time point zero are zero. ArmaForecast is used for forecasting and continuing on a time series, uses the previous time series wh...
[ 37811, 1890, 22232, 5923, 5673, 2846, 1262, 281, 47065, 198, 198, 1890, 22232, 5923, 5673, 2846, 1262, 281, 47065, 13, 4930, 6097, 11, 943, 2611, 290, 198, 220, 220, 220, 943, 2611, 16351, 2701, 13, 943, 2611, 318, 329, 2276, 779, 11,...
2.212884
2,344
import importlib from channels import channel_layers class Parser(object): """ Takes module_path as arguments path.module and also it has the function to check the in-memory layer. """
[ 11748, 1330, 8019, 198, 6738, 9619, 1330, 6518, 62, 75, 6962, 628, 198, 4871, 23042, 263, 7, 15252, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 33687, 8265, 62, 6978, 355, 7159, 3108, 13, 21412, 290, 635, 340, 468, 262, 216...
3.327869
61
from dhis2 import Api, RequestException, setup_logger, logger """ Add "(updated)" to all Data Elements that contain "ANC" in its name. Uses the method PUT. Print errors if it failed. """ # Create a Api object api = Api("play.dhis2.org/dev", "admin", "district") # setup the logger setup_logger() if __name__ == "__...
[ 6738, 288, 14363, 17, 1330, 5949, 72, 11, 19390, 16922, 11, 9058, 62, 6404, 1362, 11, 49706, 198, 198, 37811, 198, 4550, 30629, 43162, 16725, 284, 477, 6060, 26632, 326, 3994, 366, 20940, 1, 287, 663, 1438, 13, 198, 5842, 274, 262, ...
2.881356
118
from Bio import SeqIO import argparse import os parser = argparse.ArgumentParser(description='# This program renames sequences and trims primers from a sequence.') parser.add_argument('-i','--in', dest='IN', help='Input folder.') parser.add_argument('-o','--out', dest='OUT', help='Output folder.') parser.add_argumen...
[ 6738, 16024, 1330, 1001, 80, 9399, 198, 11748, 1822, 29572, 198, 11748, 28686, 198, 198, 48610, 796, 1822, 29572, 13, 28100, 1713, 46677, 7, 11213, 11639, 2, 770, 1430, 8851, 1047, 16311, 290, 220, 491, 12078, 2684, 364, 422, 257, 8379,...
3.069079
304
# -*- coding: utf-8 -*- # vim: sw=4 ts=4 fenc=utf-8 # ============================================================================= # $Id: template.py 2 2006-08-26 17:51:50Z s0undt3ch $ # ============================================================================= # $URL: http://ispmanccp.ufsoft.org/svn/br...
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 2, 43907, 25, 1509, 28, 19, 40379, 28, 19, 277, 12685, 28, 40477, 12, 23, 198, 2, 38093, 25609, 198, 2, 720, 7390, 25, 11055, 13, 9078, 362, 4793, 12, 2919, 12, 20...
3.4125
240
import os from pathlib import Path import parfive
[ 198, 11748, 28686, 198, 6738, 3108, 8019, 1330, 10644, 198, 11748, 1582, 13261, 198 ]
3.642857
14
"""Dict with attribute-like access.""" from typing import Any, Dict, KeysView from python_awair import const class AttrDict(Dict[str, Any]): """Dict with attribute-like access. For example, given an AttrDict *foo*, we could access its values via *foo["bar"]* or *foo.bar*. This is the parent class ...
[ 37811, 35, 713, 351, 11688, 12, 2339, 1895, 526, 15931, 198, 198, 6738, 19720, 1330, 4377, 11, 360, 713, 11, 26363, 7680, 198, 198, 6738, 21015, 62, 707, 958, 1330, 1500, 628, 198, 4871, 3460, 81, 35, 713, 7, 35, 713, 58, 2536, 11...
2.483363
571
import cv2 img = cv2.imread("./data/test_images/straight_lines1.jpg") cv2.imshow("Get Co-Ords", img) cv2.waitKey()
[ 11748, 269, 85, 17, 198, 198, 9600, 796, 269, 85, 17, 13, 320, 961, 7, 1911, 14, 7890, 14, 9288, 62, 17566, 14, 42729, 62, 6615, 16, 13, 9479, 4943, 198, 33967, 17, 13, 320, 12860, 7203, 3855, 1766, 12, 35422, 82, 1600, 33705, 8...
2.188679
53
import pytest from osp.citations.jstor_record import JSTOR_Record @pytest.mark.parametrize('inputs,surname', [ # Single author. ( [ ('David', 'McClure'), ], 'McClure' ), # Multiple authors. ( [ ('David', 'McClure'), ('Joe', '...
[ 198, 198, 11748, 12972, 9288, 198, 198, 6738, 267, 2777, 13, 66, 20597, 13, 73, 301, 273, 62, 22105, 1330, 449, 2257, 1581, 62, 23739, 628, 198, 31, 9078, 9288, 13, 4102, 13, 17143, 316, 380, 2736, 10786, 15414, 82, 11, 82, 700, 4...
1.74717
265
from .. import bar_func
[ 6738, 11485, 1330, 2318, 62, 20786 ]
3.833333
6
from marshmallow import Schema from marshmallow.fields import Integer, String
[ 6738, 22397, 42725, 1330, 10011, 2611, 198, 6738, 22397, 42725, 13, 25747, 1330, 34142, 11, 10903, 628 ]
4.647059
17
#!/usr/bin/python3 from Adafruit_MotorHAT import Adafruit_MotorHAT, Adafruit_DCMotor from time import sleep if __name__ == "__main__": motor_driver = Adafruit_MotorHAT(addr=0x60) left_motor = motor_driver.getMotor(1) right_motor = motor_driver.getMotor(2) left_motor.setSpeed(255) right_motor.setSpeed(255...
[ 2, 48443, 14629, 14, 8800, 14, 29412, 18, 198, 198, 6738, 1215, 1878, 4872, 62, 34919, 39, 1404, 1330, 1215, 1878, 4872, 62, 34919, 39, 1404, 11, 1215, 1878, 4872, 62, 9697, 34919, 198, 6738, 640, 1330, 3993, 628, 198, 361, 11593, 3...
2.381625
283
import json import scipy.io as scio
[ 11748, 33918, 198, 11748, 629, 541, 88, 13, 952, 355, 629, 952, 628 ]
2.846154
13
#1 Upper and Lower ss = 'Hello, World' print(ss.upper()) tt = ss.lower() print(tt) print(ss) #2 Count, Strip, Replace ss = ' Hello,World ' els = ss.count('l') print(els) print('***'+ss.strip()+'***') #Strip tira os espaços desnecessários do começo e do final news = ss.replace ('o', '***') print(news)
[ 2, 16, 20390, 290, 16048, 198, 198, 824, 796, 705, 15496, 11, 2159, 6, 198, 4798, 7, 824, 13, 45828, 28955, 198, 198, 926, 796, 37786, 13, 21037, 3419, 198, 4798, 7, 926, 8, 198, 4798, 7, 824, 8, 198, 198, 2, 17, 2764, 11, 185...
2.348148
135
from tree_intersection import tree_intersection from tree import BinaryTree, Node
[ 6738, 5509, 62, 3849, 5458, 1330, 5509, 62, 3849, 5458, 198, 6738, 5509, 1330, 45755, 27660, 11, 19081, 198 ]
4.315789
19
#!/usr/bin/env python # -*- coding: utf-8 -*- # author: Rico Sennrich # # This file is part of moses. Its use is licensed under the GNU Lesser General # Public License version 2.1 or, at your option, any later version. """Add flexibility scores to a phrase table half. You usually don't have to call this script dire...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 198, 2, 1772, 25, 16707, 311, 1697, 7527, 198, 2, 198, 2, 770, 2393, 318, 636, 286, 285, 4629, 13, 220, 6363, 779, ...
2.631683
505
import pandas from pandas.io.json import json_normalize import matplotlib.pyplot data_es = pandas.read_json('dataset_es.json') data_en = pandas.read_json('dataset_en.json') data_de = pandas.read_json('dataset_de.json') data_it = pandas.read_json('dataset_it.json') data = [juntarEstadisticas(data_es), juntarEstadistic...
[ 11748, 19798, 292, 198, 6738, 19798, 292, 13, 952, 13, 17752, 1330, 33918, 62, 11265, 1096, 198, 11748, 2603, 29487, 8019, 13, 9078, 29487, 198, 198, 7890, 62, 274, 796, 19798, 292, 13, 961, 62, 17752, 10786, 19608, 292, 316, 62, 274,...
2.398649
296
import itertools import json import hashlib import requests from django.utils.text import slugify url = 'http://refugee-info-api-v2.prod.rescueapp.org/v2' # url = 'http://localhost:8000/v2' headers = { 'content-type': 'application/json', 'ServiceInfoAuthorization': 'token 3a4a15e8eef71821b75834d179be73236802...
[ 11748, 340, 861, 10141, 198, 11748, 33918, 198, 198, 11748, 12234, 8019, 198, 11748, 7007, 198, 6738, 42625, 14208, 13, 26791, 13, 5239, 1330, 31065, 1958, 198, 198, 6371, 796, 705, 4023, 1378, 5420, 2217, 68, 12, 10951, 12, 15042, 12, ...
2.012655
3,556
""" problem 3 The prime factors of 13195 are 5, 7, 13 and 29. What is the largest prime factor of the number 600851475143 ? """ # print(is_prime(42)) # print the prime factors for k in generate_prime_factors(600851475143): print(k)
[ 37811, 198, 198, 45573, 513, 198, 464, 6994, 5087, 286, 1511, 22186, 389, 642, 11, 767, 11, 1511, 290, 2808, 13, 198, 2061, 318, 262, 4387, 6994, 5766, 286, 262, 1271, 10053, 5332, 1415, 2425, 21139, 5633, 198, 198, 37811, 198, 220, ...
2.242188
128
from django.contrib import admin from home.models import Contact,Quotation # Register your models here. admin.site.register(Contact, ContactAdmin) admin.site.register(Quotation)
[ 6738, 42625, 14208, 13, 3642, 822, 1330, 13169, 198, 6738, 1363, 13, 27530, 1330, 14039, 11, 4507, 14221, 198, 2, 17296, 534, 4981, 994, 13, 198, 220, 220, 220, 220, 198, 220, 220, 220, 220, 198, 28482, 13, 15654, 13, 30238, 7, 1782...
3.280702
57
from dsn.s_expr.clef import ( BecomeAtom, SetAtom, BecomeList, Insert, Extend, )
[ 6738, 288, 16184, 13, 82, 62, 31937, 13, 2375, 69, 1330, 357, 198, 220, 220, 220, 31114, 2953, 296, 11, 198, 220, 220, 220, 5345, 2953, 296, 11, 198, 220, 220, 220, 31114, 8053, 11, 198, 220, 220, 220, 35835, 11, 198, 220, 220, ...
2.019231
52
######################################################################## # Copyright 2018 FireEye Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/L...
[ 29113, 29113, 7804, 198, 2, 15069, 2864, 3764, 24876, 3457, 13, 198, 2, 198, 2, 49962, 739, 262, 24843, 13789, 11, 10628, 362, 13, 15, 357, 1169, 366, 34156, 15341, 198, 2, 345, 743, 407, 779, 428, 2393, 2845, 287, 11846, 351, 262, ...
3.923695
249
# Copyright 2016 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
[ 2, 15069, 1584, 3012, 3457, 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, 351, 262, 13789, ...
3.494457
451
import codecs import os import argparse import sys if __name__ == '__main__': main()
[ 11748, 40481, 82, 198, 11748, 28686, 198, 11748, 1822, 29572, 198, 11748, 25064, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 198, 198, 361, 11593, 3672, 834, 6624, 705, 834, 12417, 834, 10354, ...
2.183673
49
# coding=utf-8 # Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor. # # 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/lice...
[ 2, 19617, 28, 40477, 12, 23, 198, 2, 15069, 12131, 383, 12905, 2667, 32388, 16092, 292, 1039, 46665, 290, 262, 1459, 27039, 4226, 18920, 13, 198, 2, 198, 2, 49962, 739, 262, 24843, 13789, 11, 10628, 362, 13, 15, 357, 1169, 366, 3415...
2.189627
2,410
import os, discord from pathlib import Path from dotenv import load_dotenv from discord.ext import commands env_path = Path('.') / '.env' load_dotenv(dotenv_path=env_path) client = commands.Bot( command_prefix=os.getenv('BOT_PREFIX'), owner_id=os.getenv('BOT_OWNER'), case_insensitive=True, help_comman...
[ 11748, 28686, 11, 36446, 198, 6738, 3108, 8019, 1330, 10644, 198, 6738, 16605, 24330, 1330, 3440, 62, 26518, 24330, 198, 6738, 36446, 13, 2302, 1330, 9729, 198, 198, 24330, 62, 6978, 796, 10644, 10786, 2637, 8, 1220, 45302, 24330, 6, 19...
2.530488
164
# -*- coding: utf-8 -*- """ direct expansion units """ from __future__ import division from scipy.interpolate import interp1d from math import log, ceil import pandas as pd import numpy as np from cea.constants import HEAT_CAPACITY_OF_WATER_JPERKGK __author__ = "Shanshan Hsieh" __copyright__ = "Copyright 2015, Archit...
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 37811, 198, 12942, 7118, 4991, 198, 37811, 198, 198, 6738, 11593, 37443, 834, 1330, 7297, 198, 6738, 629, 541, 88, 13, 3849, 16104, 378, 1330, 987, 79, 16, 67, 198, 67...
2.456722
543
from tkinter import * from tkinter import filedialog from PIL import ImageTk, Image # Declare some global variables to use img_list = [] page = None root = Tk() root.title('Opening files') r = 1 c = '3' def open_file(): """ Opens a list in a list. Args: """ # Open images with GUI global page ...
[ 6738, 256, 74, 3849, 1330, 1635, 198, 6738, 256, 74, 3849, 1330, 5717, 498, 519, 198, 6738, 350, 4146, 1330, 7412, 51, 74, 11, 7412, 198, 198, 2, 16691, 533, 617, 3298, 9633, 284, 779, 198, 9600, 62, 4868, 796, 17635, 198, 7700, 7...
2.521277
564
from __future__ import absolute_import from __future__ import division from __future__ import print_function import tensorflow as tf import numpy as np import argparse import os import json import glob import random import collections import math import time from ops import *
[ 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, 198, 11748, 11192, 273, 11125, 355, 48700, 198, 11748, 299, 32152, 355, 45941, 198, 11748, ...
3.985714
70
import pandas as pd import numpy as np import io import requests
[ 11748, 19798, 292, 355, 279, 67, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 33245, 198, 11748, 7007, 628 ]
3.473684
19
""" Root of the SkPy module. Classes from all submodules are imported here for convenience. """ from skpy.core import SkypeObj, SkypeObjs, SkypeEnum, SkypeException, SkypeApiException, SkypeAuthException from skpy.util import SkypeUtils from skpy.main import Skype, SkypeEventLoop, SkypeSettings, SkypeTranslator from ...
[ 37811, 198, 30016, 286, 262, 3661, 20519, 8265, 13, 220, 38884, 422, 477, 850, 18170, 389, 17392, 994, 329, 15607, 13, 198, 37811, 198, 198, 6738, 1341, 9078, 13, 7295, 1330, 25254, 49201, 11, 25254, 5944, 8457, 11, 25254, 4834, 388, ...
3.110276
399
from equals import equals if __name__ == '__main__': print(any(equals, 3, [1, 2, 3, 4]))
[ 6738, 21767, 1330, 21767, 220, 198, 220, 220, 220, 220, 220, 220, 220, 220, 198, 361, 11593, 3672, 834, 6624, 705, 834, 12417, 834, 10354, 198, 220, 220, 220, 3601, 7, 1092, 7, 4853, 874, 11, 513, 11, 685, 16, 11, 362, 11, 513, ...
2.125
48
import datetime import json import urllib import numpy as np import fix_yahoo_finance import pandas as pd import plotly import plotly.graph_objs as go from flask import Flask, jsonify, render_template, request,session from pandas_datareader import data as pdr from datetime import timedelta from Store import dataStore f...
[ 11748, 4818, 8079, 198, 11748, 33918, 198, 11748, 2956, 297, 571, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 4259, 62, 40774, 62, 69, 14149, 198, 11748, 19798, 292, 355, 279, 67, 198, 11748, 7110, 306, 198, 11748, 7110, 306, 13, ...
2.824022
358
from graph import BCGraph from .star_type import StarType from fimath.geodesic import Geodesic from fimath.constants import * import logging logging.basicConfig(format='%(levelname)s:%(message)s', filename='log.log', level=logging.DEBUG)
[ 6738, 4823, 1330, 11843, 37065, 198, 6738, 764, 7364, 62, 4906, 1330, 2907, 6030, 198, 6738, 277, 320, 776, 13, 469, 4147, 291, 1330, 2269, 4147, 291, 198, 6738, 277, 320, 776, 13, 9979, 1187, 1330, 1635, 198, 198, 11748, 18931, 198, ...
3.116883
77
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See LICENSE in the project root # for license information. from __future__ import absolute_import, division, print_function, unicode_literals import ctypes from ctypes.wintypes import BOOL, DWORD, HANDLE, LARGE_INTEGE...
[ 2, 15069, 357, 66, 8, 5413, 10501, 13, 1439, 2489, 10395, 13, 201, 198, 2, 49962, 739, 262, 17168, 13789, 13, 4091, 38559, 24290, 287, 262, 1628, 6808, 201, 198, 2, 329, 5964, 1321, 13, 201, 198, 201, 198, 6738, 11593, 37443, 834, ...
2.598303
707
# Problem 17 : Number letter counts liste_digit_letter = ['one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten', 'eleven', 'twelve', 'thirteen', 'fourteen', 'fifteen', 'sixteen', 'seventeen', 'eighteen', 'nineteen'] liste_ten_letter = ['twenty', 'thirty', 'forty', ...
[ 2, 20647, 1596, 1058, 7913, 3850, 9853, 628, 198, 4868, 68, 62, 27003, 62, 9291, 796, 37250, 505, 3256, 705, 11545, 3256, 705, 15542, 3256, 705, 14337, 3256, 705, 13261, 3256, 705, 19412, 3256, 705, 26548, 3256, 705, 26022, 3256, 705, ...
2.392405
869
"""empty message Revision ID: 3cbc86a0a9d7 Revises: 77894fcde804 Create Date: 2018-09-27 12:25:31.893545 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '3cbc86a0a9d7' down_revision = '77894fcde804' branch_labels = None depends_on = None
[ 37811, 28920, 3275, 198, 198, 18009, 1166, 4522, 25, 513, 66, 15630, 4521, 64, 15, 64, 24, 67, 22, 198, 18009, 2696, 25, 767, 3695, 5824, 16072, 2934, 36088, 198, 16447, 7536, 25, 2864, 12, 2931, 12, 1983, 1105, 25, 1495, 25, 3132, ...
2.430894
123
''' CRUD = Create Read Update Delete Add necessary sql functions here to use throughout the project. ''' import pandas as pd from sqlalchemy import MetaData, Table, Column, Integer, Float, String from sqlalchemy.exc import IntegrityError from sqlalchemy.orm import Session from sqlalchemy.sql import select import app....
[ 7061, 6, 198, 9419, 8322, 796, 13610, 4149, 10133, 23520, 198, 4550, 3306, 44161, 5499, 994, 284, 779, 3690, 262, 1628, 13, 198, 7061, 6, 198, 198, 11748, 19798, 292, 355, 279, 67, 198, 6738, 44161, 282, 26599, 1330, 30277, 6601, 11, ...
2.826023
684
import json from collections import OrderedDict from django.contrib.gis.gdal import GDALException from django.contrib.gis.geos import GEOSException, GEOSGeometry from django.core.exceptions import ValidationError from django.utils.translation import gettext_lazy as _ from rest_framework.fields import Field, Serializer...
[ 11748, 33918, 198, 6738, 17268, 1330, 14230, 1068, 35, 713, 198, 198, 6738, 42625, 14208, 13, 3642, 822, 13, 70, 271, 13, 21287, 282, 1330, 27044, 1847, 16922, 198, 6738, 42625, 14208, 13, 3642, 822, 13, 70, 271, 13, 469, 418, 1330, ...
2.36812
1,399
# access csv budget_data csv import os import csv from collection import defaultdict csvpath = os.path.join('python-challenge.', 'election_data.csv') with open(csvpath,'r', newline='') as csvfile: csvreader = csv.reader(csvfile, delimiter=',') csv_header = next(csvreader) print(f"CSV Header: {csv_header}")...
[ 2, 1895, 269, 21370, 4466, 62, 7890, 269, 21370, 198, 11748, 28686, 198, 11748, 269, 21370, 198, 6738, 4947, 1330, 4277, 11600, 198, 40664, 6978, 796, 28686, 13, 6978, 13, 22179, 10786, 29412, 12, 36747, 3540, 2637, 11, 705, 14300, 62, ...
2.495935
615
import copy from unittest import mock import pytest from pylon.aws import sqs @pytest.mark.parametrize( 'useFixtures', [ ('testMessage_inline', 'rawMessage_inline'), ('testMessage_s3', 'rawMessage_s3') ], indirect=['useFixtures'] ) @pytest.fixture
[ 11748, 4866, 198, 6738, 555, 715, 395, 1330, 15290, 198, 198, 11748, 12972, 9288, 198, 198, 6738, 279, 15158, 13, 8356, 1330, 19862, 82, 198, 198, 31, 9078, 9288, 13, 4102, 13, 17143, 316, 380, 2736, 7, 198, 220, 220, 220, 705, 1904...
2.373984
123
from __future__ import print_function from itertools import chain import torch import torch.nn as nn from .base_model import BaseModel from .backbone import create_backbone from .pa_pool import PAPool from .pcb_pool import PCBPool from .global_pool import GlobalPool from .ps_head import PartSegHead from ..utils.model i...
[ 6738, 11593, 37443, 834, 1330, 3601, 62, 8818, 198, 6738, 340, 861, 10141, 1330, 6333, 198, 11748, 28034, 198, 11748, 28034, 13, 20471, 355, 299, 77, 198, 6738, 764, 8692, 62, 19849, 1330, 7308, 17633, 198, 6738, 764, 1891, 15992, 1330,...
3.574074
108
# -*- coding: utf-8 -*- # ############################################################################# # # The MIT License (MIT) # # Copyright (c) 2016 Michell Stuttgart # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software...
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 2, 1303, 29113, 29113, 7804, 4242, 198, 2, 198, 2, 383, 17168, 13789, 357, 36393, 8, 198, 2, 198, 2, 15069, 357, 66, 8, 1584, 7631, 12758, 520, 15318, 41651, 198, 2,...
3.438182
550
""" Technical Analysis (TA) Plotter Library of functions to plot various technical indicator charts. @author: eyu """ import os import logging import matplotlib.pyplot as plt import matplotlib.dates as mdates import constants as c class TAPlot(object): """ Class for TA plots. """
[ 37811, 198, 45638, 14691, 357, 5603, 8, 28114, 353, 198, 198, 23377, 286, 5499, 284, 7110, 2972, 6276, 16916, 15907, 13, 198, 198, 31, 9800, 25, 1926, 84, 198, 37811, 198, 198, 11748, 28686, 198, 11748, 18931, 198, 11748, 2603, 29487, ...
3.23913
92
#!/usr/bin/env python3 from reportlab.platypus import SimpleDocTemplate from reportlab.platypus import Paragraph, Spacer, Table, Image from reportlab.lib.styles import getSampleStyleSheet from reportlab.lib import colors from reportlab.graphics.shapes import Drawing from reportlab.graphics.charts.barcharts import Vert...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 198, 6738, 989, 23912, 13, 489, 265, 4464, 385, 1330, 17427, 23579, 30800, 198, 6738, 989, 23912, 13, 489, 265, 4464, 385, 1330, 2547, 6111, 11, 1338, 11736, 11, 8655, 11, 7412, ...
3.525862
116
""" Simple training loop; Boilerplate that could apply to any arbitrary neural network, so nothing in this file really has anything to do with GPT specifically. """ import math import logging from tqdm import tqdm import numpy as np import torch import torch.optim as optim from torch.optim.lr_scheduler import Lambda...
[ 37811, 198, 26437, 3047, 9052, 26, 3248, 5329, 6816, 326, 714, 4174, 284, 597, 14977, 17019, 3127, 11, 198, 568, 2147, 287, 428, 2393, 1107, 468, 1997, 284, 466, 351, 402, 11571, 5734, 13, 198, 37811, 198, 198, 11748, 10688, 198, 1174...
3.534722
144
# Employee is a sub-class of Person and adds the attribute staffnumber x = Person("Marge", "Simpson") y = Employee("Homer", "Simpson", "1007") print(x.Name()) print(y.GetEmployee())
[ 198, 2, 36824, 318, 257, 850, 12, 4871, 286, 7755, 290, 6673, 262, 11688, 3085, 17618, 628, 198, 87, 796, 7755, 7203, 44, 1376, 1600, 366, 8890, 8430, 4943, 198, 88, 796, 36824, 7203, 39, 12057, 1600, 366, 8890, 8430, 1600, 366, 443...
3
62
# Copyright 2022 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, 33160, 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,...
3.62973
370
"""Script parses changelog from git based on 2 latest tags, formates changelog to .md format, creates/updates release on gitlab """ import subprocess import os import re import json def run_command( bash_command ): """Sends command to system. """ process = subprocess.Popen(bash_command.split(), stdout=subp...
[ 37811, 7391, 13544, 274, 1488, 417, 519, 422, 17606, 1912, 319, 362, 3452, 15940, 11, 1296, 689, 1488, 417, 519, 284, 764, 9132, 5794, 11, 8075, 14, 929, 19581, 2650, 319, 17606, 23912, 198, 37811, 198, 11748, 850, 14681, 198, 11748, ...
2.456889
1,125
import pykazoo.queues import pykazoo.restrequest from unittest import TestCase from unittest.mock import create_autospec mock_rest_request = create_autospec(pykazoo.restrequest.RestRequest)
[ 11748, 12972, 74, 1031, 2238, 13, 4188, 947, 198, 11748, 12972, 74, 1031, 2238, 13, 2118, 25927, 198, 6738, 555, 715, 395, 1330, 6208, 20448, 198, 6738, 555, 715, 395, 13, 76, 735, 1330, 2251, 62, 2306, 418, 43106, 198, 198, 76, 735...
2.909091
66
import numpy as np from utils import discretize_states class Agent(): """Agent base class.""" def __init__(self, action_space, observation_space): """Initializes agent class.""" self.action_space = action_space self.observation_space = observation_space def act(self, observatio...
[ 11748, 299, 32152, 355, 45941, 198, 198, 6738, 3384, 4487, 1330, 1221, 1186, 1096, 62, 27219, 628, 198, 4871, 15906, 33529, 198, 220, 220, 220, 37227, 36772, 2779, 1398, 526, 15931, 628, 220, 220, 220, 825, 11593, 15003, 834, 7, 944, ...
2.350184
1,088
#!/usr/bin/python # -*- coding: utf-8 -*- from __future__ import (absolute_import, division, print_function) from ansible.module_utils.basic import AnsibleModule __metaclass__ = type DOCUMENTATION = ''' --- module: public_cloud_instance_info short_description: Retrieve all info for a OVH public cloud instnace descr...
[ 2, 48443, 14629, 14, 8800, 14, 29412, 198, 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 198, 6738, 11593, 37443, 834, 1330, 357, 48546, 62, 11748, 11, 7297, 11, 3601, 62, 8818, 8, 198, 198, 6738, 9093, 856, 13, ...
2.665829
398
from __future__ import unicode_literals from django.apps import AppConfig
[ 6738, 11593, 37443, 834, 1330, 28000, 1098, 62, 17201, 874, 198, 198, 6738, 42625, 14208, 13, 18211, 1330, 2034, 16934, 628 ]
3.619048
21
# # _/_/_/ _/_/_/ _/_/_/ _/_/_/ _/ _/ _/_/_/ # _/ _/ _/ _/ _/ _/ _/ _/ _/ # _/_/_/ _/_/_/ _/ _/ _/_/ _/_/ # _/ _/ _/ _/ _/ _/ _/ _/ _/ # _/_/_/ _/ _/ _/_/_/ _/_/_/ _/ _/ _/_/_/ # # By Vlad Ivano...
[ 2, 198, 2, 220, 220, 220, 220, 220, 4808, 47835, 47835, 14, 220, 220, 220, 4808, 47835, 47835, 14, 220, 220, 220, 4808, 47835, 47835, 14, 220, 220, 220, 4808, 47835, 47835, 14, 220, 4808, 14, 220, 220, 220, 4808, 14, 220, 220, 220...
1.560897
312
import argparse from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker import codecs import getpass diagram = DbMap() diagram.run()
[ 11748, 1822, 29572, 198, 6738, 44161, 282, 26599, 1330, 2251, 62, 18392, 198, 6738, 44161, 282, 26599, 13, 579, 1330, 6246, 10297, 198, 11748, 40481, 82, 198, 11748, 651, 6603, 628, 198, 10989, 6713, 796, 360, 65, 13912, 3419, 198, 1098...
3.391304
46
# Generated by Django 3.2 on 2021-04-11 19:39 from django.db import migrations, models
[ 2, 2980, 515, 416, 37770, 513, 13, 17, 319, 33448, 12, 3023, 12, 1157, 678, 25, 2670, 198, 198, 6738, 42625, 14208, 13, 9945, 1330, 15720, 602, 11, 4981, 628 ]
2.966667
30
from functools import partial from tornado import gen from tornado.gen import UnknownKeyError from tornado.ioloop import IOLoop version_tuple = (0, 1, '+') version = '.'.join(map(str, version_tuple)) """Current version of YieldPoints.""" __all__ = [ 'TimeoutException', 'WaitAny', 'WithTimeout', 'Timeout', 'Ca...
[ 6738, 1257, 310, 10141, 1330, 13027, 198, 198, 6738, 33718, 1330, 2429, 198, 6738, 33718, 13, 5235, 1330, 16185, 9218, 12331, 198, 6738, 33718, 13, 1669, 11224, 1330, 314, 3535, 11224, 628, 198, 9641, 62, 83, 29291, 796, 357, 15, 11, ...
2.895
400
import re import types from collections import defaultdict from itertools import izip from nearpy.storage.storage import Storage class MemoryStorage(Storage): """ Storage in memory. """ def clear(self, bucketkeys): """ Parameters ---------- bucket_keys: iterable of string ...
[ 11748, 302, 198, 11748, 3858, 198, 198, 6738, 17268, 1330, 4277, 11600, 198, 6738, 340, 861, 10141, 1330, 220, 528, 541, 198, 6738, 1474, 9078, 13, 35350, 13, 35350, 1330, 20514, 628, 198, 4871, 14059, 31425, 7, 31425, 2599, 198, 220, ...
2.280193
621
from .chunked_embedding import chunked_embedding, script_chunked_embedding from .generate_prefetching_rule import generate_prefetching_rule from .lazy_loading import lazy_loading
[ 6738, 764, 354, 2954, 276, 62, 20521, 12083, 1330, 16058, 276, 62, 20521, 12083, 11, 4226, 62, 354, 2954, 276, 62, 20521, 12083, 198, 6738, 764, 8612, 378, 62, 3866, 69, 7569, 278, 62, 25135, 1330, 7716, 62, 3866, 69, 7569, 278, 62,...
3.196429
56
#!/usr/bin/env python from distutils.core import setup import sys, os # For some commands, use setuptools if len(set(['develop', 'sdist', 'release', 'bdist_egg', 'bdist_rpm', 'bdist', 'bdist_dumb', 'bdist_wininst', 'install_egg_info', 'build_sphinx', 'egg_info', 'easy_install', 'upload']).inte...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 198, 6738, 1233, 26791, 13, 7295, 1330, 9058, 198, 11748, 25064, 11, 28686, 198, 198, 2, 1114, 617, 9729, 11, 779, 900, 37623, 10141, 198, 361, 18896, 7, 2617, 7, 17816, 16244, 3256, ...
2.445013
782
import asyncio import aiohttp import random import requests import time from settings import string, TOKEN ID = [] # with open('message.txt', mode='r', encoding='utf8'): asyncio.run(main())
[ 11748, 30351, 952, 198, 11748, 257, 952, 4023, 198, 11748, 4738, 198, 11748, 7007, 198, 11748, 640, 198, 6738, 6460, 1330, 4731, 11, 5390, 43959, 198, 198, 2389, 796, 17635, 198, 198, 2, 351, 1280, 10786, 20500, 13, 14116, 3256, 4235, ...
3.126984
63
import requests import pandas as pd import datetime as dt from bs4 import BeautifulSoup def my_to_datetime(date_str): """ Transform dates with with 01 - 24 hours to 00 - 23 hours. It is based on this question on Stack Over Flow: https://stackoverflow.com/questions/43359479/pandas-parsing-2400-inst...
[ 11748, 7007, 198, 11748, 19798, 292, 355, 279, 67, 198, 11748, 4818, 8079, 355, 288, 83, 198, 6738, 275, 82, 19, 1330, 23762, 50, 10486, 628, 198, 4299, 616, 62, 1462, 62, 19608, 8079, 7, 4475, 62, 2536, 2599, 198, 220, 220, 220, ...
2.083105
2,924
from dataclasses import dataclass from bindings.gmd.time_topology_complex_type import TimeTopologyComplexType __NAMESPACE__ = "http://www.opengis.net/gml" @dataclass class TimeTopologyComplex(TimeTopologyComplexType): """A temporal topology complex shall be the connected acyclic directed graph composed of te...
[ 6738, 4818, 330, 28958, 1330, 4818, 330, 31172, 198, 6738, 34111, 13, 70, 9132, 13, 2435, 62, 4852, 1435, 62, 41887, 62, 4906, 1330, 3862, 9126, 1435, 5377, 11141, 6030, 198, 198, 834, 45, 29559, 47, 11598, 834, 796, 366, 4023, 1378, ...
3.70195
359
import logging from aiohttp import web log = logging.getLogger(__name__) routes = web.RouteTableDef() @routes.get(r'/fonts/{fontstack:\s+}/{range:\s+}.pbf', name='tiles') @routes.get(r'/tiles/{z:\d+}/{x:\d+}/{y:\d+}.pbf', name='tiles')
[ 11748, 18931, 198, 198, 6738, 257, 952, 4023, 1330, 3992, 628, 198, 6404, 796, 18931, 13, 1136, 11187, 1362, 7, 834, 3672, 834, 8, 198, 81, 448, 274, 796, 3992, 13, 43401, 10962, 7469, 3419, 628, 198, 31, 81, 448, 274, 13, 1136, 7...
2.131579
114
from .bitbucket import Bitbucket from .github import Github from .gitlab import Gitlab from .gogs import Gogs from .gitea import Gitea
[ 6738, 764, 2545, 27041, 316, 1330, 4722, 27041, 316, 198, 6738, 764, 12567, 1330, 38994, 198, 6738, 764, 18300, 23912, 1330, 15151, 23912, 198, 6738, 764, 70, 18463, 1330, 402, 18463, 198, 6738, 764, 70, 578, 64, 1330, 402, 578, 64, 1...
3.214286
42
""" Plot input and reconstruction statistics, as generated by calculate_encodings.py with the --statistics flag, with output file pd_friendly_stats.txt. Usage: """ import argparse from pathlib import Path import numpy as np import pandas as pd import seaborn as sns from matplotlib import rcParams as rc from utilit...
[ 37811, 198, 43328, 5128, 290, 25056, 7869, 11, 355, 7560, 416, 15284, 62, 12685, 375, 654, 13, 9078, 198, 4480, 262, 1377, 14269, 3969, 6056, 11, 351, 5072, 2393, 279, 67, 62, 13120, 62, 34242, 13, 14116, 13, 198, 198, 28350, 25, 19...
2.483081
857
from app.conf.environ import env NOTION_TOKEN = env('NOTION_TOKEN', cast=str, default='')
[ 6738, 598, 13, 10414, 13, 268, 2268, 1330, 17365, 198, 198, 11929, 2849, 62, 10468, 43959, 796, 17365, 10786, 11929, 2849, 62, 10468, 43959, 3256, 3350, 28, 2536, 11, 4277, 28, 7061, 8, 198 ]
2.676471
34
# Введение # В этом уроке мы увидели, как создать классификатор изображений, прикрепив головку из плотных слоев к предварительно # обученной основе. База, которую мы использовали, была от модели под названием VGG16. Мы увидели, что архитектура # VGG16 была склонна переоценивать этот набор данных. В ходе этого курса вы ...
[ 2, 12466, 240, 38857, 16843, 43666, 16843, 22177, 18849, 16843, 198, 2, 12466, 240, 220, 141, 235, 20375, 25443, 120, 220, 35072, 21169, 25443, 118, 16843, 12466, 120, 45035, 220, 35072, 38857, 18849, 43666, 16843, 30143, 18849, 11, 12466, ...
1.255448
4,772
# Uses python3 import sys input = sys.stdin.read() n = int(input) sequence = list(optimal_sequence(n)) print(len(sequence) - 1) for x in sequence: print(x, end=' ')
[ 2, 36965, 21015, 18, 198, 11748, 25064, 198, 198, 15414, 796, 25064, 13, 19282, 259, 13, 961, 3419, 198, 77, 796, 493, 7, 15414, 8, 198, 43167, 796, 1351, 7, 8738, 4402, 62, 43167, 7, 77, 4008, 198, 4798, 7, 11925, 7, 43167, 8, ...
2.575758
66
import cv2 import numpy as np def get_boundary_point(y, x, angle, H, W): ''' Given point y,x with angle, return a two point in image boundary with shape [H, W] return point:[x, y] ''' point1 = None point2 = None if angle == -np.pi / 2: point1 = (x, 0) point2 = (x, H-1)...
[ 11748, 269, 85, 17, 198, 11748, 299, 32152, 355, 45941, 628, 198, 4299, 651, 62, 7784, 560, 62, 4122, 7, 88, 11, 2124, 11, 9848, 11, 367, 11, 370, 2599, 198, 220, 220, 220, 705, 7061, 198, 220, 220, 220, 11259, 966, 331, 11, 87,...
1.686492
992
from test_case import * import numpy as np import sail import time import unittest elementwise_options = [(12,), (512, 128), (3, 14, 2), (8, 12, 12, 12), (3, 1, 5, 6), (13, 14)] broadcasted_options = [(512, 128), (3, 14, 2), (8, 12, 12, 12), (3, 1, 5, 6), (13, 14)] unary_elementwise_options = [(12,), (32, 12), (3, 14,...
[ 6738, 1332, 62, 7442, 1330, 1635, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 14936, 198, 11748, 640, 198, 11748, 555, 715, 395, 198, 198, 30854, 3083, 62, 25811, 796, 47527, 1065, 11, 828, 357, 25836, 11, 13108, 828, 357, 18, 11,...
2.189076
238
import re from django.conf import settings from django.http import HttpResponsePermanentRedirect, HttpResponseRedirect from django.utils.timezone import now from .models import PageNotFoundEntry IGNORED_404S = getattr(settings, 'IGNORED_404S', [ r'^/static/', r'^/favicon.ico' ])
[ 11748, 302, 198, 198, 6738, 42625, 14208, 13, 10414, 1330, 6460, 198, 6738, 42625, 14208, 13, 4023, 1330, 367, 29281, 31077, 47, 30312, 7738, 1060, 11, 367, 29281, 31077, 7738, 1060, 198, 6738, 42625, 14208, 13, 26791, 13, 2435, 11340, ...
2.90099
101
# -*- coding: utf-8 -*- """This file imports Python modules that registers scaffolders.""" from l2tscaffolder.scaffolders import plaso_sqlite from l2tscaffolder.scaffolders import timesketch_index from l2tscaffolder.scaffolders import timesketch_sketch from l2tscaffolder.scaffolders import turbinia
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 37811, 1212, 2393, 17944, 11361, 13103, 326, 28441, 41498, 727, 364, 526, 15931, 198, 6738, 300, 17, 912, 66, 2001, 19892, 13, 1416, 2001, 727, 364, 1330, 458, 292, 78, ...
2.884615
104
""" UTPM == Univariate Taylor Polynomial of Matrices. UTPM arithmetic means to apply functions to ..math:: [A]_D = \sum_{d=0}^{D-1} A_d t^d A_d = \frac{d^d}{dt^d}|_{t=0} \sum_{k=0}^{D-1} A_k t^k The underlying data structure is a numpy.array of shape (D,P,N,M) where D: D number of coefficients, i.e. D-1 is ...
[ 37811, 19255, 5868, 6624, 791, 42524, 8121, 12280, 26601, 498, 286, 6550, 45977, 13, 198, 198, 3843, 5868, 34768, 1724, 284, 4174, 5499, 284, 198, 492, 11018, 3712, 198, 220, 220, 220, 685, 32, 60, 62, 35, 796, 3467, 16345, 23330, 67,...
2.74744
293
from setuptools import find_packages, setup setup( name='painterbot', packages=find_packages(where="src/painterbot"), use_scm_version={ "write_to": "src/painterbot/_version.py", 'fallback_version': "0.0.0-server", }, license='Apache-2.0', author='Marcelo Duarte Trevisani', a...
[ 6738, 900, 37623, 10141, 1330, 1064, 62, 43789, 11, 9058, 198, 198, 40406, 7, 198, 220, 220, 220, 1438, 11639, 35436, 353, 13645, 3256, 198, 220, 220, 220, 10392, 28, 19796, 62, 43789, 7, 3003, 2625, 10677, 14, 35436, 353, 13645, 1234...
2.323077
325
from typing import Any, List from torch import nn from torchmetrics import MetricCollection, Accuracy, F1, Precision, Recall, CohenKappa, MatthewsCorrcoef, AUROC from torchmetrics import CosineSimilarity, MeanAbsoluteError, MeanAbsolutePercentageError, MeanSquaredError, PearsonCorrcoef, R2Score, SpearmanCorrcoef import...
[ 6738, 19720, 1330, 4377, 11, 7343, 198, 6738, 28034, 1330, 299, 77, 198, 6738, 28034, 4164, 10466, 1330, 3395, 1173, 36307, 11, 33222, 11, 376, 16, 11, 39281, 11, 44536, 11, 17154, 42, 20975, 11, 22233, 10606, 81, 1073, 891, 11, 317, ...
3.427586
145
import os import logging from .consts import * # Language - settings lang = "eng" # Logger - settings available_languages = ["pl", "eng"] LOGGING_FORMAT = "\r%(asctime)s, %(levelname)-8s [`%(funcName)s` %(filename)s:%(lineno)d] %(message)s" # Api dates format DATE_FORMAT = "%Y-%m-%d"
[ 11748, 28686, 198, 11748, 18931, 198, 198, 6738, 764, 1102, 6448, 1330, 1635, 198, 198, 2, 15417, 532, 6460, 198, 17204, 796, 366, 1516, 1, 198, 198, 2, 5972, 1362, 532, 6460, 198, 15182, 62, 75, 33213, 796, 14631, 489, 1600, 366, 1...
2.377049
122
import json from django.views.generic import TemplateView from django.conf import settings from django.http import Http404 from base import mods
[ 11748, 33918, 198, 6738, 42625, 14208, 13, 33571, 13, 41357, 1330, 37350, 7680, 198, 6738, 42625, 14208, 13, 10414, 1330, 6460, 198, 6738, 42625, 14208, 13, 4023, 1330, 367, 29281, 26429, 198, 198, 6738, 2779, 1330, 13743, 628 ]
3.868421
38
from netqasm.sdk.epr_socket import EprMeasBasis, EPRSocket from netqasm.sdk.external import NetQASMConnection if __name__ == "__main__": main()
[ 6738, 2010, 80, 8597, 13, 21282, 74, 13, 538, 81, 62, 44971, 1330, 412, 1050, 5308, 292, 15522, 271, 11, 412, 4805, 39105, 198, 6738, 2010, 80, 8597, 13, 21282, 74, 13, 22615, 1330, 3433, 48, 1921, 44, 32048, 628, 198, 198, 361, 1...
2.559322
59
# Copyright (c) AIRBUS and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from __future__ import annotations import pickle from skdecide.discrete_optimization.generic_tools.do_problem import Solution, Problem, \ build_eva...
[ 2, 15069, 357, 66, 8, 31600, 45346, 290, 663, 29116, 13, 198, 2, 770, 2723, 2438, 318, 11971, 739, 262, 17168, 5964, 1043, 287, 262, 198, 2, 38559, 24290, 2393, 287, 262, 6808, 8619, 286, 428, 2723, 5509, 13, 198, 198, 6738, 11593, ...
3
251
# coding: utf-8 import sys import numpy as np from Node import Node # set the maximal recursion limits here. sys.setrecursionlimit(10000) class baseClassDecisionTree(object): ''' The main class of decision tree. ''' def __init__(self, feature_discrete=[], treeType='C4.5'): ''' featur...
[ 2, 19617, 25, 3384, 69, 12, 23, 198, 198, 11748, 25064, 198, 11748, 299, 32152, 355, 45941, 198, 6738, 19081, 1330, 19081, 198, 198, 2, 900, 262, 40708, 664, 24197, 7095, 994, 13, 198, 17597, 13, 2617, 8344, 24197, 32374, 7, 49388, ...
2.028666
9,349
# Copyright (c) 2010 Doug Hellmann. All rights reserved. # """ """ # end_pymotw_header import argparse parser = argparse.ArgumentParser() parser.add_argument("-i", metavar="in-file", type=argparse.FileType("rt")) parser.add_argument("-o", metavar="out-file", type=argparse.FileType("wt")) try: results = parser....
[ 2, 15069, 357, 66, 8, 3050, 15115, 5783, 9038, 13, 220, 1439, 2489, 10395, 13, 198, 2, 198, 37811, 198, 37811, 198, 198, 2, 886, 62, 79, 4948, 313, 86, 62, 25677, 198, 11748, 1822, 29572, 198, 198, 48610, 796, 1822, 29572, 13, 281...
2.714286
168
import pandas as pd from enum import Enum import random from game.division import Division from game.team import Team
[ 11748, 19798, 292, 355, 279, 67, 198, 6738, 33829, 1330, 2039, 388, 198, 11748, 4738, 198, 6738, 983, 13, 21426, 1330, 7458, 198, 6738, 983, 13, 15097, 1330, 4816, 628, 198 ]
3.870968
31
__all__ = ["models", "async_beatsaver", "beatsaver"]
[ 834, 439, 834, 796, 14631, 27530, 1600, 366, 292, 13361, 62, 1350, 1381, 8770, 1600, 366, 1350, 1381, 8770, 8973 ]
2.6
20
""" pre = state in previous time step (2+N vector) curr = current state (2+N vector) N = number of phases """ if __name__ == "__main__": pre = [0, 0, 1, 2, 3] curr = [0, 0, 5, 6, 7] N = 3 #print (delayReward(pre,curr,N))
[ 37811, 662, 796, 1181, 287, 2180, 640, 2239, 357, 17, 10, 45, 15879, 8, 198, 220, 220, 220, 1090, 81, 796, 1459, 1181, 357, 17, 10, 45, 15879, 8, 198, 220, 220, 220, 399, 796, 1271, 286, 21164, 37227, 628, 628, 198, 361, 11593, ...
2.223214
112
import numpy as np import matplotlib.pyplot as plt import time import os import scipy.sparse as sps if __name__ == "__main__": main()
[ 11748, 299, 32152, 355, 45941, 198, 11748, 2603, 29487, 8019, 13, 9078, 29487, 355, 458, 83, 198, 11748, 640, 198, 11748, 28686, 198, 11748, 629, 541, 88, 13, 82, 29572, 355, 599, 82, 198, 198, 361, 11593, 3672, 834, 6624, 366, 834, ...
2.74
50
from django.db import models # Create your models here. class Comment(models.Model): """ 评论 """ obj_type_id = models.IntegerField('对象类别') # 1.博客 2.评论 obj_id = models.IntegerField('对象id') username = models.CharField('用户名', max_length=50, null=True, blank=True) name = models.CharField('姓名'...
[ 6738, 42625, 14208, 13, 9945, 1330, 4981, 198, 198, 2, 13610, 534, 4981, 994, 13, 628, 198, 4871, 18957, 7, 27530, 13, 17633, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 5525, 107, 226, 164, 106, 118, 198, 220, 220, 220, ...
2.071895
459
#!/usr/bin/env python import json import sys import os from web3 import Web3 from eth_account import Account def getenv_or_exit(name): """ Gets the required variable from the environment. Closes the application with error if it's not set. Args: name (string) - The name of required environment vari...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 11748, 33918, 198, 11748, 25064, 198, 11748, 28686, 198, 6738, 3992, 18, 1330, 5313, 18, 198, 6738, 4555, 62, 23317, 1330, 10781, 628, 198, 4299, 651, 24330, 62, 273, 62, 37023, 7, 367...
2.741688
782
#!/usr/bin/env python3 # Hugo Hromic <hugo.hromic@insight-centre.org> """Generate timeline and events in JSON representation for visualisation.""" import json from argparse import ArgumentParser from helpers.utils import get_reader, get_writer, read_step_communities from helpers.timeline import Timeline def main(): ...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 2, 25930, 367, 398, 291, 1279, 71, 1018, 78, 13, 71, 398, 291, 31, 1040, 432, 12, 1087, 260, 13, 2398, 29, 198, 198, 37811, 8645, 378, 15264, 290, 2995, 287, 19449, 10552, 329,...
2.665957
940
from botocore.exceptions import ClientError from progress.bar import ChargingBar import boto3 BUCKET_NAME = 'your_bucket_name' PROFILE = 'stage' # Select required profile from ~/.aws/credentials session = boto3.Session(profile_name=PROFILE) stage_s3_client = session.client('s3') s3 = session.resource('s3') buck...
[ 6738, 10214, 420, 382, 13, 1069, 11755, 1330, 20985, 12331, 198, 6738, 4371, 13, 5657, 1330, 14797, 278, 10374, 198, 11748, 275, 2069, 18, 198, 198, 33, 16696, 2767, 62, 20608, 796, 705, 14108, 62, 27041, 316, 62, 3672, 6, 198, 31190,...
2.198257
459
from .nms_nd import nms_nd from .bbox_overlaps_nd import bbox_overlaps_nd from .roi_align_nd import RoIAlign from .roi_align_rotated_nd import RoIAlignRotated from .deform_pool_2d import DeformRoIPooling2dPack, ModulatedDeformRoIPooling2dPack from .deform_conv_2d import DeformConv2dPack from .modulated_deform_conv_2d...
[ 6738, 764, 77, 907, 62, 358, 1330, 299, 907, 62, 358, 198, 6738, 764, 65, 3524, 62, 2502, 75, 1686, 62, 358, 1330, 275, 3524, 62, 2502, 75, 1686, 62, 358, 198, 6738, 764, 305, 72, 62, 31494, 62, 358, 1330, 5564, 40, 2348, 570, ...
2.274691
324
import mock from xml2kinto.kinto import get_kinto_records
[ 11748, 15290, 198, 6738, 35555, 17, 74, 20424, 13, 74, 20424, 1330, 651, 62, 74, 20424, 62, 8344, 3669, 628, 628, 628, 628 ]
2.826087
23
""" Author: Alexandre Lepage Date: May 2019 """ class TheStack: """ Custom stack class """ __keys:list # The array holding the keys __intitial_size:int = 8 # The size of the array holding the stack def __init__(self): """ Contructor of the Class Initialized the list an...
[ 37811, 198, 13838, 25, 21000, 260, 42957, 496, 198, 10430, 25, 1737, 13130, 198, 37811, 198, 198, 4871, 383, 25896, 25, 198, 220, 220, 220, 37227, 220, 198, 220, 220, 220, 8562, 8931, 1398, 198, 220, 220, 220, 37227, 198, 220, 220, ...
1.948005
2,231
import requests import json from requests.auth import HTTPDigestAuth from utils.errors import check_error
[ 11748, 7007, 198, 11748, 33918, 198, 6738, 7007, 13, 18439, 1330, 7154, 51, 5760, 328, 395, 30515, 198, 6738, 3384, 4487, 13, 48277, 1330, 2198, 62, 18224, 628 ]
3.821429
28
from files.ListObject import variables, variableExist, callFunction from files.Operations import add, subtract, multiply, divide from files.FunctionsForSython import error
[ 6738, 3696, 13, 8053, 10267, 1330, 9633, 11, 7885, 3109, 396, 11, 869, 22203, 198, 6738, 3696, 13, 18843, 602, 1330, 751, 11, 34128, 11, 29162, 11, 14083, 198, 6738, 3696, 13, 24629, 2733, 1890, 50, 7535, 1330, 4049 ]
4.384615
39