content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
from __future__ import print_function
import os
import sys
import time
from .config import TSAdmCfg
_LEVELS = {
'OFF': 0,
'ERROR': 1,
'WARNING': 2,
'INFO': 3,
'DEBUG': 4,
}
| [
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
198,
11748,
28686,
198,
11748,
25064,
198,
11748,
640,
198,
198,
6738,
764,
11250,
1330,
26136,
2782,
76,
34,
40616,
198,
198,
62,
2538,
18697,
50,
796,
1391,
198,
220,
220,
220,
705... | 2.305882 | 85 |
"""
Selection for Newsvendor Demo
"""
from scse.api.module import Env
import logging
logger = logging.getLogger(__name__)
| [
37811,
198,
4653,
1564,
329,
3000,
85,
18738,
34588,
198,
37811,
198,
6738,
629,
325,
13,
15042,
13,
21412,
1330,
2039,
85,
198,
11748,
18931,
198,
198,
6404,
1362,
796,
18931,
13,
1136,
11187,
1362,
7,
834,
3672,
834,
8,
198
] | 3 | 41 |
from sleap.gui.commands import (
CommandContext,
ImportDeepLabCutFolder,
get_new_version_filename,
)
from sleap.io.pathutils import fix_path_separator
from pathlib import PurePath
| [
6738,
3133,
499,
13,
48317,
13,
9503,
1746,
1330,
357,
198,
220,
220,
220,
9455,
21947,
11,
198,
220,
220,
220,
17267,
29744,
17822,
26254,
41092,
11,
198,
220,
220,
220,
651,
62,
3605,
62,
9641,
62,
34345,
11,
198,
8,
198,
6738,
... | 2.954545 | 66 |
import plots
import seaborn as sns
import os.path
import networkx as nx
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import random
import plotly.graph_objects as go
import plotly
plt.close('all')
sns.set(context='notebook',style='darkgrid',font_scale=1.3)
plt.rc('text', usetex=True)
plt.rc('f... | [
11748,
21528,
198,
11748,
384,
397,
1211,
355,
3013,
82,
198,
11748,
28686,
13,
6978,
198,
11748,
3127,
87,
355,
299,
87,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
2603,
29487,
8019,
13,
907... | 2.192294 | 5,762 |
from typing import Any, Mapping, NamedTuple, Optional, Union
from pydantic import BaseModel
from starlette.responses import FileResponse as FileResponse # noqa: F401
from starlette.responses import HTMLResponse as HTMLResponse # noqa: F401
from starlette.responses import JSONResponse as JSONResponse # noqa: F401
fr... | [
6738,
19720,
1330,
4377,
11,
337,
5912,
11,
34441,
51,
29291,
11,
32233,
11,
4479,
198,
198,
6738,
279,
5173,
5109,
1330,
7308,
17633,
198,
6738,
3491,
21348,
13,
16733,
274,
1330,
9220,
31077,
355,
9220,
31077,
220,
1303,
645,
20402,
... | 3.552124 | 259 |
##############################################################
# demonstration script for resampling, stacking, mosaicking and subsetting SAR images
# John Truckenbrodt 2017
##############################################################
import os
from pyroSAR.ancillary import finder, groupbyTime, seconds
from pyroSAR.... | [
29113,
14468,
7804,
4242,
2235,
198,
2,
13646,
4226,
329,
581,
321,
11347,
11,
41228,
11,
39788,
7958,
290,
24637,
889,
47341,
4263,
198,
2,
1757,
24892,
268,
7957,
28664,
2177,
198,
29113,
14468,
7804,
4242,
2235,
198,
11748,
28686,
19... | 4.280899 | 89 |
from flask_wtf import form
from wtforms import StringField, IntegerField, TextAreaField, SubmitField, RadioField, SelectField, validators, ValidationError
| [
6738,
42903,
62,
86,
27110,
1330,
1296,
201,
198,
6738,
266,
83,
23914,
1330,
10903,
15878,
11,
34142,
15878,
11,
8255,
30547,
15878,
11,
39900,
15878,
11,
8829,
15878,
11,
9683,
15878,
11,
4938,
2024,
11,
3254,
24765,
12331,
201,
198,
... | 3.577778 | 45 |
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from unittest import TestCase
from tempfile import NamedTemporaryFile
from .. import Draft, Color
from ..render import ImageRenderer, SVGRenderer
| [
6738,
11593,
37443,
834,
1330,
357,
48546,
62,
11748,
11,
7297,
11,
3601,
62,
8818,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
28000,
1098,
62,
17201... | 2.965517 | 87 |
import csv
import urllib
import subprocess
import sys
import os
from datetime import datetime, timedelta
# Get args
if str(sys.argv[1]).isalnum():
source = sys.argv[1]
sources = {'comb' : 'comb_ats',
'jpl' : 'jpl_ats',
'sopac' : 'sopac_ats'}
src = str(sources[source])
if os.path.exists(src+'.jso... | [
11748,
269,
21370,
198,
11748,
2956,
297,
571,
198,
11748,
850,
14681,
198,
11748,
25064,
198,
11748,
28686,
198,
6738,
4818,
8079,
1330,
4818,
8079,
11,
28805,
12514,
198,
198,
2,
3497,
26498,
198,
361,
965,
7,
17597,
13,
853,
85,
58... | 2.013096 | 1,069 |
from typing import List
from guniflask.beans.lifecycle import InitializingBean
from guniflask.security.authentication import Authentication
from guniflask.security.authentication_manager import AuthenticationManager
from guniflask.security.authentication_provider import AuthenticationProvider
from guniflask.security.e... | [
6738,
19720,
1330,
7343,
198,
198,
6738,
2485,
361,
75,
2093,
13,
44749,
13,
36195,
47510,
1330,
20768,
2890,
3856,
272,
198,
6738,
2485,
361,
75,
2093,
13,
12961,
13,
41299,
3299,
1330,
48191,
198,
6738,
2485,
361,
75,
2093,
13,
1296... | 4.383721 | 86 |
class PreTrainFactory:
"""The model factory used to assign and construct different models.
Thanks to Real Python's Factory Method tutorial for guidance on
getting this to work.
https://realpython.com/factory-method-python/
"""
def register_pretrain_builders(self, key, builder):
"""This... | [
4871,
3771,
44077,
22810,
25,
198,
220,
220,
220,
37227,
464,
2746,
8860,
973,
284,
8333,
290,
5678,
1180,
4981,
13,
198,
220,
220,
220,
6930,
284,
6416,
11361,
338,
19239,
11789,
11808,
329,
11154,
319,
198,
220,
220,
220,
1972,
428,... | 2.62256 | 461 |
projects = {}
with open('result.csv', 'r') as f:
skip_line = True
for line in f:
if skip_line:
skip_line = False
continue
line = line.strip()
projectname = line.split(',')[0]
if projectname not in projects:
projects[projectname] = [line]
... | [
198,
42068,
796,
23884,
198,
198,
4480,
1280,
10786,
20274,
13,
40664,
3256,
705,
81,
11537,
355,
277,
25,
198,
220,
220,
220,
14267,
62,
1370,
796,
6407,
198,
220,
220,
220,
329,
1627,
287,
277,
25,
198,
220,
220,
220,
220,
220,
... | 2.173107 | 647 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
""" Functions to process Hyspex imu and gps data.
@author: Nanfeng Liu (nliu58@wisc.edu)
"""
import logging, os, osr, numpy as np
logger = logging.getLogger(__name__)
def prepare_imugps_Hyspex(processed_imugps_file, raw_imugps_file, boresight_offsets, map_crs, boresight... | [
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,
37811,
40480,
284,
1429,
367,
893,
24900,
545,
84,
290,
308,
862,
1366,
13,
198,
31,
9800,
25,
18008,
69,
... | 2.088599 | 1,456 |
# This file duplicated from the Yelp MRJob project:
#
# https://github.com/Yelp/mrjob
#
#
# Copyright 2009-2013 Yelp, David Marin
# Copyright 2015 Yelp
# Copyright 2017 Yelp
# Copyright 2018 Contributors
# Copyright 2019 Yelp and Contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you m... | [
2,
770,
2393,
14184,
3474,
422,
262,
44628,
17242,
33308,
1628,
25,
198,
2,
198,
2,
220,
220,
3740,
1378,
12567,
13,
785,
14,
56,
417,
79,
14,
43395,
21858,
198,
2,
198,
2,
198,
2,
15069,
3717,
12,
6390,
44628,
11,
3271,
36384,
... | 2.502836 | 1,587 |
#!/usr/bin/env python
# encoding: utf-8
name = "Solvent Descriptors"
shortDesc = u""
longDesc = u"""
"""
entry(
index = 1,
label = "water",
molecule = "O",
solvent = SolventData(
s_g = 2.743,
b_g = 4.814,
e_g = 0.822,
l_g = -0.213,
a_g = 3.904,
c_g = -1.... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
21004,
25,
3384,
69,
12,
23,
198,
198,
3672,
796,
366,
36949,
1151,
2935,
6519,
669,
1,
198,
19509,
24564,
796,
334,
15931,
198,
6511,
24564,
796,
334,
37811,
198,
198,
37811,
198... | 1.504 | 1,625 |
#!/usr/bin/env python3
import os
import contextlib
from PyQt5 import QtCore, QtWidgets
from dsrlib.settings import Settings
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
11748,
28686,
198,
11748,
4732,
8019,
198,
198,
6738,
9485,
48,
83,
20,
1330,
33734,
14055,
11,
33734,
54,
312,
11407,
198,
198,
6738,
288,
27891,
8019,
13,
33692,
1330,
16163... | 2.911111 | 45 |
from PyQt5.QtWidgets import (
QVBoxLayout,
QTextEdit,
QFrame,
QWidget
)
from PyQt5.QtGui import(
QFont,
) | [
6738,
9485,
48,
83,
20,
13,
48,
83,
54,
312,
11407,
1330,
357,
198,
220,
220,
220,
1195,
53,
14253,
32517,
11,
198,
220,
220,
220,
1195,
8206,
18378,
11,
198,
220,
220,
220,
1195,
19778,
11,
198,
220,
220,
220,
1195,
38300,
198,
... | 1.852941 | 68 |
###############################################################################
# Copyright (c) 2011-2021, NVIDIA CORPORATION. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributio... | [
29113,
29113,
7804,
4242,
21017,
198,
2,
15069,
357,
66,
8,
2813,
12,
1238,
2481,
11,
15127,
23929,
44680,
6234,
13,
220,
1439,
2489,
10395,
13,
198,
2,
220,
198,
2,
2297,
396,
3890,
290,
779,
287,
2723,
290,
13934,
5107,
11,
351,
... | 3.681725 | 487 |
# coding: utf-8
"""
"""
import base64
import requests
import pytest
import sampledb
import sampledb.logic
import sampledb.models
@pytest.fixture
@pytest.fixture
@pytest.fixture
@pytest.fixture
| [
2,
19617,
25,
3384,
69,
12,
23,
198,
37811,
198,
198,
37811,
198,
198,
11748,
2779,
2414,
198,
11748,
7007,
198,
11748,
12972,
9288,
198,
198,
11748,
35846,
65,
198,
11748,
35846,
65,
13,
6404,
291,
198,
11748,
35846,
65,
13,
27530,
... | 2.6875 | 80 |
from typing import Optional, Dict
| [
6738,
19720,
1330,
32233,
11,
360,
713,
628
] | 4.375 | 8 |
#Copyright (c) 2015 Microsoft Corp
#Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, ... | [
2,
15269,
357,
66,
8,
1853,
5413,
11421,
220,
198,
198,
2,
5990,
3411,
318,
29376,
7520,
11,
1479,
286,
3877,
11,
284,
597,
1048,
16727,
257,
4866,
286,
428,
3788,
290,
3917,
10314,
3696,
357,
1169,
366,
25423,
12340,
284,
1730,
287... | 3.714286 | 392 |
from typing import IO, Union
class DataFileParser:
'''
Handles parsing the given file type and extracting data from it in a format
usable by the MCMC algorithm
'''
@classmethod
def parse_file(cls, input_file: Union[str, IO]):
'''
Attempts to parse the given file; returns a set ... | [
6738,
19720,
1330,
24418,
11,
4479,
198,
198,
4871,
6060,
8979,
46677,
25,
198,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
7157,
829,
32096,
262,
1813,
2393,
2099,
290,
37895,
1366,
422,
340,
287,
257,
5794,
198,
220,
220,
220,
2... | 2.826667 | 225 |
# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
import warnings
import torch
import math
import torch.nn as nn
import torch.nn.functional as F
from ..blending import (
BlendParams,
hard_rgb_blend,
sigmoid_alpha_blend,
softmax_rgb_blend,
)
from ..lighting import PointLights
fro... | [
2,
15069,
357,
66,
8,
3203,
11,
3457,
13,
290,
663,
29116,
13,
1439,
2489,
10395,
13,
198,
198,
11748,
14601,
198,
198,
11748,
28034,
198,
11748,
10688,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
11748,
28034,
13,
20471,
13,
4... | 2.856129 | 2,113 |
from Backer import Backer
from Format import internalFmt
import os, yaml, pdb
import pandas as pd
from functools import reduce
import numpy as np
# basic event grouping
defaultFile = os.path.join( '.', 'userdata', 'groups.yaml' ) | [
6738,
5157,
263,
1330,
5157,
263,
198,
6738,
18980,
1330,
5387,
37,
16762,
198,
198,
11748,
28686,
11,
331,
43695,
11,
279,
9945,
198,
11748,
19798,
292,
355,
279,
67,
198,
6738,
1257,
310,
10141,
1330,
4646,
198,
11748,
299,
32152,
3... | 3.135135 | 74 |
import io
import json
import warnings
from typing import (
Any,
AsyncIterator,
BinaryIO,
Dict,
List,
Mapping,
MutableMapping,
Optional,
Union,
overload,
)
from typing_extensions import Literal
from .jsonstream import json_stream_list, json_stream_stream
from .utils import clean... | [
11748,
33245,
198,
11748,
33918,
198,
11748,
14601,
198,
6738,
19720,
1330,
357,
198,
220,
220,
220,
4377,
11,
198,
220,
220,
220,
1081,
13361,
37787,
11,
198,
220,
220,
220,
45755,
9399,
11,
198,
220,
220,
220,
360,
713,
11,
198,
2... | 2.740157 | 127 |
presenter = Presenter('Chris')
presenter.name = 'Christopher'
print(presenter.name)
| [
198,
25579,
263,
796,
1763,
9255,
10786,
15645,
11537,
220,
198,
25579,
263,
13,
3672,
796,
705,
38025,
6,
198,
4798,
7,
25579,
263,
13,
3672,
8,
198
] | 3.071429 | 28 |
import os
from typing import Union
from .get_kachery_cloud_dir import get_kachery_cloud_dir
from ._fs_operations import _makedirs, _chmod_file
| [
11748,
28686,
198,
6738,
19720,
1330,
4479,
198,
6738,
764,
1136,
62,
74,
3493,
88,
62,
17721,
62,
15908,
1330,
651,
62,
74,
3493,
88,
62,
17721,
62,
15908,
198,
6738,
47540,
9501,
62,
3575,
602,
1330,
4808,
76,
4335,
17062,
11,
480... | 2.979167 | 48 |
# Import the backtrader platform
import backtrader as bt
import math
from backtesting.strategies.basic_strategy import BasicStrategy
# Create a Stratey
| [
198,
2,
17267,
262,
736,
2213,
5067,
3859,
198,
11748,
736,
2213,
5067,
355,
275,
83,
198,
11748,
10688,
198,
198,
6738,
736,
33407,
13,
2536,
2397,
444,
13,
35487,
62,
2536,
4338,
1330,
14392,
13290,
4338,
628,
198,
2,
13610,
257,
... | 3.391304 | 46 |
# MIT License
#
# Copyright (c) 2019 Red Hat, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge... | [
2,
17168,
13789,
198,
2,
198,
2,
15069,
357,
66,
8,
13130,
2297,
10983,
11,
3457,
13,
198,
2,
198,
2,
2448,
3411,
318,
29376,
7520,
11,
1479,
286,
3877,
11,
284,
597,
1048,
16727,
257,
4866,
198,
2,
286,
428,
3788,
290,
3917,
10... | 3.454243 | 601 |
import argparse
import pathlib
import tempfile
import unittest.mock
from typing import Optional, Sequence
import pytest
import pysen
from pysen import ConfigureLintOptions, configure_lint
from pysen.exceptions import CommandNotFoundError
from pysen.manifest import Manifest, TargetType
from pysen.reporter import Repor... | [
11748,
1822,
29572,
198,
11748,
3108,
8019,
198,
11748,
20218,
7753,
198,
11748,
555,
715,
395,
13,
76,
735,
198,
6738,
19720,
1330,
32233,
11,
45835,
198,
198,
11748,
12972,
9288,
198,
198,
11748,
279,
893,
268,
198,
6738,
279,
893,
... | 3.467742 | 124 |
from unittest.mock import call
from diario_bot.twitter import post_gazettes, split_tweets, tweet
| [
6738,
555,
715,
395,
13,
76,
735,
1330,
869,
198,
198,
6738,
2566,
4982,
62,
13645,
13,
6956,
1330,
1281,
62,
70,
1031,
23014,
11,
6626,
62,
83,
732,
1039,
11,
6126,
628,
628,
628
] | 2.942857 | 35 |
from public import * # noqa
| [
6738,
1171,
1330,
1635,
220,
1303,
645,
20402,
201,
198,
201,
198
] | 2.666667 | 12 |
# Copyright 2021 Huawei Technologies Co., Ltd
#
# 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 agree... | [
2,
15069,
33448,
43208,
21852,
1766,
1539,
12052,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198... | 2.804438 | 721 |
import os
import logging
import torch.distributed as dist
import ray
from ray.util.sgd.utils import find_free_port
logger = logging.getLogger(__name__)
def setup_process_group(url, world_rank, world_size, timeout, backend="gloo"):
"""Connects the distributed PyTorch backend.
Args:
url (str): the U... | [
11748,
28686,
198,
11748,
18931,
198,
11748,
28034,
13,
17080,
6169,
355,
1233,
198,
198,
11748,
26842,
198,
6738,
26842,
13,
22602,
13,
82,
21287,
13,
26791,
1330,
1064,
62,
5787,
62,
634,
198,
198,
6404,
1362,
796,
18931,
13,
1136,
... | 2.446809 | 517 |
#1. Даны две точки и . Составить алгоритм, определяющий, которая из точек находится ближе к началу координат.
#2. Заданы размеры A, B прямоугольного отверстия и размеры X, Y, Z кирпича. Определить, пройдет ли кирпич через отверстие.
#3. Дано двухзначное число. Выяснить:
# а) является ли сумма его цифр двухзначным ... | [
2,
16,
13,
197,
140,
242,
16142,
22177,
45035,
12466,
112,
38857,
16843,
220,
20375,
15166,
141,
229,
31583,
18849,
220,
220,
12466,
116,
220,
764,
12466,
94,
15166,
21727,
20375,
16142,
38857,
18849,
20375,
45367,
12466,
108,
30143,
140,... | 0.972973 | 703 |
# numerology.py
# A program designed to calculate the numeric value of a single name provided
# as input.
"""Numeroligists claim to be able to determine a person's character traits based
on the "numeric value" of a name. The value of a name is determined by summing
up the values of the letters of the name where "a" is ... | [
2,
5470,
1435,
13,
9078,
198,
2,
317,
1430,
3562,
284,
15284,
262,
35575,
1988,
286,
257,
2060,
1438,
2810,
198,
2,
355,
5128,
13,
198,
37811,
45,
6975,
349,
328,
1023,
1624,
284,
307,
1498,
284,
5004,
257,
1048,
338,
2095,
12796,
... | 3.538462 | 169 |
from collections import Counter
from logging import Formatter,FileHandler,getLogger
from logging import DEBUG
from nltk.stem import WordNetLemmatizer
from sthir.parse import extract_html_bs4
from sthir.spectral_bloom_filter import Spectral_Bloom_Filter , Hash_Funcs
from typing import Iterable
import pkgutil
impor... | [
6738,
17268,
1330,
15034,
198,
198,
6738,
18931,
1330,
5178,
1436,
11,
8979,
25060,
11,
1136,
11187,
1362,
198,
6738,
18931,
1330,
16959,
220,
198,
198,
6738,
299,
2528,
74,
13,
927,
1330,
9678,
7934,
43,
368,
6759,
7509,
220,
198,
67... | 1.999621 | 5,280 |
s=input()[::-1]
ans=0
r=0
for i in s:
if i=="b":
r+=1
else:
ans+=r
r*=2
r%=1000000007
print(ans%1000000007) | [
82,
28,
15414,
3419,
58,
3712,
12,
16,
60,
198,
504,
28,
15,
198,
81,
28,
15,
198,
1640,
1312,
287,
264,
25,
198,
220,
220,
220,
611,
1312,
855,
1,
65,
1298,
198,
220,
220,
220,
220,
220,
220,
220,
374,
47932,
16,
198,
220,
... | 1.53125 | 96 |
# Copyright 2020 The Kale Authors
#
# 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 wri... | [
2,
15069,
12131,
383,
509,
1000,
46665,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198,
2,
921... | 2.072972 | 6,619 |
from flask import Flask, Blueprint
from flask_cors import CORS
from flask_sqlalchemy import SQLAlchemy
from flasgger import Swagger
from config.environment_tools import init_environment, get_environment_mode
from config.swagger import get_swagger_template
FLASK_APP = create_app(None)
SWAG = Swagger(FLASK_APP, tem... | [
6738,
42903,
1330,
46947,
11,
39932,
198,
6738,
42903,
62,
66,
669,
1330,
327,
20673,
198,
6738,
42903,
62,
25410,
282,
26599,
1330,
16363,
2348,
26599,
198,
6738,
781,
292,
26679,
1330,
2451,
7928,
198,
198,
6738,
4566,
13,
38986,
62,
... | 3.188034 | 117 |
"""
Module providing perturbation functions under a common interface
"""
from art.attacks.poisoning.perturbations.image_perturbations import (
add_pattern_bd,
add_single_bd,
insert_image,
)
| [
37811,
198,
26796,
4955,
22146,
5945,
341,
5499,
739,
257,
2219,
7071,
198,
37811,
198,
6738,
1242,
13,
38458,
13,
7501,
1653,
278,
13,
11766,
5945,
602,
13,
9060,
62,
11766,
5945,
602,
1330,
357,
198,
220,
220,
220,
751,
62,
33279,
... | 3.060606 | 66 |
# coding:utf-8
"""
这里是工具模块,用来存放在框架运行的过程中要用的一些功能函数或类
BaseSession 用来保存往redis数据库中保存session信息,继承与字典,然后重写__setitem__和__getitem__方法
"""
from redis import StrictRedis
from hashlib import sha3_256
class BaseSession:
"""
类字典类
重写关键方法,将原本的操作转到使用redis数据库完成
"""
def __setitem__(self, key, value):
"""... | [
2,
19617,
25,
40477,
12,
23,
198,
37811,
198,
32573,
247,
34932,
234,
42468,
32432,
98,
17739,
115,
162,
101,
94,
161,
251,
245,
11,
18796,
101,
30266,
98,
27764,
246,
162,
242,
122,
28839,
101,
162,
94,
228,
162,
252,
114,
32573,
... | 1.471622 | 740 |
#!/usr/bin/python
########################################################################################################################
#
# Copyright (c) 2014, Regents of the University of California
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification, are permi... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
29113,
29113,
29113,
14468,
7804,
198,
2,
198,
2,
15069,
357,
66,
8,
1946,
11,
3310,
658,
286,
262,
2059,
286,
3442,
198,
2,
1439,
2489,
10395,
13,
198,
2,
198,
2,
2297,
396,
3890,
290,
... | 2.718705 | 2,069 |
import sys
n = int(sys.stdin.readline().rstrip())
s, t = sys.stdin.readline().split()
if __name__ == '__main__':
ans = main()
print(ans)
| [
11748,
25064,
201,
198,
201,
198,
77,
796,
493,
7,
17597,
13,
19282,
259,
13,
961,
1370,
22446,
81,
36311,
28955,
201,
198,
82,
11,
256,
796,
25064,
13,
19282,
259,
13,
961,
1370,
22446,
35312,
3419,
201,
198,
201,
198,
361,
11593,
... | 2.2 | 70 |
import base64, sys
print(main())
| [
11748,
2779,
2414,
11,
25064,
198,
4798,
7,
12417,
28955,
198
] | 3 | 11 |
"""Python library to connect deCONZ and Home Assistant to work together."""
import asyncio
import logging
import aiohttp
import async_timeout
_LOGGER = logging.getLogger(__name__)
@asyncio.coroutine
def async_get_api_key(loop, host, port, username=None, password=None, **kwargs):
"""Get a new API key for devicet... | [
37811,
37906,
5888,
284,
2018,
390,
10943,
57,
290,
5995,
15286,
284,
670,
1978,
526,
15931,
198,
198,
11748,
30351,
952,
198,
11748,
18931,
198,
11748,
257,
952,
4023,
198,
11748,
30351,
62,
48678,
198,
198,
62,
25294,
30373,
796,
1893... | 2.536302 | 1,033 |
import argparse
import numpy as np
import nmslib
import tqdm
import collections
if __name__ == "__main__":
args = parse_args()
main(args)
| [
11748,
1822,
29572,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
299,
907,
8019,
198,
11748,
256,
80,
36020,
198,
11748,
17268,
628,
628,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
26498,
796,
... | 2.777778 | 54 |
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from matplotlib.patches import Rectangle
df = pd.DataFrame(
{
"name": [
"S_CarSharingPlus",
"S_Basic",
"S_Standard",
"S_Komfort",
"W_Flex",
"W_Komfort",
... | [
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,
6738,
2603,
29487,
8019,
13,
8071,
2052,
1330,
48599,
9248,
198,
198,
7568,
796,
279,
67,
13,
6601... | 2.075446 | 729 |
import wdl.binding
import wdl.parser
import glob
import pytest
import os
@pytest.mark.parametrize(("test_case_dir",), [[x] for x in glob.glob("wdl/test/cases/*")] )
@pytest.mark.parametrize(("test_case_dir",), [[x] for x in glob.glob("wdl/test/cases/*")] )
| [
11748,
266,
25404,
13,
30786,
198,
11748,
266,
25404,
13,
48610,
198,
11748,
15095,
198,
11748,
12972,
9288,
198,
11748,
28686,
198,
198,
31,
9078,
9288,
13,
4102,
13,
17143,
316,
380,
2736,
7,
7203,
9288,
62,
7442,
62,
15908,
1600,
8... | 2.443396 | 106 |
# -*- coding: utf-8 -*-
"""
Created on Mon Sep 23 23:16:44 2017
@author: Marios Michailidis
This is an example that performs stacking to improve mean squared error
This examples uses 2 bases learners (a linear regression and a random forest)
and linear regression (again) as a meta learner to achieve the best score.
... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
2892,
8621,
2242,
2242,
25,
1433,
25,
2598,
2177,
198,
198,
31,
9800,
25,
1526,
4267,
2843,
603,
29207,
198,
198,
1212,
318,
281,
1672,
326,
17... | 1.912858 | 3,523 |
import discord
from discord import app_commands
from pymongo import MongoClient
import os
from mcstatus import JavaServer, BedrockServer
# database connection
cluster = MongoClient(os.environ.get("mongo"))
db = cluster["discord"]
collection = db["status"]
class Minecraft(app_commands.Group):
"""All commands relat... | [
11748,
36446,
198,
6738,
36446,
1330,
598,
62,
9503,
1746,
198,
6738,
279,
4948,
25162,
1330,
42591,
11792,
198,
11748,
28686,
198,
6738,
36650,
13376,
1330,
7349,
10697,
11,
15585,
10823,
10697,
198,
198,
2,
6831,
4637,
198,
565,
5819,
... | 2.624242 | 660 |
name = "pycodedock" | [
3672,
796,
366,
9078,
40976,
735,
1
] | 2.714286 | 7 |
# Logging utils for the BFAIR modules.
import logging
def get_logger(name):
"""
Returns a logger with the specified name.
Paramters
---------
name : str
Name of the logger.
Returns
-------
logging.Logger
A logger object.
"""
logger = logging.getLogger(name)
... | [
2,
5972,
2667,
3384,
4487,
329,
262,
347,
7708,
4663,
13103,
13,
198,
198,
11748,
18931,
628,
198,
4299,
651,
62,
6404,
1362,
7,
3672,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
16409,
257,
49706,
351,
262,
7368,
1438,
13,... | 2.5 | 242 |
search_user = str(input('What user you look for?: ')).strip()
users = ['admin', 'fabiano', 'jullyana', 'inacio']
try:
if search_user in users:
for user in users:
if search_user == user:
print(f'\nHello ' + str(search_user).title() +
' you need see relatory ... | [
12947,
62,
7220,
796,
965,
7,
15414,
10786,
2061,
2836,
345,
804,
329,
27514,
705,
29720,
36311,
3419,
198,
18417,
796,
37250,
28482,
3256,
705,
36434,
10115,
3256,
705,
73,
2132,
2271,
3256,
705,
259,
48711,
20520,
198,
198,
28311,
25,... | 2.049834 | 301 |
from getratings.models.ratings import Ratings
| [
6738,
651,
10366,
654,
13,
27530,
13,
10366,
654,
1330,
36826,
201,
198,
201,
198
] | 3.266667 | 15 |
# -*- coding: utf-8 -*-
"""
"""
from django.conf import settings
"""
URL_LOCKDOWN = {
'ENABLED': False,
'SESSION_KEY': 'urllocks-allow',
}
"""
LOCKDOWN = getattr(settings, 'URL_LOCKDOWN', {})
ENABLED = LOCKDOWN.get('ENABLED', False)
SESSION_KEY = LOCKDOWN.get('SESSION_KEY', 'urllocks-allow')
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
37811,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
37811,
198,
21886,
62,
36840,
41925,
796,
1391,
198,
220,
220,
220,
705,
1677,
6242,
30465,
10354,
... | 2.364341 | 129 |
# Test suite (for verifying correctness)
#
# The test suite is a list of 5- or 3-tuples. The 5 parts of a
# complete tuple are:
# element 0: a string containing the pattern
# 1: the string to match against the pattern
# 2: the expected result (0 - SUCCEED, 1 - FAIL, 2 - SYNTAX_ERROR)
# 3: a str... | [
2,
6208,
18389,
357,
1640,
45505,
29409,
8,
198,
2,
198,
2,
383,
1332,
18389,
318,
257,
1351,
286,
642,
12,
393,
513,
12,
28047,
2374,
13,
220,
383,
642,
3354,
286,
257,
198,
2,
1844,
46545,
389,
25,
198,
2,
5002,
657,
25,
257,
... | 1.845146 | 8,395 |
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | [
2,
220,
220,
15069,
357,
66,
8,
33448,
350,
37382,
47,
37382,
46665,
13,
1439,
6923,
33876,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
... | 3.486667 | 300 |
#!/usr/bin/env python
import sys
import time
import threading
import subprocess
# This script executes a long-running command while outputing "still running ..." periodically
# to notify Travis build system that the program has not hanged
PING_INTERVAL=15
if __name__ == "__main__":
main(sys.argv[1:]) | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
11748,
25064,
198,
11748,
640,
198,
11748,
4704,
278,
198,
11748,
850,
14681,
198,
198,
2,
770,
4226,
42985,
257,
890,
12,
20270,
3141,
981,
5072,
278,
366,
24219,
2491,
35713,
26034,
... | 3.488636 | 88 |
"""Sub-package config utils."""
from .config import *
# from .validation import * | [
37811,
7004,
12,
26495,
4566,
3384,
4487,
526,
15931,
198,
6738,
764,
11250,
1330,
1635,
198,
2,
422,
764,
12102,
341,
1330,
1635
] | 3.521739 | 23 |
import functools
from flask import (
Blueprint, flash, g, redirect, render_template, request, session, url_for
)
from dbfunc import connect_db,match_user_pwd,disconnect_db,get_domain,insert_user_pwd
from dbfunc import databasePATH
import time
db = connect_db(databasePATH)
# 仅作测试
if __name__ == "__main_... | [
11748,
1257,
310,
10141,
201,
198,
6738,
42903,
1330,
357,
201,
198,
220,
220,
220,
39932,
11,
7644,
11,
308,
11,
18941,
11,
8543,
62,
28243,
11,
2581,
11,
6246,
11,
19016,
62,
1640,
201,
198,
8,
201,
198,
6738,
20613,
20786,
1330,
... | 2.457778 | 225 |
"""This module contains the general information for AaaSessionInfo ManagedObject."""
from ...ucsmo import ManagedObject
from ...ucscoremeta import MoPropertyMeta, MoMeta
from ...ucsmeta import VersionMeta
class AaaSessionInfo(ManagedObject):
"""This is AaaSessionInfo class."""
consts = AaaSessionInfoConsts... | [
37811,
1212,
8265,
4909,
262,
2276,
1321,
329,
317,
7252,
36044,
12360,
1869,
1886,
10267,
526,
15931,
198,
198,
6738,
2644,
1229,
5796,
78,
1330,
1869,
1886,
10267,
198,
6738,
2644,
1229,
26675,
28961,
1330,
4270,
21746,
48526,
11,
4270,... | 2.422727 | 1,320 |
import sys
import weakref
import networkx as nx
from openmdao.main.expreval import ConnectedExprEvaluator
from openmdao.main.pseudocomp import PseudoComponent
from openmdao.units import PhysicalQuantity
class ExprMapper(object):
"""A mapping between source expressions and destination expressions"""
@proper... | [
11748,
25064,
198,
11748,
4939,
5420,
198,
198,
11748,
3127,
87,
355,
299,
87,
198,
198,
6738,
1280,
9132,
5488,
13,
12417,
13,
1069,
3866,
2100,
1330,
8113,
276,
3109,
1050,
36,
2100,
84,
1352,
198,
6738,
1280,
9132,
5488,
13,
12417,... | 2.092512 | 3,686 |
from django.db import models
from pyplan.pyplan.usercompanies.models import UserCompany
| [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
198,
6738,
12972,
11578,
13,
9078,
11578,
13,
7220,
34390,
444,
13,
27530,
1330,
11787,
39154,
628
] | 3.6 | 25 |
from SCObject import SCObject
from SCMenu import SCMenu
from SCElement import SCElement
from SCMenuHolder import SCMenuHolder
from SCTerminal import SCTerminal
from SCCustomMenu import SCCustomMenu
from SCEmoteMenu import SCEmoteMenu
from SCStaticTextTerminal import SCStaticTextTerminal
from SCCustomTerminal import SCC... | [
6738,
6374,
10267,
1330,
6374,
10267,
198,
6738,
6374,
23381,
1330,
6374,
23381,
198,
6738,
311,
5222,
1732,
1330,
311,
5222,
1732,
198,
6738,
6374,
23381,
39,
19892,
1330,
6374,
23381,
39,
19892,
198,
6738,
311,
4177,
263,
1084,
282,
1... | 3.344 | 125 |
from fpack import primelist_till_x, divide_primecheck
from time import time
t = time()
primeset = list(primelist_till_x(10000))
for a in range(len(primeset)):
primea = primeset[a]
for b in range(a + 1, len(primeset)):
primeb = primeset[b]
if cool(primea, primeb):
for c in range(... | [
6738,
277,
8002,
1330,
2684,
46331,
62,
83,
359,
62,
87,
11,
14083,
62,
35505,
9122,
198,
6738,
640,
1330,
640,
198,
198,
83,
796,
640,
3419,
628,
198,
198,
1050,
999,
316,
796,
1351,
7,
19795,
46331,
62,
83,
359,
62,
87,
7,
493... | 1.483773 | 986 |
num = int(0)
cont = int(0)
soma = int(0)
while num != 999:
num = int(input('Digite um valor [até 999]: '))
if num != 999:
cont += 1
soma += num
print('A quantidade contagens foi: {}'.format(cont))
print('A soma de todos os termos foi: {}'.format(soma))
| [
22510,
796,
493,
7,
15,
8,
198,
3642,
796,
493,
7,
15,
8,
198,
82,
6086,
796,
493,
7,
15,
8,
198,
4514,
997,
14512,
36006,
25,
198,
220,
220,
220,
997,
796,
493,
7,
15414,
10786,
19511,
578,
23781,
1188,
273,
685,
265,
2634,
3... | 2.270492 | 122 |
self.description = "Install a package from a sync db with cascaded dependencies"
sp1 = pmpkg("dummy", "1.0-2")
sp1.files = ["bin/dummy",
"usr/man/man1/dummy.1"]
sp1.depends = ["dep1"]
sp2 = pmpkg("dep1")
sp2.files = ["bin/dep1"]
sp2.depends = ["dep2"]
sp3 = pmpkg("dep2")
sp3.files = ["bin/dep2"]
for p ... | [
944,
13,
11213,
796,
366,
15798,
257,
5301,
422,
257,
17510,
20613,
351,
49164,
5286,
20086,
1,
198,
198,
2777,
16,
796,
279,
3149,
10025,
7203,
67,
13513,
1600,
366,
16,
13,
15,
12,
17,
4943,
198,
2777,
16,
13,
16624,
796,
14631,
... | 2.058642 | 324 |
import unittest
from app.models import Blog,User
from app import db | [
11748,
555,
715,
395,
198,
6738,
598,
13,
27530,
1330,
14001,
11,
12982,
198,
6738,
598,
1330,
20613
] | 3.722222 | 18 |
#
# Copyright (C) 2020 Arm Mbed. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
"""Package definition for PyPI."""
import os
from setuptools import setup
PROJECT_SLUG = "code-snippet"
SOURCE_DIR = "snippet"
__version__ = None
repository_dir = os.path.dirname(__file__)
# Read package version, this will... | [
2,
198,
2,
15069,
357,
34,
8,
12131,
7057,
337,
3077,
13,
1439,
2489,
10395,
13,
198,
2,
30628,
55,
12,
34156,
12,
33234,
7483,
25,
24843,
12,
17,
13,
15,
198,
2,
198,
37811,
27813,
6770,
329,
9485,
11901,
526,
15931,
198,
11748,
... | 2.673548 | 775 |
__author__ = 'Thomas Rueckstiess, ruecksti@in.tum.de'
import sys
class XMLstruct:
"""
Defines an XML tag structure. Tags are added at the current level
using the insert() method, with up() providing a way to get to the
parent tag.
$Id:xmltools.py 150 2007-04-11 13:42:47Z ruecksti $
"""
_... | [
834,
9800,
834,
796,
705,
22405,
45363,
694,
301,
72,
408,
11,
374,
518,
694,
301,
72,
31,
259,
13,
83,
388,
13,
2934,
6,
198,
198,
11748,
25064,
198,
198,
4871,
23735,
7249,
25,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
28... | 2.201055 | 3,034 |
"""Module to plot the loss landscapes of circuits.
For any variational quantum algorithm being trained to optimize on a given metric,
the plot of a projected subspace of the metric is of value because it helps us
confirm along random axes that our point is indeed the local minima / maxima and
also helps visualize how ... | [
37811,
26796,
284,
7110,
262,
2994,
32964,
286,
24907,
13,
198,
198,
1890,
597,
5553,
864,
14821,
11862,
852,
8776,
284,
27183,
319,
257,
1813,
18663,
11,
198,
1169,
7110,
286,
257,
13301,
850,
13200,
286,
262,
18663,
318,
286,
1988,
... | 2.694089 | 2,893 |
import signal
import time
from multiprocessing import Process
import logging
from mongodb_connector import MongoDBConnector
class Supervisor:
"""supervisor class
"""
def __init__(self):
"""init"""
self.running = True
signal.signal(signal.SIGINT, self.stop)
signal.signal(s... | [
11748,
6737,
198,
11748,
640,
198,
6738,
18540,
305,
919,
278,
1330,
10854,
198,
11748,
18931,
198,
198,
6738,
285,
506,
375,
65,
62,
8443,
273,
1330,
42591,
35,
2749,
261,
1606,
273,
628,
198,
4871,
45673,
25,
198,
220,
220,
220,
3... | 2.304775 | 712 |
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
import os
import random
import logging
import argparse
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
from tqdm import tqdm
import numpy as np
from distutils.version import Loose... | [
2,
15069,
357,
66,
8,
5413,
10501,
13,
1439,
2489,
10395,
13,
198,
2,
49962,
739,
262,
17168,
13789,
13,
198,
11748,
28686,
198,
11748,
4738,
198,
11748,
18931,
198,
11748,
1822,
29572,
198,
11748,
28034,
198,
11748,
28034,
13,
20471,
... | 2.864818 | 577 |
from typedpy import *
| [
6738,
25683,
9078,
1330,
1635,
628
] | 3.833333 | 6 |
"""
Copyright 2020 The Magma Authors.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES O... | [
37811,
198,
15269,
12131,
383,
2944,
2611,
46665,
13,
198,
198,
1212,
2723,
2438,
318,
11971,
739,
262,
347,
10305,
12,
7635,
5964,
1043,
287,
262,
198,
43,
2149,
24290,
2393,
287,
262,
6808,
8619,
286,
428,
2723,
5509,
13,
198,
198,
... | 3.468254 | 252 |
"""
request(method, url, params=None, data=None, headers=None, cookies=None, files=None, auth=None, timeout=None, allow_redirects=True, proxies=None, hooks=None, stream=None, verify=None, cert=None, json=None)
参数:
method -- 请求方法
url -- 网址
params -- url中传递参数,字典类型{'key':'value'},http://www.ba... | [
37811,
198,
2581,
7,
24396,
11,
19016,
11,
42287,
28,
14202,
11,
1366,
28,
14202,
11,
24697,
28,
14202,
11,
14746,
28,
14202,
11,
3696,
28,
14202,
11,
6284,
28,
14202,
11,
26827,
28,
14202,
11,
1249,
62,
445,
1060,
82,
28,
17821,
... | 1.440843 | 617 |
from src.robot import Robot
from src.helpers import display_world
from random import seed
seed(1)
| [
6738,
12351,
13,
305,
13645,
1330,
16071,
198,
6738,
12351,
13,
16794,
364,
1330,
3359,
62,
6894,
198,
6738,
4738,
1330,
9403,
198,
28826,
7,
16,
8,
628,
198
] | 3.448276 | 29 |
import torch
from torch import nn
from torch.nn import functional as F
from models.layers.conv_bn_act import ConvNormAct
from .trace_utils import _assert
| [
11748,
28034,
198,
6738,
28034,
1330,
299,
77,
198,
6738,
28034,
13,
20471,
1330,
10345,
355,
376,
198,
198,
6738,
4981,
13,
75,
6962,
13,
42946,
62,
9374,
62,
529,
1330,
34872,
35393,
6398,
198,
6738,
764,
40546,
62,
26791,
1330,
480... | 3.522727 | 44 |
from flask_limiter import Limiter
from flask_limiter.util import get_remote_address
limiter = Limiter(key_func=get_remote_address, default_limits=["120/hour"])
| [
6738,
42903,
62,
2475,
2676,
1330,
7576,
2676,
198,
6738,
42903,
62,
2475,
2676,
13,
22602,
1330,
651,
62,
47960,
62,
21975,
198,
198,
2475,
2676,
796,
7576,
2676,
7,
2539,
62,
20786,
28,
1136,
62,
47960,
62,
21975,
11,
4277,
62,
49... | 3.156863 | 51 |
"""
This structure holds the unit test vectors. They are used to generate test cases in conftest.py.
The results are computed using check_outputs in util_test.py.
The function supports three types of output checks:
- Return values - 'out'
- Errors raised - 'error'
- Database changes - 'records'
- PRAGMA changes - 'prag... | [
37811,
198,
1212,
4645,
6622,
262,
4326,
1332,
30104,
13,
1119,
389,
973,
284,
7716,
1332,
2663,
287,
369,
701,
395,
13,
9078,
13,
198,
464,
2482,
389,
29231,
1262,
2198,
62,
22915,
82,
287,
7736,
62,
9288,
13,
9078,
13,
198,
464,
... | 1.669448 | 165,977 |
# coding: utf8
# Source code: https://foad-moodle.ensai.fr/pluginfile.php/15490/mod_resource/content/4/tp1.pdf
import spacy
nlp = spacy.load("en_core_web_sm/en_core_web_sm-2.3.1")
# shows pipeline components (in order)
print(nlp.pipeline)
# ** Document **
text = "This is a $2 test sentence to test a U.K. spaCy pip... | [
2,
19617,
25,
3384,
69,
23,
198,
198,
2,
8090,
2438,
25,
3740,
1378,
69,
1170,
12,
76,
27106,
13,
641,
1872,
13,
8310,
14,
33803,
7753,
13,
10121,
14,
1314,
31503,
14,
4666,
62,
31092,
14,
11299,
14,
19,
14,
34788,
16,
13,
12315... | 2.468951 | 467 |
import sys, re
from os.path import abspath, join
from optparse import OptionParser
from ctypeslib import h2xml
from ctypeslib import xml2py
default_path_to_chipmunk_include = join("..","chipmunk_src")
default_output = join("..", "pymunk", "_chipmunk.py")
default_path_to_chipmunk_lib = join("..", "pymunk", "chi... | [
11748,
25064,
11,
302,
201,
198,
6738,
28686,
13,
6978,
1330,
2352,
6978,
11,
4654,
201,
198,
6738,
2172,
29572,
1330,
16018,
46677,
201,
198,
6738,
269,
19199,
8019,
1330,
289,
17,
19875,
201,
198,
6738,
269,
19199,
8019,
1330,
35555,
... | 2.005933 | 1,517 |
import argparse
import pickle
import os, sys
from pathlib import Path
import pandas as pd
from tqdm.contrib import tzip
# load custom modules
module_path = os.path.abspath(os.path.join("."))
if module_path not in sys.path:
sys.path.append(module_path)
from pilotoeducacao import search
# execute block
if __nam... | [
11748,
1822,
29572,
198,
11748,
2298,
293,
198,
11748,
28686,
11,
25064,
198,
6738,
3108,
8019,
1330,
10644,
198,
198,
11748,
19798,
292,
355,
279,
67,
198,
6738,
256,
80,
36020,
13,
3642,
822,
1330,
256,
13344,
198,
198,
2,
3440,
218... | 2.845528 | 123 |
import torch
import numpy as np
import logging, yaml, os, sys, argparse, time, math
from tqdm import tqdm
from collections import defaultdict
from Logger import Logger
import matplotlib
matplotlib.use('agg')
matplotlib.rcParams['agg.path.chunksize'] = 10000
import matplotlib.pyplot as plt
from scipy.io import wavfile
f... | [
11748,
28034,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
18931,
11,
331,
43695,
11,
28686,
11,
25064,
11,
1822,
29572,
11,
640,
11,
10688,
198,
6738,
256,
80,
36020,
1330,
256,
80,
36020,
198,
6738,
17268,
1330,
4277,
11600,
198,
... | 2.643963 | 646 |
__author__ = 'dimd'
from zope.interface import Interface
| [
834,
9800,
834,
796,
705,
27740,
67,
6,
198,
198,
6738,
1976,
3008,
13,
39994,
1330,
26491,
628,
628
] | 3.210526 | 19 |
from typing import List
# Definition for a binary tree node.
root = creat_tree([5,4,8,11,None,13,4,7,2,None,None,5,1])
target = 22
print(Solution().pathSum(root, target)) | [
6738,
19720,
1330,
7343,
198,
2,
30396,
329,
257,
13934,
5509,
10139,
13,
628,
198,
15763,
796,
1827,
62,
21048,
26933,
20,
11,
19,
11,
23,
11,
1157,
11,
14202,
11,
1485,
11,
19,
11,
22,
11,
17,
11,
14202,
11,
14202,
11,
20,
11,... | 2.730159 | 63 |
# -*- coding: utf-8 -*-
import random
from typing import TYPE_CHECKING, Any, List, Optional
import jaconv
if TYPE_CHECKING:
from .bot import Bot
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
201,
198,
11748,
4738,
201,
198,
6738,
19720,
1330,
41876,
62,
50084,
2751,
11,
4377,
11,
7343,
11,
32233,
201,
198,
201,
198,
11748,
474,
7807,
85,
201,
198,
201,
198,
361... | 2.469697 | 66 |
import os
import sys
import math
import pickle
import pdb
import argparse
import random
from tqdm import tqdm
from shutil import copy
import torch
from torch import nn, optim
from torch.optim.lr_scheduler import ReduceLROnPlateau
import numpy as np
import scipy.io
from scipy.linalg import qr
import igraph
from random i... | [
11748,
28686,
198,
11748,
25064,
198,
11748,
10688,
198,
11748,
2298,
293,
198,
11748,
279,
9945,
198,
11748,
1822,
29572,
198,
11748,
4738,
198,
6738,
256,
80,
36020,
1330,
256,
80,
36020,
198,
6738,
4423,
346,
1330,
4866,
198,
11748,
... | 2.340217 | 3,680 |
#!/usr/local/python
# euler problem 500
# The number of divisors of 120 is 16.
# In fact 120 is the smallest number having 16 divisors.
#
# Find the smallest number with 2^500500 divisors.
# Give your answer modulo 500500507.
# prime decomposition:
# n has k factors if the prime factorization of n is:
# n = a^a1 ... | [
2,
48443,
14629,
14,
12001,
14,
29412,
198,
198,
2,
304,
18173,
1917,
5323,
198,
2,
383,
1271,
286,
2659,
271,
669,
286,
7982,
318,
1467,
13,
198,
2,
554,
1109,
7982,
318,
262,
18197,
1271,
1719,
1467,
2659,
271,
669,
13,
198,
2,
... | 2.877761 | 679 |
# -*- coding: utf-8 -*-
from tools import *
import numpy as np
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
6738,
4899,
1330,
1635,
198,
11748,
299,
32152,
355,
45941,
628,
198
] | 2.444444 | 27 |
#!/usr/bin/env python
'''Convert the AudioSet features into an sklearn-friendly format.
Example
-------
$ ./transform_features.py /path/to/audioset_v1_embeddings/unbal_train \
/path/to/outputs --prefix audioset_train_
Will produce two files:
/path/to/outputs/audioset_train_features.npy (~2.4GB)
/path/to/o... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
7061,
6,
3103,
1851,
262,
13491,
7248,
3033,
656,
281,
1341,
35720,
12,
13120,
5794,
13,
198,
198,
16281,
198,
26866,
198,
3,
24457,
35636,
62,
40890,
13,
9078,
1220,
6978,
14,
1462,
... | 2.566667 | 840 |
from .... pyaz_utils import _call_az
def add(account_name, allowed_clients, cifs, nfsv3, nfsv41, pool_name, resource_group, rule_index, unix_read_only, unix_read_write, volume_name, add=None, force_string=None, remove=None, set=None):
'''
Add a new rule to the export policy for a volume.
Required Paramete... | [
6738,
19424,
12972,
1031,
62,
26791,
1330,
4808,
13345,
62,
1031,
198,
198,
4299,
751,
7,
23317,
62,
3672,
11,
3142,
62,
565,
2334,
11,
269,
361,
82,
11,
299,
9501,
85,
18,
11,
299,
9501,
85,
3901,
11,
5933,
62,
3672,
11,
8271,
... | 3.291956 | 1,007 |
import os
| [
11748,
28686,
628
] | 3.666667 | 3 |
# -*- coding: utf-8 -*-
"""
Created on Tue May 14 08:31:39 2019
@author: mritch3
"""
import os, glob, pandas
import numpy as np, scipy.stats as st
from scipy.io import loadmat
from PIL import Image
destparam=''
resample=True
np.random.seed(1)
p=.6 #proportion in training set. The rest is split 50%-50% between valida... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
30030,
1737,
1478,
8487,
25,
3132,
25,
2670,
13130,
198,
198,
31,
9800,
25,
285,
46510,
18,
198,
37811,
198,
198,
11748,
28686,
11,
15095,
11,
... | 2.164369 | 3,772 |
import torch
| [
11748,
28034,
628,
628,
220,
220,
220,
220,
220,
220,
220,
220,
198
] | 1.923077 | 13 |
# -*- coding: utf-8 -*-
import scrapy
import json
import re
from locations.items import GeojsonPointItem
from locations.hours import OpeningHours
DAY_MAPPING = {
'SUNDAY': 'Su',
'MONDAY': 'Mo',
'TUESDAY': 'Tu',
'WEDNESDAY': 'We',
'THURSDAY': 'Th',
'FRIDAY': 'Fr',
'SATURDAY': 'Sa',
}
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
15881,
88,
198,
11748,
33918,
198,
11748,
302,
198,
6738,
7064,
13,
23814,
1330,
2269,
13210,
1559,
12727,
7449,
198,
6738,
7064,
13,
24425,
1330,
25522,
39792,
628... | 2.225352 | 142 |
import test.echotestrpc.model as model
import test.echotestrpc.client as client
from awsiot.eventstreamrpc import (
AccessDeniedError,
Connection,
ConnectionClosedError,
EventStreamError,
LifecycleHandler,
MessageAmendment,
SerializeError,
StreamClosedError,
StreamResponseHandler)
fr... | [
11748,
1332,
13,
3055,
313,
395,
81,
14751,
13,
19849,
355,
2746,
198,
11748,
1332,
13,
3055,
313,
395,
81,
14751,
13,
16366,
355,
5456,
198,
6738,
3253,
82,
5151,
13,
15596,
5532,
81,
14751,
1330,
357,
198,
220,
220,
220,
8798,
213... | 2.896373 | 386 |
if __name__ == '__main__':
print(print(to_goat_latin("I speak Goat Latin"))) | [
201,
198,
201,
198,
201,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
201,
198,
220,
220,
220,
3601,
7,
4798,
7,
1462,
62,
2188,
265,
62,
75,
10680,
7203,
40,
2740,
40423,
9133,
1,
22305
] | 2.230769 | 39 |
import string
print("Alphabet from a-z:")
for letter in string.ascii_lowercase:
i+=1
print('{} {}'.format(letter,i), end =" ")
print("\nAlphabet from A-Z:")
i = 0
for letter in string.ascii_uppercase:
i+=1
print('{} {}'.format(letter,i), end =" ")
| [
11748,
4731,
198,
4798,
7203,
2348,
19557,
422,
257,
12,
89,
25,
4943,
198,
1640,
3850,
287,
4731,
13,
292,
979,
72,
62,
21037,
7442,
25,
198,
220,
220,
1312,
47932,
16,
198,
220,
220,
3601,
10786,
90,
92,
23884,
4458,
18982,
7,
9... | 2.363636 | 110 |