content stringlengths 0 1.05M | origin stringclasses 2
values | type stringclasses 2
values |
|---|---|---|
import os
from jina.peapods.pods.k8slib.kubernetes_tools import _get_yaml
from jina import Flow
def test_custom_resource_dir():
custom_resource_dir = '/test'
flow = Flow(
name='test-flow', port_expose=8080, infrastructure='K8S', protocol='http'
).add(name='test_executor', k8s_custom_resource_dir... | nilq/baby-python | python |
from models import OrderModel
from flask_sqlalchemy import sqlalchemy
from config import db
import uuid
class OrderActions():
# Table actions:
@classmethod
def create(cls, usastate: str, order_number: int, home_office_code: str, order_status:int):
theUuid = str(uuid.uuid4())
new_order = OrderMo... | nilq/baby-python | python |
from io import open
from setuptools import find_packages, setup, Extension
from setuptools.command.build_ext import build_ext
import os
import re
import sys
import shutil
from distutils.version import LooseVersion
from subprocess import check_output
cwd = os.path.dirname(os.path.abspath(__file__))
try:
filepath =... | nilq/baby-python | python |
#
# PySNMP MIB module IBMIROCAUTH-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/IBMIROCAUTH-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 19:40:06 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27... | nilq/baby-python | python |
import functools
import numpy as np
from itertools import groupby
import cv2
import torch
from torch import nn
from torch.nn import init
from torch.optim import lr_scheduler
from networks.block import AdaptiveInstanceNorm2d, Identity, AdaptiveInstanceLayerNorm2d, InstanceLayerNorm2d
from lib.alphabet import word_capita... | nilq/baby-python | python |
import logging
import pytest
import csv
from ocs_ci.ocs import constants, scale_noobaa_lib
from ocs_ci.framework.testlib import scale, E2ETest
from ocs_ci.ocs.resources.objectconfigfile import ObjectConfFile
from ocs_ci.utility.utils import ocsci_log_path
from ocs_ci.ocs.utils import oc_get_all_obc_names
log = loggin... | nilq/baby-python | python |
import paramUtils
import argparse
import metricsJsonUtils
import os
import json
# Generate a csv file for Design Explorer (DEX)
# from the input parameters and output
# metrics.
# Example output csv file for Design Explorer
"""
in:Inlet Velocity,in:Jet Velocity,in:Pannel Height,out:PMV (person ave),out:PMV (room ave),... | nilq/baby-python | python |
import logging
import ibmsecurity.utilities.tools
logger = logging.getLogger(__name__)
module_uri = "/isam/felb"
requires_modules = None
requires_version = None
requires_model= "Appliance"
def get(isamAppliance, check_mode=False, force=False):
"""
Retrieving FELB configuration in full
"""
return isa... | nilq/baby-python | python |
from app.experimental.views import experimental
| nilq/baby-python | python |
# decompyle3 version 3.3.2
# Python bytecode 3.7 (3394)
# Decompiled from: Python 3.8.5 (default, Jul 28 2020, 12:59:40)
# [GCC 9.3.0]
# Embedded file name: lib\bl702\efuse_create_do.py
import os, sys, re, binascii, hashlib
from lib import bflb_utils
from lib import bflb_efuse_boothd_create
ef_sf_aes_mode_list = [
'N... | nilq/baby-python | python |
import os
import shutil
def get_filename(file_dir):
filenames=[]
for root, dirs, files in os.walk(file_dir):
for file in files:
filenames.append(os.path.join(root, file))
return filenames
# True针对行号False针对列号
def refile(filename, newfilename, rerow=True ,recol=True ):
... | nilq/baby-python | python |
#!/usr/bin/env python
'''Given desired set of parameters, generates all configurations
obtained by enumerate each parameter individually (continuous are discretized).
'''
import sys, re, MySQLdb, argparse, os, json, subprocess
import pandas as pd
import makemodel
import numpy as np
from MySQLdb.cursors import DictC... | nilq/baby-python | python |
# -*- coding: utf-8 -*-
# ToMaTo (Topology management software)
# Copyright (C) 2010 Dennis Schwerdel, University of Kaiserslautern
#
# 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 vers... | nilq/baby-python | python |
# This is a modification of stlehmann/Flask-MQTT
# https://github.com/stlehmann/Flask-MQTT
from logzero import logger
import paho.mqtt.client as mqtt
from paho.mqtt.client import ( # noqa: F401
Client,
MQTT_ERR_SUCCESS,
MQTT_ERR_ACL_DENIED,
MQTT_ERR_AGAIN,
MQTT_ERR_AUTH,
MQTT_ERR_CONN_LOST,
... | nilq/baby-python | python |
__author__ = 'petlja'
from docutils import nodes
from docutils.parsers.rst import directives
from docutils.parsers.rst import Directive
def setup(app):
app.connect('html-page-context', html_page_context_handler)
app.add_stylesheet('notes.css')
app.add_javascript('notes.js')
app.add_directive('infono... | nilq/baby-python | python |
import discord
from jinja2 import Environment, FileSystemLoader
from configurations import CONFIG
from game_constants import RARITY_COLORS
from search import _
from util import flatten
class Views:
WHITE = discord.Color.from_rgb(254, 254, 254)
BLACK = discord.Color.from_rgb(0, 0, 0)
RED = discord.Color.f... | nilq/baby-python | python |
def set_clock(time, buttons):
res=[int(time.split(":")[0]), int(time.split(":")[1])]
for i in buttons:
if i=="M":
res[1]=(res[1]+1)%60
elif i=="H":
res[0]=(res[0]+1)%24
return "{:d}:{:02d}".format(res[0] if res[0] else 24, res[1]) | nilq/baby-python | python |
def outer_function(msg):
def inner_function():
print(msg)
return inner_function
hi_func=outer_function('Hi')
bye_func=outer_function('Bye')
hi_func()
bye_func()
| nilq/baby-python | python |
import discord
from discord.ext import commands
class Build_info(commands.Cog, name='Build_info'):
def __init__(self, bot):
self.bot = bot
@commands.command(description="Displays build info")
async def build_info(self,ctx,file_override=None):
if file_override is None:
file= 'buildinfo.conf'
with open(fi... | nilq/baby-python | python |
# -*- coding: utf-8 -*-
"""
Created on Wed Nov 1 23:51:03 2017
@author: Mayur
"""
"""
Grader
A regular polygon has n number of sides. Each side has length s.
The area of a regular polygon is: (0.25∗n∗s^2)/tan(π/n)
The perimeter of a polygon is: length of the boundary of the polygon
Write a function... | nilq/baby-python | python |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2019-07-04 11:04
# @Author : minp
# @contact : king101125s@gmail.com
# @Site :
# @File : stockdb.py
# @Software: PyCharm
import pymongo
myclient = pymongo.MongoClient("mongodb://localhost:27017/")
mydb = myclient["runoobdb2"]
mycol = mydb["sites"]
m... | nilq/baby-python | python |
import os
import unittest
import pawnpy
basedir = os.path.dirname(os.path.realpath(__file__))
class TestCompile(unittest.TestCase):
def test_compile(self):
pawnpy.cc(os.path.join(basedir, '../pawnpy/pawn/examples/hello.p'),
basedir + '/hello.amx',
os.path.join(basedir... | nilq/baby-python | python |
from flask import Flask, url_for
from flask_migrate import Migrate
from flask_security import Security
from flask_security.utils import encrypt_password
from flask_admin import helpers as admin_helpers
from adminlte.admin import AdminLte, admins_store, admin_db
from adminlte.models import Role
from adminlte.views impor... | nilq/baby-python | python |
import time
from pymongo import MongoClient
from kiroku.config import MONGO_LOGIN
client = MongoClient(MONGO_LOGIN)
db = client['krk']
def insert_update(data, collection_name):
"""
Insert if the item has unique _id else update the item.
:param dict data: Data to be inserted into the database
:pa... | nilq/baby-python | python |
import json
def create_row_w_validated_params(cls, validated_params, rqst_errors):
found_specific_concern_rows = cls.check_for_specific_concern_rows_with_given_question(
validated_params["rqst_specific_concern_question"],
rqst_errors
)
specific_concern_row = None
if not found_specific... | nilq/baby-python | python |
# MIT License
#
# Copyright (c) 2020 Tri Minh Cao
#
# 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, merg... | nilq/baby-python | python |
from django.urls import path
from . import views
urlpatterns = [
path("",views.home),
path("posts/",views.PostList.as_view()),
path("posts/api/v1/",views.getDataJson),
path("posts/<int:pk>",views.PostDetails.as_view()),
path("post/search/<int:pk>",views.get_Data),
path('modules/',views.ModuleLi... | nilq/baby-python | python |
import sys
fname = sys.argv[1]
ofname = fname + '.raw'
idx = 0
with open(ofname, 'w') as fo:
for line in open(fname).readlines():
fo.write("# ::id %d\n"%(idx, ))
fo.write("# ::snt %s\n"%(line.rstrip()))
fo.write("(d / dummy)\n\n")
idx += 1 | nilq/baby-python | python |
# Modify print_tree_inorder so that it puts parentheses around every operator and pair of operands.
# Is the output correct and unambiguous? Are the parentheses always necessary?
class Tree:
def __init__(self, cargo, left=None, right=None):
self.cargo = cargo
self.left = left
self.right = r... | nilq/baby-python | python |
from flask_login import UserMixin
from sqlalchemy import Column, Integer, String, UniqueConstraint, CheckConstraint
from .base import Base
class User(UserMixin, Base):
"""
Class representing an application user
"""
__tablename__ = "Users"
#: Primary key
id = Column(Integer, primary_key=True)
... | nilq/baby-python | python |
import requests
from bs4 import BeautifulSoup
import sqlite3
from sqlite3 import Error
from datetime import date
#ვიგებთ დღევანდელ რიცხვს თვეს და წელს
today = date.today()
d = today.strftime('%d/%m/%y')
page = 1 #საიტის გვერდი
#ვქმნით ბაზას სადაც შევინახავთ დასკრაპულ ინფორმაციას
conn = sqlite3.connect('data.db')
c =... | nilq/baby-python | python |
# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
import nltk
import numpy as np
from nltk.metrics import *
from nltk.util import ngrams
import enchant # spell checker library pyenchant
from enchant.checker import SpellChecker
from nltk.stem import PorterS... | nilq/baby-python | python |
# -*- coding: utf-8 -*-
"""
Created on Tue May 03 16:32:53 2016
@author: Peter
A collection of functions that can be used to generate a mask for a given tissue.
These functions were fine tuned on a personnal data. They can be used at your own risk.
"""
import numpy as np
from skimage.morphology import disk, opening, ... | nilq/baby-python | python |
from itertools import product
def is_triangle(sides) -> bool:
return all(sum(pair[:2]) >= pair[2] != 0 for pair in product(sides, repeat=3))
def equilateral(sides):
return is_triangle(sides) and sides[0] == sides[1] == sides[2]
def isosceles(sides):
return is_triangle(sides) and (
sides[0] == ... | nilq/baby-python | python |
l086jXnOFE4BtKQlonKnUg+VY1GYfjn3PlxLmSqeVotZ4EuiAMTRmf5+72mmbZZF4OYRQy4ORTJsO2Lt/QsW8VSvG5vQKpjflbbMObnXBVoTrkvHd1i/xYqBUsktc9t4/jn2WW5MROuLwrYvo6gnjHRy6gmPQqxC9RBvC7DXptoYwekEWRh0D5BZ/88slO4iQJ7C+cA0/0fzjIePXkeacQumgZuYLZLnV4+TH9vAQmL4yh4OUnePCcuwG7X74/SlKA065fJIaPqpAE35FC0qaAULRE5E5tdVlWTiwjT1GSFgH2vo18Y7978tgm8D3QhX... | nilq/baby-python | python |
# Copyright Contributors to the Packit project.
# SPDX-License-Identifier: MIT
from tests.testbase import BaseClass
import tempfile
from requre.simple_object import Simple
from requre.online_replacing import replace
def x():
return tempfile.mktemp()
class Duplicated(BaseClass):
@replace("tests.test_duplica... | nilq/baby-python | python |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | nilq/baby-python | python |
from django.db import models
class Conta(models.Model):
descricao = models.CharField(max_length=150, verbose_name="Descrição")
def __str__(self):
return '{}'.format(self.descricao)
class Responsavel(models.Model):
nome = models.CharField(max_length=150, verbose_name="Nome")
def __str__(self... | nilq/baby-python | python |
class serverLoginValidation():
def __init__(self, email, passwd):
self.email = email
self.passwd = passwd
def validateUser(self):
self.db = DataBase()
self.userdata = self.db.userDefined(self.email, self.passwd)
if self.userdata:
return True
else:
... | nilq/baby-python | python |
from ep.utils import *
def first_run(download=False):
"""
Create csv files from stratch
:param download: boolean.
Set to False if files have been downloaded and saved to ./resources
Set to True to download files from EIA website
"""
setupDirectories()
interest_dataframes = get... | nilq/baby-python | python |
import os
import argparse
def main(argv=sys.argv[1:]):
pass
| nilq/baby-python | python |
import dash_mantine_components as dmc
component = dmc.Affix(
dmc.Button("I'm in an Affix Component"), position={"bottom": 20, "right": 20}
)
| nilq/baby-python | python |
import re
import math
import tweepy
import feedparser
from tweepy import OAuthHandler
from textblob import TextBlob
class TwitterClient(object):
# keys and tokens from the Twitter Dev Console
consumer_key = ''
consumer_secret = ''
access_token = ''
access_token_secret = ''
positi... | nilq/baby-python | python |
import sys
from .bv import get_bv_circuit
from .qaoa import get_qaoa_circuit
from .qgan import get_qgan_circuit
from .ising import get_ising_circuit
from .parallel_cnot import get_parallel_cnot, get_parallel_cnot_barriers
from .parallel_swap import get_parallel_swap
from .xeb import get_xeb_circuit, get_xeb_iswap_circ... | nilq/baby-python | python |
""" Canvas Indexer
A flask web application that crawls Activity Streams for IIIF Canvases and
offers a search API.
"""
import atexit
from flask import Flask
from flask_cors import CORS
from canvasindexer.config import Cfg
from canvasindexer.crawler.crawler import crawl
from apscheduler.schedulers.background i... | nilq/baby-python | python |
# Generated by Django 3.1.8 on 2021-08-25 14:00
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("river", "0004_batch_completed_canceled"),
]
operations = [
migrations.RemoveField(
model_name="error",
name="deleted_at",
... | nilq/baby-python | python |
# -*- coding: utf-8 -*-
# Copyright 2015 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Module containing release engineering related builders."""
from __future__ import print_function
from chromite.lib import par... | nilq/baby-python | python |
"""Configs for global use"""
cfg = {'seed': 1971}
| nilq/baby-python | python |
# -*- coding: utf-8 -
import codecs
import io
import os
from setuptools import setup
with io.open(os.path.join(os.path.dirname(__file__), 'README.md'),
encoding='utf-8') as f:
long_description = f.read()
setup(
name = 'bernhard',
version = '0.2.6',
description = 'Python client for Riemann'... | nilq/baby-python | python |
import asyncio, pathlib, importlib
parent = pathlib.Path(__file__).resolve().parent
for _ in parent.iterdir():
if _.is_dir() and not _.name.startswith('.'): importlib.import_module('.main', _.name)
| nilq/baby-python | python |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2019/11/6 上午11:33
# @Title : 58. 最后一个单词的长度
# @Link : https://leetcode-cn.com/problems/length-of-last-word/
QUESTION = """
给定一个仅包含大小写字母和空格 ' ' 的字符串,返回其最后一个单词的长度
如果不存在最后一个单词,请返回 0 。
说明:一个单词是指由字母组成,但不包含任何空格的字符串。
示例:
输入: "Hello World"
输出: 5
"""
THINKING ... | nilq/baby-python | python |
from __future__ import absolute_import, print_function
from django.conf.urls import patterns, url
from .metadata import CloudflareMetadataEndpoint
from .webhook import CloudflareWebhookEndpoint
urlpatterns = patterns(
"",
url(r"^metadata/$", CloudflareMetadataEndpoint.as_view()),
url(r"^webhook/$", Clou... | nilq/baby-python | python |
from sparkpost import SparkPost
import requests
import os
class SparkPostIPNotifier:
current_ip = None
fetched_ip = None
def __init__(self, sparkpost_api_key, subject, from_email, recipients):
self.subject = subject
self.from_email = from_email
self.recipients = recipients
... | nilq/baby-python | python |
"""
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
# Test case ID : C4976201
# Test Case Title : Verify that the value assigned to the Mass of the object, gets a... | nilq/baby-python | python |
# -*- coding: utf-8 -*-
"""
Query permutator to match multiword queries.
Given a query with n tokens we assume the first n-1 to be complete while the last might be partial. From that we
want to match using the following algorithm.
Bag of words reordering is applied to the first n-1 tokens, n-th token (partial) is ke... | nilq/baby-python | python |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.10 on 2018-10-25 19:58
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('s3pooler', '0001_initial'),
]
operations = [
migrations.DeleteModel(
n... | nilq/baby-python | python |
import matplotlib.pyplot as plt
def main():
# The iteration number 0 corresponds to 0 DAger's iteration, which corresponds to the simple behavioral cloning model
iterations = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19]
dagger_mean_return = [499, 491.00752037626864, 280.3549345571... | nilq/baby-python | python |
"""broccoliフレームワーク内データの、シリアライズ・デシリアライズに関するモジュール。"""
import json
from broccoli import register
from broccoli.layer import BaseLayer, BaseItemLayer, BaseObjectLayer, BaseTileLayer
from broccoli.material import BaseTile, BaseObject, BaseItem, BaseMaterial
MANAGER = 'Manager'
LAYER = 'Layer'
TILE = 'Tile'
OBJECT = 'Object... | nilq/baby-python | python |
import numpy as np
import rasterio as rio
import geopandas as gpd
import cartopy.crs as ccrs
import matplotlib.pyplot as plt
from shapely.ops import cascaded_union
from shapely.geometry.polygon import Polygon
from cartopy.feature import ShapelyFeature
import matplotlib.patches as mpatches
def generate_handles(labels,... | nilq/baby-python | python |
# coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HugginFace Inc. team.
#
# 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/LICENS... | nilq/baby-python | python |
from apistar import http, Route
from apistar.backends.sqlalchemy_backend import Session
from db import Auto
def make_auto_dict(auto: Auto) -> dict:
""" Returns a dictionary of the relevant attributes from an Auto object """
return {
"id": auto.id,
"name": auto.name,
"make": auto.make,
... | nilq/baby-python | python |
# MIT License
# Copyright (c) 2016 Alexis Bekhdadi (midoriiro) <contact@smartsoftwa.re>
# 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... | nilq/baby-python | python |
import unittest
import time
from datetime import datetime
from sqlalchemy.exc import IntegrityError
from app import mail
from flask import current_app
from app import create_app, db
from app.models import User, AnonymousUser, Role, Permission, Follow
class AdditionModelTestCase(unittest.TestCase):
def setUp(self... | nilq/baby-python | python |
from django.test import TestCase
from accounts.forms import RegisterForm, SignInForm
from django.contrib.auth.models import User
class TestAccountForm(TestCase):
def test_register_form(self):
form = RegisterForm(
data={
"email": "test@gmail.com",
"username": "te... | nilq/baby-python | python |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'settings_widget.ui'
#
# by: pyside-uic 0.2.15 running on PySide 1.2.2
#
# WARNING! All changes made in this file will be lost!
from tank.platform.qt import QtCore, QtGui
class Ui_SettingsWidget(object):
def setupUi(self, SettingsW... | nilq/baby-python | python |
#!/usr/bin/env python
import logging
from lxml import etree
from ncclient import manager
from ncclient.xml_ import *
def connect(host, port, user, password):
conn = manager.connect(host=host,
port=port,
username=user,
password=pass... | nilq/baby-python | python |
import shlex
def parse_query(query):
tokens = shlex.split(query)
dsl = {'search': []}
key = ''
for token in tokens:
if token.endswith(':'):
key = token[:-1]
else:
value = token or ''
if ':' in token:
key, word = token.split(':', 1)
... | nilq/baby-python | python |
# Copyright (c) 2020 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 b... | nilq/baby-python | python |
# Generated by Django 3.2.7 on 2021-10-30 21:49
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('workOrder', '0001_initial'),
]
operations = [
migrations.RenameField(
model_name='directive',
old_name='workOders',
... | nilq/baby-python | python |
# Excreva um programa que leia um valor em metros e o exiba convertido em centimetros e em milimetros
medida = float(input('Digite a sua medida: '))
print(f'A medida de {medida}m corresponde a {medida*100}cm e {medida*1000}mm')
| nilq/baby-python | python |
"""This module contains modules.
Submodules
==========
.. autosummary::
:toctree: _autosummary
module
gp_modules
"""
__all__ = ['module', 'gp_modules']
| nilq/baby-python | python |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
alphabet.py
Automation sketch to fire LEDs to display clue words.
usage: python3 alphabet.py [-h] [-s SERVER] [-p PORT] [-d] [-l LOGGER]
optional arguments:
-h, --help show this help message and exit
-s SERVER, --server SERVER
... | nilq/baby-python | python |
"""empty message
Revision ID: fd51d3fa9aef
Revises: 1c96aaeccb0b
Create Date: 2022-03-14 12:16:43.830823
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'fd51d3fa9aef'
down_revision = '1c96aaeccb0b'
branch_labels = None
depends_on = None
def upgrade():
pa... | nilq/baby-python | python |
# coding=utf-8
#空文件,只是为了handle目录成为一个模块,python的奇妙规则~ | nilq/baby-python | python |
#!/usr/bin/env python3
# If imports fail, try installing scispacy and the model:
# pip3 install scispacy
# pip3 install https://s3-us-west-2.amazonaws.com/ai2-s2-scispacy/releases/v0.2.0/en_core_sci_md-0.2.0.tar.gz
import sys
import os
import re
import scispacy
import spacy
from sspostproc import refine_split
DOC... | nilq/baby-python | python |
# -*- coding: utf-8 -*-
"""
Created on Mon Dec 14 18:17:10 2020
@author: Manuel Camargo
"""
import tests.read_log as rl
import tests.analyzer_test as ats
import tests.timeit_tests as tit
import tests.timeline_split_tests as tst
if __name__ == "__main__":
ats.timeseries_test()
ats.log_test()
tit.execute_te... | nilq/baby-python | python |
#!/usr/bin/env python
# -*- coding=utf-8 -*-
###########################################################################
# Copyright (C) 2013-2017 by Caspar. All rights reserved.
# File Name: fzcmeans.py
# Author: Shankai Yan
# E-mail: sk.yan@my.cityu.edu.hk
# Created Time: 2017-01-23 12:52:12
#########################... | nilq/baby-python | python |
# Faça um programa que leia o nome completo de uma pessoa, mostrando em seguida o primeiro e o último nome separadamente.
n = str(input('\nType your full name:\n>>> ')).strip().title()
n1 = n.split()
print('\nYour first name {} and your last name {}.\n'.format(n1[0], n1[-1]))
| nilq/baby-python | python |
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as ec
from selenium.webdriver.support.ui import WebDriverWait
from page_objects.login_page import LoginPage
from tools.webdriver_factory import WebdriverFactory
class TestLogin:
def setup_method(self, method):... | nilq/baby-python | python |
class Config(object):
DEBUG = False
SQLALCHEMY_DATABASE_URI = ''
SECRET_KEY = 'dbbc933946e04a729b17c0625b72e3db'
MAIL_SERVER = 'smtp.gmail.com'
MAIL_USERNAME = ''
MAIL_PASSWORD = ''
MAIL_PORT = 465
MAIL_USE_SSL = True
MAIL_USE_TLS = False
MAIL_SUPPRESS_SEND = False
SQLALCHEM... | nilq/baby-python | python |
# -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Nicole Thomas <nicole@saltstack.com>`
'''
# Import Python libs
from __future__ import absolute_import
# Import Salt Testing libs
from salttesting import TestCase, skipIf
from salttesting.helpers import ensure_in_syspath
from salttesting.mock import (
NO_MOCK,
... | nilq/baby-python | python |
import os
from distutils.version import StrictVersion
from pathlib import Path
from warnings import warn
from ..utils.translations import trans
try:
from qtpy import API_NAME, QtCore
except Exception as e:
if 'No Qt bindings could be found' in str(e):
raise type(e)(
trans._(
... | nilq/baby-python | python |
__version__ = '0.1.1'
from .tools import underline2hump, hump2underline, json_hump2underline
| nilq/baby-python | python |
import pywikibot
import redis
from api.translation_v2.core import Translation
from page_lister import get_pages_from_category
from redis_wikicache import RedisPage, RedisSite
if __name__ == '__main__':
# print(translate_using_postgrest_json_dictionary('mat', '[[mine|Mine]]', 'en', 'mg'))
# print(translate_usi... | nilq/baby-python | python |
keysDict = {
'YawLeftButton': 0x1E, # Key A
'YawRightButton': 0x20, # Key D
'PitchUpButton': 0xB5, # NUM /
'PitchDownButton': 0x37, # NUM *
'RollLeftButton': 0x4E, # NUM +
'RollRightButton': 0x9C, # NUM ENTER
'EnableFSD': 0x24, # Key J
'EngineBoost': 0x0F, # Key Tab
'Speed100': 0x47,... | nilq/baby-python | python |
import torch
from .stft import STFT
from librosa.filters import mel as librosa_mel_fn
from .functional import dynamic_range_compression, dynamic_range_decompression
import numpy as np
class MelSTFT(torch.nn.Module):
def __init__(self, filter_length=1024, hop_length=16 * 8, win_length=1024,
n_mel_... | nilq/baby-python | python |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Created on 26/04/2016
Versão 1.0
@author: Ricieri (ELP)
Python 3.4.4
"""
"""
Reviewed on 15/10/2020
Versão 1.0 rev.A - rounded printing values to 3 decimal places and displays '°C' instead of 'ºC'.
@author: Marcelo (ELP)
Python 3.8.6
"""
"""
Reviewed on 06/05/2021
Versão 1... | nilq/baby-python | python |
DEBUG = False
BCRYPT_LEVEL = 12 # Configuration for the Flask-Bcrypt extension
from settings.local_settings import *
| nilq/baby-python | python |
import requests, json
def activities(activity): # Get Activity ID
switch = {
1: "755600276941176913",
2: "755827207812677713",
3: "773336526917861400",
4: "814288819477020702"
}
return switch.get(activity, "755600276941176913")
print("--------------------------------") # He... | nilq/baby-python | python |
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# ... | nilq/baby-python | python |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Feb 14 09:31:37 2020
@author: natnem
"""
import math
def countingSort(array, exp):
n = len(array)
out = [0]*n
count = [0]*10
for i in range(n):
index = (array[i]//exp) % 10
count[index] += 1
for i in range(1,10):
... | nilq/baby-python | python |
from django.shortcuts import redirect
from rest_framework import permissions, viewsets
from rest_framework.decorators import api_view, permission_classes
from . import models
from . import serializers
from ..scraps.models import Scrap
class ScrapBookViewSet(viewsets.ModelViewSet):
queryset = models.ScrapBook.obj... | nilq/baby-python | python |
import numpy as np
import os.path
from keras.models import load_model, Model
from keras.callbacks import ModelCheckpoint, EarlyStopping, CSVLogger
from python_research.experiments.utils import (
TimeHistory
)
from python_research.experiments.multiple_feature_learning.builders.keras_builders import (
bui... | nilq/baby-python | python |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from collections import Iterable, Iterator
def g():
yield 1
yield 2
yield 3
print('Iterable? [1, 2, 3]:', isinstance([1, 2, 3], Iterable))
print('Iterable? \'abc\':', isinstance('abc', Iterable))
print('Iterable? 123:', isinstance(123, Iterable))
print('It... | nilq/baby-python | python |
from tkinter import ttk, Frame, Label, Entry, Button, LEFT, font
from models.repositories.credentials_repository import CredentialsDatabase
from settings import CREDENTIALS_DB, SALT
import sys
sys.path.append("..")
from providers.password_encrypt_provider import PasswordEncryptProvider
class PasswordPage(Frame):
... | nilq/baby-python | python |
import pygame
from pygame.locals import *
import random
import sys
from settings import *
pygame.font.init()
pygame.init()
class Pad(pygame.sprite.Sprite):
def __init__(self):
super(Pad, self).__init__()
self.width, self.height = 95,95
self.image = pygame.Surface((self.wid... | nilq/baby-python | python |
"""
# Script: polyEvaluateTest.py
#
# Description:
# Unit test for the polyEvaluate command.
#
##############################################################################
"""
import maya.cmds as cmds
import unittest
class PolyEvalutateTest(unittest.TestCase):
def testPolyEvaluate(self)... | nilq/baby-python | python |
#----------------------------------------------------------------------
# LinMoTube
# by Jake Day
# v1.2
# Basic GUI for YouTube on Linux Mobile
#----------------------------------------------------------------------
import ctypes, os, requests, io, sys, subprocess, gi, json, threading
from urllib.parse import urlpars... | nilq/baby-python | python |
"""
@author: maffettone
SVM models for classification and regression
"""
from sklearn.svm import SVC
from sklearn.svm import SVR
def gen_classifier(params):
clf = SVC(probability=False,
C=params['C'],
gamma=params['gamma']
)
return clf
def gen_regressor(params):
... | nilq/baby-python | python |
from .data_archive import * # noqa
from .limit_monitor import * # noqa
from .openmct import * # noqa
| nilq/baby-python | python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.