text
stringlengths
17
737k
from decimal import Decimal from uuid import uuid4 from django.conf import settings from django.core.validators import MaxValueValidator, MinValueValidator from django.db import models from django.db.models import Q from django.urls import reverse from django.utils.timezone import now from django.utils.translation imp...
#!/usr/bin/python # File: bytes.py # Description: bytes # Created: 2017-06-24 import struct import traceback import sys from .common import format_unknown S_COLOR_RGBA = struct.Struct("4f") SECTION_LEVEL = 99999999 SECTION_TYPE = 66666666 SECTION_LAYER = 77777777 SECTION_LEVEL_INFO = 88888888 SECTION_...
""" A simple VTK input file for PyQt, the qt bindings for python. See http://www.trolltech.com for qt documentation, and http://www.river-bank.demon.co.uk or http://www.thekompany.com for the qt python bindings. This class is based on the vtkGenericRenderWindowInteractor and is therefore fairly powerful. It should al...
"""Level and level object (CustomObject) support.""" from struct import Struct import math from contextlib import contextmanager from .bytes import (BytesModel, Section, S_FLOAT, MAGIC_9, MAGIC_7, MAGIC_6, MAGIC_2, MAGIC_3, MAGIC_5, MAGIC_8, MAGIC_1) from ....
import uuid import java.util from org.eclipse.smarthome.automation import Trigger from org.eclipse.smarthome.automation.handler import TriggerHandler from org.eclipse.smarthome.automation.type import TriggerType from org.eclipse.smarthome.config.core import Configuration import openhab from openhab.jsr223 import scope...
# -*- coding: utf-8 -*- ''' Support for YUM/DNF .. important:: If you feel that Salt should be using this module to manage packages on a minion, and it is using a different module (or gives an error similar to *'pkg.install' is not available*), see :ref:`here <module-provider-override>`. .. note:: ...
import os import json from addie.processing.mantid.master_table.master_table_exporter import TableFileExporter as MantidTableExporter def run_mantid(parent): num_rows = parent.processing_ui.h3_table.rowCount() if num_rows <= 0: print("Cannot import empty table.") return exporter = Mantid...
# -*- coding: utf-8 -*- # # Copyright (C) 2007-2015 by frePPLe bvba # # This library is free software; you can redistribute it and/or modify it # under the terms of the GNU Affero General Public License as published # by the Free Software Foundation; either version 3 of the License, or # (at your option) any later vers...
''' Support for YUM :depends: - yum Python module - rpmUtils Python module ''' # Import python libs import os import logging # Import third party libs try: import yum from rpmUtils.arch import getBaseArch HAS_YUMDEPS = True except (ImportError, AttributeError): HAS_YUMDEPS = False log ...
# -*- coding: utf-8 -*- ''' Package support for openSUSE via the zypper package manager :depends: - ``rpm`` Python module. Install with ``zypper install rpm-python`` ''' # Import python libs from __future__ import absolute_import import copy import logging import re import os # Import 3rd-party libs # pylint: disab...
# -*- coding: utf-8 -*- ''' Package support for openSUSE via the zypper package manager :depends: - ``rpm`` Python module. Install with ``zypper install rpm-python`` .. important:: If you feel that Salt should be using this module to manage packages on a minion, and it is using a different module (or gives a...
# -*- coding: utf-8 -*- ''' Management of Jenkins ===================== .. versionadded:: 2016.3.0 ''' # Import Python libs from __future__ import absolute_import import difflib import logging # Import Salt libs import salt.ext.six as six import salt.utils from salt.exceptions import CommandExecutionError log = lo...
# Copyright 2015 University of Chicago # Available under Apache 2.0 License import os import cStringIO import re import time JOB_STATUS = {'0': 'Unexpanded', '1': 'Idle', '2': 'Running', '3': 'Removed', '4': 'Completed', '5': 'Held', ...
# -*- coding: utf-8 -*- # # Copyright (C) 2005-2006 Edgewall Software # Copyright (C) 2005 Christopher Lenz <cmlenz@gmx.de> # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http://trac....
# -*- coding: utf-8 -*- # # Copyright (C) 2004-2006 Edgewall Software # Copyright (C) 2004-2005 Christopher Lenz <cmlenz@gmx.de> # Copyright (C) 2006 Christian Boos <cboos@neuf.fr> # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this dis...
#!/usr/bin/env python import catalogue class MyLibrary: def __init__(self, name='MyLibrary'): self.name = name self. holdings = [] def has(self, isbn): self.holdings.append(isbn) def find_item(self, isbn): if isbn in self.holdings: return 'http://my.lib/' + is...
# coding=utf-8 """ Command line interface for brandon """ import argparse import logging from junit_xml import TestSuite, TestCase from devpi_builder import requirements, wheeler, devpi logging.basicConfig(level=logging.INFO) logger = logging.getLogger(__name__) class Processor(object): def __init__(self, b...
from sys import getsizeof from typing import ( TYPE_CHECKING, Any, Callable, Hashable, Iterable, List, Optional, Sequence, Tuple, Union, ) import warnings import numpy as np from pandas._config import get_option from pandas._libs import algos as libalgos, index as libindex, li...
#!/usr/bin/env python2.7 import sys import pymongo import ConfigParser import getopt import json def usage(): print "./mongodb.py -c|--config=<file> -d|--database=<dbname>" class Config: config_file = "conf/mongodb.conf" # mongo connection parameters database = "local" connection_string = "mongodb:/...
""" Topographica IPython extension for notebook support. Automatically loaded when importing the topo module but may also be explicitly loaded using: %load_ext topo.misc.ipython """ import os import math import time import difflib import sys import topo import param try: import IPython except: from nose.plu...
import json import os import subprocess from typing import List, Tuple, Mapping class Baton: """ TODO """ def __init__(self, baton_location: str, irods_query_zone: str): """ TODO :param baton_location: :param irods_query_zone: """ self._baton_location =...
#!/usr/bin/env python import sys import os import curses import code import readline import rlcompleter import time sys.path.append('../src') from Bybop_Discovery import * import Bybop_Device BAT_PRINT_X = 5 BAT_PRINT_Y = 2 KEY_PRINT_X = 5 KEY_PRINT_Y = 3 MAV_PRINT_X = 5 MAV_PRINT_Y = 5 GPS_PRINT_X = 5 GPS_PRINT...
""" Plot panels to support GUI windows that display bitmap plots. Related classes include Plot, PlotGroup, and PlotEngine. BasicPlotPanel is the smallest class possible to create a new plot window. Look at it as an example of creating additional subclasses. $Id$ """ import Pmw, re, os, sys from Tkinter import Frame,...
import logging from tor_core.helpers import clean_id from tor_core.helpers import flair from tor_core.helpers import send_to_modchat def flair_post(post, text): """ Sets the requested flair on a given post. Must provide a string which matches an already-available flair template. :param post: A Submi...
import sublime_plugin, sublime, sys, os from sublime import Region from functools import partial from GulpServer.Utils import all_of_type def is_possible_value(setting, possible_values): if isinstance(setting, list): return all([value in possible_values for value in setting]) elif isinstance(setting, dict): ...
#!/usr/bin/env python3 import sys import socketserver import logging import json import subprocess from lib.LDAPHelper import run_query HOST = "" PORT = 0 LDAP_CONFIG = "" EXTERNAL_SCRIPT = "" LAST_RUN = "lastrun" # Defines what happens after a connection has been made class MyTCPHandler(socketserver.StreamRequestH...
# -*- coding: UTF-8 # config # ****** # # GlobaLeaks Utility Functions from datetime import datetime, timedelta import logging import re import os import time import traceback from OpenSSL import SSL from twisted.internet.endpoints import TCP4ClientEndpoint from txsocksx.client import SOCKS5ClientEndpoint from tx...
__author__ = 'chuqiao' import csv import urllib2 import pysolr import logging import sys def logger(): """ Function that initialises logging system """ global logger # create logger with 'syncsolr' logger = logging.getLogger('syncsolr') logger.setLevel(logging.DEBUG) # specifies th...
import sys import time sys.path.append('/home/bo1mesx/lib/Evolib') from evolib.iterators import vcf_iter ###### #args = sys.argv[1:] #subsample_file = open(args[0], 'r') #subsamples = [s.rstrip() for s in subsample_file] #print subsamples ###### #chr_num = [1270, 2063, 3047, 3208, 3357, 3750, 3913, 4111, 4944, 9...
#!/usr/bin/env python from optparse import (OptionParser,BadOptionError,AmbiguousOptionError) import inspect import sys import os from functools import wraps import types import unittest USAGE = "Usage: fibi [options] command [command args]" EXAMPLES = """Examples: TODO """ COMMAND_ATTR = "_command" # from http:/...
# -*- coding: utf-8 -*- import json from os.path import dirname, abspath, join __all__ = ['load_codes', 'language_codes'] def load_codes(file): ''' Opens up file located under the etc directory containing language codes and prints them out ''' filepath = abspath(join(dirname(__file__), 'etc', fi...
import os import subprocess import sys from io import BytesIO, StringIO try: # Needed for Python < 3.3, works up to 3.8 import xml.etree.cElementTree as etree except ImportError: # Python 3.9 onwards import xml.etree.ElementTree as etree from subprocess import Popen from textwrap import dedent from un...
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo.tests.common import TransactionCase from odoo.exceptions import AccessError, UserError class TestCommonTimesheet(TransactionCase): def setUp(self): super(TestCommonTimesheet, self).setUp() ...
# Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2016, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This program is free software: you can redistribute it and/or modify # it under the ...
''' Created on Feb 20, 2013 @author: Maribel Acosta @author: Fabian Floeck ''' from wmf import dump from difflib import Differ from time import time from structures.Revision import Revision from structures.Paragraph import Paragraph from structures.Sentence import Sentence from structures.Word import Word from str...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2016 Peerchemist # # 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 ve...
import re import time import unicodedata from datetime import date import simplejson as json from django.contrib.auth.models import User from django.db import models from django.utils import timezone from jsonfield import JSONField import clients.models as Clients import directory.models as directory import slog.models...
from collections import defaultdict from collections import Counter from sqlalchemy.sql.expression import bindparam from datetime import datetime def match(objects, session, default={}, keepexisting=False, commit=True): """ Pass in several objects and make them equal Args: objects: A list of RawO...
""" Simple pipeline data processing =============================== A simple coroutine-based method for creating data processing pipelines. Example:: @pipefilter def add2(a, b, target): while True: item = (yield) value = a+b + item print(" {} + {} + {}...
############################################################################### # MIT License # # Copyright (c) 2017 Hajime Nakagami # # 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 ...
# -*- coding: utf-8 -*- import logging from cerberus import Validator log = logging.getLogger(__name__) def has_level(level): """ Checks if user has required userlevel :param level: Required userlevel """ def _inner_has_privileges(method): def inner(instance, *args, **kwargs): if...
# This file is part of beets. # Copyright 2013, Verrus, <github.com/Verrus/beets-plugin-featInTitle> # # 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...
# ====================================================================== # matscipy - Python materials science tools # https://github.com/libAtoms/matscipy # # Copyright (2019) Johannes Hoermann, University of Freiburg # # This program is free software: you can redistribute it and/or modify # it under the terms of the ...
#!/usr/bin/python -u # # pagekite.py, Copyright 2010, the Beanstalks Project ehf. # and Bjarni Runar Einarsson # # FIXME: Implement epoll() support. # FIXME: Stress test this thing: when do we need a C rewrite? # FIXME: Make multi-process, use the FD-over-socket trick? Threads=>GIL=>ble...
# -*- coding: utf-8 -*- # # This file is part of Export Layers. # # Copyright (C) 2013-2017 khalim19 <khalim19@gmail.com> # # Export Layers 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 t...
"""Coverage plugin for pytest.""" import os import pytest from coverage.misc import CoverageException from . import embed from . import engine class CoverageError(Exception): """Indicates that our coverage is too low""" def pytest_addoption(parser): """Add options to control coverage.""" group = pars...
#!/usr/bin/env python # Hyss.py # Copyright (C) 2006 CCLRC, Graeme Winter # # This code is distributed under the terms and conditions of the # CCP4 Program Suite Licence Agreement as a CCP4 Library. # A copy of the CCP4 licence can be obtained by writing to the # CCP4 Secretary, Daresbury Laboratory, Warringt...
#!/usr/bin/python # -*- coding: utf-8 -*- """ 2016-06-16, 2016M-1.0 lzj Remove overscan For bok """ import numpy as np import astropy.stats from common import * from .constant import const def rm_os (dat, log, do_fit=False, sigma_clip=False) : """ Remove overscan from data, using only one side oversc...
import time from random import uniform from decorator import decorator from fabric import state from fabric.api import execute, get, parallel, put, run, settings from fabric.exceptions import CommandTimeout from logger import logger from perfrunner.helpers.misc import uhex @decorator def all_hosts(task, *args, **ka...
import os import shutil import hashlib import re import json import six from git.repo import Repo from lockfile import LockFile from st2actions.runners.pythonrunner import Action ALL_PACKS = '*' PACK_REPO_ROOT = 'packs' MANIFEST_FILE = 'pack.yaml' CONFIG_FILE = 'config.yaml' GITINFO_FILE = '.gitinfo' PACK_RESERVE_CH...
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import requests from PIL import Image import base64 import datetime import io import json import re from werkzeug import urls from odoo import api, fields, models, SUPERUSER_ID, _ from odoo.addons.http_routing.models.i...
#!/usr/bin/env python #============================================================================================= # MODULE DOCSTRING #============================================================================================= """ Test YAML functions. """ #=======================================================...
''' Attempt to automate steps necessary for uploading stuff to Google Drive. Based on steps listed on: https://developers.google.com/drive/quickstart-python 1. Enable the Drive API 1. Create API project https://code.google.com/apis/console/?pli=1 2. Enable the Drive API in Services 3. Open API Access tab an...
from collections import namedtuple from functools import partial import numpy as np import pandas as pd import pyqtgraph as pg from pyqtgraph.Qt import QtGui, QtCore from graphysio import algorithms, exporter, utils Point = namedtuple('Point', ['x', 'y']) Cardinals = namedtuple('Cardinals', ['A', 'B', 'C']) Ang...
from numbers import Integral from .iter_dispatch import range_iterator __all__ = ['xrange'] def _check_integral(value): if not isinstance(value, Integral): raise TypeError("'{}' object cannot be interpreted " "as an integer".format(type(value).__name__)) class xrange(object): ...
#!/usr/bin/env python # vim: ai ts=4 sts=4 et sw=4 class Message(object): def __init__(self, backend, caller=None, text=None): self._backend = backend self.caller = caller self.text = text # initialize some empty attributes self.received = None self.sent =...
""" ========================================================== File: WakaTime.py Description: Automatic time tracking for Sublime Text 2 and 3. Maintainer: WakaTime <support@wakatime.com> License: BSD, see LICENSE for more details. Website: https://wakatime.com/ =========================================...
# -*- coding: utf-8 -*- """ documentation """ from __future__ import division, unicode_literals, print_function import sys import atexit from os.path import isfile from tempfile import TemporaryFile from .. import Debug def next_free_filename(prefix, suffix): n = 0 while isfile(prefix + '%04d' % (n,) + suff...
import ConfigParser import json import logging import os import subprocess import sys import botocore.session DEFAULT_CACHE_FILE = '~/.cache/boosh/hosts' DEFAULT_BOOSH_CONFIG = '~/.aws/boosh' logger = logging.getLogger('boosh.ssh') class ConfigBase(object): defaults = {} bool_keys = () multistring_keys...
# This file is part of Indico. # Copyright (C) 2002 - 2014 European Organization for Nuclear Research (CERN). # # Indico 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 (a...
import openerp from openerp import SUPERUSER_ID from openerp.addons.web import http from openerp.addons.web.http import request import werkzeug import datetime import time import uuid from functools import wraps from openerp.tools.translate import _ class SignupError(Exception): pass class calculator(http.Contro...
import os from dataclasses import dataclass, field from typing import List, Optional import log from .. import common, exceptions, git, shell @dataclass class Link: source: str = '' target: str = '' @dataclass class Source: """A dictionary of `git` and `ln` arguments.""" repo: str = '' name: ...
import numpy as np #from . import njit #@njit def derivative(f, t, dfdt): """Fourth-order finite-differencing with non-uniform time steps The formula for this finite difference comes from Eq. (A 5b) of "Derivative formulas and errors for non-uniformly spaced points" by M. K. Bowen and Ronald Smith. A...
########################## LICENCE ############################### ## ## Copyright (c) 2005-2011, Michele Simionato ## All rights reserved. ## ## Redistributions of source code must retain the above copyright ## notice, this list of conditions and the following disclaimer. ## Redistributions in byteco...
# # Copyright (C) (2013) STFC Rutherford Appleton Laboratory, UK. # # Author: David Waterman. # # This code is distributed under the BSD license, a copy of which is # included in the root directory of this package. # """Auxiliary functions for the refinement package""" from __future__ import division from math im...
# coding: utf-8 # # Copyright 2014 The Oppia 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 requi...
import sys, getopt import fff2_input_models as fim def main(argv): inargs1 = 'ht:c:o:i:n:s:l' snargs1 = inargs1[1:].split(':') inargs2 = ['time','cmsdir','outdir','ifile',"nproc","minmod","maxmod"] helpinfo = "create_model_files_wrapper.py is a command line utility which calls the class create_mode...
# # # Atrous Python XTension # # Copyright (C) 2014 Egor Zindy <egor.zindy@manchester.ac.uk>, MIT license # # <CustomTools> # <Menu name = "Python plugins"> # <Item name="Wavelet analysis" icon="Python" tooltip="Wavelet analysis for Imaris (2D and 3D kernels)."> # <Command>PythonXT::X...
""" Low-level LAPACK functions ========================== This module contains low-level functions from the LAPACK library. .. versionadded:: 0.12.0 .. warning:: These functions do little to no error checking. It is possible to cause crashes by mis-using them, so prefer using the higher-level routines in `...
# $Id$ # Copyright (C) 1998-2001 Michael Haggerty <mhagger@alum.mit.edu> # # 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 versi...
import corehq.apps.app_manager.util as util from corehq.apps.app_manager.models import ( Module, AdvancedModule, FormSchedule, ScheduleVisit, Application, LoadUpdateAction, ) from corehq.apps.app_manager.tests.app_factory import AppFactory from corehq.apps.app_manager.tests.util import TestXmlMi...
from bs4 import BeautifulSoup import re import urllib.request # returns a list of the id numbers (strings) for every listing matching a certain search criteria, up to num_pages def get_page_ids(position="software+engineer", location="California", num_pages=1): #use "+" for spaces base_url = "http://www.indeed.com...
import sys try: from collections import MutableMapping except ImportError: from collections.abc import MutableMapping try: import simplejson as json except ImportError: try: import json except ImportError: try: # Google Appengine offers simplejson via django ...
#!/usr/bin/env python import os import sys if not os.path.exists('.tox/configure'): import virtualenv import subprocess print("Bootstrapping ...") virtualenv.create_environment('.tox/configure') print("Installing `jinja2` and `matrix` into bootstrap environment ...") if sys.platform == 'win32': ...
#!/usr/bin/env python3 # Copyright (c) 2015 Chris Olstrom <chris@olstrom.com> # # 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 #...
''' This file is part of ConfigShell. Copyright (c) 2011-2013 by Datera, 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 appli...
import uuid from django.test import SimpleTestCase from corehq.apps.cloudcare.touchforms_api import get_user_contributions_to_touchforms_session from corehq.apps.sms.models import CommConnectCase from corehq.apps.users.models import CommCareUser, WebUser class SessionUtilsTest(SimpleTestCase): def test_load_sess...
# import math # # import constants # from lib.connectwise_py.connectwise.ticket import Ticket # from lib.connectwise_py.connectwise.time_entry import TimeEntry # from .system_report import SystemReport from decimal import Decimal from pprint import pprint from .connectwise import Connectwise class Product: def _...
# # ICRAR - International Centre for Radio Astronomy Research # (c) UWA - The University of Western Australia, 2015 # Copyright by UWA (in the framework of the ICRAR) # All rights reserved # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser G...
"""Switch controller which handles all switches in MPF. Contains the SwitchController class which is responsible for reading switch states and posting events to the framework. """ import logging from collections import defaultdict, namedtuple import asyncio from functools import partial from mpf.core.case_insensiti...
from kernel_common import * class CCL(object): def __init__(self, img_size, img_dtype, label_dtype, connectivity_dtype=np.uint32, debug=False, best_wg_size = default_wg_size): self.img_size = img_size self.img_dtype = img_dtype self.label_dtype = label_dtype self.connectivity_dtype ...
#!/usr/bin/env python # encoding: utf-8 """ blocked_region.py - find the blocked region and return its location Created by CDW on 2015.10.13 """ # System imports import warnings import numpy as np import cv2 import matplotlib.pyplot as plt ## Contour processing def find_blocked_region(img, plot=False): """Loca...
from ipaddress import IPv4Interface # NOQA import os from shutil import rmtree from typing import Any, List, Optional, Tuple # NOQA from warnings import warn from netns import NetNS as nsscope from iptc import Chain, Match, Policy, Rule, Table, Target from pyroute2 import IPRoute from pyroute2 import NetlinkError ...
"""Autonomous control client that solves IEEE Hardware Competition 2014.""" import sys import bot.lib.lib as lib import bot.client.ctrl_client as ctrl_client_mod import bot.client.sub_client as sub_client_mod import bot.activity_solver as act_mod class Pilot: """Autonomous control client based on comprehensive s...
#!/usr/bin/env python description = "> process lsc data " import re import numpy as np from argparse import ArgumentParser from datetime import datetime, timedelta import lsc from multiprocessing import Pool def multi_run_cosmic(args): return lsc.myloopdef.run_cosmic(*args) # ##################################...
# Copyright (c) 2016 Ultimaker B.V. # Cura is released under the terms of the AGPLv3 or higher. from PyQt5.QtCore import QObject, pyqtSlot, pyqtProperty, pyqtSignal import UM.Settings from UM.Application import Application import cura.Settings from UM.Logger import Logger ## The settingInheritance manager is resp...
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: """The fsl module provides classes for interfacing with the `FSL <http://www.fmrib.ox.ac.uk/fsl/index.html>`_ command line tools. This was written to work with FSL version 4.1.4. These are the base tools ...
# Natural Language Toolkit: WordNet # # Copyright (C) 2001-2009 NLTK Project # Author: Steven Bethard <Steven.Bethard@colorado.edu> # Steven Bird <sb@csse.unimelb.edu.au> # Edward Loper <edloper@gradient.cis.upenn.edu> # URL: <http://www.nltk.org/> # For license information, see LICENSE.TXT im...
import unittest import tensorflow as tf import facenet import numpy.testing as testing class BatchNormTest(unittest.TestCase): def testBatchNorm(self): tf.set_random_seed(123) x = tf.placeholder(tf.float32, [None, 20, 20, 10], name='input') phase_train = tf.placeholder(tf.bool, name='ph...
''' Warning: this module requires Python 3.2 or higher It's also in an initial development phase, so either don't use it or be tolerant of API changes. ''' import re class FunctionalAnnotation: """ While recognizing that an enormous variety of attributes could go here in describing the functional annotat...
# -*- coding: utf-8 -*- # # BridgeDB by Nick Mathewson. # Copyright (c) 2007-2009, The Tor Project, Inc. # See LICENSE for licensing information """ This module sets up a bridgedb and starts the servers running. """ import os import signal import sys import time import logging import logging.handlers import gettext ...
# -*- coding: utf-8 -*- import os import json import logging from ruamel.yaml import YAML import sys import copy import errno from glob import glob from six import string_types import datetime import shutil import importlib from .util import NormalizedDataAssetName, get_slack_callback, safe_mmkdir from ..types.base i...
''' Copyright 2016 Vsevolod Kolchinsky 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 ...
#!/usr/bin/env python # Copyright (C) 2010-2015 Cuckoo Foundation. # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org # See the file 'docs/LICENSE' for copying permission. import random import logging from threading import Thread from ctypes import WINFUNCTYPE, POINTER from ctypes import c_bool, c_in...
#!/usr/bin/env python # Copyright (C) 2010-2015 Cuckoo Foundation. # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org # See the file 'docs/LICENSE' for copying permission. import random import logging from threading import Thread from ctypes import WINFUNCTYPE, POINTER from ctypes import c_bool, c_in...
# coding=utf-8 # Copyright 2022 DeepMind Technologies Limited. # # 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 applic...
# # spyne - Copyright (C) Spyne contributors. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This libra...
import numpy as np from sklearn.neighbors import KDTree from tqdm import tqdm from .Model import MainModel from ..analysis import spk_time_to_scv from .View import MainView from ..base import CLU from ..utils import warning, conf, order_label, shift_label from ..utils.utils import Timer from ..base.SPK import _transfo...
from collection import Collection, Scorer from clustering import Clustering, Partition from distance_matrix import DistanceMatrix from optimiser import Optimiser from plotter import Plotter from lib.remote.utils import fileIO
#!/usr/local/bin/python -tO # $Id$ # A more complicated gnuplot interface. # Written by Michael Haggerty <mhagger@blizzard.harvard.edu> # Derived from earlier version by Konrad Hinsen <hinsen@ibs.ibs.fr> # New features: # + A gnuplot session is an instance of class `gnuplot', so multiple # sessions can be open...