text stringlengths 6.04k 39.5k |
|---|
import warnings
from itertools import product
from numbers import Real
from typing import Dict, List, Set, Tuple, Union
import numpy as np
import pandas as pd
from gbd_mapping import (
Cause,
ModelableEntity,
RiskFactor,
causes,
covariates,
risk_factors,
)
from vivarium.framework.artifact impor... |
# ----------------------------------------------------------------------------#
# Imports
# ----------------------------------------------------------------------------#
import json
import dateutil.parser
import babel
from flask import Flask, render_template, request, Response, flash, redirect, url_for, abort
from fla... |
# coding: utf-8
'''
@license: Apache License, Version 2.0
@copyright: 2007-2013 <NAME>
@author: <NAME>
'''
## Django imports
from django.utils.timezone import now
## MAGE imports
from MAGE.exceptions import MageError
from ref.models import ConventionCounter, Environment, ComponentInstanceField, Project, I... |
#!/usr/bin/python2
from __future__ import absolute_import, division, print_function
import gui_elements as gui
import thread
import wx
import evora.common.utils.fits as fits_utils
import evora.common.utils.logs as log_utils
class ScriptStatus(wx.Panel):
def __init__(self, parent):
wx.Panel.__init__(sel... |
import numpy as np
from itertools import product
import depthai as dai
from math import gcd
from pathlib import Path
from FPS import FPS, now
import cv2
import os, sys, re
SCRIPT_DIR = Path(__file__).resolve().parent
DEFAULT_YUNET_MODEL = str(SCRIPT_DIR / "models/face_detection_yunet_180x320_sh4.blob")
def find_isp_... |
#!/usr/bin/env python3
# MIT License
#
# Copyright (c) 2020 FABRIC Testbed
#
# 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 ... |
import os
from shardingpy.parsing.parser.context.selectitem import AggregationSelectItem
from shardingpy.parsing.parser.sql.dql.select import SelectStatement
from shardingpy.parsing.parser.token import *
from tests.parsing.sql import SQLCaseType, get_supported_sql
from .parsers import ALL_PARSER_RESULT_SET
def get_p... |
from __future__ import division
from collections import OrderedDict
from functools import partial
import gzip
import io
import os
import logging
import os.path
import h5py
import numpy
from picklable_itertools.extras import equizip
from progressbar import ProgressBar
from PIL import Image
from scipy.io.matlab import l... |
from __future__ import (absolute_import, division, print_function, unicode_literals)
from builtins import *
from future.utils import PY2
import os
import sys
from fractions import Fraction
import decimal
import string
__all__ = ['Quantity', 'formatter', 'short_formatter']
if PY2:
def is_string(ss):
impor... |
import logging
import sys
import json
from typing import Any, Optional, Tuple
from reconcile import queries
from reconcile.utils import aws_api
from reconcile.utils import ocm
from reconcile.utils.aws_api import AWSApi
from reconcile.utils.ocm import OCM, OCMMap
import reconcile.utils.terraform_client as terraform
imp... |
from typing import Any, Dict, Iterator, List, Optional, Union
from itertools import chain
from pathlib import Path
import os
import re
from IPython.display import HTML
from pandas import DataFrame, Series
import lunchbox.tools as lbt
import networkx
import numpy as np
from rolling_pin.radon_etl import RadonETL
impor... |
from builtins import zip
from . import (get_explicit_k_path as _raw_explicit_path, get_path as
_raw_get_path)
DEPRECATION_DOCS_URL = "http://seekpath.readthedocs.io/en/latest/maindoc.html#aiida-integration"
def _aiida_to_tuple(aiida_structure):
"""
Convert an AiiDA structure to a tuple of the ... |
#!/usr/bin/env python
# This file is subject to the terms and conditions defined in file 'LICENSE.txt', which is part of this source code package.
# Check to see if an Office doc has had its compressed VBA source code stomped.
import argparse
import sys
import subprocess
import os
import zipfile
import time
import o... |
"""
We try to determine if it is harder for a NN to learn from
"""
from __future__ import print_function
import argparse
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torchvision import datasets, transforms
from torch.optim.lr_scheduler import StepLR
from torch... |
# ----------------------------------------------------------------------------
# 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:
#
# * Redistributions of ... |
#!/usr/bin/env python3
#<NAME>, 22-MAR-2018
#this command can run multiple times for a stack
#example command
#../../code/s1_select_ion.py -dir . -sn 34/38.5 -nr 5
import os
import sys
import glob
import shutil
import zipfile
import argparse
import datetime
import numpy as np
import xml.etree.ElementTree as ET
cla... |
# Python standard library
from operator import eq, ge, gt, le, lt, ne
from typing import Any, Dict, Iterator, List, Optional, Tuple, Union
# 3rd party library imports
# Rosetta library imports
from pyrosetta.distributed.packed_pose.core import PackedPose
from pyrosetta.distributed import requires_init
from pyrosetta.r... |
from ebml.base import EBMLInteger, EBMLData, EBMLString, EBMLMasterElement, EBMLFloat, EBMLList, EBMLProperty
import random
class PrimaryRChromaticityX(EBMLFloat):
ebmlID = b"\x55\xd1"
class PrimaryRChromaticityY(EBMLFloat):
ebmlID = b"\x55\xd2"
class PrimaryGChromaticityX(EBMLFloat):
ebmlID = b"\x55\xd3... |
#!/usr/bin/env python3
# This file is Copyright (c) 2015-2019 <NAME> <<EMAIL>>
# This file is Copyright (c) 2015 <NAME> <<EMAIL>>
# This file is Copyright (c) 2016 whitequark <<EMAIL>>
# License: BSD
import sys
import signal
import os
import time
import serial
import threading
import argparse
import json
if sys.pla... |
import math
import numpy as np
from scipy import special as ss
from scipy.optimize import curve_fit
import param
from holoviews import OrderedDict
from holoviews import Curve, ItemTable, Operation
#====================================#
# Spatial constant conversion methods
#====================================#
d... |
import numpy as np
# import torch
from PIL import Image
import matplotlib.pyplot as plt
from functools import reduce
A = np.identity(4)
A
P = np.array([[1, 0, 0, 0], [0, 0, 1, 0], [0, 1, 0, 0], [0, 0, 0, 1]])
P
Q = np.array([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 0, 1], [0, 0, 1, 0]])
Q
B = np.arange(16).reshape((4,... |
"""Usage:
run.py [-h|--help] [-c <config>] [options]
Options:
-h --help Show help
-c --config <config> Which named configuration to run.
--no-dropout Don't use dropout
--summarize Summarize results and store them
--layers <layer_sizes> List of siz... |
# Implementation of all commands the Machinekit workbench registers with FreeCAD.
#
# Special attention should be given to MachinekitCommandCenter. Integrating MK with FC
# turned out to be a bit arkward because the existence and communication with MK is entirely
# outside FC's control, which is not what the FC inf... |
# ================================================================================
# Copyright (c) 2017-2020 AT&T Intellectual Property. All rights reserved.
# ================================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not... |
#!/usr/bin/env python3
import sys, os
import argparse
import numpy as np
import pandas as pd
import tinydb as db
import json
import matplotlib.pyplot as plt
import itertools as it
from time import process_time
from scipy.stats import mode
from scipy.optimize import curve_fit
from scipy.optimize import minimize
from p... |
from __future__ import absolute_import, print_function
from .version import __version__
import time
import string
import sys
import os
import json
from ast import literal_eval
from appdirs import user_config_dir
from functools import partial
from .func_sigs import map_args_to_func_sig, repl_func_defaults
from .func... |
__copyright__ = "Copyright (C) 2013 <NAME>"
__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 restriction, including without limitation the rights
to use, copy, modify, mer... |
import nibabel as ni
from nilearn import image
import numpy as np
import sys
import os
from subprocess import call
from scipy import ndimage
import shutil
def getinputs():
inputs = sys.argv
inputs.pop(0) # remove first arg (name of file)
t1 = '' # T1w image
t2 = '' # T2w image
m = '' # lesion (... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
""" Module to I/O the data """
import os
import re
import warnings
from glob import glob
from astropy.io.fits import getheader, getval
from astropy.time import Time
REDUXPATH = os.getenv('SEDMREDUXPATH',default="~/redux/")
_PACKAGE_ROOT = os.path.abspath(os.path.dirnam... |
#!/usr/bin/env python3
#
# Copyright 2015 Google Inc. 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... |
#!/usr/bin/env python3
# -*- coding:utf-8 -*-
# Copyright (c) Megvii, Inc. and its affiliates.
import argparse
import os
import os.path
from os import path
import time
from loguru import logger
import importlib
import sys
import cv2
import numpy as np
import torch
from tabulate import tabulate
from yolox.data.data... |
from __future__ import annotations
from typing import Tuple, Dict, List, Union
import struct
import numpy
import amulet_nbt
from amulet.api.block import Block
from amulet.api.chunk import Chunk
from amulet.utils.world_utils import get_smallest_dtype
from amulet.world_interface.chunk.interfaces import Interface
from ... |
import requests
from itertools import product
from tqdm.notebook import tqdm
import numpy as np
from seaborn import color_palette
from shapely.geometry import box
from shapely import affinity
import matplotlib.pyplot as plt
from matplotlib.patches import Polygon
from skimage import color, exposure
from renderapi.rend... |
import xnet
import glob
import math
import matplotlib
import concurrent.futures
import numpy as np
import matplotlib.pyplot as plt
from igraph import *
from collections import defaultdict
from util import get_valid_pp
from util import filter_pp_name
def calculate_dist(filenames):
for filename in filenames:
# pri... |
# Example program to save several sensor data including bounding box
# Sensors: RGB Camera (+BoundingBox), De[th Camera, Segmentation Camera, Lidar Camera
# By <NAME>
# 2020
# Last tested on CARLA 0.9.10.1
# CARLA Simulator is licensed under the terms of the MIT license
# For a copy, see <https://opensource.org... |
import pandas as pd
import numpy as np
from itertools import product
import datarail.experimental_design.edge_fingerprint as edge_fingerprint
import warnings
def get_boundary_cell_count(plate_dims, exclude_outer=1):
"""Get number of wells in outer or inner edges
Parameters
----------
plate_dims : arr... |
# coding: utf-8
from zeit.connector.resource import Resource
from zeit.importer.article import Article
from zeit.importer.highres import ImageHash
from zeit.importer.interfaces import DOC_NS, PRINT_NS
import datetime
import io
import logging
import logging.config
import lxml.etree
import optparse
import os
import pkg_r... |
import discord
import sys
import random
import hashlib
import time
import requests
import asyncio
import math
import re
from typing import NamedTuple
from discord.ext import commands
TOKEN, KEY, SECRET, GROUP_LINK = None, None, None, None
def setup(bot):
print('Admin_extension se loada.')
wit... |
#!/usr/bin/env python
#-*-coding:utf8-*-
#this script is aimed to aggregate SNPs into haplotype blocks to get BAF matrices within each cell.
#Author: <NAME>
# TODO: output region file to out_dir
import os
import sys
import getopt
import gzip
from ..utils.base import assert_e, assert_n, log
from ..utils.region import... |
"""
TODO: add option to remove a specific package from abaqus environment
TODO: add support for 'install_requires' in local package setup files --> search for packages in conda
TODO: add option to sync packages from abaqus to conda environment
TODO: only for abaqus 2017 and 2018; add capability for earlier versions
"""... |
import pathlib
import sys
sys.path.append(str(pathlib.Path(__file__).parent.parent.absolute()))
import itertools
import logging
import math
import os
from collections import OrderedDict
import torch
from torch import nn, optim
from torch.nn.parallel.data_parallel import DataParallel
from torch.nn.parallel import Dis... |
# -*- coding: utf-8 -*-
"""
==================================================================================
"""
import sys
from pprint import pprint
from rdflib import RDF, URIRef, Variable
from rdflib.util import first
from rdflib.store import Store
from rdflib.plugins.stores.regexmatching import NATIVE_REGEX
# fr... |
# (c) British Crown Copyright 2020, the Met Office.
# 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,
# this list o... |
#!/usr/bin/env python3
from io import BytesIO
from pprint import pformat
from typing import BinaryIO, Any, Callable, List, Dict
from struct import pack, unpack, calcsize
from enum import Enum
try:
from deepdiff import DeepDiff
except ImportError:
DeepDiff = None
# define APP_UUID "115fc8b7-8b73-425a-883b-57fc0... |
import numpy as np
from enum import IntEnum
from numba import int64, float64, boolean
from numba import njit
from numba.experimental import jitclass
import math
from tardis.montecarlo.montecarlo_numba import njit_dict, numba_config , njit_dict_no_parallel
from tardis.montecarlo import (
montecarlo_configuration as... |
# coding: utf-8
# ## Imports and helper functions
from IPython.core.debugger import set_trace
import sys
import os, sys, inspect
import os
import numpy as np
import h5py
import scipy.sparse.linalg as la
import scipy.sparse as sp
import scipy
import time
import pyflann
import re
import math
import itertools as it
fro... |
from deuces import Card, evaluator
import itertools
from math import floor
import random
from collections import defaultdict, Counter
import networkx as nx
import Levenshtein as lev
import re
import elo_tourney
import hands_rank_sim
ev = evaluator.Evaluator()
player_ranks = {}
players_comb = {}
class Deck:
def... |
import jsonschema
import pytest
from barrage import config, defaults as d
def test_merge_defaults_dataset():
cfg = {}
result = config._merge_defaults(cfg.copy())
assert isinstance(result, dict)
assert result["dataset"]["transformer"] == d.TRANSFORMER
assert result["dataset"]["augmentor"] == d.AU... |
import copy
import sys
import os
import eventlet
import socketio
import pathlib
from .player import Player
from .room import Room
from .table import Table
from .ai import AI
import time
import random
import string
import math
roomList = []
sio = socketio.Server()
app = socketio.WSGIApp(sio)
@sio.event
def connect(... |
# Copyright (c) 2014 GigaSpaces Technologies Ltd. All rights reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... |
# %load runDM.py
"""
runDM version 1.0 [Python implementation]
Calculate low energy DM-SM couplings from high energy couplings,
taking into account RG evolution due to SM loops. See
arXiv:1605.04917 for further details.
Please contact <NAME> (<EMAIL>) for any questions,
problems, bugs and suggestions.
"""
from __futu... |
# System libs
import os
import random
import time
# Numerical libs
import torch
import torch.nn.functional as F
import numpy as np
from tensorboardX import SummaryWriter
# Our libs
from arguments import ArgParser
from dataset import MUSICMixDataset
from models import ModelBuilder, activate
from utils import AverageMe... |
###############################################################################
#
# Package: NetMsgs
#
# File: NetMsgsBase.py
#
"""
NetMsgs Base Data Module
"""
## \file
## \package NetMsgs.NetMsgsBase
##
## $LastChangedDate: 2012-07-23 14:06:10 -0600 (Mon, 23 Jul 2012) $
## $Rev: 2098 $
##
## \brief NetMsgs Base ... |
from selenium import webdriver
from selenium.common.exceptions import TimeoutException
from selenium.common.exceptions import NoSuchElementException
from selenium.common.exceptions import NoAlertPresentException
from selenium.common.exceptions import WebDriverException
from selenium.common.exceptions import UnexpectedA... |
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT-0
import base64
import json
import logging
import re
import sys
from datetime import datetime
from functools import wraps
from io import BytesIO
import boto3
import flask
from flask import request, g
from waitress impo... |
import h5py
import json
import os
import io
import torch
import sys
import nltk
import numpy as np
import pandas as pd
dirname = os.path.dirname(__file__)
dirname = os.path.dirname(dirname)
sys.path.append(os.path.join(os.path.dirname(os.path.dirname(__file__)), 'data/coco/cocoapi/PythonAPI'))
from pycocotools.coco imp... |
#!/usr/bin/env python3
"""
vcsgrep: a tool for quick grepping of Hg and Git repos.
For example, "hgg FOO .cpp" translates to grepping for FOO in all .cpp
files tracked by Mercurial.
Requires Python 3, GNU grep, GNU sed and GNU xargs.
Install by symlinking vcsgrep.py as "hgg" and/or "ggit" in your ~/bin
or similar, t... |
import argparse
import time
import ast
from classification.ner.banner import BANNERModel
from classification.ner.crfsuitener import CrfSuiteModel
from classification.ner.stanfordner import StanfordNERModel
from classification.rext.jsrekernel import JSREKernel
from classification.rext.multiinstance import MILCl... |
#密码和密匙
Code = "85E813540F0AB405"
Key = "<KEY>"
#置换选择1
PC_1 = [57,49,41,33,25,17,9, 1,58,50,42,34,26,18, 10,2,59,51,43,35,27, 19,11,3,60,52,44,36, 63,55,47,39,31,23,15, 7,62,54,46,38,30,22, 14,6,61,53,45,37,29,
21,13,5,28,20,12,4]
#置换选择2
PC_2 = [14,17,11,24,1,5, 3,28,15,6,21,10, 23,19,12,4,26,8, 16,7,27,20,13,2, 41,52... |
"""
Core IO methods for the PypeIt setup.
THIS MODULE IS NOW DEPRECATED AND LIKELY TO BE REMOVED
"""
from __future__ import (print_function, absolute_import, division, unicode_literals)
import os
import glob
import string
import numpy as np
import yaml
import linetools.utils
from pypeit import msgs
from pypeit imp... |
"""Detection, localization and segmentation of solar modules"""
import logging
from copy import deepcopy
from typing import Dict, List, Optional, Tuple, Union
import numpy as np
from pvinspect.common.transform import (
FullMultiTransform,
FullTransform,
HomographyTransform,
warp_image,
)
from pvinspec... |
import re
from datetime import datetime
import pytest
from combilog import CallNotSuccessfullError
from combilog import ChannelError
from combilog import ChannelNotFoundError
def test_authenticate_wrong_password(my_logger):
auth = my_logger.authenticate(passwd='<PASSWORD>')
assert auth is False
def test_a... |
"""
np_rw_buffer.buffer
SeaLandAire Technologies
@author: jengel
Numpy circular buffer to help store audio data.
"""
import numpy as np
import threading
from .utils import make_thread_safe
from .circular_indexes import get_indexes
__all__ = ["UnderflowError", "get_shape_columns", "get_shape", "reshape... |
# Copyright (c) 2012 - 2014 Oodrive
# 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 requi... |
from tensorflow.keras.layers import Dense, LSTM, Bidirectional, TimeDistributed, LeakyReLU
from keras import backend as K
from importlib import reload
from models.core import abstract_model
reload(abstract_model)
from models.core.abstract_model import AbstractModel
import tensorflow as tf
import tensorflow_pr... |
import os
import numpy as np
import torch
from torch.optim import lr_scheduler
import torch.nn as nn
import torchvision.transforms as transforms
import time
from sklearn.metrics import confusion_matrix, cohen_kappa_score, accuracy_score
import wandb
from dataset.ucmayo4 import UCMayo4
from utils.metrics import get_mean... |
import discord
from discord.ext import commands
import datetime
import json
import time
#########################################################################
# All of these will log to a text channel that was specified by the #
# server owner via the settings command. #
... |
import pygame
import os
from math import *
from memory_pic import *
from base64 import *
def get_pic(pic_code, pic_name):
image = open(pic_name, 'wb')
image.write(b64decode(pic_code))
image.close()
os.mkdir('_')
get_pic(earthfromnorthpole_png, '_\\earthfromnorthpole.png')
get_pic(fire_png, '_\\fire.png... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2020-2021 <NAME> and <NAME>
#
# Distributed under terms of the BSD 3-Clause license.
""" Functions related to creating data for a simulation.
"""
import os
import time
import pathlib
import shutil
import glob
from typing import Tuple
imp... |
from rdflib import Graph, Literal, URIRef
from rdflib.namespace import SKOS, RDF
from helper.functions import concept_uri, export_data
import helper.namespaces as ns
def create_status_uri(g):
status_list = ['In oprichting', 'Actief', 'Niet Actief']
status_concept_scheme, uuid = concept_uri(ns.gift + 'concept-sche... |
import pandas as pd
from PyQt5.QtWidgets import QMessageBox
from function.func_answer_error import answer_error
from models.models import BullFather, ProfilsCows
import logging
from logging.handlers import RotatingFileHandler
logFile = "./logs/log_preprocessor_ms_data.log"
logging.basicConfig(
filename=logFile,
... |
#%% [markdown]
# # Evaluate clustering concordance
#%%
import datetime
import pprint
import time
import matplotlib.pyplot as plt
import networkx as nx
import numpy as np
import pandas as pd
import seaborn as sns
from anytree import LevelOrderGroupIter, Node, NodeMixin, Walker
from matplotlib.colors import ListedColo... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
# CODE NAME HERE
# CODE DESCRIPTION HERE
Created on 2019-05-13 at 11:28
@author: cook
"""
import numpy as np
import warnings
import os
from scipy.ndimage import filters
from apero import core
from apero.core import constants
from apero import lang
from apero.core im... |
from torchtext import data
import torch.optim as optim
import time
import logging
from tqdm import tqdm
import argparse
from models import *
import math
from sklearn.metrics import f1_score, classification_report, confusion_matrix
torch.backends.cudnn.enabled = True
torch.backends.cudnn.benchmark = True
def str2bool... |
import ipaddress
from main import absorbdict
from main import multiple
src_ip = []
# src-ipのリストの生成
# 条件によってappendするdata数が異なるため注意
def select_src_ip_from_scope_ip(policy, scope_ip):
global src_ip
service_name = policy['protocol']
multiple.confirm_service_element(service_name)
service_element_num = mu... |
# -*- encoding: utf-8 -*-
from django.shortcuts import render
from django.views.generic import View
from django.http import HttpResponse, HttpResponseRedirect
from django.db.models import Q
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
from pure_pagination import Paginator, P... |
"""Pycep plugin function library."""
# coding=utf-8
import re
import random
import string
from glob import glob
from shutil import move, Error, rmtree
from logging import info, error
from yaml_info.yamlinfo import YamlInfo
from pycep.render import write_to_file
from pycep.model import get_value, strip_unsafe_file_names... |
# Copyright 2020 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
from spytest.framework import get_work_area as getwa
def banner(msg, width=80, delimiter="#", wrap=True, tnl=True, lnl=True):
getwa().banner(msg, width, delimiter, wrap, tnl=tnl, lnl=lnl)
def debug(msg):
getwa().debug(msg)
def log(msg):
getwa().log(msg)
def warn(msg):
getwa().warn(msg)
def excepti... |
import subprocess
import sys
import tkinter as tk
from collections import deque
from os import system
from time import time, sleep
from tkinter.font import Font
try:
from PIL import Image, ImageTk
print("Bibliothèque PIL chargée.", file=sys.stderr)
PIL_AVAILABLE = True
except ImportError as e:
PIL_AVAI... |
#
# SensApp::Storage
#
# Copyright (C) 2018 SINTEF Digital
# All rights reserved.
#
# This software may be modified and distributed under the terms
# of the MIT license. See the LICENSE file for details.
#
from io import StringIO
from unittest import TestCase
from deepdiff import DeepDiff
from storage.settings i... |
import numpy as np
import argparse
import os
import matplotlib.pyplot as plt
import matplotlib.patches as patches
from matplotlib.path import Path
from matplotlib.gridspec import GridSpec
from PIL import Image
import csv
import sys
sys.path.append("/home/wuminghu/3D_vision/SMOKE/3d-bounding-box-estimation-for-autonomo... |
# Copyright 2017 Google Inc. 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 required by applicable law or a... |
from rgbmaker import RGBMaker as rgbmaker
from rgbmaker.imgplt import pl_RGB, to_pixel, pl_RGBC, overlayc, overlayo, sqrt
from rgbmaker.tgss_spidx import find_spidx
from matplotlib import pyplot as plt
from regions import PixCoord, EllipsePixelRegion
from astropy.coordinates import Angle, SkyCoord
from astropy import ... |
#!/usr/bin/python
from types import SimpleNamespace
import click
import sys
import os
import json
import threading
import traceback
from datetime import datetime, timedelta
from cli_util import DipException, dip_option, setup_cli
from dip_help import Help
from src.data_filter import ColumnFilter
from src.extractor_res... |
# Copyright 2017 The Rudders 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 or agreed to in... |
import logging
import yaml
import hashlib
import os
import subprocess
import yaml
import json
import json_log_formatter
import requests
# Load configuration files
with open("config/config.yaml", mode="r") as f:
config = yaml.safe_load(f.read())
if config == None:
print("[Error] No config file could be loaded.... |
"""
Contains classes for storing and retrieving patterns, reductions operations,
pattern indices, and the pattern index values of specific words.
There are two interfaces that have been implemented: StorageHandler
and SQLStorageHandler---the former uses a text-file-based system, while
the latter uses a local SQLite d... |
# -*- coding: utf-8 -*-
# effort of writing python 2/3 compatiable code
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
from future.utils import iteritems
from operator import itemgetter, attrgetter, methodcaller
# from sys import stdin
# reload(sys)
# sys... |
"""Plot utilities for the DESI ETC.
Requires that matplotlib is installed.
"""
import datetime
import copy # for shallow copies of matplotlib colormaps
try:
import DOSlib.logger as logging
except ImportError:
# Fallback when we are not running as a DOS application.
import logging
import numpy as np
impo... |
"""
===========
classify.py
===========
This module contains functionality for classifying nanopore captures.
"""
import os
import re
from abc import ABC, abstractmethod
from dataclasses import dataclass
from pathlib import PosixPath
from typing import * # I know people don't like import *, but I think it has benefi... |
import numpy as np
from numpy import linalg as LA
import sys
import librosa
from scipy import linalg
import copy
import random
from math import log
# import matplotlib.pyplot as plt
from joblib import Parallel, delayed
import multiprocessing
import logging
import argparse
def sampleS(S, k):
sample = []
if len... |
from collections import Counter
from MiscUtils.Configurable import Configurable
from .ExamplePage import ExamplePage
class DBConfig(Configurable):
"""Database configuration."""
def defaultConfig(self):
return {
'dbapi': 'sqlite3',
'database': 'demo.db',
# 'dbapi':... |
import h5py
import numpy
import os
## This file was written by <NAME> (<EMAIL>) for GIZMO ##
def load_from_snapshot(value,ptype,sdir,snum,particle_mask=numpy.zeros(0),axis_mask=numpy.zeros(0),
units_to_physical=True,four_char=False,snapshot_name='snapshot',snapdir_name='snapdir',extension='.hdf5',name_additio... |
import asyncio
import logging
import os
import uuid
from asyncio.subprocess import DEVNULL, PIPE
from typing import (
Any,
AsyncIterable,
Awaitable,
Callable,
Dict,
List,
Optional,
Set,
Tuple,
)
import jinja2
from aioregistry import (
Descriptor,
ManifestListV2S2,
Regist... |
import argparse
import datetime
import json
import logging
import math
import os
import re
import time
import numpy as np
import pandas as pd
import requests
import xmltodict
from dateutil.parser import parse
from fvhdms import (
save_df, get_default_argumentparser, parse_args,
user_agent, dataframe_into_infl... |
from dataclasses import dataclass
import state
import tkinter as tk
from tkinter import messagebox as mb
import cell as c
import random
# @dataclass
class Game:
height: int
width: int
game_state: state.GameState
canvas: tk.Canvas
frame: tk.Frame
main_window: tk.Tk
first_move: bool
def _... |
from . import constants as CONSTANTS
from .producer_property import ProducerProperty
from common.telemetry import telemetry_py
from common.telemetry_events import TelemetryEvent
class Image:
"""
If ``string`` is used, it has to consist of digits 0-9 arranged into
lines, describing the image, for example::... |
import functools
from pylearn2.models.mlp import MLP, CompositeLayer
from pylearn2.space import CompositeSpace, VectorSpace
import theano
from theano import tensor as T
from theano.compat import OrderedDict
from theano.sandbox.rng_mrg import MRG_RandomStreams
from adversarial import AdversaryPair, AdversaryCost2, Gen... |
import time, datetime
import numpy as np
import shutil
import sys
from PIL import Image
import torch
from torch import nn
import torch.backends.cudnn as cudnn
import torch.optim as optim
from torchvision import datasets
from torch.autograd import Variable
from learning.utils_learn import *
from learning.dataloader im... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.