text
stringlengths
475
200k
from __future__ import unicode_literals from .common import InfoExtractor from .youtube import YoutubeIE class WimpIE(InfoExtractor): _VALID_URL = r'http://(?:www\.)?wimp\.com/(?P<id>[^/]+)/' _TESTS = [{ 'url': 'http://www.wimp.com/maruexhausted/', 'md5': 'ee21217ffd66d058e8b16be340b74883', ...
#!/usr/bin/env python """ Spacewalk external inventory script ================================= Ansible has a feature where instead of reading from /etc/ansible/hosts as a text file, it can query external programs to obtain the list of hosts, groups the hosts are in, and even variables to assign to each host. To use...
from django.contrib import messages as msg from django.core.exceptions import PermissionDenied from django.http import HttpResponseRedirect from django.utils.translation import ugettext as _ from django.views.generic.detail import SingleObjectMixin from django.views.generic.edit import FormView, ProcessFormView from n...
from functools import wraps, update_wrapper from unittest import TestCase import warnings from django.contrib.admin.views.decorators import staff_member_required from django.contrib.auth.decorators import login_required, permission_required, user_passes_test from django.http import HttpResponse, HttpRequest, HttpRespo...
# Copyright (c) 2014 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 agreed to ...
"""Feeds for documents""" import datetime import json from django.conf import settings from django.db.models import F from django.contrib.syndication.views import Feed from django.utils.html import escape from django.utils.feedgenerator import (SyndicationFeed, Rss201rev2Feed, A...
# (c) 2016, Ansible by Red Hat <[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. #...
import copy import operator import warnings from functools import total_ordering, wraps from django.utils import six from django.utils.deprecation import RemovedInDjango20Warning # You can't trivially replace this with `functools.partial` because this binds # to classes and returns bound instances, whereas functools...
import datetime from blaze.compute.pyfunc import symbol, lambdify, cos, math, broadcast from blaze.compute.pyfunc import _print_python from blaze.expr.broadcast import broadcast_collect t = symbol('t', '{x: int, y: int, z: int, when: datetime}') def test_simple(): f = lambdify([t], t.x + t.y) assert f((1, ...
from browser import document as doc from browser.html import * trans_menu = { 'menu_console':{'en':'Console','es':'Consola','fr':'Console', 'pt':'Console'}, 'menu_editor':{'en':'Editor','es':'Editor','fr':'Editeur', 'pt':'Editor'}, 'menu_gallery':{'en':'Gallery','es':'Galería','fr':'Galerie', 'pt':'Galeri...
import re import os import base64 try: # Python 3 from urllib.parse import urlencode except (ImportError): # Python 2 from urllib import urlencode from .json_api_client import JSONApiClient from ..downloaders.downloader_exception import DownloaderException # Used to map file extensions to formats _r...
from django.core.management.base import BaseCommand, CommandError from django.db import DEFAULT_DB_ALIAS, connections from django.db.migrations.executor import MigrationExecutor from django.db.migrations.loader import AmbiguityError class Command(BaseCommand): help = "Prints the SQL statements for the named migra...
# # 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...
""" Functions to display an error (error, warning or information) message. """ from lib.hachoir_core.log import log from lib.hachoir_core.tools import makePrintable import sys, traceback def getBacktrace(empty="Empty backtrace."): """ Try to get backtrace as string. Returns "Error while trying to get back...
""" These are tests for disabling and enabling student accounts, and for making sure that students with disabled accounts are unable to access the courseware. """ import unittest from student.tests.factories import UserFactory, UserStandingFactory from student.models import UserStanding from django.conf import setting...
# ex:ts=4:sw=4:sts=4:et # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- # # Copyright (C) 2006 - 2007 Michael 'Mickey' Lauer # Copyright (C) 2006 - 2007 Richard Purdie # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License versi...
#!/usr/bin/env python import os import shutil import glob import time import sys import subprocess import string from optparse import OptionParser, make_option SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) PKG_NAME = os.path.basename(SCRIPT_DIR) PARAMETERS = None #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=...
# testing/warnings.py # Copyright (C) 2005-2014 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php from __future__ import absolute_import import warnings from .. import exc as sa...
#!/usr/bin/env python # Written by [EMAIL] # 2014-04-29 import json import os import sys from pprint import pprint import commands paramList = sys.argv if len(paramList) <= 1: print "USAGE " + paramList[0] + " <ELB name>" sys.exit(2) elbName = paramList[1] cmd = "/usr/local/bin/aws --profile nagiosro elb d...
# Copyright (C) 2012-2020 Ben Kurtovic <[EMAIL]> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, ...
# # 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 # notice, this list of ...
# Copyright 2020 gRPC 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 applicable law or agreed to in writing...
#!/usr/bin/env python3 # # Copyright 2015 Signal Processing Devices Sweden AB. All rights reserved. # # Description: ADQ14 FWDAQ streaming example # Documentation: # import numpy as np import ctypes as ct import matplotlib.pyplot as plt import sys import time import os sys.path.insert(1, os.path.dirname(os.path.re...
""" Test the views served by third_party_auth. """ import ddt from lxml import etree from onelogin.saml2.errors import OneLogin_Saml2_Error import unittest from django.conf import settings from .testutil import AUTH_FEATURE_ENABLED, SAMLTestCase # Define some XML namespaces: from third_party_auth.tasks import SAML_...
"""A setuptools based setup module. See: https://packaging.python.org/en/latest/distributing.html https://github.com/pypa/sampleproject """ # To use a consistent encoding from codecs import open from os import path # Always prefer setuptools over distutils from setuptools import setup, find_packages here = path.abs...
# Copyright 2010 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 or agreed to ...
# Copyright (c) 2010 Cloud.com, Inc # Copyright 2012 Cloudbase Solutions Srl / Pedro Navarro Perez # 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 # # ...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import os, traceback, glob, threading import datetime as dt import numpy as np from . import printutil as pu DEFAULTVECTOR_DIR = os.path.expanduser('~/workspace/img-buff/motions/vector') MACROSQURE = 16 # 人間が...
from __future__ import unicode_literals import datetime from django.forms import TimeField, ValidationError from django.test import SimpleTestCase from . import FormFieldAssertionsMixin class TimeFieldTest(FormFieldAssertionsMixin, SimpleTestCase): def test_timefield_1(self): f = TimeField() s...
# Glumol - An adventure game creator # Copyright (C) 1998-2008 Sylvain Baubeau & Alexis Contour # This file is part of Glumol. # Glumol 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 th...
#!/usr/bin/env python3 import csv import os import multiprocessing import multiprocessing.pool import sys import tempfile import traceback import threading import gi gi.require_version('Gdk', '3.0') gi.require_version('PangoCairo', '1.0') gi.require_version('Poppler', '0.18') from paperwork_backend import config fro...
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2002-2006 Donald N. Allingham # Copyright (C) 2007 Brian G. Matherly # # 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; ...
""" Define the SeriesGroupBy and DataFrameGroupBy classes that hold the groupby interfaces (and some implementations). These are user facing as the result of the ``df.groupby(...)`` operations, which here returns a DataFrameGroupBy object. """ from collections import OrderedDict, abc, namedtuple import copy import fun...
#!/usr/bin/env python # Copyright 2012 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required ...
"""Fix incompatible renames Fixes: * sys.maxint -> sys.maxsize """ # Author: Christian Heimes # based on Collin Winter's fix_import # Local imports from .. import fixer_base from ..fixer_util import Name, attr_chain MAPPING = {"sys": {"maxint" : "maxsize"}, } LOOKUP = {} def alternates(members): re...
#!/usr/bin/env python # # Copyright 2008, 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...
# Copyright (C) 2011 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the ...
#!/usr/bin/env python from PySide import QtGui, QtCore from PySide.QtCore import Qt, QEventLoop, QEvent, QObject from juma.core import * from juma.core.ModelManager import * from juma.qt.helpers import addWidgetWithLayout, restrainWidgetToScreen from juma.qt.IconCache import getIcon from ui.array_view_container...
# Python stubs generated by omniidl from ../idl/EventChannelAdmin.idl import omniORB, _omnipy from omniORB import CORBA, PortableServer _0_CORBA = CORBA _omnipy.checkVersion(2,0, __file__) # #include "CosNaming.idl" import CosNaming_idl _0_CosNaming = omniORB.openModule("CosNaming") _0_CosNaming__POA = omniORB.openM...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2014-2017 Vincent Noel ([EMAIL]) # # This file is part of libSigNetSim. # # libSigNetSim 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/env python # Copyright (c) 2009 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Verify the settings that cause a set of programs to be created in a specific build directory, and that no intermediate built files get c...
#!/usr/bin/env python from __future__ import division import sys; sys.path.insert(1, "../..") import h2o from tests import pyunit_utils def test_load_sparse(): try: import scipy.sparse as sp except ImportError: return A = sp.csr_matrix([[1, 2, 0, 5.5], [0, 0, 3, 6.7], [4, 0, 5, 0]]) f...
import uuid from datetime import datetime import hmac from base64 import b64encode from django.conf import settings from django.utils import timezone from zeep import Client, xsd from agir.payments.models import Subscription from agir.system_pay import SystemPayError from agir.system_pay.utils import get_recurrence_r...
""" Base IO code for all datasets """ # Copyright (c) 2007 David Cournapeau <[EMAIL]> # 2010 Fabian Pedregosa <[EMAIL]> # 2010 Olivier Grisel <[EMAIL]> # License: BSD 3 clause import os import csv import shutil from os import environ from os.path import dirname from os.path import join fro...
#!/usr/bin/env python3 import os import re import math import json import yaml import numpy as np import tensorflow as tf from . import dataset def test(sess, network, mesh_type, mesh_size, model_dir, input_path, output_path): # Initialise global variables ...
#!/usr/bin/python #coding=utf-8 import sys import os import utils from core.common import GlobalVar from config_nginx import generate_config_file def copy_file(opts, src_file, ip, dst): try: os.system("sshpass -p %s scp -r %s %s %s@%s:%s" % (opts.pwd, " ".join(utils.ssh_args()), src_file, opts.user, ip, ds...
# -.- coding: utf-8 -.- # Copyright © 2009 Markus Korn <[EMAIL]> # Copyright © 2010 Laszlo Pandy <[EMAIL]> # Copyright © 2011 Michal Hruby <[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 Founda...
# data fixing script # # as you can imagine, the data entries may contain some semi-correct # values, which we need to adapt. this is done in this file. def fix_data(data): """ updates given input with modifications. input: empiresdat object, vanilla, fully read. output: empiresdat object, fixed. ...
#!/usr/bin/python # Main library file containing all the protocol generation logic. def generate_main_code(type, main_header_file, resolver_cc_file, metrics_header_file, input_files): """ Main code generator. Takes input files and processes them into structures representing a Kafka message (request or respo...
# -*- coding: utf-8 -*- import os import base64 import logging import pymongo from modularodm import fields from framework.auth import Auth from website.addons.base import exceptions from website.addons.base import AddonUserSettingsBase, AddonNodeSettingsBase, GuidFile from website.addons.base import StorageAddonBas...
# 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...
import gi gi.require_version('Gtk', '3.0') from gi.repository import Gtk from collections import OrderedDict GRID_MARGIN = 5 ICON_SIZE = Gtk.IconSize.MENU class ModifyGrid(Gtk.Grid): def __init__(self): Gtk.Grid.__init__(self) self.generate_labels() self.generate_entries() self.at...
# -*- coding: utf-8 -*- """ file: keyIO.py Description: an IO module for CoNLL-formatted files when column identifiers are available. author: Yoann Dupont MIT License Copyright (c) 2018 Yoann Dupont Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated docume...
import json from django.contrib.postgres import forms, lookups from django.contrib.postgres.fields.array import ArrayField from django.core import exceptions from django.db.models import Field, TextField, Transform from django.utils import six from django.utils.translation import ugettext_lazy as _ __all__ = ['HStore...
import functools from django.core.exceptions import PermissionDenied from olympia.access.acl import action_allowed from olympia.amo.decorators import login_required def admin_required(reviewers=False, theme_reviewers=False): """ Admin, or someone with AdminTools:View, required. If reviewers=True ...
# valueIterationAgents.py # ----------------------- # Licensing Information: Please do not distribute or publish solutions to this # project. You are free to use and extend these projects for educational # purposes. The Pacman AI projects were developed at UC Berkeley, primarily by # John DeNero ([EMAIL]) and Dan Klein...
import json import base64 import io import logging import posixpath import stat import tarfile import zipfile from pymisp import MISPEvent, MISPObject, MISPAttribute from pymisp.tools import make_binary_objects from collections import OrderedDict log = logging.getLogger(__name__) misperrors = {'error': 'Error'} modu...
from __future__ import unicode_literals from django.db.transaction import atomic class Migration(object): """ The base class for all migrations. Migration files will import this from django.db.migrations.Migration and subclass it as a class called Migration. It will have one or more of the follow...
# -*- 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 __future__ import with_statement import sys from setuptools import setup, find_packages from setuptools.command.test import test as TestCommand from pyoos import __version__ def readme(): with open('README.md') as f: return f.read() reqs = [line.strip() for line in open('requirements.txt')] class ...
# Copyright 2014 Rackspace Inc. # # Author: Tim Simmons <[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 ap...
# (c) 2015, 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 your option) any later version. # # Ansi...
# encoding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( ExtractorError, int_or_none, qualities, parse_duration, ) class NDRBaseIE(InfoExtractor): def _real_extract(self, url): mobj = re.match(self._VALID_URL, url) ...
#!/usr/bin/env python # coding=utf-8 from sacred.utils import iter_prefixes, join_paths class ConfigSummary(dict): def __init__( self, added=(), modified=(), typechanged=(), ignored_fallbacks=(), docs=() ): super().__init__() self.added = set(added) self.modified = set(modifie...
########################################################################## # # Copyright (c) 2011-2012, John Haddon. All rights reserved. # Copyright (c) 2013-2014, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted prov...
############################################################################### # # Tests for XlsxWriter. # # Copyright (c), 2013-2015, John McNamara, [EMAIL] # from ..excel_comparsion_test import ExcelComparisonTest from datetime import datetime from ...workbook import Workbook class TestCompareXLSXFiles(ExcelCompa...
########################################################################## # # Copyright (c) 2013, Image Engine Design 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: # # * Redistrib...
""" ============ Data Browser ============ """ import numpy as np import matplotlib.pyplot as plt # nodebox section if __name__ == '__builtin__': # were in nodebox import os import tempfile W = 800 inset = 20 size(W, 600) plt.cla() plt.clf() plt.close('all') def tempimage(): ...
from __future__ import absolute_import from __future__ import print_function from django.core.management.base import BaseCommand from zerver.lib.actions import do_create_stream from zerver.models import Realm, get_realm import sys class Command(BaseCommand): help = """Create a stream, and subscribe all active u...
# Copyright (c) 2009 Bea Lam. All rights reserved. # # This file is part of LightBlue. # # LightBlue 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 l...
# -*- encoding: 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 t...
# CREATED:2014-03-07 by Justin Salamon <[EMAIL]> ''' Melody extraction algorithms aim to produce a sequence of frequency values corresponding to the pitch of the dominant melody from a musical recording. For evaluation, an estimated pitch series is evaluated against a reference based on whether the voicing (melody pre...
"""Actions to run at server startup. """ from django.db import connection from django.db import transaction def run(): """Call this from manage.py or tests. """ _add_custom_mult_agg_function() def _add_custom_mult_agg_function(): """Make sure the Postgresql database has a custom function array_agg_...
# Based on local.py (c) 2012, Michael DeHaan <[EMAIL]> # and chroot.py (c) 2013, Maykel Moya <[EMAIL]> # (c) 2013, Michael Scherer <[EMAIL]> # (c) 2015, Toshio Kuratomi <[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 Gene...
import unittest, random, sys, time sys.path.extend(['.','..','../..','py']) import h2o, h2o_cmd, h2o_rf, h2o_import as h2i, h2o_util paramDict = { # 2 new 'destination_key': ['model_keyA', '012345', '__hello'], 'cols': [None, None, None, None, None, '0,1,2,3,4,5,6,7,8','C1,C2,C3,C4,C5,C6,C7,C8'], # exc...
# coding: utf-8 # (c) 2015, Toshio Kuratomi <[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 lat...
#!/usr/bin/env python # - * - coding: UTF-8 - * - """ This script generates tests text-emphasis-position-property-001 ~ 006 which cover all possible values of text-emphasis-position property with all combination of three main writing modes and two orientations. Only test files are generated by this script. It also out...
# Copyright (c) 2015 Huawei Technologies Co., Ltd. # # 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 applic...
for a, b, c in b: pass else: 1/0 for : keyword.control.flow.python, source.python : source.python a : source.python , : punctuation.separator.element.python, source.python : source.python b : source.python , : punctuation.s...
import numpy as np from tools.metadata import get_hero_dict import operator import pandas as pd import plotly.graph_objs as go import plotly.plotly as py def winrate_statistics(dataset_df, mmr_info): x_data, y_data = dataset_df wins = np.zeros(114) games = np.zeros(114) winrate = np.zeros(114) ...
#!/usr/bin/env python # # Copyright 2016 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requir...
from __future__ import absolute_import import abc class MinHashIndexBackendTestMixin(object): __meta__ = abc.ABCMeta @abc.abstractproperty def index(self): pass def test_basic(self): self.index.record("example", "1", [("index", "hello world")]) self.index.record("example", "...
#!/usr/bin/env python # Jeans.py # Jeans Foundation #4 # Designer: Helen Joseph-Armstrong # PatternMaker: Susan Spencer Conklin # # This pattern contains a design for a pair of jeans from tmtpl.constants import * from tmtpl.pattern import * from tmtpl.document import * from tmtpl.client import Client #Project specifi...
""" Functions for acting on a axis of an array. """ from __future__ import division, print_function, absolute_import import numpy as np def axis_slice(a, start=None, stop=None, step=None, axis=-1): """Take a slice along axis 'axis' from 'a'. Parameters ---------- a : numpy.ndarray The array ...
# Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
db1 = {"Database": {"Raynor": { "Raynor-Counter": ["Tracer", "Uther", "Zeratul"], "Raynor-Synergize": ["Who", "It" , "is"] }, "Stitches" : { "Stiches-Counter": ["What", "ever", "it",], "Stiches-Synergize":["What", "name", "is"] } } } d...
from __future__ import unicode_literals from datetime import datetime from django.test import TestCase from .models import Article, Category class M2MMultipleTests(TestCase): def test_multiple(self): c1, c2, c3, c4 = [ Category.objects.create(name=name) for name in ["Sports", "N...
# Copyright (C) 2018 PrivacyScore Contributors # # 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 program is dis...
# -*- coding: utf-8 -*- import json from binascii import b2a_hex from beaker.crypto.pbkdf2 import pbkdf2 from pyload.core.network.request_factory import get_url from ..base.account import BaseAccount class PBKDF2: def __init__(self, passphrase, salt, iterations=1000): self.passphrase = passphrase ...
# Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
from __future__ import absolute_import from collections import defaultdict import functools import itertools import logging import os from pip._vendor import pkg_resources from pip._vendor import requests from pip.download import (url_to_path, unpack_url) from pip.exceptions import (InstallationError, BestVersionAlr...
# -*- coding: utf-8 -*- # deconvolution.py --- Image deconvolution """Implementations restoration functions""" from __future__ import division import numpy as np import numpy.random as npr from scipy.signal import convolve2d from . import uft __keywords__ = "restoration, image, deconvolution" def wiener(image, p...
""" Script for importing courseware from git/xml into a mongo modulestore """ import os import re import StringIO import subprocess import logging from django.core import management from django.core.management.base import BaseCommand, CommandError from django.utils.translation import ugettext as _ import dashboard.g...
#!/usr/bin/env python """buildpkg.py -- Build OS X packages for Apple's Installer.app. This is an experimental command-line tool for building packages to be installed with the Mac OS X Installer.app application. It is much inspired by Apple's GUI tool called PackageMaker.app, that seems to be part of the OS X develo...
# # Copyright 2014 Quantopian, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wr...
#!/usr/bin/python # -*- coding: utf-8 -*- # # 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. ...
"""Cryptlib AES implementation.""" from cryptomath import * from AES import * if cryptlibpyLoaded: def new(key, mode, IV): return Cryptlib_AES(key, mode, IV) class Cryptlib_AES(AES): def __init__(self, key, mode, IV): AES.__init__(self, key, mode, IV, "cryptlib") sel...
# $Id: parts.py 6385 2010-08-13 12:17:01Z milde $ # Authors: David Goodger <[EMAIL]>; Dmitry Jemerov # Copyright: This module has been placed in the public domain. """ Directives for document parts. """ __docformat__ = 'reStructuredText' from docutils import nodes, languages from docutils.transforms import parts fro...
# -*- 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...
from lib.common import helpers class Module: def __init__(self, mainMenu, params=[]): # metadata info about the module, not modified during runtime self.info = { # name for the module that will appear in module menus 'Name': 'Port Scanner.', # list of one or m...