text stringlengths 6.04k 39.5k |
|---|
# --------------------------------------------------------
# Pytorch Faster R-CNN and FPN
# Licensed under The MIT License [see LICENSE for details]
# Written by <NAME> and <NAME>, <NAME>
# --------------------------------------------------------
from __future__ import absolute_import
from __future__ import division
fr... |
'''
Copyright (c) Facebook, Inc. and its affiliates.
All rights reserved.
This source code is licensed under the license found in the
LICENSE file in the root directory of this source tree.
'''
import torch
from torch.nn import functional as F
import os
import sys
import copy
import argparse
from tqdm import tqdm
imp... |
from __future__ import annotations
import argparse
import json
import sqlite3
from collections import namedtuple
from datetime import timedelta
from functools import partial, reduce
from itertools import chain, filterfalse, groupby, tee
from operator import itemgetter
from pathlib import Path
from typing import Callab... |
# Copyright (c) <NAME>.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory.
# See https://github.com/dietmarwo/fast-cma-es/blob/master/tutorials/Scheduling.adoc for a detailed description.
import math
import pandas as pd
import numpy as np
import sys, math, time
f... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from numpy import int64
# Logger
from logging import getLogger
logger = getLogger(__name__)
# Dictionary for pol labels and their IDs in UVFITS
polid2name = {
"+1": "I",
"+2": "Q",
"+3": "U",
"+4": "V",
"-1": "RR",
"-2": "LL",
"-3": "RL",
... |
"""
Processes individual packets.
"""
import hashlib
import scapy.all as sc
import scapy.layers.http as http
import re
import time
from host_state import HostState
from syn_scan import SYN_SCAN_SEQ_NUM, SYN_SCAN_SOURCE_PORT
import utils
# pylint: disable=no-member
class PacketProcessor(object):
def __init__(... |
from math import floor
import matplotlib.gridspec as gridspec #lgtm [py/unused-import]
import matplotlib.pyplot as plt
ATPdata = {
"Amikacin" : {
"Details" : ["Akhova and Tkachenko (2014)", "(nmol/mg dw)", "E. coli EH40"],
"Time (mins)" : [0, 30, 60, 90, 120, 150, 180],
... |
# file: chrm_prof.py
# author: <NAME>
# created: 9/27/2017
# modified: 9/30/2017
# purpose: ChrmProf class. ChrmProf is a chromosome profile and contains a mutated chrm with
# references to the mutations' original position. Keeps track of copy numbers.
# imports
import sys
import copy
import math
i... |
import numpy as np
import h5py
import pybel
import tfbio.net
import tfbio.data
from skimage.segmentation import clear_border
from skimage.measure import label
from skimage.morphology import closing
from keras.layers import Input, Convolution3D, MaxPooling3D, UpSampling3D, concatenate
from keras.models import Model
... |
# Generate static graphs
import os
import sys
import json
import csv
import plotly.graph_objects as go
import plotly.express as px
import numpy as np
from plotly.subplots import make_subplots
from datetime import *
from utils import *
# Generate a graph (cases) for Maryland Zip Code
# Here we pass all the data
def... |
"""The prompt_toolkit based xonsh shell."""
import os
import re
import sys
from functools import wraps
from types import MethodType
from prompt_toolkit import ANSI
from prompt_toolkit.auto_suggest import AutoSuggestFromHistory
from prompt_toolkit.cursor_shapes import ModalCursorShapeConfig
from prompt_toolkit.enums im... |
import base64
import sys
import json
from xml.dom.expatbuilder import theDOMImplementation
import psycopg2
import requests
import os
from datetime import datetime as dt
from datetime import timedelta
import time
import argparse
import random
from datetime import datetime
from datetime import date
impo... |
# -*- coding: utf-8 -*-
# @Time : 16/1/2019 10:26 AM
# @Description :
# @Author : <NAME>
# @Email : <EMAIL>
# @File : loss_utils.py
import tensorflow as tf
import os
import sys
sys.path.append(os.path.dirname(os.getcwd()))
from Common import pc_util
sys.path.append(os.path.join(os.getcwd(),"... |
#!/usr/bin/python
# Copyright: (c) 2020, DellEMC
# GNU General Public License v3.0+
""" Storage Volume module """
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'sup... |
# Copyright 2016 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.
"""Generates reports base on bisect result data."""
import copy
import math
_BISECT_HEADER = """
=== BISECT JOB RESULTS ===
<b>%s</b>
"""
_BISECT_TO_RUN ... |
import random
from kaggle_environments.envs.halite.helpers import *
import numpy as np
###################
# Helper Function #
###################
def index_to_position(index: int, size: int):
"""
Converts an index in the observation.halite list to a 2d position in the form (x, y).
"""
y, x = divm... |
#!/usr/bin/env python3
import ruamel.yaml
from ruamel.yaml.comments import CommentedMap
import fileinput
import os
import sys
from netaddr import IPNetwork
# This version saves comments/edits in YAML files
yaml = ruamel.yaml.YAML()
yaml.indent(sequence=4, mapping=2, offset=2)
# Input
colte_vars = "/etc/colte/config.... |
from sqlalchemy import text
from cc_adp_utilities import fn_format_phone, fn_convert_date
from datetime import datetime
from djzbar.utils.informix import do_sql
from djzbar.utils.informix import get_engine
# django settings for script
from django.conf import settings
# This select statement should only ret... |
import os
import sys
import json
import copy
import numpy as np
import pandas as pd
import random
import tensorflow as tf
# import PIL
seed_value = 123
os.environ['PYTHONHASHSEED']=str(seed_value)
random.seed(seed_value)
np.random.seed(seed_value)
tf.set_random_seed(seed_value)
from keras.utils import to_categorical
... |
#
# train an SSD model on Pascal VOC or Open Images datasets
#
import os
import sys
import logging
import argparse
import itertools
import torch
from torch.utils.data import DataLoader, ConcatDataset
from torch.optim.lr_scheduler import CosineAnnealingLR, MultiStepLR
from vision.utils.misc import str2bool, Timer, fre... |
# -*- coding: utf-8 -*-
'''
Author: <NAME> <<EMAIL>>
Date: 2012-08-25
This example file implements 5 variations of the negative binomial regression
model for count data: NB-P, NB-1, NB-2, geometric and left-truncated.
The NBin class inherits from the GenericMaximumLikelihood statsmodels class
which provides automatic... |
# Copyright 2018 Xanadu Quantum Technologies 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 agre... |
import argparse
import binascii
import sys
import os
"""
For the type of encoder we are going to use, this is a list of characters that
will conflict with the bad character list
first, check if there are no bad char conflicts - AND eAX, SUB r8, SUB eAX, XOR r/m16/32, XOR r8, XOR eAX,
DEC eDX , DEC eBP, DEC eSI
PUSH ... |
"""
A module for performing a selection of validation checks on a SIDD (nitf) file,
or an xml file containing the sidd structure.
Use the `check_file` function directly, or perform using the command line
>>> python -m sarpy.consistency.sidd_consistency <file_name>
For more information, about command line usage, see
... |
# *****************************************************************************
#
# Copyright (c) 2019, the jupyter-fs authors.
#
# This file is part of the jupyter-fs library, distributed under the terms of
# the Apache License 2.0. The full license can be found in the LICENSE file.
#
import os.path
import mimetypes
... |
from poshc2.server.database.DBSQLite import update_mods, new_task, select_mods
from poshc2.server.Config import ModulesDirectory
import os
def check_module_loaded(module_name, randomuri, user, force=False):
try:
modules_loaded = select_mods(randomuri)
if force:
for modname in os.listdi... |
import tensorflow as tf
import numpy as np
from sklearn.metrics import balanced_accuracy_score
import time
import os
def create_graph_placeholders(dataset, use_desc=True, with_tags=True, with_attention=True, use_subgraph=False):
'''
dataset: should be a sequence (list, tuple or array) whose order is [V, A, La... |
#!/usr/bin/env python
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
###############################################################################
# ifm_sentinel.py -
#
# Project: ADP INSAR
# Purpose: Script for processing a pair of Sentinel-1 granules with Gamma
#
# Author: <NAME>
#
###########... |
import collections
import functools
import os
import pickle
from typing import (Callable, Dict, Hashable, List, NamedTuple, Optional,
Sequence, Union)
import numpy as np
from stable_baselines.common.base_class import BaseRLModel
from stable_baselines.common.policies import BasePolicy
from stable_ba... |
# -*- coding: utf-8 -*-
"""
`TaggedBlock` objects.
"""
from __future__ import unicode_literals, absolute_import
import six
from . import docs
from . import enums
from . import path
from . import util
from typing import Any, BinaryIO, Dict, Optional, Set, TYPE_CHECKING, Union # NOQA
if TYPE_CHECKING:
from... |
# -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2018-2019 Fetch.AI 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 ... |
#Турчанинов Александр ИУ7-44Б лабораторная 5
#Алгоритм с упорядоченным списком ребер
import tkinter as tk
import tkinter.ttk as ttk
from tkinter import messagebox
from tkinter.colorchooser import askcolor
from operator import itemgetter
import time
# Returns edges from list of dots
def get_edges(dots_mas):
print... |
# coding=utf-8
# Copyright 2020 The HuggingFace Inc. team.
#
# 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... |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
#!/usr/bin/env python3
# generate_tls13_compat_tests.py
#
# Copyright The Mbed TLS Contributors
# SPDX-License-Identifier: Apache-2.0
#
# 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... |
import os
import sys
import subprocess
import argparse
from PolTools.utils.make_random_filename import generate_random_filename
from PolTools.utils.remove_files import remove_files
from multiprocessing import Pool
from collections import defaultdict
from statistics import mean
from shutil import rmtree
# TODO: Move ... |
"""Simplify loading moveit config parameters.
This module provides builder-pattern based class to simplify loading moveit related parameters found in
robot_moveit_config package generated by moveit setup assistant.
By default it expects the following structure for the moveit configs package
robot_name_moveit_config/... |
import operator
import math
import BeatFrequentPick
import PatternPredictor
import justRock
import rps
import random
from pprint import pprint
Debug = True
Debug = False
# opcode
scoreBufferWin = 0
scoreBufferLost = 1
# implementations
useScoreBuffer = True
useScoreBuffer = False
scoreReset = False # perfor... |
#!/usr/bin/env python3
# -*- coding:utf-8 -*-
# Copyright (C) <EMAIL>
## http://rtools.cbrc.jp/idiographica/ Version 2.2 (Updated July, 2013)
## 一、存在观察列,且观察列中数据重复仅取其一,最先遇到就取第一行
## cluster->idiographica
# 生成cluster
##./app.py -c ../data/11182016-1/ -o 20 -f 1 -e 3 -t 2500
## 准备数据
##cp -r ../result/11182016-1 ../data/1... |
import utils
import torch
import numpy as np
from torch import nn
import torchgeometry
from kornia import color
import torch.nn.functional as F
from time import time
from torchvision.transforms import RandomResizedCrop
class Dense(nn.Module):
def __init__(self, in_features, out_features, activation='relu'):
... |
#!/usr/bin/env python
"""
HAL interface to National Instruments cards.
Hazen 04/17
"""
import numpy
import storm_control.hal4000.halLib.halMessage as halMessage
import storm_control.sc_hardware.baseClasses.daqModule as daqModule
import storm_control.sc_hardware.nationalInstruments.nicontrol as nicontrol
import stor... |
import datetime
import json
import logging
from asyncio import Lock
from enum import Enum
from typing import Any, Dict, List, Optional
from uuid import UUID
from models_library.projects import ProjectID
from models_library.projects_nodes_io import NodeID
from models_library.service_settings_labels import (
Dynamic... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# @Author: <NAME>
# @Date: 2020-06-12
# @Filename: bhm_gua.py
# @License: BSD 3-clause (http://www.opensource.org/licenses/BSD-3-Clause)
# isort: skip_file
import peewee
from peewee import JOIN
from peewee import fn
from sdssdb.peewee.sdss5db.catalogdb import (
Cat... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
from... |
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See https://swift.org/LICENSE.txt for license information
# See https://swift.org/CONTRIBUTORS.txt for the list o... |
import os
from os import listdir
from os.path import isfile, join
import logging
import numpy as np
from ase import Atoms
import mff
from mff import models, calculators, utility
from mff import configurations as cfg
def get_potential(confs):
pot = 0
for conf in confs:
el1 = conf[:, 3]
el2 = co... |
import time
from ops import *
from utils import *
from tensorflow.contrib.data import prefetch_to_device, shuffle_and_repeat, map_and_batch
from tensorflow.contrib.opt import MovingAverageOptimizer
from tensorflow_privacy.privacy import optimizers
from metrics import metric_base
from metrics.metric_defaults import metr... |
import copy
import os
import secrets
from collections import OrderedDict, defaultdict
from functools import cached_property, lru_cache
from typing import Any, Callable, List, Union
from bs4 import BeautifulSoup
# from pydispatch import dispatcher
from zineb.exceptions import FieldError, ModelExistsError
from zineb.htt... |
class NaiveMDLSTM():
"""Naive Implementations"""
def naive_initialize_cell(self):
D = self.params['feature_vector_length']
H = self.params['hidden_dim']
D_sqrt = tf.sqrt(tf.cast(D,tf.float32))
H_sqrt = tf.sqrt(tf.cast(H,tf.float32))
with tf.variable_scope(self.scope):
... |
from collections import OrderedDict
from functools import partial
import matplotlib.pyplot as plt
from scipy.linalg import toeplitz
import scipy.sparse as sps
import numpy as np
import pandas as pd
import bioframe
import cooler
from .lib.numutils import LazyToeplitz
def make_bin_aligned_windows(binsize, chroms, cen... |
"""Platform for LifeSmart ColoLight Light integration."""
import logging
import voluptuous as vol
import socket
import homeassistant.helpers.config_validation as cv
EX_COLOR_SCHEME = "es_color_scheme"
EX_COLOR = "es_color"
EX_CYCLE_SPEED = "es_cycle_speed"
EX_MODE = "es_mode"
# Import the device class from the compo... |
import dgl
from . import register_model, BaseModel
import torch.nn as nn
import numpy as np
import dgl.nn.pytorch as dglnn
import torch
import torch.nn.functional as F
@register_model('DMGI')
class DMGI(BaseModel):
r"""
Description
-----------
**Title:** Unsupervised Attributed Multiplex Network E... |
from collections import namedtuple
import os
import subprocess
import re
import boto3
import json
STAGE_VARIABLE_ALIAS = "lambdaAlias"
INTEGRATION_URI_APPENDER = ":${{stageVariables.{0}}}".format(STAGE_VARIABLE_ALIAS)
_INTEGRATION = namedtuple(
"INTEGRATION", [
"rest_api_id",
"resource_id",
... |
# -*- coding: utf-8 -*-
"""
@file
@brief Implements function @see fn run_cmd.
"""
import sys
import os
import time
import subprocess
import threading
import warnings
import re
import queue
from .flog_fake_classes import PQHException
class RunCmdException(Exception):
"""
Raised by function @see fn run_cmd.
... |
import os
import pandas as p
import numpy as np
from PIL import ImageEnhance
from PIL import Image, ImageChops, ImageOps
import keras
from keras import optimizers
from keras.models import Sequential
from keras.layers import Dense, Activation, Flatten, LeakyReLU, Conv2D, MaxPooling2D, Dropout, Lambda
os.environ["CUDA_DE... |
# ******************************************************************************
# Copyright 2017-2019 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... |
data_dir = '/mnt/lareaulab/cfbuenabadn/SingleCell/data/'
######################
# load_data_short.py #
######################
print('loading data')
import numpy as np
import pandas as pd
import os
import matplotlib.cm as cm
from matplotlib import pyplot as plt
from scipy import stats as st
import seaborn as sns
imp... |
import io
import json
import threading
import time
import math
import matplotlib.cm as cm
import matplotlib.pyplot as pyplot
import serial
from modules.Radar.RadarStructures import *
from modules.constants import *
from modules.errors import *
syncPatternUINT64 = [int('0102', 16), int('0304', 16), int('0506', 16), i... |
"""Auto pipeline for object detection task"""
# pylint: disable=bad-whitespace,missing-class-docstring,bare-except
import time
import os
import math
import copy
import logging
import pprint
import json
import pickle
from typing import Union, Tuple
import uuid
import shutil
import numpy as np
import pandas as pd
from a... |
#coding:utf8
import logging
import json
from base_handler import BaseHandler
from utils import decimal_default,get_linenumber
from utils import RoundDown
from .proxy import EthereumProxy
from constants import ETH_IP_ADDR,ETH_RPC_PORT,ETH_BLK_BUFFER_SIZE
import sql
from constants import ERC20_CONTRACTS_MAP #ERC20合约... |
import numpy as np
import warnings
from time import time
import pandas as pd
from itertools import count, product
from copy import deepcopy
from scipy import optimize
from sklearn import linear_model as LM
from sklearn.svm import SVC, LinearSVC
from sklearn.neural_network import MLPClassifier
from sklearn.exceptions i... |
import sys
import time
import yaml
import math
import signal
import datetime
import threading
import traceback
import numpy as np
from cvxopt import matrix, solvers
#from scipy.spatial import ConvexHull
import matplotlib.patches as ptc
import matplotlib.pyplot as plt
import matplotlib.animation as animatio... |
# -*- coding: utf-8 -*-
import collections
import json
import logging
import os
import pprint
import re
import time
from concurrent import futures
import click
#import grpc
import yaml
from nvidia_deepops import Progress, utils
from nvidia_deepops.docker import DockerClient, NGCRegistry, DGXRegistry
from . import r... |
# -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2018 OSGeo
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 ... |
#!/usr/bin/env python
# Copyright 2019, <NAME>, mailto:<EMAIL>
#
# Python test originally created or extracted from other peoples work. The
# parts from me are licensed as below. It is at least Free Software where
# it's copied from other people. In these cases, that will normally be
# indicated.
#
... |
try:
from pyroute2 import IPRoute
except:
raise Exception("""
l2tester.interface depends on the following module:
* pyroute2 : available at https://pypi.python.org/pypi/pyroute2
Download .tar.gz, extract it, enter folder and run 'sudo python setup.py install' to install this module.
""")
import socket
impor... |
'''
NAME
motifs.py
VERSION
2.1.2
AUTHOR
<NAME> <<EMAIL>>
DESCRIPTION
This module is part of prot_motifs package which obtains the number of proteins motifs in a protein and
the sequences themselves. The module allows to search disulfide bonds, alpha helices, beta sheets and
speci... |
# -*- coding: UTF-8 -*-
from insights.core import FileListing
from insights.tests import context_wrap
SINGLE_DIRECTORY = """
total 32
drwxr-xr-x. 5 root root 4096 Jun 28 2017 .
drwxr-xr-x. 15 root root 4096 Aug 10 09:42 ..
lrwxrwxrwx. 1 root root 49 Jun 28 2017 cert.pem -> /etc/pki/ca-trust/extracted/pem/tls-... |
#!/usr/bin/python3
"""
Bandmap view for Tlf
Usage: ./tlf_bandmap.py [-d DIR] [-w] [-c | -s | -m] [band]
Needs PyQt5 and hamlib: apt install python3-pyqt5 python3-libhamlib2
"""
import sys, os, argparse, math, signal
from PyQt5.QtWidgets import QWidget, QApplication, QComboBox, QDesktopWidget
from PyQt5.... |
import json
import datetime
import graphene
from graphql.language.ast import ObjectValue, ListValue, IntValue
from graphql.language import ast
from graphene.types import Scalar
from graphene.types.json import JSONString as JSONtype
from graphene.types.generic import GenericScalar
from lingvodoc.models import (
Obje... |
# Shmup - Part 22
# simple start/end screens
# by KidsCanCode 2015
# A space shmup in multiple parts
# For educational purposes only
# Art from Kenney.nl
# Frozen Jam by tgfcoder <https://twitter.com/tgfcoder> licensed under CC-BY-3
import pygame as pg
import random
import sys
from os import path
sound_dir = path.j... |
#
# 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... |
#!/usr/bin/env python3
import asyncio
import argparse
from bleak import BleakClient, BleakScanner
from bleak.exc import BleakError
import PIL.Image
import PIL.ImageDraw
import PIL.ImageFont
# CRC8 table extracted from APK, pretty standard though
crc8_table = (
0x00, 0x07, 0x0e, 0x09, 0x1c, 0x1b, 0x12, 0x15, 0x38... |
# -*- coding: utf-8 -*-
# python std lib
from __future__ import unicode_literals
import os
import random
import threading
from contextlib import contextmanager
from itertools import chain
from collections import defaultdict
# rediscluster imports
from .nodemanager import NodeManager
from .exceptions import (
Redi... |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
#
# Description: an implementation of a deep learning recommendation model (DLRM)
# The model input consists of dense and sparse features... |
# The MIT License (MIT)
#
# Copyright (c) 2017 <NAME> for Adafruit Industries
#
# 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 os
import time
# -*- coding:utf-8 -*-
'''
-----------------------------Cpu-----------------------------
'''
# Cpu use
last_worktime=0
last_idletime=0
def get_cpu_use():
global last_worktime, last_idletime
f=open("/proc/stat","r")
line=""
while not "cpu " in line:
line=f.readline()
f... |
import numpy as np
from pybasicbayes.distributions import AutoRegression, DiagonalRegression, Regression
def get_empirical_ar_params(train_datas, params):
"""
Estimate the parameters of an AR observation model
by fitting a single AR model to the entire dataset.
"""
assert isinstance(train_datas, ... |
import time
import numpy as np
from typing import List, Dict
from .base import BaseInstrument
from zhinst.toolkit.control.node_tree import Parameter
from zhinst.toolkit.interface import LoggerModule
_logger = LoggerModule(__name__)
MAPPINGS = {
"edge": {1: "rising", 2: "falling", 3: "both"},
"eventcount_mod... |
import json
import re
import webbrowser
import mistune
from PyQt5 import QtCore
from PyQt5.QtCore import QTimer
from PyQt5.QtGui import QColor, QSyntaxHighlighter, QTextCursor, QTextCharFormat
from PyQt5.QtWidgets import QTextEdit, QInputDialog, QMessageBox
from Core import MarkdownRenderers
from Interface.Dialogs.In... |
import os
import re
from parse import *
from c import subroutine_c_names
PACKAGE_NAME = 'opencmiss'
MODULE_NAME = 'iron'
MODULE_DOCSTRING = ("""OpenCMISS-Iron
OpenCMISS (Open Continuum Mechanics, Imaging, Signal processing and System
identification) is a mathematical modelling environment that enables the
applicati... |
import argparse
import json
import logging
import os
# noinspection PyCompatibility
import urllib.parse as parse
# noinspection PyCompatibility
from urllib.request import url2pathname
from collections import OrderedDict
import re
import ontospy
import requests
import unicodecsv as csv
# global namespace lookup
with op... |
import numpy as np
import warnings
import cv2
import time
def Gamma_correction(low_frequency, alpha=0.5):
"""
Adjust the coefficient of low frequency component using Gamma correction.
:param low_frequency: the low frequency component of the image calculated with Shearlet transformation.
:param alpha: a... |
from cornell_word_seq2seq_glove_predict import CornellWordGloveChatBot
from cornell_word_seq2seq_glove_predict_gru import CornellWordGloveChatBotGRU
from cornell_char_seq2seq_predict import CornellCharChatBot
from gunthercox_word_seq2seq_glove_predict import GunthercoxWordGloveChatBot
from twitter_word_seq2seq_glov... |
"""
functions to access the data dictionary in a clearer way
"""
import os
import toolz as tz
from bcbio.utils import file_exists, to_single_data, deepish_copy
from bcbio.log import logger
from collections import namedtuple
import sys
LOOKUPS = {
"config": {"keys": ['config']},
"tmp_dir": {"keys": ['config', ... |
import os
import csv
import math
import dnaio
import parasail
import editdistance
import re
import logging
import datetime
from .processor import FASTQProcessor, FASTQWorker
from ..fastq_pair import ReadPair
from ..fastq_file import IlluminaFASTQ, BarcodeStatistics
logger = logging.getLogger(__name__)
class Demultipl... |
# Copyright (c) 2012-2014 Turbulenz Limited
import logging
LOG = logging.getLogger(__name__)
from re import compile as regex_compile
from time import time as time_now
from os.path import exists as path_exists, join as join_path
from threading import Lock
# pylint: disable=F0401
from pylons import config
import yaml... |
# Copyright 2009 <NAME>. 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 list of conditions and the foll... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function, unicode_literals, absolute_import
from flask import render_template, redirect, url_for, abort, flash, request, current_app, make_response
from flask_login import login_required, current_user
from flask_sqlalchemy import get_debug_quer... |
# -- coding: utf-8 --
# Copyright 2018 <NAME> <<EMAIL>>
"""
Module to handle block type used in iontof file formats ITA,ITM,ITS, etc...
"""
import sys
import binascii
import struct
import os
class MissingBlock(Exception):
def __init__(self, parent, name, index):
self.block_name = parent.parent+'/'+name
... |
# Imports
from flask import Flask
from flask import request
from functools import reduce
import requests
import importlib
import json
import sys
import time
import math
import random
app = Flask(__name__)
conversation = importlib.import_module('conversation')
extract_bid = importlib.import_module('extract-bid')
# Glo... |
# Copyright (c) Microsoft Corporation.
# Licensed under the Apache License 2.0.
import random
import os
from base64 import b64decode
import azext_aro.vendored_sdks.azure.mgmt.redhatopenshift.v2022_04_01.models as openshiftcluster
from azure.cli.command_modules.role import GraphError
from azure.cli.core.commands.clie... |
# -*- coding: utf-8 -*-
"""
Created on Sun Aug 21 10:18:52 2016
@author: PM5
Module of functions specific to ROMS.
"""
import netCDF4 as nc
import numpy as np
def get_basic_info(fn, only_G=False, only_S=False, only_T=False):
"""
Gets grid, vertical coordinate, and time info from a ROMS NetCDF
history file ... |
#!/usr/bin/env python
"""
`htrc.volumes`
Contains functions to retrieve volumes from the HTRC Data API.
The functions in this package will not operate unless they are
executed from an HTRC Data Capsule in Secure Mode. The module
`htrc.mock.volumes` contains Patch objects for testing workflows.
"""
from __future__ ... |
import logging
import multiprocessing as mp
import os
import tempfile
import pysam
from .allow_dovetailing import (
allow_dovetailing,
get_max_proper_pair_size
)
from .bam_io import (
get_mean_read_length,
get_queryname_positions,
get_reads,
is_file_coordinate_sorted,
start_positions_for_l... |
"""
Support for STATS data files.
STATS binary file structure
===========================
A stats binary output files begins with a stats_hdt_t structure::
typedef struct
{
(unsigned short header_size /* bytes, may or may not be there */
unsigned short spcid; /* station id - 10, 40, 60, 21 */... |
import sys
sys.path.insert(0, '/share/data/vision-greg2/xdu/pixel2style2pixel')
import torch
import clip
# from datasets import images_dataset
# from datasets.images_dataset import ImagesDataset, LSUNImagesDataset
# from training.coach import Coach
# from argparse import ArgumentParser
# from configs.paths_config impor... |
import pandas as pd
import numpy as np
import seaborn as sns
from matplotlib import gridspec
import matplotlib.pyplot as plt
from sklearn.manifold import TSNE
from drosoph_vae.data_loading import get_3d_columns_names
from drosoph_vae.settings import config, skeleton
from drosoph_vae.settings.config import SetupConfig
... |
"""
Code adapted from the StarGAN v2: https://github.com/clovaai/stargan-v2
"""
import os
from os.path import join as ospj
import time
import datetime
from munch import Munch
import torch
import torch.nn as nn
import torch.nn.functional as F
import torchvision.utils as vutils
from .model import build_model
from comm... |
# -*- coding: utf-8 -*-
# Copyright (C) 2013, the Pyzo development team
#
# Yoton is distributed under the terms of the 2-Clause BSD License.
# The full license can be found in 'license.txt'.
# This code is loosely based on the event system of Visvis and on the
# signals system of Qt.
# Note: Python has a buildin mod... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.