content
stringlengths
0
1.05M
origin
stringclasses
2 values
type
stringclasses
2 values
""" Copy pin d2 to the on-board LED. """ import sys sys.path.append( "../.." ) import hwpy led = hwpy.gpo( hwpy.d13 ) button = hwpy.gpi( hwpy.d2 ) print( __doc__ ) while True: led.write( button.read() )
nilq/baby-python
python
def hamming(n, m): n = bin(n)[2:] m = bin(m)[2:] m = m.rjust(max(len(m), len(n)), '0') n = n.rjust(max(len(m), len(n)), '0') return sum([1 for (x,y) in zip(m, n) if x != y]) if __name__ == '__main__': # These "asserts" using only for self-checking and not necessary for auto-testing assert h...
nilq/baby-python
python
""" Copyright (c) Nikita Moriakov and Jonas Teuwen This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree. """ import numpy as np from typing import Union def clip_and_scale( arr: np.ndarray, clip_range: Union[bool, tuple, list] = False...
nilq/baby-python
python
from fastapi.routing import APIRoute from typing import Callable from fastapi import Request, Response import time import datetime import json class LoggingContextRoute(APIRoute): def get_route_handler(self) -> Callable: # type: ignore original_route_handler = super().get_route_handler() async d...
nilq/baby-python
python
# Copyright (c) 1996-2015 PSERC. All rights reserved. # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. """Runs a power flow. """ from sys import stdout, stderr from os.path import dirname, join from time import time from numpy import r_, c_, ix_, zeros, pi, ones...
nilq/baby-python
python
import subprocess import pytest def build_project(project_path): return subprocess.check_output(['idf.py', '-C', project_path, 'build']) @pytest.mark.parametrize( 'project', [ { 'components': { 'main': { 'dependencies': { 'unit...
nilq/baby-python
python
import os from setuptools import setup def git_version(): return os.system("git rev-parse HEAD") # This file makes your module installable as a library. It's not essential for running apps with twined. setup( name="template-python-fractal", version=git_version(), py_modules=["app"], )
nilq/baby-python
python
import pytest from rotkehlchen.constants.assets import A_BTC from rotkehlchen.fval import FVal from rotkehlchen.order_formatting import MarginPosition from rotkehlchen.tests.utils.accounting import accounting_history_process from rotkehlchen.tests.utils.history import prices from rotkehlchen.typing import Timestamp D...
nilq/baby-python
python
""" Copyright (c) IBM 2015-2017. All Rights Reserved. Project name: c4-system-manager This project is licensed under the MIT License, see LICENSE """ from c4.system.backend import Backend class Version(object): @classmethod def clearVersion(cls): # FIXME: this only works with the shared SQLite backen...
nilq/baby-python
python
from .atihelper import Request
nilq/baby-python
python
from transitions.extensions import GraphMachine import time life_level = 100 sick_level = 0 mood_level = 0 boring_level = 0 hungry_level = 0 money = 100 name = 'Joseph' class TocMachine(GraphMachine): def __init__(self, **machine_configs): self.machine = GraphMachine( model = self, ...
nilq/baby-python
python
import datetime import http.client import urllib.parse import ssl class sms(object): def __init__(self, username, password, host='https://sms.stadel.dk/send.php', ssl_context=None): """Create a new SMS sender""" self.srv = { 'username': username, 'password': password...
nilq/baby-python
python
"""Add column for time. Revision ID: 0936420c5058 Revises: a8271346baba Create Date: 2021-04-25 17:08:12.555683 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '0936420c5058' down_revision = 'a8271346baba' branch_labels = None depends_on = None def upgrade():...
nilq/baby-python
python
# -*- coding: utf-8 -*- # Generated by Django 1.11 on 2019-10-31 13:05 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('neighbourapp', '0002_auto_20191031_1259'), ] operations = [ migrations.Rename...
nilq/baby-python
python
#!/usr/bin/env python3 ''' Created on 20180410 Update on 20180410 @author: Eduardo Pagotto ''' #pylint: disable=C0301 #pylint: disable=C0103 #pylint: disable=W0703 #pylint: disable=R0913 import socket from datetime import datetime from flask import Flask, render_template, jsonify, json, request application = Flask...
nilq/baby-python
python
# -*- coding: utf-8 -*- import os import random import numpy as np from pprint import pprint from tensorflow.python.estimator.estimator import Estimator from tensorflow.python.estimator.run_config import RunConfig from tensorflow.python.estimator.model_fn import EstimatorSpec from bert_encoder.bert.extract_features i...
nilq/baby-python
python
# 16. Write a program in Python to calculate the volume of a cylinder r=int(input("Enter radius of the cylinder: ")) h=int(input("Enter height of the cylinder: ")) vol=3.14*(r**2)*h print("Volume of the cylinder= ",vol)
nilq/baby-python
python
# Generated by Django 3.2.9 on 2022-03-06 05:57 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('shoppingapp', '0008_alter_bank_ac_emp_phone'), ] operations = [ migrations.AlterField( model_name='bank_ac', name='a...
nilq/baby-python
python
# -*- coding: utf-8 -*- # Автор: Гусев Илья # Описание: Функции для обработки тегов. def convert_from_opencorpora_tag(to_ud, tag: str, text: str): """ Конвертировать теги их формата OpenCorpora в Universal Dependencies :param to_ud: конвертер. :param tag: тег в OpenCorpora. :param text: токен...
nilq/baby-python
python
# -*- coding: utf-8 -*- """ Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available. Copyright (C) 2017-2018 THL A29 Limited, a Tencent company. All rights reserved. Licensed under the MIT License (the "License"); you may not use this file except in co...
nilq/baby-python
python
from django.db import models from django.contrib.auth.models import User class CodeStyle(models.Model): user = models.ForeignKey(User) name = models.CharField(max_length=255) repository = models.CharField(max_length=255) metrics = models.TextField(default='{}') calc_status = models.CharField(max_l...
nilq/baby-python
python
# -*- coding: utf-8 -*- import logging import textwrap from typing import List from airflow_munchkin.client_parser.docstring_parser.bricks import SectionBrick from airflow_munchkin.client_parser.docstring_parser.google_docstring_parser import ( GoogleDocstringParser, ) def parse_docstring(docstring: str) -> List...
nilq/baby-python
python
# Copyright (c) 2021, NVIDIA CORPORATION. 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
from .revision_oriented import Revision from .diff import Diff __all__ = [Revision, Diff]
nilq/baby-python
python
##!/usr/bin/env python3 import math import pygame from primitives import GameObject, Pose import constants as c from player import Player class HighScoreColumn(GameObject): def __init__(self, game, parent, get_data, align=c.LEFT, width=100, small_font=False): super().__init__(game) self.align = ...
nilq/baby-python
python
""" project.config ---------------- Defines configuration classes """ import os import logging from . import BASE_PATH class Config: APP_MAIL_SUBJECT_PREFIX = '[PROJECT]' APP_MAIL_SENDER = 'Project Name <project@example.org>' APP_ADMINS = ['Admin <admin@example.org>'] SECRET_KEY = os.environ.get('SECR...
nilq/baby-python
python
import sys from PySide.QtCore import * from PySide.QtGui import * from wordpress_xmlrpc import Client, WordPressPost from wordpress_xmlrpc.methods.posts import GetPosts, NewPost from wordpress_xmlrpc.methods.users import GetUserInfo # Setup Basic Dialog window for user class QDialog_Wordpress(QDialog): def __in...
nilq/baby-python
python
""".. Ignore pydocstyle D400. =========== Preparation =========== .. autoclass:: resolwe.flow.executors.docker.prepare.FlowExecutorPreparer :members: """ import os from django.conf import settings from django.core.management import call_command from resolwe.storage.connectors import connectors from .. import ...
nilq/baby-python
python
import string # convert 5 to base 2 = 101 # encode (5, 2) -> 101 #converting base 10 to whatever base we give it #loop to do the repeated division, where to stop? #get the remainders and divisors #save the remainders #return the final number result as a string #deal with hex digits def encode(number, base...
nilq/baby-python
python
# coding=utf-8 from collections import Iterable from typing import Any from flask import Blueprint, Response, jsonify, render_template from flask.views import MethodView from pysite.constants import ErrorCodes class BaseView(MethodView): """ Base view class with functions and attributes that should be commo...
nilq/baby-python
python
""" Behavioral pattern: Chain of responsibility """ from abc import ABC, abstractmethod class AbstractHandler(ABC): def __init__(self, successor): self._successor = successor def handle(self, request): handled = self.process_request(request) if not handled: se...
nilq/baby-python
python
# -*- coding: utf-8 -*- """ Created on Mon Aug 14 2020 @author: Maria Kuruvilla Goal - Code to visualise trajectoies in the tank to know the dimensions of the tank """ import sys, os import pathlib from pprint import pprint import numpy as np from scipy import stats from scipy.spatial import distance import matplo...
nilq/baby-python
python
''' Created on Mar 29, 2016 @author: dj ''' my_condition = 1 if my_condition == 0: print("my_condition =", "Ok") elif my_condition == 1: print("my_condition =", "Not bad") elif my_condition == 2: print("my_condition =", "Good") else: print("my_condition =", "So, so") print("-" * 40) ...
nilq/baby-python
python
from django.conf import settings from django.contrib.auth import login from rest_framework import serializers from rest_framework.exceptions import ValidationError from users.models import User class UserSerializer(serializers.HyperlinkedModelSerializer): class Meta: model = User fields = ( ...
nilq/baby-python
python
""" 将一个按照升序排列的有序数组,转换为一棵高度平衡二叉搜索树。 本题中,一个高度平衡二叉树是指一个二叉树每个节点 的左右两个子树的高度差的绝对值不超过 1。 示例: 给定有序数组: [-10,-3,0,5,9], 一个可能的答案是:[0,-3,9,-10,null,5],它可以表示下面这个高度平衡二叉搜索树: 0 / \ -3 9 / / -10 5 """ # Definition for a binary tree node. # class TreeNode(object): # def __init__(self, x): # sel...
nilq/baby-python
python
# parsetab.py # This file is automatically generated. Do not edit. # pylint: disable=W,C,R _tabversion = '3.10' _lr_method = 'LALR' _lr_signature = 'leftTYPECASTrightUMINUSrightUNOTleftMASMENOSleftPOTENCIAleftPORDIVRESIDUOleftANDORSIMBOLOOR2SIMBOLOORSIMBOLOAND2leftDESPLAZAMIENTOIZQUIERDADESPLAZAMIENTODERECHAABS ACOS...
nilq/baby-python
python
"""Contains source code for sample app for querying open movie database."""
nilq/baby-python
python
from kafka import KafkaProducer from kafka.errors import KafkaError import ssl import sys import json if len(sys.argv) != 2: sys.exit("Usage: ./send_message.py text_to_send") with open('etc/vcap.json') as data_file: mhProps = json.load(data_file) bootstrap_servers = mhProps['kafka_brokers_sasl'] sasl_pla...
nilq/baby-python
python
9368041 9322554 8326151 9321287 8926822 5085897 9129469 7343633 8138255 9209207 7725805 8201648 6410128 9289441 9375654 9158472 9149158 7234167 9015826 7641475 9428047 7739777 7720051 9614878 9139555 9353321 9129885 9411824 9214745 9592599 9017551 9141364 3250303 9292151 9668398 95866...
nilq/baby-python
python
import numpy as np from mayavi import mlab if __name__ == "__main__": with open("sphere_100.data") as f: # read first the dimension of the grid d = np.fromfile(f, np.int32, 1) print d # read grid size gr_dim = np.fromfile(f, np.int32, 3) print gr_dim ...
nilq/baby-python
python
#!/usr/bin/env python3 from nettest.sockets import TcpSocket from nettest.exceptions import NettestError from nettest.tools.base import MultiSender import sys class TcpSender(MultiSender): def _setup_args(self, parser, need_data=True): super(TcpSender, self)._setup_args(parser) parser.add_argument...
nilq/baby-python
python
text = str(input("Digite o seu nome completo: ")) print("O nome completo com todas as lestras maiúsculas é: {}".format(text.upper())) print("O nome completo com todas as letras minúsculas é: {}".format(text.lower())) divido = text.split() quant = int(len(text) - len(divido) + 1) print("A quantidade de letras sem esp...
nilq/baby-python
python
#!/usr/bin/python # -*- coding: utf-8 -*- import nltk from nltk.corpus import wordnet as wn NOUNS = ['NN', 'NNS', 'NNP', 'NNPS', 'PRP', 'PRP$'] def extractNouns(sentence): nouns = [] text = nltk.word_tokenize(sentence) word_tags = nltk.pos_tag(text) for word_tag in word_tags: if word_tag[1] in NOUNS: ...
nilq/baby-python
python
import numpy as np import pdb import pandas as pd import matplotlib.pyplot as plt def selection_coefficient_calculator(genotype_freq_file): output_file = 'temp.csv' df = pd.read_csv(genotype_freq_file) with open(output_file,'w') as output_f: output_f.write('p,A,a\n') for i in range(len(df)-...
nilq/baby-python
python
# -*- coding: utf-8 -*- # Generated by Django 1.11.1 on 2017-06-12 21:43 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('event_store', '0005_auto_20170602_1835'), ('event_exim', '0005_auto_20170531_1458'),...
nilq/baby-python
python
# Generated by Django 4.0.2 on 2022-03-02 09:02 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('store', '0005_remove_order_payment_status_order_complete'), ] operations = [ migrations.AddField( model_name='product', ...
nilq/baby-python
python
import hashlib from flask_jwt import JWT from bson.objectid import ObjectId from sapia.models.user import User def authenticate(username, password): db_user = db.user.find_one({"email": username}) if db_user and bcrypt.check_password_hash(db_user["password"], password): user = User.short(str(db_user["...
nilq/baby-python
python
unsorted_array = [5, 6, 0, 1, 2, 7, 6, 5, 1, 10, 11, 12, 67, 2, 6, 9, 32] class Node(): __slots__ = ['value', 'left', 'right'] def __init__(self, value): self.value = value self.left = None self.right = None def add(self, x): if x <= self.value: if self.left ...
nilq/baby-python
python
from abc import ABC from dataclasses import dataclass from typing import Type, Union, List from flask import make_response, jsonify from lab_orchestrator_prototype.app import db from lab_orchestrator_prototype.kubernetes.api import APIRegistry, NamespacedApi, NotNamespacedApi from lab_orchestrator_prototype.model imp...
nilq/baby-python
python
# A library to run imagemagick from Python. # By MineRobber9000 # Licensed under MIT import subprocess, shutil def pairs(o): for k in o: yield k,o[k] def wrapper(cmd,input,output,**kwargs): command = [cmd,input] for k,v in pairs(kwargs): command.extend(["-{}".format(k),str(v)]) command.append(output) return ...
nilq/baby-python
python
name = "aiowiki" from .wiki import * from .exceptions import *
nilq/baby-python
python
# The MIT License (MIT) # # Copyright (c) 2018-2020 Frederic Guillot # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, c...
nilq/baby-python
python
#ATS:t0 = test(SELF, "--graphics None", label="Periodic boundary unit test -- 1-D (serial)") #ATS:t1 = test(SELF, "--graphics None", np=2, label="Periodic boundary unit test -- 1-D (parallel)") #------------------------------------------------------------------------------- # 1D test of periodic boundaries -- we ...
nilq/baby-python
python
""" Given a non-negative number represented as an array of digits, add 1 to the number ( increment the number represented by the digits ). The digits are stored such that the most significant digit is at the head of the list. Example: If the vector has [1, 2, 3] the returned vector should be [1, 2, 4] as 123 + 1 ...
nilq/baby-python
python
""" Iterative forms of operations """ import warnings from shapely.errors import ShapelyDeprecationWarning from shapely.topology import Delegating class IterOp(Delegating): """A generating non-data descriptor. """ def __call__(self, context, iterator, value=True): warnings.warn( "Th...
nilq/baby-python
python
# -*- coding: utf-8 -*- """ Created on Mon Jul 06 20:24:16 2020 @author: sagarmakar """
nilq/baby-python
python
import requests import re import os from fake_useragent import UserAgent class crawler(object): def __init__(self, url, templateUrl): self.baseUrl = url self.template = templateUrl self.counter = 1 self.timeout = 10 ua = UserAgent() self.header = {'User-Agent': str(...
nilq/baby-python
python
from django.shortcuts import render from .models import Committee # Create your views here. def about_page_view(request, *args, **kwargs): committee = Committee.objects.all() context = {'committee': committee} return render(request, 'about/about.html', context)
nilq/baby-python
python
# from distribute_setup import use_setuptools # use_setuptools() from setuptools import setup, Extension # check if cython or pyrex is available. pyrex_impls = 'Cython.Distutils.build_ext', 'Pyrex.Distutils.build_ext' for pyrex_impl in pyrex_impls: try: # from (pyrex_impl) import build_ext build_e...
nilq/baby-python
python
import random list1 = ["0","1","2","3","4","5","6","7","8","9"] num = random.sample(list1, 4) ans = "".join(num) Guess = input("Enter 4 different numbers: ") while int(Guess) in range(0, 10000): A = 0 B = 0 if Guess == ans: print("Bingo! The answer is ", ans) break else: if Gues...
nilq/baby-python
python
import unittest from PiCN.Playground.AssistedSharing.IndexSchema import IndexSchema class test_IndexSchema(unittest.TestCase): def test_create_empty(self): # index schema alice_index_schema = ''.join(("doc:/alice/movies/[^/]+$\n" " -> wrapper:/irtf/icnrg/fl...
nilq/baby-python
python
"""Main script to train the doctors. There are two versions - simple and complex. Depending on which should run, game_version needs to be set """ # external imports import os import random import copy import sys import json import time from numpy.random import permutation import rl_setup def train(patient_list,...
nilq/baby-python
python
import string def converter(convertin_text): convertin_text.replace(" ", "-") convertin_text.replace(".", "") convertin_text.replace("ž", "z") convertin_text.replace("Ž", "z") convertin_text.replace("ý", "y") convertin_text.replace("Ý", "y") convertin_text.replace("á", "a") convertin_tex...
nilq/baby-python
python
from typing import List def arraysum(array: List[int]) -> int: """ Get the sum of all the elements in the array. arraysum ======== The `arraysum` function takes an array and returns the sum of all of its elements using divide and concuer method. Parameters ---------- array: List[int] ...
nilq/baby-python
python
#!/usr/bin/env python # -*- coding: utf-8 -*- from setuptools import setup setup( name='bulk-mail-sender', version='0.1', description='Send emails in bulk with a CSV listing and a email template.', author='Clément Martinez', author_email='clementmartinezdev@gmail.com', url='https://github.com/...
nilq/baby-python
python
from typing import List, Optional, Dict from transmart_loader.transmart import Concept as TLConcept, TreeNode as TLTreeNode, StudyNode as TLStudyNode, \ Study as TLStudy, ConceptNode as TLConceptNode, TreeNodeMetadata from dicer.mappers.mapper_helper import observed_value_type_to_value_type from dicer.transmart i...
nilq/baby-python
python
""" ===================================== SGDOneClassSVM benchmark ===================================== This benchmark compares the :class:`SGDOneClassSVM` with :class:`OneClassSVM`. The former is an online One-Class SVM implemented with a Stochastic Gradient Descent (SGD). The latter is based on the LibSVM implementa...
nilq/baby-python
python
# Generated by Django 2.0 on 2020-03-04 05:22 from django.conf import settings from django.db import migrations, models import django.db.models.deletion import django.utils.timezone class Migration(migrations.Migration): initial = True dependencies = [ ('myapp', '0001_initial'), migrations....
nilq/baby-python
python
# coding: utf-8 # In[19]: import os import json import tensorflow as tf import tensorflow.contrib.slim as slim from models.nnets import NN from utils.vocabulary import Vocabulary from config.config import Config from models.models import ShowAttendTell from copy import deepcopy def update_dict(file_name): wi...
nilq/baby-python
python
################################################################################# # # The MIT License (MIT) # # Copyright (c) 2015 Dmitry Sovetov # # https://github.com/dmsovetov # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the ...
nilq/baby-python
python
import numpy as np from numpy.testing import (assert_equal, assert_array_equal, assert_array_almost_equal, assert_raises) import bottleneck as bn from .reduce_test import (unit_maker as reduce_unit_maker, unit_maker_argparse as unit_maker_parse_rankdata) from .util ...
nilq/baby-python
python
from typing import Any, Dict, List, Union import boto3 from chaoslib.exceptions import FailedActivity from chaoslib.types import Configuration, Secrets from logzero import logger from chaosaws import aws_client from chaosaws.types import AWSResponse __all__ = ["instance_status", "cluster_status", "cluster_membership...
nilq/baby-python
python
import json import os import datetime import time import socket import requests class ClockModel(object): def __init__(self): __location__ = os.path.realpath( os.path.join(os.getcwd(), os.path.dirname(__file__))) with open(os.path.join(__location__, "config.json"), "r") as jsonfile: C...
nilq/baby-python
python
# -*- coding: utf-8 -*- """Interpreter ====== Interpreter Class """ from typing import Tuple from deepgo.core.pattern.singleton import AbstractSingleton, abstractmethod from deepgo.shell.command import * class Parser(AbstractSingleton): """Parser Interface This is an Abstract Singleton Class """ @a...
nilq/baby-python
python
import logging import os import time import traceback from math import floor from threading import Thread from typing import List, Tuple, Optional, Dict from PyQt5.QtWidgets import QApplication, QStyleFactory from bauh import ROOT_DIR, __app_name__ from bauh.api.abstract.controller import SoftwareManager from bauh.ap...
nilq/baby-python
python
from coinbase import CoinbaseAccount from info import API_KEY def main(): account = CoinbaseAccount(api_key=API_KEY) print "coinbase balance:", str(account.balance), "BTC" if __name__ == "__main__": main()
nilq/baby-python
python
#!/usr/bin/env python3 from planb.cli import cli if __name__ == '__main__': cli()
nilq/baby-python
python
import tkinter as tk #from interface_adapters.view_models import PositionViewModel class OutputView(tk.Frame): """View for Positions""" def __init__(self, pos_view_model, time_view_model, parent, *args, **kwargs): """Constructor method. Inject pos_view_model, time_view_model an...
nilq/baby-python
python
import os.path import datetime from dateutil.relativedelta import relativedelta # var find path import os class Lastmodif: def diftoday(modification, date_jour): print(os.path.abspath("text.docx")) modification = datetime.date.fromtimestamp(os.path.getmtime("C:\\Users\\DELL\\Deskto...
nilq/baby-python
python
""" am 9 margin data to bcolz """ import time import zipline.data.bundles as bundles_module import logbook import sys logbook.set_datetime_format('local') logbook.StreamHandler(sys.stdout).push_application() log = logbook.Logger('ingest'.upper()) def main(): """margin data to bcolz""" from zipline.pipeline...
nilq/baby-python
python
from .context import models from models import (fc_100_100_10, pca_filtered_model, train, accuracy, fastica_filtered_model, kernelpca_filtered_model, incrementalpca_filtered_model, nmf_filtered_model, truncatedsvd_filtered_model, save_to_file, load_from_file, ...
nilq/baby-python
python
# class Comida(object): def __init__(self): self.tipopan = None self.tipocarne = None self.vegetales = None self.condimentos = None self.hazcombo = None def set_tipopan(self, pan): self.typeBread = pan def set_tipocarne(self, carne): self.typeMeat = ...
nilq/baby-python
python
# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: ipc.protodevel from google.protobuf.internal import enum_type_wrapper from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection ...
nilq/baby-python
python
"""Defines various classes and definitions that provide assistance for unit testing Actors in an ActorSystem.""" import unittest import pytest import logging import time from thespian.actors import ActorSystem def simpleActorTestLogging(): """This function returns a logging dictionary that can be passed as ...
nilq/baby-python
python
special.stdtridf(p,t)
nilq/baby-python
python
#!/usr/bin/env python3 # # Copyright (c) 2018, Cisco and/or its affiliates # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # ...
nilq/baby-python
python
# Interfas Grafica XI # Menu from tkinter import * root=Tk() barraMenu=Menu(root) root.config(menu=barraMenu, width=600, height=400) archivoMenu=Menu(barraMenu, tearoff=0) archivoMenu.add_command(label="Nuevo") archivoMenu.add_command(label="Guardar") archivoMenu.add_command(label="Guardar Como") archivoMenu.add_s...
nilq/baby-python
python
import boto3, json, os, logging, random sqs = boto3.client('sqs') queue_url = os.environ['SQS_QUEUE_URL'] pinpoint_long_codes = os.environ['PINPOINT_LONG_CODES'].split(',') # This function can be used within an Amazon Pinpoint Campaign or Amazon Pinpoint Journey. def lambda_handler(event, context): logging.get...
nilq/baby-python
python
# -*- coding: utf-8 -*- # Generated by Django 1.9.5 on 2016-04-25 08:41 from __future__ import unicode_literals from django.db import migrations import isi_mip.contrib.blocks import wagtail.core.blocks import wagtail.core.fields import wagtail.images.blocks class Migration(migrations.Migration): dependencies = ...
nilq/baby-python
python
# MIT License # # Copyright (c) 2021 Andrew Krepps # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge...
nilq/baby-python
python
import os import pandas as pd import numpy as np root = 'D:\\MT\\mt_framework\\evaluation' folder = ['add_car', 'add_bicycle', 'add_person', 'night', 'rainy'] model = ['basecnn', 'vgg16', 'resnet101'] for f in folder: img_list = os.listdir(os.path.join(root, f)) for m in model: data = [[0, 0] for i i...
nilq/baby-python
python
from urlparse import parse_qs from django.http import HttpResponse from ocgis.util.inspect import Inspect from ocgis.util.helpers import get_temp_path from ocgis import env import util.helpers as helpers from ocgis.util.shp_cabinet import ShpCabinet import os.path from ocgis.api.definition import SelectUgid, Prefix, Un...
nilq/baby-python
python
# -*- coding: utf-8 -*- import numpy as np import torch import torchtestcase as ttc from torch.nn import functional from transformer import multi_head_attention as mha __author__ = "Patrick Hohenecker" __copyright__ = ( "Copyright (c) 2018, Patrick Hohenecker\n" "All rights reserved.\n" "\...
nilq/baby-python
python
""" This module contains the definition of the ConditionalGenerator. """ import numpy as np class ConditionalGenerator: """Conditional Generator. This generator is used along with the model defined in :class:`ctgan.models.Generator`, to sample conditional vectors. Parameters ---------- data:...
nilq/baby-python
python
__source__ = 'https://leetcode.com/problems/merge-k-sorted-lists/' # https://github.com/kamyu104/LeetCode/blob/master/Python/merge-k-sorted-lists.py # Time: O(nlogk) # Space: O(1) # heap # # Description: Leetcode # 23. Merge k Sorted Lists # # Merge k sorted linked lists and return it as one sorted list. Analyze and d...
nilq/baby-python
python
# coding: utf-8 # # Copyright 2019 Amazon.com, Inc. or its affiliates. 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. A copy of the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "lice...
nilq/baby-python
python
#!/usr/bin/python3 """ Rectangle class defination """ class Rectangle: """ an empty class of squre """ pass
nilq/baby-python
python
from django.db import models from django.urls import reverse class BlogPost(models.Model): title = models.CharField(max_length=255) pub_date = models.DateTimeField() body = models.TextField() image = models.ImageField(null=True, blank=True) def get_absolute_url(self): return reverse('blog_post', args=[str(sel...
nilq/baby-python
python
#!/usr/bin/env python3 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Copyright 2010 California Institute of Technology. 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...
nilq/baby-python
python
USERS_CLIENT_ID = "som_core_users" USERS_CLIENT_SECRET = "17d76b65-b8dc-44e6-b23a-73813a2feb63"
nilq/baby-python
python