content
stringlengths
1
1.04M
input_ids
listlengths
1
774k
ratio_char_token
float64
0.38
22.9
token_count
int64
1
774k
# # This source file is part of appleseed. # Visit http://appleseedhq.net/ for additional information and resources. # # This software is released under the MIT license. # # Copyright (c) 2019 Jonathan Dent, The appleseedhq Organization # # Permission is hereby granted, free of charge, to any person obtaining a copy # ...
[ 2, 198, 2, 770, 2723, 2393, 318, 636, 286, 22514, 2308, 13, 198, 2, 16440, 2638, 1378, 1324, 829, 2308, 71, 80, 13, 3262, 14, 329, 3224, 1321, 290, 4133, 13, 198, 2, 198, 2, 770, 3788, 318, 2716, 739, 262, 17168, 5964, 13, 198, ...
3.820346
462
# https://stackoverflow.com/questions/18007995/recursive-method-for-parentheses-balancing-python # define the function, string n with (), # i in n start at 0, counter start at 0 a = "(()()" print(verify_parentheses(a)) b = "(()" print(verify_parentheses(b)) c = "(())" print(verify_parentheses(c)) d = ")(()" print(ve...
[ 2, 3740, 1378, 25558, 2502, 11125, 13, 785, 14, 6138, 507, 14, 1507, 25816, 33438, 14, 8344, 30753, 12, 24396, 12, 1640, 12, 8000, 39815, 12, 6893, 5077, 12, 29412, 198, 198, 2, 8160, 262, 2163, 11, 4731, 299, 351, 29994, 220, 198, ...
2.575419
179
import json import pickle import re from app import emitter, definitions, values from six.moves import cStringIO import os from pysmt.smtlib.parser import SmtLibParser def collect_symbolic_expression(log_path): """ This function will read the output log of a klee concolic execution and extract symbolic e...
[ 11748, 33918, 198, 11748, 2298, 293, 198, 11748, 302, 198, 6738, 598, 1330, 795, 1967, 11, 17336, 11, 3815, 198, 6738, 2237, 13, 76, 5241, 1330, 269, 10100, 9399, 198, 11748, 28686, 198, 6738, 279, 893, 16762, 13, 5796, 83, 8019, 13, ...
2.039174
4,697
import cv2 import numpy as np from keras.models import load_model from model.image_classification_class import ImageClassification export_path_keras = "C:\\Users\\catal\\Facultate\\an4\\licenta\\modele antrenate\\modelBinaryClassificationFoodOrNotfood-VGG16.h5" model = load_model(export_path_keras) classtolabel...
[ 11748, 269, 85, 17, 201, 198, 11748, 299, 32152, 355, 45941, 201, 198, 6738, 41927, 292, 13, 27530, 1330, 3440, 62, 19849, 201, 198, 6738, 2746, 13, 9060, 62, 4871, 2649, 62, 4871, 1330, 7412, 9487, 2649, 201, 198, 201, 198, 39344, ...
2.734375
128
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'e:/Code/MyQT/typing/typing.ui' # # Created by: PyQt5 UI code generator 5.13.0 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 201, 198, 201, 198, 2, 5178, 7822, 7560, 422, 3555, 334, 72, 2393, 705, 68, 14079, 10669, 14, 3666, 48, 51, 14, 774, 13886, 14, 774, 13886, 13, 9019, 6, 201, 198, 2, 20...
2.486239
109
N = int(input()) soma = 0 for k in range(N): X = int(input()) if X >= 10 and X <= 20: soma+=1 print("%d in" % (soma)) print("%d out" % (abs(N-soma)))
[ 45, 796, 493, 7, 15414, 28955, 198, 198, 82, 6086, 796, 657, 198, 198, 1640, 479, 287, 2837, 7, 45, 2599, 198, 220, 220, 220, 1395, 796, 493, 7, 15414, 28955, 198, 220, 220, 220, 611, 1395, 18189, 838, 290, 1395, 19841, 1160, 25, ...
2.064103
78
"""Python wrapper for the object extraction algorithm found in https://github.com/assamite/CmCode """ import os import tempfile from ctypes import cdll, c_char_p, c_bool import cv2 from .utils import file_cache def _saliency(image_path, saliency_map_path, saliency_mask_path): """Python wrapper for running the ...
[ 37811, 37906, 29908, 329, 262, 2134, 22236, 11862, 1043, 287, 198, 5450, 1378, 12567, 13, 785, 14, 562, 321, 578, 14, 34, 76, 10669, 198, 37811, 198, 198, 11748, 28686, 198, 11748, 20218, 7753, 198, 6738, 269, 19199, 1330, 269, 12736, ...
2.576923
1,014
"""Util module.""" import six from django.db import models from django.db.models.fields.related import ForeignObjectRel as RelatedObject from django.forms.forms import pretty_name from django.utils.encoding import force_str from django.utils.encoding import force_text def label_for_field(name, model, return_attr=Fals...
[ 37811, 18274, 346, 8265, 526, 15931, 198, 11748, 2237, 198, 6738, 42625, 14208, 13, 9945, 1330, 4981, 198, 6738, 42625, 14208, 13, 9945, 13, 27530, 13, 25747, 13, 5363, 1330, 8708, 10267, 6892, 355, 19809, 10267, 198, 6738, 42625, 14208, ...
2.093985
1,064
if __name__ == '__main__': from sys import argv cal = Calculator(int(argv[1]), int(argv[2])) print(cal.square())
[ 198, 198, 361, 11593, 3672, 834, 6624, 705, 834, 12417, 834, 10354, 198, 220, 220, 220, 422, 25064, 1330, 1822, 85, 628, 220, 220, 220, 2386, 796, 43597, 7, 600, 7, 853, 85, 58, 16, 46570, 493, 7, 853, 85, 58, 17, 60, 4008, 198,...
2.345455
55
# Time: O(n) # Space: O(1)
[ 2, 3862, 25, 220, 440, 7, 77, 8, 198, 2, 4687, 25, 440, 7, 16, 8, 198 ]
1.647059
17
from apscheduler.schedulers.background import BackgroundScheduler from pyfcm import FCMNotification from flask import Flask, render_template from bs4 import BeautifulSoup import requests from urllib import parse import pyrebase from config import config from keys import api_key from collections import OrderedDict noti...
[ 6738, 257, 862, 1740, 18173, 13, 1416, 704, 377, 364, 13, 25249, 1330, 25353, 50, 1740, 18173, 198, 6738, 12972, 69, 11215, 1330, 10029, 44, 3673, 2649, 198, 6738, 42903, 1330, 46947, 11, 8543, 62, 28243, 198, 6738, 275, 82, 19, 1330,...
3.069672
244
import sys from .module import register_module, ModuleImporter if sys.version_info >= (3, 0): sys.meta_path.append(ModuleImporter(__name__)) register_module(__name__)
[ 11748, 25064, 198, 198, 6738, 764, 21412, 1330, 7881, 62, 21412, 11, 19937, 3546, 26634, 628, 198, 361, 25064, 13, 9641, 62, 10951, 18189, 357, 18, 11, 657, 2599, 198, 220, 220, 220, 25064, 13, 28961, 62, 6978, 13, 33295, 7, 26796, ...
2.916667
60
import numpy as np from SharedProcessors.const import RAW_DATA_PATH, TRIAL_NAMES, MOCAP_SAMPLE_RATE import matplotlib.pyplot as plt import scipy.interpolate as interpo from ViconReader import ViconReader
[ 11748, 299, 32152, 355, 45941, 198, 6738, 39403, 18709, 669, 13, 9979, 1330, 33782, 62, 26947, 62, 34219, 11, 37679, 1847, 62, 45, 29559, 11, 337, 4503, 2969, 62, 49302, 16437, 62, 49, 6158, 198, 11748, 2603, 29487, 8019, 13, 9078, 29...
3.059701
67
""" A word replacer to make a dumb sentence sound verysmart. Leonardo Martinho 2017 """ import API import argparse import re from nltk import pos_tag import sys from pathlib2 import Path def sanitize_for_url(word): """ Sanitizing of a word with a regex search string - everything that is not alphanumeric, a space or ...
[ 37811, 198, 32, 1573, 2186, 11736, 284, 787, 257, 13526, 6827, 2128, 845, 27004, 13, 198, 36185, 13109, 5780, 8873, 198, 5539, 198, 37811, 198, 11748, 7824, 198, 11748, 1822, 29572, 198, 11748, 302, 198, 6738, 299, 2528, 74, 1330, 1426,...
2.99283
2,092
import pyHook,pythoncom,sys,logging import time,datetime import win32console import win32gui import os window = win32console.GetConsoleWindow() win32gui.ShowWindow(window,0) root_dir = os.path.split(os.path.realpath(__file__))[0] log_file=os.path.join("C:\\Users\\Solid\\Desktop\\key","log_file.txt") buffer="" pause_p...
[ 11748, 12972, 39, 566, 11, 29412, 785, 11, 17597, 11, 6404, 2667, 198, 11748, 640, 11, 19608, 8079, 198, 11748, 1592, 2624, 41947, 198, 11748, 1592, 2624, 48317, 198, 11748, 28686, 198, 198, 17497, 796, 1592, 2624, 41947, 13, 3855, 4758...
2.619048
252
import nltk import string import requests import json from io import StringIO from html.parser import HTMLParser import os import time from sys import platform path = "" if platform == "linux" or platform == "linux2": path = os.path.dirname(os.path.realpath(__file__)).replace("test","data/nltk") elif ...
[ 11748, 299, 2528, 74, 201, 198, 11748, 4731, 201, 198, 11748, 7007, 201, 198, 11748, 33918, 201, 198, 6738, 33245, 1330, 10903, 9399, 201, 198, 6738, 27711, 13, 48610, 1330, 11532, 46677, 201, 198, 11748, 28686, 201, 198, 11748, 640, 20...
2.662281
228
from backtester.timeRule.time_rule import TimeRule from datetime import datetime, timedelta import pandas as pd from pandas.tseries.offsets import CustomBusinessHour from pandas.tseries.offsets import CustomBusinessDay
[ 6738, 736, 4879, 353, 13, 2435, 31929, 13, 2435, 62, 25135, 1330, 3862, 31929, 198, 6738, 4818, 8079, 1330, 4818, 8079, 11, 28805, 12514, 198, 11748, 19798, 292, 355, 279, 67, 198, 6738, 19798, 292, 13, 912, 10640, 13, 8210, 1039, 133...
3.65
60
from selenium import webdriver from time import sleep driver = None driver = webdriver.Firefox() SENDER = '<SENDER NAME>' GMAIL_USER = '<Your Gmail ID>' GMAIL_PASSWORD = '<Your Gmail ID>' MESSAGE = 'I will get back to you soon. \n Thanks' MESSAGE = 'I will get back to you soon. \n Thanks' if __name__ == '__main__...
[ 6738, 384, 11925, 1505, 1330, 3992, 26230, 198, 6738, 640, 1330, 3993, 198, 198, 26230, 796, 6045, 198, 26230, 796, 3992, 26230, 13, 13543, 12792, 3419, 198, 198, 50, 10619, 1137, 796, 705, 27, 50, 10619, 1137, 36751, 29, 6, 198, 38, ...
2.354839
217
from datetime import datetime from werkzeug.security import generate_password_hash, check_password_hash from flask_login import UserMixin, current_user from fuck_papers.extensions import db
[ 6738, 4818, 8079, 1330, 4818, 8079, 198, 198, 6738, 266, 9587, 2736, 1018, 13, 12961, 1330, 7716, 62, 28712, 62, 17831, 11, 2198, 62, 28712, 62, 17831, 198, 6738, 42903, 62, 38235, 1330, 11787, 35608, 259, 11, 1459, 62, 7220, 198, 198...
3.62963
54
from storyscript.compiler.semantics.functions.Mutation import Mutation from storyscript.compiler.semantics.types.GenericTypes import \ GenericType, ListGenericType, MapGenericType, TypeSymbol from storyscript.compiler.semantics.types.Types import AnyType, BaseType, \ BooleanType, FloatType, IntType, NoneType, R...
[ 6738, 1621, 12048, 13, 5589, 5329, 13, 43616, 29320, 13, 12543, 2733, 13, 44, 7094, 1330, 337, 7094, 198, 6738, 1621, 12048, 13, 5589, 5329, 13, 43616, 29320, 13, 19199, 13, 46189, 31431, 1330, 3467, 198, 220, 220, 220, 42044, 6030, 1...
2.205709
2,207
import json, requests content = """**My source code:** ``` import json, requests quote_response = requests.get("https://quotes.schollz.com/subject/friend.json") quote = quote_response.json()[0] if len(quote['Name']) == 0: quote['Name'] = 'Unknown' content = "<p>“{q[Text]}”</p><p>- <em>{q[Name]}</em></p>".format(q=qu...
[ 11748, 33918, 11, 7007, 198, 198, 11299, 796, 37227, 1174, 3666, 2723, 2438, 25, 1174, 198, 198, 15506, 63, 198, 11748, 33918, 11, 7007, 198, 22708, 62, 26209, 796, 7007, 13, 1136, 7203, 5450, 1378, 421, 6421, 13, 20601, 692, 89, 13, ...
2.657289
391
from django.db import models from django.contrib.auth.models import User
[ 6738, 42625, 14208, 13, 9945, 1330, 4981, 198, 6738, 42625, 14208, 13, 3642, 822, 13, 18439, 13, 27530, 1330, 11787, 198 ]
3.47619
21
# -*- coding: utf-8 -*- """ radish ~~~~~~ Behavior Driven Development tool for Python - the root from red to green Copyright: MIT, Timo Furrer <tuxtimo@gmail.com> """ from radish import step @step("Gegeben sei etwas") def have_a_step(step): "Given I have a step" pass @step("Wenn ich etw...
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 198, 37811, 198, 220, 220, 220, 2511, 680, 198, 220, 220, 220, 220, 8728, 4907, 628, 220, 220, 220, 20181, 5809, 574, 7712, 2891, 329, 11361, 532, 262, 6808, 422, 2266...
2.557292
192
from __future__ import print_function, absolute_import, division #makes KratosMultiphysics backward compatible with python 2.6 and 2.7 # Time control starts import time as timer print(timer.ctime()) # Measure process time t0p = timer.clock() # Measure wall time t0w = timer.time() # Import kratos core and application...
[ 6738, 11593, 37443, 834, 1330, 3601, 62, 8818, 11, 4112, 62, 11748, 11, 7297, 1303, 49123, 509, 10366, 418, 15205, 13323, 23154, 19528, 11670, 351, 21015, 362, 13, 21, 290, 362, 13, 22, 198, 198, 2, 3862, 1630, 4940, 198, 11748, 640, ...
3.19802
404
import warnings from functools import partial import torch from torch import nn from .functional import cross_entropy_with_smoothing, cross_entropy_with_softlabels
[ 11748, 14601, 198, 6738, 1257, 310, 10141, 1330, 13027, 198, 198, 11748, 28034, 198, 6738, 28034, 1330, 299, 77, 198, 198, 6738, 764, 45124, 1330, 3272, 62, 298, 28338, 62, 4480, 62, 5796, 1025, 722, 11, 3272, 62, 298, 28338, 62, 4480...
3.520833
48
#!/usr/bin/env python # Basic TCProtobufClient usage import sys from tcpb import TCProtobufClient # Water system atoms = ["O", "H", "H"] geom = [ 0.00000, 0.00000, -0.06852, 0.00000, -0.79069, 0.54370, 0.00000, 0.79069, 0.54370, ] # Default geom is bohr, but this in angstrom if le...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 2, 14392, 17283, 19703, 672, 3046, 11792, 8748, 198, 11748, 25064, 198, 198, 6738, 48265, 65, 1330, 17283, 19703, 672, 3046, 11792, 198, 198, 2, 5638, 1080, 198, 265, 3150, 796, 14631, ...
2.462366
651
import requests from n26 import config url = 'https://api.tech26.de' # Api class can be imported as a library in order to use it within applications # constructor accepting None to maintain backward compatibility # TODO: this method will check if token is valid, if not it will run get_token # IDEA: @ge...
[ 11748, 7007, 198, 6738, 299, 2075, 1330, 4566, 198, 198, 6371, 796, 705, 5450, 1378, 15042, 13, 13670, 2075, 13, 2934, 6, 628, 198, 2, 5949, 72, 1398, 460, 307, 17392, 355, 257, 5888, 287, 1502, 284, 779, 340, 1626, 5479, 198, 220, ...
3.634409
93
import requests
[ 11748, 7007, 628 ]
5.666667
3
# from watchmen.common.storage.engine.storage_engine import get_client # from watchmen.topic.topic_relationship import TopicRelationship # # db = get_client() # # topic_relation_collections = db.get_collection('topic_relation_collections') # # # def save_topic_relationship(topic_relation: TopicRelationship): # resu...
[ 2, 422, 2342, 3653, 13, 11321, 13, 35350, 13, 18392, 13, 35350, 62, 18392, 1330, 651, 62, 16366, 198, 2, 422, 2342, 3653, 13, 26652, 13, 26652, 62, 39468, 1056, 1330, 47373, 47117, 1056, 198, 2, 198, 2, 20613, 796, 651, 62, 16366, ...
2.784394
487
import os import re from importlib import import_module from pathlib import Path from typing import TYPE_CHECKING, Any, Optional, TextIO, Type, Union import yaml from snowshu.logger import Logger if TYPE_CHECKING: from snowshu.adapters.base_sql_adapter import BaseSQLAdapter from snowshu.adapters.source_adapt...
[ 11748, 28686, 198, 11748, 302, 198, 6738, 1330, 8019, 1330, 1330, 62, 21412, 198, 6738, 3108, 8019, 1330, 10644, 198, 6738, 19720, 1330, 41876, 62, 50084, 2751, 11, 4377, 11, 32233, 11, 8255, 9399, 11, 5994, 11, 4479, 198, 198, 11748, ...
2.775
960
import os import nose from qubits import command_line as cl # SETUP AND TEARDOWN FIXTURE FUNCTIONS FOR THE ENTIRE MODULE def setUpModule(): "set up test fixtures" moduleDirectory = os.path.dirname(__file__) + "/../tests" # SETUP PATHS TO COMMONG DIRECTORIES FOR TEST DATA global pathToOutputDir, path...
[ 11748, 28686, 198, 11748, 9686, 198, 6738, 627, 9895, 1330, 3141, 62, 1370, 355, 537, 198, 198, 2, 25823, 8577, 5357, 13368, 9795, 14165, 44855, 51, 11335, 29397, 4177, 11053, 7473, 3336, 47353, 41736, 33893, 628, 198, 4299, 900, 4933, ...
2.947598
229
"""Common helpers for gree test cases.""" from unittest.mock import AsyncMock, Mock def build_device_info_mock( name="fake-device-1", ipAddress="1.1.1.1", mac="aabbcc112233" ): """Build mock device info structure.""" mock = Mock(ip=ipAddress, port=7000, mac=mac) mock.name = name return mock def ...
[ 37811, 17227, 49385, 329, 308, 631, 1332, 2663, 526, 15931, 198, 6738, 555, 715, 395, 13, 76, 735, 1330, 1081, 13361, 44, 735, 11, 44123, 628, 198, 4299, 1382, 62, 25202, 62, 10951, 62, 76, 735, 7, 198, 220, 220, 220, 1438, 2625, ...
2.181609
435
import re PLAYER_NAME_AND_ID_REGEX = re.compile(r"[\s\d]\d\:[0123456]\d\:[0123456]\d\sPlayer\s(?P<player_name>(?!headlessclient).*)\s(connected)\s\(id\=(?P<steam_id>\d+)\)", re.IGNORECASE) CONNECT_REGEX = re.compile(r"^\s?(?P<hour>[0-24]?\d)\:(?P<minute>[0123456]\d)\:(?P<second>[0123456]\d)\sPlayer\s(?P<player_name>...
[ 11748, 302, 628, 198, 31519, 1137, 62, 20608, 62, 6981, 62, 2389, 62, 31553, 6369, 796, 302, 13, 5589, 576, 7, 81, 17912, 59, 82, 59, 67, 60, 59, 67, 59, 33250, 486, 1954, 29228, 60, 59, 67, 59, 33250, 486, 1954, 29228, 60, 59, ...
1.924623
199
from .interactive_guess import InteractiveGuessSession from .util import load, save
[ 6738, 764, 3849, 5275, 62, 5162, 408, 1330, 21365, 8205, 408, 36044, 198, 6738, 764, 22602, 1330, 3440, 11, 3613, 198 ]
4
21
#Python program to display calender for particular month import calendar if __name__=='__main__': main()
[ 2, 37906, 1430, 284, 3359, 2386, 2194, 329, 1948, 1227, 198, 11748, 11845, 198, 361, 11593, 3672, 834, 855, 6, 834, 12417, 834, 10354, 198, 197, 12417, 3419, 198 ]
3.655172
29
"""TODO(jietan): DO NOT SUBMIT without one-line documentation for train_ars. blaze build -c opt //experimental/users/jietan/ARS:train_ars blaze-bin/experimental/users/jietan/ARS/train_ars \ --logdir=/cns/ij-d/home/jietan/experiment/ARS/test1 \ --config_name=MINITAUR_GYM_CONFIG """ from __future__ import absolute_impo...
[ 37811, 51, 3727, 46, 7, 73, 1155, 272, 2599, 8410, 5626, 28932, 36393, 1231, 530, 12, 1370, 10314, 329, 4512, 62, 945, 13, 198, 198, 2436, 6201, 1382, 532, 66, 2172, 3373, 23100, 9134, 14, 18417, 14, 73, 1155, 272, 14, 27415, 25, ...
2.918216
269
#!/usr/bin/env python3 ''' This file tests student written cachelab traces. It tests them by running traces on csim-ref and comparing the hits/misses/evictions with the expected hits/misses/evictions. It also checks if the trace is well formatted. If run with the -f [tracefile] it only judges whether tracefile is wel...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 198, 7061, 6, 198, 1212, 2393, 5254, 3710, 3194, 269, 9636, 397, 20675, 13, 632, 5254, 606, 416, 2491, 198, 2213, 2114, 319, 269, 14323, 12, 5420, 290, 14176, 262, 7127, 14, 3927...
2.492931
1,556
"""Util for training on SIS/backselect subsets.""" import glob import numpy as np import os import torch import torchvision import imagenet_backselect class BackselectSubsetsImageNetDataset(torchvision.datasets.ImageNet): """Dataset of backselect pixel subsets on ImageNet. Args: sis_dir (str): Pat...
[ 37811, 18274, 346, 329, 3047, 319, 311, 1797, 14, 1891, 19738, 6352, 1039, 526, 15931, 198, 198, 11748, 15095, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 28686, 198, 11748, 28034, 198, 11748, 28034, 10178, 198, 198, 11748, 3590, 268,...
2.468202
912
import sys import os import time import math from itertools import groupby import operator as op import numpy as np from scipy.cluster.hierarchy import dendrogram from scipy.cluster.hierarchy import linkage from scipy.cluster.hierarchy import fcluster import itertools import inspect import collections ...
[ 11748, 25064, 201, 198, 11748, 28686, 201, 198, 11748, 640, 201, 198, 11748, 10688, 201, 198, 6738, 340, 861, 10141, 1330, 1448, 1525, 201, 198, 11748, 10088, 355, 1034, 201, 198, 201, 198, 11748, 299, 32152, 355, 45941, 201, 198, 6738,...
1.610293
14,262
from server.modules import accounts import pickle """ Manages friend connections between users. """ class FriendManager: """ Gets a list of friends for a given user. """ """ Adds a user as a friend for a given user. """ """ Remove a user as a friend for a given user. """ ""...
[ 6738, 4382, 13, 18170, 1330, 5504, 198, 11748, 2298, 293, 628, 198, 37811, 198, 5124, 1095, 1545, 8787, 1022, 2985, 13, 198, 37811, 198, 4871, 9182, 13511, 25, 628, 220, 220, 220, 37227, 198, 220, 220, 220, 29620, 257, 1351, 286, 2460...
2.984962
133
import bokeh.plotting import bokeh.models.layouts import collections import numpy as np import warnings from ilv.utils import filter_dict from ilv.utils import list_of_dict_to_dict_of_list from ilv.utils import moving_average_1d np.random.seed(1) colors_10_indices = np.random.permutation(10) colors_255_indices = np....
[ 11748, 1489, 365, 71, 13, 29487, 889, 198, 11748, 1489, 365, 71, 13, 27530, 13, 10724, 5269, 198, 11748, 17268, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 14601, 198, 198, 6738, 4229, 85, 13, 26791, 1330, 8106, 62, 11600, 198, 67...
2.329001
3,693
_C=True _B=False _A=None import inspect,io,itertools,os,struct,sys from ._compat import DEFAULT_COLUMNS,get_winterm_size,isatty,strip_ansi,WIN from .exceptions import Abort from .exceptions import UsageError from .globals import resolve_color_default from .types import Choice from .types import convert_type from .types...
[ 62, 34, 28, 17821, 198, 62, 33, 28, 25101, 198, 62, 32, 28, 14202, 198, 11748, 10104, 11, 952, 11, 270, 861, 10141, 11, 418, 11, 7249, 11, 17597, 198, 6738, 47540, 5589, 265, 1330, 5550, 38865, 62, 25154, 5883, 8035, 11, 1136, 62,...
2.804781
251
# ~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ # MIT License # # Copyright (c) 2021 Nathan Juraj Michlo # # 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 Softwar...
[ 2, 220, 5299, 33813, 33813, 33813, 33813, 33813, 33813, 33813, 33813, 33813, 33813, 33813, 33813, 33813, 33813, 33813, 33813, 33813, 33813, 33813, 198, 2, 220, 17168, 13789, 198, 2, 198, 2, 220, 15069, 357, 66, 8, 33448, 18106, 23383, 122...
2.306135
1,679
from torchvision import transforms from torchvision.datasets import ImageFolder from torch.utils.data.dataloader import DataLoader from config import cfg import os import shutil def get_dataloader(path, shuffle=True): """ create a Dataloader of the images in the folder :param path: path containing the imag...
[ 6738, 28034, 10178, 1330, 31408, 198, 6738, 28034, 10178, 13, 19608, 292, 1039, 1330, 7412, 41092, 198, 6738, 28034, 13, 26791, 13, 7890, 13, 67, 10254, 1170, 263, 1330, 6060, 17401, 198, 6738, 4566, 1330, 30218, 70, 198, 11748, 28686, ...
2.390342
497
from .SLCT import *
[ 6738, 764, 8634, 4177, 1330, 1635 ]
3.166667
6
## # Part of `SmartNodeMonitorBot` # # Copyright 2018 dustinface # # 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,...
[ 2235, 198, 2, 2142, 286, 4600, 25610, 19667, 35479, 20630, 63, 198, 2, 198, 2, 15069, 2864, 8977, 259, 2550, 198, 2, 198, 2, 2448, 3411, 318, 29376, 7520, 11, 1479, 286, 3877, 11, 284, 597, 1048, 16727, 257, 4866, 198, 2, 286, 428...
3.192833
1,758
""" module docstring """ import os import sys import torch import glob from random import shuffle import numpy as np from PIL import Image from skimage import io from torch import nn from torch.autograd import Variable from torch.utils.data import Dataset, DataLoader from torchvision import models, transforms import ma...
[ 37811, 198, 21412, 2205, 8841, 198, 37811, 198, 11748, 28686, 198, 11748, 25064, 198, 11748, 28034, 198, 11748, 15095, 198, 6738, 4738, 1330, 36273, 198, 11748, 299, 32152, 355, 45941, 198, 6738, 350, 4146, 1330, 7412, 198, 6738, 1341, 90...
2.578612
1,412
""" Define an enum of all services to health check """ from .healthchecks.healthcheck import HealthCheck from .healthchecks import ElasticsearchHealthCheck, DpFastTextHealthCheck from enum import Enum
[ 37811, 198, 7469, 500, 281, 33829, 286, 477, 2594, 284, 1535, 2198, 198, 37811, 198, 6738, 764, 13948, 42116, 13, 13948, 9122, 1330, 3893, 9787, 198, 198, 6738, 764, 13948, 42116, 1330, 48567, 12947, 18081, 9787, 11, 360, 79, 22968, 820...
4
51
# ! /usr/bin/env python # -*- coding: utf-8 -*- from enum import Enum from tornado.web import HTTPError status_0 = dict(status_code=405, reason='Method not allowed.') status_1 = dict(status_code=404, reason='API not found.') # 示例相关 # 测试相关
[ 2, 5145, 1220, 14629, 14, 8800, 14, 24330, 21015, 198, 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 198, 6738, 33829, 1330, 2039, 388, 198, 6738, 33718, 13, 12384, 1330, 14626, 12331, 198, 198, 13376, 62, 15, 796, ...
2.330189
106
# -*- coding: utf-8 -*- # Part of BrowseInfo. See LICENSE file for full copyright and licensing details. from odoo import models, fields, api, _ from datetime import date,datetime # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:s
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 2, 2142, 286, 44775, 12360, 13, 4091, 38559, 24290, 2393, 329, 1336, 6634, 290, 15665, 3307, 13, 198, 198, 6738, 16298, 2238, 1330, 4981, 11, 7032, 11, 40391, 11, 4808, ...
2.964286
84
import cv2 as cv WIDTH = 400 HEIGHT = 300 ID_WIDTH = 3 ID_HEIGHT = 4 cap = cv.VideoCapture(0) cap.set(ID_WIDTH, WIDTH) cap.set(ID_HEIGHT, HEIGHT) face_engine = cv.CascadeClassifier('data/haarcascades/haarcascade_frontalface_default.xml') eye_engine = cv.CascadeClassifier('data/haarcascades/haarcascade_eye.xml') smile...
[ 11748, 269, 85, 17, 355, 269, 85, 198, 198, 54, 2389, 4221, 796, 7337, 198, 13909, 9947, 796, 5867, 198, 2389, 62, 54, 2389, 4221, 796, 513, 198, 2389, 62, 13909, 9947, 796, 604, 198, 11128, 796, 269, 85, 13, 10798, 49630, 7, 15, ...
2.394118
170
import numpy as np import cv2 import glob import matplotlib.pyplot as plt import find_lane_pixels_convolution def find_good_indexis_in_window(out_img, window_idx, nonzerox, nonzeroy, window_height, current_pos, margin=100, visu=False): ''' Calculate good (==nonzero) indices ins...
[ 11748, 299, 32152, 355, 45941, 198, 11748, 269, 85, 17, 198, 11748, 15095, 198, 11748, 2603, 29487, 8019, 13, 9078, 29487, 355, 458, 83, 198, 11748, 1064, 62, 33533, 62, 79, 14810, 62, 42946, 2122, 628, 198, 4299, 1064, 62, 11274, 62,...
2.452162
4,233
numero = [] while True: numeros = int(input('Digite um número ')) if numeros not in numero: numero.append(numeros) numero.sort() else: print('Valor duplicado! Ignorado') sn = str(input('Deseja continuar? [S/N]: ')) while not sn in 'SsNn': sn = str(input('Deseja contin...
[ 22510, 3529, 796, 17635, 198, 4514, 6407, 25, 198, 220, 220, 220, 5470, 418, 796, 493, 7, 15414, 10786, 19511, 578, 23781, 299, 21356, 647, 78, 705, 4008, 198, 220, 220, 220, 611, 5470, 418, 407, 287, 997, 3529, 25, 198, 220, 220, ...
2.048128
187
#Any image input no matter what scale it belongs, should through following steps that used for Image segmentation task #Including two parts: # 1. Segmentation training set prepare 8000->800->choose 5 label->label me # 2. Segmentation model predict from PIL import Image import cv2 import os import random import json ...
[ 2, 7149, 2939, 5128, 645, 2300, 644, 5046, 340, 14448, 11, 815, 832, 1708, 4831, 326, 973, 329, 7412, 10618, 341, 4876, 198, 198, 2, 818, 6360, 734, 3354, 25, 220, 198, 2, 352, 13, 1001, 5154, 341, 3047, 900, 8335, 38055, 3784, 74...
2.346793
421
import cv2 import numpy as np import torchvision # import albumentations from torch import Tensor from typing import Tuple import torchlm if __name__ == "__main__": print(torchlm.albumentations_is_available()) test_torchlm_transforms_pipeline() test_torchlm_transform_mask() test_torch...
[ 11748, 269, 85, 17, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 28034, 10178, 198, 2, 1330, 435, 65, 1713, 602, 198, 6738, 28034, 1330, 309, 22854, 198, 6738, 19720, 1330, 309, 29291, 198, 198, 11748, 28034, 75, 76, 628, 628, 628,...
2.443077
325
"""Run and interact with a Localstack container.""" import logging import os import string import time from copy import copy from packaging import version from pytest_localstack import ( constants, container, exceptions, plugin, service_checks, utils, ) logger = logging.getLogger(__name__) ...
[ 37811, 10987, 290, 9427, 351, 257, 10714, 25558, 9290, 526, 15931, 198, 11748, 18931, 198, 11748, 28686, 198, 11748, 4731, 198, 11748, 640, 198, 6738, 4866, 1330, 4866, 198, 198, 6738, 16846, 1330, 2196, 198, 198, 6738, 12972, 9288, 62, ...
2.323146
4,908
from rdkit import Chem from functools import partial from multiprocessing import Pool from fuseprop import find_clusters, extract_subgraph, get_mol, get_smiles, find_fragments from copy import deepcopy import numpy as np import torch import argparse from private import * from agent import sample
[ 6738, 374, 67, 15813, 1330, 12870, 198, 6738, 1257, 310, 10141, 1330, 13027, 198, 6738, 18540, 305, 919, 278, 1330, 19850, 198, 6738, 32738, 22930, 1330, 1064, 62, 565, 13654, 11, 7925, 62, 7266, 34960, 11, 651, 62, 43132, 11, 651, 62...
3.670732
82
#!/usr/bin/env python """ Apply a patch that adds Rust doc comments to bindgen-generated Rust source. To run unittests: python -m unittest -v add_doc_comments """ # pylint: disable=too-few-public-methods from __future__ import print_function import argparse import logging import re import unittest INDENT_PAT...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 198, 37811, 198, 44836, 257, 8529, 326, 6673, 17103, 2205, 3651, 284, 11007, 5235, 12, 27568, 17103, 2723, 13, 198, 198, 2514, 1057, 555, 715, 3558, 25, 198, 220, 220, 220, 21015, 532,...
2.302109
5,263
# Program to clean out the filesystem cache import numpy a = numpy.arange(1000 * 100 * 125, dtype='f8') # 100 MB of RAM b = a * 3 # Another 100 MB # delete the reference to the booked memory del a del b # Do a loop to fully recharge the python interpreter j = 2 for i in range(1000 * 1000): j += i * 2
[ 2, 6118, 284, 3424, 503, 262, 29905, 12940, 198, 11748, 299, 32152, 198, 198, 64, 796, 299, 32152, 13, 283, 858, 7, 12825, 1635, 1802, 1635, 13151, 11, 288, 4906, 11639, 69, 23, 11537, 220, 1303, 1802, 10771, 286, 13931, 198, 65, 79...
3.039216
102
#!/usr/bin/env python3 # Test code for functions that load halcon intrinsics and extrinsics from load_camera_info import * testDataPath = Path('data_for_unit_tests/extrinsics_for_testing') if __name__=='__main__': test_that_pose_types_are_consistent()
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 198, 2, 6208, 2438, 329, 5499, 326, 3440, 10284, 1102, 22496, 873, 290, 22820, 1040, 873, 198, 6738, 3440, 62, 25695, 62, 10951, 1330, 1635, 198, 198, 9288, 6601, 15235, 796, 10644...
2.877778
90
from __future__ import division import numpy as np from pydicom import dcmread from pydicom.filebase import DicomBytesIO from zipfile import ZipFile from torch.utils.data import Dataset from skimage.exposure import rescale_intensity import pandas as pd from scipy.ndimage import center_of_mass from dataset.processing...
[ 6738, 11593, 37443, 834, 1330, 7297, 198, 198, 11748, 299, 32152, 355, 45941, 198, 198, 6738, 279, 5173, 291, 296, 1330, 288, 11215, 961, 198, 6738, 279, 5173, 291, 296, 13, 7753, 8692, 1330, 360, 291, 296, 45992, 9399, 198, 6738, 199...
2.247557
1,228
import random import socket import time import math server = socket.socket() host = '127.0.0.1' port = 8000 server.bind((host, port)) print('Start on:', host, port) print('URL', (host, port)) server.listen(5) while True: conn, (client_host, client_port) = server.accept() print('Got connection', c...
[ 11748, 4738, 201, 198, 11748, 17802, 201, 198, 11748, 640, 201, 198, 11748, 10688, 201, 198, 201, 198, 15388, 796, 17802, 13, 44971, 3419, 201, 198, 4774, 796, 705, 16799, 13, 15, 13, 15, 13, 16, 6, 201, 198, 634, 796, 38055, 201, ...
2.334694
245
#!/usr/bin/env python # # Author: Hari Sekhon # Date: 2007-02-20 17:49:00 +0000 (Tue, 20 Feb 2007) # # http://github.com/harisekhon # # License: see accompanying LICENSE file # """Nagios plugin to test the state of all 3ware raid arrays and/or drives on all 3ware controllers on the local machine. Requires the t...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 2, 198, 2, 220, 6434, 25, 2113, 72, 37558, 24130, 198, 2, 220, 7536, 25, 4343, 12, 2999, 12, 1238, 1596, 25, 2920, 25, 405, 1343, 2388, 357, 41392, 11, 1160, 3158, 4343, 8, 198, ...
2.096541
7,458
import tensorflow as tf import model import shutil # Kerasのモデルを読み込む model = model.make() # ニューラルの重みを読み込む model.load_weights("weight.hdf5") # TensorFlowのセッションを取得 sess = tf.keras.backend.get_session() # SavedModelを出力 shutil.rmtree("saved_model/",True) tf.saved_model.simple_save(sess,"saved_model/", inputs={'input': ...
[ 11748, 11192, 273, 11125, 355, 48700, 198, 11748, 2746, 198, 11748, 4423, 346, 198, 198, 2, 17337, 292, 5641, 40361, 21959, 9202, 31758, 45739, 255, 2515, 123, 164, 122, 120, 1792, 222, 198, 19849, 796, 2746, 13, 15883, 3419, 198, 2, ...
2
190
#!/usr/bin/python3 # # Copyright 2021 Dustin Kleckner # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law ...
[ 2, 48443, 14629, 14, 8800, 14, 29412, 18, 198, 2, 198, 2, 15069, 33448, 37616, 15983, 694, 1008, 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,...
2.774664
1,784
from datetime import datetime from ..schema import BaseTransformer class Transformer(BaseTransformer): """Transform Utah raw data for consolidation.""" postal_code = "UT" fields = dict( company="Company Name", location="Location", notice_date="Date of Notice", jobs="Affec...
[ 6738, 4818, 8079, 1330, 4818, 8079, 198, 198, 6738, 11485, 15952, 2611, 1330, 7308, 8291, 16354, 628, 198, 4871, 3602, 16354, 7, 14881, 8291, 16354, 2599, 198, 220, 220, 220, 37227, 41762, 10202, 8246, 1366, 329, 31941, 526, 15931, 628, ...
2.189911
337
#encoding:utf8 ''' Created on 2016-4-5 @author: hadoop ''' import os # t.write(ll[1]) parse_ldac_to_mrslda()
[ 2, 12685, 7656, 25, 40477, 23, 198, 7061, 6, 198, 41972, 319, 1584, 12, 19, 12, 20, 198, 198, 31, 9800, 25, 550, 11224, 198, 7061, 6, 198, 11748, 28686, 198, 2, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, ...
1.703704
81
# Atharv Kolhar # Python Bytes """ Functions """ # Definition of Function # Use of function c = 10 d = 8 total = add(c, d) diff = subtract(c, d) print(total) print(diff) e = 30 f = 20 ef_total = add(e, f) ef_diff = subtract(e, f) print(ef_total, ef_diff) # End
[ 2, 13548, 283, 85, 25910, 9869, 198, 2, 11361, 2750, 4879, 198, 198, 37811, 198, 24629, 2733, 198, 37811, 198, 198, 2, 30396, 286, 15553, 628, 198, 2, 5765, 286, 2163, 198, 66, 796, 838, 198, 67, 796, 807, 198, 198, 23350, 796, 75...
2.277311
119
import numpy as np from abc import ABC import air_hockey.vector as V import air_hockey.phy_const as P # updates position and velocity # updates position and velocity
[ 11748, 299, 32152, 355, 45941, 198, 6738, 450, 66, 1330, 9738, 198, 11748, 1633, 62, 71, 8337, 13, 31364, 355, 569, 198, 11748, 1633, 62, 71, 8337, 13, 6883, 62, 9979, 355, 350, 628, 220, 220, 220, 1303, 5992, 2292, 290, 15432, 628,...
3.431373
51
import os import sys sys.path.append(os.path.join(os.path.dirname(__file__), "../")) import hug from typot.pull_request import PullRequest from typot.spell_checker import SpellChecker version = 1 @hug.get("/ping", versions=version) @hug.local() @hug.post("/typot", versions=version) @hug.local()
[ 11748, 28686, 198, 11748, 25064, 198, 17597, 13, 6978, 13, 33295, 7, 418, 13, 6978, 13, 22179, 7, 418, 13, 6978, 13, 15908, 3672, 7, 834, 7753, 834, 828, 366, 492, 30487, 4008, 198, 11748, 16225, 198, 6738, 2170, 313, 13, 31216, 62,...
2.72973
111
from pyamg import gallery, smoothed_aggregation_solver from numpy import ones from pylab import * A = gallery.poisson( (100,100), format='csr') ml = smoothed_aggregation_solver(A, smooth='simple') b = ones((A.shape[0],1)); res=[] x = ml.solve(b, tol=1e-8, residuals=res) semilogy(res[1:]) xlabel('iteration') ylabel('r...
[ 6738, 12972, 321, 70, 1330, 15604, 11, 32746, 704, 62, 9460, 43068, 62, 82, 14375, 198, 6738, 299, 32152, 1330, 3392, 198, 6738, 279, 2645, 397, 1330, 1635, 198, 198, 32, 796, 15604, 13, 7501, 30927, 7, 357, 3064, 11, 3064, 828, 579...
2.533333
135
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. import logging from typing import Dict, List, Optional, Tuple import torch from torch import Tensor from torch.nn import Module from .compressor import Compressor, LayerInfo _logger = logging.getLogger(__name__) __all__ = ['Pruner'] class ...
[ 2, 15069, 357, 66, 8, 5413, 10501, 13, 198, 2, 49962, 739, 262, 17168, 5964, 13, 198, 198, 11748, 18931, 198, 6738, 19720, 1330, 360, 713, 11, 7343, 11, 32233, 11, 309, 29291, 198, 198, 11748, 28034, 198, 6738, 28034, 1330, 309, 228...
2.33908
2,088
# -*- coding: utf-8 -*- """root link layer protocol :mod:`pcapkit.protocols.link.link` contains :class:`~pcapkit.protocols.link.link.Link`, which is a base class for link layer protocols, e.g. :class:`~pcapkit.protocols.link.link.arp.ARP`/InARP, :class:`~pcapkit.protocols.link.link.ethernet.Ethernet`, :class:`~pcapkit...
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 37811, 15763, 2792, 7679, 8435, 198, 198, 25, 4666, 25, 63, 79, 11128, 15813, 13, 11235, 4668, 82, 13, 8726, 13, 8726, 63, 4909, 1058, 4871, 25, 63, 93, 79, 11128, 1...
2.545132
1,972
# -*- coding: utf-8 -*- #--------------------------------------------------------------------------- # Copyright 2019 VMware, Inc. All rights reserved. # AUTO GENERATED FILE -- DO NOT MODIFY! # # vAPI stub file for package com.vmware.vapi.metadata. #--------------------------------------------------------------------...
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 2, 10097, 32284, 198, 2, 15069, 13130, 37754, 11, 3457, 13, 220, 1439, 2489, 10395, 13, 198, 198, 2, 47044, 46, 24700, 1137, 11617, 45811, 1377, 8410, 5626, 19164, 5064,...
2.547024
2,722
__copyright__ = "Copyright (C) 2021 Andreas Andersson" import unittest, datetime, os from levelmodel import LevelModel TEST_DB = "test_pelletmeter.db" class TestLevelModel(unittest.TestCase): """Unit tests for the levelmodel.py module.""" @classmethod class TimeStamp: """Class to produce fake timestamp...
[ 834, 22163, 4766, 834, 796, 366, 15269, 357, 34, 8, 33448, 33728, 25519, 1559, 1, 198, 198, 11748, 555, 715, 395, 11, 4818, 8079, 11, 28686, 198, 6738, 1241, 19849, 1330, 5684, 17633, 198, 198, 51, 6465, 62, 11012, 796, 366, 9288, 6...
2.626327
471
#!/usr/bin/env python3 # -*- coding: utf-8 -*- if __name__ == '__main__': with open('text.txt', 'r', encoding="utf8") as f: text = f.read() # Заменить символы конца предложения. text = text.replace("!", ".") text = text.replace("?", ".") # Удалить все многоточия. while ".....
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 201, 198, 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 201, 198, 201, 198, 361, 11593, 3672, 834, 6624, 705, 834, 12417, 834, 10354, 201, 198, 220, 220, 220, 351, 1280,...
1.632184
435
from os import remove from os.path import isfile from tempfile import NamedTemporaryFile from unittest import TestCase from opwen_email_server.utils import temporary
[ 6738, 28686, 1330, 4781, 198, 6738, 28686, 13, 6978, 1330, 318, 7753, 198, 6738, 20218, 7753, 1330, 34441, 12966, 5551, 8979, 198, 6738, 555, 715, 395, 1330, 6208, 20448, 198, 198, 6738, 1034, 21006, 62, 12888, 62, 15388, 13, 26791, 133...
3.840909
44
#!/usr/bin/python # #The MIT CorrelX Correlator # #https://github.com/MITHaystack/CorrelX #Contact: correlX@haystack.mit.edu #Project leads: Victor Pankratius, Pedro Elosegui Project developer: A.J. Vazquez Alvarez # #Copyright 2017 MIT Haystack Observatory # #Permission is hereby granted, free of charge, to any person...
[ 2, 48443, 14629, 14, 8800, 14, 29412, 198, 2, 198, 2, 464, 17168, 2744, 2411, 55, 2744, 2411, 1352, 198, 2, 198, 2, 5450, 1378, 12567, 13, 785, 14, 44, 10554, 323, 25558, 14, 10606, 2411, 55, 198, 2, 17829, 25, 10895, 55, 31, 71...
2.262163
11,058
from .CalcBSRss import CalcBSRss from .GetBSCrossings import GetBSCrossings from .GetSolarWindTimes import GetSolarWindTimes from .OverlayBS import OverlayBS
[ 6738, 764, 9771, 66, 4462, 49, 824, 1330, 2199, 66, 4462, 49, 824, 198, 6738, 764, 3855, 4462, 21544, 654, 1330, 3497, 4462, 21544, 654, 198, 6738, 764, 3855, 38825, 8731, 28595, 1330, 3497, 38825, 8731, 28595, 198, 6738, 764, 5886, 1...
3.291667
48
# This version number is stored here instead of in `__init__.py` because # namespace packages and the packages which live inside them can be imported # in any order, which means their contents are supposed to be identical. If # their contents differ, Python makes no guarantee about which one is loaded. # # See https://...
[ 2, 770, 2196, 1271, 318, 8574, 994, 2427, 286, 287, 4600, 834, 15003, 834, 13, 9078, 63, 780, 198, 2, 25745, 10392, 290, 262, 10392, 543, 2107, 2641, 606, 460, 307, 17392, 198, 2, 287, 597, 1502, 11, 543, 1724, 511, 10154, 389, 43...
3.697248
109
import pytest @pytest.fixture
[ 11748, 12972, 9288, 628, 198, 198, 31, 9078, 9288, 13, 69, 9602, 198 ]
2.538462
13
"""This file contains all constant definitions .. moduleauthor:: Lan Hongjian <lanhongjianlr@gmail.com> .. moduleauthor:: Yamei Ou <oym111@gmail.com> .. moduleauthor:: Samuel Richerd <dondiego152@gmail.com> .. moduleauthor:: Jan Van Bruggen <jancvanbruggen@gmail.com> .. moduleauthor:: Junlin Zhang <neicullyn@gmail.com...
[ 37811, 1212, 2393, 4909, 477, 6937, 17336, 198, 198, 492, 8265, 9800, 3712, 14730, 9764, 73, 666, 1279, 9620, 71, 506, 73, 666, 14050, 31, 14816, 13, 785, 29, 198, 492, 8265, 9800, 3712, 575, 480, 72, 42201, 1279, 726, 76, 16243, 31...
2.949206
630
import logging import os import pandas as pd from glob import glob from pathlib import Path, PosixPath, WindowsPath from ekorpkit.utils.func import elapsed_timer log = logging.getLogger(__name__)
[ 11748, 18931, 198, 11748, 28686, 198, 11748, 19798, 292, 355, 279, 67, 198, 6738, 15095, 1330, 15095, 198, 6738, 3108, 8019, 1330, 10644, 11, 18574, 844, 15235, 11, 3964, 15235, 198, 6738, 304, 74, 16300, 15813, 13, 26791, 13, 20786, 13...
3.306452
62
# # andre@corp.insite.com.br # 2017-10-10 # Codigo que faz regressao simples e encontra embeddings # # a ideia aqui e a seguinte: # - carregar dados do movielens # - inicializar o embedding de forma aleatoria # - encontrar os embeddings de filmes e de usuarios que gerem o menor erro possivel # from __future__ impo...
[ 2, 198, 2, 290, 260, 31, 10215, 79, 13, 1040, 578, 13, 785, 13, 1671, 198, 2, 2177, 12, 940, 12, 940, 198, 2, 18720, 14031, 8358, 277, 1031, 50252, 5488, 985, 2374, 304, 2207, 756, 430, 11525, 67, 654, 198, 2, 198, 2, 257, 140...
2.327843
2,489
import torch import torchvision import torch.autograd as autograd import model import autoencoder import util import os
[ 11748, 28034, 198, 11748, 28034, 10178, 198, 11748, 28034, 13, 2306, 519, 6335, 355, 1960, 519, 6335, 198, 11748, 2746, 198, 11748, 1960, 6571, 66, 12342, 198, 11748, 7736, 198, 11748, 28686, 628 ]
3.666667
33
import io import numpy as np import tensorflow as tf import cv2 from flask import Flask, request, send_file, jsonify from UGATIT import UGATIT from main import parse_args from utils import inverse_transform, show_all_variables, merge with tf.Session(config=tf.ConfigProto(allow_soft_placement=True)) as sess: ...
[ 11748, 33245, 198, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 11192, 273, 11125, 355, 48700, 198, 11748, 269, 85, 17, 198, 6738, 42903, 1330, 46947, 11, 2581, 11, 3758, 62, 7753, 11, 33918, 1958, 198, 198, 6738, 471, 38, 1404, 20...
2.442786
402
from django.db import models from django.core.files.storage import FileSystemStorage from django.conf import settings media_storage = FileSystemStorage( location=f'{settings.BASE_DIR}/media/', base_url=f'/media/' )
[ 6738, 42625, 14208, 13, 9945, 1330, 4981, 198, 6738, 42625, 14208, 13, 7295, 13, 16624, 13, 35350, 1330, 9220, 11964, 31425, 198, 6738, 42625, 14208, 13, 10414, 1330, 6460, 628, 628, 628, 628, 198, 198, 11431, 62, 35350, 796, 9220, 1196...
2.949367
79
# VMware vSphere Python SDK # Copyright (c) 2008-2014 VMware, 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 # # ...
[ 2, 37754, 410, 38882, 11361, 26144, 198, 2, 15069, 357, 66, 8, 3648, 12, 4967, 37754, 11, 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...
3.882075
212
# encoding: utf-8 from __future__ import division, print_function, unicode_literals ########################################################################################################### # # # Palette Plugin # # Read the docs: # https://github.com/schriftgestalt/GlyphsSDK/tree/master/Python%20Templates/Palette # ...
[ 2, 21004, 25, 3384, 69, 12, 23, 198, 6738, 11593, 37443, 834, 1330, 7297, 11, 3601, 62, 8818, 11, 28000, 1098, 62, 17201, 874, 198, 198, 29113, 29113, 29113, 7804, 21017, 198, 2, 198, 2, 198, 2, 197, 11531, 5857, 42636, 198, 2, 19...
4.264463
121
from ..lib.service import Service
[ 6738, 11485, 8019, 13, 15271, 1330, 4809, 628 ]
4.375
8
from Tikzifyables.Colourable.Colourable import Colourable
[ 6738, 46338, 89, 1958, 2977, 13, 5216, 454, 540, 13, 5216, 454, 540, 1330, 38773, 540, 628 ]
3.470588
17
################ """ sb_convertFootage Simon Bjork August 2014 bjork.simon@gmail.com Version 1.3 (May 2015) Synopsis: Speed up the process of converting footage (Read nodes) to another format/resolution/colorspace/naming convention. OS: Windows/OSX/Linux CAUTION: The script uses the Python threading module,...
[ 14468, 198, 198, 37811, 198, 197, 36299, 62, 1102, 1851, 17574, 496, 198, 197, 35475, 34254, 967, 198, 197, 17908, 1946, 198, 197, 50007, 967, 13, 14323, 261, 31, 14816, 13, 785, 198, 197, 14815, 352, 13, 18, 357, 6747, 1853, 8, 628...
2.792308
1,300
import sys import glob import bladapter as bl _, pathin, pathout = sys.argv top_contigs = bl.load_contigs(pathin) names = {contig.species:contig.name for contig in top_contigs} files = {spec:glob.glob('../wgot/fastas/*{}*'.format(spec))[0] for spec in bl.spec_list} for contig in top_contigs: whole_file = open(...
[ 11748, 25064, 198, 11748, 15095, 198, 11748, 698, 324, 3429, 355, 698, 198, 198, 62, 11, 3108, 259, 11, 3108, 448, 796, 25064, 13, 853, 85, 198, 198, 4852, 62, 3642, 9235, 796, 698, 13, 2220, 62, 3642, 9235, 7, 6978, 259, 8, 198, ...
2.32
300
from gamma_functions import * import numpy as np from scipy.optimize import brentq import scipy.integrate as integrate # mu = \int_0^1 x f_ab(x) dx # Given mu,a what is b? mu = 0.1 a_ns = [] b_ns = [] for a in np.logspace(np.log10(0.2),np.log10(98),500): a_ns.append(a) b = brentq(root_f, 0.5*mu/a, 5*...
[ 198, 6738, 34236, 62, 12543, 2733, 1330, 1635, 198, 198, 11748, 299, 32152, 355, 45941, 198, 6738, 629, 541, 88, 13, 40085, 1096, 1330, 275, 1156, 80, 220, 198, 11748, 629, 541, 88, 13, 18908, 4873, 355, 19386, 198, 198, 2, 38779, 7...
1.99537
216
#!/usr/bin/env python3 import socket import unittest import struct import random from framework import tag_fixme_vpp_workers from framework import VppTestCase, VppTestRunner import scapy.compat from scapy.layers.inet import IP, TCP, UDP, ICMP from scapy.layers.inet import IPerror, TCPerror, UDPerror, ICMPerror from ...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 198, 11748, 17802, 198, 11748, 555, 715, 395, 198, 11748, 2878, 198, 11748, 4738, 198, 198, 6738, 9355, 1330, 7621, 62, 13049, 1326, 62, 85, 381, 62, 22896, 198, 6738, 9355, 1330, ...
1.93136
5,405
#!/usr/bin/env python # -*- coding: utf-8 -*- __title__ = 'modlist' __version__ = '0.1' __author__ = '@c0ding' __repo__ = 'https://github.com/c0ding/modlist-api' __license__ = 'Apache v2.0 License' MODLIST_ENTRYPOINT = 'http://modlist.mcf.li/api/v3/' def entrypoint(*suffix): """ Returns the entrypoint URL for the ...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 198, 834, 7839, 834, 796, 705, 4666, 4868, 6, 198, 834, 9641, 834, 796, 705, 15, 13, 16, 6, 198, 834, 9800, 834, ...
2.352632
190
"""Script that scrapes the global Spotify playlist 'new music friday'. 100 newly released tracks are fetched from the playlist and enriched with additional features obtained via the Spotify API. """ import logging import time from datetime import datetime from typing import List, Tuple import pandas as pd import spo...
[ 37811, 7391, 326, 15881, 274, 262, 3298, 26778, 33178, 705, 3605, 2647, 1216, 2567, 4458, 198, 198, 3064, 8308, 2716, 8339, 389, 11351, 1740, 422, 262, 33178, 290, 35601, 198, 4480, 3224, 3033, 6492, 2884, 262, 26778, 7824, 13, 198, 378...
2.301419
4,721
from datasets import load_dataset datasets = load_dataset("katanaml/cord") # example = datasets["validation"][1] # from PIL import Image, ImageDraw, ImageFont image = Image.open(example['image_path']) image = image.convert("RGB") # from transformers import LayoutLMv2Processor processor = LayoutLMv2Processor.fr...
[ 6738, 40522, 1330, 3440, 62, 19608, 292, 316, 198, 198, 19608, 292, 1039, 796, 3440, 62, 19608, 292, 316, 7203, 74, 39036, 43695, 14, 66, 585, 4943, 198, 198, 2, 198, 198, 20688, 796, 40522, 14692, 12102, 341, 1, 7131, 16, 60, 198, ...
2.72235
868
# -*- coding: utf-8 -*- from __future__ import print_function from __future__ import unicode_literals from __future__ import division from django.contrib.auth.models import User from django.test import TestCase from rest_framework.test import APIClient
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 6738, 11593, 37443, 834, 1330, 3601, 62, 8818, 198, 6738, 11593, 37443, 834, 1330, 28000, 1098, 62, 17201, 874, 198, 6738, 11593, 37443, 834, 1330, 7297, 198, 198, 6738, ...
3.324675
77
#!/usr/bin/env python print "Content-type: text/html\n\n" print "<html>Hello world!</html>"
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 198, 4798, 366, 19746, 12, 4906, 25, 2420, 14, 6494, 59, 77, 59, 77, 1, 198, 4798, 33490, 6494, 29, 15496, 995, 0, 3556, 6494, 24618, 198 ]
2.583333
36