text
stringlengths
475
200k
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
# Copyright 2014 Brocade Communications System, 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 # #...
#!/usr/bin/env python # # Copyright 2009 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...
# -*- coding: utf-8 -*- """ pygments.styles.vs ~~~~~~~~~~~~~~~~~~ Simple style with MS Visual Studio colors. :copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.style import Style from pygments.token import Keyword, Name, Co...
# -*- coding: utf-8 -*- """ /*************************************************************************** Name : TopoViewer plugin for DB Manager Description : Create a project to display topology schema on Qgis Date : Sep 23, 2011 copyright : (C) 2011 by Giuseppe Suc...
# This program is free software; you can redistribute it and/or modify # it under the terms of the (LGPL) GNU Lesser General Public License as # published by the Free Software Foundation; either version 3 of the # License, or (at your option) any later version. # # This program is distributed in the hope that it will ...
from django.http import HttpResponse, HttpResponseRedirect, Http404, HttpResponseBadRequest from django.shortcuts import render_to_response, get_object_or_404 from django.template import RequestContext, Template from django.template.loader import get_template, render_to_string from stereoscoop.models import Stereosc...
#!/usr/bin/env python # # Copyright (c) 2014-2016 Apple Inc. All rights reserved. # Copyright (c) 2014 University of Washington. 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. Redistribution...
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsAlignmentComboBox From build dir, run: ctest -R PyQgsAlignmentComboBox -V .. note:: 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...
""" This inline script allows conditional TLS Interception based on a user-defined strategy. Example: > mitmdump -s tls_passthrough.py 1. curl --proxy http://localhost:8080 https://example.com --insecure // works - we'll also see the contents in mitmproxy 2. curl --proxy http://localhost:8080 https:...
#!/usr/bin/python # -*- coding: utf-8 -*- """ Ansible module to manage Citrix NetScaler entities (c) 2013, Nandor Sivok <[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 Foundat...
from django.template.defaultfilters import length_is from django.test import SimpleTestCase from ..utils import setup class LengthIsTests(SimpleTestCase): @setup({'length_is01': '{% if some_list|length_is:"4" %}Four{% endif %}'}) def test_length_is01(self): output = self.engine.render_to_string('len...
""" Defines serializers used by the Team API. """ from copy import deepcopy from django.conf import settings from django.contrib.auth.models import User # lint-amnesty, pylint: disable=imported-auth-user from django_countries import countries from rest_framework import serializers from lms.djangoapps.teams.api imp...
from datetime import time from django.contrib.auth.decorators import login_required from django.urls import reverse_lazy from django.utils.decorators import method_decorator from django.views.generic import FormView, TemplateView from starminder.main.forms import ProfileForm class HomeView(TemplateView): templa...
from utils.nft_errors import NFTValidationError, abort from wrappers import table_wrapper, chain_wrapper def validate_new_chain(chain_json): chain = chain_json['chain'] validation_error = NFTValidationError('chain') # JSON errors if not chain: raise abort(400, 'No "chain" field in chain json')...
""" NTLM authenticating pool, contributed by erikcederstran Issue #10, see: http://code.google.com/p/urllib3/issues/detail?id=10 """ from __future__ import absolute_import from logging import getLogger from ntlm import ntlm from .. import HTTPSConnectionPool from ..packages.six.moves.http_client import HTTPSConnecti...
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (c) 2015 Serv. Tecnol. Avanzados (http://www.serviciosbaeza.com) # Pedro M. Baeza <[EMAIL]> # # This program is free software: you can redistribute it and/or modify # it un...
class EventListener: def __init__(self, events=[]): self._events=events def append(self, event): self._events.append(event) def fire(self, e): for _event in self._events: _event(e) class IndexedDB: def __init__(self): if not __BRYTHON__.has_indexedDB: raise NotImple...
#-*- coding: utf-8 -*- """ Group Configuration Tests. """ import json import mock from django.conf import settings from django.test.utils import override_settings from opaque_keys.edx.keys import AssetKey from opaque_keys.edx.locations import AssetLocation from contentstore.utils import reverse_course_url from cont...
# 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...
"""Support for Motion Blinds sensors.""" from motionblinds import BlindType from homeassistant.const import ( DEVICE_CLASS_BATTERY, DEVICE_CLASS_SIGNAL_STRENGTH, PERCENTAGE, SIGNAL_STRENGTH_DECIBELS_MILLIWATT, ) from homeassistant.helpers.entity import Entity from homeassistant.helpers.update_coordinat...
# Copyright (c) 2007 The Hewlett-Packard Development Company # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implemen...
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from __future__ import print_function import os import re import llnl.util.tty as tty from llnl.util.tty.colify import c...
""" Demonstrates some customized mouse interaction by drawing a crosshair that follows the mouse. """ import initExample ## Add path to library (just for examples; you do not need this) import numpy as np import pyqtgraph as pg from pyqtgraph.Qt import QtGui, QtCore from pyqtgraph.Point import Point #generate layo...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('api', '0068_auto_20150914_1909'), ] ...
#!/usr/bin/python # ***************************************************************************** # # Copyright (c) 2016, EPAM SYSTEMS INC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # #...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2016-2018 Stadt Karlsruhe (www.karlsruhe.de) # # This program 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 Licen...
"""Helpers for writing rules under //xars.""" __all__ = [ 'define_xar', 'define_zipapp', ] import dataclasses import logging from pathlib import Path import foreman from g1 import scripts from g1.bases.assertions import ASSERT from g1.containers import models as ctr_models from g1.operations.cores import mo...
""" ============================= Species distribution modeling ============================= Modeling species' geographic distributions is an important problem in conservation biology. In this example we model the geographic distribution of two south american mammals given past observations and 14 environmental varia...
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsCheckableComboBox .. note:: This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. "...
from __future__ import print_function from builtins import range from airflow.operators import PythonOperator from airflow.models import DAG from datetime import datetime, timedelta import time from pprint import pprint seven_days_ago = datetime.combine(datetime.today() - timedelta(7), ...
#!/usr/bin/env python import sys,re,time,argparse def main(args): # print >>sys.stdout, "Start analysis: " + time.strftime("%a,%d %b %Y %H:%M:%S") output_gpd(args.input,args.output,args.length,args.ratio) # print >>sys.stdout, "Finish analysis: " + time.strftime("%a,%d %b %Y %H:%M:%S") def extract_exon_length_from_c...
#!/usr/bin/env python3 ######################################################## # # A simple middleware to submit a scan report # assessment results # # Usage: # python sar_etl.py <apikey> <sar_service_url> [-s <system_id>] [-d <deployment_uuid>] # # Example: # python sar_etl.py eCXZbZwmBrtD5hgrJ8ptmJfvDA5vlDcc ht...
#!/usr/bin/env python # coding: utf-8 # Copyright 2020 The HuggingFace Team. 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/LICENS...
#!/usr/bin/env python # # Copyright 2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, or (at your option) # ...
import collections import io import os import errno import pathlib import pickle import shutil import socket import stat import sys import tempfile import unittest from contextlib import contextmanager if sys.version_info < (2, 7): try: import unittest2 as unittest except ImportError: raise Imp...
""" Tests specific to the CourseRerunState Model and Manager. """ from django.test import TestCase from opaque_keys.edx.locations import CourseLocator from six import text_type from course_action_state.managers import CourseRerunUIStateManager from course_action_state.models import CourseRerunState from student.test...
#/*########################################################################## # Copyright (C) 2004-2012 European Synchrotron Radiation Facility # # This file is part of the PyMca X-ray Fluorescence Toolkit developed at # the ESRF by the Software group. # # This toolkit is free software; you can redistribute it and/or m...
import sys import random from PyQt4 import QtGui, QtCore from RFID import * from DrupalConnector import * class MainWindow(QtGui.QMainWindow): def __init__(self): super(MainWindow, self).__init__() self.initUI() self.checkCardReader() def initUI(self): cWidget = QtGui.QWidget(self) vBox = QtG...
# encoding: 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): # Adding field 'Project.repo_type' db.add_column('projects_project', 'repo_type', self.gf('django.db.models.fields...
import os import sys import pipes import shutil import subprocess """ This plugin uses glue to sprite images: http://glue.readthedocs.org/en/latest/quickstart.html Install: (Only if you want to sprite jpg too) brew install libjpeg sudo easy_install pip sudo pip uninstall pil sudo pip install pil sudo pip install gl...
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2017, Ansible by Red Hat, 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 (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import print_function, unicode_literals import frappe from frappe.utils import flt, cstr, nowdate, nowtime from erpnext.stock.utils import update_bin from erpnext.stock.stock_l...
# -*- coding: utf-8 -*- """A model of an Infrastructure Host in CFME.""" from functools import partial from navmazing import NavigateToSibling, NavigateToAttribute from manageiq_client.api import APIException from selenium.common.exceptions import NoSuchElementException from cfme.base.credential import Credential as ...
""" EXPERIMENTAL CODE! Here we load a .TTF font file, and display it in a basic pygame window. It demonstrates several of the Font object attributes. Nothing exciting in here, but it makes a great example for basic window, event, and font management. """ import pygame import math from pygame.locals import * from pyg...
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
from bz2 import BZ2File import gzip from io import BytesIO import numpy as np import os import shutil from tempfile import NamedTemporaryFile from sklearn.externals.six import b from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert...
from django.conf.urls import url from django.contrib.auth.decorators import login_required from django.views import generic from oscar.core.application import Application from oscar.core.loading import get_class class CustomerApplication(Application): name = 'customer' summary_view = get_class('customer.view...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
# -*- encoding: utf-8 -*- # Pilas engine - A video game framework. # # Copyright 2010 - Hugo Ruscitti # License: LGPLv3 (see http://www.gnu.org/licenses/lgpl.html) # # Website - http://www.pilas-engine.com.ar import pilas from pilas.actores import Actor class Mapa(Actor): """Representa mapas creados a partir de ...
#!/usr/bin/python3 import numpy as np import matplotlib.pyplot as plt import sys class Src: def __init__(self, fname, block_size, navg = 1): self.offs = 0 self.navg = navg self.block_size = block_size self.data = np.fromfile(fname, dtype=np.float32) l = divmod(len(self.dat...
from bitlist.models.user import User from bitlist.models.song import Song from bitlist.models.playlist import Playlist import jobs import json import player from pyramid.security import remember from pyramid.security import forget from pyramid.view import view_config from pyramid.view import forbidden_view_config from ...
#!/usr/bin/env python # # Copyright 2016 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless require...
# Created by CubicVirtuoso # Any problems feel free to drop by #l2j-datapack on irc.freenode.net import sys from net.sf.l2j.gameserver.model.quest import State from net.sf.l2j.gameserver.model.quest import QuestState from net.sf.l2j.gameserver.model.quest.jython import QuestJython as JQuest #NPCs MIRABEL = 7146 ARI...
from urlparse import urlparse from threading import Thread import httplib, sys, multiprocessing from Queue import Queue import simplejson import time import base64 num_processes = int(sys.argv[1]) num_threads = int(sys.argv[2]) num_requests = int(sys.argv[3]) num_metrics_per_request = int(sys.argv[4]) series_name = sy...
import win32security,win32api,win32con, win32process new_privs = ((win32security.LookupPrivilegeValue('',win32security.SE_SECURITY_NAME),win32con.SE_PRIVILEGE_ENABLED), (win32security.LookupPrivilegeValue('',win32security.SE_TCB_NAME),win32con.SE_PRIVILEGE_ENABLED), (win32security.LookupPrivil...
# -*- coding: utf-8 -*- """ Acceptance tests for Video. """ from .helpers import UniqueCourseTest from ..pages.lms.video import VideoPage from ..pages.lms.tab_nav import TabNavPage from ..pages.studio.auto_auth import AutoAuthPage from ..pages.lms.course_info import CourseInfoPage from ..fixtures.course import Course...
from math import log10 from django.core.exceptions import ObjectDoesNotExist from elasticsearch_dsl.search import Search as dslSearch from statsd import statsd from mkt.constants.base import VALID_STATUSES class Search(dslSearch): def execute(self): with statsd.timer('search.execute'): res...
# -*- 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): # Adding field 'PaymentEvent.reference' db.add_column('order_paymentevent', 'reference', ...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright 2013 NEC Corporation. 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.or...
# Pretty much all copied from pyOpenSSL's certgen.py example and func's certs.py # func's certs.py is GPLv2+ # pyOpenSSL is LGPL (Probably v2+) # The pyOpenSSL examples may be under the same license but I'm not certain. from OpenSSL import crypto TYPE_RSA = crypto.TYPE_RSA TYPE_DSA = crypto.TYPE_DSA def retrieve_key_...
# # $Id$ # from sphinxapi import * import sys, time if not sys.argv[1:]: print "Usage: python test.py [OPTIONS] query words\n" print "Options are:" print "-h, --host <HOST>\tconnect to searchd at host HOST" print "-p, --port\t\tconnect to searchd at port PORT" print "-i, --index <IDX>\tsearch through index(es) s...
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals def get_notification_config(): return { "for_doctype": { "Issue": {"status": "Open"}, "Warranty Claim": {"status": "Open"}, "Task": {"statu...
"""distutils.archive_util Utility functions for creating archive files (tarballs, zip files, that sort of thing).""" # This module should be kept compatible with Python 2.1. __revision__ = "$Id: archive_util.py,v 1.17 2004/11/10 22:23:13 loewis Exp $" import os from distutils.errors import DistutilsExecError from d...
import math import re import types import actions import traverser as js_traverser import predefinedentities from jstypes import * from validator.constants import BUGZILLA_BUG from validator.compat import (FX6_DEFINITION, FX7_DEFINITION, FX8_DEFINITION, FX9_DEFINITION, FX11_DEFINITION, TB...
import datetime from operator import attrgetter from django.conf import settings from django.core.exceptions import ValidationError from django.db import DEFAULT_DB_ALIAS from django.test import TestCase from django.utils import tzinfo from models import (Worker, Article, Party, Event, Department, BrokenUnicodeMe...
# Copyright (C) 2015 Alex Nitz # # 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 program is distributed in the ...
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsVectorLayer. .. note:: This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. """ __...
# -*- 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): # Adding model 'SearchableTool' db.create_table('search_searchabletool', ( ('id', self.gf( ...
#!/usr/bin/env python # # Copyright (C) 2015 YouCompleteMe contributors # # This file is part of YouCompleteMe. # # YouCompleteMe 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...
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2016 Michael Gruener <[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', ...
# The MIT License (MIT) # # Copyright (c) 2014 Richard Moore # # 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, mod...
import json from tests.factories import ( RequestFactory, ResponseFactory, ) def test_path_property(): request = RequestFactory(url='http://www.example.com/blog/25') assert request.path == '/blog/25' def test_query_property(): request = RequestFactory(url='http://www.example.com/api/?token=1234...
# coding=utf-8 # Author: Nic Wolfe <[EMAIL]> # URL: http://code.google.com/p/sickbeard/ # # This file is part of SickRage. # # SickRage 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 ...
"""Core implementation of path-based import. This module is NOT meant to be directly imported! It has been designed such that it can be bootstrapped into Python as the implementation of import. As such it requires the injection of specific modules and attributes in order to work. One should use importlib as the public...
#!/usr/bin/env python import sys import argparse from fastavro import writer parser = argparse.ArgumentParser() parser.add_argument('output_file', help='Output Avro data file') parser.add_argument('--num_records', dest='num_records', default=1024, type=int, help='Number of records to generate (default: 1024)') parser....
""" Google Voice SMS platform for notify component. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/notify.google_voice/ """ import logging from homeassistant.components.notify import ( ATTR_TARGET, DOMAIN, BaseNotificationService) from homeassistant...
# A 'tree' is a networkx.DiGraph with a single root node (a node without parents) from operator import itemgetter from networkx import Graph, DiGraph from collections import defaultdict from math import sqrt from itertools import izip, islice from catmaid.models import Treenode def find_root(tree): """ Search and...
# # (c) 2016 Red Hat Inc. # # 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 d...
# 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 # distributed under t...
import pytest @pytest.mark.parametrize( "filter_string, expected_result", [ ("h=28 or w=6 or l=2", True), ("r.params.get.param2='2'", True), ("r.headers.response.Location", "https://wfuzz.readthedocs.io/en/latest/"), ("r.headers.response.notthere", {}), ("r.params.get.n...
import imp import logging import os import sys from optparse import OptionParser, make_option from django import VERSION as DJANGO_VERSION from django.conf import ENVIRONMENT_VARIABLE as SETTINGS_ENVIRONMENT_VARIABLE from django.core.exceptions import ImproperlyConfigured from django.core.management import base from ...
from __future__ import absolute_import import itertools import logging import time import click from populus.compilation import ( compile_project_contracts, ) from .accounts import ( is_account_locked, ) from .compile import ( write_compiled_sources, ) from .contracts import ( verify_contract_byteco...
import string, random words = open("Alice's Adventures in Wonderland by Lewis Carroll.txt").read().split('\n') xwords = open('words.txt').read().split('\n') emma = open('Emma by Jane Austen.txt').read().split('\n') def break_book_into_words(book): #apostrophes are a problem, don't => dont lower_book = '' ...
# -*- 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): # Adding field 'Artist.spotify_artist_href' db.add_column(u'history_artist', 'spotify_artist_href', ...
''' Steps for problem.feature lettuce tests ''' # pylint: disable=missing-docstring # pylint: disable=redefined-outer-name from lettuce import world, step from common import i_am_registered_for_the_course, visit_scenario_item from problems_setup import PROBLEM_DICT, answer_problem, problem_has_answer, add_problem_to_...
# =============================================================================== # Copyright 2013 Jake Ross # # 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/licens...
from test_plus.test import TestCase from ..admin import MyUserCreationForm class TestMyUserCreationForm(TestCase): def setUp(self): self.user = self.make_user() def test_clean_username_success(self): # Instantiate the form with a new username form = MyUserCreationForm({ ...
# * ************************************************************* # * # * Soft Active Mater on Surfaces (SAMoS) # * # * Author: Rastko Sknepnek # * # * Division of Physics # * School of Engineering, Physics and Mathematics # * University of Dundee # * # * (c) 2013, 2014 # * # * School of Scienc...
""" Module simplifying manipulation of XML described at http://libvirt.org/formatnetwork.html """ import logging from virttest import virsh, xml_utils from virttest.libvirt_xml import base, xcepts, accessors class RangeList(list): """ A list of start & end address tuples """ def __init__(self, iterab...
# -*- coding: utf-8 -*- # Copyright(C) 2010-2013 Romain Bignon, Pierre Mazière, Noé Rubinstein # # 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 versio...
# -*- coding: utf-8 -*- """Word cloud integration tests using mongo modulestore.""" import json from operator import itemgetter from . import BaseTestXmodule from xmodule.x_module import STUDENT_VIEW class TestWordCloud(BaseTestXmodule): """Integration test for word cloud xmodule.""" CATEGORY = "word_cloud"...
"""Support for Wink lights.""" import pywink from homeassistant.components.light import ( ATTR_BRIGHTNESS, ATTR_COLOR_TEMP, ATTR_HS_COLOR, SUPPORT_BRIGHTNESS, SUPPORT_COLOR, SUPPORT_COLOR_TEMP, LightEntity, ) from homeassistant.util import color as color_util from homeassistant.util.color i...
import rospy from sensor_msgs.msg import Image from std_msgs.msg import String from cv_bridge import CvBridge import cv2 import numpy as np import tensorflow as tf import classify_image class RosTensorFlow(): def __init__(self): classify_image.maybe_download_and_extract() self._session = tf.Sessio...
import operator import numpy as np import pytest import pandas as pd import pandas._testing as tm from pandas.arrays import BooleanArray from pandas.tests.extension.base import BaseOpsUtil class TestLogicalOps(BaseOpsUtil): def test_numpy_scalars_ok(self, all_logical_operators): a = pd.array([True, Fals...
#!/usr/bin/python """Test of HTML list presentation.""" from macaroon.playback import * import utils sequence = MacroSequence() #sequence.append(WaitForDocLoad()) sequence.append(PauseAction(5000)) # Work around some new quirk in Gecko that causes this test to fail if # run via the test harness rather than manuall...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2010-2013 Código Sur Sociedad Civil. # All rights reserved. # # This file is part of Cyclope. # # Cyclope 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 Foundat...
#!/usr/bin/env python # # Copyright (c) 2015 Intel Corporation. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of works must retain the original copyright notice, this # list of conditions and t...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-...
#!/usr/bin/python try: import setuptools except ImportError: import ez_setup ez_setup.use_setuptools() from setuptools import setup, find_packages import sys, os from cogen import __version__ as version setup( name='cogen', version=version, description=''' Coroutines...