text
stringlengths
475
200k
from flask import Blueprint, current_app, request, session as cookie_session from flask_themes2 import render_theme_template from structlog import get_logger from app.globals import get_session_store from app.utilities.schema import load_schema_from_session_data from app.utilities.cookies import analytics_allowed log...
# Copyright The Cloud Custodian Authors. # SPDX-License-Identifier: Apache-2.0 from .common import BaseTest, functional import base64 import os import json import time import tempfile import zlib from c7n.exceptions import PolicyValidationError class NotifyTest(BaseTest): @functional def test_notify_addres...
# ##### BEGIN GPL LICENSE BLOCK ##### # # 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 distrib...
"""Poll module is ungraded xmodule used by students to to do set of polls. On the client side we show: If student does not yet anwered - Question with set of choices. If student have answered - Question with statistics for each answers. """ import cgi import json import logging from copy import deepcopy from collecti...
# Practicing Dynamic Programming (DP) with the log cutting problem given on the practice midterm. import numpy as np ################################################################################ # Slow Algorithm ################################################################################ def cut_log...
#!/usr/bin/env python # summarize the sql-bench trace file import sys import re import os.path class testreports: def __init__(self): self.reports = [] def append(self, report): self.reports.append(report) def duration(self, start, stop): t0 = os.popen('date -d"' + start + '" +%...
# Copyright (C) 2014 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...
# Xlib.ext.record -- RECORD extension module # # Copyright (C) 2006 Alex Badea <[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 Foundation; either version 2 of the License, or # (a...
# Copyright 2012, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
############################################################################### ## ## Copyright 2011,2012 Tavendo GmbH ## ## 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:...
# Copyright 2019 Fortinet, 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 3 of the License, or # (at your option) any later version. # # This program is distributed in the...
# Copyright 2017 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...
# Author: Ovidiu Predescu # Date: July 2011 # # 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 ...
# Copyright 2011, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
import os import sys import inspect import core.plugin def load_plugins(dir, instantiate = False, shell = None): plugins = {} for root, dirs, files in os.walk(dir): sys.path.append(root) # make forward slashes on windows module_root = root.replace(dir, "").replace("\\", "/") ...
from django.conf import settings from django.http import HttpResponseForbidden from django.template import Context, Engine, TemplateDoesNotExist, loader from django.utils.translation import ugettext as _ from django.utils.version import get_docs_version # We include the template inline since we need to be able to reli...
# pylint: disable=C0301 import decimal from django.core import mail from django.test import TestCase from mock import patch from ..models import Customer from ..utils import get_user_model class EmailReceiptTest(TestCase): def setUp(self): User = get_user_model() self.user = User.objects.creat...
# Copyright 2020 The StackStorm Authors. # Copyright 2019 Extreme Networks, 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 ...
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2016 Compassion CH (http://www.compassion.ch) # Releasing children from poverty in Jesus' name # @author: Emanuel Cino <[EMAIL]> # # The licence is in the file __manifest__.py # #########...
import os import shutil import tempfile from importlib import import_module from django import conf from django.contrib import admin from django.test import SimpleTestCase, override_settings from django.test.utils import extend_sys_path from django.utils import autoreload from django.utils._os import npath LOCALE_PAT...
from __future__ import absolute_import import os import time from . import (LockBase, NotLocked, NotMyLock, LockTimeout, AlreadyLocked) class SymlinkLockFile(LockBase): """Lock access to a file using symlink(2).""" def __init__(self, path, threaded=True, timeout=None): # super(Symlin...
import re import os def run(): sourceDirectory = "../lib/OpenLayers" allFiles = [] SUFFIX_JAVASCRIPT = ".js" ## Find all the Javascript source files for root, dirs, files in os.walk(sourceDirectory): for filename in files: if filename.endswith(SUFFIX_JAVASCRIPT) and not f...
# -*- coding: utf-8 -*- """Tests for the 'the' plugin""" from __future__ import division, absolute_import, print_function import unittest from test import _common from beets import config from beetsplug.the import ThePlugin, PATTERN_A, PATTERN_THE, FORMAT class ThePluginTest(_common.TestCase): def test_unthe_...
# coding=utf-8 r""" This code was generated by \ / _ _ _| _ _ | (_)\/(_)(_|\/| |(/_ v1.0.0 / / """ from twilio.base import deserialize from twilio.base import serialize from twilio.base import values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import...
"""Webhooks for external integrations.""" import logging from typing import Any, Dict, List from django.http import HttpRequest, HttpResponse from django.utils.translation import ugettext as _ from zerver.decorator import authenticated_rest_api_view from zerver.lib.email_notifications import convert_html_to_markdown ...
from __future__ import print_function import logging import usi.api.systemc as api # Renaming time constants for easy reuse FS = api.SC_FS PS = api.SC_PS NS = api.SC_NS US = api.SC_US MS = api.SC_MS SEC = api.SC_SEC """Time constants units""" TIME_UNITS = { FS:"fs", PS:"ps", NS:"ns", US:"us", MS:"...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Copyright 2010-2012 Asidev s.r.l. 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 b...
# 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...
############################################################################### # # Tests for XlsxWriter. # # Copyright (c), 2013-2015, John McNamara, [EMAIL] # from ..excel_comparsion_test import ExcelComparisonTest from ...workbook import Workbook class TestCompareXLSXFiles(ExcelComparisonTest): """ Test f...
from django.template.smartif import IfParser from django.utils import unittest class SmartIfTests(unittest.TestCase): def assertCalcEqual(self, expected, tokens): self.assertEqual(expected, IfParser(tokens).parse().eval({})) # We only test things here that are difficult to test elsewhere # Many o...
#!/usr/bin/env python # -*- coding: utf-8 -*- """Invoke tasks. To run a task, run ``$ invoke <COMMAND>``. To see a list of commands, run ``$ invoke --list``. """ import os import sys import code import platform import subprocess import logging from invoke import task, run from website import settings logging.getLogg...
from redis import StrictRedis class MetadataBase(object): def __init__(self, key_base=None, **kwargs): self.r = StrictRedis(**kwargs) self.key_base = key_base or 'ufyr:%s' ##Should probably be subclassed self._get_meta_key = lambda x: self.key_base%x self._error_key = self...
# -*- coding: utf-8 -*- import base64 import datetime import dateutil.relativedelta as relativedelta import logging import lxml import urlparse import openerp from urllib import urlencode, quote as quote from openerp import _, api, fields, models, SUPERUSER_ID from openerp import tools from openerp import report as o...
# coding: utf8 { '!langcode!': 'sk', '!langname!': 'Slovenský', '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" je voliteľný výraz ako "field1=\'newvalue\'". Nemôžete upravovať alebo zmazať výsledky JOINu', '%s %%{row} deleted': '%s zmazaných...
# Copyright 2020 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, ...
'''in-memory mavlink log''' from pymavlink import mavutil class mavmemlog(mavutil.mavfile): '''a MAVLink log in memory. This allows loading a log into memory to make it easier to do multiple sweeps over a log''' def __init__(self, mav, progress_callback=None): mavutil.mavfile.__init__(self, None, ...
#!/usr/bin/env python # Copyright (c) 2013 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. """ Make sure msvs_application_type_revision works correctly. """ import TestGyp import os import sys import struct CHDIR = 'winrt-app-ty...
""" Tcpdump parser Source: * libpcap source code (file savefile.c) * RFC 791 (IPv4) * RFC 792 (ICMP) * RFC 793 (TCP) * RFC 1122 (Requirements for Internet Hosts) Author: Victor Stinner Creation: 23 march 2006 """ from lib.hachoir_parser import Parser from lib.hachoir_core.field import (FieldSet, ParserError, ...
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function import re import xml.etree.ElementTree as ElementTree from svg2code.svg_colors import SVG_COLORS from svg2code.helpers import parseSVGNumber as parseNumber from os import path class RGBAColor(object): """rgba color format: [0...
""" Python Character Mapping Codec mac_romanian generated from 'MAPPINGS/VENDORS/APPLE/ROMANIAN.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,inp...
try: import cPickle as pickle except ImportError: import pickle from django.conf import settings from django.utils.hashcompat import md5_constructor from django.forms import BooleanField def security_hash(request, form, *args): """ Calculates a security hash for the given Form instance. This crea...
#!/usr/bin/python # Copyright: (c) 2020, Your Name <[EMAIL]> # 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 DOCUMENTATION = r''' --- module: my_test_info short_description: This is my...
''' The Discretized model, or the sun model. ''' from numpy import * from scipy import sparse as sps import pdb __all__=['DiscModel','load_discmodel'] class DiscModel(object): ''' Discrete model class. Construct: DiscModel((Elist_neg,Elist_pos),(Tlist_neg,Tlist_pos),z=1.) z could be one...
# Copyright 2010 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...
"""Tests for cleverhans.experimental.certification.dual_formulation.""" # pylint: disable=missing-docstring from __future__ import absolute_import from __future__ import division from __future__ import print_function import unittest import numpy as np import tensorflow as tf from cleverhans.experimental.certificatio...
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2009, 2010, 2011 CERN. ## ## Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (at yo...
import os from django.template import Context from django.template.engine import Engine from django.test import SimpleTestCase, ignore_warnings from django.utils.deprecation import RemovedInDjango110Warning from .utils import ROOT, TEMPLATE_DIR OTHER_DIR = os.path.join(ROOT, 'other_templates') @ignore_warnings(cat...
from pyasn1.type import univ from pyasn1.codec.cer import decoder from pyasn1.compat.octets import ints2octs, str2octs, null from pyasn1.error import PyAsn1Error from sys import version_info if version_info[0:2] < (2, 7) or \ version_info[0:2] in ( (3, 0), (3, 1) ): try: import unittest2 as unittest ...
from __future__ import unicode_literals from django.test import TestCase from .models import Article, Car, Driver, Reporter class ManyToOneNullTests(TestCase): def setUp(self): # Create a Reporter. self.r = Reporter(name='John Smith') self.r.save() # Create an Article. se...
# Cam gui init module # (c) 2003 Juergen Riegel # # Gathering all the information to start FreeCAD # This is the second one of three init scripts, the third one # runs when the gui is up #*************************************************************************** #* (c) Juergen Riegel ([EMAIL]) 2002 ...
from django.template import Library register = Library() def and_n_others(values, limit): # A helper for the commonly appended "and N other(s)" string, with # the appropriate pluralization. return " and %d other%s" % (len(values) - limit, "" if len(values) == limit + 1 else...
u""" Fixer for: (a,)* *b (,c)* [,] = s for (a,)* *b (,c)* [,] in d: ... """ from lib2to3 import fixer_base from itertools import count from lib2to3.fixer_util import (Assign, Comma, Call, Newline, Name, Number, token, syms, Node, Leaf) from libfuturize.fixer_util import indentation, sui...
import os, time from argparse import ArgumentParser import numpy as np from sklearn import svm, metrics from sklearn.model_selection import GridSearchCV from sklearn.model_selection import ShuffleSplit, GroupKFold from sklearn.datasets import load_svmlight_file from sklearn.externals import joblib from utilities import...
#!/usr/bin/python # Copyright (c) 2010-2011 OpenStack, 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...
""" This is a test of the chain FTSClient -> FTSManagerHandler -> FTSDB It supposes that the DB is present, and that the service is running """ from DIRAC.Core.Base.Script import parseCommandLine parseCommandLine() import unittest #import mock import uuid from DIRAC import gLogger from DIRAC.DataManagementS...
# Copyright (c) The PyAMF Project. # See LICENSE.txt for details. """ WSGI server implementation. The Python Web Server Gateway Interface (WSGI) is a simple and universal interface between web servers and web applications or frameworks. The WSGI interface has two sides: the "server" or "gateway" side, and the "appli...
import sys import os.path import numpy as np import numpy.linalg as la import math import warnings # Suppress UserWarning from external.transform module warnings.filterwarnings("ignore", module="external.transform", lineno=1833) from mesh.GLmesh import GLMesh import OpenGL.GL from OpenGL.GL import ( GL_ELEME...
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt # ERPNext - web based ERP (http://erpnext.com) # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe.utils import cstr, flt f...
'''A multi-producer, multi-consumer queue.''' try: import threading except ImportError: import dummy_threading as threading from collections import deque from heapq import heappush, heappop try: from time import monotonic as time except ImportError: from time import time __all__ = ['Empty', 'Full', 'Q...
""" Python 'utf-16' Codec Written by Marc-Andre Lemburg ([EMAIL]). (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. """ import codecs, sys ### Codec APIs encode = codecs.utf_16_encode def decode(input, errors='strict'): return codecs.utf_16_decode(input, errors, True) class Incremental...
# -*- coding: utf-8 -*- from __future__ import absolute_import import abc import lupa from splash.render_options import BadOption from splash.utils import truncated class ImmediateResult(object): def __init__(self, value): self.value = value class AsyncCommand(object): def __init__(self, id, name,...
# Copyright (c) 2010-2012 OpenStack, 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 ...
#============================================================================ # This library is free software; you can redistribute it and/or # modify it under the terms of version 2.1 of the GNU Lesser General Public # License as published by the Free Software Foundation. # # This library is distributed in the hope th...
#!/usr/bin/env python """Configuration parameters for the client.""" from grr.lib import config_lib from grr.lib import rdfvalue # General Client options. config_lib.DEFINE_string("Client.name", "GRR", "The name of the client. This will be used as a base " "name to g...
# Copyright 2015 Observable Networks # # 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 ...
#!/usr/bin/python import unittest import omniture import os creds = {} creds['username'] = os.environ['OMNITURE_USERNAME'] creds['secret'] = os.environ['OMNITURE_SECRET'] class ElementTest(unittest.TestCase): def setUp(self): fake_list = [{"id":"123","title":"ABC"},{"id":"456","title":"DEF"}] sel...
import networkx as nx import re import sys from sklearn.feature_extraction.text import CountVectorizer from sklearn.feature_extraction import text from nltk.stem.wordnet import WordNetLemmatizer import numpy as np from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.cluster import KMeans, MiniBatch...
__author__ = "Alexander Hewer" __email__ = "[EMAIL]" class ActionBuilder: def build_fit_action(self, coilPositions, timeStamp): action = self.__base_action("FIT") action["points"] = coilPositions action["timeStamp"] = timeStamp return action def build_fix_speaker_action(self)...
''' IDE: Eclipse (PyDev) Python version: 2.7 Operating system: Windows 8.1 @author: Emil Carlsson @copyright: 2015 Emil Carlsson @license: This program is distributed under the terms of the GNU General Public License ''' import Model import Tkinter as tk from Tkconstants import LEFT from PIL import ImageTk from tkFo...
# 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...
import unittest, time, sys sys.path.extend(['.','..','../..','py']) import h2o, h2o_cmd, h2o_rf # RF train parameters paramsTrainRF = { 'ntree' : 50, 'depth' : 30, 'bin_limit' : 10000, 'ignore' : 'AirTime,ArrDelay,DepDelay,CarrierDelay,IsArrDelayed', ...
#!/usr/bin/env python import os import sys import argparse import time def main(): progname = os.path.basename(sys.argv[0]) usage = progname + """ [options] <f.txt> Run p3movie.py to process movies listed in f.txt, and the movies will be deleted to save space. """ args_def = {'apix':1.25, 'voltage':200, 'time'...
import importlib import os import re import sys from django.db.migrations import operations from django.db.migrations.migration import Migration from django.db.models.loading import cache from django.utils import datetime_safe from django.utils.six.moves import input class MigrationAutodetector(object): """ ...
# -*- coding: utf-8 -*- """Influence and Outlier Measures Created on Sun Jan 29 11:16:09 2012 Author: Josef Perktold License: BSD-3 """ from collections import defaultdict import numpy as np from statsmodels.regression.linear_model import OLS from statsmodels.tools.decorators import cache_readonly #influence meas...
# -*- coding: utf-8 -*- # Generated by Django 1.11.9 on 2018-04-12 20:31 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('osf', '0094_update_preprintprovider_group_auth'), ] operations = [ migrations.RunSQ...
# # 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...
# card representation import re import random import utils import transforms from manalib import Manacost, Manatext # Some text prettification stuff that people may not have installed try: from titlecase import titlecase except ImportError: def titlecase(s): return s.title() try: import textwrap ...
#!/usr/bin/env python # This is a component of emc # Copyright 2007 Anders Wallin <[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 Foundation; either version 2 of the License...
"""SCons.Tool.GettextCommon module Used by several tools of `gettext` toolset. """ # Copyright (c) 2001 - 2015 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 the Software withou...
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, Michael DeHaan <[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 ...
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from telemetry.page import page as page_module from telemetry.page import page_set as page_set_module class MseCasesPage(page_module.Page): def __init__(...
# Copyright Iris contributors # # This file is part of Iris and is released under the LGPL license. # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """ Tests the high-level plotting interface. """ # import iris tests first so that some things can be initialised before impo...
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file '/mnt/debris/devel/repo/git/luma-fixes/resources/forms/PluginListWidgetDesign.ui' # # Created: Wed May 25 21:41:09 2011 # by: PyQt4 UI code generator 4.8.3 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCor...
# Copyright 2012-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 ...
from os import statvfs, uname import time from socket import socket import psutil import uuid import json import requests import subprocess from django.shortcuts import render, HttpResponse, get_object_or_404, redirect from django.http import JsonResponse, HttpResponseRedirect, StreamingHttpResponse, Http404 from docki...
#!/bin/sh # -*- mode: Python -*- # 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....
#!/usr/bin/env python import os import time import datetime import ConfigParser import dbus _FREMANTLE_ALARM = "Fremantle" _DIABLO_ALARM = "Diablo" _NO_ALARM = "None" try: import alarm ALARM_TYPE = _FREMANTLE_ALARM except (ImportError, OSError): try: import osso.alarmd as alarmd ALARM_TYPE = _DIABLO_ALARM ...
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. ...
# Copyright (c) 2011 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. """Command for scraping images from a URL or list of URLs. Prerequisites: 1. The command_line package from tools/site_compare 2. Either the IE BHO o...
#!/usr/bin/env python # Copyright 2009 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...
# ============================================================================= # JPEG Image Descriptor - BIG # This file is part of the FuzzLabs Fuzzing Framework # # Author: FuzzLabs # Date: 21/07/2015 # # Original file MD5 sum: 4dde17f30fee6e6120a58d890a4ec572 # Original file SHA1 sum: 1e1d1c90b4b0dd9ad5719be96...
# Generated by h2py from /usr/include/errno.h # Included from sys/errno.h # Included from standards.h __KBASE = 1000 __IRIXBASE = 1000 __FTNBASE = 4000 __FTNLAST = 5999 EPERM = 1 ENOENT = 2 ESRCH = 3 EINTR = 4 EIO = 5 ENXIO = 6 E2BIG = 7 ENOEXEC = 8 EBADF = 9 ECHILD = 10 EAGAIN = 11 ENOMEM = 12 EACCES = 13 EFAULT = 1...
import os import sys import imp import portage from portage.const import VDB_PATH from portage import _encodings from portage import _shell_quote from portage import _unicode_decode from portage import _unicode_encode # Stolen from the ebuild command def package_from_ebuild(ebuild): pf = None if ebuild.endsw...
from sympy.core.compatibility import range from sympy import S, symbols, Function from sympy.calculus.finite_diff import ( apply_finite_diff, finite_diff_weights, as_finite_diff ) def test_apply_finite_diff(): x, h = symbols('x h') f = Function('f') assert (apply_finite_diff(1, [x-h, x+h], [f(x-h), f(...
#!/usr/bin/env pmpython # # Copyright (C) 2014-2015 Red Hat. # # 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...
# -*- coding: utf-8 -*- import mock from nose.tools import eq_ import amo.tests from reviews import feeds from translations.models import Translation class FeedTest(amo.tests.TestCase): # Rub some unicode all over the reviews feed. def setUp(self): super(FeedTest, self).setUp() self.feed = f...
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
#!/usr/bin/env python """ exec_command Implements exec_command function that is (almost) equivalent to commands.getstatusoutput function but on NT, DOS systems the returned status is actually correct (though, the returned status values may be different by a factor). In addition, exec_command takes keyword arguments fo...
# urllib3/_collections.py # Copyright 2008-2012 Andrey Petrov and contributors (see CONTRIBUTORS.txt) # # This module is part of urllib3 and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php from collections import MutableMapping from threading import Lock try: # Python 2.7+ ...