text stringlengths 8.04k 46.5k |
|---|
"""This module can read a .txt file of protein sequences and return how similar
they are to each other as well as search for potential structural motifs, such
as Schellman C-caps. This comparison has been designed to analyse the variable
binding loop regions in antibody-like proteins, hence the usage of the term
"l... |
__author__ = "<NAME> (<EMAIL>)"
import numpy as np
import scipy.sparse as spsp
from thread2vec.preprocessing.social_media import anonymized as anonymized_extract
from thread2vec.preprocessing import wrappers
from thread2vec.preprocessing.common import safe_comment_generator
from thread2vec.common import get_p... |
import math
class TypeManager:
"""
Class to manage predefined objects in the online model,
which then can be recalled when generating the lattice
the class should only interface with the layout class
"""
def __init__(self):
# library which collects all predefined types.
self.li... |
# django libs
from django.shortcuts import render, redirect
from django.shortcuts import get_object_or_404
from django.core.files.storage import default_storage, FileSystemStorage
from django.core.files.base import ContentFile
from django.contrib import messages
from django.utils.timezone import localtime
from django.u... |
#!/usr/bin/env python
"""
Streaming editor for modifying python files
This script uses the `sed` python package to programmatically
inject decorators at the head of function definitions.
"""
import os.path
import sys
import re
import logging
from collections import namedtuple, Counter
from operator import attrgetter
f... |
#! /usr/bin/python3
# # # # # #
# Please excuse the chaotic code: it was first developed with a different application in mind,
# and then got modified for this project.
# # #
import numpy as np
from time import time
from datetime import datetime
from functions import asciiL, StructuredMotionStimulus, connect_even... |
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... |
# useful thinks for linux
# https://askubuntu.com/questions/158305/python-libnotify-showing-weird-behaviour-with-xfce4-notifyd-and-notify-osd
# https://stackoverflow.com/questions/51910946/using-backspace-with-getch-in-python-curses
# https://docs.python.org/3/library/curses.html
# import
import os
import time
from... |
"""SOClone Models."""
import collections
import datetime
import hashlib
import re
from django.contrib.auth.models import User, UserManager
from django.contrib.contenttypes import generic
from django.contrib.contenttypes.models import ContentType
from django.core.urlresolvers import reverse
from django.db import connec... |
# -*- coding: utf-8 -*-
"""
Created on Thu Aug 13 13:56:53 2020
@author: dcmccal
"""
# -*- coding: utf-8 -*-
"""
Created on Thu Aug 6 13:53:11 2020
@author: dave
"""
# -*- coding: utf-8 -*-
"""
This looks at 25 degrees Li on Au. I'm looking at making this code shorter.
"""
from scipy.optimize import curve_fit... |
# SOCIAL NETWORK ANALYSIS PACKAGE
# AUTHORS: <NAME>, <NAME>, <NAME>
# LAST MODIFIED: 08/07/2020
# REQUIRED MODULES
import sys, os # Utils
import pandas as pd # Data wrangling
import numpy as np # Data wrangling
import math as math ... |
#!/usr/bin/env python3
"""
histogram: plot a histogram of a file of numbers. Numbers can be floats, one per
line. Lines with two numbers are interpreted as pre-counted, with the number of
repeats of the first being given by the second.
Multiple instances of the same value in a category will be merged by adding
weights... |
import time
import cv2
import numpy as np
import tensorflow.compat.v1 as tf
import os
import sys
import argparse
import matplotlib.pyplot as plt
from sys import platform
from scipy.optimize import curve_fit
import json
from math import pi
from ball import balls
tf.disable_v2_behavior()
##### ball detection function... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''Utilities for spectral processing'''
import warnings
import numpy as np
import scipy
import six
from . import time_frequency
from .fft import get_fftlib
from .._cache import cache
from .. import util
from ..util.exceptions import ParameterError
from ..filters import ge... |
##
# Copyright 2016 <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 in writing, softwa... |
"""
Copyright (c) 2018-2021 Qualcomm Technologies, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted (subject to the
limitations in the disclaimer below) provided that the following conditions are met:
* Redistributions of source code must retain... |
"""
Output formatting utilities.
:author: <NAME>
"""
import json
import logging
import pprint
import re
import sys
from collections import UserDict
from collections.abc import KeysView, ValuesView
from contextlib import contextmanager
from datetime import datetime, date, timedelta
from difflib import unified_diff
fro... |
import colorsys
import random
import os
import numpy as np
from yolo import YOLO
from PIL import Image
import cv2
import math
#import cv2 as cv
#import argparse
import matplotlib.pyplot as plt
video_path = "D:/test.mp4"
output_path = "D:/0.mp4"
ImageDir = os.listdir("D:/test/testimages")
j = 0
a = 0
b... |
#!/usr/bin/env python
from __future__ import print_function
import os
import sys
import numpy as np
try:
xrange
except NameError:
xrange = range
class BinarySage(object):
def __init__(self, filename, ignored_fields=None, num_files=1):
"""
Set up instance variables
"""
#... |
# -*- coding: utf-8 -*-
import PyMca5
from PyMca5.PyMcaPhysics.xrf import McaAdvancedFitBatch
from PyMca5.PyMcaPhysics.xrf import FastXRFLinearFit
from PyMca5.PyMcaPhysics.xrf import ClassMcaTheory
from PyMca5.PyMca import EDFStack
from PyMca5.PyMcaIO import ConfigDict
try:
from PyMca5.PyMcaPhysics.xrf.McaAdvance... |
# coding: utf-8
"""
h5preserve is a thin wrapper around h5py, providing easier serialisation of
native python types.
:copyright: (c) 2016 <NAME>
:license: 3-clause BSD
"""
from collections import defaultdict
from collections.abc import MutableMapping, MutableSequence
from logging import getLogger
from warnings import ... |
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import cm
from sympy import nroots, re, im, symbols, sympify
from types import FunctionType
from collections import defaultdict
from tqdm.auto import tqdm
from .varma import Varma
class LedoitPecheShrinkage:
"""
Given sample eigenvalues lambd... |
#!/usr/bin/env python3
import os
import re
import sys
import shutil
import tarfile
import argparse
import urllib.request
MFC_USE_SUBDIR = ".mfc"
MFC_CONF_FILEPATH = "mfc.conf.yaml"
MFC_LOCK_FILEPATH = f"{MFC_USE_SUBDIR}/mfc.lock.yaml"
class MFCException(Exception):
pass
def execute_shell_command_safe(comm... |
## Container classes for storing pulse sequence data
## Subclassed into distinct classes for input (ie specified by user)
## and output (used to set Labber parameters).
from operator import attrgetter
import warnings
import logging
from PSICT_UIF._include36.Pulse import Pulse
import PSICT_UIF._include36._Pulse_rc a... |
"""
To generate images with a pre-trained rcGAN model.
This is a mix of the image quilting algorithm over GAN generated patches.
@author: <NAME>
"""
import os
import sys
import heapq
import argparse
import numpy as np
import matplotlib.pyplot as plt
import torch
import torch.nn as nn
import torch.utils.data
import t... |
#!/usr/bin/env python
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# (c) Copyright 2013 Hewlett-Packard Development Company, L.P.
# 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
# ... |
# %%
import csv
import numpy as np
import time
import gurobipy as gp
from gurobipy import GRB
# %%
class MCF:
def __init__(self, dowFile):
self.nunNodes = 0
self.numArcs = 0
self.numComm = 0
self.numScen = 0
self.arcOD = {}
self.arcV = {}
self.arcCap = {}
... |
import torch
from torch import Tensor
import torch.nn as nn
# from .utils import load_state_dict_from_url
from typing import Type, Any, Callable, Union, List, Optional
import os, sys
import time
from torch.nn.common_types import _size_1_t, _size_2_t, _size_3_t
currentdir = os.path.dirname(os.path.realpath(__file__))
p... |
"""
Created on Feb 21, 2014
@author: rgeorgi
"""
import re, unittest, copy
from intent.igt.grams import gramdict
from intent.utils.string_utils import lemmatize_token
from intent.utils.token import tokenize_string, whitespace_tokenizer, Token
class HeuristicAlignmentException(Exception): pass
#===================... |
from __future__ import division
import numpy as np
import scipy
import pandas as pd
import copy
import sklearn
from scipy.cluster import hierarchy
import matplotlib as mpl
from matplotlib import pyplot as plt
import seaborn as sns
import gc
def calc_DE_mannwhitneyu(X, names1, names2):
pvalues ... |
import pandas as pd
import numpy as np
from pathlib import Path
from sklearn.manifold import TSNE
from sklearn.cluster import KMeans
import seaborn as sns
import matplotlib.pyplot as plt
import configparser
from dateutil.parser import parse
import os
from sklearn.metrics import roc_auc_score, f1_score, precision_score,... |
"""
Production of corner plots.
Modified from a fork of https://github.com/dfm/corner.py .
Original code: Copyright (c) 2013-2020 <NAME>
Full license: https://github.com/dfm/corner.py/blob/main/LICENSE
This modified version:
- Add the observed quantities to the corner plots
- Colours for the plots
- Add KDE to non... |
import datetime
import os
import warnings
import xml.etree.ElementTree as ET
import zipfile
import numpy as np
import shapely
import isce3
from nisar.workflows.stage_dem import check_dateline
from s1reader.s1_burst_slc import Doppler, Sentinel1BurstSlc
# TODO evaluate if it make sense to combine below into a class
d... |
#! /usr/bin/python
'''
Module of utility functions to drive ATP from Python and extract results
At this time, only steady-state result extraction is supported.
'''
from __future__ import print_function, unicode_literals
from math import sqrt
import pickle
import lineZ
import numpy as np
from numpy.linalg import inv... |
# !/usr/bin/python
"""
Copyright ©️: 2020 Seniatical / _-*™#7519
License: Apache 2.0
A permissive license whose main conditions require preservation of copyright and license notices.
Contributors provide an express grant of patent rights.
Licensed works, modifications, and larger works may be distributed un... |
import datetime
import logging
import os
import pytest
import time
from tests.common.fixtures.conn_graph_facts import fanout_graph_facts
from tests.common.helpers.assertions import pytest_assert
from tests.common.helpers.pfc_storm import PFCStorm
from tests.common.plugins.loganalyzer.loganalyzer import LogAnalyzer
fro... |
import copy
import json
from typing import Any
from typing import Dict
from typing import List
from typing import Optional
import warnings
import pytest
from optuna import distributions
EXAMPLE_DISTRIBUTIONS: Dict[str, Any] = {
"i": distributions.IntDistribution(low=1, high=9, log=False),
"il": distribution... |
"""
PREFS is a simple but useful python library to store and manage user preferences. PREFS creates a file with your preferences, and allows you to manage these as you like.
Requirements:
pyyaml
Content:
PrefsBase (class): This class have all the functions to manage a PREFS file
Prefs (class): Inherits from PrefsB... |
# -*- encoding: utf-8 -*-
from __future__ import unicode_literals
import codecs
import os
import posixpath
import shutil
import sys
import tempfile
from io import BytesIO
from django.template import loader, Context
from django.conf import settings
from django.core.cache.backends.base import BaseCache
from django.core... |
from __future__ import print_function
# Modified by Microsoft Corporation.
# Licensed under the MIT license.
###############################################################################
# PyDial: Multi-domain Statistical Spoken Dialogue System Software
###############################################################... |
# -*- encoding: utf-8 -*-
import pytest
from pypy.module._pypyjson.interp_decoder import JSONDecoder, Terminator, MapBase
from rpython.rtyper.lltypesystem import lltype, rffi
class TestJson(object):
def test_skip_whitespace(self):
s = ' hello '
dec = JSONDecoder(self.space, s)
assert d... |
"""
Test case for iperf example.
This test case might have problem running on windows:
1. direct use of `make`
2. use `sudo killall iperf` to force kill iperf, didn't implement windows version
The test env Example_ShieldBox do need the following config::
Example_ShieldBox:
ap_list:
- ssid: "ssid"
... |
#
# 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... |
# 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
# distributed under t... |
import sys
if sys.platform == 'win32':
raise ImportError('Not available on Windows')
from pyapprox_dev.fenics_models.advection_diffusion import *
def dl_qoi_functional_misc(u):
r"""
Use the QoI from [JEGGIJNME2020]
To reproduce adaptive multi index results use following
expr = dl.Expression(
... |
# #########################################################################
# Copyright (c) , UChicago Argonne, LLC. All rights reserved. #
# #
# See LICENSE file. #
# ##############... |
import numpy as np
from io import StringIO
import matplotlib.pyplot as plt
from joblib import Parallel, delayed
import multiprocessing
import config
import logging
import pandas as pd
from sqlalchemy import create_engine
class Data_Retreival:
def __init__(self):
self.code_complexity_query = 'SELECT M... |
"""
Provides a Pythonic interface to cffi nng bindings
"""
import logging
import weakref
import threading
from ._nng import ffi, lib
from .exceptions import check_err, ConnectionRefused
from . import options
from . import _aio
logger = logging.getLogger(__name__)
# a mapping of id(sock): sock for use in callbacks... |
import re
import operator
import collections.abc
import itertools
import copy
import functools
from jaraco.classes.properties import NonDataProperty
import jaraco.text
class Projection(collections.abc.Mapping):
"""
Project a set of keys over a mapping
>>> sample = {'a': 1, 'b': 2, 'c': 3}
>>> prj = ... |
"""
Sensor for Mosoblgaz cabinet.
Retrieves values regarding current state of contracts.
"""
import asyncio
import logging
from datetime import datetime, timedelta
from functools import partial
from typing import Any, Callable, Dict, Final, Iterable, List, Mapping, Optional, Tuple, Type, Union
import homeassistant.hel... |
# -*- coding: utf-8 -*-
"""
TileMap loader for python for Tiled, a generic tile map editor
from http://mapeditor.org/ .
It loads the \*.tmx files produced by Tiled.
"""
# Versioning scheme based on: http://en.wikipedia.org/wiki/Versioning#Designating_development_stage
#
# +-- api change, probably incompatible wit... |
# Copyright 2019-2021 ETH Zurich and the DaCe authors. All rights reserved.
"""
Contains classes that represent data-centric transformations.
There are three general types of transformations:
* Pattern-matching Transformations (extending Transformation): Transformations
that require a certain subgraph structure ... |
from fontTools.misc import psCharStrings
from fontTools import ttLib
from fontTools.pens.basePen import NullPen
from fontTools.misc.fixedTools import otRound
from fontTools.varLib.varStore import VarStoreInstancer
def _add_method(*clazzes):
"""Returns a decorator function that adds a new method to one or
more classe... |
"""Conversion tool from EDF+,BDF to FIF
"""
# Author: <NAME> <<EMAIL>>
#
# License: BSD (3-clause)
import os
import calendar
import datetime
import re
import warnings
from math import ceil, floor
import numpy as np
from ...transforms import als_ras_trans_mm, apply_trans
from ...utils import verbose, logger
from ..... |
"""
This module contains all routines for training GDML and sGDML models.
"""
# MIT License
#
# Copyright (c) 2018-2019 <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restr... |
# ---
# jupyter:
# jupytext:
# formats: ipynb,py:percent
# text_representation:
# extension: .py
# format_name: percent
# format_version: '1.3'
# jupytext_version: 1.11.1
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# ---
# %% [markdown]
# # ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2017 <EMAIL>
# Licensed under the MIT license (http://opensource.org/licenses/MIT)
from __future__ import absolute_import, division, print_function, unicode_literals
from collections import namedtuple
from copy import copy
import re
import sys
from keyplus.de... |
"""
.. currentmodule:: pylayers.antprop.diffRT
.. autosummary::
:members:
"""
from __future__ import print_function
import doctest
import os
import glob
#!/usr/bin/python
# -*- coding: latin1 -*-
import numpy as np
import scipy.special as sps
import matplotlib.pyplot as plt
import pdb
def diff(fGHz,phi0,phi,si,s... |
# coding: utf-8
# Copyright (c) Max-Planck-Institut für Eisenforschung GmbH - Computational Materials Design (CM) Department
# Distributed under the terms of "New BSD License", see the LICENSE file.
from __future__ import print_function
from itertools import islice
import numbers
import numpy as np
import os
import pa... |
import os
import sys
import pygame as pg
from operator import attrgetter
from .. import prepare, tools
from . import enemy_sprites, item_sprites
if sys.version_info[0] < 3:
import yaml
else:
import yaml3 as yaml
LAYERS = ("BG Colors", "BG Tiles", "Water", "Solid",
"Solid/Fore", "Foreground", "Env... |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import math
from collections import Counter
from typing import Any, Callable, Dict, List, Optional, Set, Tuple, Union... |
r"""
Degenerate manifolds
"""
# *****************************************************************************
# Copyright (C) 2019 <NAME> <<EMAIL>>
#
# Distributed under the terms of the GNU General Public License (GPL)
# as published by the Free Software Foundation; either version 2 of
# the License, or (at your o... |
from __future__ import absolute_import, division, print_function
import os
from libtbx import easy_run
from six.moves import range
pdbs = {
'linking_test_F3S.pdb' : '''
ATOM 1 HG11 VAL S 187 -40.693 -9.791 9.764 0.83 6.10 H
ATOM 2 HG21 VAL S 187 -40.266 -10.791 11.945 1.00 7.89 ... |
from abc import ABCMeta, abstractmethod
from collections import defaultdict, deque
from typing import Any, Callable, Dict, Iterable, Iterator, List, Set, Union
from .base.command import GraphCommand, GraphCommandType
from .base.graph import BaseGraph, Operation
from .processer import GraphCommandProcessor
class Poin... |
'''
COTR dataset
'''
import random
import time
import numpy as np
import torch
from torchvision.transforms import functional as tvtf
from torch.utils import data
import cv2
import imutils
# from COTR.datasets import megadepth_dataset
from COTR.datasets import tracking_datasets
from COTR.utils import debug_utils, uti... |
import numpy as np
from env.thor_env import ThorEnv
from tqdm import tqdm
import os
import json
import argparse
from models.model.action_model import A3CLSTMNSingleAgent, a3c_loss
import pickle
import torch
import torch.nn.functional as F
import models.nn.vnn as vnn
import warnings
from gen.utils.py_util import remove_... |
# SPDX-FileCopyrightText: 2020 <NAME> for Adafruit Industries
#
# SPDX-License-Identifier: MIT
"""
`HMAC`
================================================================================
HMAC (Keyed-Hashing for Message Authentication) Python module.
Implements the HMAC algorithm as described by RFC 2104.
This is her... |
# -*- coding: utf-8 -*-
from __future__ import (absolute_import, division,
print_function, unicode_literals)
from builtins import *
from io import BytesIO, StringIO
from xml.sax import SAXParseException
from urllib.parse import quote
from datetime import datetime
import logging
import os
import... |
import bisect
from typing import List, Tuple, NewType, TypeVar
import numpy as np
import pickle
from sklearn.linear_model import LogisticRegression
# Define data types.
Data = List[Tuple[float, float]] # List of (predicted_probability, true_label).
Bins = List[float] # List of bin boundaries, excluding 0.0, but in... |
import re
import requests.exceptions
import json
import logging
import concurrent.futures
import tldextract
import traceback
from urllib.parse import urlparse
import hypercane.errors
module_logger = logging.getLogger('hypercane.score.dsa1_score')
blog_sources = [
'blogger.com',
'blogspot.com',
'wordpres... |
# -*- coding: utf-8 -*-
# occiput
# Harvard University, Martinos Center for Biomedical Imaging
# Aalto University, Department of Computer Science
from . import Scintillators
from . import Collimators
from ...DataSources.FileSources.nifti import load_nifti
# Import NiftyPy ray-tracers
from tomolab.Core.NiftyRec impor... |
# Copyright 2016 Canonical Ltd
#
# 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, s... |
"""
A set of functions and scripts to demonstrate camera calibration and
registration.
Notes:
* Parts of this module uses opencv calibration described here:
https://docs.opencv.org/4.0.0/d9/d0c/group__calib3d.html
* and the Chruco board described here:
https://docs.opencv.org/4.0.0/d0/d3c/classcv_1_1aruco_1... |
# -*- coding: utf-8 -*-
"""
Adds debugging commands and features.
"""
import tkinter as tk
from tkinter import ttk
from thonny.common import DebuggerCommand
from thonny.memory import VariablesFrame
from thonny import ast_utils, memory, misc_utils, ui_utils
from thonny.misc_utils import shorten_repr
import ast
from t... |
# Copyright (c) 2016-2019, <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... |
#########
# Copyright (c) 2015 GigaSpaces Technologies Ltd. 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... |
import pprint
# import json
import time
from gurobipy import *
from tqdm import tqdm
import numpy as np
"""
This code is for the most part written by <NAME> and is taken and
adapted from the repository https://github.com/chenhongge/RobustTrees.
It is an implementation of the MILP attack from:
Kantchelian, <NAME>.... |
# Copyright 2004-2018 <NAME> <<EMAIL>>
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including without limitation the rights to use, copy, modify, merge,
# publish,... |
"""
Invariant panel
"""
import wx
import sys
from sas.sasgui.guiframe.utils import format_number
from invariant_widgets import OutputTextCtrl
# Dimensions related to chart
RECTANGLE_WIDTH = 400.0
RECTANGLE_HEIGHT = 20
# Invariant panel size
_BOX_WIDTH = 76
# scale to use for a bar of value zero
RECTANGLE_SCALE = ... |
# 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 u... |
import os
import shutil
import pytest
import six
import yaml
import user_sync.rules as rules
from tests.util import make_dict, merge_dict, compare_iter
from user_sync.config import ConfigFileLoader, ConfigLoader, DictConfig
from user_sync.connector.directory import DirectoryConnector
from user_sync.connector.director... |
import neural_renderer as nr
import numpy as np
from skimage.io import imread
import torch
from torch.autograd import Variable
from src.util.common import resize_img
from src.util.torch_utils import orthographic_proj_withz_idrot
from src.util.render_utils import (
draw_skeleton,
draw_text,
)
COLORS = {
#... |
"""
Schnyder's Algorithm for straight-line planar embeddings
A module for computing the (x,y) coordinates for a straight-line planar
embedding of any connected planar graph with at least three vertices. Uses
Walter Schnyder's Algorithm.
AUTHORS:
-- <NAME>, <NAME> (2008-02-09): initial version
REFERENCE:
[1... |
"""
Ansible action plugin to ensure inventory variables are set
appropriately and no conflicting options have been provided.
"""
import json
import re
from ansible.plugins.action import ActionBase
from ansible import errors
# pylint: disable=import-error,no-name-in-module
from ansible.module_utils.six.moves.urllib.par... |
#!/usr/bin/env python
"""plots.py: plots utility functions."""
__author__ = "<NAME>."
__copyright__ = "Copyright 2020, SuperDARN@VT"
__credits__ = []
__license__ = "MIT"
__version__ = "1.0"
__maintainer__ = "<NAME>."
__email__ = "<EMAIL>"
__status__ = "Research"
import os
import sys
sys.path.extend(["code/", "code/r... |
# -*- coding: utf-8 -*-
r"""
Helper functions for reduction of binary forms.
The algorithm for reducing is from Stoll and Cremona's "On the Reduction Theory of
Binary Forms" [CS2003]_. This takes a two variable homogeneous polynomial and finds a
reduced form. This is an `SL(2,\ZZ)`-equivalent binary form whose covaria... |
from __future__ import division
import json
import os
import sys
import random
import math
from time import time, sleep
from selenium import webdriver
from urllib.parse import urlparse, urljoin
from os.path import join, isdir
from random import randint
from multiprocessing import Pool
from _collections import default... |
##############################################################################################################################################################################
#
# Program contains functions to construct gene structures from expressed RNA-Seq data
#
#######################################################... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Core IO, DSP and utility functions."""
import os
import six
import audioread
import numpy as np
import scipy.signal
import scipy.fftpack as fft
import resampy
from .time_frequency import frames_to_samples, time_to_samples
from .. import cache
from .. import util
from ... |
"""Database classes and support for measurements"""
from abc import ABC
import json
import logging
import os
import re
import sys
import time
import numpy as np
from typing import Tuple
from google.cloud import bigquery
logging.basicConfig(level=logging.INFO)
def get_database(style: str):
"""Retrieve database ... |
import datetime
import itertools
import logging
import re
import string
import xml.sax.saxutils
try:
from pytz.gae import pytz
except:
# When running with the gcloud development App Engine server there's
# already a pytz module imported, so let that take precedence
import pytz
from base.constants impo... |
"""
CNC programs only support linear moves and arc moves
svgpathtools supports Arc, Line CubicBezier
For offsetting path:
Arc -> offset_curve
CubicBezier -> offset_curve
Line -> Shapely
"""
import sys
import enum
import json
import pathlib
import math
import traceback
import pprint
from PyQt5 import QtWidgets, QtCor... |
#!/usr/bin/env python
import os
import sys
import socket
import logging
from threading import Thread
import socket
from time import sleep
from subprocess import Popen, PIPE
# COLORS
B, R, Y, G, N = '\33[94m', '\033[91m', '\33[93m', '\033[1;32m', '\033[0m'
# making scapy quite
logging.getLogger('scapy.runtime').setLe... |
"""
Support for Bang & Olufsen Master Link Gateway and Beolink Gateway.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/media_player.bangolufsen/
This component manages communication To and From the MLGW.
Controlling Devices and Speakers, like Beosound ... |
# -*- coding: utf-8 -*-
"""Bytecode Interpreter operations for Python 2.4
Note: this is subclassed. Later versions use operations from here.
"""
from __future__ import print_function, division
import operator
import logging
import six
from xdis import PYTHON_VERSION
if PYTHON_VERSION > 2.7:
import importlib
fro... |
import copy
import json
import logging
from functools import lru_cache
from urllib.parse import urlparse
import dask
import dask.delayed
import fsspec
import intake
import intake_xarray
import numpy as np
import pandas as pd
import requests
from .merge_util import _aggregate, _create_asset_info_lookup, _to_nested_dic... |
# -*- coding: utf-8 -*-
# Gitless - a version control system built on top of Git
# Licensed under MIT
"""End-to-end test."""
from __future__ import unicode_literals
import logging
import os
import re
import time
import sys
if sys.platform != 'win32':
from sh import ErrorReturnCode, Command
else:
from pbs impor... |
from collections import defaultdict
import pyverilog.vparser.ast as ast
from pyverilog.ast_code_generator.codegen import ASTCodeGenerator
from typing import Dict
import relay_station_template
from formator import FormatHLS
import math
import subprocess
from optimize_control_signals import *
def initPblocksU250(formato... |
"""
This code was developed by <NAME>, <NAME> and <NAME> of PES University
Refer to the README for the sources of the Deepspeech, Tacotron and WaveRNN implementations/folders
The answer extraction code references the Hugging face run_squad.py example, modified for our use
"""
import sys
import wave
import os
import au... |
#!/usr/bin/python
#
# Copyright (c) 2019 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
# OpenStack Keystone and Sysinv interactions
#
import os
import pyudev
import re
import subprocess
import sys
import time
# The following imports are to make use of the OpenStack cgtsclient and some
# constant... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.