text stringlengths 3.07k 22.1k |
|---|
import os, re, json
import logging
from time import sleep
import requests
import sys
import argparse
from src.logger import init_console_logger
from src.config import BASE_SISTR_URL, TASK_POLL_SLEEP_TIME
PROG_DESC = '''
Python script for web analysis of genome by SISTR
================================================... |
import time
from terzani.search.search import get_markers, search_country, search_photos, search_similar_photos
from flask import Flask, redirect, url_for, render_template, request, jsonify, flash
from flask_pymongo import PyMongo
from werkzeug.utils import secure_filename
import os
import json
from dotenv import load_... |
import MalmoPython
import numpy as np
import os
import random
import sys
import time
import json
import errno
class environment():
def __init__(self):
self.maze4 = '''
<MazeDecorator>
<SizeAndPosition length="10" width="10" yOrigin="225" zOrigin="0" height="180"/>
... |
import ast
import configparser
import os
import botocore.session
import botocore.exceptions
from platform import system
from types import MethodType
def get_prepared_config(
profile,
region,
ssl_verification,
adfs_ca_bundle,
adfs_host,
output_format,
provider_id... |
"""
Binary sensors on Zigbee Home Automation networks.
For more details on this platform, please refer to the documentation
at https://home-assistant.io/components/binary_sensor.zha/
"""
import logging
from homeassistant.components.binary_sensor import DOMAIN, BinarySensorDevice
from homeassistant.components import z... |
"""
desitarget.train.train_mva_decals
=================================
- Training code developed by <NAME>
- Update to run with DR3 by <NAME>
This example can be run with the module desitarget/bin/qso_training
Three actions controlled by "step" flag: train - test - extract_myRF
Two examples of random forest (with ... |
from django.conf import settings
from apps.client_details.models import ClientDetailsBase
from apps.tags.models import Tag
from canvas import stickers
from canvas.cache_patterns import CachedCall
from canvas.redis_models import RealtimeChannel
from canvas.util import base36encode, strip_template_chars
class ContentD... |
"""
CS6476: Problem Set 3 Tests
In this script you will find some simple tests that will help you
determine if your implementation satisfies the autograder
requirements. In this collection of tests your code output will be
tested to verify if the correct data type is returned. Additionally,
there are a couple of examp... |
# Copyright (c) 2019 charlysan
# 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, distribute... |
# -*- coding: utf-8 -*-
"""
This module implements the denisty parameterisation of aqueous sulfuric acid
of Myhre et al. from 1998.
"""
import numpy as np
import warnings
from ..util import NoConvergence
_data = np.array(
[
[999.8426, 0.03345402, -0.005691304, 0, 0],
[547.2659, -5.300445, 0.0118... |
"""
Tool to extract and pretty-print PDF annotations for reviewing.
"""
__version__ = '0.3'
import bisect
import collections
import itertools
import logging
import typing
from pdfminer.pdfinterp import PDFResourceManager, PDFPageInterpreter
from pdfminer.pdfpage import PDFPage
from pdfminer.layout import (LAParams, ... |
"""Nitsche's Method for a discontinuous variational formulation is used
to solve a given demag field problem. The parameter gamma tweaks the
amount of discontinuity we allow over the core boundary"""
__author__ = "<NAME>"
__copyright__ = __author__
__project__ = "Finmag"
__organisation__ = "University of Southampton"
... |
import rdflib
from . import template
SKOS = rdflib.Namespace("http://www.w3.org/2004/02/skos/core#")
class TestStaticProperties(template.IngestTest):
data = '''<?xml version="1.0" encoding="UTF-8"?>
<PolymerNanocomposite>
<ID>L141_S19_Gao_2013</ID>
<Control_ID>L141_S1_Gao_2013</Control_ID>
... |
import base64
import json
import logging
import os
import re
import sys
from lxml import html
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives.kdf.pbkdf2 import PBKDF2HMAC
from cryptography.hazmat.primitives import hashes
from cryptography.hazmat.primitives.ciph... |
#!/usr/bin/python3
from os.path import isfile, dirname, abspath, join
import argparse
import sys
import yaml
from mtools.util import logevent
import csv
import logging
ROOT_DIR = dirname(abspath(__file__))
VERSIONS = ['3.6', '4.0']
DEBUG = False
def all_keys(x):
k = []
if dict == type(x):
for kk in ... |
#!/usr/bin/env python3
# -*- coding:utf-8 -*-
# Copyright (c) Megvii, Inc. and its affiliates.
import random
import cv2
import numpy as np
from yolox.utils import adjust_box_anns, get_local_rank
from yolox.data.data_augment import random_affine,random_cutout
from yolox.data.datasets.datasets_wrapper import Dataset
f... |
from itertools import chain
import jinja2
class FVisitor:
def visit(self, node):
meth_name = 'visit_{}'.format(type(node).__name__)
# Get the specific method for this type, else
# use the generic one.
method = getattr(self, meth_name, self.generic_visit)
return method(no... |
import concurrent.futures
from numba import jit, float32, int8, int64, optional, boolean
try:
from numba.experimental import jitclass
except ModuleNotFoundError:
from numba import jitclass
import numpy as np
from collections import OrderedDict
from ..tinyhouse import InputOutput
from ..tinyhouse import ProbMat... |
import math
import multiprocessing as mp
import random
from pathlib import Path
from unittest import mock
import numpy as np
import matplotlib.pyplot as plt
import pybullet
import pybullet_utils.bullet_client as bc
from direct.showbase.ShowBase import ShowBase
from smarts.core.controllers.actuator_dynamic_controller ... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Basic units handling and conversion.
>>> eng = units.units['eng']
>>> cxc = units.units['cxc']
>>> comb = set()
>>> for e in eng.keys():
... comb.add((eng[e], cxc[e]))
>>> comb # ** entries require explicit conversion
{('AMP', 'A'),
('ASEC', 'a... |
"""Views and viewsets for DNSaaS API"""
import django_filters
import ipaddress
import logging
from django.core.exceptions import MultipleObjectsReturned, ValidationError
from django.core.urlresolvers import reverse
from django.db import IntegrityError
from django.db.models import Prefetch, Q
from powerdns.utils impo... |
# example of defining a 70x70 patchgan discriminator model
from random import random
from keras.models import Input
from matplotlib import pyplot
from numpy import asarray
from numpy import load
from numpy import ones
from numpy import zeros
from numpy.random import randint
from tensorflow.keras.initializers import Ra... |
"""
Status Progress of rack map load/refresh/load_refresh
"""
from base_progress import BaseProgress
class RackMapProgress(BaseProgress):
# progress type
TYPE_LOAD_MAP = "load_map"
TYPE_REFRESH_MAP = "refresh_map"
TYPE_LOAD_REFRESH_MAP = "load_refresh_map"
STATUS_SEND_HTTP_REQUEST = "send h... |
# -*- coding: utf-8 -*- {{{
# vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et:
# Copyright (c) 2013, Battelle Memorial Institute
# 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. Redistri... |
# Subset of test.support from CPython 3.5, just what we need to run asyncio
# test suite. The code is copied from CPython 3.5 to not depend on the test
# module because it is rarely installed.
# Ignore symbol TEST_HOME_DIR: test_events works without it
from __future__ import absolute_import
import functools
import gc... |
from .. import xray_io, utils
from . import fmt, convert
from .model import exp as model_exp
from . import utils as det_utils
def write_details(chunked_writer, lvl_dets, context, fpath):
dm_cw = xray_io.ChunkedWriter()
meshes_object = lvl_dets.meshes_object
dm_count = len(meshes_object.children)
if... |
import numpy as np
import torch
import torch.nn as nn
from ..stepper import TimeStepper
from ..upwind import UpWind2dRHI
from ..init import initgen
from ..spectral import *
class BurgersTime2d(nn.Module, TimeStepper):
"""
2d Burgers equation
\partial_t u+u\cdot\nabla u=v\laplace u+f
"""
@property
... |
from typing import Type
from dis_snek.models import Scale, User, listen
from dis_snek.models.application_commands import (
OptionTypes,
slash_command,
slash_option,
)
from dis_snek.models.command import message_command
from dis_snek.models.context import InteractionContext
from dis_snek.models.discord_objec... |
# 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 applic... |
from matplotlib.patches import Ellipse, Arrow, Rectangle
import astropy.io.fits as pf
import numpy as np
import matplotlib
import matplotlib.pyplot as pl
import sys
from mpl_toolkits.axes_grid1 import make_axes_locatable
from matplotlib.offsetbox import AnchoredText, AnchoredOffsetbox, AuxTransformBox, VPacker, TextAre... |
# -*- coding: utf-8 -*-
"""
L{Options} class: collect the possible options that govern the parsing possibilities. The module also includes the L{ProcessorGraph} class that handles the processor graph, per RDFa 1.1 (i.e., the graph containing errors and warnings).
@summary: RDFa parser (distiller)
@requires: U{RDFLib<... |
import itertools, re, os, configparser, sys, json
from shutil import copyfile
BOOK_DICT = {'1CH': '13',
'1CO': '47',
'1JN': '63',
'1KI': '11',
'1PE': '61',
'1SA': '09',
'1TH': '53',
'1TI': '55',
'2CH': '14',
'2CO': '48',
'2JN': '64',
'2KI': '12',
'2PE': '62',
'2SA': '10',
'2TH': '54',
... |
# coding: utf8
import struct
from collections import namedtuple
from kafkaka.util import crc32
"""
Format C Type Python type Standard size Notes
x pad byte no value
c char string of length 1 1
b signed char integer 1 (3)
B unsigned char ... |
from flask import Flask, make_response, request
from os import path
from pygments import highlight
from pygments.formatters.html import HtmlFormatter
from pygments.formatter import Formatter
from pygments.lexer import RegexLexer, words
from pygments.style import Style
from pygments.token import *
from pygments.token im... |
from django.forms.models import ModelFormMetaclass, ModelForm
from django.template import RequestContext, loader
from django.http import Http404, HttpResponse, HttpResponseRedirect
from django.core.xheaders import populate_xheaders
from django.core.exceptions import ObjectDoesNotExist, ImproperlyConfigured
from dj... |
# -*- coding: utf-8 -*-
# MinIO Python Library for Amazon S3 Compatible Cloud Storage, (C)
# 2020 MinIO, 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/lic... |
"""
``BaseMPO`` is the base class for all multi-period optimization
inherits the parent class ``BaseConvexOptimizer``.
"""
import collections
import json
import warnings
from collections.abc import Iterable
from typing import List
import numpy as np
import pandas as pd
import cvxpy as cp
import scipy.optimize as sco
... |
# -*- coding: utf-8 -*-
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... |
"""
Copyright 2017-2018 Fizyr (https://fizyr.com)
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 w... |
import getopt, subprocess, socket, re, cx_Oracle, requests, json, psutil, numpy as np
from os import sys
from datetime import datetime
from configparser import ConfigParser
from logger import ServiceLogger
_logger = ServiceLogger("cron", __file__).logger
class DateTimeEncoder(json.JSONEncoder):
def default(self,... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Auteurs: <NAME> and <NAME> (Arcep)
#
# Processus de récupération des sites indisponibles de France métropolitaine
# publiés par les opérateurs et sauvegarde des données uniformisées
# aux formats CSV, JSON et GeoJSON.
#
# Nécessite Python 3.7
import sys, time, re, jso... |
# Standard Library
import json
import os
from collections import defaultdict
from enum import Enum
# First Party
from smdebug.core.json_config import get_node_id_from_resource_config
from smdebug.core.logger import get_logger
from smdebug.core.utils import is_first_process
from smdebug.profiler.profiler_config import ... |
# Copyright Contributors to the Testing Farm project.
# SPDX-License-Identifier: Apache-2.0
import collections
import re
import os
import gluetool
from gluetool import SoftGlueError
from gluetool.log import log_dict
from gluetool.result import Ok, Error
from gluetool.utils import Result
from gluetool_modules_framework... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# <NAME>
#
# Code for running FINEMAP (Benner et al.)
import utils as fm_utils
import subprocess as sp
import os
import pandas as pd
import traceback
def run_finemap_for_locus(
index_info,
sumstats,
top_loci,
in_plink,
... |
#!/usr/bin/env python3
#
# Copyright 2019 The Bazel 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 r... |
from memory.rom import ROM
from memory.heap import Heap
from memory.label import Label, LabelPointer
from enum import IntEnum
BANK_SIZE = 0x10000
Bank = IntEnum("Bank", [(f"{value:X}", (value - 0xc0) * BANK_SIZE) for value in range(0xc0, 0x100)])
START_ADDRESS_SNES = 0xc00000
class Space():
rom = None
heaps ... |
# coding: utf-8
# python: 2.7.3
# module: btcelib.py <http://pastebin.com/kABSEyYB>
# Copyright (c) 2014 by <NAME> <<EMAIL>>.
# The MIT License (MIT) <http://opensource.org/licenses/MIT>.
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
# ... |
import os
import re
train_file = "./cpbtrain.txt"
dev_file = "./cpbdev.txt"
test_file = "./cpbtest.txt"
A_dict_file = "./A_dict.txt"
B_dict_file = "./B_dict.txt"
C_dict_file = "./C_dict.txt"
def add_word_to_dict(_dict, _word):
if _word in _dict:
_dict[_word] += 1
else:
_dict[_word] = 1
r... |
# coding: utf-8
# # M* vs Mhalo
# Again, galaxy - halo matching is required.
# In[18]:
class Dummy():
def __init__(self):
pass
def region_from_xyz(x,y,z, r=0):
"""
create a region to include all points.
Parameters
----------
x: float array
y: float array
z: float arra... |
from flask import Flask, request, url_for, redirect
from flask_bootstrap3 import Bootstrap
from flask_uploads import configure_uploads, UploadSet
from flask_login import LoginManager, UserMixin
from flask_wtf.csrf import CSRFProtect
from flask_socketio import SocketIO, emit
from rtmplite3 import rtmp, multitask
from fl... |
#THIS IS A CRAWLER FOR GETTING WEATHER FORECASTS FOR CITIES AROUND THE WORLD USING DARKSKY API AND STORING THEM TO WEATHER.DB
#ALSO, THIS PROGRAM USES THE ALGORITHMS FOR CITYRANK (ranking the cities from best to worst destinations to fly)
#COPYRIGHT <NAME>, 27-03-2018.
import csv
import sqlite3
#import requests, j... |
import numpy as np
import time
import os
import csv
from multiprocessing import get_context
from tensorflow.keras.models import load_model
from tensorflow.keras import backend as K
import tensorflow as tf
from Bio import SeqIO
from multiprocessing import cpu_count
from functools import partial
from deepac.utils import ... |
'''
experiment.py: part of expfactory package
Functions to work with javascript experiments
'''
from expfactory.utils import find_directories, remove_unicode_dict
from glob import glob
import filecmp
import json
import re
import os
def get_validation_fields():
'''get_validation_fields
Returns a list of tupl... |
import argparse
import math
from datetime import datetime
# import h5pyprovider
import numpy as np
import tensorflow as tf
import socket
import importlib
import os
import sys
import pickle
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
ROOT_DIR = os.path.dirname(BASE_DIR)
DATA_DIR = os.path.join(ROOT_DIR, 'data... |
import math
import keras
import keras.layers
import numpy as np
import tensorflow as tf
from nets.resnet import ResNet50
class UpsampleLike(keras.layers.Layer):
def call(self, inputs, **kwargs):
source, target = inputs
target_shape = keras.backend.shape(target)
return tf.im... |
# -*- coding: utf-8 -*-
# Copyright 2014 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Wrapper for inframon's command-line flag based configuration."""
from __future__ import print_function
import argparse
import... |
# Copyright © 2017 anfema GmbH. All rights reserved.
from typing import Optional, Generator, List, Iterable
import os
import calendar
from itertools import islice
from datetime import datetime
from math import ceil
from multiprocessing.pool import ThreadPool
from django.http.response import StreamingHttpResponse
from... |
import discord
import asyncio
import requests
import logging
import time
from datetime import datetime, date
import string
import random
import copy
import apiai, json
import asyncpg
import copy
import dbl
from discord.ext import commands
from config.settings import *
from cogs.const import *
from cogs.locale import *
... |
#!/usr/bin/env python
# coding: utf-8
import torch
import torch.nn as nn
import torch.optim as optim
import numpy as np
import os
from time import time
import shutil
import argparse
import configparser
from model.ASTGCN_r import make_model
from lib.utils import load_graphdata_channel1, get_adjacency_matrix, compute_val... |
import numpy as np
import scipy.misc
import scipy.ndimage
import scipy.stats
import scipy.io
from vmaf.config import VmafConfig
from vmaf.tools.misc import index_and_value_of_min
__copyright__ = "Copyright 2016-2017, Netflix, Inc."
__license__ = "Apache, Version 2.0"
def _gauss_window(lw, sigma):
sd = float(sigm... |
"""API v1 routes for builds."""
from __future__ import annotations
from typing import TYPE_CHECKING, Dict, Tuple
from flask import jsonify, request
from flask_accept import accept_fallback
from keeper.api import api
from keeper.auth import permission_required, token_auth
from keeper.logutils import log_route
from k... |
from __future__ import print_function
from random import shuffle
import os
import argparse
import pickle
from get_image_paths import get_image_paths
from get_tiny_images import get_tiny_images
from build_vocabulary import build_vocabulary
from get_bags_of_sifts import get_bags_of_sifts
from visualize import visualize
... |
import json
from .data_api_resource import DataAPIResource
from .filterable_api_resource import FilterableAPIResource
from .filterable_api_resource import Filter
from .util import *
from ...schema import schema
from ... import logger
from sgqlc.operation import Operation
class ListObjectIterator:
''' Iterator cl... |
import queue
import threading
import json
import copy
## wrapper class for a queue of packets
class Interface:
## @param maxsize - the maximum size of the queue storing packets
def __init__(self, maxsize=0):
self.in_queue = queue.Queue(maxsize)
self.out_queue = queue.Queue(maxsize)
... |
from django.db import models
from django.contrib.auth.models import AbstractUser
import uuid
from django.utils import timezone
from django.conf import settings # for the settings.AUTH_USER_MODEL
from django.urls import reverse
# Create your models here.
class User(AbstractUser):
AREA_LOCATIONS = (
('nh', ... |
import warnings
import numpy as np
import graphgallery as gg
import scipy.sparse as sp
from typing import Optional
from .shape import maybe_shape, maybe_num_nodes
from ..functions import get_length
__all__ = ['remove_self_loops_edge',
'add_selfloops_edge', 'segregate_self_loops_edge',
... |
import os
from queue import Queue
from threading import Thread
import subprocess
import io
import importlib
import json
from time import sleep
from datetime import datetime
import sys
from subprocess import Popen, PIPE, STDOUT
from ydl_server.logdb import JobsDB, Job, Actions, JobType
def reload_youtube_dl():
fo... |
from mlpractice.stats.stats_utils import _update_stats, print_stats
try:
from mlpractice_solutions.mlpractice_solutions.gradient_descent_solutions import LinearRegression
from mlpractice_solutions.mlpractice_solutions.gradient_descent_solutions import GradientDescent
from mlpractice_solutions.mlpractice_so... |
import os
import sys
current_path = os.path.dirname(os.path.realpath(__file__))
root_path = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
sys.path.append(root_path)
import time
import json
import random
import numpy as np
import torch
from flownmt.data import NMTDataSet, DataIterator
from flownmt imp... |
#!/usr/bin/env python3
"""Crete mafft combination commands from directory with alignments."""
import os, re, sys, argparse, itertools, glob
sys.path.append(os.path.dirname(os.path.abspath(__name__)))
def create_and_parse_argument_options(argument_list):
parser = argparse.ArgumentParser(description='Merge alignments f... |
#!/usr/bin/env python2.7
# python run-flownet-many_batch.py /media/sagan/Drive2/sagar/EGTEA_Gaze_Plus/codes/flownet2/models/FlowNet2-Sintel/FlowNet2-CSS-Sintel_weights.caffemodel.h5 /media/sagan/Drive2/sagar/EGTEA_Gaze_Plus/codes/flownet2/models/FlowNet2-Sintel/FlowNet2-CSS-Sintel_deploy.prototxt.template /media/sagan/... |
"""
This is an upgraded version of Ceshine's and Linzhi and Andy Harless starter script, simply adding more
average features and weekly average features on it.
"""
from datetime import date, timedelta
import pandas as pd
import numpy as np
from sklearn.metrics import mean_squared_error
from keras.models import Sequenti... |
from bokeh.plotting import figure
from bokeh.layouts import row, gridplot
from bokeh.resources import CDN
from bokeh.embed import file_html
from bokeh.models import ColumnDataSource, Plot, LinearAxis, Grid
from bokeh.models.glyphs import Patches
from bokeh.io import curdoc
from scipy import stats
import numpy as np
... |
import cv2
import numpy as np
import collections
import matplotlib.pyplot as plt
from camera_calibration import undistortImage, calibrateCamera
from color_gradient import imageTransformation
from perspective_transformation import getPerspectiveTransform, warpImage2birdsEyeView
# Define a class to receive the characte... |
import logging
import warnings
try:
from urllib.parse import urljoin, urlencode, urlparse # python 3x
except ImportError:
from urllib import urlencode # python 2x
from urlparse import urljoin, urlparse
from django.conf import settings
from django.http import HttpResponse
from django.utils.decorators imp... |
# Copyright (c) 2020 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... |
from model import Seq2seq
import os
from data_utils import START_TOKEN, END_ID, get_loader, UNK_ID, outputids2words
import torch
import torch.nn.functional as F
import config
import pickle
class Hypothesis(object):
def __init__(self, tokens, log_probs, state, context=None):
self.tokens = tokens
se... |
"""
Run commands remotely on AWS Batch inside the Nextstrain container image.
"""
import os
import shlex
import signal
import subprocess
from pathlib import Path
from sys import exit
from textwrap import dedent
from time import sleep
from uuid import uuid4
from ...types import RunnerTestResults, Tuple
from ...util imp... |
#!/usr/bin/env python
import sys
import logging
import os.path
# The following lines replace many standard library modules with versions that
# use gevent for concurrency. This is NOT required by slimta, but may help
# you avoid mistakes that can have harsh performance implications!
from gevent import monkey
monkey.p... |
import os
import glob
import click
import pickle
import shutil
from nastools.nastools import retrieve_nas_files
from automator_settings import COWBAT_DATABASES
@click.command()
@click.option('--redmine_instance', help='Path to pickled Redmine API instance')
@click.option('--issue', help='Path to pickled Redmine issue... |
"""
Implementation of OGRE approach, as explained in the pdf file which is in our github page.
"""
from state_of_the_art.state_of_the_art_embedding import *
from utils import *
import time
import numpy as np
import heapq
def OGRE_embedding(current_node, proj_nodes, dict_proj, dim, dict_enode_enode, G, eps... |
import numpy as np
# from scipy.stats import norm
#adapted from OpenAI baselines/common/running_mean_std.py
class RunningMeanStd(object):
# https://en.wikipedia.org/wiki/Algorithms_for_calculating_variance#Parallel_algorithm
def __init__(self, epsilon=1e-4, shape=()):
self.mean = np.zeros(shape, 'floa... |
#! /usr/bin/python3 -B
#
# Copyright (c) 2018-2019 <NAME> and contributors.
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright n... |
from __future__ import absolute_import, division, print_function
from collections import defaultdict, Iterator
from datetime import date, datetime
import itertools
import numbers
import toolz
from toolz import first, unique, assoc
import pandas as pd
from odo import odo
from ..compatibility import basestring
from ..... |
#coding: utf-8
#!/usr/bin/env python3
#Initial test code for MiSynth Wave Generator
#Opens Wave Files And Cuts And Plays Them As The FPGA will
#Synth plays back 2048 samples at frequency of note
#Effective sample rate is 901,120Hz @ 440Hz
#CURRENTLY A DRAWING LOOP TO BE SOLVED, THANKS WX/PYTHON FOR YOUR
#COMPLETE LACK... |
import logging
import os
import sys
from pathlib import Path
from typing import Tuple
import pytest
import torch
from ride.core import RideModule
from ride.finetune import Finetunable
from ride.optimizers import AdamWOneCycleOptimizer
from ride.utils.checkpoints import get_latest_checkpoint
from ride.utils.io import ... |
#!/usr/bin/env python
"""
This module handles:
1. The images that Steve displays.
2. Loading images from the disk.
Hazen 10/18
"""
import numpy
import os
import pickle
import warnings
from PyQt5 import QtCore, QtGui, QtWidgets
import storm_control.steve.coord as coord
import storm_control.steve.mosaicDialog as mosai... |
# -*- coding: utf-8 -*-
#
# Authors: Swolf <<EMAIL>>
# Date: 2021/9/18
# License: MIT License
"""
SSCOR.
"""
from typing import Optional, List, Tuple
from functools import partial
import numpy as np
from scipy.linalg import eigh, cholesky, inv
from numpy import ndarray
from sklearn.base import BaseEstimator, Transfor... |
import itertools
import numpy as np
import gym
def generate_itoa_dict(
bucket_values=[-0.33, 0, 0.33], valid_movement_direction=[1, 1, 1, 1]):
"""
Set cartesian product to generate action combination
spaces for the fetch environments
valid_movement_direction: To set
"""
action_spac... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# 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... |
#!/usr/bin/env python3
#
# test_uW_USFM_read.py
# Written: Dec 2019
# Last modified: 2019-12-02 RJH
#
# Reads complex (e.g., aligned) USFM files
# and extracts the actual Biblical text
# with special emphasis on correctly handling whitespace.
#
# Currently there's no provision for saving the extracted t... |
from __future__ import print_function, absolute_import
import tempfile
import pytest
from pathlib import Path
from fetch import load
with_neocommon = pytest.mark.with_neocommon
def _fail_with_diff(reparsed_config, source_config):
print('-' * 20)
print_simple_obj_diff(source_config, reparsed_config)
pr... |
import numpy as np
import pandas as pd
from gym.utils import seeding
import gym
from gym import spaces
import matplotlib
from sklearn.preprocessing import MinMaxScaler
import copy
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from dl_for_env_multi import call_model
# Global variables
PLANT_DIM = 1
EFF_PUMP =... |
from collections import abc
from enum import Enum
from operator import attrgetter
from typing import Dict, Iterable, List, Tuple, Union
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
import torch
from matplotlib.figure import Figure
from ptflops import get_model_complexity_info
from supers im... |
import numpy as np
from sklearn.preprocessing import PolynomialFeatures
from sklearn import linear_model
import pandas as pd
import math
from scipy import signal
class Built_in_Datas():
def datas():
"""
This is built-in data. For instance, you can call as:
Signal , time = Built_in_Datas... |
import csv
import logging
import numpy as np
import os
import re
from samitorch.inputs.transformers import ToNumpyArray
from samitorch.utils.files import extract_file_paths
from torchvision.transforms import Compose
from deepNormalize.utils.utils import natural_sort
logging.basicConfig(level=logging.INFO)
LABELSFORT... |
#!/usr/bin/env python
import click
import logging
import numpy as np
import os
import pandas as pd
from collections import Counter, defaultdict
from copy import deepcopy
# IMPORTANT: this seed cannot be altered!
# It was used for data collection and thus affects the order in which quicksorts are performed in the Just... |
# tp0
# <NAME>
from cmu_112_graphics import *
from abc import ABC, abstractmethod
import time
import copy
import sys
import chess
import pickle
import gameAI
from tkinter.filedialog import asksaveasfilename, askopenfilename
class MyApp(App):
#size without margins
SIZE = 768
def appStarted(self):
... |
import base64
import os
import json
import copy
import asyncio
from collections import deque
from random import randint
DEFAULT_USER = os.environ.get('DEFAULT_USER', 'guest')
DEFAULT_PASSWORD = os.environ.get('DEFAULT_PASSWORD', '<PASSWORD>')
class WaitTimeout(Exception):
pass
class SetEncoder(json.JSONEncoder... |
from pathlib import Path
import os
from typing import Union
import sys
import copy
from scipy.io import savemat
import spikeextractors as se
from ..basesorter import BaseSorter
from ..utils.shellscript import ShellScript
from ..sorter_tools import recover_recording
def check_if_installed(waveclus_path: Union[str, No... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.