text stringlengths 6.04k 39.5k |
|---|
# -*- coding: utf-8 -*-
#
# PySceneDetect: Python-Based Video Scene Detector
# ---------------------------------------------------------------
# [ Site: http://www.bcastell.com/projects/PySceneDetect/ ]
# [ Github: https://github.com/Breakthrough/PySceneDetect/ ]
# [ Documentation: http://py... |
import os
import random
from functools import partial
from itertools import chain, product
from collections import Container, namedtuple
import warnings
import math
from gbdxtools.rda.io import to_geotiff
from gbdxtools.rda.util import RatPolyTransform, AffineTransform, pad_safe_positive, pad_safe_negative, RDA_TO_DTY... |
"""
Functions for visibility coalescence and decoalescence.
The BlockVisibility format describes the visibility
data_models as it would come from the correlator: [time, ant2, ant1, channel, pol]. This is well-suited to
calibration and some visibility processing such as continuum removal. However the BlockVisibility fo... |
# -*- coding: utf-8 -*-
'''
Neural Network model under POM1.
'''
__author__ = "<NAME>"
__date__ = "February 2021"
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' # Disables tensorflow warnings
# Code to ensure reproducibility in the results
from numpy.random import seed
seed(1)
from tensorflow.com... |
# -*- coding: utf-8 -*-
"""
Created on Nov 24, 2014
@author: moloch
Copyright 2014 Root the Box
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/licen... |
import settings
import helpers
import sys
import os
import glob
import random
import pandas
import ntpath
import cv2
import numpy
from typing import List, Tuple
from keras.optimizers import Adam, SGD
from keras.layers import Input, Convolution2D, MaxPooling2D, UpSampling2D, merge, Convolution3D, MaxPooling3... |
import numpy as np
import cv2
import threading
from importlib import import_module
import os
from flask import Flask, render_template, Response
from multiprocessing import Process, Manager
import time
from utils import cpu_temperature
# from rgb_matrix import RGB_Matrix
app = Flask(__name__)
@app.route('/')
def index... |
# This file is part of the Python aiocoap library project.
#
# Copyright (c) 2012-2014 <NAME> <http://sixpinetrees.blogspot.com/>,
# 2013-2014 <NAME> <<EMAIL>>
#
# aiocoap is free software, this file is published under the MIT license as
# described in the accompanying LICENSE file.
"""A plain CoAP resou... |
import enum
import os.path
from glob import glob
from dataclasses import dataclass
from enum import Enum, auto
from generalsmodbuilder.data.common import ParamsT, VerifyParamsType
from generalsmodbuilder.util import JsonFile
from generalsmodbuilder import util
class BundleEventType(Enum):
OnPreBuild = auto()
... |
""" Tools for getting and setting install names """
from subprocess import Popen, PIPE
import os
from os.path import join as pjoin, relpath, isdir, exists
import zipfile
import re
import stat
import time
class InstallNameError(Exception):
pass
def back_tick(cmd, ret_err=False, as_str=True, raise_err=None):
... |
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
"""Interact with functions using widgets."""
from __future__ import print_function
from __future__ import division
try: # Python >= 3.3
from inspect import signature, Parameter
except ImportError:
from IPyth... |
# Copyright 2020 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Classes to manage cached values.
Monorail makes full use of the RAM of GAE frontends to reduce latency
and load on the database.
Even though these caches... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Mar 25 15:54:09 2021
@author: emi
"""
# ------------------------------------------------------------------------ #
# Copyright (c) 2019 <NAME>., <NAME>., <NAME>. #
# #
# Licensed u... |
# coding=utf-8
import os
import re
import subprocess
import unittest
import pytest
import six
from mock import patch
from parameterized import parameterized
from conans.client import tools
from conans.client.tools.scm import Git
from conans.errors import ConanException
from conans.test.utils.scm import create_local_g... |
from __future__ import print_function
import os
import argparse
import torch
import torch.nn as nn
import torch.nn.functional as F
import torchvision
from torch.autograd import Variable
import torch.optim as optim
from torchvision import datasets, transforms
from models.wideresnet import *
from models.resnet import *
f... |
# ---
# jupyter:
# jupytext:
# formats: py:light
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.5'
# jupytext_version: 1.11.3
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# ---
import pandas as pd
import num... |
##!/usr/bin/python
'''
Import modules
'''
import socket
import time
import fcntl
import re
import os
import errno
import struct
import signal
import sys
from collections import OrderedDict
import logging
from time import sleep
import datetime
import json
#log file configuration
logfile = '/var/log/YeeLight.log'
#con... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2012, <NAME> <<EMAIL>>
# Sponsored by Four Kitchens http://fourkitchens.com.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
AN... |
# Copyright 2020 by <NAME>, <NAME>, <NAME>, <NAME>, and <NAME>
# This software is distributed under the 3-clause BSD License.
# Utility functions for mmw, sequantial sampling and sample trees
import os
import math
import importlib
import numpy as np
import mpisppy.MPI as mpi
import pyomo.environ as pyo
import mpisppy... |
import keras
from keras.models import Sequential, Model, load_model
from keras.layers import Dense, Dropout, Activation, Flatten, Input, Lambda
from keras.layers import Conv2D, MaxPooling2D, BatchNormalization, Concatenate, Reshape, Softmax
from keras import backend as K
import keras.losses
import os
import pickle... |
"""Tools for plotting."""
import time
import matplotlib as mpl
import numpy as np
from matplotlib import pyplot as plt
from matplotlib import ticker
from matplotlib.animation import FuncAnimation
from matplotlib.ticker import MaxNLocator
from mpl_tools import place
from numpy import arange, array
from patlib.std impo... |
#! /usr/bin/env python3
from argparse import ArgumentParser
import csv
from datetime import datetime
import json
from matplotlib import pyplot as plt
from pathlib import Path
import clr
import cmsmodel
def main():
# Most of this is ignored because we pass explicit values into solvers.CreateSolver() below. Real... |
#!/usr/bin/env python
# encoding: utf-8
#
# Stylus, Copyright 2006-2009 Biologic Institute
#
# 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.... |
# Scangen:
# written by <NAME>
# email: <EMAIL>
# License - Free for non-commercial, educational use.
# (c) 2016
# This program may be used in part or its entirety for non-commercial, educational
# purposes.
import sys
import stack
import state
import nfastate
import streamreader
import orderedcollections
epsilon = "... |
"""
Defines Configuration, YamlLoader and relevant Enums, which parses and validates a given yaml config.
"""
# Authors: <NAME> <<EMAIL>>
# License: MIT
from enum import Enum, unique, auto
from typing import List, Dict, Optional
from emerge.metrics.numberofmethods.numberofmethods import NumberOfMethodsMetric
from em... |
#!/usr/bin/python3
"""
Module to run the camera in video mode with up to 4 differently purposed streams.
each stream can be independently started and stopped. The 4 streams are intended to be used for any combination of:
streaming live video - simply using mjpeg
watching for movement - continuously capture (f... |
#!/usr/bin/python
# Copyright (c) 2017-2019 Forcepoint
ANSIBLE_METADATA = {
'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'
}
DOCUMENTATION = '''
---
module: firewall_nat_rule
short_description: Create, modify or delete a firewall NAT rule
description:
- Firewall NAT rules... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import functools
import operator
from collections import defaultdict
import numpy as np
from . import duck_array_ops
from . import dtypes
from . import utils
from .indexing import get_indexer
from .pycompat im... |
import random
import os
import csv
from PIL import Image
from tqdm import tqdm
import torch
import numpy as np
import random
import matplotlib.pyplot as plt
from matplotlib.offsetbox import OffsetImage, AnnotationBbox
def opencsv(filename):
"""
Open a csv file and return the content as a list of lists.
Ar... |
################################################################################
# Copyright 2020-2021 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.apa... |
'''Utilities for patching in cassettes'''
import functools
import itertools
from .compat import contextlib, mock
from .stubs import VCRHTTPConnection, VCRHTTPSConnection
from six.moves import http_client as httplib
# Save some of the original types for the purposes of unpatching
_HTTPConnection = httplib.HTTPConnect... |
import os
import sys
import parmed as pmd
import numpy as np
import argparse
babel = '/u/fd/ball4935/.linuxbrew/bin/babel'
antechamber = '/u/fd/ball4935/opt/amber18/bin/antechamber'
parmchk = '/u/fd/ball4935/opt/amber18/bin/parmchk2'
leaprc_forcefield_file = '/u/fd/ball4935/opt/amber18/dat/leap/cmd/leaprc.gaff2'
tleap... |
# Copyright 2017-present Kensho Technologies, LLC.
from collections import OrderedDict
from datetime import date, datetime
from decimal import Decimal
from hashlib import sha256
from itertools import chain
from typing import Any, FrozenSet, Iterable
import arrow
from graphql import (
DirectiveLocation,
GraphQL... |
# Copyright 2016, 2019 <NAME>. 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... |
import re
import base64
from roscraco.router.base import RouterBase
from roscraco.helper import validator, converter
from roscraco.exception import RouterParseError, RouterIdentityError
from roscraco.response import RouterInfo, TrafficStats, DMZSettings, \
ConnectedClientsListItem, ConnectedClientsList, Wireles... |
# OpenPCDet PyTorch Dataloader and Evaluation Tools for Waymo Open Dataset
# Reference https://github.com/open-mmlab/OpenPCDet
# Written by <NAME>, <NAME>
# All Rights Reserved 2019-2020.
import os
import pickle
import copy
import numpy as np
import torch
import multiprocessing
import SharedArray
import to... |
"""
Copyright 2015 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.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
di... |
import torch
from torch.autograd import Variable
import torch.nn.functional as F
from tqdm import tqdm
import statistics
import torchvision.utils as vutils
from icecream import ic
from models_def.models_brdf import LSregressDiffSpec
# def get_im_input(data_batch, opt, return_input_batch_as_list=False)
def get_labels... |
from __future__ import print_function
import argparse
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torchvision import datasets, transforms
from torch.autograd import Variable
import numpy as np
from utils import *
from taskcv_loader import CVDataLoader
from basenet... |
"""This module defines :class:`hyperparameter_hunter.metrics.ScoringMixIn` which enables
:class:`hyperparameter_hunter.experiments.BaseExperiment` to score predictions and collect the
results of those evaluations
Related
-------
:mod:`hyperparameter_hunter.experiments`
This module uses :class:`hyperparameter_hunte... |
#
# Copyright (c) 2018 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... |
#!/usr/bin/env python3
###################################################################################################
## SDI TAPAS python demo application - communication module
##
## Revisions:
## 1.0 - Initial version
##
## Copyright (c) 2017 Siemens AG
# Redistribution and use in source and binary forms, with... |
"""
Tagulous test: django migrations
Modules tested:
tagulous.models.migrations
"""
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
from importlib import import_module
import os
import sys
import shutil
import warnings
import django
from django.... |
import pyedflib
import numpy as np
import pandas as pd
import math
import scipy.signal as signal
from scipy.signal import hilbert
import arrow
from datetime import datetime as dt
from datetime import timedelta as td
from bs4 import BeautifulSoup
import matplotlib.pyplot as plt
def get_edf_signal_indices(f, sign... |
#!/usr/bin/env python
#
# Based on code by <NAME> <<EMAIL>>
# Rev: 1139; Date: 2008-04-16
# (see license text in pathos.pp_map)
#
# Forked by: <NAME> (April 2008)
# Author: <NAME> (mmckerns @caltech and @uqfoundation)
# Copyright (c) 2008-2016 California Institute of Technology.
# Copyright (c) 2016-2021 The Uncertaint... |
import os
import shutil
from functools import reduce
from pathlib import Path
import datajoint as dj
import numpy as np
import spikeinterface as si
import spikeinterface.extractors as se
import spikeinterface.toolkit as st
import probeinterface as pi
from ..common.common_device import Probe
from ..common.common_ephys... |
"""
Transformer used to apply basic transformations on MRI data.
"""
# Author: <NAME>, <NAME>
# License: simplified BSD
import warnings
from copy import copy as copy_object
from functools import partial
from joblib import Memory
from .base_masker import BaseMasker, _filter_and_extract
from .. import _utils
from .. i... |
import abc
from collections import namedtuple
from enum import Enum
import six
from dagster import check
from dagster.core.errors import DagsterError
from dagster.core.host_representation import ExternalSchedule
from dagster.core.instance import DagsterInstance
from dagster.core.origin import ScheduleOrigin
from dags... |
"""
problog.dd_formula - Decision Diagrams
--------------------------------------
Common interface to decision diagrams (BDD, SDD).
..
Part of the ProbLog distribution.
Copyright 2015 <NAME>, DTAI Research Group
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this fil... |
# -*- coding: utf-8 -*-
from xBot import *
from multiprocessing import Pool, Process
from subprocess import check_output
from datetime import datetime
from threading import Thread
from time import sleep
from bs4 import BeautifulSoup
import time, random, pytz, atexit, ctypes, livejson, sys, shutil, json, codecs, ast, th... |
import sys
sys.path.append(".")
import numpy as np
from dctree.core.basemodel import BaseModel
def mode(array:np.ndarray,return_percents=False):
"""
Return an array of modal values
"""
uniques, counts = np.unique(array, return_counts=True)
modes = uniques[counts == np.amax(counts)]
if return_pe... |
"""
For information on the Elsevier API, see:
- API Specification: http://dev.elsevier.com/api_docs.html
- Authentication: https://dev.elsevier.com/tecdoc_api_authentication.html
"""
from __future__ import absolute_import, print_function, unicode_literals
from builtins import dict, str
import os
import re
import l... |
import re
from genie.metaparser import MetaParser
from genie.metaparser.util.schemaengine import Schema, Any, Optional
class ShowRouteMapAllSchema(MetaParser):
"""Schema for show route-map all"""
schema = {
Any():
{Optional('description'): str,
'statements':
... |
#!/usr/bin/env python
# Scatter3: binary scattering package replicating most of the
# functionality of the scatter3 tool in Starlab. See McMillan & Hut
# 1996, ApJ, 467, 348.
import sys, unittest, numpy, random, collections, getopt, os, math
from time import *
from amuse.units import nbody_system
from amuse.units ... |
#!/usr/bin/env python3
import stanza
import sys
from aima3.logic import expr
from aima3.logic import FolKB
import aima3.logic as aima
import num2words
import re
from collections import defaultdict
import os
import re
# stanza.download('en')
def get_subtree(sent, id):
# RETURN A LIST OF IDS
forThePhrase = []
... |
# coding=utf-8
# Copyright 2019 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 numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.utils.data import DataLoader,Dataset
import one_torch_utils as otu
from torchvision import datasets, transforms
import os
import cv2
from PIL import Image
import itertools
import glob
import random
from torchvision.utils im... |
#!/usr/bin/env python
"""
What
----
vbench is a library which can be used to benchmark the performance
of a codebase over time.
Although vbench can collect data over many commites, generate plots
and other niceties, for Pull-Requests the important thing is the
performance of the HEAD commit against a known-good baseli... |
# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto. Any use, reproduction, disclosure or
# distribution of this sof... |
# BSD Licence
# Copyright (c) 2010, Science & Technology Facilities Council (STFC)
# All rights reserved.
#
# See the LICENSE file in the source distribution of this software for
# the full license text.
"""
A framework for translating DRS objects to and from filenames and paths.
This module is very object-heavy and ... |
# Stack manipulations
# Author: <NAME>, 2017, 2019
"""Import and export image stacks in various formats.
"""
import os
import glob
import numpy as np
from skimage import transform
from skimage import io
from matplotlib import animation
from scipy import ndimage
from magmap.cv import chunking
from magmap.plot import ... |
# Copyright 2017 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 ... |
'''
Soft Actor-Critic version 1
using state value function: 1 V net, 1 target V net, 2 Q net, 1 policy net
paper: https://arxiv.org/pdf/1801.01290.pdf
'''
import math
import random
import gym
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
from torch... |
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
from torch.autograd import Variable
from pdb import set_trace as breakpoint
class LinearDiag(nn.Module):
def __init__(self, num_features, bias=False):
super(LinearDiag, self).__init__()
weight = torch... |
#/usr/bin/python
__version__ = '1.0'
__author__ = '<EMAIL>'
##
## Generals
import os
import sys
import errno
import shutil
import subprocess
import logging as log
##
## Backend junk
from ..__backend import Colour as clr
from ..seq_qc.__quality_control import THREADS
import warnings; warnings.simplefilter("ignore") ##... |
#!/usr/bin/python
#
# 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 ag... |
# python
import os
import collections
# from itertools import cycle
import logging
logging.basicConfig(level=logging.WARNING)
from ast import literal_eval
#import warnings
#########################################################
## data
import pandas as pd
import numpy as np
import networkx as nx
##################... |
import numpy as np
import os
import pickle as pl
import tables
import h5py
from scipy.constants import c, pi
import gc
from mpl_toolkits.axes_grid1.axes_divider import make_axes_locatable
from data_plotters_animators import read_variables
from functions import *
import warnings
warnings.filterwarnings('ignore')
import... |
DATASET_DIR = '/home/ds/Projects/SARA/datasets/fields_segmentation'
SRC_IMAGES_PREFIX = '/home/ds/Projects/SARA/data/generated_images/document_crops_rotated/'
DST_IMAGES_PREFIX = '/home/ds/Projects/SARA/data/generated_images/fields_segm_resize_640_v1/'
SRC_MASKS_PREFIX = '/home/ds/Projects/SARA/annotations/fields_segme... |
import numpy as np
import pytest
import psyneulink as pnl
import psyneulink.core.llvm as pnlvm
import psyneulink.core.components.functions.stateful.integratorfunctions as Functions
from psyneulink.core.components.functions.function import FunctionError
from psyneulink.core.components.functions.nonstateful.transferfun... |
"""
This module implements the `se interactive-replace` command.
"""
import argparse
import curses
from pathlib import Path
import os
from math import floor
from typing import Tuple
import regex
import se
TAB_SIZE = 8
def _get_text_dimensions(text: str) -> Tuple[int, int]:
"""
Get the number of rows and column... |
#!/usr/bin/python3
# -*- coding=utf-8 -*-
"""Data process utility functions."""
import numpy as np
import random
from PIL import Image, ImageEnhance
import cv2
#from matplotlib.colors import rgb_to_hsv, hsv_to_rgb
def rand(a=0, b=1):
return np.random.rand()*(b-a) + a
def letterbox_resize(image, target_size, ret... |
#!/usr/bin/env python
# This will (hopefully) be the code to extract symmetry operations
# from Hall symbols
'''
Code from https://github.com/atztogo/spglib/tree/master/database
Originally created by <NAME>.
Modified by <NAME> for python 3 compatibility.
'''
import numpy as np
lattice_symbols = {
'P': [ [ 0, 0,... |
from __future__ import print_function, unicode_literals
from collections import namedtuple
import six
from attr import attrs, attrib
from attr.validators import instance_of, provides
from automat import MethodicalMachine
from zope.interface import Interface, implementer
from twisted.python import log
from twisted.inter... |
""" Ensemble classifiers
http://en.wikipedia.org/wiki/Ensemble_learning
Current implementations use gating for training ensemble methods.
Each gating function expects as input a special kind of
:class:`~pySPACE.resources.data_types.prediction_vector.PredictionVector`: Each
component in the vector should correspond ... |
"""
Finite Discrete Random Variables Module
See Also
========
sympy.stats.frv_types
sympy.stats.rv
sympy.stats.crv
"""
from __future__ import print_function, division
import random
from itertools import product
from sympy import (Basic, Symbol, cacheit, sympify, Mul,
And, Or, Tuple, Piecewise, Eq,... |
"""Groups views."""
from collections import OrderedDict
from json import dumps
import logging
from django.contrib import messages
from django.contrib.auth import get_user_model
from django.core.cache import cache
from django.core.exceptions import PermissionDenied
from django.core.urlresolvers import reverse
from djan... |
import logging
import numpy as np
import scipy.sparse
import tensorflow as tf
from sklearn.model_selection import train_test_split
from typing import Optional, Dict, Text, List, Tuple, Any, Union, Generator, NamedTuple
from collections import defaultdict
from rasa.utils.tensorflow.constants import BALANCED, SEQUENCE
... |
#!/usr/bin/env python3
# -*- coding:utf-8 -*-
"""
@version: V0.1
@license: MIT Licence
@author: danquxunhuan
@mail: <EMAIL>
@project: tello
@file: detector.py
@create time: 18-12-30 11:50
@description:
"""
import math
import os
import time
import cv2
import numpy as np
import tensorflow as tf
from config... |
#!/usr/bin/env python3.6
# -*- coding: utf-8 -*-
import argparse
import collections
import json
import os
import random
import time
from typing import Dict, Tuple
from collections import Counter
from tabulate import tabulate
import torch
from tensorboardX import SummaryWriter
from torch import nn, optim
from torchte... |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
from __future__ import print_function
from __future__ import unicode_literals
import io
import json
import logging
import os
import sys
from jinja2 import FileSystemLoader, Environment
import nbformat
from notebook.base.handlers import IPythonHandler, APIHandler
from note... |
from __future__ import annotations
import abc
from collections import defaultdict
from typing import Any, Optional
def cap_feature(s):
"""
Capitalization feature:
0 = low caps
1 = all caps
2 = first letter caps
3 = one capital (not first letter)
"""
if s.lower() == s:
return "... |
r"""
Custom Dataset module.
Consist of Dataset that designed for different tasks.
"""
import cv2
import json
import torch
import random
import numpy as np
from tqdm import tqdm
from pathlib import Path
from torch.utils.data import Dataset
from .log import LOGGER
from .bbox import xywhn2xyxy, xyxy2xywhn, rescale_xywh... |
import boto3
import datetime
from synapseclient import Synapse
from synapseclient.core import sts_transfer
from synapseclient.core.sts_transfer import StsTokenStore, _TokenCache, with_boto_sts_credentials
from synapseclient.core.utils import datetime_to_iso
import pytest
from unittest import mock
class TestGetStsC... |
from __future__ import unicode_literals
import json
import re
from .common import InfoExtractor
from ..compat import compat_HTTPError
from ..utils import (
ExtractorError,
int_or_none,
parse_age_limit,
traverse_obj,
)
class ViewLiftBaseIE(InfoExtractor):
_API_BASE = 'https://prod-api.viewlift.co... |
r"""
Huffman Encoding
This module implements functionalities relating to Huffman encoding and
decoding.
AUTHOR:
- <NAME> (2010-05): initial version.
Classes and functions
=====================
"""
###########################################################################
# Copyright (c) 2010 <NAME> <<EMAIL>>
#
#... |
from collections import defaultdict
import os
import re
import pygame
from pygame.locals import *
import pygame_gui
SCREENSIZE = (1024,640)
WHITE = pygame.Color(255,255,255,255)
BLACK = pygame.Color(0,0,0,255)
BACKGROUND = pygame.Color(96,96,128,255)
MASKED = pygame.Color(0,128,0,0)
SCALE = 10
ISOWIDTH = 40
ISOH... |
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... |
"""
Written by <NAME>, 2019
Some functions are adapted from <NAME>
Original source:
https://github.com/rowanz/neural-motifs/blob/master/lib/evaluation/sg_eval.py
"""
import os
import numpy as np
import logging
from six.moves import cPickle as pickle
import json
import csv
from tqdm import tqdm
from core.config import... |
# Copyright 2012 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 ... |
#!/usr/bin/env python3
"""
Utilities for manipulating coordinates or list of coordinates, under periodic
boundary conditions or otherwise. Many of these are heavily vectorized in
numpy for performance.
"""
# adapted from original version in pymatgen version from pymatgen
import numpy as np
import math
def small_fra... |
"""
DAQmx (National Instruments, :mod:`fluidlab.instruments.daq.daqmx`)
===================================================================
.. todo:: DAQmx interface and drivers (using Comedi API?)...
Provides:
.. autofunction:: read_analog
.. autofunction:: write_analog
.. autofunction:: write_analog_end_task
..... |
#
# Copyright 2016 The BigDL Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... |
# 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, software
# d... |
# -*- encoding:ascii -*-
from mako import runtime, filters, cache
UNDEFINED = runtime.UNDEFINED
__M_dict_builtin = dict
__M_locals_builtin = locals
_magic_number = 6
_modified_time = 1433361600.0885601
_template_filename='templates/admin/tool_shed_repository/select_tool_panel_section.mako'
_template_uri='/admin/tool_sh... |
# coding: utf-8
# /*##########################################################################
# Copyright (C) 2004-2021 <NAME>, European Synchrotron Radiation Facility
#
# This file is part of the PyMca X-ray Fluorescence Toolkit developed at
# the ESRF by the Software group.
#
# Permission is hereby granted, free of ... |
#!/usr/bin/env python
#
# Copyright 2007 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.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... |
r"""
Generic Convolution
Asymptotically fast convolution of lists over any commutative ring
in which the multiply-by-two map is injective. (More precisely, if
`x \in R`, and `x = 2^k*y` for some
`k \geq 0`, we require that `R(x/2^k)` returns
`y`.)
The main function to be exported is convolution().
EXAMPLES::
sa... |
""".. Line to protect from pydocstyle D205, D400.
RNA maps
--------
Distribution of cross-links relative to genomic landmarks.
What is an RNA-map?
^^^^^^^^^^^^^^^^^^^
Imagine the following situation (on positive strand)::
|---intron1---||---exon2---||---intron2---||---exon3---|
x|... |
import numpy as np
from numpy import ma
import pandas as pd
from scipy import sparse as sp
from anndata import AnnData
def test_creation():
AnnData(np.array([[1, 2], [3, 4]]))
AnnData(np.array([[1, 2], [3, 4]]), {}, {})
AnnData(ma.array([[1, 2], [3, 4]]), uns={'mask': [0, 1, 1, 0]})
AnnData(sp.eye(2)... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.