content
stringlengths
1
1.04M
input_ids
listlengths
1
774k
ratio_char_token
float64
0.38
22.9
token_count
int64
1
774k
import sys import os import signal sys.path.append(os.path.join(os.path.dirname(__file__), '..')) from munch import Munch ''' Signals munch.subscription.create -> Create a new subscription munch.subscription.delete -> Deletes an existing subscription munch.subscription.update -> Updates an existing subscription m...
[ 11748, 25064, 198, 11748, 28686, 198, 11748, 6737, 198, 198, 17597, 13, 6978, 13, 33295, 7, 418, 13, 6978, 13, 22179, 7, 418, 13, 6978, 13, 15908, 3672, 7, 834, 7753, 834, 828, 705, 492, 6, 4008, 198, 6738, 285, 3316, 1330, 337, 3...
2.670918
392
# Definition for a Node. from typing import Optional s = Solution() print(s.flatten(Node(None, None, None, None)))
[ 2, 30396, 329, 257, 19081, 13, 198, 6738, 19720, 1330, 32233, 628, 628, 198, 82, 796, 28186, 3419, 198, 4798, 7, 82, 13, 2704, 41769, 7, 19667, 7, 14202, 11, 6045, 11, 6045, 11, 6045, 22305, 198 ]
3.216216
37
import io import os import tarfile from core.DockerClient import DockerClient from core.LineBuffer import LineBuffer from core.TarUtils import make_tarfile
[ 11748, 33245, 198, 11748, 28686, 198, 11748, 13422, 7753, 198, 198, 6738, 4755, 13, 35, 12721, 11792, 1330, 25716, 11792, 198, 6738, 4755, 13, 13949, 28632, 1330, 6910, 28632, 198, 6738, 4755, 13, 47079, 18274, 4487, 1330, 787, 62, 18870,...
3.761905
42
"""Routines for streaming cell data""" import os import warnings import logging logging.captureWarnings(True) if __name__ == "__main__": warnings.warn("to be implemented")
[ 37811, 49, 448, 1127, 329, 11305, 2685, 1366, 37811, 198, 198, 11748, 28686, 198, 11748, 14601, 198, 11748, 18931, 198, 198, 6404, 2667, 13, 27144, 495, 54, 1501, 654, 7, 17821, 8, 198, 198, 361, 11593, 3672, 834, 6624, 366, 834, 1241...
3.140351
57
import sae import os import sys from driving import wsgi app_root = os.path.dirname(__file__) sys.path.insert(0, os.path.join(app_root, 'django-filter-0.9.2')) application = sae.create_wsgi_app(wsgi.application)
[ 11748, 473, 68, 198, 11748, 28686, 198, 11748, 25064, 198, 6738, 5059, 1330, 266, 82, 12397, 198, 198, 1324, 62, 15763, 796, 28686, 13, 6978, 13, 15908, 3672, 7, 834, 7753, 834, 8, 220, 198, 17597, 13, 6978, 13, 28463, 7, 15, 11, ...
2.511628
86
# -*- coding: utf-8 -*- """ Created on Fri Jun 4 00:12:01 2021 @author: ali_d """ #3D graphs from mpl_toolkits.mplot3d import axes3d import matplotlib.pyplot as plt from matplotlib import style style.use('fivethirtyeight') fig = plt.figure() ax1 = fig.add_subplot(111, projection='3d') x = [1,2,3,4,5,6,7,8,9,10] ...
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 37811, 198, 41972, 319, 19480, 7653, 220, 604, 3571, 25, 1065, 25, 486, 33448, 198, 198, 31, 9800, 25, 34965, 62, 67, 198, 37811, 198, 198, 2, 18, 35, 28770, 198, 19...
1.772045
1,066
# Copyright (c) Microsoft. All rights reserved. # Licensed under the MIT license. See LICENSE.md file in the project root # for full license information. # ============================================================================== from . import cntk_py from .cntk_py import default_param_init_scale as DefaultParamI...
[ 2, 15069, 357, 66, 8, 5413, 13, 1439, 2489, 10395, 13, 198, 2, 49962, 739, 262, 17168, 5964, 13, 4091, 38559, 24290, 13, 9132, 2393, 287, 262, 1628, 6808, 198, 2, 329, 1336, 5964, 1321, 13, 198, 2, 38093, 25609, 28, 198, 198, 6738...
2.671693
2,321
functions = { 'AddCDAQSyncConnection': { 'parameters': [ { 'direction': 'in', 'name': 'portList', 'type': 'const char[]' } ], 'returns': 'int32' }, 'AddGlobalChansToTask': { 'parameters': [ { ...
[ 12543, 2733, 796, 1391, 198, 220, 220, 220, 705, 4550, 34, 46640, 28985, 32048, 10354, 1391, 198, 220, 220, 220, 220, 220, 220, 220, 705, 17143, 7307, 10354, 685, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1391, 198...
1.501789
255,145
#!/usr/bin/env python3 # -*- coding: utf-8 -*- x = abs(100) y = abs(-20) print(x, y) print() # 以下函数可以接收任意多个参数 print('max(1, 2, 3) =', max(1, 2, 3)) print('min(1, 2, 3) =', min(1, 2, 3)) print('sum([1, 2, 3]) =', sum([1, 2, 3])) print() # 数据类型转换 print(int('123')) print(int(12.34)) print(float('12.34')) print(str(1....
[ 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, 87, 796, 2352, 7, 3064, 8, 198, 88, 796, 2352, 32590, 1238, 8, 198, 4798, 7, 87, 11, 331, 8, 198, 198, ...
1.273381
417
### Comparison between drivers ## import time import board import busio ### Adafruit MPU6050 (similar chip) import adafruit_mpu6050 ### RM Forked Driver from robohat_mpu9250.mpu9250 import MPU9250 as RM9250 from robohat_mpu9250.mpu6500 import MPU6500 as RM6500 from robohat_mpu9250.ak8963 import AK8963 as RM8963 ###...
[ 21017, 220, 34420, 1022, 6643, 198, 2235, 198, 11748, 640, 198, 11748, 3096, 198, 11748, 1323, 952, 198, 198, 21017, 1215, 1878, 4872, 4904, 52, 1899, 1120, 357, 38610, 11594, 8, 198, 11748, 512, 1878, 4872, 62, 3149, 84, 1899, 1120, ...
2.037576
825
__all__ = ['create_build_dir'] from pathlib import Path from typing import Optional from error import * from file_structure import * from ..find_build_dir import *
[ 834, 439, 834, 796, 37250, 17953, 62, 11249, 62, 15908, 20520, 198, 198, 6738, 3108, 8019, 1330, 10644, 198, 6738, 19720, 1330, 32233, 198, 198, 6738, 4049, 1330, 1635, 198, 6738, 2393, 62, 301, 5620, 1330, 1635, 198, 6738, 11485, 19796...
3.479167
48
import os from util.YamlConfig import YamlConfig if __name__ == "__main__": yaml_test()
[ 11748, 28686, 198, 198, 6738, 7736, 13, 56, 43695, 16934, 1330, 14063, 75, 16934, 628, 198, 198, 361, 11593, 3672, 834, 6624, 366, 834, 12417, 834, 1298, 198, 220, 220, 220, 331, 43695, 62, 9288, 3419, 198 ]
2.594595
37
from pathlib import Path from fhir.resources.valueset import ValueSet as _ValueSet from oops_fhir.utils import ValueSet from oops_fhir.r4.code_system.v3_act_code import v3ActCode __all__ = ["v3SecurityPolicy"] _resource = _ValueSet.parse_file(Path(__file__).with_suffix(".json")) class v3SecurityPolicy(v3ActCod...
[ 6738, 3108, 8019, 1330, 10644, 198, 198, 6738, 277, 71, 343, 13, 37540, 13, 27160, 316, 1330, 11052, 7248, 355, 4808, 11395, 7248, 198, 198, 6738, 267, 2840, 62, 69, 71, 343, 13, 26791, 1330, 11052, 7248, 628, 198, 6738, 267, 2840, ...
2.966825
211
from __future__ import absolute_import from sentry import http from sentry.plugins.bases.data_forwarding import DataForwardingPlugin from test_only_plugins.base import CorePluginMixin from test_only_plugins.utils import get_secret_field_config
[ 6738, 11593, 37443, 834, 1330, 4112, 62, 11748, 198, 198, 6738, 1908, 563, 1330, 2638, 198, 6738, 1908, 563, 13, 37390, 13, 65, 1386, 13, 7890, 62, 11813, 278, 1330, 6060, 39746, 278, 37233, 198, 198, 6738, 1332, 62, 8807, 62, 37390, ...
3.686567
67
import pytest import os from contextualized_topic_models.models.ctm import ZeroShotTM from contextualized_topic_models.evaluation.measures import CoherenceNPMI, CoherenceCV, InvertedRBO, TopicDiversity from contextualized_topic_models.utils.data_preparation import TopicModelDataPreparation @pytest.fixture @pytest.f...
[ 11748, 12972, 9288, 198, 11748, 28686, 198, 198, 6738, 38356, 1143, 62, 26652, 62, 27530, 13, 27530, 13, 310, 76, 1330, 12169, 28512, 15972, 198, 6738, 38356, 1143, 62, 26652, 62, 27530, 13, 18206, 2288, 13, 47336, 1330, 1766, 23545, 45...
3.317308
104
# !/usr/bin/env python3 # -*-coding:utf-8-*- # @file: setup.py # @brief: # @author: Changjiang Cai, ccai1@stevens.edu, caicj5351@gmail.com # @version: 0.0.1 # @creation date: 28-10-2019 # @last modified: Tue 29 Oct 2019 02:00:37 PM EDT from distutils.core import setup from Cython.Build import cythonize from distutils....
[ 2, 5145, 14, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 2, 532, 9, 12, 66, 7656, 25, 40477, 12, 23, 12, 9, 12, 198, 2, 2488, 7753, 25, 9058, 13, 9078, 198, 2, 2488, 65, 3796, 25, 198, 2, 2488, 9800, 25, 22597, 39598, 327, 1...
2.512953
193
#-------------------------------- # demo of convolution of 2D image - laplacian kernel #-------------------------------- import numpy as np import cv2 if __name__ == '__main__': UseWebCam()
[ 201, 198, 201, 198, 201, 198, 201, 198, 201, 198, 201, 198, 2, 3880, 201, 198, 2, 13605, 286, 3063, 2122, 286, 362, 35, 2939, 532, 8591, 489, 330, 666, 9720, 220, 201, 198, 2, 3880, 201, 198, 201, 198, 201, 198, 11748, 299, 3215...
2.290909
110
""" N Queens ========== Place N queens on a NxN chessboard such that no queens come under attack. Give all possible placements of N queens. SOLUTION - Backtracking to find all possible placements - Grow the state space tree by placing a queen on one row at a time - Bounding function: no two queens share the s...
[ 37811, 201, 198, 45, 14045, 201, 198, 2559, 855, 201, 198, 27271, 399, 38771, 319, 257, 399, 87, 45, 19780, 3526, 884, 326, 645, 38771, 1282, 739, 1368, 13, 201, 198, 23318, 477, 1744, 21957, 3196, 286, 399, 38771, 13, 201, 198, 201...
3.440613
261
# in not in 重载 # contains l1 = MyList([1, 2, 3]) print(1 in l1) # True print(1 not in l1) # False print(4 in l1) # False
[ 2, 287, 407, 287, 16268, 229, 235, 164, 121, 121, 198, 2, 4909, 628, 198, 198, 75, 16, 796, 2011, 8053, 26933, 16, 11, 362, 11, 513, 12962, 198, 4798, 7, 16, 287, 300, 16, 8, 220, 1303, 6407, 198, 4798, 7, 16, 407, 287, 300, ...
2.015873
63
use_list_comprehension() print(use_zip_for_list_processing())
[ 198, 1904, 62, 4868, 62, 785, 3866, 5135, 295, 3419, 198, 4798, 7, 1904, 62, 13344, 62, 1640, 62, 4868, 62, 36948, 28955 ]
2.695652
23
import json import uuid import factory from django.db import connection from django.test import TestCase from django.test import override_settings from django.utils import timezone from facility_profile.models import Facility import mock import pytest from ..helpers import create_buffer_and_store_dummy_data from ..he...
[ 11748, 33918, 198, 11748, 334, 27112, 198, 198, 11748, 8860, 198, 6738, 42625, 14208, 13, 9945, 1330, 4637, 198, 6738, 42625, 14208, 13, 9288, 1330, 6208, 20448, 198, 6738, 42625, 14208, 13, 9288, 1330, 20957, 62, 33692, 198, 6738, 42625,...
3.74375
480
''' Koko loves to eat bananas. There are n piles of bananas, the ith pile has piles[i] bananas. The guards have gone and will come back in h hours. Koko can decide her bananas-per-hour eating speed of k. Each hour, she chooses some pile of bananas and eats k bananas from that pile. If the pile has less than k bananas,...
[ 7061, 6, 198, 42, 16044, 10408, 284, 4483, 35484, 13, 1318, 389, 299, 30935, 286, 35484, 11, 262, 340, 71, 14540, 468, 30935, 58, 72, 60, 35484, 13, 383, 10942, 423, 3750, 290, 481, 1282, 736, 287, 289, 2250, 13, 198, 198, 42, 160...
3.176667
300
#!/usr/bin/env python #coding=utf-8 import sys import db_opr ################################# main program################################## if __name__ == '__main__': print 'start initdb...' db_init = DBInit() db_init.run() del db_init print 'end initdb...'
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 198, 2, 66, 7656, 28, 40477, 12, 23, 198, 11748, 25064, 220, 198, 11748, 20613, 62, 404, 81, 198, 198, 29113, 2, 1388, 1430, 29113, 2235, 198, 361, 11593, 3672, 834, 6624, 705, 834, ...
3.045455
88
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved from typing import List, Optional import torch import torch.nn as nn import torch.nn.functional as F from pytext.config.field_config import CharFeatConfig from pytext.data.utils import Vocabulary from pytext.fields import Fi...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 2, 15069, 357, 66, 8, 3203, 11, 3457, 13, 290, 663, 29116, 13, 1439, 6923, 33876, 198, 198, 6738, 19720, 1330, 7343, 11, 32233, 198, 198, 11748, 28034, 198, 11748, 28034, 13, 204...
2.540757
1,877
from selenium.webdriver.common.action_chains import ActionChains from selenium.webdriver.common.keys import Keys from time import sleep from .xpath import xpath from .browser import explicit_wait_visibility_of_element_located MODE_INSTAGRAM = "mode=instagram" def go_to_instagram_Tab(browser): """Go to instragram...
[ 6738, 384, 11925, 1505, 13, 12384, 26230, 13, 11321, 13, 2673, 62, 38861, 1330, 7561, 1925, 1299, 198, 6738, 384, 11925, 1505, 13, 12384, 26230, 13, 11321, 13, 13083, 1330, 26363, 198, 6738, 640, 1330, 3993, 198, 198, 6738, 764, 87, 6...
2.585873
2,067
# Copyright (C) 2019-2021 Ruhr West University of Applied Sciences, Bottrop, Germany # AND Elektronische Fahrwerksysteme GmbH, Gaimersheim Germany # # This Source Code Form is subject to the terms of the Apache License 2.0 # If a copy of the APL2 was not distributed with this # file, You can obtain one at https://www.a...
[ 2, 15069, 357, 34, 8, 13130, 12, 1238, 2481, 371, 7456, 81, 2688, 2059, 286, 27684, 13473, 11, 14835, 1773, 11, 4486, 198, 2, 5357, 15987, 21841, 1313, 46097, 27361, 81, 15448, 591, 6781, 68, 402, 2022, 39, 11, 402, 1385, 364, 9096,...
2.510612
5,560
"""Show the current status information for each of the selected lambda targets.""" import argparse import textwrap import typing import yaml from botocore.client import BaseClient from reviser import definitions from reviser import interactivity from reviser import servicer def get_completions( completer: "inte...
[ 37811, 15307, 262, 1459, 3722, 1321, 329, 1123, 286, 262, 6163, 37456, 6670, 526, 15931, 198, 11748, 1822, 29572, 198, 11748, 2420, 37150, 198, 11748, 19720, 198, 198, 11748, 331, 43695, 198, 6738, 10214, 420, 382, 13, 16366, 1330, 7308, ...
2.529348
1,857
ff = open('LINEAS', 'r') flines = ff.readlines() ff.close() ff = open('LINEAS.csv', 'w') for l in flines: tmp = l.split() idx, element = tmp[0].split('=') ff.write('{0},{1},{2},{3}\n'.format(idx, element,tmp[1],tmp[2])) ff.close()
[ 198, 198, 487, 796, 1280, 10786, 24027, 1921, 3256, 705, 81, 11537, 198, 2704, 1127, 796, 31246, 13, 961, 6615, 3419, 198, 487, 13, 19836, 3419, 198, 198, 487, 796, 1280, 10786, 24027, 1921, 13, 40664, 3256, 705, 86, 11537, 198, 1640,...
2.084034
119
import argparse, logging
[ 11748, 1822, 29572, 11, 18931, 198 ]
4.166667
6
from pygame.sprite import RenderClear from subpixelsurface import * # This class keeps an ordered list of sprites in addition to the dict, # so we can draw in the order the sprites were added. # Some quick benchmarks show that [:] is the fastest way to get a # shallow copy of a list. # This is kind of a wart -...
[ 6738, 12972, 6057, 13, 34975, 578, 1330, 46722, 19856, 198, 6738, 22718, 14810, 333, 2550, 1330, 1635, 198, 198, 2, 770, 1398, 7622, 281, 6149, 1351, 286, 42866, 287, 3090, 284, 262, 8633, 11, 198, 2, 523, 356, 460, 3197, 287, 262, ...
3.805085
118
from logging import getLogger log = getLogger('msn.nssb') import msn from msn import MSNTextMessage from util import callsback from util.primitives.funcs import get from util.Events import EventMixin class NSSBAdapter(EventMixin): ''' Chatting with federated (yahoo) buddies happens over the NS ...
[ 6738, 18931, 1330, 651, 11187, 1362, 201, 198, 6404, 796, 651, 11187, 1362, 10786, 907, 77, 13, 77, 824, 65, 11537, 201, 198, 201, 198, 11748, 13845, 77, 201, 198, 201, 198, 6738, 13845, 77, 1330, 6579, 45, 8206, 12837, 201, 198, 20...
2.062281
1,429
import urllib from django.shortcuts import get_object_or_404 from django.utils.translation import ugettext from olympia.amo.templatetags import jinja_helpers from olympia.amo.feeds import NonAtomicFeed from olympia.addons.models import Addon, Review
[ 11748, 2956, 297, 571, 198, 198, 6738, 42625, 14208, 13, 19509, 23779, 1330, 651, 62, 15252, 62, 273, 62, 26429, 198, 6738, 42625, 14208, 13, 26791, 13, 41519, 1330, 334, 1136, 5239, 198, 198, 6738, 267, 6760, 544, 13, 18811, 13, 1149...
3.048193
83
default_app_config = 'wechat_ggfilm_backend.apps.WechatGgfilmBackendConfig'
[ 12286, 62, 1324, 62, 11250, 796, 705, 732, 17006, 62, 1130, 26240, 62, 1891, 437, 13, 18211, 13, 1135, 17006, 38, 70, 26240, 7282, 437, 16934, 6 ]
2.777778
27
import logging import mimetypes from concurrent.futures import ThreadPoolExecutor from http.client import RemoteDisconnected from io import BytesIO from typing import Iterator, Callable from urllib.parse import urlparse import pymongo import urllib3 from bson import ObjectId from requests import HTTPError from tsing_s...
[ 11748, 18931, 198, 11748, 17007, 2963, 12272, 198, 6738, 24580, 13, 69, 315, 942, 1330, 14122, 27201, 23002, 38409, 198, 6738, 2638, 13, 16366, 1330, 21520, 7279, 15236, 198, 6738, 33245, 1330, 2750, 4879, 9399, 198, 6738, 19720, 1330, 40...
2.196787
1,743
#!/usr/bin/env python #import roslib; roslib.load_manifest('Phoebe') import rospy from nav_msgs.msg import Odometry # print("All data", completePose) if __name__ == "__main__": rospy.init_node('getPoseTTBot', anonymous=False) #make node rospy.Subscriber('odom', Odometry, callback) rospy.spin()
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 2, 11748, 686, 6649, 571, 26, 686, 6649, 571, 13, 2220, 62, 805, 8409, 10786, 2725, 2577, 1350, 11537, 198, 11748, 686, 2777, 88, 198, 198, 6738, 6812, 62, 907, 14542, 13, 19662, 133...
2.449612
129
import datetime import io import math import os.path import subprocess WGRIB_BIN = os.path.expanduser('bin/osx/wgrib2')
[ 11748, 4818, 8079, 198, 11748, 33245, 198, 11748, 10688, 198, 11748, 28686, 13, 6978, 198, 11748, 850, 14681, 198, 198, 54, 38, 7112, 33, 62, 33, 1268, 796, 28686, 13, 6978, 13, 11201, 392, 7220, 10786, 8800, 14, 418, 87, 14, 86, 70...
2.595745
47
# -*- coding: utf-8 -*- # Copyright (c) 2021, Noah Jacob and Contributors # See license.txt from __future__ import unicode_literals import frappe from frappe.utils import nowdate,flt import unittest
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 2, 15069, 357, 66, 8, 33448, 11, 18394, 12806, 290, 25767, 669, 198, 2, 4091, 5964, 13, 14116, 198, 6738, 11593, 37443, 834, 1330, 28000, 1098, 62, 17201, 874, 198, 19...
2.802632
76
from nltk.tokenize import SExprTokenizer from apodeixi.util.a6i_error import ApodeixiError from apodeixi.util.dataframe_utils import DataFrameUtils from apodeixi.util.formatting_utils import ListUtils, StringUtils class IntervalSpec(): '''...
[ 198, 6738, 299, 2528, 74, 13, 30001, 1096, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1330, 311, 3109, 1050, 30642, 7509, 220, ...
2.02957
8,184
"""Manage assets. Usage: ./manage.py assets rebuild Rebuild all known assets; this requires tracking to be enabled: Only assets that have previously been built and tracked are considered "known". ./manage.py assets rebuild --parse-templates Try to find as many of the project...
[ 37811, 5124, 496, 6798, 13, 198, 198, 28350, 25, 628, 220, 220, 220, 24457, 805, 496, 13, 9078, 6798, 17884, 628, 220, 220, 220, 220, 220, 220, 220, 797, 11249, 477, 1900, 6798, 26, 428, 4433, 9646, 284, 307, 9343, 25, 198, 220, 2...
2.962677
777
import torch from ..Objective import Objective
[ 11748, 28034, 198, 198, 6738, 11485, 10267, 425, 1330, 37092, 628 ]
4.454545
11
import imaplib import re import warnings from typing import Iterable, List from nehushtan.logger.NehushtanFileLogger import NehushtanFileLogger from nehushtan.logger.NehushtanLogging import NehushtanLogging from nehushtan.mail.rfc3501.SearchCommandKit import SearchCommandKit from nehushtan.mail.rfc822.NehushtanEmailMe...
[ 11748, 545, 64, 489, 571, 198, 11748, 302, 198, 11748, 14601, 198, 6738, 19720, 1330, 40806, 540, 11, 7343, 198, 198, 6738, 497, 71, 1530, 38006, 13, 6404, 1362, 13, 8199, 71, 1530, 38006, 8979, 11187, 1362, 1330, 44470, 1530, 38006, ...
2.025405
2,283
"""Version file.""" VERSION = "0.0.38"
[ 37811, 14815, 2393, 526, 15931, 198, 43717, 796, 366, 15, 13, 15, 13, 2548, 1, 198 ]
2.4375
16
# Copyright Contributors to the Amundsen project. # SPDX-License-Identifier: Apache-2.0 import logging import unittest from collections import OrderedDict from mock import patch from pyhocon import ConfigFactory from typing import Any from cassandra.metadata import ColumnMetadata as CassandraColumnMetadata from data...
[ 2, 15069, 25767, 669, 284, 262, 1703, 917, 6248, 1628, 13, 198, 2, 30628, 55, 12, 34156, 12, 33234, 7483, 25, 24843, 12, 17, 13, 15, 198, 198, 11748, 18931, 198, 11748, 555, 715, 395, 198, 6738, 17268, 1330, 14230, 1068, 35, 713, ...
3.594444
180
import os import io import re import pytest from contextlib import redirect_stdout import numpy as np from sklearn.neighbors import KDTree from sklearn.neighbors import NearestNeighbors from sklearn.preprocessing import normalize import pickle import joblib import scipy from pynndescent import NNDescent, PyNNDescentT...
[ 11748, 28686, 198, 11748, 33245, 198, 11748, 302, 198, 11748, 12972, 9288, 198, 6738, 4732, 8019, 1330, 18941, 62, 19282, 448, 198, 198, 11748, 299, 32152, 355, 45941, 198, 6738, 1341, 35720, 13, 710, 394, 32289, 1330, 509, 24544, 631, ...
2.675824
546
from django.test import SimpleTestCase from django.utils.deprecation import CallableFalse, CallableTrue
[ 6738, 42625, 14208, 13, 9288, 1330, 17427, 14402, 20448, 198, 6738, 42625, 14208, 13, 26791, 13, 10378, 8344, 341, 1330, 4889, 540, 25101, 11, 4889, 540, 17821, 628 ]
3.75
28
"""Parallelized, single-point launch script to run DSO on a set of benchmarks.""" import os import sys import time import multiprocessing from copy import deepcopy from datetime import datetime import click from dso import DeepSymbolicOptimizer from dso.logeval import LogEval from dso.config import load_config from ...
[ 37811, 10044, 29363, 1143, 11, 2060, 12, 4122, 4219, 4226, 284, 1057, 360, 15821, 319, 257, 900, 286, 31747, 526, 15931, 198, 198, 11748, 28686, 198, 11748, 25064, 198, 11748, 640, 198, 11748, 18540, 305, 919, 278, 198, 6738, 4866, 1330...
2.656467
2,157
import cvxpy as cp import matplotlib.pyplot as matplt from utils import * from ddpg_alg_spinup import ddpg import tensorflow as tf from env_mra import ResourceEnv import numpy as np import time import pickle from parameters import * if __name__ == "__main__": with open("saved_alpha.pickle", "wb") as fileop: ...
[ 11748, 269, 85, 87, 9078, 355, 31396, 198, 11748, 2603, 29487, 8019, 13, 9078, 29487, 355, 2603, 489, 83, 198, 6738, 3384, 4487, 1330, 1635, 198, 6738, 49427, 6024, 62, 14016, 62, 39706, 929, 1330, 49427, 6024, 198, 11748, 11192, 273, ...
2.325234
1,070
import numpy as np import neat.parallel
[ 11748, 299, 32152, 355, 45941, 198, 198, 11748, 15049, 13, 1845, 29363, 628 ]
3.230769
13
import httpx
[ 11748, 2638, 87, 628 ]
3.5
4
from YTPlaylistRanking.YTPlaylistRanking import SortType, main import argparse if __name__ == "__main__": parser = argparse.ArgumentParser( description=("Gets statistics about videos in a YouTube playlist using the playlist's id to write to a file" " the list of videos in ascendi...
[ 6738, 575, 51, 11002, 4868, 49, 15230, 13, 56, 51, 11002, 4868, 49, 15230, 1330, 33947, 6030, 11, 1388, 201, 198, 11748, 1822, 29572, 201, 198, 201, 198, 361, 11593, 3672, 834, 6624, 366, 834, 12417, 834, 1298, 201, 198, 220, 220, 2...
2.23546
1,066
# Bot token goes here BOT_TOKEN = '' # Manually specify Tesseract path TESSERACT_PATH = ''
[ 2, 18579, 11241, 2925, 994, 198, 33, 2394, 62, 10468, 43959, 796, 10148, 198, 198, 2, 1869, 935, 11986, 39412, 263, 529, 3108, 198, 51, 7597, 1137, 10659, 62, 34219, 796, 10148, 198 ]
2.787879
33
#!/usr/bin/env python import time from netmiko import ConnectHandler, redispatch net_connect = ConnectHandler( device_type='terminal_server', ip='10.10.10.10', username='admin', password='admin123', secret='secret123') # Manually handle interaction in the Terminal Server (fictional example, but #...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 11748, 640, 198, 6738, 2010, 76, 12125, 1330, 8113, 25060, 11, 2266, 8802, 963, 198, 198, 3262, 62, 8443, 796, 8113, 25060, 7, 198, 220, 220, 220, 3335, 62, 4906, 11639, 23705, 282, ...
2.750871
574
import numpy as np from scipy.stats import norm from .mixed_optimiser import MVO from scipy.optimize import shgo, differential_evolution, dual_annealing import scipy as stats class MVMOO(MVO): """ Multi variate mixed variable optimisation """ def __init__(self, input_dim=1, num_qual=0, num_obj=2, bound...
[ 11748, 299, 32152, 355, 45941, 198, 6738, 629, 541, 88, 13, 34242, 1330, 2593, 198, 6738, 764, 76, 2966, 62, 40085, 5847, 1330, 337, 29516, 198, 6738, 629, 541, 88, 13, 40085, 1096, 1330, 427, 2188, 11, 22577, 62, 1990, 2122, 11, 10...
1.872631
8,495
number_of_dragons = int(input()) dragons_dict = {} for index in range(number_of_dragons): data = input().split() type = data[0] name = data[1] damage = data[2] health = data[3] armor = data[4] if damage == 'null': damage = 45 damage = int(damage) if health == 'null': ...
[ 17618, 62, 1659, 62, 7109, 34765, 796, 493, 7, 15414, 28955, 198, 7109, 34765, 62, 11600, 796, 23884, 198, 1640, 6376, 287, 2837, 7, 17618, 62, 1659, 62, 7109, 34765, 2599, 198, 220, 220, 220, 1366, 796, 5128, 22446, 35312, 3419, 198,...
2.59708
685
# Copyright (c) Andrey Sobolev, 2020. Distributed under MIT license, see LICENSE file. import os from jinja2 import Environment, FileSystemLoader
[ 2, 220, 220, 15069, 357, 66, 8, 220, 843, 4364, 36884, 2305, 85, 11, 12131, 13, 4307, 6169, 739, 17168, 5964, 11, 766, 38559, 24290, 2393, 13, 198, 198, 11748, 28686, 198, 6738, 474, 259, 6592, 17, 1330, 9344, 11, 9220, 11964, 17401...
3.431818
44
import json import os import sys from src.gitHubApiRequest import performRequest from src.utils import createFolderIfDoesntExist if __name__ == '__main__': try: sys.argv[1] except IndexError: print('pass your github token as parameter (' 'https://help.github.com/en/articles/cr...
[ 11748, 33918, 198, 11748, 28686, 198, 11748, 25064, 198, 198, 6738, 12351, 13, 18300, 16066, 32, 14415, 18453, 1330, 1620, 18453, 198, 6738, 12351, 13, 26791, 1330, 2251, 41092, 1532, 13921, 429, 3109, 396, 628, 628, 198, 361, 11593, 3672...
2.10802
611
from django import template from django.template.base import FilterExpression from django.template.loader import get_template from django.conf import settings from ..exceptions import SiteMessageConfigurationError register = template.Library() @register.tag def detect_clause(parser, clause_name, tokens): ""...
[ 6738, 42625, 14208, 1330, 11055, 198, 6738, 42625, 14208, 13, 28243, 13, 8692, 1330, 25853, 16870, 2234, 198, 6738, 42625, 14208, 13, 28243, 13, 29356, 1330, 651, 62, 28243, 198, 6738, 42625, 14208, 13, 10414, 1330, 6460, 198, 198, 6738, ...
3.009174
218
# -*- coding: utf-8 -*- """ Defines loader objects that parse config files and return functions that provide inputs to TensorFlow Estimator objects. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function __all__ = ["ContinuousSequenceBatchLoader", "DiscreteSe...
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 37811, 198, 7469, 1127, 40213, 5563, 326, 21136, 4566, 3696, 290, 1441, 5499, 326, 2148, 198, 15414, 82, 284, 309, 22854, 37535, 10062, 320, 1352, 5563, 13, 198, 37811, ...
2.913495
2,312
# 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.45551
2,450
#!/usr/bin/env python # -*- coding: utf-8 -*- import os.path import sys try: import apiai except ImportError: sys.path.append( os.path.join(os.path.dirname(os.path.realpath(__file__)), os.pardir) ) import apiai CLIENT_ACCESS_TOKEN = '73a62055c012487b9312db1d7ac7de61'
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 198, 11748, 28686, 13, 6978, 198, 11748, 25064, 198, 198, 28311, 25, 198, 220, 220, 220, 1330, 2471, 544, 72, 198, 16...
2.091549
142
#!/usr/bin/env python import codecs import cStringIO import unittest from chirp.library import bulk_tagging_form TEST_FORM_1 = """ 00123--------- A Perfect Circle a7314af4 [ 1 ] 192 12 Mer de Noms e2ebb0f2 [ 1 ] 128 12 Mer de Noms 55d1c5a4 [ ] 192 12 Thirteenth Step A line to skip 1234abcd [ x ] 192 10 To Be Dele...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 198, 11748, 40481, 82, 198, 11748, 269, 10100, 9399, 198, 11748, 555, 715, 395, 198, 198, 6738, 442, 343, 79, 13, 32016, 1330, 11963, 62, 12985, 2667, 62, 687, 628, 198, 51, 6465, 62...
2.045288
817
from environs import Env env = Env() env.read_env() BOT_TOKEN = env.str("BOT_TOKEN") ADMIN = env.str("ADMIN") IP = env.str("ip")
[ 6738, 17365, 343, 684, 1330, 2039, 85, 198, 198, 24330, 796, 2039, 85, 3419, 198, 24330, 13, 961, 62, 24330, 3419, 198, 198, 33, 2394, 62, 10468, 43959, 796, 17365, 13, 2536, 7203, 33, 2394, 62, 10468, 43959, 4943, 198, 2885, 23678, ...
2.20339
59
# -*- coding: utf-8 -*- # # Copyright (C) 2020 Vinay M. Sajip. See LICENSE for licensing information. # # Part of the test harness for sarge: Subprocess Allegedly Rewards Good Encapsulation :-) # import sys import time if __name__ == '__main__': try: rc = main() except Exception as e: print(e) ...
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 2, 198, 2, 15069, 357, 34, 8, 12131, 11820, 323, 337, 13, 311, 1228, 541, 13, 4091, 38559, 24290, 329, 15665, 1321, 13, 198, 2, 198, 2, 2142, 286, 262, 1332, 19356, ...
2.496454
141
#!/usr/bin/python # -*- coding: utf-8 -*- # PQN-NNLS algorithm (Kim, Sra, Dhillon 2006) import numpy as np def pqn_nnls(A, b, err, limit = 300): """return x which is >= 0 and minimizes ||Ax - b||""" m, n = A.shape; AtA = np.dot(A.T, A) Atb = np.dot(A.T, b) curS = np.eye(n) x = np...
[ 2, 48443, 14629, 14, 8800, 14, 29412, 201, 198, 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 201, 198, 201, 198, 2, 350, 48, 45, 12, 6144, 6561, 11862, 357, 26374, 11, 311, 430, 11, 360, 12639, 261, 4793, 8, 201, ...
1.662351
1,004
from django.urls import path from . import views app_name = 'memberships' urlpatterns = [ path('register/', views.RegistrationView.as_view(), name='registration'), path('login/', views.LoginView.as_view(), name='login'), path('logout/', views.logout_view, name='logout'), path('forget-pass/', views.For...
[ 6738, 42625, 14208, 13, 6371, 82, 1330, 3108, 198, 198, 6738, 764, 1330, 5009, 198, 198, 1324, 62, 3672, 796, 705, 30814, 5748, 6, 198, 6371, 33279, 82, 796, 685, 198, 220, 220, 220, 3108, 10786, 30238, 14, 3256, 5009, 13, 47133, 76...
2.748768
203
from conceptnet_rocks.database import load_dump_into_database from graph_garden import arangodb from pathlib import Path from typing import Optional import typer app = typer.Typer() @app.command()
[ 6738, 3721, 3262, 62, 305, 4657, 13, 48806, 1330, 3440, 62, 39455, 62, 20424, 62, 48806, 198, 6738, 4823, 62, 70, 5872, 1330, 610, 648, 375, 65, 198, 6738, 3108, 8019, 1330, 10644, 198, 6738, 19720, 1330, 32233, 198, 11748, 1259, 525,...
3.35
60
import logging import os import sys import traceback import time import argparse from . import config, util, server from .writer import _rebuild, _check_output logger = logging.getLogger(__name__) if __name__ == "__main__": main()
[ 11748, 18931, 198, 11748, 28686, 198, 11748, 25064, 198, 11748, 12854, 1891, 198, 11748, 640, 198, 11748, 1822, 29572, 198, 198, 6738, 764, 1330, 4566, 11, 7736, 11, 4382, 198, 6738, 764, 16002, 1330, 4808, 260, 11249, 11, 4808, 9122, 6...
3.102564
78
from sklearn.feature_extraction.text import CountVectorizer examples = [ "apple ball cat", "ball cat dog", ] # vectorizer = CountVectorizer() # X = vectorizer.fit_transform(examples) # print(vectorizer.get_feature_names_out()) # print(X.toarray()) max_features = 3 ngrams = 2 vectorizer = CountVectorizer(...
[ 6738, 1341, 35720, 13, 30053, 62, 2302, 7861, 13, 5239, 1330, 2764, 38469, 7509, 628, 198, 1069, 12629, 796, 685, 198, 220, 220, 220, 366, 18040, 2613, 3797, 1600, 198, 220, 220, 220, 366, 1894, 3797, 3290, 1600, 198, 60, 198, 198, ...
2.838323
167
#coding=utf-8 import sys import gzip import json import hashlib import re import urllib2 import xml.dom.minidom import zlib USER_AGENT = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.99 Safari/537.36' APPKEY = '85eb6835b0a1034e' APPSEC = '2ad42749773c441109bd...
[ 2, 66, 7656, 28, 40477, 12, 23, 198, 198, 11748, 25064, 198, 11748, 308, 13344, 198, 11748, 33918, 198, 11748, 12234, 8019, 198, 11748, 302, 198, 11748, 2956, 297, 571, 17, 198, 11748, 35555, 13, 3438, 13, 1084, 312, 296, 198, 11748, ...
1.98893
271
from flask import Flask, render_template #this has changed import plotly import plotly.graph_objs as go import pandas as pd import numpy as np import json app = Flask(__name__) @app.route('/') if __name__ == '__main__': app.run()
[ 6738, 42903, 1330, 46947, 11, 8543, 62, 28243, 1303, 5661, 468, 3421, 198, 11748, 7110, 306, 198, 11748, 7110, 306, 13, 34960, 62, 672, 8457, 355, 467, 198, 198, 11748, 19798, 292, 355, 279, 67, 198, 11748, 299, 32152, 355, 45941, 198...
2.86747
83
XXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXX XXXXX XXXXXXX XXXXX XXXXXXXXXXXXXXXXXXXXXXXXXX XXXX XX XXXXX XXXXXX XXXXX XXXXXX X XXXXXXXX XXXXXXXXXXXXX XXXX XXXXXX XXXXX XXXXXXXXX XXXXX XX XXXXX XXXXXXXXXXXXXXXXXX X X XXXXXXXX XXXXX XXXX XXXXXXX XXXXXXXXXX XX XXXXX XXXXXXXXXXXXXXXXXX X XXX XXXX XX XXXXXXXXXXXXXX XXXXXX XXXX...
[ 24376, 24376, 24376, 24376, 24376, 24376, 8051, 198, 24376, 8051, 1395, 24376, 1395, 24376, 8051, 1395, 24376, 198, 24376, 24376, 24376, 24376, 24376, 24376, 8051, 198, 198, 24376, 21044, 1395, 24376, 198, 198, 24376, 8051, 1395, 24376, 1395,...
2.726027
146
import numbers from typing import Optional, Union, Any, Callable, Sequence import torch from ignite.metrics import Metric, MetricsLambda from ignite.exceptions import NotComputableError from ignite.metrics.metric import sync_all_reduce, reinit__is_reduced __all__ = ["ConfusionMatrix", "mIoU", "IoU", "DiceCoefficient...
[ 11748, 3146, 198, 6738, 19720, 1330, 32233, 11, 4479, 11, 4377, 11, 4889, 540, 11, 45835, 198, 198, 11748, 28034, 198, 198, 6738, 44794, 13, 4164, 10466, 1330, 3395, 1173, 11, 3395, 10466, 43, 4131, 6814, 198, 6738, 44794, 13, 1069, 1...
2.780136
2,638
import arcade from arcade import load_texture from arcade.gui import UIManager from arcade.gui.widgets import UITextArea, UIInputText, UITexturePane LOREM_IPSUM = ( "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent eget pellentesque velit. " "Nam eu rhoncus nulla. Fusce ornare libero eget ex v...
[ 11748, 27210, 198, 6738, 27210, 1330, 3440, 62, 41293, 198, 6738, 27210, 13, 48317, 1330, 471, 3955, 272, 3536, 198, 6738, 27210, 13, 48317, 13, 28029, 11407, 1330, 471, 2043, 2302, 30547, 11, 12454, 20560, 8206, 11, 471, 2043, 2302, 49...
2.56304
579
######################### # 演示元组 ######################### # 元组: 元组是一序列不可修改的元素的集合 dimensions = (1, 2, 3, 4, 5) print(dimensions) print(type(dimensions))
[ 14468, 7804, 2, 198, 2, 10545, 120, 242, 163, 97, 118, 17739, 225, 163, 119, 226, 198, 14468, 7804, 2, 628, 198, 2, 10263, 227, 225, 163, 119, 226, 171, 120, 248, 10263, 227, 225, 163, 119, 226, 42468, 31660, 41753, 237, 26344, 24...
1.666667
93
# Generated by Django 1.11.8 on 2018-01-24 15:48 from django.db import migrations, models
[ 2, 2980, 515, 416, 37770, 352, 13, 1157, 13, 23, 319, 2864, 12, 486, 12, 1731, 1315, 25, 2780, 198, 198, 6738, 42625, 14208, 13, 9945, 1330, 15720, 602, 11, 4981, 628 ]
2.875
32
from django.shortcuts import render # Create your views here. from rest_framework import generics, status, mixins from rest_framework.permissions import AllowAny from rest_framework.response import Response from rest_framework.views import APIView from measure.models import Measures from .serializers import MeasuresS...
[ 6738, 42625, 14208, 13, 19509, 23779, 1330, 8543, 198, 198, 2, 13610, 534, 5009, 994, 13, 198, 6738, 1334, 62, 30604, 1330, 1152, 873, 11, 3722, 11, 5022, 1040, 198, 6738, 1334, 62, 30604, 13, 525, 8481, 1330, 22507, 7149, 198, 6738, ...
4.034783
115
import torch.nn as nn
[ 11748, 28034, 13, 20471, 355, 299, 77, 201, 198, 201, 198 ]
2.272727
11
from abc import ABC, abstractmethod
[ 6738, 450, 66, 1330, 9738, 11, 12531, 24396, 198 ]
4
9
import numpy, itertools, tqdm, json scanners = [] new = [] with open("data.txt", "r") as fh: lines = fh.readlines() number = 0 for line in lines: line = line.strip() # print(line) if "scanner" in line: if new: scanners.append({"coords_r...
[ 11748, 299, 32152, 11, 340, 861, 10141, 11, 256, 80, 36020, 11, 33918, 198, 198, 1416, 15672, 796, 17635, 198, 3605, 796, 17635, 198, 198, 4480, 1280, 7203, 7890, 13, 14116, 1600, 366, 81, 4943, 355, 277, 71, 25, 198, 220, 220, 220,...
2.143623
1,678
from typing import TypeVar, Generic, Optional, Dict, Any from abc import abstractmethod from dataclasses import dataclass T = TypeVar("T") @dataclass
[ 6738, 19720, 1330, 5994, 19852, 11, 42044, 11, 32233, 11, 360, 713, 11, 4377, 198, 6738, 450, 66, 1330, 12531, 24396, 198, 6738, 4818, 330, 28958, 1330, 4818, 330, 31172, 628, 198, 51, 796, 5994, 19852, 7203, 51, 4943, 628, 198, 31, ...
3.369565
46
import dask.array as da import dask.dataframe as dd def apply_parallel( function, array, chunks=4, drop_axis=None, new_axis=None, dtype=float, *args, **kwargs ): """Apply the function in parallel using Dask. See https://docs.dask.org/en/latest/array-api.html#dask.array.map_blo...
[ 11748, 288, 2093, 13, 18747, 355, 12379, 198, 11748, 288, 2093, 13, 7890, 14535, 355, 49427, 628, 198, 4299, 4174, 62, 1845, 29363, 7, 198, 220, 220, 220, 2163, 11, 198, 220, 220, 220, 7177, 11, 198, 220, 220, 220, 22716, 28, 19, ...
2.492077
1,199
''' Zephyr: Open-source seismic waveform modelling and inversion code written in Python ''' __version__ = 'devel' __author__ = 'Brendan Smithyman' __license__ = 'MIT' __copyright__ = 'Copyright 2015 Brendan Smithyman'
[ 7061, 6, 198, 57, 27446, 2417, 25, 4946, 12, 10459, 37463, 6769, 687, 38591, 290, 287, 9641, 2438, 3194, 287, 11361, 198, 7061, 6, 198, 198, 834, 9641, 834, 220, 220, 796, 705, 2934, 626, 6, 198, 834, 9800, 834, 220, 220, 220, 796...
2.986842
76
# -*- coding: utf-8 -*- """ example.routes.py """ from webapp2_extras.routes import HandlerPrefixRoute, RedirectRoute # -------------------------------------------------------------------- # Routes # -------------------------------------------------------------------- routes = [ HandlerPrefixRoute('example.han...
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 37811, 198, 20688, 13, 81, 448, 274, 13, 9078, 198, 198, 37811, 198, 198, 6738, 3992, 1324, 17, 62, 2302, 8847, 13, 81, 448, 274, 1330, 32412, 36698, 844, 43401, 11, ...
2.218391
435
from django.conf.urls.static import static from django.contrib import admin from django.urls import path, include from django.conf import settings urlpatterns = [ path('admin/', admin.site.urls), path('', include('django.contrib.auth.urls')), path('', include('social_django.urls', namespace='social')), ...
[ 6738, 42625, 14208, 13, 10414, 13, 6371, 82, 13, 12708, 1330, 9037, 198, 6738, 42625, 14208, 13, 3642, 822, 1330, 13169, 198, 6738, 42625, 14208, 13, 6371, 82, 1330, 3108, 11, 2291, 198, 198, 6738, 42625, 14208, 13, 10414, 1330, 6460, ...
2.45122
246
# -*- coding: utf-8 -*- #! /usr/bin/env python import numpy as np import matplotlib.pyplot as plt from six.moves import range # plain plotting from values def plot_conn(values, name='', fs=1, ylim=None, xlim=None, show=True): ''' Plot connectivity estimation results. Allows to plot your results without us...
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 2, 0, 1220, 14629, 14, 8800, 14, 24330, 21015, 198, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 2603, 29487, 8019, 13, 9078, 29487, 355, 458, 83, 198, 6738, 2237, ...
2.153957
695
from typing import Optional, List from pydantic import BaseModel
[ 6738, 19720, 1330, 32233, 11, 7343, 198, 198, 6738, 279, 5173, 5109, 1330, 7308, 17633, 628, 628, 198 ]
3.888889
18
import librosa import os import numpy as np import scipy.io.wavfile as wavfile audio_range = (0, 20) if not os.path.exists('./norm_audio_train'): os.mkdir('./norm_audio_train') for idx in range(audio_range[0], audio_range[1]): print('Processing audio %s'%idx) path = './audio_train/trim_audio_train%s.wav'...
[ 11748, 9195, 4951, 64, 198, 11748, 28686, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 629, 541, 88, 13, 952, 13, 45137, 7753, 355, 266, 615, 7753, 198, 198, 24051, 62, 9521, 796, 357, 15, 11, 1160, 8, 198, 198, 361, 407, 28686, ...
2.180812
271
# -*- coding: utf-8 -*- """ Created on Thu Apr 29 12:08:34 2021 @author: BKG """ import sqlite3 from sqlite3 import Error import pandas as pd import PySimpleGUI as sg import re from re import search from datetime import datetime from fpdf import FPDF def _db_connection(): ''' Connects to the .db file ...
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 37811, 198, 41972, 319, 26223, 2758, 2808, 1105, 25, 2919, 25, 2682, 33448, 198, 198, 31, 9800, 25, 347, 42, 38, 198, 37811, 198, 198, 11748, 44161, 578, 18, 198, 6738...
2.587156
218
"""isort:skip_file.""" import argparse import os import sys sys.path.append("../") from torch.utils.data import DataLoader from tqdm import tqdm from beta_rec.core.eval_engine import SeqEvalEngine from beta_rec.core.train_engine import TrainEngine from beta_rec.datasets.seq_data_utils import ( SeqDataset, co...
[ 37811, 271, 419, 25, 48267, 62, 7753, 526, 15931, 198, 11748, 1822, 29572, 198, 11748, 28686, 198, 11748, 25064, 198, 198, 17597, 13, 6978, 13, 33295, 7203, 40720, 4943, 198, 198, 6738, 28034, 13, 26791, 13, 7890, 1330, 6060, 17401, 198...
2.300644
2,794
import logging from pathlib import Path from flask import Flask from config import config from model.model import get_detector from views.views import detector_blueprint logging.basicConfig(level=logging.INFO) logger = logging.getLogger(__name__) app = Flask(__name__) app.secret_key = config.get("secret_key", "secre...
[ 11748, 18931, 198, 6738, 3108, 8019, 1330, 10644, 198, 198, 6738, 42903, 1330, 46947, 198, 198, 6738, 4566, 1330, 4566, 198, 6738, 2746, 13, 19849, 1330, 651, 62, 15255, 9250, 198, 6738, 5009, 13, 33571, 1330, 31029, 62, 17585, 4798, 19...
2.893293
328
from flask import Flask, jsonify, request from flask_restful import Api, Resource from pymongo import MongoClient import bcrypt import logging logging.basicConfig(level=logging.DEBUG,format='%(asctime)s [%(levelname)s] [%(filename)s:%(lineno)d] [%(thread)d] - %(message)s',datefmt='%d/%m/%Y %H:%M:%S',filename='flask.log...
[ 6738, 42903, 1330, 46947, 11, 33918, 1958, 11, 2581, 198, 6738, 42903, 62, 2118, 913, 1330, 5949, 72, 11, 20857, 198, 6738, 279, 4948, 25162, 1330, 42591, 11792, 198, 11748, 275, 29609, 198, 11748, 18931, 198, 6404, 2667, 13, 35487, 169...
2.607383
298
score_list = [] score_list_file = open("score.txt") for score in score_list_file: score = score.rstrip().split(",") score_list.append([score[0],int(score[1])]) score_list_file.close() print (score_list)
[ 26675, 62, 4868, 796, 17635, 198, 198, 26675, 62, 4868, 62, 7753, 796, 1280, 7203, 26675, 13, 14116, 4943, 198, 198, 1640, 4776, 287, 4776, 62, 4868, 62, 7753, 25, 198, 220, 220, 220, 4776, 796, 4776, 13, 81, 36311, 22446, 35312, 7,...
2.529412
85
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2018/02/25 16:30 # @Author : niuliangtao # @Site : # @File : MachineLearninginAction.py # @Software: PyCharm import csv import random import socket import time import http.client import http.client import requests from bs4 import BeautifulSoup if __n...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 2, 2488, 7575, 220, 220, 220, 1058, 2864, 14, 2999, 14, 1495, 1467, 25, 1270, 198, 2, 2488, 13838, 220, 1058, 37628, ...
2.607843
204
from mercury import * b64_cert = 'MIIJRDCCCCygAwIBAgIRAO7eZWDNNcCvAgAAAABZcbcwDQYJKoZIhvcNAQELBQAwQjELMAkGA1UEBhMCVVMxHjAcBgNVBAoTFUdvb2dsZSBUcnVzdCBTZXJ2aWNlczETMBEGA1UEAxMKR1RTIENBIDFPMTAeFw0yMDAyMTIxMTQ3MTFaFw0yMDA1MDYxMTQ3MTFaMGYxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRMwEQYDV...
[ 6738, 27394, 1330, 1635, 198, 198, 65, 2414, 62, 22583, 796, 705, 44, 3978, 41, 35257, 4093, 4093, 35641, 23155, 40, 4339, 70, 40, 3861, 46, 22, 68, 57, 22332, 6144, 66, 34, 85, 10262, 17922, 33, 57, 66, 15630, 86, 35, 48, 56, 4...
1.34532
3,782
import os import random import string import uuid from dotenv import load_dotenv from flask import request, g, jsonify, make_response from flask_cors import CORS from flask_sqlalchemy import SQLAlchemy as _SQLAlchemy from flask_marshmallow import Marshmallow from flask_migrate import Migrate from time import monotonic...
[ 11748, 28686, 198, 11748, 4738, 198, 11748, 4731, 198, 11748, 334, 27112, 198, 6738, 16605, 24330, 1330, 3440, 62, 26518, 24330, 198, 198, 6738, 42903, 1330, 2581, 11, 308, 11, 33918, 1958, 11, 787, 62, 26209, 198, 6738, 42903, 62, 66, ...
3.071504
951
from flask import Flask, request, Response, jsonify #import pprint import json import spacy app = Flask(__name__) print("Loading spacy SM") _nlp = spacy.load("en_core_web_sm") #_nlp = spacy.load("en_core_web_trf") # performs better # Run with # <s>flask run --port=5002</s> # TODO Didn't work with spaCy, use # python...
[ 6738, 42903, 1330, 46947, 11, 2581, 11, 18261, 11, 33918, 1958, 198, 2, 11748, 279, 4798, 198, 11748, 33918, 198, 11748, 599, 1590, 198, 198, 1324, 796, 46947, 7, 834, 3672, 834, 8, 198, 198, 4798, 7203, 19031, 599, 1590, 9447, 4943, ...
2.523035
369
REGISTRY = {} from .simple_agent import SimpleAgent from .cql_agent import CQLAgent REGISTRY['simple'] = SimpleAgent REGISTRY['cql'] = CQLAgent
[ 31553, 1797, 40405, 796, 23884, 198, 198, 6738, 764, 36439, 62, 25781, 1330, 17427, 36772, 198, 6738, 764, 66, 13976, 62, 25781, 1330, 327, 9711, 36772, 198, 31553, 1797, 40405, 17816, 36439, 20520, 796, 17427, 36772, 198, 31553, 1797, 40...
3
48
import time_gen assert time_gen.get_file_list(None,['fits']) == True
[ 11748, 640, 62, 5235, 198, 198, 30493, 640, 62, 5235, 13, 1136, 62, 7753, 62, 4868, 7, 14202, 17414, 6, 21013, 6, 12962, 6624, 6407, 628 ]
2.730769
26
from random import * data = range(10000) # the original, naive version # "final" version
[ 6738, 4738, 1330, 1635, 198, 198, 7890, 796, 2837, 7, 49388, 8, 198, 198, 2, 262, 2656, 11, 24354, 2196, 628, 198, 2, 366, 20311, 1, 2196, 220, 198 ]
3.241379
29
if __name__=="__main__": import sys CpGLocationFileName = sys.argv[1] CpGsInfoFileName = sys.argv[2] outputFileName = sys.argv[3] CpGToLocationDict = makeCpGLocationDict(CpGLocationFileName) convertCpGsToLocations(CpGToLocationDict, CpGsInfoFileName, outputFileName)
[ 201, 198, 361, 11593, 3672, 834, 855, 1, 834, 12417, 834, 1298, 201, 198, 197, 11748, 25064, 201, 198, 197, 34, 79, 8763, 5040, 8979, 5376, 796, 25064, 13, 853, 85, 58, 16, 60, 201, 198, 197, 34, 79, 33884, 12360, 8979, 5376, 796,...
2.295082
122