content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
person1 = input("what is the age of the first person?")
person2 = input("what is the age of the second person?")
person1 = int(person1)
person2 = int(person2)
age_difference = person1 - person2
age_difference = abs(age_difference)
print ("the age diffrence is " + str(age_difference))
| [
6259,
16,
796,
5128,
7203,
10919,
318,
262,
2479,
286,
262,
717,
1048,
1701,
8,
198,
6259,
17,
796,
5128,
7203,
10919,
318,
262,
2479,
286,
262,
1218,
1048,
1701,
8,
198,
6259,
16,
796,
493,
7,
6259,
16,
8,
198,
6259,
17,
796,
4... | 3.131868 | 91 |
import datetime
import os
import re
proj_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
version = datetime.datetime.now().strftime('.dev%y%m%d%H%M')
version_path = os.path.join(proj_dir, 'pywebio', '__version__.py')
content = open(version_path).read()
new_content = re.sub(r'__version__ = "(.*)?"',... | [
11748,
4818,
8079,
198,
11748,
28686,
198,
11748,
302,
198,
198,
1676,
73,
62,
15908,
796,
28686,
13,
6978,
13,
15908,
3672,
7,
418,
13,
6978,
13,
15908,
3672,
7,
418,
13,
6978,
13,
397,
2777,
776,
7,
834,
7753,
834,
22305,
198,
1... | 2.455752 | 226 |
REGISTRY = {}
from .basic_controller import BasicMAC
from .basic_controller_convention import BasicMACConvention
from .basic_controller_perception import BasicMACPerception
REGISTRY["basic_mac"] = BasicMAC
REGISTRY["basic_mac_convention"] = BasicMACConvention
REGISTRY["basic_mac_perception"] = BasicMACPerception
| [
31553,
1797,
40405,
796,
23884,
198,
198,
6738,
764,
35487,
62,
36500,
1330,
14392,
44721,
198,
6738,
764,
35487,
62,
36500,
62,
1102,
4018,
1330,
14392,
44721,
3103,
4018,
198,
6738,
764,
35487,
62,
36500,
62,
525,
4516,
1330,
14392,
4... | 3.483516 | 91 |
# Generated by Django 3.1.7 on 2021-04-08 05:36
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
513,
13,
16,
13,
22,
319,
33448,
12,
3023,
12,
2919,
8870,
25,
2623,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
from common import to_hex, APIFrame, ATCommand, TXRequest, UserDataRelay
import argparse
import binascii
import serial
import time
import unittest
if __name__ == "__main__":
args = parse_arguments()
if args.integration:
print("Running the integration tests.")
run_integration_tests()
... | [
6738,
2219,
1330,
284,
62,
33095,
11,
3486,
5064,
28073,
11,
317,
4825,
2002,
392,
11,
15326,
18453,
11,
11787,
6601,
6892,
323,
198,
198,
11748,
1822,
29572,
198,
11748,
9874,
292,
979,
72,
198,
11748,
11389,
198,
11748,
640,
198,
11... | 2.666667 | 147 |
import json
import os
from typing import Any, Dict, List, Optional, cast
import click
from pydantic import BaseModel
from requests_toolbelt.sessions import BaseUrlSession
from workspacesio.common import schemas
| [
11748,
33918,
198,
11748,
28686,
198,
6738,
19720,
1330,
4377,
11,
360,
713,
11,
7343,
11,
32233,
11,
3350,
198,
198,
11748,
3904,
198,
6738,
279,
5173,
5109,
1330,
7308,
17633,
198,
6738,
7007,
62,
25981,
37976,
13,
82,
6202,
1330,
7... | 3.711864 | 59 |
from django.contrib import admin
from django.urls import path
from books.views import (
Home_view,About,Contact_us,static_demo_view,Genre_create_view,Book_issue_view,Book_return_view,Book_return1,Book_return_user,
Book_index_view,Book_list_view,Book_detail_view,Book_create_view,Book_update_view,Book_delete_view... | [
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
6738,
42625,
14208,
13,
6371,
82,
1330,
3108,
198,
6738,
3835,
13,
33571,
1330,
357,
198,
220,
220,
220,
5995,
62,
1177,
11,
8585,
11,
17829,
62,
385,
11,
12708,
62,
9536,
78,
62,... | 2.569153 | 1,193 |
import time
from os import system
from django.http import HttpResponse
from django.template import Context, loader
from django.views.decorators.csrf import csrf_exempt # Pour des formulaires POST libres
from jla_utils.utils import Fichier
from .models import ElementDialogue
@csrf_exempt # En théorie, c'est une brèc... | [
11748,
640,
198,
198,
6738,
28686,
1330,
1080,
198,
198,
6738,
42625,
14208,
13,
4023,
1330,
367,
29281,
31077,
198,
6738,
42625,
14208,
13,
28243,
1330,
30532,
11,
40213,
198,
6738,
42625,
14208,
13,
33571,
13,
12501,
273,
2024,
13,
63... | 3.252252 | 111 |
""" context manager based trackers for profiling requests and background jobs
"""
import time
from collections import ChainMap
import functools
from typing import ContextManager, Mapping, List
from django.http.request import HttpRequest
from django.http.response import HttpResponse
class Tracker(ContextManager): ... | [
37811,
4732,
4706,
1912,
2610,
364,
329,
31582,
7007,
290,
4469,
3946,
198,
37811,
198,
198,
11748,
640,
198,
6738,
17268,
1330,
21853,
13912,
198,
11748,
1257,
310,
10141,
198,
6738,
19720,
1330,
30532,
13511,
11,
337,
5912,
11,
7343,
... | 2.865237 | 653 |
import tensorflow as tf
| [
11748,
11192,
273,
11125,
355,
48700,
628,
198
] | 3.25 | 8 |
"""
Top-down modular robot simulation.
Created by Oleg Klimov. Licensed on the same terms as the rest of OpenAI Gym.
Modified by Sidney Pontes-Filho.
"""
import numpy as np
import math
from Box2D.b2 import (
circleShape,
fixtureDef,
polygonShape,
revoluteJointDef,
)
MODULE_SIZE = 1
WHEEL_SIZE = 1
SENSOR_SIZ... | [
37811,
198,
9126,
12,
2902,
26507,
9379,
18640,
13,
198,
198,
41972,
416,
440,
1455,
509,
2475,
709,
13,
49962,
319,
262,
976,
2846,
355,
262,
1334,
286,
4946,
20185,
31187,
13,
198,
5841,
1431,
416,
35727,
26345,
274,
12,
11928,
8873... | 2.118056 | 432 |
#!/usr/bin/env python
__copyright__ = '''
Copyright 2019 the original author or 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
https://www.apache.org/licenses/LICENSE-2.0
... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
834,
22163,
4766,
834,
796,
705,
7061,
198,
15269,
13130,
262,
2656,
1772,
393,
7035,
13,
628,
220,
220,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
... | 2.504262 | 1,525 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""wowin.py: A client for automatize WoW (3.3.5) login
using sockets and a variation of SRP6.
It is be able to autovote too.
Edit accounts.txt file in the following format to use this script:
username:password
username2:password2
Requirements:
pip install ... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
42773,
259,
13,
9078,
25,
317,
5456,
329,
3557,
265,
1096,
22173,
54,
357,
18,
13,
18,
13,
20,
8,
17594,
198,
220,
... | 2.312966 | 1,342 |
from app import tasks
def test_example_task():
"""
test_example_task サンプルのタスクを受信できているかのテスト
"""
task_output = tasks.example_task("Hello World")
assert task_output == "test task returns Hello World"
| [
6738,
598,
1330,
8861,
628,
198,
4299,
1332,
62,
20688,
62,
35943,
33529,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
1332,
62,
20688,
62,
35943,
38390,
6527,
30965,
9202,
5641,
23376,
8943,
14099,
31758,
20998,
245,
46479,
94,
30640... | 2.488636 | 88 |
import argparse
import logging
import os
from pathlib import Path
import uuid
import numpy as np
from models import AWDLSTMLanguageModel, LanguageModel
from sources import TextDataSource, WikidumpDataSource
from text import Dictionary, LanguageModelLoader, Tokenizer
logging.basicConfig(level=logging.INFO)
if __n... | [
11748,
1822,
29572,
198,
11748,
18931,
198,
11748,
28686,
198,
6738,
3108,
8019,
1330,
10644,
198,
11748,
334,
27112,
198,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
4981,
1330,
14356,
19260,
2257,
5805,
9000,
17633,
11,
15417,
1... | 2.850103 | 487 |
"""
Useful helper methods related to the XBlock runtime
"""
import hashlib
import hmac
import math
import time
from uuid import uuid4
import crum
from django.conf import settings
def get_secure_token_for_xblock_handler(user_id, block_key_str, time_idx=0):
"""
Get a secure token (one-way hash) used to authen... | [
37811,
198,
11041,
913,
31904,
5050,
3519,
284,
262,
1395,
12235,
19124,
198,
37811,
198,
198,
11748,
12234,
8019,
198,
11748,
289,
20285,
198,
11748,
10688,
198,
11748,
640,
198,
6738,
334,
27112,
1330,
334,
27112,
19,
198,
198,
11748,
... | 3.083834 | 2,827 |
import json
import logging
import os
import pathlib
from typing import List, Optional, Union
import github
from urllib3.util.retry import Retry
import github_action
import publish
from github_action import GithubAction
from junit import parse_junit_xml_files
from publish import hide_comments_modes, available_annotati... | [
11748,
33918,
198,
11748,
18931,
198,
11748,
28686,
198,
11748,
3108,
8019,
198,
6738,
19720,
1330,
7343,
11,
32233,
11,
4479,
198,
198,
11748,
33084,
198,
6738,
2956,
297,
571,
18,
13,
22602,
13,
1186,
563,
1330,
4990,
563,
198,
198,
... | 2.929638 | 469 |
from django.conf.urls import patterns, url, include
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
#url('', include('project_example.apps.'))
(r'^admin/doc/', include('django.contrib.admindocs.urls')),
(r'^admin/', include(admin.site.urls)),
url(r'^admin/salmonella/... | [
6738,
42625,
14208,
13,
10414,
13,
6371,
82,
1330,
7572,
11,
19016,
11,
2291,
198,
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
198,
28482,
13,
2306,
375,
29392,
3419,
198,
198,
6371,
33279,
82,
796,
7572,
10786,
3256,
198,
22... | 2.583942 | 137 |
# -*- coding: utf-8 -*-
from django.utils.translation import ugettext_lazy as _
from app.models import OS, Population, Browser, BrowserDownload, ResolutionByYear
from model_report.report import reports, ReportAdmin
from model_report.utils import (usd_format, avg_column, sum_column, count_column)
reports.register('r... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
42625,
14208,
13,
26791,
13,
41519,
1330,
334,
1136,
5239,
62,
75,
12582,
355,
4808,
198,
6738,
598,
13,
27530,
1330,
7294,
11,
20133,
11,
34270,
11,
34270,
10002,... | 3.558511 | 188 |
# Backbones
from .backbones.resnet import *
| [
2,
5157,
35095,
198,
6738,
764,
1891,
35095,
13,
411,
3262,
1330,
1635,
628
] | 3.214286 | 14 |
import pytest
import pika
from airflow.exceptions import AirflowSensorTimeout
from rabbitmq_provider.hooks.rabbitmq import RabbitMQHook
from rabbitmq_provider.sensors.rabbitmq import RabbitMQSensor
@pytest.fixture(autouse=True)
| [
11748,
12972,
9288,
198,
11748,
279,
9232,
198,
198,
6738,
45771,
13,
1069,
11755,
1330,
3701,
11125,
47864,
48031,
198,
6738,
22746,
76,
80,
62,
15234,
1304,
13,
25480,
82,
13,
81,
14229,
76,
80,
1330,
25498,
49215,
39,
566,
198,
673... | 3.012821 | 78 |
import mock
from shakenfist.config import SFConfig
from shakenfist.tests import test_shakenfist
| [
11748,
15290,
198,
198,
6738,
27821,
69,
396,
13,
11250,
1330,
14362,
16934,
198,
6738,
27821,
69,
396,
13,
41989,
1330,
1332,
62,
1477,
1685,
69,
396,
628
] | 3.5 | 28 |
"""Project file for xz."""
import typing as tp
import benchbuild as bb
from benchbuild.utils.cmd import autoreconf, make
from benchbuild.utils.revision_ranges import (
block_revisions,
GoodBadSubgraph,
RevisionRange,
)
from benchbuild.utils.settings import get_number_of_jobs
from plumbum import local
from... | [
37811,
16775,
2393,
329,
2124,
89,
526,
15931,
198,
11748,
19720,
355,
256,
79,
198,
198,
11748,
7624,
11249,
355,
275,
65,
198,
6738,
7624,
11249,
13,
26791,
13,
28758,
1330,
1960,
382,
10414,
11,
787,
198,
6738,
7624,
11249,
13,
267... | 2.00118 | 1,695 |
import os
from pathlib import Path
from unittest.mock import patch, MagicMock
import pytest
import sciencebeam_trainer_delft.utils.download_manager as download_manager_module
from sciencebeam_trainer_delft.utils.download_manager import (
DownloadManager
)
EMBEDDING_NAME_1 = 'embedding1'
EXTERNAL_TXT_URL_1 = 'ht... | [
11748,
28686,
198,
6738,
3108,
8019,
1330,
10644,
198,
6738,
555,
715,
395,
13,
76,
735,
1330,
8529,
11,
6139,
44,
735,
198,
198,
11748,
12972,
9288,
198,
198,
11748,
3783,
40045,
62,
2213,
10613,
62,
12381,
701,
13,
26791,
13,
15002,... | 2.605381 | 223 |
#!/usr/bin/env python
import warnings
warnings.filterwarnings('ignore', category=FutureWarning)
import sys
import zlib
if len(sys.argv) < 2:
print "Error: You must provide the secret key"
sys.exit()
key = ''.join(sys.argv[1:])
crc32 = zlib.crc32(key)
key = 'asdf;klasdjf;kakjsdf;akjf;aksdljf;asldjfqewrads... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
14601,
198,
40539,
654,
13,
24455,
40539,
654,
10786,
46430,
3256,
6536,
28,
29783,
20361,
8,
198,
198,
11748,
25064,
198,
11748,
1976,
8019,
628,
198,
198,
361,
18896,
7,
... | 2.378917 | 351 |
import pandas as pd
INFECTION_TO_DEATH = 24
INFECTION_TO_ADMISSION = 11
INFECTION_TO_CASE = 11
| [
11748,
19798,
292,
355,
279,
67,
198,
198,
1268,
37,
24565,
62,
10468,
62,
7206,
12599,
796,
1987,
198,
1268,
37,
24565,
62,
10468,
62,
2885,
44,
40373,
796,
1367,
198,
1268,
37,
24565,
62,
10468,
62,
34,
11159,
796,
1367,
628,
628,... | 2.272727 | 44 |
# Created on Sep 16, 2020
# author: Hosein Hadipour
# contact: hsn.hadipour@gmail.com
import os
output_dir = os.path.curdir
def skinnytk3zckb(R = 23):
"""
Checking the ZC attack propsed in the following paper:
Zero-Correlation Attacks on Tweakable Block Ciphers with Linear Tweakey Expansion
https://... | [
2,
15622,
319,
8621,
1467,
11,
12131,
198,
2,
1772,
25,
367,
577,
259,
11161,
541,
454,
198,
2,
2800,
25,
289,
16184,
13,
18108,
541,
454,
31,
14816,
13,
785,
198,
198,
11748,
28686,
198,
198,
22915,
62,
15908,
796,
28686,
13,
697... | 2.014146 | 919 |
from dataflows import Flow, printer, checkpoint, set_type, update_resource, dump_to_path, join, load, add_field
import requests
import time
if __name__ == '__main__':
judges_flow('data/judges').process()
| [
6738,
1366,
44041,
1330,
27782,
11,
20632,
11,
26954,
11,
900,
62,
4906,
11,
4296,
62,
31092,
11,
10285,
62,
1462,
62,
6978,
11,
4654,
11,
3440,
11,
751,
62,
3245,
198,
11748,
7007,
198,
11748,
640,
628,
628,
628,
628,
198,
361,
1... | 3.176471 | 68 |
import logging
log = logging.getLogger(__name__)
import re
import spotipy
import spotipy.client
from spotipy.oauth2 import SpotifyClientCredentials
import botologist.plugin
| [
11748,
18931,
198,
198,
6404,
796,
18931,
13,
1136,
11187,
1362,
7,
834,
3672,
834,
8,
198,
198,
11748,
302,
198,
198,
11748,
4136,
541,
88,
198,
11748,
4136,
541,
88,
13,
16366,
198,
6738,
4136,
541,
88,
13,
12162,
1071,
17,
1330,
... | 3.157895 | 57 |
from django.contrib import admin
from ordered_model.admin import OrderedInlineModelAdminMixin, OrderedTabularInline
from homeschool.courses.models import GradeLevelCoursesThroughModel
from homeschool.schools.models import GradeLevel, School, SchoolBreak, SchoolYear
@admin.register(School)
@admin.register(SchoolYea... | [
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
6738,
6149,
62,
19849,
13,
28482,
1330,
14230,
1068,
818,
1370,
17633,
46787,
35608,
259,
11,
14230,
1068,
33349,
934,
818,
1370,
198,
198,
6738,
5682,
1251,
13,
66,
39975,
13,
27530,... | 3.53211 | 109 |
import os
import torch
from models.networks.sync_batchnorm import DataParallelWithCallback
from models.ver2ver_model import Ver2VerModel
class Ver2VerTrainer():
"""
Trainer creates the model and optimizers, and uses them to
updates the weights of the network while reporting losses
and the latest visua... | [
11748,
28686,
198,
11748,
28034,
198,
198,
6738,
4981,
13,
3262,
5225,
13,
27261,
62,
43501,
27237,
1330,
6060,
10044,
29363,
3152,
47258,
198,
6738,
4981,
13,
332,
17,
332,
62,
19849,
1330,
4643,
17,
13414,
17633,
198,
198,
4871,
4643,... | 4.288 | 125 |
from datetime import datetime
from flask_restplus import Resource, fields
from flask import request
from app.extensions import api
from app.api.mines.mine.models.mine import Mine
from app.api.mines.permits.permit.models.permit import Permit
from app.api.utils.access_decorators import requires_role_view_all
VERIFY_P... | [
6738,
4818,
8079,
1330,
4818,
8079,
198,
198,
6738,
42903,
62,
2118,
9541,
1330,
20857,
11,
7032,
198,
6738,
42903,
1330,
2581,
198,
6738,
598,
13,
2302,
5736,
1330,
40391,
198,
198,
6738,
598,
13,
15042,
13,
1084,
274,
13,
3810,
13,
... | 2.7 | 200 |
from conf import *
import pygame
import random
vec = pygame.math.Vector2
# Teleports the enemy back into the screen
# noinspection PyArgumentList
# noinspection PyArgumentList
# noinspection PyArgumentList
# noinspection PyArgumentList
# noinspection PyArgumentList
| [
6738,
1013,
1330,
1635,
198,
11748,
12972,
6057,
198,
11748,
4738,
198,
198,
35138,
796,
12972,
6057,
13,
11018,
13,
38469,
17,
628,
198,
2,
14318,
3742,
262,
4472,
736,
656,
262,
3159,
628,
198,
2,
645,
1040,
14978,
9485,
28100,
1713... | 3.294118 | 85 |
"""
==========================================================================
ProcXcel.py
==========================================================================
Processor-accelerator compostion.
Author : Shunning Jiang
Date : June 12, 2019
"""
from pymtl3 import *
from pymtl3.stdlib.connects import connect_pa... | [
37811,
198,
23926,
2559,
855,
198,
31345,
55,
5276,
13,
9078,
198,
23926,
2559,
855,
198,
18709,
273,
12,
330,
7015,
1352,
36541,
295,
13,
198,
198,
13838,
1058,
911,
16596,
32294,
198,
220,
7536,
1058,
2795,
1105,
11,
13130,
198,
378... | 3.220994 | 181 |
import re
from streamlink.plugin import Plugin
from streamlink.plugin.api import validate
from streamlink.plugin.api import useragents
from streamlink.stream import HLSStream
_url_re = re.compile(r"https?://(www\.)?ok\.ru/live/\d+")
_vod_re = re.compile(r";(?P<hlsurl>[^;]+video\.m3u8.+?)\\"")
_schema = validate... | [
11748,
302,
198,
198,
6738,
4269,
8726,
13,
33803,
1330,
42636,
198,
6738,
4269,
8726,
13,
33803,
13,
15042,
1330,
26571,
198,
6738,
4269,
8726,
13,
33803,
13,
15042,
1330,
2836,
49638,
198,
6738,
4269,
8726,
13,
5532,
1330,
367,
6561,
... | 2.297491 | 279 |
from pyzbar.pyzbar import decode
import cv2
import os
import argparse
if __name__ == '__main__':
arguments = init_parse()
if arguments['mode'] == 'stream': # on stream/video
cap = cv2.VideoCapture('/dev/video0') # video2: usb cam | video0: laptop cam or pi cam
cap.set(3, 1280)
cap.s... | [
6738,
12972,
89,
5657,
13,
9078,
89,
5657,
1330,
36899,
198,
11748,
269,
85,
17,
198,
11748,
28686,
198,
11748,
1822,
29572,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
7159,
796,
2315,... | 1.983858 | 1,239 |
import mutagene
| [
11748,
4517,
363,
1734,
628
] | 3.4 | 5 |
from collections import namedtuple
Foo = namedtuple('Foo', 'attribute')
foo = Foo(attri<caret>) | [
6738,
17268,
1330,
3706,
83,
29291,
198,
198,
37,
2238,
796,
3706,
83,
29291,
10786,
37,
2238,
3256,
705,
42348,
11537,
198,
21943,
796,
36080,
7,
1078,
380,
27,
6651,
83,
43734
] | 3 | 32 |
import numpy as np
def point_2_x_y(point_list):
"""
point_list
[(x0, y0), (x1, y1), ..., (xn-2, yn-2), (xn-1, yn-1)]
return
x_list = [x0, x1, x2, ...]
y_list = [y0, y1, y2, ...]
"""
x_list = []
y_list = []
for point in point_list:
x_list.append(point[0])
... | [
11748,
299,
32152,
355,
45941,
198,
198,
4299,
966,
62,
17,
62,
87,
62,
88,
7,
4122,
62,
4868,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
966,
62,
4868,
198,
220,
220,
220,
220,
220,
220,
220,
47527,
87,
15,
11,
331,
... | 1.480724 | 3,865 |
#!/usr/bin/env python
# import general use modules
import os
import re
from pprint import pprint as pp
# import nornir specifics
from nornir import InitNornir
from nornir.core.task import Result
from nornir.plugins.functions.text import print_result
from nornir.core.filter import F
from nornir.plugins.tasks import netw... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
1330,
2276,
779,
13103,
198,
11748,
28686,
198,
11748,
302,
198,
6738,
279,
4798,
1330,
279,
4798,
355,
9788,
198,
2,
1330,
299,
1211,
343,
23514,
198,
6738,
299,
1211,
343,
1330,
... | 3.129187 | 209 |
"""
Copyright 2013, 2014 Ricardo Tubio-Pardavila
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 ... | [
37811,
198,
220,
220,
15069,
2211,
11,
1946,
38847,
42850,
952,
12,
47,
446,
615,
10102,
628,
220,
220,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
220,
220,
345,
743,
407,
779,
428,
239... | 2.223904 | 1,916 |
from flask_restplus import Namespace, fields
| [
6738,
42903,
62,
2118,
9541,
1330,
28531,
10223,
11,
7032,
198
] | 4.090909 | 11 |
from typing import List
from pydantic import BaseModel, conlist, constr
| [
6738,
19720,
1330,
7343,
198,
198,
6738,
279,
5173,
5109,
1330,
7308,
17633,
11,
369,
4868,
11,
1500,
81,
628,
628
] | 3.619048 | 21 |
# 引入库
import pygame, math, sys, random, ctypes
pygame.init()
GetSystemMetrics = ctypes.windll.user32.GetSystemMetrics
# 常量
SIZE = [GetSystemMetrics(0), GetSystemMetrics(1)]#[1366, 768]
tps = 0.5 # 模拟器中的时间(秒)与现实时间(秒)之比
fps = 10 # 刷新率
FILL = True
# 以下常量是游戏中的时间常量
uptime = 1000 / fps # 游戏刷新间隔(毫秒)
# 测试用数据
m2 = random.ran... | [
2,
10263,
120,
243,
17739,
98,
41753,
241,
198,
11748,
12972,
6057,
11,
10688,
11,
25064,
11,
4738,
11,
269,
19199,
198,
9078,
6057,
13,
15003,
3419,
198,
3855,
11964,
9171,
10466,
796,
269,
19199,
13,
7972,
297,
13,
7220,
2624,
13,
... | 1.663713 | 2,144 |
# MACROPAD Hotkeys: Zoom for Mac
from adafruit_hid.keycode import Keycode # REQUIRED if using Keycode.* values
app = { # REQUIRED dict, must be named 'app'
"name": "Zoom", # Application name
"macros": [ # List of button macros...
# COLOR LABEL KEY SEQUENCE
# 1st row ----------
... | [
2,
20582,
49,
3185,
2885,
6964,
13083,
25,
40305,
329,
4100,
198,
198,
6738,
512,
1878,
4872,
62,
49675,
13,
2539,
8189,
1330,
7383,
8189,
220,
1303,
4526,
10917,
37819,
611,
1262,
7383,
8189,
15885,
3815,
198,
198,
1324,
796,
1391,
2... | 2.085343 | 539 |
def VP_dado_A(A, p, tx):
""" Caculo do valor presente (VP) dado uma série uniforme (A)
:param VP: Valor Presente
:param p: Periodos
:param tx: taxa de juros
:return: Valor futuro
"""
r = (1+tx)**p - 1
q = tx*(1+tx)**p
vp = A*(r/q)
return vp
A = float(input('Insira o valor da pr... | [
4299,
23342,
62,
67,
4533,
62,
32,
7,
32,
11,
279,
11,
27765,
2599,
198,
220,
220,
220,
37227,
327,
330,
43348,
466,
1188,
273,
1944,
68,
357,
8859,
8,
288,
4533,
334,
2611,
264,
2634,
5034,
8187,
68,
357,
32,
8,
198,
220,
220,
... | 2.075099 | 253 |
import bs4 as bs
import urllib.request
#C:/Users/User/Desktop/Day1/indexHK.html
#This is work
# f = urllib2.urlopen(r'file:///c|\mypage.html')
#sauce = urllib.request.urlopen('https://pythonprogramming.net/parsememcparseface/').read()
sauce = urllib.request.urlopen(r'file:///C:/Users/User/Desktop/Day1/indexHK.htm... | [
11748,
275,
82,
19,
355,
275,
82,
201,
198,
11748,
2956,
297,
571,
13,
25927,
201,
198,
2,
34,
14079,
14490,
14,
12982,
14,
36881,
14,
12393,
16,
14,
9630,
38730,
13,
6494,
201,
198,
2,
1212,
318,
670,
201,
198,
2,
277,
796,
295... | 2.313869 | 274 |
"""The WaveBlocks Project
Use a symbolic exact formula for computing the inner product
between two semi-classical wavepackets. The formula is built
for Gaussian integrals and takes into account only the ground
states phi_0 of the 'bra' and the 'ket'.
@author: R. Bourquin
@copyright: Copyright (C) 2013 R. Bourquin
@li... | [
37811,
464,
17084,
45356,
4935,
198,
198,
11041,
257,
18975,
2748,
10451,
329,
14492,
262,
8434,
1720,
198,
23395,
734,
10663,
12,
4871,
605,
6769,
8002,
1039,
13,
383,
10451,
318,
3170,
198,
1640,
12822,
31562,
4132,
30691,
290,
2753,
... | 2.179019 | 4,709 |
from benchmark import *
import oneflow_benchmark
from flowvision.models.res_mlp import resmlp_12_224
@oneflow_benchmark.ci_settings(compare={"median": "5%"})
@oneflow_benchmark.ci_settings(compare={"median": "5%"})
@oneflow_benchmark.ci_settings(compare={"median": "5%"})
@oneflow_benchmark.ci_settings(compare={... | [
6738,
18335,
1330,
1635,
198,
11748,
530,
11125,
62,
26968,
4102,
198,
6738,
5202,
10178,
13,
27530,
13,
411,
62,
4029,
79,
1330,
581,
4029,
79,
62,
1065,
62,
24137,
628,
198,
31,
505,
11125,
62,
26968,
4102,
13,
979,
62,
33692,
7,
... | 2.538462 | 156 |
import os.path
from collections import defaultdict
COM = "COM"
SAN = "SAN"
YOU = "YOU"
INFINITY = float("inf")
if __name__ == "__main__":
main()
| [
11748,
28686,
13,
6978,
198,
6738,
17268,
1330,
4277,
11600,
198,
198,
9858,
796,
366,
9858,
1,
198,
36753,
796,
366,
36753,
1,
198,
36981,
796,
366,
36981,
1,
198,
198,
1268,
20032,
9050,
796,
12178,
7203,
10745,
4943,
628,
628,
628,... | 2.590164 | 61 |
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: v2ray.com/core/transport/internet/headers/wireguard/config.proto
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from ... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2980,
515,
416,
262,
8435,
11876,
17050,
13,
220,
8410,
5626,
48483,
0,
198,
2,
2723,
25,
410,
17,
2433,
13,
785,
14,
7295,
14,
7645,
634,
14,
37675,
14,
50145,
... | 2.747724 | 769 |
# @Time : 2019/1/30 14:36
# @Author : xufqing
from rest_framework import serializers
from ..models import Permission
class PermissionListSerializer(serializers.ModelSerializer):
'''
权限列表序列化
'''
menuname = serializers.ReadOnlyField(source='menus.name') | [
2,
2488,
7575,
220,
220,
220,
1058,
13130,
14,
16,
14,
1270,
1478,
25,
2623,
198,
2,
2488,
13838,
220,
1058,
2124,
3046,
80,
278,
198,
198,
6738,
1334,
62,
30604,
1330,
11389,
11341,
198,
6738,
11485,
27530,
1330,
2448,
3411,
198,
1... | 2.459459 | 111 |
import math
from gunpowder.coordinate import Coordinate
from gunpowder.array import ArrayKey
from gunpowder.array_spec import ArraySpec
from gunpowder.graph import GraphKey
from gunpowder.graph_spec import GraphSpec
from gunpowder.roi import Roi
from .freezable import Freezable
import logging
import warnings
logger =... | [
11748,
10688,
198,
6738,
2485,
45855,
13,
37652,
4559,
1330,
22819,
4559,
198,
6738,
2485,
45855,
13,
18747,
1330,
15690,
9218,
198,
6738,
2485,
45855,
13,
18747,
62,
16684,
1330,
15690,
22882,
198,
6738,
2485,
45855,
13,
34960,
1330,
296... | 2.202914 | 1,853 |
from cursor.path import Path, PathCollection
from cursor import device
import math
if __name__ == "__main__":
coll = PathCollection()
pp = Path(layer="round1")
num = full_spiral(pp)
reversed_path = pp.reversed()
reversed_path.layer = "round2"
coll.add(pp)
coll.add(reversed_path)
... | [
6738,
23493,
13,
6978,
1330,
10644,
11,
10644,
36307,
198,
6738,
23493,
1330,
3335,
198,
198,
11748,
10688,
628,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
2927,
796,
10644,
36307,
3419,
628,
... | 2.256637 | 226 |
from pyprocessing import *
run()
| [
6738,
12972,
36948,
1330,
1635,
198,
198,
5143,
3419,
198
] | 3.4 | 10 |
import math
from pinout import core
class Leaderline(core.Path):
"""Leaderline base object."""
def end_points(self, origin, destination):
"""Locate origin and destination coordinates."""
# origin and destination are components with bounding-boxes
# direction is a 2 char code represent... | [
11748,
10688,
198,
6738,
6757,
448,
1330,
4755,
628,
198,
4871,
10540,
1370,
7,
7295,
13,
15235,
2599,
198,
220,
220,
220,
37227,
45009,
1370,
2779,
2134,
526,
15931,
628,
220,
220,
220,
825,
886,
62,
13033,
7,
944,
11,
8159,
11,
10... | 2.353254 | 753 |
#!/bin/python3
############
# Packages #
############
import random
import string
import pandas as pd
from datetime import date
today = lambda : date.today().isoformat()
#################
# Dice rolling #
#################
#dice
d2 = lambda :random.randint(1,2)
d6 = lambda :random.randint(1,6)
d8 = lambda :random.... | [
2,
48443,
8800,
14,
29412,
18,
198,
198,
7804,
4242,
198,
2,
6400,
1095,
1303,
198,
7804,
4242,
198,
11748,
4738,
198,
11748,
4731,
198,
11748,
19798,
292,
355,
279,
67,
198,
6738,
4818,
8079,
1330,
3128,
198,
40838,
796,
37456,
1058,... | 2.181633 | 1,960 |
#Programma Principale
l = int(input(" inserisci la misura del lato del quadrato "))
area = area_quadrato(l)
print(" L'area del quadrato: ", area)
lato1 = 5
lato2 = 9
l1 = int(input(" inserisci la misura del primo lato del rettangolo "))
l2 = int(input(" inserisci la misura del secondo lato del rettangolo "))
area = a... | [
198,
2,
15167,
2611,
14117,
541,
1000,
198,
75,
796,
493,
7,
15414,
7203,
1035,
263,
271,
979,
8591,
2984,
5330,
1619,
3042,
78,
1619,
15094,
81,
5549,
366,
4008,
198,
20337,
796,
1989,
62,
421,
41909,
5549,
7,
75,
8,
198,
4798,
7... | 2.4625 | 160 |
','johnny','john'] | [
41707,
30686,
3281,
41707,
30686,
20520,
220,
220
] | 2.5 | 8 |
# -*- coding: utf-8 -*- #
# Copyright 2021 Google LLC. 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 requir... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
1303,
198,
2,
15069,
33448,
3012,
11419,
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.931563 | 1,695 |
# Copyright 2019 Verily Life Sciences 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 required by appli... | [
2,
15069,
13130,
4643,
813,
5155,
13473,
3457,
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,
2393,
2845,
287,
11846,
... | 3.015801 | 443 |
#!/usr/bin/env python
"""
A script find sources in the VAST Pilot Survey.
Includes options to provide light curves, cutouts and overlay files for
viewers such as kvis and DS9.
Example:
```terminal
find_sources "16:16:00.22 +22:16:04.83" --create-png --imsize 5.0 \
--png-zscale-contrast 0.1 --png-selavy-overla... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
37811,
198,
32,
4226,
1064,
4237,
287,
262,
569,
11262,
21697,
13084,
13,
198,
198,
42986,
3689,
284,
2148,
1657,
23759,
11,
2005,
5269,
290,
33345,
3696,
329,
198,
1177,
364,
884,
355... | 2.120344 | 9,182 |
from mock import MagicMock
from cimsparql.model import CimModel
| [
6738,
15290,
1330,
6139,
44,
735,
198,
198,
6738,
269,
12078,
1845,
13976,
13,
19849,
1330,
327,
320,
17633,
628,
628
] | 3.238095 | 21 |
#
# PySNMP MIB module HPN-ICF-FLOWTEMPLATE-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/HPN-ICF-FLOWTEMPLATE-MIB
# Produced by pysmi-0.3.4 at Wed May 1 13:39:06 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.... | [
2,
198,
2,
9485,
15571,
7378,
337,
9865,
8265,
6574,
45,
12,
2149,
37,
12,
3697,
3913,
51,
3620,
6489,
6158,
12,
8895,
33,
357,
4023,
1378,
16184,
76,
489,
8937,
13,
785,
14,
79,
893,
11632,
8,
198,
2,
7054,
45,
13,
16,
2723,
... | 2.81076 | 5,353 |
import pytest
import pygorpho as pg
import numpy as np
| [
11748,
12972,
9288,
198,
198,
11748,
12972,
7053,
746,
78,
355,
23241,
198,
11748,
299,
32152,
355,
45941,
628,
628,
628
] | 2.904762 | 21 |
import math
from typing import List, Iterable, Dict, Tuple, Hashable
from collections import defaultdict, Counter
import torch
import scipy.stats
import numpy as np
def lech_dist(A, B):
"""
given two tensors A, and B, with the item index along the first dimension,
and each tensor is 2-dimensional, this w... | [
11748,
10688,
198,
6738,
19720,
1330,
7343,
11,
40806,
540,
11,
360,
713,
11,
309,
29291,
11,
21059,
540,
198,
6738,
17268,
1330,
4277,
11600,
11,
15034,
198,
198,
11748,
28034,
198,
11748,
629,
541,
88,
13,
34242,
198,
11748,
299,
32... | 2.278845 | 7,341 |
import os
import shutil
import time
import torch
from torch.utils.tensorboard import SummaryWriter
from .timer import Timer
from easydict import EasyDict
import torchvision.utils as tvutils
from torchvision.transforms import Compose
| [
11748,
28686,
198,
11748,
4423,
346,
198,
11748,
640,
198,
11748,
28034,
198,
6738,
28034,
13,
26791,
13,
83,
22854,
3526,
1330,
21293,
34379,
198,
6738,
764,
45016,
1330,
5045,
263,
198,
6738,
2562,
11600,
1330,
16789,
35,
713,
198,
11... | 3.916667 | 60 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# The MIT License (MIT)
# Copyright (c) 2017 Juan Cabral
# 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 withou... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
383,
17168,
13789,
357,
36393,
8,
198,
198,
2,
15069,
357,
66,
8,
2177,
16852,
15976,
1373,
198,
198,
2,
24... | 3.166954 | 1,162 |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import boto3
import sqlite3
import os
import threading
from datetime import datetime
from botocore.exceptions import ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
2,
15069,
357,
66,
8,
3203,
11,
3457,
13,
290,
663,
29116,
13,
198,
2,
770,
2723,
2438,
318,
11971,
739,
262,
17168,
5964,
1043,
287,
262,
198,
2,
38559,
24290,
2393,
287,... | 2.036056 | 3,550 |
import unittest
import logging
import torch
from cnns.nnlib.utils.log_utils import get_logger
from cnns.nnlib.utils.log_utils import set_up_logging
from cnns.nnlib.datasets.cifar10_example import cifar10_example
from cnns.nnlib.datasets.imagenet.imagenet_example import imagenet_example
from cnns.nnlib.attacks.simple_bl... | [
11748,
555,
715,
395,
198,
11748,
18931,
198,
11748,
28034,
198,
6738,
269,
77,
5907,
13,
20471,
8019,
13,
26791,
13,
6404,
62,
26791,
1330,
651,
62,
6404,
1362,
198,
6738,
269,
77,
5907,
13,
20471,
8019,
13,
26791,
13,
6404,
62,
26... | 2.807107 | 197 |
from typing import List, Optional
from pydantic import BaseModel
from typing_extensions import Literal
from .request import BaseResponseData, CountOffsetParams, ListRequestParams, ListResponseData
from .tag import Tag
from .user import CommonUserDetails
| [
6738,
19720,
1330,
7343,
11,
32233,
198,
198,
6738,
279,
5173,
5109,
1330,
7308,
17633,
198,
6738,
19720,
62,
2302,
5736,
1330,
25659,
1691,
198,
198,
6738,
764,
25927,
1330,
7308,
31077,
6601,
11,
2764,
34519,
10044,
4105,
11,
7343,
18... | 4.078125 | 64 |
import re
import requests
import tldextract
from lxml import html
from ..lib.exceptions import ParsingException
def get_court_id_from_url(url):
"""Extract the court ID from the URL."""
parts = tldextract.extract(url)
return parts.subdomain.split(".")[1]
def get_pacer_case_id_from_nonce_url(url):
... | [
11748,
302,
198,
198,
11748,
7007,
198,
11748,
256,
335,
2302,
974,
198,
6738,
300,
19875,
1330,
27711,
198,
198,
6738,
11485,
8019,
13,
1069,
11755,
1330,
23042,
278,
16922,
628,
628,
198,
4299,
651,
62,
22230,
62,
312,
62,
6738,
62,... | 2.463435 | 2,434 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#__Author__ = Warsong
#_PlugName_ = 万户ezeip任意文件下载
#_Function_ = 插件格式
#_FileName_ = whezeip_Download_Anything.py
if __name__ == '__main__':
from dummy import *
audit(assign('whezeip', 'http://www.zsty.org/')[1]) | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
201,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
201,
198,
2,
834,
13838,
834,
796,
6176,
506,
201,
198,
2,
62,
23257,
5376,
62,
796,
220,
10310,
229,
22755,
115,
6... | 1.902098 | 143 |
import unittest
import solution
if __name__ == '__main__':
unittest.main()
| [
11748,
555,
715,
395,
198,
198,
11748,
4610,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
555,
715,
395,
13,
12417,
3419,
198
] | 2.59375 | 32 |
"""
I/O for Gmsh's msh format (version 4.1, as used by Gmsh 4.2.2+), cf.
<http://gmsh.info/doc/texinfo/gmsh.html#MSH-file-format>.
"""
import logging
from functools import partial
import numpy
from .._common import (
_topological_dimension,
cell_data_from_raw,
num_nodes_per_cell,
raw_from_cell_data,
)... | [
37811,
198,
40,
14,
46,
329,
402,
907,
71,
338,
285,
1477,
5794,
357,
9641,
604,
13,
16,
11,
355,
973,
416,
402,
907,
71,
604,
13,
17,
13,
17,
10,
828,
30218,
13,
198,
27,
4023,
1378,
70,
907,
71,
13,
10951,
14,
15390,
14,
1... | 2.102428 | 9,060 |
#!/usr/bin/env python3
# SPDX-License-Identifier: BSD-2-Clause
#
# Copyright (c) 2018, Linaro Limited
#
import argparse
import sys
import re
if __name__ == '__main__':
main()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
30628,
55,
12,
34156,
12,
33234,
7483,
25,
347,
10305,
12,
17,
12,
2601,
682,
198,
2,
198,
2,
15069,
357,
66,
8,
2864,
11,
5164,
12022,
15302,
198,
2,
628,
198,
11748,
182... | 2.506329 | 79 |
import controller.connect as conn
from datetime import datetime
from random import randint
import sqlite3
| [
11748,
10444,
13,
8443,
355,
48260,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
6738,
4738,
1330,
43720,
600,
198,
11748,
44161,
578,
18,
628,
628,
628,
198
] | 4 | 28 |
from __future__ import absolute_import
from __future__ import print_function
import abc
import select
from socket import socket
from fortrace.botnet.net.netutility import NetUtility
from fortrace.botnet.net.meta.tcpserverbase import TcpServerBase
import six
__author__ = 'Sascha Kopp'
class UdpServerBase(six.with_me... | [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
11748,
450,
66,
198,
11748,
2922,
198,
6738,
17802,
1330,
17802,
198,
198,
6738,
329,
40546,
13,
13645,
3262,
13,
3262,
13,
3262,
... | 2.723701 | 789 |
import tornado.httpserver
import tornado.ioloop
import tornado.web
app = tornado.web.Application(
handlers=[
(r"/", MainHandler),
(r"/user", UserHandler),
(r"/user/(\d+)", UserInfoHandler),
]
)
| [
11748,
33718,
13,
5450,
18497,
198,
11748,
33718,
13,
1669,
11224,
198,
11748,
33718,
13,
12384,
628,
628,
198,
198,
1324,
796,
33718,
13,
12384,
13,
23416,
7,
198,
220,
220,
220,
32847,
41888,
198,
220,
220,
220,
220,
220,
220,
220,
... | 2.381443 | 97 |
from qcodes.instrument.visa import VisaInstrument
from qcodes.instrument import InstrumentChannel
from qcodes.utils.validators import Numbers
from functools import partial
from .Keithley_2000_Scan import Keithley_2000_Scan_Channel
class Keithley_Sense(InstrumentChannel):
"""
This is the class for a measuremen... | [
6738,
10662,
40148,
13,
259,
43872,
13,
4703,
64,
1330,
27645,
818,
43872,
198,
6738,
10662,
40148,
13,
259,
43872,
1330,
42410,
29239,
198,
6738,
10662,
40148,
13,
26791,
13,
12102,
2024,
1330,
27797,
198,
6738,
1257,
310,
10141,
1330,
... | 2.011438 | 3,060 |
import py
import sys
from ctypes import *
from support import BaseCTypesTestChecker
| [
198,
11748,
12972,
198,
11748,
25064,
198,
6738,
269,
19199,
1330,
1635,
198,
6738,
1104,
1330,
7308,
4177,
9497,
14402,
9787,
263,
628
] | 3.73913 | 23 |
# Make all lib modules available on package import
from . import discordUtil, emojis, jsonHandler, pathfinding, stringTyping, timeUtil | [
2,
6889,
477,
9195,
13103,
1695,
319,
5301,
1330,
198,
6738,
764,
1330,
36446,
18274,
346,
11,
795,
13210,
271,
11,
33918,
25060,
11,
3108,
41070,
11,
4731,
31467,
278,
11,
640,
18274,
346
] | 3.941176 | 34 |
# 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.779381 | 485 |
'''
constraints.py
Matthew Soucy
Builtin constraints for the pattern-matching library in fuf
'''
from functools import update_wrapper
from .pat import try_pred
def constraint(func):
"""
Create a complex contraint out of a function
A variation of partial application
The first argument is the only non-... | [
7061,
6,
198,
1102,
2536,
6003,
13,
9078,
198,
25372,
22862,
948,
198,
198,
39582,
259,
17778,
329,
262,
3912,
12,
15699,
278,
5888,
287,
277,
3046,
198,
7061,
6,
198,
6738,
1257,
310,
10141,
1330,
4296,
62,
48553,
198,
6738,
764,
8... | 2.875868 | 1,152 |
#!/usr/bin/env python
# coding: utf-8
# In[1]:
# Import cleaning and splitting functions
from clean_split_data import clean_data
from clean_split_data import split_data
# Pandas library for the pandas dataframes
import pandas as pd
# Import Scikit-Learn library for decision tree models
from sklearn.tree import Dec... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
19617,
25,
3384,
69,
12,
23,
198,
198,
2,
554,
58,
16,
5974,
198,
2,
17267,
12724,
290,
26021,
5499,
198,
6738,
3424,
62,
35312,
62,
7890,
1330,
3424,
62,
7890,
198,
6738,
3424,... | 2.740798 | 652 |
import pytest
from apistar.backends import SQLAlchemy
from apistar.test import TestClient
from app import welcome, app
@pytest.fixture
def test_welcome():
"""
Testing a view directly.
"""
data = welcome()
assert data == {'message': 'Welcome to API Star!'}
def test_http_request():
"""
... | [
11748,
12972,
9288,
198,
6738,
2471,
47229,
13,
1891,
2412,
1330,
16363,
2348,
26599,
198,
6738,
2471,
47229,
13,
9288,
1330,
6208,
11792,
198,
198,
6738,
598,
1330,
7062,
11,
598,
628,
198,
31,
9078,
9288,
13,
69,
9602,
628,
198,
429... | 2.989071 | 183 |
from django.conf import settings
from django.db.models import F
from rest_framework.permissions import IsAuthenticated
from geotrek.api.v2 import serializers as api_serializers, \
viewsets as api_viewsets
from geotrek.api.v2.functions import Transform, Length, Length3D
from geotrek.core import models as core_model... | [
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
9945,
13,
27530,
1330,
376,
198,
6738,
1334,
62,
30604,
13,
525,
8481,
1330,
1148,
47649,
3474,
198,
198,
6738,
4903,
313,
37818,
13,
15042,
13,
85,
17,
1330,
113... | 2.623269 | 361 |
#
# Dependency
# ==========
#
# %%LICENSE%%
#
import os;
from dep import config, opts, scm
from dep.helpers import *
# --------------------------------------------------------------------------------
# --------------------------------------------------------------------------------
# --------------------------------... | [
2,
198,
2,
37947,
1387,
198,
2,
796,
2559,
28,
198,
2,
198,
2,
43313,
43,
2149,
24290,
16626,
198,
2,
198,
11748,
28686,
26,
198,
6738,
1207,
1330,
4566,
11,
2172,
82,
11,
629,
76,
198,
6738,
1207,
13,
16794,
364,
1330,
1635,
19... | 8.257732 | 97 |
# -*- coding:utf-8 -*-
from flask import Flask, request, render_template
from flask import Blueprint, render_template
app = Flask(__name__,template_folder='static/views')
@app.route('/')
# 动态路由
@app.route('/hello/<username>')
# http请求
@app.route('/login',methods=['GET', 'POST'])
@app.errorhandler(404)
if __name_... | [
2,
532,
9,
12,
19617,
25,
40477,
12,
23,
532,
9,
12,
198,
6738,
42903,
1330,
46947,
11,
2581,
11,
220,
8543,
62,
28243,
198,
6738,
42903,
1330,
39932,
11,
8543,
62,
28243,
198,
198,
1324,
796,
46947,
7,
834,
3672,
834,
11,
28243,
... | 2.352201 | 159 |
import os
import subprocess
import sys
output = subprocess.check_output("jps", shell=True)
if("namenode" in output or "Namenode" in output):
print "1-",sys.argv[1]
elif("datanode" in output or "Datanode" in output):
print "2-",sys.argv[1]
else:
print "0-",sys.argv[1]
| [
11748,
28686,
198,
11748,
850,
14681,
198,
11748,
25064,
198,
22915,
796,
850,
14681,
13,
9122,
62,
22915,
7203,
73,
862,
1600,
7582,
28,
17821,
8,
198,
198,
361,
7203,
7402,
268,
1098,
1,
287,
5072,
393,
366,
45,
41763,
1098,
1,
28... | 2.446429 | 112 |
"""
Utils for transformations
"""
# Author: Alicia Curth
from typing import Any, Optional
import numpy as np
PW_TRANSFORMATION = "PW"
DR_TRANSFORMATION = "DR"
RA_TRANSFORMATION = "RA"
ALL_TRANSFORMATIONS = [PW_TRANSFORMATION, DR_TRANSFORMATION, RA_TRANSFORMATION]
def aipw_te_transformation(
y: np.ndarray,
... | [
37811,
198,
18274,
4487,
329,
38226,
198,
37811,
198,
2,
6434,
25,
39607,
4424,
400,
198,
6738,
19720,
1330,
4377,
11,
32233,
198,
198,
11748,
299,
32152,
355,
45941,
198,
198,
47,
54,
62,
5446,
15037,
35036,
796,
366,
47,
54,
1,
19... | 2.567619 | 1,575 |
import responses
from binance.spot import Spot as Client
from tests.util import mock_http_response
from tests.util import random_str
from urllib.parse import urlencode
from binance.error import ParameterRequiredError
mock_item = {"key_1": "value_1", "key_2": "value_2"}
key = random_str()
secret = random_str()
params ... | [
11748,
9109,
198,
6738,
9874,
590,
13,
20485,
1330,
15899,
355,
20985,
198,
6738,
5254,
13,
22602,
1330,
15290,
62,
4023,
62,
26209,
198,
6738,
5254,
13,
22602,
1330,
4738,
62,
2536,
198,
6738,
2956,
297,
571,
13,
29572,
1330,
2956,
1... | 2.802893 | 553 |
"""
Baysian hyperparameter optimization [https://github.com/fmfn/BayesianOptimization]
based on Vladimir Iglovikov work
"""
import pandas as pd
import xgboost as xgb
from bayes_opt import BayesianOptimization
from scipy.stats import kurtosis, skew
from scipy.ndimage import laplace, sobel
import numpy as np
from multip... | [
37811,
198,
33,
592,
666,
8718,
17143,
2357,
23989,
685,
5450,
1378,
12567,
13,
785,
14,
38353,
22184,
14,
15262,
35610,
27871,
320,
1634,
60,
198,
3106,
319,
14840,
314,
4743,
709,
1134,
709,
670,
198,
37811,
198,
198,
11748,
19798,
... | 1.842222 | 900 |
''' Example test script for testing the module in src.process_data
'''
| [
7061,
6,
17934,
1332,
4226,
329,
4856,
262,
8265,
287,
12351,
13,
14681,
62,
7890,
198,
7061,
6,
198
] | 3.736842 | 19 |
from __future__ import absolute_import
from __future__ import unicode_literals
#
# Copyright (c) 2014 Juniper Networks, Inc. All rights reserved.
#
from builtins import next
from builtins import chr
from builtins import str
from builtins import range
from builtins import object
import copy
import importlib
import six
... | [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
2,
198,
2,
15069,
357,
66,
8,
1946,
7653,
9346,
27862,
11,
3457,
13,
1439,
2489,
10395,
13,
198,
2,
198,
6738,
317... | 3.07906 | 468 |
# import pytest
# from django.conf import settings
# from redis import StrictRedis
#
# from bitcaster.tsdb.db import TARGETS, TS
#
# pytestmark = pytest.mark.django_db
#
#
# @pytest.fixture()
# def tsdb():
# return TS(StrictRedis.from_url(settings.TSDB_STORE),
# 'test')
#
#
# @pytest.mark.parametrize(... | [
2,
1330,
12972,
9288,
198,
2,
422,
42625,
14208,
13,
10414,
1330,
6460,
198,
2,
422,
2266,
271,
1330,
520,
2012,
7738,
271,
198,
2,
198,
2,
422,
1643,
17970,
13,
912,
9945,
13,
9945,
1330,
309,
46095,
50,
11,
26136,
198,
2,
198,
... | 2.323671 | 414 |
from django.db import models
from django.utils import timezone
# Create your models here.
| [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
42625,
14208,
13,
26791,
1330,
640,
11340,
198,
2,
13610,
534,
4981,
994,
13,
628,
220,
220,
220,
220,
628,
628,
628,
628,
628
] | 3.181818 | 33 |
from ..command import Command
from ..package import Package
from ..target import Target
from ..util import FatalError, Namespace
| [
6738,
11485,
21812,
1330,
9455,
198,
6738,
11485,
26495,
1330,
15717,
198,
6738,
11485,
16793,
1330,
12744,
198,
6738,
11485,
22602,
1330,
41815,
12331,
11,
28531,
10223,
628,
628
] | 4.551724 | 29 |
from collections import Iterable | [
6738,
17268,
1330,
40806,
540
] | 6.4 | 5 |
# -*- coding: utf-8 -*-
# Устранение проблем с кодировкой UTF-8
import sys
reload(sys)
sys.setdefaultencoding('utf8')
# Установка файла лога
log=Log()
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
12466,
96,
21727,
20375,
21169,
16142,
22177,
16843,
22177,
18849,
16843,
12466,
123,
21169,
25443,
109,
30143,
16843,
43108,
220,
21727,
12466,
118,
25443,
112,
188... | 1.509434 | 106 |