content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
""" Implementation of `5.4 <http://shex.io/shex-semantics/#node-constraints>`_"""
import numbers
from typing import Union
from ShExJSG import ShExJ
from pyjsg.jsglib import isinstance_
from rdflib import URIRef, BNode, Literal, XSD, RDF
from jsonasobj import as_json
from pyshex.shape_expressions_language.p5_context ... | [
37811,
46333,
286,
4600,
20,
13,
19,
1279,
4023,
1378,
7091,
87,
13,
952,
14,
7091,
87,
12,
43616,
29320,
31113,
17440,
12,
1102,
2536,
6003,
29,
63,
62,
37811,
198,
198,
11748,
3146,
198,
6738,
19720,
1330,
4479,
198,
198,
6738,
91... | 2.214491 | 7,646 |
import numpy as np
from brew.base import Ensemble
from .base import DCS
class OLA2(DCS):
"""Overall Local Accuracy.
The Overall Local Accuracy selects the best classifier for
a sample using it's K nearest neighbors.
Attributes
----------
`Xval` : array-like, shape = [indeterminated, n_featu... | [
11748,
299,
32152,
355,
45941,
198,
198,
6738,
9059,
13,
8692,
1330,
2039,
15140,
198,
6738,
764,
8692,
1330,
6257,
50,
628,
198,
4871,
440,
13534,
17,
7,
49513,
2599,
198,
220,
220,
220,
37227,
16350,
10714,
33222,
13,
628,
220,
220,... | 2.614085 | 710 |
#!/usr/bin/python -tt
# -*- coding: utf-8 -*-
import argparse
ARATOLATINDICT = {u"ا":u"a",u"ە":u"e",u"ب":u"b",u"پ":u"p",u"ت":u"t",u"ج":u"j",u"چ":u"C",u"خ":u"x",u"د":u"d",u"ر":u"r",u"ز":u"z",u"ژ":u"Z",u"س":u"s",u"ش":u"S",u"غ":u"G",u"ف":u"f",u"ق":u"q",u"ك":u"k",u"گ":u"g",u"ڭ":u"N",u"ل":u"l",u"م":u"m",u"ن":u"n",u"ھ":u"h... | [
2,
48443,
14629,
14,
8800,
14,
29412,
532,
926,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
1822,
29572,
198,
198,
1503,
1404,
3535,
1404,
12115,
18379,
796,
1391,
84,
1,
12919,
1298,
84,
1,
64,... | 1.759834 | 483 |
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import scipy.stats
from finished_files.survey_data_dictionary import DATA_DICTIONARY
# Load data
# We want to take the names list from our data dictionary
names = [x.name for x in DATA_DICTIONARY]
# Generate the list of names to import
usecols =... | [
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
629,
541,
88,
13,
34242,
198,
198,
6738,
5201,
62,
16624,
13,
11793,
3304,
62,
7890,
62,
... | 2.617767 | 1,227 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@author: riselAir
#add license of some sort
problem march 2019: due to the abs(x-hm) on line 75 and the effect on post comma values, all end up being the same
No, the real problem is that Gauss() results in identical values. Why?
July 2019: add chisq test?
"""
import ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
31,
9800,
25,
6106,
417,
16170,
198,
2,
2860,
5964,
286,
617,
3297,
198,
45573,
9960,
13130,
25,
2233... | 2.641026 | 1,716 |
from ixnetwork_restpy.base import Base
from ixnetwork_restpy.files import Files
| [
6738,
220,
844,
27349,
62,
2118,
9078,
13,
8692,
1330,
7308,
198,
6738,
220,
844,
27349,
62,
2118,
9078,
13,
16624,
1330,
13283,
628
] | 3.375 | 24 |
################################################################################
# Copyright (c) 2021 ContinualAI. #
# Copyrights licensed under the MIT License. #
# See the accompanying LICENSE file for terms. ... | [
29113,
29113,
14468,
198,
2,
15069,
357,
66,
8,
33448,
6389,
723,
20185,
13,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2... | 1.819231 | 520 |
from pytpp.attributes._helper import IterableMeta, Attribute
from pytpp.attributes.application_base import ApplicationBaseAttributes
| [
6738,
12972,
83,
381,
13,
1078,
7657,
13557,
2978,
525,
1330,
40806,
540,
48526,
11,
3460,
4163,
198,
6738,
12972,
83,
381,
13,
1078,
7657,
13,
31438,
62,
8692,
1330,
15678,
14881,
29021,
628
] | 3.941176 | 34 |
"""
downward dependency example
"""
import batchOpenMPI
#defining function
# creating batch functions
f = batchOpenMPI.batchFunction(f_org)
g = batchOpenMPI.batchFunction(g_org)
h = batchOpenMPI.batchFunction(h_org)
batchOpenMPI.begin_MPI_loop()
# building processing que
bj = f.addtoBatch([2, g.addtoBatch(3) , h.... | [
37811,
198,
20841,
20203,
1672,
198,
37811,
198,
198,
11748,
15458,
11505,
7378,
40,
198,
198,
2,
4299,
3191,
2163,
198,
198,
2,
4441,
15458,
5499,
198,
69,
796,
15458,
11505,
7378,
40,
13,
43501,
22203,
7,
69,
62,
2398,
8,
198,
70,... | 2.426471 | 272 |
#!/usr/bin/env python
import os
import sys
import subprocess
from datetime import datetime
from datetime import timedelta
import time
import time
year=2014
month=5
for day in xrange(1,17):
start=datetime(year, month, day)
#end = datetime(2013, 12, 1)
end = start + timedelta(days=1)
idx = 0
while... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
28686,
198,
11748,
25064,
198,
11748,
850,
14681,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
6738,
4818,
8079,
1330,
28805,
12514,
198,
11748,
640,
198,
11748,
640,
198,
1... | 2.283988 | 331 |
"""
Unittests for Cartesian product GP with NN domains. Testing these separately since
we do not need to have nn dependencies in the gp module.
-- kandasamy@cs.cmu.edu
"""
# pylint: disable=invalid-name
# pylint: disable=no-member
import os
import numpy as np
import unittest
# Local
from ..gp.unittest_cartesian... | [
37811,
198,
220,
791,
715,
3558,
329,
13690,
35610,
1720,
14714,
351,
399,
45,
18209,
13,
23983,
777,
13869,
1201,
198,
220,
356,
466,
407,
761,
284,
423,
299,
77,
20086,
287,
262,
27809,
8265,
13,
198,
220,
1377,
479,
392,
292,
148... | 2.03481 | 2,528 |
import serial, time, platform, threading
import pyfirmata
from datetime import datetime
from Support.NexSerialSends import ResetNextion, SendPage, SendVal, SendVis, SendBright, SendPic, SendRef, SendFont, SendCrop
#from Support.NexSerialSends import PoPoShow
from Support.SupportUtils import printDebug
import multitimer... | [
11748,
11389,
11,
640,
11,
3859,
11,
4704,
278,
198,
11748,
12972,
69,
2533,
1045,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
6738,
7929,
13,
45,
1069,
32634,
50,
2412,
1330,
30027,
10019,
295,
11,
16290,
9876,
11,
16290,
7762,
11,... | 2.359659 | 6,331 |
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
import matplotlib
font = {"size": 30}
matplotlib.rc("font", **font)
matplotlib.rcParams["text.usetex"] = True
times_df_melted_numgenes = pd.read_csv("../out/time_performance_num_genes.csv", index_col=0)
times_df_melted_numgenes.model[times_df_... | [
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
384,
397,
1211,
355,
3013,
82,
198,
198,
11748,
2603,
29487,
8019,
198,
198,
10331,
796,
19779,
7857,
1298,
1542,
92,
198,
6759... | 2.352624 | 743 |
#!/usr/bin/env python3
import argparse
import csv
from logging import error, warning
import requests
import urllib3
import act
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
def parseargs():
""" Parse arguments """
parser = argparse.ArgumentParser(
description='Get Threat Acto... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
11748,
1822,
29572,
198,
11748,
269,
21370,
198,
6738,
18931,
1330,
4049,
11,
6509,
198,
198,
11748,
7007,
198,
11748,
2956,
297,
571,
18,
198,
198,
11748,
719,
198,
198,
333,... | 2.253235 | 541 |
# -*- coding:utf-8 -*-
"""Functions for converting between Julian dates and calendar dates.
A function for converting Gregorian calendar dates to Julian dates, and
another function for converting Julian calendar dates to Julian dates
are defined. Two functions for the reverse calculations are also
defined.
Different ... | [
2,
532,
9,
12,
19617,
25,
40477,
12,
23,
532,
9,
12,
198,
37811,
24629,
2733,
329,
23202,
1022,
18322,
9667,
290,
11845,
9667,
13,
198,
198,
32,
2163,
329,
23202,
8547,
22618,
11845,
9667,
284,
18322,
9667,
11,
290,
198,
29214,
2163... | 2.195169 | 6,789 |
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Eric Larson <larson.eric.d@gmail.com>
# Joan Massich <mailsik@gmail.com>
# Guillaume Favelier <guillaume.favelier@gmail.com>
#
# License: Simplified BSD
import pytest
from mne.viz.backends._utils import _get_colormap_from_array, _... | [
2,
46665,
25,
21000,
260,
20159,
3319,
1279,
1000,
87,
49078,
13,
4546,
3319,
31,
259,
7496,
13,
8310,
29,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7651,
42630,
1279,
75,
12613,
13,
35626,
13,
67,
31,
14816,
13,
785,
... | 2.255319 | 752 |
import multiprocessing as mp
from multiprocessing.queues import Queue
import warnings
class PicklableExceptionWrapper:
"""
Wraps an Exception object to make it picklable so that the traceback follows. Useful for multiprocessing when an exception is raised in a subprocess.
"""
class SafeQueue(Queue):
... | [
11748,
18540,
305,
919,
278,
355,
29034,
198,
6738,
18540,
305,
919,
278,
13,
4188,
947,
1330,
4670,
518,
198,
11748,
14601,
628,
198,
4871,
12346,
75,
540,
16922,
36918,
2848,
25,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
27323,... | 2.592516 | 481 |
# Copyright 2020 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... | [
2,
220,
220,
15069,
12131,
3012,
11419,
198,
198,
2,
220,
220,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
220,
220,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
... | 2.267519 | 2,269 |
p1 = person("malli",9)
print(p1.name)
print(p1) | [
79,
16,
796,
1048,
7203,
76,
36546,
1600,
24,
8,
198,
198,
4798,
7,
79,
16,
13,
3672,
8,
198,
4798,
7,
79,
16,
8
] | 1.92 | 25 |
#
# Copyright (c) nexB Inc. and others. All rights reserved.
# ScanCode is a trademark of nexB Inc.
# SPDX-License-Identifier: Apache-2.0
# See http://www.apache.org/licenses/LICENSE-2.0 for the license text.
# See https://github.com/nexB/scancode-toolkit for support or download.
# See https://aboutcode.org for more in... | [
2,
198,
2,
15069,
357,
66,
8,
497,
87,
33,
3457,
13,
290,
1854,
13,
1439,
2489,
10395,
13,
198,
2,
20937,
10669,
318,
257,
16028,
286,
497,
87,
33,
3457,
13,
198,
2,
30628,
55,
12,
34156,
12,
33234,
7483,
25,
24843,
12,
17,
13... | 2.48963 | 2,700 |
#!/usr/bin/python3
"""
Script: ftpdownloader.py
Author: Sascha Sambale
Date: June 21st, 2016
Purpose: This application received messages from an MQTT queue and will then download a given file
to a local directory.
"""
import sys
from configLoader import *
if __name__ == "__main__":
main()
| [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
37811,
198,
12327,
25,
220,
10117,
79,
15002,
263,
13,
9078,
198,
6434,
25,
23771,
11693,
3409,
65,
1000,
198,
7536,
25,
220,
220,
2795,
2310,
301,
11,
1584,
198,
32039,
25,
770,
3586,
... | 3.058824 | 102 |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
'''
@file:analyse_data.py
@author: Honour-Van: fhn037@126.com
@date:2021/04/27 15:48:18
@description:analyse the data we have gotten, with 3 tasks
@version:1.0
'''
import pandas as pd
import json
def is_prov(line: str) -> bool:
"""
# is_prov
@Description:
... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
21004,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
7061,
6,
198,
31,
7753,
25,
38200,
325,
62,
7890,
13,
9078,
198,
31,
9800,
25,
45129,
12,
25298,
25,
277,
21116,
15... | 1.898837 | 2,837 |
import functools
from hat.util import aio
import hat.event.common
import hat.event.server.common
| [
11748,
1257,
310,
10141,
198,
198,
6738,
6877,
13,
22602,
1330,
257,
952,
198,
11748,
6877,
13,
15596,
13,
11321,
198,
11748,
6877,
13,
15596,
13,
15388,
13,
11321,
628,
628,
628,
628,
628,
628,
198
] | 3.055556 | 36 |
andando_no_tempo()
| [
198,
198,
392,
25440,
62,
3919,
62,
11498,
7501,
3419,
198
] | 1.909091 | 11 |
import RPi.GPIO as GPIO
import time
import signal
import atexit
atexit.register(GPIO.cleanup)
servopin=18
GPIO.setmode(GPIO.BCM)
GPIO.setup(servopin,GPIO.OUT,initial=False)
p=GPIO.PWM(servopin,50)
p.start(0)
time.sleep(0.1)
while(True):
i = float(raw_input("degree?"))
p.ChangeDutyCycle(2.5 + 10 * i / 180)
time.s... | [
11748,
25812,
72,
13,
16960,
9399,
355,
50143,
198,
11748,
640,
198,
11748,
6737,
198,
11748,
379,
37023,
198,
198,
378,
10198,
13,
30238,
7,
16960,
9399,
13,
27773,
929,
8,
198,
198,
3168,
404,
259,
28,
1507,
198,
16960,
9399,
13,
... | 2.12 | 175 |
from singer_sdk import typing as th
schema = th.PropertiesList(
th.Property("id", th.IntegerType),
th.Property("name", th.StringType),
th.Property("acknowledgement", th.StringType),
th.Property("description", th.StringType),
th.Property("addedByProfile", th.IntegerType),
th.Property("displayAck... | [
6738,
14015,
62,
21282,
74,
1330,
19720,
355,
294,
198,
198,
15952,
2611,
796,
294,
13,
2964,
18200,
8053,
7,
198,
220,
220,
220,
294,
13,
21746,
7203,
312,
1600,
294,
13,
46541,
6030,
828,
198,
220,
220,
220,
294,
13,
21746,
7203,
... | 2.864583 | 192 |
from pyxb.bundles.opengis.raw.sos_1_0 import *
| [
6738,
12972,
30894,
13,
65,
917,
829,
13,
404,
1516,
271,
13,
1831,
13,
82,
418,
62,
16,
62,
15,
1330,
1635,
198
] | 2.043478 | 23 |
from pwn import *
sh = remote("node3.buuoj.cn", 27783)
payload = b'I' * 20 + b'a' * 4 + p32(0x8048f0d)
sh.sendline(payload)
sh.interactive()
| [
6738,
279,
675,
1330,
1635,
198,
198,
1477,
796,
6569,
7203,
17440,
18,
13,
11110,
84,
13210,
13,
31522,
1600,
2681,
50165,
8,
198,
198,
15577,
2220,
796,
275,
6,
40,
6,
1635,
1160,
1343,
275,
6,
64,
6,
1635,
604,
1343,
279,
2624,... | 2.057143 | 70 |
from django.urls import path, include
from apps.projects import views
app_name = "projects"
urlpatterns = [
path('', views.ProjectList.as_view(), name="project-list"),
path('create/', views.ProjectCreate.as_view(), name="project-create"),
# reporting urls
path('reporting/', include('apps.reporting.... | [
6738,
42625,
14208,
13,
6371,
82,
1330,
3108,
11,
2291,
198,
6738,
6725,
13,
42068,
1330,
5009,
628,
198,
1324,
62,
3672,
796,
366,
42068,
1,
628,
198,
6371,
33279,
82,
796,
685,
198,
220,
220,
220,
3108,
10786,
3256,
5009,
13,
1677... | 2.831094 | 521 |
#!/usr/bin/env python3
# -*- encoding: utf-8 -*-
if __name__ == '__main__':
x = Gizmo() | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
21004,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
2124,
796,
402,
528,
5908,
341... | 2.044444 | 45 |
import matplotlib.pyplot as plt
from mpl_format.axes.axis_utils import new_axes
from numpy import linspace
from probability.distributions import Dirichlet
x = linspace(0, 1, 101)
if __name__ == '__main__':
plot_distribution()
plot_pdf_simplex()
plot_pdf()
| [
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
6738,
285,
489,
62,
18982,
13,
897,
274,
13,
22704,
62,
26791,
1330,
649,
62,
897,
274,
198,
6738,
299,
32152,
1330,
300,
1040,
10223,
198,
198,
6738,
12867,
13,
17080,
2... | 2.628571 | 105 |
"""
Copyright 2021 Xilinx 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, software
di... | [
37811,
198,
15269,
33448,
1395,
346,
28413,
3457,
13,
198,
198,
26656,
15385,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
5832,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
19... | 3.030418 | 526 |
import json
import uuid
from django.db.models import Q
from django_filters.rest_framework import DjangoFilterBackend
from rest_framework import status
from rest_framework.decorators import api_view, permission_classes, action
from django.http import Http404
from rest_framework.exceptions import PermissionDenied, Valid... | [
11748,
33918,
198,
11748,
334,
27112,
198,
198,
6738,
42625,
14208,
13,
9945,
13,
27530,
1330,
1195,
198,
6738,
42625,
14208,
62,
10379,
1010,
13,
2118,
62,
30604,
1330,
37770,
22417,
7282,
437,
198,
6738,
1334,
62,
30604,
1330,
3722,
1... | 4.05 | 300 |
"""
Use Approximate Bayesian Computation (ABC) to parametrize the rate function
given a hypothetical experiment timeline.
"""
import csv
from timeit import default_timer as timer
import click
import numpy as np
from scipy.interpolate import PchipInterpolator as pchip
import toml
import simtools
# Synchronise... | [
37811,
198,
11041,
2034,
13907,
1920,
4696,
35610,
22476,
341,
357,
24694,
8,
284,
5772,
316,
380,
2736,
262,
2494,
2163,
198,
35569,
257,
25345,
6306,
15264,
13,
198,
37811,
628,
198,
11748,
269,
21370,
198,
6738,
640,
270,
1330,
4277,... | 3.13369 | 187 |
from .. import config
from ..storage import source_utils
from ..storage import cache_utils
from ..storage import caching
from ..storage import dataframe
from ..utils import captcha
from .selection.selector import BuiltinImportance
import glob
import os
import numpy as np
import inspect
# needs refactoring because... | [
6738,
11485,
1330,
4566,
198,
6738,
11485,
35350,
1330,
2723,
62,
26791,
198,
6738,
11485,
35350,
1330,
12940,
62,
26791,
198,
6738,
11485,
35350,
1330,
40918,
198,
6738,
11485,
35350,
1330,
1366,
14535,
198,
6738,
11485,
26791,
1330,
48972... | 4.045872 | 109 |
#!/usr/bin/env python
if __name__ == '__main__':
main()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
1388,
3419,
628
] | 2.296296 | 27 |
("""
076) Crie um programa que tenha uma tupla única com nomes de produtos e
seus respectivos preços, na sequência. No final, mostre uma listagem de
preços organizando os dados em forma tabular.
""")
listaDeProdutos = ('Ovo (Bandeja com 30)', 6.2, 'Maçã (Kg)', 8.5,
'Detergente de Pratos', 0.99, 'Sab... | [
7203,
15931,
198,
2998,
21,
8,
327,
5034,
23781,
1430,
64,
8358,
3478,
3099,
334,
2611,
12777,
489,
64,
6184,
118,
77,
3970,
401,
299,
2586,
390,
40426,
315,
418,
304,
198,
325,
385,
2461,
452,
418,
662,
16175,
418,
11,
12385,
4726,... | 2.029867 | 904 |
# Copyright (C) 2016-present the asyncpg authors and contributors
# <see AUTHORS file>
#
# This module is part of asyncpg and is released under
# the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0
import asyncio
import asyncpg
from asyncpg import _testbase as tb
from asyncpg import exceptions
| [
2,
15069,
357,
34,
8,
1584,
12,
25579,
262,
30351,
6024,
7035,
290,
20420,
198,
2,
1279,
3826,
37195,
20673,
2393,
29,
198,
2,
198,
2,
770,
8265,
318,
636,
286,
30351,
6024,
290,
318,
2716,
739,
198,
2,
262,
24843,
362,
13,
15,
... | 3.387097 | 93 |
from typing import List, Tuple
from solver.solver import BOARDSIZE, checkboard, createpuzzle, createrandomsolution, hassinglesolution, issafe, solve, solverecursive
import pytest
# 0 1 2 3 4 5 6 7 8
# *--+--+--*--+--+--*--+--+--*
# 0 | 0| 1| 2| 3| 4| 5| 6| 7| 8|
# +--+--+--+--+--+--+--+--+--+
# 1 | 9|1... | [
6738,
19720,
1330,
7343,
11,
309,
29291,
198,
6738,
1540,
332,
13,
82,
14375,
1330,
16494,
48294,
35400,
11,
2198,
3526,
11,
2251,
79,
9625,
11,
1827,
263,
392,
3150,
2122,
11,
468,
12215,
829,
2122,
11,
1189,
8635,
11,
8494,
11,
15... | 1.563649 | 1,414 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2009-2018 the sqlparse authors and contributors
# <see AUTHORS file>
#
# This example is part of python-sqlparse and is released under
# the BSD License: https://opensource.org/licenses/BSD-3-Clause
#
# This example illustrates how to extract table names f... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
198,
2,
15069,
357,
34,
8,
3717,
12,
7908,
262,
44161,
29572,
7035,
290,
20420,
198,
2,
1279,
3826,
37195,
20673,
... | 2.720257 | 311 |
from rust_library import multiply
print('Message from Python.')
product = multiply(3, 4.5)
print(f'Product in Python is {product}.')
| [
6738,
17000,
62,
32016,
1330,
29162,
198,
198,
4798,
10786,
12837,
422,
11361,
2637,
8,
198,
11167,
796,
29162,
7,
18,
11,
604,
13,
20,
8,
198,
4798,
7,
69,
6,
15667,
287,
11361,
318,
1391,
11167,
92,
2637,
8,
198
] | 3.268293 | 41 |
#!/usr/bin/env python3
import math
import torch
# NOTE adapted from pytorch PR #1249 issuecomment 339904369 and CoinCheung/pytorch-loss
# NOTE like ce, expects unnormalized scores
# NOTE catch all the boring cases instead of blowing up
if __name__ == '__main__':
pass
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
11748,
10688,
198,
198,
11748,
28034,
628,
198,
2,
24550,
16573,
422,
12972,
13165,
354,
4810,
1303,
1065,
2920,
2071,
23893,
4747,
2079,
3023,
30803,
290,
16312,
7376,
2150,
14,
907... | 3.119565 | 92 |
from allennlp_reasoning_explainqa.training.metrics.confusion_matrix import *
from allennlp_reasoning_explainqa.training.metrics.explanation_eval import *
| [
6738,
477,
1697,
34431,
62,
41181,
278,
62,
20676,
391,
20402,
13,
34409,
13,
4164,
10466,
13,
10414,
4241,
62,
6759,
8609,
1330,
1635,
198,
6738,
477,
1697,
34431,
62,
41181,
278,
62,
20676,
391,
20402,
13,
34409,
13,
4164,
10466,
13... | 3.08 | 50 |
#!/usr/bin/python
# -*- encoding:utf-8 -*-
import urllib2
import re
if __name__ == '__main__':
working_url = 'http://tieba.baidu.com/p/3824525683'
baidu_tieba = BaiduTieba(working_url)
page_source = baidu_tieba.get_page_source(1)
baidu_tieba.get_page_title(page_source)
baidu_tieba.get_page_num(pag... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
532,
9,
12,
21004,
25,
40477,
12,
23,
532,
9,
12,
198,
11748,
2956,
297,
571,
17,
198,
11748,
302,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
... | 2.119318 | 176 |
import genutil
def compute(dm, do):
"""Computes rms"""
if dm is None and do is None: # just want the doc
return {
"Name": "Spatio-Temporal Root Mean Square",
"Abstract": "Compute Spatial and Temporal Root Mean Square",
"URI": "http://uvcdat.llnl.gov/documentation/"... | [
11748,
2429,
22602,
628,
198,
4299,
24061,
7,
36020,
11,
466,
2599,
198,
220,
220,
220,
37227,
7293,
1769,
374,
907,
37811,
198,
220,
220,
220,
611,
288,
76,
318,
6045,
290,
466,
318,
6045,
25,
220,
1303,
655,
765,
262,
2205,
198,
... | 2.234513 | 226 |
import pytest
from users.models import User
from users.tests import persist_user # noqa: F401
from events.forms import EventCreationForm
from events.models import Event, Colors, EventParticipant
# form preferences -> new event preferences
TITLE = 'new_form'
LOCATION = 'new_form_location'
DESCRIPTION = 'new_form_desc... | [
11748,
12972,
9288,
198,
6738,
2985,
13,
27530,
1330,
11787,
198,
6738,
2985,
13,
41989,
1330,
21160,
62,
7220,
220,
1303,
645,
20402,
25,
376,
21844,
198,
6738,
2995,
13,
23914,
1330,
8558,
12443,
341,
8479,
198,
6738,
2995,
13,
27530,... | 3.019481 | 154 |
#!/usr/bin/env python3
# -*-coding:utf-8-*-
import os
import sys
import threading
import argparse
import re
import time
class MultiMinicom():
""" open multiple minicom for ESP32 """
RE_MAC = r"MAC: (([A-Fa-f0-9]{2}:){5}[A-Fa-f0-9]{2})"
if __name__ == '__main__':
if sys.version_info < (3,6):
pri... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
66,
7656,
25,
40477,
12,
23,
12,
9,
12,
198,
11748,
28686,
198,
11748,
25064,
198,
11748,
4704,
278,
198,
11748,
1822,
29572,
198,
11748,
302,
198,
11748,
640,
6... | 2.185366 | 205 |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
Layer norm done in fp32 (for fp16 training)
"""
import torch.nn as nn
import torch.nn.functional as F
| [
2,
15069,
357,
66,
8,
3203,
11,
3457,
13,
290,
663,
29116,
13,
198,
2,
198,
2,
770,
2723,
2438,
318,
11971,
739,
262,
17168,
5964,
1043,
287,
262,
198,
2,
38559,
24290,
2393,
287,
262,
6808,
8619,
286,
428,
2723,
5509,
13,
198,
... | 3.518519 | 81 |
from flask import render_template,redirect,url_for,request,flash
from . import authentication
from ..models import User
from .forms import SignUpForm,LoginForm
from flask_login import login_user,logout_user,login_required
from .. import db
from .. import main
@authentication.route('/login',methods=['GET','POST'])
@au... | [
6738,
42903,
1330,
8543,
62,
28243,
11,
445,
1060,
11,
6371,
62,
1640,
11,
25927,
11,
34167,
198,
6738,
764,
1330,
18239,
198,
6738,
11485,
27530,
1330,
11787,
198,
6738,
764,
23914,
1330,
5865,
4933,
8479,
11,
47790,
8479,
198,
6738,
... | 3.427419 | 124 |
import os
import cv2
import datetime
import numpy as np
import pandas as pd
from PIL import Image
import streamlit as st
from tensorflow import keras
from streamlit import caching
from keras.models import load_model
from keras.preprocessing import image
from keras.preprocessing.image import img_to_array
#//----------... | [
11748,
28686,
198,
11748,
269,
85,
17,
198,
11748,
4818,
8079,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,
6738,
350,
4146,
1330,
7412,
198,
11748,
4269,
18250,
355,
336,
198,
6738,
11192,
273,
11125,
... | 2.378811 | 2,001 |
from Evaluators.IEvaluator import IEvaluator
from imutils import paths
import os
import shutil
if __name__ == "__main__":
main()
| [
6738,
26439,
84,
2024,
13,
10008,
2100,
84,
1352,
1330,
28157,
2100,
84,
1352,
198,
6738,
545,
26791,
1330,
13532,
198,
11748,
28686,
198,
11748,
4423,
346,
628,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
... | 2.934783 | 46 |
from flask import current_app, request, jsonify
from app.book import bp
from app.book import services as book_service
from app.book.models import Book
from app.error.handlers import bad_request
from app.search.models import SearchPage
@bp.before_request
@bp.route('/load', methods=['POST'])
@bp.route('/search', me... | [
6738,
42903,
1330,
1459,
62,
1324,
11,
2581,
11,
33918,
1958,
198,
6738,
598,
13,
2070,
1330,
275,
79,
198,
6738,
598,
13,
2070,
1330,
2594,
355,
1492,
62,
15271,
198,
6738,
598,
13,
2070,
13,
27530,
1330,
4897,
198,
6738,
598,
13,
... | 3.184874 | 119 |
# --*-- coding:utf-8 --*--
# 部分数据写入图数据库
import time
import datetime
from py2neo import Graph
from py2neo.ogm import GraphObject, Property, RelatedTo
from pymongo import MongoClient
# graph = Graph("http://localhost:7474", password="942&op!UKVg2GQfL")
# graph.delete_all()
mongo = Mongo()
s_time = time.time()
sou... | [
2,
1377,
9,
438,
19617,
25,
40477,
12,
23,
1377,
9,
438,
198,
198,
2,
16268,
225,
101,
26344,
228,
46763,
108,
162,
235,
106,
37863,
247,
17739,
98,
32368,
122,
46763,
108,
162,
235,
106,
41753,
241,
198,
198,
11748,
640,
198,
117... | 2.033557 | 894 |
from app import app
@app.route('/')
@app.route('/index')
@app.route('/home')
| [
6738,
598,
1330,
598,
198,
198,
31,
1324,
13,
38629,
10786,
14,
11537,
198,
31,
1324,
13,
38629,
10786,
14,
9630,
11537,
198,
198,
31,
1324,
13,
38629,
10786,
14,
11195,
11537,
628
] | 2.424242 | 33 |
import tests.scenarios as scenarios
from tests.api_test_case import APITestCase
from entities import Match, Player
import events
| [
11748,
5254,
13,
1416,
268,
13010,
355,
13858,
198,
6738,
5254,
13,
15042,
62,
9288,
62,
7442,
1330,
3486,
2043,
395,
20448,
198,
6738,
12066,
1330,
13225,
11,
7853,
198,
11748,
2995,
628,
628,
198
] | 3.8 | 35 |
import unittest
from app.models import News
class NewsTest(unittest.TestCase):
'''
Test Class to test the behaviour of the News class
'''
def setUp(self):
'''
Set up method that will run before every Test
'''
self.new_source = News('bbc-news','Top News','All... | [
11748,
555,
715,
395,
201,
198,
6738,
598,
13,
27530,
1330,
3000,
201,
198,
201,
198,
4871,
3000,
14402,
7,
403,
715,
395,
13,
14402,
20448,
2599,
201,
198,
220,
220,
220,
705,
7061,
201,
198,
220,
220,
220,
6208,
5016,
284,
1332,
... | 2.372263 | 411 |
from django.db import models
from django.contrib.auth.models import User
# Create your models here.
| [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
27530,
1330,
11787,
198,
2,
13610,
534,
4981,
994,
13,
628,
628,
198
] | 3.466667 | 30 |
#!/usr/bin/env python3
from datetime import datetime
import requests
import zipfile
from urldwnld import *
#Download file
t_day = datetime.today().strftime('%d%b%Y')
year = datetime.today().strftime('%Y/')
month = datetime.today().strftime('%b/')
fdate = t_day.upper()
fyear = year.upper()
fmonth = month.upper()
urlin ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
11748,
7007,
198,
11748,
19974,
7753,
198,
6738,
2956,
335,
675,
335,
1330,
1635,
198,
198,
2,
10002,
2393,
198,
83,
62,
820,
796,
4818,
... | 2.594286 | 175 |
from random import randint
| [
6738,
4738,
1330,
43720,
600,
628
] | 4.666667 | 6 |
#!/usr/bin/env python
"""Gather information from the registry on windows."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from grr_response_core.lib import artifact_utils
from grr_response_core.lib.rdfvalues import file_finder as rdf_file_finder
from gr... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
37811,
38,
1032,
1321,
422,
262,
20478,
319,
9168,
526,
15931,
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
6738,
11593,
37443,
834,
1330,
7297,
198,
6738,
11593,
37443,
834... | 2.623739 | 1,685 |
from django.db import models
from django.urls import reverse
from django.utils import timezone
from accounts.models import User
JOB_TYPE = (
('1', "Plumbing"),
('2', "Carpentry"),
('3', "Masonary"),
('4',"Electrical Repair"),
('5', "Other")
)
| [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
42625,
14208,
13,
6371,
82,
1330,
9575,
198,
6738,
42625,
14208,
13,
26791,
1330,
640,
11340,
198,
198,
6738,
5504,
13,
27530,
1330,
11787,
198,
198,
41,
9864,
62,
25216,
796,
357,
... | 2.643564 | 101 |
#!/usr/bin/env python
# Author: Felix Wiemann
# Contact: Felix_Wiemann@ososo.de
# Revision: $Revision: 3915 $
# Date: $Date: 2005-10-02 03:06:42 +0200 (Sun, 02 Oct 2005) $
# Copyright: This module has been placed in the public domain.
"""
Test for pseudo-XML writer.
"""
from __init__ import DocutilsTestSupport
tote... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
2,
6434,
25,
29721,
11759,
368,
1236,
198,
2,
14039,
25,
29721,
62,
54,
26597,
1236,
31,
418,
28213,
13,
2934,
198,
2,
46604,
25,
720,
18009,
1166,
25,
5014,
1314,
720,
198,
2... | 2.470238 | 336 |
import os
import re
PATTERN = ('.jpg', '.jpeg')
| [
11748,
28686,
198,
11748,
302,
628,
198,
47,
1404,
31800,
796,
357,
4458,
9479,
3256,
45302,
73,
22071,
11537,
198
] | 2.5 | 20 |
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | [
2,
15069,
1853,
3012,
3457,
13,
1439,
6923,
33876,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
... | 2.668381 | 8,751 |
import numpy as np
import matplotlib.pyplot as plt
from plotstuff import colours
cols = colours()
plotpar = {'axes.labelsize': 16,
'xtick.labelsize': 16,
'ytick.labelsize': 16,
'text.usetex': True}
plt.rcParams.update(plotpar)
def make_plot(data, b):
"""
Scatter plots of reco... | [
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
6738,
7110,
41094,
1330,
18915,
198,
4033,
82,
796,
18915,
3419,
198,
198,
29487,
1845,
796,
1391,
6,
897,
274,
13,
23912,
1424,
1096,
1... | 2.042541 | 3,432 |
import sys
from external import align_warp, reslice, softmean, slicer
from convert import pgmtoppm, pnmtojpeg
main()
| [
11748,
25064,
198,
6738,
7097,
1330,
10548,
62,
86,
5117,
11,
581,
75,
501,
11,
2705,
32604,
11,
14369,
263,
198,
6738,
10385,
1330,
23241,
76,
1462,
381,
76,
11,
279,
21533,
1462,
73,
22071,
198,
198,
12417,
3419,
198
] | 2.95 | 40 |
# DRUNKWATER TEMPLATE(add description and prototypes)
# Question Title and Description on leetcode.com
# Function Declaration and Function Prototypes on leetcode.com
#129. Sum Root to Leaf Numbers
#Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a number.
#An example is the r... | [
2,
10560,
4944,
42,
54,
23261,
309,
3620,
6489,
6158,
7,
2860,
6764,
290,
32338,
8,
198,
2,
18233,
11851,
290,
12489,
319,
443,
316,
8189,
13,
785,
198,
2,
15553,
24720,
290,
15553,
5038,
13567,
319,
443,
316,
8189,
13,
785,
198,
... | 2.607495 | 507 |
import cmd, sys, traceback, os, shlex
from .http import login, tasks, submissions, submission_protocol, submit_solution, status, scores, compile_error, submission_source, compiler_list, submission_stats, has_feature, contest_list
from .error import BruteError
import brutejudge.commands
| [
11748,
23991,
11,
25064,
11,
12854,
1891,
11,
28686,
11,
427,
2588,
198,
6738,
764,
4023,
1330,
17594,
11,
8861,
11,
22129,
11,
14498,
62,
11235,
4668,
11,
9199,
62,
82,
2122,
11,
3722,
11,
8198,
11,
17632,
62,
18224,
11,
14498,
62,... | 3.727273 | 77 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from optionaldict import optionaldict
from wechatpy.client.api.base import BaseWeChatAPI
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
11,
28000,
1098,
62,
17201,
874,
198,
6738,
3038,
1940,
713,
1330,
3038,
1940,
713,
198,
198,
6738,
356,
17006,
9078,
13,... | 3.127273 | 55 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import os
import sys
import numpy as np
import tensorflow as tf
from . import label_image
from . import retrain
toppath = os.path.dirname(os.path.dirname(__file__))
model_file = os.path.join(... | [
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,
11748,
1822,
29572,
198,
11748,
28686,
198,
11748,
25064,
198,
198,
11748,
299,
32152,... | 2.988764 | 178 |
"""Acer Air Monitor API Client."""
from abc import ABC
import logging
import aiohttp
from aiohttp.formdata import FormData
import async_timeout
from .const import BASE_URL
TIMEOUT = 10
_LOGGER: logging.Logger = logging.getLogger(__package__)
HEADERS = {"Content-type": "application/json; charset=UTF-8"}
| [
37811,
32,
2189,
3701,
18289,
7824,
20985,
526,
15931,
198,
6738,
450,
66,
1330,
9738,
198,
11748,
18931,
198,
198,
11748,
257,
952,
4023,
198,
6738,
257,
952,
4023,
13,
687,
7890,
1330,
5178,
6601,
198,
11748,
30351,
62,
48678,
198,
... | 3.09901 | 101 |
# Dodge The Flame
import random
import arcade
SCREEN_WIDTH = 1200
SCREEN_HEIGHT = 800
SCREEN_TITLE = "Dodge the Flame"
SCALE = 0.5
SUPER_SCALE = 0.2
TINY_SCALE = 0.7
class Game(arcade.Window):
"""Game"""
def __init__(self):
"""Init"""
super().__init__(SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_TI... | [
2,
26048,
383,
11981,
198,
198,
11748,
4738,
198,
11748,
27210,
198,
6173,
2200,
1677,
62,
54,
2389,
4221,
796,
24938,
198,
6173,
2200,
1677,
62,
13909,
9947,
796,
10460,
198,
6173,
2200,
1677,
62,
49560,
2538,
796,
366,
35,
9728,
262... | 2.055038 | 1,181 |
# -*- coding: utf-8 -*-
"""
Functions for mapping AHBA microarray dataset to atlases and and parcellations
"""
from functools import reduce
import numpy as np
import pandas as pd
from . import correct, datasets, io, probes, samples, utils
import logging
logging.basicConfig(format='%(levelname)s: %(message)s', level... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
24629,
2733,
329,
16855,
28159,
4339,
4580,
18747,
27039,
284,
379,
75,
1386,
290,
290,
1582,
3846,
602,
198,
37811,
198,
198,
6738,
1257,
310,
10141,
1330,
... | 2.578541 | 8,938 |
# < 클래스 변수 >
# 클래스 멤버로서 클래스 내에서 사용되는 지역변수.
i1 = Cs2()
i2 = Cs2()
i3 = Cs2()
i4 = Cs2()
print(Cs.getCount()) | [
2,
1279,
220,
169,
223,
112,
167,
252,
246,
168,
232,
97,
31619,
111,
222,
168,
230,
246,
1875,
198,
2,
220,
220,
169,
223,
112,
167,
252,
246,
168,
232,
97,
31619,
102,
97,
167,
110,
226,
167,
94,
250,
168,
226,
250,
220,
169... | 0.888889 | 153 |
from torchvision.transforms import transforms
import torchvision
import os
from torch.utils.data import Dataset, DataLoader
import numpy as np
from random import shuffle
import torch
import random
| [
6738,
28034,
10178,
13,
7645,
23914,
1330,
31408,
198,
11748,
28034,
10178,
198,
11748,
28686,
198,
6738,
28034,
13,
26791,
13,
7890,
1330,
16092,
292,
316,
11,
6060,
17401,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
4738,
1330,
36273... | 4.212766 | 47 |
# ! /usr/bin/env python
# -*- coding: utf-8 -*-
import json
import traceback
from functools import wraps
from tornado.escape import json_decode
from tornado.web import RequestHandler, HTTPError, os
from lib.common import error
from lib.common.format import AlchemyJsonEncoder
from lib.common.aliyun_mysql import mysql_r... | [
2,
5145,
1220,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
33918,
198,
11748,
12854,
1891,
198,
6738,
1257,
310,
10141,
1330,
27521,
198,
6738,
33718,
13,
41915,
... | 3.078818 | 203 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Runs multiple effects in a simulator, composing them onto a single cube
"""
import time
import netl3d
from netl3d.hardware import l3dcube
from netl3d.simulator import Simulator, merge_strategy
import animations
if __name__ == '__main__':
config = netl3d.parse_config... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
10987,
82,
3294,
3048,
287,
257,
35375,
11,
49760,
606,
4291,
257,
2060,
23441,
198,
37811,
198,
11748,
640... | 2.723032 | 343 |
###Titulo: Formação de uma terceira string
###Função: Este programa le duas strings e gera uma terceira com as letras de apenas uma delas
###Autor: Valmor Mantelli Jr.
###Data: 07/01/2019
###Versão: 0.0.1
### Declaração de variáve
f = ""
s= ""
t = ""
q= ""
p = ""
### Atribuição de valor
f = "CTA"
s = "ABC"
... | [
21017,
51,
270,
43348,
25,
5178,
64,
16175,
28749,
390,
334,
2611,
1059,
344,
8704,
4731,
198,
21017,
24629,
16175,
28749,
25,
412,
4169,
1430,
64,
443,
7043,
292,
13042,
304,
308,
8607,
334,
2611,
1059,
344,
8704,
401,
355,
1309,
884... | 2.164983 | 297 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
*****************************************
Author: zhlinh
Email: zhlinhng@gmail.com
Version: 0.0.1
Created Time: 2016-02-20
Last_modify: 2016-02-20
******************************************
'''
'''
Given an array of strings, group anagrams ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
7061,
6,
198,
17174,
4557,
9,
198,
13838,
25,
220,
220,
220,
220,
220,
220,
220,
220,
1976,
71,
2815,
71,
198,
1533... | 2.641256 | 223 |
"""
Tests for POSIX-compatible `unlink`.
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/unlink.html
"""
from pathlib import Path
from helpers import check, check_fail, check_version, run
def test_version():
"""Check that we're using Boreutil's implementation."""
assert check_version("unlink")
... | [
37811,
198,
51,
3558,
329,
28069,
10426,
12,
38532,
4600,
403,
8726,
44646,
198,
198,
5450,
1378,
12984,
82,
13,
404,
1516,
3233,
13,
2398,
14,
25119,
12984,
82,
14,
4846,
17032,
24991,
2079,
14,
315,
2410,
14,
403,
8726,
13,
6494,
... | 2.643731 | 654 |
from rest_framework import serializers
from .models import Recipe
from .models import Step
from .models import Ingredient
| [
198,
6738,
1334,
62,
30604,
1330,
11389,
11341,
198,
198,
6738,
764,
27530,
1330,
26694,
198,
6738,
764,
27530,
1330,
5012,
198,
6738,
764,
27530,
1330,
17589,
445,
1153,
628,
628
] | 4.096774 | 31 |
x = 0
print(x + "")
| [
198,
198,
87,
796,
657,
198,
198,
4798,
7,
87,
1343,
366,
4943,
198
] | 1.642857 | 14 |
from __future__ import print_function
from keras.callbacks import TensorBoard
from triplet_losses import batch_all_triplet_loss, batch_hard_triplet_loss
from triplet_metrics import triplet_accuracy, mean_norm
from model import build_mnist_model
from dataset.mnist import load_mnist
batch_size = 128
num_classes = 10
ep... | [
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
6738,
41927,
292,
13,
13345,
10146,
1330,
309,
22854,
29828,
198,
198,
6738,
15055,
83,
62,
22462,
274,
1330,
15458,
62,
439,
62,
28461,
37069,
62,
22462,
11,
15458,
62,
10424,
62,
2... | 2.456853 | 394 |
#!/usr/bin/env python
import math
import base64
import binascii
import eczkp
import paillier
import ecdsa
from pyasn1.codec.der.decoder import decode
from pyasn1.type import namedtype, univ, tag
from pyasn1.compat.octets import ints2octs, octs2ints
from pyasn1.codec.der.encoder import encode as der_encoder
from pyasn1_... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
11748,
10688,
198,
11748,
2779,
2414,
198,
11748,
9874,
292,
979,
72,
198,
11748,
9940,
89,
74,
79,
198,
11748,
14187,
359,
959,
198,
11748,
9940,
9310,
64,
198,
6738,
12972,
292,
77,
... | 1.790176 | 2,097 |
import sys
import os
import subprocess
import unittest
import time
import glob
import copy
class Script:
"""
Trim_sequences is done, and the other scripts will have similar setups that have the flags as attributes so tests
can step through the list of attributes.
"""
__cwd = os.getcwd()
class Tr... | [
11748,
25064,
198,
11748,
28686,
198,
11748,
850,
14681,
198,
11748,
555,
715,
395,
198,
11748,
640,
198,
11748,
15095,
198,
11748,
4866,
628,
198,
4871,
12327,
25,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
833,
320,
62,
3107,
30... | 2.580062 | 1,605 |
class CookieException(FormatException):
"""
The exception that is thrown when an error is made adding a System.Net.Cookie to a System.Net.CookieContainer.
CookieException()
"""
def ZZZ(self):
"""hardcoded/mock instance of the class"""
return CookieException()
instance=ZZZ()
"""hardcoded/returns... | [
4871,
39606,
16922,
7,
26227,
16922,
2599,
201,
198,
37227,
201,
198,
383,
6631,
326,
318,
8754,
618,
281,
4049,
318,
925,
4375,
257,
4482,
13,
7934,
13,
34,
18055,
284,
257,
4482,
13,
7934,
13,
34,
18055,
29869,
13,
201,
201,
198,
... | 3.375854 | 439 |
import copy
| [
11748,
4866,
628,
198
] | 3.5 | 4 |
# 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
#
# https://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... | 3.023381 | 556 |
"""
DRS notification resource package.
Copyright (c) 2018 Qualcomm Technologies, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted (subject to the
limitations in the disclaimer below) provided that the following conditions are met:
* Redistribut... | [
37811,
198,
35,
6998,
14483,
8271,
5301,
13,
198,
15269,
357,
66,
8,
2864,
32903,
21852,
11,
3457,
13,
198,
1439,
2489,
10395,
13,
198,
2297,
396,
3890,
290,
779,
287,
2723,
290,
13934,
5107,
11,
351,
393,
1231,
17613,
11,
389,
1043... | 3.003085 | 1,621 |
import argparse
import gym
import numpy as np
import matplotlib.pyplot as plt
from src.agent import Agent
from src.util import window_average
if __name__ == '__main__':
parser = argparse.ArgumentParser(description=None)
parser.add_argument('env_id', nargs='?', default='Taxi-v2', help='Select the environmen... | [
11748,
1822,
29572,
198,
198,
11748,
11550,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
198,
6738,
12351,
13,
25781,
1330,
15906,
198,
6738,
12351,
13,
22602,
1330,
4324,
62,
23... | 2.771654 | 254 |
# Visualizing neural fingerprints.
#
# David Duvenaud
# Dougal Maclaurin
# 2015
import os, pickle
import autograd.numpy as np
#import autograd.numpy.random as npr
#from autograd import grad
from rdkit import Chem
from rdkit.Chem import Draw
from rdkit.Chem.Draw import DrawingOptions
import matplotlib.pyplot as plt
fr... | [
2,
15612,
2890,
17019,
34290,
13,
198,
2,
198,
2,
3271,
10343,
574,
3885,
198,
2,
5728,
13528,
4100,
75,
2899,
259,
198,
2,
1853,
198,
198,
11748,
28686,
11,
2298,
293,
198,
11748,
1960,
519,
6335,
13,
77,
32152,
355,
45941,
198,
... | 2.225187 | 937 |
from Crypto.Cipher import AES
from Crypto.Random import get_random_bytes
from ..conversions import base64_to_bytes
from ..set1.challenge1_2 import xor_bytes
from ..set1.challenge7 import decrypt_AES_ECB
from ..set1.challenge8 import get_blocks
def encrypt_AES_CBC(plaintext: bytes, key: bytes, iv: bytes) -> bytes:
... | [
6738,
36579,
13,
34,
10803,
1330,
34329,
198,
6738,
36579,
13,
29531,
1330,
651,
62,
25120,
62,
33661,
198,
198,
6738,
11485,
1102,
47178,
1330,
2779,
2414,
62,
1462,
62,
33661,
198,
6738,
11485,
2617,
16,
13,
36747,
3540,
16,
62,
17,... | 2.704023 | 348 |
#
# 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, software
# distributed under ... | [
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,
7330,
257,
4866,
286,
262,
13789,
379,... | 3.1475 | 400 |
from sklearn.linear_model import LogisticRegression
import numpy as np
from node2vec.edges import HadamardEmbedder
import time
from utils import evaluate_model, get_mask, save, load_graph, read_graph_rw2, train_rw2, k_largest_index_argsort, save_top
from sklearn.model_selection import KFold
from random import shuffle
i... | [
6738,
1341,
35720,
13,
29127,
62,
19849,
1330,
5972,
2569,
8081,
2234,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
10139,
17,
35138,
13,
276,
3212,
1330,
11161,
321,
446,
31567,
276,
1082,
198,
11748,
640,
198,
6738,
3384,
4487,
1330... | 3.175 | 160 |
"""
=============
testapp.views
=============
View functions for Comments app.
"""
import traceback
from flask import (
abort,
current_app,
flash,
g,
make_response,
redirect,
render_template,
request,
session,
url_for,
)
from flask_redis import string_types
import storage
f... | [
37811,
198,
25609,
28,
198,
9288,
1324,
13,
33571,
198,
25609,
28,
198,
198,
7680,
5499,
329,
19502,
598,
13,
198,
198,
37811,
198,
198,
11748,
12854,
1891,
198,
198,
6738,
42903,
1330,
357,
198,
220,
220,
220,
15614,
11,
198,
220,
... | 2.583178 | 1,605 |
import RPi.GPIO as GPIO
import Adafruit_PCA9685
from time import sleep
# Initialise the PCA9685 using the default address (0x40).
pwm = Adafruit_PCA9685.PCA9685()
# Alternatively specify a different address and/or bus:
#pwm = Adafruit_PCA9685.PCA9685(address=0x41, busnum=2)
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~ Use these set... | [
11748,
25812,
72,
13,
16960,
9399,
355,
50143,
198,
11748,
1215,
1878,
4872,
62,
5662,
32,
24,
35978,
198,
6738,
640,
1330,
3993,
198,
2,
20768,
786,
262,
4217,
32,
24,
35978,
1262,
262,
4277,
2209,
357,
15,
87,
1821,
737,
198,
79,
... | 2.286408 | 824 |
"""\
@file dagpool_test.py
@author Nat Goodspeed
@date 2016-08-26
@brief Test DAGPool class
"""
from nose.tools import *
import eventlet
from eventlet.dagpool import DAGPool, Collision, PropagateError
import six
from contextlib import contextmanager
import itertools
# Not all versions of nose.tools.assert_raise... | [
37811,
59,
198,
31,
7753,
220,
220,
48924,
7742,
62,
9288,
13,
9078,
198,
31,
9800,
14393,
4599,
12287,
198,
31,
4475,
220,
220,
1584,
12,
2919,
12,
2075,
198,
31,
65,
3796,
220,
6208,
360,
4760,
27201,
1398,
198,
37811,
198,
198,
... | 3.757166 | 1,256 |
import importlib
import logging
import os
import sys
import json
#sys.path.append('./lib/config/python3')
from ConfigFromJsonRemote import ConfigFromJsonRemote
from ConfigInfo import ConfigInfo, ConfigInfoList
from dotmap import DotMap
# ----------------------------------------------------------------------------... | [
11748,
1330,
8019,
198,
11748,
18931,
198,
11748,
28686,
198,
11748,
25064,
198,
198,
11748,
33918,
198,
198,
2,
17597,
13,
6978,
13,
33295,
7,
4458,
14,
8019,
14,
11250,
14,
29412,
18,
11537,
198,
198,
6738,
17056,
4863,
41,
1559,
36... | 3.906542 | 321 |
import playfab.PlayFabErrors as PlayFabErrors
import playfab.PlayFabHTTP as PlayFabHTTP
import playfab.PlayFabSettings as PlayFabSettings
""" Enables the use of an external match-making service in conjunction with PlayFab hosted Game Server instances """
def AuthUser(request, callback, customData = None, extraHeader... | [
11748,
711,
36434,
13,
11002,
43957,
9139,
5965,
355,
3811,
43957,
9139,
5965,
198,
11748,
711,
36434,
13,
11002,
43957,
40717,
355,
3811,
43957,
40717,
198,
11748,
711,
36434,
13,
11002,
43957,
26232,
355,
3811,
43957,
26232,
198,
198,
3... | 3.479029 | 906 |
# -*- coding: utf-8 -*-
'''
Stage: "市場"
'''
import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), '../../..'))
sys.path.append('storybuilder')
from storybuilder.builder.world import World
# NOTE
# 立っている市場はどこでもここを使う。基本は古くから立っている賑わいのあるバラ市場
# alias
MARKET = "Market"
## scenes
## in E... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
7061,
6,
198,
29391,
25,
366,
30585,
224,
161,
254,
112,
1,
198,
7061,
6,
198,
11748,
28686,
198,
11748,
25064,
198,
17597,
13,
6978,
13,
33295,
7,
418,
13,
6978,
13... | 1.902174 | 184 |