content
stringlengths
0
1.05M
origin
stringclasses
2 values
type
stringclasses
2 values
# Copyright (c) 2013 Shotgun Software Inc. # # CONFIDENTIAL AND PROPRIETARY # # This work is provided "AS IS" and subject to the Shotgun Pipeline Toolkit # Source Code License included in this distribution package. See LICENSE. # By accessing, using, copying or modifying this work you indicate your # agreement to the S...
nilq/baby-python
python
#!/usr/bin/env python import scapy.all as scapy from mac_vendor_lookup import MacLookup #for printing arguments help and available options for users import optparse # for coloring the terminal from termcolor import cprint, colored import subprocess import socket # For detecting the OS the script is w...
nilq/baby-python
python
import os import numpy as np # Precursor charges and m/z's considered. mz_interval = 1 charges, mzs = (2, 3), np.arange(50, 2501, mz_interval) # Spectrum preprocessing. min_peaks = 5 min_mz_range = 250. min_mz, max_mz = 101., 1500. remove_precursor_tolerance = 0.5 min_intensity = 0.01 max_peaks_used = 50 scaling = ...
nilq/baby-python
python
from discord.ext import commands import discord import pymongo from codecs import open from cogs.utils import Defaults, Checks, OsuUtils class Vote(commands.Cog): def __init__(self, bot): self.bot = bot self.db_users = pymongo.MongoClient(bot.database)['osu-top-players-voting']['users'] @Ch...
nilq/baby-python
python
from unittest import TestCase import pytest from hubblestack.audit import util from collections import defaultdict from hubblestack.exceptions import ArgumentValueError, HubbleCheckValidationError class TestProcess(): """ Class used to test the functions in ``process.py`` """ def test__compare_raise...
nilq/baby-python
python
import numpy as np def digest_indices(indices): if type(indices)==str: if indices in ['all', 'All', 'ALL']: indices = 'all' else: raise ValueError() elif type(indices) in [int, np.int64, np.int]: indices = np.array([indices], dtype='int64') elif hasattr(indi...
nilq/baby-python
python
# -*- coding: utf-8 -*- # Copyright (c) 2012 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. """Unittests for SDK stages.""" from __future__ import print_function import json import os import unittest import six fro...
nilq/baby-python
python
from app.core.exceptions import BaseException class ValidationError(BaseException): def __init__(self, error_message): self.error_message = error_message super(BaseException, self).__init__(error_message) class AuthenticationError(BaseException): def __init__(self, error_message): se...
nilq/baby-python
python
#!/usr/bin/env python # Django environment setup: from django.conf import settings, global_settings as default_settings from django.core.management import call_command from os.path import dirname, realpath, join import sys # Detect location and available modules module_root = dirname(realpath(__file__)) # Inline set...
nilq/baby-python
python
#!/usr/bin/env python # -*- coding: utf-8 -*- """ :Mod: test_async :Synopsis: :Author: servilla :Created: 4/22/21 """ import asyncio from datetime import datetime import re from typing import List import daiquiri import pendulum from soh.config import Config import soh.asserts.server from soh.server.serve...
nilq/baby-python
python
# Calculates heatwaves using Nairn's methodology # Nairn et al. (2009). Defining and predicting Excessive Heat events, a National System import numpy as np # Defines runing mean functions: def moving_average_3(x, N=3): return np.convolve(x, np.ones((N,))/N)[(N-1):] def moving_average_30(x, N=30): return np...
nilq/baby-python
python
#!/usr/bin/env python2.7 import os def system_dependency(name): print "installing system dependency {}".format(name) os.system('sudo apt-get install %s' % name) print "done!"
nilq/baby-python
python
import sys import os import shutil import re import glob import struct import math import collections import argparse import csv from lib import csv_classes fpath=os.path.realpath(__file__) py_path=os.path.dirname(fpath) endian = "little" pack_int = '<i' INT_BYTES=4 STR_BYTES=20 def parseError(error_string, line, i...
nilq/baby-python
python
# -*- coding: utf-8 -*- """ Import Modules Configure the Database Instantiate Classes """ if settings.get_L10n_languages_readonly(): # Make the Language files read-only for improved performance T.is_writable = False get_vars = request.get_vars # Are we running in debug mode? settings.check_debug...
nilq/baby-python
python
from __future__ import annotations import numpy as np from nn_recipe.NN.ActivationFunctions.__factory import ActivationFunctionFactory from nn_recipe.NN.Layers.__layer import Layer from nn_recipe.NN.__function import Function class Linear(Layer): """ This Class represents a Linear Layer (Dense - Fully connec...
nilq/baby-python
python
{ 'targets': [ { 'target_name': 'binding', 'includes': [ 'deps/snappy/common.gypi' ], 'include_dirs': [ '<!(node -e "require(\'nan\')")', 'deps/snappy/<(os_include)' ], 'dependencies': [ 'deps/snappy/snappy.gyp:snappy' ], 'sources': [ 'src/binding.cc' ] } ] }
nilq/baby-python
python
import numpy as np import math import matplotlib.pyplot as plt from sklearn import metrics import argparse from functools import partial def distance_from_unif(samples, test='ks'): sorted_samples = np.sort(samples, axis=1) try: assert (np.greater_equal(sorted_samples, 0)).all(), np.min(sorted_samples) ...
nilq/baby-python
python
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.constant.ParamConstants import * class AlipayUserElectronicidUserbarcodeCreateModel(object): def __init__(self): self._cert_id = None self._expire_time = None @property def cert_id(self): return self._...
nilq/baby-python
python
# coding=utf-8 import time, json, io, datetime, argparse item_type = ('EVENT', 'INFO', 'AD') categories = ('pregon', 'music', 'food', 'sport', 'art', 'fire', 'band') places = { 'Alameda':(41.903501, -8.866704), 'Auditorio de San Bieito':(41.899915, -8.873203), 'A Cruzada':(41.897817, -8.874520), 'As...
nilq/baby-python
python
raise NotImplementedError("ast is not yet implemented in Skulpt")
nilq/baby-python
python
import pylab as PL x0 = 0.1 samplingStartTime = 1000 sampleNumber = 100 resultA = [] resultX = [] r = 0 da = 0.005 def f(x): return r * x * (1 - x) while r <= 4.0: x = x0 for t in range(samplingStartTime): x = f(x) for t in range(sampleNumber): x = f(x) resultA.append(r) ...
nilq/baby-python
python
from django.http import HttpResponse, HttpResponseRedirect, Http404 from django.template import RequestContext from django.shortcuts import render_to_response, get_object_or_404 from django.core.urlresolvers import reverse from django.core.context_processors import csrf from django.views.decorators.csrf import csrf_pro...
nilq/baby-python
python
import numpy as np import pandas as pd from EstimatorSpectrum import TSVD from Generator import LSW from SVD import LordWillisSpektor from test_functions import kernel_transformed, BIMODAL, BETA, SMLA, SMLB replications = 10 size = [2000, 10000, 1000000] max_size = 100 functions = [BETA] functions_name = ['BETA'] tau...
nilq/baby-python
python
# Futu Algo: Algorithmic High-Frequency Trading Framework # Copyright (c) billpwchan - All Rights Reserved # Unauthorized copying of this file, via any medium is strictly prohibited # Proprietary and confidential # Written by Bill Chan <billpwchan@hotmail.com>, 2021 import argparse import importlib from multipro...
nilq/baby-python
python
def binarySearch(array,l,r,x): while l <=r: mid = l + (r-1)//2 if array[mid] == x: return mid elif array[mid] > x: r = mid-1 else: l = mid +1 return -1 array = [2,4,5,6,7,9,10,23,53] item = 23 result = binarySearch(array, 0, len(array)-1...
nilq/baby-python
python
__title__ = "playground" __author__ = "murlux" __copyright__ = "Copyright 2019, " + __author__ __credits__ = (__author__, ) __license__ = "MIT" __email__ = "murlux@protonmail.com" from logging import Logger from typing import Dict from playground.util import setup_logger class SimulationIntegrator: """ Main ...
nilq/baby-python
python
# (C) British Crown Copyright 2011 - 2018, Met Office # # This file is part of cartopy. # # cartopy is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by the # Free Software Foundation, either version 3 of the License, or # (at your option)...
nilq/baby-python
python
import gym from garage.baselines import LinearFeatureBaseline from garage.theano.baselines import GaussianMLPBaseline from garage.baselines import ZeroBaseline from garage.envs import normalize from garage.envs.box2d import CartpoleEnv from garage.envs.mujoco import SwimmerEnv from garage.theano.algos.capg_corrected im...
nilq/baby-python
python
#!/usr/bin/env python3 import os import sys import glob import shutil import subprocess from re import search def remove_dir(dir_path): try: if os.path.isdir(dir_path): shutil.rmtree(dir_path) except OSError as e: print("Failed removing {}: {}".format(dir_path, e)) else: ...
nilq/baby-python
python
import argparse __all__ = ('arg_parser') arg_parser = argparse.ArgumentParser(description='Converts JSON files to HTML files') arg_parser.add_argument('source', type=str, action='store', help='Source JSON file') arg_parser.add_argument('--dest', type=str, action='store', help='Output HTML filename', default=None, des...
nilq/baby-python
python
import pickle import json import argparse import string import os from zhon import hanzi from collections import namedtuple import nltk def makedir(root): if not os.path.exists(root): os.makedirs(root) def write_json(data, root): with open(root, 'w') as f: json.dump(data, f) ImageMetaData...
nilq/baby-python
python
jobname="manuscript"
nilq/baby-python
python
from rest_framework.response import Response from rest_framework.views import status def validate_request_data_photo(fn): def decorated(*args, **kwargs): title = args[0].request.data.get("title", "") photo = args[0].request.data.get("photo", "") if not title or not photo: retur...
nilq/baby-python
python
"""Test the houdini_package_runner.discoverers.package module.""" # ============================================================================= # IMPORTS # ============================================================================= # Standard Library import argparse import pathlib # Third Party import pytest # ...
nilq/baby-python
python
# -*- coding: utf-8 -*- # Author: Óscar Nájera # License: 3-clause BSD r""" Test Sphinx-Gallery """ from __future__ import (division, absolute_import, print_function, unicode_literals) import codecs from contextlib import contextmanager from io import StringIO import os import sys import re imp...
nilq/baby-python
python
from .ish_report_test import ish_report_test from .ish_parser_test import ish_parser_test from .ComponentTest import SnowDepthComponentTest, SkyCoverComponentTest, SolarIrradianceComponentTest from .ComponentTest import SkyConditionObservationComponentTest, SkyCoverSummationComponentTest from .Humidity_test import Humi...
nilq/baby-python
python
from skidl import SKIDL, TEMPLATE, Part, Pin, SchLib SKIDL_lib_version = '0.0.1' RFSolutions = SchLib(tool=SKIDL).add_parts(*[ Part(name='ZETA-433-SO',dest=TEMPLATE,tool=SKIDL,keywords='RF TRANSCEIVER MODULE',description='FM ZETA TRANSCEIVER MODULE, OPTIMISED FOR 433MHZ',ref_prefix='U',num_units=1,do_erc=True...
nilq/baby-python
python
#!/usr/bin/env python3 from serial import Serial import bitarray import time ser = Serial('/dev/ttyUSB0', 115200) for i in range(1,100): for a in range(0,16): ser.write(b'\xcc') ser.write((1<<a).to_bytes(2, byteorder='big')) #ser.write(b.to_bytes(1, byteorder='big')) ser.write(b'\...
nilq/baby-python
python
from aws_cdk import core, aws_events as events, aws_events_targets as targets from multacdkrecipies.common import base_alarm, base_lambda_function from multacdkrecipies.recipies.utils import CLOUDWATCH_CONFIG_SCHEMA, validate_configuration class AwsCloudwatchLambdaPipes(core.Construct): """ AWS CDK Construct ...
nilq/baby-python
python
from serial import * from tkinter import * import tkinter.ttk as ttk import serial import serial.tools.list_ports import threading # for parallel computing class myThread(threading.Thread): def __init__(self, name,ser): threading.Thread.__init__(self) self.name = name self...
nilq/baby-python
python
"""Unit tests for nautobot_ssot_ipfabric plugin."""
nilq/baby-python
python
import torch import torch.nn as nn import torch.nn.functional as F class Cnn1d(nn.Module): def __init__(self, *, nx, nt, cnnSize=32, cp1=(64, 3, 2), cp2=(128, 5, 2)): super(Cnn1d, self).__init__() self.nx = nx self.nt = nt cOut, f, p = cp1 self.conv1 = nn.Conv1d(nx, cOut, f...
nilq/baby-python
python
import sys try: from sp.base import Logging except Exception as e: print "couldn't load splib" sys.exit(1)
nilq/baby-python
python
import configparser import os basedir = os.path.abspath(os.path.dirname(__file__)) config = configparser.ConfigParser() config.read("txdispatch.conf") SECRET_KEY = config.get("app", "secret_key") VERSION = config.get("app", "version") SERVICES = { "http": {}, "sockets": {}, "websockets": {} } for service,...
nilq/baby-python
python
import re import json import requests from Bio import SeqIO from Bio.Seq import Seq from pathlib import Path from tqdm.notebook import trange from Bio.SeqRecord import SeqRecord from function.utilities import fasta_to_seqlist from function.utilities import find_human_sequence def uniprot_id_consistance_check(fasta_p...
nilq/baby-python
python
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
nilq/baby-python
python
import pydantic as _pydantic class CreditWalletConversion(_pydantic.BaseModel): credit_wallet_type: str rate: float currency_code: str class Config: orm_mode = True
nilq/baby-python
python
#!/usr/bin/env python #----------------------------------------------------------------------- # # Core video, sound and interpreter loop for Gigatron TTL microcomputer # - 6.25MHz clock # - Rendering 160x120 pixels at 6.25MHz with flexible videoline programming # - Must stay above 31 kHz horizontal sync --> 200 cy...
nilq/baby-python
python
from typing import Any, Sequence, Tuple, List, Callable, cast, TYPE_CHECKING from argparse import ArgumentParser as OriginalAP from argparse import Namespace as OriginalNS from .namespace import Namespace if TYPE_CHECKING: from hiargparse.args_providers import ArgsProvider class ArgumentParser(OriginalAP): "...
nilq/baby-python
python
from hytra.pluginsystem import feature_serializer_plugin from libdvid import DVIDNodeService try: import json_tricks as json except ImportError: import json class DvidFeatureSerializer(feature_serializer_plugin.FeatureSerializerPlugin): """ serializes features to dvid """ keyvalue_store = "f...
nilq/baby-python
python
import sys from PySide6.QtCore import QCoreApplication from PySide6.QtWidgets import QApplication from folder_watcher import FolderWatcher from main_dialog import MainDialog if __name__ == "__main__": # QCoreApplication.setOrganizationName("DiPaolo Company") QCoreApplication.setOrganizationDomain("dipaolo.co...
nilq/baby-python
python
from peewee import SqliteDatabase db = SqliteDatabase(None)
nilq/baby-python
python
import socket target_host = socket.gethostname() target_port = 9999 client = socket.socket(socket.AF_INET, socket.SOCK_STREAM) client.connect((target_host, target_port)) client.send(b'Hello World!!') response = client.recv(4096) client.close() print(response.decode())
nilq/baby-python
python
# coding: utf-8 """ AVACloud API 1.17.3 AVACloud API specification # noqa: E501 OpenAPI spec version: 1.17.3 Generated by: https://github.com/swagger-api/swagger-codegen.git """ import pprint import re # noqa: F401 import six class ExecutionDescriptionDto(object): """NOTE: This class ...
nilq/baby-python
python
"""STACS Exceptions. SPDX-License-Identifier: BSD-3-Clause """ class STACSException(Exception): """The most generic form of exception raised by STACS.""" class FileAccessException(STACSException): """Indicates an error occured while attempting to access a file.""" class InvalidFileException(STACSExceptio...
nilq/baby-python
python
import unittest from andes.utils.paths import list_cases import andes import os class TestPaths(unittest.TestCase): def setUp(self) -> None: self.kundur = 'kundur/' self.matpower = 'matpower/' self.ieee14 = andes.get_case("ieee14/ieee14.raw") def test_tree(self): list_cases(se...
nilq/baby-python
python
from sqlalchemy import Boolean, Column, ForeignKey, Integer, String, JSON from sqlalchemy.orm import relationship from open_needs_server.database import Base class DomainModel(Base): __tablename__ = "domains" def __repr__(self) -> str: return f"[{self.id}]{self.title}" id = Column(Integer, prim...
nilq/baby-python
python
# -*- coding: utf-8 -*- #!/usr/bin/env python """ @author: Noah Norman n@hardwork.party """ import json def load_file(): with open('data.json') as data_file: return json.load(data_file) def verbose(): return DATA['verbose'] def fade_in(): return DATA['switch_on_fadein'] def fade_out(): retu...
nilq/baby-python
python
from __future__ import absolute_import import random def RandomService(services): if len(services) == 0: return None index = random.randint(0, len(services) - 1) return services[index]
nilq/baby-python
python
import requests import sys from firecares.firestation.models import FireDepartment from django.core.management.base import BaseCommand from optparse import make_option def chunks(l, n): for i in xrange(0, len(l), n): yield l[i:i + n] class Command(BaseCommand): help = 'Verifies that the thumbnails f...
nilq/baby-python
python
# -*- coding: utf-8 -*- ''' :file: utils.py :author: -Farmer :url: https://blog.farmer233.top :date: 2021/09/04 23:45:40 ''' class ObjectDict(dict): """:copyright: (c) 2014 by messense. Makes a dictionary behave like an object, with attribute-style access. """ def __getattr__(self, key...
nilq/baby-python
python
import subprocess import sys class ProcessManager(object): """ Implements a manager for process to be executed in the environment. """ def __init__( self, command, working_directory, environment_variables, ): """ Initializes the mana...
nilq/baby-python
python
#! /usr/bin/env python # # Copyright (c) 2011-2012 Bryce Adelstein-Lelbach # # SPDX-License-Identifier: BSL-1.0 # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) # TODO: Rename to jobs? # TODO: More typechecking? # TOD...
nilq/baby-python
python
import unittest from unittest.mock import patch, MagicMock from requests import Response from pylaunch.dial import Dial class TestDial(unittest.TestCase): @patch("pylaunch.core.requests.get") def setUp(self, response): with open("tests/xml/dd.xml") as f: response.return_value = MagicMock...
nilq/baby-python
python
import frappe from frappe.utils import data from frappe.utils import cstr, add_days, date_diff, getdate from frappe.utils import format_date @frappe.whitelist() def get_cl_count(from_date,to_date): dates = get_dates(from_date,to_date) data = "" for date in dates: contractors = frappe.get_all('Contr...
nilq/baby-python
python
import os import sys import argparse import torch sys.path.append(os.getcwd()) import pickle import src.data.data as data import src.data.config as cfg import src.interactive.functions as interactive #!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT...
nilq/baby-python
python
import numpy as np import pandas as pd import seaborn as sns import matplotlib.pyplot as plt import sklearn from sklearn import preprocessing def readdate(name): df = pd.read_csv('gene_mutation.txt', sep=',', header=None) return df if __name__ == "__main__": df=readdate('gene_mutation.txt') del df[0] t2...
nilq/baby-python
python
import numpy as np import pax import torchvision IMAGENET_MEAN = np.array((0.485, 0.456, 0.406)) IMAGENET_STD = np.array((0.229, 0.224, 0.225)) def convert_conv(conv, name=None): """Return a pax.Conv2D module with weights from pretrained ``conv``.""" weight = conv.weight.data.contiguous().permute(2, 3, 1, 0)...
nilq/baby-python
python
import tensorflow as tf from transformers import TFDistilBertForQuestionAnswering model = TFDistilBertForQuestionAnswering.from_pretrained('distilbert-base-uncased-distilled-squad') input_spec = tf.TensorSpec([1, 384], tf.int32) model._set_inputs(input_spec, training=False) # For tensorflow>2.2.0, set inputs in the...
nilq/baby-python
python
"""Library for the ingress relation. This library contains the Requires and Provides classes for handling the ingress interface. Import `IngressRequires` in your charm, with two required options: - "self" (the charm itself) - config_dict `config_dict` accepts the following keys: - service-hostname (requi...
nilq/baby-python
python
import nltk import re import shutil import os from urllib.parse import urlparse from coalib.bears.GlobalBear import GlobalBear from dependency_management.requirements.PipRequirement import PipRequirement from coala_utils.ContextManagers import change_directory from coalib.misc.Shell import run_shell_command from coali...
nilq/baby-python
python
import dnslib.server import dnslib import time import binascii import struct NAME_LIMIT_HARD = 63 A = ord("A") Z = ord("Z") a = ord("a") z = ord("z") ZERO = ord("0") FIVE = ord("5") ir1 = lambda c: c <= Z and c >= A ir2 = lambda c: c <= z and c >= a ir3 = lambda c: c <= FIVE and c >= ZERO BASE32_SRC = b"abcdefghijk...
nilq/baby-python
python
# Generated by Django 3.1.11 on 2021-05-20 12:58 from django.conf import settings import django.core.validators from django.db import migrations, models import django.db.models.deletion import server.utils.model_fields class Migration(migrations.Migration): initial = True dependencies = [ migration...
nilq/baby-python
python
from distutils.command.install import install as install_orig from distutils.errors import DistutilsExecError from setuptools import setup class install(install_orig): def run(self): try: self.spawn(['make', 'install']) except DistutilsExecError: self.warn('listing directo...
nilq/baby-python
python
# # Copyright 2017 CNIT - Consorzio Nazionale Interuniversitario per le Telecomunicazioni # # 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/LICE...
nilq/baby-python
python
from urllib.request import ssl, socket from datetime import date, datetime import pytz def cert_validate_date(hostname, port = 443)->datetime: """ Validate the certificate expiration date """ with socket.create_connection((hostname, port)) as sock: context = ssl.create_default_context() ...
nilq/baby-python
python
import asyncio import dataset import discord DATABASE = dataset.connect('sqlite:///data/bot/higgsbot.db') class Token: def __init__(self): self.table = DATABASE['balance'] async def start(self, bot): for member in bot.get_all_members(): id = member.id if self.table...
nilq/baby-python
python
# Generated by Django 3.1.6 on 2021-02-10 08:08 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('app', '0002_transaction_wallet'), ] operations = [ migrations.AlterModelOptions( name='transaction', options={'ordering': ['...
nilq/baby-python
python
"""commands for register dummy events""" import click from autobahn.asyncio.wamp import ApplicationRunner from playground.racelog.caller import CallEndpoint @click.command("delete") @click.argument("eventId", type=click.INT) @click.pass_obj def delete(obj,eventid): """delete event including data. The event i...
nilq/baby-python
python
from featuretools.primitives import AggregationPrimitive from tsfresh.feature_extraction.feature_calculators import sum_of_reoccurring_values from woodwork.column_schema import ColumnSchema class SumOfReoccurringValues(AggregationPrimitive): """Returns the sum of all values, that are present in the time series mo...
nilq/baby-python
python
import asyncio import datetime import unittest from unittest import mock from aiohttp import hdrs from aiohttp.multidict import CIMultiDict from aiohttp.web import ContentCoding, Request, StreamResponse, Response from aiohttp.protocol import HttpVersion, HttpVersion11, HttpVersion10 from aiohttp.protocol import RawRequ...
nilq/baby-python
python
from sqlalchemy.ext.declarative import declarative_base Base = declarative_base() Base.__table_args__ = { "mysql_charset": "utf8", "mysql_collate": "utf8_general_ci", }
nilq/baby-python
python
import numpy as np import tensorflow as tf from tensorflow.keras.models import Model from tensorflow.keras.layers import * from tensorflow.keras.preprocessing import sequence from tf2bert.text.tokenizers import Tokenizer from tf2bert.text.labels import TaggingTokenizer from tf2bert.text.labels import find_entities_chun...
nilq/baby-python
python
""" Tester. """ # --------------------------------------------------------------------------- # Imports # --------------------------------------------------------------------------- from grizzled.misc import ReadOnly, ReadOnlyObjectError import pytest class Something(object): def __init__(self, a=1, b=2): ...
nilq/baby-python
python
import configparser import os from discord.ext import commands import requests COMMAND_PREFIX = '!track ' ACGN_LIST_HELP = 'Lists all tracked acgn data.' ACGN_SEARCH_HELP = ''' Searches acgns in the database. Lists acgns with title that (partially) matches <title>. Args: title: A string. ''' ACGN_ADD_HELP = ''' ...
nilq/baby-python
python
# coding: utf-8 import magic from django import forms from django.conf import settings from django.core.exceptions import ValidationError from django.utils.html import escape, format_html from django.utils.translation import ugettext_lazy as _ from trojsten.submit import constants from trojsten.submit.helpers import g...
nilq/baby-python
python
# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack.package import * class RAnnotationdbi(RPackage): """Manipulation of SQLite-based annotations in Bioconduc...
nilq/baby-python
python
var = 5 a = f"Test: {var:d}" # cool formatting!
nilq/baby-python
python
# -*- coding: utf-8 -*- """Dialogo para selecionar pastas.""" from os import listdir from pathlib import Path import gi gi.require_version(namespace='Gtk', version='3.0') from gi.repository import Gtk class MainWindow(Gtk.ApplicationWindow): def __init__(self): super().__init__() self.set_title...
nilq/baby-python
python
# Taku Ito # 2/22/2019 # General function modules for SRActFlow # For group-level/cross-subject analyses import numpy as np import multiprocessing as mp import scipy.stats as stats import nibabel as nib import statsmodels.api as sm import sklearn import h5py import os os.sys.path.append('glmScripts/') import taskGLMPi...
nilq/baby-python
python
# Copyright (c) 2020, Xilinx # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this # list of conditions and the follow...
nilq/baby-python
python
# Create an Excel file and save data from # show version command using pandas # (Implicitly uses xlsxwriter to create the Excel file) import pandas as pd from pandas import ExcelWriter from netmiko import ConnectHandler # Devices to SSH into devices = [ { "device_type": "cisco_ios", "ip": "sandbo...
nilq/baby-python
python
from pathlib import Path from jina.peapods import Pod import pytest from fastapi import UploadFile from jina.flow import Flow from jina.enums import PodRoleType from jina.peapods.pods import BasePod from jina.parsers import set_pea_parser, set_pod_parser from jinad.models import SinglePodModel from jinad.store impor...
nilq/baby-python
python
import sys sys.path.append('../') import TankModel as TM import pylab as pl import pandas as pd pl.style.use('seaborn') import numpy as np def main(): data = pd.read_csv('../sample_data/tank_sample_data.csv') rf = data['Pr'].values et = data['ET'].values obsQ = data['Q'].values area = 2000 ...
nilq/baby-python
python
# -*- coding: utf-8 -*- # Generated by Django 1.11.1 on 2017-11-30 20:34 from __future__ import unicode_literals from django.db import migrations def forward(apps, schema_editor): db_alias = schema_editor.connection.alias Message = apps.get_model("mailing", "Message") MessageAuthor = apps.get_model("mail...
nilq/baby-python
python
# Generated by Django 3.1.4 on 2020-12-12 22:28 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('app', '0003_auto_20201212_2213'), ] operations = [ migrations.AlterField( model_name='agent', name='file', ...
nilq/baby-python
python
for _ in range(int(input())): k, n = int(input()), int(input()) c = [list(range(1, n+1))] for row in range(1, k+1): c.append([sum(c[row-1][:column]) for column in range(1, n+1)]) print(c[k][n-1])
nilq/baby-python
python
def get_add(n): def add(x): return x + n return add myadd = get_add(1) assert 2 == myadd(1) def foo(): x = 1 def bar(y): def baz(): z = 1 return x + y + z return baz return bar(1) assert 3 == foo()() def change(): x = 1 def bar(): ...
nilq/baby-python
python
def recurse(s, t, i, j, s1, t1): # print(i, s[i], j, t[j], s1, t1) if i == len(s) and j == len(t): print(''.join(s1)) print(''.join(t1)) print() return if i < len(s): recurse(s, t, i+1, j, s1 + [s[i]], t1 + ['-']) if j < len(t): recurse(s, t, i, j+1, s1 + ...
nilq/baby-python
python
import wx from views.views_manager import * class MainApp(wx.App): def __init__(self): wx.App.__init__(self) # Initial the main window self.views_manager = ViewsManager() self.views_manager.main_window.Show() self.main_window = self.views_manager.get_window("MainWindow") ...
nilq/baby-python
python