text
stringlengths
475
200k
#!/usr/bin/env python # This file is part of Androguard. # # Copyright (C) 2012, Anthony Desnos <desnos at t0t0.fr> # All rights reserved. # # Androguard 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,...
#!/usr/bin/env python import argparse import glob import os import shutil import sys from lib.config import PLATFORM, get_target_arch, s3_config from lib.util import safe_mkdir, scoped_cwd, s3put SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) DIST_DIR = os.path.join(SOURCE_ROOT, 'dist'...
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import threading imp...
from scapy.layers.l2 import ARP from scapy.layers.inet6 import ICMPv6ND_NS, ICMPv6ND_NA, IPv6 from framework import VppTestCase """ TestArping is a subclass of VPPTestCase classes. Basic test for sanity check of arping. """ class TestArping(VppTestCase): """ Arping Test Case """ @classmethod def set...
from __future__ import absolute_import import os import json import collections import itertools __all__ = [ 'dirpath_to_confpath', 'confpath_to_dirpath', 'directory_to_config' ] def dirpath_to_confpath(dirpath): if dirpath[-1] == os.sep: confpath = dirpath[:-1] + ".json" else: co...
from textwrap import dedent from docxUtils.reports import DOCXReport from docxUtils.tables import TableMaker class EpiResultTables(DOCXReport): COLUMN_WIDTHS = [1.0, 1.7, 0.75, 0.75, 1.0, 1.2, 2.6] def _build_result(self, res): rows = 0 tbl = TableMaker( self.COLUMN_WIDTHS, num...
# -*- coding: utf-8 -*- # Natural Language Toolkit: Python port of the tok-tok.pl tokenizer. # # Copyright (C) 2001-2015 NLTK Project # Author: Jon Dehdari # Contributors: Liling Tan, Selcuk Ayguney, ikegami, Martijn Pieters # # URL: <http://nltk.sourceforge.net> # For license information, see LICENSE.TXT """ The tok-...
from importlib import machinery from .. import abc from . import util import unittest class FinderTests(abc.FinderTests): """Test the finder for extension modules.""" def find_module(self, fullname): importer = machinery.FileFinder(util.PATH, (machinery.Extens...
# # Author: Pearu Peterson, March 2002 # # w/ additions by Travis Oliphant, March 2002 __all__ = ['solve', 'solve_triangular', 'solveh_banded', 'solve_banded', 'inv', 'det', 'lstsq', 'pinv', 'pinv2'] from numpy import asarray, zeros, sum, conjugate, dot, transpose, \ asarray_chkfinite, single imp...
from gi.repository import Gtk from gi.repository import Gdk from sugar3.graphics.icon import Icon class OverlayWidget(Gtk.Window): def __init__(self, widget_to_overlay): Gtk.Window.__init__(self) self._box = Gtk.VBox() self._widget_to_overlay = widget_to_overlay self.set_decorate...
# -*- coding: utf-8 -*- # # Copyright 2011 Sybren A. Stüvel <[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 requi...
""" Unit tests for the gradient clipping cost """ import unittest import numpy as np from theano import function from pylearn2.costs.mlp import Default from pylearn2.models.mlp import MLP, Linear from pylearn2.sandbox.rnn.costs.gradient_clipping import GradientClipping class TestGradientClipping(unittest.TestCase):...
# This script generates a Python interface for an Apple Macintosh Manager. # It uses the "bgen" package to generate C code. # The function specifications are generated by scanning the mamager's header file, # using the "scantools" package (customized for this particular manager). #error missing SetActionFilter import...
# 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...
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # This module copyright (C) 2013 Savoir-faire Linux # (<http://www.savoirfairelinux.com>). # # This program is free software: you can redistribute it and/or m...
# 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 os from textwrap import dedent from django.conf import settings from django.core.management import call_command ...
# $HeadURL: $ ''' BaseAction Base class for Actions. ''' from DIRAC import gLogger __RCSID__ = '$Id: $' class BaseAction( object ): ''' Base class for all actions. It defines a constructor an a run main method. ''' def __init__( self, name, decisionParams, enforcementResult, singlePolicyResults, cl...
""" Single page performance tests for LMS. """ from bok_choy.web_app_test import WebAppTest, with_cache from ..pages.lms.auto_auth import AutoAuthPage from ..pages.lms.courseware import CoursewarePage from ..pages.lms.dashboard import DashboardPage from ..pages.lms.course_info import CourseInfoPage from ..pages.lms.log...
# 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...
"""Tests for certbot_apache.obj.""" import unittest class VirtualHostTest(unittest.TestCase): """Test the VirtualHost class.""" def setUp(self): from certbot_apache.obj import Addr from certbot_apache.obj import VirtualHost self.addr1 = Addr.fromstring("127.0.0.1") self.addr2...
import unittest import py3kcompat as py3k from PySide2.QtCore import QSizeF, QTimer from PySide2.QtGui import QTextFormat, QTextCharFormat, QPyTextObject from PySide2.QtWidgets import QTextEdit from helper import UsesQApplication class Foo(QPyTextObject): called = False def intrinsicSize(self, doc, posInDocu...
#!/usr/bin/env python # Software License Agreement (BSD License) # # Copyright (c) 2008, Willow Garage, 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...
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2015 clowwindy # # 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 u...
# 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...
from pymongo import MongoClient import logging, Quandl, random, os import datetime, glob, pandas as pd from pandas_datareader import data, wb import numpy as np, sys from memo import * MONGO_STAT = "C:\\Progra~1\\MongoDB\\Server\\3.2\\bin\\mongostat.exe /rowcount:1" @memo # so that we dont constantly read the .quand...
import io import sys import textwrap from test import support import traceback import unittest class Test_TestResult(unittest.TestCase): # Note: there are not separate tests for TestResult.wasSuccessful(), # TestResult.errors, TestResult.failures, TestResult.testsRun or # TestResult.shouldStop because t...
from south.db import db from django.db import models from frontend.models import * class Migration: def forwards(self, orm): # Adding model 'Message' db.create_table('frontend_message', ( ('id', orm['frontend.message:id']), ('text', orm['frontend.message:text'...
import re from .protocols.base import BaseProtocol from .exceptions import WebSocketError class WebSocketApplication(object): protocol_class = BaseProtocol def __init__(self, ws): self.protocol = self.protocol_class(self) self.ws = ws def handle(self): self.protocol.on_open() ...
"""Utilities for extracting common archive formats""" __all__ = [ "unpack_archive", "unpack_zipfile", "unpack_tarfile", "default_filter", "UnrecognizedFormat", "extraction_drivers", "unpack_directory", ] import zipfile, tarfile, os, shutil, posixpath from pkg_resources import ensure_directory from distutils....
#!/usr/bin/python # # Copyright (c) 2016, The OpenThread Authors. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the above copyright # not...
# # Copyright (C) 2018 Red Hat, Inc. # # 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 2 of the License, or # (at your option) any later version. # # This program is distributed i...
# -*- coding: utf-8 -*- # Copyright 2015 Cray Inc. # (C) Copyright 2015,2017 Hewlett Packard Enterprise Development LP # Copyright 2016-2017 FUJITSU LIMITED # # 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 t...
# 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 # d...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms o...
# # # 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: # # 1. Redistributions of source code must retain the above copyright notice, # this list of conditions and ...
# # 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...
#!/usr/bin/env python # ********************************************************************** # # Copyright (c) 2003-2015 ZeroC, Inc. All rights reserved. # # This copy of Ice is licensed to you under the terms described in the # ICE_LICENSE file included in this distribution. # # *************************************...
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2014, Kevin Carter <[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 # ...
# -*- coding: utf-8 -*- # Copyright (C) 2008 Andi Albrecht, [EMAIL] # # This module is part of python-sqlparse and is released under # the BSD License: http://www.opensource.org/licenses/bsd-license.php. """SQL Lexer""" # This code is based on the SqlLexer in pygments. # http://pygments.org/ # It's separated from th...
# Copyright 2012-2014 Red Hat, 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...
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2013 Hewlett-Packard Development Company, L.P. # 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://...
from django.conf import settings from django.core.management.base import BaseCommand from iati.models import Activity from iati.transaction.models import Transaction class Command(BaseCommand): def update_searchable_activities(self): """ Set all activities to searchable if the reporting org is i...
# (c) 2012-2014, Michael DeHaan <[EMAIL]> # (c) 2012, Dag Wieers <[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...
""" Github Enterprise OAuth2 backend, docs at: http://psa.matiasaguirre.net/docs/backends/github_enterprise.html """ from six.moves.urllib.parse import urljoin from social.utils import append_slash from social.backends.github import GithubOAuth2, GithubOrganizationOAuth2, \ GithubTeamOAuth2 class GithubEnter...
#!/usr/bin/env python """Survey PyX12 Segment Definitions. Read ALL pyx12 message definitions, accumulate all Segment definitions. """ from __future__ import print_function import xml.dom.minidom as DOM import os, glob segmentTypes= {} segmentUse= {} def getDef( aFile ): """Get the Segment Definitions from an XM...
# This file is part of Indico. # Copyright (C) 2002 - 2021 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. from collections import UserDict from datetime import date, datetime from speaklater import _LazyString ...
""" .. dialect:: drizzle+mysqldb :name: MySQL-Python :dbapi: mysqldb :connectstring: drizzle+mysqldb://<user>:<password>@<host>[:<port>]/<dbname> :url: http://sourceforge.net/projects/mysql-python """ from sqlalchemy.dialects.drizzle.base import ( DrizzleDialect, DrizzleExecutionContext, ...
from optparse import make_option import os import re import sys import socket from django.core.management.base import BaseCommand, CommandError from django.core.handlers.wsgi import WSGIHandler from django.core.servers.basehttp import AdminMediaHandler, run, WSGIServerException from django.utils import autoreload nai...
# coding: utf-8 import re from django.core.serializers import SerializerDoesNotExist from django.conf import settings from rest_framework.settings import api_settings from richard.videos.models import Category from .serializers import CategorySerializer, VideoSerializer from .utils import force_path from .exceptions ...
# Copyright 2012 Michael Still and Canonical Inc # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # ...
# encoding: utf-8 """ Readbility url shortner api implementation Located at: https://readability.com/developers/api/shortener Doesnt' need anything from the app """ from .base import BaseShortener from ..exceptions import ShorteningErrorException, ExpandingErrorException class ReadabilityShortener(BaseShortener): ...
# Copyright (c) 2015 Red Hat, Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless require...
# Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 from .PollConstants import PollConstants import select class PollSelectAdapter(object): """ Use select to emulate a poll object, for systems that don't support poll(). """ def __init__(self): self._regi...
#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 thi...
import os from Node import Node from Search import Search from Data import Data from Utils import Utils cities = Data.cities() situations = Data.cfg() def Main(): option = 0 option1 = 0 start = None finisht = None while True: os.system('cls') if(option == 0): option=0 ...
""" Python training exercise Random list Below is a list of random numbers between 0 and 100. Using built-in funcions and the list sub-functions, can you?: (a) Sort the list? HINT: Use the sorted() built-in function. (b) What are the smallest and largest numbers? HINT: There are two ways to do t...
from django.test import TestCase from django.core.exceptions import FieldError from models import Author, Article def pks(objects): """ Return pks to be able to compare lists""" return [o.pk for o in objects] class CustomColumnRegression(TestCase): def assertRaisesMessage(self, exc, msg, func, *args, **...
from django import forms from django.utils.translation import ugettext_lazy as _ from ckeditor.models import HTML5FragmentField class WikiHTMLField(HTML5FragmentField): allowed_elements = [ 'p', 'br', 'a', 'em', 'strong', 'u', 'img', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'ul', 'ol', 'li', 'p...
# Copyright (C) 2009 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...
# Generated by Django 2.0.3 on 2018-03-29 06:42 from django.conf import settings from django.db import migrations, models import django.db.models.deletion import django_prices.models class Migration(migrations.Migration): dependencies = [ ('product', '0054_merge_20180320_1108'), ('order', '0044_...
from __future__ import unicode_literals import uuid from django.conf import settings from django.db.backends.base.operations import BaseDatabaseOperations from django.utils import six, timezone from django.utils.encoding import force_text class DatabaseOperations(BaseDatabaseOperations): compiler_module = "djan...
# # 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...
# Copyright David Abrahams 2004. Distributed under the Boost # Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) r'''>>> import pickle2_ext >>> import pickle >>> pickle2_ext.world.__module__ 'pickle2_ext' >>> pickle2_ext.world.__safe...
# -*- test-case-name: twisted.test.test_unix -*- # Copyright (c) 2001-2004 Twisted Matrix Laboratories. # See LICENSE for details. import stat, os, sys from twisted.internet import interfaces, reactor, protocol, error, address, defer, utils from twisted.python import components, lockfile, failure from twisted.protoc...
"""Backport of importlib.import_module from 3.x.""" # While not critical (and in no way guaranteed!), it would be nice to keep this # code compatible with Python 2.3. import sys def _resolve_name(name, package, level): """Return the absolute name of the module to be imported.""" if not hasattr(package, ...
"""Various utility functions.""" __unittest = True _MAX_LENGTH = 80 def safe_repr(obj, short=False): try: result = repr(obj) except Exception: result = object.__repr__(obj) if not short or len(result) < _MAX_LENGTH: return result return result[:_MAX_LENGTH] + ' [truncated]...'...
from pytest import raises from imageio.testing import run_tests_if_main, get_test_dir import os import gc import shutil import numpy as np import imageio from imageio.core import Format, FormatManager, Request from imageio.core import get_remote_file test_dir = get_test_dir() def setup_module(): imageio.form...
# # Copyright 2003,2004 Free Software Foundation, Inc. # # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-3.0-or-later # # # misc utilities from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals import types class seq_with_cursor (object): ...
# (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org) # Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php """ This module implements a class for handling URLs. """ from six.moves.urllib.parse import quote, unquote, urlencode import cgi from paste import re...
from p2pool.util import math, pack def reads_nothing(f): return None, f def protoPUSH(length): return lambda f: pack.read(f, length) def protoPUSHDATA(size_len): def _(f): length_str, f = pack.read(f, size_len) length = math.string_to_natural(length_str[::-1].lstrip(chr(0))) data, f...
from ..broker import Broker class DeviceCpuStatBroker(Broker): controller = "device_cpu_stats" def index(self, **kwargs): """Lists the available device cpu stats. 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, using this m...
from django.core.exceptions import ImproperlyConfigured from django.core.management import call_command, CommandError from django.core.management.base import BaseCommand from django.conf import settings from django.db.models import loading from django.test import simple from south.migration import Migrations from sout...
# Copyright (c) 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from gpu_test_expectations import GpuTestExpectations # See the GpuTestExpectations class for documentation. class WebGLConformanceExpectations(GpuTest...
# -*- coding: utf-8 -*- # Generated by Django 1.10.5 on 2017-05-26 14:35 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('flows', '0097_interrupt_runs_for_archived_flows'), ] ...
# imports and basic notebook setup from cStringIO import StringIO import numpy as np import scipy.ndimage as nd import PIL.Image # from IPython.display import clear_output, Image, display from google.protobuf import text_format import caffe import cbaas try: caffe.set_gpu_mode() except: print "CPU mode caffe_roo...
__all__ = [ 'LXMLTreeBuilderForXML', 'LXMLTreeBuilder', ] from StringIO import StringIO import collections from lxml import etree from bs4.element import Comment, Doctype, NamespacedAttribute from bs4.builder import ( FAST, HTML, HTMLTreeBuilder, PERMISSIVE, TreeBuilder, XML) from b...
"""some generic utilities for dealing with classes, urls, and serialization Authors: * Min RK """ #----------------------------------------------------------------------------- # Copyright (C) 2010-2011 The IPython Development Team # # Distributed under the terms of the BSD License. The full license is in # the ...
#!/usr/bin/python # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distribut...
""" Copyright (c) 2008-2015, Jesus Cea Avion <[EMAIL]> All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of cond...
import yaml import pyshark import time import os import re import pyshark from robot.api import logger from robot.libraries.BuiltIn import BuiltIn from collections import OrderedDict from sip_message_validation import SipMessageValida...
# Copyright (c) 2008-2009 Aryeh Leib Taurog, all rights reserved. # Modified from original contribution by Aryeh Leib Taurog, which was # released under the New BSD license. import unittest from unittest import skipUnless from django.contrib.gis.geos import ( HAS_GEOS, LinearRing, LineString, MultiPoint, Point, P...
""" Show module information for a given database or from the file-system. """ import os import sys import textwrap from . import common # TODO provide a --rpc flag to use XML-RPC (with a specific username) instead # of server-side library. def run(args): assert args.database import openerp config = opene...
#!/usr/bin/python import numpy # based on the vicar2png module by Jessica McKellar (jesstess at mit.edu) # substantial modifications have been made to the code. However for # thoroughness, I am including her Copyright under the MIT License below: ''' The MIT License (MIT) Copyright (c) 2012-2013 Jessica McKellar ...
from mpl_toolkits.axes_grid1 import make_axes_locatable from mpl_toolkits.axes_grid1.axes_divider import make_axes_area_auto_adjustable if __name__ == "__main__": import matplotlib.pyplot as plt def ex1(): plt.figure(1) ax = plt.axes([0,0,1,1]) # ax = plt.subplot(111) ax...
#! /usr/bin/env python # Hi There! # You may be wondering what this giant blob of binary data here is, you might # even be worried that we're up to something nefarious (good for you for being # paranoid!). This is a base64 encoding of a zip file, this zip file contains # a fully functional basic pytest script. # # Pyt...
# # (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...
# This package will contain the spiders of your Scrapy project # # Please refer to the documentation for information on how to create and manage # your spiders. import scrapy import functools import requests def _link_is_http(l): return l.startswith('https://') or l.startswith('http://') def _link_is_archive(l): ...
ADS_ATTR_CLEAR = ( 1 ) ADS_ATTR_UPDATE = ( 2 ) ADS_ATTR_APPEND = ( 3 ) ADS_ATTR_DELETE = ( 4 ) ADS_EXT_MINEXTDISPID = ( 1 ) ADS_EXT_MAXEXTDISPID = ( 16777215 ) ADS_EXT_INITCREDENTIALS = ( 1 ) ADS_EXT_INITIALIZE_COMPLETE = ( 2 ) ADS_SEARCHPREF_ASYNCHRONOUS = 0 ADS_SEARCHPREF_DEREF_ALIASES = 1 ADS_SEARCHPREF_SIZE...
# Copyright 2019 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...
import hashlib import json import subprocess import traceback from tempfile import NamedTemporaryFile import httplib2 from celery.canvas import chain from django.conf import settings from google.cloud import storage from google.cloud.exceptions import Forbidden, NotFound from google.cloud.storage import Blob from goog...
""" My own variation on function-specific inspect-like features. """ # Author: Gael Varoquaux <gael dot varoquaux at normalesup dot org> # Copyright (c) 2009 Gael Varoquaux # License: BSD Style, 3 clauses. from itertools import islice import inspect import warnings import re import os from ._compat import _basestrin...
from django import forms from openflow.optin_manager.flowspace.utils import dotted_ip_to_int, mac_to_int from django.forms.util import ErrorList import re from openflow.optin_manager.opts.models import AdminFlowSpace class MACAddressForm(forms.Field): def clean(self, value): pattern = re.compile(r"^([0...
"""empty message Revision ID: 4517f9cbe1f9 Revises: 42ef4a834d23 Create Date: 2016-04-13 22:34:37.727821 """ # revision identifiers, used by Alembic. revision = '4517f9cbe1f9' down_revision = '42ef4a834d23' from alembic import op import sqlalchemy as sa def upgrade(): ### commands auto generated by Alembic - ...
import json import asyncio import hashlib from http import HTTPStatus import aiohttp from waterbutler.core import streams from waterbutler.core import provider from waterbutler.core import exceptions from waterbutler.providers.figshare.path import FigsharePath from waterbutler.providers.figshare import metadata, set...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
""" Syndication feed generation library -- used for generating RSS, etc. Sample usage: >>> from django.utils import feedgenerator >>> feed = feedgenerator.Rss201rev2Feed( ... title="Poynter E-Media Tidbits", ... link="http://www.poynter.org/column.asp?id=31", ... description="A group Weblog by the sharpes...
# Copyright 2009-2014 Justin Riley # # This file is part of StarCluster. # # StarCluster is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by the Free # Software Foundation, either version 3 of the License, or (at your option) any # later ...
import urlparse from abc import ABCMeta, abstractmethod, abstractproperty item_types = ["testharness", "reftest", "manual", "stub", "wdspec"] def get_source_file(source_files, tests_root, manifest, path): def make_new(): from sourcefile import SourceFile return SourceFile(tests_root, path, manife...
""" Module that tracks analytics events by sending them to different configurable backends. The backends can be configured using Django settings as the example below:: TRACKING_BACKENDS = { 'tracker_name': { 'ENGINE': 'class.name.for.backend', 'OPTIONS': { 'host': ... , ...