content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
import enum
class InterestCalculationBase(enum.Enum):
"""IPCB :: Interest Calculation Base.
This is important for amortizing instruments. The basis of interest calculation is normally the notional outstanding amount as per SD. This is considered the fair basis and in many countries the only legal basis. If N... | [
11748,
33829,
628,
198,
4871,
12033,
9771,
14902,
14881,
7,
44709,
13,
4834,
388,
2599,
198,
220,
220,
220,
37227,
4061,
23199,
7904,
12033,
2199,
14902,
7308,
13,
628,
220,
220,
220,
770,
318,
1593,
329,
716,
419,
2890,
12834,
13,
38... | 3.869091 | 275 |
# -*- coding:utf-8 -*-
import random
if __name__ == '__main__':
main()
| [
2,
532,
9,
12,
19617,
25,
40477,
12,
23,
532,
9,
12,
198,
11748,
4738,
628,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
1388,
3419,
198
] | 2.222222 | 36 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.7 on 2018-01-31 07:53
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,
22,
319,
2864,
12,
486,
12,
3132,
8753,
25,
4310,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
... | 2.736842 | 57 |
"""
The mechanism for defining a neuron model which can be simulated in the SNS Toolbox
William Nourse
May 7, 2021
Execute Order 66
"""
"""
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
IMPORTS
"""
from typing import Dict, Any
import warnings
... | [
37811,
198,
464,
9030,
329,
16215,
257,
43164,
2746,
543,
460,
307,
28590,
287,
262,
311,
8035,
16984,
3524,
198,
17121,
399,
9047,
198,
6747,
767,
11,
33448,
198,
23002,
1133,
8284,
7930,
198,
37811,
198,
198,
37811,
198,
36917,
36917,... | 3.532995 | 197 |
"""$to open"""
import discord
from offthedialbot import utils
| [
37811,
3,
1462,
1280,
37811,
198,
11748,
36446,
198,
198,
6738,
572,
83,
704,
498,
13645,
1330,
3384,
4487,
628
] | 3.2 | 20 |
from entityfx.benchmark_base import BenchmarkBase
from entityfx.writer import Writer
import math | [
198,
6738,
9312,
21373,
13,
26968,
4102,
62,
8692,
1330,
25187,
4102,
14881,
198,
6738,
9312,
21373,
13,
16002,
1330,
26606,
198,
11748,
10688
] | 4.041667 | 24 |
from mega import MegaRequestListener, MegaNode
from WebSocketServer.megaRPI.utils import enviar_cliente
from WebSocketServer.DataBase.MegaSQLite import existe_descarga
| [
6738,
23465,
1330,
13421,
18453,
33252,
11,
13421,
19667,
198,
6738,
5313,
39105,
10697,
13,
13731,
49,
11901,
13,
26791,
1330,
551,
8903,
283,
62,
16366,
68,
198,
6738,
5313,
39105,
10697,
13,
6601,
14881,
13,
43471,
17861,
578,
1330,
... | 3.510204 | 49 |
from time import sleep
cont = [10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0]
#Contagem de fogos 10 - 0
print('\033[32mPREPARE-SE\033[m, contagem para fogos em:')
for c in list(cont): #tambem funcionaria range(10, -1, -1) Quando passo for -1 ele fica ao contrario
print(c)
sleep(1)
print('Acabou ;-;')
'''
Para esse ex... | [
6738,
640,
1330,
3993,
198,
198,
3642,
796,
685,
940,
11,
860,
11,
807,
11,
767,
11,
718,
11,
642,
11,
604,
11,
513,
11,
362,
11,
352,
11,
657,
60,
198,
198,
2,
4264,
363,
368,
390,
19558,
418,
838,
532,
657,
198,
4798,
10786,... | 2.481319 | 455 |
"""
Example data
"""
import os
import numpy as np
from dmt import AlphaComplex
DATA_FOLDER = os.path.join(os.path.dirname(__file__), "..", "data")
| [
37811,
198,
16281,
1366,
198,
37811,
198,
11748,
28686,
198,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
288,
16762,
1330,
12995,
5377,
11141,
628,
198,
26947,
62,
37,
3535,
14418,
796,
28686,
13,
6978,
13,
22179,
7,
418,
13,
... | 2.637931 | 58 |
#might make a tut on how to add commands
import discord
from discord.ext import commands
TOKEN = "TOKEN"
client = commands.AutoShardedBot(command_prefix="?")
#cogs loader
for filename in os.listdir('./cogs'):
if filename.endswith(".py") and not filename.startswith("_"):
bot.load_extension(f"cogs.... | [
2,
44092,
787,
257,
9732,
319,
703,
284,
751,
9729,
198,
11748,
36446,
198,
6738,
36446,
13,
2302,
1330,
9729,
198,
198,
10468,
43959,
796,
366,
10468,
43959,
1,
198,
198,
16366,
796,
9729,
13,
27722,
2484,
10676,
20630,
7,
21812,
62,... | 2.512821 | 156 |
"""empty message
Revision ID: df9cb30c76b1
Revises: be69f8262276
Create Date: 2021-04-08 17:08:40.504084
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'df9cb30c76b1'
down_revision = 'be69f8262276'
branch_labels = None
depends_on = None
| [
37811,
28920,
3275,
198,
198,
18009,
1166,
4522,
25,
47764,
24,
21101,
1270,
66,
4304,
65,
16,
198,
18009,
2696,
25,
307,
3388,
69,
23,
2075,
1828,
4304,
198,
16447,
7536,
25,
33448,
12,
3023,
12,
2919,
1596,
25,
2919,
25,
1821,
13,... | 2.471074 | 121 |
from django.urls import path
from wagtail.users.views import users
app_name = "wagtailusers_users"
urlpatterns = [
path("", users.index, name="index"),
path("add/", users.create, name="add"),
path("<str:user_id>/", users.edit, name="edit"),
path("<str:user_id>/delete/", users.delete, name="delete"),
]... | [
6738,
42625,
14208,
13,
6371,
82,
1330,
3108,
198,
198,
6738,
266,
363,
13199,
13,
18417,
13,
33571,
1330,
2985,
198,
198,
1324,
62,
3672,
796,
366,
86,
363,
13199,
18417,
62,
18417,
1,
198,
6371,
33279,
82,
796,
685,
198,
220,
220,... | 2.609756 | 123 |
"""Sans-I/O implementation of the Discord gateway.
Sans-I/O means that this implements no I/O (network) and operates purely on the
bytes given using `wsproto`.
It means that this implementation can be reused for libraries implemented in a
threading fashion or asyncio/trio/curio.
"""
from .conn import *
from .errors ... | [
37811,
50,
504,
12,
40,
14,
46,
7822,
286,
262,
39462,
24308,
13,
198,
198,
50,
504,
12,
40,
14,
46,
1724,
326,
428,
23986,
645,
314,
14,
46,
357,
27349,
8,
290,
14051,
14177,
319,
262,
198,
33661,
1813,
1262,
4600,
18504,
1676,
... | 3.581633 | 98 |
# Copyright 2018 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompa... | [
2,
15069,
2864,
6186,
13,
785,
11,
3457,
13,
393,
663,
29116,
13,
1439,
6923,
33876,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
11074,
921,
198,
2,
743,
407,
779,
428,
2393,
... | 3.082329 | 498 |
# coding: utf-8
# # 20 newsgroup text classification with BERT finetuning
#
# In this script, we'll use a pre-trained BERT
# (https://arxiv.org/abs/1810.04805) model for text classification
# using TensorFlow 2 / Keras and HuggingFace's Transformers
# (https://github.com/huggingface/transformers). This notebook is
# ... | [
198,
2,
19617,
25,
3384,
69,
12,
23,
198,
198,
2,
1303,
1160,
1705,
8094,
2420,
17923,
351,
347,
17395,
957,
316,
46493,
198,
2,
198,
2,
554,
428,
4226,
11,
356,
1183,
779,
257,
662,
12,
35311,
347,
17395,
198,
2,
357,
5450,
137... | 2.350469 | 3,521 |
# Copyright (c) 2019 CyPhyHouse. All Rights Reserved.
import typing as tp
from src.datatypes.robot import BotType
from src.motion.abstract.planner import Planner
class AgentConfig(object):
"""
agent configuration object
__pid : unique integer identifier of the agent
__rip : receiver ip
__rport :... | [
2,
15069,
357,
66,
8,
13130,
5934,
2725,
88,
18102,
13,
1439,
6923,
33876,
13,
198,
198,
11748,
19720,
355,
256,
79,
198,
198,
6738,
12351,
13,
19608,
265,
9497,
13,
305,
13645,
1330,
18579,
6030,
198,
6738,
12351,
13,
38714,
13,
39... | 2.181351 | 6,027 |
from leapp.models import ActiveKernelModulesFacts, ActiveKernelModule, KernelModuleParameter, WhitelistedKernelModules
from leapp.reporting import Report
from leapp.snactor.fixture import current_actor_context
def test_actor_without_missing_drivers(current_actor_context):
""" Tests CheckKernelDrivers actor by fee... | [
6738,
443,
1324,
13,
27530,
1330,
14199,
42,
7948,
5841,
5028,
37,
8656,
11,
14199,
42,
7948,
26796,
11,
32169,
26796,
36301,
11,
13183,
417,
6347,
42,
7948,
5841,
5028,
198,
6738,
443,
1324,
13,
49914,
1330,
6358,
198,
6738,
443,
132... | 3.222826 | 368 |
import dash_html_components as html
import dash_core_components as dcc
import filters
content = html.Div([
html.H2('Brands', className='text-5xl'),
filters.content,
])
| [
11748,
14470,
62,
6494,
62,
5589,
3906,
355,
27711,
198,
11748,
14470,
62,
7295,
62,
5589,
3906,
355,
288,
535,
198,
11748,
16628,
198,
198,
11299,
796,
27711,
13,
24095,
26933,
198,
220,
220,
220,
27711,
13,
39,
17,
10786,
9414,
1746... | 2.809524 | 63 |
import bz2
import random
import tempfile
import urllib.request
import boto3
| [
11748,
275,
89,
17,
198,
11748,
4738,
198,
11748,
20218,
7753,
198,
11748,
2956,
297,
571,
13,
25927,
198,
198,
11748,
275,
2069,
18,
628,
628
] | 3.076923 | 26 |
_(u'Price excludes tax')
_(u'Price includes tax')
_(u'Street / No')
_(u'Left')
_(u'Right')
_(u'Average Rating')
_(u'Zip Code')
_(u'Last Order Number')
_(u'Format')
_(u"Cart Price")
_(u"Combined Length and Girth")
| [
198,
198,
41052,
84,
6,
18124,
36833,
1687,
11537,
198,
41052,
84,
6,
18124,
3407,
1687,
11537,
198,
41052,
84,
6,
34356,
1220,
1400,
11537,
198,
41052,
84,
6,
18819,
11537,
198,
41052,
84,
6,
11028,
11537,
198,
41052,
84,
6,
26287,
... | 2.559524 | 84 |
from .. import Model, Component, DualBoundaries, CircularBoundaries
class Lux(Model):
'''
LUX : The lexicon of uncertain color standards model
-----------------------------------------------------
lux.predict(datum) s.t. datum is (h,s,v),
h scaled to (... | [
6738,
11485,
1330,
9104,
11,
35100,
11,
20446,
49646,
3166,
11,
7672,
934,
49646,
3166,
628,
198,
4871,
17145,
7,
17633,
2599,
198,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
220,
220,
220,
220,
406,
31235,
1058,
383,
31191,
4749,
... | 1.982818 | 291 |
import os
import re
import yaml
from yaml.loader import Reader, Scanner, Parser, Composer, SafeConstructor, Resolver
from glob import glob
from urllib.request import urlopen
from selectolax.parser import HTMLParser
# import for pdf to text
import io
from pdfminer.pdfinterp import PDFResourceManager, PDFPageInterpreter
... | [
11748,
28686,
198,
11748,
302,
198,
11748,
331,
43695,
198,
6738,
331,
43695,
13,
29356,
1330,
25342,
11,
20937,
1008,
11,
23042,
263,
11,
29936,
263,
11,
19978,
42316,
273,
11,
1874,
14375,
198,
6738,
15095,
1330,
15095,
198,
6738,
295... | 3.225664 | 226 |
from __future__ import absolute_import
from numpy import clip, dot, finfo, inf, sqrt
from numpy.linalg import eigh
from numpy.random import RandomState
| [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
198,
6738,
299,
32152,
1330,
10651,
11,
16605,
11,
957,
6513,
11,
1167,
11,
19862,
17034,
198,
6738,
299,
32152,
13,
75,
1292,
70,
1330,
304,
394,
198,
6738,
299,
32152,
13,
25120,
... | 3.347826 | 46 |
import numpy as np
import cv2
import time
import argparse
###############################################################################
##This script takes several pictures and regroup them into a mp4 video format##
parser = argparse.ArgumentParser(description='Writing a Video from frames')
parser.add_argument('--d... | [
11748,
299,
32152,
355,
45941,
198,
11748,
269,
85,
17,
198,
11748,
640,
198,
11748,
1822,
29572,
198,
198,
29113,
29113,
7804,
4242,
21017,
198,
2235,
1212,
4226,
2753,
1811,
5986,
290,
842,
3233,
606,
656,
257,
29034,
19,
2008,
5794,
... | 2.63125 | 480 |
"""constants.py - Various constants used for communicating with NEC large-screen displays.
Revision: 180220
"""
#
#
# Copyright (C) 2016-18 NEC Display Solutions, Ltd
# written by Will Hollingworth <whollingworth at necdisplay.com>
# See LICENSE.rst for details.
#
# timeout in seconds for establishing a TCP connection... | [
37811,
9979,
1187,
13,
9078,
532,
26386,
38491,
973,
329,
22889,
351,
41804,
1588,
12,
9612,
11298,
13,
198,
18009,
1166,
25,
1248,
2999,
1238,
198,
37811,
198,
2,
198,
2,
198,
2,
15069,
357,
34,
8,
1584,
12,
1507,
41804,
16531,
235... | 1.947242 | 9,610 |
#!/usr/bin/python
# -*- encoding: utf-8 -*-
# part of https://github.com/WolfgangFahl/play-chess-with-a-webcam
from kivy.app import App
from kivy.uix.label import Label
from kivy.core.window import Window
from kivy.uix.gridlayout import GridLayout
if __name__ == '__main__':
MousePos().run()
| [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
532,
9,
12,
21004,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
636,
286,
3740,
1378,
12567,
13,
785,
14,
32069,
28284,
37,
15668,
14,
1759,
12,
2395,
824,
12,
4480,
12,
64,
12,
12384... | 2.586207 | 116 |
#!/usr/bin/env python3
import os
import sys
model_list = os.scandir()
model_list = sorted(f.name for f in model_list if f.is_dir())
num_failures = 0
for benchmark_model in model_list:
ret = os.system("cd {} && petablint -v -n {} ".format(benchmark_model,benchmark_model))
print('='*100) # just for output re... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
11748,
28686,
198,
11748,
25064,
198,
198,
19849,
62,
4868,
796,
28686,
13,
1416,
392,
343,
3419,
198,
19849,
62,
4868,
796,
23243,
7,
69,
13,
3672,
220,
329,
277,
287,
2746... | 2.611607 | 224 |
from DIE.Lib import DieConfig
import idaapi
import os
import DIE.Lib.DieConfig
#from PySide import QtGui
from PyQt5 import QtGui, QtWidgets
class DieIcons():
"""
DIE Icons
"""
##########################################################################
# Icons Filenames
__FUNC_... | [
6738,
360,
10008,
13,
25835,
1330,
6733,
16934,
201,
198,
11748,
220,
3755,
15042,
201,
198,
11748,
28686,
201,
198,
11748,
360,
10008,
13,
25835,
13,
32423,
16934,
201,
198,
201,
198,
2,
6738,
9485,
24819,
1330,
33734,
8205,
72,
201,
... | 1.991556 | 2,250 |
import magma as m
from magma.testing import check_files_equal
| [
11748,
2153,
2611,
355,
285,
198,
6738,
2153,
2611,
13,
33407,
1330,
2198,
62,
16624,
62,
40496,
628,
198
] | 3.368421 | 19 |
import logging
import time
from selenium.webdriver import ActionChains
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import WebDriverWait
from selenium.common.exceptions import StaleElementReferenceException
from basepageobject import B... | [
11748,
18931,
198,
11748,
640,
198,
198,
6738,
384,
11925,
1505,
13,
12384,
26230,
1330,
7561,
1925,
1299,
198,
6738,
384,
11925,
1505,
13,
12384,
26230,
13,
11321,
13,
1525,
1330,
2750,
198,
6738,
384,
11925,
1505,
13,
12384,
26230,
13... | 2.267745 | 2,719 |
import io
import os
import pytest
import json
from ansible_runner import run
from ansible_runner.streaming import Transmitter, Worker, Processor
@pytest.mark.parametrize("job_type", ['run', 'adhoc'])
| [
11748,
33245,
198,
11748,
28686,
198,
198,
11748,
12972,
9288,
198,
11748,
33918,
198,
198,
6738,
9093,
856,
62,
16737,
1330,
1057,
198,
6738,
9093,
856,
62,
16737,
13,
5532,
278,
1330,
3602,
37974,
11,
35412,
11,
32893,
628,
198,
31,
... | 3.169231 | 65 |
print('\033[32;1mDESAFIO 29 - Radar Electrônico\033[m')
print('\033[32;1mALUNO:\033[m \033[36;1mJoaquim Fernandes\033[m')
vel = float(input('Qual é a Velocidade atual do Veiculo? '))
if vel > 80:
print(f'\033[31;1mMULTADO! Você excedeu o limite permitido que é de 80Km/h\033[m')
multa = (vel - 80) * 7
print(... | [
4798,
10786,
59,
44427,
58,
2624,
26,
16,
76,
30910,
8579,
9399,
2808,
532,
38426,
5903,
81,
27083,
77,
3713,
59,
44427,
58,
76,
11537,
198,
4798,
10786,
59,
44427,
58,
2624,
26,
16,
76,
1847,
4944,
46,
7479,
44427,
58,
76,
3467,
... | 2.133663 | 202 |
from django.contrib import admin
from sigmund.models import LogEntry
admin.site.register(LogEntry)
| [
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
6738,
264,
17225,
917,
13,
27530,
1330,
5972,
30150,
198,
198,
28482,
13,
15654,
13,
30238,
7,
11187,
30150,
8,
198
] | 3.333333 | 30 |
from rest_framework import generics, filters
from rest_framework.views import APIView
from core.models import Imovel, Imobiliaria
from core.api.serializers import ImovelSerializer, ImobiliariaSerializer
from django.http import JsonResponse, HttpResponse
"""
Foi utilizado uma abstração de alto nivel
do Django ... | [
6738,
1334,
62,
30604,
1330,
1152,
873,
11,
16628,
198,
6738,
1334,
62,
30604,
13,
33571,
1330,
3486,
3824,
769,
198,
198,
6738,
4755,
13,
27530,
1330,
1846,
78,
626,
11,
1846,
672,
4797,
544,
198,
6738,
4755,
13,
15042,
13,
46911,
... | 3.037671 | 292 |
"""How to di-compile pickle file"""
import pickle
file = "Student_list.pkl"
fileobj = open(file,'rb')
stud = pickle.load(fileobj)
print(stud)
| [
37811,
2437,
284,
2566,
12,
5589,
576,
2298,
293,
2393,
37811,
198,
11748,
2298,
293,
198,
7753,
796,
366,
38778,
62,
4868,
13,
79,
41582,
1,
198,
7753,
26801,
796,
1280,
7,
7753,
4032,
26145,
11537,
198,
19149,
796,
2298,
293,
13,
... | 2.679245 | 53 |
import unittest
import mock
from mopidy import backend, core
from mopidy.models import Image, Ref, SearchResult, Track
# TODO: split by method
@mock.patch("mopidy.core.library.logger")
@mock.patch("mopidy.core.library.logger")
@mock.patch("mopidy.core.library.logger")
@mock.patch("mopidy.core.library.log... | [
11748,
555,
715,
395,
198,
198,
11748,
15290,
198,
198,
6738,
285,
404,
19325,
1330,
30203,
11,
4755,
198,
6738,
285,
404,
19325,
13,
27530,
1330,
7412,
11,
6524,
11,
11140,
23004,
11,
17762,
628,
198,
198,
2,
16926,
46,
25,
6626,
4... | 2.688312 | 154 |
# Given a string s consisting of small English letters, find and return the first instance of a non-repeating character in it. If there is no such character, return '_'.
# Example
# For s = "abacabad", the output should be
# firstNotRepeatingCharacter(s) = 'c'.
# There are 2 non-repeating characters in the string: '... | [
2,
11259,
257,
4731,
264,
17747,
286,
1402,
3594,
7475,
11,
1064,
290,
1441,
262,
717,
4554,
286,
257,
1729,
12,
45956,
803,
2095,
287,
340,
13,
1002,
612,
318,
645,
884,
2095,
11,
1441,
705,
62,
4458,
198,
198,
2,
17934,
198,
198... | 3.391837 | 245 |
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# Program Purpose: Move the servomotor
# Author: Sam Hoh
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# ------------------------------------------#
# Imports #
# ------------------------------------------#
from mi... | [
2,
27156,
27156,
27156,
8728,
4907,
93,
2,
198,
2,
6118,
32039,
25,
10028,
262,
1113,
296,
20965,
198,
2,
6434,
25,
3409,
367,
1219,
198,
2,
27156,
27156,
27156,
8728,
4907,
93,
2,
198,
198,
2,
20368,
35937,
2,
198,
2,
1846,
3742,... | 3.29589 | 365 |
## Team Members
* Etesam Ansari, ea2905, System Architect
* Nicholas Cheng , njd2135, Language Guru
* Edward Sturt, ecs2220, System Architect
* Elysia Witham, ew2632, Manager and Tester
* Andrey Uspenskiy, avu2106, Language Guru
* Jacob Alexander, jla2206, Tester
# Comma
Welcome to Comma, a programmer-friendly langu... | [
2235,
4816,
12688,
198,
9,
412,
4879,
321,
28038,
2743,
11,
304,
64,
1959,
2713,
11,
4482,
17340,
198,
9,
20320,
27692,
837,
299,
73,
67,
17,
17059,
11,
15417,
38749,
198,
9,
10443,
520,
3325,
11,
304,
6359,
1828,
1238,
11,
4482,
... | 3.375034 | 3,637 |
import subprocess
import sys
import os
import time
import PureCloudPlatformClientV2
SCRIPT_PATH = sys.path[0]
CLIENT_ID = os.environ["GENESYSCLOUD_OAUTHCLIENT_ID"]
CLIENT_SECRET = os.environ["GENESYSCLOUD_OAUTHCLIENT_SECRET"]
CLIENT_REGION = os.environ["GENESYSCLOUD_REGION"]
CLIENT_REGION = os.environ["GENESYSCLOUD_AR... | [
11748,
850,
14681,
198,
11748,
25064,
198,
11748,
28686,
198,
11748,
640,
198,
11748,
17129,
18839,
37148,
11792,
53,
17,
198,
198,
6173,
46023,
62,
34219,
796,
25064,
13,
6978,
58,
15,
60,
198,
5097,
28495,
62,
2389,
796,
28686,
13,
... | 2.584699 | 366 |
import logging
import datetime as dt
from O365.message import Message
from O365.utils import Pagination, NEXT_LINK_KEYWORD, WellKnowFolderNames, ApiComponent
log = logging.getLogger(__name__)
class Folder(ApiComponent):
""" A Mail Folder representation """
_endpoints = {
'root_folders': '/mailFolde... | [
11748,
18931,
198,
11748,
4818,
8079,
355,
288,
83,
198,
198,
6738,
440,
24760,
13,
20500,
1330,
16000,
198,
6738,
440,
24760,
13,
26791,
1330,
31525,
1883,
11,
39726,
62,
43,
17248,
62,
20373,
54,
12532,
11,
3894,
23812,
41092,
36690,
... | 2.354372 | 5,878 |
"""
initialise the package and generate a dataloader class using args as
the input
"""
from __future__ import print_function, division
import os
import torch
from skimage import io, transform
import numpy as np
import matplotlib.pyplot as plt
from torch.utils.data import Dataset, DataLoader
from torchvision impo... | [
37811,
198,
36733,
786,
262,
5301,
290,
7716,
257,
4818,
282,
1170,
263,
1398,
1262,
26498,
355,
220,
198,
1169,
5128,
198,
37811,
628,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
11,
7297,
198,
11748,
28686,
198,
11748,
28034,
... | 3.276471 | 170 |
# Copyright 2019 The Glow Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | [
2,
15069,
13130,
383,
45929,
46665,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198,
2,
921,
74... | 3.68 | 250 |
# Initialize output before importing any module, that can use colorama.
from .system import init_output
init_output()
from pprint import pformat # noqa: E402
import sys # noqa: E402
from . import logs, types # noqa: E402
from .shells import shell # noqa: E402
from .conf import settings # noqa: E402
from .correct... | [
2,
20768,
1096,
5072,
878,
33332,
597,
8265,
11,
326,
460,
779,
3124,
1689,
13,
198,
6738,
764,
10057,
1330,
2315,
62,
22915,
198,
198,
15003,
62,
22915,
3419,
198,
198,
6738,
279,
4798,
1330,
279,
18982,
220,
1303,
645,
20402,
25,
... | 2.631783 | 516 |
'''
Copyright 2022 Airbus SAS
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
dis... | [
7061,
6,
198,
15269,
33160,
39173,
35516,
198,
198,
26656,
15385,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
5832,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198,
1639,
743... | 3.085393 | 445 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
if __name__ == "__main__":
print(sum_all([1, 4]))
print(sum_all([4, 1]))
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
3601,
7,
16345,
62,
439,
26933,
16,... | 1.969231 | 65 |
import networkx as nx
GRAPH_LIST = [
'../Datasets/Processed/POLARIZED/baltimore/baltimore-PROCESSED.txt',
'../Datasets/Processed/POLARIZED/beefban/beefban-PROCESSED.txt',
'../Datasets/Processed/POLARIZED/gunsense/gunsense-PROCESSED.txt',
'../Datasets/Processed/POLARIZED/indiana/indiana-PROCESSED.txt',
... | [
11748,
3127,
87,
355,
299,
87,
198,
198,
10761,
31300,
62,
45849,
796,
685,
198,
220,
220,
220,
705,
40720,
27354,
292,
1039,
14,
18709,
276,
14,
45472,
1503,
14887,
1961,
14,
65,
2501,
9401,
14,
65,
2501,
9401,
12,
4805,
4503,
7597... | 2.297638 | 1,270 |
"""
Module for cars.
"""
class Car:
"""
Class representing a racing car.
Defaults values are set with respect to a modern Formula 1 car.
"""
def __init__(self, max_velocity=100.0, max_acceleration=15.5, friction=1.6, mass=740.0, drag_coefficient=1.0,
frontal_area=1.5, base_engine... | [
37811,
198,
26796,
329,
5006,
13,
198,
37811,
628,
198,
4871,
1879,
25,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
5016,
10200,
257,
11717,
1097,
13,
198,
220,
220,
220,
2896,
13185,
3815,
389,
900,
351,
2461,
284,
257,
3660,
19... | 2.365342 | 1,812 |
import uasyncio as asyncio
from hashlib import sha1
from binascii import b2a_base64
import struct
| [
11748,
334,
292,
13361,
952,
355,
30351,
952,
198,
6738,
12234,
8019,
1330,
427,
64,
16,
198,
6738,
9874,
292,
979,
72,
1330,
275,
17,
64,
62,
8692,
2414,
198,
11748,
2878,
628,
628
] | 2.970588 | 34 |
from .utils import MicrodropUtils as utils
| [
6738,
764,
26791,
1330,
4527,
14781,
18274,
4487,
355,
3384,
4487,
628
] | 3.666667 | 12 |
import socket
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
print('Socket created succesfully.\n')
port = 8080
IP = '192.168.0.160'
s.connect((IP, port))
cond = True
while cond:
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
print('Socket created successfully.\n')
s.connect((IP, port))
... | [
11748,
17802,
198,
198,
82,
796,
17802,
13,
44971,
7,
44971,
13,
8579,
62,
1268,
2767,
11,
17802,
13,
50,
11290,
62,
2257,
32235,
8,
198,
198,
4798,
10786,
39105,
2727,
17458,
274,
2759,
13,
59,
77,
11537,
198,
198,
634,
796,
4019,
... | 2.425339 | 221 |
from . import FlowVector
| [
6738,
764,
1330,
27782,
38469,
628
] | 4.333333 | 6 |
#!/usr/bin/env python3
# [1] https://doi.org/10.1063/1.1515483 optimization review
# [2] https://doi.org/10.1063/1.471864 delocalized internal coordinates
# [3] https://doi.org/10.1016/0009-2614(95)00646-L lindh model hessian
# [4] 10.1002/(SICI)1096-987X(19990730)20:10<1067::AID-JCC9>3.0.CO;2-V
# Handling of corn... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
2,
685,
16,
60,
3740,
1378,
34023,
13,
2398,
14,
940,
13,
940,
5066,
14,
16,
13,
1314,
1314,
38783,
23989,
2423,
198,
2,
685,
17,
60,
3740,
1378,
34023,
13,
2398,
14,
94... | 2.40293 | 546 |
from typing import List, Optional, Tuple, Union
from datetime import date, datetime, timedelta
from flask import current_app
import pandas as pd
from pandas.tseries.frequencies import to_offset
import numpy as np
import timely_beliefs as tb
from flexmeasures.data.models.time_series import Sensor, TimedBelief
from fle... | [
6738,
19720,
1330,
7343,
11,
32233,
11,
309,
29291,
11,
4479,
198,
6738,
4818,
8079,
1330,
3128,
11,
4818,
8079,
11,
28805,
12514,
198,
198,
6738,
42903,
1330,
1459,
62,
1324,
198,
11748,
19798,
292,
355,
279,
67,
198,
6738,
19798,
29... | 2.63466 | 2,562 |
import os
import sys
import time
import tqdm
import json
import torch
import logging
import argparse
import traceback
import numpy as np
from tqdm import tqdm
sys.path.append("..")
import config
import utils
from utils import pred_arranger, pred_saver
from bertkpe import tokenizer_class, Idx2Tag, Tag2Idx, Decode_Ca... | [
11748,
28686,
198,
11748,
25064,
198,
11748,
640,
198,
11748,
256,
80,
36020,
198,
11748,
33918,
198,
11748,
28034,
198,
198,
11748,
18931,
198,
11748,
1822,
29572,
198,
11748,
12854,
1891,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
2... | 2.755911 | 2,876 |
# -*- coding: utf-8 -*-
#BEGIN_HEADER
import logging
import os
import uuid
import zipfile
import copy
from subprocess import Popen, PIPE
#import CompoundSetUtils.compound_parsing as parse
#import CompoundSetUtils.zinc_db_util as zinc_db_util
from installed_clients.DataFileUtilClient import DataFileUtil
from installed_... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
33,
43312,
62,
37682,
1137,
198,
11748,
18931,
198,
11748,
28686,
198,
11748,
334,
27112,
198,
11748,
19974,
7753,
198,
11748,
4866,
198,
6738,
850,
14681,
1330,
8099,
... | 2.161133 | 7,981 |
import os
from agents.agent import Agent
from pathlib import Path
| [
11748,
28686,
198,
6738,
6554,
13,
25781,
1330,
15906,
198,
6738,
3108,
8019,
1330,
10644,
628
] | 4.1875 | 16 |
import serial
import time
import RPi.GPIO as GPIO
'''
SigFox
'''
| [
11748,
11389,
198,
11748,
640,
198,
11748,
25812,
72,
13,
16960,
9399,
355,
50143,
198,
198,
7061,
6,
198,
50,
328,
19399,
198,
7061,
6,
198
] | 2.538462 | 26 |
import numpy as np
import logging
import offsetbasedgraph as obg
from pyvg.conversion import vg_json_file_to_interval_collection
from . import CallPeaks
from .sparsepvalues import PToQValuesMapper
from .sparsediffs import SparseValues
from .intervals import Intervals, UniqueIntervals
from .peakfasta import PeakFasta
f... | [
11748,
299,
32152,
355,
45941,
198,
11748,
18931,
198,
11748,
11677,
3106,
34960,
355,
909,
70,
198,
6738,
12972,
45119,
13,
1102,
9641,
1330,
410,
70,
62,
17752,
62,
7753,
62,
1462,
62,
3849,
2100,
62,
43681,
198,
6738,
764,
1330,
48... | 3.52381 | 105 |
from django.db import models
# Create your models here.
class ExternalSite(models.Model):
'''The model for links to external websites, such as social media.'''
name = models.TextField(max_length=50, blank=False, null=False,
help_text="The name that the link will appear as.")
i... | [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
198,
2,
13610,
534,
4981,
994,
13,
198,
198,
4871,
34579,
29123,
7,
27530,
13,
17633,
2599,
198,
220,
220,
220,
705,
7061,
464,
2746,
329,
6117,
284,
7097,
9293,
11,
884,
355,
1919,
205... | 2.395973 | 447 |
# -*- coding: utf8 -*-
__author__ = "Hoseong Son <me@sookcha.com>"
import datetime
import os
import xml.etree.ElementTree as ElementTree
from dateutil import parser
from icalendar import Calendar, Event
import requests
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
23,
532,
9,
12,
198,
834,
9800,
834,
796,
366,
39,
577,
506,
6295,
1279,
1326,
31,
82,
566,
11693,
13,
785,
24618,
198,
198,
11748,
4818,
8079,
198,
11748,
28686,
198,
11748,
35555,
13,
316,
6... | 3.157143 | 70 |
# coding:UTF-8
from django.shortcuts import render
from django.http import JsonResponse
from bgadmin.models import TestUser
from common.utils.utils_log import log
import uuid
import os
from django.conf import settings
from django.db import transaction
from common.utils.utils_import_excel import import_excel_util
from c... | [
2,
19617,
25,
48504,
12,
23,
198,
6738,
42625,
14208,
13,
19509,
23779,
1330,
8543,
198,
6738,
42625,
14208,
13,
4023,
1330,
449,
1559,
31077,
198,
6738,
275,
70,
28482,
13,
27530,
1330,
6208,
12982,
198,
6738,
2219,
13,
26791,
13,
26... | 1.670302 | 2,751 |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import unittest
import errno
from poke import process_vm_readv_wrapper
| [
2,
15069,
357,
66,
8,
3203,
11,
3457,
13,
290,
663,
29116,
13,
198,
2,
198,
2,
770,
2723,
2438,
318,
11971,
739,
262,
17168,
5964,
1043,
287,
262,
198,
2,
38559,
24290,
2393,
287,
262,
6808,
8619,
286,
428,
2723,
5509,
13,
198,
... | 3.746269 | 67 |
import pytest
from django.contrib.auth.models import AnonymousUser
from django.contrib.messages import get_messages
from django.contrib.messages.middleware import MessageMiddleware
from django.contrib.sessions.middleware import SessionMiddleware
from django.urls import reverse
from pytest_django.asserts import assertCo... | [
11748,
12972,
9288,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
27530,
1330,
19200,
12982,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
37348,
1095,
1330,
651,
62,
37348,
1095,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
37348... | 3.507463 | 134 |
# Generated by Django 3.2.3 on 2021-08-14 13:15
import api.validators
from django.db import migrations, models
import django.db.models.deletion
| [
2,
2980,
515,
416,
37770,
513,
13,
17,
13,
18,
319,
33448,
12,
2919,
12,
1415,
1511,
25,
1314,
198,
198,
11748,
40391,
13,
12102,
2024,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
198,
11748,
42625,
14208,
13,
994... | 2.92 | 50 |
# Generated by Django 2.2.1 on 2019-05-31 05:39
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
362,
13,
17,
13,
16,
319,
13130,
12,
2713,
12,
3132,
8870,
25,
2670,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
# Copyright (c) Microsoft Corporation and Fairlearn contributors.
# Licensed under the MIT License.
import sklearn.metrics as skm
from sklearn import preprocessing
from ._extra_metrics import (_balanced_root_mean_squared_error,
_mean_overprediction,
_mean_unde... | [
2,
15069,
357,
66,
8,
5413,
10501,
290,
7011,
35720,
20420,
13,
198,
2,
49962,
739,
262,
17168,
13789,
13,
198,
198,
11748,
1341,
35720,
13,
4164,
10466,
355,
1341,
76,
198,
6738,
1341,
35720,
1330,
662,
36948,
198,
198,
6738,
47540,
... | 2.245502 | 3,279 |
from torchvision.transforms import ToTensor, Normalize, Compose, ColorJitter
from torchvision.utils import save_image
import argparse
import torch
from PIL import Image
from models.sketch_generator import SketchGenerator
import os.path
labeltoID = {'airplane': 0,
'alarm clock': 1,
'ant': 2,
... | [
6738,
28034,
10178,
13,
7645,
23914,
1330,
1675,
51,
22854,
11,
14435,
1096,
11,
3082,
577,
11,
5315,
41,
1967,
198,
6738,
28034,
10178,
13,
26791,
1330,
3613,
62,
9060,
198,
11748,
1822,
29572,
198,
11748,
28034,
198,
6738,
350,
4146,
... | 1.724007 | 2,895 |
# Copyright 2017 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompa... | [
2,
15069,
2177,
6186,
13,
785,
11,
3457,
13,
393,
663,
29116,
13,
1439,
6923,
33876,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
11074,
921,
198,
2,
743,
407,
779,
428,
2393,
... | 3.710983 | 173 |
from __future__ import print_function
import json
from redshift_connection import RedshiftConnection
def underscore_to_camelcase(text):
'''
Converts underscore_delimited_text to camelCase.
Useful for JSON output
'''
return ''.join(word.title() if i else word for i, word in enumerate(text.split('_')... | [
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
11748,
33918,
198,
6738,
2266,
30846,
62,
38659,
1330,
2297,
30846,
32048,
198,
198,
4299,
44810,
62,
1462,
62,
66,
17983,
7442,
7,
5239,
2599,
198,
220,
220,
220,
705,
7061,
198,
22... | 3.105769 | 104 |
from django.test import TestCase
from django.urls import reverse
| [
6738,
42625,
14208,
13,
9288,
1330,
6208,
20448,
198,
6738,
42625,
14208,
13,
6371,
82,
1330,
9575,
628
] | 3.666667 | 18 |
""" https://en.wikipedia.org/wiki/Dutch_national_flag_problem
Given an array nums
with n objects colored red, white, or blue, sort them in-place so that
objects of the same color are adjacent, with the colors in the order red,
white, and blue. Here, we will use the integers 0, 1, and 2 to represent t... | [
37811,
220,
220,
3740,
1378,
268,
13,
31266,
13,
2398,
14,
15466,
14,
49717,
62,
14648,
62,
32109,
62,
45573,
220,
198,
220,
220,
220,
198,
220,
220,
11259,
281,
7177,
997,
82,
198,
220,
220,
351,
299,
5563,
16396,
2266,
11,
2330,
... | 2.929329 | 283 |
d = {}
for _ in range(int(input())):
name = input()
score = float(input())
d[name] = score
v = d.values()
v = list(set(v))
v.sort()
k = []
lastsec = v[1]
for key, value in d.items():
if value == lastsec:
k.append(key)
k.sort()
for i in range(len(k)):
print(k[i])
| [
67,
796,
23884,
198,
1640,
4808,
287,
2837,
7,
600,
7,
15414,
28955,
2599,
198,
220,
220,
220,
1438,
796,
5128,
3419,
198,
220,
220,
220,
4776,
796,
12178,
7,
15414,
28955,
198,
220,
220,
220,
288,
58,
3672,
60,
796,
4776,
198,
19... | 2.054422 | 147 |
#!/usr/bin/env python
import sys
import shutil
from dakota.interfacing import parallel, read_parameters_file
## Use the dakota.interfacing.parallel module to run text_book_par in
# parallel
params_file=sys.argv[1]
results_file=sys.argv[2]
## Pre-processing
shutil.copy(params_file, "application.in")
## Run
# Constr... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
11748,
25064,
198,
11748,
4423,
346,
198,
6738,
288,
461,
4265,
13,
3849,
29532,
1330,
10730,
11,
1100,
62,
17143,
7307,
62,
7753,
198,
198,
2235,
5765,
262,
288,
461,
4265,
13,
3849,
... | 2.908046 | 435 |
# -*- coding: utf-8 -*-
import mock
from twisted.python.failure import Failure
from twisted.trial.unittest import TestCase
from twisted.web.http_headers import Headers
from twisted.web.client import ResponseDone, ResponseFailed
from twisted.web.http import PotentialDataLoss
from treq import collect, content, json_co... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
15290,
198,
198,
6738,
19074,
13,
29412,
13,
32165,
495,
1330,
25743,
198,
198,
6738,
19074,
13,
45994,
13,
403,
715,
395,
1330,
6208,
20448,
198,
6738,
19074,
13... | 3.579439 | 107 |
import unittest
import pytest
from bs4 import BeautifulSoup
from omniglot.haw.mamaka import HawaiianPOS, MamakaEntry, parse_entry
| [
11748,
555,
715,
395,
198,
198,
11748,
12972,
9288,
198,
6738,
275,
82,
19,
1330,
23762,
50,
10486,
198,
198,
6738,
22284,
328,
26487,
13,
26615,
13,
76,
321,
8130,
1330,
29827,
37997,
11,
29926,
8130,
30150,
11,
21136,
62,
13000,
628... | 3.166667 | 42 |
from openchat.base.agents.base import BaseAgent
__all__ = [BaseAgent]
| [
6738,
1280,
17006,
13,
8692,
13,
49638,
13,
8692,
1330,
7308,
36772,
198,
198,
834,
439,
834,
796,
685,
14881,
36772,
60,
198
] | 3.086957 | 23 |
from unicodedata import name
from django.urls import path
from purchases import views
from purchases.models import Manufacturer, Product
home_list_view = views.HomeListView.as_view(
queryset=Manufacturer.objects.order_by()[:5],
context_object_name="manufacturer_list",
template_name="purchases/home.html"
)
... | [
6738,
28000,
9043,
1045,
1330,
1438,
198,
6738,
42625,
14208,
13,
6371,
82,
1330,
3108,
198,
6738,
13339,
1330,
5009,
198,
6738,
13339,
13,
27530,
1330,
40218,
11,
8721,
198,
198,
11195,
62,
4868,
62,
1177,
796,
5009,
13,
16060,
8053,
... | 2.727848 | 316 |
#!/usr/bin/env python
# coding: utf8
#
# Copyright (c) 2020 Centre National d'Etudes Spatiales (CNES).
#
# This file is part of PANDORA
#
# https://github.com/CNES/Pandora
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
19617,
25,
3384,
69,
23,
198,
2,
198,
2,
15069,
357,
66,
8,
12131,
9072,
2351,
288,
6,
36,
83,
8401,
1338,
34961,
274,
357,
34,
37379,
737,
198,
2,
198,
2,
770,
2393,
318,
6... | 2.134941 | 8,789 |
# A simple bruteforce tool to crack UNIX passwords using wordlists
# calfcrusher@inventati.org
# Usage: ./ShadowBrute.py HASHFILE WORDLIST
# insert many hash as you want in HASHFILE once one per line, same in wordlist file
import crypt
import sys
import time
import pyfiglet
def crackpass(list, hashstring, salted):
... | [
2,
317,
2829,
8938,
891,
8387,
2891,
284,
8469,
4725,
10426,
21442,
1262,
1573,
20713,
198,
2,
31134,
6098,
34055,
31,
259,
1151,
7246,
13,
2398,
198,
2,
29566,
25,
24457,
27447,
9414,
1133,
13,
9078,
367,
11211,
25664,
370,
12532,
45... | 2.154418 | 1,211 |
# -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2019.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modif... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
770,
2438,
318,
636,
286,
1195,
1984,
270,
13,
198,
2,
198,
2,
357,
34,
8,
15069,
19764,
13130,
13,
198,
2,
198,
2,
770,
2438,
318,
11971,
739,
262,
24843,... | 2.969487 | 721 |
import asyncio
import logging
from timeit import default_timer as timer
from typing import List, Optional, Set
from lighthive.client import Client
from podping_hivewriter.async_wrapper import sync_to_async
def get_allowed_accounts(
client: Client = None, account_name: str = "podping"
) -> Set[str]:
"""get ... | [
11748,
30351,
952,
198,
11748,
18931,
198,
6738,
640,
270,
1330,
4277,
62,
45016,
355,
19781,
198,
6738,
19720,
1330,
7343,
11,
32233,
11,
5345,
198,
198,
6738,
300,
10887,
425,
13,
16366,
1330,
20985,
198,
198,
6738,
24573,
13886,
62,
... | 3.144444 | 180 |
import pysapets.constants as constants
from pysapets.animal import Animal
# helper functions
| [
11748,
279,
893,
499,
1039,
13,
9979,
1187,
355,
38491,
198,
6738,
279,
893,
499,
1039,
13,
41607,
1330,
13792,
628,
198,
2,
31904,
5499,
198,
220,
220,
220,
220
] | 3.3 | 30 |
from .utils import logger
from .tree import Tree
from .visitors import Transformer, Visitor, v_args, Discard, Transformer_NonRecursive
from .visitors import InlineTransformer, inline_args # XXX Deprecated
from .exceptions import (ParseError, LexError, GrammarError, UnexpectedToken,
Unexpected... | [
6738,
764,
26791,
1330,
49706,
198,
6738,
764,
21048,
1330,
12200,
198,
6738,
764,
4703,
6742,
1330,
3602,
16354,
11,
6911,
2072,
11,
410,
62,
22046,
11,
8444,
446,
11,
3602,
16354,
62,
15419,
6690,
30753,
198,
6738,
764,
4703,
6742,
... | 3 | 149 |
import requests
import time
import pytest
import os
@pytest.fixture
| [
11748,
7007,
198,
11748,
640,
198,
11748,
12972,
9288,
198,
11748,
28686,
628,
628,
198,
31,
9078,
9288,
13,
69,
9602,
198
] | 3.272727 | 22 |
import random, math
al1 = int(input('Digite o número de alunos: '))
text = input('Escreva o nome do aluno: ')
al2 = al1*text
#print(f'O Escolhido foi: {random.choice[al2]}')
| [
11748,
4738,
11,
10688,
198,
198,
282,
16,
796,
493,
7,
15414,
10786,
19511,
578,
267,
299,
21356,
647,
78,
390,
435,
403,
418,
25,
705,
4008,
198,
5239,
796,
5128,
10786,
47051,
260,
6862,
267,
299,
462,
466,
435,
36909,
25,
705,
... | 2.298701 | 77 |
import math
import numpy as np
"""Agrandit un tableau 2D en rajoutant des zeros à droite et en bas"""
| [
11748,
10688,
198,
11748,
299,
32152,
355,
45941,
198,
198,
37811,
32,
23936,
270,
555,
3084,
559,
362,
35,
551,
374,
1228,
448,
415,
748,
1976,
27498,
28141,
3102,
578,
2123,
551,
1615,
37811,
198
] | 2.942857 | 35 |
from xml.etree import ElementTree as ET
import palje.storage_format as storage_format
CHILDREN_MACRO = '<ac:structured-macro ac:macro-id="3f6a7cbe-2142-47ac-a9ef-a5226c237a51" ac:name="children" ac:schema-version="2"><ac:parameter ac:name="all">true</ac:parameter><ac:parameter ac:name="excerptType">simple</ac:paramet... | [
6738,
35555,
13,
316,
631,
1330,
11703,
27660,
355,
12152,
198,
198,
11748,
6340,
18015,
13,
35350,
62,
18982,
355,
6143,
62,
18982,
198,
198,
3398,
4146,
7707,
1677,
62,
44721,
13252,
796,
705,
27,
330,
25,
7249,
1522,
12,
20285,
305... | 2.281977 | 344 |
from pathlib import Path
import pathlib
import pickle
import time
from collections import defaultdict
from numpy import meshgrid as n_mesh
from second.core.box_np_ops import camera_to_lidar
from second.core import box_np_ops
import cv2
import numpy as np
from skimage import io as imgio
from PIL import Image
import... | [
6738,
3108,
8019,
1330,
10644,
198,
11748,
3108,
8019,
198,
11748,
2298,
293,
198,
11748,
640,
198,
6738,
17268,
1330,
4277,
11600,
198,
6738,
299,
32152,
1330,
19609,
25928,
355,
299,
62,
76,
5069,
198,
6738,
1218,
13,
7295,
13,
3524,
... | 1.937141 | 7,843 |
gb = GearsBuilder()
gb.map(lambda x: x["value"]) # map records to "sentence" values
gb.flatmap(lambda x: x.split()) # split sentences to words
gb.countby() # count each word's occurances
gb.run()
| [
22296,
796,
46680,
32875,
3419,
198,
22296,
13,
8899,
7,
50033,
2124,
25,
2124,
14692,
8367,
8973,
8,
220,
1303,
3975,
4406,
284,
366,
34086,
594,
1,
3815,
198,
22296,
13,
38568,
8899,
7,
50033,
2124,
25,
2124,
13,
35312,
28955,
220,
... | 2.970149 | 67 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'main.ui'
#
# Created by: PyQt5 UI code generator 5.15.4
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt5 import QtCore, QtWidge... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
5178,
7822,
7560,
422,
3555,
334,
72,
2393,
705,
12417,
13,
9019,
6,
198,
2,
198,
2,
15622,
416,
25,
9485,
48,
83,
20,
12454,
2438,
17301,
642,
13,
1314,
1... | 2.958678 | 121 |
import requests
| [
11748,
7007,
628
] | 5.666667 | 3 |
"""
Functions to build the location subparser.
"""
import argparse as ap
import api_parser as prs
import api_parser._locations.mappers as mp
def location_info_sp(locs_subprs):
"""
Creates the location information retrieval subparser.
Args:
locs_subprs: The location subparser.
"""
sp = lo... | [
37811,
198,
24629,
2733,
284,
1382,
262,
4067,
22718,
28198,
13,
198,
37811,
198,
11748,
1822,
29572,
355,
2471,
198,
11748,
40391,
62,
48610,
355,
778,
82,
198,
11748,
40391,
62,
48610,
13557,
17946,
602,
13,
76,
46629,
355,
29034,
628... | 2.553962 | 2,928 |
import numpy as np
#Test Case 1
array1=np.array([1,2,3,5,7,2])
print(move_element_to_end(array1,2))
#Test Case 2
array2=np.array([1,2,0,5,7,2])
print(move_element_to_end(array2,0))
#Test Case 3
array3=np.array([1,-2,3,5,7,2])
print(move_element_to_end(array3,-2))
#Test Case 4
array3=np.array([1,-2,101,5,7,2])
print(mov... | [
11748,
299,
32152,
355,
45941,
198,
2,
14402,
8913,
352,
198,
18747,
16,
28,
37659,
13,
18747,
26933,
16,
11,
17,
11,
18,
11,
20,
11,
22,
11,
17,
12962,
198,
4798,
7,
21084,
62,
30854,
62,
1462,
62,
437,
7,
18747,
16,
11,
17,
... | 2.065089 | 169 |
from day_04 import get_hash, find_smallest_int
| [
6738,
1110,
62,
3023,
1330,
651,
62,
17831,
11,
1064,
62,
17470,
395,
62,
600,
628,
198
] | 2.882353 | 17 |
"""Solution to day 13 parts 1 and 2"""
import re
FIREWALL = """0: 3
1: 2
4: 4
6: 4"""
def load(day):
"""Open specified days input file."""
filename = 'input_{}.txt'.format(str(day).zfill(2))
return open(filename)
def parse_firewall_instruction(instruction):
"""Parse single firewall instruction."""
... | [
37811,
46344,
284,
1110,
1511,
3354,
352,
290,
362,
37811,
198,
11748,
302,
198,
198,
11674,
2200,
54,
7036,
796,
37227,
15,
25,
513,
198,
16,
25,
362,
198,
19,
25,
604,
198,
21,
25,
604,
37811,
628,
198,
4299,
3440,
7,
820,
2599,... | 2.485496 | 655 |
# -*- coding: utf-8 -*-
# SPDX-License-Identifier: MIT
"""
The base logger module
Copyright 2017-2018, Leo Moll and Dominik Schlösser
"""
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
30628,
55,
12,
34156,
12,
33234,
7483,
25,
17168,
198,
37811,
198,
464,
2779,
49706,
8265,
198,
198,
15269,
2177,
12,
7908,
11,
19632,
337,
692,
290,
11817,
1134,
4... | 2.685185 | 54 |
# coding=utf-8
""" Module for adding numbers. """
def add_two_numbers(input_x, input_y):
""" Add two numbers """
return input_x + input_y
| [
2,
19617,
28,
40477,
12,
23,
198,
37811,
19937,
329,
4375,
3146,
13,
37227,
198,
198,
4299,
751,
62,
11545,
62,
77,
17024,
7,
15414,
62,
87,
11,
5128,
62,
88,
2599,
198,
220,
220,
220,
37227,
3060,
734,
3146,
37227,
198,
220,
220,... | 2.722222 | 54 |
#
# Hubblemon - Yet another general purpose system monitor
#
# Copyright 2015 NAVER Corp.
#
# 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
#
# U... | [
198,
2,
198,
2,
40455,
2144,
532,
6430,
1194,
2276,
4007,
1080,
5671,
198,
2,
198,
2,
15069,
1853,
11746,
5959,
11421,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2... | 3.579787 | 188 |
"""Tests for randoworde."""
import random
import tempfile
from randoworde import read_words, random_word, main
WORDS = [
'pineapple',
'banana',
'apple',
'orange',
'horse',
'battery',
'staple'
]
WORDS_TXT = '\n'.join(WORDS)
def test_read_words():
"""Test that we can read dictionarie... | [
37811,
51,
3558,
329,
43720,
322,
17531,
526,
15931,
198,
11748,
4738,
198,
11748,
20218,
7753,
198,
6738,
43720,
322,
17531,
1330,
1100,
62,
10879,
11,
4738,
62,
4775,
11,
1388,
628,
198,
45359,
5258,
796,
685,
198,
220,
220,
220,
70... | 2.179487 | 546 |