text
string
size
int64
token_count
int64
n = int(input('Qual tabuada deseja ver: ')) c=1 print(11*'=') while c <= 10: print('{} x {:2} = {}'.format(n,c,c*n)) c += 1 print(11*'=')
146
77
import argparse import json import os import matplotlib.pyplot as plt import numpy as np import tensorflow as tf import tqdm from config import Config from dataset import LJSpeech from model import DiffWave class Trainer: """WaveGrad trainer. """ def __init__(self, model, lj, config): """Initial...
8,782
2,788
# boudoir - chuchotement pantophobique # https://www.youtube.com/watch?v=KL2zW6Q5hWs # https://gist.github.com/jf-parent/c8ea7e54e30593af01512f4e21b54670 Scale.default = Scale.major Root.default = 0 Clock.bpm = 120 b1.reset() >> glass( [0], dur = 16, ).after(16, 'stop') def play1(): print('play1') p1...
1,122
555
import random import urllib.parse import sqlite3 import asyncio import aiohttp import discord from discord.ext import commands import loadconfig class fun(commands.Cog): def __init__(self, bot): self.bot = bot async def cog_command_error(self, ctx, error): print('Error in {0.comm...
14,101
4,655
# !/usr/bin/env python # -*- coding: utf-8 -*- import base64 import json import copy import socket import subprocess import six class SSR: class Service: def __init__(self, conf): self.conf = conf def update(self, array): self.conf.update(array) def port_open(self...
3,362
912
"""Build beta detail models for the API""" import enum from typing import Dict, Optional import deserialize from asconnect.models.common import BaseAttributes, Links, Relationship, Resource class ExternalBetaState(enum.Enum): """External beta state.""" PROCESSING = "PROCESSING" PROCESSING_EXCEPTION = ...
1,866
709
import math from plotter import Plotter from plots import LinePlot import board import digitalio import busio import adafruit_sdcard import storage from adafruit_bitmapsaver import save_pixels def plot(): sines = list(math.sin(math.radians(x)) for x in range(0, 361, 4)) lineplot...
922
373
from os import listdir import subprocess for f in listdir("tests/vulkan"): if f.endswith(".spv"): continue print(f"-- compiling test {f}") p = subprocess.run(["glslangValidator", f"tests/vulkan/{f}", "-H", "-o", f"tests/vulkan/{f}.spv"], shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)...
385
143
# Taken straight from Patter https://github.com/ryanleary/patter # TODO: review, and copyright and fix/add comments import torch from torch.utils.data import Dataset from .manifest import Manifest def seq_collate_fn(batch): def find_max_len(seq, index): max_len = -1 for item in seq: i...
5,769
1,755
""" ~~~ IMPORT EXPERIMENTAL DATA, PROCESS, AND NONDIMENSIONALIZE ~~~ This code reads in the rescaled Snodgrass data and compares parameters to known parameters found in the Henderson and Segur paper. 1. Get distances 2. Read in the gauge data for each event (get frequencies and Fourier magnitudes) 3. Adjust the y ax...
5,277
1,976
from .rip import *
19
7
# -*- coding: utf-8 -*- # Time : 2022/1/17 15:20 # Author : QIN2DIM # Github : https://github.com/QIN2DIM # Description: import os.path import time from hashlib import sha256 from typing import List, Optional, Union, Dict import cloudscraper import yaml from lxml import etree # skipcq: BAN-B410 - Ignore...
15,542
5,893
import torch import torch.nn as nn from torch.nn import functional as F class LinearNorm(nn.Module): def __init__(self, in_features, out_features, activation=None, use_bias=True, kernel_initializer='glorot_uniform', bias_initializer='zeros'): super(LinearNorm, self).__init__() ...
7,312
2,408
# Copyright 2020 Google LLC # # 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, ...
2,186
630
from enum import Enum from typing import ( Any, Dict, ) from galaxy import ( exceptions, model, ) from galaxy.managers import hdas from galaxy.managers.context import ProvidesUserContext from galaxy.managers.jobs import ( JobManager, JobSearch, view_show_job, ) from galaxy.schema.fields imp...
2,306
705
import pytest import numpy as np from deephub.models.registry.toy import DebugToyModel from deephub.models.feeders import MemorySamplesFeeder from deephub.trainer import Trainer @pytest.mark.slow def test_early_stopping(tmpdir): model_params = { 'type': 'toy:DebugToyModel', 'model_dir': str(tmpd...
1,984
668
from typing import TYPE_CHECKING import pytest from . import CapturedOutput from utsc.switchconfig import config from prompt_toolkit.application import create_app_session from prompt_toolkit.input import create_pipe_input if TYPE_CHECKING: from .. import MockedUtil from pytest_mock import MockerFixture @p...
2,157
664
# Copyright (c) 2014, HashFast Technologies LLC # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of...
10,742
3,712
from django.db import models from django.conf import settings from courses.models import Course # Create your models here. class Update(models.Model): user = models.ForeignKey( settings.AUTH_USER_MODEL, on_delete=models.CASCADE, null=True ) course = models.ForeignKey(Course, on_...
561
176
import argparse import os import re import sys from operator import itemgetter from typing import Optional import sentry_sdk import youtube_dl from selenium.common.exceptions import SessionNotCreatedException from cmd_tool import ( get_execution_path, exit_enter, get_input_path_or_exit, get_chrome_dri...
11,162
4,333
# -*- coding: utf-8 -*- import os import io import urllib2 import string from BeautifulSoup import BeautifulSoup import pandas as pd import sys city_url = 'http://twblg.dict.edu.tw/holodict_new/index/xiangzhen_level1.jsp?county=1' def extract_items(base_url): html = urllib2.urlopen(base_url).read() ...
1,338
589
import csv #global variables for teams: sharks = [] dragons = [] raptors = [] #read the csv file with the player info and create a player dictionary: def read_players(): player_reader = csv.reader(open('soccer_players.csv')) player_dictionary = {} for row in player_reader: key = row[0] play...
3,729
1,173
import wpilib import wpilib.drive import ctre import robotmap from wpilib.interfaces import GenericHID RIGHT_HAND = GenericHID.Hand.kRight LEFT_HAND = GenericHID.Hand.kLeft class Robot(wpilib.TimedRobot): def robotInit(self): front_left_motor = ctre.WPI_TalonSRX(robotmap.mecanum['front_left_motor']) ...
2,312
833
from django.contrib import admin from django.urls import path from .views import blog urlpatterns = [ path('', blog, name='blog'), ]
139
42
#!/usr/bin/env python from iris_sdk.models.maps.base_map import BaseMap class LocalRateCenterListMap(BaseMap): rate_center_id = None
139
48
import re import traceback import urllib2 import pandas as pd import json,random,time,datetime from bs4 import BeautifulSoup from pandas.tseries.offsets import YearEnd from sqlalchemy import text from webapp import db, app from webapp.models import FinanceBasic headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Wind...
5,374
2,255
import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_sets('MNIST_data', one_hot = True) # Network hyperparameters learning_rate = 0.0001 # 1.95 for sigmoid activation function batch_size = 10 update_step = 10 input_nodes = 784 # 28x38 images as input layer_1_...
2,555
942
class Solution(object): def isHappy(self, n): """ :type n: int :rtype: bool """ seen = set() while (True): sumOfSquaredDigits = 0 while n > 0: digit = n % 10 n = n // 10 sumOfSquaredDigits += digi...
1,157
340
from dataclasses import dataclass, field from dataclazzes.track import Track @dataclass class Playlist: """Class for storing playlist information.""" id: str title: str tracks: [Track] = field(default_factory=list) @staticmethod def from_raw(raw_playlists: list): return [ ...
434
127
#!/usr/bin/env python3 # pylint: disable=C0103 """ Définie la classe entity Permet de modeliser le personnage et des monstre """ from random import choice from vect import Vect from astar import calc_path_astart import chars class Player(): """ Classe Player : """ BULLET_MAX = 10 HP_MAX = 10 ...
9,091
2,962
import streamlit as st def app(): import plotly.express as px import plotly.graph_objects as go from textblob import TextBlob import tweepy import sys import pandas as pd api_key = 'q7QHHHAKEwd5igoUvVrx5sCiw' api_secret_key = 'i7uhcFirM38bnbYscv32beJnMpsmMxFdYSHitwfSCPIeMj7L...
3,488
1,276
import unittest import logging from varfilter import varfilter, filter class TestVarfilter(unittest.TestCase): def setUp(self): print("Preparando el contexto") self.source1 = {"teststr1": "Value teststr1", "testint1": 10} self.source2 = {"teststr2": "Value teststr2...
2,447
668
"""Test cases for Arithmatex.""" from .. import util class TestArithmatexLimit(util.MdCase): """Test limiting Arithmatex inline and block inputs.""" extension = [ 'pymdownx.arithmatex' ] extension_configs = {'pymdownx.arithmatex': {'inline_syntax': ['round'], 'block_syntax': ['square']}} ...
4,989
1,756
# -*- coding: utf-8 -*- from setuptools import setup setup( name="UrRtde", packages=["rtde"], version=1.0, description="Real-Time Data Exchange (RTDE) python client + examples", )
197
71
""" Task: Given a roman numeral, convert it to an integer. Input is guaranteed to be within the range from 1 to 3999. Symbol Value I 1 (unus) V 5 (quinque) X 10 (decem) L 50 (quinquaginta) C 100 (centum) D 500 (quingenti) M 1,000 (mille) >>> roman_to_int("DCXXI") 621 >>> roman_to_int("VI") 6 >>> roman_to_int...
891
401
import mock import pytest from rump import parser, Server, Upstream, Selection, exc @pytest.fixture def parse(): return parser.for_upstream() def test_upstream_valid(parse): cases = [ ('hi', Upstream(Selection(Server('http', 'hi'), 1))), ('https://hi', Upstream(Selection(S...
2,082
669
from django.contrib import admin from places.models import County, Constituency, Province, District from places.models import Division, Location, SubLocation, SchoolZone class CountyAdmin(admin.ModelAdmin): search_fields = ['name'] class ProvinceAdmin(admin.ModelAdmin): search_fields = ['name'] class Dis...
1,113
322
"""pyGEEMs: Geotechnical earthquake engineering models implemented in Python.""" import pathlib from pkg_resources import get_distribution import scipy.constants FPATH_DATA = pathlib.Path(__file__).parent / "data" KPA_TO_ATM = scipy.constants.kilo / scipy.constants.atm __author__ = "Albert Kottke" __copyright__ = "...
520
181
from tkinter import * from tkinter.ttk import * # creando ventana tkinter root = Tk() # Agregando herramientas a la ventana Label(root, text = 'PuntosExtra', font =( 'Verdana', 15)).pack(side = TOP, pady = 10) # Insertando la imagen de login foto = PhotoImage(file = r"C:\Users\david\OneDrive\Imágenes\lo...
414
170
from django.conf.urls import patterns, url, include from corehq.apps.api.urls import CommCareHqApi from custom.ewsghana.resources.v0_1 import EWSLocationResource from custom.ewsghana.views import EWSConfigView, EWSGlobalStats, InputStockView, EWSUserExtensionView, \ DashboardRedirectReportView hq_api = CommCareHqA...
2,200
839
import numpy as np from scipy.spatial.distance import cdist import sys from plot_area import plot_area COLOR = ['tab:blue', 'tab:orange', 'tab:green'] class BaseClassifier: d = -1 c = -1 def __init__(self, d): super().__init__() if (d <= 0): raise RuntimeError("Classifier.D/...
9,288
2,865
import sys from utils import * class DiscussManager: def add_discuss(self, problem_id: int, username: str, data: str): db = db_connect() cursor = db.cursor() try: cursor.execute("INSERT INTO Discuss(Problem_ID, Username, Data, Time) VALUES(%s, %s, %s, %s)", ...
1,920
581
import math, sys, random, mcint from scipy import integrate import numpy as np gap = float(sys.argv[1]) lam = float(sys.argv[2]) print(gap, lam) ## calculate the yukawa force over a distributed test mass assumed to be cube D = 5 # diameter of bead (um) rhob = 2e3 # density bead (kg/m^3) rhoa = 19.3e3 # density attr...
1,977
834
import logging from typing import ( Dict, Awaitable, Callable, Any, Set, List, Optional, TYPE_CHECKING) from opentrons.types import Mount, Point, Location from opentrons.config import feature_flags as ff from opentrons.hardware_control import ThreadManager, CriticalPoint from opentrons.protocol_api import labwa...
8,823
2,697
'''Autogenerated by xml_generate script, do not edit!''' from OpenGL import platform as _p, arrays # Code generation uses this from OpenGL.raw.WGL import _types as _cs # End users want this... from OpenGL.raw.WGL._types import * from OpenGL.raw.WGL import _errors from OpenGL.constant import Constant as _C imp...
1,572
789
from collections import namedtuple import inspect from django import forms FormFieldWarning = namedtuple("FormFieldWarning", ["message", "description"]) class WarningFormMixin: """Classes using WarningFormMixin should implement methods to catch warnings >>> def warning_mailboxes(self) -> List[FormFieldWarn...
1,885
445
print("Hello, World! Again!")
29
10
from numpy import array, arange, argmax from numpy.random import choice from itertools import product from ai.NN import NN import pickle from random import random, randrange, randint from collections import deque from math import floor class AI: MEMORY_DIMENSION = 90000 def __init__(self, load: bool = False,...
8,791
2,721
print('=' * 12 + 'Desafio 49' + '=' * 12) numero = int(input('Digite o número para a tabuada: ')) print('=' * 13) print(f'Tabuada do {numero}') print('=' * 13) for i in range(1,11): print(f'{numero} x {i:2} = {numero * i}') print('=' * 13)
243
121
import pretty_midi import sys import numpy as np from tqdm import tqdm from collections import Counter sys.path.append('..') from Pre_Production.Midi_Pre_Processor import * from Shared_Files.Global_Util import * class MusicPallete: def __init__(self, pre_processor_obj): self.__all_possible_instr_note_pai...
1,686
563
#!/usr/bin/env python # -*- coding: utf-8 -*- # # launches the unit testing # # Copyright (C) # Honda Research Institute Europe GmbH # Carl-Legien-Str. 30 # 63073 Offenbach/Main # Germany # # UNPUBLISHED PROPRIETARY MATERIAL. # ALL RIGHTS RESERVED. # # import os import tempfile import unittest from ToolBOSCo...
1,408
474
#!/usr/bin/env python # # Module for adding Google Calendar Functionality. # # by Peter Juett # References:https://developers.google.com/calendar/quickstart/python # # Copyright 2018 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. #...
9,566
2,685
# -*- coding: utf-8 -*- """ For an example page see: http://www.jneurosci.org/content/23/10/4355.long#ref-list-1 Note that JNeuroscience seems to be part of a consortium with J Physiology, J Neurophysiology, PNS, etc perhaps check out HighWire Press? """ import requests from bs4 import BeautifulSoup class JNeuros...
1,705
666
# coding: utf-8 from __future__ import annotations import re # noqa: F401 from datetime import date, datetime # noqa: F401 from typing import Any, Dict, List, Optional # noqa: F401 from pydantic import AnyUrl, BaseModel, EmailStr, validator # noqa: F401 class CreateMetric(BaseModel): """NOTE: This class is...
1,089
327
from .la_initiator_bfm import *
32
15
#!/usr/bin/env python3 import h5py import numpy as np import argparse import os import seissolxdmf as sx import seissolxdmfwriter as sw # These 2 latter modules are on pypi (e.g. pip install seissolxdmf) def read_reshape2d(sx, dataname): """read seissol dataset and if there is only one time stamp create...
6,940
2,614
from django.urls import path from . import views urlpatterns = [ path('', views.home_P, name='home_P') ]
110
39
def count_bit_sum(N): bit = [0] * max_bitlen if N <= 0: return bit[:] for i in range(N.bit_length() - 1): bit[i] = 1 << (N.bit_length() - 2) bit[N.bit_length()-1] = N - (1 << (N.bit_length() - 1)) + 1 return [bit[i] + b for i, b in enumerate(count_bit_sum(N - (1 << (N.bit_length() - ...
538
245
# Copyright 2012 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # any later version. # # G...
2,639
832
# -*- coding: utf8 -*- # announcement # helper class for toprace # Alfredo Martin 2021 import pygame version = 'announcement.v.1.0.0' class Announcement: def __init__(self, screen=None, text='', time=5, color=(255, 0, 0)): """initiallizes the Announcement instance screen: pygame canvas instance...
1,262
411
""" Implement regularization policies here """ import torch import torch.nn as nn from policies.policy import PolicyBase import logging def build_reg_from_config(model, reg_config): """ This function build regularizer given the model (only need for weigths typically) and regularizer configuration. ""...
3,633
1,095
from django.db import models from django.utils import timezone from stores.models import Store class Coupon(models.Model): SCOPE_CHOICES = [ ('I', 'Toàn bộ hoá đơn'), ('P', 'Sản phẩm'), ] BENEFICIARY_CHOICES = [ ('E', 'Mọi khách hàng'), ('N', 'Khách hàng hệ thống'), ...
938
346
#!/usr/bin/env python # encoding: utf-8 """ @author: zhanghe @software: PyCharm @file: inventory.py @time: 2018-06-28 00:22 """ from __future__ import unicode_literals from flask import jsonify, make_response from flask_restful import Resource, marshal, reqparse from web_api.bearings.outputs.inventory import field...
5,527
1,801
#!/usr/bin/env python # from bob.bio.spear.database import AudioBioFile import bob.bio.base import bob.io.base import bob.io.video from bob.extension import rc from .common import SwanVideoFile, SwanAudioFile, SwanVideoDatabase # class SwanAudioBioFile(SwanAudioFile, AudioBioFile): # """SwanAudioBioFile are vide...
2,141
585
from tokenizer import StringTokenizer from token import tokentype text = open('test.ex', 'r').read() t = StringTokenizer(text=text, tokentype=tokentype) token_generator = t.create_token_generator() print(token_generator)
226
76
#!/usr/bin/smilx '''========================================================================= The Software is copyright (c) Commonwealth Scientific and Industrial Research Organisation (CSIRO) ABN 41 687 119 230. All rights reserved. Licensed under the CSIRO BSD 3-Clause License You may not use this file exc...
2,008
628
expected_output ={ "lentry_label": { 24: { "aal": { "deagg_vrf_id": 0, "eos0": {"adj_hdl": "0xf9000002", "hw_hdl": "0x7f02737e2ca8"}, "eos1": {"adj_hdl": "0xf9000002", "hw_hdl": "0x7f02737e2a98"}, "id": 1996488716, "...
6,887
2,421
#!/usr/bin/env python3 import nose.tools as nose from cachesimulator.bin_addr import BinaryAddress from cachesimulator.word_addr import WordAddress def test_get_bin_addr_unpadded(): """get_bin_addr should return unpadded binary address of word address""" nose.assert_equal( BinaryAddress(word_addr=Wo...
3,610
1,363
class Vector(object,IFormattable): """ Represents a displacement in 2-D space. Vector(x: float,y: float) """ @staticmethod def Add(*__args): """ Add(vector: Vector,point: Point) -> Point Translates the specified point by the specified vector and returns the resulting point. ...
10,347
3,372
import random import math from collections import OrderedDict class BinaryEightQueensEnhancedNum: def __init__(self, populationSize, crossOverMethod=1, selectMethod=1, mutationMethod=1, entireFit=False): ''' inicializa a classe. @params populationSize o tamanho da população. ''' ...
6,869
1,987
def coding_problem_07(s): """ Given the mapping a = 1, b = 2, ... z = 26, and an encoded message, count the number of ways it can be decoded. Examples: >>> coding_problem_07('111') # possible interpretations: 'aaa', 'ka', 'ak' 3 >>> coding_problem_07('2626') # 'zz', 'zbf', 'bfz', 'bfbf' 4...
639
246
# django imports from django.conf import settings from django.contrib.auth.decorators import permission_required from django.http import HttpResponse # lfs imports from lfs.core.utils import import_symbol @permission_required("core.manage_shop") def add_criterion(request): """ Adds a new criterion form. ...
1,201
372
# Generated by Django 3.1.7 on 2021-05-26 12:56 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('apps', '0054_auto_20210525_1114'), ] operations = [ migrations.AddField( model_name='appinstance', name='access', ...
428
153
# COMO TRABALHAMOS MUITO COM ROTINAS, CRIAR UMA FUNÇÃO E CHAMA-LA NO CÓDIGO FACILITA MUITO NÃO TER QUE ESCREVER A MESMA LINHA VÁRIAS VEZES # USAMOS O COMANDO DEF PARA DECLARAR UMA FUNCAO, DEPOIS UM NOME PARA A FUNÇÃO EX: # def nomeDaFuncao(): # # BLOCO COM O CÓDIGO QUE DESEJA QUE SEJÁ EXECULTADO NA CHAMADA DA FUNÇ...
1,512
758
''' Tests for seg2toph5 ''' import os import sys import unittest import logging from mock import patch from testfixtures import OutputCapture, LogCapture from ph5.utilities import seg2toph5, initialize_ph5 from ph5.core.tests.test_base import LogTestCase, TempDirTestCase,\ initialize_ex from ph5.core import ph5ap...
5,160
2,229
from .dreamer import Dreamer
29
10
import time from zcash.node import * node1 = Node(8002, "node 1") node1.start() # wait for string time.sleep(2) node1.print_blockchain() time.sleep(2) node2 = Node(8003, "node 2") node2.start() # wait for string time.sleep(2) node2.print_blockchain() node1.get_balance() node2.get_balance() # node1 mint and...
1,251
568
from common_python.tellurium import util import pandas as pd import numpy as np import unittest class TestFunctions(unittest.TestCase): def testDfToSer(self): data = range(5) df = pd.DataFrame({'a': data, 'b': [2*d for d in data]}) ser = util.dfToSer(df) assert(len(ser) == len(df.columns)*len(df))...
822
324
# -*- coding: utf-8 -*- # © 2017 Sunflower IT (http://sunflowerweb.nl) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from openerp import fields, models, api, _ from openerp.exceptions import Warning class AccountInvoice(models.Model): _inherit = 'account.invoice' @api.multi def release...
535
194
import configparser import logging import threading from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium import webdriver logger = logging.getLogger(__name__) class SeleniumWorker(threading....
4,205
1,113
#!/usr/bin/env python # -*- coding: utf-8 -*- # """The setup.py file.""" import os import sys from setuptools import find_packages, setup from setuptools.command.install import install VERSION = "0.3.15" URL = "https://github.com/zxdavb/evohome-async" with open("README.md", "r") as fh: LONG_DESCRIPTION = fh.re...
1,595
525
#!/usr/bin/env python # Copyright (c) 2019 - The Procedural Generation for Gazebo authors # For information on the respective copyright owner see the NOTICE file # # 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...
74,403
20,640
#!/usr/bin/env python import rospy import numpy as np import pickle import time import socket from rospy.numpy_msg import numpy_msg from radbot_nuke.msg import detector_msg rospy.init_node('detServer', anonymous=False) pub = rospy.Publisher('/detector_data', detector_msg, queue_size=10) def send_ros_msg(ts, adc, de...
3,646
1,281
import re from itertools import chain from collections import defaultdict, namedtuple import pandas as pd from tqdm import tqdm Address = namedtuple('Address', ['to', 'kai', 'ku', 'mune', 'chome', 'ban', 'go', 'postal', 'endgo', 'tokens']) class Postman: """ Converts Japanese...
3,166
1,161
from setuptools import setup, find_packages with open('requirements.txt') as f: install_requires = f.read().strip().split('\n') # get version from __version__ variable in vitalpbx/__init__.py from vitalpbx import __version__ as version setup( name='vitalpbx', version=version, description='Something', author='So...
476
160
for g in range(int(input())): n, k = [int(x) for x in input().split()] v = [1 for x in range(1, n+1)] m = 0 i = p = 1 while (m < n-1): if v[i] == 1: p += 1 if p == k: v[i] = 0 m += 1 p = 0 i += 1 if i == n: i = 0 i = 0 while...
381
172
#!/usr/bin/env python3 # Copyright (c) 2020 Jarret Dyrbye # Distributed under the MIT software license, see the accompanying # file LICENSE or http://www.opensource.org/licenses/mit-license.php import time import sys import json import argparse from twisted.internet import reactor from twisted.internet.task import Loo...
8,215
2,554
#!/usr/bin/env python3 from __future__ import print_function from rosflight_holodeck_interface import ROSflightHolodeck import numpy as np import matplotlib.pyplot as plt from tqdm import tqdm import time import holodeck from holodeck import agents from holodeck.environments import * from holodeck import sensors from I...
4,078
1,539
# -*- coding: utf-8 -*- # <nbformat>3.0</nbformat> # <codecell> from IPython.display import HTML # <markdowncell> # #Graphing Calculator - inspired by AP Calculus # Graphing calculators are permitted for use during "calculator active" problems on AP exams. Here we attempt to provide open access to those functionali...
6,762
2,010
# The MIT License (MIT) # Copyright (c) 2017 Massachusetts Institute of Technology # # Authors: Cody Rude # This software is part of the NSF DIBBS Project "An Infrastructure for # Computer Aided Discovery in Geoscience" (PI: V. Pankratius) and # NASA AIST Project "Computer-Aided Discovery of Earth Surface # Deformation...
3,294
963
# -*- coding: utf-8 -*- # # on_rtd is whether we are on readthedocs.org import os import sys sys.path.insert(0, os.path.abspath('.')) sys.path.append(os.path.abspath('extensions')) extensions = [ 'sphinx.ext.graphviz', 'sphinx.ext.todo', 'wikipedia', 'examplecode' ] on_rtd = os.environ.get('READTHEDOC...
997
392
test_input = [4, 8] puzzle_input = [4, 9] def part1(): position = puzzle_input score = [0,0] die_roll = 0 num_rolls = 0 cur_player = 0 while True: die_total = 0 for _ in range(3): num_rolls += 1 die_roll += 1 if die_roll > 100: ...
2,372
798
from typing import Optional import numpy as np import matplotlib.pyplot as plt from matplotlib.axis import Axis from matplotlib.patches import Rectangle from superresolution import SIM_3D_Data def make_axis_if_none(ax: Optional[Axis]) -> Axis: if ax is None: _, ax = plt.subplots(1, 1, figsize = (10, 10))...
1,666
628
#!/usr/bin/python2 import pyghmi.util.webclient as webclient import json import os import sys missingargs = False if 'XCCUSER' not in os.environ: print('Must set XCCUSER environment variable') missingargs = True if 'XCCPASS' not in os.environ: print('Must set XCCPASS environment variable') missingargs ...
1,097
382
from github import Github from my_token import token g = Github(token) repo = g.get_repo("adafruit/Adafruit_CircuitPython_Display_Text") repo_topics = repo.get_topics() print(repo_topics)
193
74
import hashlib import os import tempfile import numpy as np import fcswrite def test_write_fcs(): """test that fcm can read the data files""" fname = tempfile.mktemp(suffix=".fcs", prefix="write_test") data = 1.0*np.arange(400).reshape((100, 4)) chn_names = ['cha', 'chb', 'ch3', 'ch4'] # monkey-...
1,200
449
from moviepy.editor import VideoFileClip from datetime import datetime import numpy as np import time import os def manage_time(timestamp): """ Given the string representation of a the time using the "minutes:seconds[:miliseconds]" representation, returns the number of seconds using double precision ...
1,810
604
#!/usr/bin/env python def get_localization(args): # TODO: Implement the localization fitting the centers pass
119
36
import snap G = snap.GenFull(snap.PNEANet, 100) # get a new random generator, provide the seed value Rnd = snap.TRnd(42) # randomize the generator, every execution will produce a different sequence. # Comment out the line to get the same sequence on every execution. Rnd.Randomize() for i in range(0,10): # provi...
505
162
print("Thank you Jesus") # Read a value from standard input a value # input("Thank you") # Evaluate expression x = 1 print(x) x += 3 print(x) # loops if x > 1: print("great than 1") else: print("less than 1") n = 3 while n > 1: print(n) n -= 1 # Arithmetic operator print({100 % 3}, {100 / 3}) z =...
1,846
793