text
stringlengths
475
200k
# -*- coding: utf-8 -*- import json import logging import pprint import urllib2 import werkzeug from odoo import http from odoo.http import request _logger = logging.getLogger(__name__) class PaypalController(http.Controller): _notify_url = '/payment/paypal/ipn/' _return_url = '/payment/paypal/dpn/' _c...
import warnings from django.apps import apps as django_apps from django.conf import settings from django.core import urlresolvers, paginator from django.core.exceptions import ImproperlyConfigured from django.utils import translation from django.utils.deprecation import RemovedInDjango19Warning from django.utils.six.m...
import sublime, sublime_plugin class MytestCommand(sublime_plugin.TextCommand): def run(self, edit): # self.view.insert(edit, 0, "Hello, World! ") self.view.run_command("show_panel", {"panel": "console"}) # "toggle": 0}) # print self.view.file_name(), "is now the active view" class SublimeOnSave(sublime_plugin...
#!/usr/bin/python # # Copyright (C) 2008 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 ...
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). All Rights Reserved # $Id$ # # This program is free software: you can redistribute it and/or modify # ...
#!/usr/bin/python import subprocess import sys import logging import dateutil.parser import pytz from datetime import datetime, timedelta logging.basicConfig(format="%(asctime)s %(levelname)s: %(message)s") logger = logging.getLogger(__name__) def run(args, dry_run=False): if dry_run: print "Would have r...
## Automatically adapted for numpy.oldnumeric Jun 27, 2008 by -c # # Copyright (C) 2001,2003 greg Landrum and Rational Discovery LLC # """ unit tests for the QuantTree implementation """ from __future__ import print_function import unittest import io from rdkit import RDConfig from rdkit.ML.DecTree import BuildQuan...
#!/usr/bin/python import os,os.path,sys,pdfkit,requests,re import getpass import pynotify import smtplib from email.MIMEMultipart import MIMEMultipart from email.MIMEText import MIMEText from email.MIMEBase import MIMEBase from email import encoders #IMPORTANT--Make sure your gmail settings' access to 'less-secure ap...
# objectHashHolder is a timer-driven thread. One objectHashHolder thread is used # by each sendDataThread. The sendDataThread uses it whenever it needs to # advertise an object to peers in an inv message, or advertise a peer to other # peers in an addr message. Instead of sending them out immediately, it must # wait a ...
# 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 LinkedIn Corp. 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 ...
#!/usr/bin/env python # coding: utf-8 import sys reload(sys) sys.setdefaultencoding('utf8') import os import re import time import datetime import textwrap import getpass import readline import django import paramiko import errno import struct, fcntl, signal, socket, select from io import open as copen import uuid ...
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2011 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 later...
config = { "interfaces": { "google.devtools.cloudtrace.v1.TraceService": { "retry_codes": { "idempotent": ["DEADLINE_EXCEEDED", "UNAVAILABLE"], "non_idempotent": [], }, "retry_params": { "default": { "ini...
# ---------------------------------------------------------------------------- # Copyright (c) 2013--, scikit-bio development team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file COPYING.txt, distributed with this software. # --------------------------------------------...
"""The tests for the mFi switch platform.""" import unittest.mock as mock import pytest import homeassistant.components.mfi.switch as mfi import homeassistant.components.switch as switch_component from homeassistant.setup import async_setup_component PLATFORM = mfi COMPONENT = switch_component THING = "switch" GOOD_...
__author__ = 'chris hamm' #NetworkServer_r13B #Created: 2/19/2015 #DEsigned to run with NetworkClient_r13B #Changes from previous revision: #(Implemented) Replace the stackOfChunksThatNeedToBeReassigned with the queue of chunks #changed receive chunk from controller setup to have chunk stored in the queue...
''' Created on 28 Jul 2014 @author: Levi Wright ''' import os if os.getcwd()[-4:] == "data": os.chdir("..") running = True imported = False import data import pygame import time class level(): pixelsToGrid = 10 fillGaps = True originLatLong = ([52, 56, 23.44],[0,4,10.75]) origi...
from binascii import unhexlify from ipv8.keyvault.crypto import ECCrypto from tribler_core.modules.bootstrap import Bootstrap from tribler_core.tests.tools.base_test import MockObject from tribler_core.tests.tools.test_as_server import TestAsServer from tribler_core.utilities.utilities import succeed class FakeDHT(...
# Copyright (C) 2003-2007, 2009-2011 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 "...
#!/usr/bin/env python import os import re import sys import pickle import time import traceback import yahoo.search from yahoo.search.web import WebSearch APP_ID = 'P5ihFKzV34G69QolFfb3nN7p0rSsYfC9tPGq.IUS.NLWEeJ14SG9Lei0rwFtgwL8cDBrA6Egdw--' QUERY_MODIFIERS = '-site:txdns.net -site:sitedossier.com -mx -site:dataopedi...
from behave import given, when, then from hamcrest.core import assert_that from hamcrest.core.core.isequal import equal_to from hamcrest.library.number.ordering_comparison import greater_than, less_than from hamcrest.library.text.stringcontains import contains_string from pages.base import Base from pages.rate_checker...
from __future__ import absolute_import, print_function import datetime import mimetypes import os import posixpath from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.db import models from django.db import transaction from django.utils.encoding import python_2_unicode_...
# -*- 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 (c) 2006 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOF...
# Copyright 2020 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...
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import logging from datetime import timedelta from functools import partial import psycopg2 from odoo import api, fields, models, tools, _ from odoo.tools import float_is_zero from odoo.exceptions import UserError from ...
# Copyright 2011, 2013 Free Software Foundation, Inc. # # This is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This pro...
import os import sys import logging import logging.handlers from Singleton import Singleton class attrdict(dict): """ Dictionary with attribute like access """ def __init__(self, *args, **kwargs): dict.__init__(self, *args, **kwargs) self.__dict__ = self class Logging_Manager(Singlet...
#!/usr/bin/python # -*- coding: utf-8 -*- # David Art <[EMAIL]> # Program Arcade Games With Python And Pygame - Build a Platformer # http://programarcadegames.com import pygame import random # Define some colors BLACK = (0, 0, 0) WHITE = (255, 255, 255) YELLOW = (255, 255, 0) WIDTH, HEIGHT = 640, 480 ...
class TestConfigLib(object): def setup(self): self.config_path = 'tests/fixture/fqdnblocklist.conf' def test_current_behavior(self): from configlib import getConfig res = getConfig('mongohost', 'defaultvalue', self.config_path) assert res == 'mongodb' def test_option_pars...
# Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file ex...
import math import numpy def normalise(a): ''' Normalises a vector Accepts: a numpy vector Returns: a numpy vector pointing in the same direction with magnitude 1 ''' a_norm = numpy.linalg.norm(a) return numpy.array([float(each)/a_norm for each in a]) def rotation_axis_angle(axis, angle)...
# -*- coding: utf-8 -*- # Copyright (C) 2015 David Caro <[EMAIL]> # # Based on jenkins_jobs/modules/project_flow.py by # Copyright (C) 2013 eNovance SAS <[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 cop...
"""This module implements data recording and reporting for an application. """ import logging import sys import threading import time import os import traceback import imp from functools import partial import newrelic.packages.six as six from newrelic.samplers.data_sampler import DataSampler from newrelic.core.co...
# -*- coding: utf-8 -*- """ Simple incremental latex lexer ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ """ import codecs import collections import re class Token(collections.namedtuple("Token", "name text")): """Stores information about a matched token.""" __slots__ = () # efficiency def __new__(cls, name=Non...
# Generated by Django 2.2.2 on 2019-06-28 06:06 from django.db import migrations, models import openslides.mediafiles.models import openslides.utils.models class Migration(migrations.Migration): dependencies = [("mediafiles", "0003_auto_20190119_1425")] operations = [ migrations.AlterModelOptions(...
# -*- coding: utf-8 -*- # # Copyright 2012-2015 Spotify AB # # 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...
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # This module copyright (C) 2013 Therp BV (<http://therp.nl>) # All Rights Reserved # # This program is free software: you can redistribute it and/or modify #...
from setuptools import Command from setuptools.archive_util import unpack_archive from distutils import log, dir_util import os, shutil, pkg_resources class install_egg_info(Command): """Install an .egg-info directory for the package""" description = "Install an .egg-info directory for the package" user_...
"""Read/write support for Maildir, mbox, MH, Babyl, and MMDF mailboxes.""" # Notes for authors of new mailbox subclasses: # # Remember to fsync() changes to disk before closing a modified file # or returning from a flush() method. See functions _sync_flush() and # _sync_close(). import os import time import calendar...
from ..broker import Broker class CollectionScheduleBroker(Broker): controller = "collection_schedules" def index(self, **kwargs): """Lists the available collection schedules. Any of the inputs listed may be be used to narrow the list; other inputs will be ignored. Of the various ways to query lists,...
#!/usr/bin/env python import os import shutil import glob import time import sys import subprocess from optparse import OptionParser, make_option SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) PARAMETERS = None ADB_CMD = "adb" def doCMD(cmd): # Do not need handle timeout in this short script, let tool...
from golem.interface.command import group, CommandHelper, Argument, command, CommandResult @group(name="envs", help="Manage environments") class Environments(object): name = Argument('name', help="Environment name") table_headers = ['name', 'supported', 'active', 'performance', 'description'] sort = Ar...
# # Copyright 2011 Facebook # # 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, s...
from numbers import Integral from .base import TestBase from ..object import ObjectFile from ..object import Relocation from ..object import Section from ..object import Symbol class TestObjectFile(TestBase): def get_object_file(self): source = self.get_test_binary() return ObjectFile(filename=sou...
# This file was automatically created by FeynRules $Revision: 510 $ # Mathematica version: 7.0 for Linux x86 (64-bit) (February 18, 2009) # Date: Wed 2 Mar 2011 15:09:55 from __future__ import division from object_library import all_particles, Particle import parameters as Param a = Particle(pdg_code = 22, ...
import sys, unittest, re, os.path sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', '..', 'src')) from tempfile import mkdtemp from shutil import rmtree from Exscript import Host from Exscript.FileLogger import FileLogger from LoggerTest import LoggerTest, FakeJob class FakeError(Exception): pass ...
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Profile.dashboard_date' db.add_column('profile_profile', 'dashboard_date', self.gf('django...
""" PRE-PROCESSORS ============================================================================= Preprocessors work on source text before we start doing anything too complicated. """ import re import markdown HTML_PLACEHOLDER_PREFIX = markdown.STX+"wzxhzdk:" HTML_PLACEHOLDER = HTML_PLACEHOLDER_PREFIX + "%d" + mark...
""" =================================================================== Decision Tree Regression =================================================================== A 1D regression with decision tree. The :ref:`decision trees <tree>` is used to fit a sine curve with addition noisy observation. As a result, it learns ...
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2014 <+YOU OR YOUR COMPANY+>. # # This is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # any later version. #...
""" @author: Bowen """ from django.shortcuts import render from django.db.models import Q from django.http import HttpResponse, HttpResponseRedirect from django.shortcuts import render, get_object_or_404, render_to_response from django.template import RequestContext, loader from django.core.mail import send_mail from...
######################################################################### # # Copyright (C) 2012 OpenPlans # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or #...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 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.apac...
# -*- 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...
from jc_types import Scope class VMWriter: arithmeticOperations = ["add", "sub", "and", "or", "not", "neg", "eq", "gt", "lt"] scopeTable = { Scope.STATIC : "static", Scope.FIELD : "dunno?", Scope.ARG : "argument", Scope.VAR : "local" } def __init__...
# -*- coding: utf-8 -*- # ***************************************************************************** # Copyright (C) 2003-2006 Gary Bishop. # Copyright (C) 2006 Jorgen Stenarson. <[EMAIL]> # # Distributed under the terms of the BSD License. The full license is in # the file COPYING, distributed as pa...
# -*- 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...
#!/usr/bin/python # rfc1751.py : Converts between 128-bit strings and a human-readable # sequence of words, as defined in RFC1751: "A Convention for # Human-Readable 128-bit Keys", by Daniel L. McDonald. __revision__ = "$Id: RFC1751.py,v 1.6 2003/04/04 15:15:10 akuchling Exp $" import string, binascii from functools...
from multiprocessing import Pool """ A generator function for chopping up a given list into chunks of length n. """ def chunks(l, n): for i in xrange(0, len(l), n): yield l[i:i+n] def MapReduce(Map, Reduce, text): l = min(len(text),8) # Fragment the string data into 8 chunks partitioned_text = list(chunks...
"""Extension argument processing code """ __all__ = ['Message', 'NamespaceMap', 'no_default', 'registerNamespaceAlias', 'OPENID_NS', 'BARE_NS', 'OPENID1_NS', 'OPENID2_NS', 'SREG_URI', 'IDENTIFIER_SELECT'] import copy import warnings import urllib from openid import oidutil from openid import kvf...
# coding=utf-8 from django.core.urlresolvers import reverse from django.contrib.auth.decorators import login_required from django.http import HttpResponseRedirect from django.shortcuts import render, get_object_or_404 from django.http import HttpResponse import json from app.content.models import City,ShoppingAddress f...
# $Id$ import inc_sip as sip import inc_sdp as sdp pjsua = "--null-audio --id=sip:CLIENT --registrar sip:127.0.0.1:$PORT " + \ "--realm=python --user=username --password=password " + \ "--auto-update-nat=0" req1 = sip.RecvfromTransaction("Initial request", 401, include=["REGISTER sip"], exclude=["Authoriza...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2014-Today OpenERP SA (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django.db.models.deletion from django.conf import settings class Migration(migrations.Migration): dependencies = [ ('auth', '0001_initial'), ('uploads', '0001_initial'), migrat...
import datetime import config.general project_github_username='veltzer' project_name='demos-linux' project_website='https://{project_github_username}.github.io/{project_name}'.format(**locals()) project_website_source='https://github.com/{project_github_username}/{project_name}'.format(**locals()) project_website_git=...
# -*- coding: utf-8 -*- ''' Covenant Add-on This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This prog...
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import api, models, fields, _ class AccountMove(models.Model): _inherit = 'account.move' edi_show_abandon_cancel_button = fields.Boolean( compute='_compute_edi_show_abandon_cancel_button') ...
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
# Copyright 2011 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 or a...
/** * * The MIT License (MIT) * * Copyright (c) 2013 Shrey Malhotra * * 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 witho...
# Copyright (c) 2019 Ultimaker B.V. # Cura is released under the terms of the LGPLv3 or higher. from datetime import datetime from typing import List, Dict, Union, Any from ..BaseModel import BaseModel from .ClusterPrinterStatus import ClusterPrinterStatus from .ClusterPrintJobStatus import ClusterPrintJobStatus # M...
# Copyright 2010 Pierre Schaus [EMAIL], [EMAIL] # # Licensed under the Apache License, Version 2.0 (the 'License'); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
""" Management command to remove enrollments and any related models created as a side effect of enrolling students. Intented for use in integration sandbox environments """ import logging from textwrap import dedent from django.core.management.base import BaseCommand, CommandError from django.db import transaction ...
import os import sys import tempfile import operator import functools import itertools import re import contextlib import pickle import textwrap from setuptools.extern import six from setuptools.extern.six.moves import builtins, map import pkg_resources if sys.platform.startswith('java'): import org.python.modul...
ACTIVATE_SCRIPT = """# This file must be used with "source bin/activate" *from bash* # you cannot run it directly deactivate () { # reset old environment variables if [ -n "$_OLD_VIRTUAL_PATH" ] ; then PATH="$_OLD_VIRTUAL_PATH" export PATH unset _OLD_VIRTUAL_PATH fi # This shoul...
""" Internationalization support. """ import re import warnings from contextlib import ContextDecorator from decimal import ROUND_UP, Decimal from django.utils.autoreload import autoreload_started, file_changed from django.utils.deprecation import RemovedInDjango40Warning from django.utils.functional import lazy __al...
# Copyright 2011 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # any later version. # # G...
# -*- 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...
# -*- coding:utf-8 -*- # # Copyright 2012 NAMD-EMAP-FGV # # This file is part of PyPLN. You can get more information at: http://pypln.org/. # # PyPLN 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 vers...
# (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...
from __future__ import with_statement import os.path import sys from warnings import warn import java.lang.reflect.Array __all__ = ['add_history', 'clear_history', 'get_begidx', 'get_completer', 'get_completer_delims', 'get_current_history_length', 'get_endidx', 'get_history_item', 'get_history_...
# -*- 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...
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
# -*- coding: utf-8 -*- # # This file is part of INSPIRE. # Copyright (C) 2014-2017 CERN. # # INSPIRE 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 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=[]): return [ ID_FIELD, ...
import json from httpretty import HTTPretty from social.exceptions import AuthFailed from social.tests.backends.oauth import OAuth2Test class GithubOAuth2Test(OAuth2Test): backend_path = 'social.backends.github.GithubOAuth2' user_data_url = 'https://api.github.com/user' expected_username = 'foobar' ...
# coding=utf-8 import datetime import re from xml.sax.saxutils import quoteattr from markupsafe import Markup, escape_silent from ._compat import to_unicode, iteritems class FakeMultiDict(dict): """Adds a fake `getlist` method to a regular dict; or acts as a proxy to Webob's MultiDict `getall` method. "...
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. from __future__ import division, unicode_literals from six.moves import zip import itertools import numpy as np import math from . import coord_utils_cython as cuc """ Utilities for manipulating coordinates o...
#!/opt/local/bin/python3.4 # Loads some common capacitor and resistor values and then exhaustively searches the space of possible combinations to find a good combination. import re,sys,math,blist from blist import sortedset def convertToValue(x) : y = x.strip() if y.endswith("pF") : return float(y.replace...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Functionality for resolving ASCII printable strings within the debuggee's address space. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import string import gdb ...
# BEGIN_COPYRIGHT # # Copyright (C) 2014 CRS4. # # This file is part of blast-python. # # blast-python 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) # ...
#!/usr/bin/env python3 """ This module tries to retrieve as much platform-identifying data as possible. It makes this information available via function APIs. If called from the command line, it prints the platform information concatenated as single string to stdout. The output format is useable as pa...
import os import sys sys.path.append(os.path.dirname(os.path.abspath(__file__))) from commander.deploy import hostgroups, task import commander_settings as settings _src_dir = lambda *p: os.path.join(settings.SRC_DIR, *p) VIRTUALENV = os.path.join(os.path.dirname(settings.SRC_DIR), 'venv') @task def create_virtu...
"""HTML handling. Copyright 2003-2006 John J. Lee <[EMAIL]> This code is free software; you can redistribute it and/or modify it under the terms of the BSD or ZPL 2.1 licenses (see the file COPYING.txt included with the distribution). """ import codecs import copy import htmlentitydefs import re import _sgmllib_co...
from django import template from django.core.cache import cache from django.template import Node, TemplateSyntaxError, Variable from django.template import resolve_variable register = template.Library() class CacheNode(Node): def __init__(self, nodelist, expire_time, key): self.nodelist = nodelist ...
""" homeassistant.components.thermostat.demo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Demo platform that offers a fake thermostat. """ from homeassistant.components.thermostat import ThermostatDevice from homeassistant.const import TEMP_CELCIUS, TEMP_FAHRENHEIT def setup_platform(hass, config, add_devices, discovery...
"""Tests for plotting utilities.""" import warnings import tempfile import shutil import numpy as np import pandas as pd import matplotlib.pyplot as plt import nose import nose.tools as nt from nose.tools import assert_equal, raises import numpy.testing as npt import pandas.util.testing as pdt from distutils.version ...