text stringlengths 3.07k 22.1k |
|---|
import os
from tempfile import mkdtemp
from unittest import TestCase
from warnings import catch_warnings
from testfixtures.mock import Mock
from testfixtures import (
TempDirectory, Replacer, ShouldRaise, compare, OutputCapture
)
from ..compat import Unicode, PY3
from ..rmtree import rmtree
if PY3:
some_byte... |
# Copyright 2020 The T5 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 writi... |
#!/usr/bin/env python3
# Copyright (c) 2011-2019, <NAME> <<EMAIL>>
# All rights reserved.
#
# 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 t... |
# SPDX-License-Identifier: MIT
# Copyright © 2020 <NAME>
# ==============================================================================
"""High-level converter functions and CLI entry point"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __fu... |
# Copyright 2020 The TensorFlow Authors. 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 applica... |
#! /usr/bin/python
"""
Provides the Tableau class. A tableau takes an input, a iterable of
Constraints, and (optionally) a Gen with a custom function; it calculates all
the violation vectors and stores them in a bidirectional dictionary, then
identifies the winners based on reranking.
Also provides the Typology cla... |
# -*- coding: utf-8 -*-
# Copyright 2020 TensorFlowTTS Team
#
# 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 applicabl... |
#!/hint/python3
import io
import os
import re
import shutil
import string
import subprocess
import sys
from contextlib import contextmanager
from traceback import print_exc
from typing import Callable, Generator, List, Optional, TextIO, Tuple
from . import ansiterm
# run()/run_bincapture()/run_txtcapture() and captu... |
"""Glitter2 App
=====================
The main module that provides the app that runs the GUI.
"""
from os.path import join, dirname
from typing import Iterable, List, Dict, Set
from ffpyplayer.pic import Image
from kivy.lang import Builder
from kivy.factory import Factory
from kivy.properties import ObjectProperty, ... |
import math
import types
from fvcore.nn import smooth_l1_loss
import torch
import torch.nn.functional as F
from detectron2.structures import Instances
from detectron2.modeling.poolers import assign_boxes_to_levels
from detectron2.layers import nonzero_tuple, cat
__all__ = ["get_gt_proposals", "get_level_assignments", ... |
#
# Copyright (c) 2021, NVIDIA CORPORATION.
#
# 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 ... |
import pathlib
import typing
from lxml import etree
from mara_schema.attribute import Type, Attribute
from mara_schema.data_set import DataSet
from mara_schema.metric import SimpleMetric, ComposedMetric, Aggregation
from mara_schema.sql_generation import database_identifier, table_alias_for_path
def date_dimension_... |
import json
import os
import math
import numpy as np
import pandas as pd
import nltk
from nltk.tokenize import RegexpTokenizer # for nltk word tokenization
from nltk.stem.wordnet import WordNetLemmatizer
import math
import re
import fasttext.util
import argparse
from collections import OrderedDict
def Preprocess_QA_... |
# This file is part of pybootchartgui.
# pybootchartgui is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# pybootchartgui is dis... |
# -*- coding: utf-8 -*-
from music21 import *
import copy
def richardBreedGetWell():
'''
<NAME> is a donor who supports the purchases of early music materials at M.I.T. --
I used this code as part of a get well card for him, it finds the name BREED in the Beethoven
quartets. (well something close, B-... |
import numpy as np
import pandas as pd
import xarray as xr
from bokeh.io import output_file, output_notebook, show
from bokeh.layouts import gridplot
from bokeh.plotting import ColumnDataSource, figure
from bokeh.transform import CategoricalColorMapper, factor_cmap
from xarray.plot.plot import _infer_line_data
default... |
#
# Copyright (c) 2021 BlackBerry Limited. 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 requ... |
import os
import argparse
import numpy as np
import cv2
import torch
import torch.backends.cudnn as cudnn
from core.networks.MVDNet_conf import MVDNet_conf
from core.networks.solver import Solver
from post_processing.calConfidence import calConf
from core.utils.utils import load_config_file, vis_depth, vis_normal
def ... |
# routines to deal with stellar images
import copy
import numpy as np
import pdb
import astropy
from astropy.io import fits
from astropy.table import Table
from astropy.table import Column
from astropy.nddata import support_nddata
from astropy.time import Time
from pyvista import mmm
from astropy.stats import sigma_cl... |
'''
Test scoring harness functions
'''
# pylint: disable=redefined-outer-name
import copy
import os
from unittest import mock
from unittest.mock import patch
import pytest
import synapseclient
import scoring_harness.base_processor
from scoring_harness.base_processor import EvaluationQueueProcessor
SYN = mock.create_... |
"""
MIT License
Copyright (c) 2020 PyKOB - MorseKOB in Python
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, me... |
import pythonneat.neat.utils.Parameters as Parameters
import pythonneat.neat.Population as Population
import pythonneat.neat.Speciation as Speciation
from pythonneat.neat.Gene import NodeGene
from pythonneat.neat.Gene import ConnectionGene
from pythonneat.neat.Gene import NodeType
import random
class Genome:
def... |
# Cray-provided controllers for the Boot Orchestration Service
# Copyright 2019-2021 Hewlett Packard Enterprise Development LP
#
# 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 restri... |
import torch
from math import pi, cos, sin, ceil, floor
def _initialize_lstm_weights(lstm_layer, hidden_size):
N = hidden_size
for name, param in lstm_layer.named_parameters():
N = hidden_size
if 'weight_ih' in name:
for i, gain in enumerate([
torch.nn.init.calc... |
"""
User settings/preference dialog
===============================
"""
import sys
import logging
from .. import config
from ..utils.settings import SettingChangedEvent
from ..utils.propertybindings import (
AbstractBoundProperty,
PropertyBinding,
BindingManager,
)
from AnyQt.QtWidgets import (
QWid... |
# -*- coding: utf-8 -*-
"""
Created on Thu Oct 15 14:32:03 2020
@author: Andres
"""
import json
import os, shutil
import jsonschema
import threading
import traceback
from typing import NamedTuple, List
from .variant import VariantType
# Causes cyclic import issue...
#from .parameter import to_variant
from .distrib... |
from json.decoder import JSONDecodeError
from yuemiao.captcha.rotate import rotateCaptcha
from requests.exceptions import Timeout
from yuemiao.miao_api.util import getLatestDate
from django.http.response import HttpResponse
from miao_backend.exceptions import BusinessException
from yuemiao.captcha.slide import SlideCap... |
import random
import cv2
import numpy as np
from scipy.ndimage.filters import gaussian_filter
from aug import Operation, perform_randomly, utils
@perform_randomly
class PerspectiveDistortion(Operation):
def __init__(self, max_warp=0.2, input_mtx=None, return_mtx=False):
self._max_warp = max_warp
... |
#!/usr/bin/python
"""
Launch a distributed job for BytePS
"""
import argparse
import os, sys
import signal
import logging
import subprocess
from multiprocessing import Pool, Process
from threading import Thread
def preprocess_envs(args_envs):
envs_map = {}
for item in args_envs:
i = item.find(":")
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from collections import OrderedDict
import subprocess
import fileinput
import itertools
import click
import pipes
import sys
import os
import io
from . import _fileio, _pairsam_format, _parse, _headerops, cli, common_io_options
from .pairtools_stats import PairCounter
UTI... |
# Copyright 2019 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, ... |
# -*- coding: utf-8 -*-
"""Meta hooks."""
from __future__ import unicode_literals
from __future__ import print_function
import pathlib
import os
import re
from rich import print
import logging
import subprocess
from collections import MutableMapping
from PyInquirer import prompt
from pydantic import BaseModel, Valid... |
# Lint as: python3
# Copyright 2021 The TensorFlow Authors. 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 ... |
"""
Derived module from :meth:`pydmd.dmdbase` for the optimal closed-form solution
to dmd.
.. note::
<NAME> & <NAME>. Low-rank dynamic mode decomposition: optimal
solution in polynomial time. arXiv:1610.02962. 2016.
"""
from scipy.linalg import eig
import numpy as np
from .dmdbase import DMDBase
from .dmdop... |
import sqlite3
import pandas as pd
from strings import *
import copy
from analyzer import Analyzer
class GenericQueries:
DEVICE_TO_DEVICE_SYMBOL_CPY = "select * from CUPTI_ACTIVITY_KIND_MEMCPY memcpy where memcpy.copyKind ==8 and memcpy.flags==1;"
DEVICE_TO_DEVICE_CPY = "select * from CUPTI_ACTIVITY_KIND_MEMC... |
from typing import Iterable, Union
import numpy as np
import tensorly as tl
from scipy.linalg import sqrtm
from sklearn.metrics.pairwise import pairwise_kernels
from sklearn.utils.validation import check_is_fitted
from tensorly.decomposition import parafac
from cca_zoo.models._cca_base import _CCA_Base
from cca_zoo.u... |
#!/usr/bin/env python
"""
C++ source code generator to create bindings from Neovim API functions
using Qt types/signals/slots
"""
import msgpack
import sys, subprocess, os
import re
import jinja2
import datetime
INPUT = 'bindings'
def decutf8(inp):
"""
Recursively decode bytes as utf8 into unicode
"""
... |
# Copyright (C) 2021 Google 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 or agreed to in writing, ... |
# Copyright 2014 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 ... |
from typing import Dict, List, Optional, Union
from uuid import UUID, uuid4
import pytest
from pydantic import UUID1, BaseConfig, BaseModel, PydanticTypeError, ValidationError, conint, errors, validator
from pydantic.error_wrappers import flatten_errors, get_exc_type
try:
from typing_extensions import Literal
ex... |
import requests
import sys
import argparse
import logging
import json
import datetime
from urllib import parse
import anticrlf
from veracode_api_py.api import VeracodeAPI as vapi
from veracode_api_py.constants import Constants
LINE_NUMBER_SLOP = 3 #adjust to allow for line number movement
log = logging.getLogger(__n... |
import pytest
from sqlalchemy.exc import IntegrityError
from sqlalchemy.orm.exc import NoResultFound
from src.minerva_db.sql.models import User, Group, Membership
from src.minerva_db.sql.api.utils import to_jsonapi
from .factories import GroupFactory, UserFactory, MembershipFactory
from . import sa_obj_to_dict, stateme... |
#!/usr/bin/env python
# Copyright 2015 Shadow Robot Company Ltd.
#
# 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, either version 2 of the License, or (at your option)
# any later version.
#
# ... |
import numpy as np
import pandas as pd
from atom.api import (Atom, Typed, Dict, List, Bool, Int, Float, Tuple,
Property, Value)
from matplotlib.figure import Figure
from matplotlib.axes import Axes
from matplotlib import transforms as T
from abr.abrpanel import WaveformPlot
from abr.... |
import wandb
import tensorflow as tf
from tensorflow.keras.layers import Input, Dense, Lambda, concatenate
import gym
import argparse
import numpy as np
import random
from collections import deque
tf.keras.backend.set_floatx('float64')
wandb.init(name='DDPG', project="deep-rl-tf2")
parser = argparse.ArgumentParser()... |
from plotly.subplots import make_subplots
import plotly.graph_objects as go
import matplotlib.pyplot as plt
import plotly.express as px
import datetime
import dask.array as da
import xarray as xr
import numpy as np
import rioxarray
import tqdm
import glob
from SAR_raster_open_func import DisplayScatteringXarray_band
f... |
from __future__ import annotations
import asyncio
import json
import logging
import uuid
from collections import defaultdict
from contextlib import suppress
from jsonrpcclient.requests import request_uuid
from jsonrpcclient.responses import Error, Ok, parse
from pydantic import ValidationError
from websockets import ... |
import os
import torch
import torchaudio
import numpy as np
import torchsummary
import pytorch_lightning as pl
from argparse import ArgumentParser
import auraloss
def center_crop(x, shape):
start = (x.shape[-1]-shape[-1])//2
stop = start + shape[-1]
return x[...,start:stop]
class FiLM(torch.nn.Module):
... |
from deap import base, creator, tools
import file_comparison
import json
import copy
import itertools as it
import math
import os
import numpy as np
from rule_creator import creating_rules
import ast
from time import time
from joblib import Parallel, delayed
import multiprocessing
import random
#load reference data
f... |
import itertools
from time import sleep
import numpy as np
import os
import torch
from torch.utils.data import DataLoader
from torch.utils.data.distributed import DistributedSampler
from tqdm import tqdm
from vdvae.data.data import set_up_data
from vdvae.train_helpers import set_up_hyperparams, load_vaes
from vdvae.c... |
# -*- coding:utf-8 -*-
# Author: hankcs
# Date: 2019-08-24 21:49
import os
from typing import Tuple, Union, List
import numpy as np
import tensorflow as tf
from tensorflow.python.ops import math_ops
from hanlp.common.vocab_tf import VocabTF
from hanlp.utils.io_util import get_resource
from hanlp.utils.torch_util impo... |
import pytest
import scipy
import numpy as np
from numpy.testing import assert_array_equal
from sklearn.preprocessing import StandardScaler
from sklearn.pipeline import make_pipeline
from sklearn.feature_selection import SequentialFeatureSelector
from sklearn.datasets import make_regression, make_blobs
from sklearn.li... |
"""Functions to clean images by fitting linear trends to the initial scans."""
try:
import matplotlib.pyplot as plt
from matplotlib.gridspec import GridSpec
HAS_MPL = True
except ImportError:
HAS_MPL = False
from .fit import contiguous_regions
from .utils import jit, vectorize
from .histograms impor... |
import time
from typing import Optional, List, Union
import json
import sys
import requests
from tqdm import tqdm
import weaviate
from weaviate.exceptions import RequestsConnectionError, UnexpectedStatusCodeException
from weaviate.auth import AuthCredentials
class WCS(weaviate.connect.Connection):
"""
WCS cla... |
# -*- coding: utf-8 -*-
#
# K2HR3 OpenStack Notification Listener
#
# Copyright 2018 Yahoo! Japan Corporation.
#
# K2HR3 is K2hdkc based Resource and Roles and policy Rules, gathers
# common management information for the cloud.
# K2HR3 can dynamically manage information as "who", "what", "operate".
# These are stored ... |
###############################################################################
#
# Copyright 2013-2019 by Shoobx, Inc.
#
###############################################################################
"""Immutable Interfaces."""
import datetime
import decimal
from enum import Enum
import zope.interface
import zope.li... |
# this file was created to handle processed ISC data
import os, glob
import pandas as pd
import numpy as np
from pandas import read_excel
from pathlib import Path
from matplotlib import pyplot as plt
def sum_up (df, list_size_spectra, min_size, max_size):
'''
This function handle 'Binned_All_Images' sheet to ... |
"""
Test PySlipQt GototPosition() function.
The idea is to have a set of buttons selecting various geo positions on the OSM
tile map. When selected, the view would be moved with GotoPosition() and a
map-relative marker would be drawn at that position. At the same time, a
view-relative marker would be drawn at the ce... |
from __future__ import absolute_import, division, print_function, unicode_literals
import os
import six
import sys
import time
from echomesh.base import Name
from echomesh.base import Path
from echomesh.base import Settings
from echomesh.base import Yaml
from echomesh.base.Join import join_words
from echomesh.command... |
import numpy as np
from scipy.spatial import distance
from sklearn.linear_model import LogisticRegression
from sklearn.cluster import DBSCAN, KMeans, AffinityPropagation, MeanShift, SpectralClustering, AgglomerativeClustering
from sklearn import metrics
from sklearn.utils import shuffle
from sklearn.model_selection imp... |
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
# (1) Please use the following command to create the script to extract 300VW frames,
# you can use ./cache/parallel.... |
import tensorflow as tf
from tensorflow import keras
from utils import io_utils, data_utils, train_utils, bbox_utils, drawing_utils, eval_utils
from models import affordancenet
import os
import numpy as np
import pickle
import importlib
# Adapt data to tf dataset
def iit_data_to_tf_dataset():
for roi in roidb:
... |
# -*- coding: utf-8 -*-
"""
Created on Mar 11, 2012
@author: moloch
Copyright 2012 Root the Box
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/licen... |
from plenum.common.constants import CONFIG_LEDGER_ID, TXN_TYPE
from plenum.common.types import f
from sovtoken.constants import ADDRESS, AMOUNT
from sovtokenfees.constants import FEE_TXNS_IN_BATCH, FEES
from sovtoken import TOKEN_LEDGER_ID
from state.trie.pruning_trie import BLANK_ROOT
from common.serializers.serializa... |
#!/usr/bin/env python3
"""
jjo's foo cedears
"""
#
# Copyright <NAME> <http://twitter.com/xjjo>
#
# License: MIT
#
import argparse
import sys
import re
import os
import asyncio
import logging
import json
import jsonpath_rw as jp
import urllib3
import pandas as pd
import httpx
import httpcore
from aiocache import cache... |
from __future__ import absolute_import, division, print_function, unicode_literals
import six
from six.moves import zip
import math
from multiprocessing import Process
from flask import Flask, request, jsonify, render_template
from hpctl.utils import Label
from hpctl.frontend import Frontend
class FlaskFrontend(Fron... |
import os
import numpy as np
import pennylane as qml
import pytest
from qiskit import IBMQ
from qiskit.providers.ibmq.exceptions import IBMQAccountError
from pennylane_qiskit import IBMQDevice
from pennylane_qiskit import ibmq as ibmq
from pennylane_qiskit import qiskit_device as qiskit_device
@pytest.fixture
def ... |
#!/usr/bin/env python
#
# Copyright (c) 2019 Opticks Team. All Rights Reserved.
#
# This file is part of Opticks
# (see https://bitbucket.org/simoncblyth/opticks).
#
# 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... |
'''
***************************************************************
Author: LU
Date: Nov 2020
Description:
CNN architecture used for thalamic nuclei segmentation in
MPRAGE images.
***************************************************************
'''
# import files
import sys, os
import tensorflow as tf
from keras... |
#!/usr/bin/env python3
import sys
import os
import string
import re
import numpy as np
import torch
import pandas as pd
import warnings
from copy import copy
from argparse import ArgumentParser
from datetime import datetime, timedelta
from ada.environments import env_utils
from ada.agents.rl_algos import rl_utils
fr... |
# Copyright 2016 Netherlands eScience Center
#
# 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 t... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# S.D.G
"""
Test IRC connector
"""
# Imports
import os
import json
import phabricator
import lugito
import pytest
from lugito.connectors import irc
# docEbrown - 20181120
# There is a bug in inspect.unwrap preventing the import of call directly
import unittest.mock
from ... |
import collections
import dataclasses
import json
import logging
import os
import pathlib
import time
from typing import Any, DefaultDict, Dict, Optional, Union
import torch
from torch import Tensor, nn, optim
from torch.optim import optimizer
from torch.utils.data import dataloader
from torch.utils.data.dataset impor... |
import torch
import torch.nn as nn
from collections import namedtuple
import functools
import torch.nn.functional as F
from torch.autograd import Variable
import os
import sys
sys.path.append(os.path.dirname(os.path.abspath(os.path.dirname(__file__))))
from layers import *
Conv = namedtuple('Conv', ['stride', 'dept... |
#!/usr/bin/env python3
import sys
import logging
import unittest
import os
import re
import time
import nose
import nose.config
import nose.loader
import nose.plugins.manager
import nose.plugins.xunit
import argparse
import traceback
import json
class DirectoryScope(object):
def __init__(self, directory):
... |
#!/usr/bin/env python2
"""
oheap2.py
OVM2 stores objects in a data structure called OHeap2. It has the following
concepts.
- Handles: 4-byte / 32-bit integers that point to Cells.
- Cells: 16-byte structs with a type tag, in a contiguous array. This array is
scanned by the GC.
- Slabs: Variable-length arrays of m... |
'''
Backend independent higher level interfaces, common exceptions.
'''
import decimal
import inspect
import warnings
from ijson import compat, utils
class JSONError(Exception):
'''
Base exception for all parsing errors.
'''
pass
class IncompleteJSONError(JSONError):
'''
Raised when the par... |
from .KTS import cpd_auto
from .knapsack import knapsack
import os
import numpy as np
import math
import cv2
from tqdm import tqdm
import matplotlib.pyplot as plt
import seaborn as sns
def get_change_points(video_feat, n_frames, fps,
decimation_factor=1, min_cp_interval=5):
kernel = np.matm... |
# -*- coding: utf-8 -*-
"""
BSD 3-Clause License
Copyright 2021 National Technology & Engineering Solutions of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the U.S. Government retains certain rights in this software.
Redistribution and use in source and binary forms, with or without... |
#!/usr/bin/python3
from dateutil import tz
from dateutil.parser import parse as date_parse
import argparse
import datetime
import os
import os.path as osp
import re
import shutil
import socket
import subprocess
import sys
import time
import urllib
from ctabus import fetch
from ctabus.internal.config import log_dir, r... |
import os
import torch
import numpy as np
from external.ChamferDistancePytorch.chamfer_python import distChamfer
import glob
from metrics import *
from loss import *
import h5py
from utils.common_utils import *
from arguments import Arguments
def compute_cd_small_batch(gt, output,batch_size=50):
"""
compute c... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""
Author
------
<NAME>
Purpose
-------
This module provides a numpy.ma.MaskedArray as a
wrapper around gdal raster functionality
"""
import os
import copy
import numpy as np
import warnings
from numpy.ma import MaskedArray
from .utils import _broadcastedMeshgrid, _bro... |
import crypt
import socket
from itertools import product
from pathlib import Path
from socket import SocketKind
import spwd
from typing import List, Tuple
import iptc
import psutil
from . import iptc_helper
def check_for_default_passwords(config_path):
"""
Check if the 'pi' user current password hash is in ... |
from numpy import load
import numpy as np
import matplotlib.pyplot as plt
import pdb
from matplotlib.animation import FuncAnimation
# Functions
def saveGit(name, variableAnimate, color, fig):
fig.set_tight_layout(True)
ax = plt.axes()
lineList = []
print("len(variableAnimate): ", len(variableAnimate))
for i in ra... |
import os, glob, re, chardet
import pandas as pd
from statistics import mode
############################################
# clean_weird function
############################################
def clean_weird(vector_dirty, extra=False):
## # ============================
## # ORDER MATTERS HERE
## # =========... |
import tkinter as tk
import random as rd
from urllib import request
from urllib.error import URLError, HTTPError
from html.parser import HTMLParser
from html.entities import name2codepoint
import threading
from tkinter.filedialog import askopenfilename
from tkinter.messagebox import showinfo
import webbrowser ... |
import itertools
from aiomas import expose
import numpy as np
from openvpp_agents import util
from openvpp_agents.unit import UnitModel
# The simulation has a temporal resolution of 1 minute.
# The ChpModel needs this value in seconds for computing the interval sice
# for _schedules and forecasts.
# We also need th... |
import polib
from django.conf import settings
from django.conf.urls import url
from django.contrib import admin
from django.core.exceptions import ValidationError
from django.http import HttpResponse
from django.utils.translation import get_language
from modeltranslation.admin import TabbedTranslationAdmin as Translata... |
import os
import os.path as osp
import pickle
import h5py
import deepdish as dd
import numpy as np
from tqdm import tqdm
from torch.utils.data import Dataset
from .url_utils import makedirs, decide_download, download_url, extract_tar
from .data_utils import (h5group_to_dict, build_graph_from_dict_pyg,
... |
# -*- coding: utf-8 -*-
#con.execute_non_query(INSERT_EX_SQ.encode('your language encoder'))
#
__doc__='''
使い方:
'''
import os
from os import getenv
import sys
import datetime
import time
import locale
import psycopg2
import csv
from map_matching import map_matching as mm
from map_matching.utils... |
"""Functions helpful in analyzing experimental data."""
from warnings import warn
import numpy as np
from scipy.signal import argrelextrema
# * Miscellaneous
def remove_close(maxima, distance, *arrays):
"""Remove points in `maxima` which are closer than `distance`.
It is assumed that the first maximum is a p... |
from django.contrib.auth.models import User
from django.db import models
from django.db.models import ManyToManyField, DateTimeField, ForeignKey, OneToOneField, Model
from django.db.models.signals import post_save
from django.dispatch import receiver
from LottoWebCore.methods import create_hash
class JSONModel(model... |
import configparser
import json
import os
import shutil
import sys
from datetime import datetime, timedelta
from decimal import Decimal
from getopt import getopt, GetoptError
from typing import List, Dict
import requests
from requests.auth import HTTPBasicAuth
from common import _json_load
from export_excel import ex... |
from contextlib import contextmanager
from importlib import import_module
from time import time
import logging
import os
import pygit2
from gitmodel import conf
from gitmodel import exceptions
from gitmodel import models
from gitmodel import utils
class Workspace(object):
"""
A workspace acts as an encapsul... |
from corelib import *
from file_check import readExpr
### Get defferentially expressed up and down regulated genes
def geneROC(genes, rp_dict, lgfc, fdr):
genes_symbol_sig = [i[0] for i in genes if abs(i[1])>=lgfc and i[-1]<=fdr]
genes_symbol = [i[0] for i in genes]
genes_symbol_all = rp_dict.keys()
ge... |
import inspect
import warnings
from sqlalchemy import bindparam
from sqlalchemy.ext import baked
from sqlalchemy.orm.attributes import InstrumentedAttribute
from sqlalchemy.orm import joinedload, aliased
from sqlalchemy.sql.expression import desc
from sqlalchemy import Boolean, Table, func, or_
from sqlalchemy.exc imp... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2012 pyReScene
#
# 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 ... |
#
# Copyright (c) 2018-2019 Intel Corporation
#
# 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 la... |
#!/usr/bin/env python3
# -------------------------------------------------------------------------------
# PROJECT: FPGA Brainfuck
# -------------------------------------------------------------------------------
# AUTHORS: <NAME> <<EMAIL>>
# LICENSE: The MIT License (MIT), please read LICENSE file
# WEBSITE: http... |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (t... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.