content
stringlengths
0
1.05M
origin
stringclasses
2 values
type
stringclasses
2 values
import os from dotenv import load_dotenv,find_dotenv # not used in this stub but often useful for finding various files project_dir = os.path.join(os.path.dirname(__file__), os.pardir) load_dotenv(find_dotenv())
nilq/baby-python
python
from ..views import add, configure, delete
nilq/baby-python
python
#!/usr/bin/env python # -*- coding: iso-8859-15 -*- # Copyright (c) 2014 The New York Times Company # # 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/LIC...
nilq/baby-python
python
# Author: Xinshuo Weng # Email: xinshuow@andrew.cmu.edu # this file includes general help functions for MUGSY data import init_paths init_paths.main() from check import isstring, isscalar from file_io import get_sheet_service, update_patchs2sheet, get_data_from_sheet, update_row2sheet # # number of points for all par...
nilq/baby-python
python
from dataclasses import dataclass import pytest import argdcls from argdcls.config import _parse @dataclass class Config: lr: float adam: bool = False def test_load_params(): # "*" config = argdcls.load(Config, ["@lr=1.0"]) assert config.lr == 1.0 # "" config = argdcls.load(Config, ["...
nilq/baby-python
python
#! /usr/bin/env python """ A simple demo using aubio and pyaudio to play beats in real time Note you will need to have pyaudio installed: `pip install pyaudio`. Examples: ./demo_tapthebeat.py ~/Music/track1.ogg When compiled with ffmpeg/libav, you should be able to open remote streams. For instance using youtube-d...
nilq/baby-python
python
''' Created 03/20/2014 @authors: Yifan Ning @summary: parse Molecular Formula and drugbank_id from drugbank.xml then parse MF(Molecular Formula), FDA Preferred Term and UNNI from UNNIs records match the results from drugbank and results of parse UNNIs records output terms: FDA Preferred ...
nilq/baby-python
python
import pandas as pd from ..util import generate_name from tickcounter.questionnaire import Encoder class MultiEncoder(object): def __init__(self, encoding_rule): if isinstance(encoding_rule, Encoder): self.rules = { encoding_rule.name: encoding_rule } elif isinstance(enc...
nilq/baby-python
python
from rest_framework import serializers from accounts.models import User class AccountSerializer(serializers.ModelSerializer): def validate(self, attrs): username = attrs.get('username', None) email = attrs.get('email', None) password = attrs.get('password', None) try: ...
nilq/baby-python
python
import os import pdb import random import sys import time from pprint import pformat import numpy import torch as tc import torch.nn as nn from tqdm import tqdm from utils.logger import Logger from utils.random_seeder import set_random_seed from config import get_config from training_procedure import Trainer def mai...
nilq/baby-python
python
#!/usr/bin/env python2 # coding:utf-8 import base64 import copy import errno import getopt import json import logging import os import sys import threading import time import traceback import boto3 import oss2 import yaml from botocore.client import Config from pykit import jobq report_state_lock = threading.RLock(...
nilq/baby-python
python
from __future__ import print_function import os import argparse import numpy as np from module.retinaface_function_in_numpy import PriorBox_in_numpy from utils.retinaface_tool_in_numpy import py_cpu_nms_in_numpy, decode_in_numpy, decode_landm_in_numpy import cv2 from module.retinaface_model_in_numpy import RetinaFace f...
nilq/baby-python
python
import logging def init_logging(log_file, log_level): logging.getLogger().setLevel(log_level) log_formatter = logging.Formatter('%(asctime)s %(message)s') root_logger = logging.getLogger() if log_file: file_handler = logging.FileHandler(log_file, encoding='utf8') file_handler.setFormat...
nilq/baby-python
python
from django.core.management.base import BaseCommand from apps.boxes.models import BoxUpload class Command(BaseCommand): help = 'Removes expired and completed boxes uploads' def handle(self, *args, **options): deleted = BoxUpload.objects.not_active().delete() self.stdout.write( sel...
nilq/baby-python
python
from audhelper.audhelper import __version__, __author__ import setuptools with open("README.md", "r") as fh: long_description = fh.read() setuptools.setup( name="audhelper", version=__version__, author=__author__, author_email="sherkfung@gmail.com", description="Audio helper functions including visualiz...
nilq/baby-python
python
import cv2 import numpy as np img = cv2.imread(r"EDIZ\OPENCV\basin.jpg") gri = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY) temp1 = cv2.imread(r"EDIZ\OPENCV\temp1.jpg",0) temp2 = cv2.imread(r"EDIZ\OPENCV\temp2.jpg",0) w,h = temp2.shape[::-1] res = cv2.matchTemplate(gri,temp2,cv2.TM_CCOEFF_NORMED) thresh = 0.5 loc = np.where(r...
nilq/baby-python
python
### # Copyright 2017 Hewlett Packard Enterprise, 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 ...
nilq/baby-python
python
from __future__ import annotations from discord.ext import commands __all__ = ("HierarchyFail",) class HierarchyFail(commands.CheckFailure): ...
nilq/baby-python
python
import numpy as np import pandas as pd import os import scipy.io as spio import math from random import sample class ProcessData: def __init__(self, data_set_directory, columns_to_use): self.directory = data_set_directory self.selected_columns = columns_to_use self.datasets = [] sel...
nilq/baby-python
python
# coding=utf-8 """ Demo app, to show OpenCV video and PySide2 widgets together.""" import sys from PySide2.QtWidgets import QApplication from sksurgerycore.configuration.configuration_manager import \ ConfigurationManager from sksurgerybard.widgets.bard_overlay_app import BARDOverlayApp def run_demo(config_...
nilq/baby-python
python
# coding: utf-8 import sys k_bit_rate_num_bits = [ 0, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 32 ] k_highest_bit_rate = len(k_bit_rate_num_bits) - 1 k_lowest_bit_rate = 1 k_num_bit_rates = len(k_bit_rate_num_bits) k_invalid_bit_rate = 255 # This code assumes that rotations, translations, and sc...
nilq/baby-python
python
#!/usr/bin/python """ Date utilities to do fast datetime parsing. Copyright (C) 2013 Byron Platt This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) ...
nilq/baby-python
python
'''OpenGL extension SGIS.texture_filter4 Overview (from the spec) This extension allows 1D and 2D textures to be filtered using an application-defined, four sample per dimension filter. (In addition to the NEAREST and LINEAR filters defined in the original GL Specification.) Such filtering results in higher ima...
nilq/baby-python
python
from support import print_func import using_name print_func("Jack")
nilq/baby-python
python
"""Various utilities used throughout the code. Here go various utilities that don't belong directly in any class, photometry utils module nor or SED model module. """ import os import pickle import random import time from contextlib import closing import numpy as np from scipy.special import erf from scipy.stats impo...
nilq/baby-python
python
import queue import cards import random #create card decks class constructBoard: def __init__(self, lowLevelCards = queue.Queue(), midLevelCards = queue.Queue(), highLevelCards = queue.Queue()): self.lowlevelcards = lowLevelCards self.midlevelcards = midLevelCards self.highlevelcar...
nilq/baby-python
python
from pytest import raises class IndexedPropertyMapper(object): def __init__(self, desc, instance): self.desc = desc self.instance = instance def __getitem__(self, item): return self.desc.fget(self.instance, item) def __setitem__(self, item, value): # hmm. is this order of ...
nilq/baby-python
python
import asyncio import shutil from collections import namedtuple from concurrent.futures.thread import ThreadPoolExecutor from datetime import datetime, timedelta, timezone from shlex import split as lex from subprocess import DEVNULL, Popen import bottle as bt import httpx import peewee as pw import toml from waitress...
nilq/baby-python
python
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'ui/ForgottenPassword2.ui' # # Created by: PyQt5 UI code generator 5.15.6 # # WARNING: Any manual changes made to this file will be lost when pyuic5 is # run again. Do not edit this file unless you know what you are doing. from PyQt5 impor...
nilq/baby-python
python
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
nilq/baby-python
python
# -*- coding: utf-8 -*- import re from pybuilder.core import init from pybuilder.core import task from pybuilder.core import depends from pybuilder.errors import BuildFailedException from pybuilder.pluginhelper.external_command import ExternalCommandBuilder from pybuilder.utils import assert_can_execute @init def i...
nilq/baby-python
python
"""Class hierarchy for base gates.""" import math from dataclasses import dataclass from functools import singledispatch, reduce from numbers import Number from typing import Tuple, Union, Callable, Dict, Optional, Iterable, Any, List import sympy from typing_extensions import Protocol import numpy as np from ...util...
nilq/baby-python
python
import pygame, sys from pygame.locals import * import random pygame.init() #initializing the pygame library #creating sample questions data = [ { 'question': 'Who is the president of America?', 'right-answer': 'Barack Obama', 'option1' : 'George Washington', 'option2' : 'Paul Kagame', 'option3' : 'Barack O...
nilq/baby-python
python
# example of setting up, running, and graphing landau damping in 3D import os import py_platypus as plat from py_platypus.utils.params import Parameters as Parameters from py_platypus.vis.plotter import Plotter as Plotter if __name__ == "__main__": # override default parameters params = { "dimen...
nilq/baby-python
python
#from app import Util import aiml import sys def formatOutPut(text): text = text.replace('\\t','\t') text = text.replace('\\n','\n') return text def stripCommand(text): if(text[0] == '/'): return text[1:] return text def main(): #create and configurate bot knowledbase ctfbot = ...
nilq/baby-python
python
from trackstats.models import Domain, Metric # Domains Domain.objects.INVESTMENT = Domain.objects.register( ref='investment', name='investment' ) # Metrics, these are associated with a domain Metric.objects.INVESTMENT_COUNT = Metric.objects.register( domain=Domain.objects.INVESTMENT, ref='investment_...
nilq/baby-python
python
import logging import json import transaction from pyramid.view import view_config from pyramid.request import Response __author__ = 'max' log = logging.getLogger(__name__) MODULE_DIR = "newsbomb_recommends.views" @view_config(route_name='generic', renderer='json') def api(request): try: module = req...
nilq/baby-python
python
""" Define the abstract Game class for providing a structure/ interface for agent environments. Notes: - Base implementation done. - Documentation 15/11/2020 """ from abc import ABC, abstractmethod import typing import numpy as np from utils.game_utils import GameState class Game(ABC): """ This class spe...
nilq/baby-python
python
x="There are %d types of people." % 10 binary="binary" do_not="dont't" y="Those who know %s and those who %s." % (binary,do_not) print(x) print(y) print("I said: %r" % x) print("I also said: '%s'." % y) hilarious=False joke_evaluation="Isn't that joke so funny?! %r" print(joke_evaluation % hilarious) w="This is t...
nilq/baby-python
python
# -*- encoding: utf-8 -*- from bs4 import Tag from datetime import datetime from dateutil.parser import parse from dateutil.relativedelta import relativedelta from scrapers.helpers import jsonify_seminars ######################################################### # This part will seriously depend on the structure of ...
nilq/baby-python
python
#============================== IBM Code Challenge ============================= # mat_gui.py # # Creates GUI for user to interact with # # Description: # This generates a GUI that allows the user to enter two matrices, select # a mathematical operation, and displays the operation result to the user. # The ...
nilq/baby-python
python
""" Uses docspec to parse docstrings to markdown. Intended for use with static site generators where further linting / linking / styling is done downstream. Loosely based on Numpy-style docstrings. Automatically infers types from signature typehints. Explicitly documented types are NOT supported in docstrings. """ i...
nilq/baby-python
python
from django.shortcuts import render, get_object_or_404, redirect from django.utils import timezone from django.urls import reverse_lazy from status import models, forms from django.contrib.auth.decorators import login_required # Create your views here. @login_required def add_comment(request,pk): post = get_obj...
nilq/baby-python
python
def countingSort(arr): counter = [0]*100 # as per the constraint that arr[i] < 100 for num in arr: counter[num] += 1 sorted = [] for num, cnt in enumerate(counter): sorted += [num]*cnt return sorted
nilq/baby-python
python
# # relu paddle model generator # import numpy as np from save_model import saveModel import sys def relu(name: str, x): import paddle as pdpd pdpd.enable_static() node_x = pdpd.static.data(name='x', shape=x.shape, dtype='float32') out = pdpd.nn.functional.relu(node_x) cpu = pdpd.static.cpu_plac...
nilq/baby-python
python
import os import os.path from dataclasses import dataclass from os import path import sys from typing import List import requests from bs4 import BeautifulSoup import re import win32console # needs pywin32 import time _stdin = win32console.GetStdHandle(win32console.STD_INPUT_HANDLE) def input_def(prompt, default=''...
nilq/baby-python
python
import numpy as np def get_box_from_point(x,y,kernel,pad,stride): kernel_x = kernel[0] kernel_y = kernel[1] pad_x = pad[0] pad_y = pad[1] stride_x = stride[0] stride_y = stride[1] x_min = (x - 1) * stride_x + 1 - pad_x x_max = (x - 1) * stride_x - pad_x + kernel_x y_min = (y - 1) *...
nilq/baby-python
python
from django.urls import path from . import views urlpatterns = [ path("", views.OrderDetailsView.as_view()), path("<uuid:order_id>", views.OrderDetailsView.as_view()), path("status/<str:order_status_value>", views.OrderStatusView.as_view()), path("incoming", views.IncomingOrders.as_view()), path("s...
nilq/baby-python
python
# Copyright (c) 2021 PaddlePaddle 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 applic...
nilq/baby-python
python
#!/usr/bin/env python2 # -*- coding: utf-8 -*- import hungrybotlib as l from random import choice import config as cfg l.cacheMenus(cfg.menu_file, cfg.menu_url, cfg.days) with open("counter", "r") as f: count = int(f.read()) text = ["Une nouvelle semaine de bouffe !", "Et voila, je viens de mettre à jour les m...
nilq/baby-python
python
"""Output an NML file cataloging a set of audio files. NML is an XML-based file format used by Traktor. This code generates NML version 11, which is used by Traktor Pro. """ import time import xml.sax.saxutils from chirp.common import timestamp from chirp.common import unicode_util from chirp.library import artists...
nilq/baby-python
python
input = open('input/input12.txt').readlines() plants = [] ZERO = 5 BASE_GEN_COUNT = 0 FINAL_GEN_COUNT = 50000000000 will_grow = set() wont_grow = set() for line in input: line = line.strip() if line.startswith('initial'): pots = list(line.split(' ')[2]) BASE_GEN_COUNT = len(pots) plants ...
nilq/baby-python
python
SOCIAL_AUTH_GITHUB_KEY = '0ec5adf60f9d0db84213' SOCIAL_AUTH_GITHUB_SECRET = 'c4b6cd88aac6b4515c5b396be2727b21ee54725e' SOCIAL_AUTH_LOGIN_URL = '/login' SOCIAL_AUTH_LOGIN_REDIRECT_URL = '/' SOCIAL_AUTH_LOGIN_ERROR_URL = '/login-error/' SESSION_COOKIE_DOMAIN = '.localhost.be' USE_X_FORWARDED_HOST = True S...
nilq/baby-python
python
from functools import lru_cache import os from time import time import json from io import StringIO import markdown import jwt import requests import github import datetime import logging from time import sleep from ruamel.yaml import YAML yaml = YAML() ZOOM_API = "https://api.zoom.us/v2/" SPEAKERS_CORNER_USER_ID = ...
nilq/baby-python
python
# Clase 24. Curso Píldoras Informáticas. # Control de Flujo. POO1. # Clase de Teoría. # Lenguajes orientados a objetos: C++, Java, VisualNet... # Atributos/Propiedades: elementos que definen las clases y objetos. # Ventajas POO: # Se pueden establecer Módulos. # Código muy reciclable (esto con Fo...
nilq/baby-python
python
#coding=utf-8 import tensorflow as tf import wmodule import basic_tftools as btf import wml_tfutils as wmlt from object_detection2.datadef import EncodedData import tfop import functools from object_detection2.datadef import * import numpy as np import wnn import wsummary from .build import HEAD_OUTPUTS import object_d...
nilq/baby-python
python
from sqlalchemy import Integer, Text, DateTime, func, Boolean, text from models.database_models import Base, Column class Comment(Base): __tablename__ = "comment" id = Column(Integer, primary_key=True, ) user_id = Column(Integer, nullable=False, comment="评论用户的 ID") post_id = Column(Integer, nullable...
nilq/baby-python
python
#!/usr/bin/env python # Copyright (C) 2009 Chia-I Wu <olv@0xlab.org> # All Rights Reserved. # # This is based on extension_helper.py by Ian Romanick. # # 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...
nilq/baby-python
python
# -*- coding: utf-8 -*- # see LICENSE.rst # ---------------------------------------------------------------------------- # # TITLE : Code for the Examples # AUTHOR : Nathaniel Starkman # PROJECT : TrackStream # # ---------------------------------------------------------------------------- """Examples Code.""" __a...
nilq/baby-python
python
def keep_evens(nums): new_seq = filter(lambda num: num % 2 == 0, nums) return list(new_seq) print(keep_evens([3, 4, 6, 7, 0, 1])) # Saída [4, 6, 0] ''' 1. Write code to assign to the variable filter_testing all the elements in lst_check that have a w in them using filter. ''' lst_check = ['plums', 'watermelon...
nilq/baby-python
python
from django.dispatch import Signal signup_complete = Signal(providing_args=["user",]) activation_complete = Signal(providing_args=["user",]) confirmation_complete = Signal(providing_args=["user","old_email"]) password_complete = Signal(providing_args=["user",]) order_complete = Signal(providing_args=["user",]) email_c...
nilq/baby-python
python
#!/usr/bin/env python3 from setuptools import setup setup( name='lilist', version='0.1.0', description='A linear interpolation list class', url='http://github.com/MatthewScholefield/lilist', author='Matthew Scholefield', author_email='matthew331199@gmail.com', license='MIT', py_modules...
nilq/baby-python
python
from unittest import TestCase import json import attr from marshmallow_helpers import RegisteredEnum, attr_with_schema def enum_to_schema(enum_cls): @attr_with_schema(register_as_scheme=True, strict=True) @attr.s(auto_attribs=True) class MyEnum: enum: enum_cls return MyEnum.schema def enum...
nilq/baby-python
python
from flask import Flask from flask_cors import CORS import json, sys, os, base64 app = Flask(__name__) CORS(app) import logging logging.getLogger("werkzeug").setLevel(logging.ERROR) @app.route("/set_contest/<contestname>/<userhash>") def set_contest(contestname, userhash): print(base64.b64decode(contestname.repl...
nilq/baby-python
python
from operator import mul numstr = '73167176531330624919225119674426574742355349194934\ 96983520312774506326239578318016984801869478851843\ 85861560789112949495459501737958331952853208805511\ 12540698747158523863050715693290963295227443043557\ 66896648950445244523161731856403098711121722383113\ 622298934233803081353362...
nilq/baby-python
python
import asyncio import unittest.mock import pytest START = object() END = object() RETVAL = object() @pytest.fixture def mock(): return unittest.mock.Mock(return_value=RETVAL) @pytest.fixture async def async_fixture(mock): return await asyncio.sleep(0.1, result=mock(START)) @pytest.mark.asyncio async def...
nilq/baby-python
python
r = float(input('Quanto dinheiro você tem na carteira?: R$')) print('Com R${:.2f} você pode comprar US${:.2f}'.format(r, (r/3.27)))
nilq/baby-python
python
""" XMLAction module. """ from pineboolib.core.utils import logging import os.path from pineboolib.core.utils.struct import ActionStruct from .utils.path import _path, coalesce_path from typing import Optional, Any, Union, TYPE_CHECKING if TYPE_CHECKING: from pineboolib.fllegacy.flaction import FLAction # noqa:...
nilq/baby-python
python
from datetime import datetime from pathlib import Path import unittest import pandas as pd import numpy as np import vak import article.syntax HERE = Path(__file__).parent DATA_DIR = HERE.joinpath('test_data') class TestSyntax(unittest.TestCase): def test_date_from_cbin_filename(self): CBIN_FILENAME = ...
nilq/baby-python
python
""" The ``fine_tune.py`` file is used to continue training (or `fine-tune`) a model on a `different dataset` than the one it was originally trained on. It requires a saved model archive file, a path to the data you will continue training with, and a directory in which to write the results. . code-block:: bash $ pyt...
nilq/baby-python
python
#!/usr/bin/python3 from brownie import HuskyTokenDeployer, accounts, HuskyToken, HuskyTokenMinter, Wei def main(): provost = accounts.load('husky') admin = provost is_live = False if provost.balance() == 0: accounts[0].transfer(provost, Wei('1 ether')) husky_token = HuskyToken.deploy("Husky...
nilq/baby-python
python
from pprint import pprint import gym env = gym.make('ChessVsRandomBot-v0') def available_moves(): state = env.state moves_p1 = env.get_possible_moves(state, 1) moves_p2 = env.get_possible_moves(state, -1) pprint(moves_p1) pprint(moves_p2) # no actions left -> resign if len(moves_p1) == ...
nilq/baby-python
python
def is_valid(phrase): words = phrase.split() word_letters = list(map("".join, map(sorted, words))) return len(set(word_letters)) == len(words) passphrases = open("day4.txt").readlines() valid_phrases = list(filter(is_valid, passphrases)) print('Valid Passphrases:', len(valid_phrases)) # = 231
nilq/baby-python
python
import os import datetime import argparse import numpy import networks import torch modelnames = networks.__all__ # import datasets datasetNames = ('Vimeo_90K_interp') #datasets.__all__ parser = argparse.ArgumentParser(description='DAIN') parser.add_argument('--debug',action = 'store_true', help='Enable debug mode'...
nilq/baby-python
python
# Copyright 2019 Xilinx 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, ...
nilq/baby-python
python
# -*- coding: utf-8 -*- import argparse import pandas as pd from zvt import init_log, zvt_env from zvt.api.quote import get_stock_factor_schema from zvt.contract import IntervalLevel from zvt.contract.api import df_to_db from zvt.contract.recorder import FixedCycleDataRecorder from zvt.recorders.joinquant.common import...
nilq/baby-python
python
import sys, re def alphaprint(code): r = "^(abcdefghijklmnopqrstuvwxyz)*(a(b(c(d(e(f(g(h(i(j(k(l(m(n(o(p(q(r(s(t(u(v(w(x(y(z?)?)?)?)?)?)?)?)?)?)?)?)?)?)?)?)?)?)?)?)?)?)?)?)?)?)?$" if re.match(r, code, re.I): last="" for i in range(len(code)): if code[i].isupper(): print(end=chr(i % 256)) ...
nilq/baby-python
python
# Create your models here. from django.db import models from django.contrib.auth.models import AbstractUser from django.conf import settings from .common import * class User(AbstractUser): #Boolean fields to select the type of account. is_job_hunter = models.BooleanField(default=False) is_company = models.Bo...
nilq/baby-python
python
#!/bin/python """ Title: The DISEMVOWLER Author: Maxwell Haley Description: Takes in a line of text from stdin, strips it of all vowles, then prints the mangled text and it's vowel remains. Done for /r/DailyProgrammer challenge #149. You can invoke this script in two ways. First, call the script with no arguments and ...
nilq/baby-python
python
import unittest from pulsar.apps.test.wsgi import HttpTestClient from pulsar.utils.httpurl import HttpParser, CHttpParser class TestPyParser(unittest.TestCase): __benchmark__ = True __number__ = 1000 @classmethod async def setUpClass(cls): http = HttpTestClient() response = await htt...
nilq/baby-python
python
from . import ash from . import grm from . import rdi from . import srf from . import sxn from . import tnl from . import ubx # jaykaron from . import adb from . import tnt
nilq/baby-python
python
from quiche.egraph import EGraph from quiche.analysis import MinimumCostExtractor from .prop_test_parser import PropParser, PropTree, PropTreeCost from .test_egraph import verify_egraph_shape # , print_egraph def make_rules(): rules = [ # x -> y ===> ~x | y PropTree.make_rule("(-> ?x ?y)", "(| ...
nilq/baby-python
python
import math import time import random # Print the Main Menu def menu(): print("---- Public Key Cryptography, RSA ----\n") print("1) Extended Euclidean Algorithm.") print("2) Fast Modular Exponentiation.") print("3) Miller-Rabin Test (True=Composite).") print("4) Prime Number Generator.") print...
nilq/baby-python
python
from source_hunter import hunter from source_hunter.hunter import hunt __all__ = [ 'hunter', 'hunt' ]
nilq/baby-python
python
#!/usr/bin/env python # coding=utf-8 from __future__ import absolute_import from collections import namedtuple from difflib import get_close_matches from warnings import warn from pytest import mark from tests.utils import PY34, PY35, PY33, PY26, PY27, PYPY, PY2, PY3 try: from collections import OrderedDict exc...
nilq/baby-python
python
############################################################################## # For copyright and license notices, see __manifest__.py file in module root # directory ############################################################################## from odoo import _ from odoo.http import request, route from odoo.addons....
nilq/baby-python
python
#! /usr/bin/env python # Author: Nuha Nishat # Date: 1/30/20 import rospy import sys, os import math import geometry_msgs.msg from geometry_msgs.msg import PoseStamped from sensor_msgs.msg import JointState import tf, math import tf.transformations import pdb import moveit_commander import moveit_msgs.msg import geom...
nilq/baby-python
python
"""Activation Functions Module. """ import numpy as np class Activation: """Base class for the activation function. Warning: This class should not be used directly. Use derived classes instead. """ def f(self, x): """Compute the activation function on x. Warning: Overrides th...
nilq/baby-python
python
# # This file is part of Orchid and related technologies. # # Copyright (c) 2017-2020 Reveal Energy Services. All Rights Reserved. # # LEGAL NOTICE: # Orchid contains trade secrets and otherwise confidential information # owned by Reveal Energy Services. Access to and use of this information is # strictly limited and...
nilq/baby-python
python
from django import forms class AgendaForm(forms.Form): date=forms.DateField() lc=forms.CharField(max_length=50)
nilq/baby-python
python
info = input() animal_food = {} areas = {} while True: if info == 'Last Info': break tokens = info.split(':') command = tokens[0] name = tokens[1] number = int(tokens[2]) area = tokens[3] if command == 'Add': if name in animal_food: animal_food[name] += number ...
nilq/baby-python
python
from typing import Any, Callable, Dict, Type from marshmallow import Schema, fields, post_load from typing_extensions import Protocol from .dataclasses import Picture, Product, ProductPage, Size, StockItem class Dataclass(Protocol): def __init__(self, **kwargs): ... def get_dataclass_maker(cls: Type[D...
nilq/baby-python
python
from typing import List class Solution: def checkPossibility(self, nums: List[int]) -> bool: flag = False for i in range(0, len(nums)-1): if nums[i] > nums[i+1]: if flag: return False if i == 0: nums[i] = nums[i+1]...
nilq/baby-python
python
from tpdataset import RawDataSet, DataDownloader from torchvision import datasets from torchvision import transforms from torch.utils.data import DataLoader from pyctlib import vector, path, fuzzy_obj import math import torch from ..download_googledrive import download_file_from_google_drive from functools import par...
nilq/baby-python
python
"""Model for blog.""" from django.db import models from django.utils import timezone from django.conf import settings class Post(models.Model): """Post model for blog.""" author = models.ForeignKey( settings.AUTH_USER_MODEL, on_delete=models.CASCADE, ) title = models.CharField(max_len...
nilq/baby-python
python
"""Números Faça um programa que produza o resultado abaixo (sendo N fornecido pelo utilizador). O exercício deve ser resolvido utilizando recursão. 1 1 2 1 2 3 ... 1 2 3 ... N """ def show(n: int) -> None: if n > 0: show(n - 1) i = 1 while i < n + 1: print(f'{i:>3} ', end='') i +=...
nilq/baby-python
python
from django.contrib import admin from website.models import (Category, SubCategory, WebsiteRecommendation, WebsiteComment, BookRecommendation, BookComment, VideoRecommendation, VideoComment) class CategoryAdmin(admin.ModelAdmin): prepopulated_fields = {'slug...
nilq/baby-python
python
""" Created on 9 Dec 2020 @author: Bruno Beloff (bruno.beloff@southcoastscience.com) The A4CalibratedDatum is designed to provide a model training data set that encapsulates the calibration of the electrochemical sensor - the fields we_v_cal, ae_v_zero_cal and cal_x_v have no meaning beyond this. cal_x_v is only rele...
nilq/baby-python
python
from application.domain.application import Application from application.domain.iBaseWatcher import IBaseWatcher from application.domain.iCerebrum import ICerebrum from application.infrastructure.championshipBaseWatcher import ChampionshipBaseWatcher from application.infrastructure.remoteBaseWatcher import RemoteBaseWat...
nilq/baby-python
python
''' Author : MiKueen Level : Medium Company : Google Problem Statement : Count Unival Subtrees A unival tree (which stands for "universal value") is a tree where all nodes under it have the same value. Given the root to a binary tree, count the number of unival subtrees. For example, the following tree has 5 unival s...
nilq/baby-python
python