content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
##############################################################################
# insert.py
# https://github.com/DigiLog-N/SynopticDataClient
# Copyright 2020 Canvass Labs, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You m... | [
29113,
29113,
7804,
4242,
2235,
198,
2,
7550,
13,
9078,
198,
2,
3740,
1378,
12567,
13,
785,
14,
19511,
72,
11187,
12,
45,
14,
29934,
8738,
291,
6601,
11792,
198,
2,
15069,
12131,
1680,
85,
562,
23500,
11,
3457,
13,
198,
2,
220,
19... | 3.304136 | 411 |
import pytest
from btreelab.disk import Disk, DiskController
@pytest.fixture()
def dc():
'''disk controller
'''
return DiskController(block_size=124, block_num=8)
| [
198,
11748,
12972,
9288,
220,
198,
6738,
275,
33945,
417,
397,
13,
39531,
1330,
31664,
11,
31664,
22130,
220,
198,
198,
31,
9078,
9288,
13,
69,
9602,
3419,
220,
198,
4299,
30736,
33529,
220,
198,
220,
220,
220,
705,
7061,
39531,
10444... | 2.591549 | 71 |
# Copyright 2017 Google Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, softwa... | [
2,
15069,
2177,
3012,
3457,
13,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198,
2,
921,
743,
7330,
257... | 3.191214 | 387 |
#
# Copyright (2021) The Delta Lake Project Authors.
#
# 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 ag... | [
2,
198,
2,
15069,
357,
1238,
2481,
8,
383,
16978,
6233,
4935,
46665,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,... | 3.397993 | 598 |
# AUTOGENERATED! DO NOT EDIT! File to edit: nbs/display.ipynb (unless otherwise specified).
__all__ = ['encode', 'DiscordEncoder', 'Formatter', 'serialize_content', 'html_content']
# Cell
import discord
# Cell
import json
# Cell
#TODO change the data model for this to something more standard.
# use only strin... | [
2,
47044,
7730,
1677,
1137,
11617,
0,
8410,
5626,
48483,
0,
9220,
284,
4370,
25,
299,
1443,
14,
13812,
13,
541,
2047,
65,
357,
25252,
4306,
7368,
737,
198,
198,
834,
439,
834,
796,
37250,
268,
8189,
3256,
705,
15642,
585,
27195,
123... | 3.398148 | 108 |
import string
import base64
from distutils.util import strtobool
from marshmallow.exceptions import ValidationError
from baselayer.app.access import permissions, auth_or_token
from ..base import BaseHandler
from ...models import (
DBSession,
Source,
Comment,
Group,
Candidate,
Filter,
Obj,
... | [
11748,
4731,
198,
11748,
2779,
2414,
198,
6738,
1233,
26791,
13,
22602,
1330,
965,
83,
672,
970,
198,
6738,
22397,
42725,
13,
1069,
11755,
1330,
3254,
24765,
12331,
198,
6738,
1615,
417,
2794,
13,
1324,
13,
15526,
1330,
21627,
11,
6284,... | 2.958333 | 120 |
from kafka import KafkaProducer
import json
producer = KafkaProducer(value_serializer=lambda m: json.dumps(m).encode('ascii'), bootstrap_servers=['localhost:9092'])
producer.send('event', {'id': 123, 'email_vendedor': 'asdas@mail.com'})
producer.flush() | [
6738,
479,
1878,
4914,
1330,
46906,
11547,
2189,
198,
11748,
33918,
220,
198,
198,
18230,
2189,
796,
46906,
11547,
2189,
7,
8367,
62,
46911,
7509,
28,
50033,
285,
25,
33918,
13,
67,
8142,
7,
76,
737,
268,
8189,
10786,
292,
979,
72,
... | 2.741935 | 93 |
import os, sys
sys.path.insert(1, os.path.join(os.path.abspath('.'), 'flaskstuff'))
from flask import Flask
app = Flask(__name__)
from app import views
| [
11748,
28686,
11,
25064,
198,
17597,
13,
6978,
13,
28463,
7,
16,
11,
28686,
13,
6978,
13,
22179,
7,
418,
13,
6978,
13,
397,
2777,
776,
10786,
2637,
828,
705,
2704,
2093,
41094,
6,
4008,
198,
6738,
42903,
1330,
46947,
198,
198,
1324,... | 2.732143 | 56 |
from concurrent.futures import ThreadPoolExecutor
from itertools import repeat
from pprint import pprint
import pexpect
import yaml
import logging
logging.basicConfig(
format="%(threadName)s %(name)s %(levelname)s: %(message)s", level=logging.INFO
)
if __name__ == "__main__":
with open("devices.yaml") as... | [
6738,
24580,
13,
69,
315,
942,
1330,
14122,
27201,
23002,
38409,
198,
6738,
340,
861,
10141,
1330,
9585,
198,
6738,
279,
4798,
1330,
279,
4798,
198,
198,
11748,
613,
87,
806,
198,
11748,
331,
43695,
198,
11748,
18931,
628,
198,
6404,
... | 2.638554 | 166 |
from django.contrib.auth.models import User
from django import forms
from healthapp.models import UserDoctor, UserPatient, Schedule
| [
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
27530,
1330,
11787,
198,
6738,
42625,
14208,
1330,
5107,
198,
6738,
1535,
1324,
13,
27530,
1330,
11787,
37564,
11,
11787,
12130,
1153,
11,
19281,
628,
628,
198
] | 3.777778 | 36 |
from __future__ import absolute_import
from . import qbatch
from .qbatch import qbatchParser
from .qbatch import qbatchDriver
| [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
198,
6738,
764,
1330,
10662,
43501,
198,
6738,
764,
80,
43501,
1330,
10662,
43501,
46677,
198,
6738,
764,
80,
43501,
1330,
10662,
43501,
32103,
198
] | 3.735294 | 34 |
__author__ = 'ThanhNam'
# Enter your code for the AdoptionCenter class here
# Be sure to include the __init__, get_name, get_species_count, get_number_of_species, and adopt_pet methods.
class AdoptionCenter:
"""
The AdoptionCenter class stores the important information that a
client would need to know about... | [
834,
9800,
834,
796,
705,
817,
272,
71,
45,
321,
6,
198,
2,
6062,
534,
2438,
329,
262,
1215,
18076,
23656,
1398,
994,
198,
2,
1355,
1654,
284,
2291,
262,
11593,
15003,
834,
11,
651,
62,
3672,
11,
651,
62,
35448,
62,
9127,
11,
65... | 3.365672 | 134 |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import absolute_import, division, print_function, unicode_literals
from numpy.testing import assert_allclose
from ...utils.testing import requires_data
from ..core import gammapy_extra
from ...datasets import load_poisson_stats_image
@req... | [
2,
49962,
739,
257,
513,
12,
565,
682,
347,
10305,
3918,
5964,
532,
766,
38559,
24290,
13,
81,
301,
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
11,
7297,
11,
3601,
62,
8818,
11,
28000,
1098,
62,
17201,
874,
198,
6738,
299,
... | 3.10559 | 161 |
import unittest
from gpflow.tf_wraps import vec_to_tri
import tensorflow as tf
import numpy as np
from testing.gpflow_testcase import GPflowTestCase
from gpflow.tf_wraps import vec_to_tri
if __name__ == "__main__":
unittest.main()
| [
11748,
555,
715,
395,
198,
6738,
27809,
11125,
13,
27110,
62,
29988,
862,
1330,
43030,
62,
1462,
62,
28461,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
4856,
13,
31197,
11125,
62,
9288,... | 2.8 | 85 |
from aiohttp.client import ClientSession
from http import HTTPStatus
from sanic.exceptions import abort
| [
6738,
257,
952,
4023,
13,
16366,
1330,
20985,
36044,
198,
6738,
2638,
1330,
14626,
19580,
198,
6738,
5336,
291,
13,
1069,
11755,
1330,
15614,
628
] | 4.2 | 25 |
from flask import Blueprint, redirect, url_for, request, render_template, flash, g
from flask.ext.login import login_user, logout_user, current_user, login_required
from GUTG_Vote import utilities
from GUTG_Vote.models import User, Game
from GUTG_Vote.forms import LoginForm
from GUTG_Vote.extensions import db
main = ... | [
6738,
42903,
1330,
39932,
11,
18941,
11,
19016,
62,
1640,
11,
2581,
11,
8543,
62,
28243,
11,
7644,
11,
308,
198,
6738,
42903,
13,
2302,
13,
38235,
1330,
17594,
62,
7220,
11,
2604,
448,
62,
7220,
11,
1459,
62,
7220,
11,
17594,
62,
... | 2.971751 | 177 |
import discord, dislash, datetime
from dislash import slash_command, SlashInteraction, ContextMenuInteraction
from discord.ext import commands
from src.extras.views import url_button_generator
| [
11748,
36446,
11,
595,
17055,
11,
4818,
8079,
198,
6738,
595,
17055,
1330,
24632,
62,
21812,
11,
26616,
9492,
2673,
11,
30532,
23381,
9492,
2673,
198,
6738,
36446,
13,
2302,
1330,
9729,
198,
6738,
12351,
13,
2302,
8847,
13,
33571,
1330,... | 4.020833 | 48 |
#!/usr/bin/env python3
# Get annotations with context from database.
import sys
import os
import re
from logging import warning, error
from standoff import Textbound
try:
from sqlitedict import SqliteDict
except ImportError:
error('failed to import sqlitedict, try `pip3 install sqlitedict`')
raise
d... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
2,
3497,
37647,
351,
4732,
422,
6831,
13,
198,
198,
11748,
25064,
198,
11748,
28686,
198,
11748,
302,
198,
198,
6738,
18931,
1330,
6509,
11,
4049,
198,
198,
6738,
33379,
1330,... | 2.489933 | 298 |
"""botform URL Configuration
"""
from django.conf.urls import url, include
from rest_framework import routers
from botform import api as form_api
router = routers.DefaultRouter()
router.register(r'forms', form_api.FormsViewSet)
router.register(r'submissions', form_api.SubmissionsViewSet)
urlpatterns = [
url(r'^... | [
37811,
13645,
687,
10289,
28373,
198,
198,
37811,
198,
6738,
42625,
14208,
13,
10414,
13,
6371,
82,
1330,
19016,
11,
2291,
198,
6738,
1334,
62,
30604,
1330,
41144,
198,
198,
6738,
10214,
687,
1330,
40391,
355,
1296,
62,
15042,
198,
198,... | 2.489712 | 243 |
from pymongo import MongoClient
| [
6738,
279,
4948,
25162,
1330,
42591,
11792,
628,
198
] | 3.777778 | 9 |
from operacaoes3 import mais , menos , vezes , divicao , resto , raiz , divicao_f
n1 = int(input('a'))
n2 = int(input('b'))
a = mais(n1,n2)
b = menos(n1,n2)
c = vezes(n1,n2)
d = divicao(n1,n2)
e = resto(n1,n2)
f = raiz(n1,n2)
g = divicao_f(n1,n2)
print(f'{a}')
print(f'{b}')
print(f'{c}')
print(f'{d}')
print(f'{e}... | [
6738,
1515,
22260,
3028,
18,
1330,
285,
15152,
837,
1450,
418,
837,
1569,
12271,
837,
2659,
3970,
78,
837,
1334,
78,
837,
2179,
528,
837,
2659,
3970,
78,
62,
69,
198,
198,
77,
16,
796,
493,
7,
15414,
10786,
64,
6,
4008,
198,
77,
... | 1.679426 | 209 |
#!/usr/bin/env python
import argparse
import os
import psycopg2
import sys
# Why is it so hard to get python imports working?
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
from scry import scry
if __name__ == "__main__":
main()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
1822,
29572,
198,
11748,
28686,
198,
11748,
17331,
22163,
70,
17,
198,
11748,
25064,
198,
198,
2,
4162,
318,
340,
523,
1327,
284,
651,
21015,
17944,
1762,
30,
198,
17597,
1... | 2.644231 | 104 |
__version__ = '0.1.5'
try:
import pandas
pandas_df_type = pandas.DataFrame
except ImportError:
pandas_df_type = type(None)
try:
import msgpack
has_msgpack = True
except ImportError:
has_msgpack = False
try:
import os
login = os.getlogin()
except OSError:
login = ''
| [
834,
9641,
834,
796,
705,
15,
13,
16,
13,
20,
6,
198,
198,
28311,
25,
198,
220,
220,
220,
1330,
19798,
292,
198,
220,
220,
220,
19798,
292,
62,
7568,
62,
4906,
796,
19798,
292,
13,
6601,
19778,
198,
16341,
17267,
12331,
25,
198,
... | 2.346154 | 130 |
#!/usr/bin/env python3
import argparse
import sys
import os
from pathlib import Path
from Bio import SeqIO
import gzip
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
11748,
1822,
29572,
198,
11748,
25064,
198,
11748,
28686,
198,
6738,
3108,
8019,
1330,
10644,
198,
6738,
16024,
1330,
1001,
80,
9399,
198,
11748,
308,
13344,
628,
198
] | 3.184211 | 38 |
""" Helper to assemble code from a web page. """
import flask
import subprocess
import tempfile
main_html = r"""
<!DOCTYPE html>
<html><head>
<title>Online compiler</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://www.w3schools.com/lib/w3.css">
<script s... | [
37811,
5053,
525,
284,
25432,
2438,
422,
257,
3992,
2443,
13,
37227,
198,
198,
11748,
42903,
198,
11748,
850,
14681,
198,
11748,
20218,
7753,
198,
198,
12417,
62,
6494,
796,
374,
37811,
198,
27,
0,
18227,
4177,
56,
11401,
27711,
29,
1... | 2.555305 | 443 |
if __name__ == "__main__":
a = input("first number:")
b = input("second number:")
print(', '.join(swap(a, b)))
| [
628,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
257,
796,
5128,
7203,
11085,
1271,
25,
4943,
198,
220,
275,
796,
5128,
7203,
12227,
1271,
25,
4943,
198,
220,
3601,
7,
3256,
45302,
22179,
7,
2032,
499,
7,... | 2.5 | 48 |
import os
import sys
import time
import math
import inspect
import copy
import logging
import numpy as np
import cv2
import torch
from torch.autograd import Variable
import torch.nn.functional as F
from .DaSiamRPN_net import SiamRPNvot, SiamRPNBIG, SiamRPNotb
from .run_SiamRPN import generate_anchor, tracker_eval
fro... | [
11748,
28686,
198,
11748,
25064,
198,
11748,
640,
198,
11748,
10688,
198,
11748,
10104,
198,
11748,
4866,
198,
11748,
18931,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
269,
85,
17,
198,
11748,
28034,
198,
6738,
28034,
13,
2306,
... | 2.128286 | 2,853 |
import random
from collections import OrderedDict
from string import ascii_letters, digits
from django import forms
from django.contrib.auth.models import User, Group
from django.contrib.sites.models import Site
from django.core.mail import send_mail
from django.template import loader
from .models import Us... | [
11748,
4738,
201,
198,
6738,
17268,
1330,
14230,
1068,
35,
713,
201,
198,
6738,
4731,
1330,
355,
979,
72,
62,
15653,
11,
19561,
201,
198,
201,
198,
6738,
42625,
14208,
1330,
5107,
201,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439... | 3.09322 | 118 |
import numpy as np
# hidden layer activation function
# derivate of hidden layer activation function for gradient descent
# output layer activation function
# cost function
# derivative of cost function for gradient descent
| [
11748,
299,
32152,
355,
45941,
201,
198,
201,
198,
2,
7104,
7679,
14916,
2163,
201,
198,
201,
198,
2,
16124,
378,
286,
7104,
7679,
14916,
2163,
329,
31312,
18598,
201,
198,
201,
198,
2,
5072,
7679,
14916,
2163,
201,
198,
201,
198,
2... | 4.12069 | 58 |
l_in = lasagne.layers.InputLayer((None, 784))
l_out = lasagne.layers.DenseLayer(l_in,
num_units=10,
nonlinearity=lasagne.nonlinearities.softmax)
X_sym = T.matrix()
y_sym = T.ivector()
output = lasagne.layers.get_output(l_out, X_sym)
pred = output.arg... | [
75,
62,
259,
796,
39990,
21080,
13,
75,
6962,
13,
20560,
49925,
19510,
14202,
11,
767,
5705,
4008,
198,
75,
62,
448,
796,
39990,
21080,
13,
75,
6962,
13,
35,
1072,
49925,
7,
75,
62,
259,
11,
198,
220,
220,
220,
220,
220,
220,
22... | 2.065517 | 870 |
'''
Created on Sep 8, 2016
@author: nicolas
'''
import re
import fnmatch
from functools import reduce
from lemoncheesecake.reporting import load_report
from lemoncheesecake.reporting.reportdir import DEFAULT_REPORT_DIR_NAME
from lemoncheesecake.reporting.report import Result, TestResult, Step, Log, Check, Attachment... | [
7061,
6,
198,
41972,
319,
8621,
807,
11,
1584,
198,
198,
31,
9800,
25,
9200,
12456,
198,
7061,
6,
198,
198,
11748,
302,
198,
11748,
24714,
15699,
198,
6738,
1257,
310,
10141,
1330,
4646,
198,
198,
6738,
18873,
2395,
274,
46557,
13,
... | 3.259494 | 158 |
STATS = [
{
"num_node_expansions": 653,
"plan_length": 167,
"search_time": 0.52,
"total_time": 0.52
},
{
"num_node_expansions": 978,
"plan_length": 167,
"search_time": 0.86,
"total_time": 0.86
},
{
"num_node_expansions": 1087,
... | [
2257,
33586,
796,
685,
198,
220,
220,
220,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
366,
22510,
62,
17440,
62,
11201,
504,
507,
1298,
718,
4310,
11,
198,
220,
220,
220,
220,
220,
220,
220,
366,
11578,
62,
13664,
1298,
26118,
... | 1.715698 | 12,237 |
import re
import ast
import operator
def literal_eval(node_or_string):
"""
Safely evaluate an expression node or a string containing a Python
expression. The string or node provided may only consist of the following
Python literal structures: strings, numbers, tuples, lists, dicts, booleans,
an... | [
11748,
302,
198,
11748,
6468,
198,
11748,
10088,
628,
628,
198,
4299,
18875,
62,
18206,
7,
17440,
62,
273,
62,
8841,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
19978,
306,
13446,
281,
5408,
10139,
393,
257,
4731,
7268,
257,
... | 2.178771 | 716 |
from collections import OrderedDict
from sage.all import (operator, flatten, PolynomialRing, SR, QQ, ZZ, RR, sage, oo)
from vu_common import (pause, get_logger,is_iterable, is_str, is_empty)
is_sage_expr = lambda x: isinstance(x, sage.symbolic.expression.Expression)
is_sage_real = lambda x: isi... | [
6738,
17268,
1330,
14230,
1068,
35,
713,
198,
6738,
35021,
13,
439,
1330,
357,
46616,
11,
27172,
268,
11,
12280,
26601,
498,
39687,
11,
16808,
11,
1195,
48,
11,
1168,
57,
11,
26067,
11,
35021,
11,
267,
78,
8,
198,
6738,
410,
84,
6... | 1.88061 | 4,523 |
from .read import read_axivity, read_geneactiv
from .gt3x_convert import read_gt3x
__all__ = ("read_axivity", "read_geneactiv", "read_gt3x")
| [
6738,
764,
961,
1330,
1100,
62,
897,
3458,
11,
1100,
62,
70,
1734,
15791,
198,
6738,
764,
13655,
18,
87,
62,
1102,
1851,
1330,
1100,
62,
13655,
18,
87,
198,
198,
834,
439,
834,
796,
5855,
961,
62,
897,
3458,
1600,
366,
961,
62,
... | 2.535714 | 56 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
import django.contrib.gis.db.models.fields
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
4981,
11,
15720,
602,
198,
6738,
42625,
14208,
13,
10414,
1330,
... | 3 | 61 |
import setuptools
import json
with open("README.rst", "r") as fh:
long_description = fh.read()
with open('pipeline_description.json', 'r') as fh:
pipeline = json.load(fh)
name = pipeline['GeneratedBy'][0]['Name']
description = pipeline['Name']
version = pipeline['GeneratedBy'][0]['Version']
ur... | [
11748,
900,
37623,
10141,
198,
11748,
33918,
198,
198,
4480,
1280,
7203,
15675,
11682,
13,
81,
301,
1600,
366,
81,
4943,
355,
277,
71,
25,
198,
220,
220,
220,
890,
62,
11213,
796,
277,
71,
13,
961,
3419,
198,
198,
4480,
1280,
10786,... | 2.50104 | 481 |
from pymooCFD.setupOpt import checkpointFile, dataDir, nCP, archDir, \
preProcDir, cluster
from pymooCFD.util.sysTools import removeDir #, makeDir, emptyDir
from pymooCFD.setupCFD import runCase
import numpy as np
import time
import os
import tarfile
from dask.distributed import Client
from sys import exit
# d... | [
6738,
279,
4948,
2238,
22495,
35,
13,
40406,
27871,
1330,
26954,
8979,
11,
1366,
35277,
11,
299,
8697,
11,
3934,
35277,
11,
3467,
198,
220,
220,
220,
662,
2964,
66,
35277,
11,
13946,
198,
6738,
279,
4948,
2238,
22495,
35,
13,
22602,
... | 2.421517 | 1,701 |
from scipy import signal
import matplotlib.pyplot as plt
import numpy as np
t = np.linspace(1, 201, 200, endpoint=False)
sig = np.cos(2 * np.pi * 7 * t) + signal.gausspulse(t - 0.4, fc=2)
widths = np.arange(1, 31)
cwtmatr = signal.cwt(sig, signal.ricker, widths)
plt.imshow(cwtmatr, extent=[1, 201, 31, 1], cmap='PRGn'... | [
6738,
629,
541,
88,
1330,
6737,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
299,
32152,
355,
45941,
198,
198,
83,
796,
45941,
13,
21602,
10223,
7,
16,
11,
580,
11,
939,
11,
36123,
28,
25101,
8,
198,
8... | 2.164021 | 189 |
description = 'minimal NICOS startup setup'
group = 'lowlevel'
sysconfig = dict(
cache = 'tofhw.toftof.frm2:14869',
)
| [
11213,
796,
705,
1084,
4402,
45593,
2640,
13693,
9058,
6,
198,
198,
8094,
796,
705,
9319,
5715,
6,
198,
198,
17597,
11250,
796,
8633,
7,
198,
220,
220,
220,
12940,
796,
705,
1462,
69,
36599,
13,
1462,
701,
1659,
13,
8310,
76,
17,
... | 2.48 | 50 |
from valhalla.extract import DataExtractor
from sklearn.pipeline import Pipeline
from ._transform import FeatureConcat | [
6738,
1188,
41911,
13,
2302,
974,
1330,
6060,
11627,
40450,
198,
6738,
1341,
35720,
13,
79,
541,
4470,
1330,
37709,
198,
6738,
47540,
35636,
1330,
27018,
3103,
9246
] | 4.214286 | 28 |
"""Guessing Game Visualization
You do not need to understand any of the code in this file.
"""
# This section avoids asking for user input.
import lab01
lab01.LOWER = 1
lab01.UPPER = 100
lab01.prompt_for_number = prompt_for_number
lab01.is_correct = is_correct
lab01.is_too_high = is_too_high
# This section runs an ... | [
37811,
8205,
27289,
3776,
15612,
1634,
198,
198,
1639,
466,
407,
761,
284,
1833,
597,
286,
262,
2438,
287,
428,
2393,
13,
198,
37811,
198,
198,
2,
770,
2665,
30940,
4737,
329,
2836,
5128,
13,
198,
198,
11748,
2248,
486,
198,
23912,
... | 2.302674 | 935 |
import pandas as pd
name = 'drop-column'
if __name__ == "__main__":
data = [['tom', 10], ['nick', 15], ['juli', 15]]
df = pd.DataFrame(data, columns = ['Name', 'Age'])
args = {
'--columns':[
'Age',
'Name'
]
}
operator(df, args) | [
11748,
19798,
292,
355,
279,
67,
198,
198,
3672,
796,
705,
14781,
12,
28665,
6,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
220,
198,
220,
220,
220,
1366,
796,
16410,
6,
39532,
3256,
838,
4357,
37250,
17172,
3... | 1.94702 | 151 |
# Generated by Django 2.0.7 on 2018-11-02 22:15
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
362,
13,
15,
13,
22,
319,
2864,
12,
1157,
12,
2999,
2534,
25,
1314,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
198
] | 2.8125 | 32 |
import torch
import torch.nn as nn
import torch.nn.functional as F
try:
from torch.hub import load_state_dict_from_url
except ImportError:
from torch.utils.model_zoo import load_url as load_state_dict_from_url
import torchvision.models.resnet as torch_resnet
from torchvision.models.resnet import BasicBlock, Bo... | [
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
198,
28311,
25,
198,
220,
220,
220,
422,
28034,
13,
40140,
1330,
3440,
62,
5219,
62,
11600,
62,
6738,
62,
6371,
198,
16341,
... | 2.51841 | 1,711 |
import pandas
from ..schema.schema_base import *
from .datastore_base import DataStore
from .odo_datastore import OdoDataStore
from ..config import config
from functools import lru_cache, partial
from sqlalchemy import Table, MetaData, select
from sqlalchemy.orm import sessionmaker
from sqlalchemy.ext.automap import ... | [
11748,
19798,
292,
198,
6738,
11485,
15952,
2611,
13,
15952,
2611,
62,
8692,
1330,
1635,
198,
6738,
764,
19608,
459,
382,
62,
8692,
1330,
6060,
22658,
198,
6738,
764,
24313,
62,
19608,
459,
382,
1330,
440,
4598,
6601,
22658,
198,
6738,
... | 3.317919 | 519 |
"""
Fast R-CNN:
data =
{'data': [num_images, c, h, w],
'rois': [num_rois, 5]}
label =
{'label': [num_rois],
'bbox_target': [num_rois, 4 * num_classes],
'bbox_weight': [num_rois, 4 * num_classes]}
roidb extended format [image_index]
['image', 'height', 'width', 'flipped',
'boxes', 'gt_classe... | [
37811,
198,
22968,
371,
12,
18474,
25,
198,
7890,
796,
198,
220,
220,
220,
1391,
6,
7890,
10354,
685,
22510,
62,
17566,
11,
269,
11,
289,
11,
266,
4357,
198,
220,
220,
220,
705,
305,
271,
10354,
685,
22510,
62,
305,
271,
11,
642,
... | 1.882739 | 8,528 |
#!/usr/bin/env python
# encoding: utf-8
import os
import sys
from mock import MagicMock, patch
from splunk_eventgen.__main__ import parse_args
from splunk_eventgen.eventgen_core import EventGenerator
FILE_DIR = os.path.dirname(os.path.abspath(__file__))
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
21004,
25,
3384,
69,
12,
23,
198,
198,
11748,
28686,
198,
11748,
25064,
198,
6738,
15290,
1330,
6139,
44,
735,
11,
8529,
198,
198,
6738,
4328,
2954,
62,
15596,
5235,
13,
834,
1241... | 2.836957 | 92 |
""" module to utils methods to file """
import os
import shutil
import logging
from documentstore_migracao import config
logger = logging.getLogger(__name__)
| [
37811,
8265,
284,
3384,
4487,
5050,
284,
2393,
37227,
198,
198,
11748,
28686,
198,
11748,
4423,
346,
198,
11748,
18931,
198,
198,
6738,
3188,
8095,
62,
76,
3692,
330,
5488,
1330,
4566,
198,
198,
6404,
1362,
796,
18931,
13,
1136,
11187,
... | 3.32 | 50 |
from sphinx.domains.changeset import versionlabels, VersionChange
from sphinx.locale import _ # just to suppress warnings
try:
from sphinx.domains.changeset import versionlabel_classes
except ImportError:
# versionlabel_classes doesn't exist in old Sphinx versions.
UPDATE_VERIONLABEL_CLASSES = False
else:
... | [
6738,
599,
20079,
87,
13,
3438,
1299,
13,
36653,
316,
1330,
2196,
23912,
1424,
11,
10628,
19400,
198,
6738,
599,
20079,
87,
13,
17946,
1000,
1330,
4808,
1303,
655,
284,
18175,
14601,
198,
198,
28311,
25,
198,
220,
220,
220,
422,
599,
... | 3.251852 | 135 |
'''
@author Tian Shi
Please contact tshi@vt.edu
'''
import json
import os
import random
import gensim
import numpy as np
from tqdm import tqdm
def run_word2vec(args):
'''
Run word2vec.
'''
cluster_dir = '../cluster_results'
if not os.path.exists(cluster_dir):
os.mkdir(cluster_dir)
if ... | [
7061,
6,
198,
31,
9800,
20834,
16380,
198,
5492,
2800,
256,
44019,
31,
36540,
13,
15532,
198,
7061,
6,
198,
11748,
33918,
198,
11748,
28686,
198,
11748,
4738,
198,
198,
11748,
308,
641,
320,
198,
11748,
299,
32152,
355,
45941,
198,
67... | 2.13034 | 913 |
from GenerateFolders import generateFolders
from GenerateFiles import generateFiles
from AddictionHelperGenerator import addictionHelperGenerator
import shutil
from Constants import *
generateFolders()
generateFiles()
addictionHelperGenerator()
shutil.make_archive('tobacco_awareness', 'zip', rootdir) | [
6738,
2980,
378,
37,
727,
364,
1330,
7716,
37,
727,
364,
198,
6738,
2980,
378,
25876,
1330,
7716,
25876,
198,
6738,
40187,
47429,
8645,
1352,
1330,
13230,
47429,
8645,
1352,
198,
11748,
4423,
346,
198,
6738,
4757,
1187,
1330,
1635,
198,... | 3.740741 | 81 |
from final_code.fcts_data_formatting import day_to_month, day_to_quarter, import_datasets, time_interval, add_categories, \
HB_to_areas, extract_data, day_to_quarter, month_to_quarter
import numpy as np
import matplotlib.pyplot as plt
data31, data62, operations, diag, covid = import_dat... | [
6738,
2457,
62,
8189,
13,
69,
310,
82,
62,
7890,
62,
18982,
889,
1330,
1110,
62,
1462,
62,
8424,
11,
1110,
62,
1462,
62,
24385,
11,
1330,
62,
19608,
292,
1039,
11,
640,
62,
3849,
2100,
11,
751,
62,
66,
26129,
11,
3467,
198,
220,... | 2.222045 | 626 |
import sys
| [
11748,
25064,
198
] | 3.666667 | 3 |
from __future__ import absolute_import
| [
171,
119,
123,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198
] | 3.333333 | 12 |
"""
GraphSense API
GraphSense API # noqa: E501
The version of the OpenAPI document: 0.5.1
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa: F401
from graphsense.api_client import ApiClient, Endpoint as _Endpoint
from graphsense.model_utils import ( # noq... | [
37811,
198,
220,
220,
220,
29681,
41166,
7824,
628,
220,
220,
220,
29681,
41166,
7824,
220,
1303,
645,
20402,
25,
412,
33548,
628,
220,
220,
220,
383,
2196,
286,
262,
4946,
17614,
3188,
25,
657,
13,
20,
13,
16,
198,
220,
220,
220,
... | 3.016287 | 307 |
import argparse
import collections
import json
import random
import string
import sys
import types
import bftool
# Default argument capture for the main function
def _get_arguments() -> argparse.Namespace:
"""Default function to prepare the arguments for the `Runner` during it's execution in a terminal
Retu... | [
11748,
1822,
29572,
198,
11748,
17268,
198,
11748,
33918,
198,
11748,
4738,
198,
11748,
4731,
198,
11748,
25064,
198,
11748,
3858,
198,
198,
11748,
275,
701,
970,
628,
198,
2,
15161,
4578,
8006,
329,
262,
1388,
2163,
198,
4299,
4808,
11... | 2.287743 | 1,338 |
from conans import ConanFile, CMake
| [
6738,
369,
504,
1330,
31634,
8979,
11,
327,
12050,
628
] | 3.7 | 10 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
from pathlib import Path
import sys
import click
import h5py
import yaml
import lynx
import hoover
import pymaster as nmt
from scipy.optimize import minimize
import emcee
import healpy as hp
import matplotlib.pyplot as plt
from matplotlib.patches import ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
18931,
198,
6738,
3108,
8019,
1330,
10644,
198,
11748,
25064,
198,
198,
11748,
3904,
198,
198,
11748,
289,
20,
9... | 2.678337 | 457 |
"""
Script for running management commands for the Asteroids Game / AI.
Usage: python manage.py [--help]
"""
from ai.experiment import merge_experiments
import click
import settings
class TransparentGroup(click.Group):
"""
A Click Group class that passes all provided
arguments to its subcommands without ... | [
37811,
198,
7391,
329,
2491,
4542,
9729,
329,
262,
38484,
10994,
3776,
1220,
9552,
13,
198,
198,
28350,
25,
21015,
6687,
13,
9078,
685,
438,
16794,
60,
198,
37811,
198,
198,
6738,
257,
72,
13,
23100,
3681,
1330,
20121,
62,
23100,
6800... | 3.046589 | 601 |
from operator import or_
import sqlalchemy
from fastapi import APIRouter, HTTPException, status
from fastapi.param_functions import Depends
from fastapi.responses import JSONResponse
from fastapi import APIRouter
import fastapi as _fastapi
import sqlalchemy.orm as _orm
from bigfastapi.db.database import get_db
from big... | [
6738,
10088,
1330,
393,
62,
198,
11748,
44161,
282,
26599,
198,
6738,
3049,
15042,
1330,
3486,
4663,
39605,
11,
14626,
16922,
11,
3722,
198,
6738,
3049,
15042,
13,
17143,
62,
12543,
2733,
1330,
2129,
2412,
198,
6738,
3049,
15042,
13,
16... | 3.105735 | 558 |
from PIL import Image, ImageDraw
w = 7200
h = 3600
i = 1
j = 0
k = 0
c6 = [(255, 153, 204), (255, 255, 153), (153, 255, 153), (153, 204, 255)]
black = (0, 0, 0)
white = (255, 255, 255)
im = Image.new('RGB', (w, h), white)
draw = ImageDraw.Draw(im)
r = open('index_src.dat', 'r')
src = r.read()
r.close
src ... | [
6738,
350,
4146,
1330,
7412,
11,
7412,
25302,
201,
198,
86,
796,
767,
2167,
201,
198,
71,
796,
4570,
405,
201,
198,
72,
796,
352,
201,
198,
73,
796,
657,
201,
198,
74,
796,
657,
201,
198,
66,
21,
796,
47527,
13381,
11,
24652,
11... | 1.722944 | 693 |
from docutils import nodes
from docutils.parsers.rst import Directive
| [
198,
6738,
2205,
26791,
1330,
13760,
198,
198,
6738,
2205,
26791,
13,
79,
945,
364,
13,
81,
301,
1330,
34736,
198,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
628
] | 2.333333 | 39 |
import imaplib
import email
from email.header import decode_header
import pandas as pd
mails_df = pd.read_csv('mails.csv')
csv_values = mails_df.values
c = 1
with open('mails_with_coupons.csv', 'w', encoding='utf-8') as f:
out_row = 'EMAIL,PASS,COUPONS\n'
f.write(out_row)
for each in csv_val... | [
11748,
545,
64,
489,
571,
201,
198,
11748,
3053,
201,
198,
6738,
3053,
13,
25677,
1330,
36899,
62,
25677,
201,
198,
11748,
19798,
292,
355,
279,
67,
201,
198,
201,
198,
201,
198,
26165,
62,
7568,
796,
279,
67,
13,
961,
62,
40664,
... | 2.036545 | 903 |
from rest_framework import serializers
from django.contrib.auth import authenticate
from rest_framework import exceptions
from Air_PnP.models import * | [
6738,
1334,
62,
30604,
1330,
11389,
11341,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
1330,
8323,
5344,
198,
6738,
1334,
62,
30604,
1330,
13269,
220,
198,
6738,
3701,
62,
47,
77,
47,
13,
27530,
1330,
1635
] | 3.973684 | 38 |
import datetime
import re
"""
Input is supposed to be in the format yyyy-mm-dd
if it is not then return false
""" | [
11748,
4818,
8079,
198,
11748,
302,
628,
198,
37811,
198,
220,
220,
220,
23412,
318,
4385,
284,
307,
287,
262,
5794,
331,
22556,
88,
12,
3020,
12,
1860,
198,
220,
220,
220,
611,
340,
318,
407,
788,
1441,
3991,
198,
37811
] | 3 | 41 |
#! /usr/bin/env python3
# __author__ = "Praneesh Kataru"
# __credits__ = []
# __version__ = "0.1.1"
# __maintainer__ = "Praneesh Kataru"
# __email__ = "pranuvitmsse05@gmail.com"
# __status__ = "Prototype"
import unittest
from pprint import pprint
from qs_backend.dal.user_stock_pref_dal import UserS... | [
2,
0,
1220,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
2,
220,
220,
11593,
9800,
834,
220,
220,
220,
796,
366,
6836,
1531,
5069,
8595,
11493,
1,
198,
2,
220,
220,
11593,
66,
20696,
834,
220,
220,
796,
17635,
198,
2,
220,
2... | 2.415385 | 195 |
# coding: utf-8
# # Pipeline processing using serial workflows.
#
# This is a serial unrolled version of the predict step
# In[1]:
#get_ipython().run_line_magic('matplotlib', 'inline')
import os
import sys
sys.path.append(os.path.join('..', '..'))
from data_models.parameters import arl_path
from mpi4py import ... | [
198,
2,
19617,
25,
3384,
69,
12,
23,
198,
198,
2,
1303,
37709,
7587,
1262,
11389,
670,
44041,
13,
198,
2,
220,
198,
2,
770,
318,
257,
11389,
555,
8375,
2196,
286,
262,
4331,
2239,
198,
198,
2,
554,
58,
16,
5974,
628,
198,
2,
1... | 1.926533 | 10,372 |
from __future__ import absolute_import
import logging
# to change log level globally, use eg logconfig.loglevel(logging.WARN)
# to change level for an individual module, eg logconfig.loglevel(logging.DEBUG, "framedata")
| [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
11748,
18931,
198,
198,
2,
284,
1487,
2604,
1241,
18309,
11,
779,
29206,
2604,
11250,
13,
75,
2467,
626,
7,
6404,
2667,
13,
37771,
8,
198,
2,
284,
1487,
1241,
329,
281,
1981,
8265... | 3.507937 | 63 |
expected_output = {
'policy_map': {
'policy-cbwfq-1': {'class': {
'class-gold': {'bandwidth_percent': '40',
'random_detect': ['dscp-based', 'ecn']},
'class-silver': {'bandwidth_percent': '20',
'random_detect': ['dscp-based', 'ec... | [
40319,
62,
22915,
796,
1391,
198,
220,
220,
220,
705,
30586,
62,
8899,
10354,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
705,
30586,
12,
21101,
86,
69,
80,
12,
16,
10354,
1391,
6,
4871,
10354,
1391,
198,
220,
220,
220,
220,
220... | 1.627151 | 523 |
# https://github.com/ArtemNikolaev/gb-hw/issues/26
from functools import reduce
print(multiply())
| [
2,
3740,
1378,
12567,
13,
785,
14,
8001,
368,
40979,
5708,
1990,
14,
22296,
12,
36599,
14,
37165,
14,
2075,
198,
6738,
1257,
310,
10141,
1330,
4646,
628,
628,
198,
4798,
7,
16680,
541,
306,
28955,
198
] | 2.756757 | 37 |
Link = "https://practice.geeksforgeeks.org/problems/merge-two-sorted-arrays-1587115620/1"
Description = "Given two sorted arrays arr1[] and arr2[] of sizes n and m in non-decreasing order." \
"Merge them in sorted order without using any extra space. Modify arr1 so that it" \
"contains the f... | [
11280,
796,
366,
5450,
1378,
39541,
13,
469,
2573,
30293,
2573,
13,
2398,
14,
1676,
22143,
14,
647,
469,
12,
11545,
12,
82,
9741,
12,
3258,
592,
12,
1314,
5774,
1157,
3980,
1238,
14,
16,
1,
198,
11828,
796,
366,
15056,
734,
23243,
... | 2.132743 | 565 |
# Copyright 2019 Amazon.com, Inc. or its affiliates.
# 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... | [
2,
15069,
13130,
6186,
13,
785,
11,
3457,
13,
393,
663,
29116,
13,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
198,
2,
366,
34156,
15341,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
198,
2,
351,
... | 3.864516 | 155 |
#!/usr/bin/env python
from setuptools import setup, find_packages
import io
setup(
name='tomago-sdk-py',
version='1.5.1',
description="Python SDKs for Blockchain.",
long_description=io.open('README.md', encoding='utf-8').read(),
url='https://github.com/arxanchain/tomago-sdk-py/',
download_url=... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
6738,
900,
37623,
10141,
1330,
9058,
11,
1064,
62,
43789,
198,
11748,
33245,
198,
198,
40406,
7,
198,
220,
220,
220,
1438,
11639,
39532,
3839,
12,
21282,
74,
12,
9078,
3256,
198,
... | 2.098315 | 356 |
#!/usr/bin/env python
# Copyright (c) 2017, the R8 project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
import create_maven_release
import gradle
import jdk
import optparse
import os
try:
i... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
15069,
357,
66,
8,
2177,
11,
262,
371,
23,
1628,
7035,
13,
4222,
766,
262,
37195,
20673,
2393,
198,
2,
329,
3307,
13,
1439,
2489,
10395,
13,
5765,
286,
428,
2723,
2438,
318,
218... | 3.227979 | 193 |
# Copyright 2020 BlueChasm LLC dba OsmosisAI.
#
# 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... | [
2,
220,
15069,
12131,
4518,
1925,
8597,
11419,
288,
7012,
440,
5796,
5958,
20185,
13,
198,
2,
198,
2,
220,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
220,
345,
743,
407,
779,
428,
... | 3.570048 | 207 |
import numpy as np
import math
def alpha_help(a,n):
"""function to compute some approximations
Parameters
----------
a : complex
number
n : int
number
Returns
ln : complex
approximation
"""
if a.real == 0 and a.imag == 0:
if n == 0:
... | [
11748,
299,
32152,
355,
45941,
198,
11748,
10688,
198,
198,
4299,
17130,
62,
16794,
7,
64,
11,
77,
2599,
198,
220,
220,
220,
37227,
8818,
284,
24061,
617,
5561,
320,
602,
198,
220,
220,
220,
220,
198,
220,
220,
220,
40117,
198,
220,... | 1.92731 | 1,926 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import sys
from .common import unittest
from squint._compatibility.itertools import islice
from squint._utils import IterItems
from squint.result import Result
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
11748,
25064,
198,
6738,
764,
11321,
1330,
555,
715,
395,
198,
6738,
2809,
600,
13557,
5589,
25901,
13,
270,
861,
10... | 3.338235 | 68 |
# multiAgents.py
# --------------
# Licensing Information: You are free to use or extend these projects for
# educational purposes provided that (1) you do not distribute or publish
# solutions, (2) you retain this notice, and (3) you provide clear
# attribution to UC Berkeley, including a link to
# http://inst.eecs.b... | [
2,
5021,
10262,
658,
13,
9078,
198,
2,
220,
26171,
198,
2,
10483,
26426,
6188,
25,
220,
921,
389,
1479,
284,
779,
393,
9117,
777,
4493,
329,
198,
2,
9856,
4959,
2810,
326,
357,
16,
8,
345,
466,
407,
14983,
393,
7715,
198,
2,
813... | 2.616242 | 6,637 |
""" XVM (c) www.modxvm.com 2013-2017 """
#####################################################################
# imports
import simplejson
import traceback
import BigWorld
import game
from Avatar import PlayerAvatar
from BattleReplay import BattleReplay, g_replayCtrl
from PlayerEvents import g_playerEvents
from gui.... | [
37811,
1395,
15996,
357,
66,
8,
7324,
13,
4666,
87,
14761,
13,
785,
2211,
12,
5539,
37227,
198,
198,
29113,
29113,
4242,
2,
198,
2,
17944,
198,
198,
11748,
2829,
17752,
198,
11748,
12854,
1891,
198,
198,
11748,
4403,
10603,
198,
11748... | 3.263538 | 277 |
import logging
from torch.optim import SGD, Adam
from torch.optim.lr_scheduler import LambdaLR, StepLR, MultiStepLR
from torch import nn
class PolyLR(LambdaLR):
"""DeepLab learning rate policy"""
| [
11748,
18931,
198,
198,
6738,
28034,
13,
40085,
1330,
26147,
35,
11,
7244,
198,
6738,
28034,
13,
40085,
13,
14050,
62,
1416,
704,
18173,
1330,
21114,
6814,
35972,
11,
5012,
35972,
11,
15237,
8600,
35972,
198,
6738,
28034,
1330,
299,
77,... | 3.1875 | 64 |
from collections import Counter
from itertools import product
import numpy as np
import advent
if __name__ == '__main__':
main()
| [
6738,
17268,
1330,
15034,
198,
6738,
340,
861,
10141,
1330,
1720,
198,
11748,
299,
32152,
355,
45941,
198,
198,
11748,
19980,
628,
628,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
1388,
... | 3.27907 | 43 |
import pyro
import pyro.distributions as dist
import torch
from scvi import _CONSTANTS
from scvi.module.base import PyroBaseModuleClass, auto_move_data
from scvi.nn import DecoderSCVI, Encoder
class MyPyroModule(PyroBaseModuleClass):
"""
Skeleton Variational auto-encoder Pyro model.
Here we implement a b... | [
11748,
12972,
305,
198,
11748,
12972,
305,
13,
17080,
2455,
507,
355,
1233,
198,
11748,
28034,
198,
6738,
629,
8903,
1330,
4808,
10943,
2257,
1565,
4694,
198,
6738,
629,
8903,
13,
21412,
13,
8692,
1330,
44954,
14881,
26796,
9487,
11,
82... | 2.878788 | 264 |
#-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#--------------------------------------------------------------------------
import os
f... | [
2,
10097,
45537,
198,
2,
15069,
357,
66,
8,
5413,
10501,
13,
1439,
2489,
10395,
13,
198,
2,
49962,
739,
262,
17168,
13789,
13,
4091,
13789,
13,
14116,
287,
262,
1628,
6808,
329,
198,
2,
5964,
1321,
13,
198,
2,
10097,
35937,
198,
1... | 3.674617 | 1,761 |
# Generated by Django 2.0 on 2019-01-12 16:27
from django.db import migrations, models
import showcase.file_size_validator
| [
2,
2980,
515,
416,
37770,
362,
13,
15,
319,
13130,
12,
486,
12,
1065,
1467,
25,
1983,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
198,
11748,
21742,
13,
7753,
62,
7857,
62,
12102,
1352,
628
] | 3.125 | 40 |
# Generated by Django 2.2.6 on 2019-11-18 11:44
import datetime
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
362,
13,
17,
13,
21,
319,
13130,
12,
1157,
12,
1507,
1367,
25,
2598,
198,
198,
11748,
4818,
8079,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.972222 | 36 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import requests
import datetime
import time
import opasConfig
import models
import logging
import localsecrets
# import urllib.parse
# import json
import sys
# from opasAPISupportLib import save_opas_session_cookie
sys.path.append("..") # Adds higher directory to python mo... | [
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,
7007,
198,
11748,
4818,
8079,
198,
11748,
640,
198,
11748,
1034,
292,
16934,
198,
11748,
4981,
198,
11748,
... | 2.070156 | 18,801 |
from os.path import dirname, basename, isfile
import glob
modules = glob.glob(dirname(__file__)+"/*.py")
__all__ = [ basename(f)[:-3] for f in modules if isfile(f) and not f.endswith('__init__.py')]
from .proximal_join import proximal_join, get_column_types
from .interpolate import interpolate
from .stitch import sti... | [
6738,
28686,
13,
6978,
1330,
26672,
3672,
11,
1615,
12453,
11,
318,
7753,
220,
198,
11748,
15095,
198,
18170,
796,
15095,
13,
4743,
672,
7,
15908,
3672,
7,
834,
7753,
834,
47762,
1,
15211,
13,
9078,
4943,
198,
834,
439,
834,
796,
68... | 3.045802 | 131 |
#!/usr/bin/env python3
"""
Author : Derek Widmayer <dwidmaye@gmail.com>
Date : 2021-01-10
Purpose: Rock the Casbah
"""
import argparse
# --------------------------------------------------
def get_args():
"""Jump the five"""
parser = argparse.ArgumentParser(
description='Jump the five',
for... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
37811,
198,
13838,
1058,
20893,
24801,
76,
2794,
1279,
67,
28029,
11261,
68,
31,
14816,
13,
785,
29,
198,
10430,
220,
220,
1058,
33448,
12,
486,
12,
940,
198,
30026,
3455,
25,
46... | 2.544271 | 384 |
import os
import os.path
import glob
import cv2
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
IMAGENET_MEAN_BGR = [103.939, 116.779, 123.68]
def load_images(data_path, image_height, image_width, plot=False):
"""
Read an image in BGR,
resize to image_height x image_width,
subtr... | [
11748,
28686,
198,
11748,
28686,
13,
6978,
198,
11748,
15095,
198,
11748,
269,
85,
17,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
198,
3... | 2.132612 | 3,514 |
# pylint: disable=wildcard-import, unused-import, unused-wildcard-import
"""Neural network related operators."""
# Re-export in a specific file name so that autodoc can pick it up
from .op.nn import *
| [
2,
279,
2645,
600,
25,
15560,
28,
21992,
9517,
12,
11748,
11,
21958,
12,
11748,
11,
21958,
12,
21992,
9517,
12,
11748,
198,
37811,
8199,
1523,
3127,
3519,
12879,
526,
15931,
198,
2,
797,
12,
39344,
287,
257,
2176,
2393,
1438,
523,
3... | 3.40678 | 59 |
from aiofile import AIOFile
from os import remove
from re import findall
from api import util
from os.path import getsize
from os import listdir
from random import randint
| [
6738,
257,
952,
7753,
1330,
317,
9399,
8979,
198,
6738,
28686,
1330,
4781,
198,
6738,
302,
1330,
1064,
439,
198,
6738,
40391,
1330,
7736,
198,
6738,
28686,
13,
6978,
1330,
3011,
1096,
198,
6738,
28686,
1330,
1351,
15908,
198,
6738,
4738... | 3.729167 | 48 |
import os
import secrets
import tarfile
import time
import zipfile
from collections import defaultdict
import httpx
import pytest
from hatch.config.constants import PublishEnvVars
from hatch.utils.ci import running_in_ci
PUBLISHER_TOKEN = os.environ.get('HATCH_CI_PUBLISHER_TOKEN')
pytestmark = [
pytest.mark.ski... | [
11748,
28686,
198,
11748,
13141,
198,
11748,
13422,
7753,
198,
11748,
640,
198,
11748,
19974,
7753,
198,
6738,
17268,
1330,
4277,
11600,
198,
198,
11748,
2638,
87,
198,
11748,
12972,
9288,
198,
198,
6738,
25834,
13,
11250,
13,
9979,
1187,... | 2.957055 | 163 |
from manim import *
import numpy as np
# creates lists of lists of squares, used for input, kernel, and output
# moves kernel around and displays output squares one at a time
# creates padding
| [
6738,
582,
320,
1330,
1635,
201,
198,
11748,
299,
32152,
355,
45941,
201,
198,
220,
220,
220,
220,
201,
198,
220,
220,
220,
1303,
8075,
8341,
286,
8341,
286,
24438,
11,
973,
329,
5128,
11,
9720,
11,
290,
5072,
201,
198,
201,
198,
... | 3.142857 | 70 |
from django.urls import path
from . import views
urlpatterns = [
path('', views.feed, name='feed'),
path('post/<int:pk>/', views.PostDetailView.as_view(), name='post-detail'),
path('post/<int:pk>/delete/', views.PostDeleteView.as_view(), name='post-delete'),
path('post/new/', views.PostCreateView.as_v... | [
6738,
42625,
14208,
13,
6371,
82,
1330,
3108,
198,
6738,
764,
1330,
5009,
628,
198,
6371,
33279,
82,
796,
685,
198,
220,
220,
220,
3108,
10786,
3256,
5009,
13,
12363,
11,
1438,
11639,
12363,
33809,
198,
220,
220,
220,
3108,
10786,
735... | 2.651515 | 132 |
''' demo of reading a button
2017-0808 PePo - added OLED display to demo
Adafruit article:
https://learn.adafruit.com/micropython-hardware-digital-i-slash-o/digital-inputs
'''
import machine, time
import ssd1306
__LED_PIN = const(14) #GPIO14
__BUTTON_PIN = const(12) #GPIO12
#define led to be set on / off by button... | [
7061,
6,
13605,
286,
3555,
257,
4936,
198,
2177,
12,
15,
28362,
2631,
18833,
532,
2087,
47463,
3359,
284,
13605,
198,
1215,
1878,
4872,
2708,
25,
198,
3740,
1378,
35720,
13,
324,
1878,
4872,
13,
785,
14,
9383,
1773,
7535,
12,
10424,
... | 2.559796 | 393 |
from copy import deepcopy
from dataclasses import dataclass
import itertools
import re
from typing import Dict
from typing import Optional
import numpy as np
import pandas as pd
from pandas.testing import assert_frame_equal
import pytest
from obp.ope import SlateIndependentIPS
from obp.ope import SlateOffPolicyEvalua... | [
6738,
4866,
1330,
2769,
30073,
198,
6738,
4818,
330,
28958,
1330,
4818,
330,
31172,
198,
11748,
340,
861,
10141,
198,
11748,
302,
198,
6738,
19720,
1330,
360,
713,
198,
6738,
19720,
1330,
32233,
198,
198,
11748,
299,
32152,
355,
45941,
... | 2.350366 | 10,666 |
import os, sys
__file__ = os.path.normpath(os.path.abspath(__file__))
__path__ = os.path.dirname(__file__)
__popup_path__ = os.path.join(__path__, 'popup')
# print(__path__)
if __path__ not in sys.path:
sys.path.insert(0, __path__)
if __popup_path__ not in sys.path:
sys.path.insert(0, __popup_path__)
from ... | [
11748,
28686,
11,
25064,
198,
198,
834,
7753,
834,
796,
28686,
13,
6978,
13,
27237,
6978,
7,
418,
13,
6978,
13,
397,
2777,
776,
7,
834,
7753,
834,
4008,
198,
834,
6978,
834,
796,
28686,
13,
6978,
13,
15908,
3672,
7,
834,
7753,
834... | 2.700704 | 284 |
# Mock apis needs to be commented before used within SAP Data Intelligence
#from diadmin.dimockapi.mock_api import mock_api
#api = mock_api(__file__)
import os
import json
import requests
import http.client
from base64 import b64encode
api.add_generator(gen) | [
2,
44123,
2471,
271,
2476,
284,
307,
16476,
878,
973,
1626,
48323,
6060,
9345,
198,
2,
6738,
2566,
28482,
13,
27740,
735,
15042,
13,
76,
735,
62,
15042,
1330,
15290,
62,
15042,
198,
2,
15042,
796,
15290,
62,
15042,
7,
834,
7753,
834... | 3.303797 | 79 |
from tkinter import filedialog
from bs4 import *
import re
from pprint import *
import pprint
import xlsxwriter
from tkinter import *
# from tkinter.filedialog import askopenfilename
Tk().withdraw() # we don't want a full GUI, so keep the root window from appearing
filename = filedialog.askopenfilename() #... | [
6738,
256,
74,
3849,
1330,
5717,
498,
519,
201,
198,
6738,
275,
82,
19,
1330,
1635,
201,
198,
11748,
302,
201,
198,
6738,
279,
4798,
1330,
1635,
201,
198,
11748,
279,
4798,
201,
198,
11748,
2124,
7278,
87,
16002,
201,
198,
6738,
256... | 2.515038 | 266 |