text stringlengths 8.04k 46.5k |
|---|
import subprocess
import itertools
import json
import copy
import simplejson
import itertools
import numpy as np
import pandas as pd
import nltk
import spacy
nlp = spacy.load("en_core_web_sm")
from xml.dom import minidom
from PIL import ImageColor
from nltk.corpus import wordnet as wn
# ===============================... |
from scipy import interpolate
import collections
import numpy as np
import os
import re
import torch
import pylab as plt
import matplotlib.ticker as mtick
import math
import itertools
from tensorboard.backend.event_processing import event_accumulator
def get_run_names(logdir, patterns):
run_names = []
for pat... |
# -*- encoding=utf-8 -*-
"""
# **********************************************************************************
# Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved.
# [oecp] is licensed under the Mulan PSL v1.
# You can use this software according to the terms and conditions of the Mulan PSL ... |
"""
Training models
"""
import os
import time
import sys
import shutil
import random
from time import strftime
from argparse import ArgumentParser
import numpy as np
import torch
import torch.utils.data
import torch.nn.functional as F
torch.multiprocessing.set_sharing_strategy('file_system')
from subprocess import... |
# -*- coding: utf-8 -*- #
# Copyright 2020 Google LLC. 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 requir... |
"""Copyright [2020] [<NAME> & <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, sof... |
#!/usr/bin/python2.7
'''
---------------------------
Licensing and Distribution
---------------------------
Program name: Pilgrim
Version : 1.0
License : MIT/x11
Copyright (c) 2019, <NAME> (<EMAIL>) and
<NAME> (<EMAIL>)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this sof... |
#!/usr/bin/env python3 -u
"""
Main Script for training and testing
"""
import argparse
import json
import logging
import os
import pdb
import random
import sys
import time as t
from collections import OrderedDict
import numpy as np
import spacy
import torch
from torch import nn
from torch.optim.lr_scheduler import Red... |
"""
Auth Model
Copyright: 2009-2021 (c) Sahana Software Foundation
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 ri... |
import logging
import typing
import random
import heapq
import time
import asyncio
import threading
from .actor import Actor
from .message import ActorMessage
from .state import ActorState, OUTBOX, EXPORT, ERROR, ERROR_NOTRY
from .storage import ActorLocalStorage
from .registery import ActorRegistery
from .builtin_act... |
from numpy import *
from numpy.linalg import *
from numpy.random import *
import scipy
import scipy.linalg
import itertools
def normalize(v):
return v / norm(v)
def decompose(P):
M = P[:3, :3]
T = P[:3, 3]
K, R = scipy.linalg.rq(M)
for i in range(2):
if K[i,i] < 0:
K[:, i] *=... |
# -*- coding: utf-8 -*-
"""
Simplified DocBook parser for docutils and sphinx
=================================================
This script may not work out of the box, but is easy to extend.
Docbook has >400 elements, only about 100 are supported for now.
It is more or less limited to the output of... |
# Copyright (C) <NAME> 2019. All rights reserved.
import copy
from matplotlib import pyplot as plt
import numpy as np
import os
from glob import glob
def scale_lse_solver(X, Y):
"""Least-sqaure-error solver
Compute optimal scaling factor so that s(X)-Y is minimum
Args:
X (KxN array): current data... |
from hack_sys_path import *
from gl_util import GlRgbTexture
from imgui_sdl_wrapper import ImguiSdlWrapper
from overlayable import *
from fit_circle import *
from pytagmapper.data import *
from pytagmapper.project import *
from pytagmapper.geometry import *
from pytagmapper.inside_out_tracker import InsideOutTracker
f... |
import logging
from speedling import conf
from speedling import facility
from speedling import gitutils
from speedling import localsh
from speedling import tasks
from speedling import usrgrp
from speedling import util
LOG = logging.getLogger(__name__)
sp = 'sl-'
# TODO: ceph feature step register_ceph_libvirt():
#... |
#!/usr/bin/env python
"""Central registry for artifacts."""
import json
import os
import re
import yaml
import logging
from grr.lib import access_control
from grr.lib import aff4
from grr.lib import artifact_utils
from grr.lib import objectfilter
from grr.lib import parsers
from grr.lib import rdfvalue
from grr.lib ... |
# Copyright (c) 2020-present, <NAME>
# All rights reserved.
import argparse
import datetime
import numpy as np
import time
import torch
import torch.backends.cudnn as cudnn
import json
from pathlib import Path
from timm.data import Mixup
from timm.models import create_model
from timm.loss import LabelSm... |
import torch
import torch.nn as nn
import numpy as np
from torch.nn import functional as F
import math
from utils.tools import make_positions
def Embedding(num_embeddings, embedding_dim, padding_idx=None):
m = nn.Embedding(num_embeddings, embedding_dim, padding_idx=padding_idx)
nn.init.normal_(m.weight, mean... |
#! /usr/bin/env python
"""
Script to extract text from json dumped scrapes from scrapes mongodb.
"""
import os
import json
import urllib.parse
import click
from torch import multiprocessing
from torch.multiprocessing import JoinableQueue, Process
from typing import (
Generator,
NamedTuple,
List,
Dict,
... |
# Copyright (c) 2016 Universidade Federal Fluminense (UFF)
# Copyright (c) 2016 Polytechnic Institute of New York University.
# This file is part of noWorkflow.
# Please, consult the license terms in the LICENSE file.
"""Dependency Filter"""
from __future__ import (absolute_import, print_function,
... |
import random
import tkinter as tk
from tkinter import messagebox
from PIL import Image, ImageTk
import time
import math
import os
TYPE_MONSTER = 0
TYPE_HERO = 1
TYPE_BUILDING = 2
MONSTER_GOOMBA = 0
MONSTER_MINOTAUR = 1
MONSTER_LAISTRYGONIAN = 2
MONSTER_ZOMBIE = 3
MONSTER_DEVIL = 4
MONSTER_SATAN = 5
MONSTER_VAMPIRE =... |
#!/usr/bin/env python2
# coding: utf-8
from __future__ import print_function, unicode_literals
"""vxt.py: transfer files encoded as dotmatrix patterns"""
__author__ = "ed <<EMAIL>>"
__copyright__ = 2020
__license__ = "MIT"
__url__ = "https://github.com/9001/diodes/"
import re
import os
import sys
import stat
import s... |
"""Utilities module for gui services."""
import datetime
import logging
import os
from aiohttp import web
from aiohttp_session import get_session
from result_service_gui.services import (
EventsAdapter,
RaceplansAdapter,
ResultAdapter,
StartAdapter,
TimeEventsAdapter,
TimeEventsService,
Us... |
#!/usr/bin/env python
#
# Azure Linux extension
#
# Copyright (c) Microsoft Corporation
# All rights reserved.
# MIT License
# 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 restrictio... |
#
# Jasy - Web Tooling Framework
# Copyright 2010-2012 Zynga Inc.
# Copyright 2013-2014 <NAME>
#
import copy
import re
import os
import json
import jasy.script.api.Data as Data
import jasy.script.api.Text as Text
import jasy.core.File as File
from jasy.script.util import *
import jasy.core.Console as Console
from ja... |
import numpy as np
import socket
import time
import os
import subprocess
import sys
from . import serverConfig
import serial.tools.list_ports
HOST = serverConfig.HOST
PORT = serverConfig.PORT
initializeOnStart = serverConfig.initializeOnStart
defaultSerialPort = serverConfig.defaultSerialPort
serialDelay = serverConf... |
#!/usr/bin/env python
#
# auto_processor.py: automated processing of Illumina sequence data
# Copyright (C) University of Manchester 2013-2020 <NAME>
#
#########################################################################
#
# auto_processor.py
#
##############################################################... |
from .data import Data
from .spectrum1d import Spectrum1D
from multiprocessing import cpu_count
from multiprocessing import Pool
from time import sleep
from functools import partial
import signal
import numpy
def init_worker():
signal.signal(signal.SIGINT, signal.SIG_IGN)
class Cube(Data):
"""A class repres... |
import sys
import os
import numpy as np
import tensorflow as tf
import csv
import pickle
import tarfile
import zipfile as z
import threading
from scipy import ndimage
from scipy.misc import imresize, imsave
from six.moves.urllib.request import urlretrieve
MB = 1024 ** 2
def download_hook_function(block, block_size... |
import argparse
from datetime import datetime
import json
import numpy as np
import subprocess
import os
import pytz
import ray
try:
from ray.rllib.agents.agent import get_agent_class
except ImportError:
from ray.rllib.agents.registry import get_agent_class
from ray.rllib.env.group_agents_wrapper import _Group... |
"""Placeholder."""
from typing import (
Callable,
Any,
Dict,
Tuple,
Union,
Optional,
Iterator
)
import socket
import logging
from time import sleep
from zenchi import cache, settings
from zenchi.settings import value_or_error
import zenchi.mappings as mappings
from zenchi.mappings import int... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import json
import os
import requests
import base64
import yaml
from prettytable import PrettyTable
from utils import *
base_url = "http://localhost:5050"
headers = {'Content-Type': 'application/json'}
def validate_vnfp(path):
vnfd_file = get_vnfd_file_name(path)
... |
import json
import os
import random
import unicodedata
import uuid
from collections import defaultdict
from datetime import date
from textwrap import dedent
from unittest.mock import patch
from django.conf import settings
from django.contrib.sites.models import Site
from django.core.files import File
from django_count... |
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
import random
import tensorflow as tf
import numpy as np
from tqdm import tqdm
from recommenders.utils.timer import Timer
class MultiHeadAttention(tf.keras.layers.Layer):
"""
- Q (query), K (key) and V (value) are s... |
# Copyright (c) 2009 Google Inc. All rights reserved.
# Copyright (c) 2009 Apple Inc. All rights reserved.
# Copyright (c) 2012 Intel Corporation. All rights reserved.
# Copyright (c) 2013 University of Szeged. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, a... |
#!/usr/bin/env python
"""
@package mi.dataset.parser.ctdmo_ghqr_sio
@file mi/dataset/parser/ctdmo_ghqr_sio.py
@author <NAME> (original telemetered), <NAME> (recovered)
@brief A CTDMO series ghqr specific data set agent parser
This file contains code for the CTDMO parsers and code to produce data particles.
For teleme... |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# 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 ... |
#
# Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
#
# 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; version 2 of the License.
#
# This program is distributed in th... |
#!/usr/bin/env python
"""A module to define the input reader object
<NAME>
<NAME>
"""
from __future__ import print_function, division
from copy import copy
import input_reader
import numpy as np
from pyscf import gto, pbc
from qsome import helpers
class InputError(Exception):
"""Exception for an improperly desig... |
import os
import sys
import time
import pdb
import gc
import numpy as np
import faiss
import argparse
import resource
import benchmark.datasets
from benchmark.datasets import DATASETS
from benchmark.plotting import eval_range_search
####################################################################
# Index building... |
import numpy as np
import numpy.linalg as la
import scipy.sparse as sp
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import ... |
"""
Created on Apr 3, 2012
@author: Dan
"""
from math import cos, sin, sqrt, atan2, copysign, radians, fabs, degrees
from Common.LayerIds import getLayerId, makeViaMask
import re
class Line(object):
__slots__ = ('x1', 'y1', 'x2', 'y2', "cX", "cY", 'width', 'layer', 'curve', 'radius', 'sAngle', 'eAngle')
de... |
from __future__ import division
# import matplotlib.pyplot as plt
import numpy as np
import tensorflow as tf
import math
def points2d_depimg(points_2d,width,height):
Z = points_2d[2, :]
x = tf.transpose(points_2d[0, :] / Z)
y = tf.transpose(points_2d[1, :] / Z)
# zero = tf.zeros([1], dtype='float32')
... |
"""
Created on Wed Nov 8 11:00:05 2017
@author: <NAME>
License: MIT
Tags: Neural Network
"""
import numpy as np
import matplotlib.pyplot as plt
import os
import time
import random
def softmax(x):
e_x = np.exp(x - np.max(x))
return e_x / e_x.sum()
def relu(x):
x[x < 0] = 0
return x... |
#!/usr/bin/python
__author__ = "<NAME>"
__copyright__ = "Copyright 2013, MetaPathways"
__credits__ = ["r"]
__version__ = "1.0"
__maintainer__ = "<NAME>"
__status__ = "Release"
try:
import traceback
from optparse import make_option
from os import makedirs, path, listdir, remove, rename, _exit
import os,... |
# -*- coding: utf-8 -*-
# *****************************************************************************
# Copyright (c) 2019-2020, Intel Corporation All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#... |
import torch
import torch.nn as nn
import torch.optim as optim
from torch.autograd import Variable
import torch.nn.functional as F
import numpy as np
import os
import sys
import pdb
import time
import math
import argparse
import time
from sklearn.cluster import KMeans
import matplotlib
matplotlib.use('Agg')
import ma... |
#! /usr/bin/env python3
# <<BEGIN-copyright>>
# Copyright 2021, Lawrence Livermore National Security, LLC.
# See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: BSD-3-Clause
# <<END-copyright>>
""" This module contains the methods to run tdfgen, producing tdf files for light ion thermonuclear ... |
"""Various utility functions used across the repo."""
import os
import json
import logging
import psycopg2
import psycopg2.extras
import itertools
import boto3
import requests
from datetime import datetime as dt
from psycopg2 import sql
from collections import Counter
from botocore.exceptions import ClientError
from g... |
import pytest
from numpy import allclose, arange, array, asarray, dot, cov, corrcoef, float64
from thunder.series.readers import fromlist, fromarray
from thunder.images.readers import fromlist as img_fromlist
pytestmark = pytest.mark.usefixtures("eng")
def test_map(eng):
data = fromlist([array([1, 2]), array([3... |
# -*- coding: UTF-8 -*-
"""
source.py
~~~~~~~~~
XML source file handler.
License of this script file:
MIT License
License is available online:
https://github.com/lordmikefin/app_source_handler/blob/master/LICENSE
Latest version of this script file:
https://github.com/lordm... |
"""
Tools useful for fitting models to data.
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from .vpfit import read_f26
from ..data.atomic import AtomDat
from ..plot.velplot_utils import VelocityPlot
from PyQt4.QtGui import (QApplication, QMainWindo... |
import cmath
import numpy as np
from math import pi
from .invert import SurroundVariation, reduce
from .sld_profile import SLDProfile, refr_idx
try: # CRUFT: basestring isn't used in python3
basestring
except:
basestring = str
ZERO_TOL = 1e-10
# The tolerance to decide, when the reflectivity is 1, i.e. |r ... |
"""Created by <NAME> on 2016-10-16, last updated 2019-12-10.
Copyright (c) 2016, 2018, 2019 <NAME>. License: MIT
# Base Types
Base types are a set of basic data types, all of which are easy to serialize and are
either a standard type of nearly every programming languge or are easy to
implement/emulate if not.
Base ... |
from __future__ import print_function, unicode_literals, absolute_import, division
import numpy as np
import warnings
import math
from tqdm import tqdm
from distutils.version import LooseVersion
import keras
import keras.backend as K
from keras.layers import Input, Conv2D, MaxPooling2D, Activation, Layer, Dropout
fro... |
import random
from my_moduler import get_module_logger
import card_setting
mylogger = get_module_logger(__name__)
from util_ability import *
def spell_ability_001(field, player, opponent, virtual, target, itself):
get_damage_to_creature(field, opponent, virtual, target, num=3)
put_card_in_hand(fiel... |
import json
import os
import shutil
from multiprocessing import Pool
import pandas as pd
import covid_data_api
import covid_data_bed
import covid_data_briefing
import covid_data_dash
import covid_data_situation
import covid_data_testing
import covid_data_tweets
import covid_data_vac
from utils_pandas import add_data
... |
READ_ME = """
=== PREREQUISITES ===
Use with Meraki Python SDK @ github.com/meraki/dashboard-api-python/ & install required libraries with
pip[3] install -r requirements.txt
=== DESCRIPTION ===
This script iterates through a dashboard organization and backs up the configuration for the org, networks & templates,
and... |
from django.shortcuts import render
import itertools
import urllib,json
import csv
import os
import datetime
from django.http import JsonResponse,HttpResponse,HttpResponseRedirect
from django.utils.timezone import make_aware
from .models import weather,hole,examination,modelResult
from .water import water
from django.c... |
"""
v8 - There are some refinements to be made to the maze creation algorithm:
1. It has been determined that it's best not to roll back the walls created in blocked branches.
- These blocked paths can be left as open paths for the maze solver to explore.
- Because of this, all the ... |
import os
import sys
import asyncio
import json
import functools
import math
from collections import OrderedDict
from caproto.server import ioc_arg_parser, run, pvproperty, PVGroup
from caproto.server.records import _Limits
from caproto import ChannelType
import simulacrum
import zmq
from zmq.asyncio import Context
#s... |
import ast
import re
import numpy as np
import pandas as pd
import wfdb
from typing import List, Union
import matplotlib.pyplot as plt
from signalanalysis.signalanalysis import general
from signalanalysis import tools
from signalanalysis import signalplot
from signalanalysis.io import igb
plt.style.use('seaborn')
c... |
#!/usr/bin/python3
from typing import Dict, List, Set, Tuple, Union, Optional
from pathlib import Path
import contextlib
import datetime
import fcntl
import logging
import os
import re
import shutil
import string
import subprocess
import time
import yaml
import cloud_build.image_tests
import cloud_build.rename
PRO... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# __coconut_hash__ = 0x6dc38803
# Compiled with Coconut version 1.5.0-post_dev78 [Fish License]
"""
Utilities for use in BBopt backends.
"""
# Coconut Header: -------------------------------------------------------------
from __future__ import print_function, absolute_i... |
# -*- coding: utf-8 -*-
"""
Created on Sat Sep 15 13:42:30 2018
@author: <NAME>
collection of IDL commands
and other useful snippets for the IDL_view->python translation
"""
import logging
from tkinter import filedialog
import tkinter as tk
import numpy as np
import scipy.ndimage as sci
#import skimage as ski
import ... |
# Copyright (c) 2019 <NAME>.
# Uranium is released under the terms of the LGPLv3 or higher.
import configparser
import io
from typing import Any, cast, Dict, List, Optional, Set, Tuple
from PyQt5.QtCore import QObject, pyqtProperty, pyqtSignal
from UM.Logger import Logger
from PyQt5.QtQml import QQmlEngine
import UM... |
'''Bayesian word embedding model for both static fits and dynamic filtering.
Basic usage:
python3 single-timestep.py [optional arguments] input_file output_directory
where `input_file` contains a sparse word-context co-occurrence matrix. Use the
script TODO to generate such a matrix from a corpus. For more detai... |
"""
The filter tab for the main toolbar
@author: <NAME>
"""
from __future__ import absolute_import
from __future__ import unicode_literals
import logging
import functools
import copy
import traceback
from PySide2 import QtGui, QtCore, QtWidgets
from ..visutils.utilities import iconPath
from ..filtering import fil... |
import numpy as np
from copy import deepcopy
from sklearn.base import BaseEstimator
from sklearn.utils.validation import check_is_fitted
from sklearn.utils.extmath import safe_sparse_dot
from sklearn.utils.validation import check_array, _check_sample_weight, \
FLOAT_DTYPES
from yaglm.autoassign import autoassign
f... |
import bpy
import os
import subprocess
from bpy.types import (
Operator,
Panel,
PropertyGroup,
)
from bpy.props import (
BoolProperty,
EnumProperty,
FloatProperty,
FloatVectorProperty,
IntProperty,
PointerProperty,
StringProperty,
)
from itertools import chain
from math import ra... |
import sys
sys.path.insert(0, "./libpytunes")
import re
import os
import sqlite3
import pickle
from libpytunes import Library
import audio_metadata
from tinytag import TinyTag
import mutagen
FIND_FLAC = False
WITH_TIMER = True
CORTINA_DURATION = 70
ITUNES_LIBRARY_FILE_LOCATION = "/Users/cjr/Tango/iTunes/iTunes Libra... |
# pylint: disable=not-callable, no-member, invalid-name, line-too-long, unexpected-keyword-arg, too-many-lines, import-outside-toplevel
"""
Some functions related to SO3 and his usual representations
Using ZYZ Euler angles parametrisation
"""
import gc
import math
import os
from functools import lru_cache
from typing ... |
"""Module classifier.py contains functionality that classifies CVEs."""
def cve_is_about_system(cpe_type):
"""
Determines whether CVE is about system.
:param cpe_type: One of {'a', 'o', 'h'} = application, operating system,
hardware
:return: true if CVE is about system.
"""
return ('o' in ... |
#!/usr/bin/env python
# coding: utf-8
# # Introduction
# ## The Data Set
# In today's workshop, we will revisit the data set you worked with in the Machine Learning workshop. As a refresher: this data set is from the GSE53987 dataset on Bipolar disorder (BD) and major depressive disorder (MDD) and schizophrenia:
#
#... |
# emacs: -*- mode: python-mode; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
#
# See COPYING file distributed along with the NiBabel package for the
# copyright and license terms.
#
### ### ### #... |
from __future__ import print_function, division, unicode_literals
import os
import operator
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import numpy as np
from math import sqrt
from scipy.spatial import Delaunay, ConvexHull
from pymatgen.core.composition import Composition
from pymatgen... |
import pandas as pd
import numpy as np
import inspect
from copy import deepcopy
from matplotlib import pyplot as plt
from matplotlib import rcParams
from matplotlib.backends.backend_pdf import PdfPages
plt.style.use('bmh')
import RuleSet
import r_funcs as rf
import policy_tools as pt
import projection_funcs as pf
de... |
# -*- coding: utf-8 -*-
# Copyright (c) 2010-2012, <NAME>.
# See LICENSE for details.
"""
txpostgres is a library for accessing a PostgreSQL_ database from the Twisted_
framework. It builds upon asynchronous features of the Psycopg_ database
library, which in turn exposes the asynchronous features of libpq_, the
Postgr... |
import os
from typing import Dict, List, Optional, Tuple
import librosa
import librosa.display
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import plotly.express as px
import plotly.graph_objects as go
from src.dataset.utils import calc_stft, calc_triangle_center
from src.postprocess.metric ... |
from collections import defaultdict
import dash_html_components as html
import dash_core_components as core
from dash.dependencies import Input, Output, State
from ..dash_id import init_ids
from ..utility.plot_builder import *
from ..utility.table_builder import table_tabs_single_lane, cutoff_table_data_ius
from ..uti... |
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
import cv2
import torch
from torchvision import transforms as T
from maskrcnn_benchmark.modeling.detector import build_detection_model
from maskrcnn_benchmark.utils.checkpoint import DetectronCheckpointer
from maskrcnn_benchmark.structures.image_l... |
# Copyright (c) 2016, Xilinx, Inc.
# 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 con... |
"""
odeint.py
Methods for integration of Ordinary Differential Equations (ODEs). The code
is a translation from the C code in [1], chapter 17.
Author: <NAME>
References:
[1] Press, Flannery, Teukolsky, and Vetterling. Numerical Recipes.
Cambridge University Press, Cambridge UK.
"""
fr... |
# ------------------------------------------------------------------------------------------
# Shapley Lorenz Function
# ------------------------------------------------------------------------------------------
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from skle... |
'''Uniaxial extension of a bar.
The displacement measurements are a sequence of point-measurements. These
are projected using least-squares meshless on a continuous function space.
Measurements
------------
- Measured displacements on the top face.
- Measured reaction (tractions) on the right face.
Boundary conditio... |
"""
This is the IP Project made and programmed in collaboration by:
<NAME>, <NAME> and <NAME>
"YOUTUBE VIDEO DOWNLOADER"
Features:
1. Can download any youtube video from the URL
2. Can download the video in either 720p with 360p with Audio
3. Can download only the audio from a video.
4. Can download multiple selecte... |
import re
import time
import os.path
import urllib.parse
pat_special_command = re.compile('/([a-z0-9?_-]+)', flags=re.IGNORECASE)
pat_dest_command = re.compile('#([^ ]+)')
pat_integer = re.compile('[0-9]+')
pat_url = re.compile('http[s]?:.*', flags=re.IGNORECASE)
pat_channel_command = re.compile('^(?:([a-z0-9_-]+)[/... |
# See screenshots here: https://github.com/dmroeder/pylogix/issues/156
# This example allows reading either a single tag or multiple tags separated by semicolon (';').
# Single tag example: CT_2D_DINTArray[0,0] or CT_STRING or CT_BOOLArray[252].
# Multi tag example: CT_DINT; CT_REAL; CT_3D_DINTArray[0,3,1].
# I... |
import os, math
import time
import numpy as np
import pandas as pd
import geopy.distance
from concurrent.futures import ProcessPoolExecutor
'''
Input: "xxx.csv" with first column as "Date"
Output: the saved files for preprocessed datasets, i.e., "train/val/test_dataTime.npz" including:
- x
- ... |
# -*- coding: utf-8 -*-
"""
--------------------------------------------------------------
tests of orbit_cheby's base class
sifter/tests/test_orbit_cheby
Jan 2020
<NAME>
TODO: See ./README_tests.md ln. 8 concerning these possibly duplicate tests.
-----------------------------------------... |
"""
Cyto Module
============
This module performs organoid cytoarchitecture analysis
These include the following subcommands:
- mesh : compute surface mesh from segmentation
- profiles : compute profiles along surface normals
- sample : randomly sample profiles
- combine : combine cytoarchitecture fe... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import cv2
import numpy as np
import random
import math
import time
import copy
import _init_paths
from opts import opts
from utils.image import gaussian_radius, draw_umich_gaussian, draw_msra_gaussi... |
import asyncio
import os
import subprocess
import sys
import tempfile
import nanome
import numpy as np
import randomcolor
from nanome.api import shapes
from nanome.api.shapes import Shape
from nanome.util import Logs, enums
class MSMSInstance():
def __init__(self, plugin, complex):
self.__plugin = plugin... |
from dask.array.core import Array
import dask.array as da
from helpers import get_dataset, get_regex_images
import napari
import numpy as np
import os
import pandas as pd
from scipy.ndimage import label
from skimage import io
from skimage.feature import peak_local_max, blob_dog, blob_log
from skimage.filters import thr... |
import argparse
import numpy as np
import os
import statistics
import sys
import matplotlib.pyplot as plt
from matplotlib.patches import Patch
from matplotlib.lines import Line2D
from scipy import stats
from scipy.optimize import curve_fit
from lib.exporter.csv import CSVExporter as csvex
import logging
# Example:
# P... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# NEURAL CODES AND EMBEDDING ANALYZER
#
from ungol.common import logger
from ungol.common import embed as uce
from ungol.common.util import ts
import h5py
import attr
import torch
import numpy as np
import pandas as pd
from tqdm import tqdm as _tqdm
import gc
import... |
# --------------------------------------------------------------------
__all__ = ['PetscConfig',
'setup', 'Extension',
'config', 'build', 'build_src', 'build_ext',
'clean', 'test', 'sdist',
'log',
]
# --------------------------------------------------------------... |
# pylint: disable=redefined-outer-name, no-member
from copy import deepcopy
import numpy as np
import pytest
from numpy.testing import assert_allclose, assert_array_almost_equal, assert_array_equal
from scipy.stats import linregress
from xarray import DataArray, Dataset
from ...data import concat, convert_to_inferenc... |
from collections import Iterable
from math import log, ceil
from mathsat import msat_term, msat_env
from mathsat import msat_make_constant, msat_declare_function
from mathsat import msat_get_rational_type, msat_get_integer_type, \
msat_get_bool_type
from mathsat import msat_make_and, msat_make_not, msat_make_or, m... |
import numba
import numpy as np
#######################
# HELPFUL TOOLS BELOW #
#######################
@numba.njit(cache=True, fastmath=True) # Speeding up by a lot!
def unpack_alms(maps, lmax):
#print("Unpacking alms")
mmax = lmax
nmaps = len(maps)
# Nalms is length of target alms
Nalms = int(m... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.