content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
props.bf_Shank_Dia = 3.0
#props.bf_Pitch = 0.5 # Coarse
props.bf_Pitch = 0.35 # Fine
props.bf_Crest_Percent = 10
props.bf_Root_Percent = 10
props.bf_Major_Dia = 3.0
props.bf_Minor_Dia = props.bf_Major_Dia - (1.082532 * props.bf_Pitch)
props.bf_Hex_Head_Flat_Distance = 5.5
props.bf_Hex_Head_Height = 2.0
props.bf_Cap... | [
1676,
862,
13,
19881,
62,
2484,
962,
62,
35,
544,
796,
513,
13,
15,
198,
2,
1676,
862,
13,
19881,
62,
47,
2007,
796,
657,
13,
20,
220,
220,
1303,
1766,
17208,
198,
1676,
862,
13,
19881,
62,
47,
2007,
796,
657,
13,
2327,
220,
2... | 1.9925 | 400 |
from django.shortcuts import render, redirect
from django.http import HttpResponse
from django.shortcuts import redirect
from .models import Image,Friend,Post #imageちゃんとある
from .forms import ImageForm, FriendForm,PostForm
# create model
| [
6738,
42625,
14208,
13,
19509,
23779,
1330,
8543,
11,
18941,
198,
6738,
42625,
14208,
13,
4023,
1330,
367,
29281,
31077,
198,
6738,
42625,
14208,
13,
19509,
23779,
1330,
18941,
198,
6738,
764,
27530,
1330,
7412,
11,
23331,
11,
6307,
220,
... | 3.342466 | 73 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from factory import DjangoModelFactory, Sequence
from reprohack_hub.reprohack.models import Paper
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
6738,
8860,
1330,
37770,
17633,
22810,
11,
45835,
198,
198,
6738,
43969,
31153,
62,
40140,
13,
260,
1676,
31153,
1... | 3.0625 | 48 |
import os.path
import logging
import warnings
import contextlib
from dictknife import loading
from dictknife.cliutils import traceback_shortly
from magicalimport import import_symbol
logger = logging.getLogger(__name__)
def merge(
*,
files: list,
dst: str,
style: str, # flavor?, strategy?
stri... | [
11748,
28686,
13,
6978,
198,
11748,
18931,
198,
11748,
14601,
198,
11748,
4732,
8019,
198,
6738,
8633,
48810,
1330,
11046,
198,
6738,
8633,
48810,
13,
44506,
26791,
1330,
12854,
1891,
62,
19509,
306,
198,
6738,
10883,
11748,
1330,
1330,
6... | 1.945867 | 1,367 |
from rostran.core.exceptions import InvalidTemplateCondition
| [
6738,
686,
2536,
272,
13,
7295,
13,
1069,
11755,
1330,
17665,
30800,
48362,
628,
198
] | 4.2 | 15 |
"""modoboa-admin-relaydomains unit tests."""
import json
from django.core.files.base import ContentFile
from django.core.urlresolvers import reverse
from django.test import TestCase
from modoboa.admin import factories as admin_factories
from modoboa.admin import models as admin_models
from modoboa.core.factories imp... | [
37811,
4666,
672,
12162,
12,
28482,
12,
2411,
323,
3438,
1299,
4326,
5254,
526,
15931,
198,
198,
11748,
33918,
198,
198,
6738,
42625,
14208,
13,
7295,
13,
16624,
13,
8692,
1330,
14041,
8979,
198,
6738,
42625,
14208,
13,
7295,
13,
6371,
... | 2.435361 | 526 |
# Generated by the pRPC protocol buffer compiler plugin. DO NOT EDIT!
# source: api/api_proto/users.proto
import base64
import zlib
from google.protobuf import descriptor_pb2
# Includes description of the api/api_proto/users.proto and all of its transitive
# dependencies. Includes source code info.
FILE_DESCRIPTOR_... | [
2,
2980,
515,
416,
262,
279,
49,
5662,
8435,
11876,
17050,
13877,
13,
220,
8410,
5626,
48483,
0,
198,
2,
2723,
25,
40391,
14,
15042,
62,
1676,
1462,
14,
18417,
13,
1676,
1462,
198,
198,
11748,
2779,
2414,
198,
11748,
1976,
8019,
198... | 1.338714 | 6,814 |
import requests
import json
import time
import logging
log = logging.getLogger(__name__)
sh = logging.StreamHandler()
log.addHandler(sh)
log.setLevel(logging.INFO)
from nose.tools import with_setup
import pymongo
from bson.objectid import ObjectId
db = pymongo.MongoClient('mongodb://localhost:9001/scitran').get_defa... | [
11748,
7007,
198,
11748,
33918,
198,
11748,
640,
198,
11748,
18931,
198,
198,
6404,
796,
18931,
13,
1136,
11187,
1362,
7,
834,
3672,
834,
8,
198,
1477,
796,
18931,
13,
12124,
25060,
3419,
198,
6404,
13,
2860,
25060,
7,
1477,
8,
198,
... | 2.804734 | 169 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from collections import OrderedDict
import abc
import tensorflow as tf
import os
import sys
PACKAGE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.insert(0, PACKAGE_DIR)
from lib.r... | [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
6738,
11593,
37443,
834,
1330,
7297,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
198,
6738,
17268,
1330,
14230,
1068,
35,
713,
198,
11748,
450,
66,
198,
11748,
11192,
273... | 2.08259 | 3,475 |
import numpy as np
from matplotlib import pyplot as plt
from black_scholes.plotters import PlotTrajectories
from black_scholes import NumericGeometricBrownianMotion, TheoreticalGeometricBrownianMotion
N_MAX = 20000
N = 5
MU, SIGMA = 1, 0.5
bm = NumericGeometricBrownianMotion(
x_0=5,
n_max=N_MAX,
mu=lambd... | [
11748,
299,
32152,
355,
45941,
198,
6738,
2603,
29487,
8019,
1330,
12972,
29487,
355,
458,
83,
198,
198,
6738,
2042,
62,
20601,
4316,
13,
29487,
1010,
1330,
28114,
15721,
752,
1749,
198,
6738,
2042,
62,
20601,
4316,
1330,
399,
39223,
10... | 2.321041 | 461 |
from monitorrent.new_version_checker import NewVersionChecker
# noinspection PyUnusedLocal
| [
6738,
5671,
1156,
13,
3605,
62,
9641,
62,
9122,
263,
1330,
968,
14815,
9787,
263,
628,
198,
2,
645,
1040,
14978,
9485,
3118,
1484,
14565,
198
] | 3.576923 | 26 |
#
# Copyright (c) 2009-2015, Jack Poulson
# All rights reserved.
#
# This file is part of Elemental and is under the BSD 2-Clause License,
# which can be found in the LICENSE file in the root directory, or at
# http://opensource.org/licenses/BSD-2-Clause
#
from environment import *
import numpy as np
buffer_fro... | [
2,
198,
2,
220,
15069,
357,
66,
8,
3717,
12,
4626,
11,
3619,
350,
2852,
1559,
198,
2,
220,
1439,
2489,
10395,
13,
198,
2,
198,
2,
220,
770,
2393,
318,
636,
286,
21340,
290,
318,
739,
262,
347,
10305,
362,
12,
2601,
682,
13789,
... | 2.340674 | 5,994 |
from .. utils import TranspileTestCase
| [
6738,
11485,
3384,
4487,
1330,
3602,
79,
576,
14402,
20448,
628
] | 3.636364 | 11 |
from openpyxl import load_workbook
import xml.etree.ElementTree as ET
import xlsxwriter
import re
import os
if __name__ == "__main__":
while True:
xml_name = input("Type the name of the XML file with .xml: ")
if xml_name.upper() != "QUIT":
excel_name = create_excel_name(xml_name)... | [
6738,
1280,
9078,
87,
75,
1330,
3440,
62,
1818,
2070,
198,
11748,
35555,
13,
316,
631,
13,
20180,
27660,
355,
12152,
198,
11748,
2124,
7278,
87,
16002,
198,
11748,
302,
198,
11748,
28686,
628,
628,
628,
628,
198,
361,
11593,
3672,
834... | 2.151762 | 369 |
import unittest
from notifyme.cli import parse_args
| [
11748,
555,
715,
395,
198,
198,
6738,
19361,
1326,
13,
44506,
1330,
21136,
62,
22046,
628
] | 3.375 | 16 |
import numpy as np
import matplotlib.pyplot as plt
import itertools
import sys
sys.path.append('/afs/ipp/aug/ads-diags/common/python/lib')
import dd
import map_equ
from scipy.interpolate import interp1d
eqm = map_equ.equ_map()
marker = itertools.cycle(('o', 's', 'd', 'v', '^', '<', '>', '*', '.'))
shot_list = np.arr... | [
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
340,
861,
10141,
198,
11748,
25064,
198,
17597,
13,
6978,
13,
33295,
10786,
14,
1878,
82,
14,
3974,
14,
7493,
14,
5643,
12,
10989... | 2.002224 | 1,349 |
import confply.{config_type} as {config_type}
tool_name = "echo"
| [
11748,
1013,
2145,
13,
90,
11250,
62,
4906,
92,
355,
1391,
11250,
62,
4906,
92,
198,
198,
25981,
62,
3672,
796,
366,
30328,
1,
628,
628,
198
] | 2.592593 | 27 |
import numpy as np
import copy as cp
from genotype import *
if __name__ == '__main__':
'''
Some tests
'''
n_neu = 4
n_pop = 25
n_grp = 5
es = EvolutionarySearch(EnvMock, PheMock, n_neu, n_pop, n_grp)
# tests for fit_stats
for i in range(n_pop): es.pop[i].fitness =... | [
11748,
299,
32152,
355,
45941,
201,
198,
11748,
4866,
355,
31396,
201,
198,
6738,
2429,
8690,
1330,
1635,
201,
198,
201,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
201,
198,
220,
220,
220,
705,
7061,
201,
198,
220,... | 2.221523 | 1,431 |
# encoding: utf-8
# cines.py
#
# First release: 2012-05-02
#
# The MIT License (MIT)
#
# Copyright (c) 2012 Roberto Zoia
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restric... | [
2,
21004,
25,
3384,
69,
12,
23,
198,
198,
2,
269,
1127,
13,
9078,
198,
198,
2,
198,
2,
220,
3274,
2650,
25,
2321,
12,
2713,
12,
2999,
220,
220,
198,
2,
198,
2,
383,
17168,
13789,
357,
36393,
8,
198,
2,
198,
2,
15069,
357,
66... | 2.97851 | 698 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2019/12/15 下午11:05
# @Title : 11. 盛最多水的容器
# @Link : https://leetcode-cn.com/problems/container-with-most-water/
QUESTION = """
给定 n 个非负整数 a1,a2,...,an,每个数代表坐标中的一个点 (i, ai) 。
在坐标内画 n 条垂直线,垂直线 i 的两个端点分别为 (i, ai) 和 (i, 0)。找出其中的两条线
使得它们与 x 轴共同构成的容器可以容纳最多的水。
... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2488,
7575,
220,
220,
220,
1058,
13130,
14,
1065,
14,
1314,
220,
10310,
233,
39355,
230,
1157,
25,
2713,
198,
2,
... | 0.894469 | 1,374 |
# -*- coding: utf-8 -*-
"""Tests for sktime annotators."""
import pandas as pd
import pytest
from sktime.registry import all_estimators
from sktime.utils._testing.estimator_checks import _make_args
ALL_ANNOTATORS = all_estimators(estimator_types="series-annotator", return_names=False)
@pytest.mark.parametrize("Est... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
51,
3558,
329,
1341,
2435,
24708,
2024,
526,
15931,
198,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
12972,
9288,
198,
198,
6738,
1341,
2435,
13,
2301,
4592... | 2.637097 | 248 |
from django import template
from devilry.devilry_gradeform.views import grade_form
register = template.Library()
@register.simple_tag(name="devilry_gradeform_editable_advanced")
def devilry_gradeform_editable_advanced(assignment, feedbackset):
"""
:param assignment:
:param feedbackset:
:return:
... | [
6738,
42625,
14208,
1330,
11055,
198,
198,
6738,
17118,
563,
13,
7959,
346,
563,
62,
9526,
687,
13,
33571,
1330,
9559,
62,
687,
628,
198,
30238,
796,
11055,
13,
23377,
3419,
198,
198,
31,
30238,
13,
36439,
62,
12985,
7,
3672,
2625,
... | 3.121429 | 140 |
from cyclopeps.tools.utils import *
from cyclopeps.tools.peps_tools import PEPS
from cyclopeps.tools.ops_tools import ops_conj_trans
from cyclopeps.ops.asep import return_op,return_curr_op
from cyclopeps.ops.basic import return_dens_op
from cyclopeps.algs.tebd import run_tebd
from sys import argv
from numpy import lins... | [
6738,
11700,
404,
25386,
13,
31391,
13,
26791,
1330,
1635,
198,
6738,
11700,
404,
25386,
13,
31391,
13,
431,
862,
62,
31391,
1330,
18468,
3705,
198,
6738,
11700,
404,
25386,
13,
31391,
13,
2840,
62,
31391,
1330,
39628,
62,
1102,
73,
6... | 1.913449 | 2,357 |
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | [
2,
15069,
13130,
3012,
11419,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198,
2,
921,
743,
733... | 2.712703 | 14,257 |
# Copyright (c) 2017-2022 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
__all__ = ["FrozenDict", "to_hashable"]
class FrozenDict(dict):
"""
A special subclass of `dict` that is immutable and hashable. Instances of this "dict" can be
use... | [
2,
15069,
357,
66,
8,
2177,
12,
1238,
1828,
10231,
31433,
357,
10462,
13947,
8,
402,
2022,
39,
290,
14,
273,
663,
29116,
13,
1439,
2489,
10395,
13,
198,
2,
30628,
55,
12,
34156,
12,
33234,
7483,
25,
24843,
12,
17,
13,
15,
198,
1... | 3.025 | 120 |
#!/usr/bin/env python
# Based on: https://topaz.github.io/paste/#XQAAAQD1BwAAAAAAAAA0m0pnuFI8c9WAoVc3IiG2klervCCkc3Fk33PvMZ8ZxYTRWczt5PtHYRBHYFff4ul0TRcyM/2lzDiSzW4VNg/PNjmJjYW9ckowDG1eb/5D8V9Rco3xOqXH2QGG6rijExTF9a0BoO3AniSgROLnmdNs7IU2MHGEC1h46yQ0I9+/3NjIUx/j8JHXp+mzyHeUNzRE08VPVEOSWXc3c3QusQxOVetAC819kymhm0NzeCxcwo... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
2,
13403,
319,
25,
3740,
1378,
4852,
1031,
13,
12567,
13,
952,
14,
34274,
31113,
55,
48,
29697,
48,
35,
16,
33,
86,
43488,
32,
15,
76,
15,
21999,
84,
11674,
23,
66,
24,
1554... | 1.589744 | 975 |
"""Testing the Basic Chunk Layer"""
import multiprocessing
import time
import unittest
from PiCN.Layers.ChunkLayer.DataOffloadingChunkLayer import DataOffloadingChunklayer, CaEntry, RequestTableEntry
from PiCN.Layers.ICNLayer.ContentStore import ContentStoreMemoryExact
from PiCN.Layers.ICNLayer.ForwardingInformationB... | [
37811,
44154,
262,
14392,
609,
2954,
34398,
37811,
198,
198,
11748,
18540,
305,
919,
278,
198,
11748,
640,
198,
11748,
555,
715,
395,
198,
198,
6738,
13993,
44175,
13,
43,
6962,
13,
1925,
2954,
49925,
13,
6601,
9362,
25138,
1925,
2954,
... | 2.181155 | 5,487 |
from typing import Dict, Generator, cast
import dagster._check as check
from dagster.config.field import Field
from .config_type import ConfigType, ConfigTypeKind
from .snap import ConfigSchemaSnapshot, snap_from_config_type
| [
6738,
19720,
1330,
360,
713,
11,
35986,
11,
3350,
198,
198,
11748,
48924,
1706,
13557,
9122,
355,
2198,
198,
6738,
48924,
1706,
13,
11250,
13,
3245,
1330,
7663,
198,
198,
6738,
764,
11250,
62,
4906,
1330,
17056,
6030,
11,
17056,
6030,
... | 3.693548 | 62 |
import discord
client = discord.Client()
from app import bot | [
201,
198,
11748,
36446,
201,
198,
201,
198,
16366,
796,
36446,
13,
11792,
3419,
201,
198,
6738,
598,
1330,
10214
] | 3.3 | 20 |
from kivy.uix.boxlayout import BoxLayout
from kivy.properties import StringProperty, NumericProperty
| [
6738,
479,
452,
88,
13,
84,
844,
13,
3524,
39786,
1330,
8315,
32517,
198,
6738,
479,
452,
88,
13,
48310,
1330,
10903,
21746,
11,
399,
39223,
21746,
198
] | 3.607143 | 28 |
import scenario
sock = scenario.start_scenario()
sock.close() | [
11748,
8883,
198,
198,
82,
735,
796,
8883,
13,
9688,
62,
1416,
39055,
3419,
198,
82,
735,
13,
19836,
3419
] | 3.1 | 20 |
from typing import Any, cast
import pytest # type: ignore
from ruamel.yaml.comments import CommentedMap
from schema_salad.sourceline import cmap
from cwltool import command_line_tool
from cwltool.context import LoadingContext, RuntimeContext
from cwltool.utils import onWindows, windows_default_container_id
@pytest... | [
6738,
19720,
1330,
4377,
11,
3350,
198,
198,
11748,
12972,
9288,
220,
1303,
2099,
25,
8856,
198,
6738,
7422,
17983,
13,
88,
43695,
13,
15944,
1330,
955,
12061,
13912,
198,
6738,
32815,
62,
21680,
324,
13,
10459,
1370,
1330,
269,
8899,
... | 2.845304 | 362 |
# coding: utf-8
from django import template
__author__ = 'mhaze'
register = template.Library()
@register.inclusion_tag('textflow.html')
| [
2,
19617,
25,
3384,
69,
12,
23,
198,
6738,
42625,
14208,
1330,
11055,
198,
198,
834,
9800,
834,
796,
705,
76,
71,
6201,
6,
198,
198,
30238,
796,
11055,
13,
23377,
3419,
628,
198,
31,
30238,
13,
259,
4717,
62,
12985,
10786,
5239,
1... | 2.916667 | 48 |
from functools import reduce
from pathlib import Path
# import numba
import pandas as pd
# import compass.core as ci
PROJECT_ROOT = Path(__file__).absolute().parent.parent.parent.parent
# @numba.njit
def first(item, vec):
"""return the index of the first occurrence of item in vec"""
for i, v in enumerate(... | [
6738,
1257,
310,
10141,
1330,
4646,
198,
6738,
3108,
8019,
1330,
10644,
198,
198,
2,
1330,
997,
7012,
198,
11748,
19798,
292,
355,
279,
67,
198,
198,
2,
1330,
31855,
13,
7295,
355,
269,
72,
198,
198,
31190,
23680,
62,
13252,
2394,
7... | 2.605882 | 170 |
"""init
Revision ID: 1c8e26c03625
Revises:
Create Date: 2020-05-14 00:55:00.914868
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '1c8e26c03625'
down_revision = None
branch_labels = None
depends_on = None
| [
37811,
15003,
198,
198,
18009,
1166,
4522,
25,
352,
66,
23,
68,
2075,
66,
48597,
1495,
198,
18009,
2696,
25,
220,
198,
16447,
7536,
25,
12131,
12,
2713,
12,
1415,
3571,
25,
2816,
25,
405,
13,
24,
18294,
3104,
198,
198,
37811,
198,
... | 2.528302 | 106 |
import numpy as np
| [
11748,
299,
32152,
355,
45941,
628
] | 3.333333 | 6 |
#!/usr/bin/env python
import asyncio
from faker import Faker
from scalade import scalade_func
from scalade.managers import ContextManager
from scalade.variables import Variable
@scalade_func
if __name__ == "__main__":
asyncio.run(main())
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
11748,
30351,
952,
198,
198,
6738,
277,
3110,
1330,
376,
3110,
198,
198,
6738,
16578,
671,
1330,
16578,
671,
62,
20786,
198,
6738,
16578,
671,
13,
805,
10321,
1330,
30532,
13511,
198,
... | 3.036585 | 82 |
import pytest
pytest.importorskip("rediscluster")
| [
11748,
12972,
9288,
198,
198,
9078,
9288,
13,
11748,
669,
74,
541,
7203,
445,
271,
565,
5819,
4943,
198
] | 2.684211 | 19 |
from django.urls import path
from . import views
urlpatterns = [
path("posts", views.PostList.as_view()),
]
| [
6738,
42625,
14208,
13,
6371,
82,
1330,
3108,
198,
198,
6738,
764,
1330,
5009,
198,
198,
6371,
33279,
82,
796,
685,
198,
220,
220,
220,
3108,
7203,
24875,
1600,
5009,
13,
6307,
8053,
13,
292,
62,
1177,
3419,
828,
198,
60,
198
] | 2.714286 | 42 |
from pymongo import MongoClient
import pprint
from IPython.display import YouTubeVideo, Image, display, Video
from wildbook_social import EmbedTweet
from datetime import timedelta
import time
import dateutil.parser
import matplotlib.pyplot as plt
import csv
import pandas as pd
import geopandas as gpd
import descartes
p... | [
6738,
279,
4948,
25162,
1330,
42591,
11792,
198,
11748,
279,
4798,
198,
6738,
6101,
7535,
13,
13812,
1330,
7444,
10798,
11,
7412,
11,
3359,
11,
7623,
198,
6738,
4295,
2070,
62,
14557,
1330,
13302,
276,
47845,
198,
6738,
4818,
8079,
1330... | 2.94186 | 1,462 |
from fastapi import FastAPI
from .routers import items, users, login
app = FastAPI()
app.include_router(users.router)
app.include_router(items.router)
app.include_router(login.router) | [
6738,
3049,
15042,
1330,
12549,
17614,
198,
6738,
764,
472,
1010,
1330,
3709,
11,
2985,
11,
17594,
628,
198,
1324,
796,
12549,
17614,
3419,
198,
198,
1324,
13,
17256,
62,
472,
353,
7,
18417,
13,
472,
353,
8,
198,
1324,
13,
17256,
62... | 2.90625 | 64 |
# This code is modified from https://github.com/wyharveychen/CloserLookFewShot/
import torch
import torch.nn as nn
from torch.nn.utils.weight_norm import WeightNorm
| [
2,
770,
2438,
318,
9518,
422,
3740,
1378,
12567,
13,
785,
14,
21768,
9869,
3304,
6607,
14,
2601,
13416,
8567,
32351,
28512,
14,
198,
198,
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
6738,
28034,
13,
20471,
13,
26791... | 3.34 | 50 |
# This code is part of Qiskit.
#
# (C) Copyright IBM 2018, 2021.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivat... | [
2,
770,
2438,
318,
636,
286,
1195,
1984,
270,
13,
198,
2,
198,
2,
357,
34,
8,
15069,
19764,
2864,
11,
33448,
13,
198,
2,
198,
2,
770,
2438,
318,
11971,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
13,
921,
743,
198,
2,
7330... | 2.446787 | 996 |
import os
from kf_lib_data_ingest.common.pandas_utils import outer_merge
from kf_lib_data_ingest.common.concept_schema import CONCEPT
from kf_lib_data_ingest.config import DEFAULT_KEY
| [
11748,
28686,
198,
6738,
479,
69,
62,
8019,
62,
7890,
62,
278,
395,
13,
11321,
13,
79,
392,
292,
62,
26791,
1330,
12076,
62,
647,
469,
198,
6738,
479,
69,
62,
8019,
62,
7890,
62,
278,
395,
13,
11321,
13,
43169,
62,
15952,
2611,
... | 2.80303 | 66 |
import os
import hashlib
import time
import base64
from hmac import HMAC
import qrcode
generate_key = lambda : base64.b32encode(os.urandom(20)).decode("ascii")
| [
11748,
28686,
198,
11748,
12234,
8019,
198,
11748,
640,
198,
11748,
2779,
2414,
198,
198,
6738,
289,
20285,
1330,
25904,
2246,
198,
198,
11748,
10662,
6015,
1098,
628,
198,
8612,
378,
62,
2539,
796,
37456,
1058,
2779,
2414,
13,
65,
2624... | 2.741935 | 62 |
from django.db import models, transaction, DataError
from django.contrib.auth.models import User
from django.utils import timezone
from django.urls import reverse
from django.core.exceptions import PermissionDenied
from consensus_engine.utils import ProposalState
from . import GroupMembership, ChoiceTicket, ConsensusHi... | [
6738,
42625,
14208,
13,
9945,
1330,
4981,
11,
8611,
11,
6060,
12331,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
27530,
1330,
11787,
198,
6738,
42625,
14208,
13,
26791,
1330,
640,
11340,
198,
6738,
42625,
14208,
13,
6371,
82,... | 3.881119 | 143 |
# -*- coding: utf-8 -*-
import requests.packages.urllib3.util.ssl_
import base64
import logging
import os
import re
import zlib
import html
import io
import urllib.parse
from babelfish import Language, language_converters
from guessit import guessit
from requests import Session
from rarfile import RarFile, is_rarfile
... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
7007,
13,
43789,
13,
333,
297,
571,
18,
13,
22602,
13,
45163,
62,
198,
11748,
2779,
2414,
198,
11748,
18931,
198,
11748,
28686,
198,
11748,
302,
198,
11748,
1976,... | 2.413673 | 1,726 |
from flask_backend import bcrypt, BCRYPT_SALT
from flask_backend.database_scripts.authentication_scripts import helper_authentication, admin_authentication
from flask_backend.support_functions import formatting
import random
| [
198,
6738,
42903,
62,
1891,
437,
1330,
275,
29609,
11,
347,
9419,
56,
11571,
62,
50,
31429,
198,
6738,
42903,
62,
1891,
437,
13,
48806,
62,
46521,
13,
41299,
3299,
62,
46521,
1330,
31904,
62,
41299,
3299,
11,
13169,
62,
41299,
3299,
... | 3.741935 | 62 |
APP_ID_TO_ARN_IDS = {
'co.justyo.yoapp': [
'ios',
'ios-beta',
'ios-development',
'android',
'winphone'
],
'co.justyo.yopolls': [
'com.flashpolls.beta.dev',
'com.flashpolls.beta.prod',
'com.flashpolls.flashpolls.dev',
'com.flashpolls.... | [
628,
198,
24805,
62,
2389,
62,
10468,
62,
1503,
45,
62,
14255,
796,
1391,
198,
220,
220,
220,
705,
1073,
13,
3137,
8226,
13,
8226,
1324,
10354,
685,
198,
220,
220,
220,
220,
220,
220,
220,
705,
4267,
3256,
198,
220,
220,
220,
220,... | 1.757825 | 607 |
import math
if __name__ == '__main__':
run()
| [
11748,
10688,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
1057,
3419,
198
] | 2.380952 | 21 |
# -*- coding: utf-8 -*-
"""Library exceptions."""
from .const import API_AUTH, ERROR_AUTH, ERROR_COMMON, ERROR_DOWNLOAD_SEARCH, ERROR_DOWNLOAD_TASK, ERROR_FILE, ERROR_SURVEILLANCE, ERROR_VIRTUALIZATION
class SynologyDSMException(Exception):
"""Generic Synology DSM exception."""
# Request
class SynologyDSM... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
201,
198,
37811,
23377,
13269,
526,
15931,
201,
198,
6738,
764,
9979,
1330,
7824,
62,
32,
24318,
11,
33854,
62,
32,
24318,
11,
33854,
62,
9858,
27857,
11,
33854,
62,
41925,
... | 2.971739 | 460 |
import tempfile
import glob
from os.path import join, dirname
import pytest
from rbu.benchmark import benchmark_commits, compare_benchmarks
from test.consts import COMMITS, ERRORED_COMMIT
@pytest.mark.setup_repo
| [
11748,
20218,
7753,
198,
11748,
15095,
198,
6738,
28686,
13,
6978,
1330,
4654,
11,
26672,
3672,
198,
198,
11748,
12972,
9288,
198,
198,
6738,
374,
11110,
13,
26968,
4102,
1330,
18335,
62,
9503,
896,
11,
8996,
62,
26968,
14306,
198,
6738... | 3.238806 | 67 |
from unittest.case import TestCase
from examples.handlers.save_tweet_handler import SaveTweetHandler
from responsebot.models import Tweet
try:
from mock import MagicMock, patch, call
except ImportError:
from unittest.mock import MagicMock, patch, call
from responsebot.responsebot_client import ResponseBotCli... | [
6738,
555,
715,
395,
13,
7442,
1330,
6208,
20448,
198,
198,
6738,
6096,
13,
4993,
8116,
13,
21928,
62,
83,
7277,
62,
30281,
1330,
12793,
47845,
25060,
198,
6738,
2882,
13645,
13,
27530,
1330,
18752,
198,
198,
28311,
25,
198,
220,
220,... | 3.532609 | 92 |
# ! /usr/bin/python
# Copyright (c) 2022, NVIDIA CORPORATION. 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
#
# Unle... | [
2,
5145,
1220,
14629,
14,
8800,
14,
29412,
198,
2,
15069,
357,
66,
8,
33160,
11,
15127,
23929,
44680,
6234,
13,
220,
1439,
2489,
10395,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
341... | 2.588601 | 965 |
import os
HOST = os.getenv('API_BASE_URL', default='0.0.0.0')
PORT = os.getenv('API_PORT', default='80')
DEBUG = bool(os.getenv('API_DEBUG', default='True'))
MONGO_HOST = os.getenv('MONGO_HOST', default='0.0.0.0')
MONGO_PORT = os.getenv('MONGO_PORT', default=27017)
MONGO_DATABASE = os.getenv('MONGO_DATABASE', default... | [
11748,
28686,
198,
198,
39,
10892,
796,
28686,
13,
1136,
24330,
10786,
17614,
62,
33,
11159,
62,
21886,
3256,
4277,
11639,
15,
13,
15,
13,
15,
13,
15,
11537,
198,
15490,
796,
28686,
13,
1136,
24330,
10786,
17614,
62,
15490,
3256,
4277... | 2.395238 | 210 |
def Geoc2Geod(GeocVector, a, e):
''' Transformação de coordenadas do ref. geocêntrico para o ref. geodético
INPUT: GeocVector - vetor geocêntrico [x,y,z] [m]
a - Raio equatorial [m]
e - Excentricidade
OUTPUT: GeodVector - vetor geodético [longitude(rad),latitude(rad),al... | [
4299,
2269,
420,
17,
10082,
375,
7,
10082,
420,
38469,
11,
257,
11,
304,
2599,
198,
220,
220,
220,
705,
7061,
26981,
64,
16175,
28749,
390,
6349,
268,
38768,
466,
1006,
13,
4903,
420,
25792,
429,
1173,
78,
31215,
267,
1006,
13,
4903... | 1.771626 | 578 |
from apscheduler.util import convert_to_datetime
| [
6738,
257,
862,
1740,
18173,
13,
22602,
1330,
10385,
62,
1462,
62,
19608,
8079,
628
] | 3.333333 | 15 |
# -*- coding: UTF-8 -*-
# -*- coding: UTF-8 -*-
import json
import logging
from pprint import pprint
from pygame.locals import *
from dev01_22_19.CONFIG import *
from dev01_22_19.data.characters.base import *
from roengine import *
logger = logging.getLogger('map_editor')
LOADFILE = './data/maps/untitled.json'
... | [
2,
532,
9,
12,
19617,
25,
41002,
12,
23,
532,
9,
12,
198,
198,
2,
532,
9,
12,
19617,
25,
41002,
12,
23,
532,
9,
12,
198,
198,
11748,
33918,
198,
11748,
18931,
198,
6738,
279,
4798,
1330,
279,
4798,
198,
198,
6738,
12972,
6057,
... | 2.585987 | 157 |
from bs4 import BeautifulSoup
import requests
import re
import importlib
import base
import foodsoft_article
import foodsoft_article_import
# Inputs this script's methods take
# none
# Executable script methods
read_webshop = base.ScriptMethod(name="read_webshop")
generate_csv = base.ScriptMethod(name="generate_csv"... | [
6738,
275,
82,
19,
1330,
23762,
50,
10486,
198,
11748,
7007,
198,
11748,
302,
198,
11748,
1330,
8019,
198,
198,
11748,
2779,
198,
11748,
2057,
4215,
62,
20205,
198,
11748,
2057,
4215,
62,
20205,
62,
11748,
198,
198,
2,
23412,
82,
428,... | 3.017804 | 337 |
import mysql.connector
import os
## TODO yuck
RESULT_PARENT = "%s/text"%os.path.dirname(os.path.realpath(__file__))
## race db credentials
DB_USER="scraper"
DB_PASSWORD="Compellent04"
RACE_DB="skiscraper.races"
def getPathHits(key,year):
"""
a temporary solution until an inverted index is implemented... | [
11748,
48761,
13,
8443,
273,
201,
198,
11748,
28686,
201,
198,
201,
198,
2235,
16926,
46,
331,
1347,
201,
198,
19535,
16724,
62,
27082,
3525,
796,
36521,
82,
14,
5239,
1,
4,
418,
13,
6978,
13,
15908,
3672,
7,
418,
13,
6978,
13,
53... | 2.45122 | 328 |
# Dominic Assia & Omer Canca
'''
Final New Password Module
~~~~~
Functions:
createNewPassword()
'''
import re
| [
2,
36401,
2195,
544,
1222,
440,
647,
327,
42124,
198,
7061,
6,
198,
220,
220,
220,
8125,
968,
30275,
19937,
198,
220,
220,
220,
220,
8728,
93,
628,
220,
220,
220,
40480,
25,
628,
220,
220,
220,
2251,
3791,
35215,
3419,
198,
7061,
... | 2.632653 | 49 |
import os
PROD = 'production'
DEV = 'development'
TEST = 'test'
| [
11748,
28686,
198,
198,
4805,
3727,
796,
705,
25493,
6,
198,
39345,
796,
705,
31267,
6,
198,
51,
6465,
796,
705,
9288,
6,
628,
628,
628
] | 2.692308 | 26 |
from style.utils.utils import sanitize_author_name
| [
6738,
3918,
13,
26791,
13,
26791,
1330,
5336,
270,
1096,
62,
9800,
62,
3672,
628
] | 3.466667 | 15 |
import os
from anshitsu import retouch
from PIL import Image
| [
11748,
28686,
198,
198,
6738,
281,
1477,
19831,
1330,
1005,
7673,
198,
6738,
350,
4146,
1330,
7412,
628,
628,
198
] | 3.3 | 20 |
'''
TACO: Multi-sample transcriptome assembly from RNA-Seq
'''
from taco.lib.base import Strand
from taco.lib.splice_graph import SpliceGraph
from taco.lib.path_graph import PathGraphFactory, PathGraph
from taco.lib.cpathfinder import find_paths
from taco.test.base import read_single_locus
# def test_path_ties():... | [
7061,
6,
198,
51,
2246,
46,
25,
15237,
12,
39873,
14687,
462,
10474,
422,
25897,
12,
4653,
80,
198,
7061,
6,
198,
6738,
47884,
13,
8019,
13,
8692,
1330,
4285,
392,
198,
6738,
47884,
13,
8019,
13,
22018,
501,
62,
34960,
1330,
13341,
... | 2.302158 | 278 |
import os
from IPython.display import clear_output
try: import torch_xla
except Exception: setup_colab()
from .tpu_utility_1 import *
from .tpu_cache_ds_utils import *
from .other_utils import *
from ._lr_finder import * | [
198,
198,
11748,
28686,
198,
6738,
6101,
7535,
13,
13812,
1330,
1598,
62,
22915,
198,
198,
28311,
25,
1330,
28034,
62,
87,
5031,
198,
16341,
35528,
25,
9058,
62,
4033,
397,
3419,
198,
198,
6738,
764,
83,
19944,
62,
315,
879,
62,
16,... | 3.027027 | 74 |
from solvertools.wordlist import combine_wordlists, build_extras
def build_scrabblish_list():
"""
Build a list of words that have the "Scrabble nature", which is to say that
they'd be officially acceptable in a word game according to some tournament
rules.
This wordlist combines the wordlists who... | [
6738,
1540,
1851,
10141,
13,
4775,
4868,
1330,
12082,
62,
4775,
20713,
11,
1382,
62,
2302,
8847,
628,
198,
4299,
1382,
62,
1416,
81,
6485,
1836,
62,
4868,
33529,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
10934,
257,
1351,
286,
... | 2.801802 | 222 |
""" Handle installing the ghidra_bridge server scripts (and supporting jfx_bridge) to a specified directory """
import argparse
import os
import pkg_resources
JFX_BRIDGE = "jfx_bridge"
GHIDRA_BRIDGE = "ghidra_bridge"
SERVER_DIR = "server"
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="... | [
37811,
33141,
15975,
262,
24997,
312,
430,
62,
9458,
4382,
14750,
357,
392,
6493,
474,
21373,
62,
9458,
8,
284,
257,
7368,
8619,
37227,
198,
11748,
1822,
29572,
198,
11748,
28686,
198,
11748,
279,
10025,
62,
37540,
198,
198,
41,
17213,
... | 3.005556 | 180 |
# pylint: disable=redefined-builtin
import functools
import json
import logging
import traceback
from collections import deque
from typing import Any, Awaitable, Deque, Dict, List, Optional, Union
from fastapi import (
APIRouter,
BackgroundTasks,
Depends,
FastAPI,
HTTPException,
Query,
Req... | [
2,
279,
2645,
600,
25,
15560,
28,
445,
18156,
12,
18780,
259,
198,
198,
11748,
1257,
310,
10141,
198,
11748,
33918,
198,
11748,
18931,
198,
11748,
12854,
1891,
198,
6738,
17268,
1330,
390,
4188,
198,
6738,
19720,
1330,
4377,
11,
5851,
... | 2.603536 | 4,921 |
from rest_framework import serializers
from .models import Quiz, QuizQuestion, Post, Tag, Article, Media, Poll
from django.contrib.admin.options import get_content_type_for_model
import random
class PostContentRelatedField(serializers.RelatedField):
"""
A custom field to use for the `content_object` gen... | [
6738,
1334,
62,
30604,
1330,
11389,
11341,
198,
6738,
764,
27530,
1330,
2264,
528,
11,
2264,
528,
24361,
11,
2947,
11,
17467,
11,
10172,
11,
6343,
11,
12868,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
28482,
13,
25811,
1330,
651,
62,... | 2.827506 | 429 |
from .SimpleSpectrum import SimpleSpectrum
from .SimpleSpectralLines import SimpleSpectralLines
from .SimpleSpectrumViewer import SimpleSpectrumViewer | [
6738,
764,
26437,
49738,
6582,
1330,
17427,
49738,
6582,
198,
6738,
764,
26437,
49738,
1373,
43,
1127,
1330,
17427,
49738,
1373,
43,
1127,
198,
6738,
764,
26437,
49738,
6582,
7680,
263,
1330,
17427,
49738,
6582,
7680,
263
] | 4.054054 | 37 |
from clumpy.similarity.jaccard import jaccard_similarity
from clumpy.similarity.cluster_graph import get_induced_partitions
from clumpy.similarity.cluster_graph import cluster_similarity
from clumpy.similarity.cluster_graph import to_similarity_matrix
from clumpy.similarity.clusterer_embedding import to_dissimilarity_m... | [
6738,
537,
32152,
13,
38610,
414,
13,
73,
4134,
446,
1330,
474,
4134,
446,
62,
38610,
414,
198,
6738,
537,
32152,
13,
38610,
414,
13,
565,
5819,
62,
34960,
1330,
651,
62,
17223,
62,
3911,
1756,
198,
6738,
537,
32152,
13,
38610,
414,... | 3.355932 | 118 |
# -*- coding: utf-8 -*-
import unittest
from parameterized import parameterized
import scrapy
import six
from scrapy_rss import FeedItem, RssItem, RssedItem
from tests.utils import RssTestCase
if __name__ == '__main__':
unittest.main()
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
555,
715,
395,
198,
6738,
11507,
1143,
1330,
11507,
1143,
198,
11748,
15881,
88,
198,
11748,
2237,
198,
6738,
15881,
88,
62,
42216,
1330,
18272,
7449,
11,
37... | 2.870588 | 85 |
import numpy as np
import pandas as pd
import scipy.optimize as sco
########################################################################################################
# Efficient Frontier
########################################################################################################
###########... | [
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
629,
541,
88,
13,
40085,
1096,
355,
629,
78,
628,
628,
628,
198,
29113,
29113,
29113,
7804,
198,
2,
412,
5632,
23281,
198,
29113,
29113,
29113,
7804,
628... | 9.339286 | 56 |
from collections import defaultdict
from itertools import groupby
import six
import sqlalchemy as sa
from sqlalchemy.exc import NoInspectionAvailable
from sqlalchemy.orm import object_session
from sqlalchemy.schema import MetaData, Table, ForeignKeyConstraint
from .orm import get_mapper, get_tables
from ..query_chain... | [
6738,
17268,
1330,
4277,
11600,
198,
6738,
340,
861,
10141,
1330,
1448,
1525,
198,
198,
11748,
2237,
198,
11748,
44161,
282,
26599,
355,
473,
198,
6738,
44161,
282,
26599,
13,
41194,
1330,
1400,
818,
31308,
10493,
198,
6738,
44161,
282,
... | 2.387331 | 3,994 |
#!/usr/bin/env python3
"""
Convert markers between types.
"""
from PostShowV2 import MCS, EpisodeMetadata
import argparse
import sys
if __name__ == "__main__":
main(sys.argv)
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
37811,
198,
3103,
1851,
19736,
1022,
3858,
13,
198,
37811,
198,
198,
6738,
2947,
15307,
53,
17,
1330,
337,
7902,
11,
7922,
9171,
14706,
198,
11748,
1822,
29572,
198,
11748,
25064,
... | 2.787879 | 66 |
import pandas
import numpy as np
import random
from .recommender_system_base import RecommenderSystemBase
class ItemItemRecommenderSystem(RecommenderSystemBase):
"""
Attributes
----------
Methods
-------
compute_movie_embeddings
Computes the movie embeddings.
recommend_similar_... | [
11748,
19798,
292,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
4738,
198,
198,
6738,
764,
47335,
2194,
62,
10057,
62,
8692,
1330,
19237,
2194,
11964,
14881,
628,
198,
198,
4871,
9097,
7449,
24898,
2194,
11964,
7,
24898,
2194,
11964,
... | 2.030568 | 5,954 |
#from flask import Flask
#from flask import jsonify
from requests_oauthlib import OAuth2Session
from flask import Flask, request, redirect, session, url_for
from flask.json import jsonify
import json
import os
app = Flask(__name__)
# This information is obtained upon registration of a new GitHub OAuth
# application... | [
2,
6738,
42903,
1330,
46947,
198,
2,
6738,
42903,
1330,
33918,
1958,
198,
198,
6738,
7007,
62,
12162,
1071,
8019,
1330,
440,
30515,
17,
36044,
198,
6738,
42903,
1330,
46947,
11,
2581,
11,
18941,
11,
6246,
11,
19016,
62,
1640,
198,
673... | 2.647022 | 1,595 |
# fixture and parameter have the same name
# pylint: disable=redefined-outer-name
import pytest
# WARNING: contract tests should use fully qualified imports to avoid issues
# when being loaded by pytest
from rpdk.core.contract.interface import Action, OperationStatus
from rpdk.core.contract.suite.resource.contract_as... | [
2,
29220,
290,
11507,
423,
262,
976,
1438,
198,
2,
279,
2645,
600,
25,
15560,
28,
445,
18156,
12,
39605,
12,
3672,
198,
198,
11748,
12972,
9288,
198,
198,
2,
39410,
25,
2775,
5254,
815,
779,
3938,
10617,
17944,
284,
3368,
2428,
198,... | 2.846774 | 248 |
#!/usr/bin/env python3
'''
Move a motor back and forth using velocity and position mode of the TMC5161
Created on 30.01.2020
@author: JM
'''
import time
import PyTrinamic
from PyTrinamic.connections.ConnectionManager import ConnectionManager
from PyTrinamic.evalboards.TMC5161_eval import TMC5161_eval
connectionMana... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
7061,
6,
198,
21774,
257,
5584,
736,
290,
6071,
1262,
15432,
290,
2292,
4235,
286,
262,
309,
9655,
20,
25948,
198,
198,
41972,
319,
1542,
13,
486,
13,
42334,
198,
198,
31,
9800,
... | 2.566474 | 519 |
# Run generate_offline to get json file for pageranks
import networkx as nx
import json
import random
import numpy as np
from app.scripts.utils import Mongo
from os import listdir
from networkx.readwrite import json_graph
| [
2,
5660,
7716,
62,
2364,
1370,
284,
651,
33918,
2393,
329,
279,
3536,
2283,
198,
198,
11748,
3127,
87,
355,
299,
87,
198,
11748,
33918,
198,
11748,
4738,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
598,
13,
46521,
13,
26791,
1330,
... | 3.603175 | 63 |
import rls
import numpy as np
import tensorflow as tf
import tensorflow_probability as tfp
from algos.tf2algos.base.off_policy import make_off_policy_class
from utils.expl_expt import ExplorationExploitationClass
from rls.modules import DoubleQ
class MAXSQN(make_off_policy_class(mode='share')):
'''
https://gi... | [
11748,
374,
7278,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
11748,
11192,
273,
11125,
62,
1676,
65,
1799,
355,
256,
46428,
198,
6738,
435,
70,
418,
13,
27110,
17,
14016,
418,
13,
8692,
13,
236... | 2.640884 | 181 |
"""
HealthCheck Resources Module Mock for Flambda APP
Version: 1.0.0
"""
from unittest.mock import Mock
from flambda_app.services.v1.healthcheck import HealthCheckResult
from flambda_app.services.v1.healthcheck.resources import SelfConnectionHealthCheck, MysqlConnectionHealthCheck, \
RedisConnectionHealthCheck, SQ... | [
37811,
198,
18081,
9787,
13864,
19937,
44123,
329,
1610,
4131,
6814,
43504,
198,
14815,
25,
352,
13,
15,
13,
15,
198,
37811,
198,
6738,
555,
715,
395,
13,
76,
735,
1330,
44123,
198,
198,
6738,
781,
4131,
6814,
62,
1324,
13,
30416,
1... | 3.432749 | 342 |
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | [
2,
198,
2,
49962,
284,
262,
24843,
10442,
5693,
357,
1921,
37,
8,
739,
530,
198,
2,
393,
517,
18920,
5964,
11704,
13,
220,
4091,
262,
28536,
2393,
198,
2,
9387,
351,
428,
670,
329,
3224,
1321,
198,
2,
5115,
6634,
9238,
13,
220,
... | 3.474249 | 466 |
import numpy as np
import gegenbauer
import compute_NTK_spectrum
import matplotlib.pyplot as plt
import approx_learning_curves
import csv
import numba
from numba import jit
from numba import prange
import time
import pandas as pd
import argparse
@jit(nopython=True, parallel=True)
@jit(nopython = True)
#@jit(nopython... | [
11748,
299,
32152,
355,
45941,
198,
11748,
308,
1533,
268,
65,
16261,
198,
11748,
24061,
62,
11251,
42,
62,
4443,
6582,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
5561,
62,
40684,
62,
22019,
1158,
198,
1... | 2.170704 | 1,734 |
# -*- coding: utf-8 -*-
# Copyright (c) 2015, Hanstel Projects and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
15069,
357,
66,
8,
1853,
11,
9530,
301,
417,
29898,
290,
20420,
198,
2,
1114,
5964,
1321,
11,
3387,
766,
5964,
13,
14116,
198,
198,
6738,
11593,
37443,
834,
1330,
... | 3.507692 | 65 |
from contextlib import contextmanager
from pytest_mock import MockFixture
@contextmanager
| [
6738,
4732,
8019,
1330,
4732,
37153,
198,
198,
6738,
12972,
9288,
62,
76,
735,
1330,
44123,
37,
9602,
628,
198,
198,
31,
22866,
37153,
198
] | 3.76 | 25 |
from rasa.core.channels.channel import InputChannel,UserMessage,RestInput,CollectingOutputChannel
from sanic import Sanic, Blueprint, response
import asyncio
import inspect
import json
import logging
import uuid
from asyncio import Queue, CancelledError
from sanic import Sanic, Blueprint, response
from sanic.request im... | [
6738,
374,
15462,
13,
7295,
13,
354,
8961,
13,
17620,
1330,
23412,
29239,
11,
12982,
12837,
11,
19452,
20560,
11,
31337,
278,
26410,
29239,
198,
6738,
5336,
291,
1330,
2986,
291,
11,
39932,
11,
2882,
198,
11748,
30351,
952,
198,
11748,
... | 3.520619 | 194 |
import os
from tqdm import tqdm
def main(path,extension,alias):
""" Function to rename multiple files """
i = 0
image=[j for j in os.listdir(path) if j.endswith(extension)]
for filename in tqdm(image):
my_dest =alias + str(i) + extension
my_source =path + filename
my_dest =path ... | [
11748,
28686,
201,
198,
6738,
256,
80,
36020,
1330,
256,
80,
36020,
201,
198,
201,
198,
4299,
1388,
7,
6978,
11,
2302,
3004,
11,
26011,
2599,
201,
198,
220,
220,
37227,
15553,
284,
36265,
3294,
3696,
37227,
201,
198,
220,
220,
1312,
... | 2.306569 | 274 |
from __future__ import absolute_import
import logging
from django.db import transaction
from sentry.snuba.models import (
QueryAggregations,
QuerySubscription,
QuerySubscriptionEnvironment,
SnubaQuery,
)
from sentry.snuba.tasks import (
create_subscription_in_snuba,
delete_subscription_from_s... | [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
198,
11748,
18931,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
8611,
198,
198,
6738,
1908,
563,
13,
16184,
22013,
13,
27530,
1330,
357,
198,
220,
220,
220,
43301,
46384,
2301,
602,
... | 2.995191 | 2,703 |
#!/usr/bin/env python
import rospy
from std_msgs.msg import Int32
from std_msgs.msg import String
rospy.init_node('seconds')
pub = rospy.Publisher('seconds', Int32, queue_size=10)
rate = rospy.Rate(1) # 1hz
s_count =0
while not rospy.is_shutdown():
s_count += 1
pub.publish(s_count)
if s_count == 60:
s_count =0
r... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
686,
2777,
88,
198,
6738,
14367,
62,
907,
14542,
13,
19662,
1330,
2558,
2624,
198,
6738,
14367,
62,
907,
14542,
13,
19662,
1330,
10903,
198,
305,
2777,
88,
13,
15003,
62,
... | 2.361702 | 141 |
s=input()
print(s[:2],s[2:4],s[4:6])
| [
82,
28,
15414,
3419,
198,
4798,
7,
82,
58,
25,
17,
4357,
82,
58,
17,
25,
19,
4357,
82,
58,
19,
25,
21,
12962,
198
] | 1.48 | 25 |
"""
This module contains tests for generic_api package.
"""
import unittest
from concurrent.futures import Future
from concurrent.futures import ThreadPoolExecutor
from . import GenericAPI, AsyncAPI, APIMethod, APIError, GenericAPICreator
class GenericAPICreatorTest(unittest.TestCase):
"""
Test API metaclas... | [
37811,
198,
1212,
8265,
4909,
5254,
329,
14276,
62,
15042,
5301,
13,
198,
37811,
198,
11748,
555,
715,
395,
198,
198,
6738,
24580,
13,
69,
315,
942,
1330,
10898,
198,
6738,
24580,
13,
69,
315,
942,
1330,
14122,
27201,
23002,
38409,
19... | 2.266957 | 2,300 |
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn.parameter import Parameter
from torch.autograd import Variable
import numpy as np
import os
import pickle
from PIL import Image
class SpectralNorm(nn.Module):
"""Spectral normalization of weight with power iteration
"""
@sta... | [
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
198,
6738,
28034,
13,
20471,
13,
17143,
2357,
1330,
25139,
2357,
198,
6738,
28034,
13,
2306,
519,
6335,
1330,
35748,
198,
11748... | 2.481481 | 1,296 |
from tests_python.resource_path_translation import other
if __name__ == '__main__':
main()
| [
6738,
5254,
62,
29412,
13,
31092,
62,
6978,
62,
41519,
1330,
584,
628,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
1388,
3419,
198
] | 3.09375 | 32 |
#!/usr/bin/env python3
from collections import OrderedDict
from io import open
from itertools import chain
import os
import unicodedata
### MOVED
### MOVED
### NOT USED
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
6738,
17268,
1330,
14230,
1068,
35,
713,
198,
6738,
33245,
1330,
1280,
198,
6738,
340,
861,
10141,
1330,
6333,
198,
11748,
28686,
198,
11748,
28000,
9043,
1045,
198,
198,
21017,... | 3.145455 | 55 |
import time
import os
import sqlite3
import hashlib
| [
11748,
640,
201,
198,
11748,
28686,
201,
198,
11748,
44161,
578,
18,
201,
198,
11748,
12234,
8019,
201,
198,
201,
198,
197
] | 2.681818 | 22 |
import sys
import datetime
from stock.utils.symbol_util import get_stock_symbols, get_realtime_by_date
from stock.marketdata.storefactory import get_store
from config import store_type
import pandas as pd
date = None
if len(sys.argv) == 1:
date = datetime.date.today().strftime("%Y-%m-%d")
else:
date = sys.argv... | [
11748,
25064,
198,
11748,
4818,
8079,
198,
6738,
4283,
13,
26791,
13,
1837,
23650,
62,
22602,
1330,
651,
62,
13578,
62,
1837,
2022,
10220,
11,
651,
62,
5305,
2435,
62,
1525,
62,
4475,
198,
6738,
4283,
13,
10728,
7890,
13,
8095,
69,
... | 2.228446 | 1,589 |
# Generated by Django 3.1.12 on 2021-06-29 08:23
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
513,
13,
16,
13,
1065,
319,
33448,
12,
3312,
12,
1959,
8487,
25,
1954,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.875 | 32 |
n = 0
for i in range(1, n+1):
n += i
| [
77,
796,
657,
198,
1640,
1312,
287,
2837,
7,
16,
11,
299,
10,
16,
2599,
198,
220,
220,
220,
299,
15853,
1312,
198
] | 1.782609 | 23 |