content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
import os,sys
from caffe.proto import caffe_pb2
import google.protobuf.text_format as txtf
prototxt_file=sys.argv[1]
to_prototxt_file=sys.argv[2]
hold_layers=sys.argv[3].split(',')
model=caffe_pb2.NetParameter()
with open(prototxt_file,'r') as f:
txtf.Merge(f.read(),model)
f.close()
active_layers={}
i=0
for... | [
11748,
28686,
11,
17597,
198,
6738,
21121,
13,
1676,
1462,
1330,
21121,
62,
40842,
17,
198,
11748,
23645,
13,
11235,
672,
3046,
13,
5239,
62,
18982,
355,
256,
742,
69,
198,
198,
11235,
313,
742,
62,
7753,
28,
17597,
13,
853,
85,
58,... | 2.117043 | 487 |
import base64
import json
import pickle
from typing import Optional, TYPE_CHECKING, Type, Dict, Any, Union
from ...helper import compress_bytes, decompress_bytes
if TYPE_CHECKING:
from ...typing import T
| [
11748,
2779,
2414,
198,
11748,
33918,
198,
11748,
2298,
293,
198,
6738,
19720,
1330,
32233,
11,
41876,
62,
50084,
2751,
11,
5994,
11,
360,
713,
11,
4377,
11,
4479,
198,
198,
6738,
2644,
2978,
525,
1330,
27413,
62,
33661,
11,
38237,
60... | 3.349206 | 63 |
from .rest_api_base import *
# First Metrics Methods appear in API 3.9
| [
6738,
764,
2118,
62,
15042,
62,
8692,
1330,
1635,
198,
198,
2,
3274,
3395,
10466,
25458,
1656,
287,
7824,
513,
13,
24,
628,
198
] | 3.083333 | 24 |
from factory import Faker
from factory.django import DjangoModelFactory
| [
6738,
8860,
1330,
376,
3110,
198,
6738,
8860,
13,
28241,
14208,
1330,
37770,
17633,
22810,
628
] | 4.5625 | 16 |
"""2021 - Day 16 Part 2: Packet Decoder."""
from src.year2021.day16a import BITS
| [
37811,
1238,
2481,
532,
3596,
1467,
2142,
362,
25,
6400,
316,
34580,
526,
15931,
198,
6738,
12351,
13,
1941,
1238,
2481,
13,
820,
1433,
64,
1330,
347,
29722,
628
] | 2.827586 | 29 |
banyakPerulangan = 10
i = 0
while (i < banyakPerulangan):
print('Hello World')
i += 1 | [
65,
1092,
461,
5990,
377,
37089,
796,
838,
198,
72,
796,
657,
198,
4514,
357,
72,
1279,
275,
1092,
461,
5990,
377,
37089,
2599,
198,
220,
220,
220,
3601,
10786,
15496,
2159,
11537,
198,
220,
220,
220,
1312,
15853,
352
] | 2.325 | 40 |
from .base import DependencyBase, dataclass
@dataclass
class Tag(DependencyBase):
""" Dependency on an arbitrary tag
Usage:
use this tag as a named signal to invalidate records
Example:
update_dashboard_for_admins = Tag('update-dashboard-for-admins')
cache.put(
'arti... | [
6738,
764,
8692,
1330,
37947,
1387,
14881,
11,
4818,
330,
31172,
628,
198,
31,
19608,
330,
31172,
198,
4871,
17467,
7,
35,
2690,
1387,
14881,
2599,
198,
220,
220,
220,
37227,
37947,
1387,
319,
281,
14977,
7621,
628,
220,
220,
220,
295... | 2.103571 | 280 |
import os
from django.db import models
from django.contrib.auth.models import User
from django.urls import reverse
from django.dispatch import receiver
from django.db.models.signals import post_delete, post_save
from django.conf import settings
from django.core.validators import int_list_validator
from taggit.manager... | [
11748,
28686,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
27530,
1330,
11787,
198,
6738,
42625,
14208,
13,
6371,
82,
1330,
9575,
198,
6738,
42625,
14208,
13,
6381,
17147,
13... | 3.308824 | 136 |
from fitrate.utils import gcd, nthrt, prod
| [
6738,
4197,
4873,
13,
26791,
1330,
308,
10210,
11,
299,
400,
17034,
11,
40426,
628,
628
] | 2.875 | 16 |
# Generated by Django 3.0.8 on 2020-10-22 04:45
from django.db import migrations
| [
2,
2980,
515,
416,
37770,
513,
13,
15,
13,
23,
319,
12131,
12,
940,
12,
1828,
8702,
25,
2231,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
628
] | 2.766667 | 30 |
import machine
import time
| [
11748,
4572,
198,
11748,
640,
198
] | 4.5 | 6 |
import torch
import torch.nn as nn
from utils.miscellaneous import progress_bar | [
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
198,
6738,
3384,
4487,
13,
25413,
25673,
1330,
4371,
62,
5657
] | 3.636364 | 22 |
import os
import cv2
import numpy as np
from matplotlib import pyplot as plt
from matplotlib.patches import Polygon
from .dataset_localization import DatasetLocalization
from odin.utils import Iterator
from .visulizer_interface import VisualizerInterface
from odin.classes import strings as labels_str
| [
11748,
28686,
198,
11748,
269,
85,
17,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
2603,
29487,
8019,
1330,
12972,
29487,
355,
458,
83,
198,
6738,
2603,
29487,
8019,
13,
8071,
2052,
1330,
12280,
14520,
198,
6738,
764,
19608,
292,
316... | 3.607143 | 84 |
'''
Es un méotod de compresión muy sencillo.
Bonzip
'''
import bz2
#Cadena binaria
cadena = b'Este es eun ejemplo del formato de compresion Bonzip, sirve para comprimir TODO.'
cadena_comprimida = bz2.compress(cadena)
print(cadena_comprimida)#b"BZh91AY&SY\xbf\xb8:\xfa\x00\x00\x06\x15\x80@\x04\x08\x00.\xa3\xde@ \x0... | [
7061,
6,
198,
198,
23041,
555,
285,
2634,
313,
375,
390,
552,
411,
72,
18840,
285,
4669,
3308,
66,
16111,
13,
198,
198,
20682,
13344,
198,
198,
7061,
6,
198,
11748,
275,
89,
17,
628,
198,
2,
34,
38047,
9874,
10312,
198,
66,
38047,... | 1.753289 | 304 |
import re
import random
| [
11748,
302,
198,
11748,
4738,
628,
198
] | 3.714286 | 7 |
# test_spiderfootplugin.py
import pytest
import unittest
from sflib import SpiderFoot
from spiderfoot import SpiderFootDb, SpiderFootEvent, SpiderFootPlugin, SpiderFootTarget
@pytest.mark.usefixtures
class TestSpiderFootPlugin(unittest.TestCase):
"""
Test SpiderFoot
"""
def test_init(self):
... | [
2,
1332,
62,
2777,
1304,
5898,
33803,
13,
9078,
198,
11748,
12972,
9288,
198,
11748,
555,
715,
395,
198,
198,
6738,
264,
2704,
571,
1330,
12648,
17574,
198,
6738,
19230,
5898,
1330,
12648,
17574,
43832,
11,
12648,
17574,
9237,
11,
12648... | 2.162667 | 4,875 |
# Copyright The PyTorch Lightning team.
#
# 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 i... | [
2,
15069,
383,
9485,
15884,
354,
12469,
1074,
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,
351,
262,
13789,
13,
1... | 2.76484 | 1,752 |
from distutils.log import error
import errno
import numpy as np
import json
import argparse
import time
from tqdm import tqdm
import cv2
import logging
import sys, os
import torch
import torchvision
import torch.nn as nn
from torch import optim
from torch.utils.data import DataLoader
from torch.utils.tensorboard impor... | [
6738,
1233,
26791,
13,
6404,
1330,
4049,
198,
11748,
11454,
3919,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
33918,
198,
11748,
1822,
29572,
198,
11748,
640,
198,
6738,
256,
80,
36020,
1330,
256,
80,
36020,
198,
11748,
269,
85,
17,... | 3.226721 | 247 |
import json
import click
from tabulate import tabulate
from spplib.cli import util
@click.group()
@util.pass_context
def cli(ctx, **kwargs):
"""VM resource.
"""
pass
@cli.command()
@util.pass_context
@click.argument('pattern')
| [
198,
11748,
33918,
198,
198,
11748,
3904,
198,
6738,
7400,
5039,
1330,
7400,
5039,
198,
198,
6738,
264,
381,
8019,
13,
44506,
1330,
7736,
198,
198,
31,
12976,
13,
8094,
3419,
198,
31,
22602,
13,
6603,
62,
22866,
198,
4299,
537,
72,
... | 2.714286 | 91 |
from django.contrib import admin
from .models import immobilien
admin.site.register(immobilien, immobilienAdmin)
# Register your models here.
| [
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
6738,
764,
27530,
1330,
47800,
2013,
628,
198,
198,
28482,
13,
15654,
13,
30238,
7,
8608,
25898,
2013,
11,
47800,
2013,
46787,
8,
198,
198,
2,
17296,
534,
4981,
994,
13,
198
] | 3.560976 | 41 |
class Alarma():
"""clase del objeto alarma"""
| [
4871,
978,
10961,
33529,
198,
197,
37811,
565,
589,
1619,
26181,
27206,
10436,
64,
37811,
198,
197,
197
] | 2.722222 | 18 |
begin_unit
comment|'# Licensed under the Apache License, Version 2.0 (the "License"); you may not'
nl|'\n'
comment|'# use this file except in compliance with the License. You may obtain a copy'
nl|'\n'
comment|'# of the License at'
nl|'\n'
comment|'#'
nl|'\n'
comment|'# http://www.apache.org/licenses/LICENSE-2.0'
nl|'\... | [
27471,
62,
20850,
198,
23893,
91,
6,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
345,
743,
407,
6,
198,
21283,
91,
6,
59,
77,
6,
198,
23893,
91,
6,
2,
779,
428,
2393,
2845,
287,
11846,... | 2.23913 | 598 |
from matplotlib import pyplot as plt
import numpy as np
import pandas as pd
from numpy import pi,abs,exp,log,log10
from scipy import optimize
class RoweOptimization():
'''
Optimizing the Rowe Model onto a training set. The key parameters to adjust
are as follows:
- G_ee
- G_e... | [
6738,
2603,
29487,
8019,
1330,
12972,
29487,
355,
458,
83,
201,
198,
11748,
299,
32152,
355,
45941,
201,
198,
11748,
19798,
292,
355,
279,
67,
201,
198,
201,
198,
6738,
299,
32152,
1330,
31028,
11,
8937,
11,
11201,
11,
6404,
11,
6404,... | 1.754261 | 1,819 |
#graph_visualize.py
from graphviz import Digraph
import pairwise
# Given a vector of the form generated in pairwise.py for
# easy reading into NNs, produce a diagram of the represented graph
| [
2,
34960,
62,
41464,
1096,
13,
9078,
198,
198,
6738,
4823,
85,
528,
1330,
7367,
1470,
198,
11748,
5166,
3083,
198,
198,
2,
11259,
257,
15879,
286,
262,
1296,
7560,
287,
5166,
3083,
13,
9078,
329,
220,
198,
2,
2562,
3555,
656,
399,
... | 3.660377 | 53 |
from machine.corpora import (
DictionaryTextAlignmentCorpus,
DictionaryTextCorpus,
MemoryText,
MemoryTextAlignmentCollection,
ParallelTextCorpus,
)
| [
6738,
4572,
13,
10215,
38851,
1330,
357,
198,
220,
220,
220,
28261,
8206,
2348,
16747,
45680,
385,
11,
198,
220,
220,
220,
28261,
8206,
45680,
385,
11,
198,
220,
220,
220,
14059,
8206,
11,
198,
220,
220,
220,
14059,
8206,
2348,
16747,... | 2.949153 | 59 |
from unicodedata import name
import unittest
from app.models import Vote, User
| [
6738,
28000,
9043,
1045,
1330,
1438,
198,
11748,
555,
715,
395,
198,
6738,
598,
13,
27530,
1330,
19175,
11,
11787,
198
] | 3.761905 | 21 |
import sys
# recursive search through bag dictionary:
# given a bag string, return only the name of the bag:
# ex: 1 light blue returns light blue
# given a bag string, return the quantity:
# ex: 1 light blue returns 1
f = open(sys.argv[1],"r")
L = []
for item in f:
L.append(item.strip())
# dictionary where key i... | [
11748,
25064,
198,
198,
2,
45115,
2989,
832,
6131,
22155,
25,
198,
198,
2,
1813,
257,
6131,
4731,
11,
1441,
691,
262,
1438,
286,
262,
6131,
25,
198,
2,
409,
25,
352,
1657,
4171,
5860,
1657,
4171,
198,
198,
2,
1813,
257,
6131,
4731... | 2.73012 | 415 |
"One user repeatedly logs in, logs out. Allow interleaving with other actions"
from WebModel import Login, Logout
actions = (Login, Logout) # just these to allow interleaving
initial = 0
accepting = (0,)
graph = ((0, (Login, ( 'VinniPuhh', 'Correct' ), 'Success'), 1),
(1, (Logout, ( 'VinniPuhh', ), None),... | [
1,
3198,
2836,
7830,
17259,
287,
11,
17259,
503,
13,
220,
22507,
987,
293,
2703,
351,
584,
4028,
1,
198,
198,
6738,
5313,
17633,
1330,
23093,
11,
5972,
448,
198,
198,
4658,
796,
357,
47790,
11,
5972,
448,
8,
1303,
655,
777,
284,
1... | 2.762712 | 118 |
import os
from django.test import TestCase
from django.contrib.staticfiles import finders
| [
11748,
28686,
198,
198,
6738,
42625,
14208,
13,
9288,
1330,
6208,
20448,
198,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
12708,
16624,
1330,
1064,
364,
628
] | 3.444444 | 27 |
import dlib
import cv2
import numpy as np
import sys
import models
import NonLinearLeastSquares
import ImageProcessing
from drawing import *
import FaceRendering
import utils
import os
import subprocess
print "Press T to draw the keypoints and the 3D model"
print "Press R to start recording to a video file"
#you ... | [
11748,
288,
8019,
198,
11748,
269,
85,
17,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
25064,
198,
198,
11748,
4981,
198,
11748,
8504,
14993,
451,
3123,
459,
22266,
3565,
198,
11748,
7412,
18709,
278,
198,
198,
6738,
8263,
1330,
163... | 2.419977 | 1,762 |
from auxiliar import receberInt
from time import sleep
# main
contador(1, 10, 1)
contador(10, 0, 2)
contador(receberInt('Digite o inicio: '), receberInt('Digite o fim: '), receberInt('Digite o passo: '))
input('\n\nPressione <enter> para continuar')
| [
6738,
27506,
4797,
1330,
1407,
527,
5317,
198,
6738,
640,
1330,
3993,
628,
198,
2,
1388,
198,
3642,
7079,
7,
16,
11,
838,
11,
352,
8,
198,
3642,
7079,
7,
940,
11,
657,
11,
362,
8,
198,
3642,
7079,
7,
260,
344,
527,
5317,
10786,
... | 2.635417 | 96 |
# Generated by Django 2.2.2 on 2019-07-05 12:44
from django.db import migrations
| [
2,
2980,
515,
416,
37770,
362,
13,
17,
13,
17,
319,
13130,
12,
2998,
12,
2713,
1105,
25,
2598,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
628
] | 2.766667 | 30 |
import pickle
import numpy as np
import gurobipy as gp
from gurobipy import GRB
from tqdm.notebook import trange, tqdm
| [
11748,
2298,
293,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
915,
22609,
541,
88,
355,
27809,
198,
6738,
915,
22609,
541,
88,
1330,
10863,
33,
198,
6738,
256,
80,
36020,
13,
11295,
2070,
1330,
491,
858,
11,
256,
80,
36020,
628,
... | 2.818182 | 44 |
# AUTOGENERATED! DO NOT EDIT! File to edit: nbs/09_matching.ipynb (unless otherwise specified).
__all__ = ['calculate_distance', 'calib_table', 'align', 'calculate_deltas', 'align_files', 'align_datasets',
'get_probability', 'match_datasets']
# Cell
import pandas as pd
import numpy as np
def calculate_di... | [
2,
47044,
7730,
1677,
1137,
11617,
0,
8410,
5626,
48483,
0,
9220,
284,
4370,
25,
299,
1443,
14,
2931,
62,
15699,
278,
13,
541,
2047,
65,
357,
25252,
4306,
7368,
737,
198,
198,
834,
439,
834,
796,
37250,
9948,
3129,
378,
62,
30246,
... | 2.44501 | 6,483 |
# AUTOGENERATED! DO NOT EDIT! File to edit: 40b_service_filesystem.ipynb (unless otherwise specified).
__all__ = ['sort_posts', 'posts_list_to_dict', 'migrate', 'ServiceFilesystem', 'before_request', 'after_request',
'init_service']
# Cell
import json,uuid,datetime,re
from pathlib import Path
from operator... | [
2,
47044,
7730,
1677,
1137,
11617,
0,
8410,
5626,
48483,
0,
9220,
284,
4370,
25,
2319,
65,
62,
15271,
62,
16624,
6781,
13,
541,
2047,
65,
357,
25252,
4306,
7368,
737,
198,
198,
834,
439,
834,
796,
37250,
30619,
62,
24875,
3256,
705,... | 2.756098 | 205 |
"""
graph.py
useful graph collection
author: @alexzander
"""
# python
import os
# core package
from core.system import *
from core.json__ import *
from exceptions import *
from core.path__ import *
# from exceptions import * (same thing, it works)
| [
201,
198,
37811,
201,
198,
220,
220,
220,
4823,
13,
9078,
201,
198,
201,
198,
220,
220,
220,
4465,
4823,
4947,
201,
198,
201,
198,
220,
220,
220,
1772,
25,
2488,
1000,
87,
89,
4066,
201,
198,
37811,
201,
198,
201,
198,
201,
198,
... | 2.607143 | 112 |
from ..formatHandlerBase import formatHandlerBase
from ..formatName import formatName
from ...data import dataFileBase,DataType,method,excitationValue,datafileSelector
from ...utils import getValFromCell
import numpy as np
@formatName("line") | [
6738,
11485,
18982,
25060,
14881,
1330,
5794,
25060,
14881,
198,
6738,
11485,
18982,
5376,
1330,
5794,
5376,
198,
6738,
2644,
7890,
1330,
1366,
8979,
14881,
11,
6601,
6030,
11,
24396,
11,
41194,
3780,
11395,
11,
7890,
7753,
17563,
273,
19... | 3.967213 | 61 |
"""
Script for building FMPasteBox
Usage:
python setup.py py2app
"""
from distutils.core import setup
from setuptools.extension import Extension
import py2app
import FMPasteBoxVersion
setup(
name = FMPasteBoxVersion.appname,
version = FMPasteBoxVersion.version,
description = FMPasteBoxVersion.descri... | [
37811,
198,
7391,
329,
2615,
376,
7378,
4594,
14253,
198,
198,
28350,
25,
198,
220,
220,
220,
21015,
9058,
13,
9078,
12972,
17,
1324,
198,
37811,
198,
6738,
1233,
26791,
13,
7295,
1330,
9058,
198,
6738,
900,
37623,
10141,
13,
2302,
30... | 2.187097 | 620 |
from __future__ import print_function
import argparse
import os
import sys, glob, itertools, math
from typing import List, Dict
from PIL import Image, ImageFont, ImageDraw
import torch
from ..srcnn.srcnn_run import SRCNNPreProcessor, SRCNNPreProcessorGen
from src.srgan.srgan_module import Generator as SRGANGenerator
f... | [
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
11748,
1822,
29572,
198,
11748,
28686,
198,
11748,
25064,
11,
15095,
11,
340,
861,
10141,
11,
10688,
198,
6738,
19720,
1330,
7343,
11,
360,
713,
198,
6738,
350,
4146,
1330,
7412,
11,
... | 2.754717 | 424 |
import h5py
import numpy as np
from .. import Transition
from ..callbacks import StoreStates2Hdf5
HDF5_PATH = "/tmp/test_humblerl_callback.hdf5"
class TestStoreTransitions2Hdf5(object):
"""Test callback on 3D (e.g. images) and continuous states."""
| [
11748,
289,
20,
9078,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
11485,
1330,
40658,
198,
6738,
11485,
13345,
10146,
1330,
9363,
42237,
17,
39,
7568,
20,
198,
198,
39,
8068,
20,
62,
34219,
796,
12813,
22065,
14,
9288,
62,
71,... | 2.88764 | 89 |
'''
File: test_accounts.py
Author: Zachary King
Defines unit tests for accounts.py.
Tests all account features.
'''
from __future__ import print_function
import unittest
import os
from oink import accounts, db
class TestAccounts(unittest.TestCase):
'''Defines unit tests for adding and removing accounts.'''
... | [
7061,
6,
198,
8979,
25,
1332,
62,
23317,
82,
13,
9078,
198,
13838,
25,
18825,
560,
2677,
198,
198,
7469,
1127,
4326,
5254,
329,
5504,
13,
9078,
13,
198,
51,
3558,
477,
1848,
3033,
13,
198,
7061,
6,
198,
198,
6738,
11593,
37443,
83... | 2.423937 | 1,387 |
# Generated by Django 3.2.9 on 2021-11-07 02:05
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
513,
13,
17,
13,
24,
319,
33448,
12,
1157,
12,
2998,
7816,
25,
2713,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
from siptrackweb.views import helpers
| [
6738,
264,
10257,
39638,
12384,
13,
33571,
1330,
49385,
198
] | 3.8 | 10 |
import re
from setuptools import setup
version = ""
with open("w2n/__init__.py") as f:
search = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]', f.read(), re.MULTILINE)
if search is not None:
version = search.group(1)
else:
raise RuntimeError("Could not grab version string")
if not ... | [
11748,
302,
198,
198,
6738,
900,
37623,
10141,
1330,
9058,
198,
198,
9641,
796,
13538,
198,
4480,
1280,
7203,
86,
17,
77,
14,
834,
15003,
834,
13,
9078,
4943,
355,
277,
25,
198,
220,
220,
220,
2989,
796,
302,
13,
12947,
7,
81,
6,
... | 2.545455 | 517 |
import joblib
import logging
from typing import Tuple
from catboost import CatBoostRegressor
from environs import Env
import numpy as np
import pandas as pd
from sklearn import metrics
from bedrock_client.bedrock.analyzer import ModelTask, ModelTypes
from bedrock_client.bedrock.analyzer.model_analyzer import ModelAna... | [
11748,
1693,
8019,
198,
11748,
18931,
198,
6738,
19720,
1330,
309,
29291,
198,
198,
6738,
3797,
39521,
1330,
5181,
45686,
8081,
44292,
198,
6738,
17365,
343,
684,
1330,
2039,
85,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,... | 2.358032 | 1,687 |
#!/usr/bin/env python
# coding: utf-8
# # PC/NC classification by CNN
#
# The convolutional neural network (CNN) was invented for image processing.
# We can use Conv1D layers for processing string sequences.
# How well does CNN work on human RNA as a binary classifier of protein-coding/non-coding?
#
# Assume user... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
19617,
25,
3384,
69,
12,
23,
198,
198,
2,
1303,
4217,
14,
7792,
17923,
416,
8100,
198,
2,
220,
198,
2,
383,
3063,
2122,
282,
17019,
3127,
357,
18474,
8,
373,
15646,
329,
2939,
... | 2.636788 | 1,930 |
from distutils.core import setup
import py2exe
setup(console=['client.py'])
setup(console=['server.py'])
setup(console=['stun.py']) | [
6738,
1233,
26791,
13,
7295,
1330,
9058,
201,
198,
11748,
12972,
17,
13499,
201,
198,
201,
198,
40406,
7,
41947,
28,
17816,
16366,
13,
9078,
6,
12962,
201,
198,
40406,
7,
41947,
28,
17816,
15388,
13,
9078,
6,
12962,
201,
198,
40406,
... | 2.634615 | 52 |
#!/usr/bin/env python
import os
import sys
from pyramid.config import Configurator
from sqlalchemy import engine_from_config
from sqlalchemy.orm import sessionmaker
from sqlalchemy.orm import scoped_session
from chatter3.models import Base
from pyramid.paster import (
get_appsettings,
setup_logging,
)
DBSes... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
11748,
28686,
198,
11748,
25064,
198,
6738,
27944,
13,
11250,
1330,
17056,
333,
1352,
198,
198,
6738,
44161,
282,
26599,
1330,
3113,
62,
6738,
62,
11250,
198,
6738,
44161,
282,
26599,
13... | 3 | 151 |
import numpy as np
import tensorflow as tf
| [
11748,
299,
32152,
355,
45941,
198,
11748,
11192,
273,
11125,
355,
48700,
628,
198
] | 3.214286 | 14 |
# -*- coding: utf-8 -*-
# Copyright (C) 2011-2019 Mag. Christian Tanzer All rights reserved
# Glasauergasse 32, A--1130 Wien, Austria. tanzer@swing.co.at
# ****************************************************************************
# This module is part of the package JNJ.
#
# This module is licensed under the terms o... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
15069,
357,
34,
8,
2813,
12,
23344,
2944,
13,
4302,
11818,
9107,
1439,
2489,
10395,
198,
2,
21931,
559,
6422,
21612,
3933,
11,
317,
438,
1157,
1270,
370,
2013,
11,
... | 1.984519 | 6,201 |
#list comprehension
cubes = [cube**3 for cube in range(1,11)]
print(cubes)
| [
2,
4868,
35915,
198,
198,
66,
29080,
796,
685,
40296,
1174,
18,
329,
23441,
287,
2837,
7,
16,
11,
1157,
15437,
198,
4798,
7,
66,
29080,
8,
198
] | 2.714286 | 28 |
import tkinter as tk
from tkinter import messagebox, filedialog, simpledialog, scrolledtext
from tkinter import PhotoImage
from tkinter import ttk
import subprocess
from threading import Thread
import time
import tempfile
from os import path
import sys
try:
from . import settings
except ImportError:
# Running f... | [
11748,
256,
74,
3849,
355,
256,
74,
198,
6738,
256,
74,
3849,
1330,
3275,
3524,
11,
5717,
498,
519,
11,
7106,
276,
498,
519,
11,
629,
8375,
5239,
198,
6738,
256,
74,
3849,
1330,
5555,
5159,
198,
6738,
256,
74,
3849,
1330,
256,
304... | 2.150588 | 13,693 |
import coursera_requests as c
import sys
try:
# c.getCourseraCategories()
c.getCourseraCourses()
# c.getCourseraInstructors()
# c.getCourseraSessions()
# c.getCourseraUniversities()
except:
print ("Unexpected error:", sys.exc_info()[0])
raise | [
11748,
1093,
2655,
64,
62,
8897,
3558,
355,
269,
198,
11748,
25064,
198,
198,
28311,
25,
198,
2,
220,
197,
66,
13,
1136,
25877,
2655,
64,
34,
26129,
3419,
198,
197,
66,
13,
1136,
25877,
2655,
64,
34,
39975,
3419,
198,
2,
220,
197,... | 2.403846 | 104 |
#!/usr/bin/python
# Copyright 2012, Kevin Ko <kevin@faveset.com>. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
#
# Generates an 8-bit log base 2 table.
# Print out an inverse 8-bit log table
print "-1, 0, 1, 1," # log(i) for i in 0, 1, 2,... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
198,
2,
15069,
2321,
11,
7939,
17634,
1279,
365,
7114,
31,
69,
3080,
316,
13,
785,
28401,
220,
1439,
2489,
10395,
13,
198,
2,
5765,
286,
428,
2723,
2438,
318,
21825,
416,
257,
347,
10305,
... | 2.313043 | 230 |
from LibSerial4.LibSerial4 import Serial, Uart | [
6738,
7980,
32634,
19,
13,
25835,
32634,
19,
1330,
23283,
11,
471,
433
] | 3.538462 | 13 |
# Generated by Django 2.1.2 on 2018-11-22 17:40
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
| [
2,
2980,
515,
416,
37770,
362,
13,
16,
13,
17,
319,
2864,
12,
1157,
12,
1828,
1596,
25,
1821,
198,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
198,
11748,
42625,
142... | 3.019231 | 52 |
if __name__ == "__main__":
print(fun(5)) # Always returns 25
| [
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
3601,
7,
12543,
7,
20,
4008,
1303,
16622,
5860,
1679,
198
] | 2.538462 | 26 |
import matplotlib.pyplot as plt
import sys
"""
Utility script to plot Execution time Vs Number of vertices based on the log-files obtained by running tests/*.sh
"""
lines = open(sys.argv[1]).readlines()[1::2]
x = map(lambda xx: 5*eval(xx.strip().split('\t')[1].split(' ')[1]), lines[::2])
# x = map(lambda xx: 400*eval(x... | [
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
25064,
198,
37811,
198,
18274,
879,
4226,
284,
7110,
37497,
640,
31280,
7913,
286,
9421,
1063,
1912,
319,
262,
2604,
12,
16624,
6492,
416,
2491,
5254,
15211,
13,
1477,... | 2.161905 | 420 |
"""
Test CLI for metric integration.
"""
from argparse import ArgumentParser
from getpass import getuser
from time import sleep
from microcosm.api import create_object_graph
from microcosm.loaders import load_from_dict
from microcosm_metrics.naming import name_for
def publish():
"""
Publish a metric (for... | [
37811,
198,
14402,
43749,
329,
18663,
11812,
13,
198,
198,
37811,
198,
6738,
1822,
29572,
1330,
45751,
46677,
198,
6738,
651,
6603,
1330,
651,
7220,
198,
6738,
640,
1330,
3993,
198,
198,
6738,
4580,
6966,
76,
13,
15042,
1330,
2251,
62,
... | 2.766667 | 270 |
from metrics import *
from itembased_recommender_system import *
import shelve
import matplotlib.pyplot as plt
genData('base','u2.base')
genData('test','u2.test')
print("data ready")
base = transform(shelve.open('base'))
test = transform(shelve.open('test'))
##base = {'max':{'odin doma':3,'labirint strah... | [
6738,
20731,
1330,
1635,
201,
198,
6738,
2378,
3106,
62,
47335,
2194,
62,
10057,
1330,
1635,
201,
198,
11748,
7497,
303,
201,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
201,
198,
201,
198,
201,
198,
5235,
6601,
1078... | 1.842479 | 1,549 |
from qiskit.circuit.quantumcircuit import QuantumCircuit, QuantumRegister, ClassicalRegister | [
6738,
10662,
1984,
270,
13,
21170,
5013,
13,
40972,
388,
21170,
5013,
1330,
29082,
31560,
5013,
11,
29082,
38804,
11,
43680,
38804
] | 4.181818 | 22 |
import json
import logging
from urllib.parse import urlencode, parse_qs
from urllib.request import urlopen
from django.conf import settings
from oauth.exceptions import QQAPIException
logger = logging.getLogger('django')
class OauthQQ(object):
"""
QQ认证工具类
"""
def get_auth_url(self):
"""
... | [
11748,
33918,
198,
11748,
18931,
198,
6738,
2956,
297,
571,
13,
29572,
1330,
2956,
11925,
8189,
11,
21136,
62,
48382,
198,
6738,
2956,
297,
571,
13,
25927,
1330,
19016,
9654,
198,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
198... | 1.895147 | 1,154 |
#
# aac_state_base.py, doom-net
#
# Created by Andrey Kolishchak on 01/21/17.
#
import os
import datetime
import glob
from multiprocessing.pool import ThreadPool
from threading import Thread
import time
import h5py
import bisect
import torch
import torch.nn.functional as F
import torch.optim as optim
from torch.utils.d... | [
2,
198,
2,
257,
330,
62,
5219,
62,
8692,
13,
9078,
11,
27666,
12,
3262,
198,
2,
198,
2,
15622,
416,
843,
4364,
25910,
680,
354,
461,
319,
5534,
14,
2481,
14,
1558,
13,
198,
2,
198,
11748,
28686,
198,
11748,
4818,
8079,
198,
1174... | 3.563758 | 149 |
# Copyright 2021 Huawei Technologies Co., Ltd
#
# 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... | [
2,
15069,
33448,
43208,
21852,
1766,
1539,
12052,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198... | 3.944681 | 235 |
"""
vtelem - Test the channel-group registry's correctness.
"""
# module under test
from vtelem.enums.primitive import Primitive
from vtelem.channel.group_registry import ChannelGroupRegistry
from vtelem.telemetry.environment import TelemetryEnvironment
# internal
from . import EnumA
def test_group_registry_basic()... | [
37811,
198,
85,
660,
10671,
532,
6208,
262,
6518,
12,
8094,
20478,
338,
29409,
13,
198,
37811,
198,
198,
2,
8265,
739,
1332,
198,
6738,
410,
660,
10671,
13,
268,
5700,
13,
19795,
1800,
1330,
11460,
1800,
198,
6738,
410,
660,
10671,
... | 2.389831 | 590 |
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
res = [line.strip().split('\t') for line in open("sizes.txt").readlines()]
a = []
for line in res:
sizes = [int(i) for i in line[1].split(',')]
strands = [j for j in line[2].split(',')]
for si, st in zip(sizes, strands):
a.... | [
11748,
19798,
292,
355,
279,
67,
198,
11748,
384,
397,
1211,
355,
3013,
82,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
198,
411,
796,
685,
1370,
13,
36311,
22446,
35312,
10786,
59,
83,
11537,
329,
1627,
287,
... | 2.170868 | 357 |
from itertools import starmap, filterfalse, zip_longest
from itertools import chain
import functools
from functools import reduce as reduce_
import operator
from collections import namedtuple
import toolz
from toolz import pipe as pipe_, compose as compose_
from ._iterators import _iterators_controller, _controlle... | [
6738,
340,
861,
10141,
1330,
336,
1670,
499,
11,
8106,
9562,
11,
19974,
62,
6511,
395,
198,
6738,
340,
861,
10141,
1330,
6333,
198,
198,
11748,
1257,
310,
10141,
198,
6738,
1257,
310,
10141,
1330,
4646,
355,
4646,
62,
198,
198,
11748,... | 3.280769 | 520 |
# -*- coding: utf-8 -*-
"""Mocks for tests."""
from typing import Optional, Tuple
import torch
from torch import nn
from pykeen.models import EntityRelationEmbeddingModel, Model
from pykeen.nn.emb import EmbeddingSpecification, RepresentationModule
from pykeen.triples import TriplesFactory
__all__ = [
'CustomR... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
37811,
44,
3320,
329,
5254,
526,
15931,
198,
198,
6738,
19720,
1330,
32233,
11,
309,
29291,
198,
198,
11748,
28034,
198,
6738,
28034,
1330,
299,
77,
198,
198,
6738,... | 2.883792 | 327 |
import re
def email(value):
"""Validate an email address
>>> email("barney@purpledino.com")
True
>>> email("barneydino.com")
'An email address must contain a single @'
"""
usernameRE = re.compile(r"^[^ \t\n\r@<>()]+$", re.I)
domainRE = re.compile(r'''
^(?:[a-z0-9][a-z0-9\... | [
11748,
302,
628,
198,
4299,
3053,
7,
8367,
2599,
198,
220,
220,
220,
37227,
7762,
20540,
281,
3053,
2209,
198,
220,
220,
220,
220,
198,
220,
220,
220,
13163,
3053,
7203,
5657,
1681,
31,
14225,
10137,
2879,
13,
785,
4943,
198,
220,
2... | 2.11995 | 1,609 |
import json
import urllib
import requests
import Config
import logging
logging.basicConfig(level=logging.DEBUG)
# Class to access the new Twitch 'HELIX' API
# The class receives it's authentication from a dictionary (HEADERS) in the Config.py file.
# The "Bearer" token must have the required scopes to perform succes... | [
11748,
33918,
198,
11748,
2956,
297,
571,
198,
11748,
7007,
198,
11748,
17056,
198,
11748,
18931,
198,
198,
6404,
2667,
13,
35487,
16934,
7,
5715,
28,
6404,
2667,
13,
30531,
8,
628,
198,
2,
5016,
284,
1895,
262,
649,
23835,
705,
39,
... | 3.644501 | 391 |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import os
g_playerDict = {'player1':u"nobody",
'player2':u"nobody",
'player3':u"nobody",
'player4':u"nobody",
'player5':u"nobody",
'player6':u"nobody",
'player7':u"n... | [
2,
0,
1220,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
25064,
198,
11748,
28686,
198,
198,
70,
62,
7829,
35,
713,
796,
1391,
6,
7829,
16,
10354,
84,
1,
34952,
11... | 1.557823 | 441 |
#!E:\py_virtual_env\saas_project\Scripts\python.exe
# -*- coding: utf-8 -*-
from django import forms
from web import models
from django.core.validators import RegexValidator,ValidationError
from django.core.exceptions import ValidationError
from django.conf import settings
from django_redis import get_redis_connection
... | [
2,
0,
36,
7479,
9078,
62,
32844,
62,
24330,
59,
11400,
292,
62,
16302,
59,
7391,
82,
59,
29412,
13,
13499,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
42625,
14208,
1330,
5107,
198,
6738,
3992,
1330,
... | 3.222222 | 126 |
'''
When squirrels get together for a party, they like to have cigars. A squirrel
party is successful when the number of cigars is between 40 and 60,
inclusive. Unless it is the weekend, in which case there is no upper bound on
the number of cigars. Return True if the party with the given values is
successful, or False... | [
7061,
6,
198,
2215,
33039,
82,
651,
1978,
329,
257,
2151,
11,
484,
588,
284,
423,
33204,
13,
317,
33039,
198,
10608,
318,
4388,
618,
262,
1271,
286,
33204,
318,
1022,
2319,
290,
3126,
11,
198,
259,
5731,
13,
17486,
340,
318,
262,
... | 4.148148 | 81 |
class NotifyIcon(Component, IComponent, IDisposable):
"""
Specifies a component that creates an icon in the notification area. This class cannot be inherited.
NotifyIcon()
NotifyIcon(container: IContainer)
"""
def Dispose(self):
""" Dispose(self: NotifyIcon,disposing: bool) """
... | [
4871,
1892,
1958,
19578,
7,
21950,
11,
314,
21950,
11,
4522,
271,
1930,
540,
2599,
201,
198,
220,
220,
220,
37227,
201,
198,
18291,
6945,
257,
7515,
326,
8075,
281,
7196,
287,
262,
14483,
1989,
13,
770,
1398,
2314,
307,
19552,
13,
2... | 2.750582 | 2,578 |
import os
import pandas as pd
import rampwf as rw
from sklearn.model_selection import ShuffleSplit
import numpy as np
problem_title = 'Salary prediction'
_target_column_name = 'SalaryUSD'
# A value which will be used to create wrapper objects for y_pred
Predictions = rw.prediction_types.make_regression()
... | [
11748,
28686,
201,
198,
11748,
19798,
292,
355,
279,
67,
201,
198,
11748,
10454,
86,
69,
355,
374,
86,
201,
198,
6738,
1341,
35720,
13,
19849,
62,
49283,
1330,
911,
18137,
41205,
201,
198,
11748,
299,
32152,
355,
45941,
201,
198,
201,... | 2.729282 | 181 |
"""
IRC message logger.
Enables logging of messages to flat files.
"""
import threading
from datetime import datetime
from kochira import config
from kochira.service import Service, Config
from pathlib import Path
service = Service(__name__, __doc__)
@service.config
@service.setup
@service.shutdown
@... | [
37811,
198,
49060,
3275,
49706,
13,
198,
198,
4834,
2977,
18931,
286,
6218,
284,
6228,
3696,
13,
198,
37811,
198,
198,
11748,
4704,
278,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
198,
6738,
479,
5374,
8704,
1330,
4566,
198,
6738,
... | 3.191045 | 335 |
import json
from unittest import main
from unittest.mock import patch
from common import ClassifierTestCaseWithMockClassifiers
from classifier import __VERSION__
from classifier.ml import Classifier
if __name__ == "__main__":
main()
| [
11748,
33918,
198,
6738,
555,
715,
395,
1330,
1388,
198,
6738,
555,
715,
395,
13,
76,
735,
1330,
8529,
198,
198,
6738,
2219,
1330,
5016,
7483,
14402,
20448,
3152,
44,
735,
9487,
13350,
198,
6738,
1398,
7483,
1330,
11593,
43717,
834,
1... | 3.43662 | 71 |
# third party
import argparse
import csv
import random
import re
import subprocess
from dataclasses import fields, is_dataclass
from functools import reduce
from io import StringIO
from typing import List, Optional
import numpy as np
import torch
import torch.jit
import torch.nn as nn
from gym import spaces
import gym... | [
2,
2368,
2151,
198,
11748,
1822,
29572,
198,
11748,
269,
21370,
198,
11748,
4738,
198,
11748,
302,
198,
11748,
850,
14681,
198,
6738,
4818,
330,
28958,
1330,
7032,
11,
318,
62,
19608,
330,
31172,
198,
6738,
1257,
310,
10141,
1330,
4646,... | 2.81039 | 385 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# SPDX-License-Identifier: GPL-3.0
#
# GNU Radio Python Flow Graph
# Title: Flatsat RX Test
# Author: dev
# GNU Radio version: 3.9.3.0
from distutils.version import StrictVersion
if __name__ == '__main__':
import ctypes
import sys
if sys.platform.startswit... | [
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,
2,
198,
2,
30628,
55,
12,
34156,
12,
33234,
7483,
25,
38644,
12,
18,
13,
15,
198,
2,
198,
2,
22961,
8829... | 2.585664 | 572 |
from random import randint
import os
from PIL import Image
path='final'
classnames=os.listdir(path)
images=[]
f1=open('input_index.txt','w')
for temp in classnames:
images.append(Image.open('final/'+temp))
f1.write(temp+"\n")
f1.close()
k=len(images)
im2=[]
for i in range(k):
img=images[i]
im2.append(img)
h=... | [
6738,
4738,
1330,
43720,
600,
198,
198,
11748,
28686,
198,
6738,
350,
4146,
1330,
7412,
198,
6978,
11639,
20311,
6,
198,
4871,
14933,
28,
418,
13,
4868,
15908,
7,
6978,
8,
198,
17566,
28,
21737,
198,
69,
16,
28,
9654,
10786,
15414,
... | 2.072464 | 345 |
#!/usr/bin/python
# (c) 2018, NetApp, Inc
# GNU General Public License v3.0+ (see COPYING or
# https://www.gnu.org/licenses/gpl-3.0.txt)
'''
Element Software Node Network Interfaces - Bond 1G and 10G configuration
'''
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METAD... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
357,
66,
8,
2864,
11,
3433,
4677,
11,
3457,
198,
2,
22961,
3611,
5094,
13789,
410,
18,
13,
15,
10,
357,
3826,
27975,
45761,
393,
198,
2,
3740,
1378,
2503,
13,
41791,
13,
2398,
14,
67... | 2.166231 | 3,826 |
# -*- coding: utf-8 -*-
"""
Created on Tue Jan 28 10:14:42 2020
@author: Thomas
"""
#!/usr/bin/env python
#Lora Base Server
#Reads Data from the ESP32 Lora Receiver via serial Port and generates a CSV file for each LoRa sensor client
import time
import serial
import re
import datetime
import os.path
... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
30030,
2365,
2579,
838,
25,
1415,
25,
3682,
12131,
198,
198,
31,
9800,
25,
5658,
198,
37811,
198,
198,
2,
48443,
14629,
14,
8800,
14,
24330,
21... | 2.022477 | 2,358 |
from copy import copy
| [
6738,
4866,
1330,
4866,
628,
628
] | 4.166667 | 6 |
# -*- coding: utf-8 -*-
"""
Downloader for ogs5.
.. currentmodule:: ogs5py.tools.download
Downloader
^^^^^^^^^^
A downloading routine to get the OSG5 executable.
.. autosummary::
download_ogs
add_exe
reset_download
OGS5PY_CONFIG
----
"""
import os
import shutil
import tarfile
import zipfile
from urllib... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
10002,
263,
329,
267,
14542,
20,
13,
198,
198,
492,
1459,
21412,
3712,
267,
14542,
20,
9078,
13,
31391,
13,
15002,
198,
198,
10002,
263,
198,
39397,
39397,
... | 2.176153 | 3,514 |
class ViewCropRegionShapeManager(object, IDisposable):
""" A class that provides access to settings related to the crop assigned to a view or a reference callout. """
def Dispose(self):
""" Dispose(self: ViewCropRegionShapeManager) """
pass
def GetAnnotationCropShape(self):
... | [
4871,
3582,
34,
1773,
47371,
33383,
13511,
7,
15252,
11,
4522,
271,
1930,
540,
2599,
201,
198,
220,
220,
220,
37227,
317,
1398,
326,
3769,
1895,
284,
6460,
3519,
284,
262,
13833,
8686,
284,
257,
1570,
393,
257,
4941,
869,
448,
13,
3... | 2.790083 | 3,368 |
# Databricks notebook source
INSTGUYIKQEFVDAVPNQI
DFXKJDJFAIGTQDFPNZXIHFBFJBXNSCAQMMDSAPVIFVULKEPYGJRUNILQPXYXVGWBNVBHBWSUEGQTKHMFFROKHGJKPJ
OCRRFSYKRPOYFVBAHSCCPHGHUA
ORMCLMKXZAKDXRSGAXPHGQDBBOGQKFQYRLQQ
AKVWPNWJGXQTKSYPSLNOUXSWVYRQ
YVOFGDXZWZHFASZQCMZFKHUUBCFUILVBZPHAAMMPWQPOCWRGVAHLTM
NCUOQLVTIVWIMABZGYRFYFLMOIUDXEP... | [
2,
16092,
397,
23706,
20922,
2723,
198,
38604,
38022,
56,
18694,
48,
25425,
53,
5631,
33883,
48,
40,
198,
8068,
55,
42,
41,
35028,
7708,
3528,
51,
48,
35,
5837,
37371,
55,
40,
39,
26001,
37,
47858,
55,
45,
6173,
32,
48,
12038,
525... | 1.542709 | 1,159 |
import torch
import torch.nn as nn
__all__ = [
'blocks_dict',
'InvertedResidual',
'conv_1x1_bn',
'conv_bn'
]
blocks_dict = {
'k3r3':lambda inp, oup, stride : InvertedResidual(inp, oup, 3, 1, stride, 3),
'k3r6':lambda inp, oup, stride : InvertedResidual(inp, oup, 3, 1, stride, 6),
'k5r3':l... | [
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
198,
834,
439,
834,
796,
685,
198,
220,
220,
220,
705,
27372,
62,
11600,
3256,
198,
220,
220,
220,
705,
818,
13658,
4965,
312,
723,
3256,
198,
220,
220,
220,
705,
42946,... | 2.094771 | 306 |
import h5py
import numpy as np
import pandas as pd
import os
from argparse import ArgumentParser
if __name__ == '__main__':
parser = ArgumentParser()
parser.add_argument('ifile_os')
parser.add_argument('ifile_pfs')
# parser.add_argument('-e', '--event_col', default='OSEvent')
# parser.add_argume... | [
11748,
289,
20,
9078,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
28686,
198,
6738,
1822,
29572,
1330,
45751,
46677,
628,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,... | 1.994635 | 2,423 |
from minicps.devices import PLC
from utils import *
import random
import logging
import time
import socket
import json
import select
import signal
import sys
SENSOR_ADDR = IP['lit101']
LIT101 = ('LIT101', 1)
LIT102 = ('LIT102', 1)
if __name__ == '__main__':
lit101 = Lit101(name='lit101',state=STATE,protocol=L... | [
6738,
949,
291,
862,
13,
42034,
1330,
350,
5639,
198,
6738,
3384,
4487,
1330,
1635,
198,
11748,
4738,
198,
11748,
18931,
198,
11748,
640,
628,
198,
11748,
17802,
220,
198,
11748,
33918,
220,
198,
11748,
2922,
198,
11748,
6737,
198,
1174... | 2.678571 | 140 |
# Generated by Django 2.2.5 on 2019-09-15 10:58
from django.db import migrations
| [
2,
2980,
515,
416,
37770,
362,
13,
17,
13,
20,
319,
13130,
12,
2931,
12,
1314,
838,
25,
3365,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
628
] | 2.766667 | 30 |
'''
End to end testing
'''
import shutil
import os
from ConfigParser import SafeConfigParser
import textwrap
import hashlib
import pexpect
import sys
import leveldb
import backup
import tempfile
from backup import dump_database
from myutils import path_leaf
TEST_CONFIG_NAME = "config"
TEST_DROPBOX_NAME = "dropbox"
TES... | [
7061,
6,
198,
12915,
284,
886,
4856,
198,
7061,
6,
198,
11748,
4423,
346,
198,
11748,
28686,
198,
6738,
17056,
46677,
1330,
19978,
16934,
46677,
198,
11748,
2420,
37150,
198,
11748,
12234,
8019,
198,
11748,
613,
87,
806,
198,
11748,
250... | 2.280568 | 4,580 |
"""
This cog deals all the lookup commands
"""
import asyncio
from discord.ext import commands, tasks
import discord
from lookupAPI import nookipediaAPI, localLookup
import os
from dotenv import load_dotenv
load_dotenv(".env")
| [
37811,
198,
1212,
43072,
7529,
477,
262,
35847,
9729,
198,
37811,
198,
11748,
30351,
952,
198,
6738,
36446,
13,
2302,
1330,
9729,
11,
8861,
198,
11748,
36446,
198,
6738,
35847,
17614,
1330,
299,
566,
11151,
17614,
11,
1957,
8567,
929,
1... | 3.59375 | 64 |
import hashlib
import os
import pytest
from aiohttp import ClientSession
from lyricsfinder.extractors.azlyrics import AZLyrics
from lyricsfinder.utils import Request
| [
11748,
12234,
8019,
198,
11748,
28686,
198,
198,
11748,
12972,
9288,
198,
6738,
257,
952,
4023,
1330,
20985,
36044,
198,
198,
6738,
15844,
22805,
13,
2302,
974,
669,
13,
1031,
306,
10466,
1330,
26253,
43,
14279,
198,
6738,
15844,
22805,
... | 3.755556 | 45 |
# settings for councils scraper
BOUNDARIES_URL = "https://ons-cache.s3.amazonaws.com/Local_Authority_Districts_April_2019_Boundaries_UK_BFE.geojson"
EC_COUNCIL_CONTACT_DETAILS_API_URL = (
"https://electoralcommission.org.uk/api/v1/data/local-authorities.json"
)
OLD_TO_NEW_MAP = {}
NEW_COUNCILS = []
WELSH_COUNC... | [
2,
6460,
329,
27174,
19320,
525,
198,
198,
33,
15919,
1503,
11015,
62,
21886,
796,
366,
5450,
1378,
684,
12,
23870,
13,
82,
18,
13,
33103,
8356,
13,
785,
14,
14565,
62,
13838,
414,
62,
44857,
82,
62,
16784,
62,
23344,
62,
49646,
3... | 2.531646 | 790 |
from enum import Enum
from typing import Iterator, List, Optional, Tuple
import re
_PUNCTUATION = {
"(": _Token(_TokenType.LPAREN),
")": _Token(_TokenType.RPAREN),
"{": _Token(_TokenType.LBRACE),
"}": _Token(_TokenType.RBRACE),
"[": _Token(_TokenType.LBRACK),
"]": _Token(_TokenType.RBRA... | [
6738,
33829,
1330,
2039,
388,
198,
6738,
19720,
1330,
40806,
1352,
11,
7343,
11,
32233,
11,
309,
29291,
198,
11748,
302,
628,
628,
628,
628,
198,
198,
62,
47,
4944,
4177,
52,
6234,
796,
1391,
198,
220,
220,
220,
30629,
1298,
4808,
3... | 2.33377 | 764 |
import sys
import numpy as np
import math
from collections import Counter
if __name__ == "__main__":
if len(sys.argv) != 6:
print("Usage:build_kNN.py <training_data> <test_data> <k_val> <similarity_func> <sys_output>")
exit(-1)
else:
trainingData, features = readData(sys.argv[1])
... | [
11748,
25064,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
10688,
198,
6738,
17268,
1330,
15034,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
611,
18896,
7,
17597,
13,
853,
85,
8,
14512,
718,
25... | 2.328638 | 213 |
from django import forms
from . import models
STATES = [
('AL', 'AL'), ('AK', 'AK'), ('AZ', 'AZ'), ('AR', 'AR'), ('CA', 'CA'),
('CO', 'CO'), ('CT', 'CT'), ('DC', 'DC'), ('DE', 'DE'), ('FL', 'FL'),
('GA', 'GA'), ('HI', 'HI'), ('ID', 'ID'), ('IL', 'IL'), ('IN', 'IN'),
('IA', 'IA'), ('KS', 'KS'), ('KY', ... | [
6738,
42625,
14208,
1330,
5107,
198,
198,
6738,
764,
1330,
4981,
198,
198,
2257,
29462,
796,
685,
198,
220,
220,
220,
19203,
1847,
3256,
705,
1847,
33809,
19203,
10206,
3256,
705,
10206,
33809,
19203,
22778,
3256,
705,
22778,
33809,
19203... | 2.431784 | 667 |
# This sample tests the reportIncompatibleMethodOverride
# configuration option.
# This should generate an error if reportIncompatibleMethodOverride
# is enabled.
# This should generate an error if reportIncompatibleMethodOverride
# is enabled.
| [
2,
770,
6291,
5254,
262,
989,
818,
38532,
17410,
37961,
198,
2,
8398,
3038,
13,
198,
220,
220,
220,
1303,
770,
815,
7716,
281,
4049,
611,
989,
818,
38532,
17410,
37961,
198,
220,
220,
220,
1303,
318,
9343,
13,
628,
220,
220,
220,
... | 4.109375 | 64 |
from ixnetwork_restpy.base import Base
from ixnetwork_restpy.files import Files
| [
6738,
220,
844,
27349,
62,
2118,
9078,
13,
8692,
1330,
7308,
198,
6738,
220,
844,
27349,
62,
2118,
9078,
13,
16624,
1330,
13283,
628
] | 3.375 | 24 |
# -*- coding:utf-8 -*-
# file: rancher_api
# author: Mundy
# date: 2017/9/1 0001
"""
rancher api调用
"""
import json
import requests
from django.conf import settings
# --------requests设置--------
time_out = 8
headers = {
'content-type': 'application/json',
'Accept': 'application/json',
}
# 调用receiver_hooks api... | [
2,
532,
9,
12,
19617,
25,
40477,
12,
23,
532,
9,
12,
198,
2,
2393,
25,
32205,
372,
62,
15042,
198,
2,
1772,
25,
33324,
88,
198,
2,
3128,
25,
2177,
14,
24,
14,
16,
3571,
486,
198,
37811,
198,
81,
1192,
372,
40391,
164,
108,
2... | 2.439394 | 132 |