content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
from typing import Dict, List
from mai_version.IO.parsing_settings.utils import FileSettings
from problog.engine import DefaultEngine
from problog.program import PrologString, PrologFile
from mai_version.representation.example import ExampleWrapper, Probability, Label
from mai_version.representation.language import Ty... | [
6738,
19720,
1330,
360,
713,
11,
7343,
198,
198,
6738,
285,
1872,
62,
9641,
13,
9399,
13,
79,
945,
278,
62,
33692,
13,
26791,
1330,
9220,
26232,
198,
6738,
1861,
6404,
13,
18392,
1330,
15161,
13798,
198,
6738,
1861,
6404,
13,
23065,
... | 2.66357 | 2,045 |
password="pbkdf2(1000,20,sha512)$9b190557101079ff$a36cf8fcfa708fff85e5a1e39848270515d258ae"
| [
28712,
2625,
40842,
74,
7568,
17,
7,
12825,
11,
1238,
11,
26270,
25836,
8,
3,
24,
65,
1129,
2713,
3553,
8784,
2998,
24,
487,
3,
64,
2623,
12993,
23,
69,
12993,
64,
32583,
20972,
5332,
68,
20,
64,
16,
68,
31952,
2780,
1983,
2713,
... | 1.84 | 50 |
weapon = Weapon(5)
print(weapon.shoot())
print(weapon.shoot())
print(weapon)
print(weapon.shoot())
print(weapon.shoot())
print(weapon.shoot())
print(weapon.shoot())
print(weapon)
| [
198,
198,
28741,
796,
13072,
7,
20,
8,
198,
4798,
7,
28741,
13,
30408,
28955,
198,
4798,
7,
28741,
13,
30408,
28955,
198,
4798,
7,
28741,
8,
198,
4798,
7,
28741,
13,
30408,
28955,
198,
4798,
7,
28741,
13,
30408,
28955,
198,
4798,
... | 2.967213 | 61 |
#!/usr/bin/env python3
# SPDX-License-Identifier: MIT
# Copyright (c) 2021 Advanced Micro Devices, Inc. All rights reserved.
import sys
import test
import translator.translator
testdata = []
test.run(
expression = translator.size_of,
testdata = testdata,
tag = "declaration-{}".format(li... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
30628,
55,
12,
34156,
12,
33234,
7483,
25,
17168,
198,
2,
15069,
357,
66,
8,
33448,
13435,
4527,
29362,
11,
3457,
13,
1439,
2489,
10395,
13,
198,
11748,
25064,
198,
11748,
133... | 2.755906 | 127 |
"""
File defining the virtual Entity class.
Designed for Protégé - IA301.
"""
import xml.etree.ElementTree as ET
class Entity:
""" Entity virtual class containaing the necessary arguments and methods. """
def __init__(self, name: str):
"""Basic constructor for the entity class.
Args:
... | [
37811,
198,
8979,
16215,
262,
7166,
20885,
1398,
13,
198,
5960,
3916,
329,
5038,
2634,
70,
2634,
532,
35229,
18938,
13,
198,
37811,
198,
198,
11748,
35555,
13,
316,
631,
13,
20180,
27660,
355,
12152,
628,
198,
4871,
20885,
25,
198,
22... | 2.472973 | 444 |
# Collaborators (including web sites where you got help: (enter none if you didn't need help)
# Jonah explained some of the concepts to me and also Megan.
# Do not change function name!
# User code goes here
gcf=0
if __name__ == '__main__':
x = int(input("Enter a number: "))
y = int(input("Enter ano... | [
2,
37322,
2024,
357,
8201,
3992,
5043,
810,
345,
1392,
1037,
25,
357,
9255,
4844,
611,
345,
1422,
470,
761,
1037,
8,
198,
2,
220,
45447,
4893,
617,
286,
262,
10838,
284,
502,
290,
635,
27616,
13,
220,
628,
220,
220,
1303,
2141,
40... | 3.057416 | 209 |
from src.roland_piano import (
discover,
RolandPiano,
)
import logging
import time
logging.basicConfig(
level=logging.DEBUG,
format="%(asctime)s,%(msecs)d %(levelname)-8s [%(filename)s:%(lineno)d] %(message)s",
datefmt="%S",
)
piano_name = discover()
with RolandPiano(piano_name) as piano:
whil... | [
6738,
12351,
13,
305,
1044,
62,
79,
10115,
1330,
357,
198,
220,
220,
220,
7073,
11,
198,
220,
220,
220,
29761,
47,
10115,
11,
198,
8,
198,
11748,
18931,
198,
11748,
640,
198,
198,
6404,
2667,
13,
35487,
16934,
7,
198,
220,
220,
22... | 2.229299 | 157 |
conjuntoA = {1, 2, 3}
conjuntoB = {1, 2, 3, 4, 5}
conjunto_subset = conjuntoA.issubset(conjuntoB)#retorna um booleano
conjunto_subset1 = conjuntoB.issubset(conjuntoA)
conjunto_superset = conjuntoB.issuperset(conjuntoA)#retorna um booleano.
conjunto_superset1 = conjuntoA.issuperset(conjuntoB)
print(f'A é subconjunto d... | [
1102,
29741,
1462,
32,
796,
1391,
16,
11,
362,
11,
513,
92,
198,
1102,
29741,
1462,
33,
796,
1391,
16,
11,
362,
11,
513,
11,
604,
11,
642,
92,
198,
198,
1102,
29741,
1462,
62,
7266,
2617,
796,
11644,
403,
1462,
32,
13,
747,
549,... | 2.117647 | 238 |
#
# Met-class for creating regression tests.
#
| [
2,
198,
2,
3395,
12,
4871,
329,
4441,
20683,
5254,
13,
198,
2,
628
] | 3.428571 | 14 |
import boto3
import botocore
import logging
from app_helper import publish_message, check_key_and_value, START_BACKFILL_TOKEN
from crhelper import CfnResource
log = logging.getLogger()
log.setLevel(logging.INFO)
sns = boto3.client('sns')
cfn_helper = CfnResource()
@cfn_helper.create
@cfn_helper.update
@cfn_helper.d... | [
11748,
275,
2069,
18,
198,
11748,
10214,
420,
382,
198,
11748,
18931,
198,
6738,
598,
62,
2978,
525,
1330,
7715,
62,
20500,
11,
2198,
62,
2539,
62,
392,
62,
8367,
11,
33303,
62,
31098,
37,
8267,
62,
10468,
43959,
198,
6738,
1067,
29... | 2.87234 | 141 |
from pydantic import BaseSettings
settings=Settings()
| [
6738,
279,
5173,
5109,
1330,
7308,
26232,
628,
628,
198,
33692,
28,
26232,
3419,
198
] | 3.866667 | 15 |
# Make this file ugly to test the problem matchersimport typing
| [
2,
6889,
428,
2393,
13400,
284,
1332,
262,
1917,
2603,
3533,
11748,
19720,
628
] | 4.642857 | 14 |
import rosegraphics as rg
import math
| [
11748,
8278,
70,
11549,
355,
48670,
198,
11748,
10688,
198
] | 3.8 | 10 |
# A Program to find number of characters to be changed to make subsrting of a string palindrome
| [
2,
317,
6118,
284,
1064,
1271,
286,
3435,
284,
307,
3421,
284,
787,
6352,
81,
889,
286,
257,
4731,
6340,
521,
5998,
628
] | 4.217391 | 23 |
"""
.. module:: matread
:synopsis: Read Python values from a MAT file made by Octave.
Strives to preserve both value and type in transit.
.. moduleauthor:: Steven Silvester <steven.silvester@ieee.org>
"""
import os
import numpy as np
from scipy.io import loadmat
import scipy
from .utils i... | [
37811,
201,
198,
492,
8265,
3712,
2603,
961,
201,
198,
220,
220,
1058,
28869,
24608,
25,
4149,
11361,
3815,
422,
257,
36775,
2393,
925,
416,
2556,
1015,
13,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
... | 1.83442 | 2,301 |
"""scrapli.driver.base"""
from scrapli.driver.base.async_driver import AsyncDriver
from scrapli.driver.base.sync_driver import Driver
__all__ = (
"AsyncDriver",
"Driver",
)
| [
37811,
1416,
430,
489,
72,
13,
26230,
13,
8692,
37811,
198,
6738,
19320,
489,
72,
13,
26230,
13,
8692,
13,
292,
13361,
62,
26230,
1330,
1081,
13361,
32103,
198,
6738,
19320,
489,
72,
13,
26230,
13,
8692,
13,
27261,
62,
26230,
1330,
... | 2.676471 | 68 |
#!/usr/bin/env python
ONLINE_RETAIL_XLSX = 'OnlineRetail.xlsx'
ONLINE_RETAIL_CSV = 'OnlineRetail.csv'
ONLINE_RETAIL_JSON = 'OnlineRetail.json'
if __name__ == "__main__":
for filename in [ONLINE_RETAIL_XLSX, ONLINE_RETAIL_CSV, ONLINE_RETAIL_JSON]:
remove_file(filename)
for filename in [ONLINE_RETA... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
1340,
24027,
62,
2200,
5603,
4146,
62,
55,
6561,
55,
220,
796,
705,
14439,
9781,
603,
13,
87,
7278,
87,
6,
198,
1340,
24027,
62,
2200,
5603,
4146,
62,
7902,
53,
220,
220,
796,... | 2.165217 | 230 |
import pandas as pd
import numpy as np
import scipy as sp
import os as os
import csv
import psycopg2
import datetime
import mysql.connector
from array import *
import datetime as datetime
# Test Code simply defining curve classes
| [
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
629,
541,
88,
355,
599,
198,
11748,
28686,
355,
28686,
198,
11748,
269,
21370,
198,
11748,
17331,
22163,
70,
17,
198,
11748,
4818,
8079,
198,
11748,
48761,... | 3.515152 | 66 |
import collections
import sys
try:
import xml.etree.cElementTree as ET
except ImportError:
import xml.etree.ElementTree as ET
####################################################################
####################################################################
ns = {'p' : 'http://www.pnml.org/version-2009... | [
11748,
17268,
198,
11748,
25064,
198,
28311,
25,
198,
220,
1330,
35555,
13,
316,
631,
13,
66,
20180,
27660,
355,
12152,
198,
16341,
17267,
12331,
25,
198,
220,
1330,
35555,
13,
316,
631,
13,
20180,
27660,
355,
12152,
198,
198,
29113,
... | 3.19863 | 146 |
# coding=utf-8
import re
from typing import Any, Union
from urllib.parse import unquote
class ArgumentError(Exception):
"""Raised when an invalid or conflicting function argument is supplied.
This error generally corresponds to construction time state errors.
"""
pass
def parse_rfc1738_args(name:... | [
2,
19617,
28,
40477,
12,
23,
198,
11748,
302,
198,
6738,
19720,
1330,
4377,
11,
4479,
198,
6738,
2956,
297,
571,
13,
29572,
1330,
555,
22708,
198,
198,
4871,
45751,
12331,
7,
16922,
2599,
198,
220,
220,
220,
37227,
21762,
1417,
618,
... | 2.104016 | 971 |
# Cores no Terminal
nome = 'Eduardo'
print('Olá! Prazer em te conhecer, {}{}{}!'.format('\033[7;31m',nome,'\033[m')) | [
2,
327,
2850,
645,
24523,
198,
198,
77,
462,
796,
705,
36,
646,
13109,
6,
198,
198,
4798,
10786,
30098,
6557,
0,
350,
3247,
263,
795,
573,
369,
258,
2189,
11,
1391,
18477,
18477,
92,
0,
4458,
18982,
10786,
59,
44427,
58,
22,
26,
... | 2.107143 | 56 |
# 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 writing, ... | [
2,
15069,
12131,
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.703764 | 611 |
# https://www.geeksforgeeks.org/largest-lexicographical-string-with-at-most-k-consecutive-elements/
if __name__ == '__main__':
t = int(input())
for i in range(t):
str = input()
k = int(input())
print(lex_largest_k_consecutive(str, k)) | [
2,
3740,
1378,
2503,
13,
469,
2573,
30293,
2573,
13,
2398,
14,
28209,
12,
2588,
291,
17046,
12,
8841,
12,
4480,
12,
265,
12,
1712,
12,
74,
12,
1102,
4552,
425,
12,
68,
3639,
14,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
1... | 2.271186 | 118 |
import RPi.GPIO as GPIO # Import Raspberry Pi GPIO library
from time import sleep # Import the sleep function from the time module
GPIO.setwarnings(False)
GPIO.setmode(GPIO.BOARD)
GPIO.setup(12, GPIO.OUT, initial=GPIO.LOW)
GPIO.output(12, GPIO.HIGH)
sleep(1)
GPIO.output(12, GPIO.LOW) | [
11748,
25812,
72,
13,
16960,
9399,
355,
50143,
1303,
17267,
24244,
13993,
50143,
5888,
198,
6738,
640,
1330,
3993,
1303,
17267,
262,
3993,
2163,
422,
262,
640,
8265,
198,
16960,
9399,
13,
2617,
40539,
654,
7,
25101,
8,
198,
16960,
9399,... | 2.784314 | 102 |
#!/usr/local/bin/python3
from math import pi
if __name__ == '__main__':
raio = float(input('Informe o raio: '))
circulo(raio)
| [
2,
48443,
14629,
14,
12001,
14,
8800,
14,
29412,
18,
198,
6738,
10688,
1330,
31028,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
2179,
952,
796,
12178,
7,
15414,
10786,
818,
687,
68,
2... | 2.322034 | 59 |
"""RacelandshopFrontend."""
class RacelandshopFrontend:
"""RacelandshopFrontend."""
version_running: bool = None
version_available: bool = None
version_expected: bool = None
update_pending: bool = False
| [
37811,
49,
330,
8822,
24643,
25886,
437,
526,
15931,
628,
198,
4871,
24746,
8822,
24643,
25886,
437,
25,
198,
220,
220,
220,
37227,
49,
330,
8822,
24643,
25886,
437,
526,
15931,
628,
220,
220,
220,
2196,
62,
20270,
25,
20512,
796,
604... | 2.935065 | 77 |
# Copyright 2017, 2018 Amazon.com, Inc. or its affiliates. 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. A copy of the License
# is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" fi... | [
2,
15069,
2177,
11,
2864,
6186,
13,
785,
11,
3457,
13,
393,
663,
29116,
13,
1439,
6923,
33876,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
11074,
921,
743,
407,
198,
2,
779,
... | 2.451563 | 1,280 |
import os
from decimal import Decimal
from textwrap import shorten
from django.conf import settings
from django.core.validators import MinValueValidator
from django.db import models
from django.db.models.fields.files import ImageFieldFile
from django.utils.html import mark_safe
from core.utils import admin_display, h... | [
11748,
28686,
198,
6738,
32465,
1330,
4280,
4402,
198,
6738,
2420,
37150,
1330,
45381,
198,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
7295,
13,
12102,
2024,
1330,
1855,
11395,
47139,
1352,
198,
6738,
426... | 2.235526 | 760 |
from .meta_document import MetaDocument
from .document_mixin import DocumentMixin
| [
6738,
764,
28961,
62,
22897,
1330,
30277,
24941,
198,
6738,
764,
22897,
62,
19816,
259,
1330,
16854,
35608,
259,
628
] | 4.15 | 20 |
#
# PySNMP MIB module OLD-CISCO-CPU-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/OLD-CISCO-CPU-MIB
# Produced by pysmi-0.3.4 at Wed May 1 14:32:38 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Ma... | [
2,
198,
2,
9485,
15571,
7378,
337,
9865,
8265,
440,
11163,
12,
34,
1797,
8220,
12,
36037,
12,
8895,
33,
357,
4023,
1378,
16184,
76,
489,
8937,
13,
785,
14,
79,
893,
11632,
8,
198,
2,
7054,
45,
13,
16,
2723,
2393,
1378,
14,
14490... | 2.752406 | 1,143 |
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
import api_pb2 as api__pb2
class APIStub(object):
"""API is the main Liftbridge server interface clients interact with.
"""
def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Channel.
"""
s... | [
2,
2980,
515,
416,
262,
308,
49,
5662,
11361,
8435,
17050,
13877,
13,
8410,
5626,
48483,
0,
198,
11748,
1036,
14751,
198,
198,
11748,
40391,
62,
40842,
17,
355,
40391,
834,
40842,
17,
628,
198,
4871,
7824,
1273,
549,
7,
15252,
2599,
... | 2.949304 | 1,006 |
import os
import math
import torch
from graphviz import Digraph
class GraphNode(object):
"""Simple aggregation op"""
class GraphEdge(torch.nn.Module):
"""Module for computing weighted outputs for an arbitrary collection of ops"""
@property
@property
@property
class GraphLayer(torch.nn.Modul... | [
11748,
28686,
198,
11748,
10688,
198,
11748,
28034,
198,
6738,
4823,
85,
528,
1330,
7367,
1470,
628,
198,
4871,
29681,
19667,
7,
15252,
2599,
198,
220,
220,
220,
37227,
26437,
46500,
1034,
37811,
628,
198,
4871,
29681,
37021,
7,
13165,
... | 2.714583 | 480 |
import concurrent.futures
import copy
import typing as tp
from googleapiclient.discovery import build
from mincrawler.crawlers.crawler import Crawler
from mincrawler.item import Item
from mincrawler.utils.batch import generate_batch
| [
11748,
24580,
13,
69,
315,
942,
198,
11748,
4866,
198,
11748,
19720,
355,
256,
79,
198,
198,
6738,
23645,
499,
291,
75,
1153,
13,
67,
40821,
1330,
1382,
198,
198,
6738,
949,
66,
39464,
13,
66,
1831,
8116,
13,
66,
39464,
1330,
20177,... | 3.522388 | 67 |
#!/usr/bin/python3
import requests
import inquirer
import json
import re | [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
11748,
7007,
198,
11748,
38212,
81,
198,
11748,
33918,
198,
11748,
302
] | 3.428571 | 21 |
@property
@intrinsic.setter
| [
31,
26745,
198,
198,
31,
600,
81,
1040,
291,
13,
2617,
353,
198
] | 2.230769 | 13 |
#!/usr/bin/python3
# scan.py - Scott Garrett
#
# Version 20211210-001
#
# This is a quick scan to locate Reverie Powerbases with bluetooth interfaces.
# It will retuurn the MAC address that you specify in the reverie.py script. It
# assumes the local name will be "RevCB_A1". If there are any other strings for
# othe... | [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
198,
2,
9367,
13,
9078,
532,
4746,
27540,
198,
2,
198,
2,
10628,
33448,
1065,
940,
12,
8298,
198,
2,
198,
2,
770,
318,
257,
2068,
9367,
284,
17276,
797,
332,
494,
4333,
65,
1386,
35... | 2.90301 | 299 |
#!/home/knielbo/virtenvs/cv/bin/python
"""
Examples of approaches to weight initialization
"""
import numpy as np
if __name__=="__main__":
main()
| [
2,
48443,
11195,
14,
15418,
8207,
2127,
14,
37040,
1452,
14259,
14,
33967,
14,
8800,
14,
29412,
198,
37811,
198,
27730,
286,
10581,
284,
3463,
37588,
198,
37811,
198,
11748,
299,
32152,
355,
45941,
198,
198,
361,
11593,
3672,
834,
855,
... | 2.833333 | 54 |
from .InstagramAPI import *
from .InstagramAPIExtended import *
from .ImageUtils import *
| [
6738,
764,
6310,
6713,
17614,
1330,
1635,
198,
6738,
764,
6310,
6713,
2969,
10008,
742,
1631,
1330,
1635,
198,
6738,
764,
5159,
18274,
4487,
1330,
1635,
198
] | 3.333333 | 27 |
from collections import namedtuple, defaultdict
import operator
import idaapi
import idc
from . import exceptions
from .code import lines
FF_TYPES = [idc.FF_BYTE, idc.FF_WORD, idc.FF_DWRD, idc.FF_QWRD, idc.FF_OWRD, ]
FF_SIZES = [1, 2, 4, 8, 16, ]
SIZE_TO_TYPE = dict(zip(FF_SIZES, FF_TYPES))
STRUCT_ERROR_MAP = {
... | [
6738,
17268,
1330,
3706,
83,
29291,
11,
4277,
11600,
198,
11748,
10088,
198,
198,
11748,
220,
3755,
15042,
198,
11748,
4686,
66,
198,
198,
6738,
764,
1330,
13269,
198,
6738,
764,
8189,
1330,
3951,
198,
198,
5777,
62,
9936,
47,
1546,
7... | 2.484719 | 1,636 |
from __future__ import print_function
import os
import sys
sys.path.insert(1, os.path.join("..","..",".."))
import h2o
from h2o.estimators.infogram import H2OInfogram
from tests import pyunit_utils
def test_infogram_personal_loan_cv_valid():
"""
Make sure safe infogram works with validation frame and supp... | [
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
11748,
28686,
198,
11748,
25064,
198,
198,
17597,
13,
6978,
13,
28463,
7,
16,
11,
28686,
13,
6978,
13,
22179,
7203,
492,
2430,
492,
2430,
492,
48774,
198,
11748,
289,
17,
78,
198,
... | 2.521968 | 1,138 |
import sys
try:
import requests
except ImportError:
print("Please Install Requests Module With Command 'pip install requests'")
sys.exit(1)
from time import sleep
url = "https://api.covid19api.com/summary"
visit = requests.get(url).json()
NewConfirmed = visit["Global"]["NewConfirmed"]
TotalConfirmed = vi... | [
11748,
25064,
198,
198,
28311,
25,
198,
220,
220,
220,
1330,
7007,
198,
16341,
17267,
12331,
25,
198,
220,
220,
220,
3601,
7203,
5492,
15545,
9394,
3558,
19937,
2080,
9455,
705,
79,
541,
2721,
7007,
6,
4943,
198,
220,
220,
220,
25064,... | 1.747318 | 839 |
"""
cache layer factory
"""
# meta manager factory
# return supported meta manager info | [
37811,
198,
220,
220,
220,
12940,
7679,
8860,
198,
37811,
628,
220,
220,
220,
1303,
13634,
4706,
8860,
628,
220,
220,
220,
1303,
1441,
4855,
13634,
4706,
7508
] | 3.607143 | 28 |
print(generateNumber(0))
print(generateNumber(1))
print(generateNumber(5))
| [
198,
4798,
7,
8612,
378,
15057,
7,
15,
4008,
198,
4798,
7,
8612,
378,
15057,
7,
16,
4008,
198,
4798,
7,
8612,
378,
15057,
7,
20,
4008,
198
] | 2.714286 | 28 |
# Generated by Django 3.1.7 on 2021-02-22 19:49
from django.db import migrations
| [
2,
2980,
515,
416,
37770,
513,
13,
16,
13,
22,
319,
33448,
12,
2999,
12,
1828,
678,
25,
2920,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
628
] | 2.766667 | 30 |
from agavepy.agave import AgaveError
from tapis_cli.display import Verbosity
from tapis_cli.clients.services.mixins import ServiceIdentifier, Username
from . import API_NAME, SERVICE_VERSION
from .models import SystemRole
from .formatters import SystemsFormatOne
__all__ = ['SystemsRolesShow']
class SystemsRolesShow... | [
6738,
556,
1015,
9078,
13,
363,
1015,
1330,
2449,
1015,
12331,
198,
6738,
9814,
271,
62,
44506,
13,
13812,
1330,
49973,
16579,
198,
6738,
9814,
271,
62,
44506,
13,
565,
2334,
13,
30416,
13,
19816,
1040,
1330,
4809,
33234,
7483,
11,
50... | 3.189542 | 153 |
"""empty message
Revision ID: 0058_add_letters_flag
Revises: 0057_change_email_template
Create Date: 2016-10-25 17:37:27.660723
"""
# revision identifiers, used by Alembic.
revision = '0058_add_letters_flag'
down_revision = '0057_change_email_template'
from alembic import op
import sqlalchemy as sa
| [
37811,
28920,
3275,
198,
198,
18009,
1166,
4522,
25,
3571,
3365,
62,
2860,
62,
15653,
62,
32109,
198,
18009,
2696,
25,
3571,
3553,
62,
3803,
62,
12888,
62,
28243,
198,
16447,
7536,
25,
1584,
12,
940,
12,
1495,
1596,
25,
2718,
25,
19... | 2.807339 | 109 |
# Generated by Django 3.1.8 on 2021-10-07 12:56
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
513,
13,
16,
13,
23,
319,
33448,
12,
940,
12,
2998,
1105,
25,
3980,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
from Wappalyze import * | [
6738,
370,
1324,
3400,
2736,
1330,
1635
] | 3.285714 | 7 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @File : fedhf\api\serial\__init__.py
# @Time : 2022-05-03 03:34:14
# @Author : Bingjie Yan
# @Email : bj.yan.pa@qq.com
# @License : Apache License 2.0
__all__ = ["Serializer", "Deserializer"]
from .serializer import Serializer
from .deserializer impor... | [
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,
8979,
220,
220,
220,
1058,
220,
220,
11672,
71,
69,
59,
15042,
59,
46911,
59,
834,
15003,
834,
13,
9078,
1... | 2.352113 | 142 |
from jsonschema import _utils
from jsonschema.compat import iteritems
from jsonschema.exceptions import ValidationError
| [
6738,
44804,
684,
2395,
2611,
1330,
4808,
26791,
198,
6738,
44804,
684,
2395,
2611,
13,
5589,
265,
1330,
11629,
23814,
198,
6738,
44804,
684,
2395,
2611,
13,
1069,
11755,
1330,
3254,
24765,
12331,
628,
628,
628,
628,
628,
628
] | 3.358974 | 39 |
import os
import json
import requests
from lgsf.commands.base import CommandBase
from lgsf.path_utils import scraper_abs_path, create_org_package
| [
11748,
28686,
198,
11748,
33918,
198,
198,
11748,
7007,
198,
198,
6738,
300,
14542,
69,
13,
9503,
1746,
13,
8692,
1330,
9455,
14881,
198,
6738,
300,
14542,
69,
13,
6978,
62,
26791,
1330,
19320,
525,
62,
8937,
62,
6978,
11,
2251,
62,
... | 3.23913 | 46 |
import torch
import time
import numpy as np
import os
import matplotlib.gridspec as gridspec
import matplotlib.pyplot as plt
import matplotlib.patches as patches
from random import shuffle
from apgs.resampler import Resampler
from apgs.bmnist.objectives import apg_objective, bpg_objective, hmc_objective
from apgs.bmnis... | [
11748,
28034,
198,
11748,
640,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28686,
198,
11748,
2603,
29487,
8019,
13,
2164,
2340,
43106,
355,
50000,
43106,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
2603,... | 3.098214 | 112 |
"""
test_16_asset_bundle
As a developer working with asset bundles
I want a way to get to sub-assets.
"""
import secrets
import logging
import json
from starfish.asset import (
DataAsset,
BundleAsset,
)
TEST_ASSET_COUNT = 4
| [
37811,
198,
220,
220,
220,
1332,
62,
1433,
62,
562,
316,
62,
65,
31249,
628,
220,
220,
220,
1081,
257,
8517,
1762,
351,
11171,
36344,
198,
220,
220,
220,
314,
765,
257,
835,
284,
651,
284,
850,
12,
19668,
13,
198,
198,
37811,
198,... | 2.717391 | 92 |
import threading
import logging
import binascii
import socket
import collections
from scapy.all import sniff, Raw
logger = logging.getLogger('sniffer')
# TLS Header
TLS_HEADER_LENGTH = 5
TLS_CONTENT_TYPE = 0
TLS_LENGTH_MAJOR = 3
TLS_LENGTH_MINOR = 4
# TLS Content Types
TLS_CHANGE_CIPHER_SPEC = 20
TLS_ALERT = 21
TLS_... | [
11748,
4704,
278,
198,
11748,
18931,
198,
11748,
9874,
292,
979,
72,
198,
11748,
17802,
198,
11748,
17268,
198,
6738,
629,
12826,
13,
439,
1330,
26300,
11,
16089,
198,
198,
6404,
1362,
796,
18931,
13,
1136,
11187,
1362,
10786,
16184,
73... | 2.450464 | 1,938 |
if __name__ == "__main__":
print(test_func(0))
print(test_func(0))
print(test_func(0))
| [
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
3601,
7,
9288,
62,
20786,
7,
15,
4008,
198,
220,
220,
220,
3601,
7,
9288,
62,
20786,
7,
15,
4008,
198,
220,
220,
220,
3601,
7,
9288,
62,
2078... | 2.061224 | 49 |
"""
Mathematical functions for line shapes in S(q,E) modelling.
"""
import numpy as np
###############################################################################
###############################################################################
#######################################################################... | [
37811,
198,
19044,
10024,
605,
5499,
329,
1627,
15268,
287,
311,
7,
80,
11,
36,
8,
38591,
13,
198,
37811,
198,
198,
11748,
299,
32152,
355,
45941,
198,
198,
29113,
29113,
7804,
4242,
21017,
198,
29113,
29113,
7804,
4242,
21017,
198,
2... | 2.386861 | 2,466 |
from .ll_merge import merge_lists
from .linked_list import LinkedList
| [
6738,
764,
297,
62,
647,
469,
1330,
20121,
62,
20713,
198,
6738,
764,
25614,
62,
4868,
1330,
7502,
276,
8053,
628,
628,
628
] | 3.26087 | 23 |
"""
time: O(n)
space: O(n)
"""
| [
37811,
198,
2435,
25,
440,
7,
77,
8,
198,
13200,
25,
440,
7,
77,
8,
198,
37811,
198,
220,
220,
220,
220,
220,
220,
220,
220
] | 1.5 | 26 |
# osutil.py - pure Python version of osutil.c
#
# Copyright 2009 Matt Mackall <mpm@selenic.com> and others
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
import ctypes
import ctypes.util
import os
import socket
import stat as ... | [
2,
28686,
22602,
13,
9078,
532,
5899,
11361,
2196,
286,
28686,
22602,
13,
66,
198,
2,
198,
2,
220,
15069,
3717,
4705,
16640,
439,
1279,
3149,
76,
31,
741,
35866,
13,
785,
29,
290,
1854,
198,
2,
198,
2,
770,
3788,
743,
307,
973,
... | 2.208594 | 2,397 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
import pytest
from bs4 import BeautifulSoup
import scrapper_helpers.utils as utils
if sys.version_info < (3, 3):
from mock import mock
else:
from unittest import mock
@pytest.mark.parametrize(
'text,dic,expected_value', [
('ala', {'a': 'b'}, ... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
25064,
198,
11748,
12972,
9288,
198,
6738,
275,
82,
19,
1330,
23762,
50,
10486,
198,
198,
11748,
19320,
2848,
62,
... | 2.128827 | 784 |
import sys
import os
try:
from pyfission.configs.config import *
except ImportError:
sys.exit(1)
"""
DWH Creds Structure:
:key = db type
:value = dict
:key = database/project name
:value = dict
:key = host, port, database, user, password
# for BigQuery
:key = private... | [
11748,
25064,
198,
11748,
28686,
198,
198,
28311,
25,
198,
220,
220,
220,
422,
12972,
69,
1480,
13,
11250,
82,
13,
11250,
1330,
1635,
198,
16341,
17267,
12331,
25,
198,
220,
220,
220,
25064,
13,
37023,
7,
16,
8,
628,
198,
37811,
198... | 2.011561 | 346 |
"""
Test for privacy settings
"""
import random
from concurrent.futures import ThreadPoolExecutor
from contextlib import contextmanager
from dataclasses import dataclass
from wxc_sdk.all_types import Person, Privacy
import base64
from .base import TestCaseWithUsers
@dataclass(init=False)
| [
37811,
198,
14402,
329,
6782,
6460,
198,
37811,
198,
11748,
4738,
198,
6738,
24580,
13,
69,
315,
942,
1330,
14122,
27201,
23002,
38409,
198,
6738,
4732,
8019,
1330,
4732,
37153,
198,
6738,
4818,
330,
28958,
1330,
4818,
330,
31172,
198,
... | 3.585366 | 82 |
import copy
if __name__== "__main__":
cipher = input("Please type in the cipher:\n")
print("The new index table is:")
table = table()
playfair_cipher(cipher, table) | [
11748,
4866,
628,
198,
361,
11593,
3672,
834,
855,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
38012,
796,
5128,
7203,
5492,
2099,
287,
262,
38012,
7479,
77,
4943,
198,
220,
220,
220,
3601,
7203,
464,
649,
6376,
3084,
318,
25,
4... | 2.757576 | 66 |
import numpy as np
import pandas as pd
import torch
import torch.nn.functional as F
import torch.nn as nn
import torch.autograd as autograd
import torch.optim as optim
import sys
import argparse
import json
import multiprocessing
import os
import time
import logging
from pandas.api.types import is_object_dtype
LOG_FORM... | [
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
28034,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
11748,
28034,
13,
2306,
519,
6335,
355,
1960,
... | 2.53406 | 367 |
# coding=UTF-8
from storage import solr_url
import pysolr
import requests
# search intagram username in solr.
| [
2,
19617,
28,
48504,
12,
23,
198,
6738,
6143,
1330,
1540,
81,
62,
6371,
198,
11748,
279,
893,
349,
81,
198,
11748,
7007,
628,
198,
2,
2989,
493,
6713,
20579,
287,
1540,
81,
13,
628,
198
] | 3.166667 | 36 |
#!/home/users/lguo/anaconda2/bin/python
#BSUB -o %J.o
#BSUB -e %J.e
#BSUB -q short-serial
#BSUB -W 24:00
#BSUB -R "rusage[mem=16000]"
#BSUB -M 16000
import numpy as np
import scipy.io as sio
import calendar
from timeit import default_timer as timer
import os
from netCDF4 import Dataset
import datetime
import cf
import... | [
2,
48443,
11195,
14,
18417,
14,
75,
5162,
78,
14,
272,
330,
13533,
17,
14,
8800,
14,
29412,
198,
2,
4462,
10526,
532,
78,
4064,
41,
13,
78,
198,
2,
4462,
10526,
532,
68,
4064,
41,
13,
68,
198,
2,
4462,
10526,
532,
80,
1790,
12... | 2.179333 | 5,158 |
# Usage:
# mono ipy.exe this_script.py args1 args2 args3 ...
# Copyright (c) Hin-Tak Leung
# This script just writes the args out, for basic testing.
import sys
print __name__
if __name__ == '__main__':
i = 0
for arg in sys.argv:
print "arg%d: '%s'" % (i, arg)
i += 1
| [
2,
29566,
25,
198,
2,
220,
220,
220,
220,
33361,
20966,
88,
13,
13499,
428,
62,
12048,
13,
9078,
26498,
16,
26498,
17,
26498,
18,
2644,
198,
198,
2,
15069,
357,
66,
8,
29094,
12,
51,
461,
1004,
2150,
198,
198,
2,
770,
4226,
655,... | 2.29771 | 131 |
import pytest
from articlenizer import corrections
from articlenizer.util import apply_regex_list | [
11748,
12972,
9288,
198,
198,
6738,
17251,
11925,
7509,
1330,
26251,
198,
6738,
17251,
11925,
7509,
13,
22602,
1330,
4174,
62,
260,
25636,
62,
4868
] | 3.92 | 25 |
import os
import datetime
| [
11748,
28686,
198,
11748,
4818,
8079,
628,
198
] | 3.5 | 8 |
from rest_framework.views import APIView
from rest_framework.response import Response
class Collections(APIView):
"""Class for interacting with the Collections Database."""
| [
6738,
1334,
62,
30604,
13,
33571,
1330,
3486,
3824,
769,
198,
6738,
1334,
62,
30604,
13,
26209,
1330,
18261,
628,
198,
4871,
50004,
7,
2969,
3824,
769,
2599,
198,
220,
220,
220,
37227,
9487,
329,
24986,
351,
262,
50004,
24047,
526,
15... | 4.162791 | 43 |
import random
import warnings
from audiomentations.core.utils import (
is_waveform_multichannel,
is_spectrogram_multichannel,
)
| [
11748,
4738,
198,
11748,
14601,
198,
198,
6738,
2709,
29005,
298,
602,
13,
7295,
13,
26791,
1330,
357,
198,
220,
220,
220,
318,
62,
19204,
687,
62,
16680,
488,
4276,
11,
198,
220,
220,
220,
318,
62,
4443,
39529,
62,
16680,
488,
4276... | 2.897959 | 49 |
import os
import sys
import math
import fire
import json
from tqdm import tqdm
from math import floor, log2
from random import random
from shutil import rmtree
from functools import partial
import multiprocessing
from contextlib import contextmanager, ExitStack
import numpy as np
import torch
from torch import nn, e... | [
11748,
28686,
198,
11748,
25064,
198,
11748,
10688,
198,
11748,
2046,
198,
11748,
33918,
198,
198,
6738,
256,
80,
36020,
1330,
256,
80,
36020,
198,
6738,
10688,
1330,
4314,
11,
2604,
17,
198,
6738,
4738,
1330,
4738,
198,
6738,
4423,
346... | 3.115686 | 510 |
from django.apps import AppConfig
| [
6738,
42625,
14208,
13,
18211,
1330,
2034,
16934,
628
] | 3.888889 | 9 |
"""Wrapper for the function that returns the titles of the available datasets"""
import xls2csv_converter
if __name__ == "__main__":
main()
| [
37811,
36918,
2848,
329,
262,
2163,
326,
5860,
262,
8714,
286,
262,
1695,
40522,
37811,
198,
11748,
2124,
7278,
17,
40664,
62,
1102,
332,
353,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
1388... | 3.318182 | 44 |
#!/usr/bin/env python
# Copyright (c) 2022 SMHI, Swedish Meteorological and Hydrological Institute.
# License: MIT License (see LICENSE.txt or http://opensource.org/licenses/mit).
"""
Created on 2022-03-10 14:37
@author: johannes
"""
"""
Microservice Template: https://github.com/shark-microservices/microservice_templa... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
15069,
357,
66,
8,
33160,
9447,
25374,
11,
14023,
25582,
2770,
290,
15084,
3225,
30766,
5136,
13,
198,
2,
13789,
25,
17168,
13789,
357,
3826,
38559,
24290,
13,
14116,
393,
2638,
137... | 2.318519 | 675 |
#Alireza-Hajizadeh
#send whatsapp msg instantly in python
from WhatsAppmsg import sendwhats_image
from WhatsAppmsg import pg
number = input("Enter your number (+989999999999) : ")
media = input("send Media Images/Hello.png : ")
sendwhats_image("+910123456789", "")
wait_time: int = 1500
pg.press("enter") | [
2,
2348,
557,
4496,
12,
39,
1228,
528,
671,
71,
198,
2,
21280,
45038,
1324,
31456,
11101,
287,
21015,
220,
198,
6738,
37666,
19662,
1330,
3758,
1929,
1381,
62,
9060,
198,
6738,
37666,
19662,
1330,
23241,
198,
198,
17618,
796,
5128,
72... | 3.009804 | 102 |
root_path = None
telehash_conf_path = None
logging = {
'version': 1,
'disable_existing_loggers': True,
'formatters': {
'verbose': {
'format': '%(asctime)s - [%(levelname)s] %(filename)s[%(lineno)d]: %(message)s'
}
},
'handlers': {
'database': {
'clas... | [
198,
15763,
62,
6978,
796,
6045,
198,
46813,
17831,
62,
10414,
62,
6978,
796,
6045,
198,
198,
6404,
2667,
796,
1391,
198,
220,
220,
220,
705,
9641,
10354,
352,
11,
198,
220,
220,
220,
705,
40223,
62,
25687,
62,
6404,
5355,
10354,
64... | 1.849558 | 1,017 |
# config.py
eval_func = ''
num_objectives = 0
num_variables = 0
num_constraints = 0
population_size = 0
variable_min = []
variable_max = []
| [
2,
4566,
13,
9078,
198,
198,
18206,
62,
20786,
796,
10148,
198,
22510,
62,
15252,
1083,
796,
657,
198,
22510,
62,
25641,
2977,
796,
657,
198,
22510,
62,
1102,
2536,
6003,
796,
657,
198,
39748,
62,
7857,
796,
657,
198,
45286,
62,
108... | 2.698113 | 53 |
from PIL import Image, ImageDraw
image_plans = [f'{i:04b}' for i in range(16)]
images = [make_image(plan) for plan in image_plans]
if __name__ == '__main__':
for image in images:
image.save(f'img/{image.filename}')
| [
6738,
350,
4146,
1330,
7412,
11,
7412,
25302,
628,
198,
9060,
62,
489,
504,
796,
685,
69,
6,
90,
72,
25,
3023,
65,
92,
6,
329,
1312,
287,
2837,
7,
1433,
15437,
198,
198,
17566,
796,
685,
15883,
62,
9060,
7,
11578,
8,
329,
1410,
... | 2.431579 | 95 |
from django.apps import AppConfig
| [
6738,
42625,
14208,
13,
18211,
1330,
2034,
16934,
628
] | 3.888889 | 9 |
import numpy as np
from genetic.genetic_algorithm import run_on_function
from vis.ErrorVis import ErrorVis
from vis.draw import animate_solutions
if __name__ == "__main__":
dims = 2
n = 10
num_runs = 300
num_particles = 50
step_size = 0.1
func_name = "rastrigin"
# todo something is still b... | [
11748,
299,
32152,
355,
45941,
198,
198,
6738,
8513,
13,
5235,
5139,
62,
282,
42289,
1330,
1057,
62,
261,
62,
8818,
198,
6738,
1490,
13,
12331,
15854,
1330,
13047,
15854,
198,
6738,
1490,
13,
19334,
1330,
43828,
62,
82,
14191,
198,
19... | 2.407713 | 363 |
"""
Websockets client.
http://websockets.readthedocs.io/
"""
from typing import Any
from websockets import WebSocketCommonProtocol # type: ignore
from ..async_client import AsyncClient
from ..response import Response
| [
37811,
198,
1135,
1443,
11603,
5456,
13,
198,
198,
4023,
1378,
732,
1443,
11603,
13,
961,
83,
704,
420,
82,
13,
952,
14,
198,
37811,
198,
6738,
19720,
1330,
4377,
198,
198,
6738,
2639,
11603,
1330,
5313,
39105,
17227,
19703,
4668,
220... | 3.415385 | 65 |
import pytest
from .commands import check_themecreator
from ...ypackage.model.common import ConfigNotFoundError
| [
11748,
12972,
9288,
198,
198,
6738,
764,
9503,
1746,
1330,
2198,
62,
18855,
721,
630,
273,
198,
6738,
2644,
4464,
441,
496,
13,
19849,
13,
11321,
1330,
17056,
3673,
21077,
12331,
628,
628,
198
] | 3.441176 | 34 |
from rest_framework import permissions
class AnonymousPermission(permissions.BasePermission):
"""
Non Anonymous Users.
"""
message = "You are already registered. Please logout and try again."
class IsOwnerOrReadOnly(permissions.BasePermission):
"""
Object level permissions that only allow own... | [
6738,
1334,
62,
30604,
1330,
21627,
198,
198,
4871,
19200,
5990,
3411,
7,
525,
8481,
13,
14881,
5990,
3411,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
8504,
19200,
18987,
13,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
... | 3.572581 | 124 |
from __future__ import unicode_literals
from django.core.exceptions import FieldError
from django.test import TestCase
from django.utils import six
from .models import Author, Article
| [
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
6738,
42625,
14208,
13,
7295,
13,
1069,
11755,
1330,
7663,
12331,
198,
6738,
42625,
14208,
13,
9288,
1330,
6208,
20448,
198,
6738,
42625,
14208,
13,
26791,
1330,
2237,
... | 3.74 | 50 |
"""
Module contains tasks to be executed asynchronously by Celery worker nodes.
"""
from celery import shared_task
from celery.utils.log import get_task_logger
from django.contrib.auth import get_user_model
from django.urls import reverse
from django.utils.translation import gettext as _
from edd.notify.backend impor... | [
37811,
198,
26796,
4909,
8861,
284,
307,
10945,
355,
24871,
3481,
416,
15248,
1924,
8383,
13760,
13,
198,
37811,
198,
198,
6738,
18725,
1924,
1330,
4888,
62,
35943,
198,
6738,
18725,
1924,
13,
26791,
13,
6404,
1330,
651,
62,
35943,
62,
... | 2.488984 | 1,634 |
"""
MIT License
Copyright (c) 2022 nmrr (https://github.com/nmrr)
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 restriction, including without limitation the rights
to use, copy, modify... | [
37811,
198,
36393,
13789,
198,
198,
15269,
357,
66,
8,
33160,
28642,
21062,
357,
5450,
1378,
12567,
13,
785,
14,
21533,
21062,
8,
198,
198,
5990,
3411,
318,
29376,
7520,
11,
1479,
286,
3877,
11,
284,
597,
1048,
16727,
257,
4866,
198,
... | 2.513774 | 2,287 |
import numpy
from dstev import dstev
from scipy import linalg
info = 0
alpha = numpy.array([1,2,3,4,5,6], dtype=float)
sigma = numpy.array([5,4,3,2,1], dtype=float)
workspace = numpy.zeros(len(alpha)*2, dtype=float)
z = numpy.zeros((len(alpha), len(alpha)),dtype=float)
#print workspace
print alpha
print sigma
pyz = ... | [
198,
11748,
299,
32152,
198,
6738,
29636,
1990,
1330,
29636,
1990,
198,
6738,
629,
541,
88,
1330,
300,
1292,
70,
198,
198,
10951,
796,
657,
198,
26591,
796,
299,
32152,
13,
18747,
26933,
16,
11,
17,
11,
18,
11,
19,
11,
20,
11,
21,... | 2.156499 | 377 |
# -*- coding: utf-8 -*-
from __future__ import print_function
import os
import click
import threading
import math
import sys
import re
from os.path import relpath, abspath, join, isdir, dirname
from glob import glob
from itertools import chain
from twccli.twccli import pass_environment, logger
from twccli.twcc.services... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
11748,
28686,
198,
11748,
3904,
198,
11748,
4704,
278,
198,
11748,
10688,
198,
11748,
25064,
198,
11748,
302,
198,
6738... | 2.81382 | 521 |
import torchvision.models as models
from torch.nn import Parameter
import torch
import torch.nn as nn
import math
import numpy as np
import pandas as pd
class GraphConvolution(nn.Module):
"""
Simple GCN layer, similar to https://arxiv.org/abs/1609.02907
"""
| [
11748,
28034,
10178,
13,
27530,
355,
4981,
198,
6738,
28034,
13,
20471,
1330,
25139,
2357,
198,
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
11748,
10688,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
... | 2.978261 | 92 |
import os
import random
import cherrypy
if __name__ == "__main__":
server = Battlesnake()
cherrypy.config.update({"server.socket_host": "0.0.0.0"})
cherrypy.config.update(
{"server.socket_port": int(os.environ.get("PORT", "8080")),}
)
print("Starting Battlesnake Server...")
cherrypy.qu... | [
11748,
28686,
198,
11748,
4738,
198,
11748,
23612,
9078,
628,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
4382,
796,
25467,
77,
539,
3419,
198,
220,
220,
220,
23612,
9078,
13,
11250,
13,
19119,
7,... | 2.533835 | 133 |
#!/usr/bin/python3
import cgitb
import os
import random
from http import cookies
from geetest import GeetestLib
# 获取极验验证 id 和 key,同时生成一个随机用户 id,防止缓存
captcha_id = os.getenv('GEETEST_ID')
private_key = os.getenv('GEETEST_KEY')
user_id = random.randint(1, 1000)
if __name__ == '__main__':
# 启用 cgi 的错误提示机制,更容易排错
... | [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
11748,
269,
18300,
65,
198,
11748,
28686,
198,
11748,
4738,
198,
6738,
2638,
1330,
14746,
198,
198,
6738,
4903,
316,
395,
1330,
2269,
316,
395,
25835,
198,
198,
2,
5525,
236,
115,
20998,
... | 1.535714 | 504 |
"""
.. currentmodule:: flytekitplugins.great_expectations
This package contains things that are useful when extending Flytekit.
.. autosummary::
:template: custom.rst
:toctree: generated/
BatchRequestConfig
GreatExpectationsFlyteConfig
GreatExpectationsTask
GreatExpectationsType
"""
from .schema i... | [
37811,
198,
492,
1459,
21412,
3712,
6129,
660,
15813,
37390,
13,
18223,
62,
1069,
806,
602,
198,
198,
1212,
5301,
4909,
1243,
326,
389,
4465,
618,
16610,
13575,
660,
15813,
13,
198,
198,
492,
44619,
388,
6874,
3712,
198,
220,
220,
105... | 3.258741 | 143 |
import asyncio
import logging
import sys
import traceback
from pathlib import Path
import cv2
import pigpio
from games.ninswitch.config import RESET_TRINKET_EACH_LOOP
from games.ninswitch.ns_dpad_switch import NSDPadSwitch
from games.ninswitch.ns_gamepad_serial import NSButton, NSDPad, NSGamepadSerial
from games.nins... | [
11748,
30351,
952,
198,
11748,
18931,
198,
11748,
25064,
198,
11748,
12854,
1891,
198,
6738,
3108,
8019,
1330,
10644,
198,
198,
11748,
269,
85,
17,
198,
11748,
12967,
79,
952,
198,
198,
6738,
1830,
13,
77,
1040,
42248,
13,
11250,
1330,
... | 2.240969 | 2,270 |
"""
1. Clarification
2. Possible solutions
- Heap
- Bucket Sort
- Quickselect (Hoare's selection algorithm)
3. Coding
4. Tests
"""
# T=O(nlgk), S=O(n+k)
# T=O(n), S=O(n)
# T=O(n), S=O(n)
| [
37811,
198,
16,
13,
15420,
2649,
198,
17,
13,
33671,
8136,
198,
220,
220,
220,
532,
679,
499,
198,
220,
220,
220,
532,
48353,
33947,
198,
220,
220,
220,
532,
12029,
19738,
357,
28900,
533,
338,
6356,
11862,
8,
198,
18,
13,
327,
76... | 2.05 | 100 |
# coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
int_or_none,
xpath_element,
xpath_text,
)
| [
2,
19617,
25,
3384,
69,
12,
23,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
11748,
302,
198,
198,
6738,
764,
11321,
1330,
14151,
11627,
40450,
198,
6738,
11485,
26791,
1330,
357,
198,
220,
220,
220,
493,... | 2.623188 | 69 |
import numpy as np
from abc import abstractmethod
import pandas as pd
from os.path import join as opjoin
from paths import annos_path, src_path
from utils.dicom_utils import world2vox, load_mhd
import os
label_coordinates = pd.read_csv(annos_path)
| [
11748,
299,
32152,
355,
45941,
198,
6738,
450,
66,
1330,
12531,
24396,
198,
11748,
19798,
292,
355,
279,
67,
198,
6738,
28686,
13,
6978,
1330,
4654,
355,
1034,
22179,
198,
6738,
13532,
1330,
1529,
418,
62,
6978,
11,
12351,
62,
6978,
1... | 2.942529 | 87 |
# -*- coding: utf-8 -*-
# Модуль переменных таблицы параметров "Режим" RastrWin3
class ComRegim:
"""
"""
table: str = 'com_regim'
table_name: str = '"Режим"'
neb_p: str = 'neb_p' # Точность расчета (dP)
it_max: str = 'it_max' # Максимальное число итераций (It)
start: str = 'start' # Ст... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
12466,
250,
25443,
112,
35072,
30143,
45367,
12466,
123,
16843,
21169,
16843,
43108,
16843,
22177,
22177,
45035,
141,
227,
220,
20375,
16142,
140,
109,
30143,
18849,
141,... | 1.253333 | 2,925 |
from flask import Blueprint
message_bp = Blueprint('message', __name__)
from . import views | [
6738,
42903,
1330,
39932,
198,
198,
20500,
62,
46583,
796,
39932,
10786,
20500,
3256,
11593,
3672,
834,
8,
198,
198,
6738,
764,
1330,
5009
] | 3.875 | 24 |
suffixes = ('KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB')
| [
37333,
844,
274,
796,
19203,
22764,
3256,
705,
10744,
3256,
705,
4579,
3256,
705,
22737,
3256,
705,
49079,
3256,
705,
30195,
3256,
705,
57,
33,
3256,
705,
56,
33,
11537,
198
] | 1.935484 | 31 |