content stringlengths 0 1.05M | origin stringclasses 2
values | type stringclasses 2
values |
|---|---|---|
"""Define the setup function using setup.cfg."""
from setuptools import setup
setup()
| nilq/baby-python | python |
"""
====================
einsteinpy_geodesics
====================
Julia wrapper for Geodesics
"""
__version__ = "0.2.dev0"
from .geodesics_wrapper import solveSystem
| nilq/baby-python | python |
from leek.api.routes.api_v1 import api_v1_blueprint
from leek.api.routes.manage import manage_bp
from leek.api.routes.users import users_bp
from leek.api.routes.applications import applications_bp
from leek.api.routes.events import events_bp
from leek.api.routes.search import search_bp
from leek.api.routes.agent import... | nilq/baby-python | python |
from __future__ import division
from __future__ import absolute_import
import pycuda.driver as drv
import pycuda.gpuarray as gpuarray
import atexit
STREAM_POOL = []
def get_stream():
if STREAM_POOL:
return STREAM_POOL.pop()
else:
return drv.Stream()
class AsyncInnerProduct:
def __init... | nilq/baby-python | python |
from setuptools import setup,find_packages
import os
pathroot = os.path.split(os.path.realpath(__file__))[0]
setup(
name='sqrt_std',
version='0.1.0',
packages = find_packages(),
entry_points = {
'console_scripts': ['sqrt_std=lib.sqrt_std:main'],
}
) | nilq/baby-python | python |
from __future__ import print_function
import sys
sys.path.insert(1,"../../../")
from tests import pyunit_utils
import h2o
def h2ocluster_status():
"""
Python API test: h2o.cluster_status()
Deprecated, use h2o.cluster().show_status(True)
"""
ret = h2o.cluster_status() # no return type
assert ... | nilq/baby-python | python |
#Main 'run through' of the program. This is run periodically
#to update the state of the file to match what has happened on
#Qualtrics, as well as to send out new surveys in accordance
#with how many have expired or been completed
import urllib
import config
import quapi
import parsers
import helpers
import filemanag... | nilq/baby-python | python |
"""HTML Template Generator
Intended to parse HTML code and emit Python code compatible with Python
Templates.
TODO
- Change tag calls to pass void=True
Open Questions
1. How to merge the generic structure of parsed HTML with existing classes like
HTMLTemplate? For example: the <head> and <body> tags should be m... | nilq/baby-python | python |
import dash
import dash_bootstrap_components as dbc
from apps.monitor import Monitor
from apps.controller import Controller
from apps.navbar import navbar
external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css']
app = dash.Dash(__name__, external_stylesheets=[
dbc.themes.BOOTSTRAP, 'asse... | nilq/baby-python | python |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.PosDishGroupModel import PosDishGroupModel
class KoubeiCateringPosDishgroupSyncModel(object):
def __init__(self):
self._pos_dish_group_model = None
@property
... | nilq/baby-python | python |
with open("file.txt") as f:
something(f)
| nilq/baby-python | python |
#!/app/ansible2/bin/python
# -* coding: utf-8 -*-
DOCUMENTATION = '''
---
author: Arthur Reyes
module: pyvim_facts
description:
- This module gathers and correlates a larger number of useful facts
from a specified guest on VMWare vSphere.
version_added: "0.1"
requirements:
- pyVim
notes:
- This module disab... | nilq/baby-python | python |
from bk_db_tools.xlsx_data_replace import XlsxDataReplace
class SOther(XlsxDataReplace):
dataSets = [
{
'sheetName':'s_player_unit',
'firstColumn':1,
'firstRow':2,
'sql':
"""
select *
from (
select pu.unit_i... | nilq/baby-python | python |
import os
import h5py
import numpy as np
type_to_id = {'worse':[0,0,1], 'okay':[0,1,0], 'better':[1,0,0]}
dirs = ['can',
'lift',
'square',
'transport']
for env in dirs:
path = "datasets/" + env + "/mh"
old = path + "/low_dim.hdf5"
new = path + "/low_dim_fewer_better.hdf5"
os.sys... | nilq/baby-python | python |
import sys
from pathlib import Path
path = str(Path(__file__).parents[1].resolve())
sys.path.append(path)
from datasets import load_dataset
from transformers import Wav2Vec2ForCTC, Wav2Vec2Processor
import soundfile as sf
import torch
from jiwer import wer
import numpy as np
from sonorus.speech.lm import (
Fairs... | nilq/baby-python | python |
from __future__ import unicode_literals
import logging
from django import template
from ..utils import get_seo_model
from ..models import SeoUrl
logger = logging.getLogger(__name__)
register = template.Library()
class SeoDataNode(template.Node):
def __init__(self, variable_name):
self.variable_name =... | nilq/baby-python | python |
from setuptools import setup, find_packages
packages = find_packages()
setup(name = 'cddm_experiment',
version = "1.0.0",
description = 'Tools for cross-differential dynamic microscopy experiment',
author = 'Andrej Petelin',
author_email = 'andrej.petelin@gmail.com',
url="https://github.... | nilq/baby-python | python |
class MyClass:
pass
obj = MyClass() # creating a MyClass Object
print(obj) | nilq/baby-python | python |
def is_palindrome(input_string):
"""Check if a string is a palindrome
irrespective of capitalisation
Returns:
True if string is a palindrome
e.g
>>> is_palindrome("kayak")
OUTPUT : True
False if string is not a palindrome
e.g
>>> is_palindro... | nilq/baby-python | python |
from izihawa_utils.text import camel_to_snake
def test_camel_to_snake():
assert camel_to_snake('CamelCase') == 'camel_case'
assert camel_to_snake('camelCase') == 'camel_case'
assert camel_to_snake('camelCase camel123Case') == 'camel_case camel123_case'
assert camel_to_snake('camelCase\ncamelCase') == ... | nilq/baby-python | python |
from flask import Blueprint, request
from kaos_backend.controllers.notebook import NotebookController
from kaos_backend.util.flask import jsonify
from kaos_model.api import Response
def build_notebook_blueprint(controller: NotebookController):
blueprint = Blueprint('notebook', __name__)
@blueprint.route("/... | nilq/baby-python | python |
#!/usr/bin/env python3.5
# -*- coding: utf-8 -*-
# setup.py
from setuptools import setup
DESCRIPTION = "See ./README.md"
LONG_DESCRIPTION = DESCRIPTION
setup(
author="Dan'",
author_email="dan@home",
name="mfm",
version="0.0.0",
description=DESCRIPTION,
long_description=LONG_DESCRIPTION,
... | nilq/baby-python | python |
# Copyright 2020 University of New South Wales, University of Sydney, Ingham Institute
# 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
# Unle... | nilq/baby-python | python |
"""Overview plots of transcet"""
import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import linregress
from os.path import join
from src import sonic_layer_depth
plt.ion()
bbox = dict(boxstyle='round', fc='w')
savedir = 'reports/jasa/figures'
c_fields = np.load('data/processed/inputed_decomp.npz')
... | nilq/baby-python | python |
import time
from datetime import datetime, timedelta
import funcy
from unittest import mock
import asyncio
from octoprint.events import EventManager
async def wait_untill(
condition,
poll_period=timedelta(seconds=1),
timeout=timedelta(seconds=10),
condition_name="no_name",
time=time.time,
*con... | nilq/baby-python | python |
from subsystems.drivesubsystem import DriveSubsystem
import commands2
import wpilib
#time in seconds
ticksDistance = 0
class rotateArm(commands2.CommandBase):
def __init__(self, power: float, distance: float) -> None:
super().__init__()
self.power = power
self.distance = distance
d... | nilq/baby-python | python |
#
# Copyright 2017 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | nilq/baby-python | python |
#! /usr/bin/env python3
import numpy as np
from PIL import Image
def load_raw(f, w=3280, h=3280):
# Metadata: width, height
# Metadata: pixelPacking
arr = np.fromfile(f, np.uint8, w*h*3//2).reshape((h,w//2,3)).astype('H')
# Image is big endian 12 bit 2d array, bayered.
# This is detailed in the TX... | nilq/baby-python | python |
ANSI_COLOURS = [
'grey',
'red',
'green',
'yellow',
'blue',
'magenta',
'cyan',
'white'
]
for i, name in enumerate(ANSI_COLOURS):
globals()[name] = str(30 + i)
globals()['intense_' + name] = str(30 + i) + ';1'
def get_colours():
cs = ['cyan', 'yellow', 'green', 'magenta', 'r... | nilq/baby-python | python |
#######################################################################
# Copyright (C) 2017 Shangtong Zhang(zhangshangtong.cpp@gmail.com) #
# Permission given to modify the code as long as you keep this #
# declaration at the top #
################################... | nilq/baby-python | python |
import itertools
def flatten(*arg):
return [item for sublist in arg for item in sublist]
def intersection(*args):
result = set(args[0])
for i in range(1, len(args)):
result = result.intersection(set(args[i]))
return result
def is_unique(*item_lists):
all_items = flatten(*item_lists)
... | nilq/baby-python | python |
import torch
import torch.nn as nn
from torch.autograd import Function
class GdnFunction(Function):
@staticmethod
def forward(ctx, x, gamma, beta):
ctx.save_for_backward(x, gamma, beta)
n, c, h, w = list(x.size())
tx = x.permute(0, 2, 3, 1).contiguous()
tx = tx.view(-1, c)
... | nilq/baby-python | python |
#!/usr/bin/env python3
# --------------------( LICENSE )--------------------
# Copyright (c) 2014-2022 Beartype authors.
# See "LICENSE" for further details.
'''
**Callable creation utility unit tests.**
This submodule unit tests the public API of the private
:mod:`beartype._util.utilfunc.ut... | nilq/baby-python | python |
from os import *
import traceback
import sys
if len(sys.argv) != 2:
print("Utilisation: %s fichier"%(sys.argv[0]))
exit(0)
SIZE=256
try:
f=open(sys.argv[1], O_RDONLY)
bs = read(f, SIZE)
while len(bs) > 0:
write(sys.stdout.fileno(), bs)
bs = read(f, SIZE)
close(f)
except OSEr... | nilq/baby-python | python |
from falcor import *
def render_graph_DefaultRenderGraph():
g = RenderGraph('DefaultRenderGraph')
loadRenderPassLibrary('BSDFViewer.dll')
loadRenderPassLibrary('AccumulatePass.dll')
loadRenderPassLibrary('TemporalDelayPass.dll')
loadRenderPassLibrary('Antialiasing.dll')
loadRenderPassLibrary('B... | nilq/baby-python | python |
import histogram_dct as hd
import pandas as pd
# load data
data = pd.read_excel(r'Example\distributions.xlsx')
# uniform distribution:
hd.histogram_dct(data['unf'], bin=12.5, name='uniform distribution')
# normal distribution:
hd.histogram_dct(data['nrm'], bin=4, name='normal distribution')
# exp distri... | nilq/baby-python | python |
""" Python Character Mapping Codec generated from '8859-2.TXT' with gencodec.py.
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
(c) Copyright 2000 Guido van Rossum.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,erro... | nilq/baby-python | python |
import torch
import torch.nn as nn
import torch.nn.functional as F
class Flip(nn.Module):
"""
Flip indices transformation.
Example:
>>> f = stribor.Flip()
>>> x = torch.tensor([[1, 2], [3, 4]])
>>> f(x)[0]
tensor([[2, 1],
[4, 3]])
>>> f = stribor.Flip([0, 1])
>>> f(x)[0... | nilq/baby-python | python |
# ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
# Copyright (c) 2018, S.J.M. Steffann. This software is licensed under the BSD
# 3-Clause License. Please see the LICENSE file in the project root directory.
# •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••... | nilq/baby-python | python |
from typing import Dict, Optional
from fastapi import APIRouter, Depends, HTTPException
from src.api.serializers import UserIn, UserOut, UsersOut
from src.services.auth import get_current_user, get_user_login_from_token
from src.services.users import (
create_user,
get_user_by_id,
get_user_by_login,
se... | nilq/baby-python | python |
import maestro
import time
import numpy as np
import scipy as sp
import scipy.interpolate
import sys
a1 = 0.1
a2 = 0.26
# In degrees from straight config
ee_pos_list = [
np.array([0.12, 0.17]),
#np.array([0.12, 0]),
#np.array([0.14, 0]),
np.array([0.325, 0.12]),
np.array([0.12, 0.17]... | nilq/baby-python | python |
import cv2
import numpy as np
#####################################
#adjust as per ratio required
widthImg = 640
heightImg = 480
#####################################
cap = cv2.VideoCapture(0)
cap.set(3, widthImg)
cap.set(4, heightImg)
cap.set(10, 150) #id: 10, represents brigthness => adjust as required based on set... | nilq/baby-python | python |
import django_tables2 as tables
from net.models import Connection
from utils.tables import BaseTable, ButtonsColumn, SelectColumn
class ConnectionTable(BaseTable):
pk = SelectColumn()
ipv6_address = tables.Column(linkify=True, verbose_name="IPv6")
ipv4_address = tables.Column(linkify=True, verbose_name="... | nilq/baby-python | python |
import os
import json
from .constants import CUST_ATTR_GROUP
def default_custom_attributes_definition():
json_file_path = os.path.join(
os.path.dirname(os.path.abspath(__file__)),
"custom_attributes.json"
)
with open(json_file_path, "r") as json_stream:
data = json.load(json_strea... | nilq/baby-python | python |
# Copyright 2021 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | nilq/baby-python | python |
from flask_restplus import Api
from jsonschema import FormatChecker
import logging
log = logging.getLogger(__name__)
# Instantiate a Flask-RESTPlus API
api = Api(version='1.0', title='iter8 analytics REST API',
description='API to perform analytics to support canary releases '
'and A/B tests',
... | nilq/baby-python | python |
import sys
def subst(s, ls):
if s == "":
return ""
for j in xrange(0, len(ls), 2):
i = s.find(ls[j])
if i != -1:
return subst(s[:i], ls) + ls[j + 1] + subst(s[i + len(ls[j]) :], ls)
return s
test_cases = open(sys.argv[1], "r")
for test in test_cases:
s, sub = tes... | nilq/baby-python | python |
from rest_framework import serializers
from daiquiri.metadata.models import Column
class ColumnSerializer(serializers.ModelSerializer):
class Meta:
model = Column
fields = (
'id',
'order',
'name',
'description',
'unit',
'ucd... | nilq/baby-python | python |
from django.shortcuts import render, get_object_or_404, redirect
from django.urls import reverse
from django.http import HttpResponseRedirect
from django.views.generic import ListView, DetailView, CreateView
from django.views.generic.edit import FormView, UpdateView
from django.contrib.auth import login, authenticate
... | nilq/baby-python | python |
"""
Unit tests for PDF class
"""
import numpy as np
import unittest
import qp
class EvalFuncsTestCase(unittest.TestCase):
""" Tests of evaluations and interpolation functions """
def setUp(self):
"""
Make any objects that are used in multiple tests.
"""
self.xpts = np.linspace... | nilq/baby-python | python |
import itsdangerous, json, atexit, traceback, logging
from flask import redirect, render_template, url_for, abort, \
flash, request
from flask_login import login_user, logout_user, current_user, login_required
from flask_mail import Message
from flask_admin import Admin, AdminIndexView, expose
from flask_admin.con... | nilq/baby-python | python |
#!/usr/bin/env python3
# Copyright 2004-present Facebook. All Rights Reserved.
# Updates by Pablo Palafox 2021
import torch.nn as nn
import torch
import torch.nn.functional as F
import kornia
from utils import embedder
from utils import geometry_utils
class PoseDecoder(nn.Module):
def __init__(
self,
... | nilq/baby-python | python |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.7 on 2018-08-03 06:39
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('hacker', '0017_auto_20180803_0633'),
]
operations = [
migrations.AddField(
... | nilq/baby-python | python |
import re
from bottle import route, run, template
# shamelessly stolen from https://www.w3schools.com/howto/howto_js_sort_table.asp
js = """
<script>
function sortTable(n) {
var table, rows, switching, i, x, y, shouldSwitch, dir, switchcount = 0;
table = document.getElementById("tbl");
switching = true;
dir =... | nilq/baby-python | python |
#!/usr/bin/python3
import alley_oop
| nilq/baby-python | python |
import glob
import json
import os
import argparse
import numpy as np
from PIL import Image, ImageDraw, ImageFont
from sklearn.preprocessing import MinMaxScaler
POSE_BODY_25_PAIRS_RENDER_GPU = \
[1, 8, 1, 2, 1, 5, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 10, 11,
8, 12, 12, 13, 13, 14, 1, 0, 0, 15, 15, 17, 0, 16, 1... | nilq/baby-python | python |
from flask import render_template,redirect,session,request, flash
from flask_app import app
from ..models import user, bag
@app.route("/bag/create")
def new_bag():
if 'user_id' not in session:
return redirect('/')
data = {
"id":session['user_id']
}
return render_template("add_bag.html",... | nilq/baby-python | python |
import os
import zipfile
from arelle.CntlrCmdLine import parseAndRun
# from https://specifications.xbrl.org/work-product-index-registries-units-registry-1.0.html
REGISTRY_CONFORMANCE_SUITE = 'tests/resources/conformance_suites/utr/registry/utr-conf-cr-2013-05-17.zip/utr-conf-cr-2013-05-17/2013-05-17'
STRUCTURE_CONFOR... | nilq/baby-python | python |
import os
import torch as torch
import numpy as np
from io import BytesIO
import scipy.misc
#import tensorflow as tf
import torchvision
import torchvision.transforms as transforms
from torch.utils.data import DataLoader
from torchvision.datasets import ImageFolder
from torch.autograd import Variable
from matplotlib imp... | nilq/baby-python | python |
import logging
from datetime import datetime, timezone
from brownie import chain
from yearn.historical_helper import export_historical, time_tracking
from yearn.networks import Network
from yearn.treasury.treasury import StrategistMultisig
from yearn.utils import closest_block_after_timestamp
logger = logging.getLogg... | nilq/baby-python | python |
def write_fbk(file_name, feat_path):
with open(file_name, 'r') as f:
lines = f.readlines()
for lin_num, x in enumerate(lines):
audio_name = x.split("/wav/")[1].split(".")[0]
feat_name = ''.join([feat_path, audio_name, '.fbk'])
lines[lin_num] = ''.join([x.strip(),... | nilq/baby-python | python |
import torch
import torch.nn as nn
import numpy as np
from skimage.morphology import label
class Dice(nn.Module):
"""The Dice score.
"""
def __init__(self):
super().__init__()
def forward(self, output, target):
"""
Args:
output (torch.Tensor) (N, C, *): The model o... | nilq/baby-python | python |
import sort_for_vexflow
import pretty_midi
def notation(orchestra, inst, tech, dyn, note, tgt, onoff, microtone,masking_order_idx):
annotations=[]
orchestration_slice=[]
tgts=[]
for i in range(len(inst)):
# Check that you input proper values:
if tech[i] in list(orchestra[inst[i]].keys()... | nilq/baby-python | python |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2018-06-18 07:56
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('disturbance', '0005_auto_20180618_1123'),
]
operations = [
migrations.RemoveField(
... | nilq/baby-python | python |
def shared_function(x, sep=':'):
return sep.join(['got', x]) | nilq/baby-python | python |
from cleaner_console import Console
if __name__ == '__main__':
Console() | nilq/baby-python | python |
from node import constants
def shout(data):
data['type'] = 'shout'
return data
def proto_page(uri, pubkey, guid, text, signature, nickname, PGPPubKey, email,
bitmessage, arbiter, notary, notary_description, notary_fee,
arbiter_description, sin, homepage, avatar_url):
data =... | nilq/baby-python | python |
# -*- coding: utf-8 -*- #
# Copyright 2018 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | nilq/baby-python | python |
# -*- coding: utf-8 -*-
"""
controlbeast.utils.loader
~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: Copyright 2013 by the ControlBeast team, see AUTHORS.
:license: ISC, see LICENSE for details.
"""
import importlib
import os
import re
def __filter_members(item):
"""
Filter function to detect classes... | nilq/baby-python | python |
# Generated by Django 3.2.4 on 2021-06-14 12:18
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('main_app', '0... | nilq/baby-python | python |
from __future__ import annotations
from typing import (
Any,
Dict,
Iterator,
Mapping,
MutableMapping,
Optional,
Tuple,
TypeVar,
)
from apiwrappers import utils
VT = TypeVar("VT")
class NoValue:
__slots__: Tuple[str, ...] = tuple()
def __repr__(self):
return f"{self.... | nilq/baby-python | python |
# -*- coding: utf-8 -*-from setuptools import setup, find_packages
from baseapp import get_version
setup(
name='feincms_baseapp',
version=get_version(),
description='This is a base app and contenttype for Feincms.',
author='',
author_email='',
url='https://github.com/',
packages=find_package... | nilq/baby-python | python |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2019/6/24 20:55
# @Author : ganliang
# @File : doctest_test.py
# @Desc : doctest测试 执行模块测试
import doctest
import src.deco
if __name__ == "__main__":
doctest.testmod(src.deco)
| nilq/baby-python | python |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# thumbor imaging service
# https://github.com/thumby/flask-thumbor/wiki
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license
# Copyright (c) 2015 thumby.io dev@thumby.io
class FlaskThumbor:
__name__ = "FlaskThumbor"
def __init__(self,... | nilq/baby-python | python |
import os
import sys
'''
3个空瓶换一瓶
input: n个空瓶
outpu: 最终可换瓶数
'''
def demo1():
while True:
try:
a = int(input())
if a != 0:
print(a//2)
except:
break
######################################
'''
input: n以及n个随机数组成的数组
output: 去重排序后的数组
'''
def dem... | nilq/baby-python | python |
class SETTING:
server_list = {
"presto": {
"connect_type": "PrestoConnector",
"url": {
"username": "hive"
,"host": ""
,"port": 3600
,"param" : "hive"
,"schema": "default"
,"metastore": "my... | nilq/baby-python | python |
# Copyright 2015: Mirantis Inc.
# All Rights Reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... | nilq/baby-python | python |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# @Time : 2017/8/23 下午12:54
# @Author : chenyuelong
# @Mail : yuelong_chen@yahoo.com
# @File : read.py
# @Software: PyCharm
import os, sys
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(sys.argv[0]))))
class read():
'''
fastq中每条read
... | nilq/baby-python | python |
# -*- coding: utf-8 -*-
"""
awsscripter.cli
This module implements awsscripter's CLI, and should not be directly imported.
"""
import os
import warnings
import click
import colorama
import yaml
from awsscripter.cli.init.init import init_group
from awsscripter.cli.audit.audit import audit_group
from awsscripter.cli.... | nilq/baby-python | python |
import tfchain.polyfill.encoding.object as jsobj
import tfchain.polyfill.array as jsarr
import tfchain.polyfill.asynchronous as jsasync
import tfchain.polyfill.crypto as jscrypto
import tfchain.client as tfclient
import tfchain.errors as tferrors
from tfchain.chain import NetworkType, Type
from tfchain.balance import... | nilq/baby-python | python |
import configparser
from fast_arrow import Client, OptionOrder
print("----- running {}".format(__file__))
config = configparser.ConfigParser()
config.read('config.debug.ini')
#
# initialize fast_arrow client and authenticate
#
client = Client(
username = config['account']['username'],
password = config['a... | nilq/baby-python | python |
# This file is part of Indico.
# Copyright (C) 2002 - 2020 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from __future__ import unicode_literals
from datetime import time
from operator import itemgetter
import... | nilq/baby-python | python |
#!/usr/bin/env python
# import necessay modules
from lxml import html
from lxml import etree
import requests
# top-level domain
parent_domain = 'http://trevecca.smartcatalogiq.com'
# parent page showing the porgrams of study
parent_page_url = parent_domain + '/en/2015-2016/University-Catalog/Programs-of-Study'
paren... | nilq/baby-python | python |
x1 = int(input())
y1 = int(input())
x2 = int(input())
y2 = int(input())
x3 = int(input())
y3 = y2
a = abs(x3 - x2)
h = abs(y1 - y2)
s = a * h / 2
print(s) | nilq/baby-python | python |
#!/usr/bin/python
import serial
import sys
import time
import string
from serial import SerialException
import RPi.GPIO as gpio
class SerialExpander:
def __init__(self, port='/dev/ttyS0', baud=9600, timeout=0, **kwargs):
self.__port = port
self.__baud = baud
self.ser = serial.Serial(self.__port, self.__baud, ... | nilq/baby-python | python |
from setuptools import setup, find_packages
with open('README.md') as f:
readme = f.read()
with open('LICENSE') as f:
content = f.read()
setup(
name='Wechatbot',
version='0.0.1',
description='Wechatbot project',
long_description=readme,
install_requires=['itchat==1.3.10', 'requests==2.19.1... | nilq/baby-python | python |
TLS_VERSIONING = "1.0.23"
TLS_DATE = "12 March 2019"
| nilq/baby-python | python |
"""
This module deals with the definition of all the database models needed for the application
"""
from app import db, app
from passlib.apps import custom_app_context as pwd_context
from itsdangerous import (TimedJSONWebSignatureSerializer as Serializer, BadSignature, SignatureExpired)
from math import cos, sin,... | nilq/baby-python | python |
from WConio2 import textcolor, clrscr, getch, setcursortype
import ctypes
ctypes.windll.kernel32.SetConsoleTitleW("n Numbers HCF")
def hcf(n):
a, b, r = n[0], n[1], 0
for x in range(0, len(n) - 1):
while a != 0:
r = b % a
b = a
a = r
a = b
if x + 2 ... | nilq/baby-python | python |
# Copyright (c) 2019 AT&T Intellectual Property.
# Copyright (c) 2018-2019 Nokia.
#
# 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... | nilq/baby-python | python |
# Copyright 2014 Facebook, Inc.
# Modified by Vivek Menon
from facebookads.adobjects.adaccount import AdAccount
from facebookads.adobjects.campaign import Campaign
from facebookads.adobjects.adset import AdSet
from facebookads.adobjects.adcreative import AdCreative
from facebookads.adobjects.ad import Ad
from facebook... | nilq/baby-python | python |
def solution(s):
word_dict = {}
for element in s.lower():
word_dict[element] = word_dict.get(element, 0) + 1
if word_dict.get('p', 0) == word_dict.get('y', 0):
return True
return False
if __name__ == '__main__':
s = 'pPoooyY'
print(solution(s))
"""
def solution... | nilq/baby-python | python |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
# ERPNext - web based ERP (http://erpnext.com)
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe, json
import http.client
import mimetype... | nilq/baby-python | python |
import warnings
from datetime import datetime
import pytest
import pandas as pd
from mssql_dataframe.connect import connect
from mssql_dataframe.core import custom_warnings, custom_errors, create, conversion, conversion_rules
from mssql_dataframe.core.write import insert, _exceptions
pd.options.mode.chained_assignme... | nilq/baby-python | python |
# Server must be restarted after creating new tags file
from django import template
register = template.Library ()
@ register.inclusion_tag ('oauth/tags/user_avatar.html')
def get_user_avatar_tag (user):
'''Return the user's picture, it is an img tag'''
return {'user': user} | nilq/baby-python | python |
# -*- coding:Utf-8 -*-
from gi.repository import Gtk, GObject, GdkPixbuf
from crudel import Crudel
import glob
class PicsouDiapo(Gtk.Window):
""" Affichage d'une image dans une Gtk.Window """
def __init__(self, crud, args):
Gtk.Window.__init__(self, title=args)
self.crud = crud
self.ar... | nilq/baby-python | python |
"""
======================
Geographic Projections
======================
This shows 4 possible geographic projections. Cartopy_ supports more
projections.
.. _Cartopy: http://scitools.org.uk/cartopy
"""
import matplotlib.pyplot as plt
###############################################################################
... | nilq/baby-python | python |
"""
Wrappers around the Google API's.
"""
import os
import json
from datetime import (
datetime,
timedelta,
)
from collections import namedtuple
try:
# this is only an issue with Python 2.7 and if the
# Google-API packages were not installed with msl-io
from enum import Enum
except ImportError:
... | nilq/baby-python | python |
#!/bin/python
#NOTE: modified from original to be more module friendly (PS)
#Original source: https://github.com/jczaplew/postgis2geojson/blob/master/postgis2geojson.py
import argparse
import datetime
import decimal
import json
import subprocess
import psycopg2
#defaults for use as a module, possibly modified by t... | nilq/baby-python | python |
"""Package initialization procedures.
The cli package provides components to build and execute the CLI.
"""
| nilq/baby-python | python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.