content
stringlengths
0
1.05M
origin
stringclasses
2 values
type
stringclasses
2 values
# Script to get the system's info from __future__ import print_function import platform import multiprocessing as mp ''' Functions: ------------------------------------------------------ sysinfo(display = True, return_info = False) Gets the details about the system ----------------------------...
nilq/baby-python
python
import LevelBuilder from sprites import * def render(name,bg): lb = LevelBuilder.LevelBuilder(name+".plist",background=bg) lb.addObject(Hero.HeroSprite(x=42, y=245,width=32,height=32)) lb.addObject(Beam.BeamSprite(x=42, y=287,width=17,height=14,angle='0',restitution=0.2,static='true',friction=0.5,density=20...
nilq/baby-python
python
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import sys class UnsupportedPythonError(Exception): pass __minimum_python_version__ = "3.6" if sys.version_info < tuple((int(val) for val in __minimum_python_version__.split('.'))): raise UnsupportedPythonError(f"pyvib does not support Python < {__minimum_pytho...
nilq/baby-python
python
# Generated by Django 2.1.5 on 2019-02-07 23:02 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('hyperion', '0003_userprofile_url'), ] operations = [ migrations.AddField( model_name='userprofile', name='github', ...
nilq/baby-python
python
import random from evennia import TICKER_HANDLER from evennia import CmdSet, Command, DefaultRoom from evennia import utils, create_object, search_object from evennia import syscmdkeys, default_cmds from evennia.contrib.text_sims.objects import LightSource, TutorialObject # the system error-handling module is defined...
nilq/baby-python
python
#coding=utf8 import itchat import re import sys from itchat.content import * global author global isDisturbOn global visit global username def messageProccess(msg): if not msg["FromUserName"] == author: if msg["Type"] == "Text": if re.search("#sinon", msg["Text"]) == None: if i...
nilq/baby-python
python
import os from setuptools import setup from gitissius import gitissius setup( name = "Gitissius", version = gitissius.VERSION, author = "Giorgos Logiotatidis", author_email = "seadog@sealabs.net", description = "Distributed bug tracking for Git.", license = "Mixed", keywords = "bug, tracki...
nilq/baby-python
python
""" Plot ENSO from 2015-2018 using daily oisstv2 Data : 18 March 2018 Author : Zachary M. Labe """ from mpl_toolkits.basemap import Basemap import numpy as np import matplotlib.pyplot as plt from netCDF4 import Dataset import datetime import cmocean ### Directory and time directoryfigure = './Figures/' directorydat...
nilq/baby-python
python
# -*- coding: utf-8 -*- """ Guney's network proposed in A Deep Neural Network for SSVEP-based Brain-Computer Interfaces. Modified from https://github.com/osmanberke/Deep-SSVEP-BCI.git """ from collections import OrderedDict import torch import torch.nn as nn import torch.nn.functional as F from .base import compute_...
nilq/baby-python
python
import numpy as np import itertools import torch class TestAugmentor(object): """Test Augmentor. Args: mode (str): inference mode ('min', 'max', 'mean'). num_aug (int): number of data augmentations: 4-fold, 16-fold """ def __init__(self, mode='min', num_aug=4): self.mode = mode...
nilq/baby-python
python
""" Cciss - Files ``/proc/driver/cciss/cciss*`` =========================================== Reads the ``/proc/driver/cciss/cciss*`` files and converts them into a dictionary in the *data* property. Example: >>> cciss = shared[Cciss] >>> cciss.data['Logical drives'] '1' >>> 'IRQ' in cciss.data True...
nilq/baby-python
python
from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import from builtins import super from future import standard_library standard_library.install_aliases() import logging import os import errno from .BaseDispatch import BaseDisp...
nilq/baby-python
python
from nintendo import account api = account.AccountAPI() pid = api.get_pid("Kinnay-WiiU") mii = api.get_mii(pid) print("NNID:", mii.nnid) print("PID:", pid) #Same as mii.pid print("Name:", mii.name) info = mii.data print("Mii:") print("\tBirthday: %i-%i" %(info.birth_day, info.birth_month)) print("\tCreator name:", i...
nilq/baby-python
python
from unittest.mock import patch from pytest import fixture @fixture(autouse=True) def environ(): environ = { "slack_access_token": "slack-access-token", "slack_signing_secret": "slack-signing-secret", } with patch.dict("os.environ", environ, clear=True): yield environ @fixture d...
nilq/baby-python
python
import cv2 import numpy as np from operator import floordiv vc = cv2.VideoCapture(0) cv2.namedWindow("top") cv2.namedWindow("bottom") if vc.isOpened(): rval, frame = vc.read() height = len(frame) width = len(frame[0]) else: rval = False lights = (16,9) history = 5 top = np.zeros((lights[0], 1,...
nilq/baby-python
python
""" If you use this code, please cite one of the SynthSeg papers: https://github.com/BBillot/SynthSeg/blob/master/bibtex.bib Copyright 2020 Benjamin Billot 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 Lice...
nilq/baby-python
python
"""Multiply SOIL13 and SOIL14 by 10 to change units from % to g/kg""" import pyiem.cscap_utils as util def main(): """Go Main Go""" config = util.get_config() spr_client = util.get_spreadsheet_client(config) drive = util.get_driveclient(config) # Fake last conditional to make it easy to reproces...
nilq/baby-python
python
##!/usr/bin/python import numpy as np import pylab as plt import seaborn as sns sns.set_context('poster') plt.subplot(1,1,1) data = np.genfromtxt(fname='energy.dat') #data = np.loadtxt('traj.dat') #for x in range(1,data.shape[-1]): plt.plot(data[:,0],data[:,1],label='kinetic') plt.plot(data[:,0],data[:,2],label='p...
nilq/baby-python
python
import nxutils import networkx as nx # TODO: Update this to remove dependency on static zipcode # if we ever need to use this code zipCode = '02138' prefix = 'neighborhood' n = nxutils.NXUtils(prefix, zipCode) n.buildNetwork() DG = n.getNetwork() fullCycles = nx.simple_cycles(DG) print('Number of cy...
nilq/baby-python
python
# This file was auto generated; Do not modify, if you value your sanity! import ctypes try: # 2 from can_settings import can_settings from swcan_settings import swcan_settings except: from ics.structures.can_settings import can_settings from ics.structures.swcan_settings import swcan_settings # flags ...
nilq/baby-python
python
"""Optimization methods."""
nilq/baby-python
python
# -*- coding: utf-8 -*- """Build functions to wrap mlflow models. Existing implementation returns a synchronous/blocking function. This decision was taken because applying ML models is probably CPU-bound. Not having unnecessary asynchronous code also makes testing simpler. Current supports only the pyfunc flavour. C...
nilq/baby-python
python
# Generated by Django 4.0.2 on 2022-02-04 17:27 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('mainapp', '0001_initial'), ] operations = [ migrations.RenameField( model_name='products', old_name='product_type', ...
nilq/baby-python
python
""" Copyright 2019 IBM Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software...
nilq/baby-python
python
# Copyright (c) 2019 PaddlePaddle 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 appli...
nilq/baby-python
python
import time from multiprocessing import Queue from queue import Full import numpy as np from .sampler import Sampler class FakeSampler(Sampler): def __init__(self, instance: np.ndarray, sample_queue: Queue, num_of_samples: int = 1000): super(FakeSample...
nilq/baby-python
python
# Copyright (c) 2013 Yubico AB # All rights reserved. # # Redistribution and use in source and binary forms, with or # without modification, are permitted provided that the following # conditions are met: # # 1. Redistributions of source code must retain the above copyright # notice, this list of conditi...
nilq/baby-python
python
import os.path as P def relative_path(this_file , rel_path): return P.join(P.dirname(this_file) , rel_path)
nilq/baby-python
python
import pytest from qualipy.filters import * PATTERN = 'tests/images/pattern.jpg' NON_PATTERN = 'tests/images/lama.jpg' def test_recognizes_pattern(): assert Pattern().predict(PATTERN) def test_doesnt_recognize_normal_image(): assert not Pattern().predict(NON_PATTERN) def test_setting_threshold(): a...
nilq/baby-python
python
from . import backup import logging from .config import DropboxOfflineBackupConfig def start(): logging.getLogger('').setLevel(logging.DEBUG) console = logging.StreamHandler() file_handler = logging.FileHandler(DropboxOfflineBackupConfig().config['DropboxBackup']['LogFile']) formatter = logging.Formatt...
nilq/baby-python
python
#! /usr/bin/python3 # # Copyright (c) 2017 Intel Corporation # # SPDX-License-Identifier: Apache-2.0 # import os import re import time import commonl.testing import tcfl.tc srcdir = os.path.dirname(__file__) ttbd = commonl.testing.test_ttbd( config_files = [ # strip to remove the compiled/optimized versi...
nilq/baby-python
python
# -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/FamilyMemberHistory Release: R4 Version: 4.0.1 Build ID: 9346c8cc45 Last updated: 2019-11-01T09:29:23.356+11:00 """ import io import json import os import unittest import pytest from .. import familymemberhistory from ..fhirdate import FHIR...
nilq/baby-python
python
# -*- coding: utf-8 -*- # Time : 2021/7/25 13:59 # Author : QIN2DIM # Github : https://github.com/QIN2DIM # Description: import json import os from datetime import datetime from bs4 import BeautifulSoup from selenium.common.exceptions import ( StaleElementReferenceException, WebDriverException, ...
nilq/baby-python
python
import stweet as st def test_return_tweets_objects(): phrase = '#koronawirus' search_tweets_task = st.SearchTweetsTask( all_words=phrase, tweets_count=200 ) tweets_collector = st.CollectorTweetOutput() result = st.TweetSearchRunner( search_tweets_task=search_tweets_task, ...
nilq/baby-python
python
import lmfit import numpy as np from uncertainties import ufloat from scipy.stats import sem from collections import OrderedDict from pycqed.analysis import fitting_models as fit_mods from pycqed.analysis import analysis_toolbox as a_tools import pycqed.analysis_v2.base_analysis as ba from pycqed.analysis.tools.plottin...
nilq/baby-python
python
def zk_demo(cfg,V,F,ZMvtk) : #function max_abs_diff = demo( V,F,ZMvtk ) # num_vertices = 3 # num_vertices = 3; num_facets = cfg.size(F,0) #! ...
nilq/baby-python
python
from django.urls import path from . import api_views, views urlpatterns = [ path('', views.firework_home, name='fireworks-home'), path('add/', views.add_firework, name='fireworks-add'), path('categories', views.category, name='fireworks-categories'), path('category/<slug:category_slug>/', views.catego...
nilq/baby-python
python
from pydantic import BaseModel from starlette.requests import Request from fastapi.security.base import SecurityBase from fastapi.security.utils import get_authorization_scheme_param from typing import Optional from starlette.status import HTTP_403_FORBIDDEN, HTTP_401_UNAUTHORIZED from fastapi.exceptions import HTTPE...
nilq/baby-python
python
print(1)<caret>
nilq/baby-python
python
""" Copyright 2013 Steven Diamond This file is part of CVXPY. CVXPY is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. CVXPY is distributed i...
nilq/baby-python
python
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import torch from torchknickknacks import metrics x1 = torch.rand(100,) x2 = torch.rand(100,) r = metrics.pearson_coeff(x1, x2) x = torch.rand(100, 30) r_pairs = metrics.pearson_coeff_pairs(x)
nilq/baby-python
python
# Based off of https://github.com/getninjas/celery-executor/ # # Apache Software License 2.0 # # Copyright (c) 2018, Alan Justino da Silva # # 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 # # ...
nilq/baby-python
python
import os import sys import json from pathlib import Path import shutil import argparse from wikiutils import split_wiki, sample_docs, cleanup_paths, save_stats parser = argparse.ArgumentParser() parser.add_argument("-l", "--lang", required=True, help="language of the wiki-dump to download / preprocess", type=str) ...
nilq/baby-python
python
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings import uuidfield.fields class Migration(migrations.Migration): dependencies = [ ('schedule', '0001_initial'), migrations.swappable_dependency(settings.AUTH_US...
nilq/baby-python
python
from .base import Dashboard
nilq/baby-python
python
from django import forms from django.contrib import messages class InputForm(forms.Form): query = forms.CharField(max_length=200)
nilq/baby-python
python
#!/usr/bin/python import base64 import binascii # CONSTANTS WORDLISTFILE = r'OSPD4.txt' SET1CH4INPUTFILE = r'4.txt' SET1CH6INPUTFILE = r'6.txt' # Functions def hextobase64(hexstring): bin = binascii.unhexlify(hexstring) return base64.b64encode(bin).decode() def xor(binary1, binary2): return ''.join(chr(ord(a) ^...
nilq/baby-python
python
#!/usr/bin/env python # -*- coding: utf-8 -*- # vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4 import unittest from mock import mock from conans.client.tools.oss import detected_architecture class DetectedArchitectureTest(unittest.TestCase): def test_various(self): # x86 with mock.patch...
nilq/baby-python
python
import pytest import shutil from accident_prediction_montreal.weather import get_weather_station_id_df from accident_prediction_montreal.utils import init_spark @pytest.fixture(scope='session') def spark(): return init_spark() def test_get_weather_station_id_df(spark): acc_sample = spark.read.parquet('test...
nilq/baby-python
python
# -*- coding: utf-8 -*- import sys import argparse from kits.parse_articles import parse_articles from config.conf import conf from config.conf import enviroment from kits.log import get_logger def initialize(): parser = argparse.ArgumentParser() parser.add_argument("-e", "--env", action="store", dest="env...
nilq/baby-python
python
#!/usr/bin/env python # encoding: utf-8 # PYTHON_ARGCOMPLETE_OK # from __future__ imports must occur at the beginning of the file from __future__ import unicode_literals from __future__ import print_function from __future__ import division from .bypy import main if __name__ == "__main__": main() # vim: tabstop=4 n...
nilq/baby-python
python
""" Define a new function using the @qgsfunction decorator. The function accept the following parameters :param [any]: Define any parameters you want to pass to your function before the following arguments. :param feature: The current feature :param parent: The QgsExpression object :param context: If th...
nilq/baby-python
python
""" The Sims 4 Community Library is licensed under the Creative Commons Attribution 4.0 International public license (CC BY 4.0). https://creativecommons.org/licenses/by/4.0/ https://creativecommons.org/licenses/by/4.0/legalcode Copyright (c) COLONOLNUTTY """ from datetime import datetime class CommonRealDateUtils: ...
nilq/baby-python
python
import logging from .utils import get_logging_level class Client(object): """ This object autheticates the account to the api """ def __init__(self, auth, **kwargs): """ Initializes Client object. Args: auth (tuple): Authentication object api (str): Api endpat...
nilq/baby-python
python
from django.shortcuts import render from .models import Salas,Rentals from django.db.models import Q from django.shortcuts import get_object_or_404 from .forms import RentalForm def salas_home_view(request,*args,**kargs): hora_inicial = request.GET.get('inicio',None) hora_fim = request.GET.g...
nilq/baby-python
python
from typing import MutableSequence class WrappingList(MutableSequence): def __init__(self, l=[]): if type(l) is not list: raise ValueError() self._inner_list = l def __len__(self): return len(self._inner_list) def __delitem__(self, index): index = self.__va...
nilq/baby-python
python
import numpy as np from scipy.special import erf class GELU: def __call__(self, x: np.ndarray, approximate: bool = True) -> np.ndarray: if approximate: return x * 0.5 * (1 + np.tanh(np.sqrt(2 / np.pi) * (x + 0.044715 * np.power(x, 3)))) return x * 0.5 * (1.0 + erf(x / np.sqrt(2.0))) ...
nilq/baby-python
python
import sys import os import pty import subprocess import shlex import selectors import multiprocessing as mp def run(cmd, input_lines=[]): """Run an interactive given command with input and capture all IO. Parameters ---------- cmd: str The command to run input_lines: list List ...
nilq/baby-python
python
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Tue Jan 3 14:52:19 2017 @author: Falaize """ from __future__ import absolute_import import sys from PyQt5.QtWidgets import QApplication from widgets import PyphsGui import os path = os.path.join('pyphs_gui', 'tests', 'rlc.net') os.chdir('..') def runn...
nilq/baby-python
python
# Copyright 2014 Baidu, 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 agreed to in writing, softwa...
nilq/baby-python
python
#******************************************************************************* # # Filename : EDMNaming.py # Description : Getting the reduced name of a dataset and others # Author : Yi-Mu "Enoch" Chen [ ensc@hep1.phys.ntu.edu.tw ] # #*******************************************************************...
nilq/baby-python
python
# Copyright 2019 Extreme Networks, 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 agreed to i...
nilq/baby-python
python
# -*- coding: utf-8 -*- from rest_framework import viewsets, mixins from .models import Pet, Birth, Breed from .serializers import PetSerializer, BreedSerializer, BirthSerializer class PetViewSet(mixins.CreateModelMixin, mixins.ListModelMixin, viewsets.GenericViewSet): queryset ...
nilq/baby-python
python
""" Tests Input.__init__() and classes in input_classes.py Note that this is more of a regression test than a unit test. Compares with previously computed results.""" import os import numpy as np import pytest import astropy.units as u from astropy.time import Time from nexoclom.solarsystem import SSObject from nexoclo...
nilq/baby-python
python
import argparse import os import numpy as np import torch from mmcv.runner import Sequential from tensorflow.python.training import py_checkpoint_reader from mmcls.models.backbones.efficientnet import EfficientNet def tf2pth(v): if v.ndim == 4: return np.ascontiguousarray(v.transpose(3, 2, 0, 1)) el...
nilq/baby-python
python
import requests import re from bs4 import BeautifulSoup import pandas as pd import sys from PyQt4.QtGui import QApplication from PyQt4.QtCore import QUrl from PyQt4.QtWebKit import QWebPage import bs4 as bs import urllib.request import os import datetime path_of_brandwise = 'C:\\LavaWebScraper\\BrandWiseF...
nilq/baby-python
python
#!/usr/bin/env python3 import argparse import sys import os import stat import httplib2 from oauth2client.service_account import ServiceAccountCredentials import apiclient SCOPE = 'https://www.googleapis.com/auth/androidpublisher' SCRIPT_VERSION = '2021-08-22' def print_info(): print('publisher.py: %s' % SCRIPT_V...
nilq/baby-python
python
"""Base register module""" def pad_zeroes(addr, n_zeroes): """Padds the address with zeroes""" if len(addr) < n_zeroes: return pad_zeroes("0" + addr, n_zeroes) return addr def int_addr(addr): """Gets the integer representation of an address""" return int(addr[1:]) def next_addr(addr, i): ...
nilq/baby-python
python
from . import views from django.urls import path urlpatterns = [ path('', views.BlogHome.as_view(), name='blog'), ]
nilq/baby-python
python
# Time: O(n) # Space: O(1) # Two pointers solution class Solution(object): def numSubarraysWithSum(self, A, S): """ :type A: List[int] :type S: int :rtype: int """ result = 0 left, right, sum_left, sum_right = 0, 0, 0, 0 for i, a in enum...
nilq/baby-python
python
from pytest import raises import pandas as pd from agape.mapping import dictify, gene2symbol class TestDictify(object): def setup_method(self): self.df = pd.DataFrame({"A": [0, 1], "B": ["x", "y"]}) self.key = "A" self.value = "B" def test_returns_dict(...
nilq/baby-python
python
from . import api from . import core from .core import Stream, NameSpace, DataFeed
nilq/baby-python
python
############################################################################## # Copyright by The HDF Group. # # All rights reserved. # # # # Th...
nilq/baby-python
python
"""Test Refiners can be constructed with various configurations""" import os from copy import deepcopy import pytest from dxtbx.model.experiment_list import ExperimentListFactory from libtbx import phil from dials.algorithms.refinement import DialsRefineConfigError, RefinerFactory from dials.algorithms.refinement....
nilq/baby-python
python
import pytest from geonotebook.kernel import Remote @pytest.fixture def remote(mocker): protocols = [{'procedure': 'no_args', 'required': [], 'optional': []}, {'procedure': 'required_only', 'required': [{"key": "a"}, {"key": "b"}], ...
nilq/baby-python
python
import serial import time import datetime import numpy as np import csv from pathlib import Path import random as random myFile = Path('BigHouse.csv') if not myFile.exists(): with open('BigHouse.csv','a', newline='') as csvfile: writer = csv.writer(csvfile, delimiter=';', quotechar='|', quoting=csv...
nilq/baby-python
python
import curses from itertools import islice, izip from .pad_display_manager import PadDisplayManager from .rate import get_rate_string SESSIONS_HEADER = "| Idx | Type | Details | RX Rate | TX Rate | Activity Time " SESSIONS_BORDER = "+-----+------+-------------...
nilq/baby-python
python
import binascii import collections import datetime import hashlib from urllib.parse import quote from google.oauth2 import service_account def generate_signed_url( service_account_file, bucket_name, object_name, expiration, http_method="GET", query_parameters=None, headers=None, ): es...
nilq/baby-python
python
import unittest from number_of_islands.solution import Solution class TestSolution(unittest.TestCase): def test_solution(self): self.assertEqual(0, Solution().num_islands( None)) self.assertEqual(0, Solution().num_islands( [[]])) self.assertEqual(1, Solution().num...
nilq/baby-python
python
from subprocess import PIPE, run my_command = "["ipconfig", "/all"]" result = run(my_command, stdout=PIPE, stderr=PIPE, universal_newlines=True) print(result.stdout, result.stderr) input("Press Enter to finish...")
nilq/baby-python
python
import connexion #app = connexion.FlaskApp(__name__) app = connexion.AioHttpApp(__name__) app.add_api("swagger/openapi.yaml") application = app.app
nilq/baby-python
python
import time import board import displayio import adafruit_ssd1325 displayio.release_displays() spi = board.SPI() oled_cs = board.D5 oled_dc = board.D6 oled_reset = board.D9 display_bus = displayio.FourWire( spi, command=oled_dc, chip_select=oled_cs, reset=oled_reset, baudrate=1000000 ) time.sleep(...
nilq/baby-python
python
from yahoofinancials import YahooFinancials import pandas as pd import datetime as dt def get_downloader(start_date, end_date, granularity='daily',): """returns a downloader closure for oanda :param start_date: the first day on which dat are downloaded :param end_date: the la...
nilq/baby-python
python
# Python script for generatign panda_drv.h from *DRV entries in registers # configuration file. from __future__ import print_function import sys from parse_indent import parse_register_file registers = parse_register_file(sys.argv[1]) base, fields = registers['*DRV'] base = int(base) print('''\ /* Register definit...
nilq/baby-python
python
import setuptools setuptools.setup( name="cinemasci", version="0.1", author="David H. Rogers", author_email="dhr@lanl.gov", description="Tools for the Cinema scientific toolset.", url="https://github.com/cinemascience", packages=["cinemasci", "cinemasci.cdb", ...
nilq/baby-python
python
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Aug 26 16:34:40 2020 @author: skyjones """ import os import re import pandas as pd from glob import glob import nibabel as nib import numpy as np import shutil out_csv = '/Users/manusdonahue/Documents/Sky/volume_testing/volume_comparisons_fastonly....
nilq/baby-python
python
#!/usr/bin/env python """ =========== {PROG} =========== ---------------------------------------------------- Compute exponentially weighted moving average ---------------------------------------------------- :Author: skipm@trdlnk.com :Date: 2013-03-15 :Copyright: TradeLink LLC 2013 :Version: 0.1 :Manual section: 1 ...
nilq/baby-python
python
import os import sys import time import WareHouse import ConfigLoader import PythonSheep.IOSheep.PrintFormat as PrintSheep import PythonSheep.IOSheep.InputFormat as InputSheep from Commands.HelpDocument import HelpDocument from Commands.ReloadConfig import ReloadConfig from Commands.OpenConfig import OpenConfig # 初...
nilq/baby-python
python
from movelister.core.context import Context def reopenCurrentFile(): """ Reopens current file. All variables made before this will be invalid. Make sure to initialize them too. """ frame = Context.getFrame() frame.loadComponentFromURL(getUrl(), "_self", 0, ()) def getUrl(): """ Retur...
nilq/baby-python
python
#!/usr/bin/env python3 # Copyright 2020 Google LLC # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
nilq/baby-python
python
import sys import os import redis from Bio import SeqIO def main(argv): # Put stuff in JSON config file r=redis.Redis() batch = 1000; itera = 0 checkID = "" pipeline=r.pipeline() handle = open( argv[0], "r") for record in SeqIO.parse(handle, "fasta") : pipeline.set( str( record.id ), str( ...
nilq/baby-python
python
from peewee import CharField, IntegerField from core.db.db import BaseModel class Materials(BaseModel): name = CharField(unique=True) type_id = IntegerField() class Meta: table_name = 'materials'
nilq/baby-python
python
from keras import backend from keras.constraints import Constraint from keras.initializers import RandomNormal from keras.layers import Dense, Conv2D, Conv2DTranspose, BatchNormalization, Activation, Reshape, LeakyReLU, \ Dropout, Flatten from keras.models import Sequential, load_model from wasserstein import wass...
nilq/baby-python
python
import events import io import json import os from executors.python import run as python_run from executors.workflow import run as workflow_run from . import utils from girder_worker.utils import JobStatus, StateTransitionException from girder_worker import config, PACKAGE_DIR # Maps task modes to their implementati...
nilq/baby-python
python
import os from urllib.parse import urlparse from boxsdk import OAuth2, Client from django.conf import settings from swag_auth.base import BaseSwaggerDownloader, BaseAPIConnector from swag_auth.oauth2.views import CustomOAuth2Adapter class BoxAPIConnector(BaseAPIConnector): def __init__(self, token): sup...
nilq/baby-python
python
from typing import List, Optional, Dict, Iterable from fhirclient.models.codeableconcept import CodeableConcept from fhirclient.models.encounter import Encounter import fhirclient.models.patient as fhir_patient from fhirclient.models.fhirreference import FHIRReference from transmart_loader.loader_exception import Load...
nilq/baby-python
python
from datetime import datetime import django import factory from django.utils import timezone from api.cases.enums import CaseTypeEnum from api.compliance.enums import ComplianceVisitTypes, ComplianceRiskValues from api.compliance.models import OpenLicenceReturns, ComplianceSiteCase, CompliancePerson, ComplianceVisitC...
nilq/baby-python
python
#!/usr/bin/env python3 """某青空文庫の実験用コード。 参考: <https://github.com/ozt-ca/tjo.hatenablog.samples/tree/master/r_samples/public_lib/jp/aozora> <https://tjo.hatenablog.com/entry/2019/05/31/190000> AP: 0.945 Prec: 0.88742 Rec: 0.86312 実行結果: ``` [INFO ] Accuracy: 0.892 (Error: 0.108) [INFO ] F1-macro: 0.894 [INFO ] ...
nilq/baby-python
python
import FWCore.ParameterSet.Config as cms from SimG4Core.Configuration.SimG4Core_cff import * g4SimHits.Watchers = cms.VPSet(cms.PSet( MaterialBudgetVolume = cms.PSet( lvNames = cms.vstring('BEAM', 'BEAM1', 'BEAM2', 'BEAM3', 'BEAM4', 'Tracker', 'ECAL', 'HCal', 'VCAL', 'MGNT', 'MUON', 'OQUA', 'CALOEC'), ...
nilq/baby-python
python
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2013, David Stygstra <david.stygstra@gmail.com> # 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_v...
nilq/baby-python
python