content stringlengths 1 1.05M | input_ids listlengths 1 883k | ratio_char_token float64 1 22.9 | token_count int64 1 883k |
|---|---|---|---|
import json
import requests
import discord
from discord.ext import commands
| [
11748,
33918,
201,
198,
11748,
7007,
201,
198,
11748,
36446,
201,
198,
6738,
36446,
13,
2302,
1330,
9729,
201,
198,
201,
198,
201,
198
] | 3.5 | 24 |
"""
G2_RIGHTS.
This module defines Monitor class to monitor CPU and memory utilization.
Pre-requisite non-standard Python module(s):
psutil
"""
import time
import threading
import psutil
| [
37811,
198,
38,
17,
62,
49,
34874,
13,
198,
198,
1212,
8265,
15738,
18289,
1398,
284,
5671,
9135,
290,
4088,
32121,
13,
198,
198,
6719,
12,
27614,
1729,
12,
20307,
11361,
8265,
7,
82,
2599,
198,
220,
220,
220,
26692,
22602,
198,
198... | 3.421053 | 57 |
# Module which defines how the I/O system works
import sys, os
from Registers import *
from random import *
from binascii import *
| [
2,
19937,
543,
15738,
703,
262,
314,
14,
46,
1080,
2499,
198,
198,
11748,
25064,
11,
28686,
198,
198,
6738,
3310,
6223,
1330,
1635,
198,
6738,
4738,
1330,
1635,
198,
6738,
9874,
292,
979,
72,
1330,
1635,
198,
220,
220,
220,
220,
220... | 3.021277 | 47 |
#!/bin/python3
import math
import os
import random
import re
import sys
# Complete the miniMaxSum function below.
if __name__ == '__main__':
arr = list(map(int, input().rstrip().split()))
miniMaxSum(arr)
| [
2,
48443,
8800,
14,
29412,
18,
198,
198,
11748,
10688,
198,
11748,
28686,
198,
11748,
4738,
198,
11748,
302,
198,
11748,
25064,
198,
198,
2,
13248,
262,
9927,
11518,
13065,
2163,
2174,
13,
198,
198,
361,
11593,
3672,
834,
6624,
705,
8... | 2.855263 | 76 |
# -*- coding: utf-8 -*-
import json
import math
import random
import time
import requests
import scrapy
from scrapy.http import HtmlResponse
from scrapy import Request
from spiders.common import OTA
from spiders.items.spot import spot
from spiders.items.price import price
'''
tag
'''
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
33918,
198,
11748,
10688,
198,
11748,
4738,
198,
11748,
640,
198,
198,
11748,
7007,
198,
11748,
15881,
88,
198,
6738,
15881,
88,
13,
4023,
1330,
367,
20369,
31077,
... | 3.303371 | 89 |
#!/usr/bin/env python3
import argparse
import os
import sys
import random
import math
from tqdm import tqdm
from collections import Counter
import operator
import numpy as np
FLAGS = None
next_random = 1
if __name__ == '__main__':
parser = argparse.ArgumentParser(description =
'transform text format f... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
11748,
1822,
29572,
198,
11748,
28686,
198,
11748,
25064,
198,
11748,
4738,
198,
11748,
10688,
198,
6738,
256,
80,
36020,
1330,
256,
80,
36020,
198,
6738,
17268,
1330,
15034,
19... | 2.021505 | 1,023 |
import pandas as pd
# Read the Hofstede indices into a pandas dataframe
data = pd.read_csv("..\\data\\Hofstede Insights - Manual 2021-05-13.csv", delimiter=",", index_col="country")
# Transform all data in the dataframe to strings
data["pdi"] = data["pdi"].astype(str)
data["idv"] = data["idv"].astype(str)
dat... | [
11748,
19798,
292,
355,
279,
67,
198,
198,
2,
4149,
262,
37745,
301,
18654,
36525,
656,
257,
19798,
292,
1366,
14535,
198,
7890,
796,
279,
67,
13,
961,
62,
40664,
7203,
492,
6852,
7890,
6852,
39,
1659,
301,
18654,
7088,
2337,
532,
1... | 2.659091 | 308 |
# pylint: disable="import-error"
from command_line_creator import CommandLineCreator
from current_cmd_b import CurrentCMD_B | [
2,
279,
2645,
600,
25,
15560,
2625,
11748,
12,
18224,
1,
198,
6738,
3141,
62,
1370,
62,
45382,
1330,
9455,
13949,
16719,
273,
198,
6738,
1459,
62,
28758,
62,
65,
1330,
9236,
34,
12740,
62,
33
] | 3.416667 | 36 |
from utils import _conv2d, _bn, _block
import tensorflow as tf | [
6738,
3384,
4487,
1330,
4808,
42946,
17,
67,
11,
4808,
9374,
11,
4808,
9967,
198,
11748,
11192,
273,
11125,
355,
48700
] | 2.952381 | 21 |
# -*- coding: utf-8 -*-
"""
Created on Sun Mar 06 00:27:21 2016
@author: maheshwa
"""
from __future__ import print_function
import requests
import time
import binascii
import hashlib
import json
# Authentication
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
3825,
1526,
9130,
3571,
25,
1983,
25,
2481,
1584,
198,
31,
9800,
25,
17266,
956,
71,
10247,
198,
37811,
198,
198,
6738,
11593,
37443,
834,
1330,
... | 3.028169 | 71 |
import logging
import functools
import mock
from testify import TestCase, setup
from testify import class_setup, class_teardown
from testify import teardown
import time
from tron.utils import timeutils
log = logging.getLogger(__name__)
# TODO: remove when replaced with tron.eventloop
# TODO: remove
def retry(m... | [
11748,
18931,
198,
11748,
1257,
310,
10141,
198,
11748,
15290,
198,
198,
6738,
19671,
1330,
220,
6208,
20448,
11,
9058,
198,
6738,
19671,
1330,
1398,
62,
40406,
11,
1398,
62,
660,
446,
593,
198,
6738,
19671,
1330,
573,
446,
593,
198,
... | 3.16 | 250 |
from classes.Display import Display
from classes.FinalScoreboard import FinalScoreboard
from classes.Sounds import Sounds
from classes.TargetArea import TargetArea
from classes.Target import Target
from classes.Text import Text
from classes.Timer import Timer
from time import time
import pygame
| [
6738,
6097,
13,
23114,
1330,
16531,
198,
6738,
6097,
13,
19006,
26595,
3526,
1330,
8125,
26595,
3526,
198,
6738,
6097,
13,
40825,
1330,
27107,
198,
6738,
6097,
13,
21745,
30547,
1330,
12744,
30547,
198,
6738,
6097,
13,
21745,
1330,
12744,... | 4.553846 | 65 |
"""Provide test fixtures"""
import logging
import os
import pytest
import vcd
# pylint: disable=too-many-locals
| [
37811,
15946,
485,
1332,
34609,
37811,
198,
11748,
18931,
198,
11748,
28686,
198,
198,
11748,
12972,
9288,
198,
11748,
410,
10210,
628,
198,
198,
2,
279,
2645,
600,
25,
15560,
28,
18820,
12,
21834,
12,
17946,
874,
198
] | 3.052632 | 38 |
import discord, os
from discord.ext import commands
from discord.ext.commands import has_permissions, bot_has_permissions
from dotenv import load_dotenv
client = commands.Bot(command_prefix='-')
client.remove_command('help')
client.remove_command('reload')
# Loads a cog
# Unloads a cog
# Reloads a cog
load_dotenv(... | [
11748,
36446,
11,
28686,
198,
6738,
36446,
13,
2302,
1330,
9729,
198,
6738,
36446,
13,
2302,
13,
9503,
1746,
1330,
468,
62,
525,
8481,
11,
10214,
62,
10134,
62,
525,
8481,
198,
6738,
16605,
24330,
1330,
3440,
62,
26518,
24330,
198,
19... | 2.581818 | 220 |
import sys
from setuptools import setup
from setuptools.extension import Extension
### unit tests for this package
import topicmodel_tests
### set include dirs for numpy
try:
import numpy
except ImportError:
numpy_already_installed = False
from distutils.sysconfig import get_python_lib
include_numpy_... | [
11748,
25064,
198,
6738,
900,
37623,
10141,
1330,
9058,
198,
6738,
900,
37623,
10141,
13,
2302,
3004,
1330,
27995,
198,
198,
21017,
4326,
5254,
329,
428,
5301,
198,
11748,
7243,
19849,
62,
41989,
198,
198,
21017,
900,
2291,
288,
17062,
... | 2.196771 | 991 |
import datetime
from unittest import mock
import pytz
from django.core.exceptions import ValidationError
from django.db import IntegrityError
from django.test import TestCase
from game.models import Ownership, Game, Player, RealEstate
from game.tests.factories.ownership import OwnershipFactory
from game.tests.factori... | [
11748,
4818,
8079,
198,
6738,
555,
715,
395,
1330,
15290,
198,
198,
11748,
12972,
22877,
198,
6738,
42625,
14208,
13,
7295,
13,
1069,
11755,
1330,
3254,
24765,
12331,
198,
6738,
42625,
14208,
13,
9945,
1330,
39348,
12331,
198,
6738,
42625... | 3.833333 | 108 |
# from constraint.node.SubstitutorVisitor import SubstitutorVisitor
from enum import Enum
# for visitor class. Using isinstance breaks when importing from outside
| [
2,
422,
32315,
13,
17440,
13,
7004,
301,
270,
38409,
15854,
2072,
1330,
24944,
270,
38409,
15854,
2072,
198,
6738,
33829,
1330,
2039,
388,
628,
628,
198,
198,
2,
329,
21493,
1398,
13,
8554,
318,
39098,
9457,
618,
33332,
422,
2354,
628... | 3.75 | 48 |
# Generated by Django 3.1.7 on 2021-03-28 20:32
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
513,
13,
16,
13,
22,
319,
33448,
12,
3070,
12,
2078,
1160,
25,
2624,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
from .snippets import (
remove_repeating,
flare,
list_appending_long,
level_off,
)
import itertools
import copy
from core.models import RotatorAdminPanel
# Nakadka na django do obsugi dodatku tumaczeniowego django-modeltranslation.
# Bo tak jest po prostu atwiej...
# Klasa aduje stron po dodaniu... | [
6738,
764,
16184,
3974,
1039,
1330,
357,
198,
220,
220,
220,
4781,
62,
45956,
803,
11,
198,
220,
220,
220,
30239,
11,
198,
220,
220,
220,
1351,
62,
1324,
1571,
62,
6511,
11,
198,
220,
220,
220,
1241,
62,
2364,
11,
198,
220,
220,
... | 2.17382 | 932 |
import copy
import math
import random
import numpy as np
import torch
from game.Player import Player
| [
11748,
4866,
198,
11748,
10688,
198,
11748,
4738,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28034,
198,
198,
6738,
983,
13,
14140,
1330,
7853,
628,
628,
628
] | 3.724138 | 29 |
from functools import partial
from typing import Tuple
import covasim as cv
import matplotlib.pyplot as plt
import numpy as np
import scipy.stats as st
delta_variant = cv.variant('delta', days=0) # delta is the dominant variant in germany
# Define baseline parameters
baseline_pars = dict(
start_day='2022-01-0... | [
6738,
1257,
310,
10141,
1330,
13027,
198,
6738,
19720,
1330,
309,
29291,
198,
198,
11748,
39849,
292,
320,
355,
269,
85,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
629,
... | 2.412536 | 686 |
# -*- coding: utf-8 -*-
"""
Created on Wed Jun 16 11:45:09 2021
@author: Michael ODonnell
@purpose: scrape NBA draft picks by year
"""
# import needed libraries
import requests
from bs4 import BeautifulSoup
import pandas as pd
import time
# function to scrape a list of years of NBA Drafts
# function to scrape a l... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
3300,
7653,
1467,
1367,
25,
2231,
25,
2931,
33448,
198,
198,
31,
9800,
25,
3899,
440,
24853,
198,
198,
31,
29983,
25,
42778,
7403,
4538,
11103,
... | 3.718232 | 181 |
import urlparse,urllib2,re
import datetime,logging
from marcbots import MARCImportBot
from pymarc import Field
| [
11748,
19016,
29572,
11,
333,
297,
571,
17,
11,
260,
201,
198,
11748,
4818,
8079,
11,
6404,
2667,
201,
198,
6738,
1667,
21101,
1747,
1330,
18805,
34,
20939,
20630,
201,
198,
6738,
12972,
3876,
66,
1330,
7663,
201,
198,
201,
198,
201,
... | 2.225806 | 62 |
from sqlalchemy import mapper, util, Query, exceptions
import types
| [
6738,
44161,
282,
26599,
1330,
285,
11463,
11,
7736,
11,
43301,
11,
13269,
198,
11748,
3858,
628
] | 4.058824 | 17 |
UNDO_EMPTY = 'undostack-empty'
UNDO_NOT_EMPTY = 'undostack-not-empty'
REDO_EMPTY = 'redostack-empty'
REDO_NOT_EMPTY = 'redostack-not-empty'
UNDO_CHANGED = 'undostack-changed'
REDO_CHANGED = 'redostack-changed'
| [
4944,
18227,
62,
39494,
9936,
796,
705,
917,
455,
441,
12,
28920,
6,
198,
4944,
18227,
62,
11929,
62,
39494,
9936,
796,
705,
917,
455,
441,
12,
1662,
12,
28920,
6,
198,
22083,
46,
62,
39494,
9936,
796,
705,
445,
455,
441,
12,
2892... | 2.234043 | 94 |
import discord
from discord.ext import commands
from os import system
#
#
# @client.command(pass_context=True)
# async def clear_all(ctx):
# channel = ctx.message.channel
# count = 0
#
# while True:
# messages = []
# async for message in client.logs_from(channel, 100):
# messa... | [
11748,
36446,
198,
6738,
36446,
13,
2302,
1330,
9729,
198,
6738,
28686,
1330,
1080,
628,
198,
198,
2,
198,
2,
198,
2,
2488,
16366,
13,
21812,
7,
6603,
62,
22866,
28,
17821,
8,
198,
2,
30351,
825,
1598,
62,
439,
7,
49464,
2599,
198... | 2.170701 | 785 |
"""
Example showing use of the jsgf.ext DictationGrammar class for matching and
compiling rules that use regular JSGF expansions like Literal and Sequence as
well as Dictation expansions.
"""
from jsgf import PublicRule, Sequence
from jsgf.ext import Dictation, DictationGrammar
if __name__ == '__main__':
main()... | [
37811,
198,
16281,
4478,
779,
286,
262,
44804,
70,
69,
13,
2302,
360,
713,
341,
38,
859,
3876,
1398,
329,
12336,
290,
198,
5589,
4386,
3173,
326,
779,
3218,
26755,
21713,
36383,
588,
25659,
1691,
290,
45835,
355,
198,
4053,
355,
360,
... | 3.309278 | 97 |
"""!
@brief Integration-tests for Hierarchical Sync (HSyncNet) algorithm.
@authors Andrei Novikov (pyclustering@yandex.ru)
@date 2014-2020
@copyright BSD-3-Clause
"""
import unittest;
import matplotlib;
matplotlib.use('Agg');
from pyclustering.cluster.tests.hsyncnet_templates import HsyncnetTestT... | [
37811,
0,
201,
198,
201,
198,
31,
65,
3796,
38410,
12,
41989,
329,
36496,
998,
605,
35908,
357,
7998,
13361,
7934,
8,
11862,
13,
201,
198,
201,
198,
31,
41617,
10948,
72,
5267,
1134,
709,
357,
9078,
565,
436,
1586,
31,
88,
392,
10... | 2.588542 | 192 |
import common.assertions as assertions | [
11748,
2219,
13,
30493,
507,
355,
29965
] | 5.428571 | 7 |
lista = [[], []]
valor = 0
for c in range(1, 8):
valor = int(input(f'Digite o {c}o. valor: '))
if valor % 2 == 0:
lista[0].append(valor)
else:
lista[1].append(valor)
print('-=' * 30)
print(f'Os valores pares digitados foram: {sorted(lista[0])}')
print(f'Os valores mpres digitados foram: {sor... | [
4868,
64,
796,
16410,
4357,
685,
11907,
198,
2100,
273,
796,
657,
198,
1640,
269,
287,
2837,
7,
16,
11,
807,
2599,
198,
220,
220,
220,
1188,
273,
796,
493,
7,
15414,
7,
69,
6,
19511,
578,
267,
1391,
66,
92,
78,
13,
1188,
273,
... | 2.048913 | 368 |
'''Top-k kendall-tau distance.
This module generalise kendall-tau as defined in [1].
It returns a distance: 0 for identical (in the sense of top-k) lists and 1 if completely different.
Example:
Simply call kendall_top_k with two same-length arrays of ratings (or also rankings), length of the top elements k (defau... | [
7061,
6,
9126,
12,
74,
479,
437,
439,
12,
83,
559,
5253,
13,
198,
198,
1212,
8265,
2276,
786,
479,
437,
439,
12,
83,
559,
355,
5447,
287,
685,
16,
4083,
198,
1026,
5860,
257,
5253,
25,
657,
329,
10411,
357,
259,
262,
2565,
286,
... | 2.297143 | 1,400 |
import unittest
import numpy as np
import bayesnet as bn
if __name__ == '__main__':
unittest.main()
| [
11748,
555,
715,
395,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
15489,
274,
3262,
355,
275,
77,
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.547619 | 42 |
newchar = char()
#newchar.raise_stat()
# print(newchar.cha)
# newchar.raise_stat()
# print(newchar.cha)
#
# class_type = None
# list(class_type)
# print(class_type, type(class_type))
#
# listthing = [0, 1, 2, 3, 4, 5]
#
# for i in listthing:
# if i == 2:
# listthing.append(1)
# elif i == 1:
# ... | [
198,
198,
3605,
10641,
796,
1149,
3419,
198,
198,
2,
3605,
10641,
13,
40225,
62,
14269,
3419,
198,
198,
2,
3601,
7,
3605,
10641,
13,
11693,
8,
198,
2,
649,
10641,
13,
40225,
62,
14269,
3419,
198,
2,
3601,
7,
3605,
10641,
13,
11693... | 2.187879 | 330 |
from kivy.app import App
from kivy.config import Config
Config.set('graphics', 'width', '500')
Config.set('graphics', 'height', '640')
Config.set('graphics', 'resizable', False)
Config.set('kivy','window_icon','data/friday/res/icon.ico')
#from kivy.core.window import Window
from kivy.uix.screenmanager import ScreenMana... | [
6738,
479,
452,
88,
13,
1324,
1330,
2034,
198,
6738,
479,
452,
88,
13,
11250,
1330,
17056,
198,
16934,
13,
2617,
10786,
70,
11549,
3256,
705,
10394,
3256,
705,
4059,
11537,
198,
16934,
13,
2617,
10786,
70,
11549,
3256,
705,
17015,
325... | 2.719008 | 363 |
fig, ax = plt.subplots()
# Add a bar for the rowing "Height" column mean/std
ax.bar("Rowing", mens_rowing["Height"].mean(), yerr=mens_rowing["Height"].std())
# Add a bar for the gymnastics "Height" column mean/std
ax.bar("Gymnastics", mens_gymnastics["Height"].mean(), yerr=mens_gymnastics["Height"].std())
# ... | [
5647,
11,
7877,
796,
458,
83,
13,
7266,
489,
1747,
3419,
201,
198,
201,
198,
2,
3060,
257,
2318,
329,
262,
686,
5469,
366,
23106,
1,
5721,
1612,
14,
19282,
201,
198,
897,
13,
5657,
7203,
49,
7855,
1600,
285,
641,
62,
11577,
14692,... | 2.533333 | 150 |
from __future__ import annotations
from itests.pages.base import BaseModal, BasePage
| [
6738,
11593,
37443,
834,
1330,
37647,
198,
198,
6738,
340,
3558,
13,
31126,
13,
8692,
1330,
7308,
5841,
282,
11,
7308,
9876,
628,
198
] | 3.666667 | 24 |
import tensorflow as tf
import numpy as np
import parse
| [
11748,
11192,
273,
11125,
355,
48700,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
21136,
628
] | 3.5625 | 16 |
from mmr2web.models import *
import datetime
def get_payments_file(nok_per_usd=9.1412):
"""Default exchange rate taken from Norges Bank, Nov 22, 2019."""
payments_out = open("payments_mmrisk.csv", "w")
payments_out.write("amount,message\n")
total_payment = 0
for s in Situation.objects.filter(selec... | [
6738,
8085,
81,
17,
12384,
13,
27530,
1330,
1635,
198,
11748,
4818,
8079,
628,
198,
4299,
651,
62,
15577,
902,
62,
7753,
7,
77,
482,
62,
525,
62,
385,
67,
28,
24,
13,
1415,
1065,
2599,
198,
220,
220,
220,
37227,
19463,
5163,
2494,... | 2.338863 | 422 |
# Test Event class
try:
import uasyncio as asyncio
except ImportError:
print("SKIP")
raise SystemExit
import micropython
try:
micropython.schedule
except AttributeError:
print("SKIP")
raise SystemExit
try:
# Unix port can't select/poll on user-defined types.
import uselect as selec... | [
2,
6208,
8558,
1398,
198,
198,
28311,
25,
198,
220,
220,
220,
1330,
334,
292,
13361,
952,
355,
30351,
952,
198,
16341,
17267,
12331,
25,
198,
220,
220,
220,
3601,
7203,
18831,
4061,
4943,
198,
220,
220,
220,
5298,
4482,
30337,
628,
... | 2.715909 | 176 |
import unittest
from ortec.scientific.benchmarks.loadbuilding.instance.ThreeDitemkind import ThreeDitemkind
TestCase = unittest.TestSuite()
TestCase.addTest(unittest.TestLoader().loadTestsFromTestCase(TestItemkind)) | [
11748,
555,
715,
395,
201,
198,
6738,
393,
36281,
13,
41355,
13,
26968,
14306,
13,
2220,
16894,
13,
39098,
13,
12510,
35,
9186,
11031,
1330,
7683,
35,
9186,
11031,
201,
198,
201,
198,
14402,
20448,
796,
555,
715,
395,
13,
14402,
5606,... | 3.142857 | 70 |
from .structs import GameNode
| [
6738,
764,
7249,
82,
1330,
3776,
19667,
198
] | 3.75 | 8 |
import socket
import ipaddress
| [
11748,
17802,
198,
11748,
20966,
21975,
628,
198
] | 4.125 | 8 |
#
# Copyright John Reid 2006
#
from _biopsy import *
Hit.__str__ = _hit_str
HitLocation.start = _location_start
HitLocation.end = _location_end
def _location_overlap( location1, location2 ):
"""Do two hits overlap?"""
if location1.position < location2.position:
return location1.end() > location2.pos... | [
2,
198,
2,
15069,
1757,
16095,
4793,
198,
2,
198,
198,
6738,
4808,
8482,
44522,
1330,
1635,
198,
198,
17889,
13,
834,
2536,
834,
796,
4808,
17945,
62,
2536,
198,
198,
17889,
14749,
13,
9688,
796,
4808,
24886,
62,
9688,
198,
17889,
1... | 2.512227 | 1,513 |
# -*- coding: utf-8 -*-
import click
from github import Github
from github.GithubException import RateLimitExceededException
if __name__ == "__main__":
main(obj={})
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
3904,
198,
6738,
33084,
1330,
38994,
198,
6738,
33084,
13,
38,
10060,
16922,
1330,
14806,
39184,
3109,
2707,
276,
16922,
628,
628,
628,
198,
198,
361,
11593,
... | 2.901639 | 61 |
import numpy as np
def normalize(matrix, nh=1, nl=0):
"""Normalizes each column in a matrix by calculating its maximum
and minimum values, the parameters nh and nl specify the final range
of the normalized values"""
return (matrix - matrix.min(0)) * ((nh - nl) / matrix.ptp(0)) + nl
def one_hot_encod... | [
11748,
299,
32152,
355,
45941,
628,
198,
4299,
3487,
1096,
7,
6759,
8609,
11,
299,
71,
28,
16,
11,
299,
75,
28,
15,
2599,
198,
220,
220,
220,
37227,
26447,
4340,
1123,
5721,
287,
257,
17593,
416,
26019,
663,
5415,
198,
220,
220,
2... | 2.766962 | 678 |
from pyimagesearch.searcher import Searcher
from pyimagesearch.utils import *
import pytest
indexPath = "D:/APP/cbis/"
verbose = True
#test Search class
pred_file = "D://APP//cbis//tests//out//predictions_test.csv"
top_k = 20
| [
6738,
12972,
17566,
3679,
13,
325,
283,
2044,
1330,
42016,
2044,
198,
6738,
12972,
17566,
3679,
13,
26791,
1330,
1635,
198,
11748,
12972,
9288,
198,
198,
9630,
15235,
796,
366,
35,
14079,
24805,
14,
21101,
271,
30487,
198,
19011,
577,
7... | 2.839506 | 81 |
"""
Provides functions for working with NTFS volumes
Author: Harel Segev
05/16/2020
"""
from construct import Struct, Padding, Computed, IfThenElse, BytesInteger, Const, Enum, Array, FlagsEnum, Switch, Tell
from construct import PaddedString, Pointer, Seek, Optional, StopIf, RepeatUntil, Padded
fro... | [
37811,
201,
198,
220,
220,
220,
47081,
5499,
329,
1762,
351,
399,
10234,
50,
15343,
201,
198,
220,
220,
220,
6434,
25,
367,
20318,
1001,
469,
85,
201,
198,
220,
220,
220,
8870,
14,
1433,
14,
42334,
201,
198,
37811,
201,
198,
201,
... | 2.095261 | 2,089 |
from ortools.linear_solver import pywraplp
from ortools.sat.python import cp_model
my_program = [
["inp", "w"],
["mul", "x", "0"],
["add", "x", "z"],
["mod", "x", "26"],
["div", "z", "1"],
["add", "x", "12"],
["eql", "x", "w"],
["eql", "x", "0"],
["mul", "y", "0"],
["add", "y", ... | [
6738,
393,
31391,
13,
29127,
62,
82,
14375,
1330,
12972,
29988,
489,
79,
198,
6738,
393,
31391,
13,
49720,
13,
29412,
1330,
31396,
62,
19849,
198,
198,
1820,
62,
23065,
796,
685,
198,
220,
220,
220,
14631,
259,
79,
1600,
366,
86,
33... | 1.736087 | 3,414 |
import xlsxwriter
from slugify import slugify
import os
| [
11748,
2124,
7278,
87,
16002,
198,
6738,
31065,
1958,
1330,
31065,
1958,
198,
11748,
28686,
628
] | 3.5625 | 16 |
import numpy as np
# datos de prueba
#set 1
""" agua = [27.5, 28, 28.8, 29.1, 30, 31, 32]
cal = [2, 3.5, 4.5, 2.5, 8.5, 10.5, 13.5]
puzo = [18, 16.5, 10.5, 2.5, 9, 4.5, 1.5]
dr = [5, 2, 3, 4, 1, 2, 3]
gh = [7, 2, 1, 1, 1, 6, 7]
puzos = [15, 15.5, 11.5, 5, 5, 3, 1]
variables_data = [cal, puzo]
variable = ['u', ... | [
198,
11748,
299,
32152,
355,
45941,
628,
628,
628,
198,
198,
2,
4818,
418,
390,
778,
518,
7012,
198,
2,
2617,
352,
198,
37811,
556,
6413,
796,
685,
1983,
13,
20,
11,
2579,
11,
2579,
13,
23,
11,
2808,
13,
16,
11,
1542,
11,
3261,
... | 1.721154 | 520 |
#Para mostra qualquer coisa na tela, Voc usa o print()
print('Alesson', 'Sousa', sep='_')# O funo sep='-' fala para o print o que colocar para separa os nome
print('Alesson', 'Sousa', sep='_', end='\n')#esse end='' para fala o que vc quer no final da linha do print
#Exemplo
#123.456.789-00
print('123','456','789',... | [
2,
47,
3301,
749,
430,
4140,
10819,
763,
9160,
12385,
256,
10304,
11,
47208,
514,
64,
267,
3601,
3419,
198,
198,
4798,
10786,
32,
1203,
261,
3256,
705,
50,
516,
64,
3256,
41767,
11639,
62,
11537,
2,
440,
1257,
78,
41767,
11639,
1935... | 2.5 | 140 |
#
# add
# add()
num1 = func()
num2 = sum(2)
print(num2(5))
print(type(num1))
print(type(num2))
| [
2,
220,
628,
198,
198,
2,
751,
220,
198,
2,
751,
3419,
220,
198,
22510,
16,
796,
25439,
3419,
198,
22510,
17,
796,
2160,
7,
17,
8,
198,
4798,
7,
22510,
17,
7,
20,
4008,
198,
198,
4798,
7,
4906,
7,
22510,
16,
4008,
198,
4798,
... | 1.924528 | 53 |
"""About tags inherited from standard mode
Attributes
BASE_GRAMMAR: The base grammar for python mode
tag_manager: The tag manager for python mode
"""
from pathlib import Path
from ...tags.manager import TagManager as TagManagerStandard
from ...tags.grammar import Grammar
from ...tags.tag import Tag as TagStand... | [
37811,
8585,
15940,
19552,
422,
3210,
4235,
198,
198,
29021,
198,
220,
220,
220,
49688,
62,
10761,
2390,
40569,
25,
383,
2779,
23491,
329,
21015,
4235,
198,
220,
220,
220,
7621,
62,
37153,
25,
383,
7621,
4706,
329,
21015,
4235,
198,
3... | 3.41844 | 141 |
# data_loader
# __init__.py
from data_loader.image_data_loader import ImageDataLoader
from data_loader.coco_data_loader import COCODataLoader
from data_loader.tf_example_loader import TFExampleLoader
| [
2,
1366,
62,
29356,
198,
2,
11593,
15003,
834,
13,
9078,
198,
198,
6738,
1366,
62,
29356,
13,
9060,
62,
7890,
62,
29356,
1330,
7412,
6601,
17401,
198,
6738,
1366,
62,
29356,
13,
66,
25634,
62,
7890,
62,
29356,
1330,
327,
4503,
3727,... | 3.295082 | 61 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.9 on 2017-02-25 11:38
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2980,
515,
416,
37770,
352,
13,
24,
13,
24,
319,
2177,
12,
2999,
12,
1495,
1367,
25,
2548,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
1... | 2.724638 | 69 |
from time import sleep
import pytest
import torch
from torchvision.ops import roi_align
| [
6738,
640,
1330,
3993,
198,
198,
11748,
12972,
9288,
198,
11748,
28034,
198,
6738,
28034,
10178,
13,
2840,
1330,
686,
72,
62,
31494,
628
] | 3.75 | 24 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# =============================================================================
# Created By : Ardalan Naseri
# Created Date: Mon September 21 2020
# =============================================================================
"""The module is a VCF reader to parse input... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
38093,
25609,
198,
2,
15622,
2750,
220,
1058,
34597,
25786,
399,
6005,
72,
198,
2,
15622,
7536,
25,
2892,
2693... | 4.653846 | 78 |
"""
Layout definitions
"""
from libqtile import layout
from .settings import COLS
from libqtile.config import Match
_layout_common_settings = dict(
border_focus=COLS['purple_4'],
border_normal=COLS['dark_1'],
single_border_width=0,
)
_max_layout_settings = {
**_layout_common_settings,
"border_focu... | [
37811,
198,
32517,
17336,
198,
37811,
198,
6738,
9195,
39568,
576,
1330,
12461,
198,
6738,
764,
33692,
1330,
20444,
50,
198,
6738,
9195,
39568,
576,
13,
11250,
1330,
13225,
198,
198,
62,
39786,
62,
11321,
62,
33692,
796,
8633,
7,
198,
... | 2.651917 | 339 |
from django.test import TestCase
from django.contrib.auth.models import User
from .models import Profile, Neighbourhood, Post, Business
# Create your tests here.
| [
6738,
42625,
14208,
13,
9288,
1330,
6208,
20448,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
27530,
1330,
11787,
198,
6738,
764,
27530,
1330,
13118,
11,
22505,
6084,
2894,
11,
2947,
11,
7320,
198,
198,
2,
13610,
534,
5254,
... | 3.365385 | 52 |
from rest_framework.routers import SimpleRouter
from api.suids import views
router = SimpleRouter()
router.register(r'suids', views.SuidViewSet, basename='suid')
urlpatterns = router.urls
| [
6738,
1334,
62,
30604,
13,
472,
1010,
1330,
17427,
49,
39605,
198,
6738,
40391,
13,
2385,
2340,
1330,
5009,
628,
198,
472,
353,
796,
17427,
49,
39605,
3419,
198,
472,
353,
13,
30238,
7,
81,
338,
84,
2340,
3256,
5009,
13,
5606,
312,
... | 3.064516 | 62 |
"""
Copyright (C) 2020 Nederlandse Organisatie voor Toegepast Natuur-
wetenschappelijk Onderzoek TNO / TNO, Netherlands Organisation for
applied scientific research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You... | [
37811,
198,
220,
220,
220,
15069,
357,
34,
8,
12131,
399,
5702,
1044,
325,
7221,
271,
265,
494,
410,
2675,
1675,
68,
469,
30119,
14393,
84,
333,
12,
198,
220,
220,
220,
9583,
641,
354,
1324,
417,
45961,
440,
681,
10872,
988,
309,
... | 2.263333 | 1,800 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from celery import Celery, platforms
app = Celery("task")
app.config_from_object('celery_task.celery_config')
platforms.C_FORCE_ROOT = True
| [
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,
18725,
1924,
1330,
15248,
1924,
11,
9554,
628,
198,
1324,
796,
15248,
1924,
7203,
35943,
4943,
... | 2.701299 | 77 |
# Copyright (c) OpenMMLab. All rights reserved.
from typing import List, Optional, Union
import numpy as np
from .builder import NODES
from .node import MultiInputNode, Node
try:
from mmdet.apis import inference_detector, init_detector
has_mmdet = True
except (ImportError, ModuleNotFoundError):
has_mmdet... | [
2,
15069,
357,
66,
8,
4946,
44,
5805,
397,
13,
1439,
2489,
10395,
13,
198,
6738,
19720,
1330,
7343,
11,
32233,
11,
4479,
198,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
764,
38272,
1330,
399,
3727,
1546,
198,
6738,
764,
174... | 3.122642 | 106 |
from .array import Array
from .grid import Grid
| [
198,
6738,
764,
18747,
1330,
15690,
198,
6738,
764,
25928,
1330,
24846,
628
] | 3.846154 | 13 |
import os
import sys
import unittest
import uuid
from nanome import PluginInstance
from nanome.api.plugin_instance import _DefaultPlugin
from nanome.api import structure, ui
from nanome.util import enums, Vector3, Quaternion, config
if sys.version_info.major >= 3:
from unittest.mock import MagicMock
e... | [
11748,
28686,
201,
198,
11748,
25064,
201,
198,
11748,
555,
715,
395,
201,
198,
11748,
334,
27112,
201,
198,
201,
198,
6738,
15709,
462,
1330,
42636,
33384,
201,
198,
6738,
15709,
462,
13,
15042,
13,
33803,
62,
39098,
1330,
4808,
19463,... | 2.986111 | 144 |
"""
Tests of bandits.
"""
import numpy as np
import pytest
from unittest import TestCase
from bandit.bandit import (
CustomBandit,
EpsGreedyBandit,
GreedyBandit,
RandomBandit,
)
from bandit.environment import Environment
from bandit.reward import GaussianReward
| [
37811,
198,
51,
3558,
286,
44149,
13,
198,
37811,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
12972,
9288,
198,
6738,
555,
715,
395,
1330,
6208,
20448,
198,
198,
6738,
4097,
270,
13,
3903,
270,
1330,
357,
198,
220,
220,
220,
... | 2.938144 | 97 |
from .release import __version__
from .generate import generate, mark_dirty, dirty, clean
from .exceptions import ParsimonyException
from . import generators
from . import configuration
from . import persistence
from .defaults import set_defaults
set_defaults() | [
6738,
764,
20979,
1330,
11593,
9641,
834,
198,
6738,
764,
8612,
378,
1330,
7716,
11,
1317,
62,
49075,
11,
11841,
11,
3424,
198,
6738,
764,
1069,
11755,
1330,
23042,
33969,
16922,
628,
198,
6738,
764,
1330,
27298,
198,
6738,
764,
1330,
... | 4.076923 | 65 |
from pyrecard.utils.pyrequest import pyrequest
PLAN_PATH = '/assinaturas/v1/plans'
| [
6738,
12972,
8344,
446,
13,
26791,
13,
9078,
25927,
1330,
12972,
25927,
628,
198,
6489,
1565,
62,
34219,
796,
31051,
44961,
2541,
292,
14,
85,
16,
14,
489,
504,
6,
628,
628,
628,
198
] | 2.676471 | 34 |
try:
from setuptools import setup, find_packages
from pkg_resources import Requirement, resource_filename
except ImportError:
from distutils.core import setup, find_packages
setup(
name='Aptly-Api-Cli',
version='0.1',
url='https://github.com/TimSusa/aptly_api_cli',
license='MIT',
keywor... | [
28311,
25,
198,
220,
220,
220,
422,
900,
37623,
10141,
1330,
9058,
11,
1064,
62,
43789,
198,
220,
220,
220,
422,
279,
10025,
62,
37540,
1330,
9394,
24615,
11,
8271,
62,
34345,
198,
16341,
17267,
12331,
25,
198,
220,
220,
220,
422,
1... | 2.421505 | 465 |
emp_1 = Employee('hello','world',1900)
emp_2 = Employee('test','world',2000)
print(emp_1)
print(emp_2)
print(emp_1.fullname())
print(emp_2.fullname())
| [
198,
45787,
62,
16,
796,
36824,
10786,
31373,
41707,
6894,
3256,
48104,
8,
198,
45787,
62,
17,
796,
36824,
10786,
9288,
41707,
6894,
3256,
11024,
8,
198,
198,
4798,
7,
45787,
62,
16,
8,
198,
4798,
7,
45787,
62,
17,
8,
198,
198,
47... | 2.444444 | 63 |
"""
PASSENGERS
"""
numPassengers = 2290
passenger_arriving = (
(0, 5, 9, 3, 0, 0, 3, 7, 5, 2, 1, 0), # 0
(2, 4, 10, 6, 0, 0, 2, 3, 4, 2, 4, 0), # 1
(4, 9, 7, 4, 2, 0, 4, 5, 7, 4, 6, 0), # 2
(9, 9, 6, 4, 1, 0, 9, 8, 2, 5, 3, 0), # 3
(4, 6, 4, 8, 2, 0, 5, 6, 7, 3, 3, 0), # 4
(4, 3, 5, 3, 1, 0, 5, 8, 2, 2, 0... | [
198,
37811,
198,
47924,
26808,
4877,
198,
37811,
198,
198,
22510,
14478,
9302,
796,
362,
24369,
198,
198,
6603,
6540,
62,
283,
380,
1075,
796,
357,
198,
197,
7,
15,
11,
642,
11,
860,
11,
513,
11,
657,
11,
657,
11,
513,
11,
767,
... | 2.071605 | 18,197 |
import plotly.express as px
from preprocess import PreprocessHeatmap | [
11748,
7110,
306,
13,
42712,
355,
279,
87,
198,
6738,
662,
14681,
1330,
3771,
14681,
39596,
8899
] | 4 | 17 |
from dom import e, Div, TextInput, Button, TextArea
from basicboard import BasicBoard
from connection import getconn
from utils import queryparams, random, setseed
mainseed = 80 | [
6738,
2401,
1330,
304,
11,
4777,
11,
8255,
20560,
11,
20969,
11,
8255,
30547,
198,
6738,
4096,
3526,
1330,
14392,
29828,
198,
6738,
4637,
1330,
651,
37043,
198,
6738,
3384,
4487,
1330,
12405,
37266,
11,
4738,
11,
900,
28826,
198,
198,
... | 3.955556 | 45 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from include import *
from timecat import detect_file_format
from timecat import detect_datetime_format
case_num = 0
if __name__ == "__main__":
ascending_log = "testbinary.log"
with open(ascending_log) as f:
# 1. ascending
regex_format_info = detect_d... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
6738,
2291,
1330,
1635,
198,
6738,
640,
9246,
1330,
4886,
62,
7753,
62,
18982,
198,
6738,
640,
9246,
1330,
4886,
62,
19... | 2.158892 | 686 |
"""This file contains code for use with "Think Bayes",
by Allen B. Downey, available from greenteapress.com
Copyright 2012 Allen B. Downey
License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html
"""
from thinkbayes import Pmf
from bowl import Bowl
if __name__ == '__main__':
main()
| [
37811,
1212,
2393,
4909,
2438,
329,
779,
351,
366,
22073,
4696,
274,
1600,
198,
1525,
9659,
347,
13,
5588,
2959,
11,
1695,
422,
10536,
21872,
499,
601,
13,
785,
198,
198,
15269,
2321,
9659,
347,
13,
5588,
2959,
198,
34156,
25,
22961,
... | 3 | 97 |
import unittest
from models import settings
from models.mathbot import *
from models.settings import U238_DECAY_CONSTANT, U238_DECAY_CONSTANT_ERROR, TH232_DECAY_CONSTANT, \
TH232_DECAY_CONSTANT_ERROR
if __name__ == '__main__':
unittest.main()
| [
11748,
555,
715,
395,
198,
198,
6738,
4981,
1330,
6460,
198,
6738,
4981,
13,
11018,
13645,
1330,
1635,
198,
6738,
4981,
13,
33692,
1330,
471,
23721,
62,
41374,
4792,
62,
10943,
2257,
8643,
11,
471,
23721,
62,
41374,
4792,
62,
10943,
2... | 2.65625 | 96 |
from .abstract import AbstractAuthProvider, AbstractUnauthenticatedEntity
from .utils import _context_processor
from flask import _request_ctx_stack, has_request_context
| [
6738,
764,
397,
8709,
1330,
27741,
30515,
29495,
11,
27741,
3118,
41299,
3474,
32398,
198,
6738,
764,
26791,
1330,
4808,
22866,
62,
41341,
198,
6738,
42903,
1330,
4808,
25927,
62,
49464,
62,
25558,
11,
468,
62,
25927,
62,
22866,
628
] | 4.275 | 40 |
from threading import Lock
import pytest
from elmo.api.decorators import require_lock, require_session
from elmo.api.exceptions import LockNotAcquired, PermissionDenied
def test_require_session_present():
"""Should succeed if a session ID is available."""
client = TestClient()
assert client.action() ==... | [
6738,
4704,
278,
1330,
13656,
198,
198,
11748,
12972,
9288,
198,
198,
6738,
1288,
5908,
13,
15042,
13,
12501,
273,
2024,
1330,
2421,
62,
5354,
11,
2421,
62,
29891,
198,
6738,
1288,
5908,
13,
15042,
13,
1069,
11755,
1330,
13656,
3673,
... | 3.071174 | 281 |
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
from net_utils.nn_distance import nn_distance
from net_utils.relation_tool import PositionalEmbedding
from models.registers import MODULES
from models.iscnet.modules.proposal_module import decode_scores
from configs.scannet_config... | [
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
2010,
62,
26791,
13,
20471,
62,
30246,
1330,
299,
77,
62,
30246,
198,
198... | 2.432624 | 282 |
from enum import Enum, auto
from typing import List, Union, Callable
from ipaddress import IPv4Address, IPv4Network, IPv6Address, IPv6Network, ip_network, ip_address
from warnings import warn
| [
6738,
33829,
1330,
2039,
388,
11,
8295,
198,
6738,
19720,
1330,
7343,
11,
4479,
11,
4889,
540,
198,
6738,
20966,
21975,
1330,
25961,
19,
20231,
11,
25961,
19,
26245,
11,
25961,
21,
20231,
11,
25961,
21,
26245,
11,
20966,
62,
27349,
11... | 3.75 | 52 |
from torch import nn
import torch.nn.functional as F
from locs.models.activations import ACTIVATIONS
| [
6738,
28034,
1330,
299,
77,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
198,
198,
6738,
1179,
82,
13,
27530,
13,
15791,
602,
1330,
11741,
3824,
18421,
628,
198
] | 3.466667 | 30 |
#! /usr/bin/env python
"""
Daniel Gorrie
Large dataset sampler
"""
import random
import os
from os import listdir
from os.path import isfile, join
# Constants
INPUT_FILE = 'train.features'
INPUT_FILE_SIZE = 8352136
OUTPUT_FILE = 'train_small.features'
SAMPLE_SIZE = 110000
INPUT_LABEL_DIR = 'labels/'
OUTPUT_LABEL_DIR... | [
2,
0,
1220,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
37811,
198,
19962,
19097,
5034,
198,
21968,
27039,
6072,
20053,
198,
37811,
198,
198,
11748,
4738,
198,
11748,
28686,
198,
6738,
28686,
1330,
1351,
15908,
198,
6738,
28686,
13,
69... | 2.597315 | 149 |
import re
import urllib.request
"""
Collection of handy functions related to uniprot. Potential reimplementations
of code that would be available in various packages with the goal of keeping
dependencies at a minimum.
"""
def valid_uniprot_ac_pattern(uniprot_ac):
"""
Checks whether Uniprot AC is formally cor... | [
11748,
302,
198,
11748,
2956,
297,
571,
13,
25927,
198,
198,
37811,
198,
36307,
286,
15728,
5499,
3519,
284,
555,
541,
10599,
13,
32480,
21123,
26908,
602,
198,
1659,
2438,
326,
561,
307,
1695,
287,
2972,
10392,
351,
262,
3061,
286,
5... | 2.363229 | 669 |
from typing import Dict, Union, Optional
from uuid import UUID
import requests
from requests.auth import HTTPBasicAuth
from yarl import URL
# A global list of adapters that are tied to nodes via the database.
registered_adapters: Dict[str, BaseAdapter] = {
'default': BaseAdapter(),
'team_1': Team1Adapter... | [
6738,
19720,
1330,
360,
713,
11,
4479,
11,
32233,
198,
6738,
334,
27112,
1330,
471,
27586,
198,
198,
11748,
7007,
198,
6738,
7007,
13,
18439,
1330,
14626,
26416,
30515,
198,
6738,
331,
7063,
1330,
10289,
628,
628,
628,
198,
2,
317,
32... | 3.163934 | 122 |
#!/usr/bin/env python
'''
Copyright (c) 2016, Allgeyer Tobias, Aumann Florian, Borella Jocelyn, Karrenbauer Oliver, Marek Felix, Meissner Pascal, Stroh Daniel, Trautmann Jeremias
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the follo... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
7061,
6,
198,
15269,
357,
66,
8,
1584,
11,
1439,
469,
9860,
46675,
11,
317,
40062,
4432,
666,
11,
45409,
8466,
5302,
344,
6213,
11,
9375,
918,
65,
16261,
15416,
11,
36989,
74,
... | 3.455259 | 637 |
from .auth import login_required
| [
6738,
764,
18439,
1330,
17594,
62,
35827,
198
] | 4.125 | 8 |
from geom2d import Segment, make_vector_between
from structures.model.bar import StrBar
from .node import StrNodeSolution
def has_node(self, node: StrNodeSolution):
"""
Tests whether the given `node` is one of this bar's end
nodes.
:param node: structure node
:return: is t... | [
6738,
4903,
296,
17,
67,
1330,
1001,
5154,
11,
787,
62,
31364,
62,
23395,
198,
6738,
8573,
13,
19849,
13,
5657,
1330,
4285,
10374,
198,
6738,
764,
17440,
1330,
4285,
19667,
46344,
628,
198,
220,
220,
220,
825,
468,
62,
17440,
7,
944... | 2.617414 | 379 |
import pytest
pytestmark = pytest.mark.forked
from unladenchant.resourcecheck import MetaMixinResourceChecker
## Testing pass and failure
def rescheckPassed():
return True
def rescheckFailed():
return False
def test_will_pass_if_res_okay():
## Testing multiple checks
| [
11748,
12972,
9288,
198,
9078,
9288,
4102,
796,
12972,
9288,
13,
4102,
13,
32523,
276,
198,
6738,
555,
35668,
8907,
13,
31092,
9122,
1330,
30277,
35608,
259,
26198,
9787,
263,
198,
198,
2235,
23983,
1208,
290,
5287,
198,
198,
4299,
581,... | 3.218391 | 87 |
import sys
input = lambda: sys.stdin.readline().rstrip()
n = int(input())
i = 666
c = 0
while True:
if str(i).find("666") != -1:
c += 1
if c == n:
print(i)
break
i += 1
| [
11748,
25064,
198,
198,
15414,
796,
37456,
25,
25064,
13,
19282,
259,
13,
961,
1370,
22446,
81,
36311,
3419,
198,
198,
77,
796,
493,
7,
15414,
28955,
198,
72,
796,
43364,
198,
66,
796,
657,
198,
4514,
6407,
25,
198,
220,
220,
220,
... | 1.871795 | 117 |
from peitho.errors_and_parsers.abc_sysbio.abcsysbio_parser.ODEPythonWriter import ODEPythonWriter
from peitho.errors_and_parsers.abc_sysbio.abcsysbio_parser.GillespiePythonWriter import GillespiePythonWriter
from peitho.errors_and_parsers.abc_sysbio.abcsysbio_parser.SDEPythonWriter import SDEPythonWriter
from peitho.er... | [
6738,
613,
342,
78,
13,
48277,
62,
392,
62,
79,
945,
364,
13,
39305,
62,
17597,
65,
952,
13,
397,
6359,
893,
65,
952,
62,
48610,
13,
3727,
8905,
7535,
34379,
1330,
440,
7206,
37906,
34379,
198,
6738,
613,
342,
78,
13,
48277,
62,
... | 2.095658 | 3,063 |
import unittest
import os
import sys
| [
11748,
555,
715,
395,
198,
11748,
28686,
198,
11748,
25064,
198
] | 3.363636 | 11 |
year= int(input("Give the value of year:"))
if((year%4==0 and year%100==0) or (Year%400==0)):
print("This is a leap year")
else:
print("This is not leap year")
| [
1941,
28,
493,
7,
15414,
7203,
23318,
262,
1988,
286,
614,
11097,
4008,
201,
198,
361,
19510,
1941,
4,
19,
855,
15,
290,
614,
4,
3064,
855,
15,
8,
393,
357,
17688,
4,
7029,
855,
15,
8,
2599,
201,
198,
220,
220,
220,
3601,
7203,
... | 2.471429 | 70 |
from __future__ import absolute_import
#-- IMPORT -- #
from ..utils.interfaces import Method | [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
198,
2,
438,
30023,
9863,
1377,
1303,
198,
6738,
11485,
26791,
13,
3849,
32186,
1330,
11789
] | 3.72 | 25 |
# stdlib modules
try:
from urllib.response import addinfourl
from urllib.error import HTTPError
from urllib.request import HTTPHandler
from io import StringIO
except ImportError:
from urllib2 import addinfourl, HTTPError, HTTPHandler
from StringIO import StringIO
| [
2,
14367,
8019,
13103,
198,
28311,
25,
198,
220,
220,
220,
422,
2956,
297,
571,
13,
26209,
1330,
751,
10745,
454,
75,
198,
220,
220,
220,
422,
2956,
297,
571,
13,
18224,
1330,
14626,
12331,
198,
220,
220,
220,
422,
2956,
297,
571,
... | 3.085106 | 94 |
'''Slickbird collection handler'''
import logging
import json
from tornado.web import URLSpec
import tornado.web
from slickbird import datparse
import slickbird.orm as orm
import slickbird
from slickbird.web import hbase
_log.logger = None
# Add handler: ########################################################... | [
7061,
6,
11122,
624,
16944,
4947,
21360,
7061,
6,
198,
198,
11748,
18931,
198,
11748,
33918,
198,
198,
6738,
33718,
13,
12384,
1330,
10289,
22882,
198,
11748,
33718,
13,
12384,
198,
198,
6738,
29395,
16944,
1330,
4818,
29572,
198,
11748,
... | 2.843077 | 325 |
import pydbus
bus = pydbus.SystemBus()
adapter = bus.get('org.bluez', '/org/bluez/hci0')
mngr = bus.get('org.bluez', '/')
if __name__ == '__main__':
connected = list_connected_devices()
for item in connected:
print(item['name']) | [
11748,
279,
5173,
10885,
198,
198,
10885,
796,
279,
5173,
10885,
13,
11964,
16286,
3419,
198,
198,
324,
3429,
796,
1323,
13,
1136,
10786,
2398,
13,
2436,
14870,
3256,
31051,
2398,
14,
2436,
14870,
14,
71,
979,
15,
11537,
198,
76,
782,... | 2.398058 | 103 |
# -*- coding: utf-8 -*-
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
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,
13... | 3.717314 | 283 |
import numpy as np
import PIL.ImageColor, PIL.ImageFont
from .rescale import rescale
def _rgb(x):
"""Convert 0-1 values to RGB 0-255 values.
"""
return rescale(x, to=[0, 255], scale=[0, 1])
def _color(color="black", alpha=1, mode="RGB"):
"""Sanitize color to RGB(A) format.
"""
if isinstance... | [
11748,
299,
32152,
355,
45941,
198,
11748,
350,
4146,
13,
5159,
10258,
11,
350,
4146,
13,
5159,
23252,
198,
198,
6738,
764,
411,
38765,
1330,
6811,
1000,
628,
198,
4299,
4808,
81,
22296,
7,
87,
2599,
198,
220,
220,
220,
37227,
3103,
... | 2.094595 | 3,182 |
import sys
import argparse
import fnmatch
import os
import re
import shutil
import glob
import logging
import multiprocessing
from copy_reg import pickle
from types import MethodType
_logger = logging.getLogger('default')
_logger.addHandler(logging.StreamHandler())
_logger.setLevel(logging.CRITICAL)
def main(arg... | [
11748,
25064,
198,
11748,
1822,
29572,
198,
11748,
24714,
15699,
198,
11748,
28686,
198,
11748,
302,
198,
11748,
4423,
346,
198,
11748,
15095,
198,
11748,
18931,
198,
11748,
18540,
305,
919,
278,
198,
6738,
4866,
62,
2301,
1330,
2298,
293... | 2.761488 | 457 |
from balldontlie import balldontlie, player, stats
from matplotlib import pyplot as plt
'''This function gets more information about the player by inputting
their name and dataset to search'''
if __name__ == "__main__":
main()
| [
6738,
3652,
335,
756,
14485,
1330,
3652,
335,
756,
14485,
11,
2137,
11,
9756,
198,
6738,
2603,
29487,
8019,
1330,
12972,
29487,
355,
458,
83,
198,
198,
7061,
6,
1212,
2163,
3011,
517,
1321,
546,
262,
2137,
416,
5128,
889,
220,
198,
... | 3.405797 | 69 |