text
stringlengths
957
885k
<reponame>smehdia/NTIRE2021-IQA-MACS<filename>model_attention.py import tensorflow as tf from tensorflow.keras.layers import * from tensorflow.keras.models import Model ''' model architecture with Batch Normalization, Attention and Residual Blocks ''' def normalize_tensor_image(inp): out = tf.convert_to_tensor(i...
<filename>nucleotides/filesystem.py """\ Module for interacting with the filesystem relative to the current nucleotides task directory. Each nucleotides benchmarking task takes place in a directory named for the nucleotides task ID. This module functions to simplify getting the location of where input files can be foun...
<reponame>susuhahnml/xls2asp #!/usr/bin/env python3 """ Converts an instance given as a set of excel tables into a set of asp facts. Input: Excel xlsx file Output: Logic program instance file """ import warnings import csv import argparse import sys import traceback import openpyxl as xls import math import warnings...
<filename>cdbfunctions.py """cdbfunctions.py Developer: <NAME> Last Updated: September 12, 2014 This module consists of all functions that interact directly with the cdbtabledef.py module. Functions include inserting, deleting, and updating records in the database. There are also several class definitions which are...
"""Native adapter for serving CherryPy via its builtin server.""" import logging import sys import io import cheroot.server import cherrypy from cherrypy._cperror import format_exc, bare_error from cherrypy.lib import httputil class NativeGateway(cheroot.server.Gateway): recursive = False def respond(sel...
import json import logging from api.api_samples.python_client.api_client import CloudBoltAPIClient from api.api_samples.python_client.samples.api_helpers import wait_for_order_completion, wait_for_job_completion from common.methods import set_progress from servicecatalog.models import ServiceBlueprint from utilities.e...
<filename>import_scripts/methylation.py ###ExonArray #Copyright 2005-2008 <NAME> Institutes, San Francisco California #Author <NAME> - <EMAIL> #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 Sof...
'''blox/compile.py Creates an optimized programattically generated template from an html file Copyright (C) 2015 <NAME> 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, incl...
<gh_stars>0 #CREATING NEW CSV FILE TAKING AVERAGE FOR VARIOUS PARAMETERS FOR A SINGLE TIME PERIO import pandas as pd import numpy as np import matplotlib.pyplot as plt import os def dataExtraction(path): obd = pd.read_csv(path,index_col=False) #print(obd.columns) ''' obd.columns = ['ENGINE_RUN_TINE', 'ENGINE_R...
#!/usr/bin/env python import matplotlib.pyplot as plt import numpy as np import sys,os import string import math import argparse def read_plugmap(filename): debug=False file=open(filename,"r") doc={} intypedef=False indices={} indices["HOLETYPE"]=8 indices["OBJECT"]=21 indices["ra"]=9...
import time import math import os import re import string from html import escape import IPython from IPython.core.magic import Magics, magics_class from jinja2 import Template, StrictUndefined from traitlets import Int, Unicode, Bool DEFAULT_SCHEMA_TTL = -1 DEFAULT_CATALOGS = '' VARIABLE_NOT_FOUND_MSG = ''' A Jinj...
<filename>pythonscripts/comix.py ''' This iteration of comix stripper uses the retrieve module which tends to crash a lot less than urllib when grabbing jpeg images or just large files in general. I started writing doc strings but haven't finished. Currently the program has to create a directory called Comix in your h...
<reponame>Znerual/FastLogin import logging import urllib.request import urllib.parse import http.cookiejar import json from requests import requests from configuration import Configuration def logIn(): # ---! Data !--- logging.basicConfig(filename='log',level=logging.DEBUG) logging.debug("Assembling the data")...
from orchestra.models import Iteration from orchestra.models import Task from orchestra.models import TaskAssignment from orchestra.utils.task_properties import current_assignment from orchestra.utils.task_properties import get_iteration_history def verify_iterations(task_id): task = Task.objects.get(id=task_id) ...
#!/usr/bin/env python from optparse import OptionParser import os import re import sys import logging LOGGER = logging.getLogger(__name__) def main(cmdline=None): parser = make_parser() opts, args = parser.parse_args(cmdline) error_happened = False for filename in args[1:]: stream = open(file...
from maestro.core.metadata import VectorClock from maestro.core.utils import make_hashable from enum import Enum from typing import List, Any, Union, Optional import copy class Comparator(Enum): """Represents a comparison operation that can be performed in a field.""" EQUALS = "==" NOT_EQUALS = "!=" L...
<gh_stars>0 import os import numpy as np import torch as t from jukebox.hparams import Hyperparams from jukebox.utils.torch_utils import empty_cache from jukebox.utils.audio_utils import save_wav, load_audio from jukebox.make_models import make_model from jukebox.align import get_alignment from jukebox.save_html impor...
#!/usr/bin/python """ Learning tool. ======= License ======= Copyright (c) 2015 <NAME> 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...
import numpy as np from math import pi import matplotlib.pyplot as plt sqrt_pi = (2 * pi) ** 0.5 class NBFunctions: @staticmethod def gaussian(x, mu, sigma): return np.exp(-(x - mu) ** 2 / (2 * sigma ** 2)) / (sqrt_pi * sigma) @staticmethod def gaussian_maximum_likelihood(labelled_x, n_catego...
<gh_stars>0 import logging from sqlalchemy import create_engine import pandas as pd LOG = logging.getLogger(__name__) class SeqlDB(object): def __init__(self, conString, dbVendor = 'SqlServer'): self.dbVendor = dbVendor self.conString = conString self.seqlEngine = self.creat...
<reponame>cherepaha/PyDDM import unittest from unittest import TestCase, main from string import ascii_letters import numpy as np from itertools import groupby from math import fsum import pandas import copy import scipy.stats from numpy import asarray as aa import ddm def fails(f, exception=BaseException): fail...
from __future__ import with_statement __version__ = '0.31' __license__ = 'MIT' import re import os import sys import finalseg import time import tempfile import marshal from math import log import random import threading from functools import wraps import logging DICTIONARY = "dict.txt" DICT_LOCK = threading.RLock() ...
#!/usr/bin/env python # thermald reports on cpu temp, cou usage, memory usage # zmq message used = thermal # it also: # controls the fan of the EON # turns charging on and off # checks if we still have a good location # checks if the selfdrive can be started based on : # a health message is available (ge...
import math import numpy as np import logging import cv2 import os import shutil import torch import torch.nn as nn import torch.nn.functional as F class Logger(object): def __init__(self, log_file_name, logger_name, log_level=logging.DEBUG): ### create a logger self.__logger = logging.getLogger(...
from __future__ import print_function, absolute_import import numpy as np from six import iterkeys from h5Nastran.defaults import Defaults from h5Nastran.h5nastrannode import H5NastranNode from .input_table import InputTable, TableDef class Property(H5NastranNode): def __init__(self, h5n, input): self._...
<filename>IoT/MHEALTH/models/CNN_shiftadd_se.py from adder import adder import torch import torch.nn as nn import torch.nn.functional as F from se_shift import SEConv2d, SELinear __all__ = ['CNN_shiftadd_se'] def conv_add(in_planes, out_planes, threshold, sign_threshold, distribution, kernel_size=(3, 3), stride=1, pa...
""" Unit tests for each geometry mesh transformation component.""" from __future__ import print_function, division import numpy as np import unittest from openmdao.api import Problem, Group from openmdao.utils.assert_utils import assert_rel_error, assert_check_partials from openaerostruct.geometry.geometry_mesh_tran...
import sys sys.path.append(".") import py #from sympy import * from sympy.numerics import * from sympy.numerics.functions import * import math import cmath from sympy.utilities.pytest import XFAIL def test_sqrt(): for i in range(1000): assert sqrt(Float(i**2)) == i # These should round ide...
<reponame>jmcb/jquizzyva #!/usr/bin/env python import functools import re SET_FINDER = re.compile("\[(\^?:?[A-Z]+)\]") MAX_WORD_LENGTH = 16 try: from util._pattern import try_word, CAnagramPattern except ImportError: try_word = None CAnagramPattern = None class AnagramPattern (object): """ A pa...
from django.urls import path, include from django.urls.conf import re_path from .views import * from rest_framework.routers import DefaultRouter #router = DefaultRouter() #router.register('ejes', EjeViewSet, basename='ejes') #router.register('instituciones', InstitucionViewSet, basename='instituciones') #router.regis...
"""Selecting simulations from a scan based on parameters. """ import os import pickle from copy import deepcopy from pathlib import Path from typing import Any, Callable, Dict, Iterable, List, Optional, Set, Tuple, Union import numpy from tqdm import tqdm from mlxtk.cwd import WorkingDir from mlxtk.log import get_log...
<filename>page_rep.py<gh_stars>0 import tkinter as tk import numpy as np def main(): mainwindow = tk.Tk() mainwindow.title("OS Simulator") mainwindow.minsize(400, 300) matdisplay_btn = tk.Button(master=mainwindow, text="Page Replacement Algorithm", command=getinputPagerep,background="cyan") matdisp...
''' Created on Mar 29, 2017 @author: gcampagn ''' import os import sys import numpy as np import tensorflow as tf import matplotlib matplotlib.use('GTK3Cairo') import matplotlib.pyplot as plt from util.seq2seq import Seq2SeqEvaluator from util.loader import unknown_tokens, load_data from util.general_utils import g...
<reponame>ywen666/code-transformer<filename>scripts/deduplicate-java-pretrain.py """ To generate the huge java-pretrain dataset, we first manually merge java-small, java-medium and java-large into the same folder. It can then happen that in the new larger training set there are Java methods from the same projects or ev...
import os import sys import random from psychopy import clock, core, event, logging, visual from datetime import datetime script_dir = os.path.dirname(os.path.abspath(__file__)) class Hampton2006(object): ''' >>> env = Hampton2006(deterministic_reward=True, deterministic_reversal=True) >>> env.reset() ...
#LCD Configuration import Adafruit_CharLCD as LCD lcd_rs = 27 lcd_en = 22 lcd_d4 = 25 lcd_d5 = 24 lcd_d6 = 23 lcd_d7 = 18 lcd_backlight = 4 lcd_columns = 16 lcd_rows = 2 lcd = LCD.Adafruit_CharLCD(lcd_rs, lcd_en, lcd_d4, lcd_d5, lcd_d6, lcd_d7, lcd_columns, lcd_rows, lcd_backli...
import itertools import gflags import logging import os from ct.client import log_client from ct.client import state from ct.client import temp_db from ct.crypto import error from ct.crypto import merkle from ct.proto import client_pb2 FLAGS = gflags.FLAGS gflags.DEFINE_integer("entry_write_batch_size", 1000, "Maxim...
<reponame>J-Owens/soccerdata<gh_stars>0 """Scraper for api.clubelo.com.""" import re from datetime import datetime, timedelta from pathlib import Path from typing import Optional, Union import pandas as pd from unidecode import unidecode from ._common import BaseReader, standardize_colnames from ._config import DATA_...
import numpy as np import tensorflow as tf import tensorflow.keras.backend as K from tensorflow.keras.preprocessing import image def cod(y_true, y_pred): SSR=K.sum(K.square(y_true-y_pred)) SST=K.sum(K.square(y_true-K.mean(y_true))) RS=SSR/SST return RS def pred4_newloss(y_true, y_pred): re...
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. from typing import List, Dict, Callable import re from datetime import datetime from recognizers_text.utilities import RegExpUtility from ..utilities import DateUtils from ..base_holiday import BaseHolidayParserConfigurati...
<gh_stars>0 """ This module provides a ASE calculator class [#ase1]_ for SchNetPack models, as well as a general Interface to all ASE calculation methods, such as geometry optimisation, normal mode computation and molecular dynamics simulations. References ---------- .. [#ase1] Larsen, Mortensen, Blomqvist, Castelli, ...
import struct import time from enum import Enum from app.connector import BasicConnector from app.exceptions import InvalidCommandError, InvalidChecksumError, DeviceAuthError, InvalidResponseError, \ ReadFailedError, AdbCommandFailureException, InterleavedDataError # Maximum amount of data in an ADB packet. MAX_A...
<reponame>theshaodi/algorithm004-05 #@author:leacoder #@des: 递归 电话号码的字母组合 """ 递归处理digits字符串中的每个字符 digits的每个字符又有多种情况(多个字母需要处理) 递归终止条件就是 digits字符串中的每个字符 已处理结束 """ class Solution: phone = {'2': ['a', 'b', 'c'], '3': ['d', 'e', 'f'], '4': ['g', 'h', 'i'], '5': ['j'...
"""Steganography, by <NAME> 2020-10-07 v1.0 """ import collections, logging, math from random import randint from PIL import Image # pip install Pillow def bits2bytes(bits): while True: byte = 0 for _ in range(8): try: byte = (byte << 1) | next(bits) ...
import logging import pytest from requests import Request from starlette.applications import Starlette from starlette.endpoints import HTTPEndpoint from starlette.middleware import Middleware from starlette.responses import PlainTextResponse from starlette.testclient import TestClient import layab.starlette @pytest...
#!/usr/bin/env python """Writes records to a configurable number of WARC files.""" import os import re import uuid import Queue import shutil import socket import logging from datetime import datetime from hanzo.warctools import WarcRecord LOGGING_FORMAT="[%(asctime)s] %(levelname)s: %(message)s" logging.basicConfig(...
<gh_stars>0 import re class Token: def __init__(self, type, match): global code global col if isinstance(match, str): end_pos = len(match) else: end_pos = match.span()[1] self.raw_data = code[:end_pos] if self.raw_data in keywords: ...
<gh_stars>0 # coding: utf-8 """ :mod:`boardgamegeek.guild` - Guild information ============================================== .. module:: boardgamegeek.guild :platform: Unix, Windows :synopsis: classes for storing guild information .. moduleauthor:: <NAME> <<EMAIL>> """ from copy import copy from .things impo...
<reponame>vhn0912/python-snippets import util_make_files util_make_files.pathlib_basic() import pathlib p_file = pathlib.Path('temp/file.txt') print(p_file) # temp/file.txt print(type(p_file)) # <class 'pathlib.PosixPath'> print(str(p_file)) # temp/file.txt print(type(str(p_file))) # <class 'str'> print(p_file....
""" Lexemes base definitions for the lexemes module. """ from enum import Enum # Definitions # ============================================================================ # Characters # ---------------------------------------------------------------------------- def char_range(first, last): """ Set of charact...
# Copyright 2015 Google Inc. 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 a...
# dalla mail di Michele: # POST https://climbdev.smartcommunitylab.it/v2/api/event/TEST/adca3db3-68d1-4197-b834-a45d61cf1c21/vlab # Header: "Authorization","Bearer 831a2cc0-48bd-46ab-ace1-c24f767af8af" # Body: # [ # { # "wsnNodeId" : "<id>", # "eventType" : 901, # "timestamp" : <timestamp>, # "payload" ...
"""VTA related intrinsics""" from __future__ import absolute_import as _abs import tvm def gemm(env, mock=False): """Matrix-matrix multiply intrinsic Parameters ---------- env : Environment The Environment mock : bool Whether create a mock version. """ wgt_lanes = env.WGT...
# Importing all modules import shutil from PIL import Image , ImageQt from GalleryMan.themes.filters import Filters from GalleryMan.assets.QtHelpers import PopUpMessage from PyQt5.QtCore import QPropertyAnimation, Qt from PyQt5.QtGui import QCursor, QImage, QPixmap from PyQt5.QtWidgets import QDialog, QDialogButtonBox,...
import codecs, json import csv, io import string, random, secrets from django.http import JsonResponse,HttpResponse from django.core.validators import URLValidator from django.core.exceptions import ValidationError from django.views.decorators.http import require_POST, require_http_methods from django.core.exceptions ...
<filename>examples/QKD/e91.py<gh_stars>10-100 from qunetsim.backends import EQSNBackend from qunetsim.components import Host from qunetsim.components import Network from qunetsim.objects import Logger from qunetsim.objects import Qubit import random import numpy as np Logger.DISABLED = True def expected_value(result...
<filename>conanfile.py from conans import ConanFile, CMake, tools from conans.tools import download, unzip import os class RttrConan(ConanFile): name = "rttr" version = "0.9.6" description = "Conan package for rttr." url = "https://gi...
<reponame>ddomhoff/tmtoolkit # -*- coding: utf-8 -*- """ requires "europarl_raw" corpus to be downloaded via `nltk.download()` """ import os import time import logging from random import sample import nltk import lda from tmtoolkit.corpus import Corpus from tmtoolkit.preprocess import TMPreproc from tmtoolkit.dtm im...
# (C) Copyright IBM Corp. 2016 # # 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 writin...
<reponame>Acidburn0zzz/luci # Copyright 2019 The LUCI Authors. All rights reserved. # Use of this source code is governed under the Apache License, Version 2.0 # that can be found in the LICENSE file. """API for interacting with the ResultDB service. Requires `rdb` command in `$PATH`: https://godoc.org/go.chromium.or...
## # <NAME> # SoundBoard runs on an OSX machine and plays sounds from the command line # when told to by HTTP requests. Multiple clients can control it and # play sound effects through the included HTML interface. # V 2.0 ## import web import os import sys if sys.version_info < (2,6): import simplejson as j...
<gh_stars>0 from django.db import models from dictionary.views import get_def_for_tooltip import json from search.models import TableNames from tools.app_utils import parse_form_type import settings import opus_support class ParamInfo(models.Model): """ This model describes every searchable param in the da...
# Copyright 2014 OpenCore 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 agreed to in writing,...
<filename>well_plate_project/data_etl/_3f_cluster_hough.py #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Nov 2 12:52:01 2020 @author: modal """ import cv2 import matplotlib.pyplot as plt def cluster_hough(warped): import numpy as np #%% CIRCLE RECOGNITION test = warped.copy(); ...
import sys, math, logging __all__ = 'defaults,byteorder,partial'.split(',') # Setup some version-agnostic types that we can perform checks with integer_types = (int, long) if sys.version_info.major < 3 else (int,) string_types = (str, unicode) if sys.version_info.major < 3 else (str,) class field: class descript...
<gh_stars>1-10 # -*- coding: utf-8 -*- __author__ = 'isparks' from datetime import datetime from random import choice from string import ascii_letters from rwslib import RWSConnection from rwslib.builders import * from rwslib.rws_requests import PostDataRequest class Folder(object): def __init__(self, oid, rep...
# project_server.py from flask import Flask, request, jsonify from datetime import datetime from pymodm import connect, MongoModel, fields import PIL connect("mongodb+srv://brad_howard:<EMAIL>" "/final_database?retryWrites=true&w=majority") app = Flask(__name__) class Patient(MongoModel): mr_number = ...
from collections import defaultdict from abc import ABC, abstractmethod import matplotlib.pylab as plot import numpy as np github_normal_header = 'https://github.com/' github_raw_content_header = 'https://raw.githubusercontent.com/' class ReportGen(ABC): def __init__(self, max_number_of_classes, repo_locatio...
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'Learning.ui' # # Created by: PyQt5 UI code generator 5.7 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets class Ui_Dialog(object): def setupUi(self, Dialog): Dialog...
<reponame>skkapoor/MiningSubjectiveSubgraphPatterns<filename>src/BackgroundDistributions/MaxEntMulti2.py ################################################################################################################################################################### ###################################################...
from django.contrib.auth.hashers import make_password from django.db import IntegrityError from django.shortcuts import get_object_or_404 from django.contrib.auth import login, logout from django_filters.rest_framework import DjangoFilterBackend from rest_framework.views import APIView from rest_framework.viewsets imp...
class WTAN(Bayes_net_PU): name = "WTAN" def __init__(self,alpha = 1,starting_node = 0): self.alpha = alpha self.starting_node = starting_node def Findparent(self, M): M = M.copy() # to avoid change global M np.fill_diagonal(M,0) p = int(M.shape[0]) V = range(p) # set of all nod...
# #---------------------------------------------------------------------- # Copyright 2007-2011 Mentor Graphics Corporation # Copyright 2007-2010 Cadence Design Systems, Inc. # Copyright 2010-2013 Synopsys, Inc. # Copyright 2013 NVIDIA Corporation # Copyright 2013 Cisco Systems, Inc. # Copyright 2...
from numba import njit import numpy as np from stingray.pulse.pulsar import _load_and_prepare_TOAs, get_model from scipy.interpolate import interp1d from astropy.table import Table ONE_SIXTH = 1 / 6 @njit(nogil=True, parallel=False) def _hist1d_numba_seq(H, tracks, bins, ranges): delta = 1 / ((ranges[1] - ranges...
import bpy from mathutils import Matrix, Vector, Quaternion import numpy as np import math # Try to make faster the retargeting. # The algorithm is based in 2 parts. # 1. From unkonwn armature transfer bone rotations to a known armature. Since sometimes this rotation transfer # has rotations that mess with the associa...
from hermes.engines.databases import * from datetime import datetime, date import time import simplejson from pprint import pprint import urllib from sqlobject.sqlbuilder import * from operator import itemgetter import logging import hermes.lib.util as Util import sys import re def sortMultipleKeys(items, columns) : ...
<reponame>tony/libvcs<filename>libvcs/cmd/git.py import pathlib import shlex from typing import Any, Literal, Optional, Sequence, Union from libvcs._internal.run import run from libvcs._internal.types import StrOrBytesPath, StrPath _CMD = Union[StrOrBytesPath, Sequence[StrOrBytesPath]] class Git: def __init__(s...
from CAMOnion.database.tables import * from CAMOnion.core.math_tools import rotate_point from CAMOnion.engine import face, slot, drill import os code_engines = { 'face_rough': face.face_rough, 'face_finish': face.face_finish, 'slot_rough': slot.slot_rough, 'slot_finish': slot.slot_finish, 'drill': ...
<reponame>pranshu30/Azure-DevOps<filename>code/training/train.py """ Copyright (C) Microsoft Corporation. All rights reserved.​ ​ Microsoft Corporation (“Microsoft”) grants you a nonexclusive, perpetual, royalty-free right to use, copy, and modify the software code provided by us ("Software Code"). You may not sublice...
<filename>edl/taxon.py import re import logging import numpy as np logger = logging.getLogger(__name__) ############## # Classes # ############## class Taxonomy: """ A container for taxonomy data: contains two maps: id to Node and name to Node """ def __init__(self, idMap, nameMap, realNameM...
# Copyright (c) 2015-2018 The Botogram Authors (see AUTHORS) # # 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, mod...
<gh_stars>0 import os import sys import unittest import numpy from os.path import join as pjn import QENSmodels # resolve path to reference_data this_module_path = sys.modules[__name__].__file__ data_dir = pjn(os.path.dirname(this_module_path), 'reference_data') class TestJumpTranslationalDiffusion(unittest.TestCas...
from django.db import models from django.conf import settings from easy_thumbnails.fields import ThumbnailerImageField from easy_thumbnails.files import get_thumbnailer BASE_TEMPLATE_PART = [ ('HEAD', 'Head'), ('BODY', 'Body'), ('NAVBAR', 'Navbar'), ('IO_PREVIEW', 'Image objects preview'), ('IO_VI...
# ##################################################################################################################### # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # # ...
#!/usr/bin/python3 __author__ = 'ziyan.yin' import asyncio import logging from typing import List from nado_utils import cryptutils import os import pickle from ._publisher import Publisher BUF_SIZE = 1024 MAX_SIZE = 2**20 * 5 HOST = '' PORT = 11210 data_format = { 'success': True, 'data': '', 'message'...
# MIT License # # Copyright (c) 2020 <NAME> <tony[dot]wu(at)nyu[dot]edu> # # 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 us...
from candidate import Candidate from sqlalchemy import ForeignKey, Column, Integer, String from sqlalchemy.orm import relationship, backref from sqlalchemy.dialects import mysql from sqlalchemy.schema import FetchedValue from base import Base import json import datetime from datetime import timedelta import calendar c...
<gh_stars>1-10 #!/usr/bin/env python # -*- coding: utf-8 -*- ######################################################################### # Copyright/License Notice (Modified BSD License) # ######################################################################### ####################################...
import numpy as np from collections import deque import matplotlib.pyplot as plt import matplotlib.lines as mlines import gym # ############################################################################# # PARAMETERS # ############################################################################# tensorboard_log_pat...
<gh_stars>0 # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # Copyright 2015 and onwards Google, 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...
'Volume generation and augmentation' # Authors: <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # MIT License import keras import os.path import numpy as np from tqdm import tqdm from sklearn.neighbors import KDTree from sklearn.decomposition import PCA from enzynet.PDB import PDB_backbone current_directory = os.p...
import audio import graphic import os import output import scipy.io.wavfile as wav from util import * def read_wav_dirty(f): samplerate, signal = wav.read(f) f = filename.truncate_extension(f) return (f, signal, samplerate) def read_wav(f): samplerate, signal = wav.read(f) #if len(signal.shape) > 1: # si...
import os import shutil import zipfile import pathlib import gitlab import click from atacac._utils import log, tower_send @click.command() @click.option('--gitlab-url', envvar='GITLAB_URL') @click.option('--gitlab-token', envvar='GITLAB_TOKEN') @click.option('--gitlab-project', envvar='GITLAB_PROJECT') @click.opti...
# -*- coding: utf-8 -*- """Pathway analysis methods.""" import logging from collections import Counter, defaultdict from typing import Dict, Iterable, List, Mapping import numpy as np import pandas as pd from networkx import DiGraph from scipy.stats import fisher_exact from statsmodels.stats.multitest import multipl...
#!/usr/bin/env python3 #<NAME> (<EMAIL>) from Bio.SeqIO.FastaIO import SimpleFastaParser from Bio.Seq import reverse_complement from Bio.SeqUtils import GC import os,sys,argparse,regex from xopen import xopen from tqdm import tqdm parser = argparse.ArgumentParser() parser.add_argument('-i', '--in_fasta', action = 'st...
<filename>ansible_bender/api.py import logging import os import datetime import sys from ansible_bender.builder import get_builder from ansible_bender.builders.base import BuildState from ansible_bender.constants import OUT_LOGGER, OUT_LOGGER_FORMAT from ansible_bender.core import AnsibleRunner from ansible_bender.db...
<reponame>internetarchive/pdf_trio import os import json import pytest import responses import pdf_trio from fixtures import flask_client def test_api_misc_routes(flask_client): misc_routes = [ "/", "/api/list", ] for r in misc_routes: resp = flask_client.get(r) assert re...
<filename>xgboost_ray/util.py from typing import Dict, Optional, List import asyncio import ray from ray.util.annotations import DeveloperAPI from ray.util.queue import Queue as RayQueue, Empty, Full @DeveloperAPI class Unavailable: """No object should be instance of this class""" def __init__(self): ...
import numpy as np from tqdm import tqdm import matplotlib.pyplot as plt import pandas as pd from ..common.toolbox import embedding,correlation,decide_dim from ..common.surrogate import twin_surrogate from ..common.distance import calic_dist_l2 import tensorflow as tf CCM_PARAM = { "save_path": "./", "emb_dim"...
<filename>rabbitmq_asynqp/rabbitmq_consumer.py<gh_stars>0 import asyncio import asynqp class EventConsumer: def __init__(self, callback_fn, queue): self.callback_fn = callback_fn self.queue = queue def __call__(self, msg): """ Whenever call is called same message content is p...