text
stringlengths
1
927k
#!/usr/bin/env python import argparse import csv import gzip import os from functools import partial import numpy import pandas from Bio import SeqIO def nice_size(size): # Returns a readably formatted string with the size words = ['bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB'] prefix = '' try: ...
FILENAME = 'sequences_full.csv' VOCAB_SIZE = None UNK = 'UNK' POS_TAGS = { 'CC' : '<CC>', 'CD' : '<CD>', 'DT' : '<DT>', 'EX' : '<EX>', 'FW' : '<FW>', 'IN' : '<IN>', 'JJ' : '<JJ>', 'JJR' : '<JJR>', 'JJS' : '<JJS>', 'LS' : '<LS>', 'MD' : '<MD>', 'NN' : '<NN>', 'NNS' : '<NNS>', 'NNP' : '<NNP>', 'NNPS' : '<NNPS>', 'PDT' :...
# coding: utf-8 """ Xero Payroll AU This is the Xero Payroll API for orgs in Australia region. # noqa: E501 Contact: api@xero.com Generated by: https://openapi-generator.tech """ import re # noqa: F401 from xero_python.models import BaseModel class Timesheets(BaseModel): """NOTE: This clas...
import numpy as np """ This file implements various first-order update rules that are commonly used for training neural networks. Each update rule accepts current weights and the gradient of the loss with respect to those weights and produces the next set of weights. Each update rule has the same interface: def updat...
import numpy as np import re, os from pmesh.pm import ParticleMesh from nbodykit.lab import BigFileCatalog, BigFileMesh, MultipleSpeciesCatalog, FFTPower from nbodykit import setup_logging from mpi4py import MPI import HImodels # enable logging, we have some clue what's going on. setup_logging('info') #...
# Copyright (c) 2020 Antti Kivi # Licensed under the MIT License """A module that contains the class that represents the project that the build script acts on. """ import importlib import json import logging import os from typing import Any, List from .support.system import System from .support import environment ...
from PIL import Image from petpetgif.saveGif import save_transparent_gif from pkg_resources import resource_stream frames = 10 resolution = (128, 128) delay = 20 def make(source, dest): """ :param source: A filename (string), pathlib.Path object or a file object. (This parameter corresponds ...
import unittest from remora.tracker import Tracker from remora.collectors import AsyncCollector import requests_mock import json class TestTracker(unittest.TestCase): def test_send_payload(self): url = 'http://127.0.0.1:31311' with requests_mock.mock() as m: req = m.put(url) ...
__all__ = [ 'UserBonus', 'UserBonusCreateRequestParameters' ] from attr.validators import optional, instance_of import datetime from decimal import Decimal from typing import Any from .primitives.base import BaseTolokaObject from .primitives.parameter import Parameters from ..util._codegen import attribute c...
r""" Sage Input Formatting This module provides the function :func:`sage_input` that takes an arbitrary sage value and produces a sequence of commands that, if typed at the ``sage:`` prompt, will recreate the value. If this is not implemented for a particular value, then an exception is raised instead. This might be u...
# Copyright (c) 2012-2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. ''' Bitcoin base58 encoding and decoding. Based on https://bitcointalk.org/index.php?topic=1026.0 (public domain) ''' import has...
from absl import logging import numpy as np import tensorflow as tf import cv2 YOLOV3_LAYER_LIST = [ 'yolo_darknet', 'yolo_conv_0', 'yolo_output_0', 'yolo_conv_1', 'yolo_output_1', 'yolo_conv_2', 'yolo_output_2', ] YOLOV3_TINY_LAYER_LIST = [ 'yolo_darknet', 'yolo_conv_0', 'yolo...
""" Code that goes along with the Airflow located at: http://airflow.readthedocs.org/en/latest/tutorial.html """ from airflow import DAG from airflow.operators.bash_operator import BashOperator from datetime import datetime, timedelta default_args = { "owner": "airflow", "depends_on_past": False, "start_d...
# Copyright 2021 Raven 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 law or ...
from django.contrib.sitemaps import Sitemap from Blog.models import Post class BlogSitemap(Sitemap): changefreq = "weekly" priority = 0.5 def items(self): return Post.objects.filter(status=True) def lastmod(self, obj): return obj.published_date
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the Apache 2.0 License. import socket import ssl import msgpack import struct import select import contextlib import json import logging import time import os from enum import IntEnum from cryptography import x509 from cryptography.hazmat.back...
import re from typing import Pattern from faker.providers.automotive.de_DE import Provider as DeDeAutomotiveProvider from faker.providers.automotive.es_ES import Provider as EsEsAutomotiveProvider from faker.providers.automotive.ro_RO import Provider as RoRoAutomotiveProvider from faker.providers.automotive.ru_RU imp...
import pickle import numpy as np from MulticoreTSNE import MulticoreTSNE as TSNE from qubo_nn.data import LMDBDataLoader from qubo_nn.config import Config cfg_id = '27_gen4' cfg = Config('../').get_cfg(cfg_id) cfg["use_big"] = False lmdb_loader = LMDBDataLoader(cfg, reverse=False, base_path='../') X = [] y = [] for ...
import time import types import pytest import teek from teek.extras import tooltips def run_event_loop(for_how_long): # this is dumb start = time.time() while time.time() < start + for_how_long: teek.update() @pytest.mark.slow def test_set_tooltip(): window = teek.Window() assert not ha...
def calc_shipping(): print("calc shipping")
#standard import unittest import math # from collections import OrderedDict from random import uniform #external import pandas as pd from scipy.spatial import KDTree def Find_RSE_range(df, RSEs, minrange): sub_df = df[['vehicle_ID', 'location_x', 'location_y']] tree = KDTree(sub_df[['location_x', 'locati...
import os import numpy as np from simbig import halos as Halos np.random.seed(918234) theta_x_pairs = [] for i in range(1000): # read in halo catalog halos = Halos.Quijote_LHC_HR(i, z=0.5) # impose random halo mass limit as a proxy for baryonic effect Mlim = np.random.uniform(12.5, 13.0) the...
import os import sys import re import shutil import argparse import string from build.sdk_build_utils import * IOS_ARCHS = ['i386', 'x86_64', 'armv7', 'arm64'] def updateUmbrellaHeader(filename, args): with open(filename, 'r') as f: lines = f.readlines() for i in range(0, len(lines)): match = re.searc...
""" Copyright (c) 2018-2022 Intel 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 wri...
# -*- coding: utf-8 -*- """ ***************************** Time-respecting VF2 Algorithm ***************************** An extension of the VF2 algorithm for time-respecting graph ismorphism testing in temporal graphs. A temporal graph is one in which edges contain a datetime attribute, denoting when interaction occurr...
#------------------------------------------------------------------------------------------# # This file is part of Pyccel which is released under MIT License. See the LICENSE file or # # go to https://github.com/pyccel/pyccel/blob/master/LICENSE for full license details. # #----------------------------------------...
# Generated by Django 2.1.5 on 2019-01-23 19:03 import datetime from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('shortener_app', '0008_auto_20181205_2300'), ] operations = [ migrations.AddField( model_name='shorturl', ...
import asyncio import logging from typing import Any, Dict import sentry_sdk from fastapi import BackgroundTasks, FastAPI from sentry_sdk.integrations.asgi import SentryAsgiMiddleware import elaspic_rest_api from elaspic_rest_api import config from elaspic_rest_api import jobsubmitter as js from elaspic_rest_api.type...
import numpy import math from rpncalc.classes import ActionEnum class BinaryOperator(ActionEnum): addition = '+' subtraction = '-' multiplication = '*' division = '/' integer_division = '//' power = '^' atan2 = 'atan2', \ "Returns quadrant correct polar coordinate theta = atan2(y,...
import sqlite3 from os import path import sys import logging app_logger = logging.getLogger("api_logic_server_app") def log(msg: any) -> None: app_logger.info(msg) # print("TIL==> " + msg) def connection() -> sqlite3.Connection: ROOT: str = path.dirname(path.realpath(__file__)) log(ROOT) _connec...
"""TRCA utils.""" import numpy as np from scipy.signal import filtfilt, cheb1ord, cheby1 from scipy import stats def round_half_up(num, decimals=0): """Round half up round the last decimal of the number. The rules are: from 0 to 4 rounds down from 5 to 9 rounds up Parameters ---------- ...
'''Train a simple deep CNN on the CIFAR10 small images dataset. It gets to 75% validation accuracy in 25 epochs, and 79% after 50 epochs. (it's still underfitting at that point, though). ''' from __future__ import print_function from time import time import keras from keras.datasets import cifar10 from keras.preproce...
# Copyright 2015 The TensorFlow 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 applica...
# Copyright 2017 The TensorFlow 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 applica...
#!/usr/bin/env python # # Copyright (c) 2016, The OpenThread Authors. # 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 # ...
from .dawid_skene import DawidSkene from .flyingsquid import FlyingSquid from .generative_model import GenerativeModel from .gold import GoldCondProb from .majority_voting import MajorityVoting, MajorityWeightedVoting from .metal import MeTaL from .naive_bayes import NaiveBayesModel from .snorkel import Snorkel
"create by poomipat01" import asyncio import discord import youtube_dl import os from discord.ext import commands def read_token(): with open("token.ini",'r') as f: lines = f.readline() return lines.strip() # Suppress noise about console usage from errors youtube_dl.utils.bug_reports_message = l...
# /usr/bin/env python # Download the twilio-python library from twilio.com/docs/libraries/python import os from twilio.rest import Client # Find these values at https://twilio.com/user/account # To set up environmental variables, see http://twil.io/secure account_sid = os.environ['TWILIO_ACCOUNT_SID'] auth_token = "YY...
# -*- coding: utf-8 -*- # Generated by Django 1.11.24 on 2019-09-07 12:47 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('award', '0002_project'), ] operations = [ ...
import argparse import logging from salamanca import data from salamanca import currency COMMANDS = {} # # Download wb data # def download_wb_cli(parser): log = 'Print log output during download.' parser.add_argument('--log', help=log, action="store_true") overwrite = 'Overwrite local files if they exi...
import pytest from django.core.exceptions import ValidationError from pretalx.common.css import validate_css from pretalx.event.models import Event @pytest.fixture def valid_css(): return ''' body { background-color: #000; display: none; } .some-descriptor { border-style: dotted dashed solid double; BORD...
#!/home/hkolstee/bproject/virtenv/bin/python # When the django-admin.py deprecation ends, remove this script. import warnings from django.core import management try: from django.utils.deprecation import RemovedInDjango40Warning except ImportError: raise ImportError( 'django-admin.py was deprecated in ...
import rospy from pid import PID from yaw_controller import YawController from lowpass import LowPassFilter GAS_DENSITY = 2.858 ONE_MPH = 0.44704 class Controller(object): def __init__(self, vehicle_mass, fuel_capacity, brake_deadband, decel_limit, accel_limit, wheel_radius, wheel_base, steer_ratio, max_lat_acce...
# -*- coding:utf-8 -*- """ 钉钉机器人接口 Author: HuangTao Date: 2018/08/04 Update: 2018/12/24 1. 增加markdown格式消息推送; """ from quant.utils import logger from quant.utils.http_client import AsyncHttpRequests class DingTalk: """ 钉钉机器人接口 """ BASE_URL = 'https://oapi.dingtalk.com/robot/send?access_token=' @...
# coding: utf-8 """ 3Di API 3Di simulation API (latest stable version: v3) Framework release: 2.9.0 3Di core release: 2.2.2 deployed on: 11:01AM (UTC) on January 11, 2022 # noqa: E501 The version of the OpenAPI document: v3 Contact: info@nelen-schuurmans.nl Generated by: https://openapi-ge...
# coding=utf-8 # Copyright 2022 The Google Research 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 applicab...
""" Script for running depth inference assuming MOTS dataset structure """ import logging import os import sys from pathlib import Path, PurePath import click import matplotlib.pyplot as plt import numpy as np import tensorflow.compat.v1 as tf from IPython.core import ultratb from PIL import Image import diw from diw...
"""Nintendo Wishlist integration.""" import logging import voluptuous as vol from homeassistant import core from homeassistant.const import CONF_SCAN_INTERVAL from homeassistant.helpers.aiohttp_client import async_get_clientsession import homeassistant.helpers.config_validation as cv from homeassistant.helpers.discov...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # This file is part of Androwarn. # # Copyright (C) 2012, 2019, Thomas Debize <tdebize at mail.com> # All rights reserved. # # Androwarn is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by #...
from decimal import Decimal as D from django.conf import settings from django.core.exceptions import ObjectDoesNotExist from django.utils.translation import ugettext_lazy as _ from izi.core import loading Scale = loading.get_class('shipping.scales', 'Scale') weight_precision = getattr( settings, 'IZI_SHIPPING_W...
''' Table Printer practice project Author: Carissa Jones ''' tableData = [['I', 'out', 'chair.'], ['just', 'of', 'Im'], ['fell', 'my', 'fine.']] def printTable(tableData): '''Given list of strings, tableData, displays in a well-organized table with each column right-justified'...
import bpy, math, os, gpu, bgl import numpy as np from . import utility from fractions import Fraction from gpu_extras.batch import batch_for_shader def encodeLogLuvGPU(image, outDir, quality): input_image = bpy.data.images[image.name] image_name = input_image.name offscreen = gpu.types.GPUOffScreen(input...
# -*- coding: utf-8 -*- # Generated by Django 1.9.7 on 2016-09-14 23:40 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('contentcuration', '0014_channel_language'), ] operations = [ migrations.Alte...
import json #top 50 all cliques in category #top 50 size n till n=2 in category def update_ref(data, ref): for clique_str, count in data: clique = eval(clique_str) if ref.get(len(clique)) is None: ref[len(clique)] = [] ref[len(clique)].append((clique, count)) return ref wi...
import os import numpy as np from PyQt5 import uic from PyQt5.QtCore import QDir, Qt, QTimer, pyqtSignal from PyQt5.QtGui import QImage, QPainter, QPalette, QPixmap from PyQt5.QtWidgets import (QHBoxLayout, QSlider, QWidget, QAction, QApplication, QFileDialog, QLabel, QMainWindow, QMenu, QMessageBox, QScrollArea, QSize...
from __future__ import absolute_import, division from tensorflow.python import debug as tf_debug import keras.backend as K def keras_set_tf_debug(): sess = K.get_session() sess = tf_debug.LocalCLIDebugWrapperSession(sess) sess.add_tensor_filter("has_inf_or_nan", tf_debug.has_inf_or_nan) K.set_session...
"""Botocore with support for AWS SSO credential assets.""" # Copyright 2012-2014 Amazon.com, Inc. or its affiliates. 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. A copy of # the License is located at # # http:...
#!/usr/bin/python # ## @file # # For testing how to write 2048 x 2048 pixels at 100fps. # # Hazen 10/13 # import ctypes import ctypes.util import numpy import time import hamamatsu_camera as hc print "camera 0 model:", hc.getModelInfo(0) hcam = hc.HamamatsuCameraMR(0) # Set camera parameters. cam_offset = 100 cam_...
class Config(object): def __init__(self): self.servers = [ "127.0.0.1" ] self.keyspace = 'at_inappscoring'
# app/models.py from app import db class Bucketlist(db.Model): """This class represents the bucketlist table.""" __tablename__ = 'bucketlists' id = db.Column(db.Integer, primary_key=True) name = db.Column(db.String(255)) date_created = db.Column(db.DateTime, default=db.func.current_timestamp()) ...
""" Copyright: Copyright 2019 by Katsuya SHIMABUKURO. License: MIT, see LICENSE for details. """ import pathlib import gzip import requests import tqdm import numpy as np from gensim.models import KeyedVectors FILE_ID = '0B7XkCwpI5KDYNlNUTTlSS21pQmM' SOURCE_URL = 'https://drive.google.com/uc?export=download&i...
import numpy import pandas import xarray as xr import numpy as np from dolo.compiler.model import Model from dolo.numeric.optimize.ncpsolve import ncpsolve from dolo.numeric.optimize.newton import newton as newton_solver from dolo.numeric.optimize.newton import SerialDifferentiableFunction ## TODO: extend for mc proc...
# pylint doesn't understand the way that pytest constructs fixture dependnecies # pylint: disable=redefined-outer-name import datetime import os import shutil import subprocess import sys import tempfile import uuid import airflow.plugins_manager import docker import pytest from dagster import check from dagster.core...
for numero1 in range(1, 11): print('\n', "Tabla del " + str(numero1)) print("--------------") for numero2 in range(1, 11): print(str(numero1) + " por " + str(numero2) + " es " + str(numero1 * numero2))
import opentracing from signalfx_tracing import utils from wrapt import wrap_function_wrapper from aioredis_opentracing import tracing config = utils.Config( tracer=None, ) def instrument(tracer=None): aioredis = utils.get_module('aioredis') if utils.is_instrumented(aioredis): return tracin...
import pytest from di.core.compose import ApplicationComposer, ComposedApplication from di.core.element import Element from di.core.injection import InjectionSolver from di.core.instance import ( ApplicationInstanceElementNotFound, RecursiveApplicationInstance, RecursiveApplicationInstanceBuilder, Recu...
''' Copyright (c) The Dojo Foundation 2011. All Rights Reserved. Copyright (c) IBM Corporation 2008, 2011. All Rights Reserved. ''' from .base import AuthBase class PublicAuth(AuthBase): cookieName = 'coweb.auth.public.username' _userId = 0 def requires_login(self): '''Does not require login. Usern...
from ctypes import * class PyObject(Structure): _fields_ = [('ob_refcnt', c_size_t), ('ob_type', py_object)] class PseudoTypeType(object): def __getattribute__(self, name): if name == '__repr__': raise Exception() elif name == '__name__': return 'PseudoT...
# U S Σ R Δ T O R / Ümüd """ U S Σ R Δ T O R """ from userbot import LOGS from telethon.tl.types import DocumentAttributeFilename def __list_all_modules(): from os.path import dirname, basename, isfile import glob mod_paths = glob.glob(dirname(__file__) + "/*.py") all_modules = [ basename(f)...
# FIXME: not required dependency. from graphviz import Digraph def graph2dot(x, **kwargs): dot = Digraph(body=["rankdir=LR;"], **kwargs) path = x.get_computation_path() for i in path: if i.is_input: dot.node(str(i.id), i.name, color="green") elif i.is_parameter: do...
#!/usr/bin/env python import sys import os from setuptools import setup, find_packages if len(sys.argv) == 1: sys.argv.append('install') if sys.argv[1] == 'test': from subprocess import call sys.exit(call([sys.executable, '-m', 'pytest'] + sys.argv[2:])) # Create the resource file dataflow/git_revision ...
def remove_punctuation(st, case='l'): """ takes in a string and returns a list of words with no punctuation""" punctuation = '!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}“”‘’~' all_words = st.split() cap_words = [] for c in punctuation: st = st.replace(c, '') if case == 'u': for word in all...
# -*- coding:utf-8 -*- """ Author: Weichen Shen,wcshen1994@163.com Reference: [1] Lian J, Zhou X, Zhang F, et al. xDeepFM: Combining Explicit and Implicit Feature Interactions for Recommender Systems[J]. arXiv preprint arXiv:1803.05170, 2018.(https://arxiv.org/pdf/1803.05170.pdf) """ import tensorflow as tf fr...
#!/usr/local/bin/python import argparse import logging import os import shlex import subprocess import sys _DEFAULT_LOG_LEVEL = 'INFO' if __name__ == '__main__': parser = argparse.ArgumentParser(prog='deploy', allow_abbrev=False, description=""" Deploys a project to AWS ECS and CloudReactor using An...
# Test cases for restful API from app import app import unittest class FlaskappTests(unittest.TestCase): def setUp(self): # creates a test client self.app = app.test_client() # propagate the exceptions to the test client self.app.testing = True def test_users_status_code(self): ...
# Copyright (c) 2009 Denis Bilenko, denis.bilenko at gmail com # Copyright (c) 2010 Eventlet Contributors (see AUTHORS) # and licensed under the MIT license: # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal #...
import sys from argparse import ArgumentParser from . import search def parse_args(): parser = ArgumentParser(prog="googlelyrics") parser.add_argument( "--no-header", action="store_true", help="don't print the info header" ) parser.add_argument("query", type=str, nargs="+", help="search quer...
"""episode_source Revision ID: d6fcd3132857 Revises: bca0b2a3b5f4 Create Date: 2021-10-17 18:51:29.927189 """ import sqlalchemy as sa from sqlalchemy.sql import table, column from sqlalchemy import String from alembic import op # revision identifiers, used by Alembic. revision = "d6fcd3132857" down_revision = "bca0b...
"""Support for LCN devices.""" import logging import pypck import voluptuous as vol import homeassistant.helpers.config_validation as cv from homeassistant.components.climate import DEFAULT_MAX_TEMP, DEFAULT_MIN_TEMP from homeassistant.const import ( CONF_ADDRESS, CONF_BINARY_SENSORS, CONF_COVERS, CON...
"""profiles_project URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/2.2/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Cl...
# Faça um programa que leia o nome completo de uma pessoa, mostrando em seguida o primeiro e o último nome, separadamente. #Ex. Ana Maria de Souza # Primeiro = Ana # Último = Souza nome = str(input('Digite seu nome Completo: ')).strip().upper() n = nome.split() print('Seu nome completo é: {}'.format(nome)) print('Se...
# Generated by Django 2.0.8 on 2019-02-27 15:56 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('article', '0001_initial'), ] operations = [ migrations.AlterField( model_name='category_article', name='add_time', ...
import sys, os import shutil def SilentMkdir(theDir): try: os.mkdir(theDir) except: pass return 0 def Run_00_CameraInit(baseDir,binDir,srcImageDir): SilentMkdir(baseDir + "/00_CameraInit") binName = binDir + "\\aliceVision_cameraInit.exe" dstDir = baseDir + "/00_CameraInit/" cmdLine = binName cmdLine =...
import pybullet as p import time import math from datetime import datetime #clid = p.connect(p.SHARED_MEMORY) p.connect(p.GUI) p.loadURDF("plane.urdf",[0,0,-0.3]) kukaId = p.loadURDF("kuka_iiwa/model.urdf",[0,0,0]) p.resetBasePositionAndOrientation(kukaId,[0,0,0],[0,0,0,1]) kukaEndEffectorIndex = 6 numJoints = p.getNu...
# Copyright 2019 BDL Benchmarks 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 applica...
# # PySNMP MIB module V-BRIDGE-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/V-BRIDGE-MIB # Produced by pysmi-0.3.4 at Wed May 1 15:33:25 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019,...
""" Copyright 2020 The OneFlow 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 law or agr...
""" author: adam h freedman afreedman405 at gmail.com data: Fri Aug 26 10:55:18 EDT 2016 This script takes as an input Rcorrector error corrected Illumina paired-reads in fastq format and: 1. Removes any reads that Rcorrector indentifes as containing an error, but can't be corrected, typically low complexity sequence...
"""The baseline Pommerman environment. This evironment acts as game manager for Pommerman. Further environments, such as in v1.py, will inherit from this. """ import json import os import numpy as np import time from gym import spaces from gym.utils import seeding import gym from .. import characters from .. import ...
import syft as sy import torch from typing import Dict from typing import Any import logging logger = logging.getLogger(__name__) def extract_batches_per_worker(federated_train_loader: sy.FederatedDataLoader): """Extracts the batches from the federated_train_loader and stores them in a dictionary (keys = ...
# -*- coding: future_fstrings -*- from django.db import models from django.contrib.auth.models import User import datetime from pytz import timezone def now(): # return Main.objects.all().first().now return datetime.datetime.now() def set_now(d): m = Main.objects.all().first() m.now = d m.save() class Team(mode...
# -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2017-10-25 10:58 from __future__ import unicode_literals import django.db.models.deletion from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('flexible_reports', '0008_auto_20171025_0553'), ] o...
""" Top-level URL lookup for InvenTree application. Passes URL lookup downstream to each app as required. """ from django.conf.urls import url, include from django.contrib import admin from django.contrib.auth import views as auth_views from qr_code import urls as qr_code_urls from company.urls import company_urls ...
import sys import os import json import time from nlp_tools import tokenize_words, build_prob_language_model, generate_text_using_trigrams from files_io import load_text, serialize, deserialize if __name__ == '__main__': args = sys.argv[1:] N_WORDS = args[0] FILES_FOLDER = 'files' TMP_FOLDER = os.path...
# (c) Copyright 2016 Hewlett-Packard Enterprise Development Company, L.P. # # 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 require...
import numpy as np from random import random import matplotlib.pyplot as plt import time import logging logging.basicConfig(level=logging.INFO,filename='simulation.log', filemode='w',format='%(asctime)s - %(message)s',datefmt='%d-%b-%y %H:%M:%S') np.seterr(all='warn') #################################################...
import cy_aho_corasick as cy_aho # print(dir(cyAhoCorasick)) t = cy_aho.Trie(remove_overlaps=True) t.insert(b"sugar") print(t.parse_text(b"sugarcane sugarcane sugar canesugar")) print(t.parse_text_values(b"sugarcane sugarcane sugar canesugar"))
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. """ Data pre-processing: build vocabularies and binarize training data. """ import logging import os import shutil impo...
from hyperparameter_hunter import Environment, CrossValidationExperiment from hyperparameter_hunter.utils.learning_utils import get_toy_classification_data from sklearn.model_selection import RepeatedStratifiedKFold from xgboost import XGBClassifier def do_full_save(experiment_result): """This is a simple check t...
"""This module contains the general information for MacpoolUniverse ManagedObject.""" import sys, os from ...ucsmo import ManagedObject from ...ucscoremeta import UcsVersion, MoPropertyMeta, MoMeta from ...ucsmeta import VersionMeta class MacpoolUniverseConsts(): pass class MacpoolUniverse(ManagedObject): ...