content
stringlengths
4
20k
from spack import * class Gnutls(AutotoolsPackage): """GnuTLS is a secure communications library implementing the SSL, TLS and DTLS protocols and technologies around them. It provides a simple C language application programming interface (API) to access the secure communications protocols as well as A...
""" Implements a workflow for testing.""" from ...tasks.sample_tasks import (add_data, halt_if_data_less_than, reduce_data_by_one) class test_workflow(object): """A test workflow for the testsuite.""" workflow = [halt_if_data_less_than(20), add_data(20), ...
""" Network-related utilities and helper functions. """ # TODO(jd) Use six.moves once # https://bitbucket.org/gutworth/six/pull-request/28 # is merged try: import urllib.parse SplitResult = urllib.parse.SplitResult except ImportError: import urlparse SplitResult = urlparse.SplitResult from six.moves.u...
#!/usr/bin/env python try: import unittest2 as unittest except ImportError: import unittest from csvkit.convert import xlsx from datetime import datetime class TestXLSX(unittest.TestCase): def test_xlsx(self): with open('examples/test.xlsx', 'rb') as f: output = xlsx.xlsx2csv(f) ...
"""Support for Fritzbox binary sensors.""" import logging import requests from homeassistant.components.binary_sensor import BinarySensorDevice from . import DOMAIN as FRITZBOX_DOMAIN _LOGGER = logging.getLogger(__name__) def setup_platform(hass, config, add_entities, discovery_info=None): """Set up the Fritz...
from __future__ import print_function, division from sympy.core import Mul from sympy.functions import DiracDelta, Heaviside from sympy.solvers import solve from sympy.core.compatibility import default_sort_key def change_mul(node, x): """change_mul(node, x) Rearranges the operands of a product, bringing...
from cinder.tests.unit import test from cinder.tests.unit import utils as test_utils class TestUtilsTestCase(test.TestCase): def test_get_test_admin_context(self): """get_test_admin_context's return value behaves like admin context.""" ctxt = test_utils.get_test_admin_context() self.asser...
"""A Python class hierarchy wrapping the StGit on-disk metadata.""" import os.path from stgit import exception, utils from stgit.lib import git, stackupgrade from stgit.config import config class StackException(exception.StgException): """Exception raised by L{stack} objects.""" class Patch(object): """Repre...
import collections import copy import mock import sys import base64 import netaddr from oslo_serialization import jsonutils from neutron.tests import base as base_test from networking_cisco.apps.saf.server.services.firewall.native import ( fabric_setup_base as FP) from networking_cisco.apps.saf.server.services....
{ 'name': 'Annotation (customizations for CLVhealth)', 'version': '1.0', 'author': 'Carlos Eduardo Vercelino - CLVsol', 'category': 'Generic Modules/Others', 'license': 'AGPL-3', 'website': 'http://clvsol.com', 'description': ''' CLVsol Annotation Module ------------------------ Annotation M...
#!/usr/bin/python # _*_ coding: latin-1 -*- # Taylor Diagram - Based on Taylor (2001) - Journal Geophysical Research # GMAO - INPE # 20/02/2018 import numpy as np from numpy import ma import mpl_toolkits.axisartist.grid_finder as GF import mpl_toolkits.axisartist.floating_axes as FA import matplotlib.pyplot as plt imp...
try: import psycopg2 import psycopg2.extras except ImportError: postgresqldb_found = False else: postgresqldb_found = True from ansible.module_utils.six import iteritems class NotSupportedError(Exception): pass # =========================================== # PostgreSQL module specific support met...
import wx import os import static import threading import inspect import image_viewer from optparse import OptionParser import sys try: from maggregator.src.multiAggregator import main_aggregator import features from features import * except: sys.path.append(".") sys.path.append('./maggregator') ...
import logging from os.path import dirname, basename from irods.resource_manager import ResourceManager from irods.message import MetadataRequest, iRODSMessage from irods.api_number import api_number from irods.models import (DataObject, Collection, Resource, User, DataObjectMeta, CollectionMeta, ResourceMeta, Us...
""" test utils """ from nose.plugins.attrib import attr from ccx.tests.factories import ( # pylint: disable=import-error CcxFactory, ) from student.roles import CourseCcxCoachRole # pylint: disable=import-error from student.tests.factories import ( # pylint: disable=import-error AdminFactory, ) from xmodule...
from django.core.exceptions import ObjectDoesNotExist from django.db.models import Count from sapl.base.models import Autor from sapl.parlamentares.models import Parlamentar def pega_autores(): return [[autor for autor in Autor.objects.filter(nome=nome)] for nome in Autor.objects.values_list('nome', f...
""" Defines the basic command class By Simon Jones 16/6/2017 """ class Command(object): """ An LCD string command descriptor. Compiles an lcd command to bytes. """ COMMANDS = {} BYTE_COMMAND = bytes([0x01]) def __init__(self, command_number, function, *names): self.__number = bytes([command_number]) self....
from __future__ import print_function import numpy as np import tables from data import index_table_light, get_fields from utils import PrettyTable, merge_items __version__ = "0.2" def unique_dupes(a): is_dupe = np.ones(len(a), dtype=bool) unique_indices = np.unique(a, return_index=True)[1] is_dupe[uni...
from setuptools import setup, find_packages from hueversion import VERSION setup( name = "desktop", version = VERSION, url = 'http://github.com/cloudera/hue', description = "Hue core", packages = find_packages('src'), package_dir = {'': 'src'}, install_requires = ['setuptools'...
"""Find and fix files with inconsistent line endings. This script requires 'dos2unix.exe' and 'unix2dos.exe' from Cygwin; they must be in the user's PATH. Arg: Either one or more files to examine, or (with --file-list) one or more files that themselves contain lists of files. The argument(s) passed to this sc...
from ctypes import ( c_void_p, c_long, c_ulong, c_longlong, c_ulonglong, c_short, c_ushort, c_wchar_p, c_byte, byref, Structure, Union, POINTER, WINFUNCTYPE, HRESULT, oledll, WinDLL, ) import ctypes import sys if sys.version_info >= (3,): def ...
from m5.SimObject import SimObject from m5.params import * from InstTracer import InstTracer class IntelTrace(InstTracer): type = 'IntelTrace' cxx_class = 'Trace::IntelTrace'
class ModuleDocFragment(object): # Standard documentation fragment DOCUMENTATION = ''' options: backup: description: - Create a backup file including the timestamp information so you can get the original file back if you somehow clobbered it incorrectly. required: fals...
# coding: utf-8 """ Wavefront REST API <p>The Wavefront REST API enables you to interact with Wavefront servers using standard REST API tools. You can use the REST API to automate commonly executed operations such as automatically tagging sources.</p><p>When you make REST API calls outside the Wavefront REST ...
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import int_or_none class DigitekaIE(InfoExtractor): _VALID_URL = r'''(?x) https?://(?:www\.)?(?:digiteka\.net|ultimedia\.com)/ (?: deliver/ (?P<embed_type> ...
""" Constants from the header ecl_util.h - some stateless functions. This module does not contain any class definitions; it mostly consists of enum definitions/values from ecl_util.h; the enum values are extracted from the shared library using the ert.cwrap.cenum.create_enum() function in a semi-automagic manner. In ...
import scipy import numpy as np import scipy.sparse as sp def pagerank(graph_matrix, n_iter=100, alpha=0.9, tol=1e-6): n_nodes = graph_matrix.shape[0] n_edges_per_node = graph_matrix.sum(axis=1) n_edges_per_node = np.array(n_edges_per_node).flatten() np.seterr(divide='ignore') normilize_vector = ...
# coding: utf-8 from __future__ import unicode_literals, division, absolute_import, print_function __all__ = [ 'CIPHER_SUITE_MAP', ] CIPHER_SUITE_MAP = { b'\x00\x00': 'TLS_NULL_WITH_NULL_NULL', b'\x00\x01': 'TLS_RSA_WITH_NULL_MD5', b'\x00\x02': 'TLS_RSA_WITH_NULL_SHA', b'\x00\x03': 'TLS_RSA_EXPO...
import logging import os from gevent import socket from fs.path import dirname from beeswarm.drones.honeypot.capabilities.handlerbase import HandlerBase from beeswarm.drones.honeypot.helpers.common import send_whole_file, path_to_ls logger = logging.getLogger(__name__) TERMINATOR = '\r\n' class BeeFTPHandler(obj...
#!/usr/bin/env python """ Test ImageSurface.get_data() """ import tempfile import cairo if not (cairo.HAS_IMAGE_SURFACE and cairo.HAS_PNG_FUNCTIONS): raise SystemExit ('cairo was not compiled with ImageSurface and PNG support') width, height = 128, 128 def create_surface(cformat, w, h): "create black triangle o...
""" AIM class to credit card payment with authorize.net Fork of authnet code written by John Conde http://www.johnconde.net/blog/integrate-the-authorizenet-aim-api-with-python-3-2/ BSDv3 License Modifed by Massimo Di Pierro - ported from Python 3.x run on Python 2.4+ - fixed a couple of bugs - merged with test so si...
# -*- coding: utf-8 -*- """ *************************************************************************** Polygonize.py --------------------- Date : March 2013 Copyright : (C) 2013 by Piotr Pociask Email : ppociask at o2 dot pl *******************************...
"""SCons.Tool.RCS.py Tool-specific initialization for RCS. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation # # ...
from __future__ import unicode_literals from django.conf import settings from django.contrib.admin.utils import quote from django.contrib.contenttypes.models import ContentType from django.core.urlresolvers import NoReverseMatch, reverse from django.db import models from django.utils import timezone from django.utils....
"""This code example updates the delivery rate of all line items in an order. To determine which line items exist, run get_all_line_items.py.""" __author__ = ('Nicholas Chen', 'Joseph DiLallo') # Import appropriate modules from the client library. from googleads import dfp # Set id of the order to get...
from datetime import datetime import os # I'm trying to track down where some missing seconds are going in the sync process # Will grep these out of the log at some later date def worker_message(state): print("Sync worker %d %s at %s" % (os.getpid(), state, datetime.now())) worker_message("booting") from tapiriik...
from gnuradio import eng_notation from gnuradio import gr from gnuradio import filter, analog, blocks from gnuradio import uhd from gnuradio.fft import window from gnuradio.eng_option import eng_option from gnuradio.filter import firdes from optparse import OptionParser class uhd_burst_detector(gr.top_block): def ...
"""Implementation of JSONDecoder """ import re import sys import struct from json import scanner try: from _json import scanstring as c_scanstring except ImportError: c_scanstring = None __all__ = ['JSONDecoder'] FLAGS = re.VERBOSE | re.MULTILINE | re.DOTALL def _floatconstants(): _BYTE...
"""n-body simulator to derive TDV+TTV diagrams of planet-moon configurations. Credit for part of the source is given to https://github.com/akuchling/50-examples/blob/master/gravity.rst Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License """ import numpy import math import matplotlib.pylab as plt...
"""Tests for Bijector.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from tensorflow.contrib.distributions.python.ops import bijectors from tensorflow.python.framework import tensor_shape from tensorflow.python.ops import array_ops from tensorflow.pyth...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.core.files.uploadedfile import SimpleUploadedFile from django.forms import ( BooleanField, CharField, ChoiceField, DateField, DateTimeField, DecimalField, EmailField, FileField, FloatField, Form, GenericIPAddressField, IntegerField...
from spack import * class PyPycurl(PythonPackage): """PycURL is a Python interface to libcurl. PycURL can be used to fetch objects identified by a URL from a Python program.""" homepage = "http://pycurl.io/" url = "https://pypi.io/packages/source/p/pycurl/pycurl-7.43.0.tar.gz" version('7.43...
""" JobManagerHandler is the implementation of the JobManager service in the DISET framework The following methods are available in the Service interface submitJob() rescheduleJob() deleteJob() killJob() """ __RCSID__ = "$Id$" from types import StringType, IntType, ListType from DIRAC.Core....
#!/usr/bin/env python from __future__ import absolute_import, division, print_function import os import sys import shutil import textwrap from fnmatch import fnmatchcase from distutils.core import Command, setup from distutils.util import convert_path #--------------------------------------------------------------...
"""Utilities to evaluate models with respect to a variable """ # # License: BSD 3 clause import warnings import numpy as np from .base import is_classifier, clone from .cross_validation import _check_cv from .externals.joblib import Parallel, delayed from .cross_validation import _safe_split, _score, _fit_and_score ...
""" Represent toolchain - the versioned executables. """ # ---------------------------------------------------------------------------- from __future__ import absolute_import import platform from . import cache_util from . import shell from . import xcrun from .which import which __all__ = [ 'host_toolchain', ]...
# -*- coding: utf-8 -*- """Dump username, per-student anonymous id, and per-course anonymous id triples as CSV. Give instructors easy access to the mapping from anonymized IDs to user IDs with a simple Django management command to generate a CSV mapping. To run, use the following: ./manage.py lms anonymized_id_mappin...
# -*- coding: utf-8 -*- from south.db import db from south.v2 import SchemaMigration class Migration(SchemaMigration): def forwards(self, orm): # Adding unique constraint on 'ProjectCache', fields ['date', 'start', 'machine_category', 'end', 'project'] db.create_unique('cache_projectcache', ['dat...
from __future__ import absolute_import, division, unicode_literals from datrie import Trie as DATrie from pip._vendor.six import text_type from ._base import Trie as ABCTrie class Trie(ABCTrie): def __init__(self, data): chars = set() for key in data.keys(): if not isinstance(key, te...
import exceptions # dbapi Error hierarchy class Warning(exceptions.StandardError): pass class Error (exceptions.StandardError): def __init__(self, msg, code=None): exceptions.StandardError.__init__(self, msg) self.code = code class InterfaceError(Error): pass class DatabaseError (Error): pass ...
# # Very simple flip without level set # and without any particle resampling # from manta import * # solver params dim = 3 particleNumber = 2 res = 64 gs = vec3(res,res,res) if (dim==2): gs.z=1 particleNumber = 3 # use more particles in 2d s = Solver(name='main', gridSize = gs, dim=dim) s.timestep = 0.5 # prepare ...
"""The Elexa Guardian integration.""" import asyncio from typing import Dict from aioguardian import Client from homeassistant.config_entries import ConfigEntry from homeassistant.const import ATTR_ATTRIBUTION, CONF_IP_ADDRESS, CONF_PORT from homeassistant.core import HomeAssistant, callback from homeassistant.helper...
#!/usr/bin/env python import imp import os import sys PYCART_DIR = ''.join(['python-', '.'.join(map(str, sys.version_info[:2]))]) try: zvirtenv = os.path.join(os.environ['OPENSHIFT_HOMEDIR'], PYCART_DIR, 'virtenv', 'bin', 'activate_this.py') execfile(zvirtenv, dict(__file__ = zvirtenv...
import internal def setOutputDir(dir): internal.core.setOutputDir(dir)
from django.contrib.contenttypes.models import ContentType from django.db import DEFAULT_DB_ALIAS, router from django.db.models import get_apps, get_models, signals from django.utils.encoding import smart_text from django.utils import six from django.utils.six.moves import input def update_contenttypes(app, created_m...
""" Module for visitor class mapping. """ import sqlalchemy as sa from migrate.changeset import ansisql from migrate.changeset.databases import (sqlite, postgres, mysql, oracle, ...
# /* UVa problem: 374 # * # * Topic: Number Theory # * # * Level: easy # * # * Brief problem description: # * # * Big Mod: Given b, p, and m, efficiently compute b^p mod m # * # * Solution Summary: # * # * Notice that easiest case is when p is a power of 2 -> repeated squaring # * Can easily be imple...
import PyQt4.uic import os import PyQt4 from PyQt4.QtGui import (QLabel, QDialog, QFileDialog, QPixmap, QGridLayout, QLayout, QWidget) from PyQt4.QtCore import (QByteArray, QBuffer, QIODevice, QEvent, QObject, pyqtSignal) import logging import images_rc basepath = os.path.dirname(__file__) uipath ...
from django.template.context import RequestContext from django.shortcuts import render_to_response from django.http import HttpResponse from piston.emitters import Emitter from api.views import display_spatial_query, display_aoi_uploader from util.ncconv.experimental import ocg_converter from util.ncconv.experimental.o...
# -*- coding: utf-8 -*- """Strongly connected components. """ # Copyright (C) 2004-2015 by # Aric Hagberg <<EMAIL>> # Dan Schult <<EMAIL>> # Pieter Swart <<EMAIL>> # All rights reserved. # BSD license. import networkx as nx from networkx.utils.decorators import not_implemented_for __authors__ = "\n"....
"""A library that provides a Python client to Slicing Dice API""" import ujson from . import exceptions from .api import SlicingDiceAPI from .url_resources import URLResources from .utils import validators class SlicingDice(SlicingDiceAPI): """A python interface to Slicing Dice API Example usage: T...
from __future__ import division, print_function import os import sys def configuration(parent_package='', top_path=None): from numpy.distutils.misc_util import Configuration from numpy.distutils.system_info import get_info config = Configuration('linalg', parent_package, top_path) config.add_data_dir...
#!/usr/bin/python # -*- coding:utf8 -*- import socket from base64 import b64encode, b64decode from threading import Thread from time import time, localtime, strftime from Crypto.Cipher import AES # You need "easy_install pyCrypto" #################Options BEGIN################## # Settings ip = "0.0.0.0" # Listen...
#!/usr/bin/env python3 """ Unwrap fasta file so that each sequence takes up only one line. Usage: <program> input_file output_file """ # Modules import gzip import sys # Classes class Fasta(object): """Fasta object with name and sequence """ def __init__(self, name, sequence): self.name = na...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np from tensorflow.contrib.solvers.python.ops import least_squares from tensorflow.contrib.solvers.python.ops import util from tensorflow.python.framework import constant_op from tensorflow.pyt...
""" Tests for the fake payment page used in acceptance tests. """ from django.test import TestCase from shoppingcart.processors.CyberSource2 import sign, verify_signatures from shoppingcart.processors.exceptions import CCProcessorSignatureException from shoppingcart.tests.payment_fake import PaymentFakeView from colle...
from os.path import abspath, join, dirname from pyvows import Vows, expect from tornado_pyvows.context import TornadoHTTPContext from thumbor.app import ThumborServiceApp from thumbor.importer import Importer from thumbor.config import Config from thumbor.context import Context, ServerParameters fixture_for = lambd...
from neutron.extensions import portbindings from neutron.plugins.ml2 import driver_api as api from neutron.tests import base NETWORK_ID = "fake_network" PORT_ID = "fake_port" class FakeNetworkContext(api.NetworkContext): def __init__(self, segments): self._network_segments = segments @property d...
from __future__ import absolute_import import inspect from datetime import timedelta from django.utils import timezone class UserActiveMiddleware(object): disallowed_paths = ( 'sentry.web.frontend.generic.static_media', 'sentry.web.frontend.organization_avatar', 'sentry.web.frontend.proje...
""" raven.handlers.logbook ~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import import logbook import sys import traceback from raven.base import Client from raven.utils.encoding import t...
import json import logging import uuid import sys import time import os if not os.path.exists("thirdparty/python/bin/pip"): print "virtualenv not installed. Run install.py to set up this directory properly." sys.exit(1) # Activate the environment now, inside this script. bootstrap_script = "thirdparty/python/bin/ac...
from zim.plugins.base.imagegenerator import ImageGeneratorPlugin, ImageGeneratorClass from zim.fs import File, TmpFile from zim.config import data_file from zim.applications import Application, ApplicationError # TODO put these commands in preferences dotcmd = ('ditaa') class InsertDitaaPlugin(ImageGeneratorPlugin)...
"""Illustrate a "three way join" - where a primary table joins to a remote table via an association table, but then the primary table also needs to refer to some columns in the remote table directly. E.g.:: first.first_id -> second.first_id second.other_id --> partitioned.other_id ...
__revision__ = "$Id$" import os import time import shutil import tempfile from invenio.config import \ CFG_TMPDIR from invenio.legacy.websubmit.config import InvenioWebSubmitFunctionError from invenio.legacy.websubmit.functions.Shared_Functions import ParamFromFile from invenio.legacy.bibsched.bibtask import tas...
"""A setuptools based setup module. See: https://packaging.python.org/en/latest/distributing.html https://github.com/pypa/sampleproject """ # Always prefer setuptools over distutils from setuptools import setup, find_packages # To use a consistent encoding from codecs import open from os import path here = path.absp...
pingsizes = [ 1, 48, 64, 512, 1440, 1500, 1505, 4096, 4192, 32767, 65507 ] from XmTestLib import * def netDomain(): dom = XmTestDomain() dom.newDevice(XenNetDevice, "eth0") try: console = dom.start() console.setHistorySaveCmds(value=True) except DomainError, e: ...
# Script for building the _ssl and _hashlib modules for Windows. # Uses Perl to setup the OpenSSL environment correctly # and build OpenSSL, then invokes a simple nmake session # for the actual _ssl.pyd and _hashlib.pyd DLLs. # THEORETICALLY, you can: # * Unpack the latest SSL release one level above your main Python ...
"""Mixer extension.""" from __future__ import absolute_import, print_function import errno import json import logging import os import sys from mixer.backend.flask import Mixer as _Mixer from invenio.ext.sqlalchemy import db, models from .registry import mixers class InvalidMixerRequest(Exception): """Defau...
""" =========================================== Tractography Clustering - Available Metrics =========================================== This page lists available metrics that can be used by the tractography clustering framework. For every metric a brief description is provided explaining: what it does, when it's usefu...
from __future__ import absolute_import, division, print_function, with_statement import datetime import os import shutil import tempfile import tornado.locale from tornado.escape import utf8, to_unicode from tornado.test.util import unittest, skipOnAppEngine from tornado.util import unicode_type class TranslationLo...
from ROOT import TFile, TList, TObject class OutputWriter: ''' classdocs ''' class OutputObject: def __init__(self, name): self.__name = name def GetName(self): return self.__name def Write(self): output = s...
import time from unittest import TestCase import zmq from zmq.tests import BaseZMQTestCase, have_gevent, GreenTest class TestPubSub(BaseZMQTestCase): pass # We are disabling this test while an issue is being resolved. def test_basic(self): s1, s2 = self.create_bound_pair(zmq.PUB, zmq.SUB) ...
""" This file shows 2 ways to fill union of triangulated surfaces: You can either use union of 2 inGtsSurface predicates or create union of surfaces using GTS calls first and use a single isGtsSurface as predicate with the united surface. The disadvantage of the predicate union | is that each sphere must fit whole in ...
from agu_queries import * from SPARQLWrapper import SPARQLWrapper, JSON dir = "/Users/narock/University/Projects/agu_analytics/esip_summer_2017/" dir = dir + "MeetingAttendeeData/csv/" files = ["2010_Winter.csv", "2011_Winter.csv", "2012_Winter.csv", "2013_Winter.csv", "2014_Winter.csv", "2015_Winter.csv","2...
from collections import OrderedDict from itertools import chain from inspect import isclass, getmembers import operator import re from operator import itemgetter from coalib.settings.Annotations import typechain class LanguageUberMeta(type): """ This class is used to hide the `all` attribute from the Languag...
# coding: UTF-8 """ Copyright (c) 2009 Marian Tietz 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, this list of conditions a...
"""Tests to ensure that the lxml tree builder generates good trees.""" import re import warnings try: from bs4.builder import LXMLTreeBuilder, LXMLTreeBuilderForXML LXML_PRESENT = True except ImportError, e: LXML_PRESENT = False from bs4 import ( BeautifulSoup, BeautifulStoneSoup, ) from bs4....
"""Sensors plugin.""" # Sensors library (optional; Linux-only) # Py3Sensors: https://bitbucket.org/gleb_zhulik/py3sensors try: import sensors except ImportError: pass # Import Glances lib from glances.core.glances_globals import is_py3 from glances.core.glances_logging import logger from glances.plugins.glanc...
import unittest from ..util import LookAheadIterator class TestLookAheadIterator(unittest.TestCase): def test_usage(self): i = LookAheadIterator(list(range(0, 10000))) self.assertEqual(next(i), 0) self.assertEqual(next(i), 1) self.assertEqual(next(i), 2) self.assertEqual...
"""engine.SCons.Tool.icc Tool-specific initialization for the OS/2 icc compiler. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, ...
# Parse Makefiles and Python Setup(.in) files. import re # Extract variable definitions from a Makefile. # Return a dictionary mapping names to values. # May raise IOError. makevardef = re.compile('^([a-zA-Z0-9_]+)[ \t]*=(.*)') def getmakevars(filename): variables = {} fp = open(filename) pendingline =...
from pylab import * from collections import namedtuple from .varifolds import Varifolds, Varifold from .currents import Currents, Current Cylinders = namedtuple('Cylinders', 'centers normals weights') Spherical = namedtuple('Spherical', 'points directions weights') class NormalCycle : def __init__(self, cylinders, ...
"""Provides access to the recipes input properties. Every recipe is run with a JSON object called "properties". These contain all inputs to the recipe. Some common examples would be properties like "revision", which the build scheduler sets to tell a recipe to build/test a certain revision. The properties that affect...
from __future__ import unicode_literals from django.db import connection from django.test import TestCase from .models import A01, A02, B01, B02, C01, C02, Managed1, Unmanaged2 class SimpleTests(TestCase): def test_simple(self): """ The main test here is that the all the models can be created w...
#!/usr/bin/env python3 """ /*************************************************************************** symbol_xml2db.py ------------------- begin : 26-5-2012 copyright : (C) 2012 by Arunmozhi email : arunt...
from __future__ import print_function import json, os, re, subprocess import utils def format_tests(test_root, test_tree): tests = [] for name, test in test_tree: command_line = test.read_file('description') failed = test.read_file('fail_message') if failed is None: status = 'pass' ...
#!/usr/bin/python from __future__ import (absolute_import, division, print_function) # Copyright 2019 Fortinet, Inc. # # 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 Lic...
# -*- coding: utf-8 -*- from collections import Counter import cPickle as pickle import heapq import nltk import numpy as np from sklearn.svm import SVC, LinearSVC from sklearn.grid_search import RandomizedSearchCV from hazm import Normalizer, Stemmer, word_tokenize #from hazm.HamshahriReader import HamshahriReader i...
#coding:utf-8 import numpy as np from mlp import MultiLayerPerceptron from sklearn.datasets import fetch_mldata from sklearn.cross_validation import train_test_split from sklearn.preprocessing import LabelBinarizer from sklearn.metrics import confusion_matrix, classification_report """ MNISTの手書き数字データの認識 scikit-learnのイ...
# -*- coding: utf-8 -*- """ 42. Serialization ``django.core.serializers`` provides interfaces to converting Django ``QuerySet`` objects to and from "flat" data (i.e. strings). """ from decimal import Decimal from django.db import models class Category(models.Model): name = models.CharField(max_length=20) ...