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
# -*- encoding: utf-8 -*-
import datetime
import logging
import os
import pprint
import numpy as np
import tensorflow as tf
from sklearn import metrics
from tensorflow.python.saved_model import builder as saved_model_builder
from tensorflow.python.saved_model import (
signature_constants, si... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
21004,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
4818,
8079,
198,
11748,
18931,
198,
11748,
28686,
198,
11748,
279,
4798,
198,
198,
11748,
299,
32152,
355,
... | 2.946429 | 224 |
from typing import Tuple, List
import numpy as np
from planar.transform import Affine
from model.car.sensor import Sensor
from model.car.directed_rect import DirectedRectangle
from model.track.track import Track, SegmentId
from model.neural_network.neural_network import NeuralNetwork
from model.neural_network.neural... | [
6738,
19720,
1330,
309,
29291,
11,
7343,
198,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
1410,
283,
13,
35636,
1330,
6708,
500,
628,
198,
6738,
2746,
13,
7718,
13,
82,
22854,
1330,
35367,
198,
6738,
2746,
13,
7718,
13,
34762,
62,
... | 3.707071 | 99 |
import datetime
import random
from flask_restplus import Resource
from api import api
from models import (new_user,
user,
user_phone_verification_request,
user_phone_verification_verify,
phone_number)
from dal import add_user, get_user
from... | [
11748,
4818,
8079,
198,
11748,
4738,
198,
6738,
42903,
62,
2118,
9541,
1330,
20857,
198,
6738,
40391,
1330,
40391,
198,
6738,
4981,
1330,
357,
3605,
62,
7220,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
... | 2.042071 | 309 |
from django import forms
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.models import User
from django import forms
from .models import Perfil
# from .models import Usuario
| [
6738,
42625,
14208,
1330,
5107,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
23914,
1330,
11787,
12443,
341,
8479,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
27530,
1330,
11787,
198,
6738,
42625,
14208,
1330,
5107,
... | 3.516667 | 60 |
from flask import *
app = Flask(__name__, template_folder="src", static_folder="dist")
@app.route("/")
@app.route("/projects")
if __name__ == '__main__':
app.run(debug=True) | [
6738,
42903,
1330,
1635,
198,
1324,
796,
46947,
7,
834,
3672,
834,
11,
11055,
62,
43551,
2625,
10677,
1600,
9037,
62,
43551,
2625,
17080,
4943,
198,
198,
31,
1324,
13,
38629,
7203,
14,
4943,
198,
220,
220,
220,
220,
198,
31,
1324,
1... | 2.473684 | 76 |
import tempfile
import shutil
import os
from deeprank.models.metrics import TensorboardBinaryClassificationExporter, OutputExporter
test_entries = ["entry0", "entry1"]
test_outputs = [[0.0, 0.1], [2.03, -1.0]]
test_targets = [1, 0]
| [
11748,
20218,
7753,
198,
11748,
4423,
346,
198,
11748,
28686,
198,
198,
6738,
2769,
43027,
13,
27530,
13,
4164,
10466,
1330,
309,
22854,
3526,
33,
3219,
9487,
2649,
3109,
26634,
11,
25235,
3109,
26634,
628,
198,
9288,
62,
298,
1678,
796... | 2.693182 | 88 |
#!/usr/bin/python
# (c) 2020, NetApp, Inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
""" NetApp StorageGRID Grid Info using REST APIs """
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': ... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
198,
2,
357,
66,
8,
12131,
11,
3433,
4677,
11,
3457,
198,
2,
22961,
3611,
5094,
13789,
410,
18,
13,
15,
10,
357,
3826,
27975,
45761,
393,
3740,
1378,
2503,
13,
41791,
13,
2398,
14,
677,
... | 2.009195 | 7,722 |
# Copyright (c) 2014 Red Hat, 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 require... | [
2,
15069,
357,
66,
8,
1946,
2297,
10983,
11,
3457,
13,
198,
2,
1439,
6923,
33876,
13,
198,
2,
198,
2,
220,
220,
220,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
345,
743,
198,
2,
220,
220... | 3.005903 | 847 |
"""
Required: obtain cc_index and copy it locally
`aws s3 sync s3://commoncrawl-dev/big-science-workshop/data-sourcing-sheet/cc-{FLAVOR}/ $CC_INDEX_FOLDER/cc-{FLAVOR}/`
"""
import logging
import re
import subprocess
import threading
from argparse import ArgumentParser
from concurrent.futures import ThreadPoolExecutor
... | [
37811,
198,
37374,
25,
7330,
36624,
62,
9630,
290,
4866,
340,
15726,
198,
63,
8356,
264,
18,
17510,
264,
18,
1378,
11321,
66,
13132,
12,
7959,
14,
14261,
12,
16801,
12,
38067,
14,
7890,
12,
82,
29985,
12,
21760,
14,
535,
12,
90,
3... | 2.599057 | 636 |
import os
import numpy as np
import pickle
from functions_detection import *
import scipy
from functions_utils import normalize_image
from functions_feat_extraction import find_cars
import time
import collections
time_window = 5
hot_windows_history = collections.deque(maxlen=time_window)
# load pretrained svm classif... | [
11748,
28686,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
2298,
293,
198,
6738,
5499,
62,
15255,
3213,
1330,
1635,
198,
11748,
629,
541,
88,
198,
6738,
5499,
62,
26791,
1330,
3487,
1096,
62,
9060,
198,
6738,
5499,
62,
27594,
62,
2... | 2.755924 | 422 |
"""Simphony Photonic Simulator
This module implements a free (as in speech) and open source
photonic integrated circuit (PIC) simulation engine.
It is speedy and easily extensible.
"""
name = "simphony"
from simphony._version import __version__
__author__ = 'Sequoia Ploeg, Hyrum Gunther'
__all__ = [
'core',
... | [
37811,
8890,
23021,
5919,
9229,
13942,
198,
198,
1212,
8265,
23986,
257,
1479,
357,
292,
287,
4046,
8,
290,
1280,
2723,
198,
38611,
9229,
11521,
10349,
357,
47,
2149,
8,
18640,
3113,
13,
220,
198,
1026,
318,
35564,
290,
3538,
1070,
27... | 3.090164 | 122 |
import numpy as np
import pytest
import pandas as pd
from pandas import DataFrame, to_datetime
import pandas._testing as tm
| [
11748,
299,
32152,
355,
45941,
198,
11748,
12972,
9288,
198,
198,
11748,
19798,
292,
355,
279,
67,
198,
6738,
19798,
292,
1330,
6060,
19778,
11,
284,
62,
19608,
8079,
198,
11748,
19798,
292,
13557,
33407,
355,
256,
76,
628
] | 3.230769 | 39 |
import sys
import tarski_wrapper as tw
USAGE = "\n\tpython3 fluentimpact.py [--assess plan.ipc] <in-domain.pddl> <in-problem.pddl> <out-domain.pddl> <out-problem.pddl>\n"
if __name__ == '__main__':
if len(sys.argv) > 2 and sys.argv[1] == '--assess':
with open(sys.argv[2], 'r') as f:
... | [
201,
198,
11748,
25064,
201,
198,
201,
198,
11748,
256,
945,
4106,
62,
48553,
355,
665,
201,
198,
201,
198,
2937,
11879,
796,
37082,
77,
59,
83,
29412,
18,
43472,
48240,
13,
9078,
685,
438,
562,
408,
1410,
13,
541,
66,
60,
1279,
2... | 2.058161 | 533 |
from setuptools import setup, find_packages
try:
with open("requirements.txt", "r") as f:
install_requires = [x.strip() for x in f.readlines()]
except IOError:
install_requires = []
setup(name = "statusdb",
version = "1.0.0",
author = "Science for Life Laboratory",
author_email = "genomics... | [
6738,
900,
37623,
10141,
1330,
9058,
11,
1064,
62,
43789,
198,
198,
28311,
25,
198,
220,
220,
220,
351,
1280,
7203,
8897,
18883,
13,
14116,
1600,
366,
81,
4943,
355,
277,
25,
198,
220,
220,
220,
220,
220,
220,
220,
2721,
62,
47911,
... | 2.81592 | 201 |
# __init__.py
__all__ = ["examples", "utils"]
| [
2,
11593,
15003,
834,
13,
9078,
198,
198,
834,
439,
834,
796,
14631,
1069,
12629,
1600,
366,
26791,
8973,
198
] | 2.35 | 20 |
# Generated by Django 3.0.7 on 2021-10-29 09:34
import ckeditor.fields
from django.db import migrations, models
import multiselectfield.db.fields
| [
2,
2980,
515,
416,
37770,
513,
13,
15,
13,
22,
319,
33448,
12,
940,
12,
1959,
7769,
25,
2682,
198,
198,
11748,
269,
9091,
2072,
13,
25747,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
198,
11748,
1963,
786,
801,
... | 3.020408 | 49 |
from cognipy.ontology import Ontology
# 180M
# def test_load_GO_extensions():
# Ontology("rdf/uri", "http://krr-nas.cs.ox.ac.uk/ontologies/lib/GO_extensions/x-anatomy-importer/2012-04-24/00040.owl")
# 240M
# def test_load_NCI():
# Ontology("rdf/uri", "http://krr-nas.cs.ox.ac.uk/ontologies/lib/NCI/v12.... | [
6738,
8866,
541,
88,
13,
756,
1435,
1330,
9463,
1435,
201,
198,
201,
198,
2,
11546,
44,
201,
198,
2,
825,
1332,
62,
2220,
62,
11230,
62,
2302,
5736,
33529,
201,
198,
2,
220,
220,
220,
220,
9463,
1435,
7203,
4372,
69,
14,
9900,
1... | 2.153527 | 241 |
print('-=-' * 20)
vel = int(input('A qual velocidade você esta dirigindo? '))
print('-=-' * 20)
print('-=-' * 20)
if vel > 80:
print('Você está andando há {}Km/h!!!!!, está acima do limite de 80Km/h'.format(vel))
mul = (vel - 80) * 7
print('Sinto em lhe dizer, mas você foi multado em {}R$'.format(mul))
else... | [
4798,
10786,
12,
10779,
6,
1635,
1160,
8,
198,
626,
796,
493,
7,
15414,
10786,
32,
4140,
11555,
420,
312,
671,
12776,
25792,
1556,
64,
26672,
328,
521,
78,
30,
705,
4008,
198,
4798,
10786,
12,
10779,
6,
1635,
1160,
8,
198,
4798,
1... | 2.248731 | 197 |
from .io import (
get_new_folder,
write_makefile_and_config,
)
from . import data
| [
6738,
764,
952,
1330,
357,
198,
220,
220,
220,
651,
62,
3605,
62,
43551,
11,
198,
220,
220,
220,
3551,
62,
15883,
7753,
62,
392,
62,
11250,
11,
198,
8,
198,
6738,
764,
1330,
1366,
628
] | 2.527778 | 36 |
# -*- coding: utf-8 -*-
"""
Legislative views.
"""
from __future__ import unicode_literals
from django.views.generic import DetailView, ListView
from legislative.models import Bill, BillVote, BillText, LegislativeSession, BillAction
class BillDetailView(DetailView):
"""
View showing detail information about ... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
11484,
3044,
876,
5009,
13,
198,
37811,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
6738,
42625,
14208,
13,
33571,
13,
41357,
... | 2.506231 | 642 |
#!/usr/bin/python
from .crosssections import * | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
198,
6738,
764,
19692,
23946,
1330,
1635
] | 3.133333 | 15 |
from django import forms
from django.contrib.auth.forms import UserCreationForm
from django.db import models
from django.forms.widgets import FileInput
from .models import USER_TYPE, BASIC_USER_TYPE, PROJECT_ADMIN_ADDABLE_USER_TYPE, User
from projects.models import Projects
from django.utils.translation import gettext... | [
6738,
42625,
14208,
1330,
5107,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
23914,
1330,
11787,
12443,
341,
8479,
198,
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
42625,
14208,
13,
23914,
13,
28029,
11407,
1330,
9220,
... | 3.363636 | 99 |
#
# PySNMP MIB module T11-FC-ROUTE-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/T11-FC-ROUTE-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 21:07:26 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar ... | [
2,
198,
2,
9485,
15571,
7378,
337,
9865,
8265,
309,
1157,
12,
4851,
12,
49,
2606,
9328,
12,
8895,
33,
357,
4023,
1378,
16184,
76,
489,
8937,
13,
785,
14,
79,
893,
11632,
8,
198,
2,
7054,
45,
13,
16,
2723,
2393,
1378,
14,
14490,
... | 2.450865 | 3,582 |
from .piecewise import *
__version__ = '0.15.0'
| [
6738,
764,
12239,
3083,
1330,
1635,
198,
198,
834,
9641,
834,
796,
705,
15,
13,
1314,
13,
15,
6,
198
] | 2.45 | 20 |
from typing import Generator
import pytest
from fastapi import FastAPI
from fastapi.testclient import TestClient
from repository.db import init_db, SessionLocal
from router.api import api_router
import models
@pytest.fixture(scope="session")
@pytest.fixture(scope="session")
@pytest.fixture(scope="function") | [
6738,
19720,
1330,
35986,
198,
11748,
12972,
9288,
198,
6738,
3049,
15042,
1330,
12549,
17614,
198,
6738,
3049,
15042,
13,
9288,
16366,
1330,
6208,
11792,
198,
6738,
16099,
13,
9945,
1330,
2315,
62,
9945,
11,
23575,
14565,
198,
6738,
2026... | 3.52809 | 89 |
from __future__ import unicode_literals
from django.db import models
from django.core.urlresolvers import reverse
# Create your models here.
| [
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
42625,
14208,
13,
7295,
13,
6371,
411,
349,
690,
1330,
9575,
628,
198,
2,
13610,
534,
4981,
994,
13,
198
] | 3.512195 | 41 |
import board
import busio
import digitalio
import adafruit_rfm9x
# Define radio parameters.
RADIO_FREQ_MHZ = 915.0 # Frequency of the radio in Mhz. Must match your
# module! Can be a value like 915.0, 433.0, etc.
# Define pins connected to the chip, use these if wiring up the breakout a... | [
11748,
3096,
198,
11748,
1323,
952,
198,
11748,
4875,
952,
198,
198,
11748,
512,
1878,
4872,
62,
81,
38353,
24,
87,
628,
198,
2,
2896,
500,
5243,
10007,
13,
198,
49,
2885,
9399,
62,
37,
2200,
48,
62,
36208,
57,
220,
220,
796,
860,... | 2.743038 | 790 |
# pylint:disable=unused-variable
# pylint:disable=unused-argument
# pylint:disable=redefined-outer-name
from typing import Any, Dict
import pytest
from simcore_sdk.node_ports_v2 import DBManager, exceptions
from simcore_sdk.node_ports_v2.serialization_v2 import dump, load
@pytest.mark.parametrize("auto_update", [Tr... | [
2,
279,
2645,
600,
25,
40223,
28,
403,
1484,
12,
45286,
198,
2,
279,
2645,
600,
25,
40223,
28,
403,
1484,
12,
49140,
198,
2,
279,
2645,
600,
25,
40223,
28,
445,
18156,
12,
39605,
12,
3672,
198,
198,
6738,
19720,
1330,
4377,
11,
... | 2.830508 | 118 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import random
from os import environ
from mezmorize import Cache
if True:
config = {
'DEBUG': True,
'CACHE_TYPE': 'memcached',
'CACHE_MEMCACHED_SERVERS': [environ.get('MEMCACHE_SERVERS')]}
else:
config = {'CACHE_TYPE': 'simple'}
cache = C... | [
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,
4738,
198,
198,
6738,
28686,
1330,
551,
2268,
198,
6738,
502,
89,
4491,
1096,
1330,
34088,
198,
198,
361,
... | 2.11396 | 351 |
import unittest
from vartriage.core import Variant, VCF
from vartriage.exceptions import VariantException
| [
11748,
555,
715,
395,
198,
198,
6738,
410,
433,
4087,
13,
7295,
1330,
38215,
11,
569,
22495,
198,
6738,
410,
433,
4087,
13,
1069,
11755,
1330,
38215,
16922,
628,
198
] | 3.633333 | 30 |
import numpy as np
from sentence_transformers import SentenceTransformer
import scipy.sparse
import warnings
from contextualized_topic_models.datasets.dataset import CTMDataset
from sklearn.feature_extraction.text import CountVectorizer
def get_bag_of_words(data, min_length):
"""
Creates the bag of words
... | [
11748,
299,
32152,
355,
45941,
198,
6738,
6827,
62,
35636,
364,
1330,
11352,
594,
8291,
16354,
198,
11748,
629,
541,
88,
13,
82,
29572,
198,
11748,
14601,
198,
6738,
38356,
1143,
62,
26652,
62,
27530,
13,
19608,
292,
1039,
13,
19608,
... | 2.490846 | 1,147 |
# strawpoll module by CantSayIHave
# Created 2018/01/26
#
# Create polls because why do more work when the bot can
import json
import aiohttp
| [
2,
14787,
30393,
8265,
416,
16821,
25515,
40,
11980,
198,
2,
15622,
2864,
14,
486,
14,
2075,
198,
2,
198,
2,
13610,
9231,
780,
1521,
466,
517,
670,
618,
262,
10214,
460,
198,
11748,
33918,
198,
198,
11748,
257,
952,
4023,
628
] | 3.428571 | 42 |
'''
Pattern
Enter number of rows: 5
1
23
345
4567
56789
'''
print('number pattern: ')
number_rows=int(input('Enter number of rows: '))
for row in range(0,number_rows+1):
k=row
for column in range(1,row+2):
k=k+1
if k < 10:
print(f'0{k}',end=' ')
else:
print(k,end=' ')
print() | [
7061,
6,
201,
198,
47546,
201,
198,
17469,
1271,
286,
15274,
25,
642,
201,
198,
16,
201,
198,
1954,
201,
198,
27712,
201,
198,
2231,
3134,
201,
198,
20,
3134,
4531,
201,
198,
7061,
6,
201,
198,
4798,
10786,
17618,
3912,
25,
705,
8... | 1.987179 | 156 |
from typing import List
import requests
from flask import current_app
from chubbyrepo.core.entities import OrganizationStats, Repository
from chubbyrepo.core.gateways import RepositoryGateway as BaseRepositoryGateway
from chubbyrepo.core.gateways import StatsGateway as BaseStatsGateway
from chubbyrepo.core.gateways i... | [
6738,
19720,
1330,
7343,
198,
198,
11748,
7007,
198,
6738,
42903,
1330,
1459,
62,
1324,
198,
198,
6738,
442,
38393,
260,
7501,
13,
7295,
13,
298,
871,
1330,
12275,
29668,
11,
1432,
13264,
198,
6738,
442,
38393,
260,
7501,
13,
7295,
13... | 3.369128 | 149 |
from cwb.common.config_parser import \
construct_single_distribution, \
construct_distribution_list, \
construct_regularizer, \
construct_regularizer_derivative, \
construct_optimizer, \
load_empirical_npz
from cwb.common.distributions import \
uniform_nd_tf, \
... | [
6738,
269,
39346,
13,
11321,
13,
11250,
62,
48610,
1330,
3467,
198,
220,
220,
220,
220,
220,
220,
220,
5678,
62,
29762,
62,
17080,
3890,
11,
3467,
198,
220,
220,
220,
220,
220,
220,
220,
5678,
62,
17080,
3890,
62,
4868,
11,
3467,
... | 2.734756 | 328 |
import sys
import numpy as np
import zmq
import time
import cv2
from skimage.filters import threshold_otsu
from skimage.color import rgb2gray
import skimage.io as io
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
| [
11748,
25064,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
1976,
76,
80,
198,
11748,
640,
198,
11748,
269,
85,
17,
198,
6738,
1341,
9060,
13,
10379,
1010,
1330,
11387,
62,
1747,
84,
198,
6738,
1341,
9060,
13,
8043,
1330,
46140,
17,... | 3.164384 | 73 |
#!/usr/bin/env python
# coding: utf-8
import logging
import warnings
from datetime import datetime
import sys
import numpy as np
from train import data_prep, train_elasticnet
import mlflow
from mlflow.entities import ViewType
from mlflow.tracking import MlflowClient
import optuna
if __name__ == "__main__":
... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
19617,
25,
3384,
69,
12,
23,
198,
198,
11748,
18931,
198,
11748,
14601,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
11748,
25064,
198,
198,
11748,
299,
32152,
355,
45941,
198,
198... | 2.474412 | 723 |
import os
import pyttsx3
import speech_recognition as sr
import wikipedia
import aiml
import wx.adv
import wolframalpha
import winsound | [
11748,
28686,
201,
198,
11748,
12972,
83,
912,
87,
18,
201,
198,
11748,
4046,
62,
26243,
653,
355,
19677,
201,
198,
11748,
47145,
11151,
201,
198,
201,
198,
11748,
4031,
75,
201,
198,
11748,
266,
87,
13,
32225,
201,
198,
11748,
17481,... | 2.938776 | 49 |
from flask import Flask
app = Flask(__name__)
app.config.from_envvar('PORTRA_SETTINGS')
import portra.views
if __name__ == '__main__':
exit(app.run(debug=True))
| [
6738,
42903,
1330,
46947,
198,
198,
1324,
796,
46947,
7,
834,
3672,
834,
8,
198,
1324,
13,
11250,
13,
6738,
62,
24330,
7785,
10786,
15490,
3861,
62,
28480,
51,
20754,
11537,
198,
198,
11748,
2493,
430,
13,
33571,
198,
198,
361,
11593,... | 2.584615 | 65 |
from sql_alchemy import db
| [
6738,
44161,
62,
282,
26599,
1330,
20613,
628
] | 3.5 | 8 |
from django.contrib import admin
from .models import Follow
admin.site.register(Follow, FollowAdmin)
| [
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
198,
6738,
764,
27530,
1330,
7281,
628,
198,
198,
28482,
13,
15654,
13,
30238,
7,
7155,
11,
7281,
46787,
8,
198
] | 3.5 | 30 |
from ..utils.utils import resize_array | [
6738,
11485,
26791,
13,
26791,
1330,
47558,
62,
18747
] | 4.222222 | 9 |
from .chatchart import supposedly
| [
6738,
764,
354,
963,
433,
1330,
13519,
628
] | 4.375 | 8 |
import numpy as np
from h5py import VirtualLayout, VirtualSource
from ndindex import Slice, ndindex, Tuple, ChunkSize
from .hashtable import Hashtable
DEFAULT_CHUNK_SIZE = 2**12
def write_dataset_chunks(f, name, data_dict, shape=None):
"""
data_dict should be a dictionary mapping chunk_size index to either ... | [
11748,
299,
32152,
355,
45941,
198,
6738,
289,
20,
9078,
1330,
15595,
32517,
11,
15595,
7416,
198,
6738,
299,
67,
9630,
1330,
3454,
501,
11,
299,
67,
9630,
11,
309,
29291,
11,
609,
2954,
10699,
198,
198,
6738,
764,
17831,
11487,
1330,... | 2.201431 | 978 |
#!/usr/bin/python
# Copyright (c) 2013, 2014 All Right Reserved, TECO, http://www.teco.edu
#
# THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
# KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
# PARTICULAR PURPOSE.
... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
15069,
357,
66,
8,
2211,
11,
1946,
1439,
6498,
33876,
11,
309,
2943,
46,
11,
2638,
1378,
2503,
13,
660,
1073,
13,
15532,
198,
2,
198,
2,
12680,
42714,
5357,
38044,
15986,
36592,
2389,
... | 2.838983 | 472 |
"""Source code copied and adjusted from or-rl-benchmarks.
GitHub:
https://github.com/awslabs/or-rl-benchmarks
License:
Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation fil... | [
37811,
7416,
2438,
18984,
290,
12328,
422,
393,
12,
45895,
12,
26968,
14306,
13,
198,
198,
38,
270,
16066,
25,
198,
5450,
1378,
12567,
13,
785,
14,
707,
6649,
8937,
14,
273,
12,
45895,
12,
26968,
14306,
198,
198,
34156,
25,
198,
152... | 2.947781 | 766 |
from darkchess.src.board import Board
from darkchess.src.gamengine import GameEngine
from darkchess.src.darkboard import DarkBoard
dark_mode = False
ans = ''
while 'y' not in ans and 'n' not in ans:
ans = input("Do you want to play in dark mode? (y/n): ")
if 'y' in ans:
dark_mode = True
if dark_mode:
boa... | [
6738,
3223,
2395,
824,
13,
10677,
13,
3526,
1330,
5926,
198,
6738,
3223,
2395,
824,
13,
10677,
13,
28483,
18392,
1330,
3776,
13798,
198,
6738,
3223,
2395,
824,
13,
10677,
13,
21953,
3526,
1330,
3801,
29828,
198,
198,
21953,
62,
14171,
... | 2.601896 | 211 |
'''
Spider for IMDb
- Retrieve most popular movies & TV series with rating of 8.0 and above
- Crawl next pages recursively
'''
from scrapy.contrib.spiders import CrawlSpider, Rule
from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor
from scrapy.selector import Selector
from scrapy_tutorial.items import Sc... | [
7061,
6,
198,
41294,
329,
8959,
43832,
198,
12,
4990,
30227,
749,
2968,
6918,
1222,
3195,
2168,
351,
7955,
286,
807,
13,
15,
290,
2029,
198,
12,
327,
13132,
1306,
5468,
664,
1834,
2280,
198,
7061,
6,
198,
198,
6738,
15881,
88,
13,
... | 3.230769 | 104 |
# Generated by Django 3.0.7 on 2020-07-21 13:20
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
513,
13,
15,
13,
22,
319,
12131,
12,
2998,
12,
2481,
1511,
25,
1238,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
# @Time : 2022/4/3 12:54
# @Author : qyellS
# @File : dataprocess.py
# @Software: PyCharm
# @Time : 2022/3/28 12:34
# @Author : xx
# @File : dataprocess_Diqos.py
# @Software: PyCharm
import os
import numpy as np
import pandas as pd
import random
import pickle
home_path = os.path.dirname(o... | [
2,
2488,
7575,
1058,
33160,
14,
19,
14,
18,
1105,
25,
4051,
220,
201,
198,
201,
198,
2,
2488,
13838,
1058,
10662,
88,
695,
50,
201,
198,
201,
198,
2,
2488,
8979,
1058,
4818,
499,
305,
919,
13,
9078,
220,
201,
198,
201,
198,
2,
... | 1.795377 | 1,168 |
import os
import re
import werkzeug
from flask import Flask, Response, request, render_template
from flask_mwoauth import MWOAuth
from builtins import input
from T120439 import WdCatTool
app = Flask(__name__)
from config import secret_key
app.secret_key = secret_key
@app.route("/")
wikiname_regex = re.compile(r'^[a... | [
11748,
28686,
198,
11748,
302,
198,
11748,
266,
9587,
2736,
1018,
198,
6738,
42903,
1330,
46947,
11,
18261,
11,
2581,
11,
8543,
62,
28243,
198,
6738,
42903,
62,
76,
86,
12162,
1071,
1330,
29961,
23621,
1071,
198,
6738,
3170,
1040,
1330,... | 2.668478 | 184 |
# -*- coding: utf-8 -*-
# @Time : 2018/3/29 上午10:06
# @Author : Azrael.Bai
# @File : reverse_string.py
if __name__ == '__main__':
s = Solution()
print(s.reverseString("abcdefg"))
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2488,
7575,
220,
220,
220,
1058,
2864,
14,
18,
14,
1959,
220,
41468,
39355,
230,
940,
25,
3312,
198,
2,
2488,
13838,
220,
1058,
7578,
2510,
13,
33,
1872,
198,
2,
... | 2.095745 | 94 |
if __name__ == "__main__":
print(can_sum_tab(7, [5, 3, 4]))
print(can_sum_tab(7, [2, 4]))
print(can_sum_tab(300, [7, 14]))
| [
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
3601,
7,
5171,
62,
16345,
62,
8658,
7,
22,
11,
685,
20,
11,
513,
11,
604,
60,
4008,
198,
220,
220,
220,
3601,
7,
5171,
62,
16345,
62,
8658,
... | 1.826667 | 75 |
"""Hanashiai - Core model module."""
import logging
from datetime import datetime
from prawcore.exceptions import ResponseException
from .exceptions import RedditResponseError
class Submission():
"""Reddit submission object.
"""
@property
@property
@property
def get_comments(self, replac... | [
37811,
29919,
1077,
544,
72,
532,
7231,
2746,
8265,
526,
15931,
198,
11748,
18931,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
198,
6738,
279,
1831,
7295,
13,
1069,
11755,
1330,
18261,
16922,
198,
198,
6738,
764,
1069,
11755,
1330,
10... | 2.258679 | 893 |
# -*- coding: utf-8 -*-
import subprocess
import sys
if __name__ == "__main__":
print("")
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
850,
14681,
198,
11748,
25064,
628,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
3601,
7203,
4943,
198
] | 2.365854 | 41 |
import sys
import argparse
from os.path import join, abspath, dirname
sys.path.append(dirname(dirname(join(abspath(__file__)))))
from map import generate
NODES_RANGE = [8, 8]
COST_RANGE = [10, 500]
OBJECTS_RANGE = [4, 4]
OCCURRENCES_RANGE = [1, 4]
if __name__ == "__main__":
parser = argparse.ArgumentParser()
... | [
11748,
25064,
198,
11748,
1822,
29572,
198,
6738,
28686,
13,
6978,
1330,
4654,
11,
2352,
6978,
11,
26672,
3672,
198,
17597,
13,
6978,
13,
33295,
7,
15908,
3672,
7,
15908,
3672,
7,
22179,
7,
397,
2777,
776,
7,
834,
7753,
834,
4008,
2... | 2.350427 | 234 |
#!/usr/bin/env python3
from sklearn.utils import shuffle
from sklearn.model_selection import train_test_split
import tensorflow as tf
import numpy as np
import shutil
import csv
import os
MODEL = '0'
DATASET = 'sonar.all-data'
OUTPUT = ['R', 'M']
INPS = 60
OUTS = len(OUTPUT)
RATE = 0.1
EPOCHS = 200
print('rea... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
6738,
1341,
35720,
13,
26791,
1330,
36273,
198,
6738,
1341,
35720,
13,
19849,
62,
49283,
1330,
4512,
62,
9288,
62,
35312,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
11748,
299,
... | 2.439374 | 767 |
from collections import defaultdict
from queue import Queue
from typing import List
from days import AOCDay, day
DEBUG = False
INFO = False
VISUALIZE = False
INSTR_ADD = 1
INSTR_MUL = 2
INSTR_INP = 3
INSTR_OUT = 4
INSTR_JIT = 5
INSTR_JIF = 6
INSTR_LT = 7
INSTR_EQ = 8
INSTR_REB = 9
INSTR_END = 99
MODE_POS = 0
MOD... | [
6738,
17268,
1330,
4277,
11600,
198,
6738,
16834,
1330,
4670,
518,
198,
6738,
19720,
1330,
7343,
198,
198,
6738,
1528,
1330,
317,
4503,
12393,
11,
1110,
198,
198,
30531,
796,
10352,
198,
10778,
796,
10352,
198,
29817,
25620,
35400,
796,
... | 2.398649 | 148 |
import numpy as np
from streamad.util import (
MultivariateDS,
StreamGenerator,
StreamStatistic,
UnivariateDS,
)
| [
11748,
299,
32152,
355,
45941,
198,
6738,
4269,
324,
13,
22602,
1330,
357,
198,
220,
220,
220,
7854,
42524,
5258,
11,
198,
220,
220,
220,
13860,
8645,
1352,
11,
198,
220,
220,
220,
13860,
17126,
2569,
11,
198,
220,
220,
220,
791,
42... | 2.66 | 50 |
#!/usr/bin/env python
### TlsrMemInfo.py ###
### Autor: pvvx ###
import sys
import signal
import struct
import platform
import time
import argparse
import subprocess
import os
import io
__progname__ = "TLSR826x MemInfo"
__filename__ = "TlsrMemInfo"
__version__ = "0.1beta"
#tool_nm = "e:/Telink/SDK/opt/tc32/bin... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
220,
198,
21017,
309,
7278,
81,
13579,
12360,
13,
9078,
44386,
198,
21017,
220,
5231,
273,
25,
279,
25093,
87,
220,
220,
44386,
198,
220,
198,
11748,
25064,
198,
11748,
6737,
198,
1174... | 2.402402 | 333 |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""Pokemon Go bot.
This bot will catch them all.
"""
from ConfigParser import SafeConfigParser
from polib.polib import *
import datetime
import time
import sys
import os
import signal
import random
__author__ = 'Mikael Kall'
__email__ = 'kall.micke@gmail.com'
"""Setu... | [
2,
0,
1220,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
48034,
1514,
10214,
13,
198,
198,
1212,
10214,
481,
4929,
606,
477,
13,
198,
198,
37811,
198,
198,
6738,
170... | 2.410811 | 370 |
import ev_reduce as ev3
| [
11748,
819,
62,
445,
7234,
355,
819,
18,
198
] | 2.666667 | 9 |
import Controlador as pid
import Plant_Data as tank
#import Frontend_v6 as UI
if __name__ == '__main__':
tank.plant.start()
pid.control.set_controller_gain(Kp=3, Ki=30, Kd=0, ind='1')
pid.control.set_controller_gain(Kp=2.7, Ki=40, Kd=1, ind='2')
pid.control.plant = tank.plant
while True:
... | [
11748,
6779,
7079,
355,
46514,
198,
11748,
16561,
62,
6601,
355,
6873,
198,
2,
11748,
8880,
437,
62,
85,
21,
355,
12454,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
6873,
13,
15060,
13,
96... | 2.414013 | 157 |
"""
Exercise 4
Write a function called middle that takes a list and returns
a new list that contains all but the first and last elements.
So middle([1,2,3,4]) should return [2,3].
"""
print(middle([1, 2, 3, 4]))
| [
37811,
201,
198,
3109,
23697,
604,
201,
198,
16594,
257,
2163,
1444,
3504,
326,
2753,
257,
1351,
290,
5860,
201,
198,
64,
649,
1351,
326,
4909,
477,
475,
262,
717,
290,
938,
4847,
13,
201,
198,
2396,
3504,
26933,
16,
11,
17,
11,
1... | 2.8125 | 80 |
import unittest
import numpy as np
from bioslds.variance import OnlineVariance
from bioslds.monitor import AttributeMonitor
if __name__ == "__main__":
unittest.main()
| [
11748,
555,
715,
395,
198,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
37140,
335,
82,
13,
25641,
590,
1330,
7467,
23907,
590,
198,
6738,
37140,
335,
82,
13,
41143,
1330,
3460,
4163,
35479,
628,
628,
628,
198,
361,
11593,
3672... | 2.983333 | 60 |
#!/usr/bin/env python
"""
This module introduces the SpecOneD class, it's functions and the related
PassBand class.
The main purpose of the SpecOneD class and it's children classes is to provide
python functionality for the manipulation of 1D spectral data in astronomy.
"""
import numpy as np
import scipy as sp
imp... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
37811,
198,
1212,
8265,
20718,
262,
18291,
3198,
35,
1398,
11,
340,
338,
5499,
290,
262,
3519,
198,
14478,
31407,
1398,
13,
198,
464,
1388,
4007,
286,
262,
18291,
3198,
35,
1398,
... | 2.124427 | 60,598 |
from django.db import models
from shortener.models import KirrURL
class ClickEvent(models.Model):
"""Model definition for ClickEvent."""
kirr_url= models.OneToOneField(KirrURL)
count = models.IntegerField(default=0)
updated = models.DateTimeField(auto_now=True)
created = models.DateTimeField(aut... | [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
1790,
877,
13,
27530,
1330,
7385,
81,
21886,
628,
198,
4871,
6914,
9237,
7,
27530,
13,
17633,
2599,
198,
220,
220,
220,
37227,
17633,
6770,
329,
6914,
9237,
526,
15931,
198,
220,
22... | 2.748663 | 187 |
import rospy
import rostest
import time
def wait_for_param(param_name, timeout=None, poll_rate=0.1):
'''Blocking wait for a parameter named $parameter_name to exist
Poll at frequency $poll_rate
Once the parameter exists, return get and return it.
This function intentionally leaves failure log... | [
11748,
686,
2777,
88,
198,
11748,
686,
301,
395,
198,
11748,
640,
628,
198,
4299,
4043,
62,
1640,
62,
17143,
7,
17143,
62,
3672,
11,
26827,
28,
14202,
11,
3278,
62,
4873,
28,
15,
13,
16,
2599,
198,
220,
220,
220,
705,
7061,
3629,
... | 2.53481 | 948 |
# pylint: disable=missing-docstring,unused-argument,too-few-public-methods
import typing
target(1, keyword=2)
PARAM = 1
target(2, PARAM) # [too-many-function-args, missing-kwoa]
other_function(param=2)
| [
2,
279,
2645,
600,
25,
15560,
28,
45688,
12,
15390,
8841,
11,
403,
1484,
12,
49140,
11,
18820,
12,
32146,
12,
11377,
12,
24396,
82,
198,
11748,
19720,
628,
628,
628,
198,
16793,
7,
16,
11,
21179,
28,
17,
8,
198,
198,
27082,
2390,
... | 2.621951 | 82 |
#!/usr/bin/env python
import os
import sys
import glob
import rospy
import re
import json
import cv2
import threading
import numpy as np
from cv_bridge import CvBridge
from sensor_msgs import msg as smsg
from geometry_msgs import msg as gmsg
from aist_depth_filter import DepthFilterClient
from tf import TransformBroad... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
28686,
198,
11748,
25064,
198,
11748,
15095,
198,
11748,
686,
2777,
88,
198,
11748,
302,
198,
11748,
33918,
198,
11748,
269,
85,
17,
198,
11748,
4704,
278,
198,
11748,
299,
... | 2.628422 | 767 |
import numpy as np
import matplotlib.pyplot as plt
nw=1001
niw=100
beta=10.
wgrid=np.linspace(-5,5,nw)
iwgrid=np.pi/beta*(2*np.arange(niw)+1)
giw=np.zeros_like(iwgrid,dtype=np.complex)
sigma=0.0001
aw=gauss_peak(-1.,0.2,1.,wgrid)+gauss_peak(1.,0.2,1.,wgrid)
norm=np.trapz(aw,wgrid)
aw=aw/norm
np.savetxt('spectrum.... | [
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
628,
628,
198,
47516,
28,
47705,
198,
8461,
86,
28,
3064,
198,
31361,
28,
940,
13,
198,
86,
25928,
28,
37659,
13,
21602,
10223,
32590,
20,
... | 1.988604 | 351 |
# -*- coding: utf-8 -*-
# Copyright 2017 LasLabs Inc.
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
from odoo import api, fields, models, tools
from ..image_constants import (
NONE,
GLOBAL,
CATEGORY,
GLOBAL_CATEGORY,
)
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
15069,
2177,
10123,
43,
8937,
3457,
13,
198,
2,
13789,
17370,
6489,
12,
18,
13,
15,
393,
1568,
357,
4023,
1378,
2503,
13,
41791,
13,
2398,
14,
677,
4541,
14,
75,
... | 2.289474 | 114 |
"""Unit test package for pdok_ls_lib."""
| [
37811,
26453,
1332,
5301,
329,
279,
67,
482,
62,
7278,
62,
8019,
526,
15931,
198
] | 2.733333 | 15 |
# Definition for a binary tree node.
# class TreeNode:
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None | [
2,
30396,
329,
257,
13934,
5509,
10139,
13,
198,
2,
1398,
12200,
19667,
25,
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,
2116,
13,
2100,
796,
2124,
1... | 2.175676 | 74 |
import pyglet
pyglet.options['shadow_window'] = False
pyglet.options['debug_gl'] = False
| [
11748,
12972,
70,
1616,
198,
198,
9078,
70,
1616,
13,
25811,
17816,
19106,
62,
17497,
20520,
796,
10352,
198,
9078,
70,
1616,
13,
25811,
17816,
24442,
62,
4743,
20520,
796,
10352,
628
] | 2.84375 | 32 |
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import calmap
all_days = pd.date_range('1/15/2014', periods=700, freq='D')
days = np.random.choice(all_days, 500)
events = pd.Series(np.random.randn(len(days)), index=days)
calmap.yearplot(events, year=2015)
plt.show()
| [
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
2386,
8899,
628,
198,
439,
62,
12545,
796,
279,
67,
13,
4475,
62,
9521,
10786,
16,
14,
13... | 2.584071 | 113 |
from simple_term_menu import TerminalMenu
| [
6738,
2829,
62,
4354,
62,
26272,
1330,
24523,
23381,
628
] | 4.3 | 10 |
#!/usr/bin/env python2
# vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab
import os, sys
import signal
import threading
import subprocess
from subprocess import Popen, PIPE, STDOUT
# **heavily** chopped up and modfied version of asyncproc.py
# to make it actually work on Windows as well as Mac/Linux
# For the original ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
17,
198,
2,
43907,
25,
912,
28,
19,
25,
2032,
28,
19,
25,
4215,
8658,
11338,
28,
19,
25,
27004,
8658,
25,
11201,
392,
8658,
198,
198,
11748,
28686,
11,
25064,
198,
11748,
6737,
198,
117... | 3.297214 | 323 |
from typing import Tuple, Union
import tensorflow as tf
from models.source_graph.regression.source_graph_regression_model import SourceGraphRegressionModel
| [
6738,
19720,
1330,
309,
29291,
11,
4479,
201,
198,
201,
198,
11748,
11192,
273,
11125,
355,
48700,
201,
198,
201,
198,
6738,
4981,
13,
10459,
62,
34960,
13,
2301,
2234,
13,
10459,
62,
34960,
62,
2301,
2234,
62,
19849,
1330,
8090,
3706... | 3.367347 | 49 |
from django.urls import path
from . import views
app_name = 'toy'
urlpatterns = [
path('<int:pk>/', views.ToyEditView.as_view(), name='edit'),
path('', views.ToyListView.as_view(), name='list'),
]
| [
6738,
42625,
14208,
13,
6371,
82,
1330,
3108,
198,
198,
6738,
764,
1330,
5009,
198,
198,
1324,
62,
3672,
796,
705,
83,
726,
6,
198,
6371,
33279,
82,
796,
685,
198,
220,
220,
220,
3108,
10786,
27,
600,
25,
79,
74,
29,
14,
3256,
5... | 2.52439 | 82 |
# Copyright (c) 2017, Apple Inc. All rights reserved.
#
# Use of this source code is governed by a BSD-3-clause license that can be
# found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
import itertools
import os
import shutil
import tempfile
import unittest
import numpy as np
import pyte... | [
2,
15069,
357,
66,
8,
2177,
11,
4196,
3457,
13,
1439,
2489,
10395,
13,
198,
2,
198,
2,
5765,
286,
428,
2723,
2438,
318,
21825,
416,
257,
347,
10305,
12,
18,
12,
565,
682,
5964,
326,
460,
307,
198,
2,
1043,
287,
262,
38559,
24290... | 1.980867 | 3,345 |
# -*- coding: utf-8 -*-
import time, sys, getpass, signal, struct
from lib.honcore.client import HoNClient
from lib.honcore.exceptions import *
from lib.honcore.constants import *
from hashlib import md5
if __name__ == '__main__':
main()
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
640,
11,
25064,
11,
651,
6603,
11,
6737,
11,
2878,
198,
6738,
9195,
13,
24130,
7295,
13,
16366,
1330,
9544,
45,
11792,
198,
6738,
9195,
13,
24130,
7295,
13,
106... | 2.848837 | 86 |
# Remove K Digits
if __name__ == "__main__":
sol = Solution()
num = "10"
k = 1
num = "112"
k = 1
print(sol.removeKdigits(num, k))
| [
2,
17220,
509,
7367,
896,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
1540,
796,
28186,
3419,
198,
220,
220,
220,
997,
796,
366,
940,
1,
198,
220,
220,
220,
479,
796,
352,
198,
220,
220,
... | 2.066667 | 75 |
from django.db import models
from django.contrib.auth.models import User
# Create your models here. | [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
27530,
1330,
11787,
198,
198,
2,
13610,
534,
4981,
994,
13
] | 3.571429 | 28 |
# Copyright (c) 2017 The Regents of the University of Michigan
# All rights reserved.
# This software is licensed under the BSD 3-Clause License.
import unittest
import os
import uuid
import warnings
import logging
import json
import pickle
from tarfile import TarFile
from zipfile import ZipFile
import signac
from sig... | [
2,
15069,
357,
66,
8,
2177,
383,
3310,
658,
286,
262,
2059,
286,
7055,
198,
2,
1439,
2489,
10395,
13,
198,
2,
770,
3788,
318,
11971,
739,
262,
347,
10305,
513,
12,
2601,
682,
13789,
13,
198,
11748,
555,
715,
395,
198,
11748,
28686... | 3.154812 | 478 |
# -*- coding: utf-8 -*-
"""
@date: 2020/9/29 下午3:31
@file: i3d_head.py
@author: zj
@description:
"""
import torch
import torch.nn as nn
from tsn.model import registry
@registry.HEAD.register('I3DHead')
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
37811,
198,
31,
4475,
25,
12131,
14,
24,
14,
1959,
220,
10310,
233,
39355,
230,
18,
25,
3132,
198,
31,
7753,
25,
1312,
18,
67,
62,
2256,
13,
9078,
198,
31,
98... | 2.212766 | 94 |
#!/usr/bin/env python
#
# Extracts constants from Clang's CXCursorKind enum and renames them
# according to Java name conventions.
#
# Prints almost a ready-to-use Java enum body to stdout.
# Doesn't handle the case of one enum value initialization by the other
# (e.g. AsmStmt=GCCAsmStmt)
import sys
if len(sys.argv)... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
220,
198,
2,
29677,
82,
38491,
422,
1012,
648,
338,
327,
55,
34,
21471,
35854,
33829,
290,
8851,
1047,
606,
198,
2,
1864,
284,
7349,
1438,
21396,
13,
198,
2,
198,
2,
12578,
82,
... | 2.349887 | 443 |
import pytest
from codewatch.defaults import (
create_directory_filter,
create_file_filter,
)
@pytest.mark.parametrize('dir_name,directory_filters,expected_output', [
('migrations', None, False),
('migrations', [], True),
('normal_dir', None, True),
('another_normal', None, True),
# the... | [
11748,
12972,
9288,
198,
198,
6738,
14873,
413,
963,
13,
12286,
82,
1330,
357,
198,
220,
220,
220,
2251,
62,
34945,
62,
24455,
11,
198,
220,
220,
220,
2251,
62,
7753,
62,
24455,
11,
198,
8,
628,
198,
31,
9078,
9288,
13,
4102,
13,
... | 2.495146 | 412 |
"""
BluePrint for all Authontication routs and logic
Use "from passlib.hash import sha256_crypt" as our encryption library
User information stored in the session (Backend) as a dictionary
And accessible from any route
30% written by Alex Kohanim
70% written By Akshay Kasar
If any questions arise from this blueprint... | [
37811,
198,
14573,
18557,
329,
477,
26828,
756,
3299,
3441,
82,
290,
9156,
198,
198,
11041,
366,
6738,
1208,
8019,
13,
17831,
1330,
427,
64,
11645,
62,
29609,
1,
355,
674,
15835,
5888,
198,
198,
12982,
1321,
8574,
287,
262,
6246,
357,... | 3.615385 | 273 |
import socket
# for getting public ip:
from json import load
from urllib.request import urlopen
import ssl
# HACK: this makes the urllib requrest work for getting the public ip
ssl._create_default_https_context = ssl._create_unverified_context
import time
import random
# for async
from multiprocessing import Pool # ... | [
11748,
17802,
198,
198,
2,
329,
1972,
1171,
20966,
25,
198,
6738,
33918,
1330,
3440,
198,
6738,
2956,
297,
571,
13,
25927,
1330,
19016,
9654,
198,
11748,
264,
6649,
198,
2,
367,
8120,
25,
428,
1838,
262,
2956,
297,
571,
1038,
2118,
... | 3.731343 | 134 |
import mock
import logging
from carrot.mocks import MessageSerializer, Connection, Properties
from django.test import TestCase, RequestFactory
from django.test.utils import override_settings
from carrot.consumer import Consumer, ConsumerSet
from carrot.objects import VirtualHost
from carrot.models import MessageLog, S... | [
11748,
15290,
198,
11748,
18931,
198,
6738,
40562,
13,
76,
3320,
1330,
16000,
32634,
7509,
11,
26923,
11,
24946,
198,
6738,
42625,
14208,
13,
9288,
1330,
6208,
20448,
11,
19390,
22810,
198,
6738,
42625,
14208,
13,
9288,
13,
26791,
1330,
... | 3.122222 | 270 |
import os
from pywps import Process, LiteralInput
from pywps import ComplexInput, ComplexOutput
from pywps import Format, FORMATS
from pywps.app.Common import Metadata
import logging
LOGGER = logging.getLogger("PYWPS")
PROCESSES_HOME = os.path.abspath(os.path.dirname(__file__))
MOVIE_PLOT = os.path.join(PROCESSES_H... | [
11748,
28686,
198,
198,
6738,
12972,
86,
862,
1330,
10854,
11,
25659,
1691,
20560,
198,
6738,
12972,
86,
862,
1330,
19157,
20560,
11,
19157,
26410,
198,
6738,
12972,
86,
862,
1330,
18980,
11,
49144,
33586,
198,
6738,
12972,
86,
862,
13,... | 2.897436 | 156 |
# Importations
import streamlit as st
import plotly.express as px
import numpy as np
from collections import Counter
import pandas as pd
import time
import os
import plotly.graph_objects as go
import webbrowser
from sklearn.linear_model import LinearRegression
from sklearn.preprocessing import PolynomialFeatures
from s... | [
2,
17267,
602,
198,
11748,
4269,
18250,
355,
336,
198,
11748,
7110,
306,
13,
42712,
355,
279,
87,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
17268,
1330,
15034,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
640,
198,
11748,
28... | 1.651897 | 36,087 |
import os
class path_helper():
"""
Function return trust platform home directory
"""
@staticmethod
def get_home_path():
"""
Function returns trust platform home directory path
Outputs:
Returns current_path or None
Current_path trus... | [
11748,
28686,
198,
198,
4871,
3108,
62,
2978,
525,
33529,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
15553,
1441,
3774,
3859,
1363,
8619,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
2488,
12708,
24396,
198,
220,
220,
220,
825,
... | 2.004219 | 474 |
import types
import inspect
import typing
class ModuleDecorator:
"""Apply decorator to all objects in module"""
def decorate_obj(
self,
module: types.ModuleType,
name: str,
obj: typing.Any,
):
"""Given a module and an object decorate the object.
If the obj ... | [
11748,
3858,
198,
11748,
10104,
198,
11748,
19720,
628,
198,
4871,
19937,
10707,
273,
1352,
25,
198,
220,
220,
220,
37227,
44836,
11705,
1352,
284,
477,
5563,
287,
8265,
37811,
628,
220,
220,
220,
825,
11705,
378,
62,
26801,
7,
198,
2... | 2.340979 | 654 |
"""
Copyright 2018 YoongiKim
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... | [
37811,
201,
198,
15269,
2864,
25455,
506,
72,
26374,
201,
198,
201,
198,
220,
220,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
201,
198,
220,
220,
345,
743,
407,
779,
428,
2393,
2845,
287,
11... | 3.226829 | 410 |
numberSet = getInput()
target = 2020
print(multiplyTwoSum(numberSet, twoSum(numberSet, target)))
print(multiplyThreeSum(numberSet, threeSum(numberSet, target)))
| [
628,
628,
198,
198,
17618,
7248,
796,
651,
20560,
3419,
198,
198,
16793,
796,
12131,
198,
198,
4798,
7,
16680,
541,
306,
7571,
13065,
7,
17618,
7248,
11,
734,
13065,
7,
17618,
7248,
11,
2496,
22305,
198,
4798,
7,
16680,
541,
306,
12... | 2.964912 | 57 |
# Copyright (C) 2011-2014 by Barry A. Warsaw
#
# This file is part of flufl.enum.
#
# flufl.enum is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the Free
# Software Foundation, either version 3 of the License, or (at your option)
# an... | [
2,
15069,
357,
34,
8,
2813,
12,
4967,
416,
14488,
317,
13,
32955,
198,
2,
198,
2,
770,
2393,
318,
636,
286,
6562,
2704,
13,
44709,
13,
198,
2,
198,
2,
6562,
2704,
13,
44709,
318,
1479,
3788,
25,
345,
460,
17678,
4163,
340,
290,
... | 3.26087 | 391 |
#!/usr/bin/python
######################################################################################################################
# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. #
# ... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
29113,
29113,
29113,
14468,
4242,
2235,
220,
220,
198,
2,
220,
15069,
13130,
6186,
13,
785,
11,
3457,
13,
393,
663,
29116,
13,
1439,
6923,
33876,
13,
220,
220,
220,
220,
220,
220,
220,
220,... | 1.911263 | 879 |
from typing import Iterable, List
import torch
from torchvision import io
from torchvision import transforms
from torchvision.io.image import ImageReadMode
import clip
import faiss
import numpy as np
from PIL import Image
from tqdm import tqdm
@torch.no_grad()
@torch.no_grad()
| [
6738,
19720,
1330,
40806,
540,
11,
7343,
198,
198,
11748,
28034,
198,
6738,
28034,
10178,
1330,
33245,
198,
6738,
28034,
10178,
1330,
31408,
198,
6738,
28034,
10178,
13,
952,
13,
9060,
1330,
7412,
5569,
19076,
198,
11748,
10651,
198,
1174... | 3.313953 | 86 |