content stringlengths 5 1.05M |
|---|
import numpy as np
#import ZebraLib as Lzb
import matplotlib.pyplot as plt
class plane:
def __init__(self, Sw=1, AR=2, teta=10, cw=0.5, bw=2):
#Asa
self.Sw = Sw
self.teta = teta
self.cw = cw
self.bw = bw
#Profundor e leme
self.AR = AR
self.S... |
from subprocess import Popen
def load_jupyter_server_extension(nbapp):
"""serve the app.py directory with bokeh server"""
Popen(["panel", "serve", "app.py", "--allow-websocket-origin=*"])
|
from extensions.vue_backend.messages.DLA_table_data_message import DLA_table_data_request, DLA_table_data_response, \
DLA_set_table_data_request, ColumnHeader
from pyecore.ecore import EReference, EClass
from esdl import esdl
from esdl.processing.ESDLQuantityAndUnits import qau_to_string
from typing import L... |
from django.apps import AppConfig
class CertificatesConfig(AppConfig):
name = 'sgce.certificates'
verbose_name = 'Certificados'
|
for i in range(1, 1001):
if i % 10 == 7:
print(i)
|
import anvil.tables as tables
import anvil.tables.query as q
from anvil.tables import app_tables
import anvil.server
import csv
import anvil.media
from io import BytesIO
import pandas as pd
import anvil.media
import Global
@anvil.server.callable
def store_data(file):
filedata = file.get_bytes()
... |
from dynamic_validation.models import Violation, ViolationStatus
from dynamic_rules.dynamic_actions import BaseDynamicAction
__all__ = ('BadViolationType', 'BaseDynamicValidation')
class BadViolationType(TypeError):
pass
class BaseDynamicValidation(BaseDynamicAction):
accepted_status = ViolationStatus.u... |
from django.conf import settings
from django.conf.urls import patterns, url
from django.contrib.auth import views as auth_views
from django.views.generic.base import TemplateView
from django.utils.translation import ugettext_lazy as _
from connect.accounts.forms import CustomPasswordResetForm
from connect.accounts imp... |
from setuptools import setup, find_packages
setup(
name='prometheus-example-exporter',
version='0.1.0.dev1',
description='Example Prometheus exporter',
url='https://github.com/anttiniskanen1/prometheus-example-exporter',
author='Antti Niskanen',
author_email='antti.niskanen@cybercom.com',
l... |
from flaskr.pricing import Pricing, Context
from flaskr import typing
from dateutil.relativedelta import relativedelta
from dataclasses import dataclass, field
from typing import Optional
from decimal import Decimal
class Period(object):
@dataclass
class Result:
@dataclass
class Profits:
... |
from common import vehicle_status_codes
# from .services.demand_prediction_service import DemandPredictionService
from config.settings import TIMESTEP, MIN_DISPATCH_CYCLE, MAX_DISPATCH_CYCLE
import numpy as np
class DispatchPolicy(object):
def __init__(self):
# self.demand_predictor = DemandPredictionServi... |
# Copyright 2016 Intel Corporation
#
# 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... |
from Configuration.AlCa.autoCond import *
|
from setuptools import setup
def build_native(spec):
# build rust library
build = spec.add_external_build(cmd=["cargo", "build", "--release"], path=".")
spec.add_cffi_module(
module_path="arrow_odbc._native",
dylib=lambda: build.find_dylib("native", in_path="/target/release"),
hea... |
import schedule, subprocess, time, sys, os, time
date_folder = time.strftime("%d%m%Y")
output = date_folder + "/" + "output.txt"
if not os.path.isdir(date_folder):
os.mkdir(date_folder)
if not os.path.isfile(output):
f = open(output,"w+")
def job (output, date):
print("Running the transcribe... |
# -*- coding: utf-8 -*-
import csv
import json
import os
import traceback
from io import StringIO
from tempfile import NamedTemporaryFile
import gevent
import requests
from pyquery import PyQuery as pq
import locust
from locust import constant
from locust.argument_parser import get_parser, parse_options
from locust.u... |
from .collect import StatsCollector
from .config import Config
__version__ = '0.4.2'
|
load("@bazel_gazelle//:deps.bzl", "go_repository")
def go_modules():
go_repository(
name = "co_honnef_go_tools",
importpath = "honnef.co/go/tools",
sum = "h1:XJP7lxbSxWLOMNdBE4B/STaqVy6L73o0knwj2vIlxnw=",
version = "v0.0.0-20190102054323-c2f93a96b099",
)
go_repository(
... |
import numpy as np
def main(number1,number2):
#num1 = int(number1)
#num2 = int(number2)
#sum = num1+num2
out=np.zeros(5)
return "Sum is "+str(out)
|
import pytest
from lineage.query_context import QueryContext
from lineage.bigquery_query import BigQueryQuery
from lineage.table_resolver import TableResolver
def create_bigquery_table_colum(project_id, dataset_id, table_id):
return {'project_id': project_id, 'dataset_id': dataset_id, 'table_id': table_id}
@pyt... |
# __init__.py
import os, sys
# Local imports
sys.path.insert(0,'..')
try:
import controller, cli, lunchscraper, translator
except:
from lunchscraper import controller, cli, lunchscraper, translator
|
import requests
JHUB_URL = 'http://127.0.0.1'
IMAGE_NAME = 'nielsbohr/slurm-notebook:edge'
if __name__ == "__main__":
# Make spawn request
with requests.Session() as session:
result = session.get(JHUB_URL)
# Get login page
login_url = JHUB_URL + "/hub/login"
page_resp = session... |
#!/usr/bin/python
# -*- coding:utf-8 -*-
import time
import numpy as np
import tensorflow as tf
import os
class NERTagger(object):
"""The NER Tagger Model."""
def __init__(self, is_training, config):
self.batch_size = batch_size = config.batch_size
self.seq_length = seq_length = config.seq_l... |
from django.shortcuts import render
from rest_framework import generics, permissions
from django.contrib.auth import get_user_model
from .serializers import ChoreListSerializer, ChoreDetailSerializer, UserSerializer
from .models import Chore
from rest_framework.parsers import MultiPartParser, FormParser
from rest_frame... |
import cv2
import numpy as np
def contourColor(color_number):
if color_number == 0:
contour_color = (128, 255, 255)
elif color_number == 1:
contour_color = (0, 255, 0)
elif color_number == 2:
contour_color = (0, 0, 0)
elif color_number == 3:
contour_color = (255, 0, 0)
... |
from scoring.models import *
from django.shortcuts import render
def remove_all_data(request):
Judge.objects.all().delete()
Project.objects.all().delete()
Student.objects.all().delete()
Judge_Assignment.objects.all().delete()
return render(request, 'home.html')
|
#!/usr/bin/env python
'''
Created on 27/10/2016
@author: sium
'''
from __future__ import print_function
__author__ = 'sium'
__licence__="""
MIT License
Copyright (c) 2017 Sinan Ugur Umu (SUU) sinanugur@gmail.com
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and asso... |
# This program is free software: you can redistribute it and/or modify it under the
# terms of the Apache License (v2.0) as published by the Apache Software Foundation.
#
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or... |
from aces import Aces
class sub(Aces):
def submit(self):
opt = dict(
units="metal",
species="glassC",
method="greenkubo",
nodes=1,
procs=12,
queue="q1.1",
runTime=10000000,
runner="phonopy")
... |
from sim.scheduler import Scheduler
from sim.queue import Queue
from sim.genjob import GenJob
from sim.tokenbucket import TokenBucket
from sim.server import Server |
# -*- coding: utf-8 -*-
from .libs import log, storage
import sublime
class S6Setting(object):
def __init__(self):
super(S6Setting, self).__init__()
self._setting = storage.StorageSetting("sublime_666")
def get_git_remote(self):
remote = self._setting.get("git_remote", None)
... |
from tinydb import TinyDB, Query
import os
import json
import youtube_metadata
import logging
from googleapiclient.errors import HttpError
from time import sleep
def store_metadata(db_fn: str, video: dict):
"""
Store the given videos_metadata
:param db_fn:
:param video:
:return:
"""
loggin... |
transliteration_to_bw_map = {
'Alif': 'A',
'hamza': 'A',
'Ayn': 'E',
'Ba': 'b',
'Dad': 'D',
'Daad': 'D',
'Dal': 'd',
'dal': 'd',
'Fa': 'f',
'Gh': 'g',
'Ghayn': 'g',
'ha': 'h',
'Ha': 'H',
'Haa': 'H',
'Jiim': 'j',
'Kaf': 'k',
'Kha': 'x',
'Kh': 'x'... |
# ==== import libraries we are using ====
import requests # for http requests (e.g., pulling the RSS feed)
import re # for searching with regular expressions
import json # for reading config.json file
import os # for file system path names
import smtplib # for sending email
import ssl # for ... |
#!/usr/bin/python
# Copyright 2015 Google.
#
# 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... |
sd = 'icons/' # Icon sub-directory name.
# The forcast includes an icon index number. Below is an ordered array that has the
# icon filename for the icon index.
icons = [
'thunderstorms.png', # 0 - Thunderstorms
'windy.png', # 1 - Windy Rain
'unknown.png', # 2 - Windy Rain
'thunderstorms.png', # 3 - Thunder... |
from django.utils.translation import gettext_lazy as _
from oscar.defaults import * # noqa
from psycopg2cffi import compat
import os
compat.register()
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
DEBUG = True
SECRET_KEY = "li0$-gnv)76g$yf7p@(cg-^_q7j6df5cx$o-gsef5hd68phj!4"
SITE_ID = 1
USE_I18N = True
LAN... |
from starry_process import StarryProcess
from starry_process.latitude import beta2gauss
import numpy as np
from tqdm import tqdm
import matplotlib.pyplot as plt
import pymc3 as pm
import exoplanet as xo
import theano
import theano.tensor as tt
from tqdm import tqdm
from corner import corner
from scipy.stats import gaus... |
from pytest import fixture, mark, raises
from pytest_asyncio import fixture as async_fixture
from sqlalchemy.ext.asyncio import create_async_engine, AsyncSession
from sqlalchemy.orm import sessionmaker
from sqlmodel import SQLModel
import todo_app.models as models
@async_fixture
async def engine():
engine = creat... |
import pytest
class TestFiltersView:
def test_basic_filters(self, client):
res = client.get("/works/filters/is_oa:true")
json_data = res.get_json()
filter_1 = json_data["filters"][0]
assert filter_1["key"] == "is_oa"
assert filter_1["type"] == "BooleanField"
assert ... |
#!/usr/bin/env python
from __future__ import print_function
import sys
import os
import traceback
if len(sys.argv) != 3:
print('Usage: "generate_spirv_offline.py <compilation_cache_dir> <cl_device_info_file>"')
exit(1)
compilation_cache_dir = sys.argv[1]
cl_device_info_filename = sys.argv[2]
def generate_s... |
import word2vec
word2vec.word2phrase('text8', 'text8-phrases', verbose=True)
word2vec.word2vec('text8-phrases', 'text8.bin', size=100, verbose=True)
model = word2vec.load('text8.bin')
indexes, metrics = model.analogy(pos=['king', 'woman'], neg=['man'])
for i in model.generate_response(indexes, metrics).tolist():
... |
"""
# ==================================================================================
# Author: Marc Sanchez Net
# Date: 03/14/2019
# Copyright (c) 2019, Jet Propulsion Laboratory.
# ==================================================================================
"""
from collections import defaultdict
from cop... |
import time
import unittest
from cache_dependencies import interfaces, locks, utils
from cache_dependencies.tests import helpers
try:
from unittest import mock
except ImportError:
import mock
class AbstractDependencyLockTestCase(unittest.TestCase):
"""Abstract class.
See http://stackoverflow.com/que... |
"""Auto-generated file, do not edit by hand. CH metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_CH = PhoneMetadata(id='CH', country_code=41, international_prefix='00',
general_desc=PhoneNumberDesc(national_number_pattern='[2-9]\\d{8}|860\\d{9}', possible_number_p... |
"""
doxybridge.renderer.rst.doxygen.base
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: Copyright (c) 2011 The Department of Arts and Culture, The Government
of the Republic of South Africa.
:copyright: Copyright (c) 2009, Michael Jones
:license: MIT, see LICENSE for de... |
"""
Test cases to validate dashboard base image configurations
"""
import subprocess
import pytest
import requests
import testinfra
DOCKER_IMAGE_NAME = 'dashboard:latest'
# scope='session' uses the same container for all the tests;
# scope='function' uses a new container per test function.
@pytest.fixture(scope='s... |
"""
Entradas
Horas trabajadas-->int-->H_T
Precio de la hora-->int-->P_h
Salidas
Salario neto-->int-->S_n
"""
#Entradas
P_h=float(input("Precio por cada hora trabajada: "))
H_t=int(input("Numero de horas trabajadas: "))
#Caja negra
S=float((H_t*P_h))
S_n=int((S-S*0.20))
#Salida
print("El salario neto es de:",S_n)
|
#! /usr/bin/env python
# Configuration for the project.
class AttrDict(dict):
def __init__(self, *args, **kwargs):
super(AttrDict, self).__init__(*args, **kwargs)
self.__dict__ = self
config = AttrDict()
config.print_info = False
config.data_root = '../dataSets/'
config.val_ratio = 0.2
# Configuration for train... |
from api.decorators import api_view, request_data, setting_required
from api.permissions import IsAdminOrReadOnly
from api.mon.vm.api_views import VmMonitoringView, VmSLAView, VmHistoryView
__all__ = ('mon_vm_define', 'mon_vm_sla', 'mon_vm_history')
#: vm_status: GET:
#: vm_status: PUT: notcreated, running, stop... |
# -*- coding: utf-8 -*-
"""
Core
====
Provides a collection of functions that are core to **e13Tools** and are
imported automatically.
"""
# %% IMPORTS
# Built-in imports
from pkg_resources import parse_version
# All declaration
__all__ = ['InputError', 'ShapeError', 'compare_versions']
# %% CLASSES
# Define Err... |
# ============================================================================
# FILE: commands.py
# AUTHOR: Qiming Zhao <chemzqm@gmail.com>
# License: MIT license
# ============================================================================
# pylint: disable=E0401,C0411
import os
import json
from .base import Base
fr... |
import os
import re
from collections import defaultdict, namedtuple
from junit_xml import TestSuite, TestCase
module_dir = os.path.abspath(os.path.dirname(__file__))
Suite = namedtuple('Suite', 'name tests msgs fails times lines')
class GUnit:
def __init__(self, build_dir='.', executable='gdb'):
self.bu... |
#!/usr/bin/env python3
#
# Copyright (c) 2021 Xiaomi Corp. (authors: Fangjun Kuang, Daniel Povey)
#
# See ../../../LICENSE for clarification regarding multiple authors
# To run this single test, use
#
# ctest --verbose -R expand_ragged_attributes_tests_py
import unittest
import k2
import torch
import _k2
... |
import os
import sys
import unittest
import warnings
from gym_minigrid import *
# Make sure the path of the framework is included in the import path
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '../src/')))
# Framework imports
from mdp import GymMinigrid, GymMinigridBuilder, GymMinigrid... |
import streamlit as st
import random
from cursor import loader
from cursor import renderer
from cursor import path
from cursor import filter
from cursor import data
from cursor import device
@st.cache(allow_output_mutation=True)
def inputs1():
return [0, 1, 2, 3, 4]
@st.cache(allow_output_mutation=True)
def of... |
from dataclasses import dataclass
from typing import Optional, Type, TypeVar
from commanderbot.ext.automod.automod_action import AutomodAction, AutomodActionBase
from commanderbot.ext.automod.automod_event import AutomodEvent
from commanderbot.lib import AllowedMentions, JsonObject
ST = TypeVar("ST")
@dataclass
cla... |
# Copyright (c) 2019 Leiden University Medical Center
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, me... |
import codecs
import csv
import datetime
def parsedate(str):
try:
if len(str) > 1:
splitted = str.split("/")
if len(splitted) == 3:
if len(splitted[-1]) == 2:
return datetime.datetime.strptime(str, "%d/%m/%y")
else:
... |
# -*- coding: utf-8 -*-
import vk_api
from vk_api.keyboard import VkKeyboard, VkKeyboardColor
from vk_api.utils import get_random_id
def main():
""" Пример создания клавиатуры для отправки ботом """
vk_session = vk_api.VkApi(token='bot_api_token')
vk = vk_session.get_api()
keyboard = VkKeyboard(one_... |
# -----------------------------------------------------------------------------
# Copyright (c) 2009-2016 Nicolas P. Rougier. All rights reserved.
# Distributed under the (new) BSD License.
# -----------------------------------------------------------------------------
import numpy as np
from glumpy import app, gl, glm... |
"""
Parse to and from a CSV string/file format for isotherms.
The _parser_version variable documents any changes to the format,
and is used to check for any deprecations.
"""
from io import StringIO
import pandas
from pygaps import logger
from pygaps.core.baseisotherm import BaseIsotherm
from pygaps.core.modelisot... |
#!/usr/bin/env python3
# Copyright 2010 Joao Henriques <jotaf (no spam) at hotmail dot com>.
#
# This file is part of name-gen.
#
# name-gen is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation, either versi... |
# -*- coding: utf-8 -*-
INPUTSTREAM_PROTOCOLS = {
'mpd': 'inputstream.adaptive',
'ism': 'inputstream.adaptive',
'hls': 'inputstream.adaptive',
'rtmp': 'inputstream.rtmp'
}
DRM_SCHEMES = {
'widevine': 'widevine',
'com.widevine.alpha': 'widevine'
}
CDM_EXTENSIONS = (
'.so',
'.dll',
... |
import os
from urllib.parse import urlsplit
import click
import requests
import config as cfg
def read_and_save(res):
"""Reads content of the accessed file and saves it locally."""
fname = os.path.split(urlsplit(res.url).path)[-1]
fpath = os.path.join(cfg.OUTPUT_DIR, fname)
with open(fpath, 'wb') as ... |
"""A rule that copies source files to the output tree.
This rule uses a Bash command (diff) on Linux/macOS/non-Windows, and a cmd.exe
command (fc.exe) on Windows (no Bash is required).
Originally authored in rules_nodejs
https://github.com/bazelbuild/rules_nodejs/blob/8b5d27400db51e7027fe95ae413eeabea4856f8e/internal... |
import asyncio, logging, unittest
from rx_scheduler import Scheduler
from functools import partial
class RxSchedulerTest(unittest.IsolatedAsyncioTestCase):
def setUp(self):
logging.basicConfig(level=logging.DEBUG)
async def test_sync(self):
loop = asyncio.get_event_loop()
scheduler = S... |
from abc import ABC, abstractmethod
from .initializers import Constant
from .optimizers import MomentumFeedForward
from .constants import EPSILON
import torch
class Layer(ABC):
@abstractmethod
def init_weights(self, num_input, optimizer, initializer):
pass
@abstractmethod
def feed_forward(sel... |
import common
import exporter
import importer
import manager
import antler
import os
import sys
import time
from flask_api import FlaskAPI
from flask import request
from flask_api import status
import json
from datetime import datetime
import utils
import threading
free_data = {}
insert_queue = []
app = FlaskAPI(__nam... |
from utils import *
def matrix_subtraction(a, b):
"""matrix_subtraction
Matrix subtraction a[i][j]-b[i][j] for all i j
:param a: first matrix
:param b: second matrix
:return: first-second result
"""
c = [[0 for y in range(len(a[0]))] for x in range(len(a))]
for i in range(len(a)):
... |
# Copyright (c) 2015, Riverbank Computing Limited
# 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 c... |
import asyncio
import logging
import os
from azure.eventhub.aio import EventHubClient
from azure.eventhub.aio.eventprocessor import EventProcessor, PartitionProcessor
from azure.eventhub.extensions.checkpointstoreblobaio import BlobPartitionManager
from azure.storage.blob.aio import ContainerClient
RECEIVE_TIMEOUT = 5... |
from datetime import datetime as date
input_date = input()
d1 = date.strptime(input_date, "%Y-%m-%d").date()
d2 = date.strptime('2018-08-26', "%Y-%m-%d").date()
if d1 < d2:
print("Passed")
elif d1 > d2:
print(f"{(d1 - d2).days + 1} days left")
else:
print("Today date")
|
import flask, json, os, re, sys, arrow
def get_state_by_coords(lat, lng):
include_geometry = flask.request.args.get('geometry', False)
columns = "aclu_id, geoid, ocd_id, name, state, area_land, area_water"
if include_geometry == '1':
columns += ', boundary_simple'
cur = flask.g.db.cursor()
cur.execute('''
... |
from .base import InteractiveAgent
from .scpr import SCPRAgent
from .ear import EARAgent |
import multiprocessing
import os
from typing import Optional
from inboard.start import configure_logging
def calculate_workers(
max_workers_str: Optional[str],
web_concurrency_str: Optional[str],
workers_per_core_str: str,
cores: int = multiprocessing.cpu_count(),
) -> int:
"""Calculate the numbe... |
"""
The DateRange class and a set of common date ranges.
"""
class DateRange(object):
"""
A range of dates, used to control sampling periods.
Args:
start_year (int): The lower bound of the date range, years BC are
negative numbers.
end_year (int): The upper bound of the date r... |
from django.contrib import admin
from geolocations.models import Geolocation, GeolocationRequest
@admin.register(GeolocationRequest)
class GeolocationRequestAdmin(admin.ModelAdmin):
list_display = ('id', 'lookup', 'user', 'created_at')
search_fields = ('id', 'lookup')
list_filter = ('created_at',)
raw... |
""" flametree/__init__.py """
# __all__ = []
from .version import __version__
from .Directory import Directory, File
from .DiskFileManager import DiskFileManager
from .ZipFileManager import ZipFileManager
from .utils import file_tree
|
import sys
def getArea(width, height) -> int:
# O(1)
return width * height
def main():
width, height = map(int, sys.stdin.readline().strip().split(' '))
print(getArea(width, height))
# O(1)
main() |
# Burgers test evolution: just one
from models import burgers
from bcs import periodic
from simulation import simulation
from methods import weno3_lf
from rk import rk3
from grid import grid
from matplotlib import pyplot
Ngz = 3
Npoints = 400
interval = grid([-1, 1], Npoints, Ngz)
model = burgers.burgers(initial_data... |
# coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
js_to_json,
determine_ext,
)
class BpbIE(InfoExtractor):
IE_DESC = 'Bundeszentrale für politische Bildung'
_VALID_URL = r'https?://www\.bpb\.de/mediathek/(?P<id>[0-9]+)/'
_T... |
import collections
import os
import re
from shift_oelint_parser.cls_item import Comment
from shift_oelint_parser.cls_item import Export
from shift_oelint_parser.cls_item import Function
from shift_oelint_parser.cls_item import FunctionExports
from shift_oelint_parser.cls_item import Include
from shift_oelint_parser.cl... |
import icepyx as ipx
import pytest
import warnings
def test_CMRparams():
reg_a = ipx.Query("ATL06", [-64, 66, -55, 72], ["2019-02-22", "2019-02-28"])
reg_a.build_CMR_params()
obs_keys = reg_a.CMRparams.keys()
exp_keys_all = ["short_name", "version", "temporal"]
exp_keys_any = ["bounding_box", "pol... |
#2- crie um programa que calcule a rentabilidade anual de um investimento baseando-se em sua rentabilidade mensal(juros compostos)
# e a rentablidade deve ser apresentada em % e R$ utilizar metodos
from Aula11 import *
investimento = float(input('Digite o valor do investimento: R$'))
taxa = float(input('Informe a ta... |
# -*- coding: utf-8 -*-
import pika
import os
import argparse
parser = argparse.ArgumentParser(description='parse rabbit')
parser.add_argument("-r", "--receive", action = 'store_true', help ='set this option to switch to receive mode' )
parser.add_argument("-s", "--sendmany",type=int,default=1)
args = parser.parse_... |
#!/usr/bin/env python
# encoding: utf-8
import unittest
from nose.tools import assert_equal
from os.path import join, dirname, abspath
from main import process
SAMPLE_DIR = join(dirname(abspath(__file__)), 'sample_data')
class ScraperTestCase(unittest.TestCase):
@classmethod
def setUpClass(cls):
""... |
from abc import ABC
class Intermediate_Representation(ABC):
pass
|
"""
This module defines some plotting functions that are used by the
BALTO GUI app. It should be included in the same directory as
"balto_gui.py" and the corresponding Jupyter notebook.
"""
#------------------------------------------------------------------------
#
# Copyright (C) 2020. Scott D. Peckham
#
# Added u... |
from __future__ import unicode_literals
from django.apps import AppConfig
class HelpmeConfig(AppConfig):
name = 'helpme'
|
# MIT licensed
# Copyright (c) 2013-2020 lilydjwg <lilydjwg@gmail.com>, et al.
from typing import Optional
from .base import TemporaryError, HTTPError
class Proxy:
_obj = None
def set_obj(self, obj):
super().__setattr__('_obj', obj)
def __getattr__(self, name):
return getattr(self._obj, name)
def ... |
import numpy as np
from det3d import torchie
from det3d.datasets.kitti import kitti_common as kitti
from det3d.core.evaluation.bbox_overlaps import bbox_overlaps
from det3d.core.bbox import box_np_ops
from det3d.core.sampler import preprocess as prep
from det3d.builder import (
build_dbsampler,
build_anchor_ge... |
import numpy as np
import simtk.unit as unit
from .utils.targets import to_singular as singular_target
from .utils.indices import intersection_indices
# Classes
from .forms.classes import dict_is_form as dict_classes_is_form, \
dict_new as dict_classes_new, \
dict_add_microstate as dict_classes_add_mi... |
import tornado.httpserver
import tornado.ioloop
import tornado.options
import tornado.web
import os.path
from tornado.options import define, options
define("port", default=8888, help="run on the given port", type=int)
SCHEMA_PATH = os.path.split(os.path.abspath(__file__))[0]
class SchemaHandler(tornado.web.Request... |
import pandas as pd
import sys
sys.path.append('../')
from src.models.svd import mySVD
import surprise
# set testing cases
targetSongidList = ['SOAKIMP12A8C130995','SOBBMDR12A8C13253B','SOBXHDL12A81C204C0','SOBYHAJ12A6701BF1D','SODACBL12A8C13C273']
# create svd object
svd = mySVD()
# create testdata and transform in... |
# -*- coding: utf-8 -*-
import logging
from .version import __version__
from .core import TTrackerSession, how_much_hours, report_activities
from .main import main
from totra.output_format import format_activities, save_output
logging.getLogger(__name__).addHandler(logging.NullHandler())
|
"""
Формат ввода
В первой строчке задано число N — число фанатов,
во второй число М — количество знакомств между
фанатами.
Далее следует M пар чисел от 0 до N-1,
разделенных пробелом: каждая пара означает обоюдное
знакомство между фанатами.
Далее следует число K —
количество типов машин, и K пар вида (вместимость
ма... |
#!/usr/bin/python3
#
# Copyright 2019 LiveSite authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... |
def number_of_occurrences(element: int, sample: list) -> int:
return sample.count(element) |
# -*- coding: utf-8 -*-
"""
Created on Thu Aug 25 13:07:56 2016
@author: likui
"""
import numpy as np
from sklearn.metrics import roc_curve, auc
from sklearn.metrics import precision_recall_curve
from sklearn.metrics import average_precision_score
from roc import*
def seg(filename):
file = open(filenam... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.