text
string
size
int64
token_count
int64
# -*- coding: utf-8 -*- from django.contrib.auth.models import User from rest_framework import authentication from rest_framework import exceptions from notifai_recruitment import settings class MasterKeyNaiveAuthentication(authentication.BaseAuthentication): """Authentication model for master key. Note: ...
1,663
392
import panel as pn def main(): text_error = """ This is not formatted correctly by Markdown due to the indentation!""" text_ok = """ This is formatted correctly by Markdown! """ app = pn.Column( pn.pane.Markdown(text_error), pn.pane.HTML( "<hr>", si...
435
156
# Vax-Man, a re-implementation of Pacman, in Python, with PyGame. # Forked from: https://github.com/hbokmann/Pacman # Edited by Melwyn Francis Carlo (2021) # Video link: https://youtu.be/ZrqZEC6DvMc import time import pygame # Ghosts multiply themselves every thirty seconds. GHOST_MULTIPLICATION_TIME_GAP = 30 # Th...
18,257
7,088
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. import numpy as np from maro.rl import AbstractStateShaper class ECRStateShaper(AbstractStateShaper): def __init__(self, *, look_back, max_ports_downstream, port_attributes, vessel_attributes): super().__init__() self._look_...
1,320
410
from os import listdir from os.path import join, isfile import json from random import randint ######################################### ## START of part that students may change from code_completion_baseline import Code_Completion_Baseline training_dir = "./../../programs_800/" query_dir = "./../../programs_200/" m...
2,834
877
from pathlib import Path from textwrap import dedent from superhelp import conf from superhelp.conf import Level, Theme from superhelp.formatters.cli_extras import md2cli from superhelp.formatters.cli_extras.cli_colour import set_global_colours from superhelp.gen_utils import (get_code_desc, get_intro, get_line_nu...
4,491
1,423
#------------------------------------------------------------------------------ # Copyright (c) 2013, Enthought, Inc. # All rights reserved. #------------------------------------------------------------------------------ from .catom import ( Member, DEFAULT_FACTORY, DEFAULT_VALUE, USER_DEFAULT, VALIDATE_INSTANCE,...
4,941
1,255
# coding=utf-8 # *** WARNING: this file was generated by crd2pulumi. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** SNAKE_TO_CAMEL_CASE_TABLE = { "access_modes": "accessModes", "api_group": "apiGroup", "api_version": "apiVersion", "app_protocol": "appProtocol", ...
4,744
1,564
from flask import Flask, render_template from config import configs from .extensions import login_manager, db from .account import account from .frontend import frontend from webapp.session import RedisSessionInterface def create_app(config_name): app = Flask(__name__) app.config.from_object(configs[config_n...
1,416
481
from typing import Callable class Knapsack: @staticmethod def best_value( capacity: int, sizes: list, values: list, quantities, min_max: Callable = max, zero_capacity_value=0, fill_to_capacity=True, output_item_list=True ): if capacit...
27,723
8,635
__version__ = """1.19.0"""
26
14
from django.conf.urls import url, patterns from .views import tutorial_email, tutorial_message urlpatterns = patterns("", # flake8: noqa url(r"^mail/(?P<pk>\d+)/(?P<pks>[0-9,]+)/$", tutorial_email, name="tutorial_email"), url(r"^message/(?P<pk>\d+)/$", tutorial_message, name="tutorial_message"), )
309
113
from setuptools import setup, find_packages setup( name='gigalixir', url='https://github.com/gigalixir/gigalixir-cli', author='Jesse Shieh', author_email='jesse@gigalixir.com', version='1.1.10', packages=find_packages(), include_package_data=True, install_requires=[ 'click~=6.7'...
895
340
import os import unittest dir_path = os.path.dirname(os.path.realpath(__file__)) suite = unittest.TestLoader().discover(dir_path, pattern='test_*.py') result = unittest.TextTestRunner(verbosity=3).run(suite) print(result) assert result.wasSuccessful()
254
87
import pytest from pydent.models import Plan def test_plan_constructor(fake_session): g = fake_session.Plan.new() assert g.name is not None print(g.plan_associations) assert g.operations is None assert g.wires == [] g = Plan(name="MyPlan", status="running") assert g.name == "MyPlan" ...
6,145
2,166
# -*- coding: utf-8 -*- # Generated by Django 1.11.27 on 2020-06-08 22:10 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('gymkhana', '0006_form_available'), ] operations = [ migrations.RemoveField...
611
205
import os import pygame import random trigger = False x = 0 y = 0 height = 720 width = 1280 linelength = 50 lineAmt = 20 displace = 10 xpos = [random.randrange(-200,1280) for i in range(0, lineAmt + 2)] xpos1 = [(xpos[i]+displace) for i in range(0, lineAmt + 2)] xr = 360 yr = 240 def setup(screen, etc): global trigg...
1,899
845
# # Metrix++, Copyright 2009-2019, Metrix++ Project # Link: https://github.com/metrixplusplus/metrixplusplus # # This file is a part of Metrix++ Tool. # import mpp.api class Plugin(mpp.api.Plugin, mpp.api.IConfigurable, mpp.api.Child, mpp.api.MetricP...
2,577
815
def flatten(aList): ''' aList: a list Returns a copy of aList, which is a flattened version of aList ''' if aList == []: return aList if type(aList[0]) == list: return flatten(aList[0]) + flatten(aList[1:]) return aList[:1] + flatten(aList[1:]) aList = [[1, 'a', ['cat'], 2...
447
187
""" Usage: Call get_svo_env(env_class) to get the real env class! """ from collections import defaultdict from math import cos, sin import numpy as np from gym.spaces import Box from metadrive.envs.marl_envs.marl_tollgate import TollGateObservation, MultiAgentTollgateEnv from metadrive.obs.state_obs import LidarStateO...
9,960
3,305
from get_html.html_renderer import HtmlRenderer import pytest import re @pytest.fixture(scope='module') def renderer(): r = HtmlRenderer() try: yield r finally: r.close() def test_response(renderer: HtmlRenderer): url = 'http://www.twitter.com' # this will redirect to https://twitt...
1,995
710
import sys import os import ntpath def readFile(filePath): with open(filePath, "r") as file: return file.read() def writeToDisk(filePath, stringToSave): with open(filePath, "w+") as newFile: newFile.write(stringToSave) def main(): filePath = os.path.abspath("./qt-includes.txt") stuf...
724
253
__author__ = "Henning Schmitz" import numpy as np def calculate_hounsfield_unit(mu, mu_water, mu_air): """ Given linear attenuation coefficients the function calculates the corresponding Hounsfield units. :param mu: Attenuation coefficient to determine corresponding Hounsfield unit. :param mu_...
2,205
699
# -*- coding: utf-8 -*- #!/usr/bin/env python ## last modified by Robert Liu at 7/29/2019 ## This script is used to extract data (and WCS info) in the image extension of a coadd patch. ## Ext 0 = primaryHDU, Ext 1 = image, Ext 2 = mask, Ext 3 = variancce. ## Then, the output fits file can be used by SWarp to assemble a...
1,028
386
global loaded_model
22
9
from .env import S3_PREFIX def respond(body=None, mime="text/plain", code=200, headers={}): h = {"Content-Type": mime} h.update(headers) return {"statusCode": code, "body": body, "headers": h} def fn(keyword): return f'{S3_PREFIX}{keyword}.xml' def fix(filename): return filename[len(S3_PREFIX...
326
126
import serial class Agilent34970A: def __init__(self): self.timeout = 10 self.baudrate = 4800 self.bytesize = serial.EIGHTBITS self.parity = serial.PARITY_NONE self.stopbits = serial.STOPBITS_ONE xonxoff = True self.s = serial.Serial(port='/dev/ttyUSB3', time...
4,071
1,457
# (C) Copyright 2010-2020 Enthought, Inc., Austin, TX # All rights reserved. import unittest import sys import os from unittest import mock from click.testing import CliRunner import force_wfmanager.gui.run from force_wfmanager.tests.dummy_classes.dummy_wfmanager import \ DummyWfManager from force_wfmanager.ve...
2,318
743
from cadastrarJogador import cadastra_jogador from cadastrarMonstros import cadastra_monstro from atualizaJogador import atualiza from combate import combate_iniciado while True: print('Bem vindo ao RPG selecione a opรงรฃo desenjada') print('[0] - Cadastrar Novo Jogador\n[1] - Atualizar Jogador\n[2] - Cadastrar N...
675
262
""" Custom user model for deployments. """ import urllib import hashlib import base64 import random from authtools.models import AbstractEmailUser from django.db import models from django.utils.translation import ugettext_lazy as _ from django.db.models.signals import post_save from .managers import DeployUserManage...
4,354
1,438
import tensorflow as tf from tensorflow.contrib import slim def head(endpoints, embedding_dim, is_training, weights_regularizer=None): predict_var = 0 input = endpoints['model_output'] endpoints['head_output'] = slim.fully_connected( input, 1024, normalizer_fn=slim.batch_norm, normalizer_pa...
1,007
317
from topbeat import BaseTest import os import shutil import time """ Contains tests for base config """ class Test(BaseTest): def test_invalid_config(self): """ Checks stop when input and topbeat defined """ shutil.copy("./config/topbeat-input-invalid.yml", os...
1,144
353
# -*- coding: utf-8 -*- """ Throughout my travels I've discovered that most people, including myself, do not realise many things about our Planet's size. For example, the latitude and longitude of certain regions (South America is much further east than the US) or the relative size of countries (Japan is surprisingly l...
7,133
2,905
# -*- coding: utf-8 -*- # Importing Libraries """ # Commented out IPython magic to ensure Python compatibility. import torch import numpy as np import pandas as pd import seaborn as sns import matplotlib.pyplot as plt import torch.nn as nn from tqdm import tqdm_notebook from sklearn.preprocessing import MinMaxScaler...
7,252
2,463
# -*- coding: utf-8 -*- import asyncio import enum import json import logging import random import time import uuid from typing import * import aiohttp import tornado.websocket import api.base import blivedm.blivedm as blivedm import config import models.avatar import models.translate import models.log logger = logg...
22,929
7,401
import argparse import os import sys import time import torch import torch.nn.functional as F import torchvision import models, lib cfg = lib.config.BaseConfig() cfg.parse() print('Preparing model') gen_model = cfg.gen_function( upsample=cfg.upsample, map_size=cfg.map_size, out_dim=cfg.out_dim) disc_model...
954
379
# https://leetcode.com/problems/minimum-area-rectangle/description/ """ Given a set of points in the xy-plane, determine the minimum area of a rectangle formed from these points, with sides parallel to the x and y axes. If there isn't any rectangle, return 0. Example 1: Input: [[1,1],[1,3],[3,1],[3,3],[2,2]] Outp...
1,475
524
'''Functions writing the needed informations in the google drive spreadsheet From CP, RTT and holidays request : create a worksheet per employee -- write_info_in_worksheet(info_paie, out_attente, out_valide, name, sh, problemes_date, problemes_type_conge) ''' from google_sheet_access import * # Write in worksheet a...
3,002
1,221
ad1 = input(f"Adjective1: ") ad2 = input(f"Adjective2: ") part1 = input(f"body part: ") dish = input(f"Dish: ") madlib=f"One day, a {ad1} fox invited a stork for dinner. \ Stork was very {ad2} with the invitation โ€“ she reached the foxโ€™s home on time and knocked at the door with her {part1}.\ The fox took her to t...
531
190
from algosdk.future.transaction import ApplicationNoOpTxn from .prepend import get_init_txns from ..utils import Transactions, TransactionGroup, int_to_bytes from ..contract_strings import algofi_manager_strings as manager_strings def prepare_send_keyreg_online_transactions(sender, suggested_params, storage_account,...
3,114
888
from flask_restful import Resource from server.platform_properties import PLATFORM_PROPERTIES from server.resources.models.platform_properties import PlatformPropertiesSchema from server.resources.decorators import marshal_response class Platform(Resource): @marshal_response(PlatformPropertiesSchema()) def ge...
402
99
# -*- coding: utf-8 -*- # # Copyright (C) 2020 Esteban J. G. Gabancho. # # Invenio-Flow is free software; you can redistribute it and/or modify it # under the terms of the MIT License; see LICENSE file for more details. """Useful decorators.""" from celery import shared_task from .api import Task def task(*args, ...
471
160
import typing from dataclasses import dataclass, field as datafield from .command_types import CommandType class FundPullPreApprovalStatus: # Pending user/VASP approval pending = "pending" # Approved by the user/VASP and ready for use valid = "valid" # User/VASP did not approve the pre-approval ...
2,460
779
# List of addresses within the Battle Animation Scripts for the following commands which cause screen flashes: # B0 - Set background palette color addition (absolute) # B5 - Add color to background palette (relative) # AF - Set background palette color subtraction (absolute) # B6 - Subtract color from backgroun...
19,924
7,298
""" this module contain the logic of parsing the actual usage of the ressource unit of a zero-os node """ from .units import GiB from sal_zos.disks.Disks import StorageType class RealityParser: def __init__(self): self._ressources = {"mru": 0.0, "cru": 0.0, "hru": 0.0, "sru": 0.0} def get_report(sel...
2,643
932
import math __all__ = ['get_jaro_distance'] __author__ = 'Jean-Bernard Ratte - jean.bernard.ratte@unary.ca' """ Find the Jaro Winkler Distance which indicates the similarity score between two Strings. The Jaro measure is the weighted sum of percentage of matched characters from each file and transposed characters...
3,314
1,091
import sys import os import matplotlib.pylab as plt import numpy as np import mpl_toolkits.mplot3d.axes3d as p3 import seaborn as sea import torch from TorchProteinLibrary import FullAtomModel if __name__=='__main__': # p2c = FullAtomModel.PDB2Coords.PDB2CoordsBiopython() p2c = FullAtomModel.PDB2CoordsUnorde...
732
304
import argparse import collections import os import numpy as np import matplotlib.pyplot as plt from .. import toy_dataset from .. import gm_vae_fc def main(args): # gpu settings if args.gpus is not None: os.environ["CUDA_VISIBLE_DEVICES"] = args.gpus # generate and show dataset train_data =...
4,306
1,629
class Solution: def maxEnvelopes(self, envelopes: List[List[int]]) -> int: if not envelopes: return 0 pairs = sorted(envelopes, key=lambda x: (x[0], -x[1])) result = [] for pair in pairs: height = pair[1] if len(result) == 0 or height > result[-1]...
520
149
class Dog: def __init__(self, newColor): self.color = newColor def bark(self): print("---ๆ—บๆ—บๅซ----") def printColor(self): print("้ขœ่‰ฒไธบ๏ผš%s"%self.color) def test(AAA): AAA.printColor() wangcai = Dog("็™ฝ") #wangcai.printColor() xiaoqiang = Dog("้ป‘") #xiaoqiang.printColor() tes...
331
147
#!/usr/bin/env python # -*- encoding: utf-8 -*- """ @File : 699.py @Contact : huanghoward@foxmail.com @Modify Time : 2022/5/26 17:22 ------------ """ from typing import List class Solution: def fallingSquares(self, positions: List[List[int]]) -> List[int]: height = [p[1] for p in pos...
1,158
380
#!/usr/bin/env python """Test suite for :py:mod:`plastid.bin.metagene`""" import tempfile import os from pkg_resources import resource_filename, cleanup_resources from nose.plugins.attrib import attr from plastid.test.functional.base import execute_helper from plastid.test.ref_files import ( RPATH, REF_FILES, ...
5,150
1,750
import pytest from ombott.router import RadiRouter, Route from ombott.router.errors import RouteMethodError route_meth_handler_path = [ ('/foo/bar', 'GET', 'foo_bar:get', '/foo/bar'), ('/foo/bar', 'POST', 'foo_bar:post', '/foo/bar/'), ('/foo/bar', ['PUT', 'PATCH'], 'foo_bar:put,patch', 'foo/bar'), ('f...
4,967
1,731
import datetime import time from utils import utils from rest_framework import serializers from rest_framework.relations import StringRelatedField from app_api.models import Album, Info, Order, Coupon, Integral, Notice, Lesson, Question, Cart, Setup, User, Bill, Address, Catalog, Log, \ ReadType, Teacher, Commen...
12,225
3,413
# -*- coding: utf-8 -*- # This file is made to configure every file number at one place # Choose the place you are training at # AWS : 0, Own PC : 1 PC = 1 path_list = ["/jet/prs/workspace/", "."] url = path_list[PC] clothes = ['shirt', 'jeans', 'blazer', 'chino-pants', 'jacket'...
718
258
__version__ = "0.2.7+depop.6.1"
32
20
""" Copyright (c) Facebook, Inc. and its affiliates. """ import logging import queue from multiprocessing import Queue, Process import sys import os from mc_memory_nodes import InstSegNode, PropSegNode from heuristic_perception import all_nearby_objects from shapes import get_bounds VISION_DIR = os.path.dirname(os.pa...
7,381
2,253
import unittest from problems.problem16 import solution class Test(unittest.TestCase): def test(self): self.assertTrue(solution([2, 3, 1, 1, 4])) self.assertFalse(solution([3, 2, 1, 0, 4]))
197
83
## ## DYNAMIC ## ## Import the module explicitly (import dynamics.<module_name> as module_name) import dynamics.root as root ## Register all modules for checking here. If something interferes, rearrange the order ## module_name_ = module_name.do(params) def responseQuery(number, body): # Available params ...
510
152
from django.urls import path from . import views urlpatterns = [ path('login', views.login, name = 'login'), path('register', views.register, name = 'register'), path('logout', views.logout, name = 'logout'), path('dashboard', views.dashboard, name = 'dashboard'), ]
288
89
""" Pure-Python implementation of a Python 2-like str object for Python 3. """ from numbers import Integral from past.utils import PY2, with_metaclass if PY2: from collections import Iterable else: from collections.abc import Iterable _builtin_bytes = bytes class BaseOldStr(type): def __instancecheck_...
4,333
1,376
#!/usr/bin/env python # -*- coding: utf-8 -*- from datetime import datetime from sqlalchemy.event import listen from app.factory import db class BaseModel(db.Model): """ Base model with `created_at` and `updated_at` fields """ __abstract__ = True fields_to_serialize = [] created_at = db.Col...
1,208
377
def test_rm_long_opt_help(pycred): pycred('rm --help') def test_rm_short_opt_help(pycred): pycred('rm -h') def test_rm_none_existing_store_gives_exit_code_2(pycred, workspace): with workspace(): pycred('rm non-existing-store user', expected_exit_code=2)
278
109
""" Raw HTML widget. Adapted/copied from https://github.com/makukha/cmsplugin-raw-html """ from cms.plugin_base import CMSPluginBase from cms.plugin_pool import plugin_pool from django.template import Template from django.utils.safestring import mark_safe from .models import RawHtmlModel, CMSMember from django.utils....
1,391
461
from unittest import TestCase, mock import pytest from requests import Response import aftership class TrackingTestCase(TestCase): def setUp(self): self.slug = "4px" self.tracking_number = "HH19260817" self.tracking_id = "k5lh7dy7vvqeck71p5loe011" @pytest.mark.vcr() def test_cre...
3,296
1,115
# Calcula a quantidade de notas de cada valor a serem sacadas em uma caixa eletrรดnico print('=' * 30) print('{:^30}'.format('CAIXA ELETRร”NICO')) print('=' * 30) valor = int(input('Valor a ser sacado: R$ ')) # notas de real (R$) existentes tot200 = valor // 200 tot100 = (valor % 200) // 100 tot50 = ((valor % 200) % 100)...
1,089
588
import sys lines=[] new=True lc=0 with open('input.txt', 'r') as f: for line in f: line=line[:-1] # remove new line char if line=='': lc+=1 new=True else: if new: lines.append(line) new=False else: ...
575
203
"""Falcon Quick Scan API Interface Class _______ __ _______ __ __ __ | _ .----.-----.--.--.--.--| | _ | |_.----|__| |--.-----. |. 1___| _| _ | | | | _ | 1___| _| _| | <| -__| |. |___|__| |_____|________|_____|____ |____|__| |__|__|__|_____| |: 1 | ...
9,366
2,480
# Application definition INSTALLED_APPS = [ 'django.contrib.staticfiles', 'django.contrib.sessions', 'authenticate', ] ROOT_URLCONF = 'auth_service.urls' WSGI_APPLICATION = 'auth_service.wsgi.application' # Use a non database session engine SESSION_ENGINE = 'django.contrib.sessions.backends.signed_cookie...
353
121
import hyrnn import torch.nn def test_MobiusGRU_no_packed_just_works(): input_size = 4 hidden_size = 3 batch_size = 5 gru = hyrnn.nets.MobiusGRU(input_size, hidden_size, hyperbolic_input=False) timestops = 10 sequence = torch.randn(timestops, batch_size, input_size) out, ht = gru(sequence)...
3,641
1,414
from __future__ import division import numpy as np __all__ = ['subtract_CAR', 'subtract_common_median_reference'] def subtract_CAR(X, b_size=16): """ Compute and subtract common average reference in 16 channel blocks. """ channels, time_points = X.shape s = channels // b_size r = ...
1,190
436
#!/usr/bin/env python import unittest import mox import six.moves.urllib.request as urlrequest from six import StringIO from solution import Solution class TestSolution(unittest.TestCase): def setUp(self): self.mox = mox.Mox() pass def tearDown(self): self.mox.VerifyAll() se...
3,701
1,137
x is 1 y is None
17
10
################################################################################################################ # Author: Suthee Chaidaroon # schaidaroon@scu.edu ################################################################################################################ import numpy as np import os from utils impo...
4,784
1,526
from matekasse import create_app, db from matekasse.models import User, Transaction import sqlite3 import argparse parser = argparse.ArgumentParser(allow_abbrev=False) parser.add_argument("-p", "--path", action='store', type=str, required=True, help="Path to fnordcredit database") inp = parser.parse_args() app = cre...
1,065
352
#!/usr/bin/env python """Runs a ROSE tool. If the tool does not return status 0, then runs the corresponding non-ROSE compiler. Records whether the tool succeeded, in passed.txt and failed.txt, but always returns status 0. """ import argparse import inspect import os from support.local_logging import Logger from su...
4,340
1,342
# Generated by Django 3.1.2 on 2020-11-21 09:19 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('odp', '0002_auto_20201121_0659'), ] operations = [ migrations.CreateModel( name='ProcessGroup', fields=[ ...
951
296
from oauthlib.oauth2 import InvalidClientError, MissingTokenError import pytest from test import configure_mendeley, cassette def test_should_get_authenticated_session(): mendeley = configure_mendeley() auth = mendeley.start_client_credentials_flow() with cassette('fixtures/auth/client_credentials/get_a...
935
280
s=[] for i in range(int(input())): s.append(input()) cnt=0 while s: flag=True for i in range(len(s)//2): if s[i]<s[-(i+1)]: print(s[0],end='') s.pop(0) flag=False break elif s[-(i+1)]<s[i]: print(s[-1],end='') s.pop() flag=False break if flag: print(s[-1],end='') s.pop() cnt+=1 if ...
338
168
from src.thirty import edit_distance from src.thirty import find_second_largest_node from src.thirty import make_palindrome from src.thirty import powerset from src.data_structures import BinaryNode class TestEditDistance: """ Problem #31 """ def test_provided_example(self): assert 3 == edit_...
2,072
689
__all__ = [ 'generate_client_id', 'get_album_art', 'get_transcoder', 'transcode_to_mp3', ] import os import shutil import subprocess from base64 import b64encode from binascii import unhexlify from hashlib import md5 import audio_metadata # The id is found by: getting md5sum of audio, base64 encode md5sum, remo...
3,947
1,565
## {{{ http://code.activestate.com/recipes/303396/ (r1) '''equation solver using attributes and introspection''' from __future__ import division class Solver(object): '''takes a function, named arg value (opt.) and returns a Solver object''' def __init__(self,f,**args): self._f=f self._args={} # ...
8,731
4,319
import json import random class Graph: """ Graph data structure G = (V, E). Vertices contain the information about the edges. """ def __init__(self, graph=None): if graph is None: graph = {} is_weighted = graph is not None and any( True for x in graph if len(gr...
15,459
4,645
cars=100 cars_in_space=5 drivers=20 pasengers=70 car_not_driven=cars-drivers cars_driven=drivers carpool_capacity=cars_driven*space_in_a_car average_passengers_percar=passengers/cars_driven print("There are", cars,"cars availble") print("There are only",drivers,"drivers availble") print("There will be",car_not_driven,"...
576
207
# Definiรงรฃo de funรงรฃo def soma(a2, b2): # Os parรขmetros aqui precisam ter outro nome print(f'A = {a2} e B = {b2}') s = a2 + b2 print(f'A soma vale A + B = {s}') # Programa principal a = int(input('Digite um valor para A: ')) b = int(input('Digite um valor para B: ')) soma(a, b)
304
137
# Your code goes here tab=[] for i in range(1000) : tab.append(i) tab2=[] for i in range(len(tab)): if sum([ int(c) for c in str(tab[i]) ]) <= 10: tab2.append(tab[i]) tab3=[] for i in range(len(tab2)): a=str(tab2[i]) if a[len(a)-2] == '4': tab3.append(tab2[i]) tab4=[] for i in range(l...
852
408
# Generated by Django 2.2.11 on 2020-10-23 08:35 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ("core", "0001_initial"),...
3,885
884
#!/usr/local/bin/python3 import sys,os,string,glob,subprocess from setuptools import setup,Extension from setuptools.command.build_ext import build_ext from setuptools.command.install import install import numpy long_description = """\ This module uses the RRG ...
1,639
480
""" restbed core api """ import pyinsane2 from typing import List class CoreApi(object): scanner: pyinsane2.Scanner = None scan_session: pyinsane2.ScanSession = None @staticmethod def initialize(): """ initialize SANE, don't call if unit testing (well that's the hope...) ...
635
210
from concurrent.futures import ThreadPoolExecutor import time from PySide2.QtCore import QCoreApplication thread_pool=None def init_thread_pool(): global thread_pool thread_pool=ThreadPoolExecutor() def deinit_thread_pool(): global thread_pool thread_pool.shutdown() def submit_task(function,*args,*...
736
225
from __future__ import division from __future__ import print_function from __future__ import absolute_import from __future__ import unicode_literals import json import numpy as np import scipy.sparse as sparse import defenses import upper_bounds class NumpyEncoder(json.JSONEncoder): def default(self, obj): ...
10,463
3,761
from pytracetable.core import tracetable __all__ = [ 'tracetable', ]
74
31
""" Server module Quandl API limits: Authenticated users have a limit of 300 calls per 10 seconds, 2,000 calls per 10 minutes and a limit of 50,000 calls per day. """ import urllib import logging from twisted.internet import reactor from twisted.web.client import Agent, readBody from . import settings from . import...
1,518
469
from builtins import object from google.appengine.ext import ndb import logging """ DbSubscriptionDiff handles all db operations for a subscription diff DbSubscriptionDiffList handles list of subscriptions diffs Google datastore for google is used as a backend. """ __all__ = [ 'DbSubscriptionDiff', ...
4,696
1,209
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
1,703
481
# ๋Œ€ํ•™์ƒ ์ƒˆ๋‚ด๊ธฐ๋“ค์˜ 90%๋Š” ์ž์‹ ์ด ๋ฐ˜์—์„œ ํ‰๊ท ์€ ๋„˜๋Š”๋‹ค๊ณ  ์ƒ๊ฐํ•œ๋‹ค. ๋‹น์‹ ์€ ๊ทธ๋“ค์—๊ฒŒ ์Šฌํ”ˆ ์ง„์‹ค์„ ์•Œ๋ ค์ค˜์•ผ ํ•œ๋‹ค. # ์ฒซ์งธ ์ค„์—๋Š” ํ…Œ์ŠคํŠธ ์ผ€์ด์Šค์˜ ๊ฐœ์ˆ˜ C๊ฐ€ ์ฃผ์–ด์ง„๋‹ค. # ๋‘˜์งธ ์ค„๋ถ€ํ„ฐ ๊ฐ ํ…Œ์ŠคํŠธ ์ผ€์ด์Šค๋งˆ๋‹ค ํ•™์ƒ์˜ ์ˆ˜ N(1 โ‰ค N โ‰ค 1000, N์€ ์ •์ˆ˜)์ด ์ฒซ ์ˆ˜๋กœ ์ฃผ์–ด์ง€๊ณ , ์ด์–ด์„œ N๋ช…์˜ ์ ์ˆ˜๊ฐ€ ์ฃผ์–ด์ง„๋‹ค. ์ ์ˆ˜๋Š” 0๋ณด๋‹ค ํฌ๊ฑฐ๋‚˜ ๊ฐ™๊ณ , 100๋ณด๋‹ค ์ž‘๊ฑฐ๋‚˜ ๊ฐ™์€ ์ •์ˆ˜์ด๋‹ค. # ๊ฐ ์ผ€์ด์Šค๋งˆ๋‹ค ํ•œ ์ค„์”ฉ ํ‰๊ท ์„ ๋„˜๋Š” ํ•™์ƒ๋“ค์˜ ๋น„์œจ์„ ๋ฐ˜์˜ฌ๋ฆผํ•˜์—ฌ ์†Œ์ˆ˜์  ์…‹์งธ ์ž๋ฆฌ๊นŒ์ง€ ์ถœ๋ ฅํ•œ๋‹ค. def avg(l): s=0 for i in l: s+=i ...
551
514
import pytest import logging import ipaddress import json import re import time from tests.common.dualtor.dual_tor_mock import * from tests.common.helpers.assertions import pytest_assert as pt_assert from tests.common.dualtor.dual_tor_utils import rand_selected_interface, verify_upstream_traffic, get_crm_nexthop_counte...
4,531
1,501
# AUTOGENERATED! DO NOT EDIT! File to edit: dataset.ipynb (unless otherwise specified). __all__ = ['load_mp3', 'get_sample_label', 'preprocess_file', 'pad_by_zeros', 'split_file_by_window_size', 'wrapper_split_file_by_window_size', 'create_dataset_fixed_size', 'get_spectrogram', 'add_channel_dim'] # Cell d...
3,308
1,115
''' Classes from the 'SplitKit' framework. ''' try: from rubicon.objc import ObjCClass except ValueError: def ObjCClass(name): return None def _Class(name): try: return ObjCClass(name) except NameError: return None PodsDummy_SplitKit = _Class('PodsDummy_SplitKit') Instan...
492
153
"""Module controling search and replace tab.""" import logging from wiki_music.constants import GUI_HEADERS from wiki_music.gui_lib import BaseGui, CheckableListModel from wiki_music.gui_lib.qt_importer import QMessageBox, QPushButton, QIcon, QStyle __all__ = ["Replacer"] log = logging.getLogger(__name__) log.debug(...
3,743
1,004