content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
"""
Configuration module that holds some configuration options for
Web2Executable.
"""
from __future__ import print_function
import os
import logging
import logging.handlers as lh
import traceback
import sys
import zipfile
import ssl
import utils
ZIP_MODE = zipfile.ZIP_STORED
MAX_RECENT = 10
DEBUG = False
TESTING ... | [
37811,
198,
38149,
8265,
326,
6622,
617,
8398,
3689,
329,
198,
13908,
17,
23002,
18187,
13,
198,
37811,
198,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
11748,
28686,
198,
11748,
18931,
198,
11748,
18931,
13,
4993,
8116,
35... | 2.552561 | 1,113 |
import jax.numpy as np
from .Axis import Axis
from jax.config import config
config.update("jax_enable_x64", True)
def read_axis(filename):
"""
Reads the magnetic axis from a file.
Expects the filename to be in a specified form, which is the same as the default
axis file given.
Parameters:
filename (str... | [
11748,
474,
897,
13,
77,
32152,
355,
45941,
198,
6738,
764,
31554,
271,
1330,
38349,
198,
6738,
474,
897,
13,
11250,
1330,
4566,
198,
198,
11250,
13,
19119,
7203,
73,
897,
62,
21633,
62,
87,
2414,
1600,
6407,
8,
628,
198,
4299,
1100... | 2.420635 | 756 |
# Compute confidence interval for a quantile.
#
# Suppose I'm interested in estimating the 37th percentile. The
# empirical CDF gives me one estimate for that. I'd like
# to get a confidence interval: I'm 90% confident that the 37th percentile
# lies between X and Y.
#
# You can compute that with two calls to the fol... | [
2,
3082,
1133,
6628,
16654,
329,
257,
5554,
576,
13,
198,
2,
198,
2,
39200,
314,
1101,
4609,
287,
39539,
262,
5214,
400,
37894,
13,
220,
383,
198,
2,
21594,
6458,
37,
3607,
502,
530,
8636,
329,
326,
13,
220,
314,
1549,
588,
198,
... | 3.007958 | 377 |
import os
import tarfile
from . import __version__
| [
11748,
28686,
198,
11748,
13422,
7753,
198,
6738,
764,
1330,
11593,
9641,
834,
628
] | 3.714286 | 14 |
#
# Copyright Contributors to the OpenTimelineIO project
#
# Licensed under the Apache License, Version 2.0 (the "Apache License")
# with the following modification; you may not use this file except in
# compliance with the Apache License and the following modification to it:
# Section 6. Trademarks. is deleted and rep... | [
2,
198,
2,
15069,
25767,
669,
284,
262,
4946,
14967,
4470,
9399,
1628,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
25189,
4891,
13789,
4943,
198,
2,
351,
262,
1708,
17613,
26,
345,
743,
4... | 1.390687 | 13,379 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2016-11-23 21:46
from __future__ import unicode_literals
from django.db import migrations
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2980,
515,
416,
37770,
352,
13,
940,
319,
1584,
12,
1157,
12,
1954,
2310,
25,
3510,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
6738,... | 2.754717 | 53 |
# Generated by Django 2.0.6 on 2018-07-02 03:46
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
362,
13,
15,
13,
21,
319,
2864,
12,
2998,
12,
2999,
7643,
25,
3510,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
# -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# ... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
29113,
29113,
7804,
21017,
198,
2,
15069,
357,
66,
828,
383,
317,
4178,
5631,
1074,
13,
1439,
2489,
10395,
13,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
... | 2.352073 | 2,846 |
import csv
import math
import os
from typing import List, Tuple
from config import Config
from evaluation.judgements import RelevanceJudgements, ConfusionMatrix
from log import get_child_logger
from models import Topic
logger = get_child_logger(__file__)
def __get_IDCG(relevance_stats, topic: int, p: int, rest_rele... | [
11748,
269,
21370,
198,
11748,
10688,
198,
11748,
28686,
198,
6738,
19720,
1330,
7343,
11,
309,
29291,
198,
198,
6738,
4566,
1330,
17056,
198,
6738,
12660,
13,
10456,
43547,
1330,
797,
2768,
590,
26141,
43547,
11,
7326,
4241,
46912,
198,
... | 2.451745 | 1,948 |
import machine
i2c = machine.I2C(scl=machine.Pin(4, sda=machine.Pin(5)))
oled = SSD1306_I2C(128, 32, i2c)
oled.fill(0)
oled.test("eyyy")
oled.show()
| [
11748,
4572,
198,
198,
72,
17,
66,
796,
4572,
13,
40,
17,
34,
7,
38528,
28,
30243,
13,
28348,
7,
19,
11,
264,
6814,
28,
30243,
13,
28348,
7,
20,
22305,
198,
45342,
796,
21252,
12952,
21,
62,
40,
17,
34,
7,
12762,
11,
3933,
11,... | 2.097222 | 72 |
import numpy as np
import os
from os import path as osp
from gym import spaces, Env
import pybullet as p
import pybullet_data as pb_data
from pybullet_utils import bullet_client
from scibotpark.pybullet.base import PybulletEnv
from scibotpark.panda.robot import PandaRobot
if __name__ == "__main__":
from scibotp... | [
11748,
299,
32152,
355,
45941,
198,
11748,
28686,
198,
6738,
28686,
1330,
3108,
355,
267,
2777,
198,
6738,
11550,
1330,
9029,
11,
2039,
85,
198,
198,
11748,
12972,
15065,
1616,
355,
279,
198,
11748,
12972,
15065,
1616,
62,
7890,
355,
27... | 2.288546 | 454 |
#/usr/bin/env python
# Matthieu Brucher
# Last Change : 2007-08-22 14:01
from __future__ import absolute_import
import unittest
import numpy
from PyDSTool.Toolbox.optimizers.line_search import GoldsteinRule
if __name__ == "__main__":
unittest.main()
| [
2,
14,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
2,
45524,
22304,
8274,
2044,
198,
2,
4586,
9794,
1058,
4343,
12,
2919,
12,
1828,
1478,
25,
486,
198,
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
198,
11748,
555,
715,... | 2.898876 | 89 |
#!/usr/bin/env python
######################################################################
# Report stats on dataset.
######################################################################
get_stats_1pass_outputs = ['n', 'min', 'max', 'mean', 'sum']
get_stats_outputs = ['n', 'min', 'max', 'mean', 'median', 'sum'... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
29113,
29113,
4242,
2235,
198,
2,
6358,
9756,
319,
27039,
13,
198,
29113,
29113,
4242,
2235,
628,
198,
198,
1136,
62,
34242,
62,
16,
6603,
62,
22915,
82,
796,
37250,
77,
3256,
705,
1... | 2.886792 | 159 |
import numpy as np
class SyntheticGaussianMapping:
'''generate synthetic feature extractor'''
def initialize_weights(self):
'''initialize the network from normal distribution'''
np.random.seed(self.seed)
self.dims = [self.dim_in, *self.dim_layers, self.dim_out]
self.num_layer... | [
198,
11748,
299,
32152,
355,
45941,
628,
198,
4871,
26375,
6587,
35389,
31562,
44,
5912,
25,
198,
220,
220,
220,
705,
7061,
8612,
378,
18512,
3895,
7925,
273,
7061,
6,
628,
220,
220,
220,
825,
41216,
62,
43775,
7,
944,
2599,
198,
22... | 2.040179 | 448 |
import subprocess,random,string,datetime
from django.contrib.auth import authenticate
from django.conf import settings
from audit import models
from audit.backend import ssh_interactive
class UserShell(object):
"""用户登录堡垒机后的shell"""
def start(self):
"""启动交互程序"""
token_obj = self.token_auth()
... | [
198,
11748,
850,
14681,
11,
25120,
11,
8841,
11,
19608,
8079,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
1330,
8323,
5344,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
14984,
1330,
4981,
198,
6738,
14984,
13,
1891,... | 1.671276 | 2,242 |
#!/usr/bin/python3
import os
import sys
import re
import jk_console
import jk_sysinfo
import jk_json
#import jk_flexdata
import jk_logging
from jk_typing import *
import jk_argparsing
#
#
#
#
#
#
ALL_SYSINFO_OPTIONS = [
SysInfoOption("i-accesspoints", "Get data about access points", jk_sysinfo.get_... | [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
628,
198,
11748,
28686,
198,
11748,
25064,
198,
11748,
302,
198,
198,
11748,
474,
74,
62,
41947,
198,
11748,
474,
74,
62,
17597,
10951,
198,
11748,
474,
74,
62,
17752,
198,
2,
11748,
474,
74... | 2.78806 | 2,010 |
import logging
from polyaxon_client.tracking import Experiment, get_log_level
from .model import Model
from .datapipeline import Datapipeline
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger("polyaxon")
if __name__ == '__main__':
# Consider using something like argparse to get your ... | [
11748,
18931,
201,
198,
6738,
7514,
897,
261,
62,
16366,
13,
36280,
1330,
29544,
11,
651,
62,
6404,
62,
5715,
201,
198,
6738,
764,
19849,
1330,
9104,
201,
198,
6738,
764,
19608,
499,
541,
4470,
1330,
16092,
499,
541,
4470,
201,
198,
... | 2.963855 | 249 |
from datetime import date, timedelta
from erlport import Atom, erlang
| [
6738,
4818,
8079,
1330,
3128,
11,
28805,
12514,
198,
198,
6738,
1931,
75,
634,
1330,
33102,
11,
1931,
17204,
198
] | 3.55 | 20 |
from django.db.models import signals
from django.contrib.sites.models import Site
from dbtemplates.models import Template
from dbtemplates import models as template_app
def create_default_templates(app, created_models, verbosity, **kwargs):
"""Creates the default database template objects."""
try:
sit... | [
6738,
42625,
14208,
13,
9945,
13,
27530,
1330,
10425,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
49315,
13,
27530,
1330,
14413,
198,
198,
6738,
20613,
11498,
17041,
13,
27530,
1330,
37350,
198,
6738,
20613,
11498,
17041,
1330,
4981,
355,... | 2.320301 | 665 |
from django.shortcuts import render_to_response
from django.template import RequestContext
from qmpy.models import Spacegroup, Operation
import io
from ..tools import get_globals
| [
6738,
42625,
14208,
13,
19509,
23779,
1330,
8543,
62,
1462,
62,
26209,
198,
6738,
42625,
14208,
13,
28243,
1330,
19390,
21947,
198,
198,
6738,
10662,
3149,
88,
13,
27530,
1330,
4687,
8094,
11,
14680,
198,
11748,
33245,
198,
6738,
11485,
... | 3.770833 | 48 |
import os
import datetime
dir = os.path.abspath(os.path.dirname(__file__))
data = file(os.path.join(dir, 'index.html')).read()
data = data.replace('<html>', '<html manifest="manifest.webapp">')
file(os.path.join(dir, 'deploy/index.html'), 'w').write(data)
data = file(os.path.join(dir, 'manifest.webapp')).read()
now ... | [
11748,
28686,
198,
11748,
4818,
8079,
198,
15908,
796,
28686,
13,
6978,
13,
397,
2777,
776,
7,
418,
13,
6978,
13,
15908,
3672,
7,
834,
7753,
834,
4008,
198,
198,
7890,
796,
2393,
7,
418,
13,
6978,
13,
22179,
7,
15908,
11,
705,
963... | 2.608696 | 184 |
from django.shortcuts import render,redirect
from django.contrib.auth import authenticate,login,logout
from django.contrib.auth.decorators import login_required
from django import conf
from kingadmin import app_setup
from crm import models
app_setup.kingadmin_auto_discover()
from kingadmin.sites import site
print("s... | [
6738,
42625,
14208,
13,
19509,
23779,
1330,
8543,
11,
445,
1060,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
1330,
8323,
5344,
11,
38235,
11,
6404,
448,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
12501,
273,
2024,
1... | 2.70197 | 406 |
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making BK-BASE 蓝鲸基础平台 available.
Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
BK-BASE 蓝鲸基础平台 is licensed under the MIT License.
License for BK-BASE 蓝鲸基础平台:
------------------------------------------... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
24893,
1087,
318,
10607,
284,
1104,
262,
1280,
2723,
2055,
416,
1642,
347,
42,
12,
33,
11159,
5525,
241,
251,
165,
110,
116,
161,
253,
118,
163,
94,
222,
... | 3.028796 | 1,146 |
apiAttachAvailable = u'API el\xe9rheto'
apiAttachNotAvailable = u'Nem el\xe9rheto'
apiAttachPendingAuthorization = u'F\xfcggoben l\xe9vo visszaigazol\xe1s'
apiAttachRefused = u'Elutas\xedtva'
apiAttachSuccess = u'Siker\xfclt'
apiAttachUnknown = u'Ismeretlen'
budDeletedFriend = u'T\xf6r\xf6lve a bar\xe1tok list\xe... | [
15042,
33296,
10493,
796,
334,
6,
17614,
1288,
59,
27705,
24,
81,
258,
1462,
6,
201,
198,
15042,
33296,
3673,
10493,
796,
334,
6,
45,
368,
1288,
59,
27705,
24,
81,
258,
1462,
6,
201,
198,
15042,
33296,
47,
1571,
13838,
1634,
796,
... | 2.017304 | 3,872 |
# for episode 26
import pandas as pd
import numpy as np
from collections import Counter
import sklearn
from sklearn import svm, preprocessing
from sklearn.metrics import classification_report, accuracy_score
how_much_better = 10
FEATURES = ['DE Ratio',
'Trailing P/E',
'Price... | [
2,
329,
4471,
2608,
201,
198,
201,
198,
11748,
19798,
292,
355,
279,
67,
201,
198,
11748,
299,
32152,
355,
45941,
201,
198,
201,
198,
6738,
17268,
1330,
15034,
201,
198,
11748,
1341,
35720,
201,
198,
6738,
1341,
35720,
1330,
264,
1476... | 1.853039 | 905 |
#!/usr/bin/env python
import asyncio
import logging
import socket
import sys
import time
import unittest
from argparse import ArgumentParser
from concurrent import futures
from contextlib import suppress
from pathlib import Path
from unittest.mock import MagicMock
from httpx import AsyncClient
from requests import Re... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
30351,
952,
198,
11748,
18931,
198,
11748,
17802,
198,
11748,
25064,
198,
11748,
640,
198,
11748,
555,
715,
395,
198,
6738,
1822,
29572,
1330,
45751,
46677,
198,
6738,
24580,
... | 3.167763 | 304 |
from .Token import *
from .TokenType import *
| [
6738,
764,
30642,
1330,
1635,
198,
6738,
764,
30642,
6030,
1330,
1635,
198,
220,
220,
220,
220,
220,
220,
220,
220,
198
] | 2.5 | 22 |
import torch
import torch.nn as nn
import torch.optim as optim
import torchvision
import os, time, PIL
import numpy as np
import matplotlib.pyplot as plt
from . import utils
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
# inherited from FastPickleClient
# def pickle_data(self,... | [
11748,
28034,
220,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
11748,
28034,
13,
40085,
355,
6436,
198,
11748,
28034,
10178,
198,
198,
11748,
28686,
11,
640,
11,
350,
4146,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
2948... | 3.2375 | 240 |
import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
import testpy
| [
11748,
28686,
198,
11748,
25064,
198,
17597,
13,
6978,
13,
33295,
7,
418,
13,
6978,
13,
22179,
7,
418,
13,
6978,
13,
15908,
3672,
7,
834,
7753,
834,
828,
705,
492,
6,
4008,
198,
11748,
1332,
9078,
198
] | 2.578947 | 38 |
from __future__ import annotations
from ._base import ReadOnlyMessage
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from ..nodes import Node
from ._conversation import Conversation
class ClearMessage(ReadOnlyMessage):
"""
This is an special state during which the message is clear-text.
It ... | [
6738,
11593,
37443,
834,
1330,
37647,
198,
198,
6738,
47540,
8692,
1330,
4149,
10049,
12837,
198,
198,
6738,
19720,
1330,
41876,
62,
50084,
2751,
198,
361,
41876,
62,
50084,
2751,
25,
198,
220,
220,
220,
422,
11485,
77,
4147,
1330,
1908... | 3.512397 | 121 |
# -*- coding: utf-8 -*-
"""
Copyright 2019 CSIRO Land and Water
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or ... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
15269,
13130,
9429,
43708,
6379,
290,
5638,
198,
198,
26656,
15385,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
5832,
... | 3.024691 | 324 |
# -*- coding: UTF-8 -*-
from spider import *
#from spider.common.get_cookie import get_cookie
col = 'race'
race = Race(col=col)
race.fetch()
| [
2,
532,
9,
12,
19617,
25,
41002,
12,
23,
532,
9,
12,
201,
198,
201,
198,
201,
198,
6738,
19230,
1330,
1635,
201,
198,
2,
6738,
19230,
13,
11321,
13,
1136,
62,
44453,
1330,
651,
62,
44453,
201,
198,
201,
198,
4033,
796,
705,
1674... | 2.035294 | 85 |
# Copyright (C) 2017-2019 Tormod Landet
# SPDX-License-Identifier: Apache-2.0
"""
This defines a set of small and relatively fast regression tests
which can be run by use of pytest. Run
python3 -m pytest -vs cases/regresion_tests.py
to execute all regression tests
"""
import os
import sys
import pytest
CASEDIR = ... | [
2,
15069,
357,
34,
8,
2177,
12,
23344,
309,
579,
375,
6379,
316,
198,
2,
30628,
55,
12,
34156,
12,
33234,
7483,
25,
24843,
12,
17,
13,
15,
198,
37811,
198,
1212,
15738,
257,
900,
286,
1402,
290,
5365,
3049,
20683,
5254,
198,
4758,... | 2.981043 | 211 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import threading
import shutil
import fnmatch
import os
import subprocess
import os.path
import time
import glob
import run
from multiprocessing import Process
DATA_FOLDER_ALL = ['/0113_NRRD_CROPPED','/0117_NRRD_CROPPED','/0120_NRRD_CROPPED','/0123_NRRD_CROPPED','/0128_... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
4704,
278,
198,
11748,
4423,
346,
198,
11748,
24714,
15699,
198,
11748,
28686,
198,
11748,
850,
14681,
198,
... | 2.101695 | 472 |
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
Copyright (C) 2017-2019 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
24893,
1087,
318,
10607,
284,
1104,
262,
1280,
2723,
2055,
416,
1642,
5525,
241,
251,
165,
110,
116,
162,
247,
118,
12859,
239,
47,
7252,
50,
33176,
111,
2... | 3.779592 | 245 |
import sys
import torch
import torch.onnx.symbolic_helper as sym_help
from torch.autograd import Function
from torch.onnx import is_in_onnx_export
from torch.onnx.symbolic_opset9 import reshape
from torch.onnx.symbolic_opset10 import _slice
from ..utils.misc import topk, dummy_pad
from ...ops.nms import batched_nms
f... | [
11748,
25064,
198,
198,
11748,
28034,
198,
11748,
28034,
13,
261,
77,
87,
13,
1837,
2022,
4160,
62,
2978,
525,
355,
5659,
62,
16794,
198,
6738,
28034,
13,
2306,
519,
6335,
1330,
15553,
198,
6738,
28034,
13,
261,
77,
87,
1330,
318,
6... | 2.264968 | 785 |
# -*- coding: utf-8 -
#
# This file is part of uzmq. See the NOTICE for more information.
import pyuv
import zmq
import uzmq
loop = pyuv.Loop.default_loop()
ctx = zmq.Context()
s = ctx.socket(zmq.REP)
s.bind('tcp://127.0.0.1:5555')
stream = uzmq.ZMQ(loop, s)
stream.start_read(echo)
loop.run()
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
198,
2,
198,
2,
770,
2393,
318,
636,
286,
334,
89,
76,
80,
13,
4091,
262,
28536,
329,
517,
1321,
13,
198,
198,
11748,
12972,
14795,
198,
11748,
1976,
76,
80,
198,
11748,
334,
89... | 2.20438 | 137 |
#coding=utf-8
from mongoengine import *
import datetime
from base.settings import CHATPAMONGO
from app.customer.models.user import User, UserInviteCode
import logging
connect(CHATPAMONGO.db, host=CHATPAMONGO.host, port=CHATPAMONGO.port, username=CHATPAMONGO.username,
password=CHATPAMONGO.password)
class Tic... | [
2,
66,
7656,
28,
40477,
12,
23,
198,
198,
6738,
285,
25162,
18392,
1330,
1635,
198,
11748,
4818,
8079,
198,
6738,
2779,
13,
33692,
1330,
5870,
1404,
47,
2390,
1340,
11230,
198,
6738,
598,
13,
23144,
263,
13,
27530,
13,
7220,
1330,
1... | 1.885856 | 806 |
from abc import abstractmethod, ABC
from entities.account import Account
from entities.my_reimbursements import MyReimbursement
| [
6738,
450,
66,
1330,
12531,
24396,
11,
9738,
198,
198,
6738,
12066,
13,
23317,
1330,
10781,
198,
6738,
12066,
13,
1820,
62,
260,
320,
21780,
902,
1330,
2011,
3041,
320,
21780,
434,
198
] | 3.909091 | 33 |
'''
尋找水仙花數: 一個 3 位數,每一位數 的數字的立方和,等於自己
'''
for i in range(100,1000):
min=i%10
mid=(i//10)%10
high=i//100 #得商數
if i == min**3+mid**3+high**3:
print(i)
'''
反轉輸入數字
'''
num=int(input("請輸入一個整數: "))
reversed_num=0
while num>0:
reversed_num=reversed_num*10+num%10
num //= 10
print(reversed_num... | [
7061,
6,
198,
22887,
233,
33699,
122,
36365,
112,
20015,
247,
164,
46788,
46763,
116,
171,
120,
248,
220,
31660,
161,
222,
233,
513,
220,
19526,
235,
46763,
116,
171,
120,
234,
162,
107,
237,
31660,
19526,
235,
46763,
116,
13328,
248,... | 1.34095 | 1,663 |
# Generated by Django 4.0.3 on 2022-04-25 19:24
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
| [
2,
2980,
515,
416,
37770,
604,
13,
15,
13,
18,
319,
33160,
12,
3023,
12,
1495,
678,
25,
1731,
198,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
198,
11748,
42625,
142... | 3.019231 | 52 |
from sklearn.model_selection import KFold
def kfold(x,y):
'''
Inputs -- x - independent variables
y - dependent variables
Outputs -- Predicted values of dependent variable y
and the accuracy score of the model.
Description -- This function takes the independent and
... | [
6738,
1341,
35720,
13,
19849,
62,
49283,
1330,
509,
37,
727,
201,
198,
4299,
479,
11379,
7,
87,
11,
88,
2599,
201,
198,
220,
220,
220,
705,
7061,
201,
198,
220,
220,
220,
23412,
82,
1377,
2124,
532,
4795,
9633,
201,
198,
220,
220,... | 2.318182 | 308 |
from django.db import models
| [
6738,
42625,
14208,
13,
9945,
1330,
4981,
628,
628
] | 3.555556 | 9 |
import pprint
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
DEVICES = [
'nvidia-tesla-k80',
'nvidia-tesla-p100',
'nvidia-tesla-p4',
'nvidia-tesla-v100',
'nvidia-tesla-t4',
'nvidia-tesla-a100',
]
PRICES = {
'nvidia-tesla-k80': 0.45,
... | [
11748,
279,
4798,
198,
11748,
2603,
29487,
8019,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
299,
32152,
355,
45941,
628,
198,
39345,
34444,
796,
685,
198,
220,
220,
220,
220,
220,
220,
220,
705,
77,
2174... | 1.705882 | 391 |
age = 20
# elif 如果满足其中任一条件, 就会忽略剩下的条件判断
if age >= 6 :
print(1)
elif age >= 20 :
print(2)
else :
print(3)
# s = input("year:\n")
# birth = int(s)
#
# if birth > 2000:
# print("2000")
# else:
# print("1000")
print('------------------------')
| [
198,
496,
796,
1160,
198,
2,
1288,
361,
10263,
99,
224,
162,
252,
250,
162,
119,
94,
164,
114,
111,
17739,
114,
40792,
20015,
119,
31660,
30266,
94,
20015,
114,
11,
10263,
108,
109,
27670,
248,
161,
4204,
45911,
98,
30298,
102,
1031... | 1.745098 | 153 |
#!/usr/bin/env python
from .version import __version__ # noqa
from .api import * # noqa
from .cli import * # noqa
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
6738,
764,
9641,
1330,
11593,
9641,
834,
220,
1303,
645,
20402,
198,
6738,
764,
15042,
1330,
1635,
220,
1303,
645,
20402,
198,
6738,
764,
44506,
1330,
1635,
220,
1303,
645,
20402,
... | 2.809524 | 42 |
"""
File: 144.py
Title: Binary Tree Preorder Traversal
Difficulty: Medium
URL: https://leetcode.com/problems/binary-tree-preorder-traversal/
"""
import unittest
from typing import List
if __name__ == "__main__":
unittest.main()
| [
37811,
198,
220,
220,
220,
9220,
25,
20224,
13,
9078,
198,
220,
220,
220,
11851,
25,
45755,
12200,
3771,
2875,
4759,
690,
282,
198,
220,
220,
220,
27419,
25,
13398,
198,
220,
220,
220,
10289,
25,
3740,
1378,
293,
316,
8189,
13,
785,... | 2.628866 | 97 |
#!/usr/bin/env python
# -*- coding: utf_8 -*
#
# Script to reformat xlsx tables from Akamai State of the Internet into a single SQL table
#
# Alex Mandel 2014
# tech@wildintellect.com
# requires pandas, xlrd
import pandas as pd
import sqlite3
if __name__ == '__main__':
#update the infile and the table if d... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
62,
23,
532,
9,
198,
2,
198,
2,
12327,
284,
4975,
265,
2124,
7278,
87,
8893,
422,
9084,
1689,
72,
1812,
286,
262,
4455,
656,
257,
2060,
16363,... | 2.579937 | 319 |
# -*- coding: utf-8 -*-
# MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
#
# Copyright (c) 2014-2020 Megvii Inc. All rights reserved.
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT ARRANTI... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
8336,
13798,
318,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
4943,
198,
2,
198,
2,
15069,
357,
66,
8,
1946,
12,
42334,
8336,
85... | 2.459459 | 555 |
from .projects import *
from .staffing import *
| [
6738,
764,
42068,
1330,
1635,
198,
6738,
764,
28120,
278,
1330,
1635,
198
] | 3.692308 | 13 |
from ..remote import RemoteModel
from infoblox_netmri.utils.utils import check_api_availability
class UploadedCertificateRemote(RemoteModel):
"""
Repository of uploaded CA certificates for Active Directory, IF-MAP Server Connections, and other services.
| ``id:`` The internal NetMRI identifier for ... | [
6738,
11485,
47960,
1330,
21520,
17633,
198,
6738,
1167,
45292,
1140,
62,
3262,
76,
380,
13,
26791,
13,
26791,
1330,
2198,
62,
15042,
62,
47274,
628,
198,
4871,
36803,
276,
37608,
22460,
36510,
7,
36510,
17633,
2599,
198,
220,
220,
220,... | 2.451128 | 399 |
from django.apps import AppConfig
| [
6738,
42625,
14208,
13,
18211,
1330,
2034,
16934,
628
] | 3.888889 | 9 |
from pybricks.pupdevices import Motor, DCMotor, Remote
from pybricks.parameters import Port, Direction, Button, Color
from pybricks.tools import wait
# Connect to the remote.
remote = Remote()
# Initialize the drive motors.
drive_motor1 = Motor(Port.A)
drive_motor2 = Motor(Port.B)
# Lower the acceleration so it star... | [
6738,
12972,
65,
23706,
13,
79,
929,
42034,
1330,
12533,
11,
6257,
34919,
11,
21520,
198,
6738,
12972,
65,
23706,
13,
17143,
7307,
1330,
4347,
11,
41837,
11,
20969,
11,
5315,
198,
6738,
12972,
65,
23706,
13,
31391,
1330,
4043,
198,
19... | 2.642093 | 841 |
import serial
from serial.tools import list_ports
# Returns True on successful data tx
| [
11748,
11389,
198,
6738,
11389,
13,
31391,
1330,
1351,
62,
3742,
628,
220,
220,
220,
1303,
16409,
6407,
319,
4388,
1366,
27765,
198
] | 4 | 23 |
from django.urls import path
from demanage.members.api.views import member_list_view, member_retrive_view
app_name = "members"
urlpatterns = [
path("members/", member_list_view, name="list"),
path("members/<str:username>/", member_retrive_view, name="detail"),
]
| [
6738,
42625,
14208,
13,
6371,
82,
1330,
3108,
198,
198,
6738,
1357,
272,
496,
13,
30814,
13,
15042,
13,
33571,
1330,
2888,
62,
4868,
62,
1177,
11,
2888,
62,
1186,
11590,
62,
1177,
198,
198,
1324,
62,
3672,
796,
366,
30814,
1,
198,
... | 2.84375 | 96 |
from z3 import BitVec, BitVecVal
from copy import copy, deepcopy
from enum import Enum
class Account:
"""
Account class representing ethereum accounts
"""
def __init__(self, address, code=None, contract_name="unknown", balance=None):
"""
Constructor for account
:param address: ... | [
6738,
1976,
18,
1330,
4722,
53,
721,
11,
4722,
53,
721,
7762,
198,
6738,
4866,
1330,
4866,
11,
2769,
30073,
198,
6738,
33829,
1330,
2039,
388,
628,
198,
4871,
10781,
25,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
10781,
1398,
10... | 2.533575 | 1,102 |
#!/usr/bin/env python
# -*- coding: utf8 -*-
import socket
import signal
from datetime import datetime
continue_reading = True
ClientMultiSocket = socket.socket()
host = '192.168.138.45'
port = 1234
print('Waiting for server response...')
try:
ClientMultiSocket.connect((host, po... | [
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,
1303,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
23,
... | 2.542725 | 433 |
# Simulation of tripartite synapse model
# Tiina Manninen and Ausra Saudargiene
# Reference: Tiina Manninen, Ausra Saudargiene, and Marja-Leena Linne. Astrocyte-mediated spike-timing-dependent
# long-term depression modulates synaptic properties in the developing cortex. PLoS Comput Biol, 2020.
# ---------------------... | [
2,
41798,
286,
1333,
3911,
578,
6171,
7512,
2746,
198,
2,
16953,
1437,
20291,
42326,
290,
27545,
430,
6746,
853,
72,
1734,
198,
2,
20984,
25,
16953,
1437,
20291,
42326,
11,
27545,
430,
6746,
853,
72,
1734,
11,
290,
1526,
6592,
12,
3... | 4.369369 | 111 |
import struct, unittest
from bibliopixel.util import artnet_message, udp
from bibliopixel.colors import printer
from bibliopixel.animation import tests as animation_tests
from test.bibliopixel import mark_tests
from test.bibliopixel.project import make
from test.bibliopixel.util import udp_test
from bibliopixel.drivers... | [
11748,
2878,
11,
555,
715,
395,
198,
6738,
275,
29142,
404,
7168,
13,
22602,
1330,
1242,
3262,
62,
20500,
11,
334,
26059,
198,
6738,
275,
29142,
404,
7168,
13,
4033,
669,
1330,
20632,
198,
6738,
275,
29142,
404,
7168,
13,
11227,
341,
... | 2.651163 | 215 |
'''
Description:
We have an array A of integers, and an array queries of queries.
For the i-th query val = queries[i][0], index = queries[i][1], we add val to A[index]. Then, the answer to the i-th query is the sum of the even values of A.
(Here, the given index = queries[i][1] is a 0-based index, and each query p... | [
7061,
6,
198,
198,
11828,
25,
198,
198,
1135,
423,
281,
7177,
317,
286,
37014,
11,
290,
281,
7177,
20743,
286,
20743,
13,
198,
198,
1890,
262,
1312,
12,
400,
12405,
1188,
796,
20743,
58,
72,
7131,
15,
4357,
6376,
796,
20743,
58,
7... | 2.761484 | 566 |
from ._VoidWriter import VoidWriter
| [
6738,
47540,
53,
1868,
34379,
1330,
18331,
34379,
198
] | 4 | 9 |
# -*- coding: utf-8 -*-
from multiprocessing import cpu_count
from djangocli.constants import EnvType
from djangocli.core.env import get_env
# APP INFO
APP_NAME = get_env(key="APP_NAME", default="django-cli", _type=str)
APP_VERSION = get_env(key="APP_VERSION", default="0.0.0", _type=str)
SECRET_KEY = get_env(key="SE... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
6738,
18540,
305,
919,
278,
1330,
42804,
62,
9127,
198,
198,
6738,
42625,
648,
420,
4528,
13,
9979,
1187,
1330,
2039,
85,
6030,
198,
6738,
42625,
648,
420,
4528,
... | 2.229299 | 785 |
from abc import ABC, abstractmethod | [
6738,
450,
66,
1330,
9738,
11,
12531,
24396
] | 4.375 | 8 |
from django import forms
from artcloud.arts.models import Comment
| [
6738,
42625,
14208,
1330,
5107,
198,
198,
6738,
1242,
17721,
13,
5889,
13,
27530,
1330,
18957,
628
] | 4 | 17 |
import os
from abc import ABCMeta, abstractmethod
from future.utils import with_metaclass
import numpy as np
from neurokernel.LPU.utils.simpleio import *
# Classes in alphabetic order
# Not used, class overrides generate_2dimage
# and this function is not supposed to be called
def savefig(values, y... | [
198,
11748,
28686,
198,
6738,
450,
66,
1330,
9738,
48526,
11,
12531,
24396,
198,
6738,
2003,
13,
26791,
1330,
351,
62,
4164,
330,
31172,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
7669,
33885,
13,
43,
5105,
13,
26791,
13,
36439,
9... | 2.395379 | 779 |
import avalon.api
class SetsLoader(avalon.api.Loader):
"""(Deprecated)"""
label = "Add Sets"
order = 90
icon = "leaf"
color = "gray"
hosts = ["maya"]
families = [
"reveries.model",
"reveries.pointcache",
"reveries.setdress",
]
representations = [
... | [
198,
11748,
37441,
261,
13,
15042,
628,
198,
4871,
21394,
17401,
7,
9226,
261,
13,
15042,
13,
17401,
2599,
198,
220,
220,
220,
13538,
18109,
12156,
31023,
8,
37811,
628,
220,
220,
220,
6167,
796,
366,
4550,
21394,
1,
198,
220,
220,
... | 2.07027 | 185 |
import os
import errno
import inspect
here = os.path.dirname(os.path.abspath(inspect.stack()[0][1]))
source_root = os.path.join('..', 'src')
generation_root = os.path.join('..', 'gen')
distribution_root = os.path.join('..', 'dst')
source_path = os.path.abspath(os.path.join(here, source_root))
generation_path = os.pa... | [
11748,
28686,
198,
11748,
11454,
3919,
198,
11748,
10104,
198,
198,
1456,
796,
28686,
13,
6978,
13,
15908,
3672,
7,
418,
13,
6978,
13,
397,
2777,
776,
7,
1040,
806,
13,
25558,
3419,
58,
15,
7131,
16,
60,
4008,
198,
198,
10459,
62,
... | 2.642857 | 168 |
from dog_class import Dog | [
6738,
3290,
62,
4871,
1330,
8532
] | 4.166667 | 6 |
from abc import abstractmethod, ABCMeta
from toscaparser.tosca_template import ToscaTemplate
import networkx as nx
# import matplotlib.pyplot as plt
| [
6738,
450,
66,
1330,
12531,
24396,
11,
9738,
48526,
198,
198,
6738,
284,
1416,
499,
28198,
13,
83,
418,
6888,
62,
28243,
1330,
40195,
6888,
30800,
198,
11748,
3127,
87,
355,
299,
87,
198,
198,
2,
1330,
2603,
29487,
8019,
13,
9078,
2... | 3.234043 | 47 |
import torch
from scem import gen, stein, kernel, ebm
from scem import util
# learning GRBM posterior with kcsd
if __name__ == '__main__':
main() | [
11748,
28034,
198,
6738,
264,
344,
76,
1330,
2429,
11,
2876,
259,
11,
9720,
11,
304,
20475,
198,
6738,
264,
344,
76,
1330,
7736,
628,
198,
198,
2,
4673,
10863,
12261,
34319,
351,
479,
6359,
67,
628,
198,
361,
11593,
3672,
834,
6624,... | 2.851852 | 54 |
# Definition for a binary tree node.
# class TreeNode:
# def __init__(self, val=0, left=None, right=None):
# self.val = val
# self.left = left
# self.right = right | [
2,
30396,
329,
257,
13934,
5509,
10139,
13,
198,
2,
1398,
12200,
19667,
25,
198,
2,
220,
220,
220,
220,
825,
11593,
15003,
834,
7,
944,
11,
1188,
28,
15,
11,
1364,
28,
14202,
11,
826,
28,
14202,
2599,
198,
2,
220,
220,
220,
220,... | 2.27381 | 84 |
from rest_framework import serializers
| [
6738,
1334,
62,
30604,
1330,
11389,
11341,
198
] | 4.875 | 8 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import pickle
import unittest
import properties
if __name__ == '__main__':
unittest.main()
| [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
6738,
11593,
37443,
834,
1330,
7297,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
11748,
2298,
293,
1... | 3.410959 | 73 |
from pathlib import Path
from PyQt5.QtWidgets import QMainWindow, QDockWidget
from piafedit.gui.image.views.overview import Overview
from piafedit.gui.notebook import Notebook
from piafedit.ui_utils import resources_path
LAYOUT_BACKUP_PATH = Path('layout.gui')
| [
6738,
3108,
8019,
1330,
10644,
198,
198,
6738,
9485,
48,
83,
20,
13,
48,
83,
54,
312,
11407,
1330,
1195,
13383,
27703,
11,
1195,
35,
735,
38300,
198,
198,
6738,
279,
544,
19082,
270,
13,
48317,
13,
9060,
13,
33571,
13,
2502,
1177,
... | 2.912088 | 91 |
"""Copyright (c) 2022 Juraj Zelman"""
import os
import shutil
from pathlib import Path
import click
if __name__ == "__main__":
postSetup()
| [
37811,
15269,
357,
66,
8,
33160,
23383,
1228,
1168,
32370,
37811,
198,
198,
11748,
28686,
198,
11748,
4423,
346,
198,
6738,
3108,
8019,
1330,
10644,
198,
198,
11748,
3904,
628,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834... | 2.96 | 50 |
# Copyright (c) 2012 iQIYI Inc.
# Copyright (c) 2013 Tencent Inc.
# Copyright (c) 2014 Huahang Liu
#
# All rights reserved.
#
# Author: Jingxu Chen <chenjingxu@qiyi.com>
# Feng Chen <chen3feng@gmail.com>
# Huahang Liu <liuhuahang@zerus.co>
#
# Date: June 28, 2014
"""
Helper classes to get the files g... | [
2,
15069,
357,
66,
8,
2321,
1312,
48,
40,
56,
40,
3457,
13,
198,
2,
15069,
357,
66,
8,
2211,
9368,
1087,
3457,
13,
198,
2,
15069,
357,
66,
8,
1946,
11256,
993,
648,
18258,
198,
2,
198,
2,
1439,
2489,
10395,
13,
198,
2,
198,
... | 2.842105 | 209 |
from mimid.common import CallArguments
from mimid.matchers.call import SpecificCallArgumentsMatcher
from mimid.matchers.value import eq
| [
6738,
17007,
312,
13,
11321,
1330,
4889,
28100,
2886,
198,
6738,
17007,
312,
13,
6759,
3533,
13,
13345,
1330,
17377,
14134,
28100,
2886,
19044,
2044,
198,
6738,
17007,
312,
13,
6759,
3533,
13,
8367,
1330,
37430,
628,
628,
628,
628,
628,... | 3.5 | 42 |
import re
import time
from os import path
from typing import Any, Dict
import latest_user_agents
import requests
from requests.models import Response
from tealprint import TealPrint
from ..config import config
from ..core.errors.download_failed import DownloadFailed
_headers = {"User-Agent": latest_user_agents.get_r... | [
11748,
302,
198,
11748,
640,
198,
6738,
28686,
1330,
3108,
198,
6738,
19720,
1330,
4377,
11,
360,
713,
198,
198,
11748,
3452,
62,
7220,
62,
49638,
198,
11748,
7007,
198,
6738,
7007,
13,
27530,
1330,
18261,
198,
6738,
573,
282,
4798,
1... | 3.677419 | 93 |
import pytorch_lightning as pl
from pytorch_lightning.callbacks.early_stopping import EarlyStopping
from pytorch_lightning.callbacks import ModelCheckpoint
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.optim.lr_scheduler import ReduceLROnPlateau
from classifiers.DL_... | [
11748,
12972,
13165,
354,
62,
2971,
768,
355,
458,
198,
6738,
12972,
13165,
354,
62,
2971,
768,
13,
13345,
10146,
13,
11458,
62,
301,
33307,
1330,
12556,
1273,
33307,
198,
6738,
12972,
13165,
354,
62,
2971,
768,
13,
13345,
10146,
1330,
... | 2.073984 | 1,230 |
# Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... | [
2,
220,
220,
220,
15069,
12131,
7458,
286,
8366,
7412,
38589,
11,
2679,
15523,
4992,
3337,
357,
48510,
37,
57,
828,
679,
5943,
3900,
11,
4486,
198,
2,
198,
2,
220,
220,
220,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
3... | 3.463333 | 300 |
"""
AUTO_BOT db helper file
Developers: Andrey Kozlovsky, Stanislav Ermokhin
"""
import sql
import re
import datetime
import local_ru as local
COLUMNS = {'oil', 'filter', 'insurance', 'tech_check', 'air_tires'}
# Users ----------------------------------------------------------------
def user_city(username):
... | [
37811,
198,
39371,
46,
62,
33,
2394,
20613,
31904,
2393,
198,
198,
19246,
364,
25,
843,
4364,
40772,
27086,
15688,
11,
7299,
3044,
615,
5256,
76,
482,
20079,
198,
198,
37811,
198,
198,
11748,
44161,
198,
11748,
302,
198,
11748,
4818,
... | 2.297713 | 4,810 |
import socket
import os
import pytest
from unittest import mock
from urllib.error import URLError
from pytube import request
from pytube.exceptions import MaxRetriesExceeded
@mock.patch("pytube.request.urlopen")
@mock.patch('pytube.request.urlopen')
@mock.patch("pytube.request.urlopen")
@mock.patch("pytube.req... | [
11748,
17802,
198,
11748,
28686,
198,
11748,
12972,
9288,
198,
6738,
555,
715,
395,
1330,
15290,
198,
6738,
2956,
297,
571,
13,
18224,
1330,
37902,
2538,
81,
1472,
198,
198,
6738,
12972,
29302,
1330,
2581,
198,
6738,
12972,
29302,
13,
1... | 2.947368 | 114 |
import dash
import dash_bootstrap_components as dbc
import dash_html_components as html
import dash_core_components as dcc
from dash.dependencies import Input, Output, State
from dash import no_update
import pandas as pd
import plotly.express as px
import plotly.figure_factory as ff
import os
import sys
import copy
i... | [
11748,
14470,
198,
11748,
14470,
62,
18769,
26418,
62,
5589,
3906,
355,
288,
15630,
198,
11748,
14470,
62,
6494,
62,
5589,
3906,
355,
27711,
198,
11748,
14470,
62,
7295,
62,
5589,
3906,
355,
288,
535,
198,
6738,
14470,
13,
45841,
3976,
... | 2.496261 | 1,471 |
import time
from DBUtils.PooledDB import PooledDB
import pymysql
from pymysql.cursors import DictCursor
from datasets.data_utils.db.dbconfig import DBConfig
"""
urls:flag
0-爬虫已爬取到
1-可以下载
2-下载损坏
download_record:flag
0-已下载未处理
1-无损坏
2-无重复
-1-损坏或者重复图片
"""
| [
11748,
640,
198,
198,
6738,
20137,
18274,
4487,
13,
27201,
276,
11012,
1330,
19850,
276,
11012,
198,
11748,
279,
4948,
893,
13976,
198,
6738,
279,
4948,
893,
13976,
13,
66,
1834,
669,
1330,
360,
713,
34,
21471,
198,
6738,
40522,
13,
7... | 1.488506 | 174 |
# -*- coding: utf-8 -*-
"""
ContactInfo object storage repository.
"""
from abc import ABCMeta
from app.crud.base import Repository
from app.crud.base import T
from app.models.contact_info import ContactInfoCreate
from app.models.contact_info import ContactInfoUpdate
class ContactInfoRepository(
Repository[T, Co... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
17829,
12360,
2134,
6143,
16099,
13,
198,
37811,
198,
6738,
450,
66,
1330,
9738,
48526,
198,
198,
6738,
598,
13,
6098,
463,
13,
8692,
1330,
1432,
13264,
198,... | 3.222222 | 144 |
print(f())
| [
198,
198,
4798,
7,
69,
28955,
198
] | 1.857143 | 7 |
import inspirobot
import random
print("-"*50)
flow = inspirobot.flow()
for quote in flow:
print(quote.text)
print("-"*50) | [
11748,
1035,
79,
7058,
13645,
198,
11748,
4738,
198,
198,
4798,
7203,
21215,
9,
1120,
8,
198,
11125,
796,
1035,
79,
7058,
13645,
13,
11125,
3419,
198,
1640,
9577,
287,
5202,
25,
198,
220,
220,
220,
3601,
7,
22708,
13,
5239,
8,
198,
... | 2.571429 | 49 |
for _ in range(10):
print(_)
| [
1640,
4808,
287,
2837,
7,
940,
2599,
198,
220,
220,
220,
3601,
28264,
8,
628
] | 2.266667 | 15 |
from dataclasses import dataclass
@dataclass
class DisplayBounds:
""" Holds the 4 corner points of a 2D bounding box """
x_min : float = 99999999999.0
x_max : float = -99999999999.0
y_min : float = 99999999999.0
y_max : float = -99999999999.0
@property
@property
... | [
6738,
4818,
330,
28958,
1330,
4818,
330,
31172,
628,
198,
31,
19608,
330,
31172,
198,
4871,
16531,
33,
3733,
25,
198,
220,
220,
220,
37227,
9340,
82,
262,
604,
5228,
2173,
286,
257,
362,
35,
5421,
278,
3091,
37227,
198,
220,
220,
22... | 2.265306 | 147 |
"""
Synthesis classes.
"""
from z3 import Solver, sat
from z3 import String, StringVal, Concat
from z3 import Re, InRe, Union, Star, Plus
from z3 import Int, Real
from z3 import BitVec
from z3 import And, Or, If
from datetime import datetime
from abc import ABC, abstractmethod
from saltyrtc.splice.splicetypes import... | [
37811,
198,
13940,
429,
8497,
6097,
13,
198,
37811,
198,
198,
6738,
1976,
18,
1330,
4294,
332,
11,
3332,
198,
6738,
1976,
18,
1330,
10903,
11,
10903,
7762,
11,
1482,
9246,
198,
6738,
1976,
18,
1330,
797,
11,
554,
3041,
11,
4479,
11,... | 2.302941 | 16,967 |
#detects the object
#gets the distance
#moves the eye until its in the middle
#receives and prints the angle in the main loop
#calculates the trig for the vert and horiz position of the detection
#receives mode from touchscreen remote
#allows mode switching
#publishes 2 different sets of vector 3 messages to move the a... | [
2,
15255,
478,
82,
262,
2134,
198,
2,
11407,
262,
5253,
198,
2,
76,
5241,
262,
4151,
1566,
663,
287,
262,
3504,
198,
2,
260,
344,
1083,
290,
20842,
262,
9848,
287,
262,
1388,
9052,
198,
2,
9948,
3129,
689,
262,
5192,
329,
262,
9... | 2.493963 | 1,905 |
import torch
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
from torch.nn import CrossEntropyLoss
from sklearn.utils.class_weight import compute_class_weight
class DiceLoss(torch.nn.Module):
""" Compute dice loss """
class FocalLoss(torch.nn.Module):... | [
11748,
28034,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
198,
6738,
28034,
13,
2306,
519,
6335,
1330,
35748,
198,
6738,
28034,
13,
20471,
1330,
6372... | 3.262411 | 141 |
from gui.editor_window import MainEditor | [
6738,
11774,
13,
35352,
62,
17497,
1330,
8774,
17171
] | 4.444444 | 9 |
# -*- coding: utf-8 -*-
"""
shepherd.shepherd_io
~~~~~
Interface layer, abstracting low-level functionality provided by PRUs and
kernel module. User-space part of the double-buffered data exchange protocol.
TODO: these files are getting to big, ~ 1000 LOC, refactor into class_X.py
:copyright: (c) 2019 Networked Embed... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
37811,
198,
7091,
23111,
13,
7091,
23111,
62,
952,
198,
8728,
93,
198,
39317,
7679,
11,
12531,
278,
1877,
12,
5715,
11244,
2810,
416,
4810,
5842,
290,
198,
33885,
... | 2.400317 | 8,196 |
n = int(input('Digite o 1º valor: '))
n2 = int(input('Digite o 2º valor: '))
s = 1
while s != 5:
print('''
[1] somar
[2] Multiplicar
[3] maior numero
[4] Novos numeros
[5] Sair do programa''')
s = int(input('Qual opçao?'))
if s == 1:
print('A soma entre {} e {} = {}'.format(n, n... | [
77,
796,
493,
7,
15414,
10786,
19511,
578,
267,
352,
36165,
1188,
273,
25,
705,
4008,
198,
77,
17,
796,
493,
7,
15414,
10786,
19511,
578,
267,
362,
36165,
1188,
273,
25,
705,
4008,
198,
82,
796,
352,
198,
4514,
264,
14512,
642,
25... | 1.938119 | 404 |
# -*- coding: utf-8 -*-
import re
import string
import json
from pkg_resources import resource_string
import Levenshtein
COMMON_BREWERY_TERMS = [
u'Trappistenbrouwerij',
u'Trappistenbier-Brauerei',
u'Bierbrouwerij',
u'Bryggeri & Spiseri',
u'Mikrobryggeri',
u'Microbirrificio',
u'Ølbryggeri'... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
302,
198,
11748,
4731,
198,
11748,
33918,
198,
6738,
279,
10025,
62,
37540,
1330,
8271,
62,
8841,
198,
198,
11748,
1004,
574,
1477,
22006,
198,
198,
9858,
27857,
... | 1.816024 | 674 |
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: proto/core/adp/scalar.proto
"""Generated protocol buffer code."""
# third party
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _re... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2980,
515,
416,
262,
8435,
11876,
17050,
13,
220,
8410,
5626,
48483,
0,
198,
2,
2723,
25,
44876,
14,
7295,
14,
324,
79,
14,
1416,
282,
283,
13,
1676,
1462,
198,
... | 1.843968 | 14,747 |
#!/usr/bin/env python
import rospy
from cv_bridge import CvBridge, CvBridgeError
import cv2
import numpy as np
from sensor_msgs.msg import CompressedImage,Image
import time
import io
# bridge = CvBridge()
# publisher = None
if __name__ == '__main__':
rospy.init_node('averageimg',anonymous=False)
node = Aver... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
11748,
686,
2777,
88,
198,
6738,
269,
85,
62,
9458,
1330,
327,
85,
37385,
11,
327,
85,
37385,
12331,
198,
11748,
269,
85,
17,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
12694,
62... | 2.765625 | 128 |
import os
from pydgeot.processors.builtins import register_builtins
available = {}
""":type: dict[str, callable[pydgeot.app.App]"""
class Processor:
"""
Base class for file processors. When generating content, an App will call can_process on each registered Processor,
adding those that return True to a ... | [
11748,
28686,
198,
6738,
279,
5173,
469,
313,
13,
14681,
669,
13,
18780,
1040,
1330,
7881,
62,
18780,
1040,
628,
198,
15182,
796,
23884,
198,
15931,
1298,
4906,
25,
8633,
58,
2536,
11,
869,
540,
58,
79,
5173,
469,
313,
13,
1324,
13,... | 2.715796 | 1,703 |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
# @Author: Jialiang Shi
from sonarqube.utils.rest_client import RestClient
from sonarqube.utils.config import (
API_PROJECT_LINKS_CREATE_ENDPOINT,
API_PROJECT_LINKS_DELETE_ENDPOINT,
API_PROJECT_LINKS_SEARCH_ENDPOINT,
)
from sonarqube.utils.common import GET, POST... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
40477,
12,
23,
532,
9,
12,
198,
2,
2488,
13838,
25,
449,
498,
15483,
16380,
198,
6738,
3367,
283,
421,
1350,
13,
26791,
13,
2118,
62,
16366,
1330,
8324,
... | 2.202797 | 572 |