repo_name stringlengths 5 100 | path stringlengths 4 294 | copies stringclasses 990
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
RJPercival/certificate-transparency | python/ct/crypto/asn1/tag.py | 35 | 4183 | """ASN.1 tagging."""
from ct.crypto import error
UNIVERSAL = 0x00
APPLICATION = 0x40
CONTEXT_SPECIFIC = 0x80
PRIVATE = 0xc0
PRIMITIVE = 0x00
CONSTRUCTED = 0x20
# Constants for better readability.
IMPLICIT, EXPLICIT = range(2)
class Tag(object):
"""An ASN.1 tag."""
_CLASS_MASK = 0xc0
_ENCODING_MASK = 0... | apache-2.0 |
cms-externals/openloops | scons-local/scons-local-2.3.0/SCons/Util.py | 11 | 49066 | """SCons.Util
Various utility functions go here.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Softwar... | gpl-3.0 |
kenshay/ImageScripter | Script_Runner/PYTHON/Lib/distutils/command/build_clib.py | 204 | 8022 | """distutils.command.build_clib
Implements the Distutils 'build_clib' command, to build a C/C++ library
that is included in the module distribution and needed by an extension
module."""
# XXX this module has *lots* of code ripped-off quite transparently from
# build_ext.py -- not surprisingly really, as the work req... | gpl-3.0 |
MalloyPower/parsing-python | front-end/testsuite-python-lib/Python-3.1/Lib/distutils/tests/test_util.py | 1 | 8506 | """Tests for distutils.util."""
# not covered yet:
# - byte_compile
#
import os
import sys
import unittest
from copy import copy
from distutils.errors import DistutilsPlatformError
from distutils.util import (get_platform, convert_path, change_root,
check_environ, split_quoted, strtobool... | mit |
nhenezi/kuma | vendor/packages/translate-toolkit/translate/storage/placeables/__init__.py | 10 | 2030 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2008-2009 Zuza Software Foundation
#
# This file is part of the Translate Toolkit.
#
# 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; e... | mpl-2.0 |
mancoast/CPythonPyc_test | fail/323_test_cmd_line.py | 1 | 14080 | # Tests invocation of the interpreter with various command line arguments
# Most tests are executed with environment variables ignored
# See test_cmd_line_script.py for testing of script execution
import test.support, unittest
import os
import sys
import subprocess
import tempfile
from test.script_helper import spawn_... | gpl-3.0 |
hyperized/ansible | lib/ansible/modules/storage/purestorage/purefb_snap.py | 38 | 6777 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Simon Dodsley (simon@purestorage.com)
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',... | gpl-3.0 |
BeDjango/intef-openedx | lms/djangoapps/verify_student/management/commands/set_software_secure_status.py | 63 | 2223 | """
Manually set Software Secure verification status.
"""
import sys
from django.core.management.base import BaseCommand
from lms.djangoapps.verify_student.models import (
SoftwareSecurePhotoVerification, VerificationCheckpoint, VerificationStatus
)
class Command(BaseCommand):
"""
Command to trigger the... | agpl-3.0 |
google-code-export/django-hotclub | apps/core_apps/tag_app/views.py | 2 | 1919 | from django.shortcuts import render_to_response, get_object_or_404
from django.template import RequestContext
from blog.models import Post
from tagging.models import Tag, TaggedItem
from photos.models import Photos
from bookmarks.models import BookmarkInstance
from projects.models import Project, Task
from projects.mo... | mit |
Dineshs91/youtube-dl | youtube_dl/extractor/ndr.py | 74 | 4573 | # 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)
... | unlicense |
hexlism/css_platform | sleepypuppy/__init__.py | 15 | 6243 | from logging import Formatter
from logging.handlers import RotatingFileHandler
from flask import Flask, redirect, request, abort, send_from_directory
from flask.ext import login
from flask.ext.bcrypt import Bcrypt
from flask.ext.restful import Api
from flask.ext.admin import Admin
from flask.ext.mail import Mail
from f... | apache-2.0 |
pambot/SMSBeds | lib/markupsafe/__init__.py | 701 | 10338 | # -*- coding: utf-8 -*-
"""
markupsafe
~~~~~~~~~~
Implements a Markup string.
:copyright: (c) 2010 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import re
import string
from collections import Mapping
from markupsafe._compat import text_type, string_types, int_types, \
u... | gpl-2.0 |
numenta/nupic.research | tests/unit/frameworks/dendrites/routing_test.py | 3 | 2900 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2020, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | agpl-3.0 |
jamespcole/home-assistant | homeassistant/helpers/system_info.py | 11 | 1220 | """Helper to gather system info."""
import os
import platform
from typing import Dict
from homeassistant.const import __version__ as current_version
from homeassistant.loader import bind_hass
from homeassistant.util.package import is_virtual_env
from .typing import HomeAssistantType
@bind_hass
async def async_get_sy... | apache-2.0 |
Endika/OpenUpgrade | addons/sale_stock/sale_stock.py | 8 | 27378 | # -*- 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... | agpl-3.0 |
rvalyi/OpenUpgrade | addons/point_of_sale/report/pos_order_report.py | 46 | 4005 | # -*- 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... | agpl-3.0 |
hgl888/chromium-crosswalk-efl | build/win/install-build-deps.py | 153 | 1463 | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import shutil
import sys
import os
def patch_msbuild():
"""VS2010 MSBuild has a ULDI bug that we patch here. See http://goo.gl/P... | bsd-3-clause |
spacecowboy/gensim | gensim/models/word2vec.py | 10 | 71322 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Radim Rehurek <me@radimrehurek.com>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
Deep learning via word2vec's "skip-gram and CBOW models", using either
hierarchical softmax or negative sampling [1]_ [2]_.
The train... | gpl-3.0 |
cloud9ers/gurumate | environment/lib/python2.7/site-packages/MySQL_python-1.2.4c1-py2.7-linux-x86_64.egg/_mysql_exceptions.py | 99 | 2352 | """_mysql_exceptions: Exception classes for _mysql and MySQLdb.
These classes are dictated by the DB API v2.0:
http://www.python.org/topics/database/DatabaseAPI-2.0.html
"""
try:
from exceptions import Exception, StandardError, Warning
except ImportError:
# Python 3
StandardError = Exception
class ... | lgpl-3.0 |
BrainTech/openbci | obci/logic/experiment_builder/imbir/kamil_oddball/kamil_consts.py | 1 | 1944 | #name of a file with words in format: every column for one group
RAW_WORDS_FILE='raw_words.csv'
#to-be-created-every-time file with experiment words with rows:
#group, word, fixation time
WORDS_FILE='words.csv'
#if true then it is assumed that there is word.csv file and itll be used
USE_EXISTING_WORDS_FILE = Fa... | gpl-3.0 |
sam-tsai/django | django/contrib/gis/gdal/prototypes/ds.py | 349 | 4403 | """
This module houses the ctypes function prototypes for OGR DataSource
related data structures. OGR_Dr_*, OGR_DS_*, OGR_L_*, OGR_F_*,
OGR_Fld_* routines are relevant here.
"""
from ctypes import POINTER, c_char_p, c_double, c_int, c_long, c_void_p
from django.contrib.gis.gdal.envelope import OGREnvelope
from djan... | bsd-3-clause |
qenter/vlc-android | toolchains/arm/lib/python2.7/bsddb/test/test_dbenv.py | 68 | 19274 | import unittest
import os, glob
from test_all import db, test_support, get_new_environment_path, \
get_new_database_path
#----------------------------------------------------------------------
class DBEnv(unittest.TestCase):
def setUp(self):
self.homeDir = get_new_environment_path()
self.... | gpl-2.0 |
jcoady9/youtube-dl | youtube_dl/extractor/macgamestore.py | 142 | 1275 | from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import ExtractorError
class MacGameStoreIE(InfoExtractor):
IE_NAME = 'macgamestore'
IE_DESC = 'MacGameStore trailers'
_VALID_URL = r'https?://www\.macgamestore\.com/mediaviewer\.php\?trailer=(?P<id>\d+)'
_TEST = {... | unlicense |
webmull/phantomjs | src/breakpad/src/tools/gyp/pylib/gyp/input.py | 137 | 84791 | #!/usr/bin/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.
from compiler.ast import Const
from compiler.ast import Dict
from compiler.ast import Discard
from compiler.ast import List
from compiler.ast im... | bsd-3-clause |
40223105/2015cd_midterm | static/Brython3.1.1-20150328-091302/Lib/markdown2.py | 669 | 8143 | import browser.html
import re
class URL:
def __init__(self,src):
elts = src.split(maxsplit=1)
self.href = elts[0]
self.alt = ''
if len(elts)==2:
alt = elts[1]
if alt[0]=='"' and alt[-1]=='"':self.alt=alt[1:-1]
elif alt[0]=="'" and alt[-1]=="'":sel... | gpl-3.0 |
YongMan/Xen-4.3.1 | tools/python/xen/xm/main.py | 20 | 129659 | # (C) Copyright IBM Corp. 2005
# Copyright (C) 2004 Mike Wray
# Copyright (c) 2005-2006 XenSource Ltd.
#
# Authors:
# Sean Dague <sean at dague dot net>
# Mike Wray <mike dot wray at hp dot com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of version 2.1 of the G... | gpl-2.0 |
kyoshino/bedrock | bedrock/releasenotes/utils.py | 10 | 1271 | from django.conf import settings
from django.core.cache import caches
from memoize import Memoizer
from bedrock.utils.git import GitRepo
def get_data_version():
"""Add the git ref from the repo to the cache keys.
This will ensure that the cache is invalidated when the repo is updated.
"""
repo = Gi... | mpl-2.0 |
daspecster/google-cloud-python | storage/google/cloud/storage/batch.py | 2 | 11055 | # Copyright 2014 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 in writing, ... | apache-2.0 |
nomuus/sineloco | ms-passwdcheck/passwdcheck.py | 1 | 2530 | from math import floor, log
# Python port of:
# https://www.microsoft.com/security/pc-security/assets/scripts/passwdcheck.js
#
# Main Page:
# https://www.microsoft.com/security/pc-security/password-checker.aspx
###############################################################################
__version__ = "1.0"
__autho... | bsd-3-clause |
cyx1231st/nova | nova/tests/unit/fake_crypto.py | 78 | 7211 | # Copyright 2012 Nebula, 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 ... | apache-2.0 |
ChemiKhazi/Sprytile | rx/backpressure/windowedobservable.py | 2 | 2159 | import logging
from rx.core import ObserverBase, ObservableBase
from rx.concurrency import current_thread_scheduler, timeout_scheduler
from rx.disposables import CompositeDisposable
log = logging.getLogger('Rx')
class WindowedObserver(ObserverBase):
def __init__(self, observer, observable, cancel, scheduler):
... | mit |
minhphung171093/GreenERP | openerp/addons/payment_ogone/tests/test_ogone.py | 430 | 9309 | # -*- coding: utf-8 -*-
from lxml import objectify
import time
import urlparse
from openerp.addons.payment.models.payment_acquirer import ValidationError
from openerp.addons.payment.tests.common import PaymentAcquirerCommon
from openerp.addons.payment_ogone.controllers.main import OgoneController
from openerp.tools i... | gpl-3.0 |
sankhesh/VTK | Rendering/Volume/Testing/Python/VolumePicker.py | 16 | 9122 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
=========================================================================
Program: Visualization Toolkit
Module: TestNamedColorsIntegration.py
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.... | bsd-3-clause |
pmarques/ansible | test/lib/ansible_test/_internal/commands/sanity/ignores.py | 13 | 2973 | """Sanity test for the sanity ignore file."""
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
from . import (
SanityFailure,
SanityIgnoreParser,
SanityVersionNeutral,
SanitySuccess,
SanityMessage,
)
from ...test import (
calculate_confidence,
... | gpl-3.0 |
Nick-OpusVL/odoo | addons/l10n_be/wizard/__init__.py | 438 | 1145 | # -*- 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... | agpl-3.0 |
hsiaoyi0504/scikit-learn | sklearn/utils/tests/test_murmurhash.py | 261 | 2836 | # Author: Olivier Grisel <olivier.grisel@ensta.org>
#
# License: BSD 3 clause
import numpy as np
from sklearn.externals.six import b, u
from sklearn.utils.murmurhash import murmurhash3_32
from numpy.testing import assert_array_almost_equal
from numpy.testing import assert_array_equal
from nose.tools import assert_equa... | bsd-3-clause |
agconti/django-rest-framework | rest_framework/status.py | 11 | 2027 | """
Descriptive HTTP status codes, for code readability.
See RFC 2616 - http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
And RFC 6585 - http://tools.ietf.org/html/rfc6585
"""
from __future__ import unicode_literals
def is_informational(code):
return code >= 100 and code <= 199
def is_success(code):
r... | bsd-2-clause |
aselle/tensorflow | tensorflow/python/tools/api/generator/create_python_api.py | 3 | 16087 | # 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... | apache-2.0 |
kevgliss/lemur | lemur/migrations/versions/a02a678ddc25_.py | 1 | 2093 | """Adds support for rotation policies.
Creates a default rotation policy (30 days) with the name
'default' ensures that all existing certificates use the default
policy.
Revision ID: a02a678ddc25
Revises: 8ae67285ff14
Create Date: 2017-07-12 11:45:49.257927
"""
# revision identifiers, used by Alembic.
revision = 'a0... | apache-2.0 |
emonty/vhd-util | tools/python/logging/logging-0.4.9.2/test/log_test6.py | 42 | 2045 | #!/usr/bin/env python
#
# Copyright 2001-2002 by Vinay Sajip. All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
# provided that the above copyright notice appear in all copies and that
# both that copyright n... | gpl-2.0 |
punesemu/puNES | src/extra/p7zip_16.02/Utils/bin_to_sources.py | 2 | 1794 | #!/usr/bin/env python
import fnmatch
import os
import sys
dir0='CPP/7zip/Bundles/Alone'
file0='Utils/file_7za.py'
dir0='CPP/7zip/Bundles/SFXCon'
file0='Utils/file_7zCon_sfx.py'
dir0='CPP/7zip/UI/Console'
file0='Utils/file_7z.py'
dir0='CPP/7zip/Compress/Rar'
file0='Utils/file_Codecs_Rar_so.py'
dir0='CPP/7zip/Bundl... | gpl-2.0 |
captainpete/rethinkdb | external/v8_3.30.33.16/build/gyp/test/ios/gyptest-per-config-settings.py | 193 | 5219 | #!/usr/bin/env python
# Copyright (c) 2012 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.
"""
Verifies that device and simulator bundles are built correctly.
"""
import plistlib
import TestGyp
import os
import struct
import subpr... | agpl-3.0 |
Denisolt/IEEE-NYIT-MA | local/lib/python2.7/site-packages/django/contrib/staticfiles/management/commands/findstatic.py | 463 | 1745 | from __future__ import unicode_literals
import os
from django.contrib.staticfiles import finders
from django.core.management.base import LabelCommand
from django.utils.encoding import force_text
class Command(LabelCommand):
help = "Finds the absolute paths for the given static file(s)."
label = 'static file... | gpl-3.0 |
libscie/liberator | liberator/lib/python3.6/site-packages/django/contrib/gis/gdal/error.py | 54 | 1997 | """
This module houses the GDAL & SRS Exception objects, and the
check_err() routine which checks the status code returned by
GDAL/OGR methods.
"""
# #### GDAL & SRS Exceptions ####
class GDALException(Exception):
pass
# Legacy name
OGRException = GDALException
class SRSException(Exception):
pass
cla... | cc0-1.0 |
Jonekee/chromium.src | ppapi/generators/idl_release.py | 104 | 9847 | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
IDLRelease for PPAPI
This file defines the behavior of the AST namespace which allows for resolving
a symbol as one or more AS... | bsd-3-clause |
ghostflare76/scouter | scouter.host/scouter/host/who.py | 11 | 1526 | #!/usr/bin/env python
#
# original code from
# https://github.com/giampaolo/psutil/blob/master/examples/
#
# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
A clone of 'who' command; print informa... | apache-2.0 |
YouLookFamiliar/swoop | setup.py | 2 | 1584 | import re
import io
from setuptools import setup
from setuptools.command.test import test as TestCommand
class Tox(TestCommand):
user_options = [('tox-args=', 'a', "Arguments to pass to tox")]
def initialize_options(self):
TestCommand.initialize_options(self)
self.tox_args = None
... | apache-2.0 |
trabucayre/gnuradio | gr-audio/examples/python/audio_to_file.py | 6 | 1524 | #!/usr/bin/env python
#
# Copyright 2004,2007,2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
from gnuradio import gr
from gnuradio import audio
from gnuradio import blocks
from gnuradio.eng_arg import eng_float
from argparse import ArgumentParse... | gpl-3.0 |
karban/field | resources/python/logilab/common/compat.py | 4 | 7473 | # pylint: disable=E0601,W0622,W0611
# copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
#
# This file is part of logilab-common.
#
# logilab-common is free software: you can redistribute it and/or modify it under
# the terms of the GNU L... | gpl-2.0 |
rande/python-shirka | shirka/responders/status.py | 1 | 2193 | # vim: set fileencoding=utf-8 :
from shirka.responders import Responder
from shirka.consumers import BaseTestCase
from random import choice
import datetime
STATUS = [
"You wanna piece of me, boy?",
"Ready to roll out!",
"Can I take your order?",
"SCV good to go, sir.",
"Alright! Bring it on!",
]
... | mit |
MotorolaMobilityLLC/external-chromium_org | third_party/android_testrunner/logger.py | 171 | 2449 | #!/usr/bin/python2.4
#
#
# Copyright 2007, The Android Open Source Project
#
# 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... | bsd-3-clause |
shusenl/scikit-learn | examples/model_selection/plot_roc_crossval.py | 247 | 3253 | """
=============================================================
Receiver Operating Characteristic (ROC) with cross validation
=============================================================
Example of Receiver Operating Characteristic (ROC) metric to evaluate
classifier output quality using cross-validation.
ROC curv... | bsd-3-clause |
kartikeys98/coala | coalib/bearlib/aspects/Formatting.py | 7 | 11164 | from coalib.bearlib.aspects import Root, Taste
@Root.subaspect
class Formatting:
"""
The visual appearance of source code.
"""
class docs:
example = """
# Here is an example of Python code with lots of
# formatting issues including: trailing spaces, missing spaces
# aro... | agpl-3.0 |
camillemonchicourt/Geotrek | geotrek/core/migrations/0002_auto__del_field_trail_id__del_field_trail_date_update__del_field_trail.py | 1 | 14912 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
from django.conf import settings
class Migration(SchemaMigration):
def forwards(self, orm):
# Keep track of previous paths associated to tra... | bsd-2-clause |
PaddlePaddle/Paddle | python/paddle/fluid/tests/unittests/test_hash_op.py | 2 | 4770 | # Copyright (c) 2019 PaddlePaddle 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 app... | apache-2.0 |
jonieli/flask | tests/test_user_error_handler.py | 150 | 3483 | # -*- coding: utf-8 -*-
from werkzeug.exceptions import Forbidden, InternalServerError
import flask
def test_error_handler_no_match():
app = flask.Flask(__name__)
class CustomException(Exception):
pass
@app.errorhandler(CustomException)
def custom_exception_handler(e):
assert isinsta... | bsd-3-clause |
mitar/django-filer | filer/tests/utils.py | 12 | 2446 | #-*- coding: utf-8 -*-
from django.core.files import File as DjangoFile
from django.test.testcases import TestCase
from filer.tests.helpers import create_image
from filer.utils.loader import load
from filer.utils.zip import unzip
from zipfile import ZipFile
import os
#==================================================... | bsd-3-clause |
aselims/androguard | androguard/gui/renamewindow.py | 26 | 1287 | from PySide import QtCore, QtGui
from androguard.core import androconf
class RenameDialog(QtGui.QDialog):
'''
parent: SourceWindow that started the new XrefDialog
'''
def __init__(self, parent=None, win=None, element="", info=()):
super(RenameDialog, self).__init__(parent)
sel... | apache-2.0 |
thingsinjars/electron | script/build.py | 155 | 1166 | #!/usr/bin/env python
import argparse
import os
import subprocess
import sys
from lib.util import atom_gyp
CONFIGURATIONS = ['Release', 'Debug']
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
def main():
os.chdir(SOURCE_ROOT)
ninja = os.path.join('vendor', 'depot_tools', 'ninja')
... | mit |
bsmrstu-warriors/Moytri--The-Drone-Aider | Lib/distutils/command/install_lib.py | 251 | 8338 | """distutils.command.install_lib
Implements the Distutils 'install_lib' command
(install all Python modules)."""
__revision__ = "$Id$"
import os
import sys
from distutils.core import Command
from distutils.errors import DistutilsOptionError
# Extension for Python source files.
if hasattr(os, 'extsep'):
PYTHON... | gpl-3.0 |
smrjan/seldon-server | docker/examples/iris/vw/vw_pipeline.py | 2 | 1126 | import sys, getopt, argparse
import seldon.pipeline.basic_transforms as bt
import seldon.pipeline.auto_transforms as pauto
import seldon.pipeline.util as sutl
from sklearn.pipeline import Pipeline
import seldon.vw as vw
import sys
def run_pipeline(events,models):
tNameId = bt.Feature_id_transform(min_size=0,exclud... | apache-2.0 |
ridfrustum/django-assets | django_assets/templatetags/assets.py | 5 | 5584 | import tokenize
import warnings
from django import template
from django_assets import Bundle
from django_assets.env import get_env
from webassets import six
from webassets.exceptions import ImminentDeprecationWarning
def parse_debug_value(value):
"""Django templates do not know what a boolean is, an... | bsd-2-clause |
MichaelNedzelsky/intellij-community | plugins/hg4idea/testData/bin/mercurial/changegroup.py | 91 | 8282 | # changegroup.py - Mercurial changegroup manipulation functions
#
# Copyright 2006 Matt Mackall <mpm@selenic.com>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
from i18n import _
from node import nullrev
import mdiff, util
impo... | apache-2.0 |
crw/speedtest-easy | convert/mysqlite.py | 1 | 2785 | #
# speedtest-easy (c) 2016 Craig Robert Wright <crw@crw.xyz>
#
# 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 sqlite3
class IntegrityError(sqlite3.IntegrityEr... | mpl-2.0 |
hudokkow/kodi-cmake | lib/gtest/scripts/upload.py | 2511 | 51024 | #!/usr/bin/env python
#
# Copyright 2007 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 o... | gpl-2.0 |
grimmjow8/ansible | lib/ansible/modules/cloud/cloudstack/cs_instancegroup.py | 48 | 5867 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2015, René Moser <mail@renemoser.net>
#
# 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 Lice... | gpl-3.0 |
Varentsov/servo | tests/wpt/web-platform-tests/tools/third_party/py/py/_io/capture.py | 268 | 11640 | import os
import sys
import py
import tempfile
try:
from io import StringIO
except ImportError:
from StringIO import StringIO
if sys.version_info < (3,0):
class TextIO(StringIO):
def write(self, data):
if not isinstance(data, unicode):
data = unicode(data, getattr(self,... | mpl-2.0 |
sephalon/python-ivi | ivi/agilent/agilentDSO7032A.py | 7 | 1688 | """
Python Interchangeable Virtual Instrument Library
Copyright (c) 2012-2014 Alex Forencich
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... | mit |
ahlusar1989/geocoder | test_geocoder.py | 1 | 3292 | #!/usr/bin/python
# coding: utf8
import geocoder
address = '453 Booth Street, Ottawa'
location = 'Ottawa, Ontario'
words = 'embedded.fizzled.trial'
city = 'Ottawa'
ip = '74.125.226.99'
china = '中国'
repeat = 3
ottawa = (45.4215296, -75.6971930)
toronto = (43.653226, -79.3831843)
def test_entry_points():
geocode... | mit |
mtougeron/python-openstacksdk | openstack/utils.py | 3 | 2677 | # 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
# distributed under t... | apache-2.0 |
ganeshnalawade/ansible | lib/ansible/plugins/doc_fragments/template_common.py | 56 | 4573 | # -*- coding: utf-8 -*-
# Copyright (c) 2019 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
class ModuleDocFragment(object):
# Standard template documentation fr... | gpl-3.0 |
jhawkesworth/ansible | lib/ansible/modules/network/avi/avi_serverautoscalepolicy.py | 31 | 7506 | #!/usr/bin/python
#
# @author: Gaurav Rastogi (grastogi@avinetworks.com)
# Eric Anderson (eanderson@avinetworks.com)
# module_check: supported
#
# Copyright: (c) 2017 Gaurav Rastogi, <grastogi@avinetworks.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
ANSIB... | gpl-3.0 |
keras-team/keras-tuner | keras_tuner/engine/base_tuner.py | 1 | 12695 | # Copyright 2019 The Keras Tuner 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | apache-2.0 |
fritsvanveen/QGIS | python/ext-libs/owslib/fes.py | 22 | 16894 | # -*- coding: ISO-8859-15 -*-
# =============================================================================
# Copyright (c) 2009 Tom Kralidis
#
# Authors : Tom Kralidis <tomkralidis@gmail.com>
#
# Contact email: tomkralidis@gmail.com
# =============================================================================
"""... | gpl-2.0 |
MarkusAlexander/makken | node_modules/pangyp/gyp/pylib/gyp/generator/ninja_test.py | 1843 | 1786 | #!/usr/bin/env python
# Copyright (c) 2012 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.
""" Unit tests for the ninja.py file. """
import gyp.generator.ninja as ninja
import unittest
import StringIO
import sys
import TestCommon
... | mit |
pnedunuri/scipy | scipy/special/tests/test_basic.py | 24 | 122406 | # this program corresponds to special.py
### Means test is not done yet
# E Means test is giving error (E)
# F Means test is failing (F)
# EF Means test is giving error and Failing
#! Means test is segfaulting
# 8 Means test runs forever
### test_besselpoly
### test_mathieu_a
### test_mathieu_even_coef
##... | bsd-3-clause |
junaidk/gitinspector | gitinspector/extensions.py | 51 | 2927 | # coding: utf-8
#
# Copyright © 2012-2014 Ejwa Software. All rights reserved.
#
# This file is part of gitinspector.
#
# gitinspector 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 Lic... | gpl-3.0 |
tornadozou/tensorflow | tensorflow/contrib/training/python/training/training_test.py | 44 | 23611 | # 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 applicable ... | apache-2.0 |
samdroid-apps/sugar | src/jarabe/frame/zoomtoolbar.py | 13 | 4263 | # Copyright (C) 2006-2007 Red Hat, Inc.
# Copyright (C) 2009 Simon Schampijer
#
# 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 v... | gpl-2.0 |
patriciolobos/desa8 | openerp/addons/portal_sale/__openerp__.py | 380 | 2183 | # -*- 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... | agpl-3.0 |
SergeyPirogov/ghost | node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/scripts/find_error.py | 117 | 5927 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Lexing error finder
~~~~~~~~~~~~~~~~~~~
For the source files given on the command line, display
the text where Error tokens are being generated, along
with some context.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:licens... | mit |
hryamzik/ansible | test/units/plugins/lookup/test_aws_ssm.py | 40 | 6486 | #
# (c) 2017 Michael De La Rue
#
# 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... | gpl-3.0 |
laszlocsomor/tensorflow | tensorflow/python/framework/errors.py | 141 | 2322 | # 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... | apache-2.0 |
zhouzhenghui/python-for-android | python-build/python-libs/gdata/src/gdata/tlslite/__init__.py | 409 | 1129 | """
TLS Lite is a free python library that implements SSL v3, TLS v1, and
TLS v1.1. TLS Lite supports non-traditional authentication methods
such as SRP, shared keys, and cryptoIDs, in addition to X.509
certificates. TLS Lite is pure python, however it can access OpenSSL,
cryptlib, pycrypto, and GMPY for faster crypt... | apache-2.0 |
potatolondon/django-nonrel-1-4 | django/template/response.py | 93 | 6205 | from django.http import HttpResponse
from django.template import loader, Context, RequestContext
class ContentNotRenderedError(Exception):
pass
class SimpleTemplateResponse(HttpResponse):
rendering_attrs = ['template_name', 'context_data', '_post_render_callbacks']
def __init__(self, template, context=... | bsd-3-clause |
gechr/ansible-modules-extras | files/blockinfile.py | 5 | 10001 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, 2015 YAEGASHI Takeshi <yaegashi@debian.org>
#
# 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 ... | gpl-3.0 |
obsoleter/suds | suds/umx/__init__.py | 1 | 1849 | # This program is free software; you can redistribute it and/or modify
# it under the terms of the (LGPL) GNU Lesser 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 hope that it ... | lgpl-3.0 |
rahul67/hue | desktop/core/ext-py/pysqlite/pysqlite2/test/userfunctions.py | 45 | 13317 | #-*- coding: ISO-8859-1 -*-
# pysqlite2/test/userfunctions.py: tests for user-defined functions and
# aggregates.
#
# Copyright (C) 2005-2007 Gerhard Häring <gh@ghaering.de>
#
# This file is part of pysqlite.
#
# This software is provided 'as-is', without any express or implied
# warran... | apache-2.0 |
kjc88/sl4a | python/src/Lib/test/test_memoryio.py | 55 | 14313 | """Unit tests for memory-based file-like objects.
StringIO -- for unicode strings
BytesIO -- for bytes
"""
from __future__ import unicode_literals
import unittest
from test import test_support
import io
import sys
import array
try:
import _bytesio
has_c_implementation = True
except ImportError:
has_c_im... | apache-2.0 |
flipchan/LayerProx | setup.openbsd.py | 1 | 1342 | #!/usr/bin/env python
# coding: utf-8
#openbsd python setup.py
import os
from setuptools import setup
if os.name == 'nt':
import py2exe
setup(name='marionette-tg',
console=['bin/marionette_client','bin/marionette_server'],
scripts=['bin/marionette_client','bin/marionette_server'],
test_suit... | apache-2.0 |
google-research/google-research | perturbations/perturbations_test.py | 1 | 5591 | # coding=utf-8
# Copyright 2021 The Google Research 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 applicab... | apache-2.0 |
kobolabs/calibre | src/calibre/gui2/preferences/save_template.py | 4 | 3143 | #!/usr/bin/env python
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
from __future__ import with_statement
__license__ = 'GPL v3'
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
from PyQt4.Qt import QWidget, pyqtSignal
from calibre.gui2 import error_dialog, ques... | gpl-3.0 |
ddboline/pylearn2 | pylearn2/distributions/tests/test_mnd.py | 49 | 1777 | import numpy as np
from pylearn2.distributions.mnd import MND
from theano import function
from pylearn2.testing.skip import skip_if_no_scipy
def test_seed_same():
"""Verifies that two MNDs initialized with the same
seed produce the same samples """
skip_if_no_scipy()
rng = np.random.RandomState([1,2,... | bsd-3-clause |
robgjansen/libutp | parse_log.py | 17 | 7954 | import os, sys, time
# usage: parse_log.py log-file [socket-index to focus on]
socket_filter = None
if len(sys.argv) >= 3:
socket_filter = sys.argv[2].strip()
if socket_filter == None:
print "scanning for socket with the most packets"
file = open(sys.argv[1], 'rb')
sockets = {}
for l in file:
... | mit |
tinkerthaler/odoo | addons/membership/__init__.py | 441 | 1101 | # -*- 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... | agpl-3.0 |
polyanskiy/refractiveindex.info-scripts | scripts/Rakic 1998 - Cr (BB model).py | 1 | 2587 | # -*- coding: utf-8 -*-
# Author: Mikhail Polyanskiy
# Last modified: 2017-04-02
# Original data: Rakić et al. 1998, https://doi.org/10.1364/AO.37.005271
import numpy as np
import matplotlib.pyplot as plt
from scipy.special import wofz as w
π = np.pi
# Brendel-Bormann (BB) model parameters
ωp = 10.75 #eV
f0 = 0.154
Γ... | gpl-3.0 |
msarana/selenium_python | ENV/Lib/ntpath.py | 50 | 19431 | # Module 'ntpath' -- common operations on WinNT/Win95 pathnames
"""Common pathname manipulations, WindowsNT/95 version.
Instead of importing this module directly, import os and refer to this
module as os.path.
"""
import os
import sys
import stat
import genericpath
import warnings
from genericpath import *
from gene... | apache-2.0 |
dims/nova | nova/tests/unit/objects/test_request_spec.py | 2 | 21770 | # Copyright 2015 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 a... | apache-2.0 |
zappala/bene | src/buffer.py | 2 | 5376 | class SendBuffer(object):
""" Send buffer for transport protocols """
def __init__(self):
""" The buffer holds a series of characters to send. The base
is the starting sequence number of the buffer. The next
value is the sequence number for the next data that has
not... | gpl-2.0 |
jhawkesworth/ansible | lib/ansible/modules/storage/netapp/_na_cdot_volume.py | 59 | 15187 | #!/usr/bin/python
# (c) 2017, NetApp, Inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['deprecated'],
... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.