content
stringlengths
0
1.05M
origin
stringclasses
2 values
type
stringclasses
2 values
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright (c) 2018-2021 Wind River Systems, Inc. # # SPDX-License-Identifier: Apache-2.0 # # All Rights Reserved. # """ System Inventory Kubernetes Application Operator.""" import copy import docker from eventlet.green import subprocess import glob import grp import fun...
nilq/baby-python
python
"""Functions for parsing the measurement data files""" import yaml import pkgutil from flavio.classes import Measurement, Observable from flavio._parse_errors import constraints_from_string, errors_from_string from flavio.statistics import probability import numpy as np from math import sqrt import warnings def _load...
nilq/baby-python
python
# Generated by Django 2.2.13 on 2020-07-15 13:18 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("licenses", "0002_import_license_data"), ] operations = [ migrations.AlterModelOptions( name="legalcode", options={"...
nilq/baby-python
python
from django.shortcuts import render from django.http import HttpResponse, HttpResponseRedirect from .forms import CreateNewEvent, CreateNewParticipant from .models import Event,Attendee from .utils import check_event,generate_event_url, get_event_by_url from creator.tasks import generate_certificates def is_logged_in...
nilq/baby-python
python
import os import numpy as np from typing import Any, Dict import torch from torch.utils.data import Dataset from core.utils.others.image_helper import read_image class CILRSDataset(Dataset): def __init__(self, root_dir: str, transform: bool = False, preloads: str = None) -> None: self._root_dir = root_d...
nilq/baby-python
python
# -*- coding: utf-8 -*- """ Contains RabbitMQ Consumer class Use under MIT License """ __author__ = 'G_T_Y' __license__ = 'MIT' __version__ = '1.0.0' import pika from . import settings from .exceptions import RabbitmqConnectionError class Publisher: """Used to publish messages on response queue""" def _...
nilq/baby-python
python
from .jira.client import JiraClient from .gitlab.client import GitLabClientWrapper as GitLabClient
nilq/baby-python
python
import sys sys.path.append("../src") import numpy as np import seaborn as sns from scipy.stats import pearsonr from scipy.special import binom import matplotlib.pyplot as plt from matplotlib import gridspec from mpl_toolkits.axes_grid1.inset_locator import inset_axes import gnk_model import C_calculation import utils ...
nilq/baby-python
python
# ---------------------------------------------------------------------------- # Copyright (c) 2016-2021, QIIME 2 development team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file LICENSE, distributed with this software. # ------------------------------------------------...
nilq/baby-python
python
#!/usr/bin/python3 # -*- coding: utf-8 -*- # Copyright (c) The Lab of Professor Weiwei Lin (linww@scut.edu.cn), # School of Computer Science and Engineering, South China University of Technology. # A-Tune is licensed under the Mulan PSL v2. # You can use this software according to the terms and conditions of the Mulan ...
nilq/baby-python
python
import os from aws_cdk import ( core, aws_ec2 as ec2, aws_cloudformation as cloudformation, aws_elasticache as elasticache, ) class ElastiCacheStack(cloudformation.NestedStack): def __init__(self, scope: core.Construct, id: str, **kwargs): super().__init__(scope, id, **kwargs) se...
nilq/baby-python
python
import numpy as np from .base import BaseLoop from .utils import EarlyStopping class BaseTrainerLoop(BaseLoop): def __init__(self, model, optimizer, **kwargs): super().__init__() self.model = model self.optimizer = optimizer ## kwargs assignations self.patience = kwargs.g...
nilq/baby-python
python
# Multiple 1D fibers (monodomain), biceps geometry # This is similar to the fibers_emg example, but without EMG. # To see all available arguments, execute: ./multiple_fibers settings_multiple_fibers_cubes_partitioning.py -help # # if fiber_file=cuboid.bin, it uses a small cuboid test example (Contrary to the "cuboid" e...
nilq/baby-python
python
import random from io import StringIO import matplotlib.pyplot as plt import numpy as np import pandas as pd import seaborn as sns sns.set_style("darkgrid") def str_convert_float(df): columns = df.select_dtypes(exclude="number").columns for col_name in columns: unique_values = df[col_name].unique() ...
nilq/baby-python
python
# Copyright 2013, Mirantis 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 agre...
nilq/baby-python
python
import json from pyramid.view import view_config @view_config(route_name='home') def home(request): # https://docs.pylonsproject.org/projects/pyramid/en/latest/api/request.html # Response response = request.response response.content_type = 'application/json' response.status_code = 200 # body ...
nilq/baby-python
python
#!/usr/bin/env python # -*- coding: utf8 -*- def btcSupplyAtBlock(b): if b >= 33 * 210000: return 20999999.9769 else: reward = 50e8 supply = 0 y = 210000 # reward changes all y blocks while b > y - 1: supply = supply + y * reward reward = int(re...
nilq/baby-python
python
import sys,os import gdal from gdalconst import * # Get georeferencing information from a raster file and print to text file src = sys.argv[1] fname_out = sys.argv[2] ds = gdal.Open(src, GA_ReadOnly) if ds is None: print('Content-Type: text/html\n') print('Could not open ' + src) sys.exit(1) # Get the g...
nilq/baby-python
python
""" Base functions and classes for linked/joined operations. """ from typing import Mapping, Callable, Union, MutableMapping, Any import operator from inspect import signature from functools import partialmethod EmptyMappingFactory = Union[MutableMapping, Callable[[], MutableMapping]] BinaryOp = Callable[[Any, Any], ...
nilq/baby-python
python
import os import re import boto3 s3 = boto3.resource('s3') s3_client = boto3.client('s3') def maybe_makedirs(path, exist_ok=True): """Don't mkdir if it's a path on S3""" if path.startswith('s3://'): return os.makedirs(path, exist_ok=exist_ok) def smart_ls(path): """Get a list of files fro...
nilq/baby-python
python
from sqlalchemy import Column, TIMESTAMP, Float, Integer, ForeignKey, String from sqlalchemy.ext.declarative import declarative_base, DeclarativeMeta, declared_attr '''SQLAlchemy models used for representing the database schema as Python objects''' Base: DeclarativeMeta = declarative_base() class Watered(Base): ...
nilq/baby-python
python
import math from .settings import pi, PI_HALF, nearly_eq from .point import Point from .basic import GeometryEntity class LinearEntity(GeometryEntity): def __new__(cls, p1, p2=None, **kwargs): if p1 == p2: raise ValueError( "%s.__new__ requires two unique Points." % cls.__nam...
nilq/baby-python
python
''' This program reads the message data from an OVI backup file (sqlite) create for a NOKIA N95 phone and writes them formated as XML to stdout. The backup file is usually located in: C:\Users\<user>\AppData\Local\Nokia\Nokia Suite/ \ Messages/Database/msg_db.sqlite Note: the exported ...
nilq/baby-python
python
import torch.nn as nn import math class BasicBlock(nn.Module): expansion = 1 def __init__(self, in_channels, out_channels, stride=1): super().__init__() self.residual_function = nn.Sequential( nn.Conv2d(in_channels, out_channels, kernel_size=3, stride=stride, padding=1, bias=False)...
nilq/baby-python
python
import unittest from parameterized import parameterized as p from solns.karatsubaMultiply.karatsubaMultiply import * class UnitTest_KaratsubaMultiply(unittest.TestCase): @p.expand([ [3141592653589793238462643383279502884197169399375105820974944592, 2718281828459045235360287471352662497757247093699...
nilq/baby-python
python
média = 0 idademaisvelho = 0 nomemaisvelho = '' totmulher20 = 0 for p in range(1, 5): print('-' * 10, '{}ª PESSOA'.format(p), '-' * 10) nome = str(input('Nome: ').strip()) idade = int(input('Idade: ')) sexo = str(input('Sexo [M/F]: ').strip()) média = (média*(p-1)+idade)/p if p == 1 and sexo in ...
nilq/baby-python
python
import logging import numpy as np X1, Y1, X2, Y2 = range(4) class ImageSegmentation(object): """ Data Structure to hold box segments for images. Box segments are defined by two points: upper-left & bottom-right. """ def __init__(self, width, height): self.height = height self...
nilq/baby-python
python
# -*- coding: utf-8 -*- from app import app, db, bbcode_parser, redis_store, mail #, q from flask import request, render_template, redirect, url_for, send_from_directory, abort, flash, g, jsonify import datetime import os from PIL import Image import simplejson import traceback from werkzeug.utils import secure_filena...
nilq/baby-python
python
# Generated by Django 2.2.4 on 2019-09-10 13:37 from django.db import migrations import wagtail.core.blocks import wagtail.core.fields import wagtail.images.blocks class Migration(migrations.Migration): dependencies = [ ('export_readiness', '0055_auto_20190910_1242'), ] operations = [ m...
nilq/baby-python
python
import opentrons.execute import requests import json import import_ipynb import csv from labguru import Labguru experiment_id = 512 lab = Labguru(login='login@gmail.com', password='123password') # get Labguru elements experiment = lab.get_experiment(experiment_id) plate_element = lab.get_elements_by_type(experiment_...
nilq/baby-python
python
import collections import os from strictdoc.helpers.sorting import alphanumeric_sort class FileOrFolderEntry: def get_full_path(self): raise NotImplementedError def get_level(self): raise NotImplementedError def is_folder(self): raise NotImplementedError def mount_folder(se...
nilq/baby-python
python
#!/usr/bin/env python2 import sys sys.path.insert(0, '..') from cde_test_common import * def checker_func(): assert os.path.isfile('cde-package/cde-root/home/pgbovine/CDE/tests/readlink_abspath_test/libc.so.6') generic_test_runner(["python", "readlink_abspath_test.py"], checker_func)
nilq/baby-python
python
import numpy as np import pysam import subprocess import argparse import utils import os, pdb MIN_MAP_QUAL = 10 def parse_args(): parser = argparse.ArgumentParser(description=" convert bam data format to bigWig data format, " " for ribosome profiling and RNA-seq data ") p...
nilq/baby-python
python
def rotate(self, nums, k): """ :type nums: List[int] :type k: int :rtype: void Do not return anything, modify nums in-place instead. """ if k is None or k <= 0: return k = k % (len(nums)) end = len(nums)- 1 self.swap(nums,0,end-k) ...
nilq/baby-python
python
#!/usr/bin/env python # -*- coding: utf-8 -*- """ 使用自己的 svm 进行垃圾邮件分类。 """ import re import numpy as np import scipy.io as scio from nltk.stem import porter from svm import SVC def get_vocabs(): vocabs = {} # 单词的总数 n = 1899 f = open('vocab.txt', 'r') for i in range(n): line = f.readl...
nilq/baby-python
python
# File: C (Python 2.4) from direct.fsm.FSM import FSM from direct.gui.DirectGui import * from pandac.PandaModules import * from pirates.piratesgui.GuiButton import GuiButton from pirates.piratesgui import PiratesGuiGlobals from pirates.piratesbase import PiratesGlobals from pirates.piratesbase import PLocalizer from p...
nilq/baby-python
python
from .constants.google_play import Sort from .features.app import app from .features.reviews import reviews __version__ = "0.0.2.3"
nilq/baby-python
python
class memoize(object): """ Memoize the result of a property call. >>> class A(object): >>> @memoize >>> def func(self): >>> return 'foo' """ def __init__(self, func): self.__name__ = func.__name__ self.__module__ = func.__module__ self.__doc__ = ...
nilq/baby-python
python
# -*- encoding: utf-8 -*- # Copyright (c) 2019 Stephen Bunn <stephen@bunn.io> # ISC License <https://opensource.org/licenses/isc> """ """ import pathlib # the path to the data directory included in the modules source DATA_DIR = pathlib.Path(__file__).parent / "data" # the path to the store-locations fil...
nilq/baby-python
python
"""Prometheus collector for Apache Traffic Server's stats_over_http plugin.""" import logging import re import time import requests import yaml from prometheus_client import Metric CACHE_VOLUMES = re.compile("^proxy.process.cache.volume_([0-9]+)") LOG = logging.getLogger(__name__) def _get_float_value(data, keys)...
nilq/baby-python
python
# # DeepRacer Guru # # Version 3.0 onwards # # Copyright (c) 2021 dmh23 # from src.personalize.reward_functions.follow_centre_line import reward_function NEW_REWARD_FUNCTION = reward_function DISCOUNT_FACTORS = [0.999, 0.99, 0.97, 0.95, 0.9] DISCOUNT_FACTOR_MAX_STEPS = 300 TIME_BEFORE_FIRST_STEP = 0.2
nilq/baby-python
python
# terrascript/provider/kubernetes.py # Automatically generated by tools/makecode.py (24-Sep-2021 15:20:43 UTC) # # For imports without namespace, e.g. # # >>> import terrascript.provider.kubernetes # # instead of # # >>> import terrascript.provider.hashicorp.kubernetes # # This is only available for 'official' and ...
nilq/baby-python
python
import os import sys from pathlib import Path import win32api from dotenv import load_dotenv from kivy.config import Config from loguru import logger import stackprinter import trio load_dotenv() logger.remove() logger.add( sys.stdout, colorize=True, format="[ <lr>Wallpaper</> ]" "[<b><fg #3b3b3b>{lev...
nilq/baby-python
python
from rest_framework import serializers from users.api.serializers import UserSerializer from ..models import Message class MessageSerializer(serializers.ModelSerializer): sender = UserSerializer(read_only=True) receiver = UserSerializer(read_only=True) class Meta: model = Message fields ...
nilq/baby-python
python
from typing import List, Tuple import difflib from paukenator.nlp import Text, Line from .common import CmpBase class CmpTokens(CmpBase): '''Algorithm that compares texts at word level and detects differences in tokenization (splitting). Comparison works in line-by-line fashion. USAGE: comparer = Cm...
nilq/baby-python
python
from django.contrib import admin from django.contrib import admin from .models import subCategory admin.site.register (subCategory) # Register your models here.
nilq/baby-python
python
import requests import convertapi from io import BytesIO from .exceptions import * class Client: def get(self, path, params = {}, timeout = None): timeout = timeout or convertapi.timeout r = requests.get(self.url(path), params = params, headers = self.headers(), timeout = timeout) return self.handle_response(r...
nilq/baby-python
python
from django.urls import reverse from django.shortcuts import render from django.utils import timezone, crypto from django.core.paginator import Paginator from django.http.response import HttpResponse, HttpResponseRedirect, JsonResponse, FileResponse from django.views.decorators.http import require_http_methods from dja...
nilq/baby-python
python
from tool.runners.python import SubmissionPy class BebertSubmission(SubmissionPy): def run(self, s): positions = [line.split(", ") for line in s.splitlines()] positions = [(int(x), int(y)) for x, y in positions] # print(positions) obj_less = 10000 # if len(positions) != 6 else 3...
nilq/baby-python
python
from setuptools import setup, find_packages setup( name='ysedu', version='1.0', author='Yuji Suehiro', packages=find_packages(), url='https://github.com/YujiSue/education', description='Sample codes used for education.' )
nilq/baby-python
python
import re text = input().lower() word = input().lower() pattern = rf"\b{word}\b" valid_matches = len(re.findall(pattern, text)) print(valid_matches)
nilq/baby-python
python
import torch def center_of_mass(x, pytorch_grid=True): """ Center of mass layer Arguments --------- x : network output pytorch_grid : use PyTorch convention for grid (-1,1) Return ------ C : center of masses for each chs """ n_batch, chs, dim1, dim2, dim3 = ...
nilq/baby-python
python
# --------------------------------------------------------------------- # Dispose Request # --------------------------------------------------------------------- # Copyright (C) 2007-2021 The NOC Project # See LICENSE for details # --------------------------------------------------------------------- # Python modules ...
nilq/baby-python
python
#!/usr/bin/env python3 # This script will run using the default Python 3 environment # where LibreOffice's scripts are installed to (at least in Ubuntu). # This converter is very similar to unoconv but has an option to remove # line numbers, it is also simpler by being more tailored to the use-case. # https://github.c...
nilq/baby-python
python
# -*- coding: utf-8 -*- """ Created on Sat Feb 23 18:53:28 2019 @author: Rajas khokle Code Title - Time Series Modelling """ import numpy as np import pandas as pd from sqlalchemy import create_engine import matplotlib.pyplot as plt from statsmodels.tsa.seasonal import seasonal_decompose from statsmodels.tsa.statto...
nilq/baby-python
python
if __name__ == '__main__': import BrowserState else: from . import BrowserState from PyQt5 import QtCore, QtWidgets, QtWidgets # The Sort dialog, with a grid of sorting buttons class SortDialog(QtWidgets.QDialog): # Constant giving the number of search keys MaxSortKeyCount = 6 ############# Signa...
nilq/baby-python
python
# This script generates the scoring and schema files # Creates the schema, and holds the init and run functions needed to # operationalize the Iris Classification sample # Import data collection library. Only supported for docker mode. # Functionality will be ignored when package isn't found try: from azureml.dat...
nilq/baby-python
python
#Calculates the median, or middle value, of a list of numbers #The median is the middle value for an odd numbered list, so median of 1,2,3,4,5 # is 3, and the average of the two center values of an even numbered list #median of 1,2,3,4 is (2+3)/2 = 2.5 def median(numbers): med = 0.0 numbers = sorted(numbe...
nilq/baby-python
python
from .gyaodl import * __copyright__ = '(c) 2021 xpadev-net https://xpadev.net' __version__ = '0.0.1' __license__ = 'MIT' __author__ = 'xpadev-net' __author_email__ = 'xpadev@gmail.com' __url__ = 'https://github.com/xpadev-net/gyaodl' __all__ = [GyaoDL]
nilq/baby-python
python
import torch from torch.nn import Module from functools import partial import warnings from .kernel_samples import kernel_tensorized, kernel_online, kernel_multiscale from .sinkhorn_samples import sinkhorn_tensorized from .sinkhorn_samples import sinkhorn_online from .sinkhorn_samples import sinkhorn_multiscale from...
nilq/baby-python
python
import pytest from cookietemple.list.list import TemplateLister """ This test class is for testing the list subcommand: Syntax: cookietemple list """ def test_non_empty_output(capfd): """ Verifies that the list command does indeed have content :param capfd: pytest fixture -> capfd: Capture, as text, o...
nilq/baby-python
python
import scrapy class ImdbImageSpiderSpider(scrapy.Spider): name = 'imdb_image_spider' allowed_domains = ['https://www.imdb.com/'] file_handle = open("url.txt", "r") temp = file_handle.readline() file_handle.close() temp += "/mediaindex?ref_=tt_ov_mi_sm" tmp = list() tmp.append(temp) ...
nilq/baby-python
python
''' 伽马变化 ''' import numpy as np import cv2 from matplotlib import pyplot as plt # 定义伽马变化函数 def gamma_trans(img, gamma): # 先归一化到1,做伽马计算,再还原到[0,255] gamma_list = [np.power(x / 255.0, gamma) * 255.0 for x in range(256)] # 将列表转换为np.array,并指定数据类型为uint8 gamma_table = np.round(np.array(gamma_list)).astype(np...
nilq/baby-python
python
def findSubstring( S, L): """ The idea is very simple, use brute-force with hashing. First we compute the hash for each word given in L and add them up. Then we traverse from S[0] to S[len(S) - total_length], for each index, i f the first substring in L, then we compute the total hash for that partiti...
nilq/baby-python
python
from dagger.input.from_node_output import FromNodeOutput from dagger.input.protocol import Input from dagger.serializer import DefaultSerializer from tests.input.custom_serializer import CustomSerializer def test__conforms_to_protocol(): assert isinstance(FromNodeOutput("node", "output"), Input) def test__expos...
nilq/baby-python
python
"""This is a Python demo for the `Sphinx tutorial <http://quick-sphinx-tutorial.readthedocs.org/en/latest/>`_. This demo has an implementation of a Python script called ``giza`` which calculates the square of a given number. """ import argparse def calc_square(number, verbosity): """ Calculate the square o...
nilq/baby-python
python
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division, print_function, unicode_literals from sumy.parsers.html import HtmlParser from sumy.parsers.plaintext import PlaintextParser from sumy.nlp.tokenizers import Tokenizer from sumy.summarizers.lsa import LsaSummarizer as Summa...
nilq/baby-python
python
from django.db import models from searchEngine.models import InternetResult from search.models import SearchParameters class TwitterUser(models.Model): id = models.CharField(max_length=128, primary_key=True) username = models.CharField(max_length=60) link = models.URLField() avatar = models.TextField...
nilq/baby-python
python
''' hist_it.py - GPUE: Split Operator based GPU solver for Nonlinear Schrodinger Equation, Copyright (C) 2011-2015, Lee J. O'Riordan <loriordan@gmail.com>, Tadhg Morgan, Neil Crowley. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that th...
nilq/baby-python
python
from unittest import TestCase from ..mock_ldap_helpers import DEFAULT_DC from ..mock_ldap_helpers import group from ..mock_ldap_helpers import group_dn from ..mock_ldap_helpers import mock_ldap_directory from ..mock_ldap_helpers import person from ..mock_ldap_helpers import person_dn class TestPerson(TestCase): ...
nilq/baby-python
python
# # DeepRacer Guru # # Version 3.0 onwards # # Copyright (c) 2021 dmh23 # import tkinter as tk import numpy as np from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg from matplotlib.axes import Axes from matplotlib.ticker import PercentFormatter from src.action_space.action import Action from src.analyze...
nilq/baby-python
python
# # Copyright (c) 2013, Digium, Inc. # Copyright (c) 2018, AVOXI, Inc. # """ARI client library """ import aripy3.client import swaggerpy3.http_client import urllib.parse from .client import ARIClient async def connect(base_url, username, password): """Helper method for easily connecting to ARI. :param base...
nilq/baby-python
python
import argparse import os.path import shutil import fileinput import re import subprocess import sys import time import os import glob import codecs from pathlib import Path from typing import Dict, List from pyrsistent import pmap, freeze from pyrsistent.typing import PMap, PVector from typing import Ma...
nilq/baby-python
python
# -*- coding: utf-8 -*- import os import setuptools PACKAGE = 'dockerblade' PATH = os.path.join(os.path.dirname(__file__), 'src/{}/version.py'.format(PACKAGE)) with open(PATH, 'r') as fh: exec(fh.read()) setuptools.setup(version=__version__)
nilq/baby-python
python
from util import start_game, tapToStart, check_game_state # 从模拟器打开 没运行游戏开始 if __name__ == '__main__': start_game() tapToStart() check_game_state() # main()
nilq/baby-python
python
import json from datetime import date, datetime, timedelta import pytest from jitenshea.webapi import ISO_DATE, ISO_DATETIME, api from jitenshea.webapp import app app.config['TESTING'] = True api.init_app(app) def yesterday(): return date.today() - timedelta(1) @pytest.fixture def client(): client = app.t...
nilq/baby-python
python
# -*- coding:utf-8 -*- import os rootdir = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir)) class Config(object): SECRET_KEY = os.environ.get('SECRET_KEY') or 'hard to guess string' SSL_DISABLE = False SQLALCHEMY_COMMIT_ON_TEARDOWN = True SQLALCHEMY_RECORD_QUERIES = True MAIL_S...
nilq/baby-python
python
## LOX-IPA sim #@ Author Juha Nieminen #import sys #sys.path.insert(0, '/Users/juhanieminen/Documents/adamrocket') import RocketComponents as rc from physical_constants import poise, inches, Runiv, gallons, lbm, \ gearth, atm, psi, lbf from numpy import pi, linspace, cos, radians, sqrt, exp, log, array, ...
nilq/baby-python
python
import unittest from kaleidoscope.config import GalleryConfigParser class TestGalleryConfigParser(unittest.TestCase): def test_lowercase_key(self): """Lowercase option key is left as is.""" config = GalleryConfigParser() config.read_string("[album]\ntitle: Example\n") self.assertT...
nilq/baby-python
python
print("hello,world") #print(5 ** 4321) a = 1 if (a < 10 and a > -10): print("fuck you")
nilq/baby-python
python
# -*- coding: utf-8 -*- """Domain Driven Design framework.""" from ddd_base import ValueObject class RouteSpecification(ValueObject): def __init__(self, api_ref, upstream_ref, policies, tls): super(RouteSpecification, self).__init__() self.api_ref = api_ref self.upstream_ref = upstream_re...
nilq/baby-python
python
load("//java/private:common.bzl", "has_maven_deps") load("//java/private:dist_info.bzl", "DistZipInfo", "dist_aspect", "separate_first_and_third_party") def _java_dist_zip_impl(ctx): inputs = [] files = [] for file in ctx.files.files: files.append("%s=%s" % (file.basename, file.path)) input...
nilq/baby-python
python
"""draws the price charts for all the securities in the currently active case""" from multiprocessing.connection import Listener from bokeh.driving import count from bokeh.layouts import layout, column, gridplot, row, widgetbox from bokeh.models import ColumnDataSource, CustomJS, Span from bokeh.plotting import curdoc,...
nilq/baby-python
python
#function = -x**2 + 2*x - 1 # x = [0,3] import random import easygui import math def representation(interval,precision,no_selected): original_list = [] largest = int(interval*(10**precision)) select_interval = int(largest//no_selected) for i in range(1,largest + 1): str_temp = '' if i %...
nilq/baby-python
python
import pytz from datetime import datetime from FlaskRTBCTF import create_app, db, bcrypt from FlaskRTBCTF.helpers import handle_admin_pass from FlaskRTBCTF.models import User, Score, Notification, Machine from FlaskRTBCTF.config import organization, LOGGING if LOGGING: from FlaskRTBCTF.models import Logs app = ...
nilq/baby-python
python
# This file is part of DroidCarve. # # Copyright (C) 2020, Dario Incalza <dario.incalza at gmail.com> # All rights reserved. # __author__ = "Dario Incalza <dario.incalza@gmail.com" __copyright__ = "Copyright 2020, Dario Incalza" __maintainer__ = "Dario Incalza" __email__ = "dario.incalza@gmail.com" from adbutils impo...
nilq/baby-python
python
import logging _FORMAT = '%(asctime)s:%(levelname)s:%(lineno)s:%(module)s.%(funcName)s:%(message)s' _formatter = logging.Formatter(_FORMAT, '%H:%M:%S') _handler = logging.StreamHandler() _handler.setFormatter(_formatter) logger = logging.getLogger('yatsm') logger.addHandler(_handler) logger.setLevel(logging.INFO) lo...
nilq/baby-python
python
# Definition for a binary tree node. class TreeNode: def __init__(self, x): self.val = x self.left = None self.right = None def pathSum(root: TreeNode, sum: int) -> [[int]]: temp = [] result = [] def dfs(root: TreeNode, left: int) : if not root : return ...
nilq/baby-python
python
"""Perform non-linear regression using a Hill function.""" import numpy as np import math from scipy.optimize import curve_fit class Hill: """A Hill function is for modeling a field falloff (i.e. penumbra). It's not a perfect model, but it fits to a function, which is not limited by resolution issues as may ...
nilq/baby-python
python
### Wet HW2 DIP ### import numpy as np import matplotlib.pyplot as plt import cv2 from scipy import fftpack ########################################################################### ########################################################################### ############################################################...
nilq/baby-python
python
from pathlib import Path from code_scanner.data_validators import validator from code_scanner.enums import FileType class FileInfo: def __init__(self, full_name: Path, file_type: FileType = FileType.UNKNOWN): """ :param full_name: Absolute folder without file, Path :param file_type: ...
nilq/baby-python
python
# # Base engine class # Copyright EAVISE # import logging import signal from abc import ABC, abstractmethod import lightnet as ln __all__ = ['Engine'] log = logging.getLogger(__name__) class Engine(ABC): """ This class removes the boilerplate code needed for writing your training cycle. |br| Here is th...
nilq/baby-python
python
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys import yaml import roslib from sensor_msgs.msg import CameraInfo, Image import rospy class CameraInfoPublisher: # Callback of the ROS subscriber. def callback(self, data): self.cam_info.header = data.header self.publish() def __init__...
nilq/baby-python
python
import numpy as np import pandas as pd import matplotlib.pyplot as plt def cal_Nash(obs_path, predict_array): obs = pd.read_csv(obs_path, index_col=0, parse_dates = True) obs_chl = obs['chla'].iloc[:-1]
nilq/baby-python
python
import serial import time arduino = serial.Serial("COM5", 9600, timeout=0) time.sleep(5) for i in range(10000): arduino.write(chr(0+48).encode()) arduino.write(chr(1+48).encode()) arduino.write(chr(2+48).encode()) arduino.write(chr(3+48).encode()) arduino.write(chr(4+48).encode()) arduino.write(...
nilq/baby-python
python
#!/usr/bin/env python3 """ domain2idna - The tool to convert a domain or a file with a list of domain to the famous IDNA format. This submodule contains all helpers that are used by other submodules. Author: Nissar Chababy, @funilrys, contactTATAfunilrysTODTODcom Contributors: Let's contribute to domains2id...
nilq/baby-python
python
from models.nasnet_do import NASNet_large_do from tensorflow.keras import Model, Input from tensorflow.keras.applications import DenseNet169 from tensorflow.keras.layers import Dropout, UpSampling2D, Conv2D, BatchNormalization, Activation, concatenate, Add from tensorflow.keras.utils import get_file from . import Net...
nilq/baby-python
python
""" Profile ../profile-datasets-py/standard54lev_o3_trunc/005.py file automaticaly created by prof_gen.py script """ self["ID"] = "../profile-datasets-py/standard54lev_o3_trunc/005.py" self["Q"] = numpy.array([ 4.902533, 4.833692, 4.768255, 4.706048, 4.646861, 4.590505, 4...
nilq/baby-python
python
# uncompyle6 version 3.7.4 # Python bytecode 3.7 (3394) # Decompiled from: Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)] # Embedded file name: T:\InGame\Gameplay\Scripts\Server\rabbit_hole\tunable_rabbit_hole_condition.py # Compiled at: 2018-08-14 18:06:05 # Size of source mod...
nilq/baby-python
python
# -*- coding: utf-8 -*- """FIFO Simulator.""" from __future__ import annotations import queue from queue import Queue import threading from typing import Any from typing import Dict from typing import Optional from stdlib_utils import drain_queue from xem_wrapper import DATA_FRAME_SIZE_WORDS from xem_wrapper import D...
nilq/baby-python
python