text
stringlengths
475
200k
import hashlib from storage import Storage from .methods import to_utf8 class SearchHistory(Storage): def __init__(self, filename, max_items=10): Storage.__init__(self, filename, max_item_count=max_items) pass def is_empty(self): return self._is_empty() def list(self): r...
# -*- coding: utf-8 -*- # Generated by Django 1.9 on 2018-08-17 03:20 from __future__ import unicode_literals import datetime from django.conf import settings from django.db import migrations, models import django.db.models.deletion from django.utils.timezone import utc class Migration(migrations.Migration): in...
import numpy as np from numba import cuda, float32, void from numba.cuda.testing import unittest, CUDATestCase def generate_input(n): A = np.array(np.arange(n * n).reshape(n, n), dtype=np.float32) B = np.array(np.arange(n) + 0, dtype=A.dtype) return A, B class TestCudaNonDet(CUDATestCase): def test_...
# Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
"""Add a setuptools command that runs a helper-based application.""" try: from setuptools import Command except ImportError: from distutils.core import Command try: from functools import reduce except ImportError: pass # use the builtin for py 2.x from . import parser from . import platform class R...
# -*- coding: utf-8 -*- """ flask.config ~~~~~~~~~~~~ Implements the configuration related objects. :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import imp import os import errno from werkzeug.utils import import_string from ._compat import string_type...
# -*- coding: utf-8 -*- ''' Management of keyboard layouts ============================== The keyboard layout can be managed for the system: .. code-block:: yaml us: keyboard.system Or it can be managed for XOrg: .. code-block:: yaml us: keyboard.xorg ''' def __virtual__(): ''' Only ...
# Generated from 'CarbonEvents.h' def FOUR_CHAR_CODE(x): return x def FOUR_CHAR_CODE(x): return x false = 0 true = 1 keyAEEventClass = FOUR_CHAR_CODE('evcl') keyAEEventID = FOUR_CHAR_CODE('evti') eventAlreadyPostedErr = -9860 eventTargetBusyErr = -9861 eventClassInvalidErr = -9862 eventClassIncorrectErr = -9864 eventH...
""" Python tests for the Survey models """ from collections import OrderedDict from django.contrib.auth.models import User from django.test.client import Client from survey.models import SurveyForm from survey.utils import is_survey_required_for_course, is_survey_required_and_unanswered from xmodule.modulestore.test...
from __future__ import absolute_import from django.core.management.base import BaseCommand from django.utils.timezone import now from django.contrib.sites.models import Site from zerver.models import Message, UserProfile, Stream, Recipient, Client, \ Subscription, Huddle, get_huddle, Realm, UserMessage, \ get...
import json from django.conf import settings from django.contrib.auth.decorators import login_required from django.http import HttpResponse, HttpResponseRedirect from django.shortcuts import render_to_response from django.core.serializers.json import DjangoJSONEncoder from django.test.client import CONTENT_TYPE_RE fro...
import sys import unittest import pywintypes import time from pywin32_testutil import str2bytes, ob2memory import datetime import operator class TestCase(unittest.TestCase): def testPyTimeFormat(self): struct_current = time.localtime() pytime_current = pywintypes.Time(struct_current) # try ...
# 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 ...
import chainer from chainer.backends import cuda from chainer import distribution from chainer.functions.array import broadcast from chainer.functions.array import where from chainer.functions.math import digamma from chainer.functions.math import exponential from chainer.functions.math import lgamma class Gamma(dist...
#! /usr/bin/env python """Mirror a remote ftp subtree into a local directory tree. usage: ftpmirror [-v] [-q] [-i] [-m] [-n] [-r] [-s pat] [-l username [-p passwd [-a account]]] hostname[:port] [remotedir [localdir]] -v: verbose -q: quiet -i: interactive mode -m: macintosh ...
# -*- coding: utf-8 -*- # Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. import pytest pytest_plugins = [ "jupyter_server.pytest_plugin", "jupyterlab_server.pytest_plugin", "jupyterlab.pytest_plugin" ] def pytest_addoption(parser): """ Adds f...
#!/usr/bin/env python # # Copyright 2007 The Closure Linter 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 #...
import unittest from tempfile import mkdtemp from os.path import join from shutil import rmtree from json import dumps, loads import copy from .settings import SPEC_DATA_DIR from slyd.gitstorage.repoman import Repoman def j(json): return dumps(json, sort_keys=True, indent=4) class RepomanTest(unittest.TestCas...
import json import requests def get_token(): client_id = "..." client_secret = "..." auth = requests.auth.HTTPBasicAuth(client_id, client_secret) resp = requests.post('https://stepik.org/oauth2/token/', data={'grant_type': 'client_credentials'}, ...
from __future__ import unicode_literals import logging import sys import types import warnings from django import http from django.conf import settings from django.core import signals, urlresolvers from django.core.exceptions import ( MiddlewareNotUsed, PermissionDenied, SuspiciousOperation, ) from django.db impo...
import kurve import area from nc.nc import * import math # roughing_funcs.py- intended to be used for lathe roughing # adapted from area_funcs.py and turning.py # and possibly roughing a profile-approaching the part from the side # some globals, to save passing variables as parameters too much area_for_feed_po...
""" Python Interchangeable Virtual Instrument Library Copyright (c) 2012-2017 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 json from django.db.models import Count from django.http import HttpResponse from django.views.generic import TemplateView from candidates.models import Ballot from elections.mixins import ElectionMixin from elections.models import Election from parties.models import Party from popolo.models import Membership ...
# This file is part of the MapProxy project. # Copyright (C) 2011 Omniscale <http://omniscale.de> # # 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...
# -*- coding: utf-8 -*- # Generated by Django 1.9.5 on 2016-04-07 22:03 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion import jsonfield.fields class Migration(migrations.Migration): dependencies = [ ('cms', '0013_urlconfrevision'), ...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
# Copyright 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...
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
# (c) 2016 Matt Clay <[EMAIL]> # (c) 2017 Ansible Project # 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 DOCUMENTATION = """ author: Matt Clay <[EMAIL]> connection: lxd sho...
# Copyright 2009-2014 Justin Riley # # This file is part of StarCluster. # # StarCluster 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 3 of the License, or (at your option) any # later ...
#!/usr/bin/env python # Copyright (c) 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. """Launches Android Virtual Devices with a set configuration for testing Chrome. The script will launch a specified number of Andr...
#!/usr/bin/env python3.5 ''' Automate the Boring Stuff with Python generic testing for chapter 4 projects Jack Hayhurst ''' from io import StringIO import unittest from unittest.mock import patch import picture_grid class TestPictureGrid(unittest.TestCase): '''tests the picture_grid.py script''' def test_pi...
import simplejson import openerp import openerp.addons.web.http as http from openerp.addons.web.http import request import openerp.addons.web.controllers.main as webmain import json class meeting_invitation(http.Controller): @http.route('/calendar/meeting/accept', type='http', auth="calendar") def accept(sel...
"""SCons.Tool.gcc Tool-specific initialization for MinGW (http://www.mingw.org/) 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. See also http://www.scons.org/wiki/CrossCompilingMingw """ # # Copyright (c) 2001,...
# Copyright 2012 Red Hat, Inc. # Copyright 2012-2013 Hewlett-Packard Development Company, L.P. # # 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/licen...
from Tkinter import * class WidgetRedirector: """Support for redirecting arbitrary widget subcommands. Some Tk operations don't normally pass through Tkinter. For example, if a character is inserted into a Text widget by pressing a key, a default Tk binding to the widget's 'insert' operation is acti...
""" Various useful constants and conversion formulae Modules ------- .. autosummary:: :toctree: generated/ codata - CODATA Recommended Values of Fundamental Physical Const (2006) constants - Collection of physical constants and conversion factors Functions --------- .. autosummary:: :toctree: generated...
# This file is part of Indico. # Copyright (C) 2002 - 2021 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. from datetime import date, datetime, time from dateutil.relativedelta import relativedelta from flask imp...
"""Support for Radarr.""" from datetime import datetime, timedelta import logging import time from pytz import timezone import requests import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA from homeassistant.const import ( CONF_API_KEY, CONF_HOST, CONF_MONITORED_CONDITIONS,...
""" Command based UI for the obfuscator. """ # OAT - Obfuscation and Analysis Tool # Copyright (C) 2011 Andy Gurden # # This file is part of OAT. # # OAT 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 Softwar...
# 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-2.0 # # Unless required by applicable law ...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
"""HTML character entity references.""" # maps the HTML entity name to the Unicode codepoint name2codepoint = { 'AElig': 0x00c6, # latin capital letter AE = latin capital ligature AE, U+00C6 ISOlat1 'Aacute': 0x00c1, # latin capital letter A with acute, U+00C1 ISOlat1 'Acirc': 0x00c2, # latin...
import unittest from django.utils import text class TestUtilsText(unittest.TestCase): def test_truncate_words(self): self.assertEqual(u'The quick brown fox jumped over the lazy dog.', text.truncate_words(u'The quick brown fox jumped over the lazy dog.', 10)) self.assertEqual(u'The qui...
"""TypeinViewer class. The TypeinViewer is what you see at the lower right of the main Pynche widget. It contains three text entry fields, one each for red, green, blue. Input into these windows is highly constrained; it only allows you to enter values that are legal for a color axis. This usually means 0-255 for de...
#!/usr/bin/python # # (c) 2016, Aleksei Kostiuk <[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...
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models from actstream.compat import user_model_label class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'Follow' db.create_table('actstream_follow', ( ...
# -*- coding: utf-8 -*- # Copyright (C) 2014 Johannes Baiter <[EMAIL]> # # 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 # License, or (at your option) any later ...
# Copyright (c) 2006-2010 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2010, Eucalyptus Systems, Inc. # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # w...
from django.http import HttpResponse, HttpResponseRedirect, HttpResponseNotFound from hikes.models import Hike from django.shortcuts import render_to_response, render from django.contrib.gis import forms from django.contrib import auth from django.contrib.auth.forms import UserCreationForm from django.core.urlresolvers...
# -*- coding: utf-8 -*- # Copyright © 2006-2009 Steven J. Bethard <[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 req...
# -*- coding: utf-8 -*- from nose.tools import * # PEP8 asserts from modularodm.exceptions import ValidationError from tests.base import OsfTestCase from website.addons.forward.tests.factories import ForwardSettingsFactory class TestSettingsValidation(OsfTestCase): def setUp(self): super(TestSettings...
# # formatter.py # # Convert parsed content blocks to a structured document (library file). # # Copyright 2002, 2004, 2007, 2008, 2014 by # David Turner. # # This file is part of the FreeType project, and may only be used, # modified, and distributed under the terms of the FreeType project # license, LICENSE.T...
# # Typofinder for domain typo discovery # # Released as open source by NCC Group Plc - http://www.nccgroup.com/ # # Simple whois query function # # Based on RFC3912 # # Developed by Matt Summers, matt dot summers at nccgroup dot com # and Stephen Tomkinson # # http://www.github.com/nccgroup/typofinder # #...
from __future__ import division import ldscore.sumstats as s import ldscore.parse as ps import unittest import numpy as np import pandas as pd from pandas.util.testing import assert_series_equal, assert_frame_equal from nose.tools import * from numpy.testing import assert_array_equal, assert_array_almost_equal, assert_...
from gen import * ########## # shared # ########## flow_var[0] = """ (declare-fun tau () Real) """ flow_dec[0] = """ (define-ode flow_1 ((= d/dt[tau] 1))) """ state_dec[0] = """ (declare-fun time_{0} () Real) (declare-fun tau_{0}_0 () Real) (declare-fun tau_{0}_t () Real) """ state_val[0] = """ (assert (<= 0 ...
# Copyright 2008-2015 Nokia Solutions and Networks # # 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...
#===- cindex.py - Python Indexing Library Bindings -----------*- python -*--===# # # The LLVM Compiler Infrastructure # # This file is distributed under the University of Illinois Open Source # License. See LICENSE.TXT for details. # #===--------------------------------------------------------------...
# (c) 2012, 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. # # A...
import uuid from django.contrib.contenttypes.fields import ( GenericForeignKey, GenericRelation, ) from django.contrib.contenttypes.models import ContentType from django.db import models from django.utils.encoding import python_2_unicode_compatible # Basic tests @python_2_unicode_compatible class Author(models....
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
""" GBDX Catalog Search Helper Functions. This set of functions is used for breaking up a large AOI into smaller AOIs to search, because the catalog API can only handle 2 square degrees at a time. """ from builtins import zip from builtins import range from pygeoif import geometry import json def point_in_poly(x,y...
# -*- encoding: utf-8 -*- import unittest2 from openerp.tests.common import TransactionCase from .. import models ID_FIELD = { 'id': 'id', 'name': 'id', 'string': "External ID", 'required': False, 'fields': [], } def make_field(name='value', string='unknown', required=False, fields=[]): retur...
from copy import deepcopy import numpy as np from vectortween.Animation import Animation from vectortween.Mapping import Mapping from vectortween.Tween import Tween def normalize(x): return x / sum(x) class SequentialAnimation(Animation): def __init__(self, list_of_animations=None, timeweight=None, repeat...
#! /usr/bin/python # -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Name: ise.py # Purpose: # Author: Gwenhael Goavec-Merou <[EMAIL]> # Created: 21/07/2015 # ----------------------------------------------------------------------------- # Copyright (2008) ...
# -*- encoding: utf-8 -*- # vim: ts=4 sw=4 expandtab ai # # This file is part of Pylyglot. # # Pylyglot 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) an...
#!/usr/bin/env python import re, string, sys with open("../stop_words.txt") as f: stops = set(f.read().split(",")+list(string.ascii_lowercase)) # The "database" data = {} # Internal functions of the "server"-side application def error_state(): return "Something wrong", ["get", "default", None] # The "server"...
# Copyright 2014 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 required by applicable law or a...
# -*- coding: utf-8 -*- """ flask.testsuite.reqctx ~~~~~~~~~~~~~~~~~~~~~~ Tests the request context. :copyright: (c) 2012 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import flask import unittest try: from greenlet import greenlet except ImportError: greenlet = None...
""" This is the "basic" text-mode user interface class. """ ############################################################################# LICENSE = """\ This file is part of pagekite.py. Copyright 2010-2013, the Beanstalks Project ehf. and Bjarni Runar Einarsson This program is free software: you can redistribute it a...
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2015, Peter Sprygada <[EMAIL]> # Copyright: (c) 2017, Dell 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_METADA...
# 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 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...
#!/usr/bin/env python # # Copyright 2009 The Closure Library 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 ...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django import VERSION as DJANGO_VERSION def get_operations(): """ This will break things if you upgrade Django to 1.8 having already applied this migration in 1.7. Since this is for a demo site i...
import copy import json import os import pickle import unittest import uuid from django.core.exceptions import DisallowedRedirect, SuspiciousOperation from django.core.serializers.json import DjangoJSONEncoder from django.core.signals import request_finished from django.db import close_old_connections from django.http...
import tensorflow as tf from tensorflow.python.framework import ops import roi_pooling_op import pdb @tf.RegisterShape("RoiPool") def _roi_pool_shape(op): """Shape function for the RoiPool op. """ dims_data = op.inputs[0].get_shape().as_list() channels = dims_data[3] dims_rois = op.inputs[1].get_shape().as...
# -*- coding: utf-8 -* import getopt import os import sys from east import applications from east import consts from east import formatting from east.synonyms import synonyms from east import relevance from east import utils def main(): args = sys.argv[1:] opts, args = getopt.getopt(args, "s:a:w:v:l:f:c:r:p...
import os import sys import click import pathlib import logging from subprocess import Popen, PIPE, STDOUT, CalledProcessError from utils.cert import openssl_installed from utils.misc import get_realpath gen_tls_script = pathlib.Path(__file__).parent.parent.joinpath('scripts/gencert.sh').absolute() @click.command() ...
"""Test Mikrotik setup process.""" from unittest.mock import AsyncMock, Mock, patch from homeassistant.components import mikrotik from homeassistant.setup import async_setup_component from . import MOCK_DATA from tests.common import MockConfigEntry async def test_setup_with_no_config(hass): """Test that we do ...
#!/usr/bin/env python # -*- coding: utf-8 -*- from future.standard_library import install_aliases install_aliases() import os import re from operator import attrgetter from urllib.request import urlretrieve from io import open from PIL import Image from jinja2 import Environment, FileSystemLoader, StrictUndefined f...
# -*- coding: utf-8 -*- # Copyright 2011-2012 Antoine Bertin <[EMAIL]> # # This file is part of subliminal. # # subliminal 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 3 of the License...
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # # Copyright (c) 2014 Noviat nv/sa (www.noviat.com). All rights reserved. # # This program is free software: you can redistribute it and/or modify # it under...
import logging import re import sys logging.basicConfig(format='%(asctime)s %(name)s: %(message)s', level=logging.INFO) logger = logging.getLogger('check-whitespace') CR_RE = re.compile(r'\r') LEADING_WHITESPACE_RE = re.compile(r'\s+') TRAILING_WHITESPACE_RE = re.compile(r'\s+\n\Z') NO_NEWLINE_RE...
#!/usr/bin/env python # encoding:utf-8 import os import sys import requests import MySQLdb from bs4 import BeautifulSoup from bs4 import SoupStrainer from config import * base_url = 'http://download.kaoyan.com' status = [] def get_soup(url, parse_only=None): content = requests.get(url).content return Beau...
# -*- coding: utf-8 -*- """ ################################################################################ # Copyright (c) 2010, Ilgar Mashayev # # E-mail: [EMAIL] # Website: http://github.com/ilgarm/pyzimbra ################################################################################ # This file is part of pyzi...
#! /usr/bin/env python ## ## standard configuration of the FEC HLVDS for the use ## with the pALPIDE with the Padua Proximity board V1 ## import sys import os import SlowControl # slow control code import biasDAC # special code to setup up the voltage biases m = SlowControl.SlowControl(0) # HLVDS FEC (master) # w...
import sys import os import marshal import imp import struct import time import unittest from test import test_support from test.test_importhooks import ImportHooksBaseTestCase, test_src, test_co # some tests can be ran even without zlib try: import zlib except ImportError: zlib = None from zipfile import Zi...
import pickle import math import random def arrow(n): return str(n)+"--> " def isPositive(aNumber): return aNumber > 0 def abs(aNumber): if aNumber >= 0: return aNumber return -aNumber def main2(): """ test two build in high order functions: map and filter functions""" ...
from __future__ import unicode_literals import re from .common import InfoExtractor class IGNIE(InfoExtractor): """ Extractor for some of the IGN sites, like www.ign.com, es.ign.com de.ign.com. Some videos of it.ign.com are also supported """ _VALID_URL = r'https?://.+?\.ign\.com/(?P<type>video...
# -*- coding: utf-8 -*- import base64 from openerp import SUPERUSER_ID from openerp import http from openerp.tools.translate import _ from openerp.http import request from openerp.addons.website.models.website import slug class website_hr_recruitment(http.Controller): @http.route([ '/jobs', '/job...
# pylint: disable-msg=W0611, W0612, W0511,R0201 """Tests suite for maskedArray statistics. :author: Pierre Gerard-Marchant :contact: pierregm_at_uga_dot_edu """ from __future__ import division, print_function, absolute_import __author__ = "Pierre GF Gerard-Marchant ($Author: backtopop $)" import numpy as np import ...
#!/usr/bin/python # Copyright (c) 2012 The Native Client 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 optparse import os.path import shutil import subprocess import stat import sys import time import traceback ARCH_MAP = { ...
""" Objects for dealing with Legendre series. This module provides a number of objects (mostly functions) useful for dealing with Legendre series, including a `Legendre` class that encapsulates the usual arithmetic operations. (General information on how this module represents and works with such polynomials is in th...
# 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...
# Authors: Lukas Breuer <[EMAIL]> # Juergen Dammers <[EMAIL]> # Denis A. Engeman <[EMAIL]> # # License: BSD (3-clause) import math import logging import numpy as np logger = logging.getLogger('mne') # one selection here used across mne-python logger.propagate = False # don't propagate (in case of...
# -*- coding: utf-8 -*- from __future__ import print_function import os import sys import imp import subprocess ## Python 2.6 subprocess.check_output compatibility. Thanks Greg Hewgill! if 'check_output' not in dir(subprocess): def check_output(cmd_args, *args, **kwargs): proc = subprocess.Popen( ...
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Argument-less script to select what to run on the buildbots.""" import filecmp import os import shutil import subprocess import sys i...
# -*- coding: utf-8 -*- # Dioptas - GUI program for fast processing of 2D X-ray diffraction data # Principal author: Clemens Prescher ([EMAIL]) # Copyright (C) 2014-2019 GSECARS, University of Chicago, USA # Copyright (C) 2015-2018 Institute for Geology and Mineralogy, University of Cologne, Germany # Copyright (C) 201...
#!/usr/bin/env python # # Copyright 2017 Google 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 required by applicable law o...