content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2011 OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GN... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
29113,
29113,
7804,
4242,
2235,
198,
2,
198,
2,
220,
220,
220,
4946,
1137,
47,
11,
4946,
8090,
7320,
26622,
198,
2,
220,
220,
220,
15069,
357,
66,
8,
2813,
4946,
113... | 3.45509 | 334 |
import numpy as np
import pandas as pd
from scipy.stats import linregress
def aggregate_returns(returns, convert_to):
"""
Aggregates returns by day, week, month, or year.
"""
if convert_to == 'weekly':
return returns.groupby(
[lambda x: x.year,
lambda x: x.month,
... | [
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,
6738,
629,
541,
88,
13,
34242,
1330,
9493,
2301,
601,
628,
198,
4299,
19406,
62,
7783,
82,
7,
7783,
82,
11,
10385,
62,
1462,
2599,
198,
220,
220,
220,
37227,
... | 2.483039 | 1,474 |
'''
Created on Jul 21, 2013
@author: Yubin Bai
'''
import sys
INF = 1 << 31
MAXW = 3005
if __name__ == '__main__':
sys.stdin = open('input.txt', 'r')
while True:
N = float(input())
if N == 0:
break
print('%.2f %d' % (N, solve(N)))
| [
7061,
6,
198,
41972,
319,
5979,
2310,
11,
2211,
198,
31,
9800,
25,
575,
549,
259,
40750,
198,
7061,
6,
198,
11748,
25064,
198,
1268,
37,
796,
352,
9959,
3261,
198,
22921,
54,
796,
5867,
20,
628,
198,
198,
361,
11593,
3672,
834,
66... | 2.007194 | 139 |
"""Removed category row
Revision ID: ff5dacfec12c
Revises: fd5ed0509c78
Create Date: 2022-03-09 14:08:10.617791
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'ff5dacfec12c'
down_revision = 'fd5ed0509c78'
branch_labels = None
depends_on = None
| [
37811,
45975,
6536,
5752,
198,
198,
18009,
1166,
4522,
25,
31246,
20,
67,
330,
69,
721,
1065,
66,
198,
18009,
2696,
25,
277,
67,
20,
276,
28669,
24,
66,
3695,
198,
16447,
7536,
25,
33160,
12,
3070,
12,
2931,
1478,
25,
2919,
25,
94... | 2.487805 | 123 |
import navio.util
from navio.ublox import Ublox
if __name__ == "__main__":
ubl = Ublox()
navio.util.check_apm()
for ind in range(0, 10):
ubl.enable_posllh()
while(1):
buffer = ubl.bus.xfer2([100])
for byt in buffer:
ubl.scan_ubx(byt)
if not ubl.mess_qu... | [
11748,
6812,
952,
13,
22602,
198,
6738,
6812,
952,
13,
549,
75,
1140,
1330,
471,
2436,
1140,
628,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
334,
2436,
796,
471,
2436,
1140,
3419,
198,
220,
220... | 1.772358 | 246 |
"""
Description:
Given the head of a singly linked list, return the middle node of the linked list.
If there are two middle nodes, return the second middle node.
Example 1:
----------
Input: head = [1,2,3,4,5]
Output: [3,4,5]
Explanation: The middle node of the list is node 3.
Example 2:
----------
Input: head ... | [
37811,
198,
11828,
25,
198,
198,
15056,
262,
1182,
286,
257,
1702,
306,
6692,
1351,
11,
1441,
262,
3504,
10139,
286,
262,
6692,
1351,
13,
198,
198,
1532,
612,
389,
734,
3504,
13760,
11,
1441,
262,
1218,
3504,
10139,
13,
198,
198,
16... | 3.025 | 160 |
# Copyright 2019 Akiomi Kamakura
#
# 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 writi... | [
2,
15069,
13130,
48663,
12753,
12670,
47754,
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,
... | 3.77907 | 172 |
# Copyright 2019 Extreme Networks, 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 law or agreed to i... | [
2,
15069,
13130,
18111,
27862,
11,
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,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198,
2... | 3.808743 | 183 |
import dataclasses
import inspect
from itertools import islice
from typing import Callable, List, Optional
from graphql import DirectiveLocation
from strawberry.arguments import StrawberryArgument, get_arguments_from_annotations
from strawberry.utils.str_converters import to_camel_case
@dataclasses.dataclass
__a... | [
11748,
4818,
330,
28958,
198,
11748,
10104,
198,
6738,
340,
861,
10141,
1330,
318,
75,
501,
198,
6738,
19720,
1330,
4889,
540,
11,
7343,
11,
32233,
198,
198,
6738,
4823,
13976,
1330,
34736,
14749,
198,
198,
6738,
41236,
13,
853,
2886,
... | 3.666667 | 105 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
4981,
11,
15720,
602,
628
] | 2.891892 | 37 |
from queue import Queue
from typing import Dict, Any
chunks_ordering: ChunksOrdering = ChunksOrdering()
| [
6738,
16834,
1330,
4670,
518,
198,
6738,
19720,
1330,
360,
713,
11,
4377,
628,
628,
628,
198,
354,
14125,
62,
34555,
25,
609,
14125,
18743,
278,
796,
609,
14125,
18743,
278,
3419,
198
] | 3.333333 | 33 |
'''1. Se necesita hacer el cambio de pesos chilenos a dólares, el programa pide al usuario el monto y el valor del dolar y el programa hace la conversión'''
# Ingresar nuestro monto
monto = input('Ingrese el monto en CLP: ')
print('El monto ingresado es:', monto)
# Input() lo guarda como un string
# Ingresar el valor... | [
7061,
6,
16,
13,
1001,
497,
728,
5350,
289,
11736,
1288,
269,
4131,
952,
390,
32317,
418,
442,
346,
28380,
257,
288,
10205,
75,
3565,
11,
1288,
1430,
64,
279,
485,
435,
514,
84,
4982,
1288,
285,
5957,
331,
1288,
1188,
273,
1619,
2... | 2.643443 | 244 |
# coding: utf-8
from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', views.StatsView.as_view(), name='stats_main'),
url(r'^leaderboards/$', views.LeaderboardsView.as_view(), name='stats_leaderboards'),
url(r'^categories/$', views.CategoryListView.as_view(), name='stats_category_l... | [
2,
19617,
25,
3384,
69,
12,
23,
198,
6738,
42625,
14208,
13,
10414,
13,
6371,
82,
1330,
19016,
198,
6738,
764,
1330,
5009,
198,
198,
6371,
33279,
82,
796,
685,
198,
220,
220,
220,
19016,
7,
81,
6,
61,
3,
3256,
5009,
13,
29668,
7... | 2.688889 | 180 |
import math
import matplotlib.pyplot as plt
import numpy as np
| [
11748,
10688,
198,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
299,
32152,
355,
45941,
628,
198
] | 3 | 22 |
'''
Github link of original code: https://github.com/oarriaga/face_classification
Author: Neel Dani
Date: 22nd May, 2019
Incroporated few changes according to needs mentioned below.
CHANGES INCORPORATED:
1) Used skvideo.io package to read a video rather than openCV as video maybe rotated (landscape mode).
Skvideo... | [
7061,
6,
198,
198,
38,
10060,
2792,
286,
2656,
2438,
25,
3740,
1378,
12567,
13,
785,
14,
78,
283,
380,
8126,
14,
2550,
62,
4871,
2649,
198,
198,
13838,
25,
3169,
417,
22254,
198,
10430,
25,
2534,
358,
1737,
11,
13130,
198,
198,
25... | 2.403244 | 3,514 |
import pathlib
import xml.etree.ElementTree
def load_constants(constants_xml_path=None):
"""
Load known constants from an XML file. Returns a dict() mapping constant values to strings.
"""
if constants_xml_path is None:
constants_xml_path = pathlib.Path(__file__).parent / "data" / "constants.... | [
11748,
3108,
8019,
198,
11748,
35555,
13,
316,
631,
13,
20180,
27660,
628,
198,
4299,
3440,
62,
9979,
1187,
7,
9979,
1187,
62,
19875,
62,
6978,
28,
14202,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
8778,
1900,
38491,
422,
... | 2.59276 | 442 |
# encoding: utf-8
from django.db import models
from django.db.models import Q
from django.utils.datastructures import OrderedDict
from geopy import units, distance
class BaseLocationManager(models.Manager):
"""
Manager location aware
"""
def nearby(self, latitude, longitude, proximity):
"""... | [
2,
21004,
25,
3384,
69,
12,
23,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
42625,
14208,
13,
9945,
13,
27530,
1330,
1195,
198,
6738,
42625,
14208,
13,
26791,
13,
19608,
459,
1356,
942,
1330,
14230,
1068,
35,
713,
... | 2.032485 | 1,139 |
# -*- coding: utf-8 -*-
# Copyright (c) 2016 by University of Kassel and Fraunhofer Institute for Wind Energy and Energy
# System Technology (IWES), Kassel. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
import numpy as np
import pandas ... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
201,
198,
201,
198,
2,
15069,
357,
66,
8,
1584,
416,
2059,
286,
15035,
741,
290,
39313,
403,
71,
30288,
5136,
329,
3086,
6682,
290,
6682,
201,
198,
2,
4482,
8987,
357,
40... | 1.869599 | 23,328 |
import unreal
from unreal import EditorAssetLibrary as eal
from unreal import EditorLevelLibrary as ell
from openpype.hosts.unreal.api.plugin import Creator
from avalon.unreal import (
instantiate,
)
class CreateCamera(Creator):
"""Layout output for character rigs"""
name = "layoutMain"
label = "Cam... | [
11748,
22865,
198,
6738,
22865,
1330,
12058,
45869,
23377,
355,
304,
282,
198,
6738,
22865,
1330,
12058,
4971,
23377,
355,
30004,
198,
198,
6738,
1280,
79,
2981,
13,
4774,
82,
13,
403,
5305,
13,
15042,
13,
33803,
1330,
21038,
198,
6738,... | 3 | 141 |
from flask import Blueprint, send_from_directory
from json import dumps, loads
from flask_socketio import emit
from util import get_databases
from .iysql import IYSQL
iysql = Blueprint('iysql', __name__)
iysql_instance = IYSQL()
@iysql.route('/', methods=['GET'])
@iysql.route('/public/<path:path>', methods=['GET']) | [
6738,
42903,
1330,
39932,
11,
3758,
62,
6738,
62,
34945,
198,
6738,
33918,
1330,
45514,
11,
15989,
198,
6738,
42903,
62,
44971,
952,
1330,
27588,
198,
6738,
7736,
1330,
651,
62,
19608,
18826,
198,
6738,
764,
72,
893,
13976,
1330,
314,
... | 2.873874 | 111 |
import unittest
import os
import os.path
from programy.spelling.norvig import NorvigSpellingChecker
| [
11748,
555,
715,
395,
198,
11748,
28686,
198,
11748,
28686,
13,
6978,
198,
198,
6738,
1430,
88,
13,
4125,
2680,
13,
13099,
85,
328,
1330,
5414,
85,
328,
5248,
2680,
9787,
263,
198
] | 3.060606 | 33 |
# pylint: disable=missing-docstring,too-few-public-methods
from typing import Any
| [
2,
279,
2645,
600,
25,
15560,
28,
45688,
12,
15390,
8841,
11,
18820,
12,
32146,
12,
11377,
12,
24396,
82,
198,
6738,
19720,
1330,
4377,
628,
628
] | 3.148148 | 27 |
known_users = ['Omkar' ,'Vishal', 'Vikrant' ,'Gaurav' ,'Sayali' ,'Trupti' ,'Nandani']
x = 'Atugade'
while True:
print("Hi! My name is Omkar")
name = input('What is your name ? : ').strip().capitalize()
if name in known_users:
print('Hello {}!'.format(name))
remove = in... | [
4002,
62,
18417,
796,
37250,
46,
76,
21070,
6,
837,
6,
53,
680,
282,
3256,
705,
53,
1134,
5250,
6,
837,
6,
38,
2899,
615,
6,
837,
6,
25515,
7344,
6,
837,
6,
51,
3622,
72,
6,
837,
6,
45,
392,
3216,
20520,
201,
198,
201,
198,
... | 2.041071 | 560 |
from pathlib import Path
from pkg_resources import resource_filename
"""
Paths to data files in this Python module.
"""
# The path to the data files.
DATA_DIRECTORY = Path(resource_filename(__name__, "data"))
# The path to object data.
OBJECT_DATA_DIRECTORY = DATA_DIRECTORY.joinpath("objects")
# The path to the list ... | [
6738,
3108,
8019,
1330,
10644,
198,
6738,
279,
10025,
62,
37540,
1330,
8271,
62,
34345,
198,
198,
37811,
198,
15235,
82,
284,
1366,
3696,
287,
428,
11361,
8265,
13,
198,
37811,
198,
198,
2,
383,
3108,
284,
262,
1366,
3696,
13,
198,
... | 3.127358 | 212 |
from math import *
import proteus.MeshTools
from proteus import Domain
from proteus.default_n import *
from proteus.Profiling import logEvent
from proteus.ctransportCoefficients import smoothedHeaviside
from proteus.ctransportCoefficients import smoothedHeaviside_integral
from proteus import Gauges
from proteus.Gaug... | [
6738,
10688,
1330,
1635,
198,
11748,
5915,
385,
13,
37031,
33637,
198,
6738,
5915,
385,
1330,
20021,
198,
6738,
5915,
385,
13,
12286,
62,
77,
1330,
1635,
220,
220,
220,
198,
6738,
5915,
385,
13,
15404,
4386,
1330,
2604,
9237,
198,
673... | 1.765277 | 9,164 |
from typing import Dict
def max_char(string: str) -> str:
''' Return the most frequent character in a string.'''
if len(string) == 0:
return ''
char_map: Dict[str, int] = {}
for char in string:
if char in char_map:
char_map[char] += 1
else:
char_map[ch... | [
6738,
19720,
1330,
360,
713,
628,
198,
4299,
3509,
62,
10641,
7,
8841,
25,
965,
8,
4613,
965,
25,
198,
220,
220,
220,
705,
7061,
8229,
262,
749,
10792,
2095,
287,
257,
4731,
2637,
7061,
198,
220,
220,
220,
611,
18896,
7,
8841,
8,
... | 2.25 | 176 |
import time
from flask import request
from funcy import project
from redash import models
from redash.handlers.base import (BaseResource, get_object_or_404,
require_fields)
from redash.permissions import (require_access, require_admin_or_owner,
require... | [
11748,
640,
198,
198,
6738,
42903,
1330,
2581,
198,
6738,
1257,
948,
1330,
1628,
198,
198,
6738,
2266,
1077,
1330,
4981,
198,
6738,
2266,
1077,
13,
4993,
8116,
13,
8692,
1330,
357,
14881,
26198,
11,
651,
62,
15252,
62,
273,
62,
26429,... | 2.383562 | 146 |
#!/usr/bin/env python3
import jargparse
import psycopg2
############
### MAIN ###
############
parser = jargparse.ArgParser('Upload an InterMine model to an existing database.')
parser.add_argument('dbName', help='name of the database.')
parser.add_argument('modelPath', help='path to the InterMine model xml')
parser.... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
11748,
474,
853,
29572,
198,
11748,
17331,
22163,
70,
17,
198,
198,
7804,
4242,
198,
21017,
8779,
1268,
44386,
198,
7804,
4242,
198,
48610,
796,
474,
853,
29572,
13,
28100,
46... | 2.866379 | 464 |
from pyramid.config import Configurator
from .extensibility import include_me, flatpages_root
from .resources import Resource
def factory(global_config, **settings):
""" Application entry point factory for serving with wsgi.
The application entry point. Provides a WSGI application that represents
our a b... | [
6738,
27944,
13,
11250,
1330,
17056,
333,
1352,
198,
198,
6738,
764,
2302,
641,
2247,
1330,
2291,
62,
1326,
11,
6228,
31126,
62,
15763,
198,
6738,
764,
37540,
1330,
20857,
198,
198,
4299,
8860,
7,
20541,
62,
11250,
11,
12429,
33692,
2... | 3.65 | 200 |
import xmlschema
import json
import os
import sqlalchemy as sa
import tempfile
import functools
import datetime
import shutil
import base64
import subprocess
import zipfile
from textwrap import dedent
from io import StringIO
import re
import requests
import iatikit
import pathlib
from collections import defaultdict
fr... | [
11748,
35555,
15952,
2611,
198,
11748,
33918,
198,
11748,
28686,
198,
11748,
44161,
282,
26599,
355,
473,
198,
11748,
20218,
7753,
198,
11748,
1257,
310,
10141,
198,
11748,
4818,
8079,
198,
11748,
4423,
346,
198,
11748,
2779,
2414,
198,
1... | 2.584665 | 626 |
from test_framework.address import key_to_p2pkh, key_to_p2sh_p2wpkh
from test_framework.key import CECKey
import secrets
import sys
from Crypto.Cipher import AES
from Crypto.Util.Padding import pad
import scrypt
import json
import leveldb
from multiprocessing import Queue
import threading
import plyvel
# 对应bitcoinj里面K... | [
6738,
1332,
62,
30604,
13,
21975,
1330,
1994,
62,
1462,
62,
79,
17,
79,
14636,
11,
1994,
62,
1462,
62,
79,
17,
1477,
62,
79,
17,
24142,
14636,
198,
6738,
1332,
62,
30604,
13,
2539,
1330,
327,
2943,
9218,
198,
11748,
13141,
198,
11... | 2.083123 | 794 |
firstName = input("What is your firstName?")
lastName = input("What is your surname?")
gender = input("Male/Female?")
ifFemale = None
#variable needs to exist for line 10 to work
if gender == 'Female':
ifFemale = True
else:
ifFemale = False
gender = 'Female' if ifFemale else 'Male'
result = f'I am {firstName} {... | [
11085,
5376,
796,
5128,
7203,
2061,
318,
534,
717,
5376,
1701,
8,
198,
12957,
5376,
796,
5128,
7203,
2061,
318,
534,
40358,
1701,
8,
198,
8388,
796,
5128,
7203,
25486,
14,
27273,
1701,
8,
198,
361,
27273,
796,
6045,
198,
2,
45286,
2... | 3.128205 | 117 |
from typing import List
class QuickSort:
"""
Quick Sort implementation
"""
def quick_sort(self, data: List):
"""
Sorts the data using quicksort
"""
# Base case which returns the list if the size is equal to 1 or 2
if len(data) < 2:
return data
... | [
6738,
19720,
1330,
7343,
628,
198,
4871,
12029,
42758,
25,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
12029,
33947,
7822,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
825,
2068,
62,
30619,
7,
944,
11,
1366,
25,
7343,
2599,
198... | 2.188312 | 308 |
"""Tests for setup configuration script."""
import glob
import shutil
import unittest
from unittest import mock
class MainTest(unittest.TestCase):
"""Tests for package execution."""
@mock.patch('sys.argv', ['setup.py', 'sdist', 'bdist_wheel'])
| [
37811,
51,
3558,
329,
9058,
8398,
4226,
526,
15931,
628,
198,
11748,
15095,
198,
11748,
4423,
346,
198,
11748,
555,
715,
395,
198,
6738,
555,
715,
395,
1330,
15290,
628,
198,
4871,
8774,
14402,
7,
403,
715,
395,
13,
14402,
20448,
2599... | 2.988372 | 86 |
import os
from os import path
from flask import Flask
from flask import g
from flask import request
from werkzeug.utils import import_string
from werkzeug.utils import ImportStringError
from jinja2 import ChoiceLoader, FileSystemLoader
from flask_wtf import CSRFProtect
from boiler.config import DefaultConfig
from boil... | [
11748,
28686,
198,
6738,
28686,
1330,
3108,
198,
6738,
42903,
1330,
46947,
198,
6738,
42903,
1330,
308,
198,
6738,
42903,
1330,
2581,
198,
6738,
266,
9587,
2736,
1018,
13,
26791,
1330,
1330,
62,
8841,
198,
6738,
266,
9587,
2736,
1018,
1... | 2.938835 | 2,060 |
"""
A module for subsampling identities from the VGG Face 2 dataset,
available at http://www.robots.ox.ac.uk/~vgg/data/vgg_face2/
"""
import os
import numpy as np
import random
from absl import app, flags
VGG_BASE = "/data/vggface"
FLAGS = flags.FLAGS
flags.DEFINE_string('image_directory',
os.pa... | [
37811,
198,
32,
8265,
329,
6352,
321,
11347,
18413,
422,
262,
569,
11190,
15399,
362,
27039,
11,
198,
15182,
379,
2638,
1378,
2503,
13,
22609,
1747,
13,
1140,
13,
330,
13,
2724,
14,
93,
85,
1130,
14,
7890,
14,
85,
1130,
62,
2550,
... | 2.118304 | 448 |
import numpy as np
from sklearn.datasets import load_iris
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import OneHotEncoder
from keras.models import Sequential
from keras.layers import Dense
import keras2onnx
import onnx
# installed: scikit-learn, keras2onnx, onnx, keras, pandas
# Pr... | [
11748,
299,
32152,
355,
45941,
198,
6738,
1341,
35720,
13,
19608,
292,
1039,
1330,
3440,
62,
29616,
198,
6738,
1341,
35720,
13,
19849,
62,
49283,
1330,
4512,
62,
9288,
62,
35312,
198,
6738,
1341,
35720,
13,
3866,
36948,
1330,
1881,
2135... | 3.337058 | 537 |
# Copyright 2015 Google 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 applicable law or ... | [
2,
15069,
1853,
3012,
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,
351,
262,
13789,
... | 3.708155 | 233 |
#!/usr/bin/env python3
import struct
import array
import sys
import os
if __name__ == '__main__':
if len(sys.argv) == 2:
file = sys.argv[1]
else:
exit()
print(f"open {file}")
f = open(file, 'rb')
parse_header(f)
print(f"close {file}")
f.close()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
11748,
2878,
198,
11748,
7177,
198,
11748,
25064,
198,
11748,
28686,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
611,
18896,
7,
17597,
1... | 2.093525 | 139 |
"""Event dispatcher sends events."""
from __future__ import absolute_import, unicode_literals
import os
import threading
import time
from collections import defaultdict, deque
from kombu import Producer
from celery.app import app_or_default
from celery.five import items
from celery.utils.nodenames import anon_nodena... | [
37811,
9237,
49952,
12800,
2995,
526,
15931,
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
11,
28000,
1098,
62,
17201,
874,
198,
198,
11748,
28686,
198,
11748,
4704,
278,
198,
11748,
640,
198,
6738,
17268,
1330,
4277,
11600,
11,
... | 2.229719 | 2,638 |
from django.db import models
# Create your models here. | [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
198,
2,
13610,
534,
4981,
994,
13
] | 3.733333 | 15 |
import sys
from skbuild import setup
| [
11748,
25064,
198,
198,
6738,
1341,
11249,
1330,
9058,
198
] | 3.8 | 10 |
from rps.util import util
from django.test import TestCase
import numpy as np
import mxnet as mx
from mxnet import nd, init, gluon, autograd
from rps.Agent import net
from .models import Record
from rps.Agent.agent import Agent
| [
6738,
374,
862,
13,
22602,
1330,
7736,
198,
6738,
42625,
14208,
13,
9288,
1330,
6208,
20448,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
285,
87,
3262,
355,
285,
87,
198,
6738,
285,
87,
3262,
1330,
299,
67,
11,
2315,
11,
1278,
8... | 3.108108 | 74 |
from pandahub.lib.timeseries import *
from pandahub.lib.timeseries.data_sources.mongo_data import MongoData
| [
6738,
19798,
993,
549,
13,
8019,
13,
22355,
10640,
1330,
1635,
198,
6738,
19798,
993,
549,
13,
8019,
13,
22355,
10640,
13,
7890,
62,
82,
2203,
13,
76,
25162,
62,
7890,
1330,
42591,
6601,
198
] | 3.085714 | 35 |
from gtts import gTTS
from pydub import AudioSegment
from pydub.playback import play
import os
with open("text.txt","r") as f:
text=f.read()
tts=gTTS(text,lang="en",slow=False)
tts.save("multimedia/hello.mp3")
song=AudioSegment.from_mp3("multimedia/hello.mp3")
play(song) | [
6738,
308,
83,
912,
1330,
308,
51,
4694,
198,
6738,
279,
5173,
549,
1330,
13491,
41030,
434,
198,
6738,
279,
5173,
549,
13,
1759,
1891,
1330,
711,
198,
11748,
28686,
198,
198,
4480,
1280,
7203,
5239,
13,
14116,
2430,
81,
4943,
355,
... | 2.382114 | 123 |
from django.core.exceptions import ValidationError
from django.db.models.aggregates import Min, Max
from django.forms.fields import Field
from django.forms.widgets import MultiWidget, CheckboxInput, NumberInput
from django.utils.safestring import mark_safe
from .utils import traverse_related_to_field
class RangeWidg... | [
6738,
42625,
14208,
13,
7295,
13,
1069,
11755,
1330,
3254,
24765,
12331,
198,
6738,
42625,
14208,
13,
9945,
13,
27530,
13,
9460,
2301,
689,
1330,
1855,
11,
5436,
198,
6738,
42625,
14208,
13,
23914,
13,
25747,
1330,
7663,
198,
6738,
4262... | 3.138728 | 173 |
#!/usr/bin/env python3
# -*- coding:utf-8 -*-
#
# @name : Infoga - Email Information Gathering
# @url : http://github.com/m4ll0k
# @author : Momo Outaadi (m4ll0k)
from lib.output import *
from lib.request import *
from lib.parser import * | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
40477,
12,
23,
532,
9,
12,
220,
198,
2,
198,
2,
2488,
3672,
220,
220,
1058,
4806,
10949,
532,
9570,
6188,
36397,
198,
2,
2488,
6371,
220,
220,
220,
... | 2.552083 | 96 |
# -*- coding: utf-8 -*- #
# Copyright 2016 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,
1584,
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.790847 | 2,644 |
import os
AIM_ENABLE_TRACKING_THREAD = '__AIM_ENABLE_TRACKING_THREAD__'
AIM_REPO_NAME = '__AIM_REPO_NAME__'
AIM_RUN_INDEXING_TIMEOUT = '__AIM_RUN_INDEXING_TIMEOUT_SECONDS__'
| [
11748,
28686,
198,
198,
32,
3955,
62,
1677,
17534,
62,
5446,
8120,
2751,
62,
4221,
15675,
796,
705,
834,
32,
3955,
62,
1677,
17534,
62,
5446,
8120,
2751,
62,
4221,
15675,
834,
6,
198,
32,
3955,
62,
2200,
16402,
62,
20608,
796,
705,
... | 2 | 88 |
from oslo_log import log as logging
import nova.conf
from nova import config
from os_brick.initiator import connector
from oslo_utils import importutils
from os_brick.initiator import linuxfc
from nova import utils
import nova.netconf
import nova.virt.libvirt.driver
from nova import objects
# import shlex
# from oslo_... | [
6738,
28686,
5439,
62,
6404,
1330,
2604,
355,
18931,
198,
11748,
645,
6862,
13,
10414,
198,
6738,
645,
6862,
1330,
4566,
198,
6738,
28686,
62,
1671,
624,
13,
259,
8846,
1352,
1330,
21716,
198,
6738,
28686,
5439,
62,
26791,
1330,
1330,
... | 2.780911 | 461 |
TF_DIR = 'E:/Steam/SteamApps/common/Team Fortress 2/tf/'
def load_maplist(mapcycle='mapcycle_default.txt'):
'turns a given mapcycle file in /tf/cfg/ into a list of strings'
official_maps = []
mapcycle_file = open(f'{TF_DIR}cfg/{mapcycle}')
for line in mapcycle_file.readlines():
if not line.star... | [
10234,
62,
34720,
796,
705,
36,
14079,
19109,
14,
19109,
48433,
14,
11321,
14,
15592,
25213,
362,
14,
27110,
14,
6,
198,
198,
4299,
3440,
62,
2611,
489,
396,
7,
8899,
13696,
11639,
8899,
13696,
62,
12286,
13,
14116,
6,
2599,
198,
22... | 2.459016 | 183 |
from django.urls import path
from .views import WeightPrediction
urlpatterns = [
path('weight/', WeightPrediction.as_view(), name='weight_prediction'),
]
| [
6738,
42625,
14208,
13,
6371,
82,
1330,
3108,
198,
6738,
764,
33571,
1330,
14331,
39156,
2867,
198,
198,
6371,
33279,
82,
796,
685,
198,
220,
220,
220,
3108,
10786,
6551,
14,
3256,
14331,
39156,
2867,
13,
292,
62,
1177,
22784,
1438,
1... | 3.18 | 50 |
#
# Tests the Validator class bindings
#
import unittest
if __name__ == '__main__':
unittest.main()
| [
2,
198,
2,
30307,
262,
48951,
1352,
1398,
34111,
198,
2,
198,
11748,
555,
715,
395,
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.675 | 40 |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import... | [
2,
19617,
28,
40477,
12,
23,
198,
2,
17202,
39410,
25,
428,
2393,
373,
7560,
416,
262,
21624,
12994,
24118,
687,
10290,
357,
27110,
5235,
8,
16984,
13,
17202,
198,
2,
17202,
2141,
407,
4370,
416,
1021,
4556,
345,
821,
1728,
345,
760... | 2.43209 | 1,421 |
import codecs
import json
import os
import sys
sys.path.append("../")
sys.path.append("../transformers/src")
import copy
import gc
import torch
import pickle
from tqdm import tqdm
from utils import set_seed, get_task_data, random_split_train_and_dev
from dataset import PairSentenceClassificationDataset
from transformer... | [
11748,
40481,
82,
198,
11748,
33918,
198,
11748,
28686,
198,
11748,
25064,
198,
17597,
13,
6978,
13,
33295,
7203,
40720,
4943,
198,
17597,
13,
6978,
13,
33295,
7203,
40720,
35636,
364,
14,
10677,
4943,
198,
11748,
4866,
198,
11748,
308,
... | 1.807549 | 5,113 |
"""Generated message classes for replicapool version v1beta2.
[Deprecated. Please use Instance Group Manager in Compute API] Provides groups
of homogenous Compute Engine instances.
"""
# NOTE: This file is autogenerated and should not be edited by hand.
from googlecloudsdk.third_party.apitools.base.protorpclite impor... | [
37811,
8645,
515,
3275,
6097,
329,
2186,
291,
499,
970,
2196,
410,
16,
31361,
17,
13,
198,
198,
58,
12156,
31023,
13,
4222,
779,
2262,
590,
4912,
9142,
287,
3082,
1133,
7824,
60,
47081,
2628,
198,
1659,
3488,
27897,
3082,
1133,
7117,
... | 3.279582 | 8,316 |
from pathlib import Path
import pytest
import superannotate as sa
from .test_assign_images import safe_create_project
PROJECT_NAME_VECTOR = "test duplicate upload images"
| [
6738,
3108,
8019,
1330,
10644,
198,
198,
11748,
12972,
9288,
198,
198,
11748,
2208,
34574,
378,
355,
473,
198,
6738,
764,
9288,
62,
562,
570,
62,
17566,
1330,
3338,
62,
17953,
62,
16302,
198,
198,
31190,
23680,
62,
20608,
62,
53,
9782... | 3.431373 | 51 |
from django.contrib import admin
from account.models import User
from account.models import Customer
from django.contrib.auth.admin import UserAdmin
# Register your models here.
admin.site.register(User,AccountAdmin)
| [
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
6738,
1848,
13,
27530,
1330,
11787,
198,
6738,
1848,
13,
27530,
1330,
22092,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
28482,
1330,
11787,
46787,
198,
2,
17296,
534,
4981... | 3.824561 | 57 |
from pathlib import Path
puzzle_input_raw = (Path(__file__).parent / "input.txt").read_text()
import re
import string
import itertools
compressed = puzzle_input_raw
MARKER_PATTERN = re.compile(r"\((\d+)x(\d+)\)")
print(decompress(compressed)) | [
6738,
3108,
8019,
1330,
10644,
198,
198,
79,
9625,
62,
15414,
62,
1831,
796,
357,
15235,
7,
834,
7753,
834,
737,
8000,
1220,
366,
15414,
13,
14116,
11074,
961,
62,
5239,
3419,
198,
198,
11748,
302,
198,
11748,
4731,
198,
11748,
340,
... | 2.62766 | 94 |
# Sorts a sequence in ascending order using the
# optimized bubble sort algorithm
a = bubbleSort_optimized([ 11, 2, 3, 5, 4, 6, 7, 8, 9, 10])
print(a)
| [
2,
311,
2096,
257,
8379,
287,
41988,
1502,
1262,
262,
198,
2,
23392,
14310,
3297,
11862,
198,
198,
64,
796,
14310,
42758,
62,
40085,
1143,
26933,
1367,
11,
362,
11,
513,
11,
642,
11,
604,
11,
718,
11,
767,
11,
807,
11,
860,
11,
... | 2.923077 | 52 |
from django.db import models
import datetime
| [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
11748,
4818,
8079,
198
] | 3.75 | 12 |
from __future__ import absolute_import
import os
from functools import reduce
import numpy as np
from ocrd import Processor
from ocrd_utils import getLogger, concat_padded, xywh_from_points, points_from_xywh, MIMETYPE_PAGE
from ocrd_modelfactory import page_from_file
from ocrd_models.ocrd_page import (
to_xml,
... | [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
198,
11748,
28686,
198,
6738,
1257,
310,
10141,
1330,
4646,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
267,
66,
4372,
1330,
32893,
198,
6738,
267,
66,
4372,
62,
26791,
1330,
... | 1.943019 | 9,547 |
import tensorflow.keras as keras
from tensorflow.keras import backend as K
| [
11748,
11192,
273,
11125,
13,
6122,
292,
355,
41927,
292,
198,
6738,
11192,
273,
11125,
13,
6122,
292,
1330,
30203,
355,
509,
198
] | 3.26087 | 23 |
import lasagne as nn
import theano.tensor as T
from utils.layer_macros import conv2dbn
| [
11748,
39990,
21080,
355,
299,
77,
198,
11748,
262,
5733,
13,
83,
22854,
355,
309,
198,
6738,
3384,
4487,
13,
29289,
62,
20285,
4951,
1330,
3063,
17,
67,
9374,
628,
628,
628,
198
] | 2.818182 | 33 |
import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..'))
import argparse
import inputparser
main()
| [
11748,
28686,
198,
11748,
25064,
198,
198,
17597,
13,
6978,
13,
33295,
7,
418,
13,
6978,
13,
22179,
7,
418,
13,
6978,
13,
15908,
3672,
7,
834,
7753,
834,
828,
705,
492,
3256,
705,
492,
6,
4008,
198,
11748,
1822,
29572,
198,
11748,
... | 2.68 | 50 |
# -*- encoding: utf-8 -*-
#
# Copyright 2012 Red Hat, Inc.
# Copyright 2013 IBM Corp.
#
# Author: Angus Salkeld <asalkeld@redhat.com>
#
# 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
#
# ... | [
2,
532,
9,
12,
21004,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
198,
2,
15069,
2321,
2297,
10983,
11,
3457,
13,
198,
2,
15069,
2211,
19764,
11421,
13,
198,
2,
198,
2,
6434,
25,
41182,
4849,
365,
335,
1279,
292,
282,
365,
335,
... | 3.397394 | 307 |
from helper import unittest, PillowTestCase
from PIL import Image, ImageDraw, ImageFont, features
from io import BytesIO
import os
import sys
import copy
FONT_PATH = "Tests/fonts/FreeMono.ttf"
FONT_SIZE = 20
TEST_TEXT = "hey you\nyou are awesome\nthis looks awkward"
HAS_FREETYPE = features.check('freetype2')
HAS_RA... | [
6738,
31904,
1330,
555,
715,
395,
11,
19770,
322,
14402,
20448,
198,
198,
6738,
350,
4146,
1330,
7412,
11,
7412,
25302,
11,
7412,
23252,
11,
3033,
198,
6738,
33245,
1330,
2750,
4879,
9399,
198,
11748,
28686,
198,
11748,
25064,
198,
1174... | 2.59799 | 199 |
import random
from fakelish import fakelish
| [
11748,
4738,
198,
198,
6738,
8390,
1836,
1330,
8390,
1836,
628,
628
] | 4 | 12 |
import re
from model.contact import Contact | [
11748,
302,
198,
198,
6738,
2746,
13,
32057,
1330,
14039
] | 4.4 | 10 |
import re
import pandas as pd
import os.path
import logging
from trans import Transform
| [
11748,
302,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
28686,
13,
6978,
198,
11748,
18931,
198,
6738,
1007,
1330,
26981,
628
] | 3.869565 | 23 |
from .helper import TestSetup
from core.model.callbacks import Callbacks
| [
6738,
764,
2978,
525,
1330,
6208,
40786,
198,
6738,
4755,
13,
19849,
13,
13345,
10146,
1330,
4889,
10146,
628
] | 3.894737 | 19 |
#!/usr/bin/python3
try:
import smbus
except ImportError:
raise ImportError("python-smbus not found'")
import re
"""
================================================
ABElectronics Python Helper Functions
Version 1.0 Created 29/02/2015
Python 3 only
Requires python 3 smbus to be installed. For more information
... | [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
28311,
25,
198,
220,
220,
220,
1330,
895,
10885,
198,
16341,
17267,
12331,
25,
198,
220,
220,
220,
5298,
17267,
12331,
7203,
29412,
12,
82,
2022,
385,
407,
1043,
6,
4943,
198,
11748,
30... | 3.671756 | 131 |
import matplotlib.pyplot as plt
import numpy as np
from double_integrator import DoubleIntegrator
from random import random, seed
from tests.tests_configuration import *
| [
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
4274,
62,
18908,
12392,
1330,
11198,
34500,
12392,
198,
6738,
4738,
1330,
4738,
11,
9403,
198,
6738,
5254,
13,
41989,
62,
11250,
392... | 3.782609 | 46 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# The MIT License (MIT)
#
# Copyright (c) 2014 Andrea Rendl
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
383,
17168,
13789,
357,
36393,
8,
198,
2,
198,
2,
15069,
357,
66,
8,
1946,
23174,
28703,
75,
198,
2,
198,
2,
244... | 3.107051 | 3,503 |
from setuptools import setup
setup(
name='xkpa',
version='0.1.3',
author='Alex Beal',
author_email='alexlbeal@gmail.com',
url='https://github.com/beala/xkcd-password',
include_package_data = True,
package_data = {
# If any package contains *.txt or *.... | [
6738,
900,
37623,
10141,
1330,
9058,
198,
198,
40406,
7,
198,
220,
220,
220,
220,
220,
220,
220,
1438,
11639,
87,
74,
8957,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
2196,
11639,
15,
13,
16,
13,
18,
3256,
198,
220,
220,
220,
... | 1.991435 | 467 |
def handle_options_on_cropped_file( # 0 0
input_doc_fname, # 0
output_doc_fname): # 0
"""Handle the options which apply after the file... | [
198,
198,
4299,
5412,
62,
25811,
62,
261,
62,
19915,
1496,
62,
7753,
7,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
... | 1.341975 | 1,620 |
#!/usr/bin/env python3
import socket
import time
import serial
###################################################
## Obtener informacion por TCP/IP de cada sensor ##
###################################################
###################################
## Enviar informacion al Arduino ##
###########################... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
11748,
17802,
198,
11748,
640,
198,
11748,
11389,
198,
198,
29113,
14468,
21017,
198,
2235,
1835,
83,
877,
4175,
49443,
16964,
23633,
14,
4061,
390,
269,
4763,
12694,
22492,
198,
291... | 4.734513 | 113 |
from pathlib import Path
PROJECT_ROOT = Path(__file__).parent.parent
| [
6738,
3108,
8019,
1330,
10644,
198,
198,
31190,
23680,
62,
13252,
2394,
796,
10644,
7,
834,
7753,
834,
737,
8000,
13,
8000,
198
] | 3.043478 | 23 |
# WARNING: Please don't edit this file. It was generated by Python/WinRT v1.0.0-beta.4
import enum
import winsdk
_ns_module = winsdk._import_ns_module("Windows.Media.Transcoding")
try:
import winsdk.windows.foundation
except Exception:
pass
try:
import winsdk.windows.foundation.collections
except Excep... | [
2,
39410,
25,
4222,
836,
470,
4370,
428,
2393,
13,
632,
373,
7560,
416,
11361,
14,
16643,
14181,
410,
16,
13,
15,
13,
15,
12,
31361,
13,
19,
198,
198,
11748,
33829,
198,
198,
11748,
7864,
34388,
198,
198,
62,
5907,
62,
21412,
796,... | 2.90873 | 252 |
par = 0
for i in range(5):
num = float(input())
if num % 2 == 0:
par += 1
print('{} valores pares'.format(par)) | [
1845,
796,
657,
198,
198,
1640,
1312,
287,
2837,
7,
20,
2599,
198,
220,
220,
220,
997,
796,
12178,
7,
15414,
28955,
198,
220,
220,
220,
611,
997,
4064,
362,
6624,
657,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1582,
15853,
352,
... | 2.206897 | 58 |
from typing import TypeVar, Any, List, Iterable, Optional, TYPE_CHECKING
if TYPE_CHECKING:
from pydfs_lineup_optimizer.player import Player
Self = TypeVar('Self', bound='Solver')
| [
6738,
19720,
1330,
5994,
19852,
11,
4377,
11,
7343,
11,
40806,
540,
11,
32233,
11,
41876,
62,
50084,
2751,
628,
198,
361,
41876,
62,
50084,
2751,
25,
198,
220,
220,
220,
422,
279,
5173,
9501,
62,
1370,
929,
62,
40085,
7509,
13,
7829... | 3.133333 | 60 |
#!/usr/bin/python
import signal
import sys
import time
from components import rgb, pir, matrix, oled, p1, joystick
# Welcome
########################################################################################################################
print "Welcome to meterkast, starting loop now"
# Our main data
######... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
198,
11748,
6737,
198,
11748,
25064,
198,
11748,
640,
198,
6738,
6805,
1330,
46140,
11,
12276,
11,
17593,
11,
267,
992,
11,
279,
16,
11,
49485,
198,
198,
2,
19134,
198,
29113,
29113,
29113,
... | 3.004299 | 1,163 |
from jinja2 import Environment, FileSystemLoader
| [
6738,
474,
259,
6592,
17,
1330,
9344,
11,
9220,
11964,
17401,
628
] | 4.166667 | 12 |
# Copyright 2015 Google 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 applicable law or agreed ... | [
2,
15069,
1853,
3012,
3457,
13,
1439,
2489,
10395,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
345,
743,
407,
779,
428,
2393,
2845,
198,
2,
287,
11846,
351,
262,
13789,
... | 3.93956 | 182 |
import pytest
import h5py
import numpy as np
@pytest.mark.parametrize('clib,clibCode',
[('blosc:blosclz', 0), ('blosc:lz4', 1),
('blosc:lz4hc', 2), ('blosc:zlib', 4),
('blosc:zstd', 5)])
@pytest.mark.parametrize('clevel', [1, 4, 8])
@pytest.m... | [
11748,
12972,
9288,
198,
11748,
289,
20,
9078,
198,
11748,
299,
32152,
355,
45941,
198,
198,
31,
9078,
9288,
13,
4102,
13,
17143,
316,
380,
2736,
10786,
565,
571,
11,
565,
571,
10669,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
22... | 2.089312 | 683 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.6 on 2017-10-15 08:11
from __future__ import unicode_literals
from django.db import migrations, models
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2980,
515,
416,
37770,
352,
13,
1157,
13,
21,
319,
2177,
12,
940,
12,
1314,
8487,
25,
1157,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
... | 2.736842 | 57 |
import string
| [
11748,
4731,
198
] | 4.666667 | 3 |
import sys, subprocess, re
from itertools import chain
string = sys.argv[1]
# 'M' marks the next 2 numbers as the starting x and y coordinates
# 'h' marks the next number as the distance to go horizontally
# but the way this actually works is unimportant, I can skip every character thats not a number and just rely on... | [
11748,
25064,
11,
850,
14681,
11,
302,
198,
6738,
340,
861,
10141,
1330,
6333,
198,
8841,
796,
25064,
13,
853,
85,
58,
16,
60,
198,
198,
2,
705,
44,
6,
8849,
262,
1306,
362,
3146,
355,
262,
3599,
2124,
290,
331,
22715,
220,
198,
... | 2.10349 | 831 |
import os
from typing import Optional
from proxy.http.parser import HttpParser
from proxy.http.proxy import HttpProxyBasePlugin
ACCESS_LOG_KEY = 'ACCESSED_HOSTS_LOG'
class LogAccessedHostsPlugin(HttpProxyBasePlugin):
"""
log client connection access to the log path in ACCESS_LOG_KEY environment variable.
... | [
11748,
28686,
198,
198,
6738,
19720,
1330,
32233,
198,
6738,
15741,
13,
4023,
13,
48610,
1330,
367,
29281,
46677,
198,
6738,
15741,
13,
4023,
13,
36436,
1330,
367,
29281,
44148,
14881,
37233,
628,
198,
26861,
7597,
62,
25294,
62,
20373,
... | 3.692857 | 140 |
"""
A high-performance HTTP/1.1 backend for the Kyoukai webserver using `httptools
<https://github.com/MagicStack/httptools>`_.
"""
import asyncio
import base64
import gzip
import logging
import traceback
import warnings
import zlib
from io import BytesIO
import httptools
from asphalt.core import Context
from werkzeu... | [
37811,
198,
32,
1029,
12,
26585,
14626,
14,
16,
13,
16,
30203,
329,
262,
509,
5832,
32765,
2639,
18497,
1262,
4600,
2804,
457,
10141,
220,
198,
27,
5450,
1378,
12567,
13,
785,
14,
22975,
25896,
14,
2804,
457,
10141,
29,
63,
44807,
1... | 2.236021 | 7,207 |
#!/usr/bin/env python
#
# Copyright 2014 - 2018 The BCE Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the license.txt file.
#
import re as _re
class MessageTree:
"""Base class for all message tree classes."""
def __init__(self, tree):
... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
198,
2,
220,
15069,
1946,
532,
2864,
383,
37078,
46665,
13,
1439,
2489,
10395,
13,
198,
2,
220,
5765,
286,
428,
2723,
2438,
318,
21825,
416,
257,
347,
10305,
12,
7635,
5964,
326,
... | 2.40223 | 1,345 |
#!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
# region header
'''This module provides an easy way to generate a python api documentation.'''
# # python3.5
# # pass
from __future__ import absolute_import, division, print_function, \
unicode_literals
# #
'''
For conventions see "boostnode/__init__.py" on \... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
17,
13,
22,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
3814,
13639,
198,
198,
7061,
6,
1212,
8265,
3769,
281,
2562,
835,
284,
7716,
257,
21015,
40391,
... | 2.324737 | 1,900 |
num=int(input("Enter your number :"))
a = ''
roman= {1000:'M', 900:'CM', 500:'D', 400:'CD', 100:'C', 90:'XC', 50:'L', 40:'XL', 10:'X', 9:'IX', 5:'V', 4:'IV', 1:'I'}
for i, j in roman.items():
if num >= i:
b = int(num/i)
num %= i
a += b * j
print(a) | [
198,
22510,
28,
600,
7,
15414,
7203,
17469,
534,
1271,
1058,
48774,
198,
64,
796,
10148,
198,
47119,
28,
1391,
12825,
32105,
44,
3256,
15897,
32105,
24187,
3256,
5323,
32105,
35,
3256,
7337,
32105,
8610,
3256,
1802,
32105,
34,
3256,
410... | 1.978571 | 140 |
def count_of_2s(number: int) -> int:
"""
Find the number of 2s in between 0 and n
:param number: the max value (inclusive)
:return: Number of 2s
"""
digit_length = find_digit_count(number)
result = 0
for i in range(0, digit_length):
result += count_of_2_at_digit(number, digit=... | [
628,
198,
4299,
954,
62,
1659,
62,
17,
82,
7,
17618,
25,
493,
8,
4613,
493,
25,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
9938,
262,
1271,
286,
362,
82,
287,
1022,
657,
290,
299,
198,
220,
220,
220,
1058,
17143,
1271,
25,
... | 2.392405 | 237 |
from flask import Blueprint
# 1创建蓝图对象
index_bp = Blueprint("index", __name__)
from . import views
| [
6738,
42903,
1330,
39932,
198,
2,
352,
26344,
249,
161,
119,
118,
164,
241,
251,
32368,
122,
43380,
117,
164,
109,
94,
198,
9630,
62,
46583,
796,
39932,
7203,
9630,
1600,
11593,
3672,
834,
8,
198,
198,
6738,
764,
1330,
5009,
198
] | 2.357143 | 42 |
# -*- encoding: utf-8 -*-
# ! python2
from __future__ import (absolute_import, division, print_function, unicode_literals)
import io
import os
import tempfile
from unittest import TestCase
from django_make_app.io_utils import read_yaml_file, optimize_code
| [
2,
532,
9,
12,
21004,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
5145,
21015,
17,
198,
198,
6738,
11593,
37443,
834,
1330,
357,
48546,
62,
11748,
11,
7297,
11,
3601,
62,
8818,
11,
28000,
1098,
62,
17201,
874,
8,
198,
198,
11748,
... | 3.023256 | 86 |
if __name__ == '__main__':
import matplotlib.pyplot as plt
import numpy as np
import os
import zipfile
with zipfile.ZipFile("./sad/downsampled_1.zip","r") as zip_ref:
zip_ref.extractall("./sad")
pass | [
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
201,
198,
220,
220,
220,
1330,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
201,
198,
220,
220,
220,
1330,
299,
32152,
355,
45941,
201,
198,
220,
220,
220,
1330,
28686,
... | 2.122807 | 114 |
from python_framework import Controller, ControllerMethod, HttpStatus
from enumeration.AccessDomain import AccessDomain
import SubscriptionDto
@Controller(url = '/subscription', tag='Subscription', description='Subscription controller')
| [
6738,
21015,
62,
30604,
1330,
22741,
11,
22741,
17410,
11,
367,
29281,
19580,
198,
198,
6738,
27056,
341,
13,
15457,
43961,
1330,
8798,
43961,
198,
11748,
3834,
33584,
35,
1462,
628,
198,
31,
22130,
7,
6371,
796,
31051,
7266,
33584,
325... | 4.528302 | 53 |
#--------------------#
# AUTHOR AND CONTACT #
#--------------------#
# Script made by David Requena [02/19/2020]
# The Rockefeller University. New York, USA.
# Contact: drequena@rockefeller.edu / d.requena.a@gmail.com
#-------------#
# DESCRIPTION #
#-------------#
# This code asks the user for a query to be searched ... | [
2,
19351,
2,
198,
2,
44746,
5357,
22904,
10659,
1303,
198,
2,
19351,
2,
198,
2,
12327,
925,
416,
3271,
9394,
8107,
685,
2999,
14,
1129,
14,
42334,
60,
198,
2,
383,
32764,
2059,
13,
968,
1971,
11,
4916,
13,
198,
2,
14039,
25,
288... | 2.467593 | 1,728 |
#!/usr/bin/python3
# Written by Kristoffer Rakstad Solberg, Student
# Copyright (c) 2020 Manta AUV, Vortex NTNU.
# All rights reserved.
import rospy
import numpy as np
import time
if __name__ == "__main__":
x = np.array((0.5, 0.0))
x_ref = np.array((2.0, 1.57))
rm = ReferenceModel(x, 0.05)
count =... | [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
2,
22503,
416,
14912,
47895,
34299,
24107,
4294,
3900,
11,
13613,
198,
2,
15069,
357,
66,
8,
12131,
337,
4910,
27548,
53,
11,
49790,
24563,
45,
52,
13,
198,
2,
1439,
2489,
10395,
13,
... | 2.221649 | 194 |