text
stringlengths
475
200k
#-*- coding:utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2011 OpenERP SA (<http://openerp.com>). All Rights Reserved # # This program is free software: you can redistribute it and/or modify # it under th...
from __future__ import unicode_literals import copy import datetime import decimal import math import warnings from itertools import tee from django.db import connection from django.db.models.query_utils import QueryWrapper from django.conf import settings from django import forms from django.core import exceptions, ...
# Django documentation build configuration file, created by # sphinx-quickstart on Thu Mar 27 09:06:53 2008. # # This file is execfile()d with the current directory set to its containing dir. # # The contents of this file are pickled, so don't put values in the namespace # that aren't picklable (module imports are okay...
__author__ = 'PARKJINSANG' # def read_file(path): """ Read text from file path :param path: string of path of file to read :return: contents inside the file """ file = open(path, "r", encoding='ISO-8859-1') contents = "" while True: line = file.readline() if not line: ...
import capstone as _capstone from .arch import Arch # FIXME: Tell fish to fix whatever he was storing in info['current_function'] # TODO: Only persist t9 in PIC programs class ArchMIPS32(Arch): def __init__(self, endness="Iend_LE"): super(ArchMIPS32, self).__init__(endness) if endness == 'Iend_BE...
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from openerp import fields, models from openerp import tools class crm_activity_report(models.Model): """ CRM Lead Analysis """ _name = "crm.activity.report" _auto = False _description = "CRM Activity A...
# Copyright (c) 2006-2012 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software wit...
def slogdet(a): """ Compute the sign and (natural) logarithm of the determinant of an array. If an array has a very small or very large determinant, than a call to `det` may overflow or underflow. This routine is more robust against such issues, because it computes the logarithm of the determinant...
# weather.py # Rewritten by ScottSteiner to use Weather Underground instead of Yahoo from util import hook, database, http, web base_url = "http://api.wunderground.com/api/{}/{}/q/{}.json" def format_coordinates(latitude, longitude): "Formats coordinates into one string" latitude = round(float(latitude), 2) longi...
# Copyright (C) 2013 Nippon Telegraph and Telephone Corporation. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
from rawweb import * def main(raw_stream,ssl): ''' This Burpy module is specially written to find CSRF vulnerability in Facebook Application. It has already found few minor CSRF vulnerability in FB application. Few them was qualifed for Bug Bounty. It simply checks whether CSRF token validation is present in Server...
import hashlib import hmac import json import uuid import urlparse from django import http from django.conf import settings from django.contrib import auth from django.contrib.auth.signals import user_logged_in from django.db import IntegrityError from django.utils.datastructures import MultiValueDictKeyError import ...
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (c) 2009 CamptoCamp. All rights reserved. # @author Nicolas Bessi # # Abstract class to fetch rates from National Bank of Poland # # This program is free software: you can redistribute it and...
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' VMware Inventory Script ======================= Retrieve information about virtual machines from a vCenter server or standalone ESX host. When `group_by=false` (in the INI file), host systems are also returned in addition to VMs. This script will attempt to read conf...
# This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by Ansible # still belong to the author of the module, and may assign their own license # to the complete wo...
# -*- coding: utf-8 -*- import sys from datetime import timedelta, datetime import pytest import ttcal from django.core.exceptions import ValidationError from django.db import connection from django.forms import Form from ttcal import Duration from dkmodelfields import DurationField from dkmodelfields import adminform...
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2016, Brian Coca <[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...
# -*- coding: utf-8 -*- """ jinja2.testsuite.utils ~~~~~~~~~~~~~~~~~~~~~~ Tests utilities jinja uses. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ import gc import unittest import pickle from jinja2.testsuite import JinjaTestCase from jinja2.utils imp...
#!/usr/bin/python ########################################################################### # mongodb_log.py - Python based ROS to MongoDB logger (multi-process) # # Created: Sun Dec 05 19:45:51 2010 # Copyright 2010-2012 Tim Niemueller [www.niemueller.de] # 2010-2011 Carnegie Mellon University # ...
"""SCons.Tool.Packaging.targz The targz SRC packager. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons Foundation # # 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 t...
from OpenGL.GL import * from itertools import product from math import ceil, log from PIL import Image, ImageDraw, ImageFont from .core import Context, Texture, VertexBuffer, Scene from .matrix import Matrix from .programs import TextProgram from .util import interleave def float_to_byte_color(color): return tuple...
from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import ( compat_urllib_parse, compat_str, ) from ..utils import ( ExtractorError, find_xpath_attr, fix_xml_ampersands, HEADRequest, sanitized_Request, unescapeHTML, url_basename, R...
import datetime from django.conf import settings from django.core.mail import send_mail from django.db import models from django.db.models.signals import post_save from django.dispatch import receiver from django.template.loader import render_to_string from django.utils.hashcompat import sha_constructor from django.c...
# $Id$ # Author: Robert Wojciechowicz <[EMAIL]> # 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: one in docutils/languages,...
# Copyright (c) 1999-2008 Mark D. Hill and David A. Wood # Copyright (c) 2009 The Hewlett-Packard Development Company # 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 co...
import numpy.testing import chainerx # NumPy-like assertion functions that accept both NumPy and ChainerX arrays def _as_numpy(x): if isinstance(x, chainerx.ndarray): return chainerx.to_numpy(x) assert isinstance(x, numpy.ndarray) or numpy.isscalar(x) return x def _check_dtype_and_strides(x, y...
#! /usr/bin/env python # pdeps # # Find dependencies between a bunch of Python modules. # # Usage: # pdeps file1.py file2.py ... # # Output: # Four tables separated by lines like '--- Closure ---': # 1) Direct dependencies, listing which module imports which other modules # 2) The inverse of (1) # 3) Indirect de...
#!/usr/bin/env python # # Copyright (c) 2016 Intel Corporation. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of works must retain the original copyright notice, this # list of conditions and t...
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import copy import datetime import hashlib import logging import os import posixpath import subprocess import sys import tempfile i...
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # This module copyright (C) 2010 - 2014 Savoir-faire Linux # (<http://www.savoirfairelinux.com>). # # This program is free software: you can redistribute it a...
import pandas as pd from sklearn.ensemble import RandomForestClassifier from sklearn.ensemble import GradientBoostingClassifier from sklearn.ensemble import BaggingClassifier from sklearn.ensemble import AdaBoostClassifier from sklearn.ensemble import ExtraTreesClassifier from sklearn.neural_network import MLPClassifie...
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- # # Copyright (C) 2015 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...
"Test posix functions" from test import test_support # Skip these tests if there is no posix module. posix = test_support.import_module('posix') import errno import sys import time import os import pwd import shutil import stat import sys import tempfile import unittest import warnings _DUMMY_SYMLINK = os.path.join...
# Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
## # Copyright 2015-2015 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en), # the Hercules foundation (htt...
#!/usr/bin/python # # Created on Aug 25, 2016 # @author: Gaurav Rastogi ([EMAIL]) # Eric Anderson ([EMAIL]) # module_check: supported # Avi Version: 17.1.1 # # # 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 Licen...
from sympy.core.compatibility import range from sympy.core.basic import Basic from sympy.vector.vector import Vector from sympy.vector.coordsysrect import CoordSysCartesian from sympy.vector.functions import _path from sympy import Symbol from sympy.core.cache import cacheit class Point(Basic): """ Represents...
"""This file contains code for use with "Think Bayes", by Allen B. Downey, available from greenteapress.com Copyright 2012 Allen B. Downey License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html """ from __future__ import print_function, division import math import columns import thinkbayes2 import thinkbayes2 impo...
''' Given a collection of intervals, merge all overlapping intervals. For example, Given [1,3],[2,6],[8,10],[15,18], return [1,6],[8,10],[15,18]. ''' # Definition for an interval. class Interval(object): def __init__(self, s=0, e=0): self.start = s self.end = e # To print the result def _...
# coding=utf-8 # coding=utf-8 # Copyright 2019 The RecSim Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ap...
#!/usr/bin/env python # Copyright 2015 The Kubernetes 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 # # Unle...
# -*- coding: utf-8 -*- # # Copyright (C) 2009, 2010 Pierre-André Saulais <[EMAIL]> # # This file is part of the Spark File-transfer Tool. # # Spark 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 versi...
#!/usr/bin/python #-*- coding: utf-8 -*- import random from IPy import IP as ip class DHCP: def __hash__(self): return hash(random.random()) def __eq__(self, other): return hash(self) == hash(other) def __str__(self): return "<DHCP>" class _IP: def __init__(self, address, netmask, gateway): self.add...
import cv2 import numpy as np from matplotlib import pyplot as plt from skimage import morphology from drawlinefeature import DrawLineFeature,drawconvex#zc from lineseg import lineseg from drawedgelist import drawedgelist from Lseg_to_Lfeat_v2 import Lseg_to_Lfeat_v2 #zc from LabelLineCurveFeature_v2 import...
# server.py -- Implementation of the server side git protocols # Copyright (C) 2008 John Carr <[EMAIL]> # Coprygith (C) 2011-2012 Jelmer Vernooij <[EMAIL]> # # 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 ...
from __future__ import unicode_literals from datetime import datetime import re import threading # from django.conf import settings from django.contrib import comments from django.contrib.comments.signals import comment_was_posted from django.contrib.contenttypes.models import ContentType from django.contrib.sites.mo...
# -*- coding: utf-8 -*- import base64 import logging import sys import threading import openerp import openerp.report from openerp import tools import security _logger = logging.getLogger(__name__) # TODO: set a maximum report number per user to avoid DOS attacks # # Report state: # False -> True self_reports...
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. from selenium.webdriver.common.by import By from selenium.webdriver.support import expected_conditions as expected from...
# 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 use ...
from functools import wraps from django.utils.decorators import available_attrs, method_decorator from django.views.decorators.cache import never_cache from django.views.decorators.http import last_modified as cache_last_modified from django.utils.translation import ugettext_lazy as _ from django.core.exceptions impor...
#-*- coding: ISO-8859-1 -*- # pysqlite2/test/transactions.py: tests transactions # # Copyright (C) 2005-2007 Gerhard Häring <[EMAIL]> # # This file is part of pysqlite. # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages # arisin...
""" Do not use unberbars for cpp filename. Only alphabets, numbers can be used for a cpp filename. == Vilolation == /testdir/test_1.cpp <== Violation. - is used. /testdir1/_test1.cpp <== Violation. _ is used == Good == testdir/test.cpp testdir1/test_1.c <== Don't care. it's c file. """ from nsiqcp...
# (C) British Crown Copyright 2013 - 2017, Met Office # # This file is part of Iris. # # Iris 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 l...
#!/usr/bin/python # Copyright 2016 Jakub Jursa <[EMAIL]> # # This module is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This softw...
from __future__ import division, print_function, unicode_literals # This code is so you can run the samples without installing the package import sys import os sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..')) # # total time duration * action multiplier testinfo = "s, t 2.0, s, t 4.0, s, t 6.1, s, q" ...
# Copyright (c) 2012 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. # All Rights Reserved # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without...
try: import urlparse except ImportError: import urllib.parse as urlparse import newrelic.packages.six as six from newrelic.agent import (current_transaction, wrap_function_wrapper, ExternalTrace) def _nr_wrapper_factory(bind_params_fn, library): # Wrapper functions will be similar for monkeypatching ...
# -*- coding: utf8 -*- """Utility and helper methods for script. util ~~~~ """ from __future__ import absolute_import, unicode_literals import re import sys from ._compat import Mapping, string_types, text_type, unichr def ucn_to_unicode(ucn): """Return a python unicode value from a UCN. Converts a Unico...
from enum import Enum from functools import wraps from typing import Iterable, Union from graphql_jwt import exceptions from graphql_jwt.decorators import context def account_passes_test(test_func): """Determine if user/service_account has permission to access to content.""" def decorator(f): @wraps...
# Copyright (C) 2013 W. Trevor King <[EMAIL]> # # This file is part of pycalender. # # pycalender 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 ...
# -*- coding: utf-8 -*- import traceback from pylons import cache from tg import config from gapproject.model import * __all__ = ['getOrsayCustomerList', 'getOrsayCustomerInfo', 'getOrsayWashingList', 'getOrsayWashingDetailInfo', 'populateTranslation', 'populateTranslation1'] def getOrsayCustomerList(): def _get...
#!/usr/bin/env python3 from sys import exit from test.http_test import HTTPTest from misc.wget_file import WgetFile """ This test ensures Wget's Basic Authorization Negotiation. Also, we ensure that Wget saves the host after a successfull auth and doesn't wait for a challenge the second time. """ TEST_NAME...
""" GitLab API: https://docs.gitlab.com/ce/api/system_hooks.html GitLab API: https://docs.gitlab.com/ce/api/groups.html#hooks GitLab API: https://docs.gitlab.com/ee/api/projects.html#hooks """ import re import pytest import responses from gitlab.v4.objects import GroupHook, Hook, ProjectHook hooks_content = [ {...
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe.utils import cstr, flt, cint, nowdate, add_days, comma_and from frappe import msgprint, _ from frappe.model.document import ...
""" A second, custom AdminSite -- see tests.CustomAdminSiteTests. """ from __future__ import unicode_literals from django.conf.urls import url from django.contrib import admin from django.contrib.auth.admin import UserAdmin from django.contrib.auth.models import User from django.http import HttpResponse from . import...
# Copyright (C) 2017 Antoine Fourmy <antoine dot fourmy at gmail dot com> # # 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. # # This program is distributed in the hope that it will be useful, # ...
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals, division import io import warnings import collections from psd_tools.utils import (read_pascal_string, unpack, read_fmt, read_unicode_string, be_array_from_bytes, decode_fixed_poi...
""" The ``atmosphere`` module contains methods to calculate relative and absolute airmass and to determine pressure from altitude or vice versa. """ from __future__ import division import logging pvl_logger = logging.getLogger('pvlib') import numpy as np AIRMASS_MODELS = ['kastenyoung1989', 'kasten1966', 'simple',...
# Copyright (c) 2009, 2010, 2011 Google Inc. All rights reserved. # Copyright (c) 2009 Apple 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 reta...
#!/usr/bin/python3 # This Amulet based tests # The goal is to ensure the Ubuntu charm # sucessfully deploys and can be accessed. # Note the Ubuntu charm does not have any # relations or config options. import amulet #import os #import requests # Timeout value, in seconds to deploy the environment seconds = 900 # S...
from direct.distributed.ClockDelta import * from direct.distributed.DistributedObject import DistributedObject from direct.fsm import ClassicFSM, State from direct.interval.IntervalGlobal import * from pandac.PandaModules import * import random import ToonInteriorColors from toontown.dna.DNAParser import DNADoor from ...
import os import sys from django.db.backends import BaseDatabaseClient class DatabaseClient(BaseDatabaseClient): executable_name = 'mysql' def runshell(self): settings_dict = self.connection.settings_dict args = [self.executable_name] db = settings_dict['OPTIONS'].get('db', settings_...
#!/usr/bin/env python '''Upload dist/ files to code.google.com. For Alex only :-) ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' import os import re import sys base = os.path.dirname(__file__) root = os.path.join(base, '../..') dist = os.path.join(root, 'dist') sys.path.insert(0, root) import pyglet ...
import matplotlib matplotlib.use("Agg") from matplotlib import pyplot from math import fabs from formulae import sigmoid, sigmoid_derivative, random_weight, get_synapse_colour, adjust_line_to_perimeter_of_circle, layer_left_margin import parameters class Synapse(): def __init__(self, input_neuron_index, x1, x2, y...
from Components.Converter.Converter import Converter from Components.Element import cached, ElementError from Tools.Directories import SCOPE_SKIN_IMAGE, SCOPE_ACTIVE_SKIN, resolveFilename from Tools.LoadPixmap import LoadPixmap class ValueToPixmap(Converter, object): LANGUAGE_CODE = 0 PATH = 1 def __init__(self, ...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations def create_homepage(apps, schema_editor): # Get models ContentType = apps.get_model('contenttypes.ContentType') Page = apps.get_model('wagtailcore.Page') Site = apps.get_model('wagtailcore.Site') Home...
""" Contains view unit tests. """ from django.core.urlresolvers import reverse from wagtailplus.tests import views from ..models import Link class TestLinkIndexView(views.BaseTestIndexView): url_namespace = 'wagtaillinks' template_dir = 'wagtaillinks/links' def _create_sequential_instance(self, ind...
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Simon Montagu # Portions created by the Initial Developer are Copyright (C) 2005 # the Initial Developer. All Rights Reserved...
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: 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 ANSIBLE_METADATA = {'metadata_version': '1.1', ...
class Errors(Exception): __status_code = 400 __error_cat = "General Error" __default_message = "System Error Occurred" def __init__(self, message=None, status_code=None, payload=None): Exception.__init__(self) self.category = self.__error_cat self.message = message or self.__d...
# -*- 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 from __future__ import unicode_literals import re from django.utils.translation import ugettext_lazy as _ from rest_framework import exceptions from rest_framework.compat import unicode_http_header from rest_framework.reverse import _reverse from rest_framework.settings import api_settings from rest_...
# Copyright (c) 2001-2010 Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for twisted.enterprise.adbapi. """ from twisted.trial import unittest import os, stat, new from twisted.enterprise.adbapi import ConnectionPool, ConnectionLost, safe from twisted.enterprise.adbapi import Connection, Transac...
tutorial_tests = """ Let's try a simple generator: >>> def f(): ... yield 1 ... yield 2 >>> for i in f(): ... print i 1 2 >>> g = f() >>> g.next() 1 >>> g.next() 2 "Falling off the end" stops the generator: >>> g.next() Traceback (most recent call la...
# Copyright (c) 2012 ARM Limited # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implementation of the functionality ...
""" Python Character Mapping Codec cp500 generated from 'MAPPINGS/VENDORS/MICSFT/EBCDIC/CP500.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,input...
# # (C) Copyright 2011 Jacek Konieczny <[EMAIL]> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License Version # 2.1 as published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, # but WI...
#!/usr/bin/env python3 # Copyright (c) 2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. from test_framework.mininode import * from test_framework.test_framework import BitcoinTestFramework from test...
from __future__ import absolute_import, division, print_function from datetime import timedelta from flask import make_response, request, current_app from functools import update_wrapper from ... import py2help def crossdomain(origin=None, methods=None, headers=None, automatic_headers=True, ...
""" Sync courses from catalog service. This is used to setup a master's integration environment. """ import logging from textwrap import dedent from django.contrib.auth.models import User # lint-amnesty, pylint: disable=imported-auth-user from django.core.management.base import BaseCommand, CommandError from opaque_...
from flask import ( current_app, render_template, redirect, Blueprint, flash, url_for, g ) from flask.ext.github import GitHubError from flask.ext.login import login_user, logout_user from realms import github from realms.modules.github.models import User blueprint = Blueprint('github', __name__) @blueprint.rout...
""" Tests for discussion API permission logic """ import itertools import ddt from nose.plugins.attrib import attr from discussion_api.permissions import ( can_delete, get_editable_fields, get_initializable_comment_fields, get_initializable_thread_fields ) from lms.lib.comment_client.comment import Co...
# 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...
from fbdownload.downloader import FacebookDownloader class FacebookGroupDownloader(FacebookDownloader): ''' Downloads data from a Facebook group, including events. Images are not downloaded. In this package of classes, that is done by the FacebookHtmlExporter, even though a stand alone download function wo...
# Copyright 2013 James McCauley # # 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 writi...
# -*- coding: utf-8 -*- # # Django documentation build configuration file, created by # sphinx-quickstart on Thu Mar 27 09:06:53 2008. # # This file is execfile()d with the current directory set to its containing dir. # # The contents of this file are pickled, so don't put values in the namespace # that aren't pickleab...
from libtaxii.constants import ( SVC_COLLECTION_MANAGEMENT, MSG_COLLECTION_INFORMATION_REQUEST, MSG_FEED_INFORMATION_REQUEST, MSG_MANAGE_COLLECTION_SUBSCRIPTION_REQUEST, MSG_MANAGE_FEED_SUBSCRIPTION_REQUEST, ) from .abstract import TAXIIService from .handlers import ( CollectionInformationRequestHa...
#!/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...
""" Models for the shopping cart and assorted purchase types """ from collections import namedtuple from datetime import datetime from datetime import timedelta from decimal import Decimal import json import analytics from io import BytesIO from django.db.models import Q import pytz import logging import smtplib impor...
import re import telnetlib from couchpotato.api import addApiView from couchpotato.core.event import addEvent from couchpotato.core.helpers.encoding import tryUrlencode from couchpotato.core.logger import CPLog from couchpotato.core.notifications.base import Notification try: import xml.etree.cElementTree as etr...