text
stringlengths
475
200k
from a10sdk.common.A10BaseClass import A10BaseClass class DebugMonitor(A10BaseClass): """ :param action: {"optional": true, "enum": ["create", "import", "export", "copy", "rename", "check", "replace", "delete"], "type": "string", "description": "'create': create; 'import': import; 'export': export; 'copy'...
#!/usr/bin/python3 # This file is for preprocessing gcode and the new G29 Autobedleveling from Marlin # It will analyse the first 2 Layer and return the maximum size for this part # After this it will replace with g29_keyword = ';MarlinG29Script' with the new G29 LRFB # the new file will be created in the same folder....
"""Support for BMW car locks with BMW ConnectedDrive.""" import logging from bimmer_connected.state import LockState from homeassistant.components.lock import LockEntity from homeassistant.const import STATE_LOCKED, STATE_UNLOCKED from . import DOMAIN as BMW_DOMAIN, BMWConnectedDriveBaseEntity from .const import CON...
import inspect import os from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.utils.importlib import import_module DEFAULT_DB_ALIAS = 'default' # Define some exceptions that mirror the PEP249 interface. # We will rethrow any backend-specific errors using these # common...
#!/usr/bin/env python3 # # Given Python's versioning history I'm going with `python3`. # # Usage: # - `python3 -m venv venv` # - `bash` # - `source venv/bin/activate` # - `pip install --upgrade pip` # - `pip install -r requirements.txt` # - `./generate-repo-files.py auth-41` # Modules import argparse import subproces...
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 CERN. # # Invenio 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,...
# Unix SMB/CIFS implementation. # Copyright (C) Jelmer Vernooij <[EMAIL]> 2007-2010 # # 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 l...
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- # # Copyright (C) 2015-2018 Canonical Ltd # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3 as # published by the Free Software Foundation. # # This program is distributed in ...
# # 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"); you may not us...
from peewee import * from peewee import Using from playhouse.read_slave import ReadSlaveModel from playhouse.tests.base import database_initializer from playhouse.tests.base import ModelTestCase queries = [] def reset(): global queries queries = [] class QueryLogDatabase(SqliteDatabase): name = '' ...
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Phil Schwartz <[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 #...
# copyright 2003-2012 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:[EMAIL] # # This file is part of Logilab-common. # # Logilab-common is free software: you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by th...
#! /usr/bin/env python macros = [\ "slits.C", "write_ntuple_to_file_advanced.C", "write_ntuple_to_file.C", "write_to_file.C", "ExampleMacro.C", "ExampleMacro_GUI.C", "makeMySelector.C", "RunMySelector.C", "macro1.C", "macro2.C", "macro3.C", "macro4.C", "macro5.C", "macro6.C", "macro7.C", "macro8.C", "macro9.C", "read_...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
# ASN.1 named integers from pyasn1 import error __all__ = [ 'NamedValues' ] class NamedValues: def __init__(self, *namedValues): self.nameToValIdx = {}; self.valToNameIdx = {} self.namedValues = () automaticVal = 1 for namedValue in namedValues: if isinstance(na...
"""Provides an interface for interaction with the encrypted sqlite database""" from cryptolock.Database import Database from cryptolock.security import encrypt, decrypt, ensure_key_validity from cryptolock.exceptions import DocumentNotFoundException from config import DB_NAME class SecureDatabase(object): """Inte...
from __future__ import unicode_literals, print_function import frappe.utils from collections import defaultdict from rq import Worker, Connection from frappe.utils.background_jobs import get_redis_conn, get_queue, get_queue_list from frappe.utils.scheduler import is_scheduler_disabled from six import iteritems def ge...
r""" Random walks ============ Probability of a random walker to be on any given vertex after a given number of steps starting from a given distribution. """ # sphinx_gallery_thumbnail_number = 2 import numpy as np from scipy import sparse from matplotlib import pyplot as plt import pygsp as pg N = 7 steps = [0, 1,...
import logging from celery import task from celery_utils.persist_on_failure import LoggedPersistOnFailureTask from django.conf import settings from opaque_keys.edx.keys import CourseKey from xmodule.modulestore.django import modulestore from openedx.core.djangoapps.content.course_overviews.models import CourseOvervi...
# -*- coding: utf-8 -*- import bson from modularodm import fields, Q from modularodm.exceptions import ModularOdmException from framework.mongo import StoredObject from website.conferences.exceptions import ConferenceError DEFAULT_FIELD_NAMES = { 'submission1': 'poster', 'submission2': 'talk', 'submissio...
# Make coding more python3-ish from __future__ import (absolute_import, division, print_function) __metaclass__ = type from datetime import datetime from ansible.plugins.callback import CallbackBase class CallbackModule(CallbackBase): """ This callback module tells you how long your plays ran for. """ ...
# Copyright (c) 2006-2008 The Regents of The University of Michigan # Copyright (c) 2012-2015 Mark D. Hill and David A. Wood # 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 so...
"""Cache lines from files. This is intended to read lines from modules imported -- hence if a filename is not found, it will look down the module search path for a file by that name. """ import sys import os import tokenize __all__ = ["getline", "clearcache", "checkcache"] def getline(filename, lineno, module_globa...
#!/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...
import pytest from cfme import test_requirements from cfme.infrastructure.provider import InfraProvider from cfme.markers.env_markers.provider import ONE_PER_CATEGORY from cfme.utils.appliance.implementations.ui import navigate_to pytestmark = [ pytest.mark.long_running, pytest.mark.provider(classes=[InfraPro...
import HandRankings as Hand from deuces.deuces import Card, Evaluator class GameData: def __init__(self, name, opponent_name, stack_size, bb): # match stats self.name = name self.opponent_name = opponent_name self.starting_stack_size = int(stack_size) self.num_hands = 0 ...
#-*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
""" Factories for use in tests of XBlocks. """ import functools import pymongo.message import threading import traceback from collections import defaultdict from decorator import contextmanager from uuid import uuid4 from factory import Factory, Sequence, lazy_attribute_sequence, lazy_attribute from factory.container...
from flask import Flask, render_template, request, jsonify, Response, abort, session, stream_with_context, redirect, g from ast import literal_eval import subprocess import re import requests import json import shutil import time import os import sqlite3 import logging import sys import commands import threading minig...
# 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...
# Copyright 2014 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. """Run the first page of one benchmark for every module. Only benchmarks that have a composable measurement are included. Ideally this test would be compreh...
# Copyright (C) 2004-2007, 2009, 2010 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and this permission notice # appear in all copies. # # THE SOFTWARE IS PROVIDED ...
# Copyright 2017 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. """Presubmit script for changes affecting chrome/browser/vr See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for more details abo...
import base64 import hmac import json import logging import psycopg2 import time import traceback import dateutil.parser import datetime import os import six import socket import sys from ipaddress import ip_address, ip_network as _ip_network from six.moves.BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer from...
from __future__ import absolute_import import time import os from . import (LockBase, LockFailed, NotLocked, NotMyLock, LockTimeout, AlreadyLocked) class LinkLockFile(LockBase): """Lock access to a file using atomic property of link(2). >>> lock = LinkLockFile('somefile') >>> lock = Link...
# Copyright (c) 2003-2013 LOGILAB S.A. (Paris, FRANCE). # http://www.logilab.fr/ -- mailto:[EMAIL] # # 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 ...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
# Copyright 2011 VMware, 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 ...
# 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"); you may not u...
from __future__ import unicode_literals, division, absolute_import import logging import urllib2 import httplib import socket from flexget import plugin from flexget.event import event log = logging.getLogger('spy_headers') class CustomHTTPConnection(httplib.HTTPConnection): def __init__(self, *args, **kwargs)...
# -*- encoding: utf-8 -*- ############################################################################## # # Avanzosc - Avanced Open Source Consulting # Copyright (C) 2011 - 2012 Avanzosc <http://www.avanzosc.com> # # This program is free software: you can redistribute it and/or modify # it under the terms ...
import json import socket import logging from testfixtures import LogCapture from twisted.internet import defer from twisted.trial.unittest import TestCase from scrapy.http import Request from scrapy.crawler import CrawlerRunner from scrapy.utils.python import to_unicode from tests import mock from tests.spiders impo...
# # 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"); you may not us...
# 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...
from __future__ import absolute_import, division, unicode_literals from . import _base class Filter(_base.Filter): def __init__(self, source, encoding): _base.Filter.__init__(self, source) self.encoding = encoding def __iter__(self): state = "pre_head" meta_found = (self.enco...
#!/usr/bin/python ''' Copyright 2013 Google Inc. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. ''' ''' Gathers diffs between 2 JSON expectations files, or between actual and expected results within a single JSON actual-results file, and generates an old-vs-new diff...
# Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file. import re import sys import os from .ansi import AnsiFore, AnsiBack, AnsiStyle, Style from .winterm import WinTerm, WinColor, WinStyle from .win32 import windll, winapi_test winterm = None if windll is not None: winterm = WinTerm() def ...
""" Copyright [2009-2017] EMBL-European Bioinformatics Institute 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...
# # 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"); you may not us...
# Originally contributed by Sjoerd Mullender. # Significantly modified by Jeffrey Yasskin <jyasskin at gmail.com>. """Rational, infinite-precision, real numbers.""" from __future__ import division from decimal import Decimal import math import numbers import operator import re __all__ = ['Fraction', 'gcd'] Rational...
#!/usr/bin/env python from __future__ import print_function import argparse import subprocess import sys import os import numpy as np from scipy.io import netcdf ########################################################################## # FUNCTIONS ###################################################################...
# -*- coding: utf-8 -*- """ *************************************************************************** lasnoise.py --------------------- Date : September 2013 and May 2016 Copyright : (C) 2013 by Martin Isenburg Email : martin near rapidlasso point com ***...
from flask.ext.security import Security, SQLAlchemyUserDatastore from flask.ext.social import Social, SQLAlchemyConnectionDatastore from logging.handlers import SMTPHandler import logging def init_error_logger_with_email_handler(app): """ Initialize a logger to send emails on error-level messages. Unhandl...
# 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"); you may not use ...
# -*- coding: utf-8 -*- """ $Id: GCodeExporter.py 1092 2011-06-13 14:40:56Z sumpfralle $ Copyright 2010-2011 Lars Kruse <[EMAIL]> Copyright 2008-2009 Lode Leroy This file is part of PyCAM. PyCAM is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published ...
# -*- coding: utf-8 -*- # Copyright 2010-2012 Kolab Systems AG (http://www.kolabsys.com) # # Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen a kolabsys.com> # # 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 ...
""" Tests to cover bulk create and update using serializers. """ from __future__ import unicode_literals from django.test import TestCase from rest_framework import serializers class BulkCreateSerializerTests(TestCase): """ Creating multiple instances using serializers. """ def setUp(self): c...
# The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- # ITY, FITNESS FOR A PARTICULAR PURPOS...
""" Created on Mar 10, 2014 @author: jtaghiyar """ import os import subprocess as sub from kronos_version import kronos_version from utils import Pipeline from helpers import make_dir, Configurer from workflow_manager import WorkFlow, WorkFlowManager from plumber import Plumber from string import Template from tempfi...
#!/usr/bin/python import sys,os import idl (TYPE_DEFBOOL, TYPE_BOOL, TYPE_INT, TYPE_UINT, TYPE_STRING, TYPE_ARRAY, TYPE_AGGREGATE) = range(7) def py_type(ty): if ty == idl.bool: return TYPE_BOOL if ty.typename == "libxl_defbool": return TYPE_DEFBOOL if isinstance(ty, idl.Enumeration): ...
""" *************** Graphviz AGraph *************** Interface to pygraphviz AGraph class. Examples -------- >>> G=nx.complete_graph(5) >>> A=nx.to_agraph(G) >>> H=nx.from_agraph(A) See Also -------- Pygraphviz: http://networkx.lanl.gov/pygraphviz """ # Copyright (C) 2004-2012 by # Aric Hagberg <[EMAIL]> # D...
# -*- coding: utf-8 -*- """ pygments.styles.emacs ~~~~~~~~~~~~~~~~~~~~~ A highlighting style for Pygments, inspired by Emacs. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.style import Style from pygments.token import ...
# -*- coding: utf-8 -*- # need this line because test utf-8 strings later import os import collections from test.unit_tests.providers import common from test.unit_tests.providers.common import ProviderTestCase from totalimpact.providers.provider import Provider, ProviderContentMalformedError from test.utils import ...
import zipfile from io import BytesIO from django.conf import settings from django.http import HttpResponse from django.template import loader def compress_kml(kml): "Returns compressed KMZ from the given KML string." kmz = BytesIO() zf = zipfile.ZipFile(kmz, 'a', zipfile.ZIP_DEFLATED) zf.writestr('d...
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # # GNU GENERAL PUBLIC LICENSE # Version 2, June 1991 # # 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; eit...
#!/usr/bin/env python3 import os import sys import time import json import shutil import subprocess from oeqa.oetest import oeRuntimeTest from oeqa.utils.decorators import tag class BlenoTest(oeRuntimeTest): cleanup = False bleno_prefix_dir = '/home/root' def setUp(self): ''' Insta...
# Copyright (C) 2009 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and this permission notice # appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND NOMIN...
# Copyright (c) 2014 Red Hat, 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...
############################################################################### ## ## Copyright (C) 2014 Tavendo GmbH ## ## 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:/...
#!/usr/bin/env python from __future__ import print_function import hashlib import sys import simplejson as json from docker_registry.core import exceptions import docker_registry.storage as storage store = storage.load() images_cache = {} ancestry_cache = {} dry_run = True def warning(msg): print('# Warning...
from __future__ import unicode_literals import unittest import tempfile import shutil import os from glob import glob from preupg.xmlgen.compose import XCCDFCompose, ComposeXML from preupg.utils import FileHelper from preupg import settings try: import base except ImportError: import tests.base as base FOO_D...
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Adam Števko <[EMAIL]> # 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', ...
import logging from celery import chain, shared_task from instanotifier.fetcher.main import fetch from instanotifier.parser.main import parse_and_save from instanotifier.publisher.tasks import publish from instanotifier.feedsource.models import FeedSource @shared_task def consume_feed(feedsource_pk): feed_sourc...
"""Thread module emulating a subset of Java's threading model.""" import sys as _sys try: import thread except ImportError: del _sys.modules[__name__] raise import warnings from collections import deque as _deque from time import time as _time, sleep as _sleep from traceback import format_exc as _format...
#!/usr/bin/env python # Copyright (C) 2014 Zulip, Inc. # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation files # (the "Software"), to deal in the Software without restriction, # including without limitation the rights to use, copy, modify, m...
""" ============== phantom_import ============== Sphinx extension to make directives from ``sphinx.ext.autodoc`` and similar extensions to use docstrings loaded from an XML file. This extension loads an XML file in the Pydocweb format [1] and creates a dummy module that contains the specified docstrings. This can be ...
import unittest from django.test import TransactionTestCase from django.contrib.contenttypes.models import ContentType from cities_light.models import Country, City from gfk_autocomplete.forms import TaggedItemForm from optionnal_gfk_autocomplete.forms import OptionnalTaggedItemForm import autocomplete_light clas...
# Copyright (c) 2013 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"), to deal in the Software without restriction, including # without limitation the rights ...
# -*- coding: utf-8 -*- # __ # /__) _ _ _ _ _/ _ # / ( (- (/ (/ (- _) / _) # / """ Requests HTTP library ~~~~~~~~~~~~~~~~~~~~~ Requests is an HTTP library, written in Python, for human beings. Basic GET usage: >>> import requests >>> r = requests.get('https://www.python.org') >>> ...
# Copyright (c) 2013 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """cmake output module This module is under development and should be considered experimental. This module produces cmake (2.8.8+) input as its output. One CMake...
# pyOCD debugger # Copyright (c) 2016-2020 Arm Limited # SPDX-License-Identifier: Apache-2.0 # # 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...
# -*- coding: utf-8 -*- """ pygments.styles.manni ~~~~~~~~~~~~~~~~~~~~~ A colorful style, inspired by the terminal highlighting style. This is a port of the style used in the `php port`_ of pygments by Manni. The style is called 'default' there. :copyright: 2006-2007 by Armin Ronacher, Manni ...
import errno import logging import os from ConfigParser import NoSectionError, NoOptionError log = logging.getLogger('gitosis.gitdaemon') from gitosis import util def export_ok_path(repopath): p = os.path.join(repopath, 'git-daemon-export-ok') return p def allow_export(repopath): p = export_ok_path(rep...
#!/usr/bin/env python # Copyright (c) 2012 The LibYuv Project Authors. All rights reserved. # # Use of this source code is governed by a BSD-style license # that can be found in the LICENSE file in the root of the source # tree. An additional intellectual property rights grant can be found # in the file PATENTS. All c...
#!/usr/bin/env python """ Combine coverage data from multiple jobs, keeping the data only from the most recent attempt from each job. Coverage artifacts must be named using the format: "Coverage $(System.JobAttempt) {StableUniqueNameForEachJob}" The recommended coverage artifact name format is: Coverage $(System.JobAtt...
import time import warnings import numpy as np import tensorflow as tf from gym.spaces import Discrete, Box from collections import deque from stable_baselines import logger from stable_baselines.common.schedules import Scheduler from stable_baselines.common.tf_util import batch_to_seq, seq_to_batch, \ check_shap...
#!/usr/bin/env python import bisect import QtCore import rospy import rospkg from python_qt_binding.QtCore import Qt, QObject, QAbstractItemModel from vigir_pluginlib_msgs.msg import PluginState, PluginDescription # Tree Model for Plugins class PluginTreeModel(QtCore.QAbstractItemModel): def __init__(self, ...
# Canvas wrapper component for Pyjamas # Ported by Willie Gollino from Canvas component for GWT - Originally by Alexei Sokolov http://gwt.components.googlepages.com/ # # Canvas API reference: # http://developer.apple.com/documentation/AppleApplications/Reference/SafariJSRef/Classes/Canvas.html#//apple_ref/js/Canvas.cle...
test = { 'name': 'Problem 9', 'points': 4, 'suites': [ { 'cases': [ { 'code': r""" >>> # QueenAnt Placement >>> queen = ants.QueenAnt() >>> impostor = ants.QueenAnt() >>> front_ant, back_ant = ants.ThrowerAnt(), ants.ThrowerAnt() >>> tu...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='ContentType', fields=[ ('id', models.AutoField(...
from __future__ import absolute_import import base64 import typing as tp from selenium.common.exceptions import WebDriverException from applitools.core import EyesScreenshot, EyesError, Point, Region, OutOfBoundsError from applitools.utils import image_utils from applitools.selenium import eyes_selenium_utils from a...
# -*- coding: utf-8 -*- '''Public section, including homepage and signup.''' from flask import (Blueprint, request, render_template, flash, url_for, redirect, session, jsonify, redirect, request, current_app, abort) from flask.ext.login import login_user, login_required, logout_u...
""" Handlers related to data production. """ from collections import OrderedDict import cStringIO from datetime import datetime import json from dateutil import parser import matplotlib.pyplot as plt from matplotlib.backends.backend_agg import FigureCanvasAgg import tornado.web from status.util import dthandler, Saf...
# BlockStore: a helper class that keeps a map of blocks and implements # helper functions for responding to getheaders and getdata, # and for constructing a getheaders message # from mininode import * import dbm class BlockStore(object): def __init__(self, datadir): self.blockDB = ...
# -*- coding: utf-8 -*- # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software ...
# <headingcell level=1> # *corpkit*: a Python-based toolkit for working with parsed linguistic corpora # <headingcell level=2> # <markdowncell> # [Daniel McDonald](mailto:[EMAIL]?Subject=corpkit)** #--------------------------- # <markdowncell> # <br> # > **SUMMARY:** This *IPython Notebook* shows you how to use `corp...
from nose.tools import * import networkx as nx from networkx.testing import * def test_union_all_attributes(): g = nx.Graph() g.add_node(0, x=4) g.add_node(1, x=5) g.add_edge(0, 1, size=5) g.graph['name'] = 'g' h = g.copy() h.graph['name'] = 'h' h.graph['attr'] = 'attr' h.node[0]['...
"""Bagging meta-estimator.""" # Author: Gilles Louppe <[EMAIL]> # License: BSD 3 clause from __future__ import division import itertools import numbers import numpy as np from warnings import warn from abc import ABCMeta, abstractmethod from ..base import ClassifierMixin, RegressorMixin from ..externals.joblib impo...
#!/usr/bin/python # Copyright 2003 Vladimir Prus # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) # This tests correct handling of dependencies, specifically, on # generated sources, and from generated sources. import Bo...
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights ...