content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
import numpy as np
def new_result(team1, team2, result):
"""add a new [result, opponent] to team1"""
return team1.append([result, team2])
def spread(e1, e2, c):
"""points spread between e1, e2"""
#recommend c between 25 (football, 10 pts = 1.5 scores) and ~15
return (e1-e2)/c
def pwin... | [
11748,
299,
32152,
355,
45941,
201,
198,
201,
198,
4299,
649,
62,
20274,
7,
15097,
16,
11,
1074,
17,
11,
1255,
2599,
201,
198,
220,
220,
220,
37227,
2860,
257,
649,
685,
20274,
11,
6125,
60,
284,
1074,
16,
37811,
201,
198,
220,
22... | 2.1787 | 554 |
from __future__ import annotations
import pytest
from aiohttp import web
@pytest.mark.asyncio
| [
6738,
11593,
37443,
834,
1330,
37647,
198,
198,
11748,
12972,
9288,
198,
6738,
257,
952,
4023,
1330,
3992,
628,
198,
31,
9078,
9288,
13,
4102,
13,
292,
13361,
952,
198
] | 3.233333 | 30 |
#!/usr/bin/env python2
import sys
print "\n----- DECODE -----"
for line in sys.stdin:
line = line.strip()
for number in line.split(' '):
number = int(number) % 127
char = chr(number)
sys.stdout.write(char)
sys.stdout.flush()
print "\n------------------"
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
17,
198,
198,
11748,
25064,
198,
198,
4798,
37082,
77,
30934,
27196,
16820,
13498,
21215,
198,
198,
1640,
1627,
287,
25064,
13,
19282,
259,
25,
198,
220,
1627,
796,
1627,
13,
36311,
3419,
1... | 2.349206 | 126 |
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2021 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... | 2.132026 | 3,416 |
from graphene import List
from graphene_django.types import DjangoObjectType
from articles.models import Article | [
6738,
42463,
1330,
7343,
198,
6738,
42463,
62,
28241,
14208,
13,
19199,
1330,
37770,
10267,
6030,
198,
198,
6738,
6685,
13,
27530,
1330,
10172
] | 4.708333 | 24 |
from dexp.utils.backends import Backend
def wiener_kernel(kernel, alpha: float = 1e-3, frequency_domain: bool = False, dtype=None):
"""Computes the Wiener filter for a given kernel and alpha parameter.
Parameters
----------
kernel : kernel
alpha : alpha parameter
frequency_domain : if True th... | [
6738,
36017,
79,
13,
26791,
13,
1891,
2412,
1330,
5157,
437,
628,
198,
4299,
45967,
877,
62,
33885,
7,
33885,
11,
17130,
25,
12178,
796,
352,
68,
12,
18,
11,
8373,
62,
27830,
25,
20512,
796,
10352,
11,
288,
4906,
28,
14202,
2599,
... | 2.532213 | 357 |
# Generated by Django 2.1.4 on 2019-01-06 09:12
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
| [
2,
2980,
515,
416,
37770,
362,
13,
16,
13,
19,
319,
13130,
12,
486,
12,
3312,
7769,
25,
1065,
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 |
import lab as B
import numpy as np
from plum import convert, Union
from .. import _dispatch
from ..aggregate import Aggregate, AggregateInput
from ..datadims import data_dims
from ..util import (
register_module,
register_composite_coder,
split,
split_dimension,
merge_dimensions,
select,
)
__a... | [
11748,
2248,
355,
347,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
22802,
1330,
10385,
11,
4479,
198,
198,
6738,
11485,
1330,
4808,
6381,
17147,
198,
6738,
11485,
9460,
49373,
1330,
19015,
49373,
11,
19015,
49373,
20560,
198,
6738,
114... | 3.105469 | 768 |
import os
import os.path
from datetime import datetime
from unittest import TestCase
import cate.core.ds as io
from cate.conf import get_data_stores_path
from cate.core.ds import DATA_STORE_REGISTRY
from cate.ds.esa_cci_ftp import FileSetDataStore, set_default_data_store
| [
11748,
28686,
198,
11748,
28686,
13,
6978,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
6738,
555,
715,
395,
1330,
6208,
20448,
198,
198,
11748,
269,
378,
13,
7295,
13,
9310,
355,
33245,
198,
6738,
269,
378,
13,
10414,
1330,
651,
62,... | 2.978495 | 93 |
#!/usr/bin/env python3
import math
insert_sizes = []
with open('insertsize.sam', 'rt') as sam:
for sam_line in sam:
try:
sam_parts = sam_line.split('\t')
sam_flags = int(sam_parts[1])
if sam_flags & 2: # read mapped in proper pair
insert_size = int(sam_... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
11748,
10688,
198,
198,
28463,
62,
82,
4340,
796,
17635,
198,
4480,
1280,
10786,
28463,
7857,
13,
37687,
3256,
705,
17034,
11537,
355,
6072,
25,
198,
220,
220,
220,
329,
6072,... | 2.060703 | 313 |
# Plot Spectrum at a list of positions in a FITS ImageMF
# On either raw (no PBCor) or PBCorImageMF.py PB corrected
name = 'Abell_194' # Base of plot name
inFile = 'Abell_194.fits'; fdisk=0 # Input file on cwd
# Specify positions (name, ra, dec)
srcpos = [ \
('core', '01:26:00.597', '-01:20:43.71'), \... | [
2,
28114,
27217,
379,
257,
1351,
286,
6116,
287,
257,
376,
29722,
7412,
49800,
198,
2,
1550,
2035,
8246,
357,
3919,
350,
2749,
273,
8,
393,
350,
2749,
273,
5159,
49800,
13,
9078,
30524,
19267,
198,
198,
3672,
220,
220,
796,
705,
482... | 2.04899 | 1,633 |
#!/usr/bin/env python
"""Test the collector flows.
To reduce the size of this module, additional collector flow tests are split out
into collectors_*_test.py files.
"""
import os
import mock
import psutil
from grr import config
from grr.client.client_actions import standard
from grr.lib import flags
from grr.lib im... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
37811,
14402,
262,
22967,
15623,
13,
198,
198,
2514,
4646,
262,
2546,
286,
428,
8265,
11,
3224,
22967,
5202,
5254,
389,
6626,
503,
198,
20424,
26668,
62,
9,
62,
9288,
13,
9078,
3696,
... | 2.491433 | 3,502 |
from flask import Flask
from flask_restful import Api
from flask_apispec import FlaskApiSpec
from resources import HelloWorld, Car
from models import db
from resources import CarByName
if __name__ == '__main__':
app = create_app()
app.run(port=7654, host='0.0.0.0', debug=True)
| [
6738,
42903,
1330,
46947,
198,
6738,
42903,
62,
2118,
913,
1330,
5949,
72,
198,
6738,
42903,
62,
499,
271,
43106,
1330,
46947,
32,
14415,
22882,
198,
198,
6738,
4133,
1330,
18435,
10603,
11,
1879,
198,
6738,
4981,
1330,
20613,
198,
198,... | 2.969388 | 98 |
"""
Base class for building blockchain transactions to issue Blockchain Certificates.
"""
import logging
import json
from pycoin.serialize import h2b
from cert_issuer.errors import BroadcastError
MAX_TX_RETRIES = 5
| [
37811,
198,
14881,
1398,
329,
2615,
11779,
8945,
284,
2071,
29724,
14965,
811,
689,
13,
198,
37811,
198,
11748,
18931,
198,
11748,
33918,
198,
198,
6738,
12972,
3630,
13,
46911,
1096,
1330,
289,
17,
65,
198,
198,
6738,
5051,
62,
747,
... | 3.639344 | 61 |
#!/usr/bin/python
import os
import sys
import time
import Adafruit_DHT
temperature_file = "/tmp/dht.temperature"
humidity_file = "/tmp/dht.humidity"
run_file = "/tmp/dht-run.pid"
sensor = Adafruit_DHT.AM2302
pin = 22
if os.path.isfile(run_file):
pid = read_runpid()
exe = "/proc/{}/exe".format(pid... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
198,
11748,
28686,
198,
11748,
25064,
198,
11748,
640,
198,
11748,
1215,
1878,
4872,
62,
35,
6535,
198,
198,
11498,
21069,
62,
7753,
796,
12813,
22065,
14,
67,
4352,
13,
11498,
21069,
1,
198,... | 2.087629 | 388 |
import os
import sys
import html
from flask import Flask, render_template
INDENT = ' '
class Page(Tag):
'''
include a <html>
'''
@page_switch_gstate
@property
@property
@page_switch_gstate
def display(self, host='0.0.0.0', port=8081, tpl_dir='template', args={}):
... | [
11748,
28686,
198,
11748,
25064,
198,
11748,
27711,
198,
198,
6738,
42903,
1330,
46947,
11,
8543,
62,
28243,
198,
198,
12115,
3525,
796,
705,
220,
220,
220,
705,
628,
628,
628,
628,
198,
4871,
7873,
7,
24835,
2599,
198,
220,
220,
220,... | 2.0625 | 1,056 |
from typing import List
| [
6738,
19720,
1330,
7343,
628,
220,
220,
220,
220,
198
] | 3 | 10 |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
Topic: sample
Filter(logname),只允许来自logname或其子日志的消息通过
app.net是app的子日志
消息传播propagate和分层记录器:消息会传播给父记录器
log.propagate属性获取是否传播标志
"""
import logging
import logging.handlers as handlers
import logging.config as config
__author__ = 'Xiong Neng'
logging... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
21004,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
220,
220,
220,
47373,
25,
6291,
628,
220,
220,
220,
25853,
7,
75,
2360,
480,
8,
171,
120,
234,
20998,
1... | 1.549774 | 442 |
# coding: utf-8
""" Matplotlib figure functionality for the Traits GUI. """
from __future__ import division, print_function
__author__ = "Andy Casey <arc@ast.cam.ac.uk>"
# Third-party
import wx
from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg
from matplotlib.backends.backend_wx import NavigationToolb... | [
2,
19617,
25,
3384,
69,
12,
23,
198,
198,
37811,
6550,
29487,
8019,
3785,
11244,
329,
262,
4759,
896,
25757,
13,
37227,
198,
198,
6738,
11593,
37443,
834,
1330,
7297,
11,
3601,
62,
8818,
198,
198,
834,
9800,
834,
796,
366,
35314,
21... | 2.660413 | 533 |
from tflite_support import metadata_schema_py_generated as _metadata_fb
from constants import IMAGE_NAME, IOU_NAME, CONF_NAME, NORMALIZED_SUFFIX, QUANTIZED_SUFFIX
from tf_metadata.metadata_utils import MetadataHelper
| [
6738,
256,
2704,
578,
62,
11284,
1330,
20150,
62,
15952,
2611,
62,
9078,
62,
27568,
355,
4808,
38993,
62,
21855,
198,
198,
6738,
38491,
1330,
8959,
11879,
62,
20608,
11,
314,
2606,
62,
20608,
11,
7102,
37,
62,
20608,
11,
25273,
42126,... | 3.084507 | 71 |
# Sergio, 2020
__all__ = ['misc']
| [
2,
220,
220,
36759,
11,
12131,
198,
198,
834,
439,
834,
796,
37250,
44374,
20520,
198
] | 2.3125 | 16 |
# -*- coding: utf-8 -*-
# This module contains all the Object classes used by the MIT Core Concept
# Catalog (MC3) Handcar based implementation of the OSID Id Service.
from ...abstract_osid.id import objects as abc_id_objects
from ..osid import objects as osid_objects
from .. import settings
from ..primitives import ... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
770,
8265,
4909,
477,
262,
9515,
6097,
973,
416,
262,
17168,
7231,
26097,
198,
2,
44515,
357,
9655,
18,
8,
7157,
7718,
1912,
7822,
286,
262,
7294,
2389,
5121,
... | 2.535809 | 1,131 |
# dataframe column names
SURNAME = 'surname'
ORIGIN = 'nationality'
# split types
TRAIN = 'train'
VALID = 'val'
TEST = 'test'
# special tokens
START_TOKEN = '<start>'
END_TOKEN = '<end>'
MASK_TOKEN = '<mask>'
UNK_TOKEN = '<unk>'
# data dictionary keys
X_DATA = 'x_data'
Y_TARGET = 'y_target'
| [
2,
1366,
14535,
5721,
3891,
198,
50,
4261,
20608,
796,
705,
82,
700,
480,
6,
198,
1581,
3528,
1268,
796,
705,
14648,
414,
6,
198,
198,
2,
6626,
3858,
198,
51,
3861,
1268,
796,
705,
27432,
6,
198,
23428,
2389,
796,
705,
2100,
6,
... | 2.251908 | 131 |
"""Delete duplicate atom entries"""
import numpy as np
import argparse
import logging
import os
import sys
import time
from string import ascii_uppercase
from . import Structure
from .structure import residue_type
from .structure.residue import _RotamerResidue
from .structure.rotamers import ROTAMERS
| [
37811,
38727,
23418,
22037,
12784,
37811,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
1822,
29572,
198,
11748,
18931,
198,
11748,
28686,
198,
11748,
25064,
198,
11748,
640,
198,
6738,
4731,
1330,
355,
979,
72,
62,
7211,
2798,
589,
198... | 3.607143 | 84 |
from scipy.linalg import solve
from scipy.special import erf as erf
import matplotlib.pyplot as plt
import numpy as np
n = 20
dt, T = 1., int(1e4)
l = np.int(np.ceil(T / dt))
sqrt_dt = np.sqrt(dt)
sqrt_2 = np.sqrt(2)
rat = sqrt_dt / sqrt_2
w = np.random.uniform(-0.5, 0.5, size=(n, n))
w[np.diag_indices_from(w)] -= 2... | [
6738,
629,
541,
88,
13,
75,
1292,
70,
1330,
8494,
198,
6738,
629,
541,
88,
13,
20887,
1330,
1931,
69,
355,
1931,
69,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
299,
32152,
355,
45941,
198,
198,
77,
7... | 1.890034 | 582 |
# Create your views here.
from django.shortcuts import render
from .froms import SampleSearchForm
| [
2,
13610,
534,
5009,
994,
13,
198,
6738,
42625,
14208,
13,
19509,
23779,
1330,
8543,
198,
6738,
764,
6738,
82,
1330,
27565,
18243,
8479,
628,
198
] | 3.846154 | 26 |
from pyspark.sql import SparkSession
from pyspark.sql.functions import avg
spark = SparkSession\
.builder\
.appName("SparkApp")\
.master("local[*]")\
.getOrCreate()
# Create a DataFrame using SparkSession
data_df = spark.createDataFrame([("Brooke", 20), ("Denny", 31), ("Jules", 30), ("... | [
6738,
279,
893,
20928,
13,
25410,
1330,
17732,
36044,
198,
6738,
279,
893,
20928,
13,
25410,
13,
12543,
2733,
1330,
42781,
198,
198,
2777,
668,
796,
17732,
36044,
59,
198,
220,
220,
220,
220,
220,
220,
220,
764,
38272,
59,
198,
220,
... | 2.707921 | 202 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-+
import sys
sys.path.insert(1,'/usr/local/lib/python3.5/dist-packages')
import numpy as np
import cv2
INNER_X = 100
INNER_Y = 30
OUTER_X = 150
OUTER_Y = 60
RANGE = 20
if __name__ == "__main__":
main() | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
201,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
19529,
201,
198,
201,
198,
11748,
25064,
201,
198,
17597,
13,
6978,
13,
28463,
7,
16,
4032,
14,
14629,
14,
12001,
14,... | 2.05303 | 132 |
"""
Video Face Manipulation Detection Through Ensemble of CNNs
Image and Sound Processing Lab - Politecnico di Milano
Nicolò Bonettini
Edoardo Daniele Cannas
Sara Mandelli
Luca Bondi
Paolo Bestagini
"""
from typing import List
import albumentations as A
import pandas as pd
from albumentations.pytorch import ToTensor... | [
37811,
198,
10798,
15399,
35045,
1741,
46254,
9561,
2039,
15140,
286,
8100,
82,
198,
198,
5159,
290,
9506,
28403,
3498,
532,
2165,
578,
31522,
3713,
2566,
4460,
5733,
198,
198,
45,
27045,
127,
110,
7979,
3087,
5362,
198,
36,
4598,
13109... | 3.133858 | 127 |
from nlplib.general.represent import represented_nonliterally
__all__ = ['Base']
class Base :
''' A base class for all of the core classes. '''
| [
198,
198,
6738,
299,
75,
489,
571,
13,
24622,
13,
15603,
1330,
7997,
62,
13159,
43819,
198,
198,
834,
439,
834,
796,
37250,
14881,
20520,
198,
198,
4871,
7308,
1058,
198,
220,
220,
220,
705,
7061,
317,
2779,
1398,
329,
477,
286,
262... | 3.122449 | 49 |
#!/usr/bin/env python
"""
@package mi.dataset.parser.test.test_presf_abc_dcl
@file marine-integrations/mi/dataset/parser/test/test_presf_abc_dcl.py
@author Christopher Fortin
@brief Test code for a presf_abc_dcl data parser
"""
import os
from nose.plugins.attrib import attr
from mi.core.log import get_logger
log =... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
37811,
198,
31,
26495,
21504,
13,
19608,
292,
316,
13,
48610,
13,
9288,
13,
9288,
62,
18302,
69,
62,
39305,
62,
67,
565,
198,
31,
7753,
16050,
12,
18908,
9143,
14,
11632,
14,
... | 2.023452 | 5,330 |
from . import indicator_base
from . import indicator
from . import regex
from . import yara
| [
6738,
764,
1330,
16916,
62,
8692,
198,
6738,
764,
1330,
16916,
198,
6738,
764,
1330,
40364,
198,
6738,
764,
1330,
331,
3301,
198
] | 4 | 23 |
"""
A module to assist with using the Python logging module
"""
import errno
import logging
import logging.handlers
import os
import time
def configure(*args, **kwargs):
"""
Borrowed from logging.basicConfig
Uses the UTCFormatter instead of the regular Formatter
Also, opts you into syslogging.
... | [
37811,
198,
32,
8265,
284,
3342,
351,
1262,
262,
11361,
18931,
8265,
198,
198,
37811,
198,
198,
11748,
11454,
3919,
198,
11748,
18931,
198,
11748,
18931,
13,
4993,
8116,
198,
11748,
28686,
198,
11748,
640,
628,
198,
198,
4299,
17425,
46... | 2.211564 | 761 |
# Copyright (C) 2019 by eHealth Africa : http://www.eHealthAfrica.org
#
# See the NOTICE file distributed with this work for additional information
# regarding copyright ownership.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with
# the License. Y... | [
2,
15069,
357,
34,
8,
13130,
416,
304,
18081,
5478,
1058,
2638,
1378,
2503,
13,
68,
18081,
17584,
30997,
13,
2398,
198,
2,
198,
2,
4091,
262,
28536,
2393,
9387,
351,
428,
670,
329,
3224,
1321,
198,
2,
5115,
6634,
9238,
13,
198,
2,... | 3.590133 | 527 |
import asyncio
import json
import logging
import sys
from abc import ABC, abstractmethod
from typing import List, TypeVar, Generic, Union, NoReturn, Iterator, Iterable
from sqlalchemy import and_, or_
from .models import session_scope, Session
from .twitter import *
T = TypeVar("T")
class BaseCrawler(ABC, Generic[T]... | [
11748,
30351,
952,
198,
11748,
33918,
198,
11748,
18931,
198,
11748,
25064,
198,
6738,
450,
66,
1330,
9738,
11,
12531,
24396,
198,
6738,
19720,
1330,
7343,
11,
5994,
19852,
11,
42044,
11,
4479,
11,
1400,
13615,
11,
40806,
1352,
11,
4080... | 2.611996 | 1,067 |
from django.core.exceptions import ObjectDoesNotExist
from django.db.models.signals import post_save
from django.dispatch import receiver
from courses.models import (
Content,
CourseUserRelations,
)
from .models import Exam
from .models import ExamUserRelations
@receiver(post_save, sender=Content)
@receive... | [
6738,
42625,
14208,
13,
7295,
13,
1069,
11755,
1330,
9515,
13921,
3673,
3109,
396,
198,
6738,
42625,
14208,
13,
9945,
13,
27530,
13,
12683,
874,
1330,
1281,
62,
21928,
198,
6738,
42625,
14208,
13,
6381,
17147,
1330,
9733,
198,
6738,
109... | 3.373832 | 107 |
from math import pi, pow
from datetime import datetime, timedelta, timezone
from doop.constants import Earth
from collections import namedtuple
from enum import IntFlag
ID = namedtuple("ID", "launch_year launch_number piece")
Object = namedtuple("Object", "name number classification")
EphemerisType = IntFlag("Epheme... | [
6738,
10688,
1330,
31028,
11,
7182,
198,
6738,
4818,
8079,
1330,
4818,
8079,
11,
28805,
12514,
11,
640,
11340,
198,
6738,
466,
404,
13,
9979,
1187,
1330,
3668,
198,
6738,
17268,
1330,
3706,
83,
29291,
198,
198,
6738,
33829,
1330,
2558,
... | 2.022246 | 1,843 |
import os
import torch
from time import strftime
from util.optimization import load_sched
from log_util import set_gpu_recursive, get_last_epoch, update_metric, best_performance
| [
11748,
28686,
198,
11748,
28034,
198,
6738,
640,
1330,
965,
31387,
198,
6738,
7736,
13,
40085,
1634,
1330,
3440,
62,
1416,
704,
198,
6738,
2604,
62,
22602,
1330,
900,
62,
46999,
62,
8344,
30753,
11,
651,
62,
12957,
62,
538,
5374,
11,
... | 3.509804 | 51 |
__all__ = ["BinaryEmbeddings"]
from dataclasses import dataclass, field
import numpy as np
from gensim.models import KeyedVectors
from .embeddings import Embeddings
@dataclass
| [
834,
439,
834,
796,
14631,
33,
3219,
31567,
6048,
654,
8973,
198,
198,
6738,
4818,
330,
28958,
1330,
4818,
330,
31172,
11,
2214,
198,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
308,
641,
320,
13,
27530,
1330,
7383,
276,
53,
478,
... | 2.967213 | 61 |
'''
Ostur Cheese Cave Controller Logger
'''
import serial
import sys
import time
from datetime import datetime
| [
7061,
6,
198,
38919,
333,
27601,
18603,
22741,
5972,
1362,
198,
7061,
6,
198,
198,
11748,
11389,
198,
11748,
25064,
198,
11748,
640,
198,
6738,
4818,
8079,
1330,
4818,
8079,
628,
198
] | 3.59375 | 32 |
# This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
# See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
# Author(s): Marc Glisse
#
# Copyright (C) 2020 Inria
#
# Modification(s):
# - YYYY/MM Author: Description of the modification... | [
2,
770,
2393,
318,
636,
286,
262,
402,
463,
5303,
10074,
532,
3740,
1378,
70,
463,
5303,
13,
259,
7496,
13,
8310,
14,
532,
543,
318,
2716,
739,
17168,
13,
198,
2,
4091,
2393,
38559,
24290,
393,
467,
284,
3740,
1378,
70,
463,
5303,... | 2.34267 | 1,071 |
num = int(input("Digite o numero:"))
print(f"Divisores de {num} -",end=" ")
for i in range(1, (num//2) + 1):
if num % i == 0:
print(f"{i}",end=" ") | [
198,
22510,
796,
493,
7,
15414,
7203,
19511,
578,
267,
997,
3529,
11097,
4008,
198,
4798,
7,
69,
1,
24095,
271,
2850,
390,
1391,
22510,
92,
532,
1600,
437,
2625,
366,
8,
198,
198,
1640,
1312,
287,
2837,
7,
16,
11,
357,
22510,
1003... | 2.0125 | 80 |
#!/usr/bin/env python3
import subprocess
import netfilterqueue
import sys
import optparse
DEFAULT_QUEUE_NUM = 0
exit_code = 0
dropped_packet_count = 0
parser = optparse.OptionParser()
parser.add_option("-q", "--queue-num", dest="queue_num", default=DEFAULT_QUEUE_NUM, help="IPTables Queue Num")
parser.add_option("-s",... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
11748,
850,
14681,
198,
11748,
2010,
24455,
36560,
198,
11748,
25064,
198,
11748,
2172,
29572,
198,
198,
7206,
38865,
62,
48,
8924,
8924,
62,
41359,
796,
657,
198,
37023,
62,
8189,
... | 2.764706 | 357 |
#!/usr/bin/env python3
from app.lib.utils.request import request
from app.lib.utils.common import get_useragent
if __name__ == "__main__":
CVE_2019_2618 = CVE_2019_2618_BaseVerify('http://127.0.0.1:7001')
print(CVE_2019_2618.check())
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
6738,
598,
13,
8019,
13,
26791,
13,
25927,
1330,
2581,
198,
6738,
598,
13,
8019,
13,
26791,
13,
11321,
1330,
651,
62,
7220,
25781,
198,
198,
361,
220,
11593,
3672,
834,
6624... | 2.47 | 100 |
# Copyright 2021 Prayas Energy Group(https://www.prayaspune.org/peg/)
#
# 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... | [
2,
15069,
33448,
1736,
323,
292,
6682,
4912,
7,
5450,
1378,
2503,
13,
1050,
323,
5126,
1726,
13,
2398,
14,
22071,
34729,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
... | 3.615023 | 213 |
#!/usr/bin/env python
# test_errors.py - unit test for psycopg2.errors module
#
# Copyright (C) 2018-2019 Daniele Varrazzo <daniele.varrazzo@gmail.com>
#
# psycopg2 is free software: you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published
# by the Free Software... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
2,
1332,
62,
48277,
13,
9078,
532,
4326,
1332,
329,
17331,
22163,
70,
17,
13,
48277,
8265,
198,
2,
198,
2,
15069,
357,
34,
8,
2864,
12,
23344,
6035,
494,
293,
12372,
430,
4780... | 3.582633 | 357 |
#!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""google_api's auto-internal gyp integration.
Takes one argument, a path. Prints 1 if the path exists, 0 if not.
"""
from __fut... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
15069,
357,
66,
8,
2321,
383,
18255,
1505,
46665,
13,
1439,
2489,
10395,
13,
198,
2,
5765,
286,
428,
2723,
2438,
318,
21825,
416,
257,
347,
10305,
12,
7635,
5964,
326,
460,
307,
... | 2.937107 | 159 |
# Generated from TacticNotations.g by ANTLR 4.7
from antlr4 import *
if __name__ is not None and "." in __name__:
from .TacticNotationsParser import TacticNotationsParser
else:
from TacticNotationsParser import TacticNotationsParser
# This class defines a complete generic visitor for a parse tree produced by T... | [
2,
2980,
515,
422,
309,
12009,
3673,
602,
13,
70,
416,
3537,
14990,
49,
604,
13,
22,
198,
6738,
1885,
14050,
19,
1330,
1635,
198,
361,
11593,
3672,
834,
318,
407,
6045,
290,
366,
526,
287,
11593,
3672,
834,
25,
198,
220,
220,
220,... | 3.395189 | 291 |
# -*- coding: utf-8 -*-
from collections import Counter
if __name__ == '__main__':
solution = Solution()
assert solution.areOccurrencesEqual('abcabc')
assert not solution.areOccurrencesEqual('aaabb')
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
6738,
17268,
1330,
15034,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
4610,
796,
28186,
3419,
628,
220,
220,
220,
... | 2.855263 | 76 |
from common import *
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.lines import Line2D
import matplotlib.ticker as ticker
import os
from matplotlib import container
from common import *
from collections import OrderedDict
from matplotlib.markers import Marker... | [
6738,
2219,
1330,
1635,
198,
11748,
2603,
29487,
8019,
198,
6759,
29487,
8019,
13,
1904,
10786,
46384,
11537,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
2603,
29487,
8019,
... | 2.170007 | 2,894 |
'''
A&B.png
.intersection()
The .intersection() operator returns the intersection of a set and the set of elements in an iterable.
Sometimes, the & operator is used in place of the .intersection() operator, but it only operates on the set of elements in set.
The set is immutable to the .intersection() operation (or & ... | [
7061,
6,
198,
32,
5,
33,
13,
11134,
220,
198,
13,
3849,
5458,
3419,
198,
464,
764,
3849,
5458,
3419,
10088,
5860,
262,
16246,
286,
257,
900,
290,
262,
900,
286,
4847,
287,
281,
11629,
540,
13,
198,
15468,
11,
262,
1222,
10088,
318... | 3.482394 | 568 |
import matplotlib.pyplot as plt
import numpy as np
from fuzzysets import utils
from fuzzysets.sets.base import FuzzySet
from fuzzysets.sets.continuous import ContinuousFuzzySet
from fuzzysets.sets.finite import FiniteFuzzySet
from fuzzysets.tfn import TriangularFuzzyNumber as TFN
_X_LIMITS = (0., 10.)
_Y_LABEL = "... | [
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
26080,
893,
1039,
1330,
3384,
4487,
198,
6738,
26080,
893,
1039,
13,
28709,
13,
8692,
1330,
376,
4715,
88,
7248,
198,
6738,
2... | 1.756746 | 2,631 |
import tensorflow as tf
from evaluation.unsupervised_metrics.disentangle_api import unsupervised_metrics
from utils.data_and_files.file_utils import log
| [
198,
11748,
11192,
273,
11125,
355,
48700,
198,
198,
6738,
12660,
13,
403,
16668,
16149,
62,
4164,
10466,
13,
6381,
298,
9248,
62,
15042,
1330,
555,
16668,
16149,
62,
4164,
10466,
198,
6738,
3384,
4487,
13,
7890,
62,
392,
62,
16624,
1... | 3.25 | 48 |
import pytest
from top_secret import CastError
from top_secret.cast_handlers import bool_cast_handler
| [
11748,
12972,
9288,
198,
198,
6738,
1353,
62,
21078,
1330,
5833,
12331,
198,
6738,
1353,
62,
21078,
13,
2701,
62,
4993,
8116,
1330,
20512,
62,
2701,
62,
30281,
628,
198
] | 3.5 | 30 |
from django import forms
from .models import Kura,Post,Comment | [
6738,
42625,
14208,
1330,
5107,
198,
6738,
764,
27530,
1330,
509,
5330,
11,
6307,
11,
21357
] | 3.875 | 16 |
"""Plot contours of first stage unvaiable mass vs recovery hardware factor and recovery propellant factor."""
import os.path
from collections import namedtuple
import numpy as np
from matplotlib import pyplot as plt
from lvreuse.performance.unavail_mass import unavail_mass
fontsize = 15
if __name__ == '__main_... | [
37811,
43328,
542,
4662,
286,
717,
3800,
555,
85,
1872,
540,
2347,
3691,
7628,
6890,
5766,
290,
7628,
46059,
415,
5766,
526,
15931,
198,
198,
11748,
28686,
13,
6978,
198,
6738,
17268,
1330,
3706,
83,
29291,
198,
198,
11748,
299,
32152,
... | 3.316832 | 101 |
print('版本1.0终于完成了!!!')
| [
4798,
10786,
48304,
17312,
105,
16,
13,
15,
163,
119,
230,
12859,
236,
22522,
234,
22755,
238,
12859,
228,
10185,
11537,
198
] | 1.045455 | 22 |
# -*- coding: utf-8 -*-
'''
salt.serializers.python
~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. versionadded:: 2016.3.0
Implements a Python serializer (via pprint.format)
'''
from __future__ import absolute_import, unicode_literals
import pprint
try:
import simplejson as _json
except ImportError:
import j... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
7061,
6,
198,
220,
220,
220,
8268,
13,
46911,
11341,
13,
29412,
198,
220,
220,
220,
220,
27156,
15116,
4907,
93,
628,
220,
220,
220,
11485,
2196,
29373,
3712,
1584,
13... | 2.74677 | 387 |
"""
rkQuery is a library for programmatically building Riak search queries. It aims
to be easy to use, powerful, and protect from injection attacks that would be
possible with simple string interpolation.
Just start playing around with the ``Q`` object:
>>> from rkquery import Q
>>> Q("some literal")
<Q: ... | [
37811,
198,
81,
74,
20746,
318,
257,
5888,
329,
1430,
49454,
2615,
30385,
461,
2989,
20743,
13,
632,
12031,
198,
1462,
307,
2562,
284,
779,
11,
3665,
11,
290,
1805,
422,
16954,
3434,
326,
561,
307,
198,
79,
4733,
351,
2829,
4731,
39... | 2.569839 | 1,618 |
import numpy as np
import torch
from sklearn.metrics import accuracy_score
from sklearn.metrics import roc_curve
from sklearn.metrics import confusion_matrix
class Classifier:
'''
An extension to the original Deep SVDD to enable classification of test cases.
optim_thresh(): get the threshold at which your met... | [
11748,
299,
32152,
355,
45941,
198,
11748,
28034,
198,
6738,
1341,
35720,
13,
4164,
10466,
1330,
9922,
62,
26675,
198,
6738,
1341,
35720,
13,
4164,
10466,
1330,
686,
66,
62,
22019,
303,
198,
6738,
1341,
35720,
13,
4164,
10466,
1330,
108... | 3.73913 | 138 |
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
import common_pb2 as common__pb2
| [
2,
2980,
515,
416,
262,
308,
49,
5662,
11361,
8435,
17050,
13877,
13,
8410,
5626,
48483,
0,
198,
11748,
1036,
14751,
198,
198,
11748,
2219,
62,
40842,
17,
355,
2219,
834,
40842,
17,
628,
628
] | 3.4 | 35 |
from django import template
register = template.Library()
@register.simple_tag
| [
6738,
42625,
14208,
1330,
11055,
198,
198,
30238,
796,
11055,
13,
23377,
3419,
628,
198,
31,
30238,
13,
36439,
62,
12985,
198
] | 3.727273 | 22 |
from django.conf import settings
from django.contrib.admin.decorators import register
from django.utils.module_loading import autodiscover_modules
from elasticsearch import Elasticsearch
__author__ = 'guillaume'
# cache es_instance
es_instance = getattr(settings, 'ES_CLIENT', Elasticsearch())
# This import need to b... | [
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
28482,
13,
12501,
273,
2024,
1330,
7881,
198,
6738,
42625,
14208,
13,
26791,
13,
21412,
62,
25138,
1330,
1960,
375,
29392,
62,
18170,
198,
6738,
2746... | 3.39881 | 168 |
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)
n = int(input())
jobs = [0] * n
for i in range(n):
jobs[i] = tuple(map(int, input().split()))
jobs = sorted(jobs, key=lambda x: x[1])
_sum = 0
for j in jobs:
_sum += j[0]
if _sum > j[1]:
print('No')
sys.exit(0)
print('Yes'... | [
11748,
25064,
198,
15414,
796,
25064,
13,
19282,
259,
13,
961,
1370,
198,
17597,
13,
2617,
8344,
24197,
32374,
7,
940,
12429,
767,
8,
198,
198,
77,
796,
493,
7,
15414,
28955,
198,
43863,
796,
685,
15,
60,
1635,
299,
198,
1640,
1312,... | 2.146667 | 150 |
#Usage: python Gquadruplex_cgcc.py <fasta> <windowsize> <output> <class> <region>
import re
import sys
from Bio import SeqIO
import numpy as np
scores, medianscores, maxscores = iteratefasta(sys.argv[1], sys.argv[2])
with open(sys.argv[3], 'a') as outfile:
'''
for score in scores:
cGcCscore, binnumber = score[0],... | [
2,
28350,
25,
21015,
402,
47003,
622,
11141,
62,
66,
70,
535,
13,
9078,
1279,
7217,
64,
29,
1279,
28457,
1096,
29,
1279,
22915,
29,
1279,
4871,
29,
1279,
36996,
29,
198,
198,
11748,
302,
198,
11748,
25064,
198,
6738,
16024,
1330,
10... | 2.290323 | 279 |
import datetime
import time
import requests
import json
import xundaili
from lxml import etree
class VariFlightSpider(object):
'''
获得所有的航班列表
:return: list 访问的航班url列表
'''
'''
爬取航班页面,用xpath找到下一个需要跳转的页面
//a[@class="searchlist_innerli"]/@href
/schedule/HRB-HGH-3U2014.html?AE71649A58c77=... | [
11748,
4818,
8079,
198,
11748,
640,
198,
11748,
7007,
198,
11748,
33918,
198,
11748,
2124,
917,
603,
72,
198,
198,
6738,
300,
19875,
1330,
2123,
631,
198,
198,
4871,
15965,
43069,
41294,
7,
15252,
2599,
628,
220,
220,
220,
705,
7061,
... | 1.457597 | 566 |
# Copyright (c) 2014 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | [
2,
15069,
357,
66,
8,
1946,
2297,
10983,
11,
3457,
13,
198,
2,
1439,
6923,
33876,
13,
198,
2,
198,
2,
220,
220,
220,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
345,
743,
198,
2,
220,
220... | 3.340361 | 332 |
import unittest
import lattice_mc
import random
import numpy as np
if __name__ == '__main__':
unittest.main()
| [
11748,
555,
715,
395,
198,
11748,
47240,
501,
62,
23209,
198,
11748,
4738,
198,
11748,
299,
32152,
355,
45941,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
555,
715,
395,
13,
12417,
3419,
198... | 2.738095 | 42 |
import os
import time
import requests
url = os.environ.get("PINGER")
if url:
if url.endswith("/"):
url = url[:-1]
while True:
time.sleep(int(os.environ.get("PINGER_INTERVAL", 900)))
requests.get("%s/api/v1/ping" % (url))
| [
11748,
28686,
198,
11748,
640,
198,
198,
11748,
7007,
198,
198,
6371,
796,
28686,
13,
268,
2268,
13,
1136,
7203,
47,
2751,
1137,
4943,
198,
361,
19016,
25,
198,
220,
220,
220,
611,
19016,
13,
437,
2032,
342,
7203,
30487,
2599,
198,
... | 2.125 | 120 |
from __future__ import absolute_import
from sentry.utils.strings import truncatechars, strip
| [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
198,
6738,
1908,
563,
13,
26791,
13,
37336,
1330,
40122,
40340,
945,
11,
10283,
628,
198
] | 3.84 | 25 |
import random
import os
from art import logo, vs
from game-data import data
score = 0
start_game()
| [
11748,
4738,
198,
11748,
28686,
198,
6738,
1242,
1330,
11112,
11,
3691,
198,
6738,
983,
12,
7890,
1330,
1366,
198,
198,
26675,
796,
657,
628,
198,
9688,
62,
6057,
3419,
198
] | 3.290323 | 31 |
import json
import unittest
from osmtogeojson import osmtogeojson
if __name__ == '__main__':
unittest.main() | [
11748,
33918,
198,
11748,
555,
715,
395,
198,
198,
6738,
267,
5796,
1462,
469,
13210,
1559,
1330,
267,
5796,
1462,
469,
13210,
1559,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
555,
715,
395... | 2.533333 | 45 |
pai = input("genótipo do pai: ")
mae = input("genótipo da mãe: ")
if pai="AA":
print("dominante") | [
49712,
796,
5128,
7203,
5235,
10205,
22504,
78,
466,
279,
1872,
25,
366,
8,
198,
2611,
68,
796,
5128,
7203,
5235,
10205,
22504,
78,
12379,
285,
26102,
68,
25,
366,
8,
198,
198,
361,
279,
1872,
2625,
3838,
1298,
198,
220,
220,
220,
... | 2.081633 | 49 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Ansible module to manage Foreman hostgroup resources.
#
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at you... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
198,
2,
28038,
856,
8265,
284,
6687,
4558,
805,
2583,
8094,
4133,
13,
198,
2,
198,
2,
770,
8265,
318,
1479,
3788,
25,
... | 2.952182 | 1,673 |
"""
Tests for source_transformer
"""
from ast import ClassDef
from unittest import TestCase
from unittest.mock import patch
from cdd.pure_utils import PY_GTE_3_9
from cdd.tests.utils_for_tests import unittest_main
class TestSourceTransformer(TestCase):
"""
Tests for source_transformer
"""
def test_... | [
37811,
198,
51,
3558,
329,
2723,
62,
7645,
16354,
198,
37811,
198,
198,
6738,
6468,
1330,
5016,
7469,
198,
6738,
555,
715,
395,
1330,
6208,
20448,
198,
6738,
555,
715,
395,
13,
76,
735,
1330,
8529,
198,
198,
6738,
269,
1860,
13,
374... | 1.959212 | 711 |
import sqlite3
import json
import datetime
import pause
import utils
import math
import socket
import time
from dateutil.parser import parse
from multiprocessing.connection import Listener
from selenium.webdriver import Firefox
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import Se... | [
11748,
44161,
578,
18,
198,
11748,
33918,
198,
11748,
4818,
8079,
198,
11748,
14985,
198,
11748,
3384,
4487,
198,
11748,
10688,
198,
11748,
17802,
198,
11748,
640,
198,
6738,
3128,
22602,
13,
48610,
1330,
21136,
198,
6738,
18540,
305,
919... | 2.331871 | 684 |
import requests
from api.models import *
from django.core.management import BaseCommand
from api.utils.utilities import get_agency_type
| [
11748,
7007,
198,
6738,
40391,
13,
27530,
1330,
1635,
198,
6738,
42625,
14208,
13,
7295,
13,
27604,
1330,
7308,
21575,
198,
198,
6738,
40391,
13,
26791,
13,
315,
2410,
1330,
651,
62,
40955,
62,
4906,
628,
628
] | 3.783784 | 37 |
import unittest
from django.conf import settings
from django.test import TestCase, RequestFactory
from django_cradmin import cradmin_testhelpers
from model_mommy import mommy
from devilry.devilry_account.models import PermissionGroup
from devilry.devilry_admin.views.dashboard import overview
| [
11748,
555,
715,
395,
198,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
9288,
1330,
6208,
20448,
11,
19390,
22810,
198,
6738,
42625,
14208,
62,
6098,
28482,
1330,
1067,
28482,
62,
9288,
16794,
364,
198,
6... | 3.597561 | 82 |
#!/usr/bin/env python
"""
config_parse
Configuration parser
"""
from __future__ import absolute_import
import os
import sys
import configparser
import core_scripts.other_tools.list_tools as nii_list_tools
import core_scripts.other_tools.display as nii_display
__author__ = "Xin Wang"
__email__ = "wangxin@nii.ac.jp"... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
37811,
198,
11250,
62,
29572,
198,
198,
38149,
30751,
198,
198,
37811,
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
198,
11748,
28686,
198,
11748,
25064,
198,
11748,
4566,
4... | 2.107119 | 1,475 |
maps={}
maps['닭갈비']=[]
maps['닭갈비'].append(["고수닭갈비",{'lat':35.8430711,'lon':127.1279931}])
maps['닭갈비'].append(["춘천닭갈비",{'lat':35.8430713,'lon':127.1279933}])
maps['닭갈비'].append(["황제춘천닭갈비",{'lat':35.8430712,'lon':127.1279929}]) | [
31803,
34758,
92,
198,
31803,
17816,
46695,
255,
166,
108,
230,
167,
117,
226,
20520,
28,
21737,
198,
31803,
17816,
46695,
255,
166,
108,
230,
167,
117,
226,
6,
4083,
33295,
7,
14692,
166,
111,
254,
168,
230,
246,
46695,
255,
166,
1... | 1.300578 | 173 |
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under th... | [
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198,
2,
921,
743,
7330,
257,
4866,
286,
262,
13789,
379,
198,
2,... | 3.921397 | 229 |
# Benchmarking Suite
# Copyright 2014-2017 Engineering Ingegneria Informatica S.p.A.
#
# 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 ... | [
2,
25187,
4102,
278,
26264,
198,
2,
15069,
1946,
12,
5539,
14044,
554,
469,
70,
1008,
544,
45255,
1512,
64,
311,
13,
79,
13,
32,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
1... | 2.831643 | 986 |
import pytest
import otscrape as ot
import time
@pytest.mark.slow
@pytest.mark.integration
@pytest.mark.ot_mp
@pytest.mark.slow
@pytest.mark.integration
@pytest.mark.ot_mp
| [
11748,
12972,
9288,
198,
198,
11748,
267,
912,
66,
13484,
355,
30972,
198,
11748,
640,
628,
628,
198,
31,
9078,
9288,
13,
4102,
13,
38246,
198,
31,
9078,
9288,
13,
4102,
13,
18908,
1358,
198,
31,
9078,
9288,
13,
4102,
13,
313,
62,
... | 2.452055 | 73 |
from django.conf.urls import url
from django.urls import path, include
from apps.intro import views
app_name = "intro"
urlpatterns = [
url(r'^$', views.homepage, name='homepage'),
]
| [
6738,
42625,
14208,
13,
10414,
13,
6371,
82,
1330,
19016,
198,
6738,
42625,
14208,
13,
6371,
82,
1330,
3108,
11,
2291,
198,
6738,
6725,
13,
600,
305,
1330,
5009,
628,
198,
1324,
62,
3672,
796,
366,
600,
305,
1,
198,
6371,
33279,
82,... | 2.724638 | 69 |
import os
import pandas
import glob
import json
from src.utils import definitions
import matplotlib.pyplot as plt
from sklearn import metrics
| [
11748,
28686,
198,
11748,
19798,
292,
198,
11748,
15095,
198,
11748,
33918,
198,
6738,
12351,
13,
26791,
1330,
17336,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
6738,
1341,
35720,
1330,
20731,
628,
628,
628,
628,
... | 3.619048 | 42 |
# auth: christian bitter
# desc: in this tutorial we register key events and display some text accordingly
# specifically, we are going to listen for the 4 arrow keys
import pygame
from pygame.locals import K_LEFT, K_RIGHT, K_DOWN, K_UP, QUIT
if not pygame.font:
print("Pygame - fonts not loaded")
if not pyg... | [
2,
6284,
25,
33826,
666,
12922,
198,
2,
1715,
25,
287,
428,
11808,
356,
7881,
1994,
2995,
290,
3359,
617,
2420,
16062,
198,
2,
220,
220,
220,
220,
220,
220,
5734,
11,
356,
389,
1016,
284,
6004,
329,
262,
604,
15452,
8251,
198,
198... | 2.530488 | 656 |
from enums import enum
from fontlist import FontList
from datetime import datetime
__all_fonts__ = FontList.all()
font_roles = enum(title=0,
body=1,
mono=2,
cursive=3,
inherit=-1)
if __name__ == "__main__":
import lipsum
block_sty... | [
6738,
551,
5700,
1330,
33829,
198,
6738,
10369,
4868,
1330,
24060,
8053,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
198,
834,
439,
62,
10331,
82,
834,
796,
24060,
8053,
13,
439,
3419,
198,
198,
10331,
62,
305,
829,
796,
33829,
7,
... | 1.700254 | 1,181 |
"""
This module provides classes for testing RatingChange object
"""
import unittest
from codeforces import RatingChange
if __name__ == '__main__':
unittest.main()
| [
37811,
198,
1212,
8265,
3769,
6097,
329,
4856,
12028,
19400,
2134,
198,
37811,
198,
198,
11748,
555,
715,
395,
198,
198,
6738,
14873,
891,
273,
728,
1330,
12028,
19400,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
... | 3.264151 | 53 |
# Copyright 1999-2021 Alibaba Group Holding 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 a... | [
2,
15069,
7358,
12,
1238,
2481,
41992,
4912,
31703,
12052,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
... | 3.106858 | 627 |
import os
import cv2
import glob
import torch
import imageio
import numpy as np
import pandas as pd
import seaborn as sn
import torch.nn as nn
import torch.optim as optim
import matplotlib.pyplot as plt
from sklearn.metrics import confusion_matrix
from scipy.io import wavfile
from PIL import Image
from losses.losses im... | [
11748,
28686,
198,
11748,
269,
85,
17,
198,
11748,
15095,
198,
11748,
28034,
198,
11748,
2939,
952,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
384,
397,
1211,
355,
3013,
198,
11748,
28034,
13,
... | 3.237624 | 101 |
'''
Link check_all script to a manage.py command
'''
from django.core.management import BaseCommand
from ._script import run_script
class Command(BaseCommand):
'''
Run general script for checking
'''
help = "Run general script for checking"
| [
7061,
6,
198,
11280,
2198,
62,
439,
4226,
284,
257,
6687,
13,
9078,
3141,
198,
7061,
6,
198,
198,
6738,
42625,
14208,
13,
7295,
13,
27604,
1330,
7308,
21575,
198,
6738,
47540,
12048,
1330,
1057,
62,
12048,
628,
198,
4871,
9455,
7,
1... | 3.25 | 80 |
# Create a class called Article. The __init__ method should accept 3 arguments: title: str, content: str, and author: str.
# The class should also have 4 methods:
# • edit(new_content: str) - changes the old content to the new one
# • change_author(new_author: str) - changes the old author with the new one
# • rename(... | [
2,
13610,
257,
1398,
1444,
10172,
13,
383,
11593,
15003,
834,
2446,
815,
2453,
513,
7159,
25,
3670,
25,
965,
11,
2695,
25,
965,
11,
290,
1772,
25,
965,
13,
220,
198,
2,
383,
1398,
815,
635,
423,
604,
5050,
25,
198,
2,
5595,
197,... | 3.289575 | 259 |
import os
# import bag package
import bag
from bag.io import read_yaml
#import scripts_dsn.diffamp_simple as diffamp
# import BAG demo Python modules
import xbase_demo.core as demo_core
import xbase_demo.demo_layout.core as layout_core
import bag_testbenches.scripts_dsn.CML as diffamp
from bag_testbenches.verificatio... | [
11748,
28686,
198,
198,
2,
1330,
6131,
5301,
198,
11748,
6131,
198,
6738,
6131,
13,
952,
1330,
1100,
62,
88,
43695,
198,
2,
11748,
14750,
62,
9310,
77,
13,
26069,
696,
62,
36439,
355,
814,
696,
198,
2,
1330,
347,
4760,
13605,
11361,... | 2.713287 | 286 |
import sys
import time
import curses
import pickle
from collections import deque
import copy
from .arena import Arena, BlockEfir, BlockSnake, BlockFood, BlockBorder
from . import settings, windows
from .exeptions import *
| [
11748,
25064,
198,
11748,
640,
198,
11748,
43878,
198,
11748,
2298,
293,
198,
6738,
17268,
1330,
390,
4188,
198,
11748,
4866,
198,
198,
6738,
764,
533,
2616,
1330,
10937,
11,
9726,
36,
69,
343,
11,
9726,
49795,
11,
9726,
24602,
11,
97... | 3.813559 | 59 |
import os
from glob import glob
from pathlib import Path
from typing import Union, List
import numpy as np
from tensorflow.keras.utils import get_file
from facegan import ROOT_PATH
from facegan.ffhq.face_alignment import image_align
from facegan.ffhq.landmarks_detector import LandmarksDetector
from facegan.utils.util... | [
11748,
28686,
198,
6738,
15095,
1330,
15095,
198,
6738,
3108,
8019,
1330,
10644,
198,
6738,
19720,
1330,
4479,
11,
7343,
198,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
11192,
273,
11125,
13,
6122,
292,
13,
26791,
1330,
651,
62,
775... | 3.31068 | 103 |
from marshmallow import Schema, fields
| [
6738,
22397,
42725,
1330,
10011,
2611,
11,
7032,
628
] | 4.444444 | 9 |
# Task 08. Mutate Strings
str_1 = input()
str_2 = input()
new_str = list(str_1)
for ch in range(len(str_2)):
if new_str[ch] == str_2[ch]:
continue
else:
new_str[ch] = str_2[ch]
print(''.join(new_str))
| [
2,
15941,
8487,
13,
13859,
378,
4285,
654,
198,
198,
2536,
62,
16,
796,
5128,
3419,
198,
2536,
62,
17,
796,
5128,
3419,
198,
198,
3605,
62,
2536,
796,
1351,
7,
2536,
62,
16,
8,
198,
198,
1640,
442,
287,
2837,
7,
11925,
7,
2536,
... | 1.982906 | 117 |
import unittest
from algorithm_collection.mathematics import iterative_logarithm
| [
11748,
555,
715,
395,
198,
6738,
11862,
62,
43681,
13,
6759,
10024,
873,
1330,
11629,
876,
62,
6404,
283,
342,
76,
628
] | 3.727273 | 22 |
# Copyright 2016 Battelle Energy Alliance, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | [
198,
2,
15069,
1584,
12350,
13485,
6682,
10302,
11,
11419,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789... | 2.883908 | 870 |
#!/usr/bin/env python
# Copyright 2016-2020 Workiva Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
2,
15069,
1584,
12,
42334,
5521,
12151,
3457,
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,
7... | 2.844072 | 776 |