content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
from collections import List | [
6738,
17268,
1330,
7343
] | 7 | 4 |
import numpy as np
# core functions
totalreturn = lambda x: (x[-1]/x[0])-1
finalreturn = lambda x: x[-1]
sharpe = lambda x: np.sqrt(12) * (np.mean(x) / np.std(x))
ann_vol = lambda x: np.sqrt(12) * np.std(x)
cagr = lambda x: ((((x[-1]) / x[0])) ** (12.0/(x.count()-1))) - 1
cagr2 = lambda x: ((np.mean(x)+1) ** 12) -1
... | [
11748,
299,
32152,
355,
45941,
198,
198,
2,
4755,
5499,
198,
23350,
7783,
796,
37456,
2124,
25,
357,
87,
58,
12,
16,
60,
14,
87,
58,
15,
12962,
12,
16,
198,
20311,
7783,
796,
37456,
2124,
25,
2124,
58,
12,
16,
60,
198,
1477,
283... | 2.037975 | 158 |
import sys # NOTE: for exiting
import requests
import datetime
import pprint
import ujson as json # NOTE: faster json
API_KEY = '' # TODO: input api key here!!!
if not API_KEY:
sys.exit('Please insert your Decisive API key')
print
print 'Creating session to always add API key...'
# NOTE: you can also use decisi... | [
11748,
25064,
1303,
24550,
25,
329,
33895,
198,
198,
11748,
7007,
198,
11748,
4818,
8079,
198,
11748,
279,
4798,
198,
11748,
334,
17752,
355,
33918,
1303,
24550,
25,
5443,
33918,
198,
198,
17614,
62,
20373,
796,
10148,
1303,
16926,
46,
... | 2.526214 | 515 |
commands = CommandsRegistry()
| [
198,
198,
9503,
1746,
796,
49505,
8081,
4592,
3419,
198
] | 3.2 | 10 |
from typing import Tuple, List
import numpy as np
import tensorflow as tf
from webdnn.frontend.tensorflow.converter import TensorFlowConverter
from webdnn.frontend.tensorflow.util import unary_op_handler, check_data_format, convert_odd_padding_to_concat, parse_padding
from webdnn.graph.axis import Axis
from webdnn.gr... | [
6738,
19720,
1330,
309,
29291,
11,
7343,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
198,
6738,
3992,
67,
20471,
13,
8534,
437,
13,
83,
22854,
11125,
13,
1102,
332,
353,
1330,
309,
22854,
3... | 2.960519 | 1,697 |
from numbers import Number
one = One()
zero = 0
| [
6738,
3146,
1330,
7913,
198,
198,
505,
796,
1881,
3419,
198,
22570,
796,
657,
198
] | 3.266667 | 15 |
from creevey.ops.image import centercrop
import numpy as np
from PIL import Image
import torch.nn as nn
def center_crop_pil_image(img):
"""
Helper function to crop the center out of images.
Utilizes the centercrop function from `creevey`
Parameters
----------
img: array
PIL image arr... | [
6738,
269,
631,
3304,
13,
2840,
13,
9060,
1330,
1247,
2798,
1773,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
350,
4146,
1330,
7412,
198,
11748,
28034,
13,
20471,
355,
299,
77,
628,
198,
4299,
3641,
62,
31476,
62,
79,
346,
62,
90... | 2.985965 | 285 |
"""
Class to help create and manage data schema and to validate json files.
"""
from jsonschema import Draft7Validator
from copy import deepcopy
from genson import SchemaBuilder
from .dictSchema import DictSchema
from cornflow_client.core.tools import load_json, save_json
class SchemaManager:
"""
A schema ma... | [
37811,
198,
9487,
284,
1037,
2251,
290,
6687,
1366,
32815,
290,
284,
26571,
33918,
3696,
13,
198,
37811,
198,
198,
6738,
44804,
684,
2395,
2611,
1330,
13650,
22,
47139,
1352,
198,
6738,
4866,
1330,
2769,
30073,
198,
6738,
308,
19069,
13... | 2.247398 | 2,979 |
from src import log
from src.summary.base import BaseSummary
if __name__ == "__main__":
import json
with open('json/C_TemplateMatchingSummary.json') as f:
_dict = json.load(f)
dicts = _dict['metadata'][0]['value']
summary = TriggerSummary()
should_be_reset = summary.should_be_reset(dicts... | [
6738,
12351,
1330,
2604,
198,
6738,
12351,
13,
49736,
13,
8692,
1330,
7308,
22093,
628,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
1330,
33918,
198,
220,
220,
220,
351,
1280,
10786,
17752,
1... | 2.549587 | 242 |
#LICENCE : http://www.apache.org/licenses/LICENSE-2.0
#CREATOR BY : PRANKBOT
#MOD BY ACIL
__all__ = ['fastbinary', 'TBase', 'TBinaryProtocol', 'TCompactProtocol', 'TJSONProtocol', 'TProtocol']
| [
2,
43,
2149,
18310,
1058,
220,
220,
2638,
1378,
2503,
13,
43073,
13,
2398,
14,
677,
4541,
14,
43,
2149,
24290,
12,
17,
13,
15,
198,
2,
43387,
25633,
11050,
1058,
4810,
15154,
33,
2394,
198,
2,
33365,
11050,
7125,
4146,
198,
834,
4... | 2.468354 | 79 |
#!/usr/bin/env python
# md5: a2cb6a826f222fa843ab488ae8a2de22
# coding: utf-8
import json
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
45243,
20,
25,
257,
17,
21101,
21,
64,
23,
2075,
69,
23148,
13331,
23,
3559,
397,
33646,
3609,
23,
64,
17,
2934,
1828,
198,
2,
19617,
25,
3384,
69,
12,
23,
198,
198,
11748,
33... | 2 | 46 |
import turtle
from turtle import Turtle, Screen
a = turtle.Turtle()
screen = Screen()
a.shape('turtle')
print('Welcome to sketch n draw')
print('select your color 1 and 2')
color_1 = (input('color 1: '))
color_2 = (input('color 2: '))
print('ok! your colors are ' + color_1 + (' and ') + color_2)
print("change... | [
11748,
28699,
201,
198,
6738,
28699,
1330,
33137,
11,
15216,
201,
198,
64,
796,
28699,
13,
51,
17964,
3419,
201,
198,
9612,
796,
15216,
3419,
201,
198,
64,
13,
43358,
10786,
83,
17964,
11537,
201,
198,
4798,
10786,
14618,
284,
17548,
... | 2.144481 | 616 |
import torch.distributed as dist
from torch.utils.data import DataLoader
from .data.transforms import make_albumentations
from .factory import make_model
from .hooks import DistSamplerSeedHook, IterTimerHook, LogBufferHook
| [
11748,
28034,
13,
17080,
6169,
355,
1233,
198,
6738,
28034,
13,
26791,
13,
7890,
1330,
6060,
17401,
198,
198,
6738,
764,
7890,
13,
7645,
23914,
1330,
787,
62,
282,
65,
1713,
602,
198,
6738,
764,
69,
9548,
1330,
787,
62,
19849,
198,
... | 3.461538 | 65 |
import pytest
import pybackend.urilib as U
| [
11748,
12972,
9288,
198,
198,
11748,
12972,
1891,
437,
13,
333,
22282,
355,
471,
628,
628
] | 2.9375 | 16 |
#! /usr/bin/env python
# coding=utf-8
"""
Example from the paper Rüde/Waluga/Wohlmuth 2013
"""
__author__ = "Christian Waluga (waluga@ma.tum.de)"
__copyright__ = "Copyright (c) 2013 %s" % __author__
from dolfin import *
from energy_correction.correction import *
from energy_correction.meshtools import *
from energy... | [
2,
0,
1220,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
19617,
28,
40477,
12,
23,
198,
198,
37811,
198,
16281,
422,
262,
3348,
371,
9116,
2934,
14,
21902,
30302,
14,
54,
48988,
76,
1071,
2211,
198,
37811,
198,
198,
834,
9800,
834,
... | 2.629458 | 1,514 |
from utils import CanadianScraper, CanadianPerson as Person
import re
COUNCIL_PAGE = 'http://www.wellesley.ca/council/councillors/?q=council/councillors'
| [
6738,
3384,
4487,
1330,
5398,
3351,
38545,
11,
5398,
15439,
355,
7755,
198,
11748,
302,
198,
198,
34,
2606,
7792,
4146,
62,
4537,
8264,
796,
705,
4023,
1378,
2503,
13,
4053,
49048,
13,
6888,
14,
66,
977,
2856,
14,
66,
977,
20346,
66... | 2.754386 | 57 |
"""
ParallelCluster
ParallelCluster API # noqa: E501
The version of the OpenAPI document: 3.0.0
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import pcluster.client
from pcluster.client.model.change import Change
from pcluster.client.model.config_validation_message im... | [
37811,
198,
220,
220,
220,
42945,
2601,
5819,
628,
220,
220,
220,
42945,
2601,
5819,
7824,
220,
1303,
645,
20402,
25,
412,
33548,
628,
220,
220,
220,
383,
2196,
286,
262,
4946,
17614,
3188,
25,
513,
13,
15,
13,
15,
198,
220,
220,
... | 3.384615 | 351 |
# -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2018, 2019, 2020.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
770,
2438,
318,
636,
286,
1195,
1984,
270,
13,
198,
2,
198,
2,
357,
34,
8,
15069,
19764,
2864,
11,
13130,
11,
12131,
13,
198,
2,
198,
2,
770,
2438,
318,
... | 2.34331 | 1,136 |
from RPLCD import CharLCD
import RPi.GPIO as GPIO
lcd = CharLCD(numbering_mode=GPIO.BOARD, cols=16, rows=2, pin_rs=37, pin_e=35, pins_data=[33, 31, 29, 23])
lcd.write_string(u'Hello World')
| [
6738,
25812,
5639,
35,
1330,
3178,
5639,
35,
198,
11748,
25812,
72,
13,
16960,
9399,
355,
50143,
198,
75,
10210,
796,
3178,
5639,
35,
7,
17618,
278,
62,
14171,
28,
16960,
9399,
13,
8202,
9795,
11,
951,
82,
28,
1433,
11,
15274,
28,
... | 2.289157 | 83 |
"""Tests for the IPTT Report Data Indicators (TP/TVA) to ensure their query counts stay O(n) and not O(n^2)
- api_report_data takes program_pk and frequency, calls IPTT<TVA/TP>ReportIndicatorSerializer.load_report
- IPTT<TVA/TP>ReportIndicatorSerializer.load_report takes program_pk and frequency
- quer... | [
37811,
51,
3558,
329,
262,
6101,
15751,
6358,
6060,
1423,
44549,
357,
7250,
14,
6849,
32,
8,
284,
4155,
511,
12405,
9853,
2652,
440,
7,
77,
8,
290,
407,
440,
7,
77,
61,
17,
8,
628,
220,
220,
220,
532,
40391,
62,
13116,
62,
7890,... | 2.833002 | 503 |
from django.db import models
from django.db.models.signals import post_save
from django.contrib.auth.models import User
from django.core.validators import MaxValueValidator
from imagekit.models import ProcessedImageField
from imagekit.processors import ResizeToFill
from home.models import ModelAbstract, Song
class ... | [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
42625,
14208,
13,
9945,
13,
27530,
13,
12683,
874,
1330,
1281,
62,
21928,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
27530,
1330,
11787,
198,
6738,
42625,
14208,
13,
7295,... | 2.669014 | 1,278 |
from motor.motor_asyncio import AsyncIOMotorClient
db = Database() | [
6738,
5584,
13,
76,
20965,
62,
292,
13361,
952,
1330,
1081,
13361,
40,
2662,
20965,
11792,
198,
198,
9945,
796,
24047,
3419
] | 3.045455 | 22 |
from shrinky.glsl_block import GlslBlock
from shrinky.glsl_block import extract_tokens
from shrinky.glsl_block_member import glsl_parse_member_list
########################################
# GlslBlockStruct ######################
########################################
class GlslBlockStruct(GlslBlock):
"""Struc... | [
6738,
22085,
88,
13,
4743,
6649,
62,
9967,
1330,
2671,
6649,
12235,
198,
6738,
22085,
88,
13,
4743,
6649,
62,
9967,
1330,
7925,
62,
83,
482,
641,
198,
6738,
22085,
88,
13,
4743,
6649,
62,
9967,
62,
19522,
1330,
1278,
6649,
62,
29572... | 2.471162 | 1,127 |
import pandas as pd
import numpy as np
from typing import List
user_ID = 78
query = 'userID == ' + str(user_ID)
# head = my_join()
head = ['Action', 'Adventure', 'Animation', 'Children', 'Comedy', 'Crime', 'Documentary', 'Drama', 'Fantasy', 'Film-Noir', 'Horror', 'IMAX', 'Musical', 'Mystery', 'Romance', 'Sci-Fi', 'Sh... | [
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
19720,
1330,
7343,
628,
198,
7220,
62,
2389,
796,
8699,
198,
22766,
796,
705,
7220,
2389,
6624,
705,
1343,
965,
7,
7220,
62,
2389,
8,
198,
2,
1182,
796,... | 2.647303 | 241 |
from machine import Pin, RTC
from time import sleep, sleep_ms, sleep_us
from json import load as jload
from ntptime import settime
ADDR_DELAY_US = 100
GOTO_DELAY_MS = 20
HOUR_LUT = jload(open("hour_lut.json"))
MINUTE_LUT = jload(open("minute_lut.json"))
TIME_ZONE = +2
encoder_pins = [Pin(i, Pin.IN, Pin.PULL_UP) for i... | [
6738,
4572,
1330,
13727,
11,
371,
4825,
198,
6738,
640,
1330,
3993,
11,
3993,
62,
907,
11,
3993,
62,
385,
198,
6738,
33918,
1330,
3440,
355,
474,
2220,
198,
6738,
299,
83,
457,
524,
1330,
900,
2435,
198,
198,
2885,
7707,
62,
35,
3... | 2.216535 | 254 |
import pytest
import retro.data
inttypes = {
'exp': retro.data.Integrations.EXPERIMENTAL_ONLY,
'contrib': retro.data.Integrations.CONTRIB_ONLY,
}
| [
11748,
12972,
9288,
198,
11748,
12175,
13,
7890,
198,
198,
600,
19199,
796,
1391,
198,
220,
220,
220,
705,
11201,
10354,
12175,
13,
7890,
13,
34500,
9143,
13,
6369,
18973,
3955,
3525,
1847,
62,
1340,
11319,
11,
198,
220,
220,
220,
705... | 2.516129 | 62 |
#!/usr/bin/env python
from binance.futures import Futures as Client
import logging
from binance.lib.utils import config_logging
config_logging(logging, logging.DEBUG)
futures_client = Client()
logging.info(futures_client.funding_rate("BTCUSDT",**{'limit':100}))
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
6738,
9874,
590,
13,
69,
315,
942,
1330,
24002,
942,
355,
20985,
198,
11748,
18931,
198,
6738,
9874,
590,
13,
8019,
13,
26791,
1330,
4566,
62,
6404,
2667,
198,
198,
11250,
62,
6404,
... | 2.923077 | 91 |
# Copyright 2019 PerfKitBenchmarker Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | [
2,
15069,
13130,
2448,
69,
20827,
44199,
4102,
263,
46665,
13,
1439,
2489,
10395,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
... | 2.854902 | 2,550 |
from __future__ import absolute_import
from .tfidf import TFIDF
from .textrank import TextRank
try:
from .analyzer import ChineseAnalyzer
except ImportError:
pass
default_tfidf = TFIDF()
default_textrank = TextRank()
extract_tags = tfidf = default_tfidf.extract_tags
set_idf_path = default_tfidf.se... | [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
201,
198,
6738,
764,
27110,
312,
69,
1330,
24958,
2389,
37,
201,
198,
6738,
764,
5239,
43027,
1330,
8255,
27520,
201,
198,
28311,
25,
201,
198,
220,
220,
220,
422,
764,
38200,
9107,
1330... | 2.652482 | 141 |
__doc__ = """ Factory function to allocate variables for Cosserat Rod"""
__all__ = ["allocate"]
import typing
from typing import Optional, Tuple
import warnings
import logging
import numpy as np
from numpy.testing import assert_allclose
from elastica.utils import MaxDimension, Tolerance
from elastica._linalg import _ba... | [
834,
15390,
834,
796,
37227,
19239,
2163,
284,
31935,
9633,
329,
327,
793,
263,
265,
6882,
37811,
198,
834,
439,
834,
796,
14631,
439,
13369,
8973,
198,
11748,
19720,
198,
6738,
19720,
1330,
32233,
11,
309,
29291,
198,
11748,
14601,
198... | 2.463753 | 938 |
from env_wrapper import wzq_env
from policy.rand_policy import rand_agent
from policy.algo.ppo import PPO
from policy.net.net_v0 import policy_net
from policy.net.net_v0 import value_net
from policy.rl_policy import ppo_agent
import time
import numpy as np
agent0 = ppo_agent(size=15)
agent1 = rand_agent(size=15)
env =... | [
6738,
17365,
62,
48553,
1330,
266,
89,
80,
62,
24330,
198,
6738,
2450,
13,
25192,
62,
30586,
1330,
43720,
62,
25781,
198,
6738,
2450,
13,
282,
2188,
13,
16634,
1330,
350,
16402,
198,
6738,
2450,
13,
3262,
13,
3262,
62,
85,
15,
1330,... | 2.80315 | 127 |
from dataclasses import dataclass, field
from typing import Optional
from bindings.gmd.abstract_object_type import AbstractObjectType
from bindings.gmd.binary_property_type import BinaryPropertyType
from bindings.gmd.character_string_property_type import CharacterStringPropertyType
from bindings.gmd.ci_citation_type im... | [
6738,
4818,
330,
28958,
1330,
4818,
330,
31172,
11,
2214,
198,
6738,
19720,
1330,
32233,
198,
6738,
34111,
13,
70,
9132,
13,
397,
8709,
62,
15252,
62,
4906,
1330,
27741,
10267,
6030,
198,
6738,
34111,
13,
70,
9132,
13,
39491,
62,
2674... | 2.253953 | 1,075 |
import pickle
import matplotlib.pyplot as plt
import matplotlib.patches
import matplotlib as mpl
import numpy as np
import sys, argparse
sys.path.append("../")
import Plotting
Names = {
'mini_gb2': 'VC-GB2',
'mini_gb5': 'VC-GB5',
'mini_lin': 'VC-Lin',
'epsall_gb2': '$\epsilon$-GB2',
'epsall_gb5'... | [
11748,
2298,
293,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
2603,
29487,
8019,
13,
8071,
2052,
198,
11748,
2603,
29487,
8019,
355,
285,
489,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
25064,
11,
1822... | 1.948012 | 2,943 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Written by Lucas Sinclair.
MIT Licensed.
Contact at www.sinclair.bio
"""
# Built-in modules #
import os
# First party modules #
from fasta import FASTQ
from plumbing.check_cmd_found import check_cmd
from plumbing.cache import property_cached
from autopaths... | [
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,
37811,
198,
25354,
416,
15257,
34927,
13,
198,
36393,
49962,
13,
198,
17829,
379,
7324,
13,
31369,
27659,
13,
... | 2.778675 | 619 |
'''
Read and write Olympia state files.
'''
import os
import os.path
import sys
from contextlib import redirect_stdout
from .oid import to_oid
from .formatters import print_one_thing, read_oly_file
def fixup_ms(data):
'''
For whatever reason, the value in IM/ms needs to have a trailing space
'''
for... | [
7061,
6,
198,
5569,
290,
3551,
45760,
1181,
3696,
13,
198,
7061,
6,
198,
198,
11748,
28686,
198,
11748,
28686,
13,
6978,
198,
11748,
25064,
198,
6738,
4732,
8019,
1330,
18941,
62,
19282,
448,
198,
198,
6738,
764,
1868,
1330,
284,
62,
... | 2.196875 | 640 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
4981,
11,
15720,
602,
628
] | 2.891892 | 37 |
from L1TriggerConfig.CSCTFConfigProducers.CSCTFConfigOnline_cfi import *
#from L1TriggerConfig.CSCTFConfigProducers.CSCTFAlignmentOnline_cfi import *
from L1TriggerConfig.CSCTFConfigProducers.L1MuCSCPtLutConfigOnline_cfi import *
from L1TriggerConfig.DTTrackFinder.L1MuDTEtaPatternLutOnline_cfi import *
from L1TriggerC... | [
6738,
406,
16,
48344,
16934,
13,
7902,
4177,
37,
16934,
11547,
7999,
13,
7902,
4177,
37,
16934,
14439,
62,
66,
12463,
1330,
1635,
198,
2,
6738,
406,
16,
48344,
16934,
13,
7902,
4177,
37,
16934,
11547,
7999,
13,
7902,
4177,
37,
2348,
... | 2.841463 | 738 |
from .base import db
| [
6738,
764,
8692,
1330,
20613,
628
] | 3.666667 | 6 |
import pulsar as psr
| [
11748,
22271,
283,
355,
26692,
81,
198
] | 3 | 7 |
# -*- coding: utf-8 -*-
"""
This package includes the Flask blueprint and all related functionality for displaying system
information.
"""
from .blueprint import blueprint
from .status_item import StatusItem
from .status_group import StatusGroup
import orchard.system_status.views # NOQA
__all__ = ['bluepri... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
37811,
198,
220,
220,
220,
770,
5301,
3407,
262,
46947,
30881,
290,
477,
3519,
11244,
329,
19407,
1080,
198,
220,
220,
220,
1321,
13,
198,
37811,
198,
198,
6738,
... | 3.470588 | 102 |
# embedded validation code, run from C
# input vars: PRODUCT, QUANTITY, BUYER
# output vars: ERRORS, WARNINGS
import string # all python tools are available to embedded code
import inventory # plus C extensions, Python modules, classes,..
msgs, errs = [], [] # warning, error messag... | [
2,
14553,
21201,
2438,
11,
1057,
422,
327,
201,
198,
2,
5128,
410,
945,
25,
220,
41458,
11,
19604,
8643,
9050,
11,
20571,
56,
1137,
201,
198,
2,
5072,
410,
945,
25,
33854,
50,
11,
39410,
50,
201,
198,
201,
198,
11748,
4731,
220,
... | 2.484058 | 345 |
from typing import Any, Dict, Iterable, List, Text
from ..common import FeatureSet
class SessionFeatureSet(FeatureSet):
"""
This class represents a session's set of features.
"""
def __init__(self, features: Dict[Text, Any], aura_id_name="AURA_ID", aura_id_global_name="AURA_ID_GLOBAL",
... | [
6738,
19720,
1330,
4377,
11,
360,
713,
11,
40806,
540,
11,
7343,
11,
8255,
198,
198,
6738,
11485,
11321,
1330,
27018,
7248,
628,
198,
4871,
23575,
38816,
7248,
7,
38816,
7248,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
770,
... | 2.46736 | 1,057 |
# -*- coding: utf-8 -*-
# This file is part of bw.
# Distributed under the terms of the last AGPL License.
__author__ = 'Jean Chassoul'
import arrow
import ujson as json
import logging
import uuid
from tornado import gen
def validate_uuid4(uuid_string):
'''
Validate that a UUID string is in
... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
770,
2393,
318,
636,
286,
275,
86,
13,
198,
198,
2,
4307,
6169,
739,
262,
2846,
286,
262,
938,
13077,
6489,
13789,
13,
628,
198,
834,
9800,
834,
796,
705,
... | 2.318498 | 1,438 |
from pyox.client import Client, ServiceError
| [
198,
6738,
12972,
1140,
13,
16366,
1330,
20985,
11,
4809,
12331,
198
] | 3.833333 | 12 |
from os import system
# 重启电脑
| [
6738,
28686,
1330,
1080,
628,
198,
2,
16268,
229,
235,
28938,
107,
18796,
113,
164,
226,
239,
628
] | 1.777778 | 18 |
from flask import Flask, request, render_template, jsonify, make_response, redirect, flash, url_for
from functools import wraps
import re
import pyctrl
from pyctrl.block import Logger
import warnings
import importlib
import traceback, sys, io
from pyctrl.flask import JSONEncoder, JSONDecoder
encoder = JSONEncoder(so... | [
6738,
42903,
1330,
46947,
11,
2581,
11,
8543,
62,
28243,
11,
33918,
1958,
11,
787,
62,
26209,
11,
18941,
11,
7644,
11,
19016,
62,
1640,
198,
6738,
1257,
310,
10141,
1330,
27521,
198,
11748,
302,
198,
198,
11748,
12972,
44755,
198,
673... | 2.30625 | 480 |
from django.db.models import Q
from rest_framework.filters import SearchFilter, OrderingFilter
from rest_framework.generics import ListAPIView, CreateAPIView, RetrieveAPIView, RetrieveUpdateAPIView, DestroyAPIView
from rest_framework.permissions import IsAuthenticated, IsAuthenticatedOrReadOnly
from posts.models impor... | [
6738,
42625,
14208,
13,
9945,
13,
27530,
1330,
1195,
198,
6738,
1334,
62,
30604,
13,
10379,
1010,
1330,
11140,
22417,
11,
8284,
278,
22417,
198,
6738,
1334,
62,
30604,
13,
8612,
873,
1330,
7343,
2969,
3824,
769,
11,
13610,
2969,
3824,
... | 3.849624 | 133 |
# by ARTRoyale (A. Lebedev) for ZapRoyale
import socket
import threading
import struct
import os
import uuid
import random
# начинаем дебаг
global debugmode
debugmode = True
global gl_server_address
gl_server_address = ('***.***.*.**', 9339)
if __name__ == "__main__":
port_num = 9339
print('[IN... | [
2,
416,
5923,
5446,
726,
1000,
357,
32,
13,
1004,
3077,
1990,
8,
329,
36079,
32027,
1000,
198,
198,
11748,
17802,
198,
11748,
4704,
278,
198,
11748,
2878,
198,
11748,
28686,
198,
11748,
334,
27112,
198,
11748,
4738,
198,
198,
2,
12466... | 2.320225 | 178 |
from pydantic import BaseModel
# class MetricsOutput(BaseModel):
# name: str
# metrics: dict
| [
6738,
279,
5173,
5109,
1330,
7308,
17633,
628,
198,
198,
2,
1398,
3395,
10466,
26410,
7,
14881,
17633,
2599,
198,
2,
220,
220,
220,
220,
1438,
25,
965,
198,
2,
220,
220,
220,
220,
20731,
25,
8633,
628
] | 2.763158 | 38 |
from quart import request, jsonify
import time
from api.models import User
from .. import bp
import utils
request: utils.Request
@bp.route("/<int:user_id>/roles", methods=["GET"])
@utils.auth_required
async def fetch_user_roles(user_id: int):
"""Fetch the specific users roles"""
query = """
SELECT j... | [
6738,
28176,
1330,
2581,
11,
33918,
1958,
198,
11748,
640,
198,
198,
6738,
40391,
13,
27530,
1330,
11787,
198,
6738,
11485,
1330,
275,
79,
198,
11748,
3384,
4487,
198,
198,
25927,
25,
3384,
4487,
13,
18453,
628,
198,
31,
46583,
13,
38... | 2.290123 | 324 |
import os
import torch
import argparse
import numpy as np
import matplotlib.pylab as plt
from text import text_to_sequence
from model.model import Tacotron2
from hparams import hparams as hps
from utils.util import mode, to_var, to_arr
from utils.audio import load_wav, save_wav, melspectrogram
if __name__ == '__m... | [
11748,
28686,
198,
11748,
28034,
198,
11748,
1822,
29572,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
13,
79,
2645,
397,
355,
458,
83,
198,
6738,
2420,
1330,
2420,
62,
1462,
62,
43167,
198,
6738,
2746,
13,
19849,
... | 2.315789 | 437 |
from typing import Union, Tuple
import pandas as pd
from sklearn.utils import shuffle
from doors_detector.dataset.torch_dataset import TRAIN_SET, TEST_SET, SET
from generic_dataset.dataset_manager import DatasetManager
from doors_detector.dataset.dataset_doors_final.door_sample import DoorSample, DOOR_LABELS
from skl... | [
6738,
19720,
1330,
4479,
11,
309,
29291,
198,
198,
11748,
19798,
292,
355,
279,
67,
198,
6738,
1341,
35720,
13,
26791,
1330,
36273,
198,
198,
6738,
8215,
62,
15255,
9250,
13,
19608,
292,
316,
13,
13165,
354,
62,
19608,
292,
316,
1330,... | 3.06 | 150 |
from collections import defaultdict
from bisect import bisect
# Your TimeMap object will be instantiated and called as such:
# obj = TimeMap()
# obj.set(key,value,timestamp)
# param_2 = obj.get(key,timestamp)
| [
6738,
17268,
1330,
4277,
11600,
198,
6738,
47457,
478,
1330,
47457,
478,
628,
198,
198,
2,
3406,
3862,
13912,
2134,
481,
307,
9113,
12931,
290,
1444,
355,
884,
25,
198,
2,
26181,
796,
3862,
13912,
3419,
198,
2,
26181,
13,
2617,
7,
2... | 3.261538 | 65 |
import fileinput
import sys
import math
import time
import os
import click
# prevent pygame from printing their welcome message
os.environ['PYGAME_HIDE_SUPPORT_PROMPT'] = "hide"
import pygame
# Define some basic colors for easy use
white = (255, 255, 255)
red = (255, 0, 0)
black = (0, 0, 0)
green = (0, 255, 0)
blue =... | [
11748,
2393,
15414,
198,
11748,
25064,
198,
11748,
10688,
198,
11748,
640,
198,
11748,
28686,
198,
11748,
3904,
198,
198,
2,
2948,
12972,
6057,
422,
13570,
511,
7062,
3275,
198,
418,
13,
268,
2268,
17816,
47,
56,
47109,
62,
39,
14114,
... | 2.775658 | 1,101 |
# Copyright (c) "Neo4j"
# Neo4j Sweden AB [http://neo4j.com]
#
# This file is part of Neo4j.
#
# 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... | [
2,
15069,
357,
66,
8,
366,
8199,
78,
19,
73,
1,
198,
2,
21227,
19,
73,
10710,
9564,
685,
4023,
1378,
710,
78,
19,
73,
13,
785,
60,
198,
2,
198,
2,
770,
2393,
318,
636,
286,
21227,
19,
73,
13,
198,
2,
198,
2,
49962,
739,
26... | 2.41644 | 7,725 |
#!/usr/bin/env python3
"""
process data generated by PageBuilder
"""
import json
INFN = "document.json"
OUTFN = "_DATA.json"
print ("PROCESSING ===========================================================")
########################################################################
## READING THE INPUT FILE
print ("... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
37811,
198,
14681,
1366,
7560,
416,
7873,
32875,
198,
37811,
198,
198,
11748,
33918,
198,
198,
1268,
43221,
220,
796,
366,
22897,
13,
17752,
1,
198,
2606,
10234,
45,
796,
45434,
26... | 3.134357 | 521 |
from cyder.api.v1.endpoints.dhcp.vrf import api
| [
6738,
3075,
1082,
13,
15042,
13,
85,
16,
13,
437,
13033,
13,
34985,
13155,
13,
37020,
69,
1330,
40391,
198
] | 2.4 | 20 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
628
] | 2.043478 | 23 |
import os
from sys import intern
from typing import Iterable, FrozenSet, Optional
from pyramids.categorization import Category
from pyramids.rules.leaf import LeafRule
from pyramids.word_sets import WordSetUtils
| [
11748,
28686,
198,
6738,
25064,
1330,
1788,
198,
6738,
19720,
1330,
40806,
540,
11,
23673,
7248,
11,
32233,
198,
198,
6738,
12972,
43591,
13,
66,
47467,
1634,
1330,
21743,
198,
6738,
12972,
43591,
13,
38785,
13,
33201,
1330,
14697,
31929,... | 3.962963 | 54 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 Nicira Networks, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apac... | [
2,
43907,
25,
7400,
11338,
28,
19,
6482,
10394,
28,
19,
2705,
8658,
11338,
28,
19,
198,
198,
2,
15069,
2813,
8377,
8704,
27862,
11,
3457,
13,
198,
2,
1439,
6923,
33876,
13,
198,
2,
198,
2,
220,
220,
220,
49962,
739,
262,
24843,
... | 2.448117 | 2,390 |
import unittest
from test import support
support.import_module('_testcapi')
from _testcapi import _test_structmembersType, CHAR_MAX, CHAR_MIN, UCHAR_MAX, SHRT_MAX, SHRT_MIN, USHRT_MAX, INT_MAX, INT_MIN, UINT_MAX, LONG_MAX, LONG_MIN, ULONG_MAX, LLONG_MAX, LLONG_MIN, ULLONG_MAX, PY_SSIZE_T_MAX, PY_SSIZE_T_MIN
ts = _test_... | [
11748,
555,
715,
395,
198,
6738,
1332,
1330,
1104,
198,
11284,
13,
11748,
62,
21412,
10786,
62,
9288,
11128,
72,
11537,
198,
6738,
4808,
9288,
11128,
72,
1330,
4808,
9288,
62,
7249,
30814,
6030,
11,
28521,
62,
22921,
11,
28521,
62,
23... | 2.301508 | 199 |
#!/usr/bin/env python3
import argparse
import copy
import logging
import sys
import warnings
import numpy as np
import rasterio as rio
import torch
import torch.hub
import tqdm
from rasterio.windows import Window
BACKBONES = [
'vgg16', 'densenet161', 'shufflenet_v2_x1_0', 'mobilenet_v2',
'mobilenet_v3_large'... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
11748,
1822,
29572,
198,
11748,
4866,
198,
11748,
18931,
198,
11748,
25064,
198,
11748,
14601,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
374,
1603,
952,
355,
374,
952... | 1.878181 | 2,397 |
# -*- coding: utf-8 -*-
from django.conf import settings
# How often to check
TZ_DETECT_PERIOD = getattr(settings, 'TZ_DETECT_PERIOD', 3*3600)
# Version of moment and moment-timezone to load
TZ_DETECT_SCRIPTS = getattr(settings, 'TZ_DETECT_SCRIPTS', [
'<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
198,
2,
1374,
1690,
284,
2198,
198,
51,
57,
62,
35,
2767,
9782,
62,
18973,
40,
3727,
796,
651,
35226,
7,
33692,
... | 2.23 | 300 |
import random
from cs.structures import Edge, Graph, Node, V
def kargers_min_cut(orig_graph: Graph[V]) -> set[Edge[V]]:
"""
Partitions a graph using Karger's Algorithm. Works on directed and undirected
graphs, but involves random choices, so it does not give consistent outputs.
Args:
graph: A... | [
11748,
4738,
198,
198,
6738,
50115,
13,
7249,
942,
1330,
13113,
11,
29681,
11,
19081,
11,
569,
628,
198,
4299,
479,
853,
364,
62,
1084,
62,
8968,
7,
11612,
62,
34960,
25,
29681,
58,
53,
12962,
4613,
900,
58,
37021,
58,
53,
60,
597... | 2.269345 | 672 |
#!/bin/python3
import os
# Complete the findDigits function below.
if __name__ == '__main__':
fptr = open(os.environ['OUTPUT_PATH'], 'w')
t = int(input())
for t_itr in range(t):
n = int(input())
result = findDigits(n)
fptr.write(str(result) + '\n')
fptr.close()
| [
2,
48443,
8800,
14,
29412,
18,
198,
198,
11748,
28686,
198,
198,
2,
13248,
262,
1064,
19511,
896,
2163,
2174,
13,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
277,
20692,
796,
1280,
7,... | 2.166667 | 144 |
from django.urls import path
from dfirtrack_artifacts.creator import artifact_creator
from dfirtrack_artifacts.exporter.spreadsheet import xls
from dfirtrack_artifacts.views import (
artifact_view,
artifactpriority_view,
artifactstatus_view,
artifacttype_view,
)
urlpatterns = (
# urls for Artifact... | [
6738,
42625,
14208,
13,
6371,
82,
1330,
3108,
198,
198,
6738,
47764,
343,
11659,
62,
50179,
13,
45382,
1330,
24127,
62,
45382,
198,
6738,
47764,
343,
11659,
62,
50179,
13,
1069,
26634,
13,
43639,
21760,
1330,
2124,
7278,
198,
6738,
4776... | 2.211097 | 1,568 |
from mayan.apps.appearance.classes import Icon
icon_user_locale_profile_detail = Icon(
driver_name='fontawesome', symbol='globe'
)
icon_user_locale_profile_edit = Icon(
driver_name='fontawesome-dual', primary_symbol='globe',
secondary_symbol='pencil-alt'
)
| [
6738,
743,
272,
13,
18211,
13,
1324,
23435,
13,
37724,
1330,
26544,
198,
198,
4749,
62,
7220,
62,
17946,
1000,
62,
13317,
62,
49170,
796,
26544,
7,
198,
220,
220,
220,
4639,
62,
3672,
11639,
10331,
707,
5927,
3256,
6194,
11639,
4743,
... | 2.7 | 100 |
import os
import sys
import pdb
import re
from copy import deepcopy
from operator import itemgetter
import json
import pandas as pd
dir_path = os.path.dirname(os.path.realpath(__file__))
sys.path.insert(0, dir_path + '/../..')
from plastering.metadata_interface import *
from plastering.evaluator import *
target_buil... | [
11748,
28686,
198,
11748,
25064,
198,
11748,
279,
9945,
198,
11748,
302,
198,
6738,
4866,
1330,
2769,
30073,
198,
6738,
10088,
1330,
2378,
1136,
353,
198,
11748,
33918,
198,
198,
11748,
19798,
292,
355,
279,
67,
198,
198,
15908,
62,
697... | 2.213477 | 1,766 |
import pandas as pd
import warnings
from learntools.core import *
Label = MultipartProblem(LabelA, LabelB)
Cardinality = MultipartProblem(CardinalityA, CardinalityB)
qvars = bind_exercises(globals(), [
Drop,
Label,
Cardinality,
OneHot
],
var_format='step_{n}',
)
__all__ = list(qvars)
| [
11748,
19798,
292,
355,
279,
67,
198,
11748,
14601,
198,
198,
6738,
26338,
10141,
13,
7295,
1330,
1635,
198,
198,
33986,
796,
7854,
541,
433,
40781,
7,
33986,
32,
11,
36052,
33,
8,
198,
198,
16962,
1292,
414,
796,
7854,
541,
433,
40... | 2.484375 | 128 |
# _*_ coding: utf-8 _*_
# Copyright (c) Nikita Kovaliov, maizy.ru, 2013
# See LICENSE.txt for details.
from tornado.web import asynchronous
from vnc_me.controllers import HttpHandler
from vnc_me.vnc_client import VncClient
| [
2,
4808,
9,
62,
19617,
25,
3384,
69,
12,
23,
4808,
9,
62,
198,
2,
15069,
357,
66,
8,
11271,
5350,
43326,
7344,
709,
11,
17266,
528,
88,
13,
622,
11,
2211,
198,
2,
4091,
38559,
24290,
13,
14116,
329,
3307,
13,
198,
198,
6738,
3... | 2.825 | 80 |
import pyknotid.spacecurves.spacecurve as sp
import pyknotid.make as mk
from functools import wraps
import os
from os import path
import numpy as np
import pytest
@pass_trefoil
@pass_trefoil
@pass_trefoil
@pass_trefoil
@pass_trefoil
@pass_trefoil
@pass_trefoil
@pass_trefoil
@pass_trefoil
@pass_trefoil
... | [
198,
198,
11748,
12972,
74,
1662,
312,
13,
13200,
22019,
1158,
13,
13200,
22019,
303,
355,
599,
198,
11748,
12972,
74,
1662,
312,
13,
15883,
355,
33480,
198,
198,
6738,
1257,
310,
10141,
1330,
27521,
198,
11748,
28686,
198,
6738,
28686,... | 2.23913 | 184 |
#Author: Miguel Molero <miguel.molero@gmail.com>
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from pcloudpy.gui.graphics.QVTKWidget import QVTKWidget
if __name__ == "__main__":
from vtk import vtkConeSource
from vtk import vtkPolyDataMapper, vtkActor
app = QApplic... | [
2,
13838,
25,
29825,
17958,
3529,
1279,
76,
328,
2731,
13,
43132,
3529,
31,
14816,
13,
785,
29,
198,
6738,
9485,
48,
83,
20,
13,
48,
83,
14055,
1330,
220,
1635,
198,
6738,
9485,
48,
83,
20,
13,
48,
83,
8205,
72,
1330,
1635,
198,... | 2.45583 | 283 |
# Copyright (c) 2015 - 2021, Intel Corporation
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and... | [
2,
220,
15069,
357,
66,
8,
1853,
532,
33448,
11,
8180,
10501,
198,
2,
198,
2,
220,
2297,
396,
3890,
290,
779,
287,
2723,
290,
13934,
5107,
11,
351,
393,
1231,
198,
2,
220,
17613,
11,
389,
10431,
2810,
326,
262,
1708,
3403,
198,
... | 3.481443 | 970 |
import functools
import logging
from flask_restful import Resource
from flask import request
import json
| [
11748,
1257,
310,
10141,
198,
11748,
18931,
198,
6738,
42903,
62,
2118,
913,
1330,
20857,
198,
6738,
42903,
1330,
2581,
198,
11748,
33918,
628,
198
] | 4.28 | 25 |
from ._tabular import fetch_crime_data, fetch_traffic_data
from ._vector import (fetch_beach_access_data,
fetch_crime_shp_data,
fetch_family_resource_centers_data,
fetch_shipping_lanes_data) | [
6738,
47540,
8658,
934,
1330,
21207,
62,
28126,
62,
7890,
11,
21207,
62,
9535,
2108,
62,
7890,
198,
6738,
47540,
31364,
1330,
357,
69,
7569,
62,
1350,
620,
62,
15526,
62,
7890,
11,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
... | 1.962121 | 132 |
#!/usr/bin/python3
import cv2
import numpy as np
import os
import process_img
import pickle
from shutil import copyfile
# model = cv2.ml.KNearest_create()
# model.load('model.xml')
model = cv2.ml.KNearest_load('model.xml')
img_area = 40 * 40
# 将序列化的内容加载到内存中
f = open('id_label_map.txt', 'rb')
try:
id_label_map = ... | [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
11748,
269,
85,
17,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28686,
198,
11748,
1429,
62,
9600,
198,
11748,
2298,
293,
198,
6738,
4423,
346,
1330,
4866,
7753,
198,
198,
2,
2746,
... | 2.191201 | 591 |
#https://programmers.co.kr/learn/courses/30/lessons/12934 | [
2,
5450,
1378,
23065,
11056,
13,
1073,
13,
38584,
14,
35720,
14,
66,
39975,
14,
1270,
14,
1203,
684,
14,
18741,
2682
] | 2.590909 | 22 |
import csv
import logging
import neo4j
import os
import uuid
from concurrent.futures import ThreadPoolExecutor
from pyopenie import OpenIE5
from queue import Empty, Queue
from spacy.lang.en import English
from time import sleep
from typing import List
ENCODING = "utf-8"
DATA_DIRECTORY = "./data"
CACHE_DIRECTORY = "cac... | [
11748,
269,
21370,
198,
11748,
18931,
198,
11748,
19102,
19,
73,
198,
11748,
28686,
198,
11748,
334,
27112,
198,
6738,
24580,
13,
69,
315,
942,
1330,
14122,
27201,
23002,
38409,
198,
6738,
12972,
9654,
494,
1330,
4946,
10008,
20,
198,
6... | 2.8017 | 353 |
import pandas as pd
df = pd.read_excel('C:/Users/gkdud/PycharmProjects/TeamProject/Scraping/files/fashion_scraping.xlsx')
import sqlite3
connect = sqlite3.connect('./wadizdb.sqlite3')
df.to_sql('table_fashion', connect, if_exists='append', index=False)
connect.close() | [
11748,
19798,
292,
355,
279,
67,
198,
7568,
796,
279,
67,
13,
961,
62,
1069,
5276,
10786,
34,
14079,
14490,
14,
70,
74,
67,
463,
14,
20519,
354,
1670,
16775,
82,
14,
15592,
16775,
14,
3351,
2416,
278,
14,
16624,
14,
25265,
62,
141... | 2.523364 | 107 |
import os
from os.path import getatime, getctime, getmtime
import errno
from django.core.exceptions import ImproperlyConfigured
from . import compressors
__all__ = ["CompressMixin"]
DEFAULT_METHODS = ["gz", "br"]
METHOD_MAPPING = {
"gz": compressors.ZopfliCompressor,
"br": compressors.BrotliCompressor,
... | [
11748,
28686,
198,
6738,
28686,
13,
6978,
1330,
651,
265,
524,
11,
651,
310,
524,
11,
651,
76,
2435,
198,
11748,
11454,
3919,
198,
198,
6738,
42625,
14208,
13,
7295,
13,
1069,
11755,
1330,
12205,
525,
306,
16934,
1522,
198,
198,
6738,... | 2.840491 | 163 |
from ..models import RunwayPoint, Runway
| [
6738,
11485,
27530,
1330,
5660,
1014,
12727,
11,
5660,
1014,
628,
628,
628,
198
] | 3.357143 | 14 |
###########################
# Project Euler Problem 9
# Special Pythagorean triplet
#
# Code by Kevin Marciniak
###########################
total = 1000
product = 0
for c in range(1, 1000):
for b in range(1, c):
for a in range(1, b):
if (a + b + c) == 1000:
if ((a * a) + (b * b)) == (c * c):
product = ... | [
14468,
7804,
21017,
198,
2,
4935,
412,
18173,
20647,
860,
198,
2,
6093,
48657,
363,
29456,
15055,
83,
198,
2,
198,
2,
6127,
416,
7939,
13067,
5362,
461,
198,
14468,
7804,
21017,
198,
198,
23350,
796,
8576,
198,
11167,
796,
657,
198,
... | 2.601504 | 133 |
import logging
from six import int2byte
from binascii import unhexlify
from twisted.internet import defer
from .resolve import Resolver
from lbryschema.error import URIParseError
from lbryschema.uri import parse_lbry_uri
from torba.baseledger import BaseLedger
from .account import Account
from .network import Netwo... | [
11748,
18931,
198,
198,
6738,
2237,
1330,
493,
17,
26327,
198,
6738,
9874,
292,
979,
72,
1330,
555,
33095,
75,
1958,
198,
198,
6738,
19074,
13,
37675,
1330,
29135,
198,
198,
6738,
764,
411,
6442,
1330,
1874,
14375,
198,
6738,
18360,
5... | 3.61194 | 134 |
'''
Created on 01.05.2017
@author: mario
Emontranslator
Receive messages from serial/uart
Generate JSON Emon Input Messages
Insert via EMON API / APIKEY to emoncms on locahost (running on pi)
'''
import serial
import httplib
import time
domain = "localhost"
emoncmspath = "emoncms"
apikey = "2eba96e51f6b41534f52110... | [
7061,
6,
198,
41972,
319,
5534,
13,
2713,
13,
5539,
198,
198,
31,
9800,
25,
1667,
952,
198,
198,
36,
8691,
26084,
41880,
198,
198,
3041,
15164,
6218,
422,
11389,
14,
19986,
198,
8645,
378,
19449,
412,
2144,
23412,
43534,
198,
44402,
... | 2.185738 | 603 |
import logging
import asyncio
import binascii
import time
import struct
from ipaddress import ip_network, ip_address
import protocol
import const
PUFFIN_SUB = ["107.178.32.0/20", "45.33.128.0/20", "101.127.206.0/23",
"101.127.208.0/23"]
| [
11748,
18931,
198,
11748,
30351,
952,
198,
11748,
9874,
292,
979,
72,
198,
11748,
640,
198,
11748,
2878,
198,
6738,
20966,
21975,
1330,
20966,
62,
27349,
11,
20966,
62,
21975,
198,
11748,
8435,
198,
11748,
1500,
198,
198,
5105,
5777,
12... | 2.419048 | 105 |
from django.utils.translation import ugettext_lazy as _
from mapentity.filters import MapEntityFilterSet
from geotrek.core.filters import TopologyFilter
from .models import Trek, POI, Service
| [
6738,
42625,
14208,
13,
26791,
13,
41519,
1330,
334,
1136,
5239,
62,
75,
12582,
355,
4808,
198,
6738,
3975,
26858,
13,
10379,
1010,
1330,
9347,
32398,
22417,
7248,
198,
6738,
4903,
313,
37818,
13,
7295,
13,
10379,
1010,
1330,
5849,
1435... | 3.45614 | 57 |
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the... | [
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198,
2,
921,
743,
7330,
257,
4866,
286,
262,
13789,
379,
198,
2,... | 2.939148 | 1,479 |
import psutil
import pandas as pd
from datetime import datetime
from termcolor import colored
import GetInfo
import Notify
import time
import os
if __name__ == "__main__":
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("-c", "--columns", default="name,cpu_usage,memor... | [
11748,
26692,
22602,
201,
198,
11748,
19798,
292,
355,
279,
67,
201,
198,
6738,
4818,
8079,
1330,
4818,
8079,
201,
198,
6738,
3381,
8043,
1330,
16396,
201,
198,
11748,
3497,
12360,
201,
198,
11748,
1892,
1958,
201,
198,
11748,
640,
201,... | 2.141638 | 1,172 |
# encoding=utf8
import os
import socket
from sync_binlog.output_log import logger as loging
import time
import sys
from sync_binlog.update_post import update_datetime
try:
import psutil
except ImportError:
print("psutil 模块不存在,请使用 pip install psutil 安装")
sys.exit(0)
# Shutdown complete
if __name__ == "... | [
2,
21004,
28,
40477,
23,
198,
198,
11748,
28686,
198,
11748,
17802,
198,
6738,
17510,
62,
8800,
6404,
13,
22915,
62,
6404,
1330,
49706,
355,
2604,
278,
198,
11748,
640,
198,
11748,
25064,
198,
6738,
17510,
62,
8800,
6404,
13,
19119,
6... | 2.156977 | 344 |
import turtle
turtle.mode("logo")
turtle.shape("turtle")
turtle.bgcolor("black")
turtle.hideturtle()
turtle.pensize(12)
turtle.colormode(255)
s = 50
a = 0
for i in range(10):
turtle.pencolor(200-a, a, 100)
turtle.pu()
turtle.goto(25*i, 0)
turtle.pd()
turtle.forward(s)
a = a + 20
s = s + 10... | [
11748,
28699,
198,
198,
83,
17964,
13,
14171,
7203,
6404,
78,
4943,
198,
83,
17964,
13,
43358,
7203,
83,
17964,
4943,
198,
83,
17964,
13,
35904,
8043,
7203,
13424,
4943,
198,
83,
17964,
13,
49675,
316,
17964,
3419,
198,
83,
17964,
13,... | 2.119497 | 159 |
#!/usr/bin/env python3
from hpecp import ContainerPlatformClient, APIException
from hpecp.k8s_cluster import K8sClusterHostConfig
import textwrap
client = ContainerPlatformClient(username='admin',
password='admin123',
api_host='127.0.0.1',
... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
6738,
289,
431,
13155,
1330,
43101,
37148,
11792,
11,
7824,
16922,
198,
6738,
289,
431,
13155,
13,
74,
23,
82,
62,
565,
5819,
1330,
509,
23,
82,
2601,
5819,
17932,
16934,
19... | 2.028369 | 564 |
import os
import shutil
# wbg_pth='/datadrive/Reflection/training_data/wbg'
# img_pth='/datadrive/Reflection/training_data/images'
# dst_pth='/datadrive/Reflection/training_data/valB'
# move_data(wbg_pth,img_pth,dst_pth)
wbg_pth='/datadrive/Reflection/training_data/wbg'
trainA_pth='/datadrive/pytorch-CycleGAN-an... | [
11748,
28686,
220,
198,
11748,
4423,
346,
220,
628,
628,
198,
2,
266,
35904,
62,
79,
400,
11639,
14,
19608,
324,
11590,
14,
8134,
1564,
14,
34409,
62,
7890,
14,
86,
35904,
6,
198,
2,
33705,
62,
79,
400,
11639,
14,
19608,
324,
1159... | 2.150407 | 246 |
# ---------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# ---------------------------------------------------------
"""A class for storing the field information."""
class _FieldInfo(object):
"""A class for storing the field information."""
... | [
2,
20368,
22369,
12,
201,
198,
2,
15069,
357,
66,
8,
5413,
10501,
13,
1439,
2489,
10395,
13,
201,
198,
2,
20368,
22369,
12,
201,
198,
37811,
32,
1398,
329,
23069,
262,
2214,
1321,
526,
15931,
201,
198,
201,
198,
201,
198,
4871,
48... | 2.405501 | 1,127 |
# Copyright 2016 Google 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 w... | [
2,
15069,
1584,
3012,
11419,
201,
198,
2,
201,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
201,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
201,
19... | 2.710796 | 1,269 |
eggs = 'global'
spam() | [
198,
33856,
82,
796,
705,
20541,
6,
198,
2777,
321,
3419
] | 2.090909 | 11 |
from github.Issue import Issue
from github.Repository import Repository
import logging
from typing import List
REQUEST_REPO = 'Azure/sdk-release-request'
REST_REPO = 'Azure/azure-rest-api-specs'
AUTO_ASSIGN_LABEL = 'assigned'
AUTO_PARSE_LABEL = 'auto-link'
_LOG = logging.getLogger(__name__)
| [
6738,
33084,
13,
45147,
1330,
18232,
198,
6738,
33084,
13,
6207,
13264,
1330,
1432,
13264,
198,
11748,
18931,
198,
6738,
19720,
1330,
7343,
198,
198,
2200,
35780,
62,
2200,
16402,
796,
705,
26903,
495,
14,
21282,
74,
12,
20979,
12,
2592... | 2.715596 | 109 |
import argparse
import os
import random
import sys
import time
import requests
parser = argparse.ArgumentParser()
parser.add_argument('--path', type=str, help='Path to text files with bills', required=True)
parser.add_argument('--count', type=int, help='How much files process', required=False, default=20)
args = par... | [
11748,
1822,
29572,
198,
11748,
28686,
198,
11748,
4738,
198,
11748,
25064,
198,
11748,
640,
198,
198,
11748,
7007,
198,
198,
48610,
796,
1822,
29572,
13,
28100,
1713,
46677,
3419,
198,
48610,
13,
2860,
62,
49140,
10786,
438,
6978,
3256,
... | 2.142206 | 1,097 |
from fastapi import APIRouter
from src.utils.events import Events
from src.schemas.schema import x_schedule_header
from src.controllers.faculties_controller import get_all_faculties, is_faculty_exists
from src.utils.tracking import track
tag = "Faculties"
router = APIRouter()
@router.get("", tags=[tag])
@track(fmt="... | [
6738,
3049,
15042,
1330,
3486,
4663,
39605,
198,
6738,
12351,
13,
26791,
13,
31534,
1330,
18715,
198,
6738,
12351,
13,
1416,
4411,
292,
13,
15952,
2611,
1330,
2124,
62,
15952,
5950,
62,
25677,
198,
6738,
12351,
13,
3642,
36667,
13,
3894... | 2.739394 | 165 |
# -*- coding: utf-8 -*-
import ckan.plugins as p
#from ckan.lib.base import BaseController, config
import ckan.lib.base as base
import ckan.lib.helpers as h
import ckan.model as model
import ckan.logic as logic
import ckan.logic.schema as schema
import ckan.new_authz as new_authz
import ckan.lib.captcha as captcha
imp... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
269,
27541,
13,
37390,
355,
279,
198,
2,
6738,
269,
27541,
13,
8019,
13,
8692,
1330,
7308,
22130,
11,
4566,
198,
11748,
269,
27541,
13,
8019,
13,
8692,
355... | 3.029851 | 201 |
""" Module for loading PypeIt files
"""
import os
import warnings
import numpy as np
from astropy import units
from astropy.time import Time
from astropy.io import fits
from astropy.table import Table
from linetools.spectra.xspectrum1d import XSpectrum1D
from linetools.spectra.utils import collate
import linetools.u... | [
37811,
19937,
329,
11046,
350,
2981,
1026,
3696,
198,
37811,
198,
11748,
28686,
198,
11748,
14601,
198,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
6468,
28338,
1330,
4991,
198,
6738,
6468,
28338,
13,
2435,
1330,
3862,
198,
6738,
... | 2.162529 | 7,211 |