content
stringlengths
0
1.05M
origin
stringclasses
2 values
type
stringclasses
2 values
#!/usr/bin/env python3 -u # -*- coding: utf-8 -*- # copyright: sktime developers, BSD-3-Clause License (see LICENSE file) """Implements composite forecasters.""" __author__ = ["mloning"] __all__ = [ "ColumnEnsembleForecaster", "EnsembleForecaster", "TransformedTargetForecaster", "ForecastingPipeline",...
nilq/baby-python
python
# -*- coding: utf-8 -*- import pandas import numpy as np from sklearn import preprocessing from sklearn import neighbors from sklearn.model_selection import StratifiedKFold, cross_val_score import matplotlib.pyplot as plt from sklearn.model_selection import train_test_split # Tira limite de vizualição do dataframe qu...
nilq/baby-python
python
from django.test import TestCase from foia_hub.models import Agency, Office from foia_hub.scripts.load_agency_contacts import ( load_data, update_reading_rooms, add_request_time_statistics, extract_tty_phone, extract_non_tty_phone, build_abbreviation) example_office1 = { 'address': { 'address_lin...
nilq/baby-python
python
import picobox @picobox.pass_("conf") def session(conf): class Session: connection = conf["connection"] return Session() @picobox.pass_("session") def compute(session): print(session.connection) box = picobox.Box() box.put("conf", {"connection": "sqlite://"}) box.put("session", factory=sessio...
nilq/baby-python
python
#pg.72 ex13 parameters, unpacking,variables #sd3 combine input with aargv to make a script that gets more input from the user from sys import argv #read the WYSS section for how to run this script, first, second, third = argv print("The script is called:", script) print("Your first variable is:", first) print("Your s...
nilq/baby-python
python
import unittest import sys from PyQt5.QtWidgets import QApplication, QDialog from ui import DisclaimerDialog app = QApplication(sys.argv) disclaimer_dialog = QDialog() disclaimer_dialog_ui = DisclaimerDialog.Ui_dialog() disclaimer_dialog_ui.setupUi(disclaimer_dialog) class DisclaimerDialogTests(unittest.TestCase): ...
nilq/baby-python
python
import json with open('04_movies_save.json', 'r', encoding='UTF-8') as fr: movies = json.load(fr) with open('04_notfound_save.json', 'r', encoding='UTF-8') as fr: not_found = json.load(fr) with open('02_rating_save.json', 'r', encoding='UTF-8') as fr: ratings = json.load(fr) new_rating = [] new_movies =...
nilq/baby-python
python
# Collaborators (including web sites where you got help: (enter none if you didn't need help) name=input("please enter your name: ") age=input("please enter your age: ") grade=input("please enter your grade: ") school=input("please enter your school: ") directory={} directory.update({'name':name, 'age':age,'grade':grad...
nilq/baby-python
python
import logging from os import access import azure.functions as func import mysql.connector import ssl def main(req: func.HttpRequest) -> func.HttpResponse: logging.info('Python HTTP trigger function processed a request.') from azure.identity import DefaultAzureCredential, AzureCliCredential, ChainedTokenCrede...
nilq/baby-python
python
import functools from bargeparse.cli import cli def command(*args, param_factories=None): """ Decorator to create a CLI from the function's signature. """ def decorator(func): func._subcommands = [] func.subcommand = functools.partial( subcommand, func, param_factories=pa...
nilq/baby-python
python
#pylint:skip-file import sys from argparse import ArgumentParser import networkx as nx def main(argv): parser = ArgumentParser() parser.add_argument('-i', '--input_file', help='Input .dot file', required=True) parser.add_argument('-s', '--start_id', help='Start ID (inclusive)', ...
nilq/baby-python
python
import os import sys from .toolkit import * __version__ = '1.1.0' class ToolkitCompileFileCommand(compiler.ES6_Toolkit_Compile_File): def run(self): self.execute() class ToolkitDumpJsCommand(compiler.ES6_Toolkit_Dump_JS): def run(self, edit, compiled_js): self.execute(edit, compiled_js)
nilq/baby-python
python
# uncompyle6 version 3.2.4 # Python bytecode 2.7 (62211) # Decompiled from: Python 2.7.15 (v2.7.15:ca079a3ea3, Apr 30 2018, 16:30:26) [MSC v.1500 64 bit (AMD64)] # Embedded file name: lib.coginvasion.gui.CILoadingScreen from direct.gui.DirectGui import OnscreenText from direct.directnotify.DirectNotifyGlobal import dir...
nilq/baby-python
python
from unittest import TestCase from musicscore.musicxml.groups.common import Voice from musicscore.musicxml.elements.fullnote import Pitch from musicscore.musicxml.elements.note import Note, Duration class Test(TestCase): def setUp(self) -> None: self.note = Note() self.note.add_child(Pitch()) ...
nilq/baby-python
python
#!/usr/bin/python # -*- coding:utf-8 -*- """ @author: Raven @contact: aducode@126.com @site: https://github.com/aducode @file: __init__.py @time: 2016/1/31 23:57 """ import types from type import Any from type import Null from type import Bool from type import Byte from type import Int16 from type import Int32 from ...
nilq/baby-python
python
import json import matplotlib.pyplot as plt import sys import os from matplotlib.backends.backend_pdf import PdfPages from random import randrange import re import traceback from datetime import datetime import argparse import operator import matplotlib.dates as mdate def buildChart(name, x,y, label1, x2,y2, label2): ...
nilq/baby-python
python
import argparse import sys import os from subprocess import call, check_output def main(): action = parse_commandline() action() def parse_commandline(): parser = argparse.ArgumentParser( description='A simple program to compile and run OpenCV programs', formatter_class=argparse.RawTextH...
nilq/baby-python
python
#!/usr/bin/env python3 # # Copyright 2021 Xiaomi Corp. (authors: Fangjun Kuang) # # See ../../../LICENSE for clarification regarding multiple authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy...
nilq/baby-python
python
def main(): print "plugin_b"
nilq/baby-python
python
# -*- coding: utf8 -*- csv_columns = [ 'DATE-OBS', 'TIME-OBS', 'FILENAME', 'OBSTYPE', 'OBJECT', 'NOTES', 'EXPTIME', 'RA', 'DEC', 'FILTERS', 'FILTER1', 'AIRMASS', 'DECPANGL', 'RAPANGL', 'NEXTEND' ]
nilq/baby-python
python
import json from tracardi_plugin_sdk.action_runner import ActionRunner from tracardi_plugin_sdk.domain.register import Plugin, Spec, MetaData, Form, FormGroup, FormField, FormComponent from tracardi_plugin_sdk.domain.result import Result from tracardi_json_from_objects.model.models import Configuration def validate(...
nilq/baby-python
python
# -*- coding: utf-8 -*- # Copyright 2016 Yelp Inc. # # 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 ag...
nilq/baby-python
python
""" Copyright (c) 2021 Heureka Group a.s. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agre...
nilq/baby-python
python
from django.test import TestCase, RequestFactory, Client from chat.views import UnarchiveMessageHealthProfessionalView from chat.models import Message from user.models import HealthProfessional, Patient class TestUnarchiveMessageHealthProfessionalView(TestCase): def setUp(self): self.health_professional...
nilq/baby-python
python
from py4jps.resources import JpsBaseLib import os from tqdm import tqdm import time import numpy as np import pandas as pd from SPARQLWrapper import SPARQLWrapper, CSV, JSON, POST from shapely import geometry, wkt, ops # read csv with regional code and WKT strings df = pd.read_csv('scotland_lsoa_populations/scottish...
nilq/baby-python
python
""" Customer Class including visualization. """ import random import pandas as pd import numpy as np from a_star import find_path from SupermarketMapClass import SupermarketMap import constants class Customer: """ customer class including visualization.""" # possible states of a customer STATES = ['che...
nilq/baby-python
python
from pathlib import Path __version__ = '0.2.1' TOOL_DIR = Path('~/.proteotools_software').expanduser() COMET = TOOL_DIR / 'comet' / 'comet.linux.exe' MSGF = TOOL_DIR / 'msgfplus' / 'MSGFPlus.jar' TANDEM = TOOL_DIR / 'tandem' / 'bin' / 'static_link_ubuntu' / 'tandem.exe' TPP = TOOL_DIR / 'tpp' / 'tpp_6-0-0.sif' THERMO...
nilq/baby-python
python
# -*- coding: utf-8 -*- # Generated by Django 1.11.4 on 2018-04-17 22:44 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ migrations.swappable_depende...
nilq/baby-python
python
from azfs.cli.constants import WELCOME_PROMPT from click.testing import CliRunner from azfs.cli import cmd def test_cmd(): result = CliRunner().invoke(cmd) # result.stdout assert result.stdout == f"{WELCOME_PROMPT}\n"
nilq/baby-python
python
# -*- coding: utf-8 -*- __author__ = 'S.I. Mimilakis' __copyright__ = 'Fraunhofer IDMT' # imports import torch from nn_modules import cls_fe_nnct, cls_basic_conv1ds, cls_fe_sinc, cls_embedder def build_frontend_model(flag, device='cpu:0', exp_settings={}): if exp_settings['use_sinc']: print('--- Buildin...
nilq/baby-python
python
import collections import heapq import json from typing import List, Optional from binarytree import Node def twoSum(nums, target): compliment_set = collections.defaultdict(int) for i, number in enumerate(nums): compliment = target - number if compliment in compliment_set: return ...
nilq/baby-python
python
from __future__ import print_function import torch import torch.nn as nn import torch.utils.data from torch.autograd import Variable import torch.nn.functional as F import math import numpy as np def test(model, imgL,imgR,disp_true): model.eval() imgL, imgR, disp_true = imgL.cuda(), imgR.cud...
nilq/baby-python
python
from datetime import datetime from config import InputConfig from .base import BaseDataLoader from ..market import BaseMarket from ..renderers import BaseRenderer class BackTestDataLoader(BaseDataLoader): def __init__( self, market: BaseMarket, renderer: BaseRenderer, ...
nilq/baby-python
python
from data_importers.management.commands import BaseXpressDemocracyClubCsvImporter class Command(BaseXpressDemocracyClubCsvImporter): council_id = "E07000096" addresses_name = "2020-02-03T10:27:29.701109/Democracy_Club__07May2020Dacorum.CSV" stations_name = "2020-02-03T10:27:29.701109/Democracy_Club__07May...
nilq/baby-python
python
from django.db.models import Q from .constants import ( STOP_WORDS, ) from .models import ( WORD_DOCUMENT_JOIN_STRING, DocumentRecord, TokenFieldIndex, ) from .tokens import tokenize_content def _tokenize_query_string(query_string): """ Returns a list of WordDocumentField keys to fetch ...
nilq/baby-python
python
import torch import suppixpool_CUDA as spx_gpu import numpy as np class SupPixPoolFunction(torch.autograd.Function): @staticmethod def forward(ctx, img, spx): spx = spx.to(torch.int) K = spx.max()+1 assert(spx.size()[-2:]==img.size()[-2:]) # print(np.all(np.arange(K)==np.uni...
nilq/baby-python
python
"""Illustrates more advanced features like inheritance, mutability, and user-supplied constructors. """ from simplestruct import Struct, Field # Default values on fields work exactly like default values for # constructor arguments. This includes the restriction that # a non-default argument cannot follow a default a...
nilq/baby-python
python
def main(): print() print("Result = ((c + ~d) * b) * ~(d + a * e)") print() print_table_header() for i in reversed(range(0, 2**5)): print_row(i) def print_table_header(): print("| a | b | c | d | e | Result |") print("|-----|-----|-----|-----|-----|---------|") def pri...
nilq/baby-python
python
import tifffile import h5py import warnings import os TIFF_FORMATS = ['.tiff', '.tif'] H5_FORMATS = ['.h5', '.hdf'] LIF_FORMATS = ['.lif'] def read_tiff_voxel_size(file_path): """ Implemented based on information found in https://pypi.org/project/tifffile """ def _xy_voxel_size(tags, key): a...
nilq/baby-python
python
import os,sys THIS_DIR = os.path.dirname(os.path.abspath(__file__)) ROOT_DIR = os.path.abspath(os.path.join(THIS_DIR, os.pardir)) sys.path.append(ROOT_DIR) from analysis.pymo.parsers import BVHParser from analysis.pymo.data import Joint, MocapData from analysis.pymo.preprocessing import * from analysis.pymo.viz_tools ...
nilq/baby-python
python
import argparse import numpy as np import os import matplotlib.pyplot as plt import PIL.Image as Image import torch from sklearn.cluster import MiniBatchKMeans, KMeans from sklearn import decomposition from scipy.sparse import csr_matrix import torchvision import torch.nn as nn from torchvision import transforms import...
nilq/baby-python
python
# -*- coding: utf-8 -*- #%% Packages import numpy as np import os, matplotlib #matplotlib.use('Agg') #from tensorflow.keras import layers from tensorflow.keras.preprocessing.image import ImageDataGenerator from tensorflow.keras.callbacks import EarlyStopping, ModelCheckpoint, ReduceLROnPlateau import tensorfl...
nilq/baby-python
python
# Copyright (c) Meta Platforms, Inc. and affiliates. # # 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 o...
nilq/baby-python
python
import os import sys from yaku.scheduler \ import \ run_tasks from yaku.context \ import \ get_bld, get_cfg import yaku.tools def configure(conf): ctx.load_tool("python_2to3") def build(ctx): builder = ctx.builders["python_2to3"] files = [] for r, ds, fs in os.walk("foo"): ...
nilq/baby-python
python
from sklearn.ensemble import IsolationForest class IsolationModel: """ Simple Isolation Model based on contamination """ def __init__(self, data): self.normalized_data = (data - data.mean()) / data.std() self.iso = IsolationForest(contamination=.001, behaviour='new') self.is...
nilq/baby-python
python
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Module with several helper functions """ import os import collections import re def file_extensions_get(fname_list): """Returns file extensions in list Args: fname_list (list): file names, eg ['a.csv','b.csv'] Returns: list: file exten...
nilq/baby-python
python
from . import fcn8_resnet, fcn8_vgg16 def get_base(base_name, exp_dict, n_classes): if base_name == "fcn8_resnet": model = fcn8_resnet.FCN8() elif base_name == "fcn8_vgg16": model = fcn8_vgg16.FCN8_VGG16(n_classes=n_classes) else: raise ValueError('%s does not exist' % base_n...
nilq/baby-python
python
# Copyright 2020 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. """The datastore models for upload tokens and related data.""" from __future__ import absolute_import import logging import uuid from google.appengine.ext i...
nilq/baby-python
python
import struct from itertools import permutations class bref3: def __init__(self, filename): self.stream = open(filename, 'rb') self.snvPerms = list(permutations(['A','C','G','T'])) def readRecords(self): # read the magic number if self.read_int() != 2055763188: rais...
nilq/baby-python
python
"""Utilities for make the code run both on Python2 and Python3. """ import sys PY2 = sys.version_info[0] == 2 # urljoin if PY2: from urlparse import urljoin else: from urllib.parse import urljoin # Dictionary iteration if PY2: iterkeys = lambda d: d.iterkeys() itervalues = lambda d: d.itervalues() ...
nilq/baby-python
python
#!/usr/bin/env python # # Copyright (c) 2021, Djaodjin Inc. # 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, # this ...
nilq/baby-python
python
#!/usr/bin/env python import codecs import logging from pathlib import Path import numpy as np import astropy.units as u from astropy.coordinates import SkyCoord from regions import CircleSkyRegion from gammapy.modeling import Fit from gammapy.data import DataStore from gammapy.datasets import ( MapDataset, ) from...
nilq/baby-python
python
from __future__ import print_function import argparse import os import random import torch import torch.nn as nn import torch.nn.parallel import torch.backends.cudnn as cudnn import torch.optim as optim import torch.utils.data import torchvision.utils as vutils from torch.autograd import Variable from model import _net...
nilq/baby-python
python
#!/usr/bin/env python # -*- coding: utf-8 -*- # pylint: disable=C0103,W0621 """ Train a text generating LSTM on Slovenian poems and prose - first train a few epochs on Slovenian poetry and prose (to learn basics of the language) (from <http://lit.ijs.si/>) - afterwards train at least additional epochs on target texts ...
nilq/baby-python
python
#!/usr/bin/env python # coding: utf-8 import os import torch import numpy as np from sklearn.preprocessing import StandardScaler class QSODataset(torch.utils.data.Dataset): """QSO spectra iterator.""" def __init__(self, filepath, partition, wavelength_threshold=1290., subsample=1, log_transfo...
nilq/baby-python
python
from xnemogcm import open_domain_cfg, open_nemo from xnemogcm.nemo import nemo_preprocess import os from pathlib import Path import xarray as xr TEST_PATH = Path(os.path.dirname(os.path.abspath(__file__))) def test_options_for_files(): """Test options to provide files""" domcfg = open_domain_cfg( dat...
nilq/baby-python
python
"""Unit test package for ipgeo."""
nilq/baby-python
python
"""Top-level package for SimpleBBox.""" __author__ = """Sergey Matyunin""" __email__ = 'serge-m@users.noreply.github.com' __version__ = '0.0.10'
nilq/baby-python
python
import os import json import datetime from performance.driver.core.classes import Reporter from performance.driver.core.eventfilters import EventFilter from performance.driver.core.events import StartEvent, ParameterUpdateEvent class RawReporter(Reporter): """ The **Raw Reporter** is creating a raw dump of the r...
nilq/baby-python
python
# SecretPlots # Copyright (c) 2019. SecretBiology # # Author: Rohit Suratekar # Organisation: SecretBiology # Website: https://github.com/secretBiology/SecretPlots # Licence: MIT License # Creation: 05/10/19, 7:52 PM # # Bar Locations import numpy as np from SecretPlots.constants import * from SecretPlots.man...
nilq/baby-python
python
#Naive vowel removal. removeVowels = "EQuis sapiente illo autem mollitia alias corrupti reiciendis aut. Molestiae commodi minima omnis illo officia inventore. Quisquam sint corporis eligendi corporis voluptatum eos. Natus provident doloremque reiciendis vel atque quo. Quidem" charToRemove = ['a', 'e', 'i', 'o', 'u'] ...
nilq/baby-python
python
#Write a program that asks the user for a number n and prints the sum of the numbers 1 to n start=1 print("Please input your number") end=input() sum=0 while end.isdigit()==False: print("Your input is not a valid number, please try again") end=input() for i in range(start,int(end)+1): sum=sum+i print("Sum f...
nilq/baby-python
python
import os.path import pathlib import subprocess import sys import urllib from typing import Dict, List, Optional, Tuple # Path component is a node in a tree. # It's the equivalent of a short file/directory name in a file system. # In our abstraction, it's represented as arbitrary bag of attributes TestPathComponent = ...
nilq/baby-python
python
#!/usr/bin/env python2 # 4DML Transformation Utility # # (C) 2002-2006 Silas S. Brown (University of Cambridge Computer Laboratory, # Cambridge, UK, http://ssb22.user.srcf.net ) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the Li...
nilq/baby-python
python
from click.testing import CliRunner from flag_slurper.cli import cli from flag_slurper.autolib.models import CredentialBag, Credential from flag_slurper.conf.project import Project def test_add_credentials(db): runner = CliRunner() result = runner.invoke(cli, ['creds', 'add', 'root', 'cdc']) assert resul...
nilq/baby-python
python
import os from dotenv import dotenv_values from algofi_amm.v0.client import AlgofiAMMTestnetClient from ..utils import compiledContract, Account from algofi_amm.v0.client import AlgofiAMMClient from algosdk.v2client.algod import AlgodClient from algosdk.future import transaction from random import randint def startup...
nilq/baby-python
python
import unittest import sys from gluon.globals import Request db = test_db #execfile("applications/Problematica/controllers/default.py", globals()) class TestClass(unittest.TestCase): # def setUp(self): #request = Request() # Use a clean Request object def test_search(self): output_id = [] ...
nilq/baby-python
python
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Adjacency List # Q4.1 - Route Between Nodes class AdjacencyList: def __init__(self, numOfNodes=None): if numOfNodes is not None and numOfNodes > 0: self.matrix = [[] for _ in range(numOfNodes)] self.numOfNodes = numOfNodes self.matrixVisited = [] self.s...
nilq/baby-python
python
#!python """Django's command-line utility for administrative tasks. This file was auto generated by the Django toolchain. Type python manage.py --help to see a list of available commands. """ import os import sys def main() -> None: """manage.py entry point.""" os.environ.setdefault('DJANGO_SETTINGS_MODULE',...
nilq/baby-python
python
#!/usr/bin/env python import TUI.Base.TestDispatcher testDispatcher = TUI.Base.TestDispatcher.TestDispatcher("sop", delay=1.5) tuiModel = testDispatcher.tuiModel dataList = ( "version=1.4", 'bypassNames=boss, ff_lamp, ffs, gcamera, hgcd_lamp, ne_lamp, uv_lamp, wht_lamp', 'bypassedNames=boss, ne_lamp, wht_...
nilq/baby-python
python
# Changes to this file by The Tavutil Authors are in the Public Domain. # See the Tavutil UNLICENSE file for details. #******************************************************************************\ #* Copyright (c) 2003-2004, Martin Blais #* All rights reserved. #* #* Redistribution and use in source and binary forms...
nilq/baby-python
python
import io import math from datetime import datetime, timedelta from typing import Dict, List, Optional, Tuple, Union import discord import matplotlib.pyplot as plt import pandas as pd import pytz from blossom_wrapper import BlossomAPI from dateutil import parser from discord import Embed, File from discord...
nilq/baby-python
python
# Copyright 2011 OpenStack Foundation # Copyright 2013 Rackspace Hosting # Copyright 2013 Hewlett-Packard Development Company, L.P. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a co...
nilq/baby-python
python
import types from . import base_objs as baseInitObjs import plato_fit_integrals.core.workflow_coordinator as wflowCoord class SurfaceEnergiesWorkFlow(wflowCoord.WorkFlowBase): def __init__(self, surfaceObj, bulkObj): self.surfObj = surfaceObj self.bulkObj = bulkObj self._ensureWorkFoldersAreTheSame() se...
nilq/baby-python
python
# -*- coding: utf-8 -*- """ celery cli services module. """ from pyrin.application.services import get_component from pyrin.task_queues.celery.cli import CeleryCLIPackage def register_cli_handler(instance, **options): """ registers a new celery cli handler or replaces the existing one. if `replace=True`...
nilq/baby-python
python
# -*- coding: utf-8 -*- # # This file is part of the pyFDA project hosted at https://github.com/chipmuenk/pyfda # # Copyright © pyFDA Project Contributors # Licensed under the terms of the MIT License # (see file LICENSE in root directory for details) """ Create a tabbed widget for all plot subwidgets in the list ``fb...
nilq/baby-python
python
''' * Capítulo 05: Pré-processamento 5.2 Histograma de Cores > Equalização de histograma ''' import cv2 from matplotlib import pyplot as grafico imagemOriginal = cv2.imread("maquina.jpg", 0) imagemEqualizada = cv2.equalizeHist(imagemOriginal) cv2.imshow("Imagem Original", imagemOriginal) cv...
nilq/baby-python
python
__author__ = 'lucabasa' __version__ = '1.1.0' __status__ = 'development' import numpy as np import pandas as pd import seaborn as sns import matplotlib.pyplot as plt from sklearn.model_selection import StratifiedKFold from sklearn.svm import SVC from sklearn.preprocessing import StandardScaler from sklearn.pipe...
nilq/baby-python
python
""" Simulates the initial state discrimination experiment using different methods, to compare the resulting error rates. """ import torch from perm_hmm.util import num_to_data from perm_hmm.postprocessing import ExactPostprocessor, EmpiricalPostprocessor from perm_hmm.classifiers.perm_classifier import PermClassifier...
nilq/baby-python
python
import json import pickle import pandas as pd from decimal import Decimal from django.db.models import Avg from recommender.models import Rating from scripts.recommenders.base_recommender import BaseRecommender class SVDRecommender(BaseRecommender): def __init__(self, save_path='./models/SVD/model/'): se...
nilq/baby-python
python
import ast from PythonVoiceCodingPlugin.library import nearest_node_from_offset,sorted_by_source_region,get_source_region,node_from_range,make_flat from PythonVoiceCodingPlugin.library.info import * from PythonVoiceCodingPlugin.library.LCA import LCA from PythonVoiceCodingPlugin.library.level_info import LevelVisitor ...
nilq/baby-python
python
def get_current_admin(): def decorator(func): setattr(func, 'get_current_admin', True) return func return decorator
nilq/baby-python
python
"""D-Bus interface for rauc.""" from enum import Enum import logging from typing import Optional from ..exceptions import DBusError, DBusInterfaceError from ..utils.gdbus import DBus from .interface import DBusInterface from .utils import dbus_connected _LOGGER: logging.Logger = logging.getLogger(__name__) DBUS_NAME...
nilq/baby-python
python
# # Copyright (c) 2015-2016 Wind River Systems, Inc. # # SPDX-License-Identifier: Apache-2.0 # from nfv_common import debug from nfv_vim.rpc._rpc_defs import RPC_MSG_RESULT from nfv_vim.rpc._rpc_defs import RPC_MSG_TYPE from nfv_vim.rpc._rpc_defs import RPC_MSG_VERSION from nfv_vim.rpc._rpc_message import RPCMessage ...
nilq/baby-python
python
#!/usr/bin/env python """Tests for util.py.""" import datetime import logging import os import sys import unittest # Fix up paths for running tests. sys.path.insert(0, "../src/") from pipeline import util from google.appengine.api import taskqueue class JsonSerializationTest(unittest.TestCase): """Test custom j...
nilq/baby-python
python
/home/runner/.cache/pip/pool/88/20/06/e25d76d7065f6488098440d13a701a2dc1acbe52cd8d7322b4405f3996
nilq/baby-python
python
#!/usr/bin/env python # -*- encoding: utf-8 -*- # Copyright (c) 2002-2019 "Neo4j," # Neo4j Sweden AB [http://neo4j.com] # # This file is part of Neo4j. # # 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 L...
nilq/baby-python
python
import ast import sys class EnvVisitor(ast.NodeVisitor): def __init__(self): self.optional_environment_variables = set() self.required_environment_variables = set() def parse_and_visit(self, body, filename=''): doc = ast.parse(body, filename=filename) return self.visit(doc) ...
nilq/baby-python
python
#!/usr/bin/python # __*__ coding: utf8 __*__ oneline = "Read, write and operate with models" #import os from model_base import model_base # -------------------------------------------------------------------- class Free_class: pass def bound(x, y): if x > y/2.: return x-y if x < -y/2. : return x+y return x #=...
nilq/baby-python
python
import configparser import datetime import os import time #import xml.etree.ElementTree as ET import lxml.etree as ET from io import StringIO, BytesIO from shutil import copyfile import requests from requests.auth import HTTPDigestAuth from subprocess import Popen print("Hikvision alert started") # CONFIGS START conf...
nilq/baby-python
python
from project import app if __name__ == "__main__": app.run(debug = True, host = "0.0.0.0")
nilq/baby-python
python
""" An emulation of the Window class, for injecting pane data into tests """ from tmux_session_utils.tmux_utils import ( inject_pane_data, WINDOW_ID_VARIABLE, WINDOW_LAYOUT_VARIABLE, ) class FakeWindow: """ Represents a window in a tmux session, for test injection """ def __init__(self, ...
nilq/baby-python
python
# -------------------------------------------------------------------------------------------- # 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
from app import app import sys, getopt, json def clear_file(file_name): with open(file_name, 'w') as filep: json.dump({}, filep) if __name__ == "__main__": try: opts, args = getopt.getopt(sys.argv, "c", ["clear"]) except getopt.GetoptError: print('python webapp.py [-c or --clear fo...
nilq/baby-python
python
import os import sys import time import random import string import argparse from collections import namedtuple import copy import torch import torch.backends.cudnn as cudnn import torch.nn.init as init import torch.optim as optim import torch.utils.data from torch import autograd import torch.multiprocessing as mp im...
nilq/baby-python
python
import logging from huobi.connection.impl.websocket_watchdog import WebSocketWatchDog from huobi.connection.impl.websocket_manage import WebsocketManage from huobi.connection.impl.websocket_request import WebsocketRequest from huobi.constant.system import WebSocketDefine, ApiVersion class SubscribeClient(object): ...
nilq/baby-python
python
import numpy as np from seisflows.tools import unix from seisflows.tools.array import loadnpy, savenpy from seisflows.tools.code import exists from seisflows.tools.config import SeisflowsParameters, SeisflowsPaths, \ loadclass, ParameterError PAR = SeisflowsParameters() PATH = SeisflowsPaths() import solver imp...
nilq/baby-python
python
from jsonobject import JsonObject from taxjar.data.float_property import TaxJarFloatProperty class TaxJarBreakdownLineItem(JsonObject): # NB: can return either string or integer # `id` is a valid property, but isn't enforced here # id = StringProperty() taxable_amount = TaxJarFloatProperty() tax_c...
nilq/baby-python
python
import abjad import consort from abjad.tools import durationtools from abjad.tools import rhythmmakertools from abjad.tools import systemtools from abjad.tools import templatetools from abjad.tools import timespantools layer = 1 score_template = templatetools.StringOrchestraScoreTemplate( violin_count=2, viola...
nilq/baby-python
python
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2015-2018 CERN. # # Invenio is free software; you can redistribute it and/or modify it # under the terms of the MIT License; see LICENSE file for more details. """Error module tests.""" from __future__ import absolute_import, print_function im...
nilq/baby-python
python