content
stringlengths
0
1.05M
origin
stringclasses
2 values
type
stringclasses
2 values
#!/usr/bin/env false """Generate script to activate project.""" # Internal packages (absolute references, distributed with Python) # External packages (absolute references, NOT distributed with Python) # Library modules (absolute references, NOT packaged, in project) # from src_gen.script.bash.briteonyx.source import...
nilq/baby-python
python
from HTML import Curve_Write_HTML from Data import Curve_Write_Data from SVG import Curve_Write_SVG class Curve_Write( Curve_Write_HTML, Curve_Write_Data, Curve_Write_SVG ): ##! ##! ##! def sifsdifdsgf(self): return 0
nilq/baby-python
python
""" Python script containing methods for building machine learning model """ import utils.text_processing as tp def classifier(X, y, tokenizer, config): word_ind_dict = tokenizer.word_index glove_path = config.get("glove_path") vocab_size = config.get("vocab_size") seq_len = config.get("seq_len") ...
nilq/baby-python
python
# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: proto/diff-img.proto """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google....
nilq/baby-python
python
"""Example training a nobrainer model for brain extraction.""" import nobrainer # Instantiate object to perform real-time data augmentation on training data. # This object is similar to `keras.preprocessing.image.ImageDataGenerator` but # works with volumetric data. volume_data_generator = nobrainer.VolumeDataGenerat...
nilq/baby-python
python
from bflib import dice, movement, units from bflib.attacks import AttackSet, Bite, Gaze from bflib.attacks import specialproperties from bflib.characters import specialabilities from bflib.characters.classes.fighter import Fighter from bflib.monsters import listing from bflib.monsters.appearingset import AppearingSet f...
nilq/baby-python
python
import requests from bs4 import BeautifulSoup address = [] def get_html(url): r = requests.get(url, headers={ 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) ' 'Chrome/97.0.4692.99 Safari/537.36', 'accept': '*/*'}) return r...
nilq/baby-python
python
# Copyright 2018 Braxton Mckee # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed t...
nilq/baby-python
python
from blinker import NamedSignal, signal from sagas.nlu.events import ResultDataset, RequestMeta from sagas.conf.conf import cf import sagas.tracker_fn as tc from pprint import pprint watch = signal('watch') # evts=[watch] @watch.connect def console_watch(sender, **kw): import datetime from sagas.nlu.nlu_tool...
nilq/baby-python
python
import numpy as np class SpatioTemporalSignal(object): """ This Class is used to create a group of N signals that interact in space and time. The way that this interaction is carrieud out can be fully determined by the user through a SpatioTemporal matrix of vectors that specify how the signals mix...
nilq/baby-python
python
from . import Token class TreeNode(object): # dictionary mapping {str: TreeNode} id_treeNodes = {} def getTreeNode(idx): return TreeNode.id_treeNodes[idx] def __init__(self, idx, tkn): self._id = idx self._tkn = tkn self._children = {} TreeNode.id_treeNodes[i...
nilq/baby-python
python
from flask import Flask from chatpy.api import API from chatpy.auth import TokenAuthHandler app = Flask(__name__) app.config.from_object('config') chatwork = API(auth_handler=TokenAuthHandler(app.config['CHATWORK_TOKEN'])) from app.endpoint import *
nilq/baby-python
python
#!/usr/bin/python # -*- coding: utf-8 -*- # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = { 'metadata_version': '1.1', 'status': ['preview'], 'supported_by...
nilq/baby-python
python
# Copyright (c) 2021, CRS4 # # Permission is hereby granted, free of charge, to any person obtaining a copy of # this software and associated documentation files (the "Software"), to deal in # the Software without restriction, including without limitation the rights to # use, copy, modify, merge, publish, distribu...
nilq/baby-python
python
import billboard import json import urllib from urllib.parse import quote apikey = 'APIKEY' # make the empty dictionary songs = {} # loop through the years we're interested in for x in range(1960, 2016): # another dictionary inside songs[x] = {} # get the chart for the last week of that year chart = ...
nilq/baby-python
python
#! /usr/bin/env python """Perform massive transformations on a document tree created from the LaTeX of the Python documentation, and dump the ESIS data for the transformed tree. """ import errno import esistools import re import string import sys import xml.dom import xml.dom.minidom ELEMENT = xml.dom.Node.ELEMENT_...
nilq/baby-python
python
import importlib.util import os def vyLoadModuleFromFilePath(filePath, moduleName=None): if moduleName == None: replacements = [ ('/', '.'), ('\\', '.'), ('-', '_'), (' ', '_'), ] filePathSansExt = os.path.splitext(filePath)[0] for iss...
nilq/baby-python
python
from ._plugin import Workplane from ._plugin import extend
nilq/baby-python
python
"""Testing File for roman_ssg_util""" import os import shutil import roman_ssg_util def setup_test(): """Setup Tests for tests""" os.chdir(os.getcwd()) if os.path.isdir("dist"): shutil.rmtree("dist") if os.path.isdir("testCustomDirectory"): shutil.rmtree("testCustomDirectory") def te...
nilq/baby-python
python
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # */AIPND/intropylab-classifying-images/check_images.py # # DONE: 0. Fill in your information in the programming header below # PROGRAMMER: Aimee Ukasick # DATE CREATED: 11 April 2018 # REVISED DATE: <=(Date Revised - if any) # PURPOSE: Check images & report re...
nilq/baby-python
python
# -*- coding: utf-8 -*- # Copyright (C) 2017 Intel Corporation. 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 # # ...
nilq/baby-python
python
import os import sys import hashlib def e(s): if type(s) == str: return s return s.encode('utf-8') def d(s): if type(s) == unicode: return s return unicode(s, 'utf-8') def mkid(s): return hashlib.sha1(e(s)).hexdigest()[:2*4] def running_in_virtualenv(): return hasattr(sys, 'r...
nilq/baby-python
python
import unittest import pprint import os from numpy import testing import invest_natcap.fisheries.fisheries_hst as main import invest_natcap.fisheries.fisheries_hst_io as io pp = pprint.PrettyPrinter(indent=4) workspace_dir = './invest-data/test/data/fisheries/' data_dir = './invest-data/Fisheries' inputs_dir = os.p...
nilq/baby-python
python
""" Decorators """ import sys from contextlib import contextmanager import mock from maya_mock.cmds import MockedCmdsSession from maya_mock.pymel import MockedPymelSession, MockedPymelNode, MockedPymelPort @contextmanager def _patched_sys_modules(data): """ Temporary override sys.modules with provided data....
nilq/baby-python
python
# -*- coding: utf-8 -*- from .torsimany import main main()
nilq/baby-python
python
from cumulusci.tasks.metadata_etl.base import ( BaseMetadataETLTask, BaseMetadataSynthesisTask, BaseMetadataTransformTask, MetadataSingleEntityTransformTask, MetadataOperation, ) from cumulusci.tasks.metadata_etl.duplicate_rules import SetDuplicateRuleStatus from cumulusci.tasks.metadata_etl.layouts...
nilq/baby-python
python
# Copyright The PyTorch Lightning team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
nilq/baby-python
python
features = [1,2,3] prices = [1,2,3] theta = [0,0] LEARNING_RATE=0.01 NO_TRAINING_EXAMPLES=len(features) EPSILON=0.000000001 #Cost function to calculate half the average of the squared errors for the given theta def cost(features, prices, theta): sum = 0 for i in range(NO_TRAINING_EXAMPLES): ...
nilq/baby-python
python
__all__ = ('WeakMap',) from .docs import has_docs from .removed_descriptor import RemovedDescriptor from .weak_core import WeakReferer, add_to_pending_removals @has_docs class _WeakMapCallback: """ Callback used by ``WeakMap``-s. Attributes ---------- _parent : ``WeakReferer`` to ``WeakMap``...
nilq/baby-python
python
import dash import dash_table import dash_core_components as dcc import dash_html_components as html from dash.dependencies import Input, Output, State import numpy as np import pandas as pd import plotly.graph_objects as go from database import get_data_cache, get_all_food_data external_stylesheets = ['https://codep...
nilq/baby-python
python
# Generated by Django 3.1.7 on 2021-04-07 15:46 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('main', '0001_initial'), ] operations = [ migrations.CreateModel( name='Rubric', fie...
nilq/baby-python
python
# based on django-markdownify # https://github.com/erwinmatijsen/django-markdownify # https://django-markdownify.readthedocs.io/en/latest/settings.html from functools import partial from django import template from django.conf import settings import bleach from markdownx.utils import markdownify as markdownx_markdow...
nilq/baby-python
python
""" Artificial Images Simulator ============================ The Artificial Images Simulator (AIS) class was developed to generate artificial star images, similar to those images that would be acquired by using the acquisition system of the instrument. To accomplish this, the AIS models as star flux as a 2D gaussian d...
nilq/baby-python
python
from rest_framework import viewsets from .models import RESP, REGONError, REGON, JSTConnection, Institution, ESP from .serializers import RESPSerializer, REGONSerializer, REGONErrorSerializer, JSTConnectionSerializer, \ InstitutionSerializer, ESPSerializer class InstitutionViewSet(viewsets.ReadOnlyModelViewSet):...
nilq/baby-python
python
# coding=utf-8 from OTLMOW.OTLModel.Datatypes.KeuzelijstField import KeuzelijstField from OTLMOW.OTLModel.Datatypes.KeuzelijstWaarde import KeuzelijstWaarde # Generated with OTLEnumerationCreator. To modify: extend, do not edit class KlEleAansluitvermogen(KeuzelijstField): """Keuzelijst met gangbare waarden voor ...
nilq/baby-python
python
# Generated by Django 2.0.2 on 2018-04-26 17:00 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('users', '0002_auto_20180406_1917'), ] operations = [ migrations.AlterField( model_name='profile', name...
nilq/baby-python
python
# -*- coding: utf-8 -*- ''' :file: score.py :author: -Farmer :url: https://blog.farmer233.top :date: 2021/09/20 20:06:29 ''' # cjcx/cjcx_cxDgXscj.html?doType=query&gnmkdm=N305005&su=2018133209 from school_sdk.client.api import BaseCrawler class Score(BaseCrawler): def __init__(self, user_client)...
nilq/baby-python
python
# -------------------------------------------------------- # Copyright (c) 2021 Microsoft # Licensed under The MIT License # -------------------------------------------------------- import os import random from PIL import Image from PIL import ImageFile from torch.utils.data import Dataset from .transforms import tr...
nilq/baby-python
python
# """""" from os import getpid import logging.handlers from .snippet import T2I def mapped_level(name): levels = {'debug': logging.DEBUG, 'info': logging.INFO, 'warning': logging.WARNING, 'error': logging.ERROR, 'fatal': logging.FATAL} return levels[name] if name in levels else logging.WARNING; def mapped_wh...
nilq/baby-python
python
""" October 2018 Simulations of a Ramsey experiment in the presence of flux 1/f noise """ import time import numpy as np import qutip as qtp from pycqed.measurement import detector_functions as det from scipy.interpolate import interp1d import scipy import matplotlib.pyplot as plt import logging from pycqed.simulation...
nilq/baby-python
python
from .cloudchain import checkconfig from .cloudchain import CloudChainConfigError from .cloudchain import CloudChainError from .cloudchain import CloudChain from .cloudchain import decryptcreds from .cloudchain import encryptcreds from .cloudchain import endpoint_url from .cloudchain import getconn from .cloudchain imp...
nilq/baby-python
python
import logging from typing import List, Dict from bs4 import BeautifulSoup, element from .row_utils import ( movies_utils, series_utils, books_utils, comics_utils, music_utils, videogames_utils, ) logger = logging.getLogger(__name__) def get_rows_from_topchart(soup: BeautifulSoup) -> List[e...
nilq/baby-python
python
#!/usr/bin/env python3 """ For each family and device, obtain a tilegrid and save it in the database """ import os from os import path import subprocess import extract_tilegrid import database def main(): devices = database.get_devices() for family in sorted(devices["families"].keys()): for device i...
nilq/baby-python
python
import os import random import string import pytest from check_mk_web_api import WebApi, CheckMkWebApiException api = WebApi( os.environ['CHECK_MK_URL'], os.environ['CHECK_MK_USER'], os.environ['CHECK_MK_SECRET'] ) def setup(): api.delete_all_hosts() api.delete_all_hostgroups() api.delete_a...
nilq/baby-python
python
from functools import reduce hashes = [None] + [i for i in range(1, 11)] index = 0 hash_list = [(lambda _h=h: _h, i == index, []) for i, h in enumerate(hashes)] print(hashes) print("zip = {0}".format(zip(hash_list[::2], hash_list[1::2] + [hash_list[::2][-1]]))) while len(hash_list) > 1: hash_list = [ ( ...
nilq/baby-python
python
import numpy as np import pandas as pd from dataset import MultiDataset, RegressionDataset def scatter_path_array(path_data, size, rank): all_lst = [] for row, item in path_data.iterrows(): path, num = item['path'], int(item['num']) all_lst.extend([[path, i] for i in range(num)]) all_lst ...
nilq/baby-python
python
from . import controller from . import model
nilq/baby-python
python
#------------------------------------------------------------------------------ # Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. #------------------------------------------------------------------------------ #------------------------------------------------------------------------------ # Shar...
nilq/baby-python
python
''' Comp_slice is a terminal fork of intra_blob. - It traces blob axis by cross-comparing vertically adjacent Ps: horizontal slices across an edge blob. These low-M high-Ma blobs are vectorized into outlines of adjacent flat or high-M blobs. (high match: M / Ma, roughly corresponds to low gradient: G / Ga) - Vectorizat...
nilq/baby-python
python
__version__ = "0.2" from PyQNX6.core import *
nilq/baby-python
python
import numpy import six from chainer.backends import cuda from chainer import function_node from chainer import utils from chainer.utils import collections_abc from chainer.utils import type_check def _tensordot(a, b, a_axes, b_axes, c_axes=None): a_col_ndim = len(a_axes[1]) b_row_ndim = len(b_axes[0]) i...
nilq/baby-python
python
import pytest from di.core.element import Element from di.core.module import ( Module, ModuleElementConsistencyCheck, ModuleElementConsistencyError, ModuleImportSolver, ModuleImportSolverError, ) def test_module_cycle(): modules = [Module(name=f"{index}") for index in range(3)] modules[0]...
nilq/baby-python
python
import acipdt import xlrd import xlwt import requests from requests.packages.urllib3.exceptions import InsecureRequestWarning from xlutils.copy import copy from orderedset import OrderedSet import sys import time import ipaddress import getpass import os # Log levels 0 = None, 1 = Class only, 2 = Line log_level = 2 #...
nilq/baby-python
python
from distutils.version import StrictVersion from unittest.mock import patch from keepassxc_pwned.keepass_wrapper import KeepassWrapper from .common import * # use keepassxc.cli wrapper script to test changing location of keepassxc-cli keepass_different_binary = os.path.abspath( os.path.join(this_dir, "keepassxc....
nilq/baby-python
python
# -*- coding: utf-8 -*- ''' Support for the softwareupdate command on MacOS. ''' from __future__ import absolute_import # Import python libs import re import os # import salt libs import salt.utils import salt.utils.mac_utils from salt.exceptions import CommandExecutionError, SaltInvocationError __virtualname__ = '...
nilq/baby-python
python
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Jun 23 13:01:46 2020 @author: dnb3k """ #use the unique Full Tokens code to get teh dataframe import ossPyFuncs import pandas as pd import wordcloud import re import matplotlib.pyplot as plt import os import numpy as np #perform sql query to get comp...
nilq/baby-python
python
# Write the benchmarking functions here. # See "Writing benchmarks" in the asv docs for more information. from math import radians import numpy as np from passpredict import _rotations class Rotations: """ Example from Vallado, Eg 11-6, p. 912 """ def setup(self, *args): self.lat = radians(4...
nilq/baby-python
python
""" Main file! """ import argparse import logging import pickle import string import sys from typing import Optional, TextIO, BinaryIO import ujson from vk_dumper import utils, vk log = logging.getLogger('vk-dumper') def main() -> None: log.info('Starting vk-dumper!') args = parse_args() # Output vari...
nilq/baby-python
python
from .iostream import cprint, cin, cout, cerr, endl from .cmath import * from . import cmath, iostream
nilq/baby-python
python
from __future__ import unicode_literals from django.core.urlresolvers import reverse from tracpro.test import factories from tracpro.test.cases import TracProTest from .. import charts from .. import models class PollChartTest(TracProTest): def setUp(self): super(PollChartTest, self).setUp() ...
nilq/baby-python
python
# Copyright 2021 The Distla Authors. 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 ...
nilq/baby-python
python
""" Train a DeeProtein-model. """ import argparse import json from DeeProtein import DeeProtein import helpers import os def main(): with open(FLAGS.config_json) as config_fobj: config_dict = json.load(config_fobj) # set the gpu context if not FLAGS.gpu: if config_dict["gpu"] == 'True': ...
nilq/baby-python
python
# -*- coding: utf-8 -*- __author__ = 'Lara Olmos Camarena' import re import json import re """ utils """ def preprocess_text(text_str): regular_expr = re.compile('\n|\r|\t|\(|\)|\[|\]|:|\,|\;|"|\?|\-|\%') text_str = re.sub(regular_expr, ' ', text_str) token_list = text_str.split(' ') token_list = [e...
nilq/baby-python
python
import importlib from time import clock for i in range(2): module = input("Enter module to import") importlib.import_module(module) start = clock() print(iterativefact(27)) end = clock() elapsed = end - start print(elapsed) start = clock() print(recursivefactorial(27)) end = clock() elapsed = end - start prin...
nilq/baby-python
python
# -*- encoding: utf-8 -*- """ Boolean type comparator used to match Boolean Comparators are used by Audit module to compare module output with the expected result In FDG-connector, comparators might also be used with FDG Boolean comparator exposes various commands: - "match" Use Cases: - To check a boolea...
nilq/baby-python
python
'''MobileNet in PyTorch. See the paper "MobileNets: Efficient Convolutional Neural Networks for Mobile Vision Applications" for more details. ''' import math import torch import torch.nn as nn import torch.nn.functional as F import os, sys project_root = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) sy...
nilq/baby-python
python
import numpy as np import tensorflow as tf import scipy.signal def add_histogram(writer, tag, values, step, bins=1000): """ Logs the histogram of a list/vector of values. From: https://gist.github.com/gyglim/1f8dfb1b5c82627ae3efcfbbadb9f514 """ # Create histogram using numpy counts, bin_edges...
nilq/baby-python
python
# See documentation in: # http://doc.scrapy.org/topics/items.html from scrapy.item import Item, Field class Author(Item): name = Field() profile_url = Field() avatar_url = Field() class BlogAuthor(Author): pass class CommentAuthor(Author): pass class Post(Item): author = Field() title =...
nilq/baby-python
python
import xml.etree.ElementTree as ET import fnmatch import matplotlib.pyplot as plt #rootDir = '/Users/yanzhexu/Desktop/Research/GBM/aCGH_whole_tumor_maps_for_Neuro-Onc_dataset/CEFSL_slices_only/slice22/ROI for +C_3D_AXIAL_IRSPGR_Fast_IM-0005-0022.xml' # draw ROI from coordinates in XML file def ParseXMLDrawROI(rootDir...
nilq/baby-python
python
word = 'Bye' phrase = word * 3 + '!' print(phrase) name = input() print('I love', name)
nilq/baby-python
python
# <<BEGIN-copyright>> # Copyright 2021, Lawrence Livermore National Security, LLC. # See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: BSD-3-Clause # <<END-copyright>> from PoPs import IDs as IDsPoPsModule from PoPs.groups import misc as chemicalElementMiscPoPsModule from fudge.channelData i...
nilq/baby-python
python
import numpy as np from scipy.linalg import expm from tqdm import tqdm import time from utils import visualize_trajectory_2d,load_data ############## All Utility Functions ############### def round_dot(vec): ''' :param vec: A point in homogeneous co-ordinate :return: 0 representation for the vector ...
nilq/baby-python
python
from rule import * from operator import methodcaller def chi_toi_checker(cards): return 0 def ko_ku_shi_checker(cards): return 0 def ron_dfs(handcards): if (len(handcards) == 0): return True return False #no matter whether have yaku def can_ron(cards): if (ron_dfs(cards.handcards)): return True ...
nilq/baby-python
python
import pytest import torch import time from ynot.datasets import FPADataset from ynot.echelle import Echellogram from torch.utils.data import DataLoader import torch.optim as optim import torch.nn as nn @pytest.mark.parametrize( "device", ["cuda", "cpu"], ) def test_forward_backward(device): """Do the scene m...
nilq/baby-python
python
import json import discord from discord.ext import commands from utils import get_color import datetime class Modlogs(commands.Cog): def __init__(self, bot): self.bot = bot with open("./bot_config/logging/modlogs_channels.json", "r") as modlogsFile: self.modlogsFile = json.load(modlog...
nilq/baby-python
python
import pytest from django.contrib.auth import get_user_model from django.urls import reverse from tahoe_idp.tests.magiclink_fixtures import user # NOQA: F401 User = get_user_model() @pytest.mark.django_db def test_studio_login_must_be_authenticated(client, settings): # NOQA: F811 url = reverse('studio_login')...
nilq/baby-python
python
UI_INTERACTIONS = { 'learn-more': { 'interaction_type': 'click', 'element_location': 'ct_menu_tree', 'element_name': 'ct_learn_more_btn', 'icon_name': 'document', 'color': 'yellow', 'cta_text': 'Learn More' }, 'advanced-metrics': { 'interaction_type': ...
nilq/baby-python
python
# -*- coding: utf-8 -*- # # Copyright 2019 Google LLC. 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 requir...
nilq/baby-python
python
from django.views.generic import ( ListView, CreateView, UpdateView, DeleteView, DetailView, ) from django.urls import reverse_lazy from .models import Todo class ListTodosView(ListView): model = Todo class DetailTodoView(DetailView): model = Todo class CreateTodoView(CreateView): ...
nilq/baby-python
python
import sys import bpy import threading from .signal import Signal from .utils import find_first_view3d class AnimationController: '''Provides an interface to Blender's animation system with fine-grained callbacks. To play nice with Blender, blendtorch provides a callback based class for interacting wi...
nilq/baby-python
python
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon May 17 11:01:58 2021 @author: root """ import sklearn from sklearn import datasets import numpy as np import matplotlib.pyplot as plt from matplotlib.colors import ListedColormap import seaborn as sns import torch.nn.functional as F import torch.nn as n...
nilq/baby-python
python
from django.apps import AppConfig class MetricConfig(AppConfig): label = "metric" name = "edd.metric" verbose_name = "Metric" def ready(self): # make sure to load/register all the signal handlers from . import signals # noqa: F401
nilq/baby-python
python
from scipy.misc.common import logsumexp from kameleon_rks.densities.gaussian import sample_gaussian, \ log_gaussian_pdf_multiple from kameleon_rks.proposals.ProposalBase import ProposalBase import kameleon_rks.samplers.tools from kameleon_rks.tools.covariance_updates import log_weights_to_lmbdas, \ update_mean...
nilq/baby-python
python
__copyright__ = 'Copyright(c) Gordon Elliott 2017' """ """ from enum import IntEnum from a_tuin.metadata import ( ObjectFieldGroupBase, StringField, ObjectReferenceField, Collection, DescriptionField, IntField, IntEnumField, ) class PPSStatus(IntEnum): Requested = 1 Provided = ...
nilq/baby-python
python
""" Tools for segmenting positional AIS messages into continuous tracks. Includes a CLI plugin for `gpsdio` to run the algorithm. """ from gpsdio_segment.segment import BadSegment from gpsdio_segment.segment import Segment from gpsdio_segment.core import Segmentizer __version__ = '0.20.2' __author__ = 'Paul Woods'...
nilq/baby-python
python
# -*- coding: utf-8 -*- """ A utility library for interfacing with the SRF-08 and SRF-10 ultrasonic rangefinders. http://www.robot-electronics.co.uk/htm/srf08tech.shtml http://www.robot-electronics.co.uk/htm/srf10tech.htm Utilizes I2C library for reads and writes. The MIT License (MIT) Copyright (c) 2015 Martin Clemo...
nilq/baby-python
python
import sys import time from datetime import timedelta, datetime as dt from monthdelta import monthdelta import holidays import re import threading import inspect from contextlib import contextmanager import traceback import logging # default logging configuration # logging.captureWarnings(True) LOG_FORMATTER = loggin...
nilq/baby-python
python
token = '1271828065:AAFCFSuz_vX71bxzZSdhLSLhUnUgwWc0t-k'
nilq/baby-python
python
########################### # # #764 Asymmetric Diophantine Equation - Project Euler # https://projecteuler.net/problem=764 # # Code by Kevin Marciniak # ###########################
nilq/baby-python
python
## What is Lambda : anonymous function or function without name ## Usecase is you can pass a function as an argument, quick function # def double(num): # x = num + num # return x # print(double(6)) # lambda num: num + num # x = lambda a : a + 10 # print(x(5)) #Example 2 # my_list = [1, 5, 4, 6, 8, 11, 3...
nilq/baby-python
python
""" Utility functions for dealing with NER tagging. """ import logging logger = logging.getLogger('stanza') def is_basic_scheme(all_tags): """ Check if a basic tagging scheme is used. Return True if so. Args: all_tags: a list of NER tags Returns: True if the tagging scheme does not ...
nilq/baby-python
python
from dataclasses import dataclass from typing import Callable import torch Logits = torch.FloatTensor @dataclass class Sample: logits: Logits tokens: torch.LongTensor Sampler = Callable[[Logits], Sample] def standard(temperature: float = 1.0) -> Sampler: def sample(logits: Logits) -> Sample: ...
nilq/baby-python
python
from numpy import NaN import pandas as pd import requests import math import re from bs4 import BeautifulSoup class Propertypro: """ web-scraper tool for scraping data on propertypro.ng Parameters: num_samples (int): The number of samples of data to be scraped. location (list): list...
nilq/baby-python
python
from oslo_log import log as logging from oslo_messaging import RemoteError from nca47.api.controllers.v1 import base from nca47.api.controllers.v1 import tools from nca47.common.exception import NonExistParam from nca47.common.exception import ParamFormatError from nca47.common.exception import ParamNull from nca47.com...
nilq/baby-python
python
import torch import torch.nn as nn import torch.nn.functional as F from torch.autograd import Variable from layers import * from layers.modules.l2norm import L2Norm from data import * import os import math #from vis_features import plot_features class ResNet(nn.Module): def __init__(self, block, layers, num_class...
nilq/baby-python
python
""" This module defines views used in CRUD operations on articles. """ from rest_framework import generics, status from rest_framework.response import Response from rest_framework.permissions import ( AllowAny, IsAuthenticatedOrReadOnly, IsAuthenticated ) from rest_framework.serializers import ValidationError from ...
nilq/baby-python
python
from .dynamo import DynamoClient from .s3 import S3Client
nilq/baby-python
python
#! python3 # -*- encoding: utf-8 -*- ''' Current module: rman.app.rm_task.models Rough version history: v1.0 Original version to use ******************************************************************** @AUTHOR: Administrator-Bruce Luo(罗科峰) MAIL: luokefeng@163.com RCS: rman.app.rm_task.models,...
nilq/baby-python
python
#!/usr/bin/python3.3 # -*- coding: utf-8 -*- # core.py # Functions: # [X] loading servers details # [X] loading servers config (in which is found username, etc.) # [ ] logging to disk commands and status # [ ] loading and providing configuration e.g. is_enabled() # [ ] provides ini reading interface import ...
nilq/baby-python
python
############################################################## # Customer Issue Prediction Model #------------------------------------------------------------- # Author : Alisa Ai # ############################################################## import dash import dash_core_components as dcc import dash_html_components ...
nilq/baby-python
python