content stringlengths 5 1.05M |
|---|
"""The Galaxy Tool Shed application."""
from galaxy.web.framework import url_for
from galaxy.web.framework.decorators import expose
__all__ = ("url_for", "expose")
|
import numpy as np
from traits.api import Instance, Float, Enum, Any, List, on_trait_change, Event, Str, Property, Button
from traitsui.api import View, UItem, VSplit, CustomEditor, HSplit, Group, VGroup, HGroup, Label, ListEditor, \
EnumEditor
from collections import OrderedDict
from pyqtgraph.Qt import QtGui
from... |
"""
This module manages webhook communication
"""
import logging
from typing import Any, Dict
from requests import RequestException, post
from freqtrade.enums import RPCMessageType
from freqtrade.rpc import RPC, RPCHandler
logger = logging.getLogger(__name__)
logger.debug('Included module rpc.webhook ...')
class... |
from apps.accounts.models import User
from selenium.webdriver.common.by import By
from functional_tests.pages.base import QcatPage
class QuestionnaireStepPage(QcatPage):
route_name = ''
LOC_BUTTON_SUBMIT = (By.ID, 'button-submit')
LOC_IMAGE_FOCAL_POINT_TARGET = (By.ID, 'id_qg_image-0-image_target')
... |
import glob
from typing import Dict, Union, List
from pathlib import Path
import pandas as pd
import numpy as np
import tensorflow as tf
def load_dataset(
data_details: Dict,
batch_size: int,
file_ffps: Union[List[str], np.ndarray] = None,
data_dirs: Union[Path, List[Path]] = None,
file_filter: s... |
"""Define the aiowatttime package."""
from .client import Client # noqa
|
import numpy as np
from netCDF4 import Dataset
from datetime import datetime
from datetime import timedelta
import os
import sys
import matplotlib.pyplot as plt
from mpl_toolkits.basemap import Basemap
from scipy import ndimage
import matplotlib.colors as mcolors
p00 = 100000.00 # hPa
Rd = 287.04
Rv = 461.51
epsi... |
from django.db import models
from .page import Page
class RunResult(models.Model):
page = models.ForeignKey(
Page,
related_name="run_results",
on_delete=models.CASCADE,
)
created_at = models.DateTimeField(auto_now_add=True)
def get_prices(self):
return [node.price for... |
"""Tested only when using Annotated since it's impossible to create a cycle using default values"""
import pytest
from di.container import Container
from di.dependant import Dependant, Marker
from di.exceptions import DependencyCycleError
from di.typing import Annotated
# These methods need to be defined at the glob... |
import bpy
import os
#the only difference between this version and the other one is that this one remove the mirror
#modifier if there is only mesh, this is useful to import on apps like substance painter which is my workflow.
pathWay = bpy.data.filepath
objs = bpy.context.selected_objects
nameWay = os.path.splite... |
import os
from pathlib import Path
from portunus.validators import ImageValidator
from portunus.validators import IPValidator
from portunus.validators import NumberValidator
from portunus.validators import PortValidator
from portunus.validators import VolumeValidator
class Document:
def __init__(self, string):
... |
# -*- coding: utf-8 -*-
# Resource object code
#
# Created by: The Resource Compiler for PyQt5 (Qt v5.12.5)
#
# WARNING! All changes made in this file will be lost!
# from PyQt5 import QtCore
from silx.gui import qt as QtCore
qt_resource_data = b"\
\x00\x00\x19\x3d\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d... |
"""Padeiro pobre precisa de ajuda para começar a ganhar dinheiro.
Ele precisa conseguir uma grana para comprar massas para produzir pão.
Com massa ele pode ir à padaria, fazer e vender pães.
Ele poderá pedir esmola na rua.
Pode pedir esmola para a mãe.
"""
from random import uniform
from random import randint
class P... |
# Generated by Django 2.2 on 2019-06-30 06:44
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Admin',
fields=[
... |
# This file is part of fesom_viz
#
################################################################################
#
# Interpolates FESOM data to regular grid. The output is netCDF4 files
# with CMOR complient attributes.
#
# Original code by Nikolay Koldunov, 2016
#
# TODO:
# Add possibility to define curvi... |
import tkinter as tk
import tkinter.ttk as ttk
root = tk.Tk()
s = ttk.Style()
#s.configure('TButton', background='green')
bg = s.lookup('TButton', 'background')
s.map('TButton',
# background=[('active', 'red')]
background=[('active', bg)]
)
btn1 = ttk.Button(root, text='Sample', style='TButton')
btn1.pack(... |
from setuptools import setup
from os import path
this_directory = path.abspath(path.dirname(__file__))
with open(path.join(this_directory, 'README.md'), encoding = 'utf-8') as f:
long_description = f.read()
setup(
name = 'ror',
packages = ['ror'],
version = '0.0.1',
python_requires = '>=3.6',
license = ... |
import os
import cv2
import random
import pickle
import numpy as np
from helper import constant
from imutils import paths
from matplotlib import pyplot as plt
from sklearn.preprocessing import LabelBinarizer
from sklearn.model_selection import train_test_split
from keras.preprocessing.image import ImageDataGenerator, i... |
import unittest
from pieces.bishop import Bishop
from board import Board
class TestSum(unittest.TestCase):
def test_no_movement(self):
board = Board()
bishop1 = Bishop("W", 7, 0, board)
bishop2 = Bishop("W", 6, 1, board)
board.add_piece(bishop1, 7, 0)
board.add_piece(bish... |
"""Returns a timeseries with input and target.
"""
import torch
import torch.utils.data as data
import numpy as np
class Timeseries(data.Dataset):
"""Provide a dataset with samples x timesteps x (remaining variables).
"""
def __init__(self, data, timesteps=[0], device=None):
self.data = data
... |
# python
import logging
from copy import deepcopy
from operator import attrgetter
from json import dumps
# Genie Libs
from genie.libs import sdk
# ats
from pyats import aetest
from pyats.log.utils import banner
from pyats.datastructures import AttrDict
# abstract
from genie.abstract import Lookup
# import pcall
imp... |
import os
import numpy as np
import h5py
import pickle
from tqdm import tqdm
import torch
from torch.utils.data import Dataset
from torch.utils.data import DataLoader
from utils import generate_candidates, calculate_IoU_batch
class RawData(Dataset):
def __init__(self, feature_path, data_path):
... |
import time
from locust import HttpUser, task, between
class QuickstartUser(HttpUser):
wait_time = between(1, 2.5)
host = "https://konec-mvno-web-cpjfbnt2q-oppo-dev.vercel.app/" #定义主机
@task(1)
def my_1_task(self):
self.client.get("/support") #请求support页面
@task(2)
def my_2_task... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2019-03-09 02:19
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('braintreepayment', '0002_payment_refactor'),
]
operations = [
migrations.A... |
# Copyright 2020 Thomas Rogers
# SPDX-License-Identifier: Apache-2.0
from .. import map_objects
class SpriteFacing:
def __init__(self, sprite: map_objects.EditorSprite):
self._sprite = sprite
def change_facing(self):
self._sprite.invalidate_geometry()
stat = self._sprite.sprite.spri... |
# By Chris Bailey-Kellogg for "Balancing sensitivity and specificity in
# distinguishing TCR groups by CDR sequence similarity"
# See README for license information
import csv, sys
import matplotlib as mpl
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import make_axes_locatable
# args:
# 1: cdr id -- ... |
import os
from django.conf import settings
from django.core.management import call_command
from django.db import connection
def spatialite_init_file():
# SPATIALITE_SQL may be placed in settings to tell
# GeoDjango to use a specific user-supplied file.
return getattr(settings, 'SPATIALITE_SQL', 'init_spati... |
def swap_with_head(self, head, n):
headVal = head.val
current=head
count = 0
while(current and current.next):
count += 1
if count == n:
head.val = current.val
current.val = headVal
current = current.next
return head
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
from google.protobuf import descriptor
from google.protobuf import message
from google.protobuf import reflection
from google.protobuf import descriptor_pb2
# @@protoc_insertion_point(imports)
DESCRIPTOR = descriptor.FileDescriptor(
name='repeated_packed.... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
from... |
import json
import boto3
import botocore
import tarfile
from io import BytesIO
s3_client = boto3.client('s3')
def lambda_handler(event, context):
inputbucket = "yourinputbucket"
destbucket = "yourdestbucket"
key = event['Records'][0]['s3']['object']['key']
#gets tar file from s3
... |
from pomozne_funkcije import Seznam
import baza
import sqlite3
from geslo import sifriraj_geslo, preveri_geslo
conn = sqlite3.connect('filmi.db')
baza.ustvari_bazo_ce_ne_obstaja(conn)
conn.execute('PRAGMA foreign_keys = ON')
uporabnik, zanr, oznaka, film, oseba, vloga, pripada = baza.pripravi_tabele(conn)
class Log... |
import os
from pysports import parse_text, _parse_all_table_tags, _parse_all_table_names, _parse_all_column_headers, _parse_all_data
from bs4 import BeautifulSoup
cwd = os.path.dirname(os.path.realpath(__file__))
one_table_full_text = None
one_table_full_text_soup = None
complicated = None
complicated_soup = None
m... |
# Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from analysis import callstack_detectors
from analysis.analysis_testcase import AnalysisTestCase
from analysis.callstack_detectors import StartOfCallStack
fr... |
"""This module implements the CircuitRegion class."""
from __future__ import annotations
import logging
from typing import Any
from typing import Iterator
from typing import Mapping
from typing import Union
from typing_extensions import TypeGuard
from bqskit.ir.interval import CycleInterval
from bqskit.ir.interval i... |
# -*- coding: utf-8 -*-
import argparse
import json
import requests
import tokenization
from flask import Flask
from flask import request, jsonify
import numpy as np
app = Flask(__name__)
app.config['JSON_AS_ASCII'] = False
headers = {
'content-type': "application/json",
'cache-control': "no-cache"
}
cola_l... |
"""Test the cloud.iot module."""
from unittest.mock import MagicMock, patch
from aiohttp import web
import pytest
from homeassistant.components.cloud import DOMAIN
from homeassistant.components.cloud.client import CloudClient
from homeassistant.components.cloud.const import PREF_ENABLE_ALEXA, PREF_ENABLE_GOOGLE
from ... |
"""
Rotor.py
Author: Colin Page
colin.w.page1@gmail.com
This file holds the Rotor class which defines the functionality
of a single Enigma Rotor
"""
class Rotor():
def __init__(self, rotor_num, start_pos):
self.rotor_num = rotor_num
self.pos = start_pos
if self.rotor_num == 1:
... |
from datetime import datetime, timedelta;
from mikecore.DfsFile import *;
from mikecore.DfsFileFactory import *;
def Dfs0ToAscii(dfs0FileName, txtFileName):
'''Writes dfs0 data to text file in similar format as other MIKE Zero tools '''
dfs = DfsFileFactory.DfsGenericOpen(dfs0FileName)
txt = open ... |
# -*- coding: utf-8 -*-
""" This module supplements Luigi's atomic writing within its Target classes.
The subclassed method preserves the suffix of the output target in the temporary file.
"""
import io
import os
import random
import traceback
from contextlib import contextmanager
import luigi
from luigi.local... |
#!/usr/bin/python
import os
import json
import logging
import lief
lief.logging.disable()
from .AbstractLabelProvider import AbstractLabelProvider
from smda.common.labelprovider.OrdinalHelper import OrdinalHelper
LOGGER = logging.getLogger(__name__)
class WinApiResolver(AbstractLabelProvider):
""" Minimal Win... |
"""
RUNBASE-IMP
HTML scraping bot for monitoring Adidas Runners events
Author: Francesco Ramoni
francesco[dot]ramoni@email.it
https://github.com/framoni/
"""
import json
from lxml import html
from selenium import webdriver
import time
from twilio.rest import Client
#-------------------------------... |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... |
#!/usr/bin/python
##
# Send a push message via the Google Cloud Messaging.
#
# Dependencies:
# - python-gcm. Install it with pip: pip install python-gcm.
#
# Params:
# 1.: GCM API key.
# 2.: Target device registration id.
# 3. - : The message's key-value pairs, separated with ':'.
#
# Examples:
# $ send-push.py api_k... |
"""
Copyright (c) 2019 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 in wri... |
from datarefinery.TupleOperations import keep
def test_empty():
inp = None
op = keep(["field1"])
(res, err) = op(inp)
assert res is None
assert err == {'field1': 'field1 not found'}
def test_some_value():
inp = {"field1": True}
op = keep(["field1"])
(res, err) = op(inp)
assert ... |
from baseq.setting import r_script_dir
import os, sys
from baseq.mgt import get_config, run_cmd
def plot_genome(bincount, cbs_path, path_out):
"""Plot the genome
"""
script = os.path.join(r_script_dir, "Genome_Plot.R")
#dynamic_bin = get_config("CNV_ref_"+genome, "dynamic_bin")
cmd = "Rscript {} {}... |
import sys
def main():
x=int(input())
arr=[int(i) for i in input().split()]
for i in range(x-1):
# a1=arr[i]
for j in range(i+1,x):
if arr[i]>arr[j]:
tem=arr[i]
arr[i]=arr[j]
arr[j]=tem
print(" ".join([str(i) for i in arr]))
try... |
import numpy as np
df = h2o.H2OFrame.from_python(np.random.randn(100,4).tolist(), column_names=list('ABCD'))
# View top 10 rows of the H2OFrame
df.head()
# A B C D
# --------- ---------- ---------- ---------
# -0.613035 -0.425327 -1.92774 -2.1201
# -1.26552 -0.241526 ... |
# -*- coding: utf-8 -*-
from models.group import Group
def test_FullForm(app, db, json_groups, check_ui):
group = json_groups
old_groups = db.get_group_list()
app.groups.create(group)
# assert len(old_groups) + 1 == app.groups.count_groups()
new_groups = db.get_group_list()
... |
import re
from model.contact import Contact
from random import randrange
from fixture.db import DbFixture
from test.test_email import merge_emails_like_on_home_page
def test_phones_on_home_page(app):
contact_from_home_page = app.contact.get_contact_list()[0]
contact_from_edit_page = app.contact.get_contact_i... |
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import numpy as np
def read_log(filename):
with open(filename, 'r') as file_h:
content = file_h.readlines()
preprocessors = []
regressors = []
rescalers = []
idx = 0
for line in content:
if 'preprocesso... |
#!/usr/bin/env python
# Author: Derrick H. Karimi
# Copyright 2014
# Unclassified
import re
import botlog
from bbot.Utils import *
from bbot.StatsParser import StatsParser
S = SPACE_REGEX
N = NUM_REGEX
class EndTurnParser(StatsParser):
def __init__(self):
StatsParser.__init__(self)
self.buymenu... |
import qdarkstyle
import sys
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from PyQt5.QtCore import *
from Voicelab.VoicelabWizard.InputTab import InputTab
from Voicelab.VoicelabWizard.OutputTab import OutputTab
from Voicelab.VoicelabWizard.SettingsTab import SettingsTab
#from Voicelab.VoicelabWizard.Experime... |
# -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import os
from os.path import join, exists
import six
from asv import config
from asv.commands.publish import Publish
... |
#!/usr/bin/env python3
# Copyright (c) 2018 Anki, Inc.
#
# 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 in the file LICENSE.txt or at
#
# https://www.apache.org/licenses/LICENSE-2.0
... |
import sys
import math
# You might know Fermat’s small theorem:
# If n is prime, then for any integer a, we have a^n ≡ a mod n,
# that means that a^n and a have the same r in the euclidian division by n.
# There are numbers, called Carmichael numbers, that are not prime but for which the equality remains true for ... |
import os
import platform
import re
import shutil
import subprocess
import helpers.ADBDeviceSerialId as deviceId
import protect
from helpers.CustomCI import CustomInput, CustomPrint
# Detect OS
isWindows = False
isLinux = False
if platform.system() == 'Windows':
isWindows = True
if platform.system() == 'Linux':
... |
# -*- coding: utf-8 -*-
import pytest
import numpy as np
from skcurve import Curve, Point, Axis
@pytest.mark.parametrize('data, size, ndim, dtype', [
([], 0, 2, np.int32),
(np.array([]), 0, 2, np.int32),
(np.array([], ndmin=2), 0, 2, np.int32),
(([1, 2, 3, 4, 5], [1, 2, 3, 4, 5]), 5, 2, np.float64),... |
import numpy as np
import twopoint
import fitsio as fio
import healpy as hp
from numpy.lib.recfunctions import append_fields, rename_fields
from .stage import PipelineStage, NOFZ_NAMES
import subprocess
import os
import warnings
class nofz(PipelineStage):
name = "nofz"
inputs = {}
outputs = {
"weig... |
import tkinter as tk
window=tk.Tk()
window.title('my windows')
window.geometry('400x400')
l=tk.Label(window,bg='yellow',width=20,text='empty')
l.pack()
def print_selection():
if (var1.get()==1 & (var2.get()==0)):
l.config(text='I love only Python')
elif (var1.get()==0 & (var2.get()==0)):
... |
# -*- coding: utf-8 -*-
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
import logging
from glob import Glob
from ormbase import OrmBase
from drivers import genericdevice
from alarm import alarmzone
'''
module implementing turhouse db connection
'''
def dbConnect():
'''
... |
import requests
import os
import json
import logging
import argparse
from github import Github
owner = os.environ.get("GIT_ORG")
token = os.environ.get("GIT_TOKEN")
with open('github-management/manage-labels/labels.json') as file:
labels = json.load(file)
g = Github(token)
org = g.get_organization('fuchicorp')
... |
import socket
import cv2
import numpy as np
import time
import threading
import pyaudio
import wavio
import wave
class sendDataThread(threading.Thread):
def __init__(self):
threading.Thread.__init__(self)
#发送buffer类型的data,会先编码,发送其长度,再发送该数据
def sendData(self,serversocket, stringData):
#先发送... |
"""
Implementation of the NORX permutation.
https://norx.io
"""
from cipher_description import CipherDescription
r = []
def apply_h(cipher, x, y, wordsize):
"""
H(x, y) = (x + y) + ((x & y) << 1)
Applies H on the whole word and assigns it to x.
"""
for bit in range(wordsize):
cipher.ap... |
import json
import os
from collections import Counter
from telegram import InlineKeyboardMarkup, InlineKeyboardButton
from tkuosc_bot.utils.concurrent_func import async_edit_msg
class Meet:
_dir_path = os.path.join(os.path.dirname(__file__), '../../files/meet/')
OPENING = "open"
CLOSED = "close"
NOT... |
import os
touching_dir='labeled_data/touching/'
not_touching_dir='labeled_data/not_touching/'
raw_data_dir='raw_data'
pos_frames_dir='pos_frames'
for i in touching_dir,not_touching_dir,raw_data_dir,pos_frames_dir:
if not os.path.exists(i):
os.makedirs(i)
|
"""
Copyright 2019 Goldman Sachs.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software di... |
import pygame, draw
DEFAULTVIEWDIMS = (0, 0, 500, 500)
MINZOOM = 200
EDGEPIXELRANGE = 20
DEFAULTZOOM = 1.1
class ZoomError(StandardError):
pass
class StateError(StandardError):
pass
class gameViewControl:
"""This class controls the game view"""
def __init__(self, display, board, bgLayers):
self... |
"""
host module functions:
cache the varied state data of hosts, providing continuity when mode changes
provide method names for publishing to thirtybirds topics
provide state data to http_server
data flow:
controller writes state data here
current mode reads and requests state data here
ht... |
# Copyright 2017 Google Inc.
#
# 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, ... |
from pwn import *
context.terminal = ['tmux', 'splitw', '-h']
p = process('./example04')
gdb.attach(p)
def write(what, where):
p.sendlineafter('>', str(where))
p.sendlineafter('>', str(what))
def read(where):
p.sendlineafter('>', str(where))
return int(p.recvline())
binary = ELF('./example04')
lib... |
#!/bin/python3
import math
import os
import random
import re
import sys
from collections import defaultdict
# Complete the makeAnagram function below.
def makeAnagram(a, b):
a_char_dict = defaultdict(int)
for char in a:
a_char_dict[char] += 1
counter = 0
for char in b:
if a_char_dict[c... |
# Copyright (c) 2022 CNES
#
# All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
import pickle
import numpy as np
import pytest
from ... import core
def weighted_mom1(values, weights):
"""Return the weighted moment 1 of the values."""
retur... |
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
# pylint: skip-file
import pyomo.environ as aml
import math
import operator as op
from functools import reduce
def get_pyomo_model(*args, **kwargs):
m = aml.ConcreteModel()
m.I = range(5)
def init_x(m, i):
return [-1.717142, 1.595708, 1.827248, -0.7636429, -0.7636435][i]
m.x = aml.Var(m.I, i... |
import datetime
import yaml
class FileClass:
"""
Класс для работы с файлом file_name, который передаётся в конструктр из main
- Записывает данные в файл
- Читает данные из файла
"""
def __init__(self, file_name, method=1):
self.file_name = file_name
if method == 2:
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# 地址:https://www.liaoxuefeng.com/wiki/1016959663602400/1017063413904832
# Python基础
print('包含中文的str')
# Python提供了ord()函数获取字符的整数表示,chr()函数把编码转换为对应的字符
print(ord('A'))
print(chr(66))
print(chr(25191))
# 编码
print('ABC'.encode('ascii'))
print('中文'.encode('utf-8'))
print(b'ABC... |
"""Helper functions to be used in views.py/routes file"""
import networkx as nx
import matplotlib
matplotlib.use('Agg')
# for basic network visualizing
import matplotlib.pyplot as plt
# createdb -E UTF8 -T template0 --locale=en_US.utf8 barternet
# specifying system path for module import
import sys
sys.path.append('... |
# Author: Pia Feiel
# Date: 21/01/22
# Topic: assign 0 to nodata values & reclassify (8 classes)
#IMPORTE
import os, sys, cfg_sapi, cmd_sapi, saga_api
import numpy as np
#from qgis.utils import iface
from osgeo import gdal
import osgeo.gdal
import math
import os
import numpy as np
#import ogr
import gl... |
#!/usr/bin/env python3
from test_framework.test_framework import BitcoinTestFramework
from test_framework.messages import (
COIN,
COutPoint,
CTransaction,
CTxIn,
CTxOut,
ToHex,
FromHex)
from test_framework.script import (
CScript,
hash160,
OP_EQUAL,
OP_HASH160,
OP_TRUE,
... |
"""
entradas
capitalparaprestamo-->c-->float
tasadeinteres-->t-->float
salidas
porcentajeanualdecobro-->i-->float
"""
#entradas
c=float(input("Ingrese el capital "))
t=float(input("Ingrese la tasa de interes "))
#caja negra
i=(t*100)/(c*4)
#salidas
print("El porcentaje anual de cobro por el prestamo de ",c, " sera d... |
from typing import Any, List
from dataclasses import dataclass, field
from PyDS.Error import Empty
@dataclass
class Queue:
"""Implementation of Queue ADT
:param __capacity: The maximum number of elements a queue can hold
:type __capacity: int
:param __list: A container that holds n-elements in queue
... |
# Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
#!/usr/bin/env python3
##############################################################################
# Author: Chao XU
# Date: 2019-01-27
# Affiliation: Peking University, TU Dresden
# Function: stanford parser and tagger
#########################################################################... |
from weakref import WeakSet
class UpdateModel(object):
"""Provide the object with a way to notify other objects
that depend on it.
"""
# Slots ensures we're explicit and fast
__slots__ = ('_sources', '_listeners', '_up_to_date',
'_metadata', '_notify_callback',
... |
#
#
#
def tc_gen_code_Kernel_Head(f, kernel_name, l_t3_d_decl_var, l_t2_d_decl_var, l_v2_d_decl_var, l_input_strides, l_external_idx, l_internal_idx, l_inputs_addr,
opt_internal, opt_pre_computed, opt_data_type):
#
f.write("\n")
f.write("// created by tc_gen_code_Kernel()\n")
... |
# Generated by Django 3.1.6 on 2021-05-12 21:29
from django.db import migrations
def unset_non_page_content_paths(apps, schema_editor):
"""
Blanks 'dirpath' and 'filename' values for all WebsiteContent records that do not represent page content.
The destination filepath for these types of WebsiteContent ... |
import os
from waterbutler.core import metadata
class BaseGitHubMetadata(metadata.BaseMetadata):
def __init__(self, raw, folder=None, commit=None):
super().__init__(raw)
self.folder = folder
self.commit = commit
@property
def provider(self):
return 'github'
@propert... |
#
# @lc app=leetcode id=212 lang=python3
#
# [212] Word Search II
#
# https://leetcode.com/problems/word-search-ii/description/
#
# algorithms
# Hard (37.77%)
# Likes: 3927
# Dislikes: 147
# Total Accepted: 314.4K
# Total Submissions: 831.8K
# Testcase Example: '[["o","a","a","n"],["e","t","a","e"],["i","h","k",... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
\ /
\ o ^ o /
\ ( ) /
____________(%%%%%%%)____________
( / / )%%%%%%%( \ \ )
(___/___/__/ \__\___\___)
( / /(%%%%%%%)\ \ )
(__/___/ (%%%%%%%) \___\__)
/( )\
... |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed unde... |
import numpy as np
import scipy as sp
import scipy.optimize
def analytic_center(A,b,eps,x0,method='nelder-mead'):
'''
Input:
- A -- N x M
- b -- N
- eps -- N
- x0 -- M
Output is a scipy OptimizeResult for
max np.sum(eps*log(b-A@x))
optimized using x0 as a starting point
... |
# import the necessary packages
from imutils.video import VideoStream
from imutils.video import FPS
import numpy as np
import argparse
import pickle
import imutils
import time
import math
import cv2
import os
class RecognizeFaceGenderAge(object):
def __init__(self):
# construct the argument parser and... |
import abc
import users.person as person
class PersonValidatorInterface(metaclass=abc.ABCMeta):
@classmethod
def __subclasshook__(cls, subclass):
return (hasattr(subclass, 'detect_user') and
callable(subclass.detect_user
) or
NotImplemented)
@a... |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'CanonicalFieldEntryLabel'
db.create_table(u'crowdataapp_c... |
import os
import subprocess
import time
import unittest
os.environ["MANIWANI_CFG"] = "test/media-test-config.cfg"
from shared import app, db
from model.Media import storage
DOCKER_NAME = "minio-test-instance"
MINIO_START_CMD = "docker run -d -p 9000:9000 -e MINIO_ACCESS_KEY=minio -e \
MINIO_SECRET_KEY=miniostorage --... |
# ! You need to understand morphological transformations before understanding the code.
# * Please check the video for more information with link below.
# # Link is here: https://pythonprogramming.net/morphological-transformation-python-opencv-tutorial/
# * Check the documentation as well for function argument options... |
#!/usr/bin/env python3
from hashlib import sha512
import json
import time
from app.db_utils import *
import app.rsa as rsa
from base64 import b64encode, b64decode
from Crypto.PublicKey import RSA
from flask import Flask, request
import requests
# A class that represents a Block, which stores one or ... |
import os
from dotenv import load_dotenv
load_dotenv()
SECRET_KEY = 'development key' # keep this key secret during production
if os.getenv('FLASK_ENV') == 'development':
SQLALCHEMY_DATABASE_URI = os.getenv('DATABASE_URL')
else: # production
db_user = os.getenv('db_user')
db_pass = os.getenv('db_pass')... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.