content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
import discord
cooldownEmbed = discord.Embed.from_dict({"type": "rich", "title": "Cooldown",
"description": ":x: That command is currently on cooldown :x:",
"color": 15158332, "author": {"name": "Error",
... | [
11748,
36446,
198,
198,
1073,
15041,
31567,
276,
796,
36446,
13,
31567,
276,
13,
6738,
62,
11600,
7,
4895,
4906,
1298,
366,
7527,
1600,
366,
7839,
1298,
366,
45953,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2... | 1.38392 | 1,990 |
#nombre = input("¿Cual es tu nombre?")
#nombre = nombre.upper()
#print(nombre)
#nombre = input("¿Cual es tu nombre?")
#nombre = nombre.capitalize()
#print(nombre)
#nombre = input("¿Cual es tu nombre?")
#nombre = nombre.lower()
#print(nombre)
nombre = input("¿Cual es tu nombre?")
nombre = nombre.strip()
print(nom... | [
2,
77,
2381,
260,
796,
5128,
7203,
126,
123,
34,
723,
1658,
12777,
299,
2381,
260,
1701,
8,
198,
2,
77,
2381,
260,
796,
299,
2381,
260,
13,
45828,
3419,
198,
198,
2,
4798,
7,
77,
2381,
260,
8,
198,
198,
2,
77,
2381,
260,
796,
... | 2.025 | 160 |
from tests.package.test_perl import TestPerlBase
class TestPerlDBDmysql(TestPerlBase):
"""
package:
DBD-mysql XS
direct dependencies:
DBI XS
"""
config = TestPerlBase.config + \
"""
BR2_PACKAGE_PERL=y
BR2_PACKAGE_PERL_DBD_MYSQL=y
"""
| [
6738,
5254,
13,
26495,
13,
9288,
62,
525,
75,
1330,
6208,
5990,
75,
14881,
628,
198,
4871,
6208,
5990,
75,
11012,
35,
28744,
13976,
7,
14402,
5990,
75,
14881,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
5301,
25,
198,
220,
... | 1.907407 | 162 |
import re
from py_pdf_parser.components import PDFDocument
from py_pdf_parser.components import PDFElement
from tomorrow_pdf_converter.t_parser.statement import Statement
from tomorrow_pdf_converter.t_parser.transaction import Transaction
closing_element_text = "ZUSAMMENFASSUNG"
# This regex matches the headline of... | [
11748,
302,
198,
198,
6738,
12972,
62,
12315,
62,
48610,
13,
5589,
3906,
1330,
12960,
24941,
198,
6738,
12972,
62,
12315,
62,
48610,
13,
5589,
3906,
1330,
12960,
20180,
198,
198,
6738,
9439,
62,
12315,
62,
1102,
332,
353,
13,
83,
62,
... | 2.3875 | 320 |
import os
import os.path
from constant import *
__all__ = ['get_id_from_abb', 'get_abb_from_name']
# Helper functions
def check_assets_dir() -> None:
"""This function checks if a directory exists. If not it will create one.
"""
directories = [PLAYER_BASE_PATH, TEAM_BASE_PATH, PLAYER_SEASON_PATH,
... | [
11748,
28686,
198,
11748,
28686,
13,
6978,
198,
198,
6738,
6937,
1330,
1635,
198,
198,
834,
439,
834,
796,
37250,
1136,
62,
312,
62,
6738,
62,
6485,
3256,
705,
1136,
62,
6485,
62,
6738,
62,
3672,
20520,
628,
198,
2,
5053,
525,
5499,... | 2.457447 | 470 |
from flask import Flask, flash, render_template, request, redirect, url_for
from flask_sqlalchemy import SQLAlchemy
from flask_wtf import FlaskForm
from wtforms import StringField, SubmitField
app = Flask(__name__)
app.config.from_object(Config)
db = SQLAlchemy(app)
@app.route('/', methods=['GET', 'POST'])
@a... | [
6738,
42903,
1330,
46947,
11,
7644,
11,
8543,
62,
28243,
11,
2581,
11,
18941,
11,
19016,
62,
1640,
198,
6738,
42903,
62,
25410,
282,
26599,
1330,
16363,
2348,
26599,
198,
6738,
42903,
62,
86,
27110,
1330,
46947,
8479,
198,
6738,
266,
... | 1.710702 | 598 |
'''All configs for handshake go here
'''
| [
7061,
6,
3237,
4566,
82,
329,
42231,
467,
994,
198,
7061,
6,
198
] | 3.153846 | 13 |
"""
Dataset setup and loaders
This file including the different datasets processing pipelines
"""
from datasets import cityscapes
from datasets import mapillary
from datasets import kitti
from datasets import camvid
from datasets import bdd
import torchvision.transforms as standard_transforms
import transforms.joint_... | [
37811,
198,
27354,
292,
316,
9058,
290,
3440,
364,
198,
1212,
2393,
1390,
262,
1180,
40522,
7587,
31108,
198,
37811,
198,
6738,
40522,
1330,
1748,
1416,
7916,
198,
6738,
40522,
1330,
3975,
15856,
198,
6738,
40522,
1330,
479,
715,
72,
19... | 2.038258 | 5,280 |
#!/usr/bin/env python3
"""tests for mad_lib.py"""
import re
import os
import random
import string
from subprocess import getstatusoutput
prg = './mad.py'
no_blanks = 'inputs/no_blanks.txt'
fox = 'inputs/fox.txt'
hlp = 'inputs/help.txt'
verona = 'inputs/romeo_juliet.txt'
# ---------------------------... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
201,
198,
37811,
41989,
329,
8805,
62,
8019,
13,
9078,
37811,
201,
198,
201,
198,
11748,
302,
201,
198,
11748,
28686,
201,
198,
11748,
4738,
201,
198,
11748,
4731,
201,
198,
6738,
850,
... | 2.751986 | 1,133 |
from chatterbot import ChatBot
'''
This is an example showing how to create an export file from
an existing chat bot that can then be used to train other bots.
'''
chatbot = ChatBot(
'Export Example Bot',
trainer='chatterbot.trainers.ChatterBotCorpusTrainer'
)
# First, lets train our bot with some data
chatb... | [
6738,
37303,
13645,
1330,
24101,
20630,
198,
198,
7061,
6,
198,
1212,
318,
281,
1672,
4478,
703,
284,
2251,
281,
10784,
2393,
422,
198,
272,
4683,
8537,
10214,
326,
460,
788,
307,
973,
284,
4512,
584,
29641,
13,
198,
7061,
6,
198,
1... | 3.176056 | 142 |
"""
=====================================================
Insert Best Buy website in list, seperated by a comma
=====================================================
"""
products_list =[#e.g."https://www.bestbuy.com/site/combo/nintendo-switch/",
"PASTE LINK HERE BETWEEN QUOTES",]
| [
37811,
201,
198,
10052,
4770,
1421,
28,
201,
198,
44402,
6705,
11763,
3052,
287,
1351,
11,
384,
525,
515,
416,
257,
39650,
201,
198,
10052,
4770,
1421,
28,
220,
201,
198,
37811,
201,
198,
201,
198,
29498,
62,
4868,
796,
58,
2,
68,
... | 3.059406 | 101 |
from floodsystem import geo
from floodsystem.stationdata import build_station_list
from floodsystem.geo import stations_within_radius
def run():
"""Requirements for Task 1C"""
# Build list of stations
stations = build_station_list()
# Build list of stations within certain radius of specified point
... | [
6738,
6947,
10057,
1330,
40087,
198,
6738,
6947,
10057,
13,
17529,
7890,
1330,
1382,
62,
17529,
62,
4868,
198,
6738,
6947,
10057,
13,
469,
78,
1330,
8985,
62,
33479,
62,
42172,
198,
198,
4299,
1057,
33529,
198,
220,
220,
220,
37227,
4... | 3.188571 | 175 |
# AUTOGENERATED BY NBDEV! DO NOT EDIT!
__all__ = ["index", "modules", "custom_doc_links", "git_url"]
index = {"Learner.get_preds": "00_inference.ipynb",
"Learner.predict": "00_inference.ipynb",
"TabularLearner.predict": "00_inference.ipynb",
"Interpret": "01_tabular.core.ipynb",
"s... | [
2,
47044,
7730,
1677,
1137,
11617,
11050,
41354,
39345,
0,
8410,
5626,
48483,
0,
198,
198,
834,
439,
834,
796,
14631,
9630,
1600,
366,
18170,
1600,
366,
23144,
62,
15390,
62,
28751,
1600,
366,
18300,
62,
6371,
8973,
198,
198,
9630,
79... | 1.949767 | 1,075 |
"""Module for plotting clusters."""
from pathlib import Path
from matplotlib import pyplot as plt
import matplotlib.figure
import numpy as np
import pte_stats
def clusterplot_combined(
power_a: np.ndarray,
power_b: np.ndarray | int | float,
extent: tuple | list,
alpha: float = 0.05,
n_perm: int =... | [
37811,
26796,
329,
29353,
23163,
526,
15931,
198,
6738,
3108,
8019,
1330,
10644,
198,
198,
6738,
2603,
29487,
8019,
1330,
12972,
29487,
355,
458,
83,
198,
11748,
2603,
29487,
8019,
13,
26875,
198,
11748,
299,
32152,
355,
45941,
198,
11748... | 1.976727 | 1,332 |
import urllib.request, json, re
import path
with open(path.KEY_PATH, 'r') as data_file:
data = json.load(data_file)
if __name__ == '__main__':
"""
테스트 코드
"""
search_keyword_by_naver_dic('백과사전')
| [
11748,
2956,
297,
571,
13,
25927,
11,
33918,
11,
302,
198,
198,
11748,
3108,
198,
198,
4480,
1280,
7,
6978,
13,
20373,
62,
34219,
11,
705,
81,
11537,
355,
1366,
62,
7753,
25,
198,
220,
220,
220,
1366,
796,
33918,
13,
2220,
7,
7890... | 1.825 | 120 |
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
import os
from typing import Any, Dict, Generator, cast
import pytest
from _pytest.fixtures import SubRequest
from _pytest.monkeypatch import MonkeyPatch
from omegaconf import OmegaConf
from torchgeo.datamodules import Ches... | [
2,
15069,
357,
66,
8,
5413,
10501,
13,
1439,
2489,
10395,
13,
198,
2,
49962,
739,
262,
17168,
13789,
13,
198,
198,
11748,
28686,
198,
6738,
19720,
1330,
4377,
11,
360,
713,
11,
35986,
11,
3350,
198,
198,
11748,
12972,
9288,
198,
673... | 3.716667 | 120 |
from django.shortcuts import render
from anuncios.models import Anuncio
# Create your views here. | [
6738,
42625,
14208,
13,
19509,
23779,
1330,
8543,
198,
6738,
281,
49652,
418,
13,
27530,
1330,
1052,
19524,
952,
198,
2,
13610,
534,
5009,
994,
13
] | 3.730769 | 26 |
"""Example: Plotting cross sections"""
from matplotlib.pyplot import show
import ebisim as eb
# The cross section plot commands accept a number of formats for the element parameter
# This example shows the different possibilities
# The first option is to provide an instance of the Element class
potassium = eb.get_el... | [
37811,
16281,
25,
28114,
889,
3272,
9004,
37811,
198,
198,
6738,
2603,
29487,
8019,
13,
9078,
29487,
1330,
905,
198,
11748,
36649,
271,
320,
355,
36649,
198,
198,
2,
383,
3272,
2665,
7110,
9729,
2453,
257,
1271,
286,
17519,
329,
262,
... | 3.97546 | 326 |
from django.db import models
| [
6738,
42625,
14208,
13,
9945,
1330,
4981,
628
] | 3.75 | 8 |
# ! Desafio 13
# ! Faça um programa que leia o salario de um funcionario e mnostre seu novo salario com 15% de aumento
po = int(input('Digite seu salario '))
pa = (15/100) * po
x = po + pa
print('Seu salario com 15% de aumenta é: {}'.format(x)) | [
198,
2,
5145,
2935,
1878,
952,
1511,
198,
2,
5145,
18350,
50041,
23781,
1430,
64,
8358,
443,
544,
267,
3664,
4982,
390,
23781,
25439,
295,
4982,
304,
285,
77,
455,
260,
384,
84,
645,
13038,
3664,
4982,
401,
1315,
4,
390,
257,
1713,
... | 2.494949 | 99 |
SOURCES_CODE = {
'ทุกสื่อ' : 'nAll',
'ข่าวหุ้น' : '01300000',
'ทันหุ้น' : '01600000',
} | [
50,
2606,
7397,
1546,
62,
34,
16820,
796,
1391,
198,
220,
220,
220,
705,
19567,
245,
19567,
116,
19567,
223,
19567,
103,
19567,
115,
31479,
230,
19567,
255,
6,
1058,
705,
77,
3237,
3256,
198,
220,
220,
220,
705,
19567,
224,
31479,
2... | 1.1 | 90 |
# -*- coding: utf-8 -*-
#
# Author: Krishna Sunkara (kpsunkara)
#
# Re-entrant, reusable context manager to store execution context. Introduced
# in pmdarima 1.5.0 (see #221), redesigned not to use thread locals in #273
# (see #275 for context).
from abc import ABC, abstractmethod
from enum import Enum
import collecti... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
198,
2,
6434,
25,
38594,
311,
2954,
3301,
357,
74,
862,
2954,
3301,
8,
198,
2,
198,
2,
797,
12,
298,
5250,
11,
42339,
4732,
4706,
284,
3650,
9706,
4732,
13,
167... | 2.616608 | 2,264 |
'''
The heart of Cici
'''
import discord
import os
import json
import aiosqlite
from functools import lru_cache
from aiohttp import ClientSession
from discord.ext.commands import Bot
enclosing_dir = os.path.dirname(os.path.realpath(__file__))
config = load_config()
db_path = f'{enclosing_dir}/data.db'
@lru_ca... | [
7061,
6,
198,
464,
2612,
286,
37212,
72,
198,
7061,
6,
198,
198,
11748,
36446,
198,
11748,
28686,
198,
11748,
33918,
198,
11748,
257,
4267,
13976,
578,
198,
6738,
1257,
310,
10141,
1330,
300,
622,
62,
23870,
198,
6738,
257,
952,
4023,... | 2.512438 | 201 |
# O mesmo professor do desafio anterior quer sortear a ordem de apresentação dos alunos. Faça um programa que leia o nome dos quatro alunos e mostre a ordem sorteada
from random import shuffle
a1 = str(input('Aluno n1: '))
a2 = str(input('Aluno n2: '))
a3 = str(input('Aluno n3: '))
a4 = str(input('Aluno n4: '))
a = ... | [
2,
440,
18842,
5908,
6240,
466,
748,
1878,
952,
32700,
42517,
3297,
451,
257,
2760,
368,
390,
2471,
2028,
64,
16175,
28749,
23430,
435,
403,
418,
13,
18350,
50041,
23781,
1430,
64,
8358,
443,
544,
267,
299,
462,
23430,
627,
47756,
435... | 2.4 | 160 |
import asyncio
import os
import socket
import tempfile
from uvloop import _testbase as tb
| [
11748,
30351,
952,
198,
11748,
28686,
198,
11748,
17802,
198,
11748,
20218,
7753,
198,
198,
6738,
334,
85,
26268,
1330,
4808,
9288,
8692,
355,
256,
65,
628,
628,
628,
198
] | 3.233333 | 30 |
import numpy
import xlsxwriter
from pandas import read_excel
import xlrd
import pandas
data = read_excel('data/questions_and_choices.xlsx')
print(data.columns[2])
# print(data.head())
| [
11748,
299,
32152,
198,
11748,
2124,
7278,
87,
16002,
198,
6738,
19798,
292,
1330,
1100,
62,
1069,
5276,
198,
11748,
2124,
75,
4372,
198,
11748,
19798,
292,
198,
7890,
796,
1100,
62,
1069,
5276,
10786,
7890,
14,
6138,
507,
62,
392,
62... | 2.681159 | 69 |
from django.db import models
from hotels.models import Hotel
from users.models import User
| [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
198,
6738,
18505,
13,
27530,
1330,
12696,
198,
6738,
2985,
13,
27530,
1330,
11787,
628
] | 4.043478 | 23 |
# TWEEPY DOCUMENTATION - https://docs.tweepy.org/en/latest/
# AUTHENTICATION TUTORIAL - https://docs.tweepy.org/en/latest/auth_tutorial.html
import tweepy
# YOU MUST HAVE A TWITTER DEVELOPER ACCOUNT TO USE
# https://developer.twitter.com/en/apply-for-access
# All new developers must apply for a developer account to ac... | [
2,
17306,
35238,
56,
37760,
5883,
3525,
6234,
532,
3740,
1378,
31628,
13,
83,
732,
538,
88,
13,
2398,
14,
268,
14,
42861,
14,
198,
2,
37195,
3525,
2149,
6234,
309,
3843,
1581,
12576,
532,
3740,
1378,
31628,
13,
83,
732,
538,
88,
1... | 3.048926 | 838 |
from streamlink.plugins.tvtoya import TVToya
from tests.plugins import PluginCanHandleUrl
| [
6738,
4269,
8726,
13,
37390,
13,
14981,
83,
23790,
1330,
3195,
51,
23790,
198,
6738,
5254,
13,
37390,
1330,
42636,
6090,
37508,
28165,
628
] | 3.791667 | 24 |
'''
This code is part of QuTIpy.
(c) Copyright Sumeet Khatri, 2021
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 modifications or derivative wor... | [
7061,
6,
198,
1212,
2438,
318,
636,
286,
2264,
25621,
9078,
13,
198,
198,
7,
66,
8,
15069,
311,
2454,
316,
509,
5183,
380,
11,
33448,
198,
198,
1212,
2438,
318,
11971,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
13,
921,
743,
... | 2.909836 | 244 |
from social.db import create_tables, drop_tables
from social.webserver import create_app
if True:
drop_tables()
create_tables()
app = create_app()
| [
6738,
1919,
13,
9945,
1330,
2251,
62,
83,
2977,
11,
4268,
62,
83,
2977,
198,
6738,
1919,
13,
732,
1443,
18497,
1330,
2251,
62,
1324,
198,
198,
361,
6407,
25,
198,
220,
220,
220,
4268,
62,
83,
2977,
3419,
198,
17953,
62,
83,
2977,
... | 2.867925 | 53 |
from __future__ import annotations
from typing import List
from typing import Type
from component.exit import Exit
from component.role import Role
from component.room import Room
from event.event import Event
from message.message import Message
from system.channel import Channel
from logcat.logcat import LogCat
#... | [
198,
6738,
11593,
37443,
834,
1330,
37647,
198,
198,
6738,
19720,
1330,
7343,
198,
6738,
19720,
1330,
5994,
198,
198,
6738,
7515,
13,
37023,
1330,
29739,
198,
6738,
7515,
13,
18090,
1330,
20934,
198,
6738,
7515,
13,
3823,
1330,
10096,
1... | 4.060976 | 82 |
import numpy as np
from pbtranscript.Utils import execute
from pbtranscript.ice.IceUtils import alignment_has_large_nonmatch, HitItem, eval_blasr_alignment
from pbtranscript.io import LA4IceReader, BLASRM5Reader
gcon2_py = "ice_pbdagcon2.py"
def sanity_check_gcon2():
"""Sanity check gcon."""
cmd = gcon2_py +... | [
198,
11748,
299,
32152,
355,
45941,
198,
6738,
279,
65,
7645,
6519,
13,
18274,
4487,
1330,
12260,
198,
6738,
279,
65,
7645,
6519,
13,
501,
13,
23709,
18274,
4487,
1330,
19114,
62,
10134,
62,
11664,
62,
13159,
15699,
11,
7286,
7449,
11... | 1.89233 | 6,167 |
# Copyright (c) 2021 Hieu Le and the UCI Networking Group
# <https://athinagroup.eng.uci.edu>.
#
# 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/LICE... | [
2,
220,
15069,
357,
66,
8,
33448,
367,
22304,
1004,
290,
262,
14417,
40,
7311,
278,
4912,
198,
2,
220,
1279,
5450,
1378,
776,
259,
363,
3233,
13,
1516,
13,
42008,
13,
15532,
28401,
198,
2,
198,
2,
220,
49962,
739,
262,
24843,
1378... | 2.971223 | 417 |
from pathlib import Path
import numpy as np
import pandas as pd
from sklearn import mixture
from tqdm import tqdm
# def save(self):
# assert self.gmms is not None, "No results can be saved before fit is ran."
# # # Save GMM object
# # with self.results_fpath.open("wb") as f:
# # ... | [
6738,
3108,
8019,
1330,
10644,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,
6738,
1341,
35720,
1330,
11710,
198,
6738,
256,
80,
36020,
1330,
256,
80,
36020,
628,
198,
220,
220,
220,
1303,
825,
36... | 1.913223 | 1,210 |
import socket
addr = ('127.0.0.1', 3001)
if __name__ == '__main__':
run() | [
11748,
17802,
628,
198,
198,
29851,
796,
19203,
16799,
13,
15,
13,
15,
13,
16,
3256,
5867,
16,
8,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
1057,
3419
] | 2.216216 | 37 |
from aws_cdk import aws_ec2 as ec2
from aws_cdk import aws_iam as iam
from aws_cdk import core
class MLLib(core.Construct):
"""Install machine learning libraries."""
| [
6738,
3253,
82,
62,
10210,
74,
1330,
3253,
82,
62,
721,
17,
355,
9940,
17,
198,
6738,
3253,
82,
62,
10210,
74,
1330,
3253,
82,
62,
1789,
355,
1312,
321,
198,
6738,
3253,
82,
62,
10210,
74,
1330,
4755,
628,
198,
4871,
337,
3069,
... | 2.774194 | 62 |
#!/usr/bin/env python
# List the process ordered by oom score
from __future__ import print_function
import argparse
from codecs import decode
from operator import itemgetter
from os import listdir
from os.path import join
import sys
try:
from string import maketrans
except ImportError:
# we are using python3 s... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
7343,
262,
1429,
6149,
416,
267,
296,
4776,
198,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
11748,
1822,
29572,
198,
6738,
40481,
82,
1330,
36899,
198,
6738,
10088,
13... | 2.763547 | 203 |
import os
import jinja2
import shutil
from . import utils
from codecs import open
__all__ = ['handle_project']
def copy(src, dst):
"""Copy file or directory from src to dst"""
if os.path.isfile(src):
shutil.copy(src, dst)
elif os.path.isdir(src):
shutil.copytree(src, dst)
return dst
... | [
11748,
28686,
198,
11748,
474,
259,
6592,
17,
198,
11748,
4423,
346,
198,
6738,
764,
1330,
3384,
4487,
198,
6738,
40481,
82,
1330,
1280,
628,
198,
834,
439,
834,
796,
37250,
28144,
62,
16302,
20520,
628,
198,
4299,
4866,
7,
10677,
11,... | 2.578069 | 839 |
import argparse
from tqdm import tqdm
import numpy as np
# Import in the Clarifai gRPC based objects needed
from clarifai_grpc.channel.clarifai_channel import ClarifaiChannel
from clarifai_grpc.grpc.api import resources_pb2, service_pb2, service_pb2_grpc
from clarifai_grpc.grpc.api.status import status_code_pb2
from g... | [
11748,
1822,
29572,
198,
6738,
256,
80,
36020,
1330,
256,
80,
36020,
198,
11748,
299,
32152,
355,
45941,
198,
198,
2,
17267,
287,
262,
15420,
361,
1872,
308,
49,
5662,
1912,
5563,
2622,
198,
6738,
10212,
361,
1872,
62,
2164,
14751,
13... | 2.25724 | 587 |
sx = sy =sxy = sx2 =sy2 = xy = c = 0
vx = [0,0,0]
vy = [0,0,0]
while(c<3):
vx[c] = int(input("Digite um valor de x: "))
c+=1
for x in vx:
sx += x
c=0
while(c<3):
vy[c] = int(input("Digite um valor de y: "))
c+=1
for y in vy:
sy += y
xy = x*y | [
82,
87,
796,
827,
796,
82,
5431,
796,
264,
87,
17,
796,
1837,
17,
796,
2124,
88,
796,
269,
796,
657,
198,
85,
87,
796,
685,
15,
11,
15,
11,
15,
60,
198,
7670,
796,
685,
15,
11,
15,
11,
15,
60,
198,
198,
4514,
7,
66,
27,
... | 1.675 | 160 |
""" Simplified imports for the records module. """
from .acc import AccuracyDescription
from .dsi import DataSetIdentification
from .uhl import UserHeaderLabel
| [
37811,
45157,
1431,
17944,
329,
262,
4406,
8265,
13,
37227,
198,
6738,
764,
4134,
1330,
33222,
11828,
198,
6738,
764,
9310,
72,
1330,
6060,
7248,
33234,
2649,
198,
6738,
764,
7456,
75,
1330,
11787,
39681,
33986,
198
] | 4.324324 | 37 |
from typing import List
from bigfastapi import db
from uuid import uuid4
from bigfastapi.models import subscription_model
from bigfastapi.schemas import subscription_schema
from bigfastapi.db.database import get_db
import sqlalchemy.orm as _orm
import fastapi as _fastapi
from fastapi import APIRouter
from fastapi.respo... | [
6738,
19720,
1330,
7343,
198,
6738,
1263,
7217,
15042,
1330,
20613,
198,
6738,
334,
27112,
1330,
334,
27112,
19,
198,
6738,
1263,
7217,
15042,
13,
27530,
1330,
14569,
62,
19849,
198,
6738,
1263,
7217,
15042,
13,
1416,
4411,
292,
1330,
1... | 3.370732 | 205 |
from credit_card.ledger import Ledger
import luhn
import unittest
| [
6738,
3884,
62,
9517,
13,
992,
1362,
1330,
22964,
1362,
198,
11748,
300,
7456,
77,
198,
11748,
555,
715,
395,
628
] | 3.190476 | 21 |
# -*- coding: utf-8 -*-
import re
from csv import writer
from datetime import datetime
from flask import Blueprint
from flask import flash, redirect, render_template, request, url_for, abort, \
session
from flask_babel import _
from flask_login import current_user, login_user, logout_user, login_required
from io im... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
302,
198,
6738,
269,
21370,
1330,
6260,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
6738,
42903,
1330,
39932,
198,
6738,
42903,
1330,
7644,
11,
18941,
11,
8543,
... | 2.490683 | 3,864 |
from ua_model.functions import z_minus_its_reciprocal
from ua_model.utils import validate_branch_point_positions
| [
6738,
334,
64,
62,
19849,
13,
12543,
2733,
1330,
1976,
62,
40191,
62,
896,
62,
8344,
541,
43270,
198,
6738,
334,
64,
62,
19849,
13,
26791,
1330,
26571,
62,
1671,
3702,
62,
4122,
62,
1930,
1756,
628
] | 3.081081 | 37 |
from __future__ import unicode_literals
from django.apps import AppConfig
| [
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
6738,
42625,
14208,
13,
18211,
1330,
2034,
16934,
628
] | 3.619048 | 21 |
# coding=utf-8
# Copyright 2022 The Google Research 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 applicab... | [
2,
19617,
28,
40477,
12,
23,
198,
2,
15069,
33160,
383,
3012,
4992,
46665,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
... | 3.016609 | 1,445 |
#!/usr/bin/env python3
import readline
import sys
if __name__ == '__main__':
main()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
11748,
1100,
1370,
198,
11748,
25064,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
1388,
3419,
198
] | 2.5 | 36 |
import hashlib
import zlib
algorithms = [
zlib.crc32,
]
try:
import xxhash
except ImportError:
pass
else:
algorithms.extend(
[xxhash.xxh3_64_intdigest, xxhash.xxh64_intdigest, xxhash.xxh3_128_intdigest, xxhash.xxh32_intdigest]
)
def get_hashes(key: str, k: int, max_i: int):
"""
r... | [
11748,
12234,
8019,
198,
11748,
1976,
8019,
198,
198,
282,
7727,
907,
796,
685,
198,
220,
220,
220,
1976,
8019,
13,
66,
6015,
2624,
11,
198,
60,
198,
198,
28311,
25,
198,
220,
220,
220,
1330,
31383,
17831,
198,
16341,
17267,
12331,
... | 2.146868 | 463 |
from __future__ import absolute_import
import unittest
from main.maincontroller import MainController
from tests.xroad_local_group import xroad_local_group
class XroadEditDescriptionLocalGroup(unittest.TestCase):
"""
UC SERVICE_28 Edit the Description of a Local Group
RIA URL: https://jira.ria.ee/browse... | [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
198,
11748,
555,
715,
395,
198,
198,
6738,
1388,
13,
12417,
36500,
1330,
8774,
22130,
198,
6738,
5254,
13,
87,
6344,
62,
12001,
62,
8094,
1330,
2124,
6344,
62,
12001,
62,
8094,
628,... | 2.736842 | 266 |
#!/usr/bin/env python
import numpy as np
import pandas as pd
# First example
# Win probability vector
p = np.array([0.25,0.50,0.25])
# Decimal odds
d = np.array([5.0,1.5,2.0])
# Implied probabilities
i = np.array([])
for j in range(len(d)):
i = np.append(i,1/d[j])
race = pd.DataFrame()
race['p'] = p
race[... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,
198,
2,
3274,
1672,
198,
198,
2,
7178,
12867,
15879,
198,
198,
79,
796,
45941,
13,
18747,
26933,
15,
13... | 1.928571 | 546 |
from collections import deque
from aoc.util import load_example, load_input
def part1(lines):
"""
>>> part1(load_example(__file__, '22'))
306
"""
cards1, cards2 = prepare_data(lines)
while True:
turn(cards1, cards2)
if len(cards1) == 0:
return calc_score(cards2)
... | [
6738,
17268,
1330,
390,
4188,
198,
6738,
257,
420,
13,
22602,
1330,
3440,
62,
20688,
11,
3440,
62,
15414,
628,
628,
198,
198,
4299,
636,
16,
7,
6615,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
13163,
636,
16,
7,
2220,
62... | 2.227692 | 325 |
from smtplib import SMTPException
from django.contrib import admin, messages
from django.utils.timezone import now
from .site import admin_site
from .individual_command import IndividualCommandAdmin
from .. import models, forms
admin_site.register(models.MemberCommand, MemberCommandAdmin)
| [
6738,
895,
83,
489,
571,
1330,
9447,
7250,
16922,
198,
198,
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
11,
6218,
198,
6738,
42625,
14208,
13,
26791,
13,
2435,
11340,
1330,
783,
198,
198,
6738,
764,
15654,
1330,
13169,
62,
15654,
... | 3.831169 | 77 |
"""Leetcode 1. Two Sum
Easy
URL: https://leetcode.com/problems/two-sum/
Given an array of integers, return indices of the two numbers such that
they add up to a specific target.
You may assume that each input would have exactly one solution, and you
may not use the same element twice.
Example:
Given nums = [2, 7... | [
37811,
3123,
316,
8189,
352,
13,
4930,
5060,
198,
28406,
198,
198,
21886,
25,
3740,
1378,
293,
316,
8189,
13,
785,
14,
1676,
22143,
14,
11545,
12,
16345,
14,
198,
198,
15056,
281,
7177,
286,
37014,
11,
1441,
36525,
286,
262,
734,
31... | 2.883871 | 155 |
import FWCore.ParameterSet.Config as cms
#from HLTrigger.HLTfilters.hltHighLevel_cfi import *
#exoticaMuHLT = hltHighLevel
#Define the HLT path to be used.
#exoticaMuHLT.HLTPaths =['HLT_L1MuOpen']
#exoticaMuHLT.TriggerResultsTag = cms.InputTag("TriggerResults","","HLT8E29")
#Define the HLT quality cut
#exot... | [
11748,
48849,
14055,
13,
36301,
7248,
13,
16934,
355,
269,
907,
201,
198,
201,
198,
2,
6738,
38312,
48344,
13,
6581,
51,
10379,
1010,
13,
71,
2528,
11922,
4971,
62,
66,
12463,
1330,
1635,
201,
198,
2,
1069,
313,
3970,
33239,
6581,
5... | 1.732558 | 3,354 |
from utils.BaseFlags import parser as parser
parser.add_argument('--dataset', type=str, default='MMNIST', help="name of the dataset")
parser.add_argument('--style_dim', type=int, default=0, help="style dimensionality") # TODO: use modality-specific style dimensions?
parser.add_argument('--num_classes', type=int, def... | [
6738,
3384,
4487,
13,
14881,
40053,
1330,
30751,
355,
30751,
198,
198,
48610,
13,
2860,
62,
49140,
10786,
438,
19608,
292,
316,
3256,
2099,
28,
2536,
11,
4277,
11639,
12038,
45,
8808,
3256,
1037,
2625,
3672,
286,
262,
27039,
4943,
198,
... | 3.260563 | 710 |
# -*- coding: utf-8 -*-
from . import enum
from . import vo
from .RoleProxy import RoleProxy
from .UserProxy import UserProxy
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
6738,
764,
1330,
33829,
198,
6738,
764,
1330,
7608,
198,
6738,
764,
47445,
44148,
1330,
20934,
44148,
198,
6738,
764,
12982,
44148,
1330,
11787,
44148,
198
] | 3.097561 | 41 |
import numpy as np
import matplotlib.pyplot as plt
| [
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
628
] | 3.058824 | 17 |
from __future__ import print_function, absolute_import, division, unicode_literals
import errno
import glob
import os
import re
import zipfile
from hyp3lib.execute import execute
def prepare_files(csv_file):
"""Download granules and unzip granules
Given a CSV file of granule names, download the granules an... | [
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
11,
4112,
62,
11748,
11,
7297,
11,
28000,
1098,
62,
17201,
874,
198,
198,
11748,
11454,
3919,
198,
11748,
15095,
198,
11748,
28686,
198,
11748,
302,
198,
11748,
19974,
7753,
198,
198,
6738,... | 2.276941 | 863 |
from django.db import models
from django.conf import settings
from django.utils.text import slugify
import uuid
# Create your models here.
| [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
26791,
13,
5239,
1330,
31065,
1958,
198,
11748,
334,
27112,
198,
198,
2,
13610,
534,
4981,
994,
13,
628,
628,
628,
... | 3.5 | 42 |
"""
This module illustrates how to compute Precision at k and Recall at k metrics.
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from collections import defaultdict
import time
import datetime
import random
import numpy as np
import six
f... | [
37811,
201,
198,
1212,
8265,
21290,
703,
284,
24061,
39281,
379,
479,
290,
44536,
379,
479,
20731,
13,
201,
198,
37811,
201,
198,
201,
198,
6738,
11593,
37443,
834,
1330,
357,
48546,
62,
11748,
11,
7297,
11,
3601,
62,
8818,
11,
201,
... | 2.042678 | 3,421 |
from schema_graph.views import Schema
try:
# Django 2+:
from django.urls import path
urlpatterns = [path("", Schema.as_view())]
except ImportError:
# Django < 2:
from django.conf.urls import url
urlpatterns = [url(r"^$", Schema.as_view())]
| [
6738,
32815,
62,
34960,
13,
33571,
1330,
10011,
2611,
628,
198,
28311,
25,
198,
220,
220,
220,
1303,
37770,
362,
10,
25,
198,
220,
220,
220,
422,
42625,
14208,
13,
6371,
82,
1330,
3108,
628,
220,
220,
220,
19016,
33279,
82,
796,
685... | 2.504673 | 107 |
from classes.threads.AbstractRawThread import AbstractRawThread
| [
6738,
6097,
13,
16663,
82,
13,
23839,
27369,
16818,
1330,
27741,
27369,
16818,
628,
198
] | 4.4 | 15 |
import random
from torch import tensor
from sklearn.model_selection import StratifiedKFold
import torch
import numpy as np
import time
import matplotlib.pyplot as plt
| [
11748,
4738,
198,
6738,
28034,
1330,
11192,
273,
198,
6738,
1341,
35720,
13,
19849,
62,
49283,
1330,
29186,
1431,
42,
37,
727,
198,
11748,
28034,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
640,
198,
11748,
2603,
29487,
8019,
13,
90... | 3.652174 | 46 |
from botctl.client import BotClientCommand
from botctl.common import command_callback, execute_subcommand
class InstallConversationCommand(BotClientCommand):
"""Usage:
$ botmod update-conversation {BOT_NAME} < CONVERSATION_FILE.json
"""
__commandname__ = 'botmod'
expects_input = True
@comman... | [
6738,
10214,
34168,
13,
16366,
1330,
18579,
11792,
21575,
198,
6738,
10214,
34168,
13,
11321,
1330,
3141,
62,
47423,
11,
12260,
62,
7266,
21812,
628,
198,
4871,
15545,
3103,
690,
341,
21575,
7,
20630,
11792,
21575,
2599,
198,
220,
220,
... | 2.797143 | 350 |
# -*- coding: utf-8 -*-
if __name__ == "__main__":
import os
import sys
# If you run tests in-place (instead of using py.test), ensure local version is tested!
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
import greenery.v1 as greenery
if __name__ == "__main__":
test_v1()
| [
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,
197,
11748,
28686,
198,
197,
11748,
25064,
198,
197,
2,
1002,
345,
1057,
5254,
287,
12,
5372,
357,
3... | 2.548387 | 124 |
l1 = int ( input ('Primeiro lado : '))
l2 = int ( input('Segundo lado : '))
l3 = int ( input ('Terceiro lado : '))
if l1 + l2 > l3 and l2 + l3 > l1 and l3 + l1 > l2:
print('Pode formar triangulo')
if l1 == l2 == l3:
print('Triangulo Equilatero')
elif (l1 == l2 and l2 != l3) or (l2 == l3 and l3 != ... | [
75,
16,
796,
493,
357,
5128,
19203,
26405,
7058,
300,
4533,
1058,
705,
4008,
198,
75,
17,
796,
493,
357,
5128,
10786,
41030,
41204,
300,
4533,
1058,
705,
4008,
198,
75,
18,
796,
493,
357,
5128,
19203,
15156,
344,
7058,
300,
4533,
10... | 2.090517 | 232 |
from serial import Serial,SerialException
from serial.tools.list_ports import comports
from threading import Lock
from queue import Queue
import time,random,struct
from base64 import b64encode, b64decode
from binascii import Error as BAError
from mirage.libs.ble_utils.constants import *
from mirage.libs.ble_utils.scapy... | [
6738,
11389,
1330,
23283,
11,
32634,
16922,
198,
6738,
11389,
13,
31391,
13,
4868,
62,
3742,
1330,
552,
2096,
198,
6738,
4704,
278,
1330,
13656,
198,
6738,
16834,
1330,
4670,
518,
198,
11748,
640,
11,
25120,
11,
7249,
198,
6738,
2779,
... | 2.865616 | 7,486 |
"""Get invoice profile by group name API method."""
from ibsng.handler.handler import Handler
class getInvoiceProfileByGroupName(Handler):
"""Get invoice profile by group name method class."""
def control(self):
"""Validate inputs after setup method.
:return: None
:rtype: None
... | [
37811,
3855,
45458,
7034,
416,
1448,
1438,
7824,
2446,
526,
15931,
198,
6738,
24283,
82,
782,
13,
30281,
13,
30281,
1330,
32412,
628,
198,
4871,
651,
19904,
2942,
37046,
3886,
13247,
5376,
7,
25060,
2599,
198,
220,
220,
220,
37227,
3855... | 2.550218 | 229 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, \
with_statement
from kivy.app import App
from kivy.clock import Clock
from kivy.core.text import LabelBase
from kivy.core.window import Window
from kivy.utils import get_color_from_hex
from time import strft... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
11,
7297,
11,
3601,
62,
8818,
11,
3467,
198,
220,
220,
220,
351,
62,
26090,
... | 2.471698 | 318 |
import sys
import argparse
import psutil
from cpu_load_generator import load_all_cores, load_single_core, from_profile
def parse_args(parser):
"""Parse input parameters.
param parser: ArgumentParser object
"""
parser.add_argument('-p', '--path_to_profile_json', type=str, default="",
... | [
11748,
25064,
198,
11748,
1822,
29572,
198,
198,
11748,
26692,
22602,
198,
198,
6738,
42804,
62,
2220,
62,
8612,
1352,
1330,
3440,
62,
439,
62,
66,
2850,
11,
3440,
62,
29762,
62,
7295,
11,
422,
62,
13317,
628,
198,
4299,
21136,
62,
... | 2.489816 | 1,031 |
from random import random
import math
import numpy as np
import binascii
import struct
num_vectors = 100
f = open("test_vectors.txt", "w")
i = 0
while (i < num_vectors):
a = np.uint16(math.floor(random() * (2**16 - 1)))
b = np.uint16(math.floor(random() * (2**16 - 1)))
if (a != 0) and (b != 0):
c = math.g... | [
6738,
4738,
1330,
4738,
198,
11748,
10688,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
9874,
292,
979,
72,
198,
11748,
2878,
198,
198,
22510,
62,
303,
5217,
796,
1802,
198,
198,
69,
796,
1280,
7203,
9288,
62,
303,
5217,
13,
14116,... | 2.19 | 200 |
import json
import pandas as pd
import time
import matplotlib.pyplot as plt
ylabels = [
"CPU Utilization (%)",
"Disk I/O Utilization (%)",
"Process CPU Threads In Use",
"Network Traffic (bytes)",
"System Memory Utilization (%)",
"Process Memory Available (non-swap) (MB)",
"Process Memory In... | [
11748,
33918,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
640,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
198,
2645,
397,
1424,
796,
685,
198,
220,
220,
220,
366,
36037,
7273,
346,
1634,
11509,
1600,
198,... | 2.359465 | 523 |
from flask import Flask, request
from flask import Flask, request, session, g, jsonify, \
redirect, url_for, abort, render_template, flash
import sqlite3
import json
app=Flask(__name__)
app.config.from_object(__name__)
app.config.update(DATABASE=app.root_path + '/data/textpile.db')
# log errors in production to uw... | [
6738,
42903,
1330,
46947,
11,
2581,
198,
6738,
42903,
1330,
46947,
11,
2581,
11,
6246,
11,
308,
11,
33918,
1958,
11,
3467,
198,
220,
220,
220,
18941,
11,
19016,
62,
1640,
11,
15614,
11,
8543,
62,
28243,
11,
7644,
198,
11748,
44161,
... | 2.491909 | 309 |
from datetime import datetime
from typing import Generic, Optional
from rx.core import typing
from rx.disposable import SingleAssignmentDisposable
from .schedulerbase import SchedulerBase
| [
6738,
4818,
8079,
1330,
4818,
8079,
198,
6738,
19720,
1330,
42044,
11,
32233,
198,
198,
6738,
374,
87,
13,
7295,
1330,
19720,
198,
6738,
374,
87,
13,
6381,
1930,
540,
1330,
14206,
8021,
16747,
7279,
1930,
540,
198,
198,
6738,
764,
141... | 3.82 | 50 |
import datetime
from dateutil import parser
from itertools import tee
from jinja2 import Template, Environment, FileSystemLoader
import os
import re
import shutil
import time
import warnings
import yaml
DEFAULT_TIME = datetime.time(9, 0)
MAX_SLUG_LENGTH = 30
def ComputePermalink(type_name, slug, created_date, perm... | [
11748,
4818,
8079,
198,
6738,
3128,
22602,
1330,
30751,
198,
6738,
340,
861,
10141,
1330,
30479,
198,
6738,
474,
259,
6592,
17,
1330,
37350,
11,
9344,
11,
9220,
11964,
17401,
198,
11748,
28686,
198,
11748,
302,
198,
11748,
4423,
346,
19... | 2.775583 | 1,671 |
"""Top-level package for TensorFlow PhaseSpace."""
import sys
if sys.version_info < (3, 8):
from importlib_metadata import PackageNotFoundError, version
else:
from importlib.metadata import PackageNotFoundError, version
try:
__version__ = version("phasespace")
except PackageNotFoundError:
pass
__auth... | [
37811,
9126,
12,
5715,
5301,
329,
309,
22854,
37535,
18983,
14106,
526,
15931,
198,
11748,
25064,
198,
198,
361,
25064,
13,
9641,
62,
10951,
1279,
357,
18,
11,
807,
2599,
198,
220,
220,
220,
422,
1330,
8019,
62,
38993,
1330,
15717,
36... | 2.843049 | 223 |
import csv
import sys
import json
if __name__ == "__main__":
sys.exit(main(sys.argv))
| [
198,
11748,
269,
21370,
198,
11748,
25064,
198,
11748,
33918,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
25064,
13,
37023,
7,
12417,
7,
17597,
13,
853,
85,
4008,
198
] | 2.421053 | 38 |
import gym
import gym.spaces
import numpy as np
import numpy.testing as nt
import pytest
from vel.exceptions import VelException
from vel.rl.buffers.backend.circular_buffer_backend import CircularBufferBackend
def get_half_filled_buffer():
""" Return simple preinitialized buffer """
observation_space = gym.s... | [
11748,
11550,
198,
11748,
11550,
13,
2777,
2114,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
299,
32152,
13,
33407,
355,
299,
83,
198,
11748,
12972,
9288,
198,
198,
6738,
11555,
13,
1069,
11755,
1330,
17378,
16922,
198,
6738,
11555,
... | 2.308472 | 6,905 |
import adafruit_fancyled.adafruit_fancyled as fancy
import board
import adafruit_dotstar
import time
num_leds = 1085
spread = 5
# Declare a NeoPixel object on pin D6 with num_leds pixels, no auto-write.
# Set brightness to max because we'll be using FancyLED's brightness control.
pixels = adafruit_dotstar.DotStar(bo... | [
11748,
512,
1878,
4872,
62,
69,
3883,
992,
13,
324,
1878,
4872,
62,
69,
3883,
992,
355,
14996,
198,
11748,
3096,
198,
11748,
512,
1878,
4872,
62,
26518,
7364,
198,
11748,
640,
198,
198,
22510,
62,
992,
82,
796,
838,
5332,
198,
43639... | 2.320635 | 315 |
l, c = [int(x) for x in input().split()]
matriz = [[0 for _ in range(c)] for _ in range(l)]
possible_sabers = []
for i in range(l):
for j, v in enumerate(input().split()):
v = int(v)
matriz[i][j] = v
if v == 42:
possible_sabers.append((i, j))
final = (0, 0)
pattern = [
(-... | [
75,
11,
269,
796,
685,
600,
7,
87,
8,
329,
2124,
287,
5128,
22446,
35312,
3419,
60,
198,
6759,
47847,
796,
16410,
15,
329,
4808,
287,
2837,
7,
66,
15437,
329,
4808,
287,
2837,
7,
75,
15437,
198,
198,
79,
4733,
62,
82,
397,
364,
... | 1.766497 | 394 |
# @param start, a string
# @param end, a string
# @param dict, a set of string
# @return a list of lists of string | [
220,
220,
220,
1303,
2488,
17143,
923,
11,
257,
4731,
198,
220,
220,
220,
1303,
2488,
17143,
886,
11,
257,
4731,
198,
220,
220,
220,
1303,
2488,
17143,
8633,
11,
257,
900,
286,
4731,
198,
220,
220,
220,
1303,
2488,
7783,
257,
1351,
... | 2.765957 | 47 |
from .nums import are_close_enough
class OpenInterval:
"""
An open interval is one where both ends aren't included.
For example, the range (2, 7) includes every number between
its two ends, 2 and 7, but the ends are excluded.
"""
@property
def length(self):
"""
Length of ... | [
6738,
764,
77,
5700,
1330,
389,
62,
19836,
62,
48229,
628,
198,
4871,
4946,
9492,
2100,
25,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
1052,
1280,
16654,
318,
530,
810,
1111,
5645,
3588,
470,
3017,
13,
628,
220,
220,
220,
1114,
... | 2.316298 | 724 |
#!/usr/bin/env python
from vtkmodules.vtkCommonCore import vtkVersion
print(vtkVersion.GetVTKSourceVersion())
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
6738,
410,
30488,
18170,
13,
85,
30488,
17227,
14055,
1330,
410,
30488,
14815,
198,
198,
4798,
7,
85,
30488,
14815,
13,
3855,
36392,
42,
7416,
14815,
28955,
198
] | 2.947368 | 38 |
"""
The :code:`pyswarms.backend` module abstracts various operations
for swarm optimization: generating boundaries, updating positions, etc.
You can use the methods implemented here to build your own PSO implementations.
"""
from .generators import *
from .operators import *
from .swarms import *
__all__ = ["generato... | [
37811,
198,
464,
1058,
8189,
25,
63,
79,
893,
5767,
907,
13,
1891,
437,
63,
8265,
12531,
82,
2972,
4560,
198,
1640,
30077,
23989,
25,
15453,
13215,
11,
19698,
6116,
11,
3503,
13,
198,
1639,
460,
779,
262,
5050,
9177,
994,
284,
1382,... | 3.782609 | 92 |
import os
import argparse
import torch
import torch.nn
from torch.utils.data import TensorDataset
import torch.backends.cudnn as cudnn
if __name__ == "__main__":
get_args()
main(args)
| [
11748,
28686,
198,
11748,
1822,
29572,
198,
198,
11748,
28034,
198,
11748,
28034,
13,
20471,
220,
198,
6738,
28034,
13,
26791,
13,
7890,
1330,
309,
22854,
27354,
292,
316,
198,
11748,
28034,
13,
1891,
2412,
13,
66,
463,
20471,
355,
269,... | 2.69863 | 73 |
#!/usr/bin/env python
# coding: utf-8
# In[ ]:
'''
# W O R K F L O W #
1. download github data in native clickhouse format (74.6 gb, ~10hours to download)
2. clickhouse server must be running
see: https://clickhouse.tech/docs/en/getting-started/install/
>sudo service clickhouse-server start (may need sudo -u jap... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
19617,
25,
3384,
69,
12,
23,
198,
198,
2,
554,
58,
2361,
25,
628,
198,
7061,
6,
198,
2,
370,
440,
371,
509,
220,
220,
376,
406,
440,
370,
220,
1303,
198,
16,
13,
4321,
33084... | 2.479904 | 7,887 |
print len([i for i in range(1000000) if is_circular_prime(i)]) | [
220,
220,
220,
220,
220,
220,
220,
220,
198,
4798,
18896,
26933,
72,
329,
1312,
287,
2837,
7,
16,
10535,
8,
611,
318,
62,
21170,
934,
62,
35505,
7,
72,
8,
12962
] | 2.21875 | 32 |
from pathlib import Path
from soopervisor.exceptions import MissingConfigurationFileError
| [
6738,
3108,
8019,
1330,
10644,
198,
198,
6738,
523,
404,
712,
271,
273,
13,
1069,
11755,
1330,
25639,
38149,
8979,
12331,
628,
628
] | 4.086957 | 23 |
import inspect
import json
from libhoney.internal import json_default_handler
class FieldHolder:
'''A FieldHolder is the generalized class that stores fields and dynamic
fields. It should not be used directly; only through the subclasses'''
def __add__(self, other):
'''adding two field holders... | [
11748,
10104,
198,
11748,
33918,
198,
6738,
9195,
71,
1419,
13,
32538,
1330,
33918,
62,
12286,
62,
30281,
628,
198,
4871,
7663,
39,
19892,
25,
198,
220,
220,
220,
705,
7061,
32,
7663,
39,
19892,
318,
262,
38284,
1398,
326,
7000,
7032,... | 2.659624 | 426 |
#!/usr/bin/env python
# -*- coding:utf8 -*-
# Power by viekie. 2017-05-27 09:23:04
import numpy as np
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
40477,
23,
532,
9,
12,
198,
2,
4333,
416,
410,
494,
49375,
13,
2177,
12,
2713,
12,
1983,
7769,
25,
1954,
25,
3023,
198,
11748,
299,
32152,
355,
45941,
6... | 2.288889 | 45 |
import os
from server import make_worker
worker = make_worker(os.getenv("FLASK_CONFIG") or "default",) | [
198,
11748,
28686,
198,
6738,
4382,
1330,
787,
62,
28816,
198,
198,
28816,
796,
787,
62,
28816,
7,
418,
13,
1136,
24330,
7203,
3697,
1921,
42,
62,
10943,
16254,
4943,
393,
366,
12286,
1600,
8
] | 2.971429 | 35 |
# Copyright 2021 Canonical Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | [
2,
15069,
33448,
19507,
605,
12052,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198,
2,
921,
74... | 3.783069 | 189 |
# Description: Run the AOBW function from the pymolshortcuts.py file to generate photorealistic effect in grayscale.
# Source: placeHolder
"""
cmd.do('cmd.do("AOBW")')
"""
cmd.do('cmd.do("AOBW")')
| [
2,
12489,
25,
220,
5660,
262,
317,
9864,
54,
2163,
422,
262,
279,
4948,
349,
19509,
23779,
13,
9078,
2393,
284,
7716,
2825,
39396,
2569,
1245,
287,
1036,
592,
38765,
13,
198,
2,
8090,
25,
220,
1295,
39,
19892,
198,
198,
37811,
198,
... | 2.716216 | 74 |
from year2021.python.day6.day6_func import *
inputStr = open('../../data/day6_data.txt').readline()
fishes = FishCreator.initFishes(inputStr)
spawn = FishSpawn()
numberOfFishes80Days = spawn.spawn(fishes, 80)
print(f"Part 1: {numberOfFishes80Days}")
numberOfFishes256Days = spawn.spawn(fishes, 256)
print(f"Part ... | [
6738,
614,
1238,
2481,
13,
29412,
13,
820,
21,
13,
820,
21,
62,
20786,
1330,
1635,
198,
198,
15414,
13290,
796,
1280,
10786,
40720,
40720,
7890,
14,
820,
21,
62,
7890,
13,
14116,
27691,
961,
1370,
3419,
198,
198,
69,
5614,
796,
1338... | 2.636364 | 132 |
from enum import Enum
from types import GeneratorType
from typing import Any, Callable, Dict, List, Set, Tuple, Union
from fastapi.logger import logger
from fastapi.utils import PYDANTIC_1
from pydantic import BaseModel
from pydantic.json import ENCODERS_BY_TYPE
SetIntStr = Set[Union[int, str]]
DictIntStrAny = Dict[U... | [
6738,
33829,
1330,
2039,
388,
198,
6738,
3858,
1330,
35986,
6030,
198,
6738,
19720,
1330,
4377,
11,
4889,
540,
11,
360,
713,
11,
7343,
11,
5345,
11,
309,
29291,
11,
4479,
198,
198,
6738,
3049,
15042,
13,
6404,
1362,
1330,
49706,
198,
... | 2.90411 | 146 |
# coding: utf-8
# Copyright (C) 2021, [Breezedeus](https://github.com/breezedeus).
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this f... | [
2,
19617,
25,
3384,
69,
12,
23,
198,
2,
15069,
357,
34,
8,
33448,
11,
685,
33,
631,
8863,
27650,
16151,
5450,
1378,
12567,
13,
785,
14,
65,
631,
8863,
27650,
737,
198,
2,
49962,
284,
262,
24843,
10442,
5693,
357,
1921,
37,
8,
73... | 1.932024 | 2,648 |
#####################################################
## Read bag from file ##
#####################################################
# First import library
import pyrealsense2 as rs
# Import Numpy for easy array manipulation
import numpy as np
import sys
np.set_printoptions(thre... | [
29113,
14468,
4242,
2,
201,
198,
2235,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4149,
6131,
422,
2393,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
22492,
201,
198,
29113,... | 2.656522 | 1,150 |
# import pytest
| [
2,
1330,
12972,
9288,
628,
198
] | 3 | 6 |