content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
import torch
import numpy as np
import torch.nn.functional as F
import cv2
if __name__ == '__main__':
from bbox_model.kpda_parser import KPDA
import cv2
from bbox_model.config import Config
import numpy as np
config = Config('whale')
# db_path = '/home/storage/lsy/fashion/FashionAI_Keypoint_D... | [
11748,
28034,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
198,
11748,
269,
85,
17,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
422,
275,
3524,... | 2.219753 | 405 |
#if 0 /*
# -----------------------------------------------------------------------
# vcdinfo.py - parse vcd track informations
# -----------------------------------------------------------------------
# $Id: vcdinfo.py,v 1.8 2004/06/25 13:20:35 dischi Exp $
#
# $Log: vcdinfo.py,v $
# Revision 1.8 2004/06/25 13:20:35 ... | [
2,
361,
657,
11900,
198,
2,
16529,
26866,
198,
2,
410,
10210,
10951,
13,
9078,
532,
21136,
410,
10210,
2610,
4175,
602,
198,
2,
16529,
26866,
198,
2,
720,
7390,
25,
410,
10210,
10951,
13,
9078,
11,
85,
352,
13,
23,
5472,
14,
3312,... | 3.582721 | 544 |
import os
from typing import List
from fastapi import FastAPI, File, UploadFile
from fastapi.responses import HTMLResponse
from fastapi import Request
from fastapi.staticfiles import StaticFiles
from fastapi.templating import Jinja2Templates
app = FastAPI()
app.mount("/static", StaticFiles(directory="static"), nam... | [
11748,
28686,
198,
6738,
19720,
1330,
7343,
198,
198,
6738,
3049,
15042,
1330,
12549,
17614,
11,
9220,
11,
36803,
8979,
198,
6738,
3049,
15042,
13,
16733,
274,
1330,
11532,
31077,
198,
198,
6738,
3049,
15042,
1330,
19390,
198,
6738,
3049,... | 3.156977 | 172 |
import certifi
import urllib3
import asyncio
import aiohttp
import ipaddress
import time
from connection import Connection
from bencode import Parser
from torrent import Torrent
from block import Piece, Block
if __name__ == "__main__":
path = './test/ubuntu-20.10-desktop-amd64.iso.torrent'
torrent = To... | [
11748,
5051,
22238,
198,
11748,
2956,
297,
571,
18,
198,
11748,
30351,
952,
198,
11748,
257,
952,
4023,
198,
11748,
20966,
21975,
198,
11748,
640,
198,
6738,
4637,
1330,
26923,
198,
6738,
1888,
8189,
1330,
23042,
263,
198,
6738,
24458,
... | 2.927711 | 166 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.tools import pycompat
from odoo.tools import mute_logger
from odoo.tools.translate import quote, unquote, xml_translate, html_translate
from odoo.tests.common import TransactionCase, BaseCase
from psycopg2 impor... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2142,
286,
10529,
2238,
13,
4091,
38559,
24290,
2393,
329,
1336,
6634,
290,
15665,
3307,
13,
198,
6738,
16298,
2238,
13,
31391,
1330,
12972,
5589,
265,
198,
6738,
162... | 3.366337 | 101 |
import copy
import typing
from slender import List
KT = typing.TypeVar('KT')
VT = typing.TypeVar('VT')
| [
198,
11748,
4866,
198,
11748,
19720,
198,
198,
6738,
36808,
1330,
7343,
198,
198,
42176,
796,
19720,
13,
6030,
19852,
10786,
42176,
11537,
198,
36392,
796,
19720,
13,
6030,
19852,
10786,
36392,
11537,
198,
220,
220,
220,
220,
198,
220,
... | 2.537037 | 54 |
# uncompyle6 version 3.2.0
# Python bytecode 2.4 (62061)
# Decompiled from: Python 2.7.14 (v2.7.14:84471935ed, Sep 16 2017, 20:19:30) [MSC v.1500 32 bit (Intel)]
# Embedded file name: pirates.ship.ShipGlobals
from pandac.PandaModules import *
from direct.showbase.PythonUtil import Enum
from pirates.uberdog.UberDogGloba... | [
2,
34318,
2349,
21,
2196,
513,
13,
17,
13,
15,
198,
2,
11361,
18022,
8189,
362,
13,
19,
357,
38850,
5333,
8,
198,
2,
4280,
3361,
3902,
422,
25,
11361,
362,
13,
22,
13,
1415,
357,
85,
17,
13,
22,
13,
1415,
25,
23,
34825,
1129,
... | 2.395889 | 40,231 |
import pytest
from nadypy.api.system import get_sysinfo
from nadypy.api.webserver import post_chat_web
from nadypy.client import BasicAuthClient, SignedAuthClient
from nadypy.models.system_information import SystemInformation
@pytest.fixture
@pytest.fixture
@pytest.mark.asyncio
@pytest.mark.asyncio
| [
11748,
12972,
9288,
198,
198,
6738,
299,
324,
4464,
88,
13,
15042,
13,
10057,
1330,
651,
62,
17597,
10951,
198,
6738,
299,
324,
4464,
88,
13,
15042,
13,
732,
1443,
18497,
1330,
1281,
62,
17006,
62,
12384,
198,
6738,
299,
324,
4464,
... | 2.897196 | 107 |
price = [100, 180, 260, 310, 40, 535, 695]
stockAndBySell(price) | [
198,
198,
20888,
796,
685,
3064,
11,
11546,
11,
21148,
11,
28947,
11,
2319,
11,
642,
2327,
11,
718,
3865,
60,
198,
13578,
1870,
3886,
50,
695,
7,
20888,
8
] | 2.2 | 30 |
from flask import Flask, render_template, Blueprint, flash
from flask_bootstrap import Bootstrap
from flask_moment import Moment
from flask_wtf import FlaskForm
from wtforms import StringField, SubmitField, SelectField
from wtforms.validators import DataRequired
from workshops_model import *
from users_model import *
... | [
6738,
42903,
1330,
46947,
11,
8543,
62,
28243,
11,
39932,
11,
7644,
198,
6738,
42903,
62,
18769,
26418,
1330,
18892,
26418,
198,
6738,
42903,
62,
32542,
298,
1330,
29278,
198,
6738,
42903,
62,
86,
27110,
1330,
46947,
8479,
198,
6738,
26... | 2.975709 | 247 |
from asyncio import Event, get_event_loop
| [
6738,
30351,
952,
1330,
8558,
11,
651,
62,
15596,
62,
26268,
628
] | 3.583333 | 12 |
#!/usr/bin/python
import cwiid
import sys
import gevent
import time
import json
import datetime
import atexit
from collections import OrderedDict
import random
from dotstar import Adafruit_DotStar
import socket
import alsaaudio
import wave
import sys
import struct
import math
WHOAMI = socket.gethostname()
import RP... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
11748,
269,
37686,
312,
198,
11748,
25064,
198,
11748,
4903,
1151,
198,
11748,
640,
198,
11748,
33918,
198,
11748,
4818,
8079,
198,
11748,
379,
37023,
198,
6738,
17268,
1330,
14230,
1068,
35,
7... | 2.539546 | 1,277 |
#!/usr/bin/env python
import unittest
from binomial_heap import Node
from binomial_heap import Tree, insert
from binomial_heap import Heap
unittest.main()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
11748,
555,
715,
395,
198,
6738,
9874,
49070,
62,
258,
499,
1330,
19081,
198,
6738,
9874,
49070,
62,
258,
499,
1330,
12200,
11,
7550,
198,
6738,
9874,
49070,
62,
258,
499,
1330,
679,
... | 2.929825 | 57 |
from battalion_processor import BattalionProcessor
from battalion_types import BattalionType
from battle_planner import BattlePlanner
from army import Army
from copy import deepcopy
| [
6738,
36328,
62,
41341,
1330,
29887,
18709,
273,
198,
6738,
36328,
62,
19199,
1330,
29887,
6030,
198,
6738,
3344,
62,
11578,
1008,
1330,
5838,
20854,
1008,
198,
6738,
5428,
1330,
5407,
198,
6738,
4866,
1330,
2769,
30073,
628,
220,
220,
... | 2.959459 | 74 |
import os
import uuid
from server.utils import get_colors_colortheif
def get_colors_gen_css(filename: str, joiner: str, ex_colors=[], ex_uid=None):
"""
Pass filename, joiner, existing_colors, existing_uid
"""
temp_dir = os.path.abspath('server/tmp/')
file = os.path.abspath(f"server/img/{filename}... | [
11748,
28686,
198,
11748,
334,
27112,
198,
198,
6738,
4382,
13,
26791,
1330,
651,
62,
4033,
669,
62,
4033,
419,
258,
361,
198,
198,
4299,
651,
62,
4033,
669,
62,
5235,
62,
25471,
7,
34345,
25,
965,
11,
4654,
263,
25,
965,
11,
409,... | 2.229282 | 362 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from faker import Faker # pour créer de faux noms, adresses,...
from random import * # pour des générateurs de nombres pseudo-aléatoires
import csv # pour parcourir des fichiers csv
from pathlib 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,
198,
6738,
277,
3110,
1330,
376,
3110,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
22... | 2.116935 | 248 |
from .model import Model, load
from .model_base import Optimizer
__all__ = [
"Model",
"Optimizer",
"load",
]
| [
6738,
764,
19849,
1330,
9104,
11,
3440,
198,
6738,
764,
19849,
62,
8692,
1330,
30011,
7509,
198,
198,
834,
439,
834,
796,
685,
198,
220,
220,
220,
366,
17633,
1600,
198,
220,
220,
220,
366,
27871,
320,
7509,
1600,
198,
220,
220,
220... | 2.489796 | 49 |
from ryven.NENV import *
widgets = import_widgets(__file__)
import numpy as np
class ShowMatrix(MatrixNodeBase):
"""Displays a matrix"""
title = 'Show Matrix'
# ------------------------------------------------------------------------------
class Matrix_Node(Node):
"""Evaluates a matrix"""
title ... | [
6738,
374,
88,
574,
13,
45,
1677,
53,
1330,
1635,
198,
28029,
11407,
796,
1330,
62,
28029,
11407,
7,
834,
7753,
834,
8,
198,
198,
11748,
299,
32152,
355,
45941,
628,
198,
198,
4871,
5438,
46912,
7,
46912,
19667,
14881,
2599,
198,
22... | 2.580923 | 1,279 |
from django.db import models
# Create your models here. | [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
198,
2,
13610,
534,
4981,
994,
13
] | 3.733333 | 15 |
import re
f = open('input.txt')
east = 0
north = 0
waypoint = {'east': 10, 'north': 1}
for line in f:
m = re.match(r'([S|W|E|N|F|R|L]{1})(\d+)', line[:-1])
instruction = (m.group(1), int(m.group(2)))
if instruction[0] == 'F':
update_location(instruction[1])
elif instruction[0] == 'R':
... | [
11748,
302,
198,
198,
69,
796,
1280,
10786,
15414,
13,
14116,
11537,
198,
198,
23316,
796,
657,
198,
43588,
796,
657,
198,
1014,
4122,
796,
1391,
6,
23316,
10354,
838,
11,
220,
705,
43588,
10354,
352,
92,
198,
198,
1640,
1627,
287,
... | 2.15404 | 396 |
from __future__ import print_function
if __name__ == '__main__':
xs = [1, 2, 3]
if 2 in xs:
print("YES")
else:
print("NO")
if cond1() and cond2():
print("YES")
else:
print("NO")
| [
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
628,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
2124,
82,
796,
685,
16,
11,
362,
11,
513,
60,
198,
220,
220,
220,
611,
362,
287,
2124,
82,... | 1.991525 | 118 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Project: Fable Input Output
# https://github.com/silx-kit/fabio
#
# Copyright (C) European Synchrotron Radiation Facility, Grenoble, France
#
# Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)
#
# This program is free software: you... | [
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,
220,
220,
220,
4935,
25,
376,
540,
23412,
25235,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
220,
... | 2.608187 | 684 |
num = cont = soma = igual = maior = menor = 0
r = 'a'
while r != 'N':
num = int(input('Digite um número: '))
igual = num
soma += num
cont += 1
if cont == 1:
maior = menor = num
else:
if num > maior:
maior = num
elif num < menor:
menor = num
r =... | [
22510,
796,
542,
796,
3870,
64,
796,
45329,
723,
796,
17266,
1504,
796,
1450,
273,
796,
657,
198,
81,
796,
705,
64,
6,
198,
4514,
374,
14512,
705,
45,
10354,
198,
220,
220,
220,
997,
796,
493,
7,
15414,
10786,
19511,
578,
23781,
2... | 2.102128 | 235 |
from src.creator.creator import Creator
from src.creator.luogu_creator import LuoguProblemCreator
problem_map = {
"luogu": LuoguProblemCreator
}
| [
6738,
12351,
13,
45382,
13,
45382,
1330,
21038,
198,
6738,
12351,
13,
45382,
13,
2290,
519,
84,
62,
45382,
1330,
6026,
519,
84,
40781,
16719,
273,
198,
198,
45573,
62,
8899,
796,
1391,
198,
220,
220,
220,
366,
2290,
519,
84,
1298,
6... | 2.941176 | 51 |
import inspect
from typing import Optional
from solo.server.definitions import HttpMethod
from . import predicates as default_predicates
from ..util import viewdefaults
from .routes import ViewMeta
from .util import PredicateList
from ..exceptions import ConfigurationError
from solo.server.app import App
| [
11748,
10104,
198,
6738,
19720,
1330,
32233,
198,
198,
6738,
12199,
13,
15388,
13,
4299,
50101,
1330,
367,
29281,
17410,
198,
6738,
764,
1330,
2747,
16856,
355,
4277,
62,
28764,
16856,
198,
6738,
11485,
22602,
1330,
1570,
12286,
82,
198,
... | 4.148649 | 74 |
import base64
import json
from typing import Any, ByteString, Iterable, Optional, Tuple
import aiowamp
from aiowamp import SerializerABC, build_message_from_list
__all__ = ["JSONSerializer", "JSONDecoder", "JSONEncoder"]
class JSONSerializer(SerializerABC):
"""Serializer for the JSON format.
Provides a cus... | [
11748,
2779,
2414,
198,
11748,
33918,
198,
6738,
19720,
1330,
4377,
11,
30589,
10100,
11,
40806,
540,
11,
32233,
11,
309,
29291,
198,
198,
11748,
257,
72,
322,
696,
198,
6738,
257,
72,
322,
696,
1330,
23283,
7509,
24694,
11,
1382,
62,... | 2.430667 | 1,500 |
# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack.package import *
class RSessioninfo(RPackage):
"""R Session Information.
Query and print information... | [
2,
15069,
2211,
12,
1238,
1828,
13914,
45036,
3549,
2351,
4765,
11,
11419,
290,
584,
198,
2,
1338,
441,
4935,
34152,
13,
4091,
262,
1353,
12,
5715,
27975,
38162,
9947,
2393,
329,
3307,
13,
198,
2,
198,
2,
30628,
55,
12,
34156,
12,
... | 2.552279 | 373 |
"""Interface for the Database updater thread."""
# Local imports
import crawler.communication as communication
def shutdown() -> None:
"""Shutdown the database updater thread."""
command = communication.Command(
command=communication.DATABASE_UPDATER_SHUTDOWN,
data=None
)
communicati... | [
37811,
39317,
329,
262,
24047,
2325,
729,
4704,
526,
15931,
628,
198,
2,
10714,
17944,
198,
11748,
27784,
1754,
13,
32560,
355,
6946,
628,
198,
4299,
18325,
3419,
4613,
6045,
25,
198,
220,
220,
220,
37227,
39079,
2902,
262,
6831,
2325,
... | 3.121739 | 115 |
from core.advbase import *
from module.template import SigilAdv
variants = {None: Pinon}
| [
6738,
4755,
13,
32225,
8692,
1330,
1635,
198,
6738,
8265,
13,
28243,
1330,
21984,
346,
22856,
198,
198,
25641,
1187,
796,
1391,
14202,
25,
13727,
261,
92,
198
] | 3.214286 | 28 |
# coding=utf-8
| [
2,
19617,
28,
40477,
12,
23,
198
] | 2.142857 | 7 |
import datetime
import requests
import re
import json
class Buro(metaclass=Meta):
"""
Base interface-like class for all departments providing appointments on ...muenchen.de/termin/index.php... page
"""
appointment_types = None
appointment_type_date = None
@classmethod
def get_available... | [
11748,
4818,
8079,
198,
198,
11748,
7007,
198,
11748,
302,
198,
11748,
33918,
628,
198,
198,
4871,
347,
1434,
7,
4164,
330,
31172,
28,
48526,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
7308,
7071,
12,
2339,
1398,
329,
477,
... | 2.441413 | 1,869 |
###############################################################################################################################
# This script implements our Prior-guided Bayesian Optimization method, presented in: https://arxiv.org/abs/1805.12168. #
################################################################... | [
29113,
29113,
29113,
14468,
7804,
4242,
21017,
198,
2,
770,
4226,
23986,
674,
14481,
12,
23657,
4696,
35610,
30011,
1634,
2446,
11,
5545,
287,
25,
3740,
1378,
283,
87,
452,
13,
2398,
14,
8937,
14,
1507,
2713,
13,
1065,
14656,
13,
220,... | 2.536888 | 6,696 |
# Generated by Django 2.1.11 on 2019-08-15 06:58
import ct.models
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
362,
13,
16,
13,
1157,
319,
13130,
12,
2919,
12,
1314,
9130,
25,
3365,
198,
198,
11748,
269,
83,
13,
27530,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.868421 | 38 |
import unittest
| [
11748,
555,
715,
395,
628
] | 3.4 | 5 |
# -*- coding: utf-8 -*-
"""
Created on Wed Jan 10 14:30:07 2018
@author: Nzix
"""
with open('member.txt', 'r', encoding = 'utf-8') as f: data = f.readlines()
sql = ''
for line in data:
line = line.replace('\n', '')
if not line: continue
if line.startswith('#'): continue
id, name, furigana, romaji =... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
3300,
2365,
838,
1478,
25,
1270,
25,
2998,
2864,
198,
198,
31,
9800,
25,
399,
89,
844,
198,
37811,
198,
198,
4480,
1280,
10786,
19522,
13,
1411... | 2.426606 | 218 |
from PyQt5 import QtGui
from pathlib import Path
import datetime | [
6738,
9485,
48,
83,
20,
1330,
33734,
8205,
72,
198,
6738,
3108,
8019,
1330,
10644,
198,
11748,
4818,
8079
] | 3.368421 | 19 |
#!usr/bin/env python
# coding=utf-8
# Author: zhezhiyong@163.com
# Created: 2016-03-09 09:11:10
# Python version:2.7.10
"""
# TODO(purpose):
"""
import uuid
import time
# 操作 etf代码 成份股代码
print uuid.uuid1(01510300000001)
print uuid.uuid1(01510300000001)
print uuid.uuid1(01510300000001)
# 10 1000 5 1000 6 1000
# 9.5... | [
2,
0,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
19617,
28,
40477,
12,
23,
198,
2,
6434,
25,
1976,
258,
89,
5303,
88,
506,
31,
24136,
13,
785,
198,
2,
15622,
25,
1584,
12,
3070,
12,
2931,
7769,
25,
1157,
25,
940,
198,
2,
11361... | 1.994565 | 368 |
"""Plot capacity factors."""
import os
from operator import itemgetter
import textwrap
import datetime
import yaml
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.cm as cm
from matplotlib.dates import date2num
import matplotlib.dates as mdates
import matplotlib.patches as mpatches
from matplotlib... | [
37811,
43328,
5339,
5087,
526,
15931,
198,
198,
11748,
28686,
198,
6738,
10088,
1330,
2378,
1136,
353,
198,
11748,
2420,
37150,
198,
11748,
4818,
8079,
198,
198,
11748,
331,
43695,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
294... | 2.726563 | 256 |
# -*- coding: ascii -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import logging
from itertools import groupby
from lxml import etree
from odoo import api, fields, models
from odoo import tools
from odoo.addons.website.models import website
from odoo.http import request
_logger = lo... | [
2,
532,
9,
12,
19617,
25,
355,
979,
72,
532,
9,
12,
198,
2,
2142,
286,
10529,
2238,
13,
4091,
38559,
24290,
2393,
329,
1336,
6634,
290,
15665,
3307,
13,
198,
198,
11748,
18931,
198,
6738,
340,
861,
10141,
1330,
1448,
1525,
198,
67... | 3.304762 | 105 |
#☆𝒐𝒎𝒂𝒋𝒊𝒏𝒂𝒊☆#
import sys
import math
from math import ceil, floor
import itertools
from functools import lru_cache
from collections import deque
inf=10**20
sys.setrecursionlimit(10000000)
input=lambda : sys.stdin.readline().rstrip()
'''''✂'''''''''''''''''''''''''''''''''''''''''''''''''''''''''
a,b,c=map(int,i... | [
2,
35283,
47728,
240,
238,
47728,
240,
236,
47728,
240,
224,
47728,
240,
233,
47728,
240,
232,
47728,
240,
237,
47728,
240,
224,
47728,
240,
232,
35283,
2,
198,
11748,
25064,
198,
11748,
10688,
198,
6738,
10688,
1330,
2906,
346,
11,
4... | 2.247525 | 202 |
import pickle
import numpy as np
from keras.preprocessing.sequence import pad_sequences
from keras import Sequential
from keras_contrib.layers import CRF
from keras.layers import Embedding ,Bidirectional,LSTM
from keras.models import load_model
BATCH_SIZE = 32
MODEL_PATH = "./model/crf.h5"
# 训练后保存模型 | [
11748,
2298,
293,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
41927,
292,
13,
3866,
36948,
13,
43167,
1330,
14841,
62,
3107,
3007,
198,
6738,
41927,
292,
1330,
24604,
1843,
198,
6738,
41927,
292,
62,
3642,
822,
13,
75,
6962,
1330,
... | 2.55 | 120 |
from __future__ import annotations
import asyncio
from typing import Protocol
from fastapi import APIRouter, status
from fastapi.responses import JSONResponse, Response
class Healther(Protocol):
"""Any object implementing ^ can be checked for health status"""
class HealthCheckService(Protocol):
"""
De... | [
6738,
11593,
37443,
834,
1330,
37647,
198,
198,
11748,
30351,
952,
198,
6738,
19720,
1330,
20497,
198,
198,
6738,
3049,
15042,
1330,
3486,
4663,
39605,
11,
3722,
198,
6738,
3049,
15042,
13,
16733,
274,
1330,
19449,
31077,
11,
18261,
628,
... | 3.138554 | 498 |
# Standard lib imports
from sys import argv
import os
from time import sleep
import re
import pdb
import logging
import datetime
import csv
import json
from collections import defaultdict
# Third-party imports
import pandas as pd
import requests
from selenium import webdriver
from selenium.webdriver.support.ui import ... | [
2,
8997,
9195,
17944,
198,
6738,
25064,
1330,
1822,
85,
198,
11748,
28686,
198,
6738,
640,
1330,
3993,
198,
11748,
302,
198,
11748,
279,
9945,
198,
11748,
18931,
198,
11748,
4818,
8079,
198,
11748,
269,
21370,
198,
11748,
33918,
198,
67... | 2.252878 | 7,209 |
from datetime import timedelta
from unittest.mock import patch
from django.core.files.uploadedfile import SimpleUploadedFile
@patch('django.core.files.storage.FileSystemStorage.save')
@patch('django.core.files.storage.FileSystemStorage.save')
@patch('django.core.files.storage.FileSystemStorage.sav... | [
6738,
4818,
8079,
1330,
28805,
12514,
198,
6738,
555,
715,
395,
13,
76,
735,
1330,
8529,
198,
198,
6738,
42625,
14208,
13,
7295,
13,
16624,
13,
25850,
276,
7753,
1330,
17427,
41592,
276,
8979,
628,
628,
628,
628,
628,
628,
628,
628,
... | 3.035088 | 114 |
import pickle
from collections import defaultdict
from nltk.tokenize import word_tokenize
import time
import sys
import os
import operator
import preprocessing.config as config
import preprocessing.util as util
# TODO delete this one, no longer usefull since there is another one that also handles the conflicts
def t... | [
11748,
2298,
293,
198,
6738,
17268,
1330,
4277,
11600,
198,
6738,
299,
2528,
74,
13,
30001,
1096,
1330,
1573,
62,
30001,
1096,
198,
11748,
640,
198,
11748,
25064,
198,
11748,
28686,
198,
11748,
10088,
198,
198,
11748,
662,
36948,
13,
11... | 2.009615 | 2,392 |
import logging
import os
import random
import signal
import subprocess
import time
from parsl.executors.errors import *
from parsl.utils import RepresentationMixin
logger = logging.getLogger(__name__)
class Controller(RepresentationMixin):
"""Start and maintain a IPythonParallel controller.
Parameters
... | [
11748,
18931,
198,
11748,
28686,
198,
11748,
4738,
198,
11748,
6737,
198,
11748,
850,
14681,
198,
11748,
640,
198,
198,
6738,
13544,
75,
13,
18558,
315,
669,
13,
48277,
1330,
1635,
198,
6738,
13544,
75,
13,
26791,
1330,
10858,
341,
3560... | 2.270866 | 2,588 |
from clld.web.assets import environment
from clldutils.path import Path
import lexirumah
environment.append_path(
Path(lexirumah.__file__).parent.joinpath('static').as_posix(), url='/lexirumah:static/')
environment.load_path = list(reversed(environment.load_path))
| [
6738,
269,
297,
67,
13,
12384,
13,
19668,
1330,
2858,
198,
6738,
269,
297,
67,
26791,
13,
6978,
1330,
10644,
198,
198,
11748,
31191,
343,
388,
993,
628,
198,
38986,
13,
33295,
62,
6978,
7,
198,
220,
220,
220,
10644,
7,
2588,
343,
... | 2.924731 | 93 |
# -*- coding: utf-8 -*-
"""WEASEL+MUSE classifier.
multivariate dictionary based classifier based on SFA transform, dictionaries
and logistic regression.
"""
__author__ = ["patrickzib", "BINAYKUMAR943"]
__all__ = ["MUSE"]
import math
import warnings
import numpy as np
from numba import njit
from sklearn.feature_ext... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
8845,
1921,
3698,
10,
44,
19108,
1398,
7483,
13,
198,
198,
16680,
42524,
22155,
1912,
1398,
7483,
1912,
319,
311,
7708,
6121,
11,
48589,
3166,
198,
392,
2604,
256... | 2.17352 | 4,645 |
import graphistry, os, pandas as pd, streamlit as st
from components import GraphistrySt, URLParam
from graphistry import PyGraphistry
from css import all_css
from time import sleep
from util import getChild
############################################
#
# DASHBOARD SETTINGS
#
#######################################... | [
11748,
4823,
4592,
11,
28686,
11,
19798,
292,
355,
279,
67,
11,
4269,
18250,
355,
336,
198,
6738,
6805,
1330,
29681,
4592,
1273,
11,
10289,
22973,
198,
6738,
4823,
4592,
1330,
9485,
37065,
4592,
198,
6738,
269,
824,
1330,
477,
62,
254... | 4.160665 | 361 |
#
# DRAGONS
#
# cal_service
# ------------------------------------------------------------------------------
from os import path
import warnings
from importlib import import_module
... | [
2,
198,
2,
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,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
... | 2.370327 | 2,568 |
# test builtin property
# create a property object explicitly
property()
property(1, 2, 3)
# use its accessor methods
p = property()
p.getter(1)
p.setter(2)
p.deleter(3)
# basic use as a decorator
a = A(1)
print(a.x)
try:
a.x = 2
except AttributeError:
print("AttributeError")
# explicit use within a class... | [
2,
1332,
3170,
259,
3119,
198,
198,
2,
2251,
257,
3119,
2134,
11777,
198,
26745,
3419,
198,
26745,
7,
16,
11,
362,
11,
513,
8,
198,
198,
2,
779,
663,
1895,
273,
5050,
198,
79,
796,
3119,
3419,
198,
79,
13,
1136,
353,
7,
16,
8,... | 2.436893 | 309 |
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
# Copyright 2019 The Prescience-Client Authors. All rights reserved.
import copy
from abc import ABC, abstractmethod
from prescience_client.utils.table_printable import TablePrintable, DictPrintable
from prescience_c... | [
2,
5765,
286,
428,
2723,
2438,
318,
21825,
416,
257,
347,
10305,
12,
7635,
198,
2,
5964,
326,
460,
307,
1043,
287,
262,
38559,
24290,
2393,
13,
198,
2,
15069,
13130,
383,
1763,
4234,
12,
11792,
46665,
13,
1439,
2489,
10395,
13,
198,... | 3.110368 | 299 |
# FROM: https://gist.github.com/Skinner927/413c0e9cc8433123f426832f9fe8d931
class classproperty(object):
"""
Similar to @property but used on classes instead of instances.
The only caveat being that your class must use the
classproperty.meta metaclass.
Class properties will still work on class in... | [
2,
16034,
25,
3740,
1378,
70,
396,
13,
12567,
13,
785,
14,
15739,
5083,
24,
1983,
14,
44103,
66,
15,
68,
24,
535,
5705,
2091,
10163,
69,
19,
25022,
2624,
69,
24,
5036,
23,
67,
24,
3132,
628,
198,
198,
4871,
1398,
26745,
7,
15252... | 2.482587 | 402 |
class Hostaddr(basestring):
"""
the individual client hosts. could be a hostname or an IP
address.
"""
@staticmethod
| [
4871,
14504,
29851,
7,
12093,
395,
1806,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
262,
1981,
5456,
11453,
13,
714,
307,
257,
2583,
3672,
393,
281,
6101,
198,
220,
220,
220,
2209,
13,
198,
220,
220,
220,
37227,
198,
220,
... | 2.491525 | 59 |
@profile
@profile
if __name__ == "__main__":
call()
| [
31,
13317,
198,
198,
31,
13317,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
869,
3419,
198
] | 2.32 | 25 |
print("Please select which presence indicator to wish to use...")
print("Press 1 to run the Teams Presence Indicator")
print("Press 2 to run the Zoom Presence Indicator")
choice = input("Indicator: ")
if choice == '1':
print("Starting the Teams Presence Indicator...")
import teamsPresence
teamsPresence.run... | [
4798,
7203,
5492,
2922,
543,
4931,
16916,
284,
4601,
284,
779,
9313,
8,
198,
4798,
7203,
13800,
352,
284,
1057,
262,
24690,
46523,
1423,
26407,
4943,
198,
4798,
7203,
13800,
362,
284,
1057,
262,
40305,
46523,
1423,
26407,
4943,
198,
255... | 3.4 | 130 |
""" module init """
__title__ = 'pair'
__version__ = '0.1.0'
__author__ = 'LIU Lu'
__contact__ = 'nudtlliu@gmail.com'
__license__ = 'MIT'
__all__ = [
'base', 'servicefactory', 'mapbox', 'ors', 'google'
]
from .servicefactory import RoutingServiceFactory
| [
37811,
8265,
2315,
37227,
198,
834,
7839,
834,
796,
705,
24874,
6,
198,
834,
9641,
834,
796,
705,
15,
13,
16,
13,
15,
6,
198,
834,
9800,
834,
796,
705,
31271,
52,
6026,
6,
198,
834,
32057,
834,
796,
705,
77,
463,
83,
15516,
84,
... | 2.564356 | 101 |
import rdflib
import os
import pandas as pd
import csv_db
from demosauruswebapp.demosaurus.link_thesaurus import normalize_name
| [
11748,
374,
67,
2704,
571,
198,
11748,
28686,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
269,
21370,
62,
9945,
198,
6738,
35551,
22302,
12384,
1324,
13,
9536,
47650,
13,
8726,
62,
83,
956,
22302,
1330,
3487,
1096,
62,
3672,
628... | 3.046512 | 43 |
import numpy as np
def concatenate_fill(arrays, axis=0, fill_value=None):
"""
Appends to all the arrays so that they can be concatenated along the given axis (kwargs axis=0 by default).
The fill_value will be automatically determined from the dtype of arrays. For floating point types of arrays
it will ... | [
11748,
299,
32152,
355,
45941,
198,
198,
4299,
1673,
36686,
378,
62,
20797,
7,
3258,
592,
11,
16488,
28,
15,
11,
6070,
62,
8367,
28,
14202,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
2034,
2412,
284,
477,
262,
26515,
523,
... | 2.371869 | 1,038 |
import numpy as np
import os, cv2
imgs = np.load('test_set_ck_extended_no_resize.npy')
lbls = np.load('test_labels_ck_extended_no_resize.npy')
for i in range(imgs.shape[0]):
print (lbls[i])
cv2.imshow('img', imgs[i])
cv2.waitKey(0)
| [
11748,
299,
32152,
355,
45941,
198,
11748,
28686,
11,
269,
85,
17,
198,
198,
9600,
82,
796,
45941,
13,
2220,
10786,
9288,
62,
2617,
62,
694,
62,
2302,
1631,
62,
3919,
62,
411,
1096,
13,
77,
9078,
11537,
198,
75,
2436,
82,
796,
459... | 2.043103 | 116 |
n, k = map(int, raw_input().strip().split(' '))
a = map(int, raw_input().strip().split(' '))
array_left_rotation(a, n, k);
answer = array_left_rotation(a, n, k);
print ' '.join(map(str, answer))
| [
198,
198,
77,
11,
479,
796,
3975,
7,
600,
11,
8246,
62,
15414,
22446,
36311,
22446,
35312,
10786,
705,
4008,
198,
64,
796,
3975,
7,
600,
11,
8246,
62,
15414,
22446,
36311,
22446,
35312,
10786,
705,
4008,
198,
18747,
62,
9464,
62,
10... | 2.475 | 80 |
import sys
if len(sys.argv) != 2:
print 'usage: [input edge pair path]'
exit(1)
node_set = set()
with open(sys.argv[1], 'r') as fi:
for line in fi:
line = line.strip('\n').strip('\r')
tmp = line.split('\t')
src = int(tmp[0])
node_set.add(src)
print 'node size: %d' % len(node... | [
11748,
25064,
198,
198,
361,
18896,
7,
17597,
13,
853,
85,
8,
14512,
362,
25,
198,
220,
220,
220,
3601,
705,
26060,
25,
685,
15414,
5743,
5166,
3108,
49946,
198,
220,
220,
220,
8420,
7,
16,
8,
198,
17440,
62,
2617,
796,
900,
3419,... | 2.063291 | 158 |
import json
import logging
import os
import threading
from multiprocessing import Process, Queue
from queue import Empty
from typing import Tuple, Union
from docker import DockerClient
from docker.models.containers import Container
from casperlabs_local_net.errors import CommandTimeoutError, NonZeroExitCodeError
from ... | [
11748,
33918,
198,
11748,
18931,
198,
11748,
28686,
198,
11748,
4704,
278,
198,
6738,
18540,
305,
919,
278,
1330,
10854,
11,
4670,
518,
198,
6738,
16834,
1330,
33523,
198,
6738,
19720,
1330,
309,
29291,
11,
4479,
198,
6738,
36253,
1330,
... | 3.07717 | 622 |
#!/usr/bin/env python3
import os
import re
import shlex
import subprocess
import sys
GENERATED_FILE_NAME = "prometheus-metrics.md"
FILE_HEADER = """<!--
{
"name": "Prometheus Metrics",
"category": "5fcfd1ede5ded705a0bf5fd0",
"priority": 1000
}
-->
<!--
============================
GENERATED FILE - DO NOT EDI... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
11748,
28686,
198,
11748,
302,
198,
11748,
427,
2588,
198,
11748,
850,
14681,
198,
11748,
25064,
198,
198,
35353,
1137,
11617,
62,
25664,
62,
20608,
796,
366,
16963,
36916,
12,
... | 2.996441 | 281 |
from django.urls import path
from . import views
urlpatterns = [
path("", views.IndexView.as_view(), name="index"),
path("hello/<str:username>", views.HelloView.as_view(), name="hello"),
path("failing", views.FailingView.as_view(), name="failing"),
]
| [
6738,
42625,
14208,
13,
6371,
82,
1330,
3108,
198,
198,
6738,
764,
1330,
5009,
198,
198,
6371,
33279,
82,
796,
685,
198,
220,
220,
220,
3108,
7203,
1600,
5009,
13,
15732,
7680,
13,
292,
62,
1177,
22784,
1438,
2625,
9630,
12340,
198,
... | 2.789474 | 95 |
import os
import logging
from sqlalchemy_utils import database_exists, create_database
from datetime import datetime
from sqlalchemy.dialects import postgresql
from flask_sqlalchemy import SQLAlchemy
from config import SQLALCHEMY_DATABASE_URI
db = SQLAlchemy()
| [
11748,
28686,
198,
11748,
18931,
198,
6738,
44161,
282,
26599,
62,
26791,
1330,
6831,
62,
1069,
1023,
11,
2251,
62,
48806,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
6738,
44161,
282,
26599,
13,
38969,
478,
82,
1330,
1281,
34239,
139... | 3.329268 | 82 |
# Capture multi video from webcam
# Display the frame 4 times on canvas
import numpy
import cv2
# 0 means 1st webcam
cap = cv2.VideoCapture(0)
face_cascade = cv2.CascadeClassifier(
cv2.data.haarcascades + "haarcascade_frontalface_default.xml")
eye_cascade = cv2.CascadeClassifier(
cv2.data.haarcascad... | [
2,
31793,
5021,
2008,
422,
49823,
198,
2,
16531,
262,
5739,
604,
1661,
319,
21978,
198,
198,
11748,
299,
32152,
198,
11748,
269,
85,
17,
198,
198,
2,
657,
1724,
352,
301,
49823,
198,
11128,
796,
269,
85,
17,
13,
10798,
49630,
7,
1... | 1.764079 | 657 |
import items_setup
import unittest
if __name__ == "__main__":
unittest.main()
| [
11748,
3709,
62,
40406,
198,
11748,
555,
715,
395,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
555,
715,
395,
13,
12417,
3419,
198
] | 2.59375 | 32 |
#!/usr/bin/env python3
############################################################################################
# #
# Program purpose: Checks whether a given string is number or not using Lambda. #
# Program ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
220,
21015,
18,
198,
198,
29113,
29113,
14468,
7804,
4242,
198,
2,
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.03532 | 453 |
'''----------------------------------------------------------------------------
Name: Heroku API Commands (commands.py)
Purpose: To setup a connection with the Heroku API and denote functions
that carry out various tasks.
Author: Nicholas Chong
Created: 2020-06-24 (YYYY/MM/DD)
-------... | [
7061,
6,
10097,
10541,
198,
5376,
25,
220,
220,
220,
220,
220,
220,
220,
2332,
11601,
7824,
49505,
357,
9503,
1746,
13,
9078,
8,
198,
30026,
3455,
25,
220,
220,
220,
220,
1675,
9058,
257,
4637,
351,
262,
2332,
11601,
7824,
290,
4268... | 3.593985 | 133 |
from Helpers import Logger
from Helpers import xcrun
# This is initial setup that should be done so the xcrun helper module doesn't have to be used everywhere.
import os
DEVELOPER_DIR = os.environ.get('DEVELOPER_DIR')
if DEVELOPER_DIR:
Logger.write().info('DEVELOPER_DIR environment variable is already set, existin... | [
6738,
10478,
364,
1330,
5972,
1362,
198,
6738,
10478,
364,
1330,
2124,
66,
5143,
198,
198,
2,
770,
318,
4238,
9058,
326,
815,
307,
1760,
523,
262,
2124,
66,
5143,
31904,
8265,
1595,
470,
423,
284,
307,
973,
8347,
13,
198,
11748,
286... | 3.0625 | 160 |
####################
# ES-DOC CIM Questionnaire
# Copyright (c) 2017 ES-DOC. All rights reserved.
#
# University of Colorado, Boulder
# http://cires.colorado.edu/
#
# This project is distributed according to the terms of the MIT license [http://www.opensource.org/licenses/MIT].
####################
__author_... | [
14468,
4242,
198,
2,
220,
220,
13380,
12,
38715,
327,
3955,
18233,
24042,
198,
2,
220,
220,
15069,
357,
66,
8,
2177,
13380,
12,
38715,
13,
1439,
2489,
10395,
13,
198,
2,
198,
2,
220,
220,
2059,
286,
7492,
11,
27437,
198,
2,
220,
... | 2.736934 | 574 |
import os
from time import time
import torch
import torch.nn.functional as F
import numpy as np
import SimpleITK as sitk
import xlsxwriter as xw
import scipy.ndimage as ndimage
from net.ResUnet_dice import Net
os.environ['CUDA_VISIBLE_DEVICES'] = '1'
val_ct_dir = './Path of original images/'
#val_seg_dir = './Trai... | [
11748,
28686,
198,
6738,
640,
1330,
640,
198,
198,
11748,
28034,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
17427,
2043,
42,
355,
1650,
74,
198,
11748,
2124,
7278,
87,
16002,
... | 2.150778 | 1,479 |
import doctest
import unittest
from hypothesis import given
from hypothesis.strategies import (builds, from_regex, integers, just, lists,
recursive, tuples)
from src.main import *
strat_codeline = from_regex(r"\A[a-z]{3}\Z")
strat_nochildren = just([])
strat_children = re... | [
11748,
10412,
395,
198,
11748,
555,
715,
395,
198,
198,
6738,
14078,
1330,
1813,
198,
6738,
14078,
13,
2536,
2397,
444,
1330,
357,
11249,
82,
11,
422,
62,
260,
25636,
11,
37014,
11,
655,
11,
8341,
11,
198,
220,
220,
220,
220,
220,
... | 2.347826 | 184 |
import json
import math
import os
import sys
import time
import colorama
from colorama import Style, Fore, Back
colorama.init()
import click
@click.command()
@click.option('--fields', default='')
@click.option('--hide-inactive/--no-hide-inactive', default=False)
@click.option('--only')
@click.option('--watch',... | [
11748,
33918,
198,
11748,
10688,
198,
11748,
28686,
198,
11748,
25064,
198,
11748,
640,
198,
11748,
3124,
1689,
198,
6738,
3124,
1689,
1330,
17738,
11,
4558,
11,
5157,
198,
198,
8043,
1689,
13,
15003,
3419,
198,
198,
11748,
3904,
628,
6... | 2.924242 | 198 |
"""rename status retry
Revision ID: 6ef79b56ad4a
Revises: 94e7b91d83d5
Create Date: 2017-06-19 15:06:50.441524+00:00
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '6ef79b56ad4a'
down_revision = '94e7b91d83d5'
branch_labels = None
depends_on = None
## ref htt... | [
37811,
918,
480,
3722,
1005,
563,
198,
198,
18009,
1166,
4522,
25,
718,
891,
3720,
65,
3980,
324,
19,
64,
198,
18009,
2696,
25,
10048,
68,
22,
65,
6420,
67,
5999,
67,
20,
198,
16447,
7536,
25,
2177,
12,
3312,
12,
1129,
1315,
25,
... | 2.365269 | 167 |
"""
SparseSeriesData
"""
from __future__ import annotations
import logging
import sys
import time
import copy
from typing import Dict
# Its there not sure why pylint is unable to find it
# pylint: disable-msg=E0611 # No Name In Module
from lru import LRU
from nbdb.common.context import Context
from nbdb.common.data... | [
37811,
198,
50,
29572,
27996,
6601,
198,
37811,
198,
6738,
11593,
37443,
834,
1330,
37647,
198,
198,
11748,
18931,
198,
11748,
25064,
198,
11748,
640,
198,
11748,
4866,
198,
6738,
19720,
1330,
360,
713,
198,
198,
2,
6363,
612,
407,
1654... | 2.160529 | 6,734 |
#!/usr/bin/env python3
import argparse
import logging
import os
import re
import sys
import time
import traceback
import Constants
import FoscamImager
import Mailer
import NetHelpers
system_healthy = True
state = dict()
message = ""
#### Helper Functions ####
# Note: For windows nodes only
# Note: For Foscam node... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
11748,
1822,
29572,
198,
11748,
18931,
198,
11748,
28686,
198,
11748,
302,
198,
11748,
25064,
198,
11748,
640,
198,
11748,
12854,
1891,
198,
11748,
4757,
1187,
198,
11748,
376,
17500,
... | 2.387276 | 1,619 |
from typing import Tuple, Union
import gym.spaces as spaces
import numpy as np
from gym.spaces import Box
from autograph.lib.envs.adversarialenv import AdversarialEnv, PlayerID
from autograph.lib.envs.saveloadenv import SaveLoadEnv
from autograph.lib.util import element_add, element_neg
PATTERNS = ((0, 1), (1, 0), (... | [
6738,
19720,
1330,
309,
29291,
11,
4479,
198,
198,
11748,
11550,
13,
2777,
2114,
355,
9029,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
11550,
13,
2777,
2114,
1330,
8315,
198,
198,
6738,
1960,
2384,
13,
8019,
13,
268,
14259,
13,
32... | 2.855932 | 118 |
arr = [64, 34, 25, 12, 22, 11, 90]
test_arr = [2, 1, 5, 3, 4, 7]
bubbleSort(test_arr)
print("排序后的数组:")
for i in range(len(test_arr)):
print("%d" % test_arr[i]),
print(bubble(test_arr)) | [
628,
198,
3258,
796,
685,
2414,
11,
4974,
11,
1679,
11,
1105,
11,
2534,
11,
1367,
11,
4101,
60,
198,
9288,
62,
3258,
796,
685,
17,
11,
352,
11,
642,
11,
513,
11,
604,
11,
767,
60,
198,
198,
46176,
903,
42758,
7,
9288,
62,
3258... | 1.839623 | 106 |
import socket
s=socket.socket()
n=int(raw_input("enter n:"))
s.connect(('127.0.0.1',2222))
for k in range(0,n):
input=raw_input()
#s.connect(('127.0.0.1',2222))
s.send(input)
k=s.recv(1024)
print k
| [
11748,
17802,
198,
82,
28,
44971,
13,
44971,
3419,
198,
77,
28,
600,
7,
1831,
62,
15414,
7203,
9255,
299,
11097,
4008,
198,
82,
13,
8443,
7,
10786,
16799,
13,
15,
13,
15,
13,
16,
3256,
1828,
1828,
4008,
198,
1640,
479,
287,
2837,
... | 2.03 | 100 |
#coding:utf-8
#
# id: functional.gtcs.external_file_04_d
# title: GTCS/tests/external-file-04-d. Test for external table with field of INTEGER datatype
# decription:
# Original test see in:
# https://github.com/FirebirdSQL/fbtcs/blob/master/GTCS/tests/EXT_REL_0_4... | [
2,
66,
7656,
25,
40477,
12,
23,
198,
2,
198,
2,
4686,
25,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
10345,
13,
13655,
6359,
13,
22615,
62,
7753,
62,
3023,
62,
67,
198,
2,
3670,
25,
220,
220,
220,
220,
220,
220,
220,
... | 2.189094 | 1,137 |
import numpy as np
__all__ = ('_fod_dimensionality_fixer', 'iterable_data_array', 'data_array_builder')
def _fod_dimensionality_fixer(data_dict, check_key, keys_to_fix):
"""
Checks the dimensionality of data in data_dict for function on data and reshapes them if their shape is 1d.
args:
data_... | [
11748,
299,
32152,
355,
45941,
198,
198,
834,
439,
834,
796,
19203,
62,
69,
375,
62,
46156,
1483,
62,
13049,
263,
3256,
705,
2676,
540,
62,
7890,
62,
18747,
3256,
705,
7890,
62,
18747,
62,
38272,
11537,
628,
628,
198,
4299,
4808,
69... | 2.244782 | 527 |
from wsgiref.simple_server import make_server
from pyramid.config import Configurator
from pyramid.view import view_config
@view_config(
route_name = 'home'
renderer = 'json')
if __name__ == '__main__':
with Configurator() as config:
config.add_route('home', '/')
config.scan()
app ... | [
6738,
266,
45213,
557,
69,
13,
36439,
62,
15388,
1330,
787,
62,
15388,
198,
6738,
27944,
13,
11250,
1330,
17056,
333,
1352,
198,
6738,
27944,
13,
1177,
1330,
1570,
62,
11250,
198,
198,
31,
1177,
62,
11250,
7,
198,
220,
220,
220,
633... | 2.502994 | 167 |
import logging
from libs import baseview
from rest_framework.response import Response
from django.http import HttpResponse
from core.models import (
SqlRecord,
SqlOrder
)
CUSTOM_ERROR = logging.getLogger('Yearning.core.views')
class recordorder(baseview.SuperUserpermissions):
'''
审核记录相关
'''
... | [
11748,
18931,
198,
6738,
9195,
82,
1330,
2779,
1177,
198,
6738,
1334,
62,
30604,
13,
26209,
1330,
18261,
198,
6738,
42625,
14208,
13,
4023,
1330,
367,
29281,
31077,
198,
6738,
4755,
13,
27530,
1330,
357,
198,
220,
220,
220,
311,
13976,
... | 2.523077 | 130 |
from app.blueprints.user.views import user | [
6738,
598,
13,
17585,
17190,
13,
7220,
13,
33571,
1330,
2836
] | 3.818182 | 11 |
"""
mobile-block
MobileNet-style blocks for PyTorch
Author: SF-Zhou
Date: 2019-01-15
"""
from setuptools import setup
name = 'mobile_block'
setup(
name=name,
version='0.0.6',
description='MobileNet-style blocks for PyTorch',
url=f'https://github.com/SF-Zhou/{name.replace("_", "-")}',
author='SF-Zh... | [
37811,
198,
24896,
12,
9967,
198,
17066,
7934,
12,
7635,
7021,
329,
9485,
15884,
354,
198,
13838,
25,
14362,
12,
57,
15710,
198,
10430,
25,
13130,
12,
486,
12,
1314,
198,
37811,
198,
198,
6738,
900,
37623,
10141,
1330,
9058,
198,
198,... | 2.463158 | 190 |
import logging
from typing import Any
from json_checker.core.base import Base
from json_checker.core.exceptions import CheckerError
from json_checker.core.checkers import Validator
from json_checker.core.reports import Report
log = logging.getLogger(__name__)
| [
11748,
18931,
198,
198,
6738,
19720,
1330,
4377,
198,
198,
6738,
33918,
62,
9122,
263,
13,
7295,
13,
8692,
1330,
7308,
198,
6738,
33918,
62,
9122,
263,
13,
7295,
13,
1069,
11755,
1330,
6822,
263,
12331,
198,
6738,
33918,
62,
9122,
263... | 3.441558 | 77 |
import pytest
from ubatch.ubatch import UBatch
@pytest.fixture
| [
11748,
12972,
9288,
198,
198,
6738,
20967,
963,
13,
549,
963,
1330,
471,
33,
963,
628,
198,
198,
31,
9078,
9288,
13,
69,
9602,
198
] | 2.68 | 25 |
# coding: utf-8
# Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | [
2,
19617,
25,
3384,
69,
12,
23,
198,
2,
15069,
357,
66,
8,
1584,
11,
33160,
11,
18650,
290,
14,
273,
663,
29116,
13,
220,
1439,
2489,
10395,
13,
198,
2,
770,
3788,
318,
10668,
12,
36612,
284,
345,
739,
262,
14499,
2448,
33532,
1... | 2.606867 | 1,165 |
# (C) Copyright 2005- ECMWF.
#
# This software is licensed under the terms of the Apache Licence Version 2.0
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
#
# In applying this licence, ECMWF does not waive the privileges and immunities
# granted to it by virtue of its status as an intergovernme... | [
2,
357,
34,
8,
15069,
5075,
12,
13182,
14326,
37,
13,
198,
2,
198,
2,
770,
3788,
318,
11971,
739,
262,
2846,
286,
262,
24843,
10483,
594,
10628,
362,
13,
15,
198,
2,
543,
460,
307,
6492,
379,
2638,
1378,
2503,
13,
43073,
13,
239... | 3.312757 | 243 |
my_host = 'localhost'
my_port = 10000
is_emulation = False
emulator_host = '0.0.0.0'
emulator_port = 4390
apis_web_host = '0.0.0.0'
apis_web_budo_emulator_port = 43830
apis_web_api_server_port = 9999
#apis_log_group_address = 'FF02:0:0:0:0:0:0:1'
apis_log_group_address = '224.2.2.4'
apis_log_port = 8888
units = [... | [
198,
1820,
62,
4774,
796,
705,
36750,
6,
198,
1820,
62,
634,
796,
33028,
198,
198,
271,
62,
368,
1741,
796,
10352,
198,
198,
368,
8927,
62,
4774,
796,
705,
15,
13,
15,
13,
15,
13,
15,
6,
198,
368,
8927,
62,
634,
796,
604,
2596... | 2.007825 | 639 |
from datetime import datetime, timedelta
import pytest
import pytz
from tests.assertions import assert_durations_are_eq
from garden import models
from garden.formatters import WateringStationFormatter
@pytest.mark.unit
@pytest.mark.unit
@pytest.mark.unit
@pytest.mark.unit
| [
6738,
4818,
8079,
1330,
4818,
8079,
11,
28805,
12514,
198,
198,
11748,
12972,
9288,
198,
11748,
12972,
22877,
198,
6738,
5254,
13,
30493,
507,
1330,
6818,
62,
67,
20074,
62,
533,
62,
27363,
198,
198,
6738,
11376,
1330,
4981,
198,
6738,
... | 3.215909 | 88 |
"""
Copyright 2022 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, software
dis... | [
37811,
198,
15269,
33160,
3012,
11419,
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,
198,
1639,
743,
7... | 2.476004 | 1,021 |
import base64
from django.urls import reverse
from dcim.models import Device, DeviceRole, DeviceType, Manufacturer, Site
from secrets.models import Secret, SecretRole, SessionKey, UserKey
from utilities.testing import ViewTestCases
from .constants import PRIVATE_KEY, PUBLIC_KEY
| [
11748,
2779,
2414,
198,
198,
6738,
42625,
14208,
13,
6371,
82,
1330,
9575,
198,
198,
6738,
30736,
320,
13,
27530,
1330,
16232,
11,
16232,
47445,
11,
16232,
6030,
11,
40218,
11,
14413,
198,
6738,
13141,
13,
27530,
1330,
3943,
11,
3943,
... | 3.773333 | 75 |
"""
Is One Array a Rotation of Another? (Python)
Write a function that returns True if one array is a rotation of another.
Example: [1, 2, 3, 4, 5, 6, 7] is a rotation of [4, 5, 6, 7, 1, 2, 3].
NOTE: There are no duplicates in each of these arrays.
REMINDER: We're going to use lists instead of arr... | [
37811,
198,
220,
220,
220,
1148,
1881,
15690,
257,
371,
14221,
286,
6023,
30,
357,
37906,
8,
628,
220,
220,
220,
19430,
257,
2163,
326,
5860,
6407,
611,
530,
7177,
318,
257,
13179,
286,
1194,
13,
198,
220,
220,
220,
17934,
25,
685,
... | 2.245232 | 367 |
import numpy as np
from matplotlib import pyplot as plt
from scipy.ndimage import median_filter, gaussian_filter
import epics
import time
import imageio
import logging, coloredlogs
coloredlogs.install(fmt='%(asctime)s,%(msecs)d %(levelname)-8s [%(filename)s:%(lineno)d] %(message)s',datefmt='%H:%M:%S',level=logging.INF... | [
11748,
299,
32152,
355,
45941,
198,
6738,
2603,
29487,
8019,
1330,
12972,
29487,
355,
458,
83,
198,
6738,
629,
541,
88,
13,
358,
9060,
1330,
14288,
62,
24455,
11,
31986,
31562,
62,
24455,
198,
11748,
2462,
873,
198,
11748,
640,
198,
1... | 2.564864 | 2,089 |
S = input()
flag1 = True
flag2 = True
flag3 = True
flag1 = S[0] == "A" and S.count("A") == 1
flag2 = S.count("C") == 1 and 2 <= S.index("C") <= len(S)-2
S = S.replace("A", "")
S = S.replace("C", "")
flag3 = S.islower()
if all([flag1, flag2, flag3]):
print("AC")
else:
print("WA") | [
50,
796,
5128,
3419,
198,
32109,
16,
796,
6407,
198,
32109,
17,
796,
6407,
198,
32109,
18,
796,
6407,
198,
198,
32109,
16,
796,
311,
58,
15,
60,
6624,
366,
32,
1,
290,
311,
13,
9127,
7203,
32,
4943,
6624,
352,
198,
32109,
17,
79... | 2.172932 | 133 |
#!/usr/bin/env python
# coding: utf-8
import os
import re
from setuptools import setup
_VERSION_RE = re.compile(r"__version__\s*?=\s*?'(.*?)'", flags=re.M)
setup(
name='pangu',
version=get_version(),
description='Paranoid text spacing for good readability, to automatically insert whitespace between CJ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
19617,
25,
3384,
69,
12,
23,
198,
198,
11748,
28686,
198,
11748,
302,
198,
198,
6738,
900,
37623,
10141,
1330,
9058,
198,
198,
62,
43717,
62,
2200,
796,
302,
13,
5589,
576,
7,
8... | 2.762861 | 797 |
# Generated by Django 2.2.2 on 2019-06-06 12:20
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import model_utils.fields
import uuid
| [
2,
2980,
515,
416,
37770,
362,
13,
17,
13,
17,
319,
13130,
12,
3312,
12,
3312,
1105,
25,
1238,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
198,
11748,
42625,
14208,
13,
9945,
13,
27530,
13,
2934,
1616,
295,
... | 2.984375 | 64 |