text stringlengths 3.07k 12.6k |
|---|
import os
import sys
import traceback
from builtins import ValueError
from typing import List, Callable, Dict
from ultimate1541 import Ultimate1541
def cmd_dir(u: Ultimate1541, params: List[str]):
if len(params) == 0:
return cmd_dir(u, ['/Usb0'])
for param in params:
if len(params) > 1:
... |
from application.fit.callback import fit_callback, remove_functions, save_callback
from dearpygui.simple import *
from utils.callback import on_close_callback
from .callback import *
app_menu_name = 'Tools'
app_menu_item_name = 'quickplot'
pnum = 1
def start_app(sender, data):
global app_name
global pnum
... |
# ------------------------------------------------------------------------------
# CodeHawk Binary Analyzer
# Author: <NAME>
# ------------------------------------------------------------------------------
# The MIT License (MIT)
#
# Copyright (c) 2021 Aarno Labs, LLC
#
# Permission is hereby granted, free of charge, t... |
#
# BSD 3-Clause License
#
# Copyright (c) 2017-2018, plures
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this... |
# Copyright (c) 2021, Ballerina Dev Kit. 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 applicabl... |
# 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... |
import json
import networkx as nx
import numpy
from typing import Set, Dict, List, Tuple
from labelset_hierarchy import get_base_forms
def create_subgraph(graph: nx.DiGraph, root_node, direction='descendants'):
if direction == 'descendants':
children = nx.descendants(graph, root_node)
else:
ch... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# 默认是密送模式(BBC)
# 需要改为正常模式,把 send 时,bcc 改为 to
from concurrent import futures
import yagmail
from config.mail_server_config import MAIL_CONFIG, PORT, SECRET_KEY
import grpc
import sys
import re
sys.path.append("proto")
import proto.mail_pb2 as mail_pb2
import proto.mail_p... |
from collections import Counter
import numpy as np
from inference.core import Inference
from inference import get_algorithm
from graphical_models import construct_binary_mrf
from scipy.stats import pearsonr
import pdb
class HamiltonianMC(Inference):
def kinetic_energy(self, p):
return 0.5 * p @ p.T
def energy_... |
import os
from functools import wraps
import datetime
import requests
from babel import Locale
from flask import Flask, render_template, request, abort, Markup, g
from flask_babel import Babel, gettext, get_locale
from flask_wtf import FlaskForm, CSRFProtect
from wtforms import StringField, validators, FloatField
app... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
# IMPORTS ----------------------------------------------------------------------
import glob
import os
import re
import io
# ---------------------------------------------------------------------... |
from dataclasses import dataclass
import numpy as np
import portion as p
from sklearn import linear_model
from .p_value import p_value
from . import ci
from typing import List
EPS = 1e-4
@dataclass
class SI_result:
"""this class returns the results of selective inference. Each selective inference function retur... |
from __future__ import division
import numpy as np
from .base import DataSource
class ArrayDataSource(DataSource):
def __init__(self, data,
start_time=None, tick_size=None,
data_start_time=None, data_tick_size=None):
if start_time is None:
start_time = data_s... |
import os
import jax
import jax.numpy as jnp
import numpy as np
import numpyro
import pandas as pd
from numpyro.infer import MCMC, NUTS, Predictive, init_to_median
from forecasting.time_series_model import gp
from forecasting.utils import load_holidays, load_timeseries, split_training
class UnivariateScaler:
""... |
#!/usr/bin/env python3
# vim: set sts=4 sw=4 et tw=0 :
#
# Author: <NAME> <<EMAIL>>
# License: MIT
#
import gi, sys, time
gi.require_version ('Gst', '1.0')
from gi.repository import Gio, GLib, Gst
Gst.init(None)
def get_displays():
display_p = Gio.DBusProxy.new_for_bus_sync(Gio.BusType.SESSION,
Gio.D... |
import os, sys
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
sys.path.append(BASE_DIR)
sys.path.append(os.path.join(BASE_DIR, "../"))
import torch
import torch.optim as optim
from models import I3D_backbone
from models.PS import PSNet
from utils.misc import import_class
from torchvideotransforms import video_t... |
from copy import deepcopy
from time import time
import torch
from sklearn.metrics import f1_score
from torch.nn.utils import clip_grad_norm_
from torch.nn.utils.rnn import pad_sequence
from torch.utils.data import DataLoader, WeightedRandomSampler
from torchvision import transforms
from tqdm import tqdm
from detectio... |
from collections import OrderedDict
from django.contrib import admin
from django.db.models import BooleanField
from django.urls import reverse
from django.utils.html import format_html
from stages.views.export import OpenXMLExport
from .forms import CandidateForm
from .models import (
Candidate, Interview, GENDER... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Mar 27 15:58:40 2018
@author: lz
"""
from __future__ import absolute_import
#import torch
import torch.nn as nn
import torch.nn.functional as F
import torchvision
from torch.nn import init
#from collections import OrderedDict
#import torch.utils.mode... |
from typing import List, Optional
import actionlib
import rospy
from actionlib import GoalStatus
from geometry_msgs.msg import PoseStamped
from iiwa_msgs.msg import (
CartesianPose,
JointPosition,
JointQuantity,
MoveToCartesianPoseAction,
MoveToCartesianPoseGoal,
MoveToJointPositionAction,
... |
'''
Defines functions to calculate the Mach and Re numbers, angles of attack, etc...
Several have a standardized interface, and are used for control gain interpolations in `MAPLEAF.GNC`
'''
import math
from MAPLEAF.Motion import Vector
from MAPLEAF.Utilities import cacheLastResult
def getAltitude(state, environment,... |
"""
Main
"""
import logging
from core.nn_model import build_model
from core.dataset import generate_dataset, generate_test_dataset
import matplotlib.pyplot as plt
from PIL import ImageFile, Image
import os
import pylab
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers
import mat... |
import pyaudio
import numpy as np
import math
import argparse
from sys import stdin
# Instantiate the parser
parser = argparse.ArgumentParser(description='PyCW - the Morse Code Source')
# Volume Argument
parser.add_argument('volume', type=float, help='Volume in range [0.0, 1.0]')
# Sampling Rate Argument
parser.add... |
from io import BytesIO
import flask
import flask_bootstrap
import redis
import json
import os
import jinja2
import uuid
import string
import random
import ipaddress
import hashlib
import time
import sys
import secrets
import logging as log
from zipfile import ZipFile
from flask_bootstrap import WebCDN
log.basicConfi... |
from . import utils
from bookiesports import BookieSports
from dataproxy import Config
class NotNormalizableException(Exception):
pass
class BookieLookup(object):
"""
This class serves as the normalization entry point for incidents.
All events / event group and participant names are replaced... |
# coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import fnmatch
impor... |
"""
--------------------------------------------------------------------------------
Description:
Primary Entrypoint into Ibis
Written by <NAME>, <NAME>, <NAME>
--------------------------------------------------------------------------------
"""
import os
from pathlib import Path
from typing import (
List,
Opt... |
"""CLI functionality.
Entry point: $ chicken-dinner [CMD] [OPTS] [player_name]
"""
import logging
import os
from collections import defaultdict
import click
from tabulate import tabulate
from chicken_dinner.assets.dictionary import update_dictionary
from chicken_dinner.assets.maps import update_maps
from chicken_din... |
# -*- coding: utf-8 -*-
"""
Tests for CriteriaVMCView
Note 1: Passed criteria functions determine which entries appear in which column(s)
Note 2: It is up to the user to ensure their criteria functions and func_args perform as expected
Note 3: Some entries can appear in more than one column if the criteria functions ov... |
# Copyright 2021 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0
from sis_provisioner.builders import Builder
from sis_provisioner.csv.format import SectionCSV
from sis_provisioner.dao.group import get_effective_members
from sis_provisioner.dao.course import (
valid_adhoc_course_sis_id, valid... |
from RLGames.Sapientino import COLORS
from RLGames.gym_wrappers.GymPygameWrapper import PygameVideoRecorder
from RLGames.gym_wrappers.GymSapientino import GymSapientino
from flloat.base.Symbol import Symbol
from flloat.parser.ldlf import LDLfParser
from gym.spaces import Tuple
from rltg.agents.RLAgent import RLAgent
fr... |
#! /usr/bin/env python
#
# This script is part of khmer, https://github.com/dib-lab/khmer/, and is
# Copyright (C) Michigan State University, 2009-2015. It is licensed under
# the three-clause BSD license; see LICENSE.
# Contact: <EMAIL>
#
# pylint: disable=invalid-name,missing-docstring
"""
De-interleave a file.
Take... |
import os
import sys
import asyncio
import pytz
import datetime
import random
import discord
from discord.ext import commands
from discord.http import LoginFailure
from dotenv import load_dotenv
from schedule import cal
def my_except_hook(exctype, value, traceback):
if exctype == LoginFailure:
print(value)... |
# -*- coding: utf-8 -*-
"""
Created on Thu Dec 12 10:07:06 2019
@author: shirhe-lyh
Reference:
https://github.com/tensorflow/models/blob/master/research/slim/nets/
mobilenet/mobilenet.py
"""
import collections
import torch
import core.models.mobilenet_v3.conv_blocks as conv_blocks
_Op = collections.... |
'''
a class of utility functions to handle files
'''
import os, errno, uuid
from vicms.abst import BaseContent
from flask import send_file, send_from_directory, current_app
from werkzeug.utils import secure_filename
from datetime import datetime, timezone
illegal_seq = ('*','..','&','%','$','>','<','|','!','?','`','\... |
import json
from .bread_spec import NUM_SYNTHS, WAVES_PER_SYNTH
class WaveSynthOverwriteLock(object):
def __init__(self, song, index):
self._index = NUM_SYNTHS - index - 1
self._locks = song.song_data.wave_synth_overwrite_locks
def enable(self):
self._locks[self._index] = True
de... |
# 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 app... |
import queue
import collections
class HuffmanNode:
__slots__ = ('weight',)
def __init__(self, weight):
self.weight = weight
def __lt__(self, other):
return self.weight < other.weight
class LeafNode(HuffmanNode):
__slots__ = ('symbol',)
def __init__(self, weight, symbol):
... |
#-----------------------------------------------------------------------#
# Library imports #
#-----------------------------------------------------------------------#
import torch
import torch.utils.data
from torch.utils.data import Dataset
import albumentations as... |
import os
import sys
import matplotlib.pyplot as plt
import numpy as np
from scipy.linalg import eigh
# mock module installation
sys.path.append(os.path.join('..', '..'))
from weights import Diffusion
np.random.seed(0)
plt.rcParams['text.latex.preamble'] = [r'\usepackage{newtxmath}']
plt.rcParams['text.usetex'] =... |
#!/usr/bin/env python3
import sys
from Gralog import *
import math
try:
import pycosat
except:
gPrint("Module pycosat needed to run this script. You may install it via python -m pip --user pycosat.")
exit()
# The formula for a given graph G is
#
# every vertex v has exactly one colour: R_v, B_v or G_v
#
#... |
#!/usr/bin/env python3
import os
import csv
import sys
import base64
import socket
import random
import argparse
import colorama
import requests
import threading
import concurrent.futures
from builtins import input # compatibility, python2/3
from datetime import datetime
from colorama import Fore, Style
from user_agen... |
##############################################################################
#
# Copyright (c) 2006 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOF... |
# This is a action plugin for Ansible 2.0
# Put it in your action_plugins folder.
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import re
from datetime import datetime, timedelta
import subprocess
import tempfile
import base64
from str... |
# Copyright (c) 2016 Codethink Limited
#
# 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 ... |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import argparse
import json
import random
import re
import jieba
import spacy
from tqdm import tqdm
random.seed(42)
nlp_en = spacy.load('en_core_web_sm')
def is_all_chinese(word):
# identify whether all chinese characters
for _char in... |
from copy import deepcopy
import pandas as pd
import numpy as np
import json
import os
class Pipeline:
def __init__(self, id=0):
self.steps = []
self.id = id
def add_step(self, step):
self.steps.append(step)
class Pipeline_run:
def __init__(self, learning_job, pipeline=None):
... |
import configparser
from datetime import datetime
import os
from pyspark.sql import SparkSession
from pyspark.sql.functions import udf, col, monotonically_increasing_id
from pyspark.sql.functions import year, month, dayofmonth, hour, weekofyear, date_format, dayofweek, from_unixtime, to_date
from pyspark.sql.types impo... |
import collections
import pytest
from tests.helpers.models import User
from bloop.actions import ActionType
from bloop.engine import Engine
from bloop.exceptions import MissingKey
from bloop.models import BaseModel, Column
from bloop.types import Integer
from bloop.util import (
Sentinel,
default_context,
... |
# Copyright 2019 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... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Aug 18 14:23:06 2021
@author: saimihirj
"""
# Bioinformatics - WEEK 4
# Which DNA Patterns Play The Role of Molecular Clocks?(Part 2)
# Input: A set of kmers Motifs
# Output: Count(Motifs)
def CountWithPsuedocounts(Motifs):
count = {} # initializ... |
from random import choice
import discord.ui
from discord import ButtonStyle, Embed, Interaction, Member
from discord.ui import Button, View
from bot.bot import Bot
from bot.constants import Colours, NEGATIVE_REPLIES
class ScoreboardView(View):
"""View for the scoreboard."""
def __init__(self, bot: Bot):
... |
#!/usr/bin/env python3
import tempfile
import os
import glob
import sys
from termcolor import cprint
import time
import shutil
from msbase.subprocess_ import try_call_std
from msbase.utils import load_json, write_pretty_json, file_size_mb
from uichecker.common import run_markii, produce_report, parse_seconds, run_ga... |
import numpy as np
import cv2
from pathlib import Path
models_path = Path(__file__).parent / 'models'
face_prototxt_path = str(models_path / 'face_deploy.prototxt')
face_caffemodel_path = str(models_path / 'face_res10_300x300_ssd_iter_140000.caffemodel')
landmark_prototxt_path = str(models_path / 'landmark_deploy.pro... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This file is to get the homolog accession identifiers and sequences for the following multiple sequence alignment
import re
import sys
import os
from Bio import SeqIO
from Bio import Entrez
from ete3 import NCBITaxa
def parse_NCBI(filename):
with open(filename, ... |
#
# client.py
#
# Copyright 2022 <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... |
import datetime
import importlib
import json
import logging
import socket
import sys
import time
from pathlib import Path
import gevent
import yaml as yaml
from locust import web, runners, events
from locust.inspectlocust import print_task_ratio, get_task_ratio_dict
from locust.log import setup_logging, console_logger... |
"""Support for NAD digital amplifiers which can be remote controlled via tcp/ip."""
import logging
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.components.media_player import (
MediaPlayerEntity, PLATFORM_SCHEMA, DEVICE_CLASS_RECEIVER)
from homeassistant.compone... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# (c) <NAME>, 2019
# File : utils.py
# License: MIT
# Author : <NAME> <<EMAIL>>
# Date : 08.10.2019
import collections
from dataclasses import is_dataclass
import itertools
import os
import re
import time
from typing import TypeVar, Type, Callable, List, Dict, Any
p... |
#!/usr/bin/python
# this will be used for aggregating data.
# essentially need to:
# create the table as with add_table.py
# execute some SQL to fill it
# e.g. add_monthly_aggregation_table.py Maximum "Rainfall mm" "float"
# should this not be automatic on adding an observed data table?
import ClimateDataPortal
d... |
# -*- coding: utf-8 -*-
import operator
import pathlib
import numpy as np
import pandas as pd
def form_hhaa_records(df,
team_locn='h',
records='h',
feature = 'ftGoals'):
"""
Accept a league table of matches with a feature
"""
team_re... |
import click
from textwrap import dedent
from pathlib import Path
from typing import Optional
from .file_utils import pad_empty_file
from .doc_utils import (
read_docs_from_file, filter_out_cac_pubs,
filter_out_already_downloaded_docs, filter_out_non_pdf_docs
)
from .download_handlers import process_all_docs
fr... |
# 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... |
#!/usr/bin/env python3
"""
#------------------------------------------------------------------------------
#
# SCRIPT: run_s2spost_cf_1month.py
#
# PURPOSE: Automates generation of daily and monthly CF files from one month
# of LIS output.
#
# REVISION HISTORY:
# 23 Sep 2021: <NAME> (SSAI), first version.
# 27 Oct 2021... |
# This file shows a demo implementation of kernel classifiers like L1,L2-logreg,
# SVC, RVC.
# Author <NAME>(@always-newbie161)
import superimport
import numpy as np
import h5py
import requests
from io import BytesIO
from scipy.io import loadmat
import matplotlib.pyplot as plt
from sklearn.svm import SVC
from sklear... |
# coding: utf-8
'''
.. code-block:: bash
neutron-reaper {info, delete} \
{ip, port} \
<grace-days>
Reclaims idle floating IPs and cleans up stale ports.
Required arguments, in order:
* ``info`` to just display what would be cleaned up, or actually clean it up with ``delete`... |
#!usr/bin/env python
# -*- coding: utf-8 -*-
# @Date: 2017-03-22
# UE14CS348 Digital Image Processing Mini Project
# Indian paper currency detection
# utils.py
# contains utility functions
import cv2
import math
import numpy as np
from pprint import pprint
# read image as is
def read_img(file_name):
img = cv2.imr... |
# encoding = utf-8
import json
from typing import List, Any
from traceback import format_exc
from datetime import datetime, timezone, timedelta
# from dateparser import parse
try:
from pyxdr.pyxdr import PyXDRClient
except ImportError:
import os
import sys
libpath = os.path.dirname(os.path.abspath(_... |
import pickle as pkl
import numpy as np
from beeracer.codeParserLambda import CodeParser
from beeracer.physics import Moveable, Physical
from beeracer.settings import *
from beeracer.sprites import Pollen
class Bee(Moveable):
def __init__(self, game, spritepath: str, dt=0.05, assemblypath=None, binary=None, pos... |
import random
from .config import *
class Player:
def __init__(self, user, player_id):
self.name = user.user
self.user = user
self.id = player_id
self.inventory = []
self.n = 0
def get_information(self):
resp = {
'id': self.id,
'cards'... |
# -*- coding: utf-8 -*-
'''
License:
© Copyright 2018, Networked Systems group, ESAT-TELEMIC,KU Leuven.
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 a... |
import numpy as np
import pandas as pd
import itertools
import matplotlib.pyplot as plt
import datetime
from sklearn import svm
from sklearn.preprocessing import RobustScaler
from sklearn.metrics import confusion_matrix
threshold = 40.1 # Storm threshold
class_weight = 1 # SVM hyperparameter
gamma = 0.0... |
from django.contrib import messages
from django.contrib.admin.views.decorators import staff_member_required
from django.contrib.auth.decorators import permission_required
from django.contrib.auth.mixins import LoginRequiredMixin
from django.core.exceptions import PermissionDenied
from django.db import transaction
from ... |
#!/usr/bin/env python
# vim: noet:ts=4:sts=4:sw=4
"""
Utilities catchall.
"""
import os
import sys
import psutil
import pprint
import subprocess
def catalog(base,path=None):
"""
Traverse all paths in a nested dictionary. Returns a list of pairs: paths and values.
Note that lists can be a child item; catalog does ... |
from http.client import responses
import requests
USER_AGENT = "Circle K B2C app"
GAME_API_URL = "https://api.mgame.nu/server-2022-summer-eu-circlek/server.php"
COUNTRY_CODE = "dk" # Only tested with Denmark
OTLINK_RETURN_URI = "fb2050160281848445" # Not sure what this means
APP_CLIENT_ID = "fb0adc92-ee2d-3a79-8636-af... |
"""
Command line interface for image processing.
"""
import contextlib
import logging
import os
from functools import partial
import click
import cv2
import numpy as np
from patchies.index import img_index
from patchies.pipeline import (cats, celeba, cifar100, make_mosaic,
slice_params... |
# -*- coding: utf-8 -*-
from numpy import in1d
from pandas import read_table, DataFrame
from .enrichr import get_library_name
import sys, logging
def unique(seq):
"""Remove duplicates from a list in Python while preserving order.
:param seq: a python list object.
:return: a list without duplicates ... |
# Imports from 3rd party libraries
import dash
import dash_bootstrap_components as dbc
from dash.dependencies import Input, Output
import dash_core_components as dcc
import dash_html_components as html
import joblib
import pickle
from joblib import load
import numpy as np
import pandas as pd
from app import app
#pipel... |
# -*- coding: utf-8 -*-
##########################################################################
# NSAp - Copyright (C) CEA, 2020
# Distributed under the terms of the CeCILL-B license, as published by
# the CEA-CNRS-INRIA. Refer to the LICENSE file or to
# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
#... |
"""website example tests
Log output cannot be tested!
#doctest: +ELLIPSIS
"""
import cssutils
cssutils.ser.prefs.useDefaults()
def profile():
"""
>>> import cssutils
>>> sheet = cssutils.parseString('x { -test-custommacro: x }')
>>> print sheet.cssRules[0].style.getProperties()[0].vali... |
# Copyright 2022 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.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... |
#!/usr/bin/python
'''
routines for acquiring dvd details, based on dvdinfo.py (many thanks
to <NAME>, http://stuvel.eu/dvdinfo).
'''
import re
import sys
import datetime
import argparse
from itertools import count
from subprocess import Popen, PIPE, STDOUT
from typing import Set
try:
from importlib import metadat... |
# -*- coding: utf-8 -*-
# Copyright (c) 2021-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 app... |
#!/usr/bin/env python
#
# Copyright (c) 2019 Opticks Team. All Rights Reserved.
#
# This file is part of Opticks
# (see https://bitbucket.org/simoncblyth/opticks).
#
# 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... |
# -*- coding: utf-8 -*-
from extensions.path import path
import gtk
from configobj import ConfigObj
MAGICK_COL = 65535.0
default_colors = {'pers': 'ff5600', 'tool': '0000ff',
'trans': '0000ff', 'node': '0000ff',
'fire': 'dd0000', 'earth': '00bb00', 'air': 'ffb600',
'water': '0000ff', 'orange':... |
#
# Copyright 2016 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... |
import argparse
import logging
import numpy as np
from obiwan import SimCatalog,BrickCatalog,utils,setup_logging
import settings
logger = logging.getLogger('preprocessing')
def isELG_colors(gflux=None, rflux=None, zflux=None, south=True, gmarg=0., grmarg=0., rzmarg=0., primary=None):
"""
Apply ELG selection w... |
import torch
import torch.nn as nn
import torch.nn.init as init
import torch.nn.functional as F
from torch.nn.utils.rnn import pad_packed_sequence as unpack
from torch.nn.utils.rnn import pack_padded_sequence as pack
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
class LSTMEncoder(nn.Module):
... |
# coding=utf-8
# Copyright 2021 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... |
import vapoursynth as vs
import vsutil
from G41Fun import MaskedDHA
from debandshit import f3kbilateral
from havsfunc import LSFmod
from lvsfunc.aa import upscaled_sraa
from lvsfunc.kernels import Bicubic
from lvsfunc.mask import detail_mask
from lvsfunc.misc import replace_ranges
from lvsfunc.types import Range
from... |
# -*- coding: utf-8 -*-
import os, sys
import warnings
warnings.filterwarnings("ignore")
import numpy as np
import matplotlib.pyplot as plt
import argparse, uuid, time
from skimage import io, transform
from tifffile import imsave
from collections import defaultdict
import torch
import torch.nn as nn
from torch.autogr... |
#!/usr/bin/python3
#############################################################################################
# Program by <NAME> #
# Email: <EMAIL> #
# Date: 09/17/2019 ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Author:
# <NAME>
#
# Contact
# <EMAIL>
#
# <NAME>,
# Biomolecular Sciences Building,
# University of St Andrews,
# North Haugh Campus,
# St Andrews,
# KY16 9ST
# Scotland,
# UK
#
# The MIT License
"""Contains function to parse the output from eCAMI, and create a standaris... |
""" from https://github.com/keithito/tacotron """
import re
import pickle
from text import cleaners
#from text.symbols import symbols
from feature_extraction import pipeline
import pandas as pd
#_symbol_to_id = {s: i for i, s in enumerate(symbols)}
#_id_to_symbol = {i: s for i, s in enumerate(symbols)}
_curly_re = r... |
import logging
from typing import Dict, List
from allennlp.common.checks import ConfigurationError
from allennlp.common.file_utils import cached_path
from allennlp.common.util import START_SYMBOL, END_SYMBOL
from allennlp.data import Field
from allennlp.data.dataset_readers.dataset_reader import DatasetReader
from all... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from flask import request, render_template, url_for, make_response, flash, send_file, redirect, Response
import tempfile, string, random, os, json, time, re
from http import HTTPStatus
from concurrent.futures import ThreadPoolExecutor
from queue import Queue
import youtub... |
"""
Offers methods for calculating room impulse responses and convolutions of these
with audio signals.
"""
import numpy as np
import scipy
import scipy.signal
eps = 1e-60
window_length = 256
# TODO: Refactor
def generate_rir(
room_dimensions,
source_positions,
sensor_positions,
soun... |
#!/usr/bin/env python
# Filename: ndvi_landsat7
"""
introduction: calculate multispectral indices of Landsat 7,
including Brightness, Greenness, Wetness, NDVI, NDWI, NDMI
The input image is download from Google Eerth Engine
For comparison, we will stack the NDVI of each image and give a name consiting with image date,... |
# -*- coding:utf-8 -*-
#
# Camera calibration module
#
# External dependencies
import glob
import math
import pickle
import cv2
import numpy as np
# Calibration pattern size
pattern_size = ( 9, 6 )
# Find the chessboard quickly, and draw it
def PreviewChessboard( image ) :
# Convert image from BGR to Grayscale
gr... |
from typing import Any, Dict, Iterable, List, Optional
from fastapi import Depends
from rubrix.server.commons.es_wrapper import ElasticsearchWrapper, create_es_wrapper
from rubrix.server.commons.helpers import unflatten_dict
from rubrix.server.commons.settings import settings
from rubrix.server.datasets.dao import (
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.