text
stringlengths
475
200k
# -*- coding: utf-8 -*- """ werkzeug.debug ~~~~~~~~~~~~~~ WSGI application traceback debugger. :copyright: (c) 2011 by the Werkzeug Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ import mimetypes from os.path import join, dirname, basename, isfile from werkzeu...
# Tiles, tiles, tiles! Doors, walls.. If it's not a player but it's # on the map, it goes here. # Our imports from constants import Constants class Tile(object): """Represents a tile in vision. Once seen, a tile will show what is currently on it via the game draw method. Once a tile goes out of view, ever...
# -*- 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...
#!/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...
"""MongoDB event tracker backend.""" from __future__ import absolute_import import logging import pymongo from pymongo import MongoClient from pymongo.errors import PyMongoError from bson.errors import BSONError from track.backends import BaseBackend log = logging.getLogger(__name__) class MongoBackend(BaseBack...
# Copyright (c) 2018 Zim Kalinowski, <[EMAIL]> # # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) try: from msrestazure.azure_exceptions import CloudError from msrestazure.azure_configuration import AzureConfiguration from msrest.service_client import ServiceClie...
#!/usr/bin/env python import os, sys, subprocess, logging, dxpy, json, re, socket, getpass, urlparse from posixpath import basename, dirname import common EPILOG = '''Notes: Examples: %(prog)s ''' DEFAULT_APPLET_PROJECT = 'E3 ChIP-seq' KEYFILE = os.path.expanduser("~/keypairs.json") def get_args(): import...
# coding=utf-8 # Copyright 2020 The TF-Agents 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable la...
import re import logging from scrapy.spiders import Spider from scrapy.http import Request, XmlResponse from scrapy.utils.sitemap import Sitemap, sitemap_urls_from_robots from scrapy.utils.gz import gunzip, is_gzipped logger = logging.getLogger(__name__) class SitemapSpider(Spider): sitemap_urls = () sitem...
from django.contrib.auth.models import User from webpos.models import Item, Bill, BillItem def commit_bill(output, reqdata, user): billhd = Bill(customer_name=reqdata['customer_name'], server=User.objects.get(pk=user.id).username) billitms = [] reqquants = reqdata['items'] dbitms = I...
# Copyright (c) 2012 OpenStack Foundation # 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 ...
""" Simple utility functions that operate on block metadata. This is a place to put simple functions that operate on block metadata. It allows us to share code between the XModuleMixin and CourseOverview and BlockStructure. """ def url_name_for_block(block): """ Given a block, returns the block's URL name. ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) 2014, Nicolas P. Rougier. All Rights Reserved. # Distributed under the (new) BSD License. # ----------------------------------------------------------------------------- from vi...
#!/usr/bin/env python # Copyright (c) 2012, 2014 Abhay Devasthale # Author(s): # Abhay Devasthale <[EMAIL]> # Adam Dybbroe <[EMAIL]> # Sara Hornquist <[EMAIL]> # Martin Raspaud <[EMAIL]> # Carlos Horn <[EMAIL]> # This program is free software: you can redistribute it and/or modify # it under the terms of ...
# # General-purpose Photovoltaic Device Model - a drift diffusion base/Shockley-Read-Hall # model for 1st, 2nd and 3rd generation solar cells. # Copyright (C) 2012-2017 Roderick C. I. MacKenzie r.c.i.mackenzie at googlemail.com # # https://www.gpvdm.com # Room B86 Coates, University Park, Nottingham, NG7 2RD...
from __future__ import unicode_literals from django.db import models from django.utils.encoding import python_2_unicode_compatible from django.utils.http import urlquote @python_2_unicode_compatible class Author(models.Model): name = models.CharField(max_length=100) def __str__(self): return self.na...
import os import socket import atexit import re from setuptools.extern.six.moves import urllib, http_client, map import pkg_resources from pkg_resources import ResolutionError, ExtractionError try: import ssl except ImportError: ssl = None __all__ = [ 'VerifyingHTTPSHandler', 'find_ca_bundle', 'is_avail...
"""Tests for distutils.dir_util.""" import unittest import os import stat import sys from unittest.mock import patch from distutils import dir_util, errors from distutils.dir_util import (mkpath, remove_tree, create_tree, copy_tree, ensure_relative) from distutils import log from distu...
#!/usr/bin/env python # -*- coding: utf-8 -*- ## # Just enough auxiliary bits to make the translated code work. # # This package provides the support necessary to use the translated # code. The configuration modules used in translation take care of # many semantic differences between Java and Python, while this # pac...
import unittest from test import test_support import os import socket import StringIO import urllib2 from urllib2 import Request, OpenerDirector # XXX # Request # CacheFTPHandler (hard to write) # parse_keqv_list, parse_http_list, HTTPDigestAuthHandler class TrivialTests(unittest.TestCase): def test_trivial(sel...
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Generic USB gadget functionality. """ import struct import usb_constants class Gadget(object): """Basic functionality for a USB device. Implement...
# -*- coding: utf-8 -*- """ This test file will verify proper password policy enforcement, which is an option feature """ import json from django.test import TestCase from django.test.client import RequestFactory from django.core.urlresolvers import reverse from django.contrib.auth.models import AnonymousUser from djan...
# (c) 2016 Red Hat Inc. # # (c) 2017 Dell EMC. # # 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 vers...
# Copyright (c) 2012 Rackspace Hosting # 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 req...
import os import sys import json import re import errno import gitnb.config as con import gitnb.utils as utils from gitnb.constants import * import gitnb.default as default class Py2NB(object): """CONVERT NBPY to Notebook Args: path: <str> path to file """ def __init__(self,path,nb_pat...
# WARNING: This file is extremely specific to how Katharine happens to have her # local machines set up. # In particular, to run without modification, you will need: # - An EC2 keypair in ~/Downloads/katharine-keypair.pem # - A keypair for the ycmd servers in ~/.ssh/id_rsa # - The tintin source tree in ~/projects/tint...
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Listing.shipping' db.add_column('listings', 'shipping', ...
from os.path import join as pjoin def configuration(parent_package='', top_path=None, setup_name='setupscons.py'): from numpy.distutils.misc_util import Configuration from numpy.distutils.misc_util import scons_generate_config_py pkgname = 'scipy' config = Configuration(pkgname, parent_package, top_pa...
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. { 'name': 'Products & Pricelists', 'version': '1.2', 'category': 'Sales Management', 'depends': ['base', 'decimal_precision', 'mail', 'report'], 'demo': [ 'product_demo.xml', 'product...
""" TODO: add table listing each forecast's peak and peak time... """ import datetime import pytz import numpy as np import pandas as pd from pandas.io.sql import read_sql import matplotlib.dates as mdates from pyiem.plot import figure_axes from pyiem.util import get_autoplot_context, get_dbconn from pyiem.exceptions ...
import os from pyxform.errors import PyXFormError from onadata.apps.logger.models import XForm, Instance from test_base import TestBase class TestInputs(TestBase): """ This is where I'll input all files that proved problematic for users when uploading. """ def test_uniqueness_of_group_names_enfo...
import random from canari.maltego.transform import Transform from canari.maltego.entities import URL from canari.framework import EnableDebugWindow from common.entities import NettackerScan from lib.scan.shodan.engine import start from database.db import __logs_by_scan_id as find_log __author__ = 'Shaddy Garg' __cop...
#!/usr/bin/env python """ |jedi| is mostly being tested by what I would call "Blackbox Tests". These tests are just testing the interface and do input/output testing. This makes a lot of sense for |jedi|. Jedi supports so many different code structures, that it is just stupid to write 200'000 unittests in the manner of...
import json import base64 import os from django.core.urlresolvers import reverse from django.test import TestCase, LiveServerTestCase import requests from selenium import webdriver from selenium.webdriver.common.keys import Keys from easter_egg.models import split_image class _HelperTestCase(TestCase): path_to...
import os import subprocess import sys from PyQt5 import QtCore, QtWidgets from ouf.filemodel.proxymodel import FileProxyModel from ouf.view.filenamedelegate import FileNameDelegate from ouf import shortcuts # TODO: modifiers to open in new window # TODO: switch icons / tree # TODO: modify icon size class FileView...
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- # # Copyright (C) 2017 Canonical Ltd # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3 as # published by the Free Software Foundation. # # This program is distributed in the h...
"""Typing helpers for ZHA component.""" from typing import TYPE_CHECKING, Callable, TypeVar import zigpy.device import zigpy.endpoint import zigpy.group import zigpy.zcl import zigpy.zdo # pylint: disable=invalid-name CALLABLE_T = TypeVar("CALLABLE_T", bound=Callable) ChannelType = "ZigbeeChannel" ChannelsType = "Ch...
# Copyright (c) 2003, The Regents of the University of California, # through Lawrence Berkeley National Laboratory (subject to receipt of # any required approvals from the U.S. Dept. of Energy). All rights # reserved. # # Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved. # # This software is ...
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). import sys import threading import time from contextlib import contextmanager from .variables import ENV __all__ = ('TraceLogger',) class Trace(object): __slots__ = ('msg', 'verbosit...
# The contents of this file are subject to the BitTorrent Open Source License # Version 1.1 (the License). You may not copy or use this file, in either # source code or executable form, except in compliance with the License. You # may obtain a copy of the License at http://www.bittorrent.com/license/. # # Software di...
# Copyright (C) 2001-2007, 2009, 2010 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and this permission notice # appear in all copies. # # THE SOFTWARE IS PROVIDED ...
# # core.py # # Copyright (C) 2009 Ian Martin <[EMAIL]> # Copyright (C) 2008 Damien Churchill <[EMAIL]> # Copyright (C) 2008 Martijn Voncken <[EMAIL]> # Copyright (C) Marcos Pinto 2007 <[EMAIL]> # # Deluge is free software. # # You may redistribute it and/or modify it under the terms of the # GNU General Public License...
from ctypes import c_char_p, c_double, c_int, c_void_p, POINTER from django.contrib.gis.gdal.envelope import OGREnvelope from django.contrib.gis.gdal.libgdal import lgdal from django.contrib.gis.gdal.prototypes.errcheck import check_envelope from django.contrib.gis.gdal.prototypes.generation import (const_string_output...
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
""" This module contains query handlers responsible for calculus queries: infinitesimal, bounded, etc. """ from __future__ import print_function, division from sympy.logic.boolalg import conjuncts from sympy.assumptions import Q, ask from sympy.assumptions.handlers import CommonHandler, test_closed_group from sympy.ma...
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
# -*- coding: utf-8 -*- from importlib import reload from io import StringIO import pytest from pyscaffold import termui @pytest.fixture(scope="module") def after(): # Reload termui after tests to ensure constants are calculated # with original logic (without mocks). yield reload(termui) @pytest....
from django.db import models from django.utils.translation import ugettext_lazy as _ from django.core.urlresolvers import reverse from django.contrib import admin class Patient(models.Model): GENDER = ( ('F', 'Female'), ('M', 'Male'), ) MARRIAGE_STATUS = ( ('S', 'Single'), ...
from __future__ import absolute_import from django.utils.translation import ugettext as _ from zerver.lib.actions import check_send_message from zerver.lib.response import json_success, json_error from zerver.decorator import REQ, has_request_variables, api_key_only_webhook_view from zerver.models import UserProfile ...
""" PT-specific Form helpers """ from __future__ import unicode_literals import re from django.core.validators import EMPTY_VALUES from django.forms import ValidationError from django.forms.fields import Field, RegexField from django.utils.encoding import smart_text from django.utils.translation import ugettext_lazy ...
#!/usr/bin/env python #-*- coding:utf-8 -*- """ QCheckBox demo Tested environment: Mac OS X 10.6.8 http://doc.qt.nokia.com/latest/qcheckbox.html http://doc.qt.nokia.com/latest/qabstractbutton.html http://doc.qt.nokia.com/latest/qt.html#CheckState-enum """ import sys try: from PySide import QtCore from Py...
from openerp.osv import osv import time from openerp.report import report_sxw def titlize(journal_name): words = journal_name.split() while words.pop() != 'journal': continue return ' '.join(words) class order(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): super(order, self)...
#!/usr/bin/env python # 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 https://mozilla.org/MPL/2.0/. import os import re import subprocess import sys import BaseHTTPServer import SimpleHTTPServer i...
# Dr. D Studios - Software Disclaimer # # Copyright 2010 Dr D Studios Pty Limited (ACN 127 184 954) (Dr. D Studios), its # affiliates and/or its licensors. # import itch.tank_scratch import nose.plugins class TankScratchNosePlugin(nose.plugins.Plugin): """ Adds Tank scratch setup and teardown capabilit...
# ext/mutable.py # Copyright (C) 2005-2014 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 """Provide support for tracking of in-place changes to scalar values, which are propaga...
"""util.py - General utilities for running, loading, and processing benchmarks """ import json import os import tempfile import subprocess import sys # Input file type enumeration IT_Invalid = 0 IT_JSON = 1 IT_Executable = 2 _num_magic_bytes = 2 if sys.platform.startswith('win') else 4 def is_executable_file...
# Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.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, modi...
#!/usr/bin/env python from selenium import webdriver import os import traceback import time from selenium import webdriver from platform import platform import socket from sys import argv port = 13013 if len(argv) >= 2: port = int(argv[1]) path = os.path dirname = path.abspath(path.dirname(__file__)) chromedriv...
# futex contention # (c) 2010, Arnaldo Carvalho de Melo <[EMAIL]> # Licensed under the terms of the GNU GPL License version 2 # # Translation of: # # http://sourceware.org/systemtap/wiki/WSFutexContention # # to perf python scripting. # # Measures futex contention import os, sys sys.path.append(os.environ['PERF_EXEC_P...
"""Registration facilities for DOM. This module should not be used directly. Instead, the functions getDOMImplementation and registerDOMImplementation should be imported from xml.dom.""" from xml.dom.minicompat import * # isinstance, StringTypes # This is a list of well-known implementations. Well-known names # sho...
#!/usr/bin/python # The contents of this file are in the public domain. See LICENSE_FOR_EXAMPLE_PROGRAMS.txt # # This example program shows how you can use dlib to make an object # detector for things like faces, pedestrians, and any other semi-rigid # object. In particular, we go though the steps to train the kin...
#!/usr/bin/env python import linuxcnc_util import hal import time import sys import os # this is how long we wait for linuxcnc to do our bidding timeout = 5.0 # unbuffer stdout sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0) def wait_for_pin_value(pin_name, value, timeout=5.0): start_time = time.time() ...
# -*- coding:utf-8 -*- # # # Copyright (C) 2013 Michael Telahun Makonnen <[EMAIL]>. # All Rights Reserved. # # 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 ...
# Copyright (c) 2001-2014, Canal TP and/or its affiliates. All rights reserved. # # This file is part of Navitia, # the software to build cool stuff with public transport. # # Hope you'll enjoy and contribute to this project, # powered by Canal TP (www.canaltp.fr). # Help us simplify mobility and open public tr...
""" unixccompiler - can handle very long argument lists for ar. """ from __future__ import division, absolute_import, print_function import os from distutils.errors import DistutilsExecError, CompileError from distutils.unixccompiler import * from numpy.distutils.ccompiler import replace_method from numpy.distutils....
# Author: Travis Oliphant, 2002 # # Further updates and enhancements by many SciPy developers. # from __future__ import division, print_function, absolute_import import math import warnings from collections import namedtuple import numpy as np from numpy import (isscalar, r_, log, around, unique, asarray, ...
from __future__ import absolute_import import sys from django.core.exceptions import PermissionDenied, SuspiciousOperation from django.core.urlresolvers import get_resolver from django.http import HttpResponse, HttpResponseRedirect from django.shortcuts import render_to_response, render from django.template import Co...
# -*- coding: utf-8 -*- # MySQL Connector/Python - MySQL driver written in Python. # Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. # MySQL Connector/Python is licensed under the terms of the GPLv2 # <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most # MySQL Connectors. T...
# -*- coding: UTF-8 -*- __kupfer_name__ = _("VirtualBox") __kupfer_sources__ = ("VBoxMachinesSource", ) __description__ = _("Control VirtualBox Virtual Machines. " "Supports both Sun VirtualBox and Open Source Edition.") __version__ = "0.4" __author__ = "Karol Będkowski <[EMAIL]>" from kupfer.obje...
from django.conf import settings from django.template.base import Lexer, Parser, tag_re, NodeList, VariableNode, TemplateSyntaxError from django.utils.encoding import force_unicode from django.utils.html import escape from django.utils.safestring import SafeData, EscapeData from django.utils.formats import localize cl...
from ctypes import byref, c_int from datetime import date, datetime, time from django.contrib.gis.gdal.base import GDALBase from django.contrib.gis.gdal.error import GDALException from django.contrib.gis.gdal.prototypes import ds as capi from django.utils.encoding import force_text # For more information, see the OG...
import logging from django.core.management.base import BaseCommand from ngw.core import perms from ngw.core.models import GROUP_EVERYBODY, Contact class Command(BaseCommand): help = 'Recover lost contacts' def handle(self, *args, **options): logger = logging.getLogger('contactrecover') hand...
# Author: Meir Kriheli # Id: $Id: he.py 4837 2006-12-26 09:59:41Z sfcben $ # Copyright: This module has been placed in the public domain. # New language mappings are welcome. Before doing a new translation, please # read <http://docutils.sf.net/docs/howto/i18n.html>. Two files must be # translated for each language:...
# # 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...
__kupfer_name__ = _("Epiphany Bookmarks") __kupfer_sources__ = ("EpiphanySource", ) __description__ = _("Index of Epiphany bookmarks") __version__ = "" __author__ = "Ulrik Sverdrup <[EMAIL]>" import os from kupfer.objects import Source from kupfer.objects import UrlLeaf from kupfer.obj.apps import AppLeafContentMixin...
# -*- coding: utf-8 -*- """ pygments.lexers._lassobuiltins ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Built-in Lasso types, traits, and methods. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ BUILTINS = { 'Types': [ 'null', '...
import unittest import tkinter from tkinter import ttk from test.support import requires, run_unittest import tkinter.test.support as support requires('gui') class StyleTest(unittest.TestCase): def setUp(self): self.style = ttk.Style() def test_configure(self): style = self.style s...
# 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 unittest from cStringIO import StringIO from ..backends import static # There aren't many tests here because i...
from django.core.exceptions import ImproperlyConfigured from django.utils import lru_cache, six from django.utils.functional import cached_property from django.utils.module_loading import import_string from .base import Context, Template from .context import _builtin_context_processors from .exceptions import Template...
""" Amazon OAuth2 backend, docs at: https://python-social-auth.readthedocs.io/en/latest/backends/amazon.html """ import ssl from .oauth import BaseOAuth2 class AmazonOAuth2(BaseOAuth2): name = 'amazon' ID_KEY = 'user_id' AUTHORIZATION_URL = 'https://www.amazon.com/ap/oa' ACCESS_TOKEN_URL = 'https...
# -*- 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...
#!/usr/bin/env python __author__ = 'Andrew Dunai <[EMAIL]>' import sys import json import argparse import re from collections import namedtuple try: from PyQt4 import QtGui import argparseui except ImportError: CAN_GUI = False else: CAN_GUI = True range_regexp = re.compile(r'^([\w\d]+)\=([\d]+)\.\.([...
'''Experimenting with the new JSON-RPC Server ''' import sys import datetime import logging from environment import settings, local_dir from siro.core.api import siro_api from djpcms import http from django.core.handlers import wsgi from gevent.wsgi import WSGIServer class WSGIHandler(wsgi.WSGIHandler)...
# # (c) 2016 Red Hat Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is d...
import io import json import os import html5lib import pytest from selenium import webdriver from wptserver import WPTServer ENC = 'utf8' HERE = os.path.dirname(os.path.abspath(__file__)) WPT_ROOT = os.path.normpath(os.path.join(HERE, '..', '..')) HARNESS = os.path.join(HERE, 'harness.html') def pytest_addoption(pa...
# #!/usr/bin/env python # # -*- coding: utf-8 -*- # import os # import math # import mapnik # import sys # from utilities import execution_path, run_all # from nose.tools import * # def setup(): # # All of the paths used are relative, if we run the tests # # from another directory we need to chdir() # os....
from __future__ import absolute_import import numpy as nm from sfepy.base.base import output, assert_, get_default, Struct from sfepy.homogenization.coefs_base import CorrSolution, \ TCorrectorsViaPressureEVP, CorrMiniApp from sfepy.solvers.ts import TimeStepper from six.moves import range class PressureRHSVecto...
from django.template import TemplateSyntaxError from django.test import SimpleTestCase from ..utils import setup class FirstOfTagTests(SimpleTestCase): @setup({'firstof01': '{% firstof a b c %}'}) def test_firstof01(self): output = self.engine.render_to_string('firstof01', {'a': 0, 'c': 0, 'b': 0}) ...
# Copyright (C) 2011 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2011-2012 Domsense s.r.l. (<http://www.domsense.com>). # Copyright (C) 2012 Agile Business Group sagl (<http://www.agilebg.com>) # Copyright (C)...
#*************************************************************************** #* * #* Copyright (c) 2011, 2016 * #* Jose Luis Cercos Pita <[EMAIL]> * #* ...
import os import sys import sqlite3 import decimal import math import datetime import ast import csv def adapt_decimal(d): return str(d) def convert_decimal(s): return decimal.Decimal(s) def question_marks(st): question_marks = '?' for i in range(0, len(st.split(','))-1): question_marks = question_marks + ",?"...
import requests import httputil import traceback from datetime import datetime, timedelta def get_symbol_to_quotes(symbols): if len(symbols) == 0: return {} symbol_to_quote = {} try: quotes = httputil.get_json_object_from_url("https://api.robinhood.com/quotes/?symbols={}".format(",".join(s...
import pandas import time import sklearn import numpy as np import Bio.SeqUtils as SeqUtil import Bio.Seq as Seq import util import sys import Bio.SeqUtils.MeltingTemp as Tm import pickle import itertools def featurize_data(data, learn_options, Y, gene_position, pam_audit=True, length_audit=True): ''' assumes ...
""" Helper classes for parsers. """ from __future__ import unicode_literals import datetime import decimal import json import uuid from django.db.models.query import QuerySet from django.utils import six, timezone from django.utils.encoding import force_text from django.utils.functional import Promise from rest_fram...
"""Test compiler changes for unary ops (+, -, ~) introduced in Python 2.2""" import unittest from test.support import run_unittest class UnaryOpTestCase(unittest.TestCase): def test_negative(self): self.assertTrue(-2 == 0 - 2) self.assertEqual(-0, 0) self.assertEqual(--2, 2) self....
#!/usr/bin/env python # -*- coding: UTF-8 -*- """ Copyright (c) 2014, Kersten Doering <[EMAIL]>, Christian Senger <[EMAIL]> """ #Kersten HowTo: #"python RunXapian.py -x" for indexing and searching #"python RunXapian.py -f" for indexing #"python RunXapian.py" for searching #"python RunXapian.py -h" for help import...
# Copyright (c) 2010 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the ...
# # Copyright 2015 Quantopian, 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 or agreed to in wr...
# 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. import copy import ntpath import os import posixpath import re import subprocess import sys import gyp.common import gyp.easy_xml as easy_xml import gyp.generator...