text
stringlengths
475
200k
import os import sys from select import select from subprocess import Popen, PIPE import rpyc err = "" def handleInterpreter(conn, fd, data): global err if fd == p.stderr.fileno(): datastr = str(data, 'utf8') if datastr == '>>> ': return if 'Type "help", "co...
from sympy.utilities.pytest import raises, USE_PYTEST if USE_PYTEST: import py.test pytestmark = py.test.mark.skipif(USE_PYTEST, reason=("using py.test")) # Test callables def test_expected_exception_is_silent_callable(): def f(): raise ValueError() raise...
import eventlet import json from flask import request, json, Flask, Response # noqa from st2reactor.sensor.base import Sensor eventlet.monkey_patch( os=True, select=True, socket=True, thread=True, time=True) class SmartThingsSensor(Sensor): def __init__(self, sensor_service, config=None): ...
from __future__ import absolute_import from __future__ import division from __future__ import print_function from collections import namedtuple from copy import copy, deepcopy from datetime import datetime, timedelta from textwrap import dedent import pytest from distutils.version import LooseVersion import numpy as n...
#!/usr/bin/python # This file is part of Ansible # # Ansible 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. # # Ansible is distributed...
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j F Y' # '20 januari 2009' TIME_FORMAT = 'H:i' ...
#!/usr/bin/env python from omics_pipe.parameters.default_parameters import default_parameters from omics_pipe.utils import * p = Bunch(default_parameters) def bwa1(sample, bwa1_flag): '''BWA aligner for read1 of paired_end reads. input: .fastq output: .sam citation: Li...
# Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # http://code.google.com/p/protobuf/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions o...
#!/usr/bin/env python3 """JACK client that creates minor triads from single MIDI notes. All MIDI events are passed through. Two additional events are created for each NoteOn and NoteOff event. """ import jack import struct # First 4 bits of status byte: NOTEON = 0x9 NOTEOFF = 0x8 INTERVALS = 3, 7 # minor triad c...
""" Copyright (c) 2004-Present Pivotal Software, Inc. This program and the accompanying materials are made available under the terms of the 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....
# Copyright (C) 2010 Google 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: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
# Copyright (C) 2009-2015 by the Free Software Foundation, Inc. # # This file is part of GNU Mailman. # # GNU Mailman 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 you...
# -*- coding: utf-8 -*- # Generated by Django 1.11.29 on 2020-04-15 23:27 from __future__ import unicode_literals from django.db import migrations import django.db.models.manager class Migration(migrations.Migration): # This flag is used to mark that a migration shouldn't be automatically run in # production...
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Removing unique constraint on 'Project', fields ['slug'] db.delete_unique('sentry_project', ['slug']) ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- #################################################################################################################################################################################################################################### ############################################...
# Copyright 2012 Locaweb. # 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 appli...
# vim:fileencoding=utf-8:noet from __future__ import (unicode_literals, division, absolute_import, print_function) import os from threading import Lock from copy import deepcopy from time import sleep from functools import wraps from powerline.renderer import Renderer from powerline.lib.config import ConfigLoader fr...
import os.path import sys from warnings import warn try: _console = sys._jy_console _reader = _console.reader except AttributeError: raise ImportError("Cannot access JLine2 setup") try: # jarjar-ed version from org.python.jline.console.history import MemoryHistory except ImportError: # dev ver...
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, 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 progra...
# -*- coding: utf-8 -*- """ Created on Thu Jan 07 17:44:20 2016 A module to store operations related to matrix tranformations. @author: Luke """ import Point as p import Line as l import constants as c import numpy import math def translateMatrix(shiftX, shiftY, shiftZ=0): transMatrix = numpy.identity(4) t...
import numpy as np from numpy.testing import assert_array_equal from nose import with_setup from nose.tools import (assert_equal, assert_raises) try: from nose.tools import assert_is except ImportError: from landlab.testing.tools import assert_is from landlab.grid import raster_funcs as rfuncs from landlab imp...
# -*- coding: utf-8 -*- from __future__ import unicode_literals import sys, os # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. ...
# -*- coding: utf-8 -*- # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import glob import os import shutil import sys import zlib from distutils.core impo...
import pkg_resources try: from collections import OrderedDict except ImportError: from ordereddict import OrderedDict class Core(object): @classmethod def js_package(cls): return __package__ @classmethod def css_package(cls): return __package__ @classmethod def image_...
# -*- coding: utf-8 -*- # Copyright (C) 2011 Chris Dekter # # 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 3 of the License, or # (at your option) any later version. # # This pr...
# Copyright 2016 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 absolute_import import json import os import sys import yaml import pytest myPath = os.path.abspath(os.getcwd()) sys.path.insert(0, myPath) import hubblestack.extmods.fdg.readfile class TestReadfile(): ''' Class used to test the functions in ``readfile.py`` ''' def generate_d...
# -*- coding: utf-8 -*- from __future__ import print_function, division import keyword as kw import sympy from .repr import ReprPrinter from .str import StrPrinter # A list of classes that should be printed using StrPrinter STRPRINT = ("Add", "Infinity", "Integer", "Mul", "NegativeInfinity", "Pow", "Zero...
# Copyright (c) 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/LICEN...
from __future__ import print_function from contextlib import closing from PIL import ImageChops, ImageStat from videosequence import VideoSequence def assert_images_not_equal(im1, im2): diff = ImageChops.difference(im1, im2) for min_, max_ in ImageStat.Stat(diff).extrema: if max_ > 0: retu...
# 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 2014 OneConvergence, Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requir...
from __future__ import unicode_literals from .common import InfoExtractor class EbaumsWorldIE(InfoExtractor): _VALID_URL = r'https?://www\.ebaumsworld\.com/video/watch/(?P<id>\d+)' _TEST = { 'url': 'http://www.ebaumsworld.com/video/watch/83367677/', 'info_dict': { 'id': '83367677...
def thrustDice(value): if value <= 10: return 1 if value < 40: return (value - 11) // 8 + 1 if value < 60: return (value - 5) // 10 + 1 return (value) // 10 + 1 def thrustModifier(value): if value <= 10: return (value - 11) // 2 - 1 if value < 40: return...
""" FCKeditor - The text editor for Internet - http://www.fckeditor.net Copyright (C) 2003-2007 Frederico Caldeira Knabben == BEGIN LICENSE == Licensed under the terms of any of the following licenses at your choice: - GNU General Public License Version 2 or later (the "GPL") http://www.gnu.org/license...
#!/usr/bin/env python __all__ = ['Cube', 'Cylinder', 'Cone', 'Sphere', 'Circle', 'Plane', 'Tetrahedron', 'Octahedron', 'Icosahedron', 'Torus', 'TorusKnot', 'Tube'] import numpy as np # This is a ...
# -*- coding: utf-8 -*- """ oauthlib.oauth1.rfc5849.signature ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This module represents a direct implementation of `section 3.4`_ of the spec. Terminology: * Client: software interfacing with an OAuth API * Server: the API provider * Resource Owner: the user who is granting authoriza...
#!/usr/bin/env python # # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Runs findbugs, and returns an error code if there are new warnings. This runs findbugs with an additional flag to exclude know...
# Copyright (c) 2010 Spotify AB # Copyright (c) 2012 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. # 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"),...
# tags.py -- map tags from one namespace to another # Copyright 2016 Ben Elliston # This file 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 v...
from kivy.adapters.dictadapter import DictAdapter from kivy.uix.selectableview import SelectableView from kivy.uix.boxlayout import BoxLayout from kivy.uix.gridlayout import GridLayout from kivy.uix.listview import ListView, ListItemButton from kivy.lang import Builder from kivy.factory import Factory from fixtures im...
#!/usr/bin/env python """\ ASCII art to image converter. This is the main module that contains the parser. See svg.py and aa.py for output modules, that can render the parsed structure. (C) 2006-2009 Chris Liechti <[EMAIL]> This is open source software under the BSD license. See LICENSE.txt for more details. """ i...
# # iso2022_jp_1.py: Python Unicode Codec for ISO2022_JP_1 # # Written by Hye-Shik Chang <[EMAIL]> # import _codecs_iso2022, codecs import _multibytecodec as mbc codec = _codecs_iso2022.getcodec('iso2022_jp_1') class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class IncrementalEncoder(m...
import os import os.path as osp import xml.etree.ElementTree as ET import numpy as np import scipy.sparse import scipy.io as sio # from utils.cython_bbox import bbox_overlaps years = {'2013': '2013', '2014': ['0000', '0001', '0002', '0003', '0004', '0005', '0006']} name = 'ILSVRC' _MAX_TRAIN_NUM = 20000 ...
# Copyright (c) 2015, Scott J Maddox. All rights reserved. # Use of this source code is governed by the BSD-3-Clause # license that can be found in the LICENSE file. ''' Uses numerical integration to calculate accurate values to test against. This should only be run after `python setup.py build_ext --inplace`. ''' im...
from django.contrib.auth.mixins import PermissionRequiredMixin from django.urls import reverse from django.views.generic import FormView, ListView from osf.models import OSFGroup from admin.osf_groups.forms import OSFGroupSearchForm from admin.base.views import GuidView from admin.osf_groups.serializers import seriali...
"""Certificates API This is a Python API for generating certificates asynchronously. Other Django apps should use the API functions defined in this module rather than importing Django models directly. """ import logging from django.conf import settings from django.core.urlresolvers import reverse from eventtracking ...
""" Update all copyright notices to the current year. Does a search for a specific copyright notice of last year and replaces it with a version for this year. Other copyright mentionings are listed, but left unmodified. If an argument is given, use that as the name of the copyright holder, otherwise use the name speci...
# # @BEGIN LICENSE # # Psi4: an open-source quantum chemistry software package # # Copyright (c) 2007-2021 The Psi4 Developers. # # The copyrights for code used from other parties are included in # the corresponding files. # # This file is part of Psi4. # # Psi4 is free software; you can redistribute it and/or modify #...
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'd F Y' TIME_FORMAT = 'H:i:s' DATE...
THOST_FTDC_EXP_Normal = '0' THOST_FTDC_EXP_GenOrderByTrade = '1' THOST_FTDC_ICT_EID = '0' THOST_FTDC_ICT_IDCard = '1' THOST_FTDC_ICT_OfficerIDCard = '2' THOST_FTDC_ICT_PoliceIDCard = '3' THOST_FTDC_ICT_SoldierIDCard = '4' THOST_FTDC_ICT_HouseholdRegister = '5' THOST_FTDC_ICT_Passport = '6' THOST_FTDC_ICT_TaiwanCompatri...
# tested with python2.7 and 3.4 from spyre import server import pandas as pd import json try: import urllib2 except ImportError: import urllib.request as urllib2 class StockExample(server.App): def __init__(self): # implements a simple caching mechanism to avoid multiple calls to the yahoo finance api self.d...
"""Pseudo terminal utilities.""" # Bugs: No signal handling. Doesn't set slave termios and window size. # Only tested on Linux. # See: W. Richard Stevens. 1992. Advanced Programming in the # UNIX Environment. Chapter 19. # Author: Steen Lumholt -- with additions by Guido. from select import select imp...
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers import pybindgen.settings import warnings class ErrorHandler(pybindgen.settings.ErrorHandler): def handle_error(self, wrapper, exception, traceback_): warnings.warn("exception %r in wrapper %s" % (exception, wrapper)) ...
# Module doctest. # Released to the public domain 16-Jan-2001, by Tim Peters ([EMAIL]). # Major enhancements and refactoring by: # Jim Fulton # Edward Loper # Provided as-is; use at your own risk; no warranty; no promises; enjoy! r"""Module doctest -- a framework for running examples in docstrings. In simple...
#!/usr/bin/env python3 # Copyright (c) 2014-2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # Exercise the wallet keypool, and interaction with wallet encryption/locking from test_framework.test_f...
from collections import OrderedDict import glob import os try: # Python 3 from urllib.parse import urlparse, parse_qs except ImportError: # Python 2 from urlparse import urlparse, parse_qs import IPython.display import cartopy.crs as ccrs import ipywidgets import iris import iris.plot as iplt import ma...
"""Benchmarks of Lasso regularization path computation using Lars and CD The input data is mostly low rank but is a fat infinite tail. """ from __future__ import print_function from collections import defaultdict import gc import sys from time import time import numpy as np from sklearn.linear_model import lars_pat...
# Copyright 2016 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 # -*- coding: windows-1251 -*- # Copyright (C) 2005 Roman V. Kiseliov # 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 reta...
# """ # @package mi.instrument.ooici.mi.test_driver.driver # @file marine-integrations/mi/instrument/ooici/mi/test_driver/driver.py # @author Bill French # @brief Driver for the test_driver # Release notes: # # This driver is used for coi testing # # """ # # __author__ = 'Bill French' # __license__ = 'Apache 2.0' # # i...
# -*- coding: utf-8 -*- # Copyright(C) 2013 Julien Veyssier # # This file is part of weboob. # # weboob 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 op...
import time import select import socket import struct import threading import errno from .amspacket import AmsPacket from .adsconnection import AdsConnection from .adsexception import AdsException from .commands import * class InvalidPacket(AdsException): pass class AdsClient: def __init__(self, adsConnecti...
import sys import os import re def print_environ(environ=os.environ): """Dump the shell environment as HTML.""" keys = environ.keys() keys.sort() i = 0 for key in keys: if not re.search("^HTTP_|^REQUEST_", key): continue if i == 0: print """<tr class="normal"><td>""",...
# -*- coding: utf-8 -*- import sys import os import math #读写文件接口函数文件函数 def read_write_file(rfname,wfname,resource_files): readf = open(rfname,'r') writef = open(wfname,'w') for line in readf: #add other functions to deal with each line result_line = location_extr(line.strip(),resource_files) writef.write(re...
from sqlalchemy import Unicode, Date, Integer from sqlalchemy.schema import Column, ForeignKey from sqlalchemy.orm import relationship import sqlalchemy.types from camelot.admin.entity_admin import EntityAdmin from camelot.core.orm import Entity import camelot.types class Movie( Entity ): __tablename__ ...
""" This is the play """ import numpy as np import matplotlib.pyplot as plt import math from sklearn.cluster import KMeans from sklearn.datasets import make_blobs from functions import selection_algorithm, scl from csl import CSL plot = True verbose = False tracking = True selection = False # Generate the data n_sa...
data = ( 's', # 0x00 't', # 0x01 'u', # 0x02 'v', # 0x03 'w', # 0x04 'x', # 0x05 'y', # 0x06 'z', # 0x07 'A', # 0x08 'B', # 0x09 'C', # 0x0a 'D', # 0x0b 'E', # 0x0c 'F', # 0x0d 'G', # 0x0e 'H', # 0x0f 'I', # 0x10 'J', # 0x11 'K', # 0x12 'L', # 0x13 'M', # 0...
#!/usr/bin/env python # Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import unittest from api_list_data_source import APIListDataSource from compiled_file_system import CompiledFileSystem from copy import...
""" :mod: DataManager .. module: DataManager :synopsis: DataManager links the functionalities of StorageElement and FileCatalog. This module consists of DataManager and related classes. """ # # imports from datetime import datetime, timedelta import fnmatch import os import time import errno # # from DIRAC import...
from keras.models import Graph from keras.layers.convolutional import Convolution2D, MaxPooling2D, ZeroPadding2D from keras.layers.advanced_activations import PReLU import datetime ''' Inception v3 paper http://arxiv.org/pdf/1512.00567v1.pdf Old inception paper http://arxiv.org/pdf/1409.4842.pdf ''' def activation_fu...
from __future__ import absolute_import, unicode_literals import os import pytest from case import Mock, mock, patch from celery.bin.base import Command, Extensions, Option from celery.five import bytes_if_py2 class MyApp(object): user_options = {'preload': None} APP = MyApp() # <-- Used by test_with_custom_...
""" Example of parallel implementation of betweenness centrality using the multiprocessing module from Python Standard Library. The function betweenness centrality accepts a bunch of nodes and computes the contribution of those nodes to the betweenness centrality of the whole network. Here we divide the network in chu...
# Copyright 2014 Rackspace, Andrew Melton # # 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...
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2016, René Moser <[EMAIL]> # # This file is part of Ansible # # Ansible 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 # (...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ This script will be used to create test data set. It is also called by: - test_small_file_rule.py - test_small_file_actions.py """ import sys import ast import os import re import argparse from util import * def create_test_set(file_set_nums, file_size, base_dir, deb...
import numpy.lib.stride_tricks import numpy as np from scipy.fft import rfft2, irfft2, fftshift from numpy import ma from scipy.signal import convolve2d from numpy import log """This module contains a pure python implementation of the basic cross-correlation algorithm for PIV image processing.""" __licence_ = """ Cop...
#!/usr/bin/python # # This file is part of Ansible # # Ansible 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. # # Ansible is distribut...
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright: (c) 2017, F5 Networks Inc. # GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
# Copyright 2013 Cloudbase Solutions Srl # 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 r...
# Copyright 2015 IBM Corp. # 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 app...
#!/usr/bin/env python # # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # # <LicenseText> # # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # class Inlet(object): def __init__(self): self._handle = None return def impose(sel...
from django.contrib.gis.db import models from django.contrib.gis.tests.utils import mysql, spatialite from django.utils.encoding import python_2_unicode_compatible # MySQL spatial indices can't handle NULL geometries. null_flag = not mysql @python_2_unicode_compatible class Country(models.Model): name = models.Ch...
import os import os.path import numpy from numpy.distutils.misc_util import Configuration from sklearn._build_utils import get_blas_info def configuration(parent_package="", top_path=None): config = Configuration("metrics", parent_package, top_path) cblas_libs, blas_info = get_blas_info() if os.name ==...
''' Allison Lewko, Amit Sahai and Brent Waters (Pairing-based) | From: "Revocation Systems with Very Small Private Keys" | Published in: IEEE S&P 2010 | Available from: http://eprint.iacr.org/2008/309.pdf | Notes: fully secure IBE Construction with revocable keys. * type: identity-based encryption (public ...
#!python """Bootstrap setuptools installation If you want to use setuptools in your package's setup.py, just include this file in the same directory with it, and add this to the top of your setup.py:: from ez_setup import use_setuptools use_setuptools() If you want to require a specific version of setuptools...
#!/usr/bin/env python # coding=utf8 caOpensslConf = ''' #http://www.phildev.net/ssl/opensslconf.html [ ca ] default_ca = CA_default [CA_default] caroot = %(caroot)s certs = $caroot/certsdb new_certs_dir = $certs database = $caroot/index.txt certificate = $caroot/%(cn)s.cer private_key = $caro...
import time import datetime import sqlite3 conn = sqlite3.connect('diary.db') c = conn.cursor() c.execute('''CREATE TABLE executive (unid INTEGER PRIMARY KEY,name text,designation text, abs text)''') no_of_exec = input() #enter the total number of executives while(no_of_exec): no_of_exec = no...
from tests.compat import OrderedDict from tests.unit import unittest from tests.unit import AWSMockServiceTestCase from boto.vpc import VPCConnection, Subnet class TestDescribeSubnets(AWSMockServiceTestCase): connection_class = VPCConnection def default_body(self): return b""" <Describe...
#!/usr/bin/env python import jumeg import os.path raw_fname = "109925_CAU01A_100715_0842_2_c,rfDC-raw.fif" if not os.path.isfile(raw_fname): print("Please find the test file at the below location on the meg_store2 network drive - \ cp /data/meg_store2/fif_data/jumeg_test_data/109925_CAU01A_100715_0842_...
# -*- coding: utf-8 -*- # # This file is part of EventGhost. # Copyright © 2005-2016 EventGhost Project <http://www.eventghost.net/> # # EventGhost 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 versio...
"""Utilities for writing code that runs on Python 2 and 3""" # Copyright (c) 2010-2014 Benjamin Peterson # # 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 with...
# Authors: Pearu Peterson, Pauli Virtanen, John Travers """ First-order ODE integrators. User-friendly interface to various numerical integrators for solving a system of first order ODEs with prescribed initial conditions:: d y(t)[i] --------- = f(t,y(t))[i], d t y(t=0)[i] = y0[i], where:: ...
# -*- coding: utf-8 -*- r''' werkzeug.script ~~~~~~~~~~~~~~~ .. admonition:: Deprecated Functionality ``werkzeug.script`` is deprecated without replacement functionality. Python's command line support improved greatly with :mod:`argparse` and a bunch of alternative modules. Most ...
#!/usr/bin/env python3 import lief import sys import termcolor as tc def get_typeval_as_str(lief_type): return str(lief_type).split('.')[1] def show_name(binary): print(tc.colored("[::] Name", "blue")) print(binary.name) def enum_header(header): def get_ident_props(): identity = "\n{0:18...
#!/usr/bin/env python ######################################################################## # # (C) 2015, Chris Houseknecht <[EMAIL]> # # This file is part of Ansible # # Ansible 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...
"""The tests for the folder_watcher component.""" import os from homeassistant.components import folder_watcher from homeassistant.setup import async_setup_component from tests.async_mock import Mock, patch async def test_invalid_path_setup(hass): """Test that an invalid path is not set up.""" assert not aw...
# Copyright 2011,2012 James McCauley # # This file is part of POX. # # POX 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. # # POX is d...
import os import time import numpy import functools import sys import codecs import types import gdal import osr from invest_natcap import raster_utils GLOBAL_UPPER_LEFT_ROW = 2602195.7925872812047601 GLOBAL_UPPER_LEFT_COL = -11429693.3490753173828125 def average_layers(): base_table_uri = "C:/Users/rich/Desk...
# coding=utf-8 from PyMimircache.cache.lru import LRU from PyMimircache.cache.abstractCache import Cache class SLRU(Cache): def __init__(self, cache_size=1000, ratio=1, **kwargs): """ :param cache_size: size of cache :param args: raio: the ratio of protected/probationary :return: ...