content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2018 Intel Corporation
#
# 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
#
# Un... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
198,
2,
15069,
357,
66,
8,
2864,
8180,
10501,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,... | 2.250737 | 5,085 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import pytest
from pony import orm
db = orm.Database()
db.bind(provider="sqlite", filename=":memory:")
db.generate_mapping(create_tables=True)
@orm.db_session
init_data()
@orm.db_session
if __name__ == "__main__":
import os
basename = os.path.basenam... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
12972,
9288,
198,
6738,
26902,
1330,
393,
76,
198,
198,
9945,
796,
393,
76,
13,
38105,
3419,
198,
9945,
1... | 2.38125 | 160 |
import argparse
from neural_networks.rnn_one_hot import RNNOneHot
from neural_networks.rnn_cluster import RNNCluster
from neural_networks.fism_cluster import FISMCluster
from neural_networks.rnn_margin import RNNMargin
from neural_networks.rnn_sampling import RNNSampling
from lazy.pop import Pop
from lazy.markov_model ... | [
11748,
1822,
29572,
198,
6738,
17019,
62,
3262,
5225,
13,
81,
20471,
62,
505,
62,
8940,
1330,
371,
6144,
3198,
21352,
198,
6738,
17019,
62,
3262,
5225,
13,
81,
20471,
62,
565,
5819,
1330,
371,
6144,
2601,
5819,
198,
6738,
17019,
62,
... | 3.204128 | 436 |
# Style Transfer Network
# Encoder -> AdaIN -> Decoder
import tensorflow.compat.v1 as tf
tf.disable_eager_execution()
from encoder import Encoder
from decoder import Decoder
from adaptive_instance_norm import AdaIN
| [
2,
17738,
20558,
7311,
198,
2,
14711,
12342,
4613,
47395,
1268,
4613,
34580,
198,
198,
11748,
11192,
273,
11125,
13,
5589,
265,
13,
85,
16,
355,
48700,
198,
27110,
13,
40223,
62,
68,
3536,
62,
18558,
1009,
3419,
198,
198,
6738,
2207,
... | 3.421875 | 64 |
# -*- coding: utf-8 -*-
#----------------------------------------------------------------------------
# Created By : Zekun Li
# version ='1.0'
# ---------------------------------------------------------------------------
""" Spatial AI Assignment"""
# ---------------------------------------------------------------... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
10097,
10541,
198,
2,
15622,
2750,
220,
1058,
1168,
988,
403,
7455,
220,
220,
198,
2,
2196,
796,
6,
16,
13,
15,
6,
198,
2,
16529,
32284,
198,
37811,
1338,
34961,
... | 4.730769 | 104 |
from objects.pieces import *
def matrix_to_tuple(array, empty_array):
"""
Given a 2D list, converts it to 2D tuple. This is useful for using a
matrix as a key in a dictionary
(an empty 8x8 should be provided, just for efficiency)
"""
for i in range(8):
empty_array[i] = tuple(array[i])
... | [
6738,
5563,
13,
34154,
1330,
1635,
628,
198,
4299,
17593,
62,
1462,
62,
83,
29291,
7,
18747,
11,
6565,
62,
18747,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
11259,
257,
362,
35,
1351,
11,
26161,
340,
284,
362,
35,
46545,
... | 2.22744 | 5,175 |
import re
MISSING_FIELD = 'MISSING'
BIRTH_YEAR_PATTERN = 'byr:(\d{4})'
BIRTH_YEAR_MIN = 1920
BIRTH_YEAR_MAX = 2002
ISSUE_YEAR_PATTERN = 'iyr:(\d{4})'
ISSUE_YEAR_MIN = 2010
ISSUE_YEAR_MAX = 2020
EXP_YEAR_PATTERN = 'eyr:(\d{4})'
EXP_YEAR_MIN = 2020
EXP_YEAR_MAX = 2030
HGT_PATTERN = 'hgt:(\d?\d\d)(in|cm)'
MIN_CM = 15... | [
11748,
302,
198,
198,
44,
16744,
2751,
62,
44603,
796,
705,
44,
16744,
2751,
6,
198,
198,
3483,
49,
4221,
62,
56,
17133,
62,
47,
1404,
31800,
796,
705,
1525,
81,
37498,
59,
67,
90,
19,
30072,
6,
198,
3483,
49,
4221,
62,
56,
1713... | 1.997024 | 672 |
## @ingroup Methods-Aerodynamics-Common-Fidelity_Zero-Lift
# make_VLM_wings.py
# Created: Jun 2021, A. Blaufox
# ----------------------------------------------------------------------
# Imports
# ----------------------------------------------------------------------
# package imports
import numpy as np
from copy ... | [
2235,
2488,
278,
3233,
25458,
12,
32,
263,
44124,
12,
17227,
12,
37,
23091,
62,
28667,
12,
43,
2135,
198,
2,
787,
62,
53,
31288,
62,
48819,
13,
9078,
198,
198,
2,
15622,
25,
220,
7653,
33448,
11,
317,
13,
1086,
559,
12792,
198,
... | 2.075307 | 17,329 |
# -*- coding: utf-8 -*-
from redis import Redis
from background_worker_lib import Worker
job_map = {
'add': lambda a, b: print(a+b),
'mult': lambda a, b: print(a*b)
}
if __name__ == '__main__':
redis_connect = Redis()
worker = Worker(connect=redis_connect, name_queue='queue_add_mult', job_map=job_ma... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
6738,
2266,
271,
1330,
2297,
271,
198,
6738,
4469,
62,
28816,
62,
8019,
1330,
35412,
628,
198,
21858,
62,
8899,
796,
1391,
198,
220,
220,
220,
705,
2860,
10354,
3... | 2.425532 | 141 |
from datetime import timedelta, datetime
import numpy as np
import pandas as pd
from flexmeasures.data.models.data_sources import DataSource
from flexmeasures.data.models.time_series import Sensor, TimedBelief
from flexmeasures.data.services.scheduling import create_scheduling_job
from flexmeasures.data.tests.utils i... | [
6738,
4818,
8079,
1330,
28805,
12514,
11,
4818,
8079,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,
198,
6738,
7059,
47336,
13,
7890,
13,
27530,
13,
7890,
62,
82,
2203,
1330,
6060,
7416,
198,
6738... | 2.636628 | 1,032 |
from pytorch_lightning.utilities.types import STEP_OUTPUT
from torch.functional import Tensor
from . import SEMI_TRAINER_REGISTRY
from torch.utils.data import DataLoader
import torch.nn.functional as F
from typing import Optional, Tuple, Callable, Any
from DeSSL.scheduler import SchedulerBase
from torch import nn, cat,... | [
6738,
12972,
13165,
354,
62,
2971,
768,
13,
315,
2410,
13,
19199,
1330,
49154,
62,
2606,
7250,
3843,
198,
6738,
28034,
13,
45124,
1330,
309,
22854,
198,
6738,
764,
1330,
48603,
40,
62,
51,
3861,
1268,
1137,
62,
31553,
1797,
40405,
198... | 3.087629 | 388 |
# -*- coding: utf-8 -*-
if __name__ == "__main__":
main()
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
628,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
1388,
3419,
198
] | 1.969697 | 33 |
from algorithms.MergeSort import MergeSort
from algorithms.BubbleSort import BubbleSort
from utility.Timer import Timer | [
6738,
16113,
13,
13102,
469,
42758,
1330,
39407,
42758,
198,
6738,
16113,
13,
33,
549,
903,
42758,
1330,
33691,
42758,
198,
6738,
10361,
13,
48801,
1330,
5045,
263
] | 4.25 | 28 |
import torch
import random
import pickle
import pandas
import time
import numpy as np
from pandas import DataFrame
from torch import nn
from torch import optim
from torch.autograd import Variable
from torch import optim
from torch.autograd import Variable
from torch.optim.lr_scheduler import ReduceLROnPlateau
from data... | [
11748,
28034,
198,
11748,
4738,
198,
11748,
2298,
293,
198,
11748,
19798,
292,
198,
11748,
640,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
19798,
292,
1330,
6060,
19778,
198,
6738,
28034,
1330,
299,
77,
198,
6738,
28034,
1330,
6436,
... | 2.992933 | 283 |
# This script created by Joseph Aaron Campbell - 10/2020
""" Set up Working Environment """
# import Metashape library module
import Metashape
# create a reference to the current project via Document Class
doc = Metashape.app.document
# set reference for the currently active chunk
activeChunk = Metashape.app.d... | [
2,
770,
4226,
2727,
416,
7212,
12139,
14327,
532,
838,
14,
42334,
201,
198,
201,
198,
37811,
5345,
510,
14594,
9344,
37227,
201,
198,
2,
1330,
3395,
1077,
1758,
5888,
8265,
201,
198,
11748,
3395,
1077,
1758,
201,
198,
2,
2251,
257,
... | 2.628261 | 460 |
"""DQN model class for RL experiments with neural net function approx.
Written by: Zahi Kakish (zmk5)
"""
from typing import List
import numpy as np
from tensorflow import keras
from tensorflow.keras.optimizers import Adam
from mrt_msgs.srv import Gradients
from mrt_msgs.srv import Weights
class ServerPolicyDQN()... | [
37811,
35,
48,
45,
2746,
1398,
329,
45715,
10256,
351,
17019,
2010,
2163,
5561,
13,
198,
198,
25354,
416,
25,
1168,
32810,
31250,
680,
357,
89,
28015,
20,
8,
198,
37811,
198,
6738,
19720,
1330,
7343,
198,
198,
11748,
299,
32152,
355,
... | 2.205602 | 1,785 |
import cv2
import numpy as np
import mediapipe as mp
from HandTrackModel3 import HandDetector
if __name__ == '__main__':
main()
| [
11748,
269,
85,
17,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
16957,
499,
3757,
355,
29034,
198,
6738,
7157,
24802,
17633,
18,
1330,
7157,
11242,
9250,
628,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
... | 2.893617 | 47 |
# -*- coding: utf-8 -*-
import unittest
from app.utils.operate_db import DBUtil | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
555,
715,
395,
198,
6738,
598,
13,
26791,
13,
3575,
378,
62,
9945,
1330,
20137,
18274,
346
] | 2.424242 | 33 |
import timeit
import argparse
import numpy as np
from core.bamnet.entnet import EntnetAgent
from core.build_data.build_all import build
from core.build_data.utils import vectorize_ent_data
from core.utils.utils import *
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('-confi... | [
11748,
640,
270,
198,
11748,
1822,
29572,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
4755,
13,
65,
321,
3262,
13,
298,
3262,
1330,
7232,
3262,
36772,
198,
6738,
4755,
13,
11249,
62,
7890,
13,
11249,
62,
439,
1330,
1382,
198,
... | 2.023423 | 1,110 |
from flask import Blueprint, request, redirect, url_for, flash, render_template
from orders_tracker.blueprints.devices.service import add_device, update_device
from orders_tracker.forms import NewDeviceForm
from orders_tracker.models import Device
devices_blueprint = Blueprint('devices_bp', __name__, template_folder=... | [
6738,
42903,
1330,
39932,
11,
2581,
11,
18941,
11,
19016,
62,
1640,
11,
7644,
11,
8543,
62,
28243,
198,
198,
6738,
6266,
62,
2213,
10735,
13,
17585,
17190,
13,
42034,
13,
15271,
1330,
751,
62,
25202,
11,
4296,
62,
25202,
198,
6738,
... | 3.305732 | 157 |
import os
import shlex
import subprocess
import tempfile
from ef.config.efconf import EfConf
# try instead
# https://stackoverflow.com/questions/4417546/constantly-print-subprocess-output-while-process-is-running
if __name__ == "__main__":
main()
| [
11748,
28686,
198,
11748,
427,
2588,
198,
11748,
850,
14681,
198,
11748,
20218,
7753,
198,
198,
6738,
304,
69,
13,
11250,
13,
891,
10414,
1330,
412,
69,
18546,
628,
220,
220,
220,
1303,
1949,
2427,
198,
220,
220,
220,
1303,
3740,
1378... | 2.869565 | 92 |
import pickle
import os
import numpy as np
import csv
pickle_folder = './Processed/'
measures = ['rank',]# 'mmre', 'abs_res']
files = [pickle_folder+file for file in os.listdir(pickle_folder) if '.p' in file]
result_folder = './Results_10-100/'
for file in files:
system_name = file.split('/')[-1].split('.p')[0]
... | [
11748,
2298,
293,
198,
11748,
28686,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
269,
21370,
198,
198,
27729,
293,
62,
43551,
796,
705,
19571,
18709,
276,
14,
6,
198,
47336,
796,
37250,
43027,
3256,
60,
2,
705,
3020,
260,
3256,
70... | 2.035382 | 537 |
from torch.optim import AdamW
from torch.utils.data import DataLoader
from torchvision.datasets.mnist import MNIST
from typing import NamedTuple
from tqdm import tqdm
#from webmnist.model import LeNet5
import torch
import torch.nn as nn
import torchvision.transforms as torch
MIRROR = "https://ossci-datasets.s3.amazon... | [
6738,
28034,
13,
40085,
1330,
7244,
54,
198,
6738,
28034,
13,
26791,
13,
7890,
1330,
6060,
17401,
198,
6738,
28034,
10178,
13,
19608,
292,
1039,
13,
10295,
396,
1330,
29060,
8808,
198,
6738,
19720,
1330,
34441,
51,
29291,
198,
6738,
256... | 2.78125 | 160 |
"""Select MSCOCO keyword-image pairs for one-shot background training.
Write background split to data/splits/mscoco_one_shot:
`python3 src/moonshot/preprocessing/make_mscoco_background.py --mode write`
Debug:
`python3 -m pdb src/moonshot/preprocessing/make_mscoco_background.py --debug --mode write`
Author: Ryan Elof... | [
37811,
17563,
337,
6173,
4503,
46,
21179,
12,
9060,
14729,
329,
530,
12,
9442,
4469,
3047,
13,
198,
198,
16594,
4469,
6626,
284,
1366,
14,
22018,
896,
14,
907,
66,
25634,
62,
505,
62,
9442,
25,
198,
63,
29412,
18,
12351,
14,
5908,
... | 2.918167 | 611 |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
btab format, used by BLAST and NUCMER, found spec here:
<http://www.agcol.arizona.edu/~matthew/formats.html>
btab format used by aat, found spec here:
<http://ergatis.diagcomputing.org/cgi/documentation.cgi?article=components&page=aat_aa>
"""
from __future__ import pr... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
41002,
12,
23,
532,
9,
12,
198,
198,
37811,
198,
65,
8658,
5794,
11,
973,
416,
9878,
11262,
290,
399,
9598,
29296,
11,
1043,
1020,
994,
25,
198,
27,
402... | 2.026236 | 1,639 |
"""
Tests for the interface to topography files
and other things in topobank.manager.utils
"""
import pytest
import json
from django.shortcuts import reverse
from django.contrib.contenttypes.models import ContentType
from ..tests.utils import two_topos, Topography1DFactory, Topography2DFactory, SurfaceFactory, \
... | [
37811,
198,
51,
3558,
329,
262,
7071,
284,
1353,
4867,
3696,
198,
392,
584,
1243,
287,
1353,
672,
962,
13,
37153,
13,
26791,
198,
37811,
198,
198,
11748,
12972,
9288,
198,
11748,
33918,
198,
6738,
42625,
14208,
13,
19509,
23779,
1330,
... | 2.979661 | 295 |
import os
| [
11748,
28686,
628
] | 3.666667 | 3 |
"""Unit test package for tagstr."""
| [
37811,
26453,
1332,
5301,
329,
7621,
2536,
526,
15931,
198
] | 3.6 | 10 |
# ASCIIfy.py - Functions for ASCII conversion
import numpy as np
import cv2
# Resize the image as specified dimensions to be divided by Region of Interest (ROI)
# Generate the ASCII image array to match with the ROI
# Returns False if letters is of invalid length
# Changing the image to ASCII by ROI average intensi... | [
2,
25400,
40,
1532,
88,
13,
9078,
532,
40480,
329,
37101,
11315,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
269,
85,
17,
198,
198,
2,
1874,
1096,
262,
2939,
355,
7368,
15225,
284,
307,
9086,
416,
17718,
286,
12033,
357,
13252,
... | 4.020619 | 97 |
import numpy as np
from abc import ABC, abstractmethod
from heapq import heapify, heappush, heappop
import random
import math
class EvaluationOrder(ABC):
""""
Abstract Class to evaluate the evaluation order with Christofides Algorithm,
an approximation of TSP.
"""
def build_graph(self):
... | [
11748,
299,
32152,
355,
45941,
198,
6738,
450,
66,
1330,
9738,
11,
12531,
24396,
198,
6738,
24575,
80,
1330,
24575,
1958,
11,
339,
1324,
1530,
11,
339,
1324,
404,
198,
11748,
4738,
198,
11748,
10688,
198,
198,
4871,
34959,
18743,
7,
2... | 2.429472 | 1,744 |
# Logic Algorithms
# condition
# check
| [
2,
30146,
978,
7727,
907,
201,
198,
201,
198,
2,
4006,
201,
198,
201,
198,
2,
2198,
201,
198,
201,
198
] | 2.285714 | 21 |
# Copyright 2016 The TensorFlow 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 applica... | [
2,
15069,
1584,
383,
309,
22854,
37535,
46665,
13,
1439,
6923,
33876,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
... | 3.167802 | 1,174 |
import asyncio
import functools
import time
if __name__ == '__main__':
start = time.time()
main()
end = time.time()
print('运行耗时:{:.4f}'.format(end - start))
| [
11748,
30351,
952,
198,
11748,
1257,
310,
10141,
198,
11748,
640,
628,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
923,
796,
640,
13,
2435,
3419,
198,
220,
220,
220,
1388,
3419,
198,
... | 2.170732 | 82 |
from DSA.template.template import *
if __name__ == '__main__':
# array = get_random_array(10, 0, 3)
# print(array)
# sort_array(array)
# print(array)
test_cases = int(input())
for t_case in range(test_cases):
n = map(int, input().split())
array = list(map(int, input().split())... | [
6738,
360,
4090,
13,
28243,
13,
28243,
1330,
1635,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
1303,
7177,
796,
651,
62,
25120,
62,
18747,
7,
940,
11,
657,
11,
513,
8,
198,
220,
220... | 2.169231 | 195 |
# You are a product manager and currently leading a team to develop a new product. Unfortunately, the latest version of your product fails the quality check. Since each version is developed based on the previous version, all the versions after a bad version are also bad.
# Suppose you have n versions [1, 2, ..., n] an... | [
2,
921,
389,
257,
1720,
4706,
290,
3058,
3756,
257,
1074,
284,
1205,
257,
649,
1720,
13,
8989,
11,
262,
3452,
2196,
286,
534,
1720,
10143,
262,
3081,
2198,
13,
4619,
1123,
2196,
318,
4166,
1912,
319,
262,
2180,
2196,
11,
477,
262,
... | 3.659836 | 244 |
from .builder import OPTIMIZERS
from .torch_optimizer import torch_optimizer
| [
6738,
764,
38272,
1330,
39852,
3955,
14887,
4877,
198,
6738,
764,
13165,
354,
62,
40085,
7509,
1330,
28034,
62,
40085,
7509,
198
] | 3.5 | 22 |
# -*- coding: utf-8 -*-
#------------------------------------------------------------
# Based on code from pelisalacarta
# License: GPL (http://www.gnu.org/licenses/gpl-3.0.html)
#------------------------------------------------------------
if __name__ == "__main__":
item = Item(title="bla b", url="http://bla")
... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
47232,
10541,
198,
2,
13403,
319,
2438,
422,
16176,
28456,
330,
34202,
198,
2,
13789,
25,
38644,
357,
4023,
1378,
2503,
13,
41791,
13,
2398,
14,
677,
4541,
14,
70,
... | 2.953947 | 152 |
import torch
import numpy as np
class FractionalInpainting(torch.autograd.Function):
"""
Wrapper around torch.ops.renderer.fast_inpaint_fractional
that supports gradient propagation.
It is aliased by 'fractionalInpainting', use it as
<code>output = fractionalInpainting(input : Tensor, sample_mask :... | [
11748,
28034,
198,
11748,
299,
32152,
355,
45941,
198,
198,
4871,
376,
7861,
282,
818,
35436,
889,
7,
13165,
354,
13,
2306,
519,
6335,
13,
22203,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
27323,
2848,
1088,
28034,
13,
2840,... | 2.567299 | 1,107 |
# -*- coding: utf-8 -*-
from .Conv import (
Conv2d,
ConvTranspose2d,
Conv2dBatch,
ConvTranspose2dBatch,
Conv2dGroup,
DSConv,
DWConv,
)
from .Interpolate import Lerp
from .Linear import Linear
from .Loss import WGAN_ACGAN, WGANGP_ACGAN
from .Module import Module
from .Norm import PixelwiseNor... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
764,
3103,
85,
1330,
357,
198,
220,
220,
220,
34872,
17,
67,
11,
198,
220,
220,
220,
34872,
8291,
3455,
17,
67,
11,
198,
220,
220,
220,
34872,
17,
36077,
963,
... | 2.086957 | 368 |
# Configuration for Gunicorn on Azure
# Azure Startup Command should be: gunicorn -c gunicorn_config.py app:app
# See: https://docs.gunicorn.org/en/stable/settings.html#config
workers = 4
worker_class = "uvicorn.workers.UvicornWorker"
| [
2,
28373,
329,
6748,
291,
1211,
319,
22134,
198,
2,
22134,
40472,
9455,
815,
307,
25,
2485,
291,
1211,
532,
66,
2485,
291,
1211,
62,
11250,
13,
9078,
598,
25,
1324,
198,
2,
4091,
25,
3740,
1378,
31628,
13,
7145,
291,
1211,
13,
239... | 3.051948 | 77 |
# -*- coding: utf-8 -*-
# (c) Copyright 2019 Sensirion AG, Switzerland
from __future__ import absolute_import, division, print_function
from .command import I2cCommand
from .errors import I2cChecksumError
from struct import pack
class SensirionI2cCommand(I2cCommand):
"""
Base class for Sensirion-specific I²C... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
357,
66,
8,
15069,
13130,
14173,
343,
295,
13077,
11,
14679,
198,
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
11,
7297,
11,
3601,
62,
8818,
198,
6738,
764,... | 2.326538 | 2,747 |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
5366,
13,
26791,
1330,
4818,
8079,
62,
26791,
355,
4818,
8079,
198,
6738,
5366,
13,
9945,
1330,
20613,
198,
6738,
5366,
13,
85,
17,
1330,
10011,
2611,
44,
4254,
... | 3.113208 | 53 |
# -*- coding:UTF-8 -*-
from bs4 import BeautifulSoup
import requests, sys
"""
类说明:下载《笔趣看》网小说《一念永恒》
Parameters:
无
Returns:
无
Modify:
2017-09-13
"""
class downloader(object):
"""
函数说明:获取下载链接
Parameters:
无
Returns:
无
Modify:
2017-09-13
"""
"""
函数说明:获取章... | [
2,
532,
9,
12,
19617,
25,
48504,
12,
23,
532,
9,
12,
198,
6738,
275,
82,
19,
1330,
23762,
50,
10486,
198,
11748,
7007,
11,
25064,
198,
198,
37811,
198,
163,
109,
119,
46237,
112,
23626,
236,
25,
10310,
233,
164,
121,
121,
5099,
... | 1.352778 | 720 |
from .search_attribute import SearchAttribute
from .dict_attribute import DictAttribute
from .query_expression_attribute import QueryExpressionAttribute
from .update_expression_attribute import UpdateExpressionAttribute
from .update_action import UpdateAction
from .projection_expression_attribute import ProjectionExpre... | [
6738,
764,
12947,
62,
42348,
1330,
11140,
33682,
198,
6738,
764,
11600,
62,
42348,
1330,
360,
713,
33682,
198,
6738,
764,
22766,
62,
38011,
62,
42348,
1330,
43301,
16870,
2234,
33682,
198,
6738,
764,
19119,
62,
38011,
62,
42348,
1330,
1... | 4.855072 | 69 |
from schema import Schema, Or
from validations.schemas.base_schema import BaseSchema
| [
6738,
32815,
1330,
10011,
2611,
11,
1471,
198,
198,
6738,
4938,
602,
13,
1416,
4411,
292,
13,
8692,
62,
15952,
2611,
1330,
7308,
27054,
2611,
628
] | 3.346154 | 26 |
from __future__ import print_function
import os
import sys
import time
import numpy as np
import scipy.optimize as opt
from six.moves import range
from acq4.util.functions import logSpace, downsample as fnDownsample
path = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..', 'util'))
sys.path.append(... | [
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
198,
11748,
28686,
198,
11748,
25064,
198,
11748,
640,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
629,
541,
88,
13,
40085,
1096,
355,
2172,
198,
6738,
2237,
13,
76,
5241,
1... | 2.279315 | 759 |
"""Tools to extract information from MRI, fMRI data."""
from .temporal_series import extract_timeseries
from .connectivity import extract_connectivity
from .structural import get_structural_data
__all__ = ['extract_timeseries',
'extract_connectivity',
'get_structural_data']
| [
37811,
33637,
284,
7925,
1321,
422,
30278,
11,
277,
40952,
1366,
526,
15931,
198,
6738,
764,
11498,
35738,
62,
25076,
1330,
7925,
62,
22355,
10640,
198,
6738,
764,
8443,
3458,
1330,
7925,
62,
8443,
3458,
198,
6738,
764,
7249,
1523,
1330... | 3.040816 | 98 |
# 0603.py
import cv2
import numpy as np
src = cv2.imread('./data/rect.jpg', cv2.IMREAD_GRAYSCALE)
#1
gx = cv2.Sobel(src, cv2.CV_32F, 1, 0, ksize = 3)
gy = cv2.Sobel(src, cv2.CV_32F, 0, 1, ksize = 3)
#2
dstX = cv2.sqrt(np.abs(gx))
dstX = cv2.normalize(dstX, None, 0, 255, cv2.NORM_MINMAX, dtype = cv2.CV_8U... | [
2,
657,
35642,
13,
9078,
201,
198,
11748,
269,
85,
17,
201,
198,
11748,
299,
32152,
355,
45941,
201,
198,
201,
198,
10677,
796,
269,
85,
17,
13,
320,
961,
7,
4458,
14,
7890,
14,
2554,
13,
9479,
3256,
269,
85,
17,
13,
3955,
15675... | 1.76 | 450 |
# -*- coding: utf-8 -*-
import os
import sys
import subprocess
adb_path = ''
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
28686,
198,
11748,
25064,
198,
11748,
850,
14681,
198,
198,
324,
65,
62,
6978,
796,
10148,
628,
198
] | 2.424242 | 33 |
"""distutils.core
The only module that needs to be imported to use the Distutils; provides
the 'setup' function (which is to be called from the setup script). Also
indirectly provides the Distribution and Command classes, although they are
really defined in distutils.dist and distutils.cmd.
"""
__revision__ = "$Id$... | [
198,
37811,
17080,
26791,
13,
7295,
198,
198,
464,
691,
8265,
326,
2476,
284,
307,
17392,
284,
779,
262,
4307,
26791,
26,
3769,
198,
1169,
705,
40406,
6,
2163,
357,
4758,
318,
284,
307,
1444,
422,
262,
9058,
4226,
737,
220,
4418,
19... | 2.690626 | 3,339 |
#
# Copyright (C) 2004-2006 greg Landrum and Rational Discovery LLC
#
# @@ All Rights Reserved @@
# This file is part of the RDKit.
# The contents are covered by the terms of the BSD license
# which is included in the file license.txt, found at the root
# of the RDKit source tree.
#
import os
import unittest
f... | [
2,
198,
2,
220,
15069,
357,
34,
8,
5472,
12,
13330,
220,
308,
2301,
6379,
6582,
290,
46863,
23455,
11419,
198,
2,
198,
2,
220,
220,
25248,
1439,
6923,
33876,
25248,
198,
2,
220,
770,
2393,
318,
636,
286,
262,
31475,
20827,
13,
198... | 3.134831 | 178 |
import os
import collections
from sklearn.ensemble import RandomForestClassifier, RandomForestRegressor
from sklearn.linear_model import (LinearRegression, SGDClassifier,
RidgeClassifierCV, ARDRegression,
BayesianRidge)
MODELS_TYPE_DICT = {'RandomFore... | [
11748,
28686,
198,
11748,
17268,
198,
6738,
1341,
35720,
13,
1072,
11306,
1330,
14534,
34605,
9487,
7483,
11,
14534,
34605,
8081,
44292,
198,
6738,
1341,
35720,
13,
29127,
62,
19849,
1330,
357,
14993,
451,
8081,
2234,
11,
26147,
35,
9487,... | 2.299026 | 5,752 |
from .raman_hyperspectra_gui import *
__version__ = "0.0.63"
__author__ = 'F. Bertin, A. Chabli '
__license__ = "MIT"
| [
6738,
764,
859,
272,
62,
36362,
364,
806,
430,
62,
48317,
1330,
1635,
198,
834,
9641,
834,
796,
366,
15,
13,
15,
13,
5066,
1,
198,
834,
9800,
834,
796,
705,
37,
13,
22108,
259,
11,
317,
13,
609,
397,
4528,
705,
198,
834,
43085,
... | 2.313725 | 51 |
import os
import math
para_lambdas = [8.0]
para_rs = [0.25]
para_paths = [10]
para_path_lengths = [60]
para_ps = [0.5]
para_qs = [1]
para_alphas = [0.12]
para_bias_weights = [1.5]
model_path = 'models'
result_path = 'results'
format_data_path = 'format_data'
sentiment_result_file = os.path.join(result_path, 'sentimen... | [
11748,
28686,
198,
11748,
10688,
198,
198,
1845,
64,
62,
2543,
17457,
292,
796,
685,
23,
13,
15,
60,
198,
1845,
64,
62,
3808,
796,
685,
15,
13,
1495,
60,
198,
1845,
64,
62,
6978,
82,
796,
685,
940,
60,
198,
1845,
64,
62,
6978,
... | 1.953988 | 978 |
import argparse
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('--pseudoTreactivities', type = str, required = True, help = 'reactivities.out from a spats run where pseudoT mappings were allowed.')
parser.add_argument('--outfile', type = str, required = True, help = 'Outp... | [
11748,
1822,
29572,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
30751,
796,
1822,
29572,
13,
28100,
1713,
46677,
3419,
198,
220,
220,
220,
30751,
13,
2860,
62,
49140,
10786,
438,
7752,
12003,
... | 3.116438 | 146 |
# -*- coding: utf-8 -*-
#
# Dao-Ke-Dao: Universal Message Module
#
# Written in 2019 by Moky <albert.moky@gmail.com>
#
# ==============================================================================
# MIT License
#
# Copyright (c) 2019 Albert Moky
#
# Permission is hereby granted, free... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
198,
2,
220,
220,
360,
5488,
12,
8896,
12,
35,
5488,
25,
14499,
16000,
19937,
198,
2,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
... | 2.568895 | 2,199 |
'''
Spell Check script using aspell and python unit tests
'''
import os
import argparse
import subprocess
from junit_xml import TestSuite, TestCase
def argument_parser():
''' Argument parser for documentation generation script '''
parser = argparse.ArgumentParser()
parser.add_argument("-o", "--output", def... | [
7061,
6,
198,
31221,
6822,
4226,
1262,
355,
23506,
290,
21015,
4326,
5254,
198,
7061,
6,
198,
11748,
28686,
198,
11748,
1822,
29572,
198,
11748,
850,
14681,
198,
6738,
10891,
270,
62,
19875,
1330,
6208,
5606,
578,
11,
6208,
20448,
198,
... | 2.423624 | 1,617 |
#Provide different values for msg1,msg2 and test your program
msg1="I like Python"
msg2="Java is a very popular language"
common_characters=find_common_characters(msg1,msg2)
print(common_characters) | [
2,
15946,
485,
1180,
3815,
329,
31456,
16,
11,
19662,
17,
290,
1332,
534,
1430,
198,
19662,
16,
2625,
40,
588,
11361,
1,
198,
19662,
17,
2625,
29584,
318,
257,
845,
2968,
3303,
1,
198,
11321,
62,
10641,
19858,
28,
19796,
62,
11321,
... | 3.245902 | 61 |
# Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
| [
171,
119,
123,
2,
30396,
329,
257,
13934,
5509,
10139,
13,
198,
2,
1398,
12200,
19667,
7,
15252,
2599,
198,
2,
220,
220,
220,
220,
825,
11593,
15003,
834,
7,
944,
11,
2124,
2599,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
2... | 2.135802 | 81 |
# PART 1 KEEPING IT CLASSY
from random import randint
class Product():
"""
A product of Acme Corporation.
"""
# Attributes: name, price, weight, flammability, identifier
# importing 'random', use randint which return random integers from the “discrete uniform” distribution
# identifier is an interger gen... | [
2,
16652,
352,
509,
35238,
2751,
7283,
42715,
56,
198,
198,
6738,
4738,
1330,
43720,
600,
198,
198,
4871,
8721,
33529,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
317,
1720,
286,
4013,
1326,
10501,
13,
198,
220,
220,
220,
37227,
... | 3.52356 | 191 |
#!/usr/bin/env python
import tkinter as tk
# --- functions ---
# --- main ---
# open first main window
root = tk.Tk()
btn = tk.Button(root, text='Submit', command=open_second_window)
btn.pack()
root.mainloop()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
256,
74,
3849,
355,
256,
74,
198,
198,
2,
11420,
5499,
11420,
198,
198,
2,
11420,
1388,
11420,
198,
220,
220,
220,
220,
198,
2,
1280,
717,
1388,
4324,
220,
220,
220,
22... | 2.5 | 90 |
from logging import getLogger
import cv2
import numpy as np
import pyopencl as cl
from car_motion_attack.utils import prg, queue, ctx
from car_motion_attack.utils import warp_corners, yuv2rgb, rgb2yuv
from car_motion_attack.config import (
MODEL_IMG_HEIGHT,
MODEL_IMG_WIDTH,
IMG_CROP_HEIGHT,
MODEL_IMG_C... | [
6738,
18931,
1330,
651,
11187,
1362,
198,
198,
11748,
269,
85,
17,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
12972,
9654,
565,
355,
537,
198,
6738,
1097,
62,
38714,
62,
20358,
13,
26791,
1330,
778,
70,
11,
16834,
11,
269,
17602,... | 2.106312 | 301 |
#-*- coding:utf-8 -*-
"""xbman-Integrated URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', vie... | [
2,
12,
9,
12,
19617,
25,
40477,
12,
23,
532,
9,
12,
198,
37811,
30894,
805,
12,
34500,
4111,
10289,
28373,
198,
198,
464,
4600,
6371,
33279,
82,
63,
1351,
11926,
32336,
284,
5009,
13,
1114,
517,
1321,
3387,
766,
25,
198,
220,
220,... | 2.475578 | 778 |
#!/usr/bin/python
#
# Copyright 2013 Google, Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
198,
2,
15069,
2211,
3012,
11,
3457,
13,
1439,
6923,
33876,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
... | 2.631235 | 1,223 |
a = 50
print('\033[32m_\033[m' * a)
print(f'\033[1;32m{"SISTEMA DE IDADE PARA VOTAÇAO":=^{a}}\033[m')
print('\033[32m-\033[m' * a)
nasc = int(input('\033[35mEm que ano voce nasceu? '))
print(voto(nasc))
| [
64,
796,
2026,
198,
4798,
10786,
59,
44427,
58,
2624,
76,
62,
59,
44427,
58,
76,
6,
1635,
257,
8,
198,
4798,
7,
69,
6,
59,
44427,
58,
16,
26,
2624,
76,
4895,
50,
8808,
27630,
5550,
4522,
19266,
350,
24401,
569,
29009,
127,
229,
... | 1.855856 | 111 |
import os,sys,time,random
import httplib, urllib
import shutil
server_url = '121.251.255.51:80'
file_path = '/worker-node'
command = ''
lastcommand = 0
while 1:
sleeptime = random.randint(10,600)
print sleeptime
time.sleep(sleeptime)
print 'downloading'
if(update()):
break
print 'run'
... | [
11748,
28686,
11,
17597,
11,
2435,
11,
25120,
198,
11748,
1841,
489,
571,
11,
2956,
297,
571,
198,
11748,
4423,
346,
198,
198,
15388,
62,
6371,
796,
705,
19244,
13,
28072,
13,
13381,
13,
4349,
25,
1795,
6,
198,
7753,
62,
6978,
796,
... | 2.384615 | 156 |
# coding: utf-8
# Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | [
2,
19617,
25,
3384,
69,
12,
23,
198,
2,
15069,
357,
66,
8,
1584,
11,
33160,
11,
18650,
290,
14,
273,
663,
29116,
13,
220,
1439,
2489,
10395,
13,
198,
2,
770,
3788,
318,
10668,
12,
36612,
284,
345,
739,
262,
14499,
2448,
33532,
1... | 2.528097 | 1,477 |
import _plotly_utils.basevalidators
| [
11748,
4808,
29487,
306,
62,
26791,
13,
8692,
12102,
2024,
628
] | 3.363636 | 11 |
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""
Stub functions that are used by the Amazon Route 53 unit tests.
"""
import datetime
from test_tools.example_stubber import ExampleStubber
class Route53Stubber(ExampleStubber):
"""
A class that impl... | [
2,
15069,
6186,
13,
785,
11,
3457,
13,
393,
663,
29116,
13,
1439,
6923,
33876,
13,
198,
2,
30628,
55,
12,
34156,
12,
33234,
7483,
25,
24843,
12,
17,
13,
15,
198,
198,
37811,
198,
1273,
549,
5499,
326,
389,
973,
416,
262,
6186,
1... | 2.91411 | 326 |
"""
The `~certbot_dns_stackpath.dns_stackpath` plugin automates the process of
completing a ``dns-01`` challenge (`~acme.challenges.DNS01`) by creating, and
subsequently removing, TXT records using the StackPath API.
Named Arguments
---------------
======================================== ===========================... | [
37811,
198,
464,
4600,
93,
22583,
13645,
62,
67,
5907,
62,
25558,
6978,
13,
67,
5907,
62,
25558,
6978,
63,
13877,
3557,
689,
262,
1429,
286,
198,
785,
47130,
257,
7559,
67,
5907,
12,
486,
15506,
4427,
357,
63,
93,
330,
1326,
13,
3... | 3.046075 | 1,172 |
# Automatically generated by pb2py
# fmt: off
from .. import protobuf as p
if __debug__:
try:
from typing import Dict, List # noqa: F401
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
| [
2,
17406,
4142,
7560,
416,
279,
65,
17,
9078,
198,
2,
46996,
25,
572,
198,
6738,
11485,
1330,
1237,
672,
3046,
355,
279,
198,
198,
361,
11593,
24442,
834,
25,
198,
220,
220,
220,
1949,
25,
198,
220,
220,
220,
220,
220,
220,
220,
... | 2.515152 | 99 |
##########DEPENDENCIES#############
from dronekit import connect, VehicleMode,LocationGlobalRelative,APIException
import time
import socket
#import exceptions
import math
import argparse
from pymavlink import mavutil
#########FUNCTIONS#################
def send_local_ned_velocity(vx, vy, vz):
"""
Move vehicle... | [
7804,
2235,
46162,
10619,
24181,
11015,
7804,
4242,
2,
198,
198,
6738,
12170,
15813,
1330,
2018,
11,
21501,
19076,
11,
14749,
22289,
6892,
876,
11,
17614,
16922,
198,
11748,
640,
198,
11748,
17802,
198,
2,
11748,
13269,
198,
11748,
10688,... | 1.896068 | 5,494 |
"""Cross-modal retrieval evaluation wrapper.
PCME
Copyright (c) 2021-present NAVER Corp.
MIT license
"""
from functools import partial
import numpy as np
import torch
import torch.nn as nn
from tqdm import tqdm
from utils.tensor_utils import to_numpy
def batch(iterable, batch_size=1):
"""a batch generator
... | [
37811,
21544,
12,
4666,
282,
45069,
12660,
29908,
13,
198,
198,
5662,
11682,
198,
15269,
357,
66,
8,
33448,
12,
25579,
11746,
5959,
11421,
13,
198,
36393,
5964,
198,
37811,
198,
6738,
1257,
310,
10141,
1330,
13027,
198,
198,
11748,
299,... | 1.961632 | 5,786 |
#!/usr/bin/python3
import os
if (os.geteuid() != 0):
print('run as admin')
os._exit(-1)
from tinydb import TinyDB, Query
from pprint import pprint
import run_latest_version as run
query = Query()
files = run.get_last_version_of_files('../scripts/').get_list()
file = '../scripts/1_caller_db_0000.json'
with ... | [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
198,
11748,
28686,
198,
361,
357,
418,
13,
1136,
12496,
312,
3419,
14512,
657,
2599,
198,
220,
220,
220,
3601,
10786,
5143,
355,
13169,
11537,
198,
220,
220,
220,
28686,
13557,
37023,
325... | 2.409574 | 752 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import argparse
# from copy import deepcopy
if __name__ == '__main__':
main()
| [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
1822,
29572,
198,
2,
422,
4866,
1330,
2769,
30073,
628,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
... | 2.433962 | 53 |
# Endpoint for temperatures route
from flask_json import json_response as res
from flask import request as req
from flask import abort
from datetime import datetime
from datetime import timezone
from model.historic.HistoricTemperatureModel import HistoricTemperatureModel
import logging
import time
import mariadb
from f... | [
2,
5268,
4122,
329,
10101,
6339,
198,
6738,
42903,
62,
17752,
1330,
33918,
62,
26209,
355,
581,
198,
6738,
42903,
1330,
2581,
355,
43089,
198,
6738,
42903,
1330,
15614,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
6738,
4818,
8079,
133... | 3.174455 | 321 |
#!/usr/bin/env python3
import sys
from pathlib import Path
# add parent folder
sys.path.append(str(Path(__file__).parent.parent.absolute()))
from app import app # noqa: E402
from models import Zone, Record # noqa: E402
from dns_providers import bind9 # noqa: E402
with app.app_context():
bind9.sync(zones=Zone... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
11748,
25064,
198,
6738,
3108,
8019,
1330,
10644,
198,
198,
2,
751,
2560,
9483,
198,
17597,
13,
6978,
13,
33295,
7,
2536,
7,
15235,
7,
834,
7753,
834,
737,
8000,
13,
8000,
... | 2.850394 | 127 |
#! /usr/bin/env python
"""
open-dobot Accelerometers Calibration tool.
This tool continuously reports accelerometers and angles from those.
Use this tool to find offsets for your accelerometers.
Follow the procedure below to enable accelerometers reporting mode on FPGA.
No action required on RAMPS as GY-521 acceler... | [
2,
0,
1220,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
37811,
198,
9654,
12,
67,
672,
313,
29805,
40077,
2199,
571,
1358,
2891,
13,
198,
198,
1212,
2891,
17282,
3136,
8320,
40077,
290,
18333,
422,
883,
13,
198,
198,
11041,
428,
28... | 2.873967 | 968 |
# SPDX-License-Identifier: MIT
import argparse
import os
import os.path
import sys
import warnings
from typing import Iterable, List, Optional, TextIO, Type, Union
import rich
import rich.traceback
import trampolim
warnings.showwarning = _showwarning
def _error(msg: str, code: int = 1) -> None: # pragma: no c... | [
2,
30628,
55,
12,
34156,
12,
33234,
7483,
25,
17168,
198,
198,
11748,
1822,
29572,
198,
11748,
28686,
198,
11748,
28686,
13,
6978,
198,
11748,
25064,
198,
11748,
14601,
198,
198,
6738,
19720,
1330,
40806,
540,
11,
7343,
11,
32233,
11,
... | 2.310164 | 1,338 |
from rest_framework import serializers
from iconcollections.models import Collection
| [
6738,
1334,
62,
30604,
1330,
11389,
11341,
198,
198,
6738,
7196,
4033,
26448,
13,
27530,
1330,
12251,
628
] | 4.833333 | 18 |
# coding=utf-8
import tensorflow as tf
import scipy.sparse
from sklearn.neighbors import KDTree
import numpy as np
import math
import multiprocessing as multiproc
from functools import partial
def GridSampling(batch_size, meshgrid):
'''
output Grid points as a NxD matrix
params = {
'batc... | [
2,
19617,
28,
40477,
12,
23,
201,
198,
11748,
11192,
273,
11125,
355,
48700,
201,
198,
11748,
629,
541,
88,
13,
82,
29572,
201,
198,
6738,
1341,
35720,
13,
710,
394,
32289,
1330,
509,
24544,
631,
201,
198,
11748,
299,
32152,
355,
45... | 2.024448 | 2,945 |
# Generated by Django 3.0.5 on 2020-04-19 13:46
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import model_utils.fields
import simple_history.models
import uuid
| [
2,
2980,
515,
416,
37770,
513,
13,
15,
13,
20,
319,
12131,
12,
3023,
12,
1129,
1511,
25,
3510,
198,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
198,
11748,
42625,
14... | 3.202532 | 79 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup
with open('README.rst') as readme_file:
readme = readme_file.read()
requirements = [
'tiingo',
'pandas'
]
test_requirements = [
'pytest'
]
setup(
name='tiingo_prices',
version='0.3.1',
description="A CLI tool to ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
6738,
900,
37623,
10141,
1330,
9058,
198,
198,
4480,
1280,
10786,
15675,
11682,
13,
81,
301,
11537,
355,
1100,
132... | 2.402852 | 561 |
from django.db import models
from django.conf import settings
| [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
628,
198
] | 3.764706 | 17 |
import sys
import threading
import time
from goprocam import GoProCamera, constants
cameras = sys.argv[1]
cameras = cameras.split(",")
for interface in cameras:
thr = threading.Thread(target=take_photo, args=(interface,))
thr.start()
| [
11748,
25064,
198,
11748,
4704,
278,
198,
11748,
640,
198,
198,
6738,
308,
404,
12204,
321,
1330,
49789,
35632,
11,
38491,
628,
198,
198,
66,
2382,
292,
796,
25064,
13,
853,
85,
58,
16,
60,
198,
66,
2382,
292,
796,
9073,
13,
35312,
... | 2.940476 | 84 |
### tensorflow==2.3.0
import tensorflow as tf
import tensorflow_datasets as tfds
import numpy as np
raw_test_data, info = tfds.load(name="the300w_lp", with_info=True, split="train", data_dir="~/TFDS", download=True)
# Full Integer Quantization - Input/Output=int8
converter = tf.lite.TFLiteConverter.from_saved_model(... | [
21017,
11192,
273,
11125,
855,
17,
13,
18,
13,
15,
198,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
11748,
11192,
273,
11125,
62,
19608,
292,
1039,
355,
48700,
9310,
198,
11748,
299,
32152,
355,
45941,
198,
198,
1831,
62,
9288,
62... | 2.691083 | 314 |
from __future__ import print_function
import os
from functools import wraps
from zmq.tests import BaseZMQTestCase
from zmq.utils.win32 import allow_interrupt
| [
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
198,
11748,
28686,
198,
198,
6738,
1257,
310,
10141,
1330,
27521,
198,
6738,
1976,
76,
80,
13,
41989,
1330,
7308,
57,
49215,
14402,
20448,
198,
6738,
1976,
76,
80,
13,
26791,
13,
540... | 3.24 | 50 |
from qac.experiments import preprocessing
| [
6738,
10662,
330,
13,
23100,
6800,
1330,
662,
36948,
198
] | 4.2 | 10 |
import argparse
import torch
from g2p.config import Config
from g2p.data import Data, DoubleBets
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('--config', type=str, default='default',
help="YAML file name under configs/")
args = parser.parse_args... | [
11748,
1822,
29572,
198,
11748,
28034,
198,
198,
6738,
308,
17,
79,
13,
11250,
1330,
17056,
198,
6738,
308,
17,
79,
13,
7890,
1330,
6060,
11,
11198,
33,
1039,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
... | 2.557047 | 149 |
#!/usr/bin/python
from argparse import ArgumentParser
from sklearn.metrics import accuracy_score, confusion_matrix, classification_report
import pickle
from sklearn.cross_validation import train_test_split
from tictacs import from_recipe
from sklearn.grid_search import GridSearchCV
import pprint
if __name__ == '_... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
198,
6738,
1822,
29572,
1330,
45751,
46677,
198,
6738,
1341,
35720,
13,
4164,
10466,
1330,
9922,
62,
26675,
11,
10802,
62,
6759,
8609,
11,
17923,
62,
13116,
198,
11748,
2298,
293,
198,
6738,
... | 2.058546 | 1,059 |
import signal
import time
# Setup handler for sigterm so we can exit when docker stop is called.
signal.signal(signal.SIGTERM, term)
print ("Starting")
max = 3
for i in range(max):
time.sleep(1)
print("Heartbeat {0}/{1}".format(i + 1, max))
print("Exiting")
| [
11748,
6737,
198,
11748,
640,
198,
198,
2,
31122,
21360,
329,
43237,
4354,
523,
356,
460,
8420,
618,
36253,
2245,
318,
1444,
13,
198,
198,
12683,
282,
13,
12683,
282,
7,
12683,
282,
13,
50,
3528,
5781,
44,
11,
3381,
8,
198,
198,
4... | 2.656863 | 102 |
from lxml import etree
from importlib.resources import path
import configparser
import os
import pwd
from mache.discover import discover_machine
class MachineInfo:
"""
An object containing information about an E3SM supported machine
Attributes
----------
machine : str
The name of an E3SM... | [
6738,
300,
19875,
1330,
2123,
631,
198,
6738,
1330,
8019,
13,
37540,
1330,
3108,
198,
11748,
4566,
48610,
198,
11748,
28686,
198,
11748,
279,
16993,
198,
198,
6738,
285,
4891,
13,
67,
29392,
1330,
7073,
62,
30243,
628,
198,
4871,
10850,... | 1.948994 | 8,352 |
from django.apps import AppConfig
| [
6738,
42625,
14208,
13,
18211,
1330,
2034,
16934,
628
] | 3.888889 | 9 |
# coding=utf-8
import os
from . import _actrie
from .context import Context, PrefixContext
from .error import MatcherError
from .util import convert2pass
| [
2,
19617,
28,
40477,
12,
23,
198,
198,
11748,
28686,
198,
198,
6738,
764,
1330,
4808,
529,
5034,
198,
6738,
764,
22866,
1330,
30532,
11,
3771,
13049,
21947,
198,
6738,
764,
18224,
1330,
6550,
2044,
12331,
198,
6738,
764,
22602,
1330,
... | 3.434783 | 46 |
# -*-coding:utf-8-*-
import tensorflow as tf
import matplotlib.pyplot as plt
import numpy as np
from lxml import etree
from utils.dataset_utils import recursive_parse_xml_to_dict
from utils.label_map_util import get_label_map_dict
from dataset_tools.create_pascal_tf_record import dict_to_tf_example
import os
if __... | [
2,
532,
9,
12,
66,
7656,
25,
40477,
12,
23,
12,
9,
12,
198,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
300,
19875,
1330,
... | 2.309343 | 792 |
import dash
import dash_core_components as dcc
import dash_html_components as html
import datetime as dt
from dash.dependencies import Input, Output, State, Event
app = dash.Dash(__name__)
app.config['suppress_callback_exceptions'] = True
app.css.config.serve_locally = True
app.scripts.config.serve_locally = True
se... | [
11748,
14470,
198,
11748,
14470,
62,
7295,
62,
5589,
3906,
355,
288,
535,
198,
11748,
14470,
62,
6494,
62,
5589,
3906,
355,
27711,
198,
11748,
4818,
8079,
355,
288,
83,
198,
6738,
14470,
13,
45841,
3976,
1330,
23412,
11,
25235,
11,
18... | 2.521635 | 416 |
#!/usr/bin/env ipy
##############################################################################
# Written by: Calen Chen <cachen@novell.com>
# Brian G. Merrell <bgmerrell@novell.com>
# Date: 05/11/2008
# Description: This is a test application sample for winforms control:
# ToolStri... | [
2,
48443,
14629,
14,
8800,
14,
24330,
20966,
88,
198,
198,
29113,
29113,
7804,
4242,
2235,
198,
2,
22503,
416,
25,
220,
2199,
268,
12555,
1279,
66,
330,
831,
31,
77,
659,
297,
13,
785,
29,
198,
2,
220,
220,
220,
220,
220,
220,
2... | 2.511379 | 1,494 |
#!/usr/bin/env python2
#!coding=utf-8
basic_command = [
('help', 'Show this help'),
('login', 'Login using Baidu account'),
('download', 'Download file from the Baidu pan link'),
('show', 'Show the Baidu pan real link and filename'),
('export', 'export link to aria2 json... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
17,
198,
2,
0,
66,
7656,
28,
40477,
12,
23,
198,
198,
35487,
62,
21812,
796,
685,
198,
220,
220,
220,
19203,
16794,
3256,
220,
220,
220,
220,
220,
220,
220,
705,
15307,
428,
1037,
33809... | 2.619822 | 676 |
#!/usr/bin/env python
import click
from chimenea.obsinfo import ObsInfo
import glob
import os
import json
@click.command()
@click.argument('fits_or_ms', nargs=-1, type=click.Path(exists=True))
@click.option('-g','--groupname', default='NOGROUP')
@click.option('-o', '--outfile', type=click.File(mode='w'), default='-'... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
11748,
3904,
198,
6738,
18205,
1734,
64,
13,
8158,
10951,
1330,
11086,
12360,
198,
11748,
15095,
198,
11748,
28686,
198,
11748,
33918,
628,
198,
198,
31,
12976,
13,
21812,
3419,
198,
31,... | 2.699248 | 133 |
blacklist = []
class Blacklist:
"""users class""" | [
13424,
4868,
796,
17635,
198,
4871,
2619,
4868,
25,
198,
220,
220,
220,
37227,
18417,
1398,
37811
] | 3.117647 | 17 |