content
stringlengths
0
1.05M
origin
stringclasses
2 values
type
stringclasses
2 values
from cloudshell.devices.runners.configuration_runner import ConfigurationRunner from vyos.flows.restore import VyOSRestoreFlow from vyos.flows.save import VyOSSaveFlow class VyOSConfigurationRunner(ConfigurationRunner): @property def restore_flow(self): return VyOSRestoreFlow(cli_handler=self.cli_han...
nilq/baby-python
python
from numpy.random import random from bokeh.plotting import * output_server("markers.py example") def myscatter(x, y, typestr): scatter(x, y, type=typestr, line_color="#6666ee", fill_color="#ee6666", fill_alpha=0.5, size=12, tools="pan,zoom") def mytext(x, y, textstr): text(x, y, text=textstr, angle...
nilq/baby-python
python
""" 개발환경 : PyQt5 x64, Python 3.4.3 x64, Windows 8.1 x64 파일 : CryptoCommon.py 내용 : 암호에서 자주 쓰이는 변수들을 지원할 예정 """ import os class CryptoCommon: common_long_keyspace = ' !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~' def __init__(self): self.message = '' ...
nilq/baby-python
python
# -*- coding: utf-8 -*- # --------------------------------------------------------------------- # Checkpoint manager # --------------------------------------------------------------------- # Copyright (C) 2007-2019 The NOC Project # See LICENSE for details # -------------------------------------------------------------...
nilq/baby-python
python
# -*- coding: utf-8 -*- from sys import maxsize from model.group import Group def test_add_group(app): old_groups = app.group.get_group_list() added_group = Group(name="Grop1", header="Heder1", footer="Footer1") app.group.create(added_group) assert len(old_groups)+1 == app.group.count() #"""хеш функ...
nilq/baby-python
python
import pytest from django.conf import settings from django.contrib.messages import get_messages from django.core.exceptions import ObjectDoesNotExist from django.urls import reverse from tests.api_tokens_tests.factories import AuthTokenFactory from tests.factories import UserFactory from tests.utils import get_view_fo...
nilq/baby-python
python
from gfl.core.manager.node import GflNode from gfl.core.manager.manager import NodeManager
nilq/baby-python
python
import numpy as np targets = np.loadtxt('qm9_targets.dat',dtype=str)[:,1] factors = [1., 1., 27.2114, 27.2114, 27.2114, 1., 27211.4, 1., 1., 1., 1., 1., 0.043363, 0.043363, 0.043363, 0.043363, 1., 1., 1., 0.043363] assert len(factors) == len(targets) seeds = ['11','22','33'] mae_avg = [] mae_std = [] for target i...
nilq/baby-python
python
import json import argparse import os import io import shutil import copy import sys from datetime import datetime from pick import pick from time import sleep from urllib.parse import urlparse import requests #################### Patched - Slacker ###################### # Purpose of the patch is to allow for a cookie...
nilq/baby-python
python
from .CSGOMarketAPI import * from .Exceptions import * from .Item import * from .types import * __all__ = ['Item', 'CSGOMarketAPI', 'Exceptions', 'types']
nilq/baby-python
python
#----------------------------------------------------- # Mimas: conference submission and review system # (c) Allan Kelly 2016-2020 http://www.allankelly.net # Licensed under MIT License, see LICENSE file # ----------------------------------------------------- import unittest import datetime from google.appengine.ext...
nilq/baby-python
python
import pandas as pd import yfinance as yf from src.config import Config def main(cfg: Config): metadata = pd.read_csv(cfg.METADATA_FILEPATH, comment="#") ticker_symbols = " ".join(metadata[cfg.TICKER_SYMBOL_COLUMN]) data = yf.download(tickers=ticker_symbols, period=cfg.PERIOD, interval=cfg.INTERVAL, group...
nilq/baby-python
python
import sys n, *a = map(int, sys.stdin.read().split()) def main(): res = 0 for i in range(1, n-1): cur = a[i] l = 0 for j in range(i): if a[j] < cur: l += 1 r = 0 for j in range(i+1, n): if a[j] < cur: ...
nilq/baby-python
python
import numpy as np from random import randint import matplotlib.pyplot as plt def createTestData(X, y, word): img_word = [] word = str(word) for char in range(len(word)): if(word[char] == ' '): img_word.append(-1) else: indices = [i for i, x in enumerate(y) if x ==...
nilq/baby-python
python
#!/usr/bin/env python def part1(path): with open(path) as f: lines = f.read().strip().split("\n") earliest = int(lines[0]) ids = [int(x) for x in lines[1].split(",") if x != "x"] a = [(id, ((earliest // id) + 1) * id) for id in ids] min_ = min(a, key=lambda x: x[1]) return (min_[1] - e...
nilq/baby-python
python
from tests.test_limesurvey import TestBase from limesurveyrc2api.limesurvey import LimeSurveyError class TestSurveys(TestBase): def test_list_surveys_success(self): """A valid request for list of surveys should not return empty.""" result = self.api.survey.list_surveys() for survey in res...
nilq/baby-python
python
try: a except Exc as b: b except Exc2 as c: b # Check that capturing vars are properly local def foo(): try: a except Exc as b: b
nilq/baby-python
python
# Generated by Django 2.1.3 on 2018-12-03 07:00 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('users', '0008_auto_20181203_0659'), ] operations = [ migrations.RenameField( model_name='user', old_name='followings', ...
nilq/baby-python
python
# -*- coding: utf-8 -*- # Generated by Django 1.10.5 on 2017-02-21 19:10 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('lookup_tables', '0015_auto_20170220_1348'), ] operations = [ migrations.Alt...
nilq/baby-python
python
# Boolean Variables x = True print(bool(x)) x = 4 y = 4 print("X :",x) print("Y :",y) print("Is X=Y ? " , bool(x==y)) y = 3 print("Y :",y) print("Is X=Y ? " , bool(x==y)) print("NOTE : If empty sequence, strings, values, are passed, then bool returns false") def mod(num): return (bool(num%2==0)) num = int(input(...
nilq/baby-python
python
#!/usr/bin/env python # -*- coding: utf-8 -*- class qKanji2num_class: def __init__(self, ): self.kans = '〇一二三四五六七八九' self.tais1 = '千百十' self.tais2 = '京兆億万' self.suuji = {'〇', '一', '二', '三', '四', '五', '六', '七', '八', '九', '十', \ '百', '千', '万', '億', '兆', \ ...
nilq/baby-python
python
""" venvs creates virtualenvs. By default it places them in the appropriate data directory for your platform (See `appdirs <https://pypi.python.org/pypi/appdirs>`_), but it will also respect the :envvar:`WORKON_HOME` environment variable for compatibility with :command:`mkvirtualenv`. """ from functools import parti...
nilq/baby-python
python
from itsdangerous import json from models.vagas import VagasEmpregoModel class VagasEmpregoService: def buscar_vaga(self, vaga_id: int) -> dict: vaga = VagasEmpregoModel.procurar_vaga(vaga_id) return vaga def listar_vagas(self) -> list: lista_vagas = VagasEmpregoModel.listar_vagas() ...
nilq/baby-python
python
import matplotlib; matplotlib.use('Agg') from daft_builder import pgm import pytest def test_Param_init(): param = pgm.Param(r"$y$", xy=(0.5, 0.5), of=["x"]) assert param.name == "y" assert param.x, param.y == (0.5, 0.5) assert param.anchor_node is None assert param.edges_to == ["x"] @pytest.ma...
nilq/baby-python
python
from .neurons import *
nilq/baby-python
python
#!/usr/bin/env python __author__ = "Mari Wahl" __copyright__ = "Copyright 2014" __credits__ = ["Mari Wahl"] __license__ = "GPL" __version__ = "2.0" __maintainer__ = "Mari Wahl" __email__ = "marina.w4hl@gmail.com" ''' this should be automatize, declare everything like this is terrible, but it was for historical rea...
nilq/baby-python
python
""" This file contains form classes for abstracting forms across picbackend app """ from django.forms import ModelForm from picmodels.models import NavMetricsLocation class NavMetricsLocationForm(ModelForm): # country = ModelChoiceField(queryset=Country.objects.all(), empty_label="Choose Country", to_field_name...
nilq/baby-python
python
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the Li...
nilq/baby-python
python
#************************************************************************** #* Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. * #* * #* Author: The ALICE Off-line Project. * #* Contributors ...
nilq/baby-python
python
import re import difflib import collections from . import ComicBookCrawlerBase, ChapterItem, ComicBookItem, SearchResultItem from ..exceptions import ComicbookNotFound, ChapterNotFound class ComicBookCrawler(ComicBookCrawlerBase): SOURCE_NAME = '鼠绘漫画' SITE = "ishuhui" CHAPTER_INTERVAL_PATTERN = re.compil...
nilq/baby-python
python
import paddle import pit import numpy as np from reprod_log import ReprodLogger # import argparse from DeiT.losses import DistillationLoss from DeiT.regnet import build_regnet as build_teacher_model from DeiT.losses import DistillationLoss ,SoftTargetCrossEntropyLoss reprod_logger = ReprodLogger() # 定义加载模型 model = ...
nilq/baby-python
python
import copy import itertools from taichi.core import ti_core as _ti_core import taichi as ti # Helper functions def get_rel_eps(): arch = ti.cfg.arch if arch == ti.opengl: return 1e-3 elif arch == ti.metal: # Debatable, different hardware could yield different precisions # On AMD...
nilq/baby-python
python
from lxml import etree, objectify class norm_attribute: def __remove_attributes_node(self, mt_node): if not mt_node.attrib: return True for at in mt_node.attrib.keys(): del mt_node.attrib[at] def __remove_attributes_tree(self, mt_tree): self.__remove_attributes_node(mt_tree...
nilq/baby-python
python
import os from pysigtool import extract_authenticode def test_extract_authenticode() -> None: script_dir: str = os.path.abspath(os.path.dirname(__file__)) input_bin: str = os.path.join(script_dir, "msvcr120.dll") output_der: str = os.path.join( script_dir, "msvcr120.dll".replace(".", "_") + ".de...
nilq/baby-python
python
''' Export/Spreadsheet/spreadsheetrow _________________________________ Base object for generating spreadsheet data rows. :copyright: (c) 2015 The Regents of the University of California. :license: GNU GPL, see licenses/GNU GPLv3.txt for more details. ''' # load modules/submodules from xldlib.qt....
nilq/baby-python
python
expected_output={ 'tunnel_id': { 1: { 'active_time': 2856, 'auth_sign': 'psk', 'auth_verify': 'psk', 'ce_id': 1406, 'cisco_trust_security_sgt': 'disabled', 'dh_grp': 20, 'dpd_configured_time': 10, 'dyna...
nilq/baby-python
python
#!/usr/bin/env python import requests possible_chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' password = '8Ps3H0GWbn5rd9S7GmAdgQNdkhPkq9cw' auth=('natas17', password) used_chars = '' for char in possible_chars: payload = {'username': ('natas18" AND password LIKE BINARY "%%%c%%" and slee...
nilq/baby-python
python
from .data_wrangling import dip2strike from .data_wrangling import strike2dipaz from .data_wrangling import xyzinterp from .data_wrangling import linear_interpolate_2dp from .geometric_bias import unitvectorx from .geometric_bias import unitvectory from .geometric_bias import unitvectorz from .geometric_bias import is...
nilq/baby-python
python
from .base import Widget class RectangleWidget(Widget): def __init__(self, size, position=(0, 0)): super().__init__(position) self.size = size def draw(self, window): width, height = self.extent(window) window.rectangle(self.x, self.y, self.x + width - 1, self.y + height - 1) ...
nilq/baby-python
python
import sys import pandas as pd import numpy as np import torch from torch import nn from torch.utils.data import random_split, DataLoader from utils import ( read_glove_vector, get_one_hot_matrix, get_glove_matrix, create_emb_layer, ) from dataset import UtteranceSlotDataset from train import train fr...
nilq/baby-python
python
from bokeh.models import FuncTickFormatter import bokeh.palettes import numpy as np logFmtr = FuncTickFormatter(code=""" var trns = [ '\u2070', '\u00B9', '\u00B2', '\u00B3', '\u2074', '\u2075', '\u2076', '\u2077', '\u2078', '\u2079']; var tick_power = Math.floor(Math.log10(tick)); var tick_mult = Math.pow(10, Math.l...
nilq/baby-python
python
from sklearn.kernel_approximation import (RBFSampler,Nystroem) from sklearn.ensemble import RandomForestClassifier import pandas import numpy as np import random from sklearn.svm import SVC from sklearn.metrics.pairwise import rbf_kernel,laplacian_kernel,chi2_kernel,linear_kernel,polynomial_kernel,cosine_similarity fro...
nilq/baby-python
python
# Generated by Django 3.0.8 on 2020-08-29 14:04 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('bugtrack', '0014_user_notification'), ] operations = [ migrations.AddField( model_name='bug', name='notifType', ...
nilq/baby-python
python
# -*- coding: utf-8 -*- import shutil import locm, routem, mapm, dropboxm, gmaps, tools, bokehm, tspm import logging.config, os, yaml, inspect import time, math import numpy as np tver_coords = {u'lat':56.8583600,u'lng':35.9005700} ryazan_coords = {u'lat':54.6269000,u'lng':39.6916000} def setup_logging( default_p...
nilq/baby-python
python
# -*- coding: utf-8 -*- """ In the test, we assume: - id_col: id, string, generated by ``import uuid`` - sort_col: time, datetime """ from __future__ import division from sqlalchemy import MetaData, Table, Column from sqlalchemy import String, DateTime table_name = "events" id_col_name = "id" sort_col_name = "time"...
nilq/baby-python
python
import time import numpy as np import torch import torch.nn as nn import torch.nn.functional as F import chamfer from torch.autograd import Function from util.sampler import sampler, sampler_color, sampler_uv, uv2color from torch.autograd import Variable class RGBPriorLoss(nn.Module): def __init__(self, options)...
nilq/baby-python
python
from neuroquery import datasets from neuroquery_image_search import NeuroQueryImageSearch datasets.fetch_neuroquery_model() NeuroQueryImageSearch()
nilq/baby-python
python
# -*- coding: utf-8 -*- """ dcm - Direction Cosine Matric (DCM) class for Astrodynamic Toolkit Copyright (c) 2017 - Michael Kessel (mailto: the.rocketredneck@gmail.com) a.k.a. RocketRedNeck, RocketRedNeck.com, RocketRedNeck.net RocketRedNeck and MIT Licenses RocketRedNeck hereby grants license for others to copy a...
nilq/baby-python
python
# -*- coding: utf-8 -*- # --------------------------------------------------------------------- # MetricScope model # --------------------------------------------------------------------- # Copyright (C) 2007-2019 The NOC Project # See LICENSE for details # --------------------------------------------------------------...
nilq/baby-python
python
import os import pickle import random import torch import numpy as np import math from torch.utils.data import Dataset class RicoDataset(Dataset): ''' dataset Loader for rico ''' def __init__(self, data_path, debug=False ) -> None: super().__in...
nilq/baby-python
python
import numpy as np import scipy.stats as stats import matplotlib.pyplot as plt import scipy.optimize as opt import emcee import triangle, walkers import priors np.random.seed(666) def randomData(a, b, sig, npts = 100): x = np.random.random(npts) mean = a + b * x y = stats.norm(loc=mean, scale=sig).rvs(...
nilq/baby-python
python
import os from Zoo.World import World from Zoo.Position import Position from Zoo.Organisms.Grass import Grass from Zoo.Organisms.Sheep import Sheep from Zoo.Organisms.Dandelion import Dandelion from Zoo.Organisms.Wolf import Wolf from Zoo.Organisms.Toadstool import Toadstool if __name__ == '__main__': pyWorld = Worl...
nilq/baby-python
python
# -*- coding: utf-8 -*- #!/usr/bin/env python3 import os import re import time import random import fileinput import math import pandas as pd import numpy as np import matplotlib.pyplot as plt from spyci import spyci def write_spice(sch_path, file_name, corner): extension = '.spice' lines = ["\n* Parameters\n...
nilq/baby-python
python
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from recipe_engine.post_process import Filter DEPS = [ 'archive', 'chromium', 'depot_tools/gclient', 'recipe_engine/context', 'recipe_engine/json'...
nilq/baby-python
python
#!/usr/bin/python -Wall # ================================================================ # Please see LICENSE.txt in the same directory as this file. # John Kerl # kerl.john.r@gmail.com # 2007-05-31 # ================================================================ ispec_mul_table = [99] ispec_inv_table = []
nilq/baby-python
python
# sys.path.append(os.getcwd() + '/..') # Uncomment for standalone running from abstract_filter import * import re class RepeatedChars(AbstractFilter): def __init__(self): self.num_of_scans = 0 self.src_language = "" self.trg_language = "" self.repeated_chars_re = None # def initialize(self, source_langua...
nilq/baby-python
python
import itertools import random import logging import numpy as np import matplotlib.pyplot as plt import os #from evaluate_reservoir import * from utilis import * from args import args as my_args from evaluate_encoder import * from itertools import product import time if __name__ == '__main__': args...
nilq/baby-python
python
#! /usr/bin/python import ctypes import os __author__ = 'fyabc' # Try to locate the shared library _file = 'my_utils.dll' _path = os.path.join(*(os.path.split(__file__)[:-1] + (_file,))) _module = ctypes.cdll.LoadLibrary(_path) # void myPrint(int) myPrint = _module.myPrint myPrint.argtypes = (ctypes.c_int,) myPrin...
nilq/baby-python
python
import urllib.request import re import sys class WordReader: MEANING_URL = "https://dict.longdo.com/search/%s" @staticmethod def __get_url_content(url): fp = urllib.request.urlopen(url) content = fp.read().decode("utf8") fp.close() return content @staticmethod def...
nilq/baby-python
python
# -*- coding: utf-8 -*- # Copyright 2017 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Module to manage failure message of builds.""" from __future__ import print_function import sys from chromite.lib import fai...
nilq/baby-python
python
''' this file contains time tests for scanner algorithms ''' from FreeAndSimpleScanner import * import unittest from time import time from random import uniform class AreaScannerMethodsTest(unittest.TestCase): @staticmethod def used_regions_sample(): usedRegions = [((5.5, 1), (7.5, 4)), ((1, 5.5), (...
nilq/baby-python
python
import yaml import json import numpy as np from json import dumps, loads from kafka import KafkaProducer, KafkaConsumer from fedrec.communications.messages import JobSubmitMessage from fedrec.utilities import registry with open("configs/dlrm_fl.yml", 'r') as cfg: config = yaml.load(cfg, Loader=yaml.FullLoader) de...
nilq/baby-python
python
import urllib.request import csv import datetime from requests import get import fcntl # expireDate # http://stock.finance.sina.com.cn/futures/api/openapi.php/StockOptionService.getRemainderDay?date=201706 # frontrow = [ # 'Date', 'ExpireDate', 'OptionType', 'Strike', 'Contract Name', 'Last', # 'Bid', 'Ask', '...
nilq/baby-python
python
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import (division, print_function, absolute_import, unicode_literals) import logging from itertools import imap from osrc.database import get_pipeline, format_key # The default time-to-live for every key. DEFAULT_TTL = 2 * 7 * 24 * ...
nilq/baby-python
python
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from .. import...
nilq/baby-python
python
# _*_coding:utf-8_*_ # @auther:FelixFu # @Date: 2021.4.14 # @github:https://github.com/felixfu520 import numpy as np import os import cv2 from base import BaseDataSet, BaseDataLoader class BDDDataset(BaseDataSet): def __init__(self, **kwargs): self.num_classes = 29 super(BDDDataset, self).__init...
nilq/baby-python
python
import numpy as np from scipy.optimize import least_squares from sklearn.cluster import KMeans from sklearn.neighbors import NearestNeighbors def sol_u(t, u0, alpha, beta): return u0*np.exp(-beta*t) + alpha/beta*(1-np.exp(-beta*t)) def sol_s(t, s0, u0, alpha, beta, gamma): exp_gt = np.exp(-gamma*t) if bet...
nilq/baby-python
python
#!/usr/bin/env #Imports import subprocess from collections import defaultdict import re import os import string import sys import argparse import datetime def transform_groups(blob): lines = blob.stdout.decode('utf-8').split('\n') stat = defaultdict(lambda: defaultdict()) months = [] for line in line...
nilq/baby-python
python
from django.db import models from django.contrib.auth.models import User from django.forms import ModelForm, Textarea, TextInput, Select from django.utils import timezone # Create your models here. class Unvetted(models.Model): token_address = models.CharField(max_length=120) telegram_url = models.CharField(...
nilq/baby-python
python
from .base_options import BaseOptions class TrainOptions(BaseOptions): def initialize(self): BaseOptions.initialize(self) self._parser.add_argument('--total_epoch', type=int, default=20, help='total epoch for training') self._parser.add_argument('--learning_rate', type=float, default=0.00...
nilq/baby-python
python
import json import os.path import codecs from sampledata.exceptions import ParameterError LOCALES = ['us'] OCCUPATIONS_PATH = os.path.join(os.path.dirname(__file__), 'occupations') class Occupation(object): data = {} def __load_locale(self, locale): locale_path = os.path.join(OCCUPATIONS_PATH, "{0...
nilq/baby-python
python
"""Facebook platform for notify component.""" import json import logging from aiohttp.hdrs import CONTENT_TYPE import requests import voluptuous as vol from homeassistant.components.notify import ( ATTR_DATA, ATTR_TARGET, PLATFORM_SCHEMA, BaseNotificationService, ) from homeassistant.const import CONT...
nilq/baby-python
python
"""jinjalint Usage: jinjalint [options] [INPUT ...] Options: -h --help Show this help message and exit. --version Show version information and exit. -v --verbose Verbose mode. -c --config FILE Specify the configuration file. The configuration file must be a valid Python file. """ ...
nilq/baby-python
python
import logging import re from datetime import datetime class SFHelper(object): @staticmethod def get_pi_name(path, log = True): pi_names = {"staudt": "Louis_Staudt", "Staudt": "Louis_Staudt", "Soppet": "Daniel_Soppet", "Schrump": "David_Schrump", "Shrump": "David_Schrump", "Elec...
nilq/baby-python
python
from os.path import basename from pandas import read_csv from NaiveBayes import * from DecisionTrees import * from KNN import * from K_Means import * from Evaluator import * from PickleFiles import * def run(): try: os.mkdir(os.path.join("", "myFiles")) except FileExistsError: pa...
nilq/baby-python
python
import pickle import pandas as pd import nltk import re from nltk.corpus import wordnet as ewn import numpy as np def load_dataset(path,train): train_data = np.load(path, allow_pickle=True) ########if(not train): #train_data = train_data[()] embeddings = train_data['embeddings'] labels = train_data['labels'] sen...
nilq/baby-python
python
import io import json import time import errno import socket import struct import threading from . import logs from . import utils TIMEOUT = 0.1 BACKLOG = socket.SOMAXCONN CHUNK_SIZE = io.DEFAULT_BUFFER_SIZE error = socket.error timeout = socket.timeout log = logs.get(__name__) def start_client(address, handler, s...
nilq/baby-python
python
from flask import Flask, request, render_template from flask_cors import cross_origin import pickle app = Flask(__name__) model = open('car.pkl','rb') regressor = pickle.load(model) @app.route("/") @cross_origin() def home(): return render_template('car.html') @app.route("/predict", methods=["GET"...
nilq/baby-python
python
"""Qgroupbox module.""" # -*- coding: utf-8 -*- from PyQt6 import QtWidgets, QtCore # type: ignore[import] from pineboolib.core import decorators from pineboolib.core import settings from pineboolib import logging from . import qwidget from typing import Any logger = logging.get_logger(__name__) class QGroupBox(...
nilq/baby-python
python
from datetime import timedelta from django.test import TestCase from django.utils.timezone import now from core.models.route import Route from core.models.station import Station from core.models.tender import Tender from core.models.workshop import Workshop TEST_WORKSHOP = 'Bw Hagen' TEST_ROUTE = 'KBS 100 Hamburg - ...
nilq/baby-python
python
from io import StringIO from .. import * from bfg9000 import path from bfg9000 import safe_str from bfg9000.shell.syntax import * class my_safe_str(safe_str.safe_string): pass class TestWriteString(TestCase): def test_variable(self): out = Writer(StringIO()) out.write('foo', Syntax.variabl...
nilq/baby-python
python
""" A collection of utilities for working with observation dictionaries and different kinds of modalities such as images. """ import numpy as np from copy import deepcopy from collections import OrderedDict import torch import torch.nn.functional as F import robomimic.utils.tensor_utils as TU # DO NOT MODIFY THIS! ...
nilq/baby-python
python
# -*- coding: utf-8 -*- """ Tests for the salt-run command """ from __future__ import absolute_import, print_function, unicode_literals import logging import pytest from tests.support.case import ShellCase from tests.support.helpers import slowTest log = logging.getLogger(__name__) @pytest.mark.usefixtures("salt_s...
nilq/baby-python
python
from os import listdir, path import random import csv import re import natsort import numpy import theano from skimage.io import imread from block_designer import BlockDesigner from sampler import Sampler import pdb class ImageFlipOracle(object): """ *_flip methods should take an image_name """ def _...
nilq/baby-python
python
from g2net.input import extract_dict_from_df import pandas as pd import pytest @pytest.mark.parametrize( 'data_dict, key_col, val_col, expected_dict', ( pytest.param( { 'col1': [1, 2, 5], 'col2': [3, 4, 6] }, 'col1', '...
nilq/baby-python
python
# # Copyright (c) 2020 by Philipp Scheer. All Rights Reserved. # # usage: nlu.py [-h] [--config CONFIG] # # Natural language understanding engine using spaCy and RASA # Convert spoken language into a command (skill) and arguments # # optional arguments: # -h, --help show this help message and exit # --con...
nilq/baby-python
python
import pickle import pytest from routrie import Router def test_routing() -> None: router = Router( routes={ "/": 0, "/users": 1, "/users/:id": 2, "/users/:id/:org": 3, "/users/:user_id/repos": 4, "/users/:user_id/repos/:id": 5, ...
nilq/baby-python
python
import os import sys sys.path.append(f'{os.getcwd()}/example/bpapi/vendor')
nilq/baby-python
python
# Generated by Django 2.2.11 on 2020-04-09 13:49 from django.db import migrations, models import django.db.models.deletion import wagtail.core.fields class Migration(migrations.Migration): dependencies = [ ('wagtailcore', '0041_group_collection_permissions_verbose_name_plural'), ('contentPages',...
nilq/baby-python
python
import urllib def assert_urls_match(u1, u2): p1 = urllib.parse.urlparse(u1) p2 = urllib.parse.urlparse(u2) assert p1.scheme == p2.scheme assert p1.netloc == p2.netloc assert p1.path == p2.path assert urllib.parse.parse_qs(p1.query) == urllib.parse.parse_qs(p2.query) class FakeResponse: d...
nilq/baby-python
python
# -*- coding: utf-8 -*- """Defines `json.JSONEncoder` subclass that makes parsed object (including bytes and bitarray) JSON-serializable """ import bitarray import json import sys class JSONEncoder(json.JSONEncoder): """JSON encoder with additional support for bytes and bitarray Examples: >>> JSON...
nilq/baby-python
python
from os.path import getsize from .constants import ATTACHMENT_CONTENT_TYPES from .errors import FastScoreError class Attachment(object): """ Represents a model attachment. An attachment can be created directly but it must (ultimately) associated with the model: >>> att = fastscore.Attachment('att-1'...
nilq/baby-python
python
# The Path class represents paths on a graph and records the total path cost class Path: def __init__(self): self.length = 0 self.cost = 0 self.nodes = [] # adds a node to the end of the path def add_node(self, node_label, cost): self.length += 1 self.cost += cost ...
nilq/baby-python
python
######################################################### # 2020-01-28 13:15:09 # AI # ins: MOV @Ri, A ######################################################### import random from .. import testutil as u from ..sim51util import SIMRAM from ..asmconst import * p = u.create_test() ram = SIMRAM() def test_rs(rs, psw...
nilq/baby-python
python
import sys, re, hashlib, json, random import GenePredBasics, SequenceBasics from SerializeBasics import encode_64, decode_64 # Transcriptome is a set of genepred entries # with the corresponding fasta file. # alternatively, you can read in a serialized transcriptome. # # You can further define a transcriptome file wit...
nilq/baby-python
python
from cnnlevelset.pascalvoc_util import PascalVOC from cnnlevelset.localizer import Localizer from cnnlevelset import config as cfg from collections import defaultdict import tensorflow as tf import keras.backend as K import numpy as np import matplotlib.pyplot as plt import sys import time tf.python.control_flow_ops...
nilq/baby-python
python
a''' Created on 6-feb-2017 Modified the 20170321, by EP @author: roncolato ''' import numpy as np import scipy.interpolate as interpol from sherpa.training.step1 import from7to28 as f7 from sherpa.training.step1 import quant as q from sherpa.training.step1 import EquaPrec as ep from sherpa.training import EquaIndic ...
nilq/baby-python
python
"""ibc client module data objects.""" from __future__ import annotations import attr from terra_proto.ibc.core.client.v1 import Height as Height_pb from terra_sdk.util.json import JSONSerializable __all__ = ["Height"] @attr.s class Height(JSONSerializable): revision_number: int = attr.ib(default=0, converter=i...
nilq/baby-python
python
import numpy as np import scipy as scp from numpy.linalg import norm ############################################# # Add the one-folder-up-path import os import sys sys.path.append(os.path.join(os.path.dirname(__file__), '../')) ############################################# from envs.blocking_env import BlockingEnv ...
nilq/baby-python
python
from annotation_utils.ndds.structs import NDDS_Dataset dataset = NDDS_Dataset.load_from_dir('/home/clayton/workspace/prj/data_keep/data/ndds/measure_kume_map3_1_200', show_pbar=True) dataset.save_to_dir('save_test', show_pbar=True)
nilq/baby-python
python