content stringlengths 0 1.05M | origin stringclasses 2
values | type stringclasses 2
values |
|---|---|---|
"""Define the API serializers."""
| nilq/baby-python | python |
__version__='1.0.3'
| nilq/baby-python | python |
import os
import featuretools as ft
import pandas as pd
from vbridge.utils.directory_helpers import exist_entityset, load_entityset, save_entityset
from vbridge.utils.entityset_helpers import remove_nan_entries
def create_entityset(dataset_id, entity_configs, relationships, table_dir, load_exist=True,
... | nilq/baby-python | python |
src = Split('''
rec_libc.c
rec_main.c
''')
component = aos_component('recovery', src)
component.add_global_includes('.')
| nilq/baby-python | python |
import django
import sys,os
rootpath = os.path.dirname(os.path.realpath(__file__)).replace("\\","/")
rootpath = rootpath.split("/apps")[0]
# print(rootpath)
syspath=sys.path
sys.path=[]
sys.path.append(rootpath) #指定搜索路径绝对目录
sys.path.extend([rootpath+i for i in os.listdir(rootpath) if i[0]!="."])#将工程目录下的一级目录添加到python搜索路... | nilq/baby-python | python |
""" The model train file trains the model on the download dataset and other parameters specified in the assemblyconfig file
The main function runs the training and populates the created file structure with the trained model, logs and plots
"""
import os
import sys
current_path=os.path.dirname(__file__)
parentdir = os.... | nilq/baby-python | python |
#FLM: Calculate GCD of selected glyphs
# Description:
# Calculate the Greatest Common Denominator of selected glyphs
# Credits:
# Pablo Impallari
# http://www.impallari.com
# Dependencies
import fractions
from robofab.world import CurrentFont
# Clear Output windows
from FL import *
fl.output=""
# Fun... | nilq/baby-python | python |
# Discord Packages
import discord
from discord.ext import commands
# Bot Utilities
from cogs.utils.db import DB
from cogs.utils.db_tools import get_user, get_users
from cogs.utils.defaults import easy_embed
from cogs.utils.my_errors import NoDM
from cogs.utils.server import Server
import asyncio
import operator
impor... | nilq/baby-python | python |
from pybrain.structure.modules.linearlayer import LinearLayer
from pybrain.structure.moduleslice import ModuleSlice
from pybrain.structure.connections.identity import IdentityConnection
from pybrain.structure.networks.feedforward import FeedForwardNetwork
from pybrain.structure.connections.shared import MotherConnectio... | nilq/baby-python | python |
from uuid import uuid4
from flask_sqlalchemy import SQLAlchemy
from sqlalchemy_utils import (
UUIDType,
URLType,
)
db = SQLAlchemy()
class Tag(db.Model):
__tablename__ = 'tag'
object_id = db.Column('id', UUIDType(), primary_key=True, default=uuid4)
value = db.Column(db.String(40))
post =... | nilq/baby-python | python |
import subprocess
import os
import json
def main():
files = os.listdir("./processed")
if os.path.isfile("concate.jsonl"):
return
pd = [[],[],[]]
for fn in files:
source = os.path.join("./processed", fn)
with open(source, "r") as f:
d = json.load(f)
pd[... | nilq/baby-python | python |
"""
日 K 範例程式
"""
import asyncio
try:
from skcom.receiver import AsyncQuoteReceiver as QuoteReceiver
except ImportError as ex:
print('尚未生成 SKCOMLib.py 請先執行一次 python -m skcom.tools.setup')
print('例外訊息:', ex)
exit(1)
async def on_receive_kline(kline):
"""
處理日 K 資料
"""
# TODO: 在 Git-Bash ... | nilq/baby-python | python |
#!/usr/bin/env python3
# file://mkpy3_util.py
# Kenneth Mighell
# SETI Institute
def mkpy3_util_str2bool(v):
"""Utility function for argparse."""
import argparse
if v.lower() in ("yes", "true", "t", "y", "1"):
return True
elif v.lower() in ("no", "false", "f", "n", "0"):
return Fals... | nilq/baby-python | python |
import asyncio
import os
import sys
from os.path import realpath
from watchdog.observers import Observer
from watchdog.events import PatternMatchingEventHandler as EventHandler
from watchdog.events import FileSystemEvent as Event
# Event handler class for watchdog
class Handler(EventHandler):
# Private
_fut... | nilq/baby-python | python |
# pip3 install https://github.com/s4w3d0ff/python-poloniex/archive/v0.4.6.zip
from poloniex import Poloniex
polo = Poloniex()
# Ticker:
print(polo('returnTicker')['BTC_ETH'])
# or
print(polo.returnTicker()['BTC_ETH'])
# Public trade history:
print(polo.marketTradeHist('BTC_ETH'))
# Basic Private Setup (Api key/sec... | nilq/baby-python | python |
"""
In the 20×20 grid below, four numbers along a diagonal line have been marked in red.
<GRID MOVED TO MAIN>
The product of these numbers is 26 × 63 × 78 × 14 = 1788696.
What is the greatest product of four adjacent numbers in the same direction (up, down, left, right, or diagonally) in the 20×20 grid?
"""
import mat... | nilq/baby-python | python |
import unittest #importing unittest module
from credential import Credential # importing class Credential
import pyperclip # importing pyperclip module
class TestCredential(unittest.TestCase):
"""
Test class that defines the test cases for the credential class behaviours
Args:
unittest.TestCas... | nilq/baby-python | python |
class KeystoneAuthException(Exception):
""" Generic error class to identify and catch our own errors. """
pass
| nilq/baby-python | python |
import os
import numpy as np
import matplotlib.pyplot as plt
import networkx as nx
from torch_geometric.utils import to_networkx
def draw_nx_graph(G, name='Lobster', path='./visualization/train_nxgraph/'):
fig = plt.figure(figsize=(12,12))
ax = plt.subplot(111)
ax.set_title(name, fontsize=10)
nx.draw(G... | nilq/baby-python | python |
from .xgb import XgbParser
from .lgb import LightgbmParser
from .pmml import PmmlParser | nilq/baby-python | python |
from . bitbucket import BitBucket
| nilq/baby-python | python |
# -*- coding: utf-8 -*-
import pickle
from os import path, makedirs
from googleapiclient.discovery import build
from google_auth_oauthlib.flow import InstalledAppFlow
from google.auth.transport.requests import Request
from googleapiclient.http import MediaIoBaseDownload
import io
import pathlib
from datetime... | nilq/baby-python | python |
import unittest
from conjur.data_object.user_input_data import UserInputData
class UserInputDataTest(unittest.TestCase):
def test_user_input_data_constructor(self):
mock_action = None
mock_user_id = None
mock_new_password = None
user_input_data = UserInputData(action=mock_action, ... | nilq/baby-python | python |
#!/usr/bin/env python3
######################################################################
## Author: Carl Schaefer, Smithsonian Institution Archives
######################################################################
import re
import wx
import wx.lib.scrolledpanel as scrolled
import db_access as dba
import dm... | nilq/baby-python | python |
from django.urls import path
from .views import (
FlightListView,
FlightDetailView,
FlightUpdateView,
HomePageView,
search_results_view,
contact_view,
FlightCreateView,
FlightDeleteView,
AllFlightView,
EachFlightDetail,
)
urlpatterns = [
path('flights/list/', FlightListView.as_view(), name='flights_list'),... | nilq/baby-python | python |
#!/usr/bin/env python
#encoding: utf-8
#####################################################################
########################## Global Variables #########################
#####################################################################
## Define any global variables here that do not need to be changed ##
... | nilq/baby-python | python |
from django.http import HttpResponse, HttpResponseRedirect
from django.contrib.auth.decorators import user_passes_test
from django.urls import reverse
import csv
from .serializers import DaySerializer
from rest_framework.views import APIView
from rest_framework.response import Response
import datetime
import calendar... | nilq/baby-python | python |
import logging
from abc import abstractmethod
from datetime import datetime
import json
from dacite import from_dict
from os.path import join
from airflow.models.dag import DAG
from airflow.operators.python_operator import PythonOperator
from airflow.providers.google.cloud.hooks.gcs import GCSHook
from airflow.provide... | nilq/baby-python | python |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# -----------------------------------------------------------------------... | nilq/baby-python | python |
def shift(string):
for c in string:
print(chr(ord(c) + 2))
shift(input("Inserisci la stringa: ")) | nilq/baby-python | python |
# Sphinx extension to insert the last updated date, based on the git revision
# history, into Sphinx documentation. For example, do:
#
# .. |last_updated| last_updated::
#
# *This document last updated:* |last_updated|.
import subprocess
from email.utils import parsedate_tz
from docutils import nodes
from sphinx.... | nilq/baby-python | python |
##############################################################################
# Copyright 2009, Gerhard Weis
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code ... | nilq/baby-python | python |
from tweepy.streaming import StreamListener
from tweepy import OAuthHandler
from tweepy import Stream
import json
from auth import TwitterAuth
#Very simple (non-production) Twitter stream example
#1. Download / install python and tweepy (pip install tweepy)
#2. Fill in information in auth.py
#3. Run as: python streami... | nilq/baby-python | python |
# -*- coding: utf-8 -*-
import os
import sys
import copy
import random
import numpy as np
import torch
from torchvision import transforms
from .datasets import register_dataset
import utils
@register_dataset('VisDA2017')
class VisDADataset:
"""
VisDA Dataset class
"""
def __init__(self, name, img_dir, LDS_type, i... | nilq/baby-python | python |
# Sample PySys testcase
# Copyright (c) 2015-2016 Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors.
# Use, reproduction, transfer, publication or disclosure is prohibited except as specifically provided for in your Licens... | nilq/baby-python | python |
from selenium import webdriver
from selenium.webdriver import ActionChains
driver = webdriver.Chrome() # give executabe_path = "driver_.exe" path
driver.get("https://swisnl.github.io/jQuery-contextMenu/demo.html")
driver.maximize_window() # maximze the window
button = driver.find_element_by_xpath("/html/body/div/s... | nilq/baby-python | python |
import pytest
import tfchain
from stubs.ExplorerClientStub import TFChainExplorerGetClientStub
def test():
# create a tfchain client for testnet
c = tfchain.TFChainClient.TFChainClient(network_type="testnet")
# (we replace internal client logic with custom logic as to ensure we can test without requirin... | nilq/baby-python | python |
from collections import defaultdict
from datetime import datetime
from schemas import Task, TaskStatus
tasks_db = defaultdict(lambda: defaultdict(dict))
def current_datetime_str():
now = datetime.now()
day_mon_date = now.strftime("%a, %b, %d")
today = now.strftime('%Y%m%d')
hr = now.strftime("%-H")
... | nilq/baby-python | python |
from django import forms
from .models import User
class StudentRegistration(forms.ModelForm):
class Meta:
model=User
fields=['name','email','password']
widgets={
'name':forms.TextInput(attrs={'class':'form-control'}),
'email':forms.EmailInput(attrs={'class':'f... | nilq/baby-python | python |
# -*- coding:utf8 -*-
""" SCI - Simple C Interpreter """
from ..lexical_analysis.token_type import ID
from ..lexical_analysis.token_type import XOR_OP, AND_OP, ADD_OP, ADDL_OP, SUB_OP, MUL_OP
from ..lexical_analysis.token_type import NOT_OP, NEG_OP, DEC_OP, INC_OP
from ..lexical_analysis.token_type import LEA_OP
from ... | nilq/baby-python | python |
#=========================================================================
# helpers.py
#=========================================================================
# Author : Christopher Torng
# Date : June 2, 2019
#
import os
import yaml
#-------------------------------------------------------------------------
# U... | nilq/baby-python | python |
from engine import Engine
from engine import get_engine | nilq/baby-python | python |
#!/usr/bin/python
#----------------------------------------------------------------------
# Copyright (c) 2008 Board of Trustees, Princeton University
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and/or hardware specification (the "Work") to
# deal in the Work wit... | nilq/baby-python | python |
import threading
import time
import queue
EXIT_FLAG = 0
class exampleThread(threading.Thread):
def __init__(self, threadID, name, q):
threading.Thread.__init__(self)
self.threadID = threadID
self.name = name
self.q = q
def run(self):
print("Starting... | nilq/baby-python | python |
# -*- coding: utf-8 -*-
# Copyright (c) 2010-2016, MIT Probabilistic Computing Project
#
# 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 |
"""Class and container for pedigree information, vcf, and bam file by sample"""
from future import print_function
import pandas as pd
import re
import func
class Ped:
"""Family_ID - '.' or '0' for unknown
Individual_ID - '.' or '0' for unknown
Paternal_ID - '.' or '0' for unknown
Maternal_ID - '.' or ... | nilq/baby-python | python |
#!/usr/bin/env python3
#
# Copyright (c) 2016-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
... | nilq/baby-python | python |
"""Main code for training. Probably needs refactoring."""
import os
from glob import glob
import dgl
import pandas as pd
import pytorch_lightning as pl
import sastvd as svd
import sastvd.codebert as cb
import sastvd.helpers.dclass as svddc
import sastvd.helpers.doc2vec as svdd2v
import sastvd.helpers.glove as svdg
imp... | nilq/baby-python | python |
# Generated by Django 4.0 on 2021-12-17 12:12
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('src', '0012_alter_articlecategory_options_article_slug_and_more'),
('src', '0013_alter_product_description_alter_product_name'),
]
operations = [
... | nilq/baby-python | python |
from hallo.events import EventInvite
from hallo.function import Function
import hallo.modules.channel_control.channel_control
from hallo.server import Server
class Invite(Function):
"""
IRC only, invites users to a given channel.
"""
def __init__(self):
"""
Constructor
"""
... | nilq/baby-python | python |
from die import Die
import pygal
die_1 = Die()
die_2 = Die()
results = []
for roll_num in range(1000):
result = die_1.roll() + die_2.roll()
results.append(result)
#分析结果
frequencies = []
max_result = die_1.num_sides + die_2.num_sides
for value in range(2,max_result+1):
#results.count()查每个值出现的次数
frequen... | nilq/baby-python | python |
from .index import index
from .village import village
from .voice import voice
from .confirm_voice import confirm_voice
from .selectstyle import selectstyle
| nilq/baby-python | python |
try:
from .secrets import *
except ImportError:
import sys
sys.exit('secrets.py settings file not found. Please run `prepare.sh` to create one.')
from .server import *
#
# Put production server environment specific overrides below.
#
COWRY_RETURN_URL_BASE = 'https://onepercentclub.com'
COWRY_LIVE_PAYMENT... | nilq/baby-python | python |
from django.db import models
import addons.myminio.settings as settings
from addons.base import exceptions
from addons.base.models import (BaseOAuthNodeSettings, BaseOAuthUserSettings,
BaseStorageAddon)
from addons.myminio import SHORT_NAME, FULL_NAME
from addons.myminio.provider import... | nilq/baby-python | python |
# ---
# jupyter:
# jupytext:
# formats: ipynb,py:percent
# text_representation:
# extension: .py
# format_name: percent
# format_version: '1.3'
# jupytext_version: 1.11.1
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# ---
# %%
import yaml
imp... | nilq/baby-python | python |
import os, sys
sys.path.append(os.path.join(os.environ['GGP_PATH'], 'analogy','rule_mapper'))
sys.path.append(os.path.join(os.environ['GGP_PATH'], 'analogy','test_gen'))
import gdlyacc
from GDL import *
from PositionIndex import PositionIndex
import rule_mapper2
import psyco
# constants to ignore, along with numbers
... | nilq/baby-python | python |
# This file is subject to the terms and conditions defined in
# file 'LICENSE', which is part of this source code package.
import subprocess
import re
import numpy as np
def main():
m = 100
for methodIndex in range(18):
for n in (10, 32, 100, 316, 1000, 3162, 10000):
data = []
... | nilq/baby-python | python |
#!/usr/bin/env python3
# testPyComments.py
""" Test functioning of Python line counters. """
import unittest
from argparse import Namespace
from pysloc import count_lines_python, MapHolder
class TestPyComments(unittest.TestCase):
""" Test functioning of Python line counters. """
def setUp(self):
p... | nilq/baby-python | python |
import binascii
import time
from typing import List, Tuple, Union, cast
logging = True
loggingv = False
_hex = "0123456789abcdef"
def now():
return int(time.monotonic() * 1000)
def log(msg: str, *args: object):
if logging:
if len(args):
msg = msg.format(*args)
print(msg)
def l... | nilq/baby-python | python |
# -*- coding: utf-8 -*-
"""Pih2o utilities.
"""
import logging
LOGGER = logging.getLogger("pih2o")
| nilq/baby-python | python |
# Code generated by `typeddictgen`. DO NOT EDIT.
"""V1beta1PodDisruptionBudgetStatusDict generated type."""
import datetime
from typing import TypedDict, Dict
V1beta1PodDisruptionBudgetStatusDict = TypedDict(
"V1beta1PodDisruptionBudgetStatusDict",
{
"currentHealthy": int,
"desiredHealthy": int... | nilq/baby-python | python |
import sys
import os
from src.model.userManagement import getLeaderBoard
import configparser
from discord import Client, Message, Guild, Member
from pymysql import Connection
from src.utils.readConfig import getLanguageConfig
languageConfig = getLanguageConfig()
async def getLeaderBoardTop10(self: Client, message: M... | nilq/baby-python | python |
# Copyright 2019 Graphcore Ltd.
# coding=utf-8
"""
Derived from
https://www.tensorflow.org/probability/api_docs/python/tfp/mcmc/HamiltonianMonteCarlo
"""
import tensorflow as tf
from tensorflow.contrib.compiler import xla
import tensorflow_probability as tfp
import time
try:
from tensorflow.python import ipu
d... | nilq/baby-python | python |
#!/usr/bin/env python
import os
# Clear the console.
os.system("clear")
def msg(stat):
print '\033[1;42m'+'\033[1;37m'+stat+'\033[1;m'+'\033[1;m'
def newline():
print ""
def new_hosts(domain):
msg(" What would be the public directory name? \n - Press enter to keep default name (\"public_html\") ")
p... | nilq/baby-python | python |
from __future__ import print_function
import os
import unittest
import numpy as np
from sklearn.utils.testing import assert_array_almost_equal
from autosklearn.data.abstract_data_manager import AbstractDataManager
dataset_train = [[2.5, 3.3, 2, 5, 1, 1],
[1.0, 0.7, 1, 5, 1, 0],
[1.... | nilq/baby-python | python |
# -*- coding: utf-8 -*-
__author__ = 'Grzegorz Latuszek, Michal Ernst, Marcin Usielski'
__copyright__ = 'Copyright (C) 2018-2019, Nokia'
__email__ = 'grzegorz.latuszek@nokia.com, michal.ernst@nokia.com, marcin.usielski@nokia.com'
import pytest
def test_device_directly_created_must_be_given_io_connection(buffer_conn... | nilq/baby-python | python |
# Copyright 2022 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | nilq/baby-python | python |
import mpmath
from mpsci.distributions import benktander1
def test_pdf():
with mpmath.workdps(50):
x = mpmath.mpf('1.5')
p = benktander1.pdf(x, 2, 3)
# Expected value computed with Wolfram Alpha:
# PDF[BenktanderGibratDistribution[2, 3], 3/2]
valstr = '1.090598817302604... | nilq/baby-python | python |
from django import forms
from django.contrib.auth.forms import UserCreationForm
from .models import Comment, Webpage, Template, User
class CommentForm(forms.ModelForm):
class Meta:
model = Comment
fields = ['title', 'content']
class WebpageForm(forms.ModelForm):
class Meta:
model = ... | nilq/baby-python | python |
import unittest
import os
from examples.example_utils import delete_experiments_folder
from smallab.runner.runner import ExperimentRunner
from smallab.runner_implementations.fixed_resource.simple import SimpleFixedResourceAllocatorRunner
from smallab.specification_generator import SpecificationGenerator
from smallab.... | nilq/baby-python | python |
import os
import torch
import argparse
import numpy as np
import torch.nn.functional as F
from torch.autograd import Variable
import torch.backends.cudnn as cudnn
from model import * # NOTE : Import all the models here
from utils import progress_bar
# NOTE : All parser related stuff here
parser = argparse.ArgumentPa... | nilq/baby-python | python |
#
# Copyright (c) 2005-2006
# The President and Fellows of Harvard College.
#
# 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
# notice, this li... | nilq/baby-python | python |
num = int(input('Digite um número inteiro: '))
if (num % 2) == 0:
print('O número escolhido é PAR.')
else:
print('O número escolhido é ÍMPAR')
| nilq/baby-python | python |
#!/usr/bin/env python3
import subprocess
from deoplete.source.base import Base
class Source(Base):
def __init__(self, vim):
super().__init__(vim)
# deoplete related variables
self.rank = 1000
self.name = "cmake"
self.mark = "[cmake]"
self.input_pattern = r"[^\w\s]... | nilq/baby-python | python |
#!/usr/bin/env python
# -*- coding:utf8 -*-
from library.cloudflare import CloudFlare
from library.dnspod import Dnspod
from helpers.logger import log_error
support = ['dnspod', 'cloudflare']
allowed_types = ['A', 'CNAME', 'AAAA', 'NS']
class dns:
def help(self, req, resp):
h = '''
... | nilq/baby-python | python |
#!/usr/bin/env python2
# Copyright (c) 2016-2017, Daimler AG. All rights reserved.
import argparse
# Find the best implementation available
import logging
import os
from generic_tf_tools.tf_records import TFCreator
from generic_tf_tools.data2example import SwedenImagesv2
logging.basicConfig(level=logging.INFO)
logg... | nilq/baby-python | python |
"""
Properties of Dictionary Keys
Dictionary values have no restrictions. They can be any arbitrary Python object, either standard
objects or user-defined objects. However, same is not true for the keys.
There are two important points to remember about dictionary keys −
(a) More than one entry per key not allowe... | nilq/baby-python | python |
def readFile(file):
f = open(file)
data = f.read()
f.close()
return data
def readFileLines(file):
data = readFile(file)
return data.strip().split("\n")
def readFileNumberList(file):
lines = readFileLines(file)
return list(map(int, lines))
def differencesBetweenNumbers(numbers):
# ... | nilq/baby-python | python |
import re
from src.vcd import VCD
from src.module import Module
from src.interval_list import IntervalList
from src.wire import Wire
class VCDFactory():
"""
Factory class
"""
seperator = "$enddefinitions $end"
@staticmethod
def read_raw(filename):
with open(filename, 'r') as f:
... | nilq/baby-python | python |
import pytest
from sovtokenfees.constants import FEES
from plenum.common.exceptions import InvalidClientRequest
def test_set_fees_handler_static_validation(set_fees_handler, set_fees_request):
set_fees_handler.static_validation(set_fees_request)
def test_set_fees_handler_static_validation_no_fees(set_fees_hand... | nilq/baby-python | python |
from app import controller #yeah...kinda stupid
import json
class controller():
def __init__(s,gen_new,nam=None,SECRET_KEY=b'12'):
s.q={}
s.gen_new=gen_new
s.max_id=0
if nam is None:nam=__name__
s.app=Flask(nam)
s.app.config["SECRET_KEY"]=SECRET_KEY
s.addroute()
def addroute(s):
... | nilq/baby-python | python |
from flask import Flask,request
from PIL import Image
from tempfile import TemporaryFile
import json,base64
import captcha as capt
import model
app = Flask(__name__)
@app.route('/')
def hello():
return "hello,world"
@app.route('/captcha',methods=['GET','POST'])
def captcha():
if request.method == 'GET... | nilq/baby-python | python |
from operator import attrgetter
import pyangbind.lib.xpathhelper as xpathhelper
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType
from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType
from pyangbind.lib.base import PybindBase
from d... | nilq/baby-python | python |
# dir_utils.py is derived from [3DMPPE_POSENET_RELEASE](https://github.com/mks0601/3DMPPE_POSENET_RELEASE.git)
# distributed under MIT License (c) 2019 Gyeongsik Moon.
import os
import sys
def make_folder(folder_name):
if not os.path.exists(folder_name):
os.makedirs(folder_name)
def add_pypath(path):
... | nilq/baby-python | python |
import numpy as np
import theano as th
import theano.tensor as tt
import src.kinematics as kn
def test_unzero6dof():
# Make sure that our unzeroing actually doesn't change anything.
q = tt.dmatrix('q')
q_ = np.random.rand(50, 6)
th.config.compute_test_value = 'warn'
q.tag.test_value = q_
u =... | nilq/baby-python | python |
from conans import ConanFile
class OSSCoreTestsConan(ConanFile):
settings = "os", "compiler", "build_type", "arch"
generators = "cmake_find_package"
def requirements(self):
self.requires("catch2/2.13.3")
self.requires("nlohmann_json/3.9.1")
| nilq/baby-python | python |
# Import packages to extend Python (just like we extend Sublime, Atom, or VSCode)
from random import randint
# re-import our game variables
from gameComponents import gameVars, winLose
# [] => this is an array
# name = [value1, value2, value3]
# an array is a special type of container that can hold mutiple items.
# a... | nilq/baby-python | python |
class File(object):
def __init__(self,name, current_type):
self.name = name
self.block = 0
self.critical = 0
self.major = 0
# current modification type like 'modify' 'add' 'delete'
self.current_type = current_type
self.authors = list()
@staticmethod
... | nilq/baby-python | python |
# Software Name: its-client
# SPDX-FileCopyrightText: Copyright (c) 2016-2022 Orange
# SPDX-License-Identifier: MIT License
#
# This software is distributed under the MIT license, see LICENSE.txt file for more details.
#
# Author: Frédéric GARDES <frederic.gardes@orange.com> et al.
# Software description: This Intellig... | nilq/baby-python | python |
from pathlib import Path as _Path
from sys import platform as _platform
__all__ = [
"hmmfetch",
"hmmpress",
"hmmscan",
"hmmsearch",
"hmmemit",
"phmmer",
"binary_version",
]
binary_version = "3.3.2"
if _platform not in ["linux", "darwin"]:
raise RuntimeError(f"Unsupported platform: {_p... | nilq/baby-python | python |
import time
import matplotlib.pyplot as plt
import numpy as np
class Timer(object):
def __init__(self, name=None):
self.name = name
def __enter__(self):
self.tstart = time.time()
def __exit__(self, type, value, traceback):
if self.name:
print('[%s]' % self.name, end=... | nilq/baby-python | python |
from datetime import datetime
import logging
from telegram import (
InlineKeyboardButton
)
from iot.devices.base import BaseDevice, BaseBroadlinkDevice
from iot.rooms import d_factory, bl_d_factory
from iot.utils.keyboard.base import (
CLOSE_INLINE_KEYBOARD_COMMAND,
InlineKeyboardMixin,
KeyboardCallBa... | nilq/baby-python | python |
# -*- coding: utf-8 -*-
__author__ = """Larissa Triess"""
__email__ = "larissa@triess.eu"
from .compute import (
get_points_over_angles_and_label_statistics as get_angle_label_stats,
)
from .compute import (
get_points_over_distance_and_label_statistics as get_distance_label_stats,
)
__all__ = [
"get_dis... | nilq/baby-python | python |
#Given an array of integers nums.
#A pair (i,j) is called good if nums[i] == nums[j] and i < j.
#Return the number of good pairs.
class Solution:
def numIdenticalPairs(self, nums: List[int]) -> int:
hash = {}
count = 0
for i in range(0,len(nums)):
for j in range(1,l... | nilq/baby-python | python |
from django.http import HttpResponse
from django.utils import simplejson
from django.template.defaultfilters import slugify
from django.utils.encoding import force_unicode
from django.core.exceptions import ValidationError
import models
from scipy_central.submission.models import TagCreation
import datetime
from coll... | nilq/baby-python | python |
from qupulse.hardware.setup import HardwareSetup, PlaybackChannel, MarkerChannel
from qupulse.pulses import PointPT, RepetitionPT, TablePT
#%%
""" Connect and setup to your AWG. Change awg_address to the address of your awg and awg_name to the name of
your AWGs manufacturer (Zürich Instruments: ZI, TaborElectronics:... | nilq/baby-python | python |
from unittest import TestCase
from mandrill import InvalidKeyError
from mock import patch
from welcome_mailer import settings
from welcome_mailer.backends import email
from welcome_mailer.testing_utils import create_user, fake_user_ping
class TestBaseBackend(TestCase):
""" Test cases for the base email backend... | nilq/baby-python | python |
from __future__ import print_function
from __future__ import division
import os
import sys
sys.path.append(os.getcwd())
import argparse
import json
import random
import warnings
import time
from collections import defaultdict, OrderedDict
from types import SimpleNamespace
import glog as log
import os.path as osp
from... | nilq/baby-python | python |
#!/usr/bin/env python3
# Copyright (c) 2015, Göran Gustafsson. 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 notice,
# thi... | nilq/baby-python | python |
from DeepJetCore.DataCollection import DataCollection
from pprint import pprint
dc = DataCollection()
dc.readFromFile('dc/dataCollection.dc')#/storage/9/dseith/DeepJet/deepCSV/results/../../Ntuples/Thu_135917_batch/dataCollections/deepCSV/train/dataCollection.dc')
#dc.readFromFile('/storage/9/dseith/DeepJet/deepCSV/re... | nilq/baby-python | python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.