text stringlengths 8.04k 46.5k |
|---|
import os
import sys
import json
import inspect
import pymongo
import pathlib
from bson.objectid import ObjectId
from datetime import datetime
from markupsafe import Markup
#-----------------------------------------------------------------------
#
# add a watch function, if change happend to collection, add it to... |
import uuid
import copy
from io import BytesIO
from lxml import etree as etree_
from sdc11073.namespaces import wsaTag, wseTag, dpwsTag, s12Tag, xmlTag, nsmap, WSA_ANONYMOUS, docNameFromQName
from sdc11073.namespaces import Prefix_Namespace as Prefix
from .. import isoduration
CHECK_NAMESPACES = False # ca... |
# Copyright 2017 NOKIA
#
# 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... |
import glob
import os
import cv2
import h5py
import numpy as np
import scipy.misc
import scipy.ndimage
from keras import backend as K
from submodule.Xu3.utils import getFuncName
from utils import (
info,
biBubicInterpolation,
biBubicInterpolation2
)
from utils import showImages
# region setupInput
# 載入... |
#!/bin/python3
"""
jamf2snipe - Inventory Import
ABOUT:
This program is designed to import inventory information from a
JAMFPro into snipe-it using api calls. For more information
about both of these products, please visit their respecitive
websites:
https://jamf.com
https://snipeitapp.... |
# -*- coding: utf-8 -*-
import base64
import datetime
import hashlib
import io
import itertools
import json
import os
import random
import shutil
import subprocess
import tarfile
import tempfile
from configparser import ConfigParser
from contextlib import contextmanager
import factory
import factory.alchemy
import fac... |
import json
import numpy as np
from transformers import AutoModelForTokenClassification
from torch.nn.functional import softmax
from typing import List, Union, Tuple, Any, Dict, IO
from omegaconf import OmegaConf
from nerblackbox.modules.ner_training.ner_model import NerModel
from transformers import logging
# TODO... |
import dash
from dash import Dash #to be installed
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output, State
from dash.exceptions import PreventUpdate
import dash_bootstrap_components as dbc #to be installed
import plotly.graph_objects as go #to be install... |
#!/usr/bin/env python
"""Demonstrates many commonly-used key features of GameTime.
This script also provides a starting point to perform GameTime
analysis on code. The commonly-used features can be activated
through command-line arguments, whose explanation and usage is
described through the `--help` command-line arg... |
from concurrent.futures import ThreadPoolExecutor
from wrappers import SONATAClient
import time
import json
import requests
from urllib.request import urlopen
import csv
import os
import docker
from dateutil import parser
import threading
from keystoneauth1.identity import v3
from keystoneauth1 import session
from he... |
from ..process_flights import AirspaceHandler
from ..utils import DataConfig, check_file, execute_bulk, execute_bulk_between, lerp
from ..scalebar import scale_bar
from .data_utils import graph_add_node, graph_increment_edge, build_graph_from_sparse_matrix, build_graph_from_matrix, get_zone_centre, save_graph_to_file, ... |
from state import *
from workspace import *
import re
import copy
import target
def reset():
Element.defined = set()
State.defined = set()
State.id = 0
Connectable.id = 0
workspace_reset()
###################### Port #######################
import common
class ID(object):
def __init__(self):... |
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import matplotlib.colors as mcolors
import tensorflow as tf
import imageio
css_colors = mcolors.CSS4_COLORS
import pickle
import imageio
###################################FIG_TO_IMG###################################
def fig_to_img(fig):
"""... |
from collections import defaultdict
from pycocotools.cocoeval import Params, COCOeval
import numpy as np
class ExpandParam(Params):
'''
Params for coco evaluation api
'''
def setDetParams(self):
eval_standard = self.evaluate_standard.lower()
if eval_standard.startswith('tiny'):
... |
from __future__ import absolute_import, division, print_function
import argparse
import glob
import logging
import os
import pickle
import random
import re
import shutil
import numpy as np
import torch
import torch.nn.functional as F
from torch.utils.data import DataLoader, Dataset, SequentialSampler, RandomSampler
f... |
import argparse
import os
import numpy as np
import pickle
import sys
sys.path.append('../')
import src.utils as utils
import scipy.sparse as sp
from collections import defaultdict
from sklearn.preprocessing import normalize
def concept_frequency(concept_name):
dict_path = "../data/word_concept_dict/" + concept_na... |
# Copyright (C) 2016 <NAME> <<EMAIL>>
# All rights reserved.
# This file is part of the Python Automatic Forecasting (PyAF) library and is made available under
# the terms of the 3 Clause BSD license
import pandas as pd
import numpy as np
import traceback
import dill
dill.settings['recurse'] = False
# import dill
#... |
import ipdb
import torch
import torch.nn as nn
from torch.autograd import Variable
from torch.nn.utils.rnn import pack_padded_sequence as pack
from torch.nn.utils.rnn import pad_packed_sequence as unpack
import onmt
from onmt.Utils import aeq
class EncoderBase(nn.Module):
"""
Base encoder class. Specifies t... |
from Environment import environment
from DoubleDQN import Qnetwork
import numpy as np
import tensorflow as tf
import pandas as pd
import time as tm
from haversine import haversine
#import random
from random import sample
import math
# action is in the set of (0,1,2,3) = (north, east, south, west)
# s1, r, d = e... |
import matplotlib
matplotlib.use('Agg')
import os, sys
import yaml
from argparse import ArgumentParser
from tqdm import tqdm
import cv2
import imageio
import numpy as np
from skimage.transform import resize
from skimage import img_as_ubyte
import torch
from sync_batchnorm import DataParallelWithCallback
from modules.... |
"""
@file
@brief Source: https://github.com/koniiiik/edmonds-blossom/blob/master/blossom.py
An implementation of Edmonds' blossom algorithm for finding minimum-weight
maximum matchings.
"""
import fractions
import functools
import sys
INF = float('inf')
# Possible levels of blossoms.
LEVEL_EVEN = 0
LEVEL_ODD = 1
# ... |
def detselect(detector_object, suffix='_stats4_total'):
"""Switch the active detector and set some internal state"""
if isinstance(detector_object, (list, tuple)):
#gs.DETS = detector_object
#gs.PLOT_Y = detector_object[0].name + suffix
#gs.TABLE_COLS = [gs.PLOT_Y]
cms.detector... |
import inspect
import json
import argparse
from operator import truediv
import os
import voluptuous as vol
# NOTE: Cannot import other esphome components globally as a modification in jsonschema
# is needed before modules are loaded
import esphome.jsonschema as ejs
ejs.EnableJsonSchemaCollect = True
# schema format:... |
# All imports
import mm_backend as mm
import kivy
from kivy.app import App
from kivy.properties import ObjectProperty
from kivy.core.window import Window
from kivy.uix.screenmanager import Screen, ScreenManager
from kivy.lang import Builder
from kivy.uix.screenmanager import SlideTransition
from kivy.uix.screenmanager... |
#!/usr/bin/env python3
# dinkum/sudoku/cell.py
'''Defines the Cell class which is part of a Sudoku Board.
also a member of an RCB (row/col/blk).
A Cell knows what board it belongs to. It's value and
possible_values if unsolved. It knows which row/col/blk
it belongs to.
Also defines a CellToSet class which holds a C... |
#!/usr/bin/env python
"""
Prints a map of the entire world.
"""
import os, sys
import math
from struct import pack
# local module
try:
import nbt
except ImportError:
# nbt not in search path. Let's see if it can be found in the parent folder
extrasearchpath = os.path.realpath(
os.path.join(__file_... |
"""
Class Features
Name: lib_data_io_nc
Author(s): <NAME> (<EMAIL>)
Date: '20200401'
Version: '3.0.0'
"""
#######################################################################################
# Libraries
import logging
import os
import netCDF4
import time
import re
import warnings
impor... |
""" Contains some SVD functions """
__author__ = "<NAME>"
__email__ = "<EMAIL>"
import numpy as np
import unittest
import os
import cffi
# with 1e-4, we get 1e-1 accuracy, requiring approx 360 iterations
SVD_EPSILON = 1e-4 # 1e-15 # 2e-4
_ACCURACY = 1e-1 # with epsilon:1e-4
MIN_ALLOWED_EIGENVALUE = 1e-3
USE_CFFI = T... |
import numpy as np
# Finding the sim root directory
import sys
from pathlib import Path
from sympy import centroid
cwd = Path.cwd()
for dirname in tuple(cwd.parents):
if dirname.name == '3D-CG':
sim_root_dir = dirname
continue
sys.path.append(str(sim_root_dir.joinpath('CG')))
import quadrature
imp... |
# -*- coding: utf-8 -*-
"""
routines for integrals between uncontracted cartesian Gaussian basis function (only needed for testing)
"""
import numpy as np
def basis_overlap(basis):
"""
compute the overlap matrix between uncontracted basis functions
Parameters
----------
basis : instance of Uncon... |
"""Convenience functions for MLR diagnostics."""
import logging
import os
import re
import warnings
from copy import deepcopy
from pprint import pformat
import esmvalcore.preprocessor
import iris
import numpy as np
import shapely.vectorized as shp_vect
from cartopy.io import shapereader
from cf_units import Unit
from... |
# File: archer_utils.py
#
# Copyright (c) 2016-2022 Splunk 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 appli... |
# DEBUG = True
import math, os
class Node:
def __init__(self, value = None, left = None, right = None):
self.left = left
self.right = right
self.parent = None
self.ind = value
self.x = None
self.y = None
self.width = None
self.height = None
def set_node_value(self, value, x = None, y =... |
# 6DoF pose annotator
# <NAME>, Chukyo Univ.
# Email: <EMAIL>
#
import open3d as o3
import numpy as np
import cv2
import copy
import argparse
import os
import common3Dfunc as c3D
from math import *
from scipy.spatial.transform import Rotation as R
import json
from pathlib import Path
from realsense import RealsenseDa... |
from keras.utils import multi_gpu_model
from systemtools.logger import *
from numpy import array
from keras.preprocessing.text import one_hot
from keras.preprocessing.sequence import pad_sequences
from keras.models import Sequential
from keras.layers import Dense, LSTM, Flatten
from keras.layers.embeddings import Embed... |
# -*- coding: UTF-8 -*-
# Copyright 2011-2018 Rumma & Ko Ltd
# License: BSD (see file COPYING for details)
from __future__ import unicode_literals
from builtins import str
from django.conf import settings
from django.db import models
from django.db.models import Q
from lino import mixins
from lino.api import dd, rt,... |
import codecs
import csv
import os
import re
import sys
import urllib.request
import logging
from typing import Type, Tuple
from baseParser import BaseParser
from monstatparser import MonStatParser
from property import Property
from property import PropertyParse
from skills import SkillParser
from utils import isdebug... |
#!/usr/bin/env python
"""
coding=utf-8
Build model for a dataset by identifying type of column along with its
respective parameters.
"""
from __future__ import print_function
from __future__ import division
from future.utils import with_metaclass
import copy
import abc
import warnings
import sys
import numpy as np
f... |
import asyncio
import json
import time
import folium
import geojson
from apscheduler.schedulers.background import BackgroundScheduler
from apscheduler.triggers.interval import IntervalTrigger
from area import area
from celery import shared_task
from django.db.models import Sum, Avg
from django.utils.translation import... |
'''
Created on 4 Nov 2018
@author: jamie
'''
from collections import deque
from enum import Enum
from enum import unique
# import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import os
import tensorflow as tf
import shutil
# import skop... |
#!/usr/bin/env python3
#works in simulator.Testing in sim only.
""" TODO
- Tune segmentation for green buoy (may need to use similar components as red,
because TRANSDEC buoy and lighting is better)
- Detection of (yellow?) (propeller?) may need a separate vision module
depending on its shape
- Buoy reference colo... |
# -*- coding: utf-8 eval: (yapf-mode 1) -*-
#
# January 13 2019, <NAME> <<EMAIL>>
#
# Copyright (c) 2019, LabN Consulting, L.L.C.
# 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 L... |
# Copyright 2018 <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, software... |
# Python 3
#
# <NAME>
# Feb 28, 2019 Created
# Aug 17, 2020 Updated
#
# Generate all profilings in parallel
# Run Experiment passes
# Please follow README.md in the sciprt/ directory
import argparse
import json
import sys
import os
import subprocess
import shutil
from joblib import Parallel, delayed
from collections ... |
## CAS 741 - Development of Scientific Computing Software - <NAME>
## Reference source code:
## https://github.com/farzadab/pendulum_simulation
## Python implementation of multiple pendula simulation using OpenGL GLUT
from OpenGL.GL import *
from OpenGL.GLUT import *
from OpenGL.GLU import *
import argparse
import s... |
# Lint as: python3
# Copyright 2021 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... |
import json
import logging
from os import walk
import time
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import render
from django.urls import reverse
from django.views.decorators.csrf import csrf_protect
from rest_framework.decorators import api_view
from rest_framework.response imp... |
# encoding: UTF-8
"""
"""
import hashlib
import hmac
import sys
import time
from copy import copy
from datetime import datetime, timedelta
from threading import Lock
from urllib.parse import urlencode
from requests import ConnectionError
from vnpy.api.rest import Request, RestClient
from vnpy.api.websocket import We... |
import pandas as pd
import numpy as np
import gspread_dataframe as gd
import gspread as gs
import setup
import queries
# csv export of historical sales
sales_master = pd.read_csv('Inventory Manager/historical_sales.csv')
# dropping na values, filtering out samples
sales_master = sales_master.dropna()
sales_mast... |
'''
Simple routes
=============
Ordinary routes management is really simple::
(ndb # create a route
.routes
.create(dst='10.0.0.0/24', gateway='192.168.122.1')
.commit())
(ndb # retrieve a route and change it
.routes['10.0.0.0/24']
.set('gateway', '192.168.122.1... |
import os
import struct
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import nibabel as nib
from matplotlib import cm
from nibabel.affines import apply_affine
from PyQt5 import QtGui
from .instance import Instance
class Image(Instance):
"""Specific methods for the SOPClass MR Image Storag... |
import numpy as np
from datetime import datetime, date, time, timedelta
import cartopy.crs as ccrs
import matplotlib.pyplot as plt
import pyart
import os
import pytda
from radarlma2local import rcs_to_tps, geo_to_tps
from ortho_proj import ortho_proj_lma
def plot_locs_lma_rhi(radar, lma_df, zoom):
"""
Plot t... |
#!/usr/bin/env python3
import os
import re
import sys
import string
import inspect
import pandas as pd
import random
import json
import math
import matplotlib.pyplot as plt
random.seed(12345)
try:
currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
parentdir = os.path.dirnam... |
from VESIcal import activity_models
from VESIcal import calibration_checks
from VESIcal import core
from VESIcal import fugacity_models
from VESIcal import model_classes
from VESIcal import sample_class
import numpy as np
import warnings as w
from scipy.optimize import root_scalar
class carbon(model_classes.Model):
... |
from collections import defaultdict
from datetime import timedelta
from enum import IntEnum
from typing import NamedTuple, List
from urllib.parse import urljoin
import redis
from django.conf import settings
from django.db.models import Q, QuerySet, Max, F
from django.urls import reverse
from django.utils import timezo... |
#!/usr/bin/env python3.7
"""
This file contains test cases for Privex's Python Helper's (privex-helpers).
Before running the tests:
- Ensure you have any mandatory requirements installed (see setup.py's install_requires)
- You may wish to install any optional requirements listed in README.md for best results
... |
from itertools import permutations
import matplotlib.pyplot as plt
import numpy as np
import os
from pyearth import Earth
import sys
from tqdm import tqdm
np.warnings.filterwarnings('ignore') # this suppresses a FutureWarning in the PyEarth package
#######################################################################... |
# Copyright (c) Facebook, Inc. and its affiliates.
import os
import sys
import os.path as osp
import torch
from torchvision.transforms import Normalize
import numpy as np
import cv2
import argparse
import json
import pickle
import matplotlib.pyplot as plt
############# input parameters #############
from demo.demo_o... |
# -*- coding: utf-8 -*-
import numpy as np
# Generates a point
# >>Input: X and Y coordinate of point
# >>Output: a point object (is np array type float64 shape (2,) )
def getPoint(x, y):
return np.asarray([x, y])
# Determine euclidean distance between two points
# >>Input: two points pointA and pointB
# >>Out... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
try:
import Tkinter as tk
except ImportError:
import tkinter as tk
try:
import ttk
py3 = False
except ImportError:
import tkinter.ttk as ttk
py3 = True
try:
import check_log_gui #Importing GUI to Show Data of log.txt in GUI W... |
# -*- coding: utf-8 -*-
"""
The :mod:`parsimony.functions.nesterov.tv` module contains the loss function
and helper functions for Total variation, TV, smoothed using Nesterov's
technique.
Created on Mon Feb 3 10:46:47 2014
Copyright (c) 2013-2014, CEA/DSV/I2BM/Neurospin. All rights reserved.
@author: <NAME>, <NAME... |
import textwrap
import datetime
import types
from urllib.request import urlopen
import urllib.error
from dateutil.easter import *
from dateutil.parser import *
from datetime import date
from bs4 import BeautifulSoup
import httplib2
import os
import json
from google.auth.transport.requests import Request
from google.oa... |
import argparse
import logging
import time
import os
import sys
import itertools
import signal
from pathlib import Path
import z3
import util
from get_semantics import get_z3_formulization
log = logging.getLogger(__name__)
FILE_DIR = Path(__file__).parent.resolve()
ROOT_DIR = FILE_DIR.parent
P4Z3_BIN = ROOT_DIR.joinp... |
"""Application of this framework to the realistic problem of the
analysis described in https://arxiv.org/abs/1709.08908,
i.e. the CMS search including two opposite-sign, same-flavour
leptons, jets, and MET at 13 TeV.
Simplified likelihood construction follows
https://cds.cern.ch/record/2242860
"""
im... |
"""Compute rough emission curves."""
import warnings
import numpy as np
import xarray as xr
import roughness.helpers as rh
import roughness.roughness as rn
from roughness.config import SB, SC, CCM, KB, HC, TLOOKUP
def rough_emission_lookup(
geom, wls, rms, albedo, lat, tloc, rerad=True, flookup=None, tlookup=None... |
"""
********************************
*** LOOPS IN POOL ***
********************************
You are a magigardener. The Countess du Swagging asked you to clean
her swimming-pool, which has been invaded by mud and vines.
Select two tiles with the "1" button (numpad or keyboard)
to exchange their vines.
Make... |
#!/usr/bin/env python
# ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 <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:
#
#... |
from __future__ import unicode_literals
import json
import re
import subprocess
import sys
import syslog
from pprint import pprint
from xml.dom import minidom
import hashlib
from pyfeld.renderer import Renderer
from pyfeld.discoverByHttp import DiscoverByHttp
from pyfeld.errorPrint import err_print
from pyfeld.getRau... |
"""
Generate shapeworld reference games
"""
import numpy as np
from numpy import random
from tqdm import tqdm
import os
import multiprocessing as mp
import json
import image
import color
import shape
import config
import constants as c
import vis
import copy
def world_json(config, shapes, lang_type='standard'):
... |
# Licensed under the MIT License.
# Written by <NAME> (<EMAIL>)
import torch
import numpy as np
import os
from pycocotools.coco import COCO
from pycocotools.cocoeval import COCOeval
from collections import defaultdict
from collections import OrderedDict
from timeit import default_timer as timer
import... |
# -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2018-2020 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 ... |
#!/usr/bin/env python3
import argparse
import logging
import os
import shutil
import sys
import warnings
from copy import deepcopy
from datetime import datetime
from functools import partial
import numpy as np
import torch
import torch.backends.cudnn as cudnn
import torch.nn as nn
import torch.nn.functional as F
impo... |
## adapted from https://github.com/rail-berkeley/softlearning/blob/master/softlearning/algorithms/sac.py
import os
import math
import pickle
from collections import OrderedDict
from numbers import Number
from itertools import count
import gtimer as gt
import numpy as np
import tensorflow as tf
from tensorflow.python.... |
# coding=utf-8
import re
import vim
from . import breakpoint
from . import dbgp
from . import error
from . import log
from . import opts
from . import util
from .ui import vimui
class Event:
def __init__(self, session_handler):
log.Log("** %s" % self.__class__.__name__,
log.Logger.DEBUG)... |
# 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.
import os.path
import sys
import optparse
import collections
import functools
import re
import copy
try:
import json
except ImportError:
import simpl... |
# Copyright (c) 2018 ISP RAS (http://www.ispras.ru)
# Ivannikov Institute for System Programming of the Russian Academy of Sciences
#
# 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
#
# ht... |
import multiprocessing as mp
import os
import time
import numpy as np
import torch
from progressbar import ProgressBar
from torch.autograd import Variable
from torch.utils.data import Dataset
from socket import gethostname
from physics_engine import RopeEngine, SoftEngine, SwimEngine
from physics_engine import sample... |
# pylint: disable=E1101
import time
from copy import copy
from functools import reduce
from itertools import chain
from typing import Callable, List, Union
import torch
import torch.nn.functional as F
import PIL
PIL.PILLOW_VERSION = PIL.__version__
from torchvision.transforms.functional import to_tensor
impo... |
from utils import load_audio, load_info
from pathlib import Path
import torch.utils.data
import argparse
import random
import musdb
import torch
import tqdm
class Compose(object):
"""Composes several augmentation transforms.
Args:
augmentations: list of augmentations to compose.
"""
def __ini... |
#!/usr/bin/env python
## Copyright (c) 2009 <NAME>
## Permission is hereby granted, free of charge, to any person obtaining a copy
## of this software and associated documentation files (the "Software"), to deal
## in the Software without restriction, including without limitation the rights
## to use, copy, modify, m... |
from typing import KeysView
import numpy as np
import torch
import torch.nn.functional as functional
from inplace_abn import active_group, set_active_group
from random import randint
from cirtorch.modules.losses import triplet_loss, contrastive_loss
from cirtorch.utils.misc import Empty
from cirtorch.utils.parallel imp... |
from cmath import inf
from unicodedata import numeric
import numpy as np
import itertools
import torch
import seaborn as sns
from matplotlib import pyplot as plt
from scipy.special import gamma
numpy = lambda x: x.cpu().numpy()
FIGSIZE_LARGE = (4, 4)
FIGSIZE = (8, 12) # Small thumbnails for the paper
CELLSIZE = (4... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Date : 2020-03-23 19:28:33
# @Author : <NAME> & <NAME> (<EMAIL>)
# @Link : http://iridescent.ink
# @Version : $1.0$
from __future__ import division, print_function, absolute_import
import torch as th
import numpy as np
from torchlib.base.arrayops import sl
from to... |
#!/usr/bin/env python3
""" Copyright © 2020 <NAME>
Functions for extract pixel values by line.
"""
import sys
import os
import logging
import math
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
from skimage.external import tifffile
from skimage import data, img_as_float
def lineSlice(img, ... |
# -*- coding: utf-8 -*-
#===============================================================================
# Battleship Plugin by DarkVolli 2011
#
# This 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 ve... |
from docutils import nodes
from docutils.parsers.rst import directives
from sphinx.application import Sphinx
from sphinx.config import Config
from sphinx.errors import SphinxError
from sphinx.roles import XRefRole
from sphinxcontrib.needs.api.configuration import add_extra_option
from sphinxcontrib.needs.builder impor... |
import mimetypes
import os
import shutil
import sys
import tempfile
import uuid
from datetime import datetime, timedelta
from collections import namedtuple
import pygit2
from celery import current_task
from django_statsd.clients import statsd
from django.conf import settings
from django.db import connections
from d... |
from __future__ import division
"""
Author: <NAME>
"""
__license__ = """
Copyright 2015 Parse.ly, 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... |
import re
import inspect
import warnings
import weakref
from twisted.trial import unittest
from scrapy.exceptions import ScrapyDeprecationWarning
from scrapy.http import TextResponse, HtmlResponse, XmlResponse
from scrapy.selector import Selector
from scrapy.selector.lxmlsel import XmlXPathSelector, HtmlXPathSelector, ... |
""" This file originated from the online analysis project at:
https://github.com/OlafHaag/UCM-WebApp
"""
import itertools
import pandas as pd
import pingouin as pg
import numpy as np
from scipy.stats import wilcoxon
from sklearn.decomposition import PCA
from sklearn.covariance import EllipticEnvelope
... |
"""
Date: March 2021
Author: <NAME>
Abstract: Training process and functions
"""
# -*- coding: UTF-8 -*-
import os
import sys
import random
import datetime
import numpy as np
import argparse
import tensorflow as tf
import time
import matplotlib.pyplot as plt
from task_generator import TaskGenerator
from m... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from matplotlib import pyplot as plt
import pandas as pd
import numpy as np
from sklearn.neighbors import KernelDensity
from sklearn.model_selection import GridSearchCV
from tensorflow import keras
from tensorflow.keras import layers
from tensorflow.keras import callbacks
... |
from bitarray import bitarray
from random import *
from time import sleep
from threading import Thread
import sys
from cqc.pythonLib import *
from protocol import *
from utils import *
##############################
#
# QGMNode class derived from CQCConnection, with reg* attributes
#
class QGMNode():
def __init... |
# -*- coding: utf-8 -*-
# This file is part of beets.
# Copyright 2016, <NAME>.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the right... |
from utils import io_util, rend_util
from models.frameworks import get_model
from utils.checkpoints import sorted_ckpts
from utils.print_fn import log
from pathlib import Path
import pickle
import os
import math
import imageio
import functools
import numpy as np
from tqdm import tqdm
import torch
import torch.nn.func... |
import numpy as np
from numpy import exp, sin
import matplotlib.pyplot as plt
import scipy.integrate as spint
from scipy.optimize import fsolve, fmin, minimize, root, newton
from scipy.linalg import solve_triangular
from scipy.sparse.linalg import eigsh
import scipy
from scipy.integrate import solve_ivp
from param impo... |
"""This module defines a functions for handling conformational ensembles."""
import os.path
import time
from numbers import Integral
import numpy as np
from prody.proteins import alignChains
from prody.utilities import openFile, showFigure, copy, isListLike, pystr, DTYPE
from prody import LOGGER, SETTINGS
from prody... |
"""Methods for the interpolation of DLTI ROMs
This is library for state-space models interpolation. These routines are intended
for small size state-space models (ROMs), hence some methods may not be optimised
to exploit sparsity structures. For generality purposes, all methods require in
input interpolatory weights.... |
import gc
import os
import time
import traceback
import numpy as np
import tensorflow as tf
from constants import *
from model import *
from utils import calc_rouge, eprint, BertConfig, calc_acc
from utils.Batcher import get_batcher
from utils.Saver import Saver
from utils.data_loader import load_vocab, id2text
impor... |
from __future__ import (
absolute_import,
unicode_literals,
)
import importlib
from types import ModuleType
from typing import (
Any as AnyType,
Callable,
Dict,
Hashable as HashableType,
List as ListType,
Mapping,
MutableMapping,
Optional,
Tuple as TupleType,
Type,
U... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.