content
stringlengths
1
1.04M
input_ids
listlengths
1
774k
ratio_char_token
float64
0.38
22.9
token_count
int64
1
774k
import csv import codecs if __name__ == '__main__': main()
[ 11748, 269, 21370, 198, 11748, 40481, 82, 198, 198, 361, 11593, 3672, 834, 6624, 705, 834, 12417, 834, 10354, 198, 220, 220, 220, 1388, 3419, 198 ]
2.461538
26
# -*- Python -*- # This file is licensed under a pytorch-style license # See frontends/pytorch/LICENSE for license information. import torch import npcomp.frontends.pytorch as torch_mlir import npcomp.frontends.pytorch.test as test # RUN: %PYTHON %s | FileCheck %s model = torch.nn.LogSoftmax(dim=1) tensor = torch.ra...
[ 2, 532, 9, 12, 11361, 532, 9, 12, 198, 2, 770, 2393, 318, 11971, 739, 257, 12972, 13165, 354, 12, 7635, 5964, 198, 2, 4091, 2166, 2412, 14, 9078, 13165, 354, 14, 43, 2149, 24290, 329, 5964, 1321, 13, 198, 198, 11748, 28034, 198, ...
2.593301
209
#!/usr/bin/env python3 import pathlib import sys import subprocess pattern = sys.argv[1] for log in pathlib.Path(".").glob(pattern): print(log) basename = log.stem plot_name = "{}.pdf".format(basename) log_plot_name = "{}-log.pdf".format(basename) if not pathlib.Path(plot_name).exists(): su...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 11748, 3108, 8019, 198, 11748, 25064, 198, 11748, 850, 14681, 198, 198, 33279, 796, 25064, 13, 853, 85, 58, 16, 60, 198, 1640, 2604, 287, 3108, 8019, 13, 15235, 7203, 526, 737, 4...
2.369668
211
from cache_utility import cacheUtility from nltk import ngrams from nltk.tokenize import word_tokenize from nltk.corpus import stopwords import string import os from tika import parser #Support for podcast, machine learning, dialogue #Function to return the text from all of the true transcripts
[ 6738, 12940, 62, 315, 879, 1330, 12940, 18274, 879, 198, 198, 6738, 299, 2528, 74, 1330, 299, 4546, 82, 198, 6738, 299, 2528, 74, 13, 30001, 1096, 1330, 1573, 62, 30001, 1096, 198, 6738, 299, 2528, 74, 13, 10215, 79, 385, 1330, 2245...
3.54023
87
#!/usr/bin/env python # coding: utf-8 import matplotlib # matplotlib.use('Agg') import sys import numpy as np import glob import pypianoroll as ppr import time import music21 import os import argparse import torch import torch.utils.data from torch import nn, optim from torch.nn import functional as F from utils.utils...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 2, 19617, 25, 3384, 69, 12, 23, 198, 198, 11748, 2603, 29487, 8019, 198, 2, 2603, 29487, 8019, 13, 1904, 10786, 46384, 11537, 198, 11748, 25064, 198, 11748, 299, 32152, 355, 45941, 198...
2.340103
2,708
import sys, traceback # reload(sys) # sys.setdefaultencoding('utf-8') from PyQt5 import QtCore, QtGui, QtWidgets import datetime import pyqtgraph as pg import tushare as ts import numpy as np df = ts.get_hist_data('sh',start='2019-01-01',end='2027-12-01').sort_index() data = df.close.tolist() # 主窗口类 # 运行函数 if __nam...
[ 11748, 25064, 11, 12854, 1891, 198, 2, 18126, 7, 17597, 8, 198, 2, 25064, 13, 2617, 12286, 12685, 7656, 10786, 40477, 12, 23, 11537, 198, 6738, 9485, 48, 83, 20, 1330, 33734, 14055, 11, 33734, 8205, 72, 11, 33734, 54, 312, 11407, 19...
2.21519
158
# Callan M Keller # Fall 2019 # # Computer Organization # Experimenting with Wav import numpy as np import wave import file_io_wav as wavRW import matplotlib.pyplot as plt ## NOTE: to visualize wav data: plt.plot(data) #read .wav file as numpy array # Reduce amplitude of sound in file by half #...
[ 2, 4889, 272, 337, 35999, 201, 198, 2, 7218, 13130, 201, 198, 2, 201, 198, 2, 13851, 12275, 201, 198, 2, 29544, 278, 351, 370, 615, 201, 198, 201, 198, 11748, 299, 32152, 355, 45941, 201, 198, 11748, 6769, 201, 198, 11748, 2393, 6...
2.585714
210
#!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = 'ipetrash' if __name__ == '__main__': JSON_FORM_DATA = { "add": [ { "source_name": "WEB сайт", "source_uid": "a1fee7c0fc436088e64ba2e8822ba2b3", "created_at": "1529007000", ...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 198, 834, 9800, 834, 796, 705, 541, 21879, 1077, 6, 628, 198, 198, 361, 11593, 3672, 834, 6624, 705, 834, 12417, ...
1.254678
1,924
''' Author: Karan Sharma Probleum: Page 28 at [link] ''' import hashlib as hasher
[ 7061, 6, 198, 13838, 25, 9375, 272, 40196, 198, 198, 2964, 903, 388, 25, 198, 9876, 2579, 379, 685, 8726, 60, 198, 7061, 6, 198, 198, 11748, 12234, 8019, 355, 468, 372, 198 ]
2.545455
33
from threading import Thread, Event from datetime import datetime, timedelta from mininet.log import lg
[ 6738, 4704, 278, 1330, 14122, 11, 8558, 198, 6738, 4818, 8079, 1330, 4818, 8079, 11, 28805, 12514, 198, 198, 6738, 949, 42504, 13, 6404, 1330, 300, 70, 628 ]
3.785714
28
""" Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-Identifier: MIT-0 """ from cfnlint.rules import CloudFormationLintRule from cfnlint.rules import RuleMatch import cfnlint.helpers from cfnlint.data import AdditionalSpecs class UpdateReplacePolicyDeletionPolicyOnStatefulResourceTypes(...
[ 37811, 198, 15269, 6186, 13, 785, 11, 3457, 13, 393, 663, 29116, 13, 1439, 6923, 33876, 13, 198, 4303, 36227, 12, 34156, 12, 33234, 7483, 25, 17168, 12, 15, 198, 37811, 198, 6738, 30218, 21283, 600, 13, 38785, 1330, 10130, 8479, 341, ...
2.699387
815
from enum import Enum from .english import english_words from .french import french_words from .spanish import spanish_words dictionaries = { Languages.ENGLISH.value: english_words, Languages.FRENCH.value: french_words, # 92 words contain 5 characters and end with '-'. I don't know what this is. Lan...
[ 6738, 33829, 1330, 2039, 388, 198, 6738, 764, 39126, 1330, 46932, 62, 10879, 198, 6738, 764, 69, 3532, 1330, 48718, 62, 10879, 198, 6738, 764, 2777, 7115, 1330, 599, 7115, 62, 10879, 628, 198, 198, 67, 2867, 3166, 796, 1391, 198, 220,...
3.125984
127
from django.utils import timezone
[ 6738, 42625, 14208, 13, 26791, 1330, 640, 11340, 628, 198 ]
3.6
10
import numpy as np from typing import NamedTuple import sys sys.path.append("..") from bearx.tensor import Tensor Batch = NamedTuple("Batch", [("inputs", Tensor), ("targets", Tensor)])
[ 11748, 299, 32152, 355, 45941, 198, 6738, 19720, 1330, 34441, 51, 29291, 198, 11748, 25064, 198, 17597, 13, 6978, 13, 33295, 7203, 492, 4943, 198, 198, 6738, 6842, 87, 13, 83, 22854, 1330, 309, 22854, 220, 198, 198, 33, 963, 796, 3444...
2.863636
66
''' @Author: fxm @Date: Dec 27, 2020. @Title: Nnet class. ''' import os import time import argparse import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim import numpy as np from torchvision import datasets, transforms from torch.autograd import Variable from tqdm im...
[ 7061, 6, 198, 220, 220, 220, 2488, 13838, 25, 277, 87, 76, 198, 220, 220, 220, 2488, 10430, 25, 4280, 2681, 11, 12131, 13, 198, 220, 220, 220, 2488, 19160, 25, 399, 3262, 1398, 13, 198, 7061, 6, 198, 198, 11748, 28686, 198, 11748,...
1.232692
520
# coding: utf-8 __author__ = 'Sandro Vega Pons : https://www.kaggle.com/svpons' import numpy as np import pandas as pd from sklearn.preprocessing import LabelEncoder from sklearn.linear_model import SGDClassifier from sklearn.ensemble import RandomForestClassifier from sklearn.neighbors import KNeighborsClassifier fro...
[ 2, 19617, 25, 3384, 69, 12, 23, 198, 834, 9800, 834, 796, 705, 18471, 305, 30310, 350, 684, 1058, 3740, 1378, 2503, 13, 74, 9460, 293, 13, 785, 14, 21370, 79, 684, 6, 198, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 19798, 292...
2.140705
4,115
import rospy import subprocess from os import path from visualization_msgs.msg import Marker from visualization_msgs.msg import MarkerArray from numpy import inf import numpy as np import random import math from gazebo_msgs.msg import ModelState from squaternion import Quaternion from geometry_msgs.msg import Twist fro...
[ 11748, 686, 2777, 88, 198, 11748, 850, 14681, 198, 6738, 28686, 1330, 3108, 198, 6738, 32704, 62, 907, 14542, 13, 19662, 1330, 2940, 263, 198, 6738, 32704, 62, 907, 14542, 13, 19662, 1330, 2940, 263, 19182, 198, 6738, 299, 32152, 1330, ...
3.473088
353
from beet import Context, Function, sandbox from beet.contrib.render import render
[ 6738, 25679, 1330, 30532, 11, 15553, 11, 35204, 198, 6738, 25679, 13, 3642, 822, 13, 13287, 1330, 8543, 628, 628 ]
4.3
20
""" Time In Profile Pic..... Command: `.bloom` Hmmmm U need to config DOWNLOAD_PFP_URL_CLOCK var in Heroku with any telegraph image link ⚠️DISCLAIMER⚠️ USING THIS PLUGIN CAN RESULT IN ACCOUNT BAN. WE DONT CARE ABOUT BAN, SO WE ARR USING THIS. """ import asyncio import os import random import shutil from datetime impor...
[ 37811, 198, 7575, 554, 13118, 15085, 12359, 198, 21575, 25, 4600, 13, 2436, 4207, 63, 198, 39, 40133, 471, 761, 284, 4566, 30320, 35613, 62, 47, 5837, 62, 21886, 62, 5097, 11290, 1401, 287, 2332, 11601, 351, 597, 573, 16606, 2939, 279...
2.830189
212
#!/usr/bin/env python from gimpfu import * from miasmata_gimp import * font = Font('Georgia', 84.0, False) max_font_size = 84.0 max_width = 350 # Alternate close match: # font = Font('Century Schoolbook L Bold', 73.0, True) # status_size = 84.0 # notes_size = 78.0 # lab_size = 61.0 register( "miasmata_journal_t...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 198, 6738, 308, 11011, 20942, 1330, 1635, 198, 6738, 285, 16401, 1045, 62, 70, 11011, 1330, 1635, 198, 198, 10331, 796, 24060, 10786, 41072, 3256, 9508, 13, 15, 11, 10352, 8, 198, 9806...
2.55132
341
import json from os.path import join, dirname from watson_developer_cloud import VisualRecognitionV1Beta as VisualRecognition visual_recognition = VisualRecognition(username='YOUR SERVICE USERNAME', password='YOUR SERVICE PASSWORD') print(json.dumps(visual_recognition.labels(),...
[ 11748, 33918, 198, 6738, 28686, 13, 6978, 1330, 4654, 11, 26672, 3672, 198, 6738, 266, 13506, 62, 16244, 263, 62, 17721, 1330, 15612, 6690, 2360, 653, 53, 16, 43303, 355, 15612, 6690, 2360, 653, 628, 198, 41464, 62, 26243, 653, 796, 1...
2.610577
208
# store_data_file.py - Process JSON files from AWS S3 to PostgreSQL Database # forked from Joinville Smart Mobility Project and Louisville WazeCCPProcessor # modified by Bryan.Blackford@lacity.org for City of Los Angeles CCP # Database Config - fill in the details for your database here: DATABASE = { 'drivername': "po...
[ 2, 3650, 62, 7890, 62, 7753, 13, 9078, 532, 10854, 19449, 3696, 422, 30865, 311, 18, 284, 2947, 47701, 24047, 198, 2, 329, 9091, 422, 15251, 4244, 10880, 34505, 4935, 290, 21525, 370, 6201, 4093, 47, 18709, 273, 198, 2, 9518, 416, 1...
2.561488
1,667
from django import template register = template.Library() @register.filter
[ 6738, 42625, 14208, 1330, 11055, 201, 198, 30238, 796, 11055, 13, 23377, 3419, 201, 198, 201, 198, 201, 198, 31, 30238, 13, 24455, 201 ]
3.375
24
# ------------------------ # Tom Aarsen - s1027401 # Bart Janssen - s4630270 # ------------------------ CLIENT_IP = 'localhost' CLIENT_PORT = 20000 SERVER_IP = 'localhost' SERVER_PORT = 30000 HEADER_SIZE = 10 PAYLOAD_SIZE = 1008 SEGMENT_SIZE = HEADER_SIZE + PAYLOAD_SIZE
[ 2, 220, 22369, 198, 2, 4186, 317, 945, 268, 220, 220, 532, 264, 40403, 21844, 198, 2, 13167, 449, 504, 6248, 532, 264, 3510, 1270, 20233, 198, 2, 220, 22369, 198, 198, 5097, 28495, 62, 4061, 796, 705, 36750, 6, 198, 5097, 28495, 6...
2.814433
97
# -*- coding: utf-8 -*- # # Copyright (C) 2006-2020 Edgewall Software # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at https://trac.edgewall.org/wiki/TracLicense. # # This soft...
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 201, 198, 2, 201, 198, 2, 15069, 357, 34, 8, 4793, 12, 42334, 1717, 39909, 439, 10442, 201, 198, 2, 1439, 2489, 10395, 13, 201, 198, 2, 201, 198, 2, 770, 3788, 318, 119...
2.984287
2,673
from .app import Application from .app_set import ApplicationSet from .policy import PolicyContext from .policy_rule import PolicyRule from .zone import Zone from .shared_ab import SharedAddrBook from .zone_ab import ZoneAddrBook from .ab_finder import AddrBookFinder
[ 6738, 764, 1324, 1330, 15678, 198, 6738, 764, 1324, 62, 2617, 1330, 15678, 7248, 198, 6738, 764, 30586, 1330, 7820, 21947, 198, 6738, 764, 30586, 62, 25135, 1330, 7820, 31929, 198, 6738, 764, 11340, 1330, 13035, 198, 6738, 764, 28710, 6...
3.774648
71
import chainer from chainer import functions as F import chainer.links as L import sys import os from chainer_chemistry.models import GGNN from chainer_chemistry.models import NFP from chainer_chemistry.models import SchNet from chainer_chemistry.models import WeaveNet sys.path.append(os.path.dirname(__file__)) from ...
[ 11748, 6333, 263, 198, 6738, 6333, 263, 1330, 5499, 355, 376, 198, 11748, 6333, 263, 13, 28751, 355, 406, 198, 11748, 25064, 198, 11748, 28686, 198, 198, 6738, 6333, 263, 62, 15245, 4592, 13, 27530, 1330, 37442, 6144, 198, 6738, 6333, ...
2.646489
413
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union from ... import _utilities, _tables from...
[ 2, 19617, 28, 40477, 12, 23, 198, 2, 17202, 39410, 25, 428, 2393, 373, 7560, 416, 262, 21624, 12994, 26144, 35986, 13, 17202, 198, 2, 17202, 2141, 407, 4370, 416, 1021, 4556, 345, 821, 1728, 345, 760, 644, 345, 389, 1804, 0, 17202, ...
2.605062
1,699
""" Game of trying to mimic logic gates. """ import numpy as np from spikey.module import Key from spikey.games.template import RL # Top level for pickle friendliness class Logic(RL): """ Game of trying to mimic logic gates. Parameters ---------- preset: str=PRESETS.keys(), default="OR" ...
[ 37811, 198, 8777, 286, 2111, 284, 26332, 9156, 17435, 13, 198, 37811, 198, 11748, 299, 32152, 355, 45941, 198, 198, 6738, 20240, 88, 13, 21412, 1330, 7383, 198, 6738, 20240, 88, 13, 19966, 13, 28243, 1330, 45715, 628, 198, 2, 5849, 12...
2.073589
1,984
# -*- coding: utf-8 -*- # Copyright Noronha Development Team # # 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, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 198, 2, 15069, 5414, 261, 3099, 7712, 4816, 198, 2, 198, 2, 49962, 739, 262, 24843, 13789, 11, 10628, 362, 13, 15, 357, 1169, 366, 34156, 15341, 198, 2, 345, 743, 40...
3.52349
298
import tensorflow as tf from model.layers.coordconv import CoordConv2D class PredictionHead(tf.keras.layers.Layer): """ Prediction head for SOLO network """ def __init__(self, num_class, grid_sizes, image_size, head_depth=8, num_channel=256, head_style='vanilla', **kwargs): """Prediction head ...
[ 11748, 11192, 273, 11125, 355, 48700, 198, 6738, 2746, 13, 75, 6962, 13, 37652, 42946, 1330, 22819, 3103, 85, 17, 35, 628, 198, 4871, 46690, 13847, 7, 27110, 13, 6122, 292, 13, 75, 6962, 13, 49925, 2599, 198, 220, 220, 220, 37227, 1...
1.973985
1,922
FLAG = 'flag{xxxxxxxxxxxxxxxxxxxxxx}'
[ 38948, 796, 705, 32109, 90, 24223, 24223, 12343, 5324, 92, 6 ]
3.363636
11
import torch import torch.nn as nn import torch.nn.functional as F
[ 11748, 28034, 198, 11748, 28034, 13, 20471, 355, 299, 77, 198, 11748, 28034, 13, 20471, 13, 45124, 355, 376, 628 ]
3.4
20
# Copyright © 2019 National Institute of Advanced Industrial Science and Technology (AIST). All rights reserved. from datetime import datetime, timedelta, timezone from requests import post, get from pathlib import Path import json from injector import singleton import os import shutil from distutils.dir_util import re...
[ 2, 15069, 10673, 13130, 2351, 5136, 286, 13435, 19034, 5800, 290, 8987, 27332, 120, 230, 32, 8808, 171, 120, 231, 13, 1439, 2489, 10395, 13, 198, 6738, 4818, 8079, 1330, 4818, 8079, 11, 28805, 12514, 11, 640, 11340, 198, 6738, 7007, 1...
3.586563
387
"""setup tools for GDX Analytics microservices """ from setuptools import setup, find_packages setup(name='microservices', version='1.0', packages=find_packages())
[ 37811, 40406, 4899, 329, 27044, 55, 30437, 4580, 30416, 198, 37811, 198, 6738, 900, 37623, 10141, 1330, 9058, 11, 1064, 62, 43789, 198, 198, 40406, 7, 3672, 11639, 24055, 30416, 3256, 2196, 11639, 16, 13, 15, 3256, 10392, 28, 19796, 62,...
3.75
44
import numpy as np import torch from torch.autograd import Variable from helpers.utils import progress_bar # Train function # train function in a teacher-student fashion # Test function
[ 11748, 299, 32152, 355, 45941, 198, 11748, 28034, 198, 6738, 28034, 13, 2306, 519, 6335, 1330, 35748, 198, 198, 6738, 49385, 13, 26791, 1330, 4371, 62, 5657, 198, 198, 2, 16835, 2163, 628, 198, 198, 2, 4512, 2163, 287, 257, 4701, 12, ...
3.86
50
#!/usr/bin/python """ (c) 2018-2021, NetApp, Inc # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) """ from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['pre...
[ 2, 48443, 14629, 14, 8800, 14, 29412, 198, 198, 37811, 198, 357, 66, 8, 2864, 12, 1238, 2481, 11, 3433, 4677, 11, 3457, 198, 1303, 22961, 3611, 5094, 13789, 410, 18, 13, 15, 10, 357, 3826, 27975, 45761, 393, 3740, 1378, 2503, 13, ...
2.317571
1,861
""" [STEPIK] Python: основы и применение https://stepik.org/512 01_06_01 Наследование классов """ """ Вам дано описание наследования классов в следующем формате. <имя класса 1> : <имя класса 2> <имя класса 3> ... <имя класса k> Это означает, что класс 1 отнаследован от класса 2, класса 3, и т. д. Или эквивалентно зап...
[ 37811, 198, 58, 42135, 18694, 60, 198, 37906, 25, 12466, 122, 21727, 22177, 25443, 110, 45035, 12466, 116, 12466, 123, 21169, 18849, 43108, 16843, 22177, 16843, 22177, 18849, 16843, 3740, 1378, 9662, 1134, 13, 2398, 14, 25836, 198, 486, 6...
1.127029
1,787
#!/usr/bin/env python3 # # Zadanie Q1 # Kamil Cieślik # 20.04.2018 11:15 TP # import os import sys if sys.argv.__len__() != 3: print("Skrypt należy uruchomić z dwoma parametremi (ścieżka do katalogu, lista plików).") sys.exit(1) dir_path = sys.argv[1] if not os.path.isdir(dir_path): print("Katalog o ście...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 2, 198, 2, 1168, 29157, 494, 1195, 16, 198, 2, 12670, 346, 327, 494, 129, 249, 46965, 198, 2, 1160, 13, 3023, 13, 7908, 1367, 25, 1314, 24525, 198, 2, 198, 198, 11748, 28686, ...
1.903353
1,014
from manpy.simulation.imports import ( Machine, Source, Exit, Part, Frame, Assembly, Failure, ) from manpy.simulation.Globals import runSimulation # define the objects of the model Frame.capacity = 4 Sp = Source( "SP", "Parts", interArrivalTime={"Fixed": {"mean": 0.5}}, entity="manpy.Pa...
[ 6738, 582, 9078, 13, 14323, 1741, 13, 320, 3742, 1330, 357, 198, 220, 220, 220, 10850, 11, 198, 220, 220, 220, 8090, 11, 198, 220, 220, 220, 29739, 11, 198, 220, 220, 220, 2142, 11, 198, 220, 220, 220, 25184, 11, 198, 220, 220, ...
2.564246
358
""" Django settings for config project. Generated by 'django-admin startproject' using Django 2.0.6. For more information on this file, see https://docs.djangoproject.com/en/2.0/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/2.0/ref/settings/ """ import os # ...
[ 37811, 198, 35, 73, 14208, 6460, 329, 4566, 1628, 13, 198, 198, 8645, 515, 416, 705, 28241, 14208, 12, 28482, 923, 16302, 6, 1262, 37770, 362, 13, 15, 13, 21, 13, 198, 198, 1890, 517, 1321, 319, 428, 2393, 11, 766, 198, 5450, 1378...
2.026731
2,469
# Given a binary tree, flatten it to a linked list in-place. # Definition for a binary tree node. # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None # 代码更加简洁
[ 2, 11259, 257, 13934, 5509, 11, 27172, 268, 340, 284, 257, 6692, 1351, 287, 12, 5372, 13, 198, 198, 2, 30396, 329, 257, 13934, 5509, 10139, 13, 198, 2, 1398, 12200, 19667, 25, 198, 2, 220, 220, 220, 220, 825, 11593, 15003, 834, 7,...
2.070796
113
from django.contrib import admin from recipes.models import Recipe admin.site.register(Recipe)
[ 6738, 42625, 14208, 13, 3642, 822, 1330, 13169, 198, 198, 6738, 14296, 13, 27530, 1330, 26694, 198, 198, 28482, 13, 15654, 13, 30238, 7, 37523, 8, 198 ]
3.592593
27
import sys from switch_nexa import NexaSwitcher if __name__ == '__main__': if len(sys.argv) != 4: sys.exit('Usage: %s on|off data_pin_number transmitter_code' % sys.argv[0]) switcher = NexaSwitcher(data_pin=int(sys.argv[2]), transmitter_code=int(sys.argv[3])) if sys.argv[1] == "on": switc...
[ 11748, 25064, 198, 198, 6738, 5078, 62, 12413, 64, 1330, 14786, 64, 10462, 23640, 198, 198, 361, 11593, 3672, 834, 6624, 705, 834, 12417, 834, 10354, 198, 220, 220, 220, 611, 18896, 7, 17597, 13, 853, 85, 8, 14512, 604, 25, 198, 220...
2.236686
169
# AC 約数列挙しその約数をもつ最も多い数を出力 import collections N = int(input()) A = list(map(int, input().split())) B = [divisor(a) for a in A] C = [i for i in sum(B, []) if i != 1] D = collections.Counter(C) print(D.most_common()[0][0]) # 公式解説 max1000と少ないから全列挙 N = int(input()) A = list(map(int, input().split())) ans = -1 mx = 0 ...
[ 2, 7125, 13328, 112, 226, 46763, 108, 26344, 245, 162, 234, 247, 22180, 2515, 251, 17683, 112, 226, 46763, 108, 31758, 43266, 2515, 97, 17312, 222, 43266, 13783, 248, 18566, 46763, 108, 31758, 49035, 118, 27950, 249, 198, 198, 11748, 17...
1.751037
241
from django.urls import path from .views import add_to_cart, cart_detail, remove_item_cart, remove_one_cart app_name = "cart" urlpatterns = [ path("detail/", cart_detail, name="cart_detail"), path("add/<int:item_id>", add_to_cart, name="add_to_cart"), path("add-size/<int:item_id>/<str:size>", add_to_cart...
[ 6738, 42625, 14208, 13, 6371, 82, 1330, 3108, 198, 198, 6738, 764, 33571, 1330, 751, 62, 1462, 62, 26674, 11, 6383, 62, 49170, 11, 4781, 62, 9186, 62, 26674, 11, 4781, 62, 505, 62, 26674, 198, 198, 1324, 62, 3672, 796, 366, 26674, ...
2.34632
231
import streamlit as st import joblib import pandas as pd from train import svc, rf, KNN, adaboost, gboost, extra_tree from PIL import Image if __name__ == '__main__': # st.image(Image.open('diabetes_image.webp'),use_column_width=True) st.title('Predict early stage diabetes-mellitus.') st.sidebar.markdown...
[ 11748, 4269, 18250, 355, 336, 198, 11748, 1693, 8019, 198, 11748, 19798, 292, 355, 279, 67, 198, 6738, 4512, 1330, 264, 28435, 11, 374, 69, 11, 509, 6144, 11, 512, 34748, 455, 11, 308, 39521, 11, 3131, 62, 21048, 198, 6738, 350, 414...
2.534296
277
import geopandas as gp import pytest from geofeather import to_geofeather, from_geofeather @pytest.mark.benchmark(group="read-points") def test_points_read_benchmark(tmpdir, points_wgs84, benchmark): """Test performance of reading feather files""" filename = tmpdir / "points_wgs84.feather" to_geofeather...
[ 11748, 30324, 392, 292, 355, 27809, 198, 11748, 12972, 9288, 198, 198, 6738, 4903, 1659, 68, 1032, 1330, 284, 62, 469, 1659, 68, 1032, 11, 422, 62, 469, 1659, 68, 1032, 628, 198, 31, 9078, 9288, 13, 4102, 13, 26968, 4102, 7, 8094, ...
2.753823
1,308
# Copyright (c) 2018 PaddlePaddle 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 app...
[ 2, 220, 220, 15069, 357, 66, 8, 2864, 350, 37382, 47, 37382, 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, ...
3.002315
432
""" Illustration of the heat equation Solve the heat equation using finite differences and Forward Euler. Based on: https://commons.wikimedia.org/wiki/File:Heat_eqn.gif @author: Nicolás Guarín-Zapata """ import numpy as np from scipy.ndimage import gaussian_filter from mayavi import mlab def step_function(N, scale...
[ 37811, 198, 21478, 44027, 286, 262, 4894, 16022, 198, 198, 50, 6442, 262, 4894, 16022, 1262, 27454, 5400, 290, 19530, 412, 18173, 13, 198, 198, 15001, 319, 25, 3740, 1378, 9503, 684, 13, 20763, 20626, 13, 2398, 14, 15466, 14, 8979, 25...
1.94329
1,781
__all__ = [ "abs", "sin", "cos", "log", "exp", "sqrt", "pow", "floor", "ceil", "round", "as_int", "as_float", "as_str", "as_factor", "fct_reorder", "fillna", "qnorm", "pnorm", "dnorm", "pareto_min", ] from grama import make_symbolic from ...
[ 834, 439, 834, 796, 685, 198, 220, 220, 220, 366, 8937, 1600, 198, 220, 220, 220, 366, 31369, 1600, 198, 220, 220, 220, 366, 6966, 1600, 198, 220, 220, 220, 366, 6404, 1600, 198, 220, 220, 220, 366, 11201, 1600, 198, 220, 220, 220...
2.390189
2,222
# -*- coding: utf-8 ''' Import books metadata which ID extracted from XLSX. ''' import os import pathlib from openpyxl import load_workbook from torcms.model.category_model import MCategory from torcms.model.post2catalog_model import MPost2Catalog from torcms.model.post_model import MPost def update_category(uid,...
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 198, 198, 7061, 6, 198, 20939, 3835, 20150, 543, 4522, 21242, 422, 1395, 6561, 55, 13, 198, 7061, 6, 198, 198, 11748, 28686, 198, 198, 11748, 3108, 8019, 198, 6738, 1280, 9078, 87, 75, ...
2.220245
899
import math if __name__ == '__main__': import sys sys.path.insert(0, 'C:\\Users\\James Jiang\\Documents\\Project Euler') from progress import Progress answers_list = ['dummy'] with open('C:\\Users\\James Jiang\\Documents\\Project Euler\\answers.txt') as answers: for line in answers: answers_list.a...
[ 11748, 10688, 198, 198, 361, 11593, 3672, 834, 6624, 705, 834, 12417, 834, 10354, 198, 220, 220, 220, 1330, 25064, 198, 220, 220, 220, 25064, 13, 6978, 13, 28463, 7, 15, 11, 705, 34, 25, 6852, 14490, 6852, 14731, 32294, 6852, 38354, ...
2.760204
196
# -*- coding: utf-8 -*- """ Created on Thu Jun 7 11:41:44 2018 @author: MichaelEK """ import os import argparse import types import pandas as pd import numpy as np from pdsql import mssql from datetime import datetime import yaml import itertools import lowflows as lf import util pd.options.display.max_columns = 10 ...
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 37811, 198, 41972, 319, 26223, 7653, 220, 767, 1367, 25, 3901, 25, 2598, 2864, 198, 198, 31, 9800, 25, 3899, 36, 42, 198, 37811, 198, 11748, 28686, 198, 11748, 1822, 2...
2.48094
21,406
""" BitBake 'Fetch' implementation for bzr. """ # Copyright (C) 2007 Ross Burton # Copyright (C) 2007 Richard Purdie # # Classes for obtaining upstream sources for the # BitBake build tools. # Copyright (C) 2003, 2004 Chris Larson # # This program is free software; you can redistribute it and/or modify # it un...
[ 37811, 198, 13128, 33, 539, 705, 37, 7569, 6, 7822, 329, 275, 89, 81, 13, 198, 198, 37811, 198, 198, 2, 15069, 357, 34, 8, 4343, 9847, 27209, 198, 2, 15069, 357, 34, 8, 4343, 6219, 350, 2799, 494, 198, 2, 198, 2, 220, 220, 388...
3.553691
298
from .invite_user import InviteUserView from .invite_user import InviteUserDoneView from .email import EmailUserView from .email import EmailUserDoneView from .password_change import PasswordChangeView __all__ = [ 'InviteUserView', 'InviteUserDoneView', 'PasswordChangeView', 'EmailUserView', 'Emai...
[ 6738, 764, 16340, 578, 62, 7220, 1330, 10001, 578, 12982, 7680, 198, 6738, 764, 16340, 578, 62, 7220, 1330, 10001, 578, 12982, 45677, 7680, 198, 6738, 764, 12888, 1330, 9570, 12982, 7680, 198, 6738, 764, 12888, 1330, 9570, 12982, 45677, ...
3.072727
110
# Lint as: python2, python3 # Copyright 2017 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless req...
[ 2, 406, 600, 355, 25, 21015, 17, 11, 21015, 18, 198, 2, 15069, 2177, 3012, 3457, 13, 1439, 6923, 33876, 13, 198, 2, 198, 2, 49962, 739, 262, 24843, 13789, 11, 10628, 362, 13, 15, 357, 1169, 366, 34156, 15341, 198, 2, 345, 743, 4...
2.797239
9,706
from itertools import chain import pymysql from faker import Faker import random import datetime from dim_ova_veteran import search_people fake = Faker('zh_CN') # 连接MySQL数据库 mysql_conn = pymysql.connect(host="192.168.101.105", user="root", password="123456", db="dim", port=3306, charset='...
[ 6738, 340, 861, 10141, 1330, 6333, 198, 11748, 279, 4948, 893, 13976, 198, 6738, 277, 3110, 1330, 376, 3110, 198, 11748, 4738, 198, 11748, 4818, 8079, 198, 198, 6738, 5391, 62, 10071, 62, 303, 353, 272, 1330, 2989, 62, 15332, 198, 198...
2.312821
195
import requests import base64 import json from os import environ as env from urlparse import urljoin EXTERNAL_SCHEME = env['EXTERNAL_SCHEME'] BASE_URL = '%s://%s:%s' % (EXTERNAL_SCHEME, env['EXTERNAL_SY_ROUTER_HOST'], env['EXTERNAL_SY_ROUTER_PORT']) if 'EXTERNAL_SY_ROUTER_PORT' in env else '%s://%s' % (EXTERNAL_SCHEME...
[ 11748, 7007, 198, 11748, 2779, 2414, 198, 11748, 33918, 198, 6738, 28686, 1330, 551, 2268, 355, 17365, 198, 6738, 19016, 29572, 1330, 19016, 22179, 198, 198, 6369, 31800, 1847, 62, 50, 3398, 3620, 36, 796, 17365, 17816, 6369, 31800, 1847,...
2.070064
471
#!/usr/bin/env python # encoding: utf-8 """ Code for managing la-grange.net. Created by Karl Dubost on 2011-12-03. Copyright (c) 2011 Grange. All rights reserved. see LICENSE.TXT """ import argparse import configparser from dataclasses import dataclass import datetime from io import StringIO import logging import os ...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 2, 21004, 25, 3384, 69, 12, 23, 198, 37811, 198, 10669, 329, 11149, 8591, 12, 2164, 858, 13, 3262, 13, 198, 198, 41972, 416, 15415, 10322, 455, 319, 2813, 12, 1065, 12, 3070, 13, 1...
2.334592
3,972
import random import math import config import wavelink import re import time import asyncio from youtube_title_parse import get_artist_title from modules import format_time, database from .spotify_link import SpotifyLink db = database.Connection()
[ 11748, 4738, 198, 11748, 10688, 198, 11748, 4566, 198, 11748, 2082, 626, 676, 198, 11748, 302, 198, 11748, 640, 198, 11748, 30351, 952, 198, 6738, 35116, 62, 7839, 62, 29572, 1330, 651, 62, 49016, 62, 7839, 198, 6738, 13103, 1330, 5794,...
3.876923
65
from typing import Any, Dict, List import pandas as pd def transform_categorical_feature(df: pd.DataFrame, column_name: str, column_prefix: str = "") -> pd.DataFrame: """ creates columns of binary values from categorical textual information """ df1 = pd.get_dummies(df[column_name].astype(str)) ...
[ 6738, 19720, 1330, 4377, 11, 360, 713, 11, 7343, 198, 11748, 19798, 292, 355, 279, 67, 628, 628, 628, 198, 4299, 6121, 62, 66, 2397, 12409, 62, 30053, 7, 7568, 25, 279, 67, 13, 6601, 19778, 11, 5721, 62, 3672, 25, 965, 11, 5721, ...
2.688679
212
# Copyright 2014: Mirantis Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required b...
[ 2, 15069, 1946, 25, 7381, 20836, 3457, 13, 198, 2, 1439, 6923, 33876, 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.109215
293
import tensorflow as tf from tensorflow.keras.layers import Conv2D, Dense, BatchNormalization, Flatten # defines a resnet model # resnet20: num_block=[3,3,3] # resnet32: num_block=[5,5,5] # resnet44: num_block=[7,7,7] # resnet56: num_block=[9,9,9] # resnet110: num_block=[18,18,18] # resnet12...
[ 11748, 11192, 273, 11125, 355, 48700, 198, 6738, 11192, 273, 11125, 13, 6122, 292, 13, 75, 6962, 1330, 34872, 17, 35, 11, 360, 1072, 11, 347, 963, 26447, 1634, 11, 1610, 41769, 198, 220, 220, 220, 1303, 15738, 257, 581, 3262, 2746, ...
2.210191
157
#!/usr/bin/env python """ This script is used to setup individual test cases. Available test cases can be see using the list_testcases.py script. Specifically, this script parses XML files that define cases (steps in test cases) and driver scripts, and generates directories and scripts to run each step in the process ...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 37811, 198, 1212, 4226, 318, 973, 284, 9058, 1981, 1332, 2663, 13, 14898, 1332, 2663, 198, 5171, 307, 766, 1262, 262, 1351, 62, 9288, 33964, 13, 9078, 4226, 13, 198, 198, 48379, 11, ...
2.143685
7,245
from app import app from flask import render_template, request from flask_restful import Resource, Api from app.database import Database api = Api(app) @app.route("/") @app.route("/about") api.add_resource(TodoSimple, "/client/")
[ 6738, 598, 1330, 598, 198, 6738, 42903, 1330, 8543, 62, 28243, 11, 2581, 198, 6738, 42903, 62, 2118, 913, 1330, 20857, 11, 5949, 72, 198, 6738, 598, 13, 48806, 1330, 24047, 198, 198, 15042, 796, 5949, 72, 7, 1324, 8, 628, 198, 31, ...
3.090909
77
# --- # jupyter: # jupytext: # text_representation: # extension: .py # format_name: light # format_version: '1.5' # jupytext_version: 1.4.2 # kernelspec: # display_name: Python [conda env:PROJ_IrOx_Active_Learning_OER] # language: python # name: conda-env-PROJ_IrOx_Active_Lea...
[ 2, 11420, 198, 2, 474, 929, 88, 353, 25, 198, 2, 220, 220, 474, 929, 88, 5239, 25, 198, 2, 220, 220, 220, 220, 2420, 62, 15603, 341, 25, 198, 2, 220, 220, 220, 220, 220, 220, 7552, 25, 764, 9078, 198, 2, 220, 220, 220, 220, ...
2.101727
521
try: from hashlib import md5 except: from md5 import new as md5 import autocomplete_light from django import forms from django.db.models.fields import BLANK_CHOICE_DASH from django.core.urlresolvers import reverse_lazy from django.forms import models from django.forms.formsets import BaseFormSet from django...
[ 28311, 25, 198, 220, 220, 220, 422, 12234, 8019, 1330, 45243, 20, 198, 16341, 25, 198, 220, 220, 220, 422, 45243, 20, 1330, 649, 355, 45243, 20, 198, 198, 11748, 1960, 42829, 6677, 62, 2971, 198, 198, 6738, 42625, 14208, 1330, 5107, ...
2.968709
767
# Copyright 2017 The KaiJIN 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 applicable ...
[ 2, 15069, 2177, 383, 22091, 41, 1268, 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.552239
402
# print('CREATING CODE') # print() # # This code counts to 100 (chr 'd') in the DATA section # # code2 = bytearray(b'\x01\x01\x00\n\x02\x01\x00\x04\x02\x01\x00\x04\x02\x01\x00\x04\x02\x01\x00\x01\x01\x00\n\x02\x01\x00\x04\x02\x01\x00\x04\x02\x01\x00\x04\x18\x01\x00\n\x02\x01\x00\x04\x02\x01\x00\x04\x02\x01\x00\x04\x02\...
[ 2, 3601, 10786, 43387, 33881, 42714, 11537, 198, 2, 3601, 3419, 198, 2, 1303, 770, 2438, 9853, 284, 1802, 357, 354, 81, 705, 67, 11537, 287, 262, 42865, 2665, 198, 2, 1303, 2438, 17, 796, 416, 83, 451, 2433, 7, 65, 6, 59, 87, 48...
1.561367
11,529
print("Hello World") Last login: Mon Jan 10 14:42:15 on ttys000 (base) leila_fifelina@Leilas-MBP ~ % jupyter -V usage: jupyter [-h] [--version] [--config-dir] [--data-dir] [--runtime-dir] [--paths] [--json] [--debug] [subcommand] Jupyter: Interactive Computing positional arguments: sub...
[ 4798, 7203, 15496, 2159, 4943, 198, 5956, 17594, 25, 2892, 2365, 838, 1478, 25, 3682, 25, 1314, 319, 256, 774, 82, 830, 198, 7, 8692, 8, 443, 10102, 62, 32041, 417, 1437, 31, 3123, 346, 292, 12, 10744, 47, 5299, 4064, 474, 929, 88...
2.656172
2,414
# Copyright (c) 2018 PaddlePaddle 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 app...
[ 2, 220, 220, 15069, 357, 66, 8, 2864, 350, 37382, 47, 37382, 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, ...
3.442359
373
import logging _BLACK, _RED, _GREEN, _YELLOW, _BLUE, _MAGENTA, _CYAN, _WHITE = range(8) RESET_SEQ = "\033[0m" COLOR_SEQ = "\033[1;%dm" BOLD_SEQ = "\033[1m" COLORS = { 'WARNING': _YELLOW, 'INFO': _WHITE, 'DEBUG': _BLUE, 'CRITICAL': _YELLOW, 'ERROR': _RED } LOG_LEVEL = logging.INFO
[ 11748, 18931, 628, 198, 62, 9148, 8120, 11, 4808, 22083, 11, 4808, 43016, 11, 4808, 56, 23304, 3913, 11, 4808, 9148, 8924, 11, 4808, 45820, 3525, 32, 11, 4808, 34, 56, 1565, 11, 4808, 12418, 12709, 796, 2837, 7, 23, 8, 198, 19535, ...
1.949686
159
import helium import unittest import os if __name__ == '__main__': unittest.main()
[ 11748, 43142, 198, 11748, 555, 715, 395, 198, 11748, 28686, 628, 198, 198, 361, 11593, 3672, 834, 6624, 705, 834, 12417, 834, 10354, 198, 220, 220, 220, 555, 715, 395, 13, 12417, 3419, 198 ]
2.647059
34
""" 68. How to get the n’th largest value of a column when grouped by another column? """ """ Difficulty Level: L2 """ """ In df, find the second largest value of 'taste' for 'banana' """ """ Input """ """ df = pd.DataFrame({'fruit': ['apple', 'banana', 'orange'] * 3, 'rating': np.random.rand(9), ...
[ 37811, 198, 3104, 13, 1374, 284, 651, 262, 299, 447, 247, 400, 4387, 1988, 286, 257, 5721, 618, 32824, 416, 1194, 5721, 30, 198, 37811, 198, 37811, 198, 28813, 22402, 5684, 25, 406, 17, 198, 37811, 198, 37811, 198, 818, 47764, 11, 1...
2.226519
181
__author__ = 'alandinneen'
[ 834, 9800, 834, 796, 705, 282, 392, 259, 710, 268, 6, 198 ]
2.25
12
import logging import os import shutil import subprocess from mecoshark.processor.baseprocessor import BaseProcessor from mecoshark.resultparser.sourcemeterparser import SourcemeterParser logger = logging.getLogger("processor") class CProcessor(BaseProcessor): """ Implements :class:`~mecoshark.processor.base...
[ 11748, 18931, 198, 11748, 28686, 198, 11748, 4423, 346, 198, 11748, 850, 14681, 198, 198, 6738, 502, 66, 3768, 668, 13, 41341, 13, 12093, 538, 305, 919, 273, 1330, 7308, 18709, 273, 198, 6738, 502, 66, 3768, 668, 13, 20274, 48610, 13,...
2.413687
1,622
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # GAMLite # # Copyright 2020, 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/LIC...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 2, 198, 2, 49965, 43, 578, 198, 2, 198, 2, 15069, 12131, 11, 1439, 6923, 33876, 13, 198, 2, 198, 2, 49962, 73...
2.451656
4,499
from unittest.mock import call, patch import pytest from pytest import raises from vang.bitbucket.get_repos import get_all_repos from vang.bitbucket.get_repos import get_repos from vang.bitbucket.get_repos import main from vang.bitbucket.get_repos import parse_args @pytest.fixture @pytest.mark.parametrize("only_...
[ 6738, 555, 715, 395, 13, 76, 735, 1330, 869, 11, 8529, 198, 198, 11748, 12972, 9288, 198, 6738, 12972, 9288, 1330, 12073, 198, 198, 6738, 410, 648, 13, 2545, 27041, 316, 13, 1136, 62, 260, 1930, 1330, 651, 62, 439, 62, 260, 1930, ...
2.005208
768
from pydantic import BaseModel, EmailStr from datetime import datetime from typing import List
[ 6738, 279, 5173, 5109, 1330, 7308, 17633, 11, 9570, 13290, 198, 6738, 4818, 8079, 1330, 4818, 8079, 198, 6738, 19720, 1330, 7343, 628, 628, 628, 198 ]
3.884615
26
from itembase.core.tests import *
[ 6738, 2378, 8692, 13, 7295, 13, 41989, 1330, 1635, 198 ]
3.4
10
#!/usr/bin/env python """Thunder Chen<nkchenz@gmail.com> 2007.9.1""" from __future__ import with_statement import re try: import xml.etree.ElementTree as ET except: # pragma: no cover # For Python 2.4 import cElementTree as ET from object_dict import object_dict class Dict2XML(object): """Turn a...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 198, 37811, 45713, 12555, 27, 77, 74, 6607, 89, 31, 14816, 13, 785, 29, 4343, 13, 24, 13, 16, 37811, 198, 198, 6738, 11593, 37443, 834, 1330, 351, 62, 26090, 198, 11748, 302, 198, ...
2.466667
375
from pytest import approx, raises import numpy as np import netket as nk import netket.variational as vmc from io import StringIO from contextlib import redirect_stderr import tempfile import re SEED = 214748364 nk.utils.seed(SEED)
[ 6738, 12972, 9288, 1330, 5561, 11, 12073, 198, 11748, 299, 32152, 355, 45941, 198, 198, 11748, 2010, 7126, 355, 299, 74, 198, 11748, 2010, 7126, 13, 25641, 864, 355, 410, 23209, 198, 198, 6738, 33245, 1330, 10903, 9399, 198, 6738, 4732,...
3.064103
78
"""edits to embedding-related tables Revision ID: bedce04cf1d3 Revises: 93ae3f97278a Create Date: 2021-01-13 19:42:31.658244 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = "bedce04cf1d3" down_revision = "93ae3f97278a" branch_labels = None depends_on = None
[ 37811, 276, 896, 284, 11525, 12083, 12, 5363, 8893, 198, 198, 18009, 1166, 4522, 25, 3996, 344, 3023, 12993, 16, 67, 18, 198, 18009, 2696, 25, 10261, 3609, 18, 69, 5607, 25870, 64, 198, 16447, 7536, 25, 33448, 12, 486, 12, 1485, 678...
2.572581
124
import os import sys import copy import pygame from code.extensions.common import UITemplateLoaderExt from code.render.glfunctions import * from code.controllers.intervalcontroller import IntervalController from code.controllers.menucontroller import MenuController from code.controllers.timercontroller import Time...
[ 11748, 28686, 198, 11748, 25064, 198, 198, 11748, 4866, 198, 198, 11748, 12972, 6057, 198, 198, 6738, 2438, 13, 2302, 5736, 13, 11321, 1330, 471, 2043, 368, 6816, 17401, 11627, 198, 198, 6738, 2438, 13, 13287, 13, 70, 1652, 46797, 1330,...
3.485315
715
from typing import List # Approach 1 -> Single Iteration # Approach 2 -> Single Iteration, Memory optimization # Approach 3 -> Inbuilt functions -> Less Efficient print(isNonDecreasing(inputList=[10, 20, 30])) print(isNonDecreasing(inputList=[10, 20, 20, 30])) print(isNonDecreasing(inputList=[10, 20, 11, 30]))...
[ 198, 6738, 19720, 1330, 7343, 628, 198, 2, 38066, 352, 4613, 14206, 40806, 341, 628, 198, 2, 38066, 362, 4613, 14206, 40806, 341, 11, 14059, 23989, 628, 198, 2, 38066, 513, 4613, 554, 18780, 5499, 4613, 12892, 412, 5632, 628, 198, 479...
2.744505
364
from Service.clientcardService import ClientCardService from Service.movieService import MovieService from Service.randommovie import unique_strings, inProgram, unique_number from Service.reservationService import ReservationService from Service.undoredoservice import Undoredoservice
[ 198, 6738, 4809, 13, 16366, 9517, 16177, 1330, 20985, 16962, 16177, 198, 6738, 4809, 13, 41364, 16177, 1330, 15875, 16177, 198, 6738, 4809, 13, 25192, 2002, 10739, 1330, 3748, 62, 37336, 11, 287, 15167, 11, 3748, 62, 17618, 198, 6738, 4...
4.415385
65
#!/usr/bin/env python import http.client import pprint con = http.client.HTTPSConnection("api.fda.gov") con.request('GET', '/drug/label.json?limit=10') res = con.getresponse() print("Status: {}".format(res.status)) headers_list = res.getheaders() print("Headers: {}".format(headers_list)) con.close()
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 198, 11748, 2638, 13, 16366, 198, 11748, 279, 4798, 198, 198, 1102, 796, 2638, 13, 16366, 13, 6535, 28820, 32048, 7203, 15042, 13, 69, 6814, 13, 9567, 4943, 198, 1102, 13, 25927, 10786...
2.807339
109
"""Common code.""" import contextlib import difflib import fcntl import glob import os import pathlib import shutil import struct import sys import tempfile import termios import typing import warnings from subprocess import check_output, CalledProcessError from uuid import UUID import attr import icdiff import toml f...
[ 37811, 17227, 2438, 526, 15931, 198, 11748, 4732, 8019, 198, 11748, 814, 8019, 198, 11748, 277, 66, 429, 75, 198, 11748, 15095, 198, 11748, 28686, 198, 11748, 3108, 8019, 198, 11748, 4423, 346, 198, 11748, 2878, 198, 11748, 25064, 198, ...
2.468435
1,093
import re r = int(input()) for i in range(0,r): s = str( input() ) if True: try: reg = re.compile(s) except re.error: print(False) else: print(True)
[ 11748, 302, 198, 81, 796, 493, 7, 15414, 28955, 198, 1640, 1312, 287, 2837, 7, 15, 11, 81, 2599, 198, 220, 220, 220, 264, 796, 965, 7, 5128, 3419, 1267, 198, 220, 220, 220, 611, 6407, 25, 198, 220, 220, 220, 220, 220, 220, 220, ...
1.75
124
import sys, re, numpy, random from collections import Counter word_pattern = re.compile(r"\w+") num_dimensions = int(sys.argv[2]) window_size = 5 num_negative_samples = 5 frequency_weight = 0.0001 raw_documents = [] all_words = Counter() with open(sys.argv[1]) as infile: for line in infile: fields = lin...
[ 11748, 25064, 11, 302, 11, 299, 32152, 11, 4738, 198, 6738, 17268, 1330, 15034, 198, 198, 4775, 62, 33279, 796, 302, 13, 5589, 576, 7, 81, 1, 59, 86, 10, 4943, 198, 198, 22510, 62, 27740, 5736, 796, 493, 7, 17597, 13, 853, 85, 5...
2.616172
977
#!/usr/bin/env python3 """ Run all the stages of the Deep Colony Tracking pipeline Analyze the example confocal data: .. code-block:: bash $ ./deep_track.py --preset confocal ../deep_hipsc_tracking/data/example_confocal/ To try the code out without running anything: .. code-block:: bash $ ./deep_track.py...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 198, 37811, 5660, 477, 262, 9539, 286, 262, 10766, 34480, 37169, 11523, 198, 198, 37702, 2736, 262, 1672, 1013, 4374, 1366, 25, 198, 198, 492, 2438, 12, 9967, 3712, 27334, 628, 220...
2.858
500
"""Elementwise sigmoid activation function with HBP functionality.""" from torch.nn import Sigmoid from .nonlinear import hbp_elementwise_nonlinear class HBPSigmoid(hbp_elementwise_nonlinear(Sigmoid)): """Componentwise sigmoid layer with HBP functionality. Applies sigma(x) = 1 / (1 + exp(-x)) elementwise. ...
[ 37811, 20180, 3083, 264, 17225, 1868, 14916, 2163, 351, 367, 20866, 11244, 526, 15931, 198, 198, 6738, 28034, 13, 20471, 1330, 311, 17225, 1868, 198, 198, 6738, 764, 13159, 29127, 1330, 289, 46583, 62, 30854, 3083, 62, 13159, 29127, 628, ...
2.556863
510
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 6738, 11593, 37443, 834, 1330, 28000, 1098, 62, 17201, 874, 198, 198, 6738, 42625, 14208, 13, 9945, 1330, 4981, 11, 15720, 602, 628 ]
2.891892
37
import os.path import re import subprocess import sys # TODO TODO TODO # also change around the .env file if __name__ == '__main__': main()
[ 11748, 28686, 13, 6978, 198, 11748, 302, 198, 11748, 850, 14681, 198, 11748, 25064, 198, 198, 2, 16926, 46, 16926, 46, 16926, 46, 198, 2, 635, 1487, 1088, 262, 764, 24330, 2393, 198, 198, 361, 11593, 3672, 834, 6624, 705, 834, 12417, ...
2.862745
51
import os, glob pwd = os.path.dirname(os.path.realpath(__file__)) v8_path = os.path.join(pwd, 'v8') mozilla_path = os.path.join(pwd, 'mozilla') test262_path = os.path.join(pwd, 'test262') jsi_path = os.path.join(pwd, 'JSI') jerryjs_path = os.path.join(pwd, 'JerryJS') tinyjs_path = os.path.join(pwd, 'TinyJS') webkitjs...
[ 11748, 28686, 11, 15095, 198, 198, 79, 16993, 796, 28686, 13, 6978, 13, 15908, 3672, 7, 418, 13, 6978, 13, 5305, 6978, 7, 834, 7753, 834, 4008, 198, 198, 85, 23, 62, 6978, 796, 28686, 13, 6978, 13, 22179, 7, 79, 16993, 11, 705, ...
2.368159
603
# -*- coding: utf-8 -*- import re import graphene from graphene import Enum as GrapheneEnum from sqlalchemy import and_ from common.database import db from common.graphene_utils import ShortString from common.languages import _local_ from common.log.journal import system_logger from common.models.auth import User fr...
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 11748, 302, 198, 198, 11748, 42463, 198, 6738, 42463, 1330, 2039, 388, 355, 402, 2416, 29473, 4834, 388, 198, 198, 6738, 44161, 282, 26599, 1330, 290, 62, 198, 198, 6738...
2.378462
650
import re from enum import Enum LOGICAL_OPERATORS = [Token.AND, Token.OR] CONDITIONAL_OPERATORS = [ Token.EQUAL, Token.NEQUAL, Token.SMALL, Token.SMALLEQ, Token.LARGE, Token.LARGEEQ, Token.IN, Token.NIN, ]
[ 11748, 302, 198, 6738, 33829, 1330, 2039, 388, 628, 628, 198, 25294, 20151, 62, 31054, 1404, 20673, 796, 685, 30642, 13, 6981, 11, 29130, 13, 1581, 60, 198, 10943, 35, 17941, 1847, 62, 31054, 1404, 20673, 796, 685, 198, 220, 220, 220,...
2.016667
120
from hamcrest import * from solr_admin.models.synonym import Synonym from tests.external.pages.synonyms_list_page import SynonymsListPage
[ 6738, 8891, 66, 2118, 1330, 1635, 198, 6738, 1540, 81, 62, 28482, 13, 27530, 13, 28869, 5177, 1330, 16065, 5177, 198, 6738, 5254, 13, 22615, 13, 31126, 13, 28869, 43612, 62, 4868, 62, 7700, 1330, 16065, 43612, 8053, 9876, 628 ]
3.475
40
# coding=utf8 from __future__ import print_function from django.core.management.base import BaseCommand from django.contrib.auth.models import User
[ 2, 19617, 28, 40477, 23, 198, 6738, 11593, 37443, 834, 1330, 3601, 62, 8818, 198, 198, 6738, 42625, 14208, 13, 7295, 13, 27604, 13, 8692, 1330, 7308, 21575, 198, 198, 6738, 42625, 14208, 13, 3642, 822, 13, 18439, 13, 27530, 1330, 1178...
3.511628
43