text
stringlengths
475
200k
#!/usr/bin/env python # -*- coding: utf-8 -*- # # GuessIt - A library for guessing information from filenames # Copyright (c) 2013 Nicolas Wack <[EMAIL]> # # GuessIt is free software; you can redistribute it and/or modify it under # the terms of the Lesser GNU General Public License as published by # the Free Software ...
from .compat import OrderedDict, is_py2, str, bytes, integer_types, string_types from .util import pack_bytes_into from collections import namedtuple from struct import Struct, error as struct_error from inspect import getargspec (SCRIPT_DATA_TYPE_NUMBER, SCRIPT_DATA_TYPE_BOOLEAN, SCRIPT_DATA_TYPE_STRING, SCRIPT_DAT...
# (c) 2014, Chris Church <[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. # # An...
# -*- coding: utf-8 -*- from django.db import models from apps.titulos.models.CohorteExtensionAulica import CohorteExtensionAulica import datetime "Seguimiento de cada cohorte de la extensión áulica" class CohorteExtensionAulicaSeguimiento(models.Model): cohorte_extension_aulica = models.ForeignKey(CohorteExtensio...
import logging from openerp.osv import osv,fields from openerp import _ #import pooler logging.basicConfig(level=logging.DEBUG) class make_medical_appointment_invoice(osv.osv_memory): _name="oemedical.appointment.invoice" def create_invoice(self, cr, uid, ids, context={}): invoice_obj = self.poo...
# coding=utf-8 import pytest from os.path import join from xpaw.cmdline import main from xpaw import __version__ def test_print_help(capsys): with pytest.raises(SystemExit) as excinfo: main(argv=['xpaw']) assert excinfo.value.code == 0 out, _ = capsys.readouterr() assert out.startswith('usag...
# # Tests of spherical Bessel functions. # import numpy as np from numpy.testing import (assert_almost_equal, assert_allclose, dec, assert_array_almost_equal) from numpy import sin, cos, sinh, cosh, exp, inf, nan, r_, pi from scipy.special import spherical_jn, spherical_yn, spherical_in, sp...
""" A Python "serializer". Doesn't do much serializing per se -- just converts to and from basic Python data types (lists, dicts, strings, etc.). Useful as a basis for other serializers. """ from django.conf import settings from django.core.serializers import base from django.db import models from django.utils.encodin...
# -*- coding: utf-8 -*- from __future__ import unicode_literals import datetime import os import tempfile import uuid from django.contrib.auth.models import User from django.contrib.contenttypes.fields import ( GenericForeignKey, GenericRelation, ) from django.contrib.contenttypes.models import ContentType from d...
''' Robot testing for test volume operations for 2 hours. Will use weight fairly strategy. @author: Youyk ''' import zstackwoodpecker.action_select as action_select import zstackwoodpecker.test_util as test_util import zstackwoodpecker.test_state as test_state import zstackwoodpecker.test_lib as test_lib ...
""" Defines classes and functions for working with Qt's rich text system. """ #----------------------------------------------------------------------------- # Imports #----------------------------------------------------------------------------- # Standard library imports import io import os import re # System librar...
# Copyright 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. import os from telemetry.page.actions import page_action class ScrollAction(page_action.PageAction): # TODO(chrishenry): Ignore attributes, to be deleted...
""" Iterator for RNN data """ from functools import wraps import numpy as np from theano import config from pylearn2.sandbox.rnn.space import SequenceDataSpace from pylearn2.sandbox.rnn.space import SequenceMaskSpace from pylearn2.space import CompositeSpace from pylearn2.utils import safe_izip from pylearn2.utils.it...
"""PyPI and direct package downloading""" import sys import os import re import shutil import socket import base64 import hashlib from functools import wraps from pkg_resources import ( CHECKOUT_DIST, Distribution, BINARY_DIST, normalize_path, SOURCE_DIST, require, Environment, find_distributions, safe_name, s...
import os import pytest import textwrap from sklearn import __version__ from sklearn.utils._openmp_helpers import _openmp_parallelism_enabled def test_openmp_parallelism_enabled(): # Check that sklearn is built with OpenMP-based parallelism enabled. # This test can be skipped by setting the environment varia...
from TreeSerialize.TreeSerialize import deserialize, drawtree ''' Needs Python 3+ ''' class Solution_old(object): ''' Lowest Common Ancestor (LCA) in a Binary Tree (BT) : Takes additional space, not space optimized. ''' def findPath(self, root, path, k): ''' A Helper function to ma...
# -*- coding: utf-8 -*- from ..Qt import QtCore, QtGui __all__ = ['FeedbackButton'] class FeedbackButton(QtGui.QPushButton): """ QPushButton which flashes success/failure indication for slow or asynchronous procedures. """ ### For thread-safetyness sigCallSuccess = QtCore.Signal(object, ...
#!/usr/bin/env python import os import re import copy import time import subprocess import shutil import datetime # not used but "sub-"imported by livestatus test.. (to be corrected..) import sys # not here used but "sub-"imported by livestatus test.. (to be corrected..) # from shinken.modulesctx import modulesctx fr...
# Copyright (c) 2010 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2010, Eucalyptus Systems, Inc. # 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 restrict...
# (c) 2015, Ensighten <[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. # # Ansibl...
#!/usr/bin/env python3 from contextlib import closing import argparse import multiprocessing import os import os.path import re import socket import subprocess import sys import traceback import urllib.parse import urllib3 import bs4 import dulwich.index import dulwich.objects import dulwich.pack import requests impor...
# Volatility # # Authors: # Michael Hale Ligh <[EMAIL]> # # This file is part of Volatility. # # Volatility 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...
# # Copyright 2017 Red Hat | Ansible # # 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. # # ...
"""A more or less complete user-defined wrapper around dictionary objects.""" class UserDict: def __init__(self, dict=None, **kwargs): self.data = {} if dict is not None: self.update(dict) if len(kwargs): self.update(kwargs) def __repr__(self): return repr(self.d...
#!/usr/local/bin/python # ---------------------------------------------------------------------- # MR-MPI = MapReduce-MPI library # http://www.cs.sandia.gov/~sjplimp/mapreduce.html # Steve Plimpton, [EMAIL], Sandia National Laboratories # # Copyright (2009) Sandia Corporation. Under the terms of Contract # ...
""" Sample script showing the way to perform computations in blaze This should be executable and result in an out of core execution to generate the result of the expression This illustrates the idea of: - Using large in-disk arrays as operands - Building expressions to evaluate in blaze - Evaluate those expr...
# Copyright (c) 2010 Chris Moyer http://coredumped.org/ # # 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, ...
""" Out-of-band default plugin commands available for OOB handler. This module implements commands as defined by the MSDP standard (http://tintin.sourceforge.net/msdp/), but is independent of the actual transfer protocol (webclient, MSDP, GMCP etc). It also implements several OOB commands unique to Evennia (both some ...
""" Python Interchangeable Virtual Instrument Library Copyright (c) 2012-2014 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...
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst from __future__ import (absolute_import, division, print_function, unicode_literals) import sys import base64 import os import re import zlib import itertools import hashlib import datetime import collectio...
# coding: utf-8 # # Copyright 2010-2014 Ning, Inc. # Copyright 2014-2020 Groupon, Inc # Copyright 2020-2021 Equinix, Inc # Copyright 2014-2021 The Billing Project, LLC # # The Billing Project, LLC licenses this file to you under the Apache License, version 2.0 # (the "License"); you may not use this file except in com...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013-today OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms o...
#!/usr/bin/env python """ @package mi.dataset.driver.wc_sbe.cspp @file mi/dataset/driver/wc_sbe/cspp/wc_sbe_cspp_recovered_driver.py @author Jeff Roy @brief Driver for the wc_sbe_cspp instrument Release notes: Initial Release """ from mi.dataset.dataset_parser import DataSetDriverConfigKeys from mi.dataset.dataset_...
"""Word completion for GNU readline 2.0. This requires the latest extension to the readline module. The completer completes keywords, built-ins and globals in a selectable namespace (which defaults to __main__); when completing NAME.NAME..., it evaluates (!) the expression up to the last dot and completes its att...
import PIL.Image import math class MapHelper(object): @staticmethod def new_image(width, height, alpha=False): """ Generates a new image using PIL.Image module returns PIL.IMAGE OBJECT """ if alpha is True: return PIL.Image.new('RGBA', (width, height), (0,...
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function, unicode_literals import re from stgit.compat import text from stgit.config import config from .base import Immutable from .person import Person class GitObject(Immutable): """Base class for all git objects. One git object...
import dis import re import sys from io import StringIO import unittest from math import copysign from test.bytecode_helper import BytecodeTestCase class TestTranforms(BytecodeTestCase): def test_unot(self): # UNARY_NOT POP_JUMP_IF_FALSE --> POP_JUMP_IF_TRUE' def unot(x): if not x =...
"""Utilities for writing code that runs on Python 2 and 3""" # Copyright (c) 2010-2015 Benjamin Peterson # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including with...
# Copyright 2017 The Sonnet 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 l...
from xml.dom.minidom import parseString from django.core import mail from django.template import Context, Template from django.http import HttpResponse, HttpResponseRedirect, HttpResponseNotFound from django.contrib.auth.decorators import login_required, permission_required from django.forms.forms import Form from dja...
""" Runs through a reST file looking for old-style literals, and helps replace them with new-style references. """ import re import sys import shelve refre = re.compile(r'``([^`\s]+?)``') ROLES = ( 'attr', 'class', "djadmin", 'data', 'exc', 'file', 'func', 'lookup', 'meth', 'm...
#!/usr/bin/env python # -*- encoding: utf-8 -*- # vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8: # Author: Binux<[EMAIL]> # http://binux.me # Created on 2014-11-05 10:42:24 import time import mysql.connector class MySQLMixin(object): @property def dbcur(self): try: if self.conn.u...
""" Tests of the LMS XBlock Runtime and associated utilities """ from django.contrib.auth.models import User from django.conf import settings from ddt import ddt, data from mock import Mock from unittest import TestCase from urlparse import urlparse from opaque_keys.edx.locations import SlashSeparatedCourseKey from lm...
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2016-2017, Yanis Guenane <[EMAIL]> # (c) 2017, Markus Teufelberger <[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_META...
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------- # Copyright (c) 2009 Jendrik Seipp # # RedNotebook 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 ver...
#-*- coding: utf-8 -*- from django import forms from django import template from django.core.exceptions import ValidationError from django.contrib.admin import helpers from django.contrib.admin.util import quote, unquote, capfirst from django.contrib import messages from django.template.defaultfilters import urlencode ...
import warnings from scrapy.exceptions import ScrapyDeprecationWarning DEPRECATED_SETTINGS = [ ('TRACK_REFS', 'no longer needed (trackref is always enabled)'), ('RESPONSE_CLASSES', 'no longer supported'), ('DEFAULT_RESPONSE_ENCODING', 'no longer supported'), ('BOT_VERSION', 'no longer used (user agent ...
# -*- 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...
# vim: set encoding=utf-8 # Copyright (c) 2016 Intel Corporation  # # 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...
from django.contrib.auth.models import User from django.contrib.comments.forms import CommentForm from django.contrib.comments.models import Comment from django.contrib.contenttypes.models import ContentType from django.contrib.sites.models import Site from django.test import TestCase from regressiontests.comment_tests...
# -*- coding: utf-8 -*- """ werkzeug.testsuite.datastructures ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Tests the functionality of the provided Werkzeug datastructures. TODO: - FileMultiDict - Immutable types undertested - Split up dict tests :copyright: (c) 2014 by Armin Ronacher....
#!/usr/bin/python # Copyright (c) 2018 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', 'status': ['preview...
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (c) 2017 F5 Networks Inc. # GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( clean_html, int_or_none, parse_duration, parse_iso8601, parse_resolution, url_or_none, ) class CCMAIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?ccma\.cat/(?:[...
# # 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 # ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2009-2014: # Gabes Jean, [EMAIL] # Gerhard Lausser, [EMAIL] # Gregory Starck, [EMAIL] # Hartmut Goebel, [EMAIL] # # This file is part of Shinken. # # Shinken is free software: you can redistribute it and/or modify # it under the terms of the GNU...
# Toshiba MeP-c4 - miasm architecture definition # Guillaume Valadon <[EMAIL]> from builtins import range from miasm.core.cpu import * from miasm.core.utils import Disasm_Exception from miasm.expression.expression import ExprId, ExprInt, ExprLoc, \ ExprMem, ExprOp, is_expr from miasm.core.asm_ast import AstId, Ast...
# -*- coding: utf-8 -*- from django.db import models from django.utils.translation import ugettext_lazy as _ from django.template.loader import render_to_string from django.core.paginator import Paginator from actstream.models import Action, target_stream, user_stream from cyclope.core import frontend import cyclope....
# Collect facts related to selinux # # 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. # # Ans...
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Joseph Callen <jcallen () csc.com> # # 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 Li...
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. import argparse import array import re import socket import struct import subprocess import sys import mozinfo import m...
""" Video Outlines We only provide the listing view for a video outline, and video outlines are only displayed at the course level. This is because it makes it a lot easier to optimize and reason about, and it avoids having to tackle the bigger problem of general XBlock representation in this rather specialized format...
def test(): def gen(n): for x in xrange(n): yield str(x) def f_1(xs): """ :type xs: list of int """ return xs def f_2(xs): """ :type xs: collections.Sequence of int """ return xs def f_3(xs): """ :type xs...
#!/usr/bin/env python # coding:utf-8 # 并发进程的类 by xzr import multiprocessing import time import subprocess import os import sys import traceback import threading #import Queue def get_now(): tf = '%Y-%m-%d %H:%M:%S' return time.strftime(tf, time.localtime()) _Cpus = multiprocessing.cpu_count() class xBF: ...
# Copyright 2012, 2013 Canonical Ltd. This software is licensed under the # GNU Affero General Public License version 3 (see the file LICENSE). """Test maasserver messages.""" from __future__ import ( absolute_import, print_function, unicode_literals, ) str = None __metaclass__ = type __all__ = [] ...
# # Author: Pearu Peterson, March 2002 # # w/ additions by Travis Oliphant, March 2002 # and Jake Vanderplas, August 2012 from __future__ import division, print_function, absolute_import __all__ = ['solve', 'solve_triangular', 'solveh_banded', 'solve_banded', 'solve_toeplitz', 'solve_circulant...
#!/usr/bin/python DOCUMENTATION = """ module: ec2_scaling_policy short_description: Create or delete AWS scaling policies for Autoscaling groups description: - Can create or delete scaling policies for autoscaling groups - Referenced autoscaling groups must already exist version_added: "1.6" author: "Zacharie Eaki...
#!/usr/bin/python # Author: Jon Trulson <[EMAIL]> # Copyright (c) 2016 Intel Corporation. # # 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...
# Copyright: Damien Elmes <[EMAIL]> # -*- coding: utf-8 -*- # License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html import sys, os, traceback from cStringIO import StringIO from aqt.qt import * from aqt.utils import showInfo, openFolder, isWin, openLink, \ askUser from zipfile import ZipFile...
# 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...
""" Tests for the LTI provider views """ from unittest.mock import MagicMock, patch from django.test import TestCase from django.test.client import RequestFactory from django.urls import reverse from opaque_keys.edx.locator import BlockUsageLocator, CourseLocator from common.djangoapps.student.tests.factories impor...
# -*- coding: utf-8 -*- ############################################################################## # # wms module for OpenERP, This module allows to manage crossdocking in warehouses # Copyright (C) 2011 SYLEAM Info Services (<http://www.Syleam.fr/>) # Sylvain Garancher <[EMAIL]> # Elico Corp ...
# -*- coding : utf8 -*- """ .. module:: 3seg :synopsis: Equations and solutions for the three-segment model .. moduleauthor:: Moritz Maus <[EMAIL]> """ # format: l1, l2, l3, c1, c2] from pylab import (array, arccos, linspace, vstack, figure, clf, plot, xlabel, ylabel, show, savefig, sqrt, xlim, ylim, ax...
# Copyright (c) 2012 NTT DOCOMO, 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 requ...
''' Widget animation ================ This example demonstrates creating and applying a multi-part animation to a button widget. You should see a button labelled 'plop' that will move with an animation when clicked. ''' import kivy kivy.require('1.0.7') from kivy.animation import Animation from kivy.app import App f...
import glob from optparse import make_option import os from django.core.management.base import CommandError from django.core.management.templates import TemplateCommand from django.utils.importlib import import_module import horizon class Command(TemplateCommand): template = os.path.join(horizon.__path__[0], "c...
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe, json from frappe.widgets.form.load import run_onload @frappe.whitelist() def savedocs(): """save / submit / update doclist""" try: doc = frappe.get_doc(json...
# -*- coding: utf-8 -*- # Tests for the contrib/localflavor/ RO form fields. tests = r""" >>> from django.contrib.localflavor.ro.forms import * ##ROCIFField ################################################################ f = ROCIFField() f.clean('21694681') u'21694681' f.clean('RO21694681') u'21694681' f.clean('216...
# -*- coding: utf-8 -*- """ ================================== Color Quantization using K-Means ================================== Performs a pixel-wise Vector Quantization (VQ) of an image of the summer palace (China), reducing the number of colors required to show the image from 96,615 unique colors to 64, while pre...
from django.db import models from django.contrib.sites.models import Site from django.utils.translation import ugettext_lazy as _ class FlatPage(models.Model): url = models.CharField(_('URL'), max_length=100, db_index=True) title = models.CharField(_('title'), max_length=200) content = models.TextField(_(...
#!/usr/bin/env python import shogun as sg traindna = '../data/fm_train_dna.dat' testdna = '../data/fm_test_dna.dat' parameter_list = [[traindna,testdna,3,0,False],[traindna,testdna,4,0,False]] def distance_manhattenword (train_fname=traindna,test_fname=testdna,order=3,gap=0,reverse=False): charfeat=sg.create_string...
""" Helpers for configuring locale settings. Name `localization` is chosen to avoid overlap with builtin `locale` module. """ from contextlib import contextmanager import locale import re import subprocess from pandas._config.config import options @contextmanager def set_locale(new_locale, lc_var=locale.LC_ALL): ...
""" Tests sklearn matrix decomposition converters """ import unittest import warnings import sys from distutils.version import LooseVersion import numpy as np import torch import sklearn from sklearn.decomposition import FastICA, KernelPCA, PCA, TruncatedSVD from sklearn.model_selection import train_test_split from sk...
#!/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...
# This file is part of sydpy. # # Copyright (C) 2014-2015 Bogdan Vukobratovic # # sydpy is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as # published by the Free Software Foundation, either version 2.1 # of the License, or (at your option)...
# Copyright 2020 kubeflow.org. # # 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,...
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2014, 2015 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, or (at your option) any...
# -*- coding: iso-8859-1 -*- from enigma import eConsoleAppContainer from Components.Console import Console from Components.About import about from Components.PackageInfo import PackageInfoHandler from Components.Language import language from Components.Sources.List import List from Components.Ipkg import IpkgComponent...
#!/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...
# Don't import __future__ packages here; they make setup fail # First, we try to use setuptools. If it's not available locally, # we fall back on ez_setup. try: from setuptools import setup except ImportError: from ez_setup import use_setuptools use_setuptools() from setuptools import setup with open(...
from matplotlib.pyplot import * from math import sqrt m = 1/3. xs = [+1, +1, -1, -1] ys = [-1, +1, -1, +1] figure(figsize=(4, 4)) ax = gca() ax.spines['right'].set_visible(False) ax.spines['top'].set_visible(False) ax.spines['left'].set_position(('data', 0)) ax.spines['bottom'].set_position(('data', 0)) ax.xaxis.set_t...
#!/usr/bin/env python # Copyright (c) 2011 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. """SiteCompare component to handle bulk scrapes. Invokes a list of browsers and sends them to a list of URLs, saving the rendered ...
"""Tests for google3.cloud.bigscience.apitools.base.py.batch.""" import textwrap import mock from six.moves import http_client from six.moves.urllib import parse import unittest2 from apitools.base.py import batch from apitools.base.py import exceptions from apitools.base.py import http_wrapper class FakeCredentia...
#!/usr/bin/env python3 import os import sys import tempfile import sh REPO_PATH = {'extras': '/srv/ansible/stable-2.2/lib/ansible/modules/extras', 'core': '/srv/ansible/stable-2.2/lib/ansible/modules/core'} if __name__ == '__main__': commit_hash = sys.argv[1] which_modules = sys.argv[2] git = sh...
#!/usr/bin/env python # Copyright 2015 The Kubernetes 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 appli...
# -*- coding: utf-8 -*- """ werkzeug.contrib.wrappers ~~~~~~~~~~~~~~~~~~~~~~~~~ Extra wrappers or mixins contributed by the community. These wrappers can be mixed in into request objects to add extra functionality. Example:: from werkzeug.wrappers import Request as RequestBase fr...
# vim: set encoding=utf-8 # Copyright (c) 2016 Intel Corporation  # # 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...
from {{cookiecutter.project_slug}}.data.cms_page import CmsPage from {{cookiecutter.project_slug}}.data.dbsession import DbSessionFactory class CmsService: @classmethod def get_page_by_url(cls, url): if not url: return None url = url.lower().strip() session = DbSessionFact...
from __future__ import print_function, division from sympy.core import S, pi, Rational from sympy.functions import assoc_laguerre, sqrt, exp, factorial, factorial2 def R_nl(n, l, nu, r): """ Returns the radial wavefunction R_{nl} for a 3d isotropic harmonic oscillator. ``n`` the "nodal" quan...
#!/usr/bin/env python3 # Copyright © 2012-13 Qtrac Ltd. All rights reserved. # This program or module 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 ...