content
stringlengths
1
1.04M
input_ids
listlengths
1
774k
ratio_char_token
float64
0.38
22.9
token_count
int64
1
774k
# list(map(int, input().split())) # int(input()) if __name__ == '__main__': N = int(input()) main(N)
[ 2, 1351, 7, 8899, 7, 600, 11, 5128, 22446, 35312, 3419, 4008, 198, 2, 493, 7, 15414, 28955, 628, 198, 361, 11593, 3672, 834, 6624, 705, 834, 12417, 834, 10354, 198, 220, 220, 220, 399, 796, 493, 7, 15414, 28955, 198, 220, 220, 220...
2.265306
49
"""/usr/bin/python $ Filename :controlbeep.py $ Description :If KEY_4 is pressed,this script will be executed $ Author :alan $ Website :www.osoyoo.com $ Update :2017/07/07 $ $ """ import RPi.GPIO as GPIO PIN = 23 GPIO.setmode(GPIO.BCM) GPIO.setwarnings(F...
[ 37811, 14, 14629, 14, 8800, 14, 29412, 198, 3, 220, 220, 220, 220, 220, 7066, 12453, 220, 220, 220, 220, 220, 1058, 13716, 1350, 538, 13, 9078, 198, 3, 220, 220, 220, 220, 220, 12489, 220, 220, 1058, 1532, 35374, 62, 19, 318, 1207...
2.011321
265
""" fwks.tasks ========== Module responsible for scheduling the computations. Each type of task may be configured and then run in sequence. Useful for creation of batches of jobs. """ __all__ = ["Task", "make_training_task", "make_ab_feature_test", "make_feature_learnability"] import keras import numpy as np import ...
[ 37811, 198, 44482, 591, 13, 83, 6791, 198, 2559, 855, 198, 198, 26796, 4497, 329, 26925, 262, 2653, 602, 13, 5501, 2099, 286, 4876, 743, 307, 17839, 290, 788, 1057, 287, 8379, 13, 198, 11041, 913, 329, 6282, 286, 37830, 286, 3946, 1...
2.842025
652
#!/usr/bin/env python import importlib import argparse import sys import signal from subprocess import call # parse command line arguments parser = argparse.ArgumentParser() parser.add_argument("--cfg", help="path to hyperparameter config file", type=str) parser.add_argument("--render", help="render agent", action="s...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 198, 11748, 1330, 8019, 198, 11748, 1822, 29572, 198, 11748, 25064, 198, 11748, 6737, 198, 6738, 850, 14681, 1330, 869, 198, 198, 2, 21136, 3141, 1627, 7159, 198, 48610, 796, 1822, 29572...
3.020583
583
# -*- coding: utf-8 -*- """ Created on Thu Feb 22 10:23:18 2018 @author: gy17mjk """ import sqlite3 conn = sqlite3.connect('resultsdb.sqlite') c = conn.cursor() c.execute("CREATE TABLE Results (address text, burglaries integer)") c.execute("INSERT INTO Results VALUES ('Queen Vic',2)") conn.commit() conn.close()
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 37811, 198, 41972, 319, 26223, 3158, 2534, 838, 25, 1954, 25, 1507, 2864, 198, 198, 31, 9800, 25, 21486, 1558, 76, 73, 74, 198, 37811, 198, 198, 11748, 44161, 578, 18,...
2.73913
115
# -*- coding: utf-8 -*- ############################################################################### # # Query # Access DuckDuckGo web search functionality. # # Python versions 2.6, 2.7, 3.x # # Copyright 2014, Temboo Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this ...
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 198, 29113, 29113, 7804, 4242, 21017, 198, 2, 198, 2, 43301, 198, 2, 8798, 21867, 35, 1347, 5247, 3992, 2989, 11244, 13, 220, 220, 198, 2, 198, 2, 11361, 6300, 362, ...
3.045788
1,092
"""Path routing-based tests fixtures.""" import pytest from testsuite import rawobj from testsuite.gateways.apicast.selfmanaged import SelfManagedApicast from testsuite.utils import blame def delete_all_mapping_rules(proxy): """Deletes all mapping rules in a given proxy.""" mapping_rules = proxy.mapping_rule...
[ 37811, 15235, 28166, 12, 3106, 5254, 34609, 526, 15931, 198, 11748, 12972, 9288, 198, 198, 6738, 1332, 2385, 578, 1330, 8246, 26801, 198, 6738, 1332, 2385, 578, 13, 10494, 1322, 13, 499, 291, 459, 13, 944, 39935, 1330, 12189, 5124, 1886...
2.885536
961
import requests import json, os url = "{0}:{1}".format(os.environ['HOSTNAME'] , "8000") resp = requests.post('http://' + url + '/api/v1/type/service/botbuilder/def/', json={ "cb_id" : "cb0001", "chat_cate" : "EP", "chat_sub_ca...
[ 11748, 7007, 198, 11748, 33918, 11, 28686, 198, 6371, 796, 45144, 15, 92, 29164, 16, 92, 1911, 18982, 7, 418, 13, 268, 2268, 17816, 39, 10892, 20608, 20520, 837, 366, 33942, 4943, 198, 198, 4363, 796, 7007, 13, 7353, 10786, 4023, 1378...
1.650964
467
from flask import ( Blueprint, render_template, session, make_response, request, redirect, url_for, ) from .. import orm module = Blueprint('index', __name__, url_prefix='/') @module.route('/', methods=['GET'])
[ 6738, 42903, 1330, 357, 198, 220, 220, 220, 39932, 11, 198, 220, 220, 220, 8543, 62, 28243, 11, 198, 220, 220, 220, 6246, 11, 198, 220, 220, 220, 787, 62, 26209, 11, 198, 220, 220, 220, 2581, 11, 198, 220, 220, 220, 18941, 11, 1...
2.574468
94
# coding: utf-8 #------------------------------------------------------------------------------------------# # This file is part of Pyccel which is released under MIT License. See the LICENSE file or # # go to https://github.com/pyccel/pyccel/blob/master/LICENSE for full license details. # #------------------------...
[ 2, 19617, 25, 3384, 69, 12, 23, 198, 2, 10097, 22369, 438, 2, 198, 2, 770, 2393, 318, 636, 286, 9485, 66, 5276, 543, 318, 2716, 739, 17168, 13789, 13, 4091, 262, 38559, 24290, 2393, 393, 1303, 198, 2, 467, 284, 3740, 1378, 12567, ...
2.218818
8,258
import motor.motor_asyncio from bson.objectid import ObjectId MONGO_DETAILS = "mongodb://localhost:27017" client = motor.motor_asyncio.AsyncIOMotorClient(MONGO_DETAILS) database = client.review_db review_collection = database.get_collection("reviews") # Retrieve all businesses present in the database
[ 11748, 5584, 13, 76, 20965, 62, 292, 13361, 952, 198, 6738, 275, 1559, 13, 15252, 312, 1330, 9515, 7390, 628, 198, 27857, 11230, 62, 35, 20892, 45484, 796, 366, 31059, 375, 65, 1378, 36750, 25, 1983, 29326, 1, 198, 16366, 796, 5584, ...
3.14433
97
"""Utilities that help with wrapping various C structures.""" import copy import glob import h5py import logging import numpy as np import warnings from cffi import FFI from hashlib import md5 from os import makedirs, path from pathlib import Path from . import __version__ from ._cfg import config _ffi = FFI() logge...
[ 37811, 18274, 2410, 326, 1037, 351, 27074, 2972, 327, 8573, 526, 15931, 198, 11748, 4866, 198, 11748, 15095, 198, 11748, 289, 20, 9078, 198, 11748, 18931, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 14601, 198, 6738, 269, 487, 72, 1...
2.263716
13,397
import pathlib import pandas as pd import pytest import taxes.download as dload from taxes.loading import ( # noqa: E501 dload_to_df_list, get_gov_dir, gov_dir_to_names_dict, names_dict_to_df_dict, ) gov_dir = { 2019: ( [ "https://www.gov.pl/attachment/6594af94-cd1e-49fb-9149-...
[ 11748, 3108, 8019, 198, 198, 11748, 19798, 292, 355, 279, 67, 198, 11748, 12972, 9288, 198, 11748, 5704, 13, 15002, 355, 288, 2220, 198, 6738, 5704, 13, 25138, 1330, 357, 220, 1303, 645, 20402, 25, 412, 33548, 198, 220, 220, 220, 288,...
1.717547
1,533
# -*- coding: utf-8 -*- import sys from typing import List import time import datetime from .exceptions import NotEnoughValuesError, UnrecognizedFlagError # MIT License # # Copyright (c) 2019-2020 karx1 # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associate...
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 628, 198, 11748, 25064, 198, 6738, 19720, 1330, 7343, 198, 11748, 640, 198, 11748, 4818, 8079, 198, 6738, 764, 1069, 11755, 1330, 1892, 47323, 40161, 12331, 11, 791, 26243, 114...
2.500886
2,258
import unittest from tropopause import Tags as BaseTags from tropopause.ec2 import InternetGatewayVPC, PublicSubnet from tropopause.autoscaling import AutoScalingGroup, LaunchConfigurationRPM from troposphere import Ref, Template from troposphere.autoscaling import LaunchConfiguration, Tag class TestAutoscaling(unit...
[ 11748, 555, 715, 395, 198, 198, 6738, 14673, 404, 682, 1330, 44789, 355, 7308, 36142, 198, 6738, 14673, 404, 682, 13, 721, 17, 1330, 4455, 22628, 1014, 53, 5662, 11, 5094, 7004, 3262, 198, 6738, 14673, 404, 682, 13, 2306, 17500, 4272,...
3.67619
105
import subprocess
[ 11748, 850, 14681, 628, 628 ]
4.2
5
import argparse import logging import utils # noqa: F401 Keep for django_hack from apps.noclook.models import NodeType, NodeHandle from actstream.models import Action logger = logging.getLogger('noclook_cleanup_peering_partners') if __name__ == '__main__': if not len(logger.handlers): logger.propaga...
[ 11748, 1822, 29572, 198, 11748, 18931, 198, 11748, 3384, 4487, 220, 1303, 645, 20402, 25, 376, 21844, 9175, 329, 42625, 14208, 62, 31153, 198, 6738, 6725, 13, 77, 420, 5460, 13, 27530, 1330, 19081, 6030, 11, 19081, 37508, 198, 6738, 719...
2.644898
245
""" @project : pyrgbdev @author : Gooday2die @date : 2022-02-13 @file : RainbowAll.py """ import threading import time from pyrgbdev import All from abstractDemo import AbstractDemo if __name__ == '__main__': sdk_object = All.sdk() sdk_object.connect() rainbow_all = Demo() rainbow_all.run(sdk_objec...
[ 37811, 198, 31, 16302, 1058, 279, 2417, 22296, 7959, 198, 31, 9800, 1058, 4599, 323, 17, 11979, 198, 31, 4475, 1058, 33160, 12, 2999, 12, 1485, 198, 31, 7753, 1058, 19909, 3237, 13, 9078, 198, 37811, 198, 11748, 4704, 278, 198, 11748,...
2.558824
136
frase = str (input ('Digite uma frase: ')).strip().upper() palavras = frase.split() junto = ''.join(palavras) inverso = '' for letra in range (len(junto) -1, -1, -1): inverso += junto[letra] if inverso == junto: print ('A frase digitada é um palindromo') else: print ('A frase digitada não é um palindromo'...
[ 8310, 589, 796, 965, 357, 15414, 220, 19203, 19511, 578, 220, 334, 2611, 1216, 589, 25, 705, 29720, 36311, 22446, 45828, 3419, 198, 18596, 615, 8847, 796, 1216, 589, 13, 35312, 3419, 198, 29741, 1462, 796, 705, 4458, 22179, 7, 18596, ...
2.402985
134
import numpy as np from src.bandit_algorithms.bandit_learner import BanditLearner # n_arms = number of arms the learner can pull. # Select which arm to pull by sampling beta distribution. # We select the max value from the values sampled. # pulled_arm = arm pulled. # reward = reward of arm pulle...
[ 11748, 299, 32152, 355, 45941, 198, 198, 6738, 12351, 13, 3903, 270, 62, 282, 7727, 907, 13, 3903, 270, 62, 3238, 1008, 1330, 10243, 270, 14961, 1008, 628, 220, 220, 220, 1303, 299, 62, 8357, 796, 1271, 286, 5101, 262, 22454, 1008, ...
3.23
100
from .causal_graph import CausalGraph from .transition_system import FiniteTransitionSystem
[ 6738, 764, 6888, 6775, 62, 34960, 1330, 6488, 6775, 37065, 198, 6738, 764, 7645, 653, 62, 10057, 1330, 4463, 578, 8291, 653, 11964 ]
3.956522
23
#!/usr/bin/env python3 # Copyright 2021 - 2022 Universität Tübingen, DKFZ and EMBL # for the German Human Genome-Phenome Archive (GHGA) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # ...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 198, 2, 15069, 33448, 532, 33160, 26986, 270, 11033, 83, 309, 9116, 4623, 268, 11, 32975, 37, 57, 290, 17228, 9148, 198, 2, 329, 262, 2679, 5524, 5215, 462, 12, 47, 831, 462, 2...
2.780504
1,467
import os import io from setuptools import setup, find_packages from os import path from io import open setup( # This is the name of your project. The first time you publish this # package, this name will be registered for you. It will determine how # users can install this project, e.g.: # # $ pip...
[ 11748, 28686, 198, 11748, 33245, 198, 6738, 900, 37623, 10141, 1330, 9058, 11, 1064, 62, 43789, 198, 6738, 28686, 1330, 3108, 198, 6738, 33245, 1330, 1280, 198, 198, 40406, 7, 198, 220, 220, 220, 1303, 770, 318, 262, 1438, 286, 534, 1...
2.871739
460
# -*- coding: utf-8 -*- """ This module """ import attr import typing from ..core.model import ( Property, Resource, Tag, GetAtt, TypeHint, TypeCheck, ) from ..core.constant import AttrMeta #--- Property declaration --- @attr.s class PropDBProxyTargetGroupConnectionPoolConfigurationInfoFormat(Property): ""...
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 198, 37811, 198, 1212, 8265, 198, 37811, 198, 198, 11748, 708, 81, 198, 11748, 19720, 198, 198, 6738, 11485, 7295, 13, 19849, 1330, 357, 198, 220, 220, 220, 14161, 11, ...
2.571292
46,155
import json from compas_singular.datastructures import CoarseQuadMesh from compas_plotters.meshplotter import MeshPlotter # read input data json_data = 'data/coarse_quad_mesh_british_museum.json' coarse_quad_mesh = CoarseQuadMesh.from_json(json_data) # plot coarse quad mesh plotter = MeshPlotter(coarse_quad_mesh, ...
[ 11748, 33918, 198, 198, 6738, 552, 292, 62, 12215, 934, 13, 19608, 459, 1356, 942, 1330, 1766, 17208, 4507, 324, 37031, 198, 198, 6738, 552, 292, 62, 29487, 1010, 13, 76, 5069, 29487, 353, 1330, 47529, 43328, 353, 198, 198, 2, 1100, ...
2.601463
547
from ..bases import BaseParser from collections import defaultdict __all__ = ['ReactionsParser']
[ 6738, 11485, 65, 1386, 1330, 7308, 46677, 198, 6738, 17268, 1330, 4277, 11600, 198, 198, 834, 439, 834, 796, 37250, 3041, 4658, 46677, 20520, 628 ]
3.96
25
#!/usr/bin/env python import argparse import datetime import json import os import feedparser import httplib2 import requests import dateutil.parser from apiclient import discovery from oauth2client import client from oauth2client import tools from oauth2client.file import Storage from lib.bottle import ( defa...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 198, 11748, 1822, 29572, 198, 11748, 4818, 8079, 198, 11748, 33918, 198, 11748, 28686, 198, 198, 11748, 3745, 48610, 198, 11748, 1841, 489, 571, 17, 198, 11748, 7007, 198, 198, 11748, 31...
2.595395
912
""" Revolve body generator based on RoboGen framework """ import yaml import traceback from collections import OrderedDict from pyrevolve import SDF from .revolve_module import CoreModule, Orientation from .brain import Brain, BrainNN, BrainRLPowerSplines from .render.render import Render from .render.brain_graph im...
[ 37811, 198, 18009, 6442, 1767, 17301, 1912, 319, 39702, 13746, 9355, 198, 37811, 198, 11748, 331, 43695, 198, 11748, 12854, 1891, 198, 6738, 17268, 1330, 14230, 1068, 35, 713, 198, 198, 6738, 12972, 18218, 6442, 1330, 311, 8068, 198, 198,...
2.183846
3,900
"""only needed post torch 1.10 updates patches improvements that allow us to handle tensordicts """ import torch import re import collections from torch._six import string_classes np_str_obj_array_pattern = re.compile(r'[SaUO]') default_collate_err_msg_format = ( "default_collate: batch must contain tensors, n...
[ 37811, 8807, 2622, 1281, 28034, 352, 13, 940, 5992, 16082, 8561, 326, 1249, 514, 284, 5412, 11192, 585, 14137, 198, 37811, 198, 198, 11748, 28034, 198, 11748, 302, 198, 11748, 17268, 198, 6738, 28034, 13557, 19412, 1330, 4731, 62, 37724, ...
2.39307
1,847
from pathlib import Path import configparser import logging import flask import pymongo from datetime import datetime, timedelta import numpy as np from iqmon import get_webpage_config, get_all_configs from iqmon.webpage import mongo_query from iqmon.webpage.weather_plot import generate_weather_plot from iqmon.webpage...
[ 6738, 3108, 8019, 1330, 10644, 198, 11748, 4566, 48610, 198, 11748, 18931, 198, 11748, 42903, 198, 11748, 279, 4948, 25162, 198, 6738, 4818, 8079, 1330, 4818, 8079, 11, 28805, 12514, 198, 11748, 299, 32152, 355, 45941, 198, 198, 6738, 131...
4.534694
490
import logging import databases import sqlalchemy from app.settings import DATABASE_URL log = logging.getLogger(__name__) db = databases.Database(DATABASE_URL) metadata = sqlalchemy.MetaData()
[ 11748, 18931, 198, 198, 11748, 20083, 198, 11748, 44161, 282, 26599, 198, 198, 6738, 598, 13, 33692, 1330, 360, 1404, 6242, 11159, 62, 21886, 198, 198, 6404, 796, 18931, 13, 1136, 11187, 1362, 7, 834, 3672, 834, 8, 198, 198, 9945, 796...
3.061538
65
from kinorrt.mechanics.mechanics import * from kinorrt.mechanics.stability_margin import * #import wrenchStampingLib as ws smsolver = StabilityMarginSolver() h_modes = np.array([[CONTACT_MODE.STICKING, CONTACT_MODE.STICKING], [CONTACT_MODE.SLIDING_RIGHT, CONTACT_MODE.SLIDING_RIGHT], ...
[ 6738, 18967, 273, 17034, 13, 1326, 3147, 873, 13, 1326, 3147, 873, 1330, 1635, 198, 6738, 18967, 273, 17034, 13, 1326, 3147, 873, 13, 301, 1799, 62, 36153, 1330, 1635, 198, 2, 11748, 34561, 1273, 37843, 25835, 355, 266, 82, 198, 198, ...
1.954657
816
from django.db import models from django.utils import timezone from django.contrib.auth.models import User from django.urls import reverse from taggit.managers import TaggableManager # Published custom post manager model # Returns the QuerySet that will be executed / custom manager # Post model # Comment mode...
[ 6738, 42625, 14208, 13, 9945, 1330, 4981, 198, 6738, 42625, 14208, 13, 26791, 1330, 640, 11340, 198, 6738, 42625, 14208, 13, 3642, 822, 13, 18439, 13, 27530, 1330, 11787, 198, 6738, 42625, 14208, 13, 6371, 82, 1330, 9575, 198, 6738, 762...
3.788235
85
num = int(input()) ans = [int(i) for i in bin(num)[2:]] sum = 0 for i in ans: sum += i print(str(sum))
[ 22510, 796, 493, 7, 15414, 28955, 198, 504, 796, 685, 600, 7, 72, 8, 329, 1312, 287, 9874, 7, 22510, 38381, 17, 25, 11907, 198, 16345, 796, 657, 198, 1640, 1312, 287, 9093, 25, 198, 220, 220, 220, 2160, 15853, 1312, 198, 4798, 7, ...
2.183673
49
# pylint: disable=C0111,R0902,R0904,R0912,R0913,R0915,E1101 # Smartsheet Python SDK. # # Copyright 2019 Smartsheet.com, 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....
[ 2, 279, 2645, 600, 25, 15560, 28, 34, 486, 1157, 11, 49, 2931, 2999, 11, 49, 2931, 3023, 11, 49, 2931, 1065, 11, 49, 2931, 1485, 11, 49, 2931, 1314, 11, 36, 1157, 486, 198, 2, 2439, 5889, 25473, 11361, 26144, 13, 198, 2, 198, ...
2.927581
649
# Adapted from https://github.com/huggingface/transformers/blob/master/examples/pytorch/language-modeling/run_clm.py from itertools import chain from pathlib import Path import pickle from typing import Any, List, Union from torch.utils.data.dataloader import DataLoader, Dataset from transformers import AutoTokenizer,...
[ 2, 30019, 276, 422, 3740, 1378, 12567, 13, 785, 14, 71, 1018, 2667, 2550, 14, 35636, 364, 14, 2436, 672, 14, 9866, 14, 1069, 12629, 14, 9078, 13165, 354, 14, 16129, 12, 4666, 10809, 14, 5143, 62, 565, 76, 13, 9078, 198, 6738, 340,...
3.294118
153
from google.protobuf.json_format import MessageToJson, ParseDict def message_to_json(message): """Converts a message to JSON, using snake_case for field names.""" return MessageToJson(message, preserving_proto_field_name=True) def _stringify_all_experiment_ids(x): """Converts experiment_id fields which ...
[ 6738, 23645, 13, 11235, 672, 3046, 13, 17752, 62, 18982, 1330, 16000, 2514, 41, 1559, 11, 2547, 325, 35, 713, 628, 198, 4299, 3275, 62, 1462, 62, 17752, 7, 20500, 2599, 198, 220, 220, 220, 37227, 3103, 24040, 257, 3275, 284, 19449, ...
2.587413
715
from aws_cdk.core import App from b_cfn_custom_userpool_authorizer_test.integration.infrastructure.main_stack import MainStack app = App() MainStack(app) app.synth()
[ 6738, 3253, 82, 62, 10210, 74, 13, 7295, 1330, 2034, 198, 198, 6738, 275, 62, 12993, 77, 62, 23144, 62, 7220, 7742, 62, 9800, 7509, 62, 9288, 13, 18908, 1358, 13, 10745, 6410, 13, 12417, 62, 25558, 1330, 8774, 25896, 198, 198, 1324,...
2.847458
59
""" 重写range函数,要求重写之后的myrange(5)输出结果为:5,4,3,2,1,0 """ mr=MyRange(5) iterator=mr.__iter__() while True: try: i=iterator.__next__() print(i) except StopIteration: break
[ 37811, 198, 34932, 235, 37863, 247, 9521, 49035, 121, 46763, 108, 171, 120, 234, 17358, 223, 162, 109, 224, 34932, 235, 37863, 247, 45298, 28938, 236, 21410, 1820, 9521, 7, 20, 8, 164, 122, 241, 49035, 118, 163, 119, 241, 162, 252, ...
1.492537
134
# -*- coding: utf-8 -*- # import seaborn as sns # sns.set() import numpy as np from dramkit.gentools import isnull from dramkit.gentools import get_con_start_end from dramkit.gentools import get_update_kwargs from dramkit.logtools.utils_logger import logger_show import matplotlib as mpl mpl.rcParams['font.family'] ...
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 198, 2, 1330, 384, 397, 1211, 355, 3013, 82, 198, 2, 3013, 82, 13, 2617, 3419, 198, 198, 11748, 299, 32152, 355, 45941, 198, 198, 6738, 4850, 15813, 13, 6783, 10141, ...
1.470072
27,249
import os import cv2 import sys import numpy as np import torch import torch.nn as nn import torch.backends.cudnn as cudnn import torchvision import argparse import config as cf import operator import csv from torchvision import datasets, models, transforms from networks import * from torch.autograd import Variable f...
[ 11748, 28686, 198, 11748, 269, 85, 17, 198, 11748, 25064, 198, 11748, 299, 32152, 355, 45941, 198, 198, 11748, 28034, 198, 11748, 28034, 13, 20471, 355, 299, 77, 198, 11748, 28034, 13, 1891, 2412, 13, 66, 463, 20471, 355, 269, 463, 20...
2.164796
1,693
import json from collections import Counter import spacy import en_core_web_sm from tqdm import tqdm nlp = en_core_web_sm.load() # def get_subject_verb_obj(sentence): # print(sentence) # tokens = nlp(sentence) # svos = findSVOs(tokens) # print(svos) # print("-------------------------------") if ...
[ 11748, 33918, 198, 6738, 17268, 1330, 15034, 198, 11748, 599, 1590, 198, 11748, 551, 62, 7295, 62, 12384, 62, 5796, 198, 6738, 256, 80, 36020, 1330, 256, 80, 36020, 198, 198, 21283, 79, 796, 551, 62, 7295, 62, 12384, 62, 5796, 13, 2...
2.492958
142
import os from setuptools import setup # We follow Semantic Versioning (https://semver.org/) _MAJOR_VERSION = "0" _MINOR_VERSION = "1" _PATCH_VERSION = "0" with open(os.path.join(os.path.dirname(__file__), "requirements.txt")) as fp: install_requires = fp.read().split("\n") setup( name="multi-graph", de...
[ 11748, 28686, 198, 198, 6738, 900, 37623, 10141, 1330, 9058, 198, 198, 2, 775, 1061, 12449, 5109, 10628, 278, 357, 5450, 1378, 43616, 332, 13, 2398, 34729, 198, 62, 5673, 41, 1581, 62, 43717, 796, 366, 15, 1, 198, 62, 23678, 1581, 6...
2.576547
307
#!/usr/bin/env python3 import argparse from argparse import RawTextHelpFormatter import logging from pbr.version import VersionInfo from Bio import SeqIO import itertools from prettytable import PrettyTable import tabulate from xopen import xopen from fastaqc.alphabet import Alphabet import pprint __version__ = Versio...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 11748, 1822, 29572, 198, 6738, 1822, 29572, 1330, 16089, 8206, 22087, 8479, 1436, 198, 11748, 18931, 198, 6738, 279, 1671, 13, 9641, 1330, 10628, 12360, 198, 6738, 16024, 1330, 1001, ...
3.205263
760
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ pyplr.pupil =========== A module for interfacing with a Pupil Core eye tracker. @author: jtm """ from time import time from concurrent import futures from typing import List, Tuple import numpy as np import msgpack import zmq class PupilCore...
[ 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, 37811, 201, 198, 9078, 489, 81, 13, 79, 929, 346, 201, 198, 2559, 18604, 201, 198, 201, 198, 32, 8265...
2.092875
11,747
from ._loader import ParkLoader, ParkData
[ 6738, 47540, 29356, 1330, 3250, 17401, 11, 3250, 6601, 198 ]
4.2
10
import orchestrator
[ 11748, 28127, 1352, 628, 628 ]
4.6
5
from .base import ( preprocess_box_for_cv, preprocess_box_for_dl, load_part_model )
[ 6738, 764, 8692, 1330, 357, 198, 220, 220, 220, 662, 14681, 62, 3524, 62, 1640, 62, 33967, 11, 198, 220, 220, 220, 662, 14681, 62, 3524, 62, 1640, 62, 25404, 11, 198, 220, 220, 220, 3440, 62, 3911, 62, 19849, 198, 8 ]
2.261905
42
"""Authentication and authorization tools """ import os from typing import Optional from fastapi import Depends, HTTPException, status from fastapi.security import OAuth2PasswordBearer, OAuth2PasswordRequestForm from fastapi.security.utils import get_authorization_scheme_param from typing import Optional from datetime ...
[ 37811, 47649, 3299, 290, 19601, 4899, 198, 37811, 198, 11748, 28686, 198, 6738, 19720, 1330, 32233, 198, 6738, 3049, 15042, 1330, 2129, 2412, 11, 14626, 16922, 11, 3722, 198, 6738, 3049, 15042, 13, 12961, 1330, 440, 30515, 17, 35215, 3856...
2.447537
1,868
# Generated by Django 3.1.4 on 2021-01-11 03:52 from django.db import migrations, models
[ 2, 2980, 515, 416, 37770, 513, 13, 16, 13, 19, 319, 33448, 12, 486, 12, 1157, 7643, 25, 4309, 198, 198, 6738, 42625, 14208, 13, 9945, 1330, 15720, 602, 11, 4981, 628 ]
2.84375
32
import dash import dash_html_components as html import dash_core_components as dcc from dash.dependencies import Input, Output, State import dash_bootstrap_components as dbc import numpy as np from jsonschema import validate import json import yaml import base64 from json_schema_to_dash_forms.forms import SchemaFormCon...
[ 11748, 14470, 198, 11748, 14470, 62, 6494, 62, 5589, 3906, 355, 27711, 198, 11748, 14470, 62, 7295, 62, 5589, 3906, 355, 288, 535, 198, 6738, 14470, 13, 45841, 3976, 1330, 23412, 11, 25235, 11, 1812, 198, 11748, 14470, 62, 18769, 26418,...
3.686441
118
#!/usr/bin/env python # -*- coding:utf-8 -*- """ 使用 ffmpeg 截取视频片段并且重新拼接 使用方式: 提供文件格式如下:比如 input.txt ./input.mp4 00:01:00 00:02:00 00:04:00 00:08:00 """ import os import sys CONCAT_FILE = '_concat.txt' def remove(filepath_list): """移除中间文件""" for path in filepath_list + [CONCAT_FILE]: if os.path....
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 2, 532, 9, 12, 19617, 25, 40477, 12, 23, 532, 9, 12, 198, 37811, 198, 45635, 18796, 101, 31246, 43913, 10545, 230, 103, 20998, 244, 164, 100, 228, 165, 95, 239, 31965, 229, 162, 10...
1.568093
257
from logging import getLogger from typing import TYPE_CHECKING, List, Optional from pyknp import BList, Tag from pyknp_eventgraph.builder import Builder from pyknp_eventgraph.component import Component from pyknp_eventgraph.event import Event, EventBuilder from pyknp_eventgraph.helper import convert_mrphs_to_surf if...
[ 6738, 18931, 1330, 651, 11187, 1362, 198, 6738, 19720, 1330, 41876, 62, 50084, 2751, 11, 7343, 11, 32233, 198, 198, 6738, 12972, 15418, 79, 1330, 347, 8053, 11, 17467, 198, 198, 6738, 12972, 15418, 79, 62, 15596, 34960, 13, 38272, 1330,...
2.469761
711
# !/usr/bin/env python # -*-coding:utf-8 -*- # PROJECT : Python-Exercise # Time :2020/12/19 15:59 # Warning :The Hard Way Is Easier from typing import List """ 给定一个整数数组,编写一个函数,找出索引m和n,只要将索引区间[m,n]的元素排好序,整个数组就是有序的。注意:n-m尽量最小,也就是说,找出符合条件的最短序列。函数返回值为[m,n],若不存在这样的m和n(例如整个数组是有序的),请返回[-1,-1]。 输入: [1,2,4,7,10,11...
[ 2, 5145, 14, 14629, 14, 8800, 14, 24330, 21015, 198, 2, 532, 9, 12, 66, 7656, 25, 40477, 12, 23, 532, 9, 12, 198, 2, 21965, 23680, 220, 220, 220, 1058, 11361, 12, 3109, 23697, 198, 2, 3862, 220, 220, 220, 220, 220, 220, 27332, ...
1.054622
476
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! import grpc import payload_pb2 as payload__pb2
[ 2, 2980, 515, 416, 262, 308, 49, 5662, 11361, 8435, 17050, 13877, 13, 8410, 5626, 48483, 0, 198, 11748, 1036, 14751, 198, 198, 11748, 21437, 62, 40842, 17, 355, 21437, 834, 40842, 17, 628, 628 ]
3.457143
35
# Standard library imports # / # Third party imports import pandas as pd # Local application imports from scifin.timeseries.timeseries import build_from_csv, CatTimeSeries, multi_plot # Build a time series from a CSV file online ts1 = build_from_csv(filepath_or_buffer='https://raw.githubusercontent.com/selva86/datas...
[ 2, 8997, 5888, 17944, 198, 2, 1220, 198, 198, 2, 10467, 2151, 17944, 198, 11748, 19798, 292, 355, 279, 67, 198, 198, 2, 10714, 3586, 17944, 198, 6738, 629, 361, 259, 13, 22355, 10640, 13, 22355, 10640, 1330, 1382, 62, 6738, 62, 4066...
2.588398
362
# -*- coding: utf-8 -*- from cleo.inputs import ListInput, InputDefinition, InputArgument, InputOption from .. import CleoTestCase
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 198, 6738, 1190, 78, 13, 15414, 82, 1330, 7343, 20560, 11, 23412, 36621, 11, 23412, 28100, 1713, 11, 23412, 19722, 198, 198, 6738, 11485, 1330, 3779, 78, 14402, 20448, 6...
3.045455
44
"""The sensor tests for the tado platform.""" from homeassistant.const import STATE_ON from .util import async_init_integration async def test_home_create_binary_sensors(hass): """Test creation of home binary sensors.""" await async_init_integration(hass) state = hass.states.get("binary_sensor.wr1_con...
[ 37811, 464, 12694, 5254, 329, 262, 256, 4533, 3859, 526, 15931, 198, 198, 6738, 1363, 562, 10167, 13, 9979, 1330, 35454, 62, 1340, 198, 198, 6738, 764, 22602, 1330, 30351, 62, 15003, 62, 18908, 1358, 628, 198, 292, 13361, 825, 1332, 6...
3.066116
121
import json import sys from collections import defaultdict from difflib import ndiff from pathlib import Path from pprint import pformat from typing import List from conmon.utils import shorten if __name__ == "__main__": test_main(*sys.argv[1:2])
[ 11748, 33918, 198, 11748, 25064, 198, 6738, 17268, 1330, 4277, 11600, 198, 6738, 814, 8019, 1330, 299, 26069, 198, 6738, 3108, 8019, 1330, 10644, 198, 6738, 279, 4798, 1330, 279, 18982, 198, 6738, 19720, 1330, 7343, 198, 198, 6738, 369, ...
3.350649
77
from logger import logger logging = logger.getChild('sessions.twitter.buffers.local_trends') import output import threading from trends import Trends
[ 6738, 49706, 1330, 49706, 201, 198, 6404, 2667, 796, 49706, 13, 1136, 16424, 10786, 82, 6202, 13, 6956, 13, 36873, 364, 13, 12001, 62, 83, 10920, 82, 11537, 201, 198, 201, 198, 11748, 5072, 201, 198, 11748, 4704, 278, 201, 198, 201, ...
3.244898
49
import numpy as np import os # import matplotlib.pyplot as plt import scipy.constants as c if __name__ == '__main__': main()
[ 11748, 299, 32152, 355, 45941, 198, 11748, 28686, 198, 2, 220, 1330, 2603, 29487, 8019, 13, 9078, 29487, 355, 458, 83, 198, 11748, 629, 541, 88, 13, 9979, 1187, 355, 269, 628, 198, 361, 11593, 3672, 834, 6624, 705, 834, 12417, 834, ...
2.64
50
# For tensorflow version 1.x import warnings warnings.filterwarnings('ignore', category=Warning) #warnings.filterwarnings('ignore', category=DeprecationWarning) #warnings.filterwarnings('ignore', category=FutureWarning)
[ 2, 1114, 11192, 273, 11125, 2196, 352, 13, 87, 198, 11748, 14601, 198, 40539, 654, 13, 24455, 40539, 654, 10786, 46430, 3256, 6536, 28, 20361, 8, 198, 2, 40539, 654, 13, 24455, 40539, 654, 10786, 46430, 3256, 6536, 28, 12156, 8344, 34...
3.65
60
import setuptools with open("README.md", "r") as fh: long_description = fh.read() setuptools.setup( name="Flask2Neo4J", version="0.1a1", author="Ganggas95", author_email="subhannizar25@amail.com", description="""Extension Flask for integration with neo4j graph database""", long_description...
[ 11748, 900, 37623, 10141, 198, 198, 4480, 1280, 7203, 15675, 11682, 13, 9132, 1600, 366, 81, 4943, 355, 277, 71, 25, 198, 220, 220, 220, 890, 62, 11213, 796, 277, 71, 13, 961, 3419, 198, 198, 2617, 37623, 10141, 13, 40406, 7, 198, ...
2.396465
396
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from __future__ import print_function import argparse import os import sys import time try: from urllib2 import HTTPError, URL...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 2, 15069, 357, 66, 8, 2321, 383, 18255, 1505, 46665, 13, 1439, 2489, 10395, 13, 198, 2, 5765, 286, 428, 2723, 2438, 318, 21825, 416, 257, 347, 10305, 12, 7635, 5964, 326, 460, 307, ...
2.083113
758
"""MIT License Copyright (c) 2022 Daniel Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distrib...
[ 37811, 36393, 13789, 198, 198, 15269, 357, 66, 8, 33160, 7806, 198, 198, 5990, 3411, 318, 29376, 7520, 11, 1479, 286, 3877, 11, 284, 597, 1048, 16727, 257, 4866, 198, 1659, 428, 3788, 290, 3917, 10314, 3696, 357, 1169, 366, 25423, 123...
2.379554
1,839
from __future__ import unicode_literals import os from django.template import Context, Engine from django.test import SimpleTestCase, ignore_warnings from django.utils.deprecation import RemovedInDjango20Warning from ..utils import ROOT, setup @ignore_warnings(category=RemovedInDjango20Warning) @ignore_warnings(...
[ 6738, 11593, 37443, 834, 1330, 28000, 1098, 62, 17201, 874, 198, 198, 11748, 28686, 198, 198, 6738, 42625, 14208, 13, 28243, 1330, 30532, 11, 7117, 198, 6738, 42625, 14208, 13, 9288, 1330, 17427, 14402, 20448, 11, 8856, 62, 40539, 654, ...
3.380952
105
from encoder import decode_unsigned from encoder import decode_float import sys FLOAT_SIZE = 8 INT_SIZE = 4 LONG_SIZE = 8
[ 6738, 2207, 12342, 1330, 36899, 62, 43375, 198, 6738, 2207, 12342, 1330, 36899, 62, 22468, 198, 11748, 25064, 198, 198, 3697, 46, 1404, 62, 33489, 796, 807, 198, 12394, 62, 33489, 796, 604, 198, 43, 18494, 62, 33489, 796, 807, 198 ]
3
41
#!/usr/bin/env python3 '''Drive differentially with an Xbox controller.''' from wpilib.command import Command class DriveForward(Command): '''Drive differentially with an Xbox controller.''' def __init__(self, robot): '''Save the robot object and pull in the drivetrain subsystem.''' super().__...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 7061, 6, 24825, 1180, 1927, 351, 281, 9445, 10444, 2637, 7061, 198, 198, 6738, 266, 79, 22282, 13, 21812, 1330, 9455, 198, 198, 4871, 9974, 39746, 7, 21575, 2599, 198, 220, 220, ...
2.868421
380
import numpy as np import cv2 face_cascade = cv2.CascadeClassifier('haarcascade_frontalface_default.xml') eye_cascade = cv2.CascadeClassifier('haarcascade_eye.xml') cap = cv2.VideoCapture(0) count=1 while True: ret, img = cap.read() gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) faces = face_cascade.detect...
[ 11748, 299, 32152, 355, 45941, 198, 11748, 269, 85, 17, 198, 198, 2550, 62, 66, 28966, 796, 269, 85, 17, 13, 34, 28966, 9487, 7483, 10786, 3099, 5605, 28966, 62, 8534, 1604, 558, 62, 12286, 13, 19875, 11537, 198, 25379, 62, 66, 2896...
1.829314
539
print("Insert a number") s = input() print("Insert a list of letters") lis = input().split(',') if s in lis: print(True) else: print(False)
[ 4798, 7203, 44402, 257, 1271, 4943, 198, 82, 796, 5128, 3419, 198, 4798, 7203, 44402, 257, 1351, 286, 7475, 4943, 198, 27999, 796, 5128, 22446, 35312, 7, 3256, 11537, 198, 361, 264, 287, 300, 271, 25, 198, 220, 220, 220, 3601, 7, 17...
2.642857
56
from app import app from flask import render_template, abort import json @app.route('/') @app.route('/health')
[ 6738, 598, 1330, 598, 198, 6738, 42903, 1330, 8543, 62, 28243, 11, 15614, 198, 11748, 33918, 198, 198, 31, 1324, 13, 38629, 10786, 14, 11537, 198, 198, 31, 1324, 13, 38629, 10786, 14, 13948, 11537 ]
3.2
35
from genetic import * if __name__ == '__main__': # basic_func.DEBUG = True # init() # target = lambda x: math.sin(10*x) # populations_ = genetic_algorithm(target, population_size=40, unit_length=10, epochs=120, # selection_type='rank', default_std=1, save_king=True...
[ 6738, 8513, 1330, 1635, 628, 198, 361, 11593, 3672, 834, 6624, 705, 834, 12417, 834, 10354, 198, 220, 220, 220, 1303, 4096, 62, 20786, 13, 30531, 796, 6407, 198, 220, 220, 220, 1303, 2315, 3419, 198, 220, 220, 220, 1303, 2496, 796, ...
2.302115
662
""" Utilities Tests --------------- """ from wikirec import utils
[ 37811, 198, 18274, 2410, 30307, 198, 24305, 198, 37811, 198, 198, 6738, 47145, 557, 66, 1330, 3384, 4487, 628, 628 ]
3.5
20
# # MIT License # Copyright (c) 2021 MjTs-140914 # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, ...
[ 2, 198, 2, 17168, 13789, 198, 198, 2, 15069, 357, 66, 8, 33448, 337, 73, 33758, 12, 1415, 2931, 1415, 198, 198, 2, 2448, 3411, 318, 29376, 7520, 11, 1479, 286, 3877, 11, 284, 597, 1048, 16727, 257, 4866, 198, 2, 286, 428, 3788, ...
2.212885
11,579
from django.db import models # Create your models here.
[ 6738, 42625, 14208, 13, 9945, 1330, 4981, 198, 198, 2, 13610, 534, 4981, 994, 13, 628 ]
3.625
16
#!/usr/bin/env python """Tests for `spectrapepper` package.""" import unittest import spectrapepper as spep import numpy as np import pandas as pd # import my_functions as spep class TestSpectrapepper(unittest.TestCase): """Tests for `spectrapepper` package.""" if __name__ == '__main__': unittest.main()
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 198, 37811, 51, 3558, 329, 4600, 4443, 13484, 2848, 63, 5301, 526, 15931, 198, 198, 11748, 555, 715, 395, 198, 11748, 5444, 13484, 2848, 355, 693, 79, 198, 11748, 299, 32152, 355, 4594...
2.80531
113
#!/Applications/anaconda/envs/Python3/bin def main(): '''Examples Using Exceptions in Python''' # Python exceptions: http://docs.python.org/library/exceptions.html # Catch exceptions with try try: f = open('noFile.txt') except IOError as e: print('Oh no, IOError:', e) except Va...
[ 2, 48443, 41995, 14, 272, 330, 13533, 14, 268, 14259, 14, 37906, 18, 14, 8800, 198, 198, 4299, 1388, 33529, 198, 220, 220, 220, 705, 7061, 27730, 8554, 1475, 11755, 287, 11361, 7061, 6, 198, 220, 220, 220, 1303, 11361, 13269, 25, 26...
2.375
608
"""Main application logic""" import logging from flask import Flask, jsonify, render_template, request from summarizer import Summarizer from src.utils import setup_logging DEFAULT_MODEL_NAME = 'distilbert-base-uncased' DEFAULT_NUM_SENTENCES = 1 setup_logging() logger = logging.getLogger('ext_summarizer') summari...
[ 37811, 13383, 3586, 9156, 37811, 198, 11748, 18931, 198, 198, 6738, 42903, 1330, 46947, 11, 33918, 1958, 11, 8543, 62, 28243, 11, 2581, 198, 6738, 15676, 7509, 1330, 5060, 3876, 7509, 198, 198, 6738, 12351, 13, 26791, 1330, 9058, 62, 64...
2.707317
451
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2015 Felix Wunsch, Communications Engineering Lab (CEL) / Karlsruhe Institute of Technology (KIT) <wunsch.felix@googlemail.com>. # # This is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as publis...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 2, 220, 198, 2, 15069, 1853, 29721, 370, 13271, 354, 11, 14620, 14044, 3498, 357, 34, 3698, 8, 1220, 15415, 82, 622, ...
3.218659
343
""" Input for Redmine shell. """ import sys import os import termios import contextlib from enum import Enum from .command import Command from redmine_shell.command.system.commands import History, HistoryMove class State(Enum): ''' Character Key Event State. ''' CONTINUE = -1 BREAK = -2 @contextlib.co...
[ 37811, 23412, 329, 2297, 3810, 7582, 13, 37227, 628, 198, 11748, 25064, 198, 11748, 28686, 198, 11748, 3381, 4267, 198, 11748, 4732, 8019, 198, 6738, 33829, 1330, 2039, 388, 198, 6738, 764, 21812, 1330, 9455, 198, 6738, 2266, 3810, 62, ...
1.908797
1,239
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Feb 06 09:13:14 2021 @author: sudhir """ # ============================================================================= # Import library # ============================================================================= import pandas as pd import numpy a...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 37811, 198, 41972, 319, 26223, 3158, 9130, 7769, 25, 1485, 25, 1415, 33448, 628, 198, 31, 9800, 25, 424, 34985, 3...
5.428571
105
import torch import torch.nn as nn from sacred import Ingredient model = Ingredient('model') @model.config @model.capture
[ 11748, 28034, 198, 11748, 28034, 13, 20471, 355, 299, 77, 198, 6738, 13626, 1330, 17589, 445, 1153, 628, 198, 19849, 796, 17589, 445, 1153, 10786, 19849, 11537, 628, 198, 31, 19849, 13, 11250, 628, 628, 198, 198, 31, 19849, 13, 27144, ...
3.046512
43
import itertools from threading import Thread
[ 11748, 340, 861, 10141, 198, 6738, 4704, 278, 1330, 14122, 628, 198 ]
4
12
import tensorflow as tf import numpy as np import h5py #broadcasting:先将实数或向量扩展再对对应元素进行运算 A = np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 11, 12]]) print(A) print(A.shape[1]) #输出为3 print(A + 100) #reshape()函数,注意reshape以后不能丢失数据:1x12 12x1 2x6 6x2 3x4 4x3 #-1表示未知 print(A.reshape(-1)) print(A.reshape(-1, 1)) print(A...
[ 11748, 11192, 273, 11125, 355, 48700, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 289, 20, 9078, 198, 2, 36654, 19913, 25, 17739, 230, 49546, 22522, 252, 46763, 108, 22755, 244, 28938, 239, 34932, 237, 33699, 102, 161, 109, 243, 378...
1.23543
3,020
# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 from unittest import mock from pytest import fixture import json from servicecatalog_puppet import constants, luigi_tasks_and_targets @fixture
[ 2, 15069, 13130, 6186, 13, 785, 11, 3457, 13, 393, 663, 29116, 13, 1439, 6923, 33876, 13, 198, 2, 30628, 55, 12, 34156, 12, 33234, 7483, 25, 24843, 12, 17, 13, 15, 198, 6738, 555, 715, 395, 1330, 15290, 198, 198, 6738, 12972, 9288...
3.2625
80
from commonconf.backends import use_configparser_backend from commonconf import settings from datetime import datetime import argparse import json import os if __name__ == '__main__': settings_path = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'settings.cfg') use...
[ 6738, 2219, 10414, 13, 1891, 2412, 1330, 779, 62, 11250, 48610, 62, 1891, 437, 198, 6738, 2219, 10414, 1330, 6460, 198, 6738, 4818, 8079, 1330, 4818, 8079, 198, 11748, 1822, 29572, 198, 11748, 33918, 198, 11748, 28686, 628, 198, 198, 36...
2.679803
203
"""nycrud URL Configuration""" # Django from django.contrib import admin from django.urls import path, include urlpatterns = [ path('admin/', admin.site.urls), path('users/', include(('users.urls', 'users'), namespace='users')), path('', include(('posts.urls', 'posts'), namespace='posts')), ]
[ 37811, 3281, 6098, 463, 10289, 28373, 37811, 198, 198, 2, 37770, 198, 6738, 42625, 14208, 13, 3642, 822, 1330, 13169, 198, 6738, 42625, 14208, 13, 6371, 82, 1330, 3108, 11, 2291, 628, 198, 6371, 33279, 82, 796, 685, 198, 220, 220, 220...
2.942857
105
_base_ = 'fcos_r50_caffe_fpn_gn-head_1x_coco.py' model = dict( pretrained='open-mmlab://detectron2/resnet50_caffe', neck=dict( _delete_=True, type='FPN_CARAFE_LDCN3_PDCN_CAT', in_channels=[256, 512, 1024, 2048], out_channels=256, num_outs=5, start_level=1, ...
[ 62, 8692, 62, 796, 705, 69, 6966, 62, 81, 1120, 62, 66, 21223, 62, 69, 21999, 62, 4593, 12, 2256, 62, 16, 87, 62, 66, 25634, 13, 9078, 6, 198, 198, 19849, 796, 8633, 7, 198, 220, 220, 220, 2181, 13363, 11639, 9654, 12, 3020, 2...
1.979405
1,311
from __future__ import print_function import argparse import io import locale import os import sys import shlex from collections import defaultdict import bdemeta.resolver import bdemeta.commands if __name__ == "__main__": main()
[ 6738, 11593, 37443, 834, 1330, 3601, 62, 8818, 198, 198, 11748, 1822, 29572, 198, 11748, 33245, 198, 11748, 36693, 198, 11748, 28686, 198, 11748, 25064, 198, 11748, 427, 2588, 198, 6738, 17268, 1330, 4277, 11600, 198, 198, 11748, 275, 953...
3.338028
71
from rest_framework.routers import DefaultRouter from app.api import views router = DefaultRouter(trailing_slash=False) router.register("users", views.UserViewSet, basename="user") urlpatterns = router.urls
[ 6738, 1334, 62, 30604, 13, 472, 1010, 1330, 15161, 49, 39605, 198, 198, 6738, 598, 13, 15042, 1330, 5009, 628, 198, 472, 353, 796, 15161, 49, 39605, 7, 9535, 4386, 62, 6649, 1077, 28, 25101, 8, 198, 472, 353, 13, 30238, 7203, 18417,...
3.19697
66
import os import time #-------------------- 1/4 Run Config Begin -------------------- RUN_MODE = "slurmCluster" # singleProc, multiProc, slurmCluster REDIRECT_TERMINAL_OUTPUT = True COMPILE_APP = False #-------------------- 1/4 Run Config End -------------------- #-------------------- 2/4 Base CPU Config Begin ---...
[ 198, 11748, 28686, 198, 11748, 640, 198, 198, 2, 19351, 352, 14, 19, 5660, 17056, 16623, 41436, 198, 49, 4944, 62, 49058, 796, 366, 6649, 333, 76, 2601, 5819, 1, 1303, 2060, 2964, 66, 11, 5021, 2964, 66, 11, 40066, 76, 2601, 5819, ...
2.384211
2,470
# -*- coding: utf-8 -*- import os PKG_DIR = os.path.abspath(os.path.dirname(__file__))
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 198, 11748, 28686, 198, 198, 40492, 38, 62, 34720, 796, 28686, 13, 6978, 13, 397, 2777, 776, 7, 418, 13, 6978, 13, 15908, 3672, 7, 834, 7753, 834, 4008, 628 ]
2.045455
44
# coding: utf-8 # The problem: CF compliant readers cannot read HOPS dataset directly. # The solution: read with the `netCDF4-python` raw interface and create a CF object from the data. # # NOTE: Ideally this should be a `nco` script that could be run as a CLI script and fix the files. # Here I am using `Python`+`i...
[ 198, 2, 19617, 25, 3384, 69, 12, 23, 198, 198, 2, 383, 1917, 25, 18551, 31332, 7183, 2314, 1100, 220, 367, 30737, 27039, 3264, 13, 198, 2, 383, 4610, 25, 1100, 351, 262, 4600, 3262, 34, 8068, 19, 12, 29412, 63, 8246, 7071, 290, ...
1.896523
2,387
import base64 import re import time from datetime import datetime from fontTools.ttLib import TTFont from io import BytesIO import scrapy from A58Spider.items import A58SpiderItem if __name__ == '__main__': from scrapy.crawler import CrawlerProcess from scrapy.utils.project import get_project_settings ...
[ 11748, 2779, 2414, 198, 11748, 302, 198, 11748, 640, 198, 6738, 4818, 8079, 1330, 4818, 8079, 198, 6738, 10369, 33637, 13, 926, 25835, 1330, 309, 10234, 756, 198, 6738, 33245, 1330, 2750, 4879, 9399, 198, 11748, 15881, 88, 198, 198, 673...
3.136364
132
#!/usr/bin/env python """ tumult.py - Because everyone needs a little chaos every now and again. """ try: import demiurgic except ImportError: print("Warning: You're not demiurgic. Actually, I think that's normal.") try: import mystificate except ImportError: print("Warning: Dark voodoo may be unreliab...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 37811, 198, 83, 388, 586, 13, 9078, 532, 4362, 2506, 2476, 257, 1310, 11918, 790, 783, 290, 757, 13, 198, 37811, 198, 198, 28311, 25, 198, 220, 220, 220, 1330, 1357, 72, 3686, 291, ...
2.636187
514
import logging import array from store import database OPERATIONS = {} @register_oper(key="SET") @check_paras_len(gt=2) @register_oper(key="GET") @check_paras_len(eq=2) @register_oper(key="DEL") @check_paras_len(gt=1) @register_oper(key="DUMP") @check_paras_len(eq=2) INFO = """# Server redis_version:2...
[ 11748, 18931, 198, 11748, 7177, 198, 6738, 3650, 1330, 6831, 628, 198, 31054, 18421, 796, 23884, 628, 628, 628, 198, 198, 31, 30238, 62, 3575, 7, 2539, 2625, 28480, 4943, 198, 31, 9122, 62, 1845, 292, 62, 11925, 7, 13655, 28, 17, 8,...
2.266223
1,803
#!/usr/bin/env python3 """LockedIterator.""" from threading import Lock from collections.abc import Iterator # pylint: disable=too-few-public-methods class LockedIterator(Iterator): """Locked Iterator.""" def __init__(self, _it): """Initialise object.""" self.lock = Lock() self._it =...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 37811, 43, 3543, 37787, 526, 15931, 198, 6738, 4704, 278, 1330, 13656, 198, 6738, 17268, 13, 39305, 1330, 40806, 1352, 198, 198, 2, 279, 2645, 600, 25, 15560, 28, 18820, 12, 32146,...
2.13172
372
"""Initialize tests"""
[ 37811, 24243, 1096, 5254, 37811 ]
4.4
5
# -*- coding: utf-8 -*- """ Tencent is pleased to support the open source community by making BK-BASE 蓝鲸基础平台 available. Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. BK-BASE 蓝鲸基础平台 is licensed under the MIT License. License for BK-BASE 蓝鲸基础平台: ---------------------------------------------...
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 37811, 198, 24893, 1087, 318, 10607, 284, 1104, 262, 1280, 2723, 2055, 416, 1642, 347, 42, 12, 33, 11159, 5525, 241, 251, 165, 110, 116, 161, 253, 118, 163, 94, 222, ...
2.185946
1,850
"""examples.configuration_modes.eos_configure_session""" from scrapli.driver.core import EOSDriver MY_DEVICE = { "host": "172.18.0.14", "auth_username": "scrapli", "auth_password": "scrapli", "auth_secondary": "VR-netlab9", "auth_strict_key": False, } def main(): """Connect to an EOS Device a...
[ 37811, 1069, 12629, 13, 11250, 3924, 62, 76, 4147, 13, 68, 418, 62, 11250, 495, 62, 29891, 37811, 198, 6738, 19320, 489, 72, 13, 26230, 13, 7295, 1330, 412, 2640, 32103, 198, 198, 26708, 62, 7206, 27389, 796, 1391, 198, 220, 220, 22...
2.819936
311