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 python """ A toolkit for identifying and advertising service resources. Uses a specific naming convention for the Task Definition of services. If you name the Task Definition ending with "-service", no configuration is needed. This also requires that you not use that naming convention for task definiti...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 37811, 198, 32, 2891, 15813, 329, 13720, 290, 8560, 2139, 4133, 13, 198, 198, 5842, 274, 257, 2176, 19264, 9831, 329, 262, 15941, 30396, 286, 2594, 13, 220, 1002, 345, 198, 3672, 262, ...
2.468531
3,289
# -*- coding:utf8 -*- import json import requests import re import datetime import MySQLdb from multiprocessing import Pool # 自己的数据库 db_conf = { } db = MySQLdb.connect(host=db_conf.get('host'), user=db_conf.get('user'), port=db_conf.get('port'), passwd=db_conf.get('passwo...
[ 2, 532, 9, 12, 19617, 25, 40477, 23, 532, 9, 12, 201, 198, 201, 198, 11748, 33918, 201, 198, 11748, 7007, 201, 198, 11748, 302, 201, 198, 11748, 4818, 8079, 201, 198, 11748, 33476, 9945, 201, 198, 201, 198, 201, 198, 6738, 18540, ...
1.786635
2,095
import tensorflow as tf
[ 11748, 11192, 273, 11125, 355, 48700, 628 ]
3.571429
7
import re def is_valid_username(username): """A username is valid if it fulfills the following conditions: - Contains at least 8 characters and at most 12 characters - Only contains letters from A to Z, a to z and digits from 0 to 9 - Contains at least one digit - Must start with a capital letter ...
[ 11748, 302, 198, 198, 4299, 318, 62, 12102, 62, 29460, 7, 29460, 2599, 198, 220, 220, 220, 37227, 32, 20579, 318, 4938, 611, 340, 8456, 2171, 262, 1708, 3403, 25, 198, 220, 220, 220, 532, 49850, 379, 1551, 807, 3435, 290, 379, 749, ...
2.625935
401
# Copyright (c) 2020 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 appli...
[ 2, 15069, 357, 66, 8, 12131, 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, 2393, 2845...
2.62212
651
import socket import urllib
[ 11748, 17802, 198, 11748, 2956, 297, 571, 198 ]
3.5
8
s1 = "A 'string' literal \n" s2 = 'You may use any of \' or " as delimiter' s3 = """This text goes over several lines up to the closing triple quote"""
[ 82, 16, 796, 366, 32, 705, 8841, 6, 18875, 3467, 77, 1, 198, 82, 17, 796, 705, 1639, 743, 779, 597, 286, 34373, 393, 366, 355, 46728, 2676, 6, 198, 82, 18, 796, 37227, 1212, 2420, 198, 220, 220, 2925, 625, 1811, 3951, 198, 220, ...
2.793103
58
import simplejson import uuid from amqplib import client_0_8 as amqp DEFAULT_HOST = '127.0.0.1' DEFAULT_USER_ID = 'guest' DEFAULT_PASSWORD = 'guest' DEFAULT_VHOST = '/' DEFAULT_PORT = 5672 DEFAULT_INSIST = False DEFAULT_QUEUE = 'default_queue' DEFAULT_ROUTING_KEY = 'default_routing_key' DEFAULT_EXCHANGE = 'default_ex...
[ 11748, 2829, 17752, 198, 11748, 334, 27112, 198, 198, 6738, 716, 80, 489, 571, 1330, 5456, 62, 15, 62, 23, 355, 716, 80, 79, 198, 198, 7206, 38865, 62, 39, 10892, 796, 705, 16799, 13, 15, 13, 15, 13, 16, 6, 198, 7206, 38865, 62,...
2.338095
630
from django.db import models from django.conf import settings from django.utils.translation import gettext_lazy as _ from django.urls import reverse from krankit.utils.models import BaseModel
[ 6738, 42625, 14208, 13, 9945, 1330, 4981, 198, 6738, 42625, 14208, 13, 10414, 1330, 6460, 198, 6738, 42625, 14208, 13, 26791, 13, 41519, 1330, 651, 5239, 62, 75, 12582, 355, 4808, 198, 6738, 42625, 14208, 13, 6371, 82, 1330, 9575, 198, ...
3.545455
55
# -*- coding: utf-8 -*- # Generated by Django 1.11.11 on 2019-01-13 08:04 from __future__ import unicode_literals from django.db import migrations
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 2, 2980, 515, 416, 37770, 352, 13, 1157, 13, 1157, 319, 13130, 12, 486, 12, 1485, 8487, 25, 3023, 198, 6738, 11593, 37443, 834, 1330, 28000, 1098, 62, 17201, 874, 198,...
2.709091
55
LATENT_SIZE, BATCH_SIZE = 128, 128 STATS = (0.5, 0.5, 0.5), (0.5, 0.5, 0.5) SAVE_DIR = "generated"
[ 43, 1404, 3525, 62, 33489, 11, 347, 11417, 62, 33489, 796, 13108, 11, 13108, 198, 2257, 33586, 796, 357, 15, 13, 20, 11, 657, 13, 20, 11, 657, 13, 20, 828, 357, 15, 13, 20, 11, 657, 13, 20, 11, 657, 13, 20, 8, 198, 198, 4090...
1.818182
55
from .base import PediaDictionary __all__ = ["PediaDictionary"]
[ 6738, 764, 8692, 1330, 350, 5507, 35, 14188, 198, 198, 834, 439, 834, 796, 14631, 47, 5507, 35, 14188, 8973, 198 ]
3.095238
21
import utils import numpy as np import pandas as pd import matplotlib.pyplot as plt from matplotlib.colors import ListedColormap from tensorflow.keras.applications.vgg16 import VGG16 from tensorflow.keras.applications.vgg16 import preprocess_input from sklearn.cluster import KMeans from sklearn.model_selection import...
[ 11748, 3384, 4487, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 19798, 292, 355, 279, 67, 198, 11748, 2603, 29487, 8019, 13, 9078, 29487, 355, 458, 83, 198, 6738, 2603, 29487, 8019, 13, 4033, 669, 1330, 406, 6347, 5216, 579, 499, 1...
2.494687
847
from utils import * import random
[ 6738, 3384, 4487, 1330, 1635, 198, 11748, 4738, 628 ]
3.888889
9
"""Implementation of a search source based on our internal data.""" from ichnaea.api.locate.blue import BluePositionMixin, BlueRegionMixin from ichnaea.api.locate.cell import CellPositionMixin, CellRegionMixin from ichnaea.api.locate.constants import DataSource from ichnaea.api.locate.source import PositionSource, Reg...
[ 37811, 3546, 32851, 286, 257, 2989, 2723, 1912, 319, 674, 5387, 1366, 526, 15931, 198, 198, 6738, 220, 488, 2616, 18213, 13, 15042, 13, 75, 13369, 13, 17585, 1330, 4518, 26545, 35608, 259, 11, 4518, 47371, 35608, 259, 198, 6738, 220, ...
3.267559
299
""" given a sorted list of integers, recursively find if a given value, val, is in the array or not """ print(binarySearch([0, 2, 4, 6, 7, 8, 8], 8)) # true print(binarySearch([0, 2, 4, 6, 7, 8, 8], 1)) # false print(binarySearch([0, 2, 4, 6, 7, 8, 8], -1)) # false print(binarySearch([0, 2, 4, 6, 7, 8, 8], 0)) #...
[ 37811, 198, 35569, 257, 23243, 1351, 286, 37014, 11, 664, 1834, 2280, 1064, 611, 257, 1813, 1988, 11, 1188, 11, 318, 287, 262, 7177, 393, 407, 198, 37811, 628, 198, 198, 4798, 7, 39491, 18243, 26933, 15, 11, 362, 11, 604, 11, 718, ...
2.469697
132
import bcrypt
[ 11748, 275, 29609, 628, 198 ]
3.2
5
class MissingExecutable(Exception): """Exception raised when a package manager executable is missing""" pass class UnknownManager(Exception): """Exception raised when a requested package manager is unknown""" pass
[ 4871, 25639, 23002, 18187, 7, 16922, 2599, 198, 220, 220, 220, 37227, 16922, 4376, 618, 257, 5301, 4706, 28883, 318, 4814, 37811, 198, 220, 220, 220, 1208, 628, 198, 4871, 16185, 13511, 7, 16922, 2599, 198, 220, 220, 220, 37227, 16922, ...
4.142857
56
from unittest.mock import patch from icat.exception import ICATError import pytest from datagateway_api.src.common.config import Config from datagateway_api.src.common.constants import Constants from datagateway_api.src.common.exceptions import PythonICATError from datagateway_api.src.datagateway_api.backends import ...
[ 6738, 555, 715, 395, 13, 76, 735, 1330, 8529, 198, 198, 6738, 14158, 265, 13, 1069, 4516, 1330, 12460, 6158, 81, 1472, 198, 11748, 12972, 9288, 198, 198, 6738, 4818, 37861, 1014, 62, 15042, 13, 10677, 13, 11321, 13, 11250, 1330, 17056...
3.171642
134
import pandas as pd import config import ujson # limit top n per day DAILY_LIMIT = 100 hackernews = pd.read_feather(config.DATA_DIR / "intermediate/hackernews_github.feather") # remove posts with no points hackernews = hackernews[~hackernews["points"].isna()] # remove posts with no url hackernews = hackernews[hacke...
[ 11748, 19798, 292, 355, 279, 67, 198, 11748, 4566, 198, 11748, 334, 17752, 198, 198, 2, 4179, 1353, 299, 583, 1110, 198, 5631, 33340, 62, 43, 3955, 2043, 796, 1802, 198, 198, 31153, 1142, 15515, 796, 279, 67, 13, 961, 62, 5036, 1032...
2.681818
550
#!/usr/bin/env python3 # Copyright 2017 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Tools to finalize a factory bundle.""" import argparse import concurrent.futures import contextlib import errno import glob imp...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 2, 15069, 2177, 383, 18255, 1505, 7294, 46665, 13, 1439, 2489, 10395, 13, 198, 2, 5765, 286, 428, 2723, 2438, 318, 21825, 416, 257, 347, 10305, 12, 7635, 5964, 326, 460, 307, 198...
2.493228
12,994
from django_filters import rest_framework as filters from .models import Record
[ 6738, 42625, 14208, 62, 10379, 1010, 1330, 1334, 62, 30604, 355, 16628, 198, 6738, 764, 27530, 1330, 13266, 628 ]
4.263158
19
#!/usr/bin/python import os, string print "Counting lines in all Kotlin (*.kt) files:" codefiles = [] dirinfo = os.walk(os.getcwd()) for item in dirinfo: for f in item[2]: if f[-2:] == 'kt': codefiles.append([item[0],"/",f]) lines = 0 code_lines = 0 for f in codefiles: this_lines = 0 ...
[ 2, 48443, 14629, 14, 8800, 14, 29412, 198, 11748, 28686, 11, 4731, 198, 198, 4798, 366, 12332, 278, 3951, 287, 477, 21702, 2815, 20789, 13, 21841, 8, 3696, 11097, 198, 19815, 891, 2915, 796, 17635, 198, 198, 15908, 10951, 796, 28686, ...
2.100604
497
# Generated by Django 2.1.5 on 2019-01-06 07:10 from django.db import migrations, models import django.db.models.deletion def make_config(apps, schema_editor): """まだ設定が作成されていない場合,デフォルトの設定を生成する""" Course = apps.get_model('courses', 'Course') Config = apps.get_model('courses', 'Config') db_alias = sche...
[ 2, 2980, 515, 416, 37770, 362, 13, 16, 13, 20, 319, 13130, 12, 486, 12, 3312, 8753, 25, 940, 198, 198, 6738, 42625, 14208, 13, 9945, 1330, 15720, 602, 11, 4981, 198, 11748, 42625, 14208, 13, 9945, 13, 27530, 13, 2934, 1616, 295, 6...
2.183784
370
from torch import nn from src.encoder import encoder_dict from src.conv_onet import models from src.conv_onet import generation from src.common import decide_total_volume_range, update_reso def get_model(cfg, device=None, dataset=None, **kwargs): ''' Return the Occupancy Network model. Args: cfg (dic...
[ 6738, 28034, 1330, 299, 77, 198, 6738, 12351, 13, 12685, 12342, 1330, 2207, 12342, 62, 11600, 198, 6738, 12351, 13, 42946, 62, 36823, 1330, 4981, 198, 6738, 12351, 13, 42946, 62, 36823, 1330, 5270, 198, 6738, 12351, 13, 11321, 1330, 540...
2.120819
2,392
# -*- coding: utf-8 -*- # Copyright 2018 yukoga. 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, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 198, 2, 15069, 2864, 331, 2724, 10949, 13, 1439, 6923, 33876, 13, 198, 2, 198, 2, 49962, 739, 262, 24843, 13789, 11, 10628, 362, 13, 15, 357, 1169, 366, 34156, 15341, ...
4.034826
201
from typing import List, Set, Iterator from .dal import ( parse_export, FullTraktExport, PartialHistoryExport, TraktExport, HistoryEntry, ) def read_and_merge_exports(files: List[str]) -> FullTraktExport: """ Given multiple files as inputs, parses and merges the exports into one full,...
[ 6738, 19720, 1330, 7343, 11, 5345, 11, 40806, 1352, 198, 198, 6738, 764, 31748, 1330, 357, 198, 220, 220, 220, 21136, 62, 39344, 11, 198, 220, 220, 220, 6462, 15721, 21841, 43834, 11, 198, 220, 220, 220, 43689, 18122, 43834, 11, 198, ...
2.674956
563
import os import sys from random import Random from wai.annotations.main import main as wai_annotations_main from sample import * from sample.splitters import RandomSplitter, TopNSplitter BS = 5 NUM_EPOCHS = int(sys.argv[2]) SEED = 42 VALIDATION_PERCENT = 0.15 GPU = sys.argv[5] LR = float(sys.argv[6]) RANDOM = Rand...
[ 11748, 28686, 198, 11748, 25064, 198, 6738, 4738, 1330, 14534, 198, 198, 6738, 266, 1872, 13, 34574, 602, 13, 12417, 1330, 1388, 355, 266, 1872, 62, 34574, 602, 62, 12417, 198, 198, 6738, 6291, 1330, 1635, 198, 6738, 6291, 13, 35312, ...
1.966351
3,269
from channels.exceptions import DenyConnection from channels.generic.websocket import JsonWebsocketConsumer from django.contrib.auth import get_user_model class NonAnonymousJsonWebsocketConsumer(JsonWebsocketConsumer): """ Only allows non anonymous users to connect """ user = None def send_msg(s...
[ 6738, 9619, 13, 1069, 11755, 1330, 5601, 88, 32048, 198, 6738, 9619, 13, 41357, 13, 732, 1443, 5459, 1330, 449, 1559, 1135, 1443, 5459, 49106, 198, 6738, 42625, 14208, 13, 3642, 822, 13, 18439, 1330, 651, 62, 7220, 62, 19849, 628, 198...
3.035928
167
from __future__ import print_function import pandas as pd from Bio import SeqIO import glob import re import os import sys import gzip import distance import argparse TAB=chr(9) EOL=chr(10) comp = {'A':'T','C':'G','G':'C','T':'A'} args = parseArguments() if args.chrom_only: chroms = [ args.ch...
[ 198, 6738, 11593, 37443, 834, 1330, 3601, 62, 8818, 198, 198, 11748, 19798, 292, 355, 279, 67, 198, 6738, 220, 220, 16024, 1330, 1001, 80, 9399, 198, 11748, 15095, 198, 11748, 302, 198, 11748, 28686, 198, 11748, 25064, 198, 11748, 308, ...
1.973616
1,554
''' Instituto Tecnologico Nacional de Mexico Jose Mario Molina Pasquel y Henriquez Desarrollador: Edgar Noel Espino Cordova Funcion del Programa: Generacion de valores 'y' con base en la ecuacion de distribucion normal. Fecha: 08 de Marzo del ...
[ 7061, 6, 201, 198, 201, 198, 197, 6310, 270, 9390, 48257, 77, 928, 3713, 399, 330, 1538, 390, 5828, 201, 198, 197, 23409, 10682, 17958, 1437, 17454, 31735, 331, 44485, 22281, 201, 198, 201, 198, 197, 5960, 283, 2487, 7079, 25, 29166, ...
2.024823
282
'''import the required packages and read the file.''' import tensorflow as tf import tensorflow.feature_column as fc import numpy as np import os import sys import matplotlib.pyplot as plt from IPython.display import clear_output from sklearn.preprocessing import Imputer from sklearn.metrics import recall_score tf....
[ 7061, 6, 11748, 262, 2672, 10392, 290, 1100, 262, 2393, 2637, 7061, 198, 198, 11748, 11192, 273, 11125, 355, 48700, 198, 11748, 11192, 273, 11125, 13, 30053, 62, 28665, 355, 277, 66, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 28686...
2.610403
3,922
""" Null implementation for Pixel LED display. """ pixels = Pixels()
[ 37811, 198, 35067, 7822, 329, 11349, 12365, 3359, 13, 198, 37811, 198, 198, 79, 14810, 796, 350, 14810, 3419, 198 ]
3.5
20
import os
[ 11748, 28686, 628 ]
3.666667
3
from ze_mailer.app.core.messages import Info import re class UtilitiesMixin: """A mixin used to extend classes with various definitions on repetitive tasks on names such as normalizing them etc. """ @staticmethod def check_name_structure(name): """Check the structure of a name. Sometimes, ...
[ 6738, 41271, 62, 4529, 263, 13, 1324, 13, 7295, 13, 37348, 1095, 1330, 14151, 198, 11748, 302, 198, 198, 4871, 41086, 35608, 259, 25, 198, 220, 220, 220, 37227, 32, 5022, 259, 973, 284, 9117, 6097, 351, 2972, 17336, 319, 220, 198, 2...
2.081226
2,056
from datetime import datetime from mpsiem_api.base_functions.base import LoggerHandler class Credentials: """Интерфейс для параметров аутентификации""" class AuthInterface: """Интерфейс класса аутентификации""" class EventInterface(LoggerHandler): """Интерфейс событий из MP EventViewer""" @prope...
[ 6738, 4818, 8079, 1330, 4818, 8079, 198, 198, 6738, 285, 862, 26597, 62, 15042, 13, 8692, 62, 12543, 2733, 13, 8692, 1330, 5972, 1362, 25060, 628, 198, 198, 4871, 327, 445, 14817, 25, 198, 220, 220, 220, 37227, 140, 246, 22177, 20375,...
1.85782
211
from types import TracebackType from typing import Any, Generator, Optional, Type from asyncpg import Connection, create_pool from asyncpg.pool import Pool __all__ = ["Engine"]
[ 6738, 3858, 1330, 34912, 1891, 6030, 198, 6738, 19720, 1330, 4377, 11, 35986, 11, 32233, 11, 5994, 198, 198, 6738, 30351, 6024, 1330, 26923, 11, 2251, 62, 7742, 198, 6738, 30351, 6024, 13, 7742, 1330, 19850, 198, 198, 834, 439, 834, 7...
3.851064
47
""" Convert all the taxonomy IDs to rank so that we are always talking about the same thing """ import sys import taxon try: rank = sys.argv[1] except: sys.exit(sys.argv[0] + " rank to use ... eg. species or genus") taxa = taxon.readNodes() with open("all_host_taxid.txt", 'r') as rin: for l in rin: ...
[ 37811, 198, 3103, 1851, 477, 262, 1687, 30565, 32373, 284, 4279, 523, 326, 356, 389, 1464, 3375, 198, 10755, 262, 976, 1517, 198, 37811, 198, 198, 11748, 25064, 198, 11748, 1687, 261, 198, 198, 28311, 25, 198, 220, 220, 220, 4279, 796...
2.064286
280
#! /usr/bin/python import sys import os import numpy if len(sys.argv) < 2: print "Usage: do_hist <input_file>" sys.exit(-1) wr_nums = [] rd_nums = [] parse_errors = 0 range_errors = 0 print "Loading data..." line_num = 0 for line in open(sys.argv[1]): try: #WR 0 3400 0.9994 12.1195 (typ,idx,cyc,us,g...
[ 2, 0, 1220, 14629, 14, 8800, 14, 29412, 198, 198, 11748, 25064, 198, 11748, 28686, 198, 11748, 299, 32152, 198, 198, 361, 18896, 7, 17597, 13, 853, 85, 8, 1279, 362, 25, 198, 220, 220, 220, 3601, 366, 28350, 25, 466, 62, 10034, 12...
2.153169
568
""" DeepLabCut2.0 Toolbox (deeplabcut.org) © A. & M. Mathis Labs https://github.com/AlexEMG/DeepLabCut Please see AUTHORS for contributors. https://github.com/AlexEMG/DeepLabCut/blob/master/AUTHORS Licensed under GNU Lesser General Public License v3.0 """ import os import numpy as np import matplotlib as mpl import ...
[ 37811, 198, 29744, 17822, 26254, 17, 13, 15, 16984, 3524, 357, 67, 1453, 489, 397, 8968, 13, 2398, 8, 198, 16224, 317, 13, 1222, 337, 13, 16320, 271, 23500, 198, 5450, 1378, 12567, 13, 785, 14, 15309, 3620, 38, 14, 29744, 17822, 262...
2.175554
1,219
import numpy as np from .functions import relu, d_relu, one_hot_convert class Linear: """ A linear layer that performs the operation W X + b Args: - n_inputs (int): number of inputs - n_outputs (int): number of outputs """ def __call__(self, X, cache=False): """ Performs a ...
[ 11748, 299, 32152, 355, 45941, 198, 6738, 764, 12543, 2733, 1330, 823, 84, 11, 288, 62, 260, 2290, 11, 530, 62, 8940, 62, 1102, 1851, 198, 198, 4871, 44800, 25, 198, 220, 220, 220, 37227, 317, 14174, 7679, 326, 17706, 262, 4905, 198...
2.254673
428
"""Layers are the building blocks of a Neural Network. A complete Neural Network model consists of several layers. A Layer is a function that receives a tensor as output, computes something out of it, and finally outputs a tensor. NeuralPy currently supports only one type of Layer and that is the Dense layer. """ fro...
[ 37811, 43, 6962, 389, 262, 2615, 7021, 286, 257, 47986, 7311, 13, 198, 32, 1844, 47986, 7311, 2746, 10874, 286, 1811, 11685, 13, 198, 32, 34398, 318, 257, 2163, 326, 11583, 257, 11192, 273, 355, 5072, 11, 198, 5589, 1769, 1223, 503, ...
3.574468
141
ACCOUNT_NAME = 'Hoptec'
[ 26861, 28270, 62, 20608, 796, 705, 23483, 36281, 6, 198 ]
2.4
10
from distutils.core import setup from catkin_pkg.python_setup import generate_distutils_setup # fetch values from package.xml setup_args = generate_distutils_setup( packages=['hfts_grasp_planner'], package_dir={'': 'src'}, requires=['rospy', 'numpy', 'yaml', 'rtree', 'tf', 'stl', 'sklearn', '...
[ 6738, 1233, 26791, 13, 7295, 1330, 9058, 198, 6738, 3797, 5116, 62, 35339, 13, 29412, 62, 40406, 1330, 7716, 62, 17080, 26791, 62, 40406, 198, 198, 2, 21207, 3815, 422, 5301, 13, 19875, 198, 40406, 62, 22046, 796, 7716, 62, 17080, 267...
2.518987
158
MAX = 100 gold = [[1, 3, 1, 8], [2, 9, 8, 1], [7, 0, 1, 3], [0, 6, 1, 2]] m = 4 n = 4 print(getMaxGold(gold, m, n))
[ 22921, 796, 1802, 628, 198, 198, 24267, 796, 16410, 16, 11, 513, 11, 352, 11, 807, 4357, 198, 220, 220, 220, 220, 220, 220, 220, 685, 17, 11, 860, 11, 807, 11, 352, 4357, 198, 220, 220, 220, 220, 220, 220, 220, 685, 22, 11, 65...
1.576087
92
import gmpy e = 3 n1 = 7156756869076785933541721538001332468058823716463367176522928415602207483494410804148006276542112924303341451770810669016327730854877940615498537882480613 n2 = 11836621785229749981615163446485056779734671669107550651518896061047640407932488359788368655821120768954153926193557467079978964149306...
[ 11748, 308, 3149, 88, 198, 198, 68, 796, 513, 198, 198, 77, 16, 796, 767, 21599, 2425, 3104, 3388, 2998, 30924, 3270, 2091, 4051, 1558, 23349, 2548, 405, 16945, 26912, 1795, 39118, 24693, 1433, 3510, 2091, 3134, 1558, 2996, 23539, 30336...
2.033445
598
# Lint-as: python3 # Copyright 2020 The IREE Authors # # Licensed under the Apache License v2.0 with LLVM Exceptions. # See https://llvm.org/LICENSE.txt for license information. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception from .core import * from .tools import CompilerToolError
[ 2, 406, 600, 12, 292, 25, 21015, 18, 198, 2, 15069, 12131, 383, 314, 11587, 46665, 198, 2, 198, 2, 49962, 739, 262, 24843, 13789, 410, 17, 13, 15, 351, 27140, 15996, 1475, 11755, 13, 198, 2, 4091, 3740, 1378, 297, 14761, 13, 2398,...
3.195652
92
# SPDX-License-Identifier: Apache-2.0 # # The OpenSearch Contributors require contributions made to # this file be licensed under the Apache-2.0 license or a # compatible open source license. import os import unittest from typing import Any from unittest.mock import MagicMock, patch from manifests.test_manifest impor...
[ 2, 30628, 55, 12, 34156, 12, 33234, 7483, 25, 24843, 12, 17, 13, 15, 198, 2, 198, 2, 383, 4946, 18243, 25767, 669, 2421, 9284, 925, 284, 198, 2, 428, 2393, 307, 11971, 739, 262, 24843, 12, 17, 13, 15, 5964, 393, 257, 198, 2, 1...
3.342657
143
# The ReactRoleTagger cog and all associated commands and data. import os import pickle from datetime import datetime from collections import defaultdict from typing import Union, List, Optional import discord as dc from discord.ext import commands from cogs_textbanks import url_bank, query_bank, response_bank from b...
[ 2, 383, 21492, 47445, 51, 7928, 43072, 290, 477, 3917, 9729, 290, 1366, 13, 198, 11748, 28686, 198, 11748, 2298, 293, 198, 6738, 4818, 8079, 1330, 4818, 8079, 198, 6738, 17268, 1330, 4277, 11600, 198, 6738, 19720, 1330, 4479, 11, 7343, ...
3.319149
141
import sklearn from sklearn import svm, metrics, model_selection import pandas as pd import numpy as np import matplotlib.pyplot as plt from sklearn.discriminant_analysis import LinearDiscriminantAnalysis from sklearn.ensemble import RandomForestRegressor from sklearn.feature_selection import SelectFromModel ...
[ 11748, 1341, 35720, 201, 198, 6738, 1341, 35720, 1330, 264, 14761, 11, 20731, 11, 2746, 62, 49283, 201, 198, 11748, 19798, 292, 355, 279, 67, 201, 198, 11748, 299, 32152, 355, 45941, 201, 198, 11748, 2603, 29487, 8019, 13, 9078, 29487, ...
2.257534
365
#!/usr/bin/evn python import sys import os import time import os as sistema # Set color R = '\033[31m' # Red N = '\033[1;37m' # White G = '\033[32m' # Green O = '\033[0;33m' # Orange B = '\033[1;34m' #Blue os.system("cd banner;python2 banner4.py") print print ("\033[49m Welcome To Virus-X ...
[ 2, 48443, 14629, 14, 8800, 14, 1990, 77, 21015, 198, 198, 11748, 25064, 198, 11748, 28686, 198, 11748, 640, 198, 11748, 28686, 355, 264, 396, 19687, 198, 198, 2, 5345, 3124, 198, 49, 796, 705, 59, 44427, 58, 3132, 76, 6, 1303, 2297,...
1.906367
267
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Description : This code generates yaml file that can be parsed by MultiQC, including input data information Copyright : (c) LemasLab, 02/23/2020 Author : Xinsong Du License : MIT License Maintainer : xinsongdu@ufl.edu, manfiol@ufl.edu, djlemas@...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 37811, 198, 11828, 1058, 770, 2438, 18616, 331, 43695, 2393, 326, 460, 307, 44267, 416, 15237, 48, 34, 11, 198, 220, ...
2.287172
1,372
""" Test the virtual machine. """ try: from StringIO import StringIO except ImportError: from io import StringIO import os import sys import mock import pytest sys.path.append(os.path.join('..', '..', 'snake')) from snake.vm import MEMORY_SIZE from snake.vm import System @pytest.fixture() def system(): ...
[ 37811, 6208, 262, 7166, 4572, 13, 37227, 198, 28311, 25, 198, 220, 220, 220, 422, 10903, 9399, 1330, 10903, 9399, 198, 16341, 17267, 12331, 25, 198, 220, 220, 220, 422, 33245, 1330, 10903, 9399, 198, 11748, 28686, 198, 11748, 25064, 198...
2.382937
1,512
""" 【Python魔术方法】常规魔术方法 """ """ __str__魔术方法: 在打印某个对象的时候,通常显示的是这个对象所属类的名字以及内存地址,这种样子是不适合人类来阅读的。 因此如果你想在打印某个对象的时候能更加友好一点,那么你可以自己重写这个方法,并且你自己定义好字符串再返回: 在没有重写__str__函数的时候,打印出来的对象是 类名+地址 例:<__main__.Person object at 0x02A708F0> __repr__魔术方法: 这个魔术方法是用来表述一个对象的,用于给机器看的。这样说可能不好理解,这里以两个小案例说明这个魔术方法的一个用法: 未使用__repr__魔术方法: 例:[<__m...
[ 37811, 198, 31854, 37906, 20804, 17312, 107, 43095, 37345, 243, 31817, 30585, 116, 164, 100, 226, 20804, 17312, 107, 43095, 37345, 243, 198, 37811, 198, 198, 37811, 198, 834, 2536, 834, 20804, 17312, 107, 43095, 37345, 243, 171, 120, 248,...
1.0054
926
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
[ 2, 49962, 284, 262, 24843, 10442, 5693, 357, 1921, 37, 8, 739, 530, 198, 2, 393, 517, 18920, 5964, 11704, 13, 220, 4091, 262, 28536, 2393, 198, 2, 9387, 351, 428, 670, 329, 3224, 1321, 198, 2, 5115, 6634, 9238, 13, 220, 383, 7054,...
2.765746
1,810
"""The ship module. Defines the ship class, and the ship-breakup class (for when death happens).""" import math import random import pyxel from bullet import Bullet from utils import check_bounds, rotate_around_origin, Point import constants import sound class Ship: """The ship class. The ship class des...
[ 37811, 464, 4074, 8265, 13, 198, 198, 7469, 1127, 262, 4074, 1398, 11, 290, 262, 4074, 12, 9032, 929, 1398, 357, 1640, 618, 198, 22595, 4325, 21387, 15931, 198, 198, 11748, 10688, 198, 11748, 4738, 198, 198, 11748, 12972, 87, 417, 198...
2.125495
3,785
from django.shortcuts import render, get_object_or_404 from .models import Category, Product from cart.forms import CartAddProductForm from django.views.generic import ( ListView, DetailView ) ''' class ProductListView(ListView): template_name = 'shop/product/list.html' queryset = Product.objects.all(...
[ 6738, 42625, 14208, 13, 19509, 23779, 1330, 8543, 11, 651, 62, 15252, 62, 273, 62, 26429, 198, 198, 6738, 764, 27530, 1330, 21743, 11, 8721, 198, 6738, 6383, 13, 23914, 1330, 13690, 4550, 15667, 8479, 198, 198, 6738, 42625, 14208, 13, ...
2.847826
184
# Copyright 2020 Roeland Wiersema # # 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 writ...
[ 2, 15069, 12131, 5564, 8822, 370, 959, 325, 2611, 198, 2, 198, 2, 49962, 739, 262, 24843, 13789, 11, 10628, 362, 13, 15, 357, 1169, 366, 34156, 15341, 198, 2, 345, 743, 407, 779, 428, 2393, 2845, 287, 11846, 351, 262, 13789, 13, 1...
2.137628
7,840
#!/usr/bin/python3 # # Stephen Vondenstein, Matthew Buckley # 10/14/2018 # import os # Add parent to project root so we can import project files import sys sys.path.append('..') import numpy as np import pandas as pd import math import cv2 from tqdm import tqdm from src.utils.parser import get_args from src.utils.util...
[ 2, 48443, 14629, 14, 8800, 14, 29412, 18, 198, 2, 198, 2, 7970, 569, 623, 37975, 11, 9308, 41493, 198, 2, 838, 14, 1415, 14, 7908, 198, 2, 198, 11748, 28686, 198, 2, 3060, 2560, 284, 1628, 6808, 523, 356, 460, 1330, 1628, 3696, ...
2.853933
267
import pytest
[ 11748, 12972, 9288, 198, 220, 220, 220, 220, 220, 220, 220, 198 ]
1.833333
12
# =============================================================================== # Copyright 2017 ross # # 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/LICE...
[ 2, 38093, 25609, 855, 198, 2, 15069, 2177, 686, 824, 198, 2, 198, 2, 49962, 739, 262, 24843, 13789, 11, 10628, 362, 13, 15, 357, 1169, 366, 34156, 15341, 198, 2, 345, 743, 407, 779, 428, 2393, 2845, 287, 11846, 351, 262, 13789, 13...
3.704388
433
import httplib import os.path import requests import six from simplekit import settings from simplekit.exceptions import MailException PRIORITY_NORMAL = 0 PRIORITY_LOW = 1 PRIORITY_HIGH = 2 CONTENT_TYPE_HTML = 0 CONTENT_TYPE_TEXT = 1 ENCODING_UTF8 = 0 ENCODING_ASCII = 1 ENCODING_UTF32 = 2 ENCODI...
[ 11748, 1841, 489, 571, 201, 198, 11748, 28686, 13, 6978, 201, 198, 201, 198, 11748, 7007, 201, 198, 11748, 2237, 201, 198, 201, 198, 6738, 2829, 15813, 1330, 6460, 201, 198, 6738, 2829, 15813, 13, 1069, 11755, 1330, 11099, 16922, 201, ...
2.117479
349
import re from requests_html import HTMLSession from datetime import datetime from urllib.parse import quote from bs4 import BeautifulSoup from logger import Logger session = HTMLSession() def get_tweets(query, pages=25): """Gets tweets for a given user, via the Twitter frontend API.""" logger = Logger() ...
[ 11748, 302, 198, 6738, 7007, 62, 6494, 1330, 11532, 36044, 198, 6738, 4818, 8079, 1330, 4818, 8079, 198, 6738, 2956, 297, 571, 13, 29572, 1330, 9577, 198, 6738, 275, 82, 19, 1330, 23762, 50, 10486, 198, 6738, 49706, 1330, 5972, 1362, ...
2.517888
587
import numpy as np import pandas as pd header = ['user_id','item_id','rating','timestamp'] src_data = pd.read_csv('ml-100k/u.data',sep = '\t',names = header) unique_user_count = src_data.user_id.nunique() #查看用户去重个数 unique_item_count = src_data.item_id.nunique() #查看物品去重个数 ...
[ 11748, 299, 32152, 355, 45941, 201, 198, 11748, 19798, 292, 355, 279, 67, 201, 198, 25677, 796, 37250, 7220, 62, 312, 41707, 9186, 62, 312, 41707, 8821, 41707, 16514, 27823, 20520, 201, 198, 10677, 62, 7890, 796, 279, 67, 13, 961, 62,...
1.900452
221
from telethon import TelegramClient import os
[ 6738, 5735, 400, 261, 1330, 50203, 11792, 198, 11748, 28686, 628, 198 ]
4
12
""" UUID related utilities and helper functions. """ import uuid def is_uuid_like(val): """Returns validation of a value as a UUID. For our purposes, a UUID is a canonical form string: aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa """ try: return str(uuid.UUID(val)) == val except (TypeError...
[ 37811, 198, 52, 27586, 3519, 20081, 290, 31904, 5499, 13, 198, 37811, 198, 198, 11748, 334, 27112, 628, 198, 198, 4299, 318, 62, 12303, 312, 62, 2339, 7, 2100, 2599, 198, 220, 220, 220, 37227, 35561, 21201, 286, 257, 1988, 355, 257, ...
2.695652
138
#!/usr/bin/env python """ """ import os import time import shutil import numpy as np from random import randrange from functools import partial from datetime import timedelta import wx import wx.lib.scrolledpanel as scrolled import wx.lib.mixins.inspection HAS_EPICS = False try: import epics from epics.wx imp...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 37811, 198, 37811, 198, 11748, 28686, 198, 11748, 640, 198, 11748, 4423, 346, 198, 11748, 299, 32152, 355, 45941, 198, 6738, 4738, 1330, 43720, 9521, 198, 6738, 1257, 310, 10141, 1330, 1...
2.463918
388
""" Cisco_IOS_XR_subscriber_pppoe_ma_oper This module contains a collection of YANG definitions for Cisco IOS\-XR subscriber\-pppoe\-ma package operational data. This module contains definitions for the following management objects\: pppoe\: PPPoE operational data Copyright (c) 2013\-2017 by Cisco Systems, Inc. A...
[ 37811, 28289, 62, 40, 2640, 62, 55, 49, 62, 7266, 1416, 24735, 62, 381, 79, 2577, 62, 2611, 62, 3575, 220, 198, 198, 1212, 8265, 4909, 257, 4947, 286, 575, 15567, 17336, 198, 1640, 28289, 314, 2640, 41441, 55, 49, 32944, 41441, 381,...
1.362846
74,409
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Sep 26 20:46:03 2018 @author: daniel cons(a, b) constructs a pair, and car(pair) and cdr(pair) returns the first and last element of that pair. For example, car(cons(3, 4)) returns 3, and cdr(cons(3, 4)) returns 4. Given this implementation of cons: ...
[ 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, 3300, 8621, 2608, 1160, 25, 3510, 25, 3070, 2864, 198, 198, 31, 9800, 25, 288, 6321, 198,...
2.492537
201
"""clean.py Drop and encode features specified in config.json. """ import os import sys import argparse import category_encoders as ce import pandas as pd from src.log import Logger log = Logger('clean') class Cleaner(): """Drop and encode columns in a dataframe. Additionally, drops rows with NA values. A...
[ 37811, 27773, 13, 9078, 198, 198, 26932, 290, 37773, 3033, 7368, 287, 4566, 13, 17752, 13, 198, 37811, 198, 198, 11748, 28686, 198, 11748, 25064, 198, 198, 11748, 1822, 29572, 198, 11748, 6536, 62, 12685, 375, 364, 355, 2906, 198, 11748...
2.957854
261
""" EULA APP This module provides a form for the user to be able to accept the EULA. Classes: SignEULAForm Functions: n/a Created on 23 Oct 2013 @author: michael """ from django import forms from django.contrib.contenttypes.models import ContentType from tunobase.core import utils as core_utils from tunob...
[ 37811, 198, 36, 6239, 32, 43504, 198, 198, 1212, 8265, 3769, 257, 1296, 329, 262, 2836, 284, 307, 1498, 284, 2453, 198, 1169, 4576, 13534, 13, 198, 198, 9487, 274, 25, 198, 220, 220, 220, 5865, 36, 6239, 32, 8479, 198, 198, 24629, ...
2.229805
718
from subprocess import PIPE, STDOUT, Popen # edax config edax_level = 1 edax_path = "./edax/Edax" edax_eval_path = "./edax/data/eval.dat" edax_book_path = "./edax/data/book.dat"
[ 198, 6738, 850, 14681, 1330, 350, 4061, 36, 11, 48571, 12425, 11, 8099, 268, 198, 198, 2, 1225, 897, 4566, 198, 276, 897, 62, 5715, 796, 352, 198, 276, 897, 62, 6978, 796, 366, 19571, 276, 897, 14, 7407, 897, 1, 198, 276, 897, 6...
2.246914
81
#!/usr/bin/python3 """ This program handles the relay for the lights. """ from time import sleep, localtime, strftime from datetime import datetime from astral import Astral # For sunset and sunrise import RPi.GPIO as GPIO if __name__ == '__main__': try: main() except KeyboardInterrupt: prin...
[ 2, 48443, 14629, 14, 8800, 14, 29412, 18, 198, 198, 37811, 198, 1212, 1430, 17105, 262, 24248, 329, 262, 7588, 13, 198, 37811, 198, 198, 6738, 640, 1330, 3993, 11, 1957, 2435, 11, 965, 31387, 198, 6738, 4818, 8079, 1330, 4818, 8079, ...
2.860294
136
""" cepelblog/core/views.py """ from cepelblog.models import BlogPost, Tag from flask import render_template, request, Blueprint core = Blueprint('core', __name__) # ----------------------------------------------------------------------------- # INDEX VIEW # ----------------------------------------------------------...
[ 37811, 198, 344, 30242, 14036, 14, 7295, 14, 33571, 13, 9078, 198, 37811, 198, 198, 6738, 269, 538, 417, 14036, 13, 27530, 1330, 14001, 6307, 11, 17467, 198, 6738, 42903, 1330, 8543, 62, 28243, 11, 2581, 11, 39932, 198, 198, 7295, 796...
6.241667
120
import os import glob import numpy as np import time import matplotlib.pyplot as plt from PIL import ImageOps, Image from keras.models import load_model import keras.backend as K from shutil import copyfile # K.set_image_data_format('channels_last') K.set_learning_phase(0) if __name__ == '__main__': path_models =...
[ 11748, 28686, 198, 11748, 15095, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 640, 198, 11748, 2603, 29487, 8019, 13, 9078, 29487, 355, 458, 83, 198, 6738, 350, 4146, 1330, 7412, 41472, 11, 7412, 198, 6738, 41927, 292, 13, 27530, 133...
1.845293
1,519
""" Example of non-nested structure with translation and rotations """ from larlib import * square = larCuboids([1,1]) table = larApply( t(-.5,-.5) )(square) chair = larApply( s(.35,.35) )(table) chair1 = larApply( t(.75, 0) )(chair) chair2 = larApply( r(PI/2) )(chair1) chair3 = larApply( r(PI/2) )(chair2) chair4 = la...
[ 37811, 17934, 286, 1729, 12, 77, 7287, 4645, 351, 11059, 290, 5724, 602, 37227, 198, 198, 6738, 300, 7063, 571, 1330, 1635, 198, 23415, 796, 26371, 43632, 10994, 26933, 16, 11, 16, 12962, 198, 11487, 796, 26371, 44836, 7, 256, 32590, ...
2.29
200
# -*- coding: utf-8 -*- # Generated by Django 1.11.16 on 2018-12-13 19:15 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion import uuid
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 2, 2980, 515, 416, 37770, 352, 13, 1157, 13, 1433, 319, 2864, 12, 1065, 12, 1485, 678, 25, 1314, 198, 6738, 11593, 37443, 834, 1330, 28000, 1098, 62, 17201, 874, 198, ...
2.767123
73
import numpy as np class LinearRegression: """ A linear regression model with polynomial basis functions. Args: lamb: float, regularization factor. """ def fit(self, X, Y): """ Trains the model using the specified features and target values. Args: ...
[ 11748, 299, 32152, 355, 45941, 198, 198, 4871, 44800, 8081, 2234, 25, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 317, 14174, 20683, 2746, 351, 745, 6213, 49070, 4308, 5499, 13, 198, 220, 220, 220, 943, 14542, 25, 198, 220, 220, ...
2.20462
606
#import numpy as np from sklearn.externals import joblib
[ 2, 11748, 299, 32152, 355, 45941, 198, 6738, 1341, 35720, 13, 1069, 759, 874, 1330, 1693, 8019, 628, 198 ]
3.105263
19
""" * Assignment: Numpy Polyfit * Complexity: easy * Lines of code: 4 lines * Time: 8 min English: 1. Given are points coordinates in Cartesian system 2. Separate first row (header) from data 3. Calculate coefficients of best approximating polynomial of 3rd degree 4. Run doctests - all must succeed Po...
[ 37811, 198, 9, 50144, 25, 399, 32152, 12280, 11147, 198, 9, 19157, 414, 25, 2562, 198, 9, 26299, 286, 2438, 25, 604, 3951, 198, 9, 3862, 25, 807, 949, 198, 198, 15823, 25, 198, 220, 220, 220, 352, 13, 11259, 389, 2173, 22715, 287,...
2.224576
472
#!/usr/bin/env python # # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the #...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 2, 198, 2, 198, 2, 49962, 284, 262, 24843, 10442, 5693, 357, 1921, 37, 8, 739, 530, 198, 2, 393, 517, 18920, 5964, 11704, 13, 220, 4091, 262, 28536, 2393, 198, 2, 9387, 351, 428, ...
2.325779
9,046
from django.db import models from django.contrib.auth.models import User from tinymce.models import HTMLField # Create your models here.
[ 6738, 42625, 14208, 13, 9945, 1330, 4981, 198, 6738, 42625, 14208, 13, 3642, 822, 13, 18439, 13, 27530, 1330, 11787, 198, 6738, 7009, 76, 344, 13, 27530, 1330, 11532, 15878, 198, 198, 2, 13610, 534, 4981, 994, 13, 628 ]
3.564103
39
from tweet_builder import TweetBuilder
[ 6738, 6126, 62, 38272, 1330, 18752, 32875, 198 ]
4.875
8
# PigletC from .raddsl_parse import * from .term import * ast_integer = to(2, lambda p, x: Int(int(x), pos=p)) ast_op = to(2, lambda p, x: Op(x, pos=p)) ast_bop = to(3, lambda x, o, y: Bop(o[1], x, y, pos=attr(o, "pos"))) ast_assign = to(2, lambda x, y: Assign(x, y, pos=attr(x, "pos"))) ast_call = to(2, lambda x, ...
[ 2, 23097, 1616, 34, 198, 198, 6738, 764, 81, 2860, 6649, 62, 29572, 1330, 1635, 198, 6738, 764, 4354, 1330, 1635, 628, 628, 198, 459, 62, 41433, 796, 284, 7, 17, 11, 37456, 279, 11, 2124, 25, 2558, 7, 600, 7, 87, 828, 1426, 28, ...
2.298701
924
import math import torch import torch.nn as nn import torch.nn.functional as F from torch.nn.parameter import Parameter from data.data_helper import BasicDataset from src.layers import GraphConvolution # class GCN(nn.Module): # def __init__(self, nfeat, nhid, nclass, dropout): # super(GCN, self).__init__(...
[ 11748, 10688, 198, 11748, 28034, 198, 11748, 28034, 13, 20471, 355, 299, 77, 198, 11748, 28034, 13, 20471, 13, 45124, 355, 376, 198, 6738, 28034, 13, 20471, 13, 17143, 2357, 1330, 25139, 2357, 198, 198, 6738, 1366, 13, 7890, 62, 2978, ...
2.043186
1,042
#!/usr/bin/env python # -*- coding: UTF-8 -*- """ ================================================= @Project :aste @IDE :PyCharm @Author :Mr. Wireless @Date :2021/12/24 10:19 @Desc : ================================================== """ import itertools from typing import List import torch.nn as nn import...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 2, 532, 9, 12, 19617, 25, 41002, 12, 23, 532, 9, 12, 198, 37811, 198, 10052, 4770, 28, 198, 31, 16775, 27332, 120, 248, 4594, 198, 31, 14114, 220, 220, 220, 220, 27332, 120, 248, ...
2.889831
118
""" A very simple Tosca daemon. Every ten seconds it looks for new programs in "run" or "destroy" status, and executes them. TODO: Replace this with observer and/or model_policies ? """ import os import sys from threading import Thread import time # add the parent directory to sys.path import os,sys,inspect ...
[ 37811, 317, 845, 2829, 40195, 6888, 33386, 13, 3887, 3478, 4201, 340, 3073, 329, 649, 4056, 287, 198, 220, 220, 220, 366, 5143, 1, 393, 366, 41659, 1, 3722, 11, 290, 42985, 606, 13, 628, 220, 220, 220, 16926, 46, 25, 40177, 428, 3...
2.830357
336
# Declaring a dictionary dictStudent = {'Name':'Zara', 'Age':'20', 'Class':'first'} print('\n') # Accessing the dictionary with its value print('dictStudent[Name] = ', dictStudent['Name']) print('dictStudent[Age] = ', dictStudent['Age']) print('dictStudent[Class] = ', dictStudent['Class']) print('\n') # Check if the...
[ 198, 2, 16691, 1723, 257, 22155, 198, 11600, 38778, 796, 1391, 6, 5376, 10354, 6, 57, 3301, 3256, 705, 23396, 10354, 6, 1238, 3256, 705, 9487, 10354, 6, 11085, 6, 92, 198, 4798, 10786, 59, 77, 11537, 198, 198, 2, 8798, 278, 262, 2...
2.552632
304
import numpy as np from nefct.geometry.scanner_config import ScannerConfig2D, ScannerConfig3D from nefct.geometry.detector_config import DetectorDirectAConfig, DetectorDirectBConfig __all__ = ( 'cbct_a_detector', 'cbct_b_detector', 'cbct_2d_scanner', 'cbct_3d_scanner', 'cbct_angles', 'cbct_2d_full_fan_scanner...
[ 11748, 299, 32152, 355, 45941, 198, 198, 6738, 497, 69, 310, 13, 469, 15748, 13, 35836, 1008, 62, 11250, 1330, 20937, 1008, 16934, 17, 35, 11, 20937, 1008, 16934, 18, 35, 198, 6738, 497, 69, 310, 13, 469, 15748, 13, 15255, 9250, 62,...
1.300118
4,255
import glob import re import numpy as np from PIL import Image pattern = r'(?P<name>[a-zA-z]+)_art_small\.png' for fname in glob.glob('*.png'): if (m := re.match(pattern, fname)) is not None: img = np.array(Image.open(fname)) indices = np.logical_and(np.all(img[:,:,0:1] == img, 2), np.all(img > 160...
[ 11748, 15095, 198, 11748, 302, 198, 11748, 299, 32152, 355, 45941, 198, 6738, 350, 4146, 1330, 7412, 198, 198, 33279, 796, 374, 6, 7, 30, 47, 27, 3672, 36937, 64, 12, 89, 32, 12, 89, 60, 28988, 62, 433, 62, 17470, 17405, 11134, 6,...
2.160714
280
#!/usr/bin/env python3 '''aionfpga ~ fhnwtoys.enums Copyright (C) 2020 Dominik Müller and Nico Canzani ''' import cv2 from enum import IntEnum # Enums ----------------------------------------------------------------------
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 198, 7061, 6, 64, 295, 46428, 4908, 5299, 277, 21116, 46569, 19417, 13, 268, 5700, 198, 15269, 357, 34, 8, 12131, 11817, 1134, 40790, 6051, 290, 39360, 1680, 89, 3216, 198, 7061, ...
3.476923
65
# coding=utf-8 """ Gets OCDS JSON notices from the Contracts Finder API, and insert 100 with sufficient content, with an option to update these using the existing OCIDs API Info https://content-api.publishing.service.gov.uk/#gov-uk-content-api https://www.gov.uk/government/publications/open-contracting https://www.co...
[ 2, 19617, 28, 40477, 12, 23, 198, 37811, 198, 38, 1039, 24775, 5258, 19449, 19748, 422, 262, 49199, 42500, 7824, 11, 290, 7550, 1802, 351, 6751, 2695, 11, 198, 4480, 281, 3038, 284, 4296, 777, 1262, 262, 4683, 24775, 47954, 198, 198, ...
2.404376
2,651
import copy import six import json from django.db.models import Q from django.core.exceptions import ImproperlyConfigured, PermissionDenied from django.core.urlresolvers import reverse from django.http import HttpResponseBadRequest, HttpResponse from django.shortcuts import get_object_or_404 from eztables.forms import...
[ 11748, 4866, 198, 11748, 2237, 198, 11748, 33918, 198, 198, 6738, 42625, 14208, 13, 9945, 13, 27530, 1330, 1195, 198, 6738, 42625, 14208, 13, 7295, 13, 1069, 11755, 1330, 12205, 525, 306, 16934, 1522, 11, 2448, 3411, 21306, 798, 198, 67...
3.308458
201
#!/usr/bin/env python # a simple routine to parse particle files and dump out the particle # histories into separate files (1 file per particle) so that they can # be plotted elsewhere #import math import numpy import sys import parseparticles #-----------------------------------------------------------------------...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 198, 2, 257, 2829, 8027, 284, 21136, 18758, 3696, 290, 10285, 503, 262, 18758, 198, 2, 25985, 656, 4553, 3696, 357, 16, 2393, 583, 18758, 8, 523, 326, 484, 460, 198, 2, 307, 37515, ...
3.517857
168
# Arrume a formatação na saida, para dinheiro, do exer 107 import moeda valor = float(input('Digite um valor: R$')) print() print(f'Aumentando 10% o valor {moeda.moeda(valor)} -> {moeda.moeda(moeda.aumentar(valor))} ') print(f'Diminuindo 10% o valor {moeda.moeda(valor)} -> {moeda.moeda(moeda.diminuir(valor))} ...
[ 2, 943, 81, 2454, 257, 1296, 1045, 16175, 28749, 12385, 531, 64, 11, 31215, 16278, 258, 7058, 11, 466, 409, 263, 16226, 201, 198, 11748, 6941, 18082, 201, 198, 201, 198, 2100, 273, 796, 12178, 7, 15414, 10786, 19511, 578, 23781, 1188,...
2.141026
234
from roadshow.hed import hed import cv2 import numpy as np
[ 6738, 2975, 12860, 13, 704, 1330, 16418, 198, 11748, 269, 85, 17, 198, 11748, 299, 32152, 355, 45941, 198, 220, 220, 220, 220 ]
2.73913
23
import torch import torchvision.transforms as transforms import torch.utils.data as data import os import pickle from build_vocab import Vocabulary import numpy as np import nltk from PIL import Image from pycocotools.coco import COCO class CocoDataset(data.Dataset): """COCO Custom Dataset compatible with torch.u...
[ 11748, 28034, 198, 11748, 28034, 10178, 13, 7645, 23914, 355, 31408, 198, 11748, 28034, 13, 26791, 13, 7890, 355, 1366, 198, 11748, 28686, 198, 11748, 2298, 293, 198, 6738, 1382, 62, 18893, 397, 1330, 47208, 22528, 198, 11748, 299, 32152,...
2.339611
1,646
import pickle from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.feature_extraction.text import CountVectorizer import numpy import nltk from nltk.tokenize import RegexpTokenizer from nltk.corpus import stopwords from nltk.stem import WordNetLemmatizer import pandas as pd from sklearn.metrics.pair...
[ 11748, 2298, 293, 198, 6738, 1341, 35720, 13, 30053, 62, 2302, 7861, 13, 5239, 1330, 309, 69, 312, 69, 38469, 7509, 198, 6738, 1341, 35720, 13, 30053, 62, 2302, 7861, 13, 5239, 1330, 2764, 38469, 7509, 198, 11748, 299, 32152, 198, 117...
2.697425
466
# Get the product of all element at the list except the element
[ 2, 3497, 262, 1720, 286, 477, 5002, 379, 262, 1351, 2845, 262, 5002, 198 ]
4.571429
14
import setuptools with open("README.md", "r", encoding="utf-8") as fh: long_description = fh.read() setuptools.setup( name="EngineeringToolbox", # Replace with your own username version="0.0.4", author="Joshua H. Phillips", description="Package containing python programs for common problems in mec...
[ 11748, 900, 37623, 10141, 198, 198, 4480, 1280, 7203, 15675, 11682, 13, 9132, 1600, 366, 81, 1600, 21004, 2625, 40477, 12, 23, 4943, 355, 277, 71, 25, 198, 220, 220, 220, 890, 62, 11213, 796, 277, 71, 13, 961, 3419, 198, 198, 2617, ...
2.629969
327