content stringlengths 5 1.05M |
|---|
# -*- coding: utf-8 -*-
"""
Created on Tue Mar 07 12:49:18 2017
@author: smudd
"""
# -*- coding: utf-8 -*-
"""
Created on Fri Feb 10 16:57:22 2017
@author: smudd
"""
# -*- coding: utf-8 -*-
"""
Created on Fri Feb 10 12:55:23 2017
@author: smudd
"""
import matplotlib
# Force matplotlib to not use any Xwindows bac... |
'''
Look up packaging instructions from Serious Python to see if anything has changed for Python 3
'''
from setuptools import setup
#this should be pretty detailed; generate from function definitions (i.e. Serious Python)
def readme():
with open('README.md') as f:
return f.read()
setup(name='aspace_tools',
ver... |
import os
import shutil
import random
import numpy as np
from tensorflow import random as tf_random
import yaml
from datetime import datetime
import pytz
from PIL import Image, ImageOps
from pathlib import Path
import git
from models import generate_compiled_segmentation_model
from image_utils import str2bool
from metr... |
from cement import Controller, ex
import webbrowser, time, datetime
from cement import shell
from ..constants import DIFFICULTY_DISPLAY, GREEN, RED, WHITE
class Next(Controller):
class Meta:
label = "next"
stacked_type = 'embedded'
stacked_on = 'base'
@ex(
help='Get the next p... |
from __future__ import unicode_literals
from django.apps import AppConfig
class DjangoDodoConfig(AppConfig):
name = 'django_dodo'
|
WIIU = 0
SWITCH = 1
class Settings:
MODE_ECB = 0
MODE_GCM = 1
field_types = {
"pia.version": int,
"pia.system_version": int,
"pia.application_version": int,
"pia.lan_version": int,
"common.pid_size": int
}
def __init__(self, version, app_version=-1, *, platform=SWITCH):
s... |
# $Filename$
# $Authors$
# Last Changed: $Date$ $Committer$ $Revision-Id$
# Copyright (c) 2003-2011, German Aerospace Center (DLR)
# All rights reserved.
#
#
#Redistribution and use in source and binary forms, with or without
#
#modification, are permitted provided that the following conditions are
#met:
#
... |
import argparse
import glob
import os
import librosa
import numpy as np
import onnxruntime
import soundfile as sf
from tqdm import tqdm
import audio_utils
class DECModel:
def __init__(self, model_path, window_length, hop_fraction,
dft_size, hidden_size, sampling_rate=16000, spe... |
# -*- coding: utf-8 -*-
import os
from shovel.config import Config
from shovel.pit import Pit
DEFAULT_BUCKET = os.environ.get('SHOVEL_DEFAULT_BUCKET')
DEFAULT_ROOT = os.environ.get('SHOVEL_DEFAULT_ROOT') or 'bottomless-pit'
def bury(project, name, version, local_path, force=False, ignore_exists=False):
"""Uploa... |
motor2_cp1 = 4
motor2_cp2 = 5
motor2_ep = 10
motor1_cp1 = 2
motor1_cp2 = 3
motor1_ep = 9
motor_speed = 1000
lights_pin = 13
beep_pin = 8
serialport = '/dev/tty.usbmodem1411' |
import numpy as np
import model
import monte_carlo
class Sequence():
"""
Object that stores a sequence with positions with an update method to update the positions and sequence
through a Markov Chain Monte Carlo Method.
"""
def __init__(self, N=None, selected_iterator=None, p_mutation=None,
... |
from .statements import Select,Where,GroupBy,OrderBy,Aggregate
class query:
def __init__(self):
self.select = []
self.where = []
self.groupBy = []
self.aggregate = []
self.language = 'en'
self.orderBy = []
def set_select(self,data_table:str,indicators:list)... |
import os
PRINTER_HOST = 'example.com'
PRINTER_USER = 'admin'
PRINTER_PASS = 'admin'
ADMIN_KEY = 'adminkey'
CLIENT_KEY = 'clientkey'
WEB_KEY = 'webkey'
SECRET_KEY='clavemuysecreta',
DEBUG = True
LOG = True |
import json
import os
import re
from abc import ABC
from abc import abstractmethod
from concurrent.futures import ThreadPoolExecutor
from typing import Dict
from typing import IO
from typing import Tuple
from typing import Text
from typing import List
from typing import Any
from typing import Union
from typing import O... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''subs.py
Usage: subs.py [options]
Options:
-D --debug Debugging output
-q --quiet Quiet output
-h --help Help!
-l --loops=LOOPS Maximum Loops [default: 10]
-s --sleep=SLEEP Sleep wait between loops [default: 30]
... |
# import the necessary packages
from skimage import feature
class HOG:
def __init__(
self,
orientations=9,
pixelsPerCell=(8, 8),
cellsPerBlock=(3, 3),
transform=False,
block_norm="L2-Hys",
):
# store the number of orientations, pixels per cell,
#... |
from typing import Iterable, Optional, TypeVar
from stock_indicators._cslib import CsIndicator
from stock_indicators._cstypes import List as CsList
from stock_indicators.indicators.common.helpers import RemoveWarmupMixin
from stock_indicators.indicators.common.results import IndicatorResults, ResultBase
from stock_ind... |
import pytest
import sys
from vagranttoansible.vagranttoansible import write_ssh_config_to_file, parse_ssh_config, write_ansible_inventory, \
__version__, get_args
FIXTURES_DIR = 'tests/fixtures/'
EMPTY_FILE = FIXTURES_DIR + 'ssh_config_empty_file'
SIMPLE_FILE = FIXTURES_DIR + 'ssh_config_simple'
def _read_fil... |
from django.apps import AppConfig
from django.db.models import signals
def create_default_store(sender, app_config, verbosity, **kwargs):
# Only create the default sites in databases where Django created the table.
if verbosity >= 2:
print("Creating default Store object")
from .models import Store
... |
import base64
from Crypto.Cipher import DES3
import os
import subprocess
import re
#########################################################
# RPDscan - Remmina Password Decorder/scanner #
# by Freakyclown #
# This tool searches the /home directory for users #
# Remmina preference and config files, then d... |
# from yt_downloader.txt_reader import read
from argparse import ArgumentParser
from yt_downloader import yt_downer
import json
# TODO keep original file option
# TODO make new directory for files option
parser = ArgumentParser()
parser.add_argument('-url', help='Youtube URL to download.')
parser.add_argument('-i','--... |
#! /usr/bin/python3
#-*- coding: utf-8 -*-
from __future__ import print_function
import os, sys
import re
import datetime
from pybern.products.errors.errors import FileFormatError
FILE_FORMAT = 'GPSEST .CRD (Bernese v5.2)'
"""
IGS14: coordinate list
-------------------------------------------------------------------... |
__version__ = "5.0.0-beta.13" |
requested_toppings = ['mushrooms', 'extra cheese']
if requested_toppings:
for requested_topping in requested_toppings:
print('Adding ' + requested_topping )
print('\nFinished making your pizza')
else:
print('Are you sure you want a plain pizza?') |
"""
Kernels on molecules:
1) Graph-based kernels: operate on graph representations of molecules.
Can be computed using graphkernels package.
2) String-based kernels: operate on SMILES strings
TBA
Author: kkorovin@cs.cmu.edu
TODO:
- Issue: for some reason graphkernels fails when graphs are attributed,
... |
import time
from datetime import datetime
from pynput.keyboard import Controller, Key
from data import lst
import webbrowser
keyboard = Controller()
isStarted = False
for i in lst:
while True:
if isStarted == False:
if datetime.now().hour == int(i[1].split(':')[0]) and datetime.n... |
import tensorflow as tf
from layers.basics import optimize
class BaseSiameseNet:
def __init__(self, max_sequence_len, vocabulary_size, main_cfg, model_cfg, loss_function):
self.x1 = tf.placeholder(dtype=tf.int32, shape=[None, max_sequence_len])
self.x2 = tf.placeholder(dtype=tf.int32, shape=[No... |
"""
Creates a MobileNetV1 Model as defined in:
Andrew G. Howard Menglong Zhu Bo Chen, et.al. (2017 CVPR).
MobileNets: Efficient Convolutional Neural Networks for Mobile Vision Applications.
Copyright (c) Yang Lu, 2017
"""
import torch.nn as nn
import torch.nn.functional as F
import models.ops as ops
from models.imag... |
from benchmarks.base import BaseRemoteBench
class UpdateImportUrlBench(BaseRemoteBench):
def setup(self, remote):
super().setup(remote)
data_url = self.setup_data("100x1024")
self.dvc("import-url", data_url, "stage")
self.setup_data("200x1024", url=data_url)
def time_import_ur... |
# -*- coding: utf-8 -*-
# Define here the models for your scraped items
#
# See documentation in:
# https://doc.scrapy.org/en/latest/topics/items.html
import scrapy
class GeotermsItem(scrapy.Item):
# define the fields for your item here like:
domain = scrapy.Field()
term = scrapy.Field()
term_englis... |
###############################################################################
##
## Copyright (C) 2013-2014 Tavendo GmbH
##
## 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
##
## h... |
# -*- coding: utf-8 -*-
"""
[ Obtained from https://gist.github.com/chengdi123000/42ec8ed2cbef09ee050766c2f25498cb ]
Created on Wed Feb 14 16:17:38 2018
This handler is used to deal with logging with mpi4py in Python3.
@author: cheng
@reference:
https://cvw.cac.cornell.edu/python/logging
https://groups.goog... |
class Solution:
def mostVisited(self, n: int, rounds: List[int]) -> List[int]:
"""Array.
Running time: O(n * m) where m is the length of rounds.
"""
f = [0] * n
for i in range(len(rounds)-1):
s, e = rounds[i], rounds[i+1]
if e < s:
e +... |
"""
Generator object for standard 96-well plate.
"""
class WellIdGenerator(object):
"""Generates 96-plate well ids from A1 ... A12, ..., H1 ... H12
Also returns plate number if requested.
"""
LETTER_TRANSITION_TABLE = {
'A': 'B',
'B': 'C',
'C': 'D',
'D... |
from unittest import TestCase
from xml_collation.TextGraph import convert_superwitness_to_textgraph
from xml_collation.collate_xml_hierarchy import convert_xml_string_into_tokens, align_tokens_and_return_superwitness
from xml_collation.text_graph_exporter import export_as_dot
class DotTest(TestCase):
def test_d... |
import copy
import re
import numpy as np
import torch
import ops.norm as norm
import ops.tests as tests
def normalize_filter(bs, ws):
bs = {k: v.float() for k, v in bs.items()}
ws = {k: v.float() for k, v in ws.items()}
norm_bs = {}
for k in bs:
ws_norm = torch.norm(ws[k], dim=0, keepdim=Tr... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Project : tql-Python.
# @File : pseudo
# @Time : 2020/9/6 1:56 下午
# @Author : yuanjie
# @Email : yuanjie@xiaomi.com
# @Software : PyCharm
# @Description :
import numpy as np
import pandas as pd
from lightgbm import LGBMClassifier
... |
import argbind
@argbind.bind(without_prefix=True, positional=True)
def main(
arg1 : int,
arg2 : str = 'arg2',
arg3 : float = 1.0
):
"""Same script, ArgBind style.
Parameters
----------
arg1 : int
The first argument (positional).
arg2 : str, optional
The second argumen... |
'''
Copyright (c) 2021. IIP Lab, Wuhan University
'''
import os
import argparse
import numpy as np
import pandas as pd
from scipy.stats import spearmanr
import tensorflow as tf
from tensorflow.keras import layers, models
from tensorflow.keras import backend as K
from data import *
from train import *
... |
import math
import os
import pickle
import struct
import numpy as np
import quaternion
import numba as nb
import moderngl
from visnav.missions.bennu import BennuSystemModel
try:
from moderngl.ext.obj import Obj
except:
from ModernGL.ext.obj import Obj
from visnav.algo import tools
from visnav.algo.image im... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2017, Data61
# Commonwealth Scientific and Industrial Research Organisation (CSIRO)
# ABN 41 687 119 230.
#
# This software may be distributed and modified according to the terms of
# the BSD 2-Clause license. Note that NO WARRANTY is provided.
# See "LICENSE... |
from django import forms
from django.contrib.auth.models import User
class UserForm(forms.ModelForm):
name = forms.CharField(max_length=254, help_text='Podaj imie...')
surname = forms.CharField(max_length=254, help_text='Podaj nazwisko...')
new_login = forms.CharField(max_length=254, help_text='Podaj logi... |
#! /usr/bin/env python
from __future__ import print_function
import unittest
import time
import nose
import sys
import os
from getpass import getuser
from firecloud import fccore
from firecloud import api as fapi
class TestFISSLowLevel(unittest.TestCase):
"""Unit test the low-level interface of FireCloud-enabled ... |
import tensorflow as tf
from pgn.layers import Encoder, Decoder, Pointer, BahdanauAttention
from utils.saveLoader import load_embedding_matrix
class PGN(tf.keras.Model):
def __init__(self, params):
super(PGN, self).__init__()
self.embedding_matrix = load_embedding_matrix()
self.params = pa... |
import math
from typing import Tuple
import numpy as np
import scipy.stats as scs
from tabulate import tabulate
class DistrManager:
def __init__(self, alpha: float = 0.05) -> None:
self._p = 1 - alpha
def get_probability(
self, distr: np.ndarray, limits: np.ndarray
) -> Tuple[np.ndarray,... |
import socket
import threading
host = '127.0.0.1'
port = 9999
server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server.bind((host, port))
server.listen(5)
print '[*] Listening on %s:%d' % (host, port)
def handle_client(client_socket):
request = client_socket.recv(1024)
print '[*] Reviced %s' % req... |
# Copyright 2013 Viewfinder Inc. All Rights Reserved.
"""Viewfinder LinkIdentityOperation.
This operation links a previously unlinked identity to a target user account.
"""
__authors__ = ['andy@emailscrubbed.com (Andy Kimball)']
import logging
from tornado import gen
from viewfinder.backend.db.identity import Iden... |
""" Register modules with `ptflops` """
from .closure import Add, Multiply # noqa: F401
from .container import ( # noqa: F401
Broadcast,
BroadcastReduce,
Conditional,
Parallel,
Reduce,
Residual,
Sequential,
)
from .conv import Conv1d, Conv2d, Conv3d # noqa: F401
from .linear import Linea... |
# AUTOGENERATED! DO NOT EDIT! File to edit: nbs/95_cli.ipynb (unless otherwise specified).
__all__ = ['logger', 'get_parser', 'main']
# Cell
import argparse
import logging
from pathlib import Path
import random
from .utils import log_elapsed_time
from .coco import merge_datasets, cut_annotations_per_category, remov... |
### reporting
from time import time, strftime
from locust import events
from logging import getLogger
log = getLogger(__name__)
log_file_name = f'test_details_{strftime("%Y_%m_%d_%H_%M_%S")}.csv'
log_file = open(log_file_name, 'wt')
log_file.write('timestamp\tresult\tresponse_time\trequest_type\tname\tresponse_lengt... |
# by:koala @mixiologist
# Lord Userbot
from userbot import DEVS, WHITELIST, blacklistman
from userbot.events import register
from userbot.utils import chataction, get_user_from_event, man_cmd
# Ported For Lord-Userbot by liualvinas/Alvin
@chataction()
async def handler(tele):
if not tele.user_joined and not te... |
class WisePreInputData:
NONE = "None"
def __init__(self,
figure_error_file=NONE,
figure_error_step=0.0,
figure_error_amplitude_scaling=1.0,
figure_user_units_to_m=1.0,
roughness_file=NONE,
roughness_x_scaling=1.0,... |
# -*- coding: utf-8 -*-
import logging
from hashcode19.helpers import Input, Output, PictureType, Slide, score_transition
logger = logging.getLogger(__name__)
def main(inp: Input) -> Output:
"""Sort by number of tags, then trivially pack vertical pictures.
Choose the best next slide in 1000 other slides.""... |
# -*- coding: utf-8 -*-
# Copyright 2016 OpenMarket Ltd
#
# 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 la... |
import attr
class MyMixin(object):
def __init__(self, *a, param=True, **kw):
print(f"MyMixin.__init__ of {type(self)})")
self.param = param
super().__init__(*a, **kw)
@attr.s
class A:
value: int = attr.ib(default=3)
class B(A, MyMixin):
pass
class C(MyMixin, A):
pass
@attr.... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
__author__ = ['Tomas Mendez Echenagucia <tmendeze@uw.edu>']
__copyright__ = 'Copyright 2020, Design Machine Group - University of Washington'
__license__ = 'MIT License'
__email__ = 'tmendeze@uw.e... |
"""
Created on Oct 13, 2021
@author: Richard Christie
"""
from opencmiss.utils.zinc.general import ChangeManager
from opencmiss.zinc.node import Nodeset
from opencmiss.zinc.field import Field, FieldGroup
from opencmiss.zinc.scene import Scene
def get_scene_selection_group(scene: Scene, subelement_handling_mode=Field... |
#!/usr/bin/env python3
from greshunkel import Template, Context, GshklFilterFunc
# Taken from the greshunkel_test.c file
test_template =\
"""
<html>
<body>
xXx SCREAM _include.html xXx
xXx LOOP i LOOP_TEST xXx
<li>xXx @TEST xXx xXx @i xXx</li>
xXx BBL xXx
<span>This is t... |
from ..remote import RemoteModel
from infoblox_netmri.utils.utils import check_api_availability
class TimeWindowRemote(RemoteModel):
"""
This table list out the entries of Time Window System.
| ``id:`` The internal NetMRI identifier of a time window.
| ``attribute type:`` number
| ``... |
from typing import List
from django import forms
from django.conf import settings
from .value import LocalizedValue
from .widgets import LocalizedFieldWidget
class LocalizedFieldForm(forms.MultiValueField):
"""Form for a localized field, allows editing
the field in multiple languages."""
widget = Local... |
"""
Author: Jason Eisele
Date: October 1, 2020
Email: jeisele@shipt.com
Scope: App for Tensorflow Doggo classifier
"""
from fastapi import APIRouter
from app.api.routes import heartbeat, prediction
api_router = APIRouter()
api_router.include_router(heartbeat.router, tags=["health"], prefix="/health")
api_router.includ... |
#!/home/mario/anaconda3/envs/project2_venv/bin python
"""
DESCRIPTION:
This script tries to gather all the steps needed to
perform once the basecalls have been obtained.
"""
# Libraries
import os
import sys
from tombo import tombo_helper, tombo_stats, resquiggle
import h5py
import mappy
from tqdm import tqdm
import ... |
# Copyright (c) 2006-2009 The Trustees of Indiana University.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without ... |
# iot-sec Device class
from mongoengine import *
import datetime
class Device(Document):
id = StringField(required=True, primary_key=True, unique=True)
manuf = StringField()
model = StringField()
pubkey = BinaryField()
lastSeen = DateTimeField(default=datetime.datetime.now) |
#!/usr/bin/env python
"""
An interface for creating custom waves on the PiGlow.
"""
import math
from itertools import tee
from time import sleep
from sys import exit
try:
import numpy
except ImportError:
exit("This library requires the numpy module\nInstall with: sudo pip install numpy")
import piglow
# o... |
from panstamps.__version__ import __version__
from panstamps import utKit
from panstamps import cl_utils
from panstamps.downloader import downloader
from panstamps.image import image
|
#The function of the program that would print the variables fed to it
def cheeseAndCrackers(cheese_count, boxes_of_crackers):
print "You have %d cheeses!" %cheese_count
print "You have %d boxes of crackers!" %boxes_of_crackers
print "Man that's enough for a party"
print "Get a blanket.\n"
#First try t... |
class Indexer:
def __init__(self,r,i):
self.real=r
self.imag=i
def __iadd__(self,c):
return Indexer(self.real+c.real,self.imag+c.imag)
def __str__(self): #repr or str
return '{} i{}'.format(self.real,self.imag)
c1=Indexer(10,20)
c2=Indexer(40,80)
print('c1 : ',c1)
print('c2 : ',c2)
c1+=c2
print('c3 : ',c1)... |
#!/usr/bin/python
#
# Copyright 2019 Polyaxon, 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 o... |
# Copyright Istio Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http:#www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, softw... |
from django.contrib import admin
from .models import Contacts
# Register your models here.
admin.site.register(Contacts) |
#Program to generate simple g-code per /u/dubc4 request in the /r/3dprinting subreddit
import math
class StirGCodeGenerator:
def __init__(self, printerDims, zFinal, stirDiameter, stirSpeed, stirTime, stirHeight,
travelSpeed=2400, compatibility=False):
""" Creates a GCode generator fo... |
import asyncio
import discord
from discord.ext import commands
from discord.utils import get
def is_authority():
"""Checks that a member is a mod"""
async def predicate(ctx):
return "Authority Ping" in [r.name for r in ctx.author.roles]
return commands.check(predicate)
def can_banish():
"""... |
# Generated by Django 3.2 on 2021-11-27 04:48
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='District',
fields=[
... |
from hindinballs.util import Tree
root = Tree("root")
allNodes = {"root": root}
set2Word = {}
word2Set = {}
with open("data/set2WordV.txt","r") as s2w:
cont = s2w.read()
sets = cont.split("$")
for set in sets:
pairs = set.split(":")
num = pairs[0]
word = pairs[1]
set2Word[... |
"""
Tests for the unwrapped ufuncs.
This is a WIP; it doesn't work yet for all cases, and might not be a good
approach anyway. For now, test_check_functions is adequate, handling the
wrapped ufuncs via check_functions "eval" and "exec" machinery.
"""
import pytest
import numpy as np
from numpy.testing import assert_... |
# -*- coding: utf-8 -*-
#
# This file is part of EUDAT B2Share.
# Copyright (C) 2016 CERN.
#
# B2Share 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 2 of the
# License, or (at your option) any... |
import datetime
import os
import time
from Main import MachineSpecificSettings, Hyperparameters
from Main.AlphaZero.DistributedSelfPlay import Connection, FitModel
from Main.AlphaZero import Utils
from Main.Training.Connect4 import MemoryBuffers
STATUS_TRAIN_DATA = "trainData"
STATUS_INIT_MODEL = "initModel"
def _g... |
import os
import re
from math import floor
from PIL import Image
def default_save_path(path, size):
savepath, ext = os.path.splitext(path)
savepath = '%s__w%dh%d%s' % (savepath, *size, ext)
return savepath
def assure_path_exists(path):
if not os.path.exists(path):
os.makedirs(path)
def no... |
"""Tests for format_tutorials.py. The `test_expected_output()` function loads a
table of strings and ensures that each leads to the expected output when run
through `process_content()`"""
from format_tutorials import *
import csv
import os
def test_expected_output():
input_strings: list = None
csv_file_path: ... |
# Made by Emperorc
import sys
from com.l2jserver.gameserver.model.quest import State
from com.l2jserver.gameserver.model.quest import QuestState
from com.l2jserver.gameserver.model.quest.jython import QuestJython as JQuest
qn = "66_CertifiedArbalester"
#NPCs
Rindy = 32201
Clayton = 30464
Poitan = 30458
Holvas = 30058... |
import collections
from functools import wraps
from inspect import signature
def string_to_list(s, sep=";"):
if s is None:
return s
if not isinstance(s, str) and isinstance(s, collections.abc.Iterable):
return s
return s.rstrip(sep).split(sep) if s else []
def list_to_string(l, sep=";")... |
"""
extended learning rate scheduler,
which adaptive changes the learning rate based on the progress
"""
import logging
import mxnet as mx
class FixedScheduler(mx.lr_scheduler.LRScheduler):
def __call__(self, num_update):
return self.base_lr
class LinearScheduler(mx.lr_scheduler.LRScheduler):
"""Re... |
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: tensorflow/core/framework/tensor_shape.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.proto... |
#!/usr/bin/env python
"""
dnolivieri: 23 dec 2015
Bootstrap workflow for the MR ensemble RF code.
grep \> all_R.fasta | awk -F"|" '{print $1; split($1,a,"-"); locus[a[3]]+=1}END{for (i in locus){print i, locus[i]}}'
david@treg:/media/disk2TB/BioInf/VsRF/analysis/trees$ cat $(ls *_R.fasta) > all_R.fas... |
# coding:utf-8
import numpy as np
import pandas as pd
from sklearn import svm
import seaborn as sns
import scipy.io as sio
import matplotlib.pyplot as plt
from sklearn import metrics
# from sklearn.grid_search import GridSearchCV
from sklearn.model_selection import GridSearchCV
if __name__ == '__main__':
mat = s... |
import shutil
import subprocess
import sys
import unittest
from mock_tests import test_sqlparsing
import os
from pymongo import MongoClient
client = MongoClient()
TEST_DIR = os.path.dirname(os.path.abspath(__file__))
if __name__ == '__main__':
result = unittest.TextTestRunner(verbosity=2, failfast=True).run(
... |
import copy
from hypothesis import given
from tests.utils import (BoundPortedLeavesPair,
are_bound_ported_leaves_equal)
from . import strategies
@given(strategies.leaves_pairs)
def test_shallow(leaves_pair: BoundPortedLeavesPair) -> None:
bound, ported = leaves_pair
assert are_boun... |
import sys
from subprocess import call
from .command import BaseCommand
class Command(BaseCommand):
help = 'Run background task worker'
def add_arguments(self, parser):
parser.add_argument('-b', '--beats', action='store_true', help='Run beats sheduler with worker')
def execute(self, args):
... |
from sandglass.time.api import API
from sandglass.time.api import ApiDescribeResource
class ApiV1DescribeResource(ApiDescribeResource):
"""
Resource to describe API version 1.
"""
version = "v1"
def describe(self):
resource_info_list = []
for resource in self.resources:
... |
# Must be run from parent directory: poetic pumas
import os
import sys
import time
from random import choice
from string import ascii_lowercase as KEYS
from typing import Dict
from blessed import Terminal
from pygame import mixer
from soundboard import Soundboard
def draw(x: int, y: int, char: str) -> None:
"""T... |
import os
import math
import pathlib
import sys
import numpy as np
import pandas as pd
from datetime import datetime
from openpyxl import Workbook, load_workbook
import parser_april20_backward
import parser_may20_forward
def read_data(path):
try:
data = pd.read_html(path, decimal=',', thousands='.')
... |
# -*- coding: utf-8 -*-
import os, sys, commands, csv, datetime
import pygame
SHOULD_RUN_FULLSCREEN = os.getenv('PHOTOMATON_SHOULD_RUN_FULLSCREEN') == '1'
PATH_TO_LAST_CAPTURED_PHOTO = os.getenv('PHOTOMATON_LAST_CAPTURED_TEXT_PATH')
PATH_TO_PHOTOSETS_CSV = os.getenv('PHOTOMATON_PHOTOSETS_CSV_PATH')
COMMAND_FOR_TAKING_... |
def convert(string: str) -> int:
result = 0
bool_negative = False
if string.startswith("-"):
bool_negative = True
string = string[1:]
length = len(string)
for c in string:
if ord(c) >= ord("9") or ord(c) <= ord("0"):
return 0
result += int(c) * (10 ** (len... |
# Modifications © 2019 Hashmap, 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 wr... |
import logging
from malduck.extractor import Extractor
from malduck.pe import MemoryPEData
log = logging.getLogger(__name__)
__author__ = "c3rb3ru5"
__version__ = "1.0.0"
class Azorult(Extractor):
"""
Azorult C2 Domain Configuration Extractor
"""
family = 'azorult'
yara_rules = 'azorult',... |
from notebooks.profiles._base_profile import BaseProfile # noqa: F401
from notebooks.profiles._euclidean_profile import EuclideanProfile # noqa: F401
from notebooks.profiles._naive_bayes_profile import NaiveBayesProfile # noqa: F401
from notebooks.profiles._voting_profile import VotingProfile # noqa: F401
|
from django.http import HttpResponse
from django.shortcuts import render, redirect
from django.contrib.auth import authenticate, login, get_user_model
from django.contrib.auth.models import User
from django.utils.http import is_safe_url
from django.conf.urls.static import static
from .forms import ContactForm, Login... |
import plotly.express as px
from mobspy import *
"""
Here we have a NOR_GATE
There are two possible repressors for the Promoter A and B
If any of them bind to the Promoter the protein can no longer be expressed
"""
def NOR_GATE(A_conc, B_conc):
# Here we define the Protein to be produced, the Promo... |
info = {
"name": "br",
"date_order": "YMD",
"january": [
"gen",
"genver"
],
"february": [
"c'hwe",
"c'hwevrer"
],
"march": [
"meur",
"meurzh"
],
"april": [
"ebr",
"ebrel"
],
"may": [
"mae"
],
"jun... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.