text
stringlengths
475
200k
# -*- coding: utf-8 -*- # Copyright 2013 Mirantis, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requi...
import functools try: import json except ImportError: import simplejson as json import pytest from fabric.api import cd, run from fabtools.files import is_file from fabtools.require import directory as require_directory from fabtools.require import file as require_file pytestmark = pytest.mark.network @p...
from ctypes import * import unittest import os import ctypes import _ctypes_test class BITS(Structure): _fields_ = [("A", c_int, 1), ("B", c_int, 2), ("C", c_int, 3), ("D", c_int, 4), ("E", c_int, 5), ("F", c_int, 6), ...
import gtk import gobject import sys import traceback from cStringIO import StringIO from HIGDialog import HIGDialog from LogView import LogView # define some Dialog icons _ERROR = gtk.STOCK_DIALOG_ERROR _INFO = gtk.STOCK_DIALOG_INFO _QUESTION = gtk.STOCK_DIALOG_QUESTION _WARNING = gtk.STOCK_DIALOG_WARNING # we onl...
DATA_SOURCE = 'data/dialog-bAbI-tasks/dialog-babi-candidates.txt' DATA_SOURCE_TASK6 = 'data/dialog-bAbI-tasks/dialog-babi-task6-dstc2-candidates.txt' DATA_DIR = 'dialog-bAbI-tasks/dialog-babi-candidates.txt' STOP_WORDS=set(["a","an","the"]) import re import os from itertools import chain from six.moves import range,...
# Wrapper module for _socket, providing some additional facilities # implemented in Python. """\ This module provides socket operations and some related functions. On Unix, it supports IP (Internet Protocol) and Unix domain sockets. On other systems, it only supports IP. Functions specific for a socket are available a...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1) # # (1) Kamaelia Contributors are listed in the AUTHORS file and at # http://www.kamaelia.org/AUTHORS - please extend this file, # not this notice. # # Licensed under the Apache License,...
#coding=UTF-8 from pyspark import SparkContext, SparkConf, SQLContext, Row, HiveContext from pyspark.sql.types import * from datetime import date, datetime, timedelta import sys, re, os st = datetime.now() conf = SparkConf().setAppName('PROC_F_CI_CUST_SIGN').setMaster(sys.argv[2]) sc = SparkContext(conf = conf) sc.set...
#!/usr/bin/python3 from amazonia.classes.elb import Elb from amazonia.classes.elb_config import ElbConfig, ElbListenersConfig from network_setup import get_network_config def main(): network_config, template = get_network_config() elb_listeners_config = [ ElbListenersConfig( instance_por...
""" Test cases for image processing functions in the profile image package. """ from contextlib import closing from itertools import product import os from tempfile import NamedTemporaryFile import unittest from django.conf import settings from django.core.files.uploadedfile import UploadedFile from django.test import...
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. from __future__ import unicode_literals import imp import os import sys from mach.base import MachError from mach.test....
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor class YourUploadIE(InfoExtractor): _VALID_URL = r'''(?x)https?://(?:www\.)? (?:yourupload\.com/watch| embed\.yourupload\.com| embed\.yucache\.net )/(?P<id>[A-Za-z0-9]+) ''' ...
# -*- coding: utf-8 -*- """ Created on Thu Sep 1 16:54:39 2016 @author: stonneau """ from pinocchio_inv_dyn.optimization.solver_LP_abstract import LP_status, LP_status_string from pinocchio_inv_dyn.multi_contact.stability_criterion import Bunch from pinocchio_inv_dyn.optimization.solver_LP_abstract import ...
""" Python Interchangeable Virtual Instrument Library Copyright (c) 2013-2016 Alex Forencich 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...
import socket import threading import json class EnablerConnection(): def __init__(self): self.connections = [] self.stopped = False self.enabler_listening_port = 50001 self.local_ip = socket.gethostbyname(socket.gethostname()) t = threading.Thread(target=self.listen_loop,...
#!/usr/bin/env python # vim: ai ts=4 sts=4 et sw=4 import re class Keyworder(object): TOKEN_MAP = [ ("slug", "([a-z0-9\-]+)"), ("letters", "([a-z]+)"), ("numbers", "(\d+)"), ("whatever", "(.+)")] def __init__(self): self.regexen = [] self.prefix = "" ...
""" Desired syntax: gaurdian = MaxDepth(10) & HasAttr('__dict__') if gaurdian(current, path): # .... walker(obj, gaurd=MaxDepth(10) & HasAttr('__dict__')) @note: I put example wrapper decorators at the bottom. @todo: Come up with simple-ish logical structure alternative to the wrapper decora...
from __future__ import absolute_import import logging import gensim import pandas as pd # imports used only for doctests from topik.readers import read_input from topik.tests import test_data_path from topik.preprocessing import preprocess class LDA(object): """A high interface for an LDA (Latent Dirichlet All...
# -*- coding: utf-8 -*- from south.db import db from south.v2 import SchemaMigration class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'CourseEmail' db.create_table('bulk_email_courseemail', ( ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True...
# Copyright (c) 2012 ARM Limited # 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 implementation of the functionality ...
import os import sys import linecache from TreeWidget import TreeNode, TreeItem, ScrolledCanvas from ObjectBrowser import ObjectTreeItem, make_objecttreeitem def StackBrowser(root, flist=None, tb=None, top=None): if top is None: from Tkinter import Toplevel top = Toplevel(root) sc = ScrolledCa...
# Copyright 2010-2014 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 from __future__ import division import locale import logging import time from portage import os, _unicode_decode from portage.exception import PortageException from portage.localization import _ from portage.ou...
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor class Canal13clIE(InfoExtractor): _VALID_URL = r'^http://(?:www\.)?13\.cl/(?:[^/?#]+/)*(?P<id>[^/?#]+)' _TEST = { 'url': 'http://www.13.cl/t13/nacional/el-circulo-de-hierro-de-michelle-bachelet-en-su-...
import unittest from ctypes import * from ctypes.test import need_symbol from struct import calcsize import _testcapi class SubclassesTest(unittest.TestCase): def test_subclass(self): class X(Structure): _fields_ = [("a", c_int)] class Y(X): _fields_ = [("b", c_...
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt # ERPNext - web based ERP (http://erpnext.com) # For license information, please see license.txt from __future__ import unicode_literals import webnotes, unittest from webnotes.utils impor...
import os from sets import Set from get_lineStroke import getLineStroke from get_targetStrings import getTargetString from get_xmlFileName import getXmlNames import netcdf_helpers import numpy as np targetStrings = [] wordTargetStrings = [] charSet = Set() inputs = [] labels = [] seqDims = [] seqLengths = [] seqTag...
# Copyright (c) 2013, Web Notes 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.email import sendmail_to_system_managers from frappe.utils import get_link_to_form def execute(): wrong_r...
#!/usr/bin/env python # -*- coding: UTF-8 -*- import numpy as np import matplotlib.pyplot as plt from skimage.transform import PiecewiseAffineTransform, warp from skimage import data #--------------------------------------------------------------------- # REF [site] >> http://scikit-image.org/docs/stable/auto_exampl...
# -*- coding:utf-8 -*- """ /*************************************************************************** qgsplugininstallerinstallingdialog.py Plugin Installer module ------------------- Date : June 2013 Copyright ...
from itertools import cycle from PIL import Image from PIL import ImageTk try: # Python2 import Tkinter as tk except ImportError: # Python3 import tkinter as tk class App(tk.Tk): def __init__(self, image_files, x, y, delay): tk.Tk.__init__(self) self.geometry('+{}+{}'.format(x, y))...
"""cases Revision ID: 9474324542c6 Revises: Create Date: 2017-06-08 09:02:37.384472 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '9474324542c6' down_revision = None branch_labels = None depends_on = None def upgrade(): # ### commands auto generated by...
"""Drop-in replacement for collections.OrderedDict by Raymond Hettinger http://code.activestate.com/recipes/576693/ """ from UserDict import DictMixin # Modified from original to support Python 2.4, see # http://code.google.com/p/simplejson/issues/detail?id=53 try: all except NameError: def all(seq): ...
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
# Copyright 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.org/licenses/LICENSE-2.0 # # Unless required ...
############################################################################## # Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, [EMAIL], All rights reserved. # LLNL-CODE-647188 # # F...
""" Tests for SplitTestTransformer. """ import ddt import openedx.core.djangoapps.user_api.course_tag.api as course_tag_api from openedx.core.djangoapps.user_api.partition_schemes import RandomUserPartitionScheme from student.tests.factories import CourseEnrollmentFactory from xmodule.partitions.partitions import Grou...
# # The Python Imaging Library. # $Id$ # # a simple Qt image interface. # # history: # 2006-06-03 fl: created # 2006-06-04 fl: inherit from QImage instead of wrapping it # 2006-06-05 fl: removed toimage helper; move string support to ImageQt # 2013-11-13 fl: add support for Qt5 ([EMAIL]) # # Copyright (c) 2006 by Secre...
#-*- coding: utf-8 -*- from django.forms.models import modelform_factory from django.contrib import admin from django.http import HttpResponse from django.utils import simplejson from django.views.decorators.csrf import csrf_exempt from filer import settings as filer_settings from filer.models import Clipboard, Clipboa...
import win32api, win32security import win32con, ntsecuritycon, winnt import os temp_dir=win32api.GetTempPath() fname=win32api.GetTempFileName(temp_dir,'rsk')[0] print fname ## file can't exist os.remove(fname) ## enable backup and restore privs required_privs = ((win32security.LookupPrivilegeValue('',ntsecuritycon.SE...
# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from code import Code from model import PropertyType import cpp_util import model import os class HGenerator(object): """A .h generator for a namespac...
""" Tests that the project's module import graph conforms to certain policies """ from __future__ import division from __future__ import print_function from __future__ import unicode_literals import copy import fnmatch import itertools import logging import operator import os import pprint import unittest import sys ...
"""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 The SCons Foundation # # Perm...
# -*- coding: utf-8 -*- # Open Source Initiative OSI - The MIT License (MIT):Licensing # # The MIT License (MIT) # Copyright (c) 2013 DotCloud Inc ([EMAIL]) # # 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...
# 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 License, or # (at your option) any later version. # # This program is distributed in the...
#!/usr/bin/env python ######################################################################## # $HeadURL$ # File : dirac-fix-ld-lib # Author : Joel Closier ######################################################################## __RCSID__ = "$Id$" """ This is a script to fix oversized LD_LIBRARY_PATH variables. """...
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import parse_duration class Canalc2IE(InfoExtractor): IE_NAME = 'canalc2.tv' _VALID_URL = r'https?://(?:(?:www\.)?canalc2\.tv/video/|archives-canalc2\.u-strasbg\.fr/video\.asp\?.*\bidVideo=)(?P<i...
#! /usr/bin/env python import argparse import time import subprocess import sys import re from subprocess import CalledProcessError """ A script to push releases to Google Play See samples: https://github.com/googlesamples/android-play-publisher-api Requires Google API python client Insall with: pip install google-...
#!/usr/bin/python # Copyright 2015 The Project Buendia Authors # # 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 l...
""" Tcpdump parser Source: * libpcap source code (file savefile.c) * RFC 791 (IPv4) * RFC 792 (ICMP) * RFC 793 (TCP) * RFC 1122 (Requirements for Internet Hosts) Author: Victor Stinner Creation: 23 march 2006 """ from hachoir_parser import Parser from hachoir_core.field import (FieldSet, ParserError, Enum, ...
from __future__ import unicode_literals from collections import OrderedDict import re from bisect import bisect import warnings from django.conf import settings from django.db.models.fields.related import ManyToManyRel from django.db.models.fields import AutoField, FieldDoesNotExist from django.db.models.fields.proxy...
# ============================================================================= # Copyright (c) 2016, Cisco Systems, 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 ...
from Screens.Wizard import wizardManager, WizardSummary from Screens.WizardLanguage import WizardLanguage from Screens.Rc import Rc from Screens.MessageBox import MessageBox from Components.Pixmap import Pixmap, MovingPixmap, MultiPixmap from Components.Sources.Boolean import Boolean from Components.Network import iNet...
# coding=utf-8 # Copyright 2021 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 or agreed ...
from sparktk.loggers import log_load; log_load(__name__); del log_load from sparktk.propobj import PropertiesObject from sparktk.frame.ops.classification_metrics_value import ClassificationMetricsValue import os def train(frame, label_column, observation_columns, num_classes = 2, ...
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from openerp import api from openerp.osv import fields,osv from openerp.tools.translate import _ WARNING_MESSAGE = [ ('no-message','No Message'), ('warning','Warning'), ...
# Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file ex...
#! /usr/bin/env python from __future__ import division, absolute_import, print_function # System imports from distutils.util import get_platform import os import sys import unittest # Import NumPy import numpy as np major, minor = [ int(d) for d in np.__version__.split(".")[:2] ] if major == 0: BadListError = TypeE...
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( ExtractorError, sanitized_Request, urlencode_postdata, xpath_text, xpath_with_ns, ) _x = lambda p: xpath_with_ns(p, {'xspf': 'http://xspf.org/ns/0/'}) class NosVideoIE(InfoE...
# Since this package contains a "jinja2" directory, this is required to # silence an ImportWarning warning on Python 2. from __future__ import absolute_import from unittest import skipIf from django.template import TemplateSyntaxError from .test_dummy import TemplateStringsTests try: import jinja2 except Import...
################################ # These variables are overwritten by Zenoss when the ZenPack is exported # or saved. Do not modify them directly here. # NB: PACKAGES is deprecated NAME = "ZenPacks.example.Techniques" VERSION = "1.4.1" AUTHOR = "Chet Luther" LICENSE = "" NAMESPACE_PACKAGES = ['ZenPacks', 'ZenPacks.exa...
# 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 ...
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import collections from measurements import startup from metrics import cpu from metrics import startup_metric from telemetry.core import util from telemetr...
try: import cPickle as pickle except ImportError: import pickle from django.conf import settings from django.core import signing from django.contrib.sessions.backends.base import SessionBase class PickleSerializer(object): """ Simple wrapper around pickle to be used in signing.dumps and signing....
# -*- encoding: utf-8 -*- # This file is part of MyPaint. # Copyright (C) 2009-2013 by Martin Renold <[EMAIL]> # Copyright (C) 2013-2016 by the MyPaint Development Team. # # 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 ...
#!/usr/bin/env python __author__ = 'rolandh' import copy import sys import os import re import logging import logging.handlers from importlib import import_module from saml2 import root_logger, BINDING_URI, SAMLError from saml2 import BINDING_SOAP from saml2 import BINDING_HTTP_REDIRECT from saml2 import BINDING_HT...
# -*- coding: utf-8 -*- # Copyright 2011 Jaap Karssenberg <[EMAIL]> import tests import gtk import pango from zim.index import Index, IndexPath, IndexTag from zim.notebook import Path from zim.gui.pageindex import FGCOLOR_COL, \ EMPTY_COL, NAME_COL, PATH_COL, STYLE_COL # Explicitly don't import * from pageindex, ...
import json import unittest from binascii import b2a_hex from unittest import skipUnless from django.contrib.gis.gdal import HAS_GDAL from django.utils.six.moves import range from ..test_data import TestDataMixin try: from django.utils.six.moves import cPickle as pickle except ImportError: import pickle if...
"""Global database feature support policy. Provides decorators to mark tests requiring specific feature support from the target database. """ from testing import \ _block_unconditionally as no_support, \ _chain_decorators_on, \ exclude, \ emits_warning_on,\ skip_if,\ fails_on,\ fai...
import sys from test import support, list_tests class ListTest(list_tests.CommonTest): type2test = list def test_basic(self): self.assertEqual(list([]), []) l0_3 = [0, 1, 2, 3] l0_3_bis = list(l0_3) self.assertEqual(l0_3, l0_3_bis) self.assertTrue(l0_3 is not l0_3_bis) ...
#!/usr/bin/env python """This is the GRR class registry. A central place responsible for registering plugins. Any class can have plugins if it defines __metaclass__ = MetaclassRegistry. Any derived class from this baseclass will have the member classes as a dict containing class name by key and class as value. """ #...
# ============================================================================= # Authors: PAR Government # Organization: DARPA # # Copyright (c) 2016 PAR Government # All rights reserved. # ============================================================================== import json import logging import os from json i...
import unittest from scrapy.settings import BaseSettings from scrapy.utils.conf import build_component_list, arglist_to_dict class BuildComponentListTest(unittest.TestCase): def test_build_dict(self): d = {'one': 1, 'two': None, 'three': 8, 'four': 4} self.assertEqual(build_component_list(d, con...
"""Tests for cross-domain request views. """ import json from django.test import TestCase from django.core.urlresolvers import reverse, NoReverseMatch import ddt from config_models.models import cache from cors_csrf.models import XDomainProxyConfiguration @ddt.ddt class XDomainProxyTest(TestCase): """Tests for...
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2015, Darren Worrall <[EMAIL]> # (c) 2015, René Moser <[EMAIL]> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, ei...
# Copyright 2010 Hakan Kjellerstrand [EMAIL] # # 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...
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe import random from frappe.utils import random_string from frappe.desk import query_report from erpnext.accounts.doctype.journal_entry.jo...
# -*- coding: utf-8-*- import os import re from getpass import getpass import yaml from pytz import timezone import feedparser import jasperpath def run(): profile = {} print("Welcome to the profile populator. If, at any step, you'd prefer " + "not to enter the requested information, just hit 'Ente...
# (c) 2012-2014, Michael DeHaan <[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 # (at your option) any later version. ...
""" * Copyright (c) 2012-2017, Adriana Flores * 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 co...
from __future__ import unicode_literals import os import re import subprocess import time from .common import FileDownloader from ..compat import compat_str from ..utils import ( check_executable, encodeFilename, encodeArgument, get_exe_version, ) def rtmpdump_version(): return get_exe_version( ...
# -*- coding: utf-8 -*- """ flask.signals ~~~~~~~~~~~~~ Implements signals based on blinker if available, otherwise falls silently back to a noop :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ signals_available = False try: from blinker import Name...
# -*- coding: utf-8 -*- """ /*************************************************************************** QAD Quantum Aided Design plugin funzioni per comando SPEZZA per tagliare un oggetto ------------------- begin : 2019-08-08 copyright ...
""" This module collects helper functions and classes that "span" multiple levels of MVC. In other words, these functions/classes introduce controlled coupling for convenience's sake. """ from django.template import loader, RequestContext from django.http import HttpResponse, Http404 from django.http import HttpRespons...
""" Artificial Intelligence for Humans Volume 2: Nature-Inspired Algorithms Python Version http://www.aifh.org http://www.jeffheaton.com Code repository: https://github.com/jeffheaton/aifh Copyright 2013 by Jeff Heaton Licensed under the Apache License, Version 2.0 (the "License")...
# mysql/gaerdbms.py # Copyright (C) 2005-2017 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """ .. dialect:: mysql+gaerdbms :name: Google Cloud SQL :dbapi: rdbms :...
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
#!/usr/bin/env python # -*- coding: utf-8 -*- # filename: npsapp.py import cProfile import pstats from npyscreen import NPSApp from npyscreen import Form from npyscreen import TextTokens, TitleTextTokens class TextBoxForm(Form): def create(self): tb = self.add(TextTokens, name="TokenField", )#max_width=25...
# Licensed to the StackStorm, Inc ('StackStorm') 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 th...
# module pyparsing.py # # Copyright (c) 2003-2013 Paul T. McGuire # # 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 u...
# Copyright 2017 gRPC authors. # # 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...
# 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
#!/usr/bin/env python '''automated testing of Samba3 against windows''' import sys, os import optparse import wintest def set_libpath(t): t.putenv("LD_LIBRARY_PATH", "${PREFIX}/lib") def set_krb5_conf(t): t.run_cmd("mkdir -p ${PREFIX}/etc") t.write_file("${PREFIX}/etc/krb5.conf", ''...
"""Strptime-related classes and functions. CLASSES: LocaleTime -- Discovers and stores locale-specific time information TimeRE -- Creates regexes for pattern matching a string of text containing time information FUNCTIONS: _getlang -- Figure out what language is being used for the locale ...
from __future__ import absolute_import from django.conf import settings from django.contrib import comments from django.contrib.comments.models import Comment from django.contrib.comments.forms import CommentForm from . import CommentTestCase class CommentAppAPITests(CommentTestCase): """Tests for the "comment ...
from flask_mail import Message from flask import render_template, url_for import NodeDefender import smtplib @NodeDefender.decorators.mail_enabled @NodeDefender.decorators.celery_task def new_node(group, node): group = NodeDefender.db.group.get(group) if group is None: return False if group.email i...
# Copyright 2018 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 applicable ...
"""Tests for setuptools.find_packages().""" import os import sys import shutil import tempfile import unittest import platform import setuptools from setuptools import find_packages from setuptools.tests.py26compat import skipIf find_420_packages = setuptools.PEP420PackageFinder.find # modeled after CPython's test.s...
# from datetime import datetime class Program ( ): #private: """ id # int datetime # datetime description # string status # boolean inactive # boolean weekly # boolean pin # int(4) id_related_dev # int id_initiator # int """ def __init__(self,**kwargs): """ @**kwargs: id: int datetime: date...
import unittest import numpy import chainer from chainer import cuda from chainer import functions from chainer import gradient_check from chainer.testing import attr if cuda.available: cuda.init() class TestSplitAxis0(unittest.TestCase): def setUp(self): self.x = numpy.arange(42, dtype=numpy.flo...
# -*- coding: utf-8 -*- from __future__ import print_function import os import sys from mock import patch from six import StringIO, text_type from tzlocal import get_localzone from djangocms_installer import config from djangocms_installer.install import check_install from djangocms_installer.utils import less_than_v...