text stringlengths 8.04k 46.5k |
|---|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import pytest
from pypinyin import (
pinyin, slug, lazy_pinyin, load_single_dict,
load_phrases_dict, NORMAL, TONE, TONE2, TONE3, INITIALS,
FIRST_LETTER, FINALS, FINALS_TONE, FINALS_TONE2, FINALS_TONE3,
BOPOMOFO, BOP... |
#!/usr/bin/python
# Script that uses katsdpcal's calprocs to reduce data consisting of offset tracks on multiple point sources.
#
from katsdpcal import calprocs
import pickle
import katdal
import numpy as np
import scikits.fitting as fit
import katpoint
import optparse
#TODO Remove this function once katdal has this ... |
from __future__ import print_function
import os
import re
import subprocess
import io
import threading
import shlex
import sys
import shutil
import filecmp
from optparse import OptionParser
import stat
import glob
import platform
import zipfile
from xml.dom.minidom import parse
import contextlib
def abort(msg):
"... |
# -*- coding: utf-8 -*-
"""
Created on Wed Aug 21 17:49:21 2013
@author: <NAME>
Minor edits by <NAME>
"""
import numpy as np
from matplotlib import pyplot as plt
#from mpl_toolkits.mplot3d import Axes3D
#import mpl_toolkits.mplot3d.art3d as art3d
from matplotlib.patches import Ellipse
from matplotlib i... |
import logging
from collections import Counter
import os
import pandas as pd
import numpy as np
import pwseqdist as pw
from tcrdist.rep_funcs import _pw, _pws
import scipy
from scipy.cluster.hierarchy import linkage, dendrogram, fcluster
from scipy.spatial.distance import squareform
from tcrdist.repertoire import TCR... |
import sys
import time
from pathlib import Path
from typing import Dict
from contextlib import contextmanager
from abc import ABC
from abc import abstractmethod
import humanfriendly as hf
import tensorflow as tf
import numpy as np
import tensorflow.contrib.slim as slim
from termcolor import colored
import common.tf_u... |
# Copyright 2021, <NAME>, mailto:<EMAIL>
#
# Part of "Nuitka", an optimizing Python compiler that is compatible and
# integrates with CPython, but also works on its own.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Lice... |
# Ravestate context class
from threading import Thread, Lock, Event
from typing import Optional, Any, Tuple, Set, Dict, Iterable, List
from collections import defaultdict
from math import ceil
from copy import deepcopy
import gc
from ravestate.wrappers import PropertyWrapper
from ravestate.icontext import IContext
fr... |
from scipy import stats
from collections import OrderedDict
from django.core.exceptions import SuspiciousOperation
from django.db import models
from django.utils import timezone
from rest_framework import serializers
from scipy import stats
import uuid
from perftracker.helpers import pt_float2human, pt_cut_common_sf... |
# -*- coding: utf-8 -*-
# Copyright (C) 2016, the Pyzo development team
#
# Pyzo is distributed under the terms of the 2-Clause BSD License.
# The full license can be found in 'license.txt'.
""" Module editor
Defines the PyzoEditor class which is used to edit documents.
This module/class also implements all the relat... |
from __future__ import unicode_literals, division, absolute_import
from builtins import * # noqa pylint: disable=unused-import, redefined-builtin
from future.moves.urllib.parse import urlparse
from future.utils import text_to_native_str
import os
import logging
import base64
import re
from datetime import datetime
fr... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import argparse
import os
import sys
py3 = sys.version_info.major == 3
def warn(msg):
print('[powerline-bash] ', msg)
if py3:
def unicode(x):
return x
class Powerline:
symbols = {
'compatible': {
... |
#!/usr/bin/env python3
import ssl
import sys
import re
import json
import os.path
import argparse
from time import time, sleep, localtime, strftime
from collections import OrderedDict
from colorama import init as colorama_init
from colorama import Fore, Back, Style
from configparser import ConfigParser
from unidecode ... |
from __future__ import division
from __future__ import print_function
from struct import unpack
import idaapi
import idautils
import idc
from PyQt5.Qt import QApplication
ACTION_CONVERT = ["lazyida:convert%d" % i for i in range(10)]
ACTION_SCANVUL = "lazyida:scanvul"
ACTION_COPYEA = "lazyida:copyea"
ACTION_GOTOCLIP =... |
import asyncio
import datetime
import re
from asyncio import CancelledError
import hashlib
import discord
import emoji
import time
from collections import deque
from discord import Object, Forbidden, NotFound, RawMessageDeleteEvent
from discord.channel import TextChannel
from discord.ext import commands
from discord... |
import warnings
import functools
from typing import Union, Optional, Callable, Tuple, Sequence
import torch
import numpy as np
from xitorch import LinearOperator
from scipy.sparse.linalg import gmres as scipy_gmres
from xitorch._impls.optimize.root.rootsolver import broyden1
from xitorch._utils.bcast import nor... |
import math
from decimal import Decimal, getcontext
import numpy as np
import scipy.sparse as sp
import scipy.sparse.linalg as LA
#
# Runge-Kutta IMEX methods of order 1 to 3
#
class rk_imex:
def __init__(self, M_fast, M_slow, order):
assert np.shape(M_fast)[0] == np.shape(M_fast)[1], "A_fast must be squ... |
import torch
import math
from abc import ABC
import torch.nn as nn
import torch.nn.functional as F
import core.utils as utils
import functools
import numpy as np
#################################
# Function
#################################
def define_inpaint_gen(hy, gpu_ids, init_type, init_gain):
inp... |
import pytest
from r2d7.cardlookup import CardLookup
from r2d7.core import UserError
from r2d7.slackdroid import SlackDroid
print_card_tests = (
('tacticalofficer', [
':crew: *<http://xwing-miniatures-second-edition.wikia.com/wiki/Tactical_Officer|Tactical Officer>* [6] [Hyperspace]',
'_Restricti... |
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2018
# <NAME> <<EMAIL>>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser Public License as published by
# the Free Software Foundation, either ... |
import logging
from datetime import datetime, timedelta, timezone
import hashlib
import boto3
from botocore.exceptions import ClientError
import geocoder
from geocoder.keys import mapbox_access_token
import pytz
from django.conf import settings
from django.contrib.gis.db.models import GeometryField
from django.contr... |
# based on DeepLTL: https://github.com/reactive-systems/deepltl
# pylint: disable=line-too-long
"""Parser for LTL formulas in different notations"""
from enum import Enum
import re
import random
from functools import reduce, total_ordering
import operator
import sympy as sy
import sympy.logic as syl
# Regular expre... |
'''
@brief: introduct hiearchical structure in the model
@author: <NAME>
'''
import init_path
import numpy as np
import random
from copy import deepcopy
import lxml.etree as etree
# local import
from env import model_gen
from env import model_perturb
from util import model_gen_util
from util import logger
fr... |
"""
Copyright 2021 Nirlep_5252_
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
d... |
"""
TensorFlow policy class used for SAC.
"""
import copy
import gym
from gym.spaces import Box, Discrete
from functools import partial
import logging
from typing import Dict, List, Optional, Tuple, Type, Union
import ray
import ray.experimental.tf_utils
from ray.rllib.algorithms.ddpg.ddpg_tf_policy import (
Comp... |
from collections import OrderedDict
import torch
import torch.nn as nn
import torch.nn.functional as F
'''
Copyright (c) 2020 <NAME> (<EMAIL>)
'''
'''
# --------------------------------------------
# Advanced nn.Sequential
# https://github.com/xinntao/BasicSR
# --------------------------------------------
'''
def s... |
import subprocess
import numpy as np
import lmfit as lm
import scipy.special as sp
import scipy.constants as cs
from astropy.stats import jackknife_resampling
import nmrglue as ng
import ast
import pandas as pd
from more_itertools import pairwise
import statistics as st
def tedor_ideal(t_mix, a, dist, t2, j_cc, obs='... |
# Copyright (C) 2020 Arm Limited or its affiliates. All rights reserved.
#
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the License); you may
# not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# www.apache.org/licenses/LICE... |
#!/usr/bin/python
import sys
import os
sys.path.append(os.path.join(os.path.dirname(sys.argv[0]), "../python-libs"))
import pytoml as toml
import logging
import argparse
import re
#import pydotplus.graphviz as pydot
import pydot
import shutil
# from mako.template import Template
# mytemplate = Template("hello, ${name}... |
from pycocotools.coco import COCO
import numpy as np
import skimage.io as io
import matplotlib.pyplot as plt
import pylab
import cv2
import math
# import Polygon as plg
# from tqdm import tqdm
from pycocotools.coco import COCO
from .custom import CustomDataset
from .custompolarmask import CustomDatasetpolarmask
from ... |
# Copyright 2015 Citrix Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... |
#!/usr/bin/env python3
# pylint: disable=too-few-public-methods, missing-docstring
from __future__ import division, print_function
import argparse
import datetime
import json
import logging
import os
import re
import sqlite3
import subprocess
import sys
import time
__version__ = '0.9.2.dev'
LOG = logging.getLogger... |
#!/usr/bin/python3
from names import Names
from addresses import Addresses
from emails import Emails
from rand import Rand
from dates import Dates
import sys
import json
import datetime
# Set this to True to add " TEST" to the end of person names
add_test_to_names = True
# -----------------------------------------
i... |
import argparse
import itertools
import json
import sys
from collections.abc import Iterable
from dataclasses import dataclass
from typing import List, Dict, Union, Any, Optional, Set
from colorama import init
from cyclonedx.model.bom import Bom, Tool
from cyclonedx.model.component import Component
from cyclonedx.mode... |
import numpy as np
from numpy.linalg import norm
from functools import lru_cache
from tqdm import tqdm
from scipy.optimize import linprog
from sklearn.metrics import accuracy_score, f1_score
import matplotlib
import matplotlib.pyplot as plt
matplotlib.rcParams.update({'errorbar.capsize': 2})
def sq(a):
return np.... |
"""
A simplified git implementation based on "write yourself a git"
https://wyag.thb.lt/
"""
import argparse
import collections
import configparser
import hashlib
import os
import re
import sys
import zlib
from typing import Optional, BinaryIO, cast, Tuple, List
argparser = argparse.ArgumentParser(description="Simpli... |
# -*- coding: utf-8 -*-
"""
Provides the Client class
"""
from __future__ import (unicode_literals, print_function, division)
import re
from os import getpid
import uuid
import functools
import logging
import pkgutil
from pprint import pformat
import qalib.corelibs.system
from qalib.client.multipath import Multipath
... |
# Copyright 2022 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... |
import tensorflow as tf
import numpy as np
from keras.engine import data_adapter
from matplotlib import cm
def colorize_img(value, vmin=None, vmax=None, cmap='jet'):
"""
A utility function for TensorFlow that maps a grayscale image to a matplotlib colormap for use with TensorBoard image summaries.
By defa... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# =============================================================================
## @file ostap/frames/frames.py
# Module with decoration of TDataFrame objects for efficient use in python
# @author <NAME> <EMAIL>
# @date 2018-06-16
# ====================================... |
import os
import re
import sys
import time
from unittest.mock import MagicMock
from collections import defaultdict, Counter
from pathlib import Path
import subprocess
import tempfile
import pytest
import ray
from ray.cross_language import java_actor_class
from ray import ray_constants
from ray._private.test_utils imp... |
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2019 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this ... |
#!/usr/bin/env python
"""cflib.main
===============
This library contains functions that are used by PoMo.
"""
import argparse
import random
from scipy.misc import comb as choose
import cflib as lp
import os
import pdb
import time
# define PoMo10 states
codons = ["aaa", "aac", "aag", "aat", "aca", "acc", "acg", "... |
import tkinter as tk
from tkinter import filedialog
from tkinter import *
import tkinter.ttk as ttk
from tkinter.scrolledtext import ScrolledText
import PIL
from PIL import Image, ImageTk
import cv2
from functools import partial
import json
import math
import numpy as np
import os
import scipy
import sys
import time
i... |
import os
import csv
import math
import copy
import numpy as np
from annogesiclib.gff3 import Gff3Parser
from annogesiclib.helper import Helper
from annogesiclib.coverage_detection import coverage_comparison
from annogesiclib.coverage_detection import replicate_comparison
from annogesiclib.lib_reader import read_wig, r... |
import torch
import pytest
import numpy as np
from greattunes import TuneSession
from scipy.stats import multivariate_normal
@pytest.mark.parametrize(
"max_iter, max_response, error_lim, model_type",
[
[10, 4.81856, 5e-2, "SingleTaskGP"],
[50, 6.02073, 1e-3, "SingleTaskGP"],
[50, 5.997... |
# Copyright 2018 The TensorFlow Probability Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... |
# -*- coding: utf-8 -*-
"""
@author: <NAME>
@email: <EMAIL>
@time: 8/13/21 5:44 PM
"""
import copy
import glob
import os
# import glob
import shutil
import numpy as np
import json
import threading
import open3d as o3
import transforms3d as t3d
from vis import draw_registration_result
class Dataset:
def __init_... |
# Copyright The OpenTelemetry Authors
# Copyright <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 l... |
#!/opt/anaconda2/bin/python
# -*- coding: utf-8 -*-
"""
################################################################################
#
# Copyright (c) 2016 <NAME>
# All rights reserved
# Distributed under the terms of the MIT license
#
############################################################################... |
# None of this is django-specific. Don't import from django.
import os
import sys
import contextlib
import subprocess
import getpass
import logging
from os.path import commonprefix
# try both the python 2 and 3 import to avoid six dependency or django import
try:
from urllib import quote
except ImportError:
... |
# Load and dump a CAN database in DBC format.
from collections import OrderedDict
import pyparsing
from pyparsing import Word
from pyparsing import Literal
from pyparsing import Keyword
from pyparsing import Optional
from pyparsing import Suppress
from pyparsing import Group
from pyparsing import StringEnd
from pypars... |
#!/usr/bin/env python
# ----------------------------------------------------------------------------
# Copyright (c) 2013--, scikit-bio development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
# ---------------------... |
import argparse
import json
import os
import time
from jsonpath import jsonpath
import smartBugs
from src.interface.cli import create_parser_with_args
class Issue:
def __init__(self, issue_type: int, name: str):
self.issue_type = issue_type
self.name = name
class AnalysisResult:
def __init... |
import pandas as pd
import os
import sys
import warnings as w
from VESIcal import core
from VESIcal import sample_class
# Turn off chained assignment pandas warning
pd.options.mode.chained_assignment = None # default='warn'
def rename_duplicates(df, suffix='-duplicate-'):
appendents = (suffix +
... |
"""This module implements a class that..."""
from __future__ import print_function, unicode_literals
from __future__ import division
from builtins import str
from past.utils import old_div
from builtins import object
import codecs
import logging
from math import floor, ceil
import os
import numpy
import skimage.measu... |
"""
Drag and Drop
==============
This adds a drag and drop functionality to layouts and widgets. There are 2
primary and one internal component used to have drag and drop:
* The :class:`DraggableObjectBehavior`. Each widget that can be dragged needs
to inherit from this. It has :attr:`DraggableObjectBehavior.drag_cls... |
"""
Define the classes
Parameters - dimensional and dimensionless parameters in the model
Scales - scales for nondimensionalisation
Grid - information regarding the grid
"""
import numpy as np
import pdb
class Parameters:
"""A class to store the parameters in the model"""
def __init__(self, fit=N... |
"""
open-dobot driver.
Implements driver to open firmware that controls Dobot FPGA.
Abstracts communication protocol, CCITT CRC and commands sent to FPGA.
Find firmware and SDK at https://github.com/maxosprojects/open-dobot
Author: maxosprojects (March 18 2016)
Additional Authors: <put your name here>
Version: 1.2.2... |
from __future__ import print_function
import sys
import argparse
import os
import shutil
import time
import random
import numpy as np
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.nn.functional as F
import torch.backends.cudnn as cudnn
import torch.distributed as dist
import torch.optim as ... |
import turtle
import random
import time
import winsound
wn = turtle.Screen() # Main window where the game is evolved
wn.bgcolor("black")
Pilot = wn.textinput("Welcome Player!!", "Please write your name in the space below:").capitalize()
if Pilot == '':
Pilot = 'Pilot'
if "ς" in Pilot and Pilot[-2... |
import os
import time
import torch
import numpy as np
from torch.autograd import Variable
import scipy
import cv2
import glob
import random
import math
def visual_img(img, folder = 'temp',name="0.png"):
scipy.misc.imsave(os.path.join(folder,name),img)
def visual_kp_in_img(img, kp, size = 4, folder = 'temp', name ... |
#!../../../../virtualenv/bin/python3
# -*- coding: utf-8 -*-
# NB: The shebang line above assumes you've installed a python virtual environment alongside your working copy of the
# <4most-4gp-scripts> git repository. It also only works if you invoke this python script from the directory where it
# is located. If these... |
# Copyright (c) 2020, 2021, NECSTLab, Politecnico di Milano. All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# * Redistributions of source code must retain the above copyright
# notice, t... |
import glob, math, cv2
import numpy as np
from scipy import misc
from scipy import linalg
EPS = 1e-6
XMIN = -32 # right (neg is left)
XMAX = 32.0 # right
YMIN = -16.0 # down (neg is up)
YMAX = 16.0 # down
ZMIN = -32 # forward
ZMAX = 32 # forward
def print_stats(name, tensor):
print('%s min = %.2f, m... |
# -*- coding: utf-8 -*-
"""
Set of helper functions that make it easier to manipulate
and work with subclasses defined in **components** module
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import numpy as np
import math
import gdspy
TOL = 1e-6
CURRENT_CELLS = {}
CURRENT_CELL... |
#!/usr/bin/env python3
#
# bspwm.py
#
# (c) 2016 <NAME>
import gi
import os
import re
import sys
import json
import select
import socket
import _thread
import netifaces
import subprocess
gi.require_version('Notify', '0.7')
from gi.repository import Notify
import utils
I3STATUS_PATH = '/opt/i3status/i3status'
I3... |
from django.contrib.auth.models import User
from .models import QSUBJECT, CNAME, BTUTOR, Edit_User,TUTOR_HOME, QUESTION
from django.shortcuts import render, redirect, get_object_or_404
from django.contrib.auth.decorators import login_required
from django.urls import reverse_lazy
from django.views.generic.edit import Up... |
#!/usr/bin/env python3
############################################################
## <NAME> ##
## Copyright (C) 2019-2020 <NAME> Lab, IGTP, Spain ##
############################################################
"""
Create miRNA analysis using sRNAbenchtoolbox and miRTop.
"""
##... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2018/9/23 2:52
# @Author : {ZM7}
# @File : utils.py
# @Software: PyCharm
#Adapted from https://github.com/CRIPAC-DIG/SR-GNN/tree/master/tensorflow_code and from https://github.com/rn5l/session-rec
#to work as a baseline for CHAMELEON
import tensorflow as tf
imp... |
from . import Mag
from . import MagUtils
import SimPEG.PF as PF
from SimPEG.Utils import mkvc
from scipy.constants import mu_0
from matplotlib import pyplot as plt
import matplotlib.gridspec as gridspec
import numpy as np
import ipywidgets as widgets
from mpl_toolkits.mplot3d import Axes3D
from mpl_toolkits.mplot3d.art... |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import os
import glob
import json
import torch
import random
import numpy as np
from torch.utils.data import Dataset
from data.transforms import orbit_transform
class ORBITDataset(Dataset):
"""
Base class for ORBIT dataset.
"""
d... |
"""
Prepare data for Part-GPNN model.
Need:
Node feature at different scales
Edge feature for valid edges
Adjacency matrix GT (parse graph GT)
Edge weight (corresponds to node level)
Edge label GT
"""
import json
import os
import pickle
import warnings
from collections import defaultdict
import matplotlib.pyplot as... |
from canvasapi import Canvas
from canvasapi.course import Course
from canvasapi.requester import Requester
import click
from collections import defaultdict, namedtuple
from configparser import ConfigParser
import datetime
import functools
import glob
import logging
from html.parser import HTMLParser
import os
import re... |
"""This is a python port of <NAME>'s msslib.
The original msslib can be found here: https://github.com/gee-community/msslib
This port was written by <NAME> in December 2021.
The intent of the original msslib is "to make it easy to work with Landsat MSS
data in Earth Engine." The intent of this port to python is to ma... |
import sys
from multiprocessing import Process, Array
import os
import time
import numpy as np
from startup import DisplayLogoLicense, CheckDependencies, Usage
DEBUG = 0
QUIET = 0
class RNAProfiler():
"""
RNAProfiler class: Contains all the information required to perform a round of Pattern matching
"""
def __in... |
__all__ = ['biblio_parser',
'build_institutions_dic',
'build_title_keywords',
'check_and_drop_columns',
'country_normalization',
'extend_author_institutions',
'getting_secondary_inst_list',
'merge_database',
'name_normalizer',
... |
import re
import uuid
import rdflib
nif_ns = rdflib.namespace.ClosedNamespace(
uri='http://persistence.uni-leipzig.org/nlp2rdf/ontologies/nif-core#',
terms=[
# Classes
"Phrase", "NormalizedContextOccurrence", "Structure",
"CollectionOccurrence", "NormalizedCollectionOccurrence",
... |
#!/usr/bin/env python3
# https://www.python.org/dev/peps/pep-0343/#transition-plan
from __future__ import with_statement
import calendar
import ctypes
import datetime
import decimal
import glob
import os
import string
import struct
import subprocess
import sys
import time
try:
# https://docs.python.org/3.0/whatsn... |
import numpy as np
import copy
import random
import math
import pdb
# Example solved and checked UCS cost < 1 at 100 m
# REVERSE HISTORY: (0.017000000000000008, [(None, 0), (2.0, 0.001), (2.0, 0.001), (2.0, 0.001), (2.0, 0.001), (1.0, 0.001), (2.0, 0.001), (2.0, 0.001), (2.0, 0.001), (2.0, 0.001), (2.0, 0.001), (2.0,... |
#!/usr/bin/env python
"""
Created on Mon Jun 15 21:49:32 2015
@author: <NAME>
"""
import sys, os, glob, textwrap, itertools
from optparse import OptionParser
from collections import defaultdict
from os.path import splitext
from pdbx.reader.PdbxReader import PdbxReader
from multiprocessing import Pool
DEBUG_MODE = F... |
import math
import logging
import numpy
import tensorflow as tf
from constants import DataType
class ModelUpdater(object):
"""Helper class for training using multiple GPUs and/or large minibatches.
Given a set of model replicas and an optimizer, ModelUpdater takes care of
splitting minibatches into sub-b... |
"""Manage images.
We make an important design decision: Importing images requires root
privilege; unlike rkt, which does not. We make this decision for the
simplicity of implementation. To not require root privilege, rkt has to
split import into two steps:
* The first step, the ``fetch`` command, merely copies a ta... |
import base64
import os
import dash
from dash.dependencies import Input, Output, State
import dash_core_components as dcc
import dash_html_components as html
import dash_daq as daq
from dash_bio_utils import gene_expression_reader
import dash_bio
try:
from layout_helper import run_standalone_app
except ModuleNot... |
import numpy as np
#TODO setup JAX instead of numpy
#initial trials showed no real improvement, but I remain optimstic
#from jax.config import config
#config.update("jax_enable_x64", True)
#from jax import numpy as np
# from jax import jit
from scipy.integrate import odeint
import matplotlib.pyplot as plt
z0 = np.arr... |
import torch
import random
from addict import Dict
from evocraftsearch import Explorer
from evocraftsearch.explorers import IMGEP_OGL_Explorer
from evocraftsearch.spaces import BoxSpace, DictSpace
from evocraftsearch.utils import sample_value, map_nested_dicts, map_nested_dicts_modify, map_nested_dicts_modify_with_othe... |
#!/usr/bin/env python
# Functions for ICA-AROMA v0.3 beta
from __future__ import division
from __future__ import print_function
from future import standard_library
standard_library.install_aliases()
from builtins import str
from builtins import range
from past.utils import old_div
def runICA(fslDir, inFile... |
# Copyright 2017 University of Maryland.
#
# This file is part of Sesame. It is subject to the license terms in the file
# LICENSE.rst found in the top-level directory of this distribution.
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
from PyQt5.QtCore import *
import os
from ast import literal_eval as ev... |
# -*- coding: utf-8 -*-
import contextlib
import functools
import logging
import os
import re
import threading
import time
from selenium.common.exceptions import NoAlertPresentException
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver import ActionChains
from selenium.webdriver.rem... |
# Copyright: (c) 2020, <NAME> (@jborean93) <<EMAIL>>
# MIT License (see LICENSE or https://opensource.org/licenses/MIT)
import base64
import logging
import sys
import typing
from spnego._context import (
ContextProxy,
ContextReq,
GSSMech,
IOVUnwrapResult,
IOVWrapResult,
UnwrapRes... |
import numpy as np
from datetime import datetime
cnn_layer_types = ["CONV", "MAXPOOL"]
# ( layer type , x_length , y_length , zero_padding, no of mask ) zero_padding and no of mask not applicable for MAXPOOL
cnn_layer_info = []
ndelst = inpt_dim = [] # contains the node numbers in FC layer
mask_depth = [] # contains... |
# IMPORTS
from random import randint
from turtle import *
from math import sqrt
from time import sleep
import sys, os
print("Game design credit goes to Google.")
#os.system("TASKKILL /F /IM explorer.exe")
# Check if module is being imported or not
if __name__ == "__main__":
pass # If not being im... |
#!/usr/bin/env python
rom = bytearray(open("baserom.gbc", "rb").read())
sfx_names_1 = [
"Noise_Instrument01_1",
"Noise_Instrument02_1",
"Noise_Instrument03_1",
"Noise_Instrument04_1",
"Noise_Instrument05_1",
"Noise_Instrument06_1",
"Noise_Instrument07_1",
"Noise_Instrument08_1",
"Noise_Instrument09_1",
"Noi... |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... |
import numpy as np
import torch
PI = 3.14159
def encode_label_iou_box(dims, locs):
l, h, w = dims[0], dims[1], dims[2]
x, y, z = locs[0], locs[1], locs[2]
x_corners = [0, l, l, l, l, 0, 0, 0]
y_corners = [0, 0, h, h, 0, 0, h, h]
z_corners = [0, 0, 0, w, w, w, w, 0]
x_corners += - np.float3... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Provide constants and composite types for binding with ctypes.
"""
from __future__ import absolute_import
import ctypes
import ctypes.util
import os
from .utils import coerce_char_p, python_2_unicode_compatible, read_ejdb_config
JDBIDKEYNAME = '_id'
# enum { /** Da... |
# ----------------------------------------------------------------------------
# Copyright (c) 2020, <NAME>.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# -----------------------------------------------------------------------... |
'''
An example of embedding CEF browser in the Kivy framework.
The browser is embedded using off-screen rendering mode.
Tested using Kivy 1.7.2 stable on Ubuntu 12.04 64-bit.
In this example kivy-lang is used to declare the layout which
contains two buttons (back, forward) and the browser view.
'''
from kivy.app imp... |
# -*- coding: utf-8 -*-
"""
Created on Tuesday, May 22, 2019
Author: <NAME> (<EMAIL>)
"""
#
import numpy as np
from scipy import interpolate, optimize
gravity = 9.8076
Rstar = 8.31446261815324
P0 = 100000. # Standard Pressure [Pa]
T0 = 273.15 # Standard Temperature [K]
#
# Based on Park et al (2004) Met... |
#!/usr/bin/env python
# encoding=utf-8
# Author: <NAME>(Simon)
# E-mail: <EMAIL>
'''
Target: enable every func in http://tool.chinaz.com/Tools/subnetmask
'''
from optparse import OptionParser
import sys
addzero= lambda x : ( x not in "10" ) and '0' or x
def ip2network_address(ip='192.168.1.0', cidr='32'):
"""
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.