content stringlengths 0 1.05M | origin stringclasses 2
values | type stringclasses 2
values |
|---|---|---|
"""
Django settings for app project.
Generated by 'django-admin startproject' using Django 2.2.2.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
# pylint: disable... | nilq/baby-python | python |
"""
Tyk API Management.
"""
from diagrams import Node
class _Tyk(Node):
_provider = "tyk"
_icon_dir = "resources/tyk"
fontcolor = "#2d3436"
| nilq/baby-python | python |
# -*- encoding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
from collections import OrderedDict
from h2o.utils.compatibility import * # NOQA
from .model_base import ModelBase
from .metrics_base import * # NOQA
import h2o
from h2o.expr import ExprNode
class H2OWordEm... | nilq/baby-python | python |
from pymongo import MongoClient
def mongo_client():
return MongoClient("database", 27017)
| nilq/baby-python | python |
from msgpack import Packer
COMMAND_SET_VERSION = 3
class CommandType:
JumpToMain = 1
CRCRegion = 2
Erase = 3
Write = 4
Ping = 5
Read = 6
UpdateConfig = 7
SaveConfig = 8
ReadConfig = 9
GetStatus = 10
def encode_command(command_code, *arguments):
"""
Encodes a command of... | nilq/baby-python | python |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import numpy as np
import pandas as pd
import matplotlib.pylab as plt
from utility.webdl import WebDLUtility
from service.webdl import WebDLService
from postprocessing.tools import plot_utility_model, utility_grid, save_model
from postprocessing.cfg import *
#%%
df = pd... | nilq/baby-python | python |
XSym
0033
19e4fe6b5fba275cfa63817605c40e9f
/anaconda2/lib/python2.7/types.py
... | nilq/baby-python | python |
import unittest
import shutil
import SimpleITK as sitk
import numpy as np
from typing import Union, Sequence
from mnts.scripts.dicom2nii import *
from mnts.scripts.normalization import *
from mnts.filters import MNTSFilterGraph
from mnts.filters.intensity import *
from mnts.filters.geom import *
from pathlib import Pa... | nilq/baby-python | python |
# -*- coding: utf-8 -*-
from click.testing import CliRunner
from simmate.command_line.workflows import workflows
def test_database():
# make the dummy terminal
runner = CliRunner()
# list the workflows
result = runner.invoke(workflows, ["list-all"])
assert result.exit_code == 0
# list the c... | nilq/baby-python | python |
# Copyright 2017 The BerryDB Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
BASE_FLAGS = [
'-Wall',
'-Wextra',
'-Werror',
'-DUSE_CLANG_COMPLETER', # YCM needs this.
'-xc++', # YCM needs this to avoid c... | nilq/baby-python | python |
# -*- coding: utf-8 -*-
from twisted.internet.defer import Deferred
from twisted.internet.protocol import ClientFactory, ServerFactory
from twisted.internet import reactor
from twisted.protocols.basic import LineReceiver
from Screens.MessageBox import MessageBox
from Tools import Notifications
from GrowleeConnection ... | nilq/baby-python | python |
import unicodedata
from django import forms
from django.contrib.auth import authenticate, get_user_model, password_validation
from django.contrib.auth.hashers import UNUSABLE_PASSWORD_PREFIX, identify_hasher
from django.contrib.auth.tokens import default_token_generator
from django.contrib.sites.shortcuts import get_c... | nilq/baby-python | python |
from typing import Union
from requests import session, Session
import json
import os
from models import ChallengeResult, ChallengeError
BASE_URL = os.getenv('API_URL', 'https://soallpeach-api-soroosh.fandogh.cloud')
session = Session()
def get_session() -> Session:
session.headers.update({
'Authoriza... | nilq/baby-python | python |
#!/data2/zhangshuai/anaconda3/bin
# -*- coding: utf-8 -*-
import os
import wave
from pydub import AudioSegment
import json
wav_path = "/home/zhangshuai/kaldi-master/egs/biendata/Magicdata/audio/test"
trans_path = "/home/zhangshuai/kaldi-master/egs/biendata/Magicdata/transcription/test_no_ref_noise"
wav_segments_path ... | nilq/baby-python | python |
# encoding: utf-8
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License")... | nilq/baby-python | python |
import os
## FIXME most of the path variables should come from env vars
PWD = os.getcwd()
OUTPUT_PATH= os.path.join(PWD, "CodeComb_Outputs")
#FORMATS = ['.cpp']
DATA_PATH = os.path.join(PWD, "CodeComb_Data")
DF_FILE = "df_corpus"
DOC_EMB_PATH = os.path.join(OUTPUT_PATH, "doc_emb_" + DF_FILE)
ANN_INDEX_PATH = os.pat... | nilq/baby-python | python |
import scrapy
import re
from .mirkcolorselector import sampler_function
class DecjubaSpider(scrapy.Spider):
name = "decjuba_products"
start_urls = [
'https://www.decjuba.com.au/collections/women/dresses',
'https://www.decjuba.com.au/collections/women/jackets',
'https://www.decjuba.com.a... | nilq/baby-python | python |
from cloudshell.devices.runners.autoload_runner import AutoloadRunner
from vyos.flows.autoload import VyOSAutoloadFlow
class VyOSAutoloadRunner(AutoloadRunner):
def __init__(self, resource_config, cli_handler, logger):
"""
:param resource_config:
:param cli_handler:
:param logger... | nilq/baby-python | python |
"""
Dada uma String "str", retorne true se nela possuir o mesmo número de ocorrências
das strings "cat" e "dog".
Ex.:(('catdog') → True; ('1cat1cadodog') → True; ('catcat') → False).
"""
def cat_dog(str):
return str.count("cat") == str.count("dog")
print(cat_dog("catdog"))
| nilq/baby-python | python |
"""
This file implements a general purpose best-first planner.
--------------HOW TO INITIALIZE IT -------------
An instance of the planner is created using
planner = Planner(s)
where s is the initial state in the planning process.
The planner needs five functions/methods to work properly.
These functions can either... | nilq/baby-python | python |
import cv2
import apriltag
# Функция для вывода изображения на экран
def viewImage(image, window_name='window name'):
cv2.imshow(window_name, image)
cv2.waitKey(0)
cv2.destroyAllWindows()
# Считываем изображение и преобразуем его в grayscale
tag = cv2.imread('/home/administrator/PycharmProjects/trial/si... | nilq/baby-python | python |
# Copyright (c) 2020, Manfred Moitzi
# License: MIT License
import pytest
from ezdxf.math import BSpline, global_bspline_interpolation, rational_bspline_from_arc, Vec3
def test_from_nurbs_python_curve_to_ezdxf_bspline():
from geomdl.fitting import interpolate_curve
curve = interpolate_curve([(0, 0), (0, 10), ... | nilq/baby-python | python |
import itertools
import numpy
from matplotlib import pyplot
from typing import Dict, Sequence, Tuple
from warg import Number
__all__ = [
"plot_errors",
"masks_to_color_img",
"plot_prediction",
"bounding_box_from_mask",
]
def plot_errors(results_dict: Dict, title: str) -> None:
"""
Args:
... | nilq/baby-python | python |
# -*- coding: utf-8 -*-
import numpy
import os
from os.path import join
import shutil
import time
import sys
import math
import json
import utilities
import matplotlib.pyplot as plt
def get_num_antennas(ms):
"""."""
tb.open(ms + '/ANTENNA', nomodify=True)
num_stations = tb.nrows()
tb.close()
retu... | nilq/baby-python | python |
# coding=utf-8
import datetime
import json
import time
import redis
import scrapy
from pymongo import MongoClient
from scrapy.http import Request
from scrapy_redis.spiders import RedisSpider
from biliob_spider.items import TagListItem
from biliob_tracer.task import SpiderTask
from db import db
class TagAdderSpider... | nilq/baby-python | python |
"""
Bot's behaviour
"""
INTENTS = [
{
'name': 'Date',
'tokens': ('when', 'time', 'date', 'at', '1'), # You can add any key words in the list
'scenario': None,
'answer': 'The conference is being held on May 10, registration will start at 11 am.'
},
{
'name': 'Place',... | nilq/baby-python | python |
from rest_framework.exceptions import APIException
class CFSSLError(APIException):
status_code = 503
default_detail = 'Could not create Docker certificate.'
default_code = 'docker_certificate_service_unavailable'
| nilq/baby-python | python |
"""Source code for categorical dqn brain class.
Author: Yoshinari Motokawa <yoshinari.moto@fuji.waseda.jp>
"""
from typing import List
import torch
from omegaconf import DictConfig
from torch import nn
from .abstract_brain import AbstractBrain
from core.agents.models.customs.categorical_dqn import ApplySoftmax
cl... | nilq/baby-python | python |
# -*- coding: utf-8 -*-
"""Model definitions."""
from django.db import models
from picklefield.fields import PickledObjectField
class Model(models.Model):
"""GLM model."""
blob = PickledObjectField()
def __str__(self):
return f'Hello, I am the GLM model #{self.id}'
| nilq/baby-python | python |
import anki_vector
from anki_vector.util import Pose, degrees
def main():
args = anki_vector.util.parse_command_args()
with anki_vector.Robot(args.serial, show_3d_viewer=True, enable_nav_map_feed=True) as robot:
robot.behavior.drive_off_charger()
fixed_object = robot.world.create_custom_fixed_object(P... | nilq/baby-python | python |
# proxy module
from __future__ import absolute_import
from mayavi.action.filters import *
| nilq/baby-python | python |
class Solution:
def XXX(self, head: ListNode, n: int) -> ListNode:
slow=head
fast=head
for i in range(n):
fast=fast.next
if fast==None:
return slow.next
else:
fast=fast.next
while fast:
fast=fast.next
slow=s... | nilq/baby-python | python |
# -*- coding: utf-8 -*-
import click
import pytest
from click.testing import CliRunner
from gitlabctl.cli import project_get_env
from gitlabctl.cli import run_pipeline
__author__ = "Thomas Bianchi"
__copyright__ = "Thomas Bianchi"
__license__ = "mit"
def main_get_env(func_name, id):
return [id]
def main_run... | nilq/baby-python | python |
from enum import Enum
class Status(Enum):
Dziecko=1,
Nastolatek=2,
Dorosly=3
def printFileName():
print("Status") | nilq/baby-python | python |
import logging
from typing import Optional, Sequence
from hybrid.sites import SiteInfo
import PySAM.Singleowner as Singleowner
from hybrid.log import hybrid_logger as logger
class PowerSource:
def __init__(self, name, site: SiteInfo, system_model, financial_model):
"""
Abstract class for a renewa... | nilq/baby-python | python |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Jul 24 13:41:37 2018
@author: craggles
"""
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import axes3d
import scipy.special
import sklearn
from matplotlib import cm
from matplotlib import rc
import matplotlib
matplotli... | nilq/baby-python | python |
import os
from getpass import getpass
from netmiko import ConnectHandler
password = os.getenv("PYNET_PASSWORD") if os.getenv("PYNET_PASSWORD") else getpass()
net_connect = ConnectHandler(
host="cisco3.lasthop.io",
username="pyclass",
password=password,
device_type="cisco_ios",
session_log="my_sessi... | nilq/baby-python | python |
from pathlib import Path
from yacs.config import CfgNode as CN
import os
import time
import logging
import torch.distributed as dist
_C = CN()
_C.dataset = 'imagenet'
_C.data_dir = './data_list/'
_C.check_path = './checkpoint'
_C.arch = 'resnet50'
_C.workers = 32
_C.epochs = 400
_C.defer_epoch = 0
_C.start_epoch = 1... | nilq/baby-python | python |
#!/usr/local/sbin/charm-env python3
# 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 writ... | nilq/baby-python | python |
import sys
import re as _re
from fclpy.lisptype import LispSymbol
class LispStream():
def __init__(self, fh):
self.fh = fh
self.tokens = []
self.buff = []
def unread_char(self, y):
self.buff.append(y)
def push_token(self, token):
self.tokens.append(to... | nilq/baby-python | python |
"""
We have discussed Knight’s tour and Rat in a Maze problems in Set 1 and Set 2 respectively. Let us discuss N Queen as another example problem that can be solved using Backtracking.
The N Queen is the problem of placing N chess queens on an N×N chessboard so
that no two queens attack each other. For example, follow... | nilq/baby-python | python |
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("-t", "--text",help="text for the google_speech",
action="store")
args = parser.parse_args()
print ()
from google_speech import Speech
# say "Hello World"
text = args.text
lang = "en"
speech = Speech(text, lang)
#speech.pla... | nilq/baby-python | python |
import os
import webapp2
import jinja2
import json
import cgi
import re
import hmac
import hashlib
import random
from string import letters
from google.appengine.ext import db
template_dir = os.path.join(os.path.dirname(__file__), 'templates')
jinja_env = jinja2.Environment(loader = jinja2.FileSystemLoader(template... | nilq/baby-python | python |
import logging
import os
import shutil
import sys
import time
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
class AverageMeter(object):
def __init__(self):
self.reset()
def reset(self):
self.avg = 0
self.sum = 0
self.cnt = 0
def up... | nilq/baby-python | python |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Author: Wenbin Li (liwenbin.nju@gmail.com)
Date: April 9, 2019
Version: V0
Citation:
@inproceedings{li2019DN4,
title={Revisiting Local Descriptor based Image-to-Class Measure for Few-shot Learning},
author={Li, Wenbin and Wang, Lei and Xu, Jinglin and Huo, Jing ... | nilq/baby-python | python |
# Copyright 2016 Anselm Binninger, Thomas Maier, Ralph Schaumann
#
# 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 appl... | nilq/baby-python | python |
import unittest
import pyarrow
import pymarrow
import pandas as pd
class TestPyMarrow(unittest.TestCase):
def test_add_index(self):
batch = pyarrow.RecordBatch.from_arrays([
[5, 4, 3, 2, 1],
[1, 2, 3, 4, 5]
], ["a", "b"])
actual = pymarrow.add_index(batch, ["a"])
... | nilq/baby-python | python |
from django.shortcuts import render
from django.http import HttpResponse, HttpResponseRedirect
from .forms import PDBForm
from .runVis import LoadModel, DOPE, HDXRepr, RepLabels, CustomRes
import urllib
d_obj = {
"1":RepLabels,
"2":HDXRepr,
"3":DOPE,
"4":CustomRes
}
d_desc = {
"1":"Selected residu... | nilq/baby-python | python |
#!/usr/bin/env python
from webkitpy.benchmark_runner.generic_factory import GenericFactory
class HTTPServerDriverFactory(GenericFactory):
products = {}
| nilq/baby-python | python |
# Copyright (c) 2019-2021, Manfred Moitzi
# License: MIT License
from typing import TYPE_CHECKING, Iterable, Tuple, Optional, List, Iterator
import abc
import warnings
from ezdxf.math import Vec3, Vec2
if TYPE_CHECKING:
from ezdxf.math import Vertex, AnyVec
__all__ = ["BoundingBox2d", "BoundingBox", "AbstractBou... | nilq/baby-python | python |
#
# Author: Robert Abram <rabram991@gmail.com>
#
# This file is subject to the terms and conditions defined in the
# file 'LICENSE', which is part of this source code package.
#
#
# Signal handlers for model change events, see: proj.settings.appconfig.
# These are a great way to log user activity.
#
from datetime imp... | nilq/baby-python | python |
from common import *
import collections
import numpy as np
def test_astype(ds_local):
ds = ds_local
ds_original = ds.copy()
#ds.columns['x'] = (ds.columns['x']*1).copy() # convert non non-big endian for now
ds['x'] = ds['x'].astype('f4')
assert ds.x.evaluate().dtype == np.float32
assert ds.x.... | nilq/baby-python | python |
""" File: P3_semi_supervised_topic_modeling.py
Description: Loads a previously created pre-processed chat corpus, then performs
semi-supervised topic modeling utilizing CorEx and GuidedLDA.
INPUT FILES:
0) anchors.txt - anchor/seed words each on their own line
Previously created preproces... | nilq/baby-python | python |
# ==============================================================================
# Imports
# ==============================================================================
import numpy as np
import os, glob
from tqdm import tqdm as tqdm
import tensorflow.compat.v1 as tf
tfq = tf.quantization
import tensorflow_probab... | nilq/baby-python | python |
from .features import Dictionary, RegexMatches, Stemmed, Stopwords
name = "portuguese"
try:
import enchant
dictionary = enchant.Dict("pt")
except enchant.errors.DictNotFoundError:
raise ImportError("No enchant-compatible dictionary found for 'pt'. " +
"Consider installing 'myspell-p... | nilq/baby-python | python |
# --------------------------------------------------------------------
# Directory syncer by Alexander Sirotin (c) 2016
# Originally created for syncing between home NAS backup and Amazon cloud
# Both are mounted on the host machine (Amazon cloud is mounted using acd_cli)
# This program comes without any warranty, use ... | nilq/baby-python | python |
#!/usr/bin/env python3
# -*- encoding: utf-8 -*-
'''
@author: yuejl
@application:
@contact: lewyuejian@163.com
@file: wechatApiConf.py
@time: 2021/7/1 0001 11:32
@desc:
'''
class WechatApiConfig:
def __init__(self):
self.url = None
self.init = None | nilq/baby-python | python |
#
# Copyright (c) 2018 nexB Inc. and others. All rights reserved.
# http://nexb.com and https://github.com/nexB/scancode-toolkit/
# The ScanCode software is licensed under the Apache License version 2.0.
# Data generated with ScanCode require an acknowledgment.
# ScanCode is a trademark of nexB Inc.
#
# You may not use... | nilq/baby-python | python |
"""
Copyright (C) 2018-2021 Intel Corporation
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 i... | nilq/baby-python | python |
import os.path as osp
import pickle
from collections import Counter
import torch
from torch.utils.data import DataLoader
import spacy
from tqdm import tqdm
import lineflow as lf
import lineflow.datasets as lfds
PAD_TOKEN = '<pad>'
UNK_TOKEN = '<unk>'
START_TOKEN = '<s>'
END_TOKEN = '</s>'
IGNORE_INDEX = -100
NL... | nilq/baby-python | python |
import unittest
from helpers.queuehelper import QueueName
#from backend.fcmapp import InfrastructureService
from backend.fcmbus import Bus
class TestBus(unittest.TestCase):
#@classmethod
#def make_bus(self):
# return Bus(InfrastructureService('', '', '', '', '', ''))
def test_bus_get_name_q(self):
... | nilq/baby-python | python |
import importlib
import sys
# the following are python opcodes taken from the `opcode` module
# these have been constantized for easier access
# these are the opcodes used by python
# not to be confused with opcodes from neo.VM.OpCode,
# which are the opcodes for the neo vm
POP_TOP = 1
ROT_TWO = 2
ROT_THREE = 3
DUP_... | nilq/baby-python | python |
from django.contrib import admin
from testModel.models import Test,Contact,Tag
class TagInline(admin.TabularInline):
model =Tag
# Register your models here.
class ContactAdmin(admin.ModelAdmin):
list_display = ('name','age', 'email')
search_fields = ('name',)
inlines =[TagInline]
# fie... | nilq/baby-python | python |
# Definition for a binary tree node.
# class TreeNode:
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution:
def buildTree(self, inorder: 'List[int]', postorder: 'List[int]') -> 'TreeNode':
if not inorder or not postorder:
ret... | nilq/baby-python | python |
import argparse
import os.path
import numpy as np
import torch
import torchvision
import torchvision.transforms as T
from sklearn.model_selection import train_test_split
from MIA.Attack.Augmentation import Augmentation
from model import CIFAR
parser = argparse.ArgumentParser()
parser.add_argument("--save_to", defaul... | nilq/baby-python | python |
"""TrackML scoring metric"""
__authors__ = ['Sabrina Amrouche', 'David Rousseau', 'Moritz Kiehn',
'Ilija Vukotic']
import numpy
import pandas
def _analyze_tracks(truth, submission):
"""Compute the majority particle, hit counts, and weight for each track.
Parameters
----------
truth : ... | nilq/baby-python | python |
from crc.api.common import ApiError
from crc.scripts.script import Script
from crc.services.study_service import StudyService
class UpdateStudyAssociates(Script):
argument_error_message = "You must supply at least one argument to the " \
"update_study_associates task, an array of obje... | nilq/baby-python | python |
from django.shortcuts import render, redirect
from .models import *
from django.http import Http404
from django.contrib.auth.models import User
from rest_framework import viewsets
from .sheet2 import interest_responses, firstapplication_response
# from .sheet3 import assesment_responses, score_response
# from django.co... | nilq/baby-python | python |
"""The qnap component."""
| nilq/baby-python | python |
import os
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']
).get_hosts('all')
def test_nginx_service(host):
assert host.service("nginx-podman").is_running
assert host.service("nginx-podman").is_enabled
def test_... | nilq/baby-python | python |
import unittest
from typing import List, Optional
from swift_cloud_py.common.errors import SafetyViolation
from swift_cloud_py.entities.intersection.intersection import Intersection
from swift_cloud_py.entities.intersection.traffic_light import TrafficLight
from swift_cloud_py.entities.intersection.signalgroup import ... | nilq/baby-python | python |
import cv2
from PIL import Image
import argparse
import os
import glob
import time
from pathlib import Path
import torch
from config import get_config
from mtcnn import MTCNN
import mxnet as mx
import numpy as np
from Learner import face_learner
from utils import load_facebank, draw_box_name, prepare_facebank
from face... | nilq/baby-python | python |
class PixelNotChangingError(Exception):
pass
| nilq/baby-python | python |
__author__ = 'kim'
try:
import pyfftw
print('-------------------')
print('| pyFFTW detected |')
print('-------------------')
except:
print('-------------------------------')
print('* WARNING: No pyFFTW detected *')
print('-------------------------------')
from upsilon.utils import utils
f... | nilq/baby-python | python |
import mysql.connector
from mysql.connector import errorcode
from flask import flash
try:
# Establish a connection with the MySQL database
# Password here is hardcoded for simplicity.
# For all practical purposes, use environment variables or config files.
cnx = mysql.connector.connect(user='test_user'... | nilq/baby-python | python |
"""
Django template tags for configurations.
"""
| nilq/baby-python | python |
from services import user_service
from viewmodels.shared.viewmodelbase import ViewModelBase
class IndexViewModel(ViewModelBase):
def __init__(self):
super().__init__()
self.user = user_service.get_user_by_id(self.user_id)
def validate(self):
if not self.user_id:
self.error... | nilq/baby-python | python |
# coding: utf-8
# In[1]:
from flask import Flask,render_template,session,url_for,request,redirect
from flask_pymongo import PyMongo
from flask_bcrypt import Bcrypt
from flask import jsonify,json
import os
import gspread
from oauth2client.service_account import ServiceAccountCredentials
import pprint
import datetime... | nilq/baby-python | python |
# Copyright (c) The Diem Core Contributors
# SPDX-License-Identifier: Apache-2.0
from typing import List, Callable, Optional
import requests
from .models import (
User,
Address,
Transaction,
Transactions,
RequestForQuote,
Quote,
CreateTransaction,
AccountInfo,
OffChainSequenceIn... | nilq/baby-python | python |
# -*- coding: utf-8 -*-
"""
Created on Wed Oct 30 14:05:38 2019
@author: ico
"""
import numpy as np
class MyNeuron:
def training(self,X,Y):
self.W=np.random.random((X.shape[1]+1,1))
X=np.append(np.ones((X.shape[0],1)),X,axis=1)
for j in range(1,21):
i=0
... | nilq/baby-python | python |
#!/usr/bin/env python3
import argparse
import random
import sys
from mpmath import mp
from common import print_integral_single_input
from common.randomgen import generate_basis_function
parser = argparse.ArgumentParser()
parser.add_argument("--filename", type=str, required=True, help="Output file name")
parser.add... | nilq/baby-python | python |
# coding: utf-8
r"""Distance conversions"""
from corelib.units.base import create_code
distances = {"mm": 1e-3, "millimeter": 1e-3, "millimeters": 1e-3, "millimetre": 1e-3, "millimetres": 1e-3,
"cm": 1e-2, "centimeter": 1e-2, "centimeters": 1e-2, "centimetre": 1e-2, "centimetres": 1e-2,
"m"... | nilq/baby-python | python |
kOk = 0
kNoSuchSession = 6
kNoSuchElement = 7
kNoSuchFrame = 8
kUnknownCommand = 9
kStaleElementReference = 10
kElementNotVisible = 11
kInvalidElementState = 12
kUnknownError = 13
kJavaScriptError = 17
kXPathLookupError = 19
kTimeout = 21
kNoSuchWindow = 23
kInvalidCookieDomain = 24
kUnexpectedAlertOpen = 26
kNoAlertOp... | nilq/baby-python | python |
# Copyright 2018 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 |
# terrascript/arukas/d.py
| nilq/baby-python | python |
# Simple NTP daemon for MicroPython using asyncio.
# Copyright (c) 2020 by Thorsten von Eicken
# Based on https://github.com/wieck/micropython-ntpclient by Jan Wieck
# See LICENSE file
try:
import uasyncio as asyncio
from sys import print_exception
except ImportError:
import asyncio
import sys, socket, str... | nilq/baby-python | python |
import re
import random
TOOBIG = -1
TOOSMALL = -2
NOTNEW = -3
EMPTY = -1
class NameJoiner:
def __init__(self, str1, str2):
words = [str1, str2]
random.shuffle(words)
self.fullStartName = words[0]
self.fullEndName = words[1]
self.initVariables()
def in... | nilq/baby-python | python |
import sys
from PySide2.QtWidgets import QApplication, QWidget, QPushButton, QLineEdit, QTextBrowser, QMainWindow, QTextEdit
from PySide2.QtCore import QFile, Slot
from ui_mainwindow import Ui_MainWindow
class MainWindow(QMainWindow):
def __init__(self, filename : str):
super(MainWindow, self).__init__()
... | nilq/baby-python | python |
#! usr/bin/activate
"""AstroThings library: imagination and Universe."""
def main():
pass
if __name__ == '__main__':
main()
__version__ = '0.1.0.dev1'
| nilq/baby-python | python |
from unittest import TestCase
from tilapia.lib.provider.chains.btc.sdk import transaction
class TestTransaction(TestCase):
def test_calculate_vsize(self):
self.assertEqual(79, transaction.calculate_vsize(["P2WPKH"], []))
self.assertEqual(176, transaction.calculate_vsize(["P2WPKH"], ["P2WPKH", "P2... | nilq/baby-python | python |
from applauncher.event import EventManager, KernelReadyEvent, ConfigurationReadyEvent
class TestClass:
def test_events(self):
em = EventManager()
class KernelCounter:
c = 0
@staticmethod
def inc(event):
KernelCounter.c += 1
@static... | nilq/baby-python | python |
from flask_wtf import FlaskForm
from wtforms import BooleanField, SelectField, IntegerField
from wtforms.validators import Required, Optional
from .vcconnect import get_main_area_dropdown, get_service_dropdown, get_client_group_dropdown
class OrgSearchForm(FlaskForm):
main_area_id = SelectField('Area',
... | nilq/baby-python | python |
from airflow.hooks.base_hook import BaseHook
def get_conn(conn_id):
# get connection by name from BaseHook
conn = BaseHook.get_connection(conn_id)
return conn
| nilq/baby-python | python |
import sys
import torch.nn as nn
from net6c import ClusterNet6c, ClusterNet6cTrunk
from vgg import VGGNet
__all__ = ["ClusterNet6cTwoHead"]
class ClusterNet6cTwoHeadHead(nn.Module):
def __init__(self, config, output_k, semisup=False):
super(ClusterNet6cTwoHeadHead, self).__init__()
self.batchn... | nilq/baby-python | python |
import webbrowser
import click
from ghutil.types import Repository
@click.command()
@Repository.argument('repo')
def cli(repo):
""" Open a repository in a web browser """
webbrowser.open_new(repo.data["html_url"])
| nilq/baby-python | python |
from __future__ import print_function
import os
import json
from typtop.dbaccess import (
UserTypoDB, get_time, on_wrong_password,
on_correct_password, logT, auxT,
FREQ_COUNTS, INDEX_J, WAITLIST_SIZE,
WAIT_LIST, pkdecrypt,
NUMBER_OF_ENTRIES_TO_ALLOW_TYPO_LOGIN,
logT, auxT, call_check
)
import ty... | nilq/baby-python | python |
#!/usr/bin/env python
import argparse
import os
import sys
from functools import partial
from glob import iglob as glob
from itertools import chain
from dautil.IO import makedirs
from dautil.util import map_parallel
PY2 = sys.version_info[0] == 2
if PY2:
import cPickle as pickle
else:
import pickle
__versi... | nilq/baby-python | python |
# -*- coding: utf-8 -*-
from scrapy import signals
from scrapy.exporters import CsvItemExporter
class CompanyListStorePipeline:
exporter = None
@classmethod
def from_crawler(cls, crawler):
pipeline = cls()
crawler.signals.connect(pipeline.spider_opened, signals.spider_opened)
... | nilq/baby-python | python |
"""
:mod:`cookie`
-------------
This is a cookie authentication implementation for Pando.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import datetime
from .. import auth
from ..utils import to_rfc822, utcnow
... | nilq/baby-python | python |
from query_generator.query import Query
from utils.contracts import Operator, Schema
class UnionOperator(Operator):
def __init__(self, schema: Schema, leftSubQuery: Query, rightSubQuery: Query):
super().__init__(schema)
self._leftSubQuery = leftSubQuery
self._rightSubQuery = rightSubQuery
... | nilq/baby-python | python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.