content
stringlengths
1
1.04M
input_ids
listlengths
1
774k
ratio_char_token
float64
0.38
22.9
token_count
int64
1
774k
""" A simple slack message sender @author: Abhishek Thakur (abhishek4@gmail.com) """ import collections import json import os import requests def send(msg, use_raw=False, webhook=None): """ A function to send messages on slack :param msg: string, list of strings, dictionary (or defaultdict/OrderedDict) ...
[ 37811, 198, 32, 2829, 30740, 3275, 29788, 198, 31, 9800, 25, 2275, 14363, 258, 74, 536, 461, 333, 357, 397, 14363, 258, 74, 19, 31, 14816, 13, 785, 8, 198, 37811, 198, 11748, 17268, 198, 11748, 33918, 198, 11748, 28686, 198, 11748, ...
2.473958
576
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app...
[ 2, 220, 220, 15069, 357, 66, 8, 2864, 350, 37382, 47, 37382, 46665, 13, 1439, 6923, 33876, 13, 198, 2, 198, 2, 49962, 739, 262, 24843, 13789, 11, 10628, 362, 13, 15, 357, 1169, 366, 34156, 15341, 198, 2, 345, 743, 407, 779, 428, ...
3.663636
220
# Copyright 2016 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import unittest import common_util if __name__ == '__main__': unittest.main()
[ 2, 15069, 1584, 383, 18255, 1505, 46665, 13, 1439, 2489, 10395, 13, 198, 2, 5765, 286, 428, 2723, 2438, 318, 21825, 416, 257, 347, 10305, 12, 7635, 5964, 326, 460, 307, 198, 2, 1043, 287, 262, 38559, 24290, 2393, 13, 198, 198, 11748...
3.337838
74
import nltk from nltk.corpus import stopwords from nltk.tokenize import WhitespaceTokenizer with open(r"Orlando_Data.txt",'r', encoding="utf8") as inFile, open(r"Orlando_Data_Filtered.txt",'w') as outFile: stop_words = set(stopwords.words('english')) for line in inFile.readlines(): words = WhitespaceTokenizer().to...
[ 11748, 299, 2528, 74, 198, 6738, 299, 2528, 74, 13, 10215, 79, 385, 1330, 2245, 10879, 198, 6738, 299, 2528, 74, 13, 30001, 1096, 1330, 29290, 10223, 30642, 7509, 198, 198, 4480, 1280, 7, 81, 1, 5574, 11993, 62, 6601, 13, 14116, 160...
2.75
160
''' Tests data augmentation methods at low level, not through Akara ''' import re import doctest from zen import augmentation
[ 7061, 6, 198, 51, 3558, 1366, 16339, 14374, 5050, 379, 1877, 1241, 11, 407, 832, 9084, 3301, 198, 7061, 6, 198, 198, 11748, 302, 198, 11748, 10412, 395, 198, 198, 6738, 1976, 268, 1330, 16339, 14374, 628 ]
3.486486
37
"""Grasshopper - Terminal game combat function - Return remaining health after taking damage. # 1 Best Practices solution by ZozoFouchtra and others def combat(health, damage): return max(0, health-damage) """ def combat(health, damage): """Find remaining health after taking damage.""" return 0 if healt...
[ 37811, 8642, 562, 8873, 2848, 532, 24523, 983, 5249, 2163, 532, 8229, 5637, 1535, 706, 198, 26103, 2465, 13, 198, 198, 2, 352, 6705, 42134, 4610, 416, 1168, 45149, 37, 7673, 9535, 290, 1854, 198, 198, 4299, 5249, 7, 13948, 11, 2465, ...
3.670103
97
from runners.python import Submission from collections import defaultdict import re
[ 6738, 19323, 13, 29412, 1330, 42641, 198, 6738, 17268, 1330, 4277, 11600, 198, 11748, 302, 198 ]
5.25
16
"""Collection of utils for Statement Results of queries.""" def execution_time(result): """Return the execution time of a query.""" avail = result.summary().result_available_after cons = result.summary().result_consumed_after return avail + cons def total_db_hits(result): """Return th...
[ 37811, 36307, 286, 3384, 4487, 329, 21983, 15691, 286, 20743, 526, 15931, 201, 198, 201, 198, 201, 198, 4299, 9706, 62, 2435, 7, 20274, 2599, 201, 198, 220, 220, 220, 37227, 13615, 262, 9706, 640, 286, 257, 12405, 526, 15931, 201, 198...
2.644753
791
""" Utilities for dealing with identifiers. """ import hashlib import os import re from urllib.parse import quote_plus class IdentRegexChecker(object): """ Allows a user to specify a regex that matches all identifiers. This can allow us to skip making a network/disk request if the identifier is inval...
[ 37811, 198, 18274, 2410, 329, 7219, 351, 42814, 13, 198, 37811, 198, 11748, 12234, 8019, 198, 11748, 28686, 198, 11748, 302, 198, 6738, 2956, 297, 571, 13, 29572, 1330, 9577, 62, 9541, 628, 198, 4871, 11440, 3041, 25636, 9787, 263, 7, ...
2.560479
835
from unittest.mock import MagicMock import pytest from prefect import context from prefect.agent.docker import DockerAgent from prefect.environments.storage import Docker, Local from prefect.utilities.configuration import set_temporary_config from prefect.utilities.graphql import GraphQLResult @pytest.mar...
[ 6738, 555, 715, 395, 13, 76, 735, 1330, 6139, 44, 735, 198, 198, 11748, 12972, 9288, 198, 198, 6738, 662, 2309, 1330, 4732, 198, 6738, 662, 2309, 13, 25781, 13, 45986, 1330, 25716, 36772, 198, 6738, 662, 2309, 13, 268, 12103, 13, 35...
1.838125
2,261
# -*- coding: utf-8 -*- """ Script Name: Author: Do Trinh/Jimmy - 3D artist. Description: """ # ------------------------------------------------------------------------------------------------------------- from .obj import Base # ------------------------------------------------------------------------------...
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 37811, 198, 198, 7391, 6530, 25, 220, 198, 13838, 25, 2141, 33822, 71, 14, 40335, 532, 513, 35, 6802, 13, 198, 198, 11828, 25, 628, 198, 37811, 198, 2, 16529, 3880, ...
4.793478
92
# -*- coding: utf-8 -*- # # Authors: Swolf <swolfforever@gmail.com> # Date: 2021/1/07 # License: MIT License """ Task-related Component Analysis (TRCA) and its variants. """ from typing import Optional, Union, List, Tuple, Dict from itertools import combinations from functools import partial import numpy as np from sc...
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 2, 198, 2, 46665, 25, 2451, 4024, 1279, 2032, 349, 487, 382, 332, 31, 14816, 13, 785, 29, 198, 2, 7536, 25, 33448, 14, 16, 14, 2998, 198, 2, 13789, 25, 17168, 1378...
2.392567
3,444
import pygame from bomber_monkey.features.physics.rigid_body import RigidBody from bomber_monkey.features.controller.input_mapping import InputMapping from bomber_monkey.features.player.player_action import PlayerAction from bomber_monkey.features.controller.mappings.utils import compute_action from bomber_monkey.game...
[ 11748, 12972, 6057, 198, 198, 6738, 24065, 62, 49572, 13, 40890, 13, 746, 23154, 13, 4359, 312, 62, 2618, 1330, 24666, 312, 25842, 198, 6738, 24065, 62, 49572, 13, 40890, 13, 36500, 13, 15414, 62, 76, 5912, 1330, 23412, 44, 5912, 198,...
3.80198
101
import os from kivy.animation import Animation from kivy.core.window import Window from kivy.lang import Builder from kivy.metrics import dp from kivy.properties import NumericProperty Window.size = (800, 600) Window.minimum_width, Window.minimum_height = Window.size from kivymd.uix.screen import MDScreen Builde...
[ 11748, 28686, 198, 198, 6738, 479, 452, 88, 13, 11227, 341, 1330, 23535, 198, 6738, 479, 452, 88, 13, 7295, 13, 17497, 1330, 26580, 198, 6738, 479, 452, 88, 13, 17204, 1330, 35869, 198, 6738, 479, 452, 88, 13, 4164, 10466, 1330, 288...
2.969697
132
from pathlib import Path import dash_html_components as html from ...api_doc import ApiDoc from ...helpers import ( ExampleContainer, HighlightedSource, load_source_with_environment, ) from ...metadata import get_component_metadata from .group import buttons as buttons_group from .outline import buttons a...
[ 6738, 3108, 8019, 1330, 10644, 198, 198, 11748, 14470, 62, 6494, 62, 5589, 3906, 355, 27711, 198, 198, 6738, 2644, 15042, 62, 15390, 1330, 5949, 72, 23579, 198, 6738, 2644, 16794, 364, 1330, 357, 198, 220, 220, 220, 17934, 29869, 11, ...
3.116505
206
# -*- coding: utf-8 -*- from flask import Flask, g, json, render_template, Response, request import psycopg2 import psycopg2.extras from Config import Config import logging import os.path from subprocess import call import tempfile from zipfile import * from urllib2 import urlopen, URLError, HTTPError app ...
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 201, 198, 6738, 42903, 1330, 46947, 11, 308, 11, 33918, 11, 8543, 62, 28243, 11, 18261, 11, 2581, 201, 198, 11748, 17331, 22163, 70, 17, 201, 198, 11748, 17331, 22163, 70, ...
2.002252
888
import json from enum import Enum from os import listdir from os.path import isfile from pathlib import Path from typing import List import yaml from attributedict.collections import AttributeDict from pydantic import BaseModel def get_config_files( path: str, ) -> List[ConfigFile]: """ :param path: r...
[ 11748, 33918, 198, 6738, 33829, 1330, 2039, 388, 198, 6738, 28686, 1330, 1351, 15908, 198, 6738, 28686, 13, 6978, 1330, 318, 7753, 198, 6738, 3108, 8019, 1330, 10644, 198, 6738, 19720, 1330, 7343, 198, 198, 11748, 331, 43695, 198, 6738, ...
2.384409
372
from numpy import percentile import pandas as pd import pymc3 as pm
[ 6738, 299, 32152, 1330, 37894, 198, 11748, 19798, 292, 355, 279, 67, 198, 11748, 279, 4948, 66, 18, 355, 9114, 198 ]
3.238095
21
from sanic import Sanic from sanic.response import json from milvus import Milvus, DataType from pprint import pprint import random import numpy as np from bert_serving.client import BertClient # ip address of the GPU machine bc = BertClient(ip='192.168.187.41') # bc = BertClient(ip='10.13.5.221') _HOST = 'any.moono.vi...
[ 6738, 5336, 291, 1330, 2986, 291, 198, 6738, 5336, 291, 13, 26209, 1330, 33918, 198, 6738, 1465, 85, 385, 1330, 4460, 85, 385, 11, 6060, 6030, 198, 6738, 279, 4798, 1330, 279, 4798, 198, 11748, 4738, 198, 11748, 299, 32152, 355, 45941...
2.293893
262
if __name__ == '__main__': main()
[ 628, 198, 361, 11593, 3672, 834, 6624, 705, 834, 12417, 834, 10354, 198, 220, 220, 220, 1388, 3419 ]
2.222222
18
"""Filesystem utility functions.""" from __future__ import absolute_import import os import errno def makedirs(path): """Create directory recursively if not exists. Similar to `makedir -p`, you can skip checking existence before this function. Parameters ---------- path : str Path of the d...
[ 37811, 25876, 6781, 10361, 5499, 526, 15931, 198, 6738, 11593, 37443, 834, 1330, 4112, 62, 11748, 198, 11748, 28686, 198, 11748, 11454, 3919, 628, 198, 4299, 285, 4335, 17062, 7, 6978, 2599, 198, 220, 220, 220, 37227, 16447, 8619, 664, ...
2.556356
1,526
# -*- coding: utf-8 -*- try: from fountain.data_generator import DataGenerator except: import sys sys.path.append('../') from fountain.data_generator import DataGenerator import logging if __name__ == "__main__": logging.info('Using `fountain` to generate data') # DataGenerator data_genera...
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 198, 28311, 25, 198, 220, 220, 220, 422, 29420, 13, 7890, 62, 8612, 1352, 1330, 6060, 8645, 1352, 198, 16341, 25, 198, 220, 220, 220, 1330, 25064, 198, 220, 220, 220, ...
2.697548
367
""" Module implementing an interface with `Sentinel Hub Batch Processing API <https://docs.sentinel-hub.com/api/latest/api/batch/>`__. """ import datetime as dt import logging import time from collections import defaultdict from dataclasses import dataclass, field from enum import Enum from typing import Any, DefaultDi...
[ 37811, 198, 26796, 15427, 281, 7071, 351, 198, 63, 31837, 20538, 14699, 347, 963, 28403, 7824, 1279, 5450, 1378, 31628, 13, 34086, 20538, 12, 40140, 13, 785, 14, 15042, 14, 42861, 14, 15042, 14, 43501, 15913, 63, 834, 13, 198, 37811, ...
2.684744
12,336
import numpy as np import rlkit.misc.hyperparameter as hyp import rlkit.torch.pytorch_util as ptu from multiworld.core.flat_goal_env import FlatGoalEnv from multiworld.core.image_env import ImageEnv from multiworld.envs.pygame.point2d import Point2DEnv from rlkit.data_management.env_replay_buffer import EnvReplayBuffe...
[ 11748, 299, 32152, 355, 45941, 198, 198, 11748, 374, 75, 15813, 13, 44374, 13, 49229, 17143, 2357, 355, 5328, 198, 11748, 374, 75, 15813, 13, 13165, 354, 13, 9078, 13165, 354, 62, 22602, 355, 279, 28047, 198, 6738, 5021, 6894, 13, 729...
1.970451
1,286
############################################################################# # ATTENTION! # # This code is automatically generated by flatdata generator. # # Any modifications to this file will be lost upon next regeneration. # ########...
[ 29113, 29113, 7804, 4242, 2, 198, 2, 220, 220, 220, 26195, 45589, 0, 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, 220, 220, 220,...
2.01321
1,514
"""Tests for device finding functionality.""" import unittest from unittest.mock import patch from pysyncdroid.exceptions import DeviceException from pysyncdroid.find_device import ( get_connection_details, get_mtp_details, lsusb, ) mock_lsub_parts = [ "Bus 002 Device 001: ID 0123:0001 test_vendor ...
[ 37811, 51, 3558, 329, 3335, 4917, 11244, 526, 15931, 628, 198, 11748, 555, 715, 395, 198, 6738, 555, 715, 395, 13, 76, 735, 1330, 8529, 198, 198, 6738, 279, 893, 2047, 10210, 3882, 13, 1069, 11755, 1330, 16232, 16922, 198, 6738, 279, ...
2.566929
254
from vulnix.vulnerability import Vulnerability from vulnix.derivation import Derive, split_name, load, SkipDrv import os import pkg_resources import pytest import tempfile V = Vulnerability def test_check_returns_cves(nvd): """Test for CVE-2016-9844 which is listed but has a patch.""" nvd.update() ...
[ 6738, 24477, 77, 844, 13, 85, 40920, 1330, 569, 40920, 198, 6738, 24477, 77, 844, 13, 1082, 26939, 1330, 9626, 425, 11, 6626, 62, 3672, 11, 3440, 11, 32214, 6187, 85, 198, 11748, 28686, 198, 11748, 279, 10025, 62, 37540, 198, 11748, ...
2.405904
271
#!/usr/bin/env yamtbx.python """ (c) RIKEN 2015. All rights reserved. Author: Keitaro Yamashita This software is released under the new BSD License; see LICENSE. """ """ Helper script for setting up mtz files (?) for comparing results with scala Usage: PHENIX_TRUST_OTHER_ENV=1 xds_setup_scala_exp.py What we want ...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 331, 321, 83, 65, 87, 13, 29412, 198, 37811, 198, 7, 66, 8, 371, 18694, 1677, 1853, 13, 1439, 2489, 10395, 13, 220, 198, 13838, 25, 3873, 7940, 78, 14063, 1077, 5350, 198, 198, 1212, 3788, 318...
1.945511
3,542
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import xlrd import xlwt from sklearn import svm from sklearn import preprocessing from sklearn.model_selection import train_test_split from sklearn.model_selection import cross_val_score from sklearn.model_selection import learning_curve from sklearn.metrics import accura...
[ 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, 11748, 2124, 75, 4372, 198, 11748, 2124, 75, 46569, 198, 6738, 1341, 35720, 1330, 264, 14761, 198, 6738, 1341,...
1.882883
1,554
from typing import TYPE_CHECKING from python_pachyderm.service import Service import betterproto.lib.google.protobuf as bp_proto if TYPE_CHECKING: from python_pachyderm.experimental.service import admin_proto # bp_to_pb: bp_proto.Empty -> empty_pb2.Empty class AdminMixin: """A mixin for admin-related funct...
[ 6738, 19720, 1330, 41876, 62, 50084, 2751, 198, 198, 6738, 21015, 62, 79, 35586, 1082, 76, 13, 15271, 1330, 4809, 198, 11748, 1365, 1676, 1462, 13, 8019, 13, 13297, 13, 11235, 672, 3046, 355, 275, 79, 62, 1676, 1462, 198, 198, 361, ...
2.306397
297
import os
[ 11748, 28686, 198 ]
3.333333
3
import torch import pyro.distributions as dist from pyro.ops.gamma_gaussian import GammaGaussian from tests.common import assert_close def random_gamma_gaussian(batch_shape, dim, rank=None): """ Generate a random Gaussian for testing. """ if rank is None: rank = dim + dim log_normalizer =...
[ 11748, 28034, 198, 198, 11748, 12972, 305, 13, 17080, 2455, 507, 355, 1233, 198, 6738, 12972, 305, 13, 2840, 13, 28483, 2611, 62, 4908, 31562, 1330, 43595, 35389, 31562, 198, 6738, 5254, 13, 11321, 1330, 6818, 62, 19836, 628, 198, 4299,...
2.615213
447
from typing import Callable, Dict, List, Tuple, cast import Operators as op import Target as ta import numpy as np
[ 6738, 19720, 1330, 4889, 540, 11, 360, 713, 11, 7343, 11, 309, 29291, 11, 3350, 198, 11748, 6564, 2024, 355, 1034, 198, 11748, 12744, 355, 20486, 198, 11748, 299, 32152, 355, 45941, 198 ]
3.484848
33
#!/usr/bin/env python3 # SDA = pin.SDA_1 # SCL = pin.SCL_1 # SDA_1 = pin.SDA # SCL_1 = pin.SCL from adafruit_servokit import ServoKit import board import busio import time import rospy from std_msgs.msg import String #from approxeng.input.selectbinder import ControllerResource # On the Jetson Nano # Bus 0 (pins 28...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 198, 2, 311, 5631, 796, 6757, 13, 50, 5631, 62, 16, 198, 2, 311, 5097, 796, 6757, 13, 50, 5097, 62, 16, 198, 2, 311, 5631, 62, 16, 796, 6757, 13, 50, 5631, 198, 2, 311, 5...
2.647815
389
cor = { 'fim':'\033[m', 'amarelo':'\033[1;033m', 'amarelof':'\033[7;033m', 'vermelho':'\033[1;031m', 'vermelhof':'\033[7;031m', 'azul':'\033[1;034m', 'verde':'\033[1;32m', 'verdef':'\033[7;32m', 'branco':'\033[1;030m' } pesos = [] for i in range(1, 6): ...
[ 10215, 796, 1391, 201, 198, 220, 220, 220, 705, 69, 320, 10354, 6, 59, 44427, 58, 76, 3256, 220, 201, 198, 220, 220, 220, 705, 321, 533, 5439, 10354, 6, 59, 44427, 58, 16, 26, 44427, 76, 3256, 220, 201, 198, 220, 220, 220, 705, ...
1.757813
384
import datetime import re from contextlib import suppress from django.contrib.auth import get_user_model from django.http import Http404 from django.utils import timezone from django.utils.translation import get_language from dateutil.parser import parse from dictionary.conf import settings from dictionary.utils.de...
[ 11748, 4818, 8079, 198, 11748, 302, 198, 198, 6738, 4732, 8019, 1330, 18175, 198, 198, 6738, 42625, 14208, 13, 3642, 822, 13, 18439, 1330, 651, 62, 7220, 62, 19849, 198, 6738, 42625, 14208, 13, 4023, 1330, 367, 29281, 26429, 198, 6738, ...
2.249161
1,489
from urllib import parse from instagrapi import Client from tinydb import TinyDB, Query import json
[ 6738, 2956, 297, 571, 1330, 21136, 198, 6738, 916, 363, 2416, 72, 1330, 20985, 198, 6738, 7009, 9945, 1330, 20443, 11012, 11, 43301, 198, 11748, 33918, 198 ]
3.703704
27
import os import csv samples = [] with open('../data/driving_log.csv') as csvfile: reader = csv.reader(csvfile) for line in reader: samples.append(line) #samples = samples[1:], optional in case there is header in csv data print('Filenames loaded...') from sklearn.model_selection import train_test_sp...
[ 11748, 28686, 198, 11748, 269, 21370, 198, 198, 82, 12629, 796, 17635, 198, 4480, 1280, 10786, 40720, 7890, 14, 24255, 62, 6404, 13, 40664, 11537, 355, 269, 21370, 7753, 25, 198, 220, 220, 220, 9173, 796, 269, 21370, 13, 46862, 7, 406...
2.871707
873
# Copyright 2020 TerraPower, LLC # # 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 writi...
[ 2, 15069, 12131, 24118, 13434, 11, 11419, 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, 198, 2, 9...
3.424354
271
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ @author: olivergiesecke 1) Collect the data on the speakers and text for each alternative. 2) Do the regular pre-processing for each text entry. 3) Apply standard LDA 4) Provide summary statics how the probability mass lines up with the different alternatives. 5) Check...
[ 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, 31, 9800, 25, 25776, 1428, 70, 444, 721, 365, 198, 16, 8, 9745, 262, 1366, 319, 262, 11636, 290, 24...
2.639557
6,689
# Homework 4 Solutions # Center of Mass Position and Velocity # G. Besla # Homework 6 : modified to take in a different value with which to # decrease the volume. # import modules import numpy as np import astropy.units as u from ReadFile import Read
[ 2, 8074, 6433, 604, 23555, 198, 2, 3337, 286, 5674, 23158, 290, 43137, 198, 2, 402, 13, 30837, 5031, 198, 198, 2, 8074, 6433, 718, 1058, 9518, 284, 1011, 287, 257, 1180, 1988, 351, 543, 284, 220, 198, 2, 10070, 262, 6115, 13, 628,...
3.111111
90
from flask import Flask, render_template, redirect from sql_keys import username, password from sqlalchemy import create_engine from splinter import Browser from bs4 import BeautifulSoup as bs import time import csv import datetime, time import requests from scipy import stats # Create an instance of Flask app = Flask...
[ 6738, 42903, 1330, 46947, 11, 8543, 62, 28243, 11, 18941, 198, 6738, 44161, 62, 13083, 1330, 20579, 11, 9206, 198, 6738, 44161, 282, 26599, 1330, 2251, 62, 18392, 198, 6738, 4328, 3849, 1330, 34270, 198, 6738, 275, 82, 19, 1330, 23762, ...
3.22067
358
#!/usr/bin/env python3 from datetime import datetime as dt from setuptools import setup, find_packages import ledfxcontroller.consts as const PROJECT_PACKAGE_NAME = 'ledfxcontroller' PROJECT_VERSION = const.PROJECT_VERSION PROJECT_LICENSE = 'The MIT License' PROJECT_AUTHOR = 'Austin Hodges' PROJECT_AUTHOR_EMAIL = 'au...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 198, 6738, 4818, 8079, 1330, 4818, 8079, 355, 288, 83, 198, 6738, 900, 37623, 10141, 1330, 9058, 11, 1064, 62, 43789, 198, 11748, 2957, 21373, 36500, 13, 1102, 6448, 355, 1500, 198...
2.142553
470
"""Score k-nearest neighbor classifier trained on wine classification data. Copyright by Nikolaus Ruf Released under the MIT license - see LICENSE file for details """ import gzip import os import pickle from sklearn.metrics import classification_report, log_loss, roc_auc_score print("* Apply user set...
[ 37811, 26595, 479, 12, 710, 12423, 4780, 1398, 7483, 8776, 319, 8237, 17923, 1366, 13, 201, 198, 201, 198, 15269, 416, 47817, 385, 371, 3046, 201, 198, 45037, 739, 262, 17168, 5964, 532, 766, 38559, 24290, 2393, 329, 3307, 201, 198, 3...
2.610662
619
import pytest from jason import props
[ 11748, 12972, 9288, 198, 198, 6738, 474, 888, 1330, 25744, 628, 628, 628, 628, 628, 628, 628, 628, 628, 628, 198 ]
2.809524
21
"""Transform a roidb into a trainable roidb by adding a bunch of metadata.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import datasets import numpy as np from model.utils.config import cfg from datasets.factory import get_imdb import PIL import pdb ...
[ 37811, 41762, 257, 686, 312, 65, 656, 257, 4512, 540, 686, 312, 65, 416, 4375, 257, 7684, 286, 20150, 526, 15931, 198, 6738, 11593, 37443, 834, 1330, 4112, 62, 11748, 198, 6738, 11593, 37443, 834, 1330, 7297, 198, 6738, 11593, 37443, ...
2.219741
2,239
# # Copyright © 2020 Intel Corporation. # # This software and the related documents are Intel copyrighted # materials, and your use of them is governed by the express # license under which they were provided to you (License). Unless # the License provides otherwise, you may not use, modify, copy, # publish, distribute,...
[ 2, 198, 2, 15069, 10673, 12131, 8180, 10501, 13, 198, 2, 198, 2, 770, 3788, 290, 262, 3519, 4963, 389, 8180, 33696, 198, 2, 5696, 11, 290, 534, 779, 286, 606, 318, 21825, 416, 262, 4911, 198, 2, 5964, 739, 543, 484, 547, 2810, 2...
2.538555
9,921
""" Codes for correcting the differential phase and estimating KDP. @title: phase @author: Valentin Louf <valentin.louf@monash.edu> @institutions: Monash University and the Australian Bureau of Meteorology @date: 20/11/2017 .. autosummary:: :toctree: generated/ check_phidp fix_phidp_from_kdp phidp_br...
[ 37811, 198, 34, 4147, 329, 39038, 262, 22577, 7108, 290, 39539, 509, 6322, 13, 198, 198, 31, 7839, 25, 7108, 198, 31, 9800, 25, 17284, 259, 4768, 69, 1279, 2100, 31371, 13, 75, 37116, 31, 2144, 1077, 13, 15532, 29, 198, 31, 8625, ...
2.077954
4,926
import RLAgents import numpy import matplotlib.pyplot as plt raw_score_col = 3 norm_score_col = 4 result_path = "./results/" files = [] files.append("./models/ppo_baseline/result/result.log") stats_baseline = RLAgents.RLStatsCompute(files) files = [] files.append("./models/ppo_curiosity/result/result.log") stats_...
[ 11748, 45715, 10262, 658, 198, 11748, 299, 32152, 198, 198, 11748, 2603, 29487, 8019, 13, 9078, 29487, 355, 458, 83, 628, 198, 1831, 62, 26675, 62, 4033, 796, 513, 198, 27237, 62, 26675, 62, 4033, 796, 604, 198, 198, 20274, 62, 6978, ...
2.525773
1,746
# -*- coding: UTF8 ''' Created on 19.08.2015 @author: mEDI ''' from datetime import datetime, timedelta import elite class route(object): ''' calculate a A-B-A or A-B(x) route, set speed control and result details over limitCalc() ''' mydb = None deals = [] forceHops ...
[ 2, 532, 9, 12, 19617, 25, 41002, 23, 201, 198, 7061, 6, 201, 198, 41972, 319, 678, 13, 2919, 13, 4626, 201, 198, 201, 198, 31, 9800, 25, 285, 1961, 40, 201, 198, 7061, 6, 201, 198, 201, 198, 6738, 4818, 8079, 1330, 4818, 8079, ...
2.347191
890
from enum import Enum import json import pytest from rmlab_http_client.types import ( Argument, AsyncEndpoint, AuthType, CommunicationType, Endpoint, MethodType, PayloadArguments, PayloadType, ResponseType, ) Payloads = [ PayloadType.NONE, PayloadType.MATCH, Payload...
[ 6738, 33829, 1330, 2039, 388, 198, 11748, 33918, 198, 11748, 12972, 9288, 198, 6738, 374, 4029, 397, 62, 4023, 62, 16366, 13, 19199, 1330, 357, 198, 220, 220, 220, 45751, 11, 198, 220, 220, 220, 1081, 13361, 12915, 4122, 11, 198, 220,...
2.459103
379
from urllib.parse import urlsplit, urljoin from datetime import timedelta from werkzeug.routing import NotFound, RequestRedirect, MethodNotAllowed from flask import current_app, redirect, url_for, request, g from flask.views import MethodView from flask_smorest import abort from swpt_lib.utils import i64_to_u64, u64_to...
[ 6738, 2956, 297, 571, 13, 29572, 1330, 2956, 7278, 489, 270, 11, 19016, 22179, 198, 6738, 4818, 8079, 1330, 28805, 12514, 198, 6738, 266, 9587, 2736, 1018, 13, 81, 13660, 1330, 1892, 21077, 11, 19390, 7738, 1060, 11, 11789, 3673, 3237, ...
2.721472
815
############################################################################################### # 题目要求modify in-place,快排就是in-place,只不过复杂度高于O(n) ########### # 时间复杂度:O(nlogn) # 空间复杂度:O(logn) ############################################################################################### ###########################...
[ 29113, 29113, 14468, 7804, 4242, 21017, 201, 198, 2, 16268, 95, 246, 33566, 106, 17358, 223, 162, 109, 224, 4666, 1958, 287, 12, 5372, 171, 120, 234, 33232, 104, 162, 236, 240, 22887, 109, 42468, 259, 12, 5372, 11, 20998, 103, 38834, ...
2.491954
435
# coding:utf-8 """ @author:ww @time:2018/3/9 @version:0.1 """ # Create your views here. from braces.views._access import UserPassesTestMixin from braces.views._ajax import JSONResponseMixin, AjaxResponseMixin from braces.views._queries import SelectRelatedMixin, PrefetchRelatedMixin from django.contrib import messages ...
[ 2, 19617, 25, 40477, 12, 23, 198, 37811, 198, 31, 9800, 25, 1383, 198, 31, 2435, 25, 7908, 14, 18, 14, 24, 198, 31, 9641, 25, 15, 13, 16, 198, 37811, 198, 2, 13610, 534, 5009, 994, 13, 198, 6738, 47241, 13, 33571, 13557, 15526, ...
2.727273
1,089
import mxnet as mx import numpy as np import os import argparse import pickle from symbols import * from loaders import * parser = argparse.ArgumentParser(description='Structured Visual Attention on the VQA dataset') parser.add_argument('--qa-path', type=str, default='/rundata/vqa2.0/train+val+vg_...
[ 11748, 285, 87, 3262, 355, 285, 87, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 28686, 198, 11748, 1822, 29572, 198, 11748, 2298, 293, 198, 6738, 14354, 1330, 1635, 198, 6738, 3440, 364, 1330, 1635, 198, 198, 48610, 796, 1822, 29572...
2.199353
2,473
# -*- coding: UTF-8 -*- """ Start the function ,and determine the current directory ---------------------------------- ---------------------------------- __version__ = "V1.0" __completion__ = "2018-08-09" __author__ = "yewei" Recorded : 1. 2018-08-09 Release V1.0 ...
[ 2, 532, 9, 12, 19617, 25, 41002, 12, 23, 532, 9, 12, 198, 37811, 198, 220, 220, 220, 7253, 262, 2163, 837, 392, 5004, 262, 1459, 8619, 198, 220, 220, 220, 20368, 438, 20368, 438, 198, 220, 220, 220, 220, 220, 220, 220, 11593, 96...
2.475248
606
# run_experiment # Basics import pandas as pd import numpy as np import datetime import typer import os # Import paths from globals import DATA_MODELLING_FOLDER, EXPERIMENT_RESULTS # Import sklearn processing/pipeline from sklearn.pipeline import Pipeline from sklearn.preprocessing import MinMaxScaler from sklearn.f...
[ 2, 1057, 62, 23100, 3681, 198, 198, 2, 45884, 198, 11748, 19798, 292, 355, 279, 67, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 4818, 8079, 198, 11748, 1259, 525, 198, 11748, 28686, 198, 198, 2, 17267, 13532, 198, 6738, 15095, 874...
3.368078
307
# ROI Editor with serial 2D viewer and annotator # Author: David Young, 2018, 2020 """ROI editing GUI in the MagellanMapper package. Attributes: verify: If true, verification mode is turned on, which for now simply turns on interior borders as the picker remains on by default. """ from collections...
[ 2, 15107, 40, 12058, 351, 11389, 362, 35, 19091, 290, 24708, 1352, 198, 2, 6434, 25, 3271, 6960, 11, 2864, 11, 12131, 198, 37811, 13252, 40, 12857, 25757, 287, 262, 17323, 47993, 44, 11463, 5301, 13, 198, 198, 29021, 25, 198, 220, 2...
2.02832
29,943
import os import torch.nn as nn import torch import numpy as np from math import sin, cos from components import Attention
[ 11748, 28686, 198, 11748, 28034, 13, 20471, 355, 299, 77, 198, 11748, 28034, 198, 11748, 299, 32152, 355, 45941, 198, 6738, 10688, 1330, 7813, 11, 8615, 198, 6738, 6805, 1330, 47406, 628, 198 ]
3.787879
33
# TODO: Add import statements ## Diego -> step 1 import numpy as np import pandas as pd from sklearn.linear_model import Lasso # Assign the data to predictor and outcome variables # TODO: Load the data #train_data = None #X = None #y = None ## Diego -> step 2 train_data = pd.read_csv('data.csv', header = None) X = tra...
[ 2, 16926, 46, 25, 3060, 1330, 6299, 198, 2235, 9500, 4613, 2239, 352, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 19798, 292, 355, 279, 67, 198, 6738, 1341, 35720, 13, 29127, 62, 19849, 1330, 406, 28372, 198, 198, 2, 2195, 570, ...
2.803846
260
import py3dtiles.points.task.las_reader as reader import py3dtiles.points.task.las_reader as lasReader import py3dtiles.points.task.pnts_writer as writer import math from laspy.file import File import numpy as np from octtree import oct_block #from octtreev2 import node import pntsoutput as pnts import progress as prog...
[ 11748, 12972, 18, 28664, 2915, 13, 13033, 13, 35943, 13, 21921, 62, 46862, 355, 9173, 198, 11748, 12972, 18, 28664, 2915, 13, 13033, 13, 35943, 13, 21921, 62, 46862, 355, 39990, 33634, 198, 11748, 12972, 18, 28664, 2915, 13, 13033, 13, ...
2.372617
577
res = answer([ [30, 185, 624], [66, 351, 947], [26, 1023, 1024], [19, 148, 250], [5, 1, 5], [10, 1, 2] ]) print res
[ 198, 198, 411, 796, 220, 3280, 26933, 198, 220, 220, 220, 685, 1270, 11, 22855, 11, 718, 1731, 4357, 685, 2791, 11, 44417, 11, 860, 2857, 4357, 685, 2075, 11, 838, 1954, 11, 28119, 4357, 685, 1129, 11, 22613, 11, 8646, 4357, 198, ...
1.925373
67
from django.db.models import Count, Q from rooms.models import Room from .forms import ProfileForm
[ 6738, 42625, 14208, 13, 9945, 13, 27530, 1330, 2764, 11, 1195, 198, 6738, 9519, 13, 27530, 1330, 10096, 198, 198, 6738, 764, 23914, 1330, 13118, 8479, 628 ]
3.740741
27
"""All-Link Record Flags.""" from binascii import hexlify from ...constants import AllLinkMode from ...utils import bit_is_set, set_bit, test_values_eq def create( in_use: bool, controller: bool, hwm: bool, bit5: bool = False, bit4: bool = False, bit3: bool = False, bit2: bool = False, ...
[ 37811, 3237, 12, 11280, 13266, 34771, 526, 15931, 198, 198, 6738, 9874, 292, 979, 72, 1330, 17910, 75, 1958, 198, 198, 6738, 2644, 9979, 1187, 1330, 1439, 11280, 19076, 198, 6738, 2644, 26791, 1330, 1643, 62, 271, 62, 2617, 11, 900, 6...
2.163525
2,122
import json import re from typing import List from .exceptions import ( ResponseProcessException, ClientError, ServerError, NotFound404Error, ) from .serializers import SimpleSerializer from .tapi import TapiInstantiator, TapiClientExecutor
[ 11748, 33918, 198, 11748, 302, 198, 6738, 19720, 1330, 7343, 198, 198, 6738, 764, 1069, 11755, 1330, 357, 198, 220, 220, 220, 18261, 18709, 16922, 11, 198, 220, 220, 220, 20985, 12331, 11, 198, 220, 220, 220, 9652, 12331, 11, 198, 220...
3.275
80
# %% [markdown] # ## PerfPro FIT files EDA # %% import matplotlib.pyplot as plt import seaborn as sns import numpy as np import pandas as pd from tqdm import tqdm import datetime import zipfile from os import listdir from os.path import isfile, join import fitparse # %% [markdown] # ### Processing the zipped files ...
[ 2, 43313, 685, 4102, 2902, 60, 198, 2, 22492, 2448, 69, 2964, 376, 2043, 3696, 412, 5631, 198, 198, 2, 43313, 198, 11748, 2603, 29487, 8019, 13, 9078, 29487, 355, 458, 83, 198, 11748, 384, 397, 1211, 355, 3013, 82, 198, 11748, 299, ...
2.397122
695
"""Core classes and methods for mapping moments through functions.""" import typing from . import backends class MomentMap: """Base class for moment map functions. Moment maps are callables that take in multivariate-normal distributed inputs and produce the mean, covariance of the output distribution, a...
[ 37811, 14055, 6097, 290, 5050, 329, 16855, 7188, 832, 5499, 526, 15931, 198, 11748, 19720, 198, 198, 6738, 764, 1330, 736, 2412, 628, 198, 4871, 29278, 13912, 25, 198, 220, 220, 220, 37227, 14881, 1398, 329, 2589, 3975, 5499, 13, 628, ...
2.162648
5,724
import torch import torch.nn as nn from torch.autograd import Variable import torch.nn.functional as F from rnn_modules import * class RNNModel(nn.Module): """Container module with an encoder, a recurrent module, and a decoder."""
[ 11748, 28034, 198, 11748, 28034, 13, 20471, 355, 299, 77, 198, 6738, 28034, 13, 2306, 519, 6335, 1330, 35748, 198, 11748, 28034, 13, 20471, 13, 45124, 355, 376, 198, 198, 6738, 374, 20471, 62, 18170, 1330, 1635, 198, 198, 4871, 371, 6...
3.352113
71
# -*- coding: utf-8 -*- """ Created by susy at 2020/1/27 """ from controller.base_service import BaseService from utils import singleton, make_account_token, obfuscate_id, decrypt_user_id, get_now_datetime from dao.models import Accounts, Role, Org, BASE_FIELDS, PanAccounts, AccountExt from dao.auth_dao import AuthDao ...
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 37811, 198, 41972, 416, 2341, 88, 379, 12131, 14, 16, 14, 1983, 198, 37811, 198, 6738, 10444, 13, 8692, 62, 15271, 1330, 7308, 16177, 198, 6738, 3384, 4487, 1330, 2060, ...
2.744604
278
from django.conf import settings from django.template import TemplateDoesNotExist from django.template.loader import template_source_loaders, find_template_loader def find_template_path(name): """ Same as :func:`django.template.loader.find_template`, but it only returns the path to the template file. "...
[ 6738, 42625, 14208, 13, 10414, 1330, 6460, 198, 6738, 42625, 14208, 13, 28243, 1330, 37350, 13921, 3673, 3109, 396, 198, 6738, 42625, 14208, 13, 28243, 13, 29356, 1330, 11055, 62, 10459, 62, 2220, 364, 11, 1064, 62, 28243, 62, 29356, 19...
2.468665
367
# Generated by Django 3.1.1 on 2020-09-10 20:18 import django.contrib.postgres.fields from django.db import migrations, models
[ 2, 2980, 515, 416, 37770, 513, 13, 16, 13, 16, 319, 12131, 12, 2931, 12, 940, 1160, 25, 1507, 198, 198, 11748, 42625, 14208, 13, 3642, 822, 13, 7353, 34239, 13, 25747, 198, 6738, 42625, 14208, 13, 9945, 1330, 15720, 602, 11, 4981, ...
2.931818
44
import logging from typing import Dict, Tuple from collections import OrderedDict import torch from tqdm import tqdm from nncf.registry import Registry from nncf.quantization.initializers import InitializerFactory logger = logging.getLogger(__name__) INITIALIZABLE_MODULES = Registry('initializable_modules') class...
[ 11748, 18931, 198, 6738, 19720, 1330, 360, 713, 11, 309, 29291, 198, 6738, 17268, 1330, 14230, 1068, 35, 713, 198, 198, 11748, 28034, 198, 6738, 256, 80, 36020, 1330, 256, 80, 36020, 198, 198, 6738, 299, 10782, 69, 13, 2301, 4592, 133...
3.309524
210
from django import forms from .models import Product
[ 6738, 42625, 14208, 1330, 5107, 198, 6738, 764, 27530, 1330, 8721, 198 ]
4.416667
12
from .zip_addon import * from .blender_addon import *
[ 6738, 764, 13344, 62, 48078, 1330, 1635, 198, 6738, 764, 2436, 2194, 62, 48078, 1330, 1635, 198 ]
3.176471
17
#!/usr/bin/env python # coding: utf-8 # In[1]: import time import json import requests import numpy as np import pandas as pd from PIL import Image from io import BytesIO # In[2]: time_type = { 'a1': '10点前', 'n1': '10~12点', 'n2': '12~14点', 'p1': '14点后' } # In[3]: SkiRanch_ID = '57a0ff6a...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 2, 19617, 25, 3384, 69, 12, 23, 198, 198, 2, 554, 58, 16, 5974, 628, 198, 11748, 640, 198, 11748, 33918, 198, 11748, 7007, 198, 198, 11748, 299, 32152, 220, 355, 45941, 198, 11748, ...
2.156609
696
import sys import io __all__ = 'PY3', 'byte_to_int', 'get_stream' PY3 = sys.version_info.major == 3
[ 11748, 25064, 198, 11748, 33245, 198, 198, 834, 439, 834, 796, 705, 47, 56, 18, 3256, 705, 26327, 62, 1462, 62, 600, 3256, 705, 1136, 62, 5532, 6, 198, 47, 56, 18, 796, 25064, 13, 9641, 62, 10951, 13, 22478, 6624, 513, 628, 198 ]
2.340909
44
#!/usr/bin/env python3 import argparse, os, shutil, tempfile, sys, subprocess here = os.path.abspath(os.path.dirname(__file__)) package_name = 'raspberrypi-uart-logger' service_name = 'logger.service' mountpoint = '/mnt/LOGS' installation_files = [ 'logger.py', 'miscs.py', ...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 198, 11748, 1822, 29572, 11, 28686, 11, 4423, 346, 11, 20218, 7753, 11, 25064, 11, 850, 14681, 628, 198, 1456, 796, 28686, 13, 6978, 13, 397, 2777, 776, 7, 418, 13, 6978, 13, 1...
2.470985
2,223
from molsysmt._private.digestion import digest_item, digest_atom_indices from molsysmt._private.digestion import digest_coordinates, digest_box
[ 6738, 285, 10220, 893, 16762, 13557, 19734, 13, 12894, 395, 295, 1330, 16274, 62, 9186, 11, 16274, 62, 37696, 62, 521, 1063, 198, 6738, 285, 10220, 893, 16762, 13557, 19734, 13, 12894, 395, 295, 1330, 16274, 62, 37652, 17540, 11, 16274,...
3.272727
44
from django.db import models from updown.fields import RatingField
[ 6738, 42625, 14208, 13, 9945, 1330, 4981, 198, 6738, 2325, 593, 13, 25747, 1330, 12028, 15878, 628 ]
4
17
import nmap import gi gi.require_version("Notify",'0.7') from gi.repository import Notify Notify.init("Intruder Alert") from decouple import config import datetime notification = Notify.Notification.new("Intruder alert launched",str(datetime.datetime.now().time().strftime("%H:%M")), "account-logged-...
[ 11748, 299, 8899, 198, 11748, 308, 72, 198, 12397, 13, 46115, 62, 9641, 7203, 3673, 1958, 1600, 6, 15, 13, 22, 11537, 198, 6738, 308, 72, 13, 260, 1930, 37765, 1330, 1892, 1958, 198, 3673, 1958, 13, 15003, 7203, 5317, 81, 26651, 232...
2.16092
783
from .KETTS_male import KETTS_30m from .KETTS_female import KETTS_30f from .KETTS76 import KETTS76 from .KNTTS import KNTTS from .BC2013 import BC2013 from .LJSpeech11 import LJSpeech11 from .ETRI import ETRI
[ 6738, 764, 42, 2767, 4694, 62, 22606, 1330, 509, 2767, 4694, 62, 1270, 76, 198, 6738, 764, 42, 2767, 4694, 62, 24724, 1330, 509, 2767, 4694, 62, 1270, 69, 198, 6738, 764, 42, 2767, 4694, 4304, 1330, 509, 2767, 4694, 4304, 198, 6738,...
2.518072
83
from unittest import TestCase from usbfan import Colour, Column, Message, Program
[ 6738, 555, 715, 395, 1330, 6208, 20448, 198, 198, 6738, 514, 19881, 272, 1330, 38773, 11, 29201, 11, 16000, 11, 6118, 628, 628 ]
3.73913
23
import tensorflow as tf import numpy as np from datetime import datetime import matplotlib.pyplot as plt def visualize(**images): """PLot images in one row.""" n = len(images) plt.figure(figsize=(16, 5)) for i, (name, image) in enumerate(images.items()): plt.subplot(1, n, i + 1) plt....
[ 11748, 11192, 273, 11125, 355, 48700, 198, 11748, 299, 32152, 355, 45941, 198, 198, 6738, 4818, 8079, 1330, 4818, 8079, 198, 198, 11748, 2603, 29487, 8019, 13, 9078, 29487, 355, 458, 83, 628, 198, 4299, 38350, 7, 1174, 17566, 2599, 198,...
2.151852
270
import random import numpy as np class Operation: """ Abstract base class for all types of operations that may be put into a pipeline. """ def __init__(self): """ Create the Operation. args member contains the arguments that were used while creating the operation. It is neces...
[ 11748, 4738, 198, 198, 11748, 299, 32152, 355, 45941, 628, 198, 4871, 14680, 25, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 27741, 2779, 1398, 329, 477, 3858, 286, 4560, 326, 743, 307, 1234, 656, 257, 11523, 13, 198, 220, 220, 2...
2.581573
3,408
import configparser import psycopg2 from sql_queries import create_table_queries, drop_table_queries, create_schema_queries def create_schemas(cur, conn): """ Execute SQL-statements to create schemas in sparkifydb. There are two schemas used in DWH (Amazon Redshift): - `staging` schema to...
[ 11748, 4566, 48610, 198, 11748, 17331, 22163, 70, 17, 198, 6738, 44161, 62, 421, 10640, 1330, 2251, 62, 11487, 62, 421, 10640, 11, 4268, 62, 11487, 62, 421, 10640, 11, 2251, 62, 15952, 2611, 62, 421, 10640, 628, 198, 4299, 2251, 62, ...
2.606987
916
import math import time import matplotlib.pyplot as plt import numpy as np from PIL import Image import geometry as gm import rtx scene = rtx.Scene((0, 0, 0)) box_width = 6 box_height = 6 # 1 geometry = rtx.PlainGeometry(box_width, box_height) geometry.set_rotation((0, 0, 0)) geometry.set_position((0, 0, -box_widt...
[ 11748, 10688, 198, 11748, 640, 198, 198, 11748, 2603, 29487, 8019, 13, 9078, 29487, 355, 458, 83, 198, 11748, 299, 32152, 355, 45941, 198, 6738, 350, 4146, 1330, 7412, 198, 198, 11748, 22939, 355, 308, 76, 198, 11748, 374, 17602, 198, ...
2.382979
1,551
import sys import utils as m_utils if __name__ == '__main__': main()
[ 11748, 25064, 198, 11748, 3384, 4487, 355, 285, 62, 26791, 628, 198, 198, 361, 11593, 3672, 834, 6624, 705, 834, 12417, 834, 10354, 198, 220, 220, 220, 1388, 3419, 198 ]
2.533333
30
class UnsupportedAxisError(Exception): """Raised when unsupported axis argument is used""" pass class UnsupportedSurfaceMovementError(Exception): """Raised when unsupported surface movement is used""" pass
[ 4871, 791, 15999, 31554, 271, 12331, 7, 16922, 2599, 198, 220, 220, 220, 37227, 21762, 1417, 618, 24222, 16488, 4578, 318, 973, 37811, 198, 220, 220, 220, 1208, 628, 198, 4871, 791, 15999, 14214, 2550, 21774, 434, 12331, 7, 16922, 2599,...
3.672131
61
# -*- coding: utf-8 -*- import torch from torch.utils.data import Dataset, DataLoader import torchvision.transforms as transforms import numpy as np from PIL import Image import os import pickle import torch.utils.data as data import torchvision.datasets as datasets
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 201, 198, 11748, 28034, 201, 198, 6738, 28034, 13, 26791, 13, 7890, 1330, 16092, 292, 316, 11, 6060, 17401, 201, 198, 11748, 28034, 10178, 13, 7645, 23914, 355, 31408, 201, 1...
2.89
100
from io import BytesIO import os import sys from flask import request, render_template, current_app, url_for from flask.views import View from werkzeug.wrappers import Response from werkzeug.exceptions import NotFound import dulwich.objects import dulwich.archive import dulwich.config from dulwich.object_store impor...
[ 6738, 33245, 1330, 2750, 4879, 9399, 198, 11748, 28686, 198, 11748, 25064, 198, 198, 6738, 42903, 1330, 2581, 11, 8543, 62, 28243, 11, 1459, 62, 1324, 11, 19016, 62, 1640, 198, 6738, 42903, 13, 33571, 1330, 3582, 198, 198, 6738, 266, ...
2.796674
1,864
""" csv_to_json.py converts Celero CSV output to custom JSON. Source: https://github.com/mloskot/pycelerograph Author: Mateusz Loskot <mateusz@loskot.net> License: http://unlicense.org """ import csv import json import os import os.path import sys from enum import Enum class Column(Enum): """Columns in Celero ben...
[ 37811, 198, 40664, 62, 1462, 62, 17752, 13, 9078, 26161, 15248, 3529, 44189, 5072, 284, 2183, 19449, 13, 198, 198, 7416, 25, 3740, 1378, 12567, 13, 785, 14, 4029, 418, 74, 313, 14, 9078, 7015, 2384, 198, 13838, 25, 24787, 385, 89, 5...
2.175805
1,678
r"""undocumented""" __all__ = [ "CWSLoader" ] import glob import os import random import shutil import time from .loader import Loader from ...core.dataset import DataSet from ...core.instance import Instance class CWSLoader(Loader): r""" CWSLoader支持的数据格式为,一行一句话,不同词之间用空格隔开, 例如: Example:: ...
[ 81, 37811, 917, 17664, 37811, 198, 198, 834, 439, 834, 796, 685, 198, 220, 220, 220, 366, 43538, 8634, 1170, 263, 1, 198, 60, 198, 198, 11748, 15095, 198, 11748, 28686, 198, 11748, 4738, 198, 11748, 4423, 346, 198, 11748, 640, 198, ...
1.52605
1,977
# pylint: disable=R0903 '''Example repository.''' class ExampleRepo(): '''Example repository class.''' def __init__(self): '''Initialize example repository.''' self.data = {} self.data['default'] = 'default message' self.data['message'] = 'example value of key message' de...
[ 2, 279, 2645, 600, 25, 15560, 28, 49, 2931, 3070, 198, 7061, 6, 16281, 16099, 2637, 7061, 198, 198, 4871, 17934, 6207, 78, 33529, 198, 220, 220, 220, 705, 7061, 16281, 16099, 1398, 2637, 7061, 628, 220, 220, 220, 825, 11593, 15003, ...
2.555556
162
import logging import random import time from djangae.db import transaction from google.appengine.api.datastore_errors import \ TransactionFailedError as AppEngineTransactionFailedError def do_with_retry(func, *args, **kwargs): """ Tries a function 3 times using exponential backoff according to Google ...
[ 11748, 18931, 198, 11748, 4738, 198, 11748, 640, 198, 198, 6738, 42625, 648, 3609, 13, 9945, 1330, 8611, 198, 198, 6738, 23645, 13, 1324, 18392, 13, 15042, 13, 19608, 459, 382, 62, 48277, 1330, 3467, 198, 220, 220, 220, 45389, 37, 625...
2.570806
459
# Extract frames from videos import os.path as osp import os, pdb frame_path = '/media/hdd1/datasets/Adobe240-fps/test_high_fps_frames' vid_path = '/media/hdd1/datasets/Adobe240-fps/pred_high_fps_videos' if not osp.exists(vid_path): os.makedirs(vid_path) folder_list = os.listdir(frame_path) # folder_list = [x for x ...
[ 2, 29677, 13431, 422, 5861, 198, 11748, 28686, 13, 6978, 355, 267, 2777, 198, 11748, 28686, 11, 279, 9945, 198, 198, 14535, 62, 6978, 796, 31051, 11431, 14, 71, 1860, 16, 14, 19608, 292, 1039, 14, 2782, 5910, 16102, 12, 29647, 14, 9...
2.318182
330
#! /usr/bin/env python # -*- coding: utf-8 -*- """ DWF Python Example Modified by: MURAMATSU Atsushi <amura@tomato.sakura.ne.jp> Revised: 2016-04-21 Original Author: Digilent, Inc. Original Revision: 11/24/2014 Requires: Python 2.7, 3.3 or later """ import dwf impo...
[ 2, 0, 1220, 14629, 14, 8800, 14, 24330, 21015, 198, 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 37811, 198, 220, 220, 29652, 37, 11361, 17934, 628, 220, 220, 40499, 416, 25, 337, 4261, 2390, 1404, 12564, 317, 91...
2.268109
1,063
"""Database Query Builder """ __author__ = 'Oleksandr Shepetko' __email__ = 'a@shepetko.com' __license__ = 'MIT' # Public API from . import contract, drivers from ._api import *
[ 37811, 38105, 43301, 35869, 198, 37811, 198, 834, 9800, 834, 796, 705, 46, 293, 591, 46273, 1375, 6449, 7204, 6, 198, 834, 12888, 834, 796, 705, 64, 31, 7091, 6449, 7204, 13, 785, 6, 198, 834, 43085, 834, 796, 705, 36393, 6, 198, ...
2.934426
61
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from setuptools import setup from glob import glob from itertools import chain SCRIPTS = [ i for i in chain( glob("bin/*.py"), glob("bin/*.sh"), ) ] setup( name="freeplane_tools", install_requires=[ "beautifulsoup4 >= 4.8.2", ...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 6738, 900, 37623, 10141, 1330, 9058, 198, 6738, 15095, 1330, 15095, 198, 6738, 340, 861, 10141, 1330, 6333, 198, 19...
2.077778
180
import logging from bcex.core.symbol import Symbol from bcex.core.websocket_client import Environment, Channel from bcex.examples.trader import BaseTrader class HODLR(BaseTrader): """Trade which places a market order at regular intervals """ CHANNELS = [ Channel.HEARTBEAT, Channel.TRADIN...
[ 11748, 18931, 198, 198, 6738, 275, 344, 87, 13, 7295, 13, 1837, 23650, 1330, 38357, 198, 6738, 275, 344, 87, 13, 7295, 13, 732, 1443, 5459, 62, 16366, 1330, 9344, 11, 11102, 198, 6738, 275, 344, 87, 13, 1069, 12629, 13, 2213, 5067, ...
2.384328
268
# pylint: disable=missing-docstring from resolwe_bio.utils.test import BioProcessTestCase
[ 2, 279, 2645, 600, 25, 15560, 28, 45688, 12, 15390, 8841, 198, 6738, 581, 349, 732, 62, 65, 952, 13, 26791, 13, 9288, 1330, 16024, 18709, 14402, 20448, 628 ]
3.137931
29