gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
#!/usr/bin/env python
"""
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 (the
"License");... | |
#!/usr/bin/env python
# Copyright 2015 The Kubernetes 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
#
# Unle... | |
# Copyright 2013: Mirantis 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 b... | |
# -*- coding: utf-8 -*-
import numpy as np
import pytest
import six
import tensorflow as tf
from tfsnippet.utils import TensorWrapper, register_tensor_wrapper_class
from tests.utils._div_op import regular_div, floor_div
from tests.utils._true_div_op import true_div
class _SimpleTensor(TensorWrapper):
def __init... | |
#!/usr/bin/env python3
# Copyright (c) 2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test recovery from a crash during chainstate writing.
- 4 nodes
* node0, node1, and node2 will have diffe... | |
"""Event parser and human readable log generator."""
from datetime import timedelta
from itertools import groupby
import logging
import voluptuous as vol
from homeassistant.loader import bind_hass
from homeassistant.components import sun
from homeassistant.components.http import HomeAssistantView
from homeassistant.c... | |
# Copyright (c) 2011 OpenStack Foundation
#
# 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 ... | |
"""Astronomical observations calculations.
"""
import numpy as np
from zcode.constants import PC, SPLC, JY
# LOTS OF REFERENCE FLUXES: https://coolwiki.ipac.caltech.edu/index.php/Central_wavelengths_and_zero_points
# VEGA/Johnson/Bessell: http://web.ipac.caltech.edu/staff/fmasci/home/astro_refs/magsystems.pdf
# SDS... | |
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
# MIT License. See license.txt
from __future__ import unicode_literals
import webnotes
from webnotes import msgprint
import os
from webnotes.utils import now, cint
from webnotes.model import no_value_fields
class DocType:
def __init__(self, doc=None, doclist=... | |
# Licensed under a 3-clause BSD style license - see PYFITS.rst
import gzip
import bz2
import io
import mmap
import os
import pathlib
import warnings
import zipfile
import pytest
import numpy as np
from . import FitsTestCase
from ..convenience import _getext
from ..diff import FITSDiff
from ..file import _File, GZIP... | |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import os
import time
from django.conf import settings
from .intervals import Interval, IntervalSet
from .carbonlink import CarbonLink
from .logger import log
try:
import whisper
except ImportError:
whisper = False
try:
import rrdtool
except ... | |
from sympy.core.assumptions import StdFactKB
from sympy.core import S, Pow, Symbol
from sympy.core.expr import AtomicExpr
from sympy.core.compatibility import range
from sympy import diff as df, sqrt, ImmutableMatrix as Matrix
from sympy.vector.coordsysrect import CoordSysCartesian
from sympy.vector.basisdependent impo... | |
"""
nbtattr
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import collections
import logging
import uuid
from mceditlib import nbt
from mceditlib.geometry import Vector
log = logging.getLogger(__name__)
class NBTAttr(object):
"""
NBT Attributes can be added to any ... | |
# BSD 3-Clause License
#
# Copyright (c) 2017, Thomas Pointhuber
# 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
# ... | |
# Natural Language Toolkit - Feature Select
# The command line entry point for feature selection
#
# Author: Sumukh Ghodke <sumukh dot ghodke at gmail dot com>
#
# URL: <http://nltk.sf.net>
# This software is distributed under GPL, for license information see LICENSE.TXT
from nltk_contrib.classifier import split_ignor... | |
# Copyright 2016 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 agree... | |
"""Test functions for 1D array set operations.
"""
from __future__ import division, absolute_import, print_function
import numpy as np
from numpy.testing import (assert_array_equal, assert_equal,
assert_raises, assert_raises_regex)
from numpy.lib.arraysetops import (
ediff1d, intersect... | |
import logging
import random
import requests
import urllib
import pyjokes
import sys
import threading
from asq.initiators import *
import json
logger = logging.getLogger(__name__)
class Messenger(object):
def __init__(self, slackClients):
self.clients = slackClients
self.lock = threading.RLock()
... | |
# Copyright 2015 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... | |
from __future__ import print_function
from fontTools.misc.py23 import *
"""
This implements the WOFF specification dated September 16, 2009.
The main object is the WOFFFont. It is a subclass for the FontTools
TTFont object, so it has very similar functionality. The WOFFReader
and WOFFWriter are also available for use ... | |
#!/usr/bin/env python
#
# trans_tests.py: testing eol conversion and keyword substitution
#
# Subversion is a tool for revision control.
# See http://subversion.apache.org for more information.
#
# ====================================================================
# Licensed to the Apache Software Foundation (... | |
from __future__ import absolute_import, print_function, division
import time
import numpy as np
import multiprocessing as mp
import threading as thr
import GPy
import os
def timeprintit(f):
class TpRecord:
i = 1
times = []
if not hasattr(timeprintit, 'records'):
timeprintit.records = ... | |
# 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... | |
# Copyright 2011 Justin Santa Barbara
# 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... | |
from __future__ import absolute_import, division, print_function
import pytest
import sys
from _pytest.skipping import MarkEvaluator, folded_skips, pytest_runtest_setup
from _pytest.runner import runtestprotocol
class TestEvaluator(object):
def test_no_marker(self, testdir):
item = testdir.getitem("def t... | |
# 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 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
from logging import getLogger
import operator as op
import re
from ..common.compat import string_types, zip, zip_longest, text_type
from ..exceptions import CondaValueError, InvalidVersionSpecError
try:
from... | |
#!/usr/bin/env python
#
# Copyright 2007 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 o... | |
r"""JSON (JavaScript Object Notation) <http://json.org> is a subset of
JavaScript syntax (ECMA-262 3rd edition) used as a lightweight data
interchange format.
:mod:`simplejson` exposes an API familiar to users of the standard library
:mod:`marshal` and :mod:`pickle` modules. It is the externally maintained
version of ... | |
##########################################################################
#
# Copyright 2012 VMware, Inc.
# 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 res... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# periodsearch.py - Waqas Bhatti (wbhatti@astro.princeton.edu) - Feb 2019
'''
This contains functions to run period-finding in a parallelized manner on large
collections of light curves.
'''
#############
## LOGGING ##
#############
import logging
from astrobase import... | |
# Copyright 2017 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... | |
"""
MySQL database backend for Django.
Requires MySQLdb: http://sourceforge.net/projects/mysql-python
"""
from __future__ import unicode_literals
import datetime
import re
import sys
import warnings
try:
import MySQLdb as Database
except ImportError as e:
from django.core.exceptions import ImproperlyConfigur... | |
#! /usr/bin/python
'''
Alessandro Bacchini (allebacco@gmail.com)
This file contains debug dumpers / helpers / visualizers so OpenCV
classes can be more easily inspected by gdb and QtCreator.
To install in gdb, add these lines to ~/.gdbinit
```
python
exec(open('<path to opencv_dumper.py>').read())
end
```
'''
impo... | |
# basis classes for ccsnmultivar
from sklearn.decomposition import FastICA, SparsePCA, DictionaryLearning
import numpy as np
class PCA(object):
"""
Performs SVD: Y = USV^\dagger
PCA has 4 methods:
- fit(waveforms)
update class instance with pca fit, done via svd
- fit_transform()
... | |
#!/usr/bin/python
# pose related functions
import csv
import fileinput
import fnmatch
import math
import os
import re
import navpy
from props import getNode
from . import camera
from . import exif
from . import image
from .logger import log
from . import transformations
from props import getNode
import props_json
... | |
# -*- coding: utf-8 -*-
"""
>>> pingpong = thriftpy2.load("pingpong.thrift")
>>>
>>> class Dispatcher(object):
>>> def ping(self):
>>> return "pong"
>>> server = make_server(pingpong.PingPong, Dispatcher())
>>> server.listen(6000)
>>> client = ioloop.IOLoop.current().run_sync(
lambda: make_client(ping... | |
import numpy as np
import pickle
from sklearn.isotonic import check_increasing, isotonic_regression,\
IsotonicRegression
from sklearn.utils.testing import assert_raises, assert_array_equal,\
assert_true, assert_false, assert_equal
from sklearn.utils.testing import assert_warns_message, assert_no_warnings
d... | |
# PyVision License
#
# Copyright (c) 2006-2008 David S. Bolme
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, thi... | |
#! /usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2007-2010 (ita)
"""
Debugging helper for parallel compilation, outputs
a file named pdebug.svg in the source directory::
def options(opt):
opt.load('parallel_debug')
def configure(conf):
conf.load('parallel_debug')
def build(bld):
...
"""
import os,... | |
import sys
import time
import zmq
import json
from zmq.eventloop import ioloop
ioloop.install()
from zmq.eventloop.zmqstream import ZMQStream
import tornado.ioloop
import tornado.gen
import tornado.web
import tornado.websocket
import threading
import session_ipc
def tprint(msg):
"""like print, but won't get newl... | |
from __future__ import absolute_import, division
from collections import defaultdict
import numpy as np
import pandas as pd
from six import iteritems
from bokeh.charts import DEFAULT_PALETTE
from bokeh.core.enums import DashPattern
from bokeh.models.glyphs import Rect, Segment, Line, Patches
from bokeh.models.render... | |
"""Symbolic primitives + unicode/ASCII abstraction for pretty.py"""
from __future__ import print_function, division
import sys
import warnings
unicode_warnings = ''
from sympy.core.compatibility import u, unicode, range
# first, setup unicodedate environment
try:
import unicodedata
def U(name):
"""... | |
import os
import re
import shutil
from ...workspace_factory import workspace_factory
from ....utils import in_temporary_directory, temporary_directory
from ....utils import assert_cmd_success
from ....utils import assert_cmd_failure
from ....utils import assert_files_exist
from ....utils import catkin_success
from ..... | |
"""The tests for the geolocation trigger."""
import pytest
from homeassistant.components import automation, zone
from homeassistant.core import Context
from homeassistant.setup import async_setup_component
from tests.common import async_mock_service, mock_component
from tests.components.automation import common
@py... | |
"""Generic (shallow and deep) copying operations.
Interface summary:
import copy
x = copy.copy(y) # make a shallow copy of y
x = copy.deepcopy(y) # make a deep copy of y
For module specific errors, copy.Error is raised.
The difference between shallow and deep copying is only relev... | |
#
# plots.py -- Utility functions for plotting.
#
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
import numpy as np
import matplotlib as mpl
from matplotlib.figure import Figure
from ginga.util import iqcalc as _iqcalc # Prevent namespace confusion below... | |
# 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 agre... | |
#from seq2seq import ngramlm, neurallm
import cPickle, pickle
import numpy as np
import os
from collections import defaultdict
import dynet as dy
from dynet import *
import numpy
import random
from nltk.tokenize import RegexpTokenizer
class Attention:
def __init__(self, vocab_size, model, lookup):
s... | |
# Copyright 2015 - Mirantis, Inc.
# Copyright 2015 - StackStorm, 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
#
# Unl... | |
### Task Serializers ###
from datetime import timedelta
from django.utils import timezone
from django.core.urlresolvers import reverse
from rest_framework import serializers
from task.models import Task, TaskDirectory, Assignment
from item.models import Item
from slave.settings import *
class AssignmentSerializer(seri... | |
import os
import timeit
from collections import deque
import numpy as np
import simplejson as json
from ghx.borehole import BoreholeClass
from ghx.my_print import PrintClass
class BaseGHXClass:
"""
Base class for GHXArray
"""
def __init__(self, json_data, loads_path, output_path, print_output=True)... | |
"""The tests for hls streams."""
from datetime import timedelta
from io import BytesIO
import os
from unittest.mock import patch
import av
import pytest
from homeassistant.components.stream import create_stream
from homeassistant.components.stream.const import HLS_PROVIDER, RECORDER_PROVIDER
from homeassistant.compon... | |
import functools
import sys
import threading
import warnings
from collections import Counter, OrderedDict, defaultdict
from functools import partial
from django.core.exceptions import AppRegistryNotReady, ImproperlyConfigured
from .config import AppConfig
class Apps:
"""
A registry that stores the configura... | |
#!/usr/bin/env python
# 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 required... | |
import mxnet as mx
import numpy as np
import cv2
from tools.rand_sampler import RandSampler
class DetRecordIter(mx.io.DataIter):
"""
The new detection iterator wrapper for mx.io.ImageDetRecordIter which is
written in C++, it takes record file as input and runs faster.
Supports various augment operation... | |
#!/usr/bin/env python
#
# Copyright 2001 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 require... | |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | |
from numpy.testing import assert_array_equal, assert_almost_equal, \
assert_array_almost_equal, assert_raises, assert_equal
import numpy as np
import math
from skimage.measure._regionprops import regionprops, PROPS, perimeter
SAMPLE = np.array(
[[0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0],
[0... | |
#!/usr/bin/env python
# coding: UTF-8
"""Higher order singular value decomposition routines
as introduced in:
Lieven de Lathauwer, Bart de Moor, Joos Vandewalle,
'A multilinear singular value decomposition',
SIAM J. Matrix Anal. Appl. 21 (4), 2000, 1253-1278
implemented by Jiahao Chen <jiahao@mit.edu>, 20... | |
"""
PySCeS - Python Simulator for Cellular Systems (http://pysces.sourceforge.net)
Copyright (C) 2004-2020 B.G. Olivier, J.M. Rohwer, J.-H.S Hofmeyr all rights reserved,
Brett G. Olivier (bgoli@users.sourceforge.net)
Triple-J Group for Molecular Cell Physiology
Stellenbosch University, South Africa.
Permission to us... | |
from typing import List
from uchan.lib import action_authorizer, roles
from uchan.lib.action_authorizer import ModeratorBoardAction, NoPermissionError
from uchan.lib.exceptions import ArgumentError
from uchan.lib.mod_log import mod_log
from uchan.lib.model import ModeratorLogType, ModeratorModel, BoardModel, BoardMode... | |
class Node(object):
def __init__(self, value):
self.value = value
self.edges = []
self.visited = False
class Edge(object):
def __init__(self, value, node_from, node_to):
self.value = value
self.node_from = node_from
self.node_to = node_to
# You only need to ch... | |
import logging
from sqlalchemy.orm.attributes import InstrumentedAttribute
from sqlalchemy.orm import joinedload
from sqlalchemy.sql.expression import desc
from sqlalchemy import Column, Boolean, func, or_
from sqlalchemy.exc import IntegrityError
from flask import flash
from flask.ext.admin._compat import string_ty... | |
# Copyright 2013 Hewlett-Packard Development Company, L.P.
# 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... | |
#! /usr/bin/env python
#coding=utf-8
# This module is used to parse and create new style ini file. This
# new style ini file format should like a very simple python program
# but you can define section like normal ini file, for example:
#
# [default]
# key = value
#
# Then the result should be ini.default.key1 = ... | |
#!/usr/bin/python
# ========================================================================
# Copyright (c) 2007, Metaweb Technologies, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# ... | |
#!/usr/bin/env python3
# binary2DICOM converter
# Author: Rafal Maselek
# Email: rafal.maselek@ncbj.gov.pl
#
# This script enables converting raw 3D binary images to DICOM file format and importing meta-data from external file.
import sys
try:
from pydicom.dataset import Dataset, FileDataset
except ImportError:
fr... | |
import time
import synapse.cortex as s_cortex
import synapse.daemon as s_daemon
import synapse.telepath as s_telepath
import synapse.lib.service as s_service
import synapse.lib.userauth as s_userauth
import synapse.swarm.runtime as s_runtime
from synapse.tests.common import *
class SwarmRunBase(SynTest):
def g... | |
"""The tests for the device tracker component."""
# pylint: disable=protected-access
import asyncio
import json
import logging
import unittest
from unittest.mock import call, patch
from datetime import datetime, timedelta
import os
from homeassistant.components import zone
from homeassistant.core import callback
from ... | |
# Copyright 2017 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... | |
# Copyright 2015 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
# -*- coding: utf-8 -*-
#
# FILE: twitterDB.py
#
# An object for managing a twitter DB
#
# Copyright by Author. All rights reserved. Not for reuse without
# express permissions.
#
#
from sochi.data.db.base.baseDB import BaseDB
from sochi.data.db.base.dbManager import DBManager
from sochi.dat... | |
import xml.etree.ElementTree as et
import pytest
from django.urls import reverse
from ..models import Question
users = (
('editor', 'editor'),
('reviewer', 'reviewer'),
('user', 'user'),
('api', 'api'),
('anonymous', None),
)
status_map = {
'list': {
'editor': 200, 'reviewer': 200, '... | |
from sqlalchemy import *
from sqlalchemy.sql import table, column, ClauseElement
from sqlalchemy.sql.expression import _clone, _from_objects
from test.lib import *
from sqlalchemy.sql.visitors import *
from sqlalchemy import util, exc
from sqlalchemy.sql import util as sql_util
from test.lib.testing import eq_, ne_, a... | |
# -*- coding: utf-8 -*-
import json
import operator
from django.db import models
from django.db.models import Q
from django.utils.translation import ugettext_lazy as _
from django.core.exceptions import ValidationError
from django.core.cache import cache
from django.utils import timezone
from django.conf import settin... | |
# Copyright 2015 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/env python
#
# VM Backup extension
#
# Copyright 2014 Microsoft 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
#
# U... | |
# 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 required by applicable law or a... | |
#!/usr/bin/env python
# -*- encoding: utf-8
"""Print log event messages from a CloudWatch log group.
Usage: aws_get_log_events.py <LOG_GROUP_NAME> [--log-stream=<LOG_STREAM_NAME>] [--start=<START>] [--end=<END>] [--day=<DAY>] [--limit=<LIMIT>] [--filter=<FILTER_PATTERN>] [--regex=<REGEX_PATTERN>] [--log-streams-number... | |
"""
An implementation of the scheme of
Shen and Yang, SIAM J. Numer. Anal., 2015.
Binary electrohydrodynamics solved using a partial splitting approach and
linearisation.
The problem is split between the following subproblems.
* PF: Solved with stabilization and a modified phase field potential.
* EC: Improvised. ... | |
"""
Floodfill operation implementation
"""
import math, functools
import numpy
from .base import Operation
from ..image import Image
from ..analyze import detect_bg
class TargetNotFoundError(Exception):
"""
An internal use exception that indicates the lack of a valid pixel from a selection operation
e.g. s... | |
#!/usr/bin/env python
"""oc_csr_approve module"""
# Copyright 2020 Red Hat, Inc. and/or its affiliates
# and other contributors as indicated by the @author tags.
#
# 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... | |
"""
Randomized Lasso/Logistic: feature selection based on Lasso and
sparse Logistic Regression
"""
# Author: Gael Varoquaux, Alexandre Gramfort
#
# License: BSD 3 clause
import itertools
from abc import ABCMeta, abstractmethod
import warnings
import numpy as np
from scipy.sparse import issparse
from scipy import spar... | |
from __future__ import division
import itertools
from enum import Enum
import numpy as np
import amnet
from amnet.util import Relation
import z3
################################################################################
# Classes and routines related to Multiplexing Programming with AMNs
######################... | |
# Copyright 2013 OpenStack Foundation
#
# 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... | |
"""File like interface for reading pdb coordinates."""
import os
import numpy as np
import topology as t
STDOPEN=open
def read_topology_parts(pdb_file_name):
with STDOPEN(pdb_file_name) as pdb_file:
for line in pdb_file:
line_type = line[:6].strip()
if line_type == 'ATOM' or lin... | |
from datetime import datetime
from collections import namedtuple
class Field(namedtuple("Field", ["field", "default", "formatter", "model"])):
"""Model Field
Model fields represent JSON key/value pairs. When added to a PandoraModel
the describe the unpacking logic for the API JSON and will be replaced at... | |
# -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Rupesh Tare <rupesht@saltstack.com>`
'''
# Import Python libs
from __future__ import absolute_import
# Import Salt Testing Libs
from salttesting import TestCase, skipIf
from salttesting.mock import (
MagicMock,
patch,
NO_MOCK,
NO_MOCK_REASON
)
# Im... | |
"""Support for Huawei LTE routers."""
from collections import defaultdict
from datetime import timedelta
from functools import partial
import ipaddress
import logging
from typing import Any, Callable, Dict, List, Set, Tuple
from urllib.parse import urlparse
import attr
from getmac import get_mac_address
from huawei_l... | |
"""
OpenDaylight REST API
Copyright 2013 The University of Wisconsin Board of Regents
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
... | |
try:
import StringIO
except:
import io as StringIO
import traceback
from os.path import basename
try:
__setFalse = False
except:
import __builtin__
setattr(__builtin__, 'True', 1)
setattr(__builtin__, 'False', 0)
from _pydevd_bundle import pydevd_constants
from _pydevd_bundle.pydevd_constants ... | |
from test.vim_test_case import VimTestCase as _VimTest
from test.constant import *
class TabStopSimpleReplace_ExpectCorrectResult(_VimTest):
snippets = ("hallo", "hallo ${0:End} ${1:Beginning}")
keys = "hallo" + EX + "na" + JF + "Du Nase"
wanted = "hallo Du Nase na"
class TabStopSimpleReplaceZeroLengthTabs... | |
from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
# Standard imports
from future import standard_library
standard_library.install_aliases()
from builtins import str
from builtins import *
from past.utils import old_div
im... | |
# sqlalchemy/pool.py
# Copyright (C) 2005-2012 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Connection pooling for DB-API connections.
Provides a number of connection poo... | |
from django.db.models.aggregates import Count
from django.utils.functional import cached_property
from django.utils.translation import ugettext as _
from dateutil.rrule import DAILY, FR, MO, SA, TH, TU, WE, rrule
from sqlagg.columns import SimpleColumn
from sqlagg.filters import EQ
from sqlagg.sorting import OrderBy
... | |
from Data import Parameters
from Data.Events import ChangeEvent
from Data.Vertex import Vertex
from Data.Objects import IdObject, ObservableObject, NamedObservableObject
__author__ = 'mamj'
components = "xyz"
class Point3d(Vertex, IdObject):
def __init__(self, x=0.0, y=0.0, z=0.0):
Vertex.__init__(self, x, y, z)
... | |
"""
Copyright (c) 2014-2015 F-Secure
See LICENSE for details
"""
import json
import logging
import traceback
from functools import partial
from werkzeug.wrappers import Request, Response
from werkzeug.routing import Map, Rule
from werkzeug import exceptions as http_exceptions
from resource_api.schema import ListField... | |
import urlparse
import sys
import util
import json
import cgi
import multiprocessing
from multiprocessing import Queue
from multiprocessing import Manager
sys.path.append('../')
from util import BackgroundWorker
from urlparse import urlparse, parse_qs
import config as gc
# async_request_queue holds list of active asyn... | |
from __future__ import unicode_literals
import click
from pyinfra import logger
from .connectors import EXECUTION_CONNECTORS
from .connectors.util import remove_any_sudo_askpass_file
from .exceptions import ConnectError, PyinfraError
from .facts import (
create_host_fact,
delete_host_fact,
get_fact_class... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.