content
stringlengths
1
1.04M
input_ids
listlengths
1
774k
ratio_char_token
float64
0.38
22.9
token_count
int64
1
774k
#!/usr/bin/env python3 """ PyTorch Dataset local example. """ import glob import json import os from typing import Dict, List, Optional, Sequence, Tuple import cv2 import matplotlib.pylab as plt import numpy as np import numpy.typing from torch.utils.data import Dataset, DataLoader from targetran.np import ( Com...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 37811, 198, 20519, 15884, 354, 16092, 292, 316, 1957, 1672, 13, 198, 37811, 198, 198, 11748, 15095, 198, 11748, 33918, 198, 11748, 28686, 198, 6738, 19720, 1330, 360, 713, 11, 7343, ...
2.154976
1,839
from django.contrib import messages from django.contrib.auth import authenticate, login from django.http.response import HttpResponseRedirect from django.views import View from django.shortcuts import render, redirect from django.contrib.auth.models import User from shop.models import Customer
[ 6738, 42625, 14208, 13, 3642, 822, 1330, 6218, 198, 6738, 42625, 14208, 13, 3642, 822, 13, 18439, 1330, 8323, 5344, 11, 17594, 198, 6738, 42625, 14208, 13, 4023, 13, 26209, 1330, 367, 29281, 31077, 7738, 1060, 198, 6738, 42625, 14208, 1...
3.607143
84
# 数据集 import os import glob import librosa import numpy as np import torch from torch.utils.data import Dataset if __name__ == '__main__': from torch.utils.data import DataLoader trainset = WavDataset('../data/trunc_noisy_train2', '../data/trunc_speech_train') trainloader = DataLoader(trainset) ...
[ 2, 10545, 243, 108, 162, 235, 106, 37239, 228, 198, 198, 11748, 28686, 198, 11748, 15095, 198, 198, 11748, 9195, 4951, 64, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 28034, 198, 6738, 28034, 13, 26791, 13, 7890, 1330, 16092, 292, ...
2.47619
147
# Copyright 2016 Cisco Systems, Inc. # All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requi...
[ 2, 15069, 1584, 28289, 11998, 11, 3457, 13, 198, 2, 1439, 2489, 10395, 13, 198, 2, 198, 2, 220, 220, 220, 49962, 739, 262, 24843, 13789, 11, 10628, 362, 13, 15, 357, 1169, 366, 34156, 15341, 345, 743, 198, 2, 220, 220, 220, 407, ...
3.191837
245
import traceback import os import json import asyncio from aiogram import Bot, types from aiogram.dispatcher import Dispatcher from aiogram.types.message import ContentType from aiogram.utils import executor from moviepy.editor import VideoFileClip from moviepy.video.fx.resize import resize from aiogram.utils.exception...
[ 11748, 12854, 1891, 198, 11748, 28686, 198, 11748, 33918, 198, 11748, 30351, 952, 198, 6738, 257, 72, 21857, 1330, 18579, 11, 3858, 198, 6738, 257, 72, 21857, 13, 6381, 8071, 2044, 1330, 3167, 8071, 2044, 198, 6738, 257, 72, 21857, 13, ...
3.042918
233
import logging import abc import time from typing import Dict from release_watcher.base_models import WatcherConfig from release_watcher.config_models import CommonConfig from release_watcher.watchers.watcher_models import WatchResult logger = logging.getLogger(__name__) WATCHER_TYPES = {} class Watcher(metaclass=a...
[ 11748, 18931, 198, 11748, 450, 66, 198, 11748, 640, 198, 6738, 19720, 1330, 360, 713, 198, 6738, 2650, 62, 86, 34734, 13, 8692, 62, 27530, 1330, 12242, 2044, 16934, 198, 6738, 2650, 62, 86, 34734, 13, 11250, 62, 27530, 1330, 8070, 169...
2.617122
841
import argparse import logging import os from multiprocessing import Process from tqdm import tqdm from util.load_sentence import LoadSentences from util.logger import get_logger from util.trie import Trie, TrieMatchResult, TrieNode logger = logging.getLogger(__name__) if __name__ == "__main__": parser = ar...
[ 11748, 1822, 29572, 198, 11748, 18931, 198, 11748, 28686, 198, 6738, 18540, 305, 919, 278, 1330, 10854, 198, 198, 6738, 256, 80, 36020, 1330, 256, 80, 36020, 198, 198, 6738, 7736, 13, 2220, 62, 34086, 594, 1330, 8778, 31837, 3007, 198, ...
2.118406
853
#!/usr/bin/env python3 # encoding: utf-8 import functools import sys tracer = functools.partial(trace_calls, to_be_traced=['b']) sys.settrace(tracer) a()
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 2, 21004, 25, 3384, 69, 12, 23, 198, 198, 11748, 1257, 310, 10141, 198, 11748, 25064, 628, 628, 628, 198, 198, 2213, 11736, 796, 1257, 310, 10141, 13, 47172, 7, 40546, 62, 66, ...
2.347826
69
""" Generate BTC addresses which have predefined prefix. """ import secrets from classes.btc_address import BtcAddress while True: btc_private_key = secrets.token_bytes(nbytes=32) btc_address = BtcAddress.compute_btc_address(btc_private_key) if btc_address.lower().startswith('1kev'): btc_private_...
[ 37811, 198, 8645, 378, 14503, 9405, 543, 423, 2747, 18156, 21231, 13, 198, 37811, 198, 198, 11748, 13141, 198, 198, 6738, 6097, 13, 18347, 66, 62, 21975, 1330, 347, 23047, 20231, 198, 198, 4514, 6407, 25, 198, 220, 220, 220, 275, 2304...
2.462766
188
import unittest import json import os import sys import copy sys.path.append(os.path.join(os.getcwd(), 'scripts')) from dats_validator.validator import (validate_json, # noqa: E402 validate_non_schema_required, validate_extra_properties, ...
[ 11748, 555, 715, 395, 198, 11748, 33918, 198, 11748, 28686, 198, 11748, 25064, 198, 11748, 4866, 198, 17597, 13, 6978, 13, 33295, 7, 418, 13, 6978, 13, 22179, 7, 418, 13, 1136, 66, 16993, 22784, 705, 46521, 6, 4008, 198, 6738, 288, ...
1.94335
406
from rest_framework import serializers from .models import Enquiry
[ 6738, 1334, 62, 30604, 1330, 11389, 11341, 198, 198, 6738, 764, 27530, 1330, 2039, 421, 9045, 628 ]
4.058824
17
# Global Variables board = ["-", "-", "-", "-", "-", "-", "-", "-", "-"] player_id = "X" continue_game = True winner = None #Functions # Starts the game game()
[ 2, 8060, 15965, 2977, 198, 3526, 796, 14631, 12, 1600, 27444, 1600, 27444, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 220, 27444, 1600, 27444, 1600, 27444, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 220, 27444, 1600, 27444, 1600...
2.301205
83
# # # def func(): # n = 0 # while True: # n += 1 # yield n # yield = return + 暂停 # # # # g = func() # # print(g) # # print(g.__next__()) # # print(next(g)) # # # def fid(length): # a, b = 0, 1 # n = 0 # while n < length: # yield b # a, b = b, a + b # n += 1 #...
[ 2, 1303, 198, 2, 825, 25439, 33529, 198, 2, 220, 220, 220, 220, 299, 796, 657, 198, 2, 220, 220, 220, 220, 981, 6407, 25, 198, 2, 220, 220, 220, 220, 220, 220, 220, 220, 299, 15853, 352, 198, 2, 220, 220, 220, 220, 220, 220, ...
1.644989
938
# collections deque nr8 import collections from collections import deque d = deque("hello", maxlen=5) d.extend([1, 2, 3]) # d.pop() # d.popleft() # d.clear() # d.extend("456") # d.extend([1, 2, 3]) # d.extendleft("hey") # d.rotate(-2) print(d)
[ 2, 17268, 390, 4188, 299, 81, 23, 198, 11748, 17268, 198, 6738, 17268, 1330, 390, 4188, 198, 198, 67, 796, 390, 4188, 7203, 31373, 1600, 3509, 11925, 28, 20, 8, 198, 67, 13, 2302, 437, 26933, 16, 11, 362, 11, 513, 12962, 198, 2, ...
2.214286
112
import os import shutil import torch def save_checkpoint(state, is_best, checkpoint): """Saves model and training parameters at checkpoint + 'last.pth.tar'. If is_best==True, also saves checkpoint + 'best.pth.tar' Args: state: (dict) contains model's state_dict, may contain other keys s...
[ 11748, 28686, 201, 198, 11748, 4423, 346, 201, 198, 201, 198, 11748, 28034, 201, 198, 201, 198, 4299, 3613, 62, 9122, 4122, 7, 5219, 11, 318, 62, 13466, 11, 26954, 2599, 201, 198, 220, 220, 220, 37227, 50, 3080, 2746, 290, 3047, 100...
2.689441
644
print('-'*30) print('sequencia de fibonacci') print('-'*30) n = int(input('quantos termos voce quer mostrar?: ')) t1 = 0 t2 = 1 print('~'*30) print(f'{t1} - {t2}', end='') contador = 3 while contador <= n: t3 = t1 + t2 print(f' - {t3}', end='') t1 = t2 t2 = t3 contador = contador + 1 print(' - FIM',...
[ 4798, 10786, 19355, 9, 1270, 8, 198, 4798, 10786, 3107, 29634, 390, 12900, 261, 44456, 11537, 198, 4798, 10786, 19355, 9, 1270, 8, 198, 77, 796, 493, 7, 15414, 10786, 40972, 418, 3381, 418, 7608, 344, 42517, 749, 20040, 27514, 705, 40...
2.024096
166
# coding: utf-8 """ Isilon SDK Isilon SDK - Language bindings for the OneFS API # noqa: E501 OpenAPI spec version: 4 Contact: sdk@isilon.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import unittest import isi_sdk_8_0_1 from i...
[ 2, 19617, 25, 3384, 69, 12, 23, 198, 198, 37811, 198, 220, 220, 220, 1148, 33576, 26144, 628, 220, 220, 220, 1148, 33576, 26144, 532, 15417, 34111, 329, 262, 1881, 10652, 7824, 220, 1303, 645, 20402, 25, 412, 33548, 628, 220, 220, 2...
2.295276
1,016
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
[ 2, 19617, 28, 40477, 12, 23, 198, 2, 16529, 35937, 198, 2, 15069, 357, 66, 8, 5413, 10501, 13, 1439, 2489, 10395, 13, 198, 2, 49962, 739, 262, 17168, 13789, 13, 4091, 13789, 13, 14116, 287, 262, 1628, 6808, 329, 198, 2, 5964, 1321...
2.853436
1,426
"""This module contains the general information for LstorageVirtualDriveDef ManagedObject.""" from ...ucsmo import ManagedObject from ...ucscoremeta import MoPropertyMeta, MoMeta from ...ucsmeta import VersionMeta class LstorageVirtualDriveDef(ManagedObject): """This is LstorageVirtualDriveDef class.""" co...
[ 37811, 1212, 8265, 4909, 262, 2276, 1321, 329, 406, 35350, 37725, 24825, 7469, 1869, 1886, 10267, 526, 15931, 198, 198, 6738, 2644, 1229, 5796, 78, 1330, 1869, 1886, 10267, 198, 6738, 2644, 1229, 26675, 28961, 1330, 4270, 21746, 48526, 11...
2.724138
1,392
# -*- coding: utf-8 -*- if __name__ == "__main__": main()
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 628, 198, 198, 361, 11593, 3672, 834, 6624, 366, 834, 12417, 834, 1298, 198, 220, 220, 220, 1388, 3419, 198 ]
1.969697
33
"""distutils.filelist Provides the FileList class, used for poking about the filesystem and building lists of files. """ import os import re import fnmatch import functools from distutils.util import convert_path from distutils.errors import DistutilsTemplateError, DistutilsInternalError from distutils import log ...
[ 37811, 17080, 26791, 13, 7753, 4868, 198, 198, 15946, 1460, 262, 9220, 8053, 1398, 11, 973, 329, 39048, 546, 262, 29905, 198, 392, 2615, 8341, 286, 3696, 13, 198, 37811, 198, 198, 11748, 28686, 198, 11748, 302, 198, 11748, 24714, 15699,...
2.506408
3,043
# -*- coding: utf-8 -*- try: from django.conf.urls import url except ImportError: from django.conf.urls.defaults import url from . import views urlpatterns = [ url(r'^notification/$', views.smsconnect_notification, name='smsconnect_notification'), ]
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 28311, 25, 198, 220, 220, 220, 422, 42625, 14208, 13, 10414, 13, 6371, 82, 1330, 19016, 198, 16341, 17267, 12331, 25, 198, 220, 220, 220, 422, 42625, 14208, 13, 10414, ...
2.666667
99
# Copyright 2014 The Swarming Authors. All rights reserved. # Use of this source code is governed by the Apache v2.0 license that can be # found in the LICENSE file. """Auth component configuration hooks. Application that use 'auth' component can override settings defined here by adding the following lines to appengi...
[ 2, 15069, 1946, 383, 2451, 18052, 46665, 13, 1439, 2489, 10395, 13, 198, 2, 5765, 286, 428, 2723, 2438, 318, 21825, 416, 262, 24843, 410, 17, 13, 15, 5964, 326, 460, 307, 198, 2, 1043, 287, 262, 38559, 24290, 2393, 13, 198, 198, 3...
3.126961
701
#!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = 'LenoxWong' # for creating database database = { 'name': 'Test', 'host': 'localhost', 'user': 'test', 'password': 'test' }, # for creating the pool pool = { 'host': 'localhost', 'port': 3306, 'user': tuple(database)[0]['user'], ...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 198, 834, 9800, 834, 796, 705, 30659, 1140, 54, 506, 6, 198, 198, 2, 329, 4441, 6831, 198, 48806, 796, 1391, 19...
2.268519
216
""" """ import os import numpy as np import pandas as pd import xarray as xr from osgeo import gdal from src.utils.constants import ( REGIONS, LANDCOVER_MAP, LANDCOVER_PERIODS, LANDCOVER_PADDING ) if __name__ == "__main__": # Project's root os.chdir("../..") for region in REGIONS: ...
[ 37811, 198, 198, 37811, 198, 11748, 28686, 198, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 19798, 292, 355, 279, 67, 198, 11748, 2124, 18747, 355, 2124, 81, 198, 6738, 28686, 469, 78, 1330, 308, 31748, 198, 198, 6738, 12351, 13, ...
2.019208
833
# calculates spectra of a given star at different inclinations from pa.lib import limbdark from pa.lib import fit as ft from pa.lib import star from pa.lib import util as ut import numpy as np from numpy.core import defchararray as ch import sys import time import argparse import pickle import os # in case we are ru...
[ 2, 43707, 5444, 430, 286, 257, 1813, 3491, 379, 1180, 13358, 7352, 198, 6738, 14187, 13, 8019, 1330, 1761, 17457, 668, 198, 6738, 14187, 13, 8019, 1330, 4197, 355, 10117, 198, 6738, 14187, 13, 8019, 1330, 3491, 198, 6738, 14187, 13, 8...
3.473214
112
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
[ 2, 15069, 2864, 383, 309, 22854, 37535, 46665, 13, 1439, 6923, 33876, 13, 198, 2, 198, 2, 49962, 739, 262, 24843, 13789, 11, 10628, 362, 13, 15, 357, 1169, 366, 34156, 15341, 198, 2, 345, 743, 407, 779, 428, 2393, 2845, 287, 11846, ...
3.684524
336
import collections from django.shortcuts import get_object_or_404 from django.http import JsonResponse, HttpResponse from .models import * from django.db.utils import IntegrityError from django.views.decorators.http import require_http_methods from django.forms.models import model_to_dict from itertools import chain fr...
[ 11748, 17268, 198, 6738, 42625, 14208, 13, 19509, 23779, 1330, 651, 62, 15252, 62, 273, 62, 26429, 198, 6738, 42625, 14208, 13, 4023, 1330, 449, 1559, 31077, 11, 367, 29281, 31077, 198, 6738, 764, 27530, 1330, 1635, 198, 6738, 42625, 14...
2.123105
4,354
from functools import partial import psutil import time # Code for bw2 import bw2data as bd, bw2calc as bc bd.projects.set_current("ecoinvent 3.7.1 bw2") bd.databases a = bd.get_activity(('ecoinvent 3.7.1', 'f57568b2e553864152a6ac920595216f')) a ipcc = ('IPCC 2013', 'climate change', 'GWP 100a') curry = parti...
[ 6738, 1257, 310, 10141, 1330, 13027, 198, 11748, 26692, 22602, 198, 11748, 640, 628, 628, 628, 628, 198, 2, 6127, 329, 275, 86, 17, 198, 198, 11748, 275, 86, 17, 7890, 355, 275, 67, 11, 275, 86, 17, 9948, 66, 355, 47125, 198, 1745...
2.257534
365
import rclpy from rclpy.node import Node from std_msgs.msg import Int64 if __name__ == '__main__': main()
[ 11748, 374, 565, 9078, 198, 6738, 374, 565, 9078, 13, 17440, 1330, 19081, 198, 198, 6738, 14367, 62, 907, 14542, 13, 19662, 1330, 2558, 2414, 628, 198, 361, 11593, 3672, 834, 6624, 705, 834, 12417, 834, 10354, 198, 220, 220, 220, 1388...
2.604651
43
import json from app.core.constructor import ConstructorAbstract from app.dao.test_case.TestCaseDao import TestCaseDao from app.models.constructor import Constructor
[ 11748, 33918, 198, 198, 6738, 598, 13, 7295, 13, 41571, 273, 1330, 28407, 273, 23839, 198, 6738, 598, 13, 67, 5488, 13, 9288, 62, 7442, 13, 14402, 20448, 35, 5488, 1330, 6208, 20448, 35, 5488, 198, 6738, 598, 13, 27530, 13, 41571, 2...
3.574468
47
# https://www.hackerrank.com/challenges/2d-array/problem?h_l=interview&playlist_slugs%5B%5D=interview-preparation-kit&playlist_slugs%5B%5D=arrays arr = [] for _ in range(6): arr.append(list(map(int, input().rstrip().split()))) hourglassSum(arr)
[ 2, 3740, 1378, 2503, 13, 31153, 8056, 962, 13, 785, 14, 36747, 34120, 14, 17, 67, 12, 18747, 14, 45573, 30, 71, 62, 75, 28, 3849, 1177, 5, 1759, 4868, 62, 6649, 10339, 4, 20, 33, 4, 20, 35, 28, 3849, 1177, 12, 3866, 1845, 341,...
2.345794
107
# coding=utf-8 # Copyright 2021 The Google Research Authors. # # 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 applicab...
[ 2, 19617, 28, 40477, 12, 23, 198, 2, 15069, 33448, 383, 3012, 4992, 46665, 13, 198, 2, 198, 2, 49962, 739, 262, 24843, 13789, 11, 10628, 362, 13, 15, 357, 1169, 366, 34156, 15341, 198, 2, 345, 743, 407, 779, 428, 2393, 2845, 287, ...
2.813266
1,387
import random from fn import build_tweet from fn import get from fn import instaAPI from fn import media from fn import storage from fn import twitterAPI from fn.classes import Ftext
[ 11748, 4738, 198, 198, 6738, 24714, 1330, 1382, 62, 83, 7277, 198, 6738, 24714, 1330, 651, 198, 6738, 24714, 1330, 916, 64, 17614, 198, 6738, 24714, 1330, 2056, 198, 6738, 24714, 1330, 6143, 198, 6738, 24714, 1330, 17044, 17614, 198, 67...
3.78
50
""" Provides application configuration for Figures. As well as default values for running Figures along with functions to add entries to the Django conf settings needed to run Figures. """ from django.apps import AppConfig try: from openedx.core.djangoapps.plugins.constants import ( ProjectType, Settings...
[ 37811, 198, 15946, 1460, 3586, 8398, 329, 36574, 13, 198, 198, 1722, 880, 355, 4277, 3815, 329, 2491, 36574, 1863, 351, 5499, 284, 198, 2860, 12784, 284, 262, 37770, 1013, 6460, 2622, 284, 1057, 36574, 13, 198, 37811, 198, 198, 6738, ...
2.205722
734
import requests import subprocess import time import sched import xml.etree.ElementTree as xmlET import configparser from pyautogui import press parser = configparser.ConfigParser() #parser.read('C:\\Users\\user\\Desktop\\config.INI') parser.read('C:\\Users\\Morgan.Rehnberg\\Desktop\\config.INI') config = parser['Conf...
[ 11748, 7007, 198, 11748, 850, 14681, 198, 11748, 640, 198, 11748, 6038, 198, 11748, 35555, 13, 316, 631, 13, 20180, 27660, 355, 35555, 2767, 198, 11748, 4566, 48610, 198, 6738, 12972, 2306, 519, 9019, 1330, 1803, 198, 198, 48610, 796, 4...
3.04
400
#!/usr/bin/env python import sys import argparse import pandas as pd if __name__ == "__main__": options = get_options() m = pd.read_csv(options.df, sep='\t', index_col=0) s = pd.read_csv(options.matrix, sep='\t', index_col=0) idx = s.index.intersection(m.index) s.loc[idx, idx].to_csv(sys.stdou...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 628, 198, 11748, 25064, 198, 11748, 1822, 29572, 198, 11748, 19798, 292, 355, 279, 67, 628, 198, 198, 361, 11593, 3672, 834, 6624, 366, 834, 12417, 834, 1298, 198, 220, 220, 220, 3689, 796,...
2.22
150
from bql.bql import BQLParser, BQLError
[ 6738, 275, 13976, 13, 65, 13976, 1330, 347, 9711, 46677, 11, 347, 48, 2538, 81, 1472 ]
2.4375
16
import io import os import matplotlib import matplotlib.pyplot as plt import numpy as np import scipy.ndimage as ndimage from PIL import Image #Plot the figure ###Save the figure #Return heatmap array
[ 11748, 33245, 198, 11748, 28686, 198, 198, 11748, 2603, 29487, 8019, 198, 11748, 2603, 29487, 8019, 13, 9078, 29487, 355, 458, 83, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 629, 541, 88, 13, 358, 9060, 355, 299, 67, 9060, 198, 6...
2.986301
73
# -*- coding: utf-8 -*- from nltk.corpus import stopwords as _stopwords from curses.ascii import isascii import unicodedata language = "swedish" stopwords = list(_stopwords.words(language)) punctuation = u'!(),-.:;?' make_ascii = lambda text: \ filter(isascii, unicodedata.normalize('NFD', text).encode('utf-8'))
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 6738, 299, 2528, 74, 13, 10215, 79, 385, 1330, 2245, 10879, 355, 4808, 11338, 10879, 198, 6738, 43878, 13, 292, 979, 72, 1330, 318, 292, 979, 72, 198, 11748, 28000, 90...
2.552
125
import sys
[ 11748, 25064, 198 ]
3.666667
3
from selenium import webdriver from selenium.webdriver.support.ui import Select from selenium.webdriver.common.keys import Keys from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from bs4 import BeautifulSo...
[ 6738, 384, 11925, 1505, 1330, 3992, 26230, 198, 6738, 384, 11925, 1505, 13, 12384, 26230, 13, 11284, 13, 9019, 1330, 9683, 198, 6738, 384, 11925, 1505, 13, 12384, 26230, 13, 11321, 13, 13083, 1330, 26363, 198, 6738, 384, 11925, 1505, 13...
2.354872
975
# Copyright 2019 Matthew Hayes # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to in writing, s...
[ 2, 15069, 13130, 9308, 25109, 198, 198, 2, 49962, 739, 262, 24843, 13789, 11, 10628, 362, 13, 15, 357, 1169, 366, 34156, 15341, 198, 2, 345, 743, 407, 779, 428, 2393, 2845, 287, 11846, 351, 262, 13789, 13, 198, 2, 921, 743, 7330, ...
3.651163
215
from ..models import * from login.models import * #
[ 6738, 11485, 27530, 1330, 1635, 198, 6738, 17594, 13, 27530, 1330, 1635, 198, 2, 628, 628, 628 ]
3.352941
17
user = "" password = "" port = ""
[ 7220, 796, 13538, 198, 28712, 796, 13538, 198, 634, 796, 13538 ]
3
11
import numpy as np import matplotlib.pyplot as plt import torch import cv2 cv2.setNumThreads(0) import os import pdb from PIL import Image from scipy.optimize import minimize from config import TYPE_ID_CONVERSION from shapely.geometry import Polygon from config import cfg from utils.visualizer import Visualizer from ...
[ 11748, 299, 32152, 355, 45941, 198, 11748, 2603, 29487, 8019, 13, 9078, 29487, 355, 458, 83, 198, 11748, 28034, 198, 11748, 269, 85, 17, 198, 33967, 17, 13, 2617, 33111, 16818, 82, 7, 15, 8, 198, 11748, 28686, 198, 11748, 279, 9945, ...
2.516556
302
from booru_extension.altbooru import Gelbooru, Safebooru
[ 6738, 1489, 27786, 62, 2302, 3004, 13, 2501, 2127, 27786, 1330, 29635, 2127, 27786, 11, 6895, 1765, 2675, 84 ]
2.947368
19
from __future__ import absolute_import from django.http import Http404 from sentry.constants import ObjectStatus from sentry.api.bases.organization import ( OrganizationEndpoint, OrganizationIntegrationsPermission ) from sentry.integrations.exceptions import IntegrationError from sentry.integrations.repositories ...
[ 6738, 11593, 37443, 834, 1330, 4112, 62, 11748, 198, 198, 6738, 42625, 14208, 13, 4023, 1330, 367, 29281, 26429, 198, 198, 6738, 1908, 563, 13, 9979, 1187, 1330, 9515, 19580, 198, 6738, 1908, 563, 13, 15042, 13, 65, 1386, 13, 9971, 16...
3.897959
98
from . import launchable subset = launchable.CommonSubsetImpls(__name__).scan_files('*_spec.rb') record_tests = launchable.CommonRecordTestImpls(__name__).report_files()
[ 6738, 764, 1330, 4219, 540, 198, 198, 7266, 2617, 796, 4219, 540, 13, 17227, 7004, 2617, 29710, 82, 7, 834, 3672, 834, 737, 35836, 62, 16624, 10786, 9, 62, 16684, 13, 26145, 11537, 198, 22105, 62, 41989, 796, 4219, 540, 13, 17227, 2...
3.053571
56
""" This module defines classes for various parts of the franka-allegro robot. """ from .types import SpideyDim from .spidey import SpideyBot # EOF
[ 37811, 198, 1212, 8265, 15738, 6097, 329, 2972, 3354, 286, 262, 14346, 64, 12, 282, 1455, 305, 9379, 13, 198, 37811, 198, 198, 6738, 764, 19199, 1330, 1338, 485, 88, 29271, 198, 6738, 764, 2777, 485, 88, 1330, 1338, 485, 88, 20630, ...
3.145833
48
import stat import ast import os import configparser from .constants import * from .exceptions import OAuthSSHError class ConfigError(OAuthSSHError): """Base exception for all Config exceptions"""
[ 11748, 1185, 198, 11748, 6468, 198, 11748, 28686, 198, 11748, 4566, 48610, 198, 198, 6738, 764, 9979, 1187, 1330, 1635, 198, 6738, 764, 1069, 11755, 1330, 440, 30515, 5432, 39, 12331, 628, 198, 4871, 17056, 12331, 7, 23621, 1071, 5432, ...
3.55
60
import asyncio from rtcbot import SerialConnection import logging logging.basicConfig(level=logging.DEBUG) loop = asyncio.get_event_loop() conn = SerialConnection("/dev/ttyACM0", startByte=bytes([192, 105])) @conn.onReady asyncio.ensure_future(sendAndReceive(conn)) loop.run_forever()
[ 11748, 30351, 952, 198, 6738, 374, 23047, 13645, 1330, 23283, 32048, 198, 198, 11748, 18931, 198, 198, 6404, 2667, 13, 35487, 16934, 7, 5715, 28, 6404, 2667, 13, 30531, 8, 628, 198, 198, 26268, 796, 30351, 952, 13, 1136, 62, 15596, 62...
2.864078
103
from configparser import ConfigParser import argparse import json import sys from urllib import parse, request, error from pprint import pp import style BASE_WEATHER_API_URL = 'http://api.openweathermap.org/data/2.5/weather' # Weather Condition Codes THUNDERSTORM = range(200, 300) DRIZZLE = range(300, 400) RAIN = ra...
[ 6738, 4566, 48610, 1330, 17056, 46677, 198, 11748, 1822, 29572, 198, 11748, 33918, 198, 11748, 25064, 198, 6738, 2956, 297, 571, 1330, 21136, 11, 2581, 11, 4049, 198, 6738, 279, 4798, 1330, 9788, 198, 198, 11748, 3918, 198, 198, 33, 111...
2.587302
378
N, M = map(int, input().split()) if N == M: print('Yes') else: print('No')
[ 45, 11, 337, 796, 3975, 7, 600, 11, 5128, 22446, 35312, 28955, 198, 198, 361, 399, 6624, 337, 25, 198, 220, 220, 220, 3601, 10786, 5297, 11537, 198, 17772, 25, 198, 220, 220, 220, 3601, 10786, 2949, 11537, 198 ]
2.153846
39
import os as _os import tensorflow as _tf from time import gmtime, strftime import logging import logging.handlers _logger = None _FLAGS = _tf.app.flags.FLAGS
[ 11748, 28686, 355, 4808, 418, 198, 11748, 11192, 273, 11125, 355, 4808, 27110, 198, 6738, 640, 1330, 308, 76, 2435, 11, 965, 31387, 198, 11748, 18931, 198, 11748, 18931, 13, 4993, 8116, 198, 198, 62, 6404, 1362, 796, 6045, 198, 62, 38...
2.945455
55
''' calculate film strength''' import operator
[ 7061, 6, 15284, 2646, 4202, 7061, 6, 628, 198, 11748, 10088, 628 ]
4.166667
12
""" Contains helper methods that are used to train and infer Tarteel ML models """ import dill as pickle import numpy as np import os def convert_list_of_arrays_to_padded_array(list_varying_sizes, pad_value=0): """ Converts a list of 2D arrays of varying sizes to a single 3D numpy array. The extra elements ar...
[ 37811, 198, 4264, 1299, 31904, 5050, 326, 389, 973, 284, 4512, 290, 13249, 309, 32074, 417, 10373, 4981, 198, 37811, 198, 11748, 288, 359, 355, 2298, 293, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 28686, 628, 198, 4299, 10385, 62,...
2.688488
2,658
from .models import * from .keyvalue import *
[ 6738, 764, 27530, 1330, 1635, 198, 6738, 764, 2539, 8367, 1330, 1635 ]
3.75
12
import csv import urllib2 import re from datetime import datetime, timedelta from django.conf import settings from google.appengine.api import memcache from google.appengine.api import urlfetch from bs4 import BeautifulSoup from gempa.models import Gempa, Event def str_to_datetime(datetime_str): """ Conve...
[ 11748, 269, 21370, 198, 11748, 2956, 297, 571, 17, 198, 11748, 302, 198, 6738, 4818, 8079, 1330, 4818, 8079, 11, 28805, 12514, 198, 198, 6738, 42625, 14208, 13, 10414, 1330, 6460, 198, 198, 6738, 23645, 13, 1324, 18392, 13, 15042, 1330,...
2.047065
1,891
"""setup.py""" from codecs import open as codecs_open from setuptools import setup with codecs_open('README.rst', 'r', 'utf-8') as f: readme = f.read() setup( name='mipy', version='0.0.1', description='Copy files to Micropython', long_description=readme, author='Beau Barker', author_email...
[ 37811, 40406, 13, 9078, 37811, 198, 198, 6738, 40481, 82, 1330, 1280, 355, 40481, 82, 62, 9654, 198, 6738, 900, 37623, 10141, 1330, 9058, 198, 198, 4480, 40481, 82, 62, 9654, 10786, 15675, 11682, 13, 81, 301, 3256, 705, 81, 3256, 705,...
2.273469
245
from core import db from .category import Category
[ 6738, 4755, 1330, 20613, 198, 6738, 764, 22872, 1330, 21743, 198 ]
4.636364
11
def max_profit(a): """ write a function that takes a list of prices a and returns the max profit possible by buying at a given price then selling at a future price, for e.g. [2, 5, 1, 3, 10] should return 9 (10 - 1) [4, 3, 2, 1] should return 0 (prices are always decreasing) """ if len(a) =...
[ 4299, 3509, 62, 9183, 7, 64, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 3551, 257, 2163, 326, 2753, 257, 1351, 286, 4536, 257, 290, 5860, 262, 3509, 7630, 1744, 416, 7067, 379, 257, 1813, 198, 220, 220, 220, 2756, 788, 6...
2.417508
297
""" Plotting the comparison of optimizers ====================================== Plots the results from the comparison of optimizers. """ import pickle import sys import numpy as np import matplotlib.pyplot as plt results = pickle.load(open( 'helper/compare_optimizers_py%s.pkl' % sys.version_info[0], 'rb')...
[ 37811, 198, 43328, 889, 262, 7208, 286, 6436, 11341, 198, 10052, 50155, 198, 198, 3646, 1747, 262, 2482, 422, 262, 7208, 286, 6436, 11341, 13, 198, 198, 37811, 198, 198, 11748, 2298, 293, 198, 11748, 25064, 198, 198, 11748, 299, 32152, ...
2.243604
899
from IPython.utils import io import numpy as np import sys import math import re import csv distFile = sys.argv[1] gtFile = sys.argv[2] dataV = np.transpose(np.loadtxt(gtFile, delimiter=",",skiprows=1)).astype('float') ids, t_esv, t_edv= dataV smallest_id=100000 with open(distFile, 'r') as csvfile: distsCV=csv.re...
[ 6738, 6101, 7535, 13, 26791, 1330, 33245, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 25064, 198, 11748, 10688, 198, 11748, 302, 198, 11748, 269, 21370, 198, 198, 17080, 8979, 796, 25064, 13, 853, 85, 58, 16, 60, 198, 13655, 8979, ...
2.052533
533
# Generated by Django 2.2.12 on 2020-05-13 07:43 from django.db import migrations, models
[ 2, 2980, 515, 416, 37770, 362, 13, 17, 13, 1065, 319, 12131, 12, 2713, 12, 1485, 8753, 25, 3559, 198, 198, 6738, 42625, 14208, 13, 9945, 1330, 15720, 602, 11, 4981, 628 ]
2.875
32
# python3 -m pip install -U discord.py # pip install requests import sys import time import discord from discord.ext import tasks import requests import json import conoha_wrap import conoha_main import conoha_sub import utility import datetime from config import * client = discord.Client() client.isProcessing = Fal...
[ 2, 21015, 18, 532, 76, 7347, 2721, 532, 52, 36446, 13, 9078, 198, 2, 7347, 2721, 7007, 198, 198, 11748, 25064, 198, 11748, 640, 198, 11748, 36446, 198, 6738, 36446, 13, 2302, 1330, 8861, 198, 11748, 7007, 198, 11748, 33918, 198, 11748...
2.624365
197
#!/usr/bin/env python """ Does Deep Q-Learning for Snake """ # Import Modules import numpy as np import tensorflow as tf import os from single_player_game import SinglePlayerGame from q_graph import QGraph import epsilon_method class ExperienceTuple: """ ExperienceTuple data structure for DeepRFLearner """ cla...
[ 198, 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 37811, 198, 13921, 10766, 1195, 12, 41730, 329, 16705, 198, 198, 37811, 198, 198, 2, 17267, 3401, 5028, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 11192, 273, 11125, 355, 48700...
2.079926
2,690
student = { "firstName": "Prasad", "lastName": "Honrao", "age": 37 } try: #try to get wrong value from dictionary last_name = student["last_name"] except KeyError as error: print("Exception thrown!") print(error) print("Done!")
[ 50139, 796, 1391, 201, 198, 220, 220, 220, 366, 11085, 5376, 1298, 366, 6836, 292, 324, 1600, 201, 198, 220, 220, 220, 366, 12957, 5376, 1298, 366, 29478, 430, 78, 1600, 201, 198, 220, 220, 220, 366, 496, 1298, 5214, 201, 198, 92, ...
2.368421
114
#!/usr/bin/env python2 import functools import os.path import time, zipfile, sys import StringIO import Krakatau from Krakatau import script_util from Krakatau.classfileformat.reader import Reader from Krakatau.classfileformat.classdata import ClassData from Krakatau.assembler.disassembly import Disassembler if __nam...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 17, 198, 11748, 1257, 310, 10141, 198, 11748, 28686, 13, 6978, 198, 11748, 640, 11, 19974, 7753, 11, 25064, 198, 11748, 10903, 9399, 198, 198, 11748, 509, 17716, 265, 559, 198, 6738, 509, 1...
2.928709
519
import gym if __name__ == "__main__": env = gym.make('BipedalWalkerHardcore-v2') # get initial obsevation of the environment observation = env.reset() while (True): env.render() print(observation); # choose the action to take action = env.action_space.sample() ...
[ 11748, 11550, 198, 198, 361, 11593, 3672, 834, 6624, 366, 834, 12417, 834, 1298, 198, 220, 220, 220, 17365, 796, 11550, 13, 15883, 10786, 33, 46647, 282, 39950, 17309, 7295, 12, 85, 17, 11537, 628, 220, 220, 220, 1303, 651, 4238, 909,...
2.557823
147
# -*- coding: utf-8 -*- """ @author: Quentin DUCASSE """ import unittest from som.vmobjects.object import Object from som.vmobjects.string import String
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 37811, 198, 31, 9800, 25, 42447, 360, 9598, 1921, 5188, 198, 37811, 628, 198, 11748, 555, 715, 395, 198, 6738, 3870, 13, 14761, 48205, 13, 15252, 1330, 9515, 198, 6738, ...
2.924528
53
""" The experiment MAIN for GERMAN. """ import warnings warnings.filterwarnings('ignore') from adversarial_models import * from utils import * from get_data import * from sklearn.model_selection import train_test_split from sklearn.preprocessing import StandardScaler import numpy as np import pandas as pd import ...
[ 37811, 198, 464, 6306, 8779, 1268, 329, 44186, 10725, 13, 198, 37811, 198, 11748, 14601, 198, 40539, 654, 13, 24455, 40539, 654, 10786, 46430, 11537, 220, 198, 198, 6738, 16907, 36098, 62, 27530, 1330, 1635, 220, 198, 6738, 3384, 4487, ...
3.067771
1,328
import numpy as np
[ 11748, 299, 32152, 355, 45941, 628 ]
3.333333
6
# __dict__ vs __slots__ import sys a = A(1, 2) assert '__dict__' in dir(a) # 'b' will have a lower memory footprint (no dict) and provide faster attribute # access (again, no need to go through a dict when accessing them) than 'a' due # to the use of __slots__: b = B(1, 2) assert '__dict__' not in dir(b)
[ 2, 11593, 11600, 834, 3691, 11593, 6649, 1747, 834, 198, 198, 11748, 25064, 198, 198, 64, 796, 317, 7, 16, 11, 362, 8, 198, 30493, 705, 834, 11600, 834, 6, 287, 26672, 7, 64, 8, 198, 198, 2, 705, 65, 6, 481, 423, 257, 2793, 40...
2.783784
111
import pytest from dlms_cosem.protocol.wrappers import DlmsUdpMessage, WrapperHeader data_examples_encrypted_data_nofication = [ b"\x00\x01\x00\x01\x00\x01\x00F\xdb\x08/\x19\"\x91\x99\x16A\x03;0\x00\x00\x01\xe5\x02\\\xe9\xd2'\x1f\xd7\x8b\xe8\xc2\x04!\x1a\x91j\x9d\x7fX~\nz\x81L\xad\xea\x89\xe9Y?\x01\xf9.\xa8\xc0\x...
[ 11748, 12972, 9288, 198, 198, 6738, 288, 75, 907, 62, 66, 577, 76, 13, 11235, 4668, 13, 29988, 11799, 1330, 360, 75, 907, 52, 26059, 12837, 11, 27323, 2848, 39681, 198, 198, 7890, 62, 1069, 12629, 62, 43628, 62, 7890, 62, 77, 1659, ...
1.368349
2,932
""" Numba support for MultiVector objects. For now, this just supports .value wrapping / unwrapping """ import numba import operator import numpy as np from numba.extending import NativeValue import llvmlite.ir try: # module locations as of numba 0.49.0 import numba.np.numpy_support as _numpy_support from...
[ 37811, 198, 45, 2178, 64, 1104, 329, 15237, 38469, 5563, 13, 198, 198, 1890, 783, 11, 428, 655, 6971, 764, 8367, 27074, 1220, 7379, 430, 2105, 198, 37811, 198, 11748, 997, 7012, 198, 11748, 10088, 198, 11748, 299, 32152, 355, 45941, 1...
2.817225
1,045
"""Plugin-wide utility data.""" # Docker uses all of these env variables to connect to the docker # server process DOCKER_ENV_VARS = [ "DOCKER_CERT_PATH", "DOCKER_CONFIG", "DOCKER_CONTENT_TRUST_SERVER", "DOCKER_CONTENT_TRUST", "DOCKER_CONTEXT", "DOCKER_DEFAULT_PLATFORM", "DOCKER_HIDE_LEGACY...
[ 37811, 37233, 12, 4421, 10361, 1366, 526, 15931, 198, 198, 2, 25716, 3544, 477, 286, 777, 17365, 9633, 284, 2018, 284, 262, 36253, 198, 2, 4382, 1429, 198, 35, 11290, 1137, 62, 1677, 53, 62, 53, 27415, 796, 685, 198, 220, 220, 220, ...
2.053097
226
# Autoencoder development import numpy as np import matplotlib.pyplot as plt from ae_module import AE_model from keras.datasets import mnist if __name__ == '__main__': # load and prep MNIST data (x_train, _), (x_test, _) = mnist.load_data() x_train = x_train.astype('float32') / 255. x_test = x_test...
[ 2, 5231, 6571, 66, 12342, 2478, 198, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 2603, 29487, 8019, 13, 9078, 29487, 355, 458, 83, 198, 198, 6738, 257, 68, 62, 21412, 1330, 25603, 62, 19849, 198, 198, 6738, 41927, 292, 13, 19608, ...
2.318937
301
# -*- coding: utf-8 -*- # This code is part of Qiskit. # # (C) Copyright IBM 2018, 2020. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any...
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 198, 2, 770, 2438, 318, 636, 286, 1195, 1984, 270, 13, 198, 2, 198, 2, 357, 34, 8, 15069, 19764, 2864, 11, 12131, 13, 198, 2, 198, 2, 770, 2438, 318, 11971, 739, ...
2.345865
1,064
from abc import ABC, abstractmethod
[ 6738, 450, 66, 1330, 9738, 11, 12531, 24396, 628 ]
4.111111
9
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sat Apr 18 16:38:07 2020 This file includes functions which are helpful to visualize the partitions and the Q functions for the Oil and Ambulance problems. """ import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import axes3d, Axes...
[ 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, 7031, 2758, 1248, 1467, 25, 2548, 25, 2998, 12131, 198, 198, 1212, 2393, 3407, 5499, 543, ...
2.284476
3,691
'''5.WAP to input a list and arrange the list in ascending order with bubble sort''' l=eval(input("Enter the list: ")) for j in range(0,len(l)): for i in range(0,len(l)-1): if(l[i]>l[i+1]): l[i+1],l[i]=l[i],l[i+1] print(l)
[ 7061, 6, 20, 13, 54, 2969, 284, 5128, 257, 1351, 290, 21674, 262, 1351, 287, 41988, 1502, 351, 14310, 3297, 7061, 6, 198, 198, 75, 28, 18206, 7, 15414, 7203, 17469, 262, 1351, 25, 366, 4008, 198, 1640, 474, 287, 2837, 7, 15, 11, ...
1.976
125
#!/usr/bin/python # -*- coding: utf-8 -*- from pnp_gen.generator import Generator from pnp_actions.pn_action import PNAction from pnp_actions.recovery import Recovery, Before, During, After from pnp_kb.queries import LocalQuery, RemoteQuery, Query from pnp_kb.external_knowledge_base import ExternalKnowledgeBase from p...
[ 2, 48443, 14629, 14, 8800, 14, 29412, 198, 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 198, 6738, 279, 37659, 62, 5235, 13, 8612, 1352, 1330, 35986, 198, 6738, 279, 37659, 62, 4658, 13, 21999, 62, 2673, 1330, 35...
3.375
192
import numpy as np import astropy.units as u from astropy import constants as const from ...util import set_units from ...config import default_units from ...field import Field from ...external import get_PHOENIX_spectrum, get_BT_SETTL_spectrum from .base import SpectralModel from .util import make_spectrum_unit_field...
[ 11748, 299, 32152, 355, 45941, 198, 11748, 6468, 28338, 13, 41667, 355, 334, 198, 6738, 6468, 28338, 1330, 38491, 355, 1500, 198, 198, 6738, 2644, 22602, 1330, 900, 62, 41667, 198, 6738, 2644, 11250, 1330, 4277, 62, 41667, 198, 6738, 26...
3.208955
134
""" Django settings for lsql project. Loads settings_shared and settings_dev or settings_deploy depending on the value of DJANGO_DEVELOPMENT Generated by 'django-admin startproject' using Django 3.0.7. For more information on this file, see https://docs.djangoproject.com/en/3.0/topics/settings/ For the full list of ...
[ 37811, 198, 35, 73, 14208, 6460, 329, 300, 25410, 1628, 13, 8778, 82, 6460, 62, 28710, 290, 6460, 62, 7959, 393, 6460, 62, 2934, 1420, 198, 44023, 319, 262, 1988, 286, 13004, 1565, 11230, 62, 7206, 18697, 3185, 10979, 198, 198, 8645, ...
3.138075
239
from typing import Iterator, Iterable, Tuple, Dict, Any, Callable, Optional from .misc import static_vars __all__ = ['DUNDERMETHOD_NAMES', 'AUGMENTED_ASSIGNMENT_DUNDERMETHOD_NAMES', 'iter_class_dundermethods', 'class_implements_dundermethod', 'class_implements_any_dundermethod', 'class_implements_dunderme...
[ 198, 6738, 19720, 1330, 40806, 1352, 11, 40806, 540, 11, 309, 29291, 11, 360, 713, 11, 4377, 11, 4889, 540, 11, 32233, 198, 198, 6738, 764, 44374, 1330, 9037, 62, 85, 945, 198, 198, 834, 439, 834, 796, 37250, 35, 4944, 14418, 49273,...
2.446991
3,839
# copy from https://github.com/LianShuaiLong/CV_Applications/blob/master/classification/classification-pytorch/backbones/vgg19.py import torch import torch.nn as nn device = 'cuda' if torch.cuda.is_available() else 'cpu' model = ConvNet(in_channels=3,num_classes=1000,bn=True).to(device) # 双线性汇合 biliear pooling ????...
[ 2, 4866, 422, 3740, 1378, 12567, 13, 785, 14, 43, 666, 2484, 84, 1872, 14617, 14, 33538, 62, 41995, 14, 2436, 672, 14, 9866, 14, 4871, 2649, 14, 4871, 2649, 12, 9078, 13165, 354, 14, 1891, 35095, 14, 85, 1130, 1129, 13, 9078, 198,...
1.723902
2,050
# -*- coding: utf-8 -*- """ Created on Thu Jun 6 21:38:42 2019 """ import numpy as np from scipy import linalg # try to keep it in block ##################### basic functions ################################################ def mass_action_law (ln_X, ln_K, A): ''' all inputs are numpy arrays!!! ...
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 37811, 198, 41972, 319, 26223, 7653, 220, 718, 2310, 25, 2548, 25, 3682, 13130, 198, 198, 37811, 198, 198, 11748, 299, 32152, 355, 45941, 198, 6738, 629, 541, 88, 1330, ...
2.291097
3,875
import time import logging from PyQt5 import QtCore import qcodes import qcodes.logger as logger from qcodes.logger import start_all_logging from keysight_fpga.sd1.fpga_utils import \ print_fpga_info, config_fpga_debug_log, print_fpga_log from keysight_fpga.sd1.dig_iq import load_iq_image from keysight_fpga.qcod...
[ 11748, 640, 198, 11748, 18931, 198, 6738, 9485, 48, 83, 20, 1330, 33734, 14055, 198, 198, 11748, 10662, 40148, 198, 11748, 10662, 40148, 13, 6404, 1362, 355, 49706, 198, 6738, 10662, 40148, 13, 6404, 1362, 1330, 923, 62, 439, 62, 6404, ...
2.187017
1,294
import torch import torch.autograd from torch.autograd import Variable from revnet import RevBlock, RevBlockFunction import unittest from .common import TestCase if __name__ == '__main__': unittest.main()
[ 11748, 28034, 198, 11748, 28034, 13, 2306, 519, 6335, 198, 6738, 28034, 13, 2306, 519, 6335, 1330, 35748, 198, 198, 6738, 2710, 3262, 1330, 5416, 12235, 11, 5416, 12235, 22203, 198, 198, 11748, 555, 715, 395, 198, 198, 6738, 764, 11321,...
3.161765
68
#!/usr/bin/env python """ .. py:currentmodule:: FileFormat.Results.DetectorParameters .. moduleauthor:: Hendrix Demers <hendrix.demers@mail.mcgill.ca> MCXRay detector parameters from results file. """ # Script information for the file. __author__ = "Hendrix Demers (hendrix.demers@mail.mcgill.ca)" __version_...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 201, 198, 37811, 201, 198, 492, 12972, 25, 14421, 21412, 3712, 9220, 26227, 13, 25468, 13, 11242, 9250, 48944, 201, 198, 492, 8265, 9800, 3712, 14666, 8609, 1897, 364, 1279, 15631, 8609, 13, ...
2.486807
758
#network of nodes #Alan Balu #import statements import numpy as np, math import matplotlib.pyplot as plt import pandas as pd from pprint import pprint import networkx as nx import matplotlib.pyplot as plt import community import glob import statistics #function to examine the degree of nodes in ...
[ 2, 27349, 286, 13760, 201, 198, 2, 36235, 8528, 84, 201, 198, 201, 198, 2, 11748, 6299, 201, 198, 11748, 299, 32152, 355, 45941, 11, 10688, 201, 198, 11748, 2603, 29487, 8019, 13, 9078, 29487, 355, 458, 83, 201, 198, 11748, 19798, 2...
3.584906
212
# ============================================================================ # # Copyright (C) 2007-2016 Conceptive Engineering bvba. # www.conceptive.be / info@conceptive.be # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following condition...
[ 2, 220, 38093, 2559, 18604, 198, 2, 198, 2, 220, 15069, 357, 34, 8, 4343, 12, 5304, 1482, 25867, 14044, 275, 85, 7012, 13, 198, 2, 220, 7324, 13, 1102, 25867, 13, 1350, 1220, 7508, 31, 1102, 25867, 13, 1350, 198, 2, 198, 2, 220,...
3.620865
786
# proxy module from traitsui.key_bindings import *
[ 2, 15741, 8265, 198, 6738, 12796, 9019, 13, 2539, 62, 21653, 654, 1330, 1635, 198 ]
3.4
15
from ..parser import LR1Parser from .grammar import CoolGrammar CoolParser = LR1Parser(CoolGrammar)
[ 6738, 11485, 48610, 1330, 37491, 16, 46677, 198, 6738, 764, 4546, 3876, 1330, 15226, 38, 859, 3876, 198, 198, 34530, 46677, 796, 37491, 16, 46677, 7, 34530, 38, 859, 3876, 8, 198 ]
3.15625
32
"""Test make_dataset.py.""" import configparser import yaml def test_download_data(): """test if the output parameters of the make_dataset module are correct.""" config = configparser.ConfigParser() config.read("configs.ini") output_dir = config["datasets"]["raw_folder"] with open("dvc.yaml", "r"...
[ 37811, 14402, 787, 62, 19608, 292, 316, 13, 9078, 526, 15931, 198, 11748, 4566, 48610, 198, 11748, 331, 43695, 628, 198, 4299, 1332, 62, 15002, 62, 7890, 33529, 198, 220, 220, 220, 37227, 9288, 611, 262, 5072, 10007, 286, 262, 787, 62...
2.623596
178
__author__ = 'Nina Stawski' __contact__ = 'me@ninastawski.com' import os def resetPrpr(): """ Removes all files from working directories, invokes prpr setup. """ os.remove('prpr.db') dirs = ['esc', 'incoming', 'logs', 'tables'] for dir in dirs: files = os.listdir(dir) for file ...
[ 834, 9800, 834, 796, 705, 45, 1437, 520, 8356, 4106, 6, 198, 834, 32057, 834, 796, 705, 1326, 31, 35073, 459, 8356, 4106, 13, 785, 6, 198, 198, 11748, 28686, 198, 198, 4299, 13259, 6836, 1050, 33529, 198, 220, 220, 220, 37227, 198, ...
2.266332
199
from xml.dom import NamespaceErr import hashlib from urllib.parse import urlparse from dojo.models import Endpoint, Finding from defusedxml import ElementTree __author__ = 'propersam'
[ 6738, 35555, 13, 3438, 1330, 28531, 10223, 9139, 81, 198, 11748, 12234, 8019, 198, 6738, 2956, 297, 571, 13, 29572, 1330, 19016, 29572, 198, 6738, 466, 7639, 13, 27530, 1330, 5268, 4122, 11, 27063, 198, 6738, 825, 1484, 19875, 1330, 117...
3.444444
54
pre_processData("Population.csv")
[ 628, 198, 3866, 62, 14681, 6601, 7203, 45251, 13, 40664, 4943 ]
3.272727
11
"""jc - JSON CLI output utility `lsof` command output parser Usage (cli): $ lsof | jc --lsof or $ jc lsof Usage (module): import jc.parsers.lsof result = jc.parsers.lsof.parse(lsof_command_output) Schema: [ { "command": string, "pid": integer, "tid...
[ 37811, 48055, 532, 19449, 43749, 5072, 10361, 4600, 75, 568, 69, 63, 3141, 5072, 30751, 198, 198, 28350, 357, 44506, 2599, 628, 220, 220, 220, 720, 300, 568, 69, 930, 474, 66, 1377, 75, 568, 69, 628, 220, 220, 220, 393, 628, 220, ...
1.918112
2,076