repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values |
|---|---|---|---|---|---|
goldmedal/spark | python/pyspark/ml/fpm.py | 9 | 15928 | #
# 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... | apache-2.0 |
mattnenterprise/servo | tests/wpt/web-platform-tests/tools/third_party/py/py/_code/assertion.py | 60 | 3174 | import sys
import py
BuiltinAssertionError = py.builtin.builtins.AssertionError
_reprcompare = None # if set, will be called by assert reinterp for comparison ops
def _format_explanation(explanation):
"""This formats an explanation
Normally all embedded newlines are escaped, however there are
three exce... | mpl-2.0 |
dulaccc/django-select2 | docs/conf.py | 14 | 9543 | # -*- coding: utf-8 -*-
#
# Django-Select2 documentation build configuration file, created by
# sphinx-quickstart on Sat Aug 25 10:23:46 2012.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerate... | apache-2.0 |
Bachaco-ve/odoo | addons/payment_authorize/tests/test_authorize.py | 195 | 7565 | # -*- coding: utf-8 -*-
import hashlib
import hmac
import time
import urlparse
from lxml import objectify
import openerp
from openerp.addons.payment.models.payment_acquirer import ValidationError
from openerp.addons.payment.tests.common import PaymentAcquirerCommon
from openerp.addons.payment_authorize.controllers.ma... | agpl-3.0 |
ryfeus/lambda-packs | Spacy/source2.7/numpy/lib/tests/test_arraysetops.py | 2 | 18032 | """Test functions for 1D array set operations.
"""
from __future__ import division, absolute_import, print_function
import numpy as np
from numpy.testing import (
run_module_suite, assert_array_equal, assert_equal, assert_raises,
)
from numpy.lib.arraysetops import (
ediff1d, intersect1d, setxor1d, union1... | mit |
Jorge-Rodriguez/ansible | lib/ansible/modules/net_tools/haproxy.py | 17 | 16304 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, Ravi Bhure <ravibhure@gmail.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 |
byzvulture/android_kernel_zte_nx503a | tools/perf/util/setup.py | 4998 | 1330 | #!/usr/bin/python2
from distutils.core import setup, Extension
from os import getenv
from distutils.command.build_ext import build_ext as _build_ext
from distutils.command.install_lib import install_lib as _install_lib
class build_ext(_build_ext):
def finalize_options(self):
_build_ext.finalize_optio... | gpl-2.0 |
kubeflow/pipelines | components/gcp/container/component_sdk/python/kfp_component/google/dataflow/_launch_template.py | 1 | 3920 | # Copyright 2018 The Kubeflow 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... | apache-2.0 |
ecino/compassion-switzerland | hr_switzerland/__manifest__.py | 3 | 1954 | # -*- coding: utf-8 -*-
##############################################################################
#
# ______ Releasing children from poverty _
# / ____/___ ____ ___ ____ ____ ___________(_)___ ____
# / / / __ \/ __ `__ \/ __ \/ __ `/ ___/ ___/ / __ \/ __ \
# / /___/ /_/ / / / / / / /_/... | agpl-3.0 |
s3nk4s/flaskTutorials | FlaskApp/FlaskApp/venv/local/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/utf8prober.py | 2919 | 2652 | ######################## 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.
#
# Con... | mit |
newrocknj/horizon | openstack_dashboard/dashboards/project/data_processing/cluster_templates/forms.py | 43 | 2206 | # 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 the... | apache-2.0 |
mujiansu/arangodb | 3rdParty/V8-4.3.61/third_party/python_26/Lib/ftplib.py | 50 | 28528 | """An FTP client class and some helper functions.
Based on RFC 959: File Transfer Protocol (FTP), by J. Postel and J. Reynolds
Example:
>>> from ftplib import FTP
>>> ftp = FTP('ftp.python.org') # connect to host, default port
>>> ftp.login() # default, i.e.: user anonymous, passwd anonymous@
'230 Guest login ok, ac... | apache-2.0 |
airodactyl/qutebrowser | qutebrowser/browser/webengine/webengineinspector.py | 2 | 2192 | # vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2015-2018 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser 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 S... | gpl-3.0 |
wimmuskee/mangrove | test/test_interface.py | 1 | 1296 | from unittest import TestCase
from mangrove_libs import common
from mangrove_libs.interface import Interface
from storage.mysql import Database
import re
class InterfaceTestCase(TestCase):
@classmethod
def setUpClass(self):
config = common.getConfig("mangrove-crawler-config.json.test", "default_collection")
self... | gpl-3.0 |
adammaikai/OmicsPipe2.0 | build/lib.linux-x86_64-2.7/omics_pipe/modules/GATK_BQSR.py | 3 | 1560 | #!/usr/bin/env python
from omics_pipe.parameters.default_parameters import default_parameters
from omics_pipe.utils import *
p = Bunch(default_parameters)
def GATK_BQSR(sample, extension, GATK_BQSR_flag):
'''Recalibrate base quality scores.
input:
_WES_realigned_sorted.bam
output... | mit |
tdtrask/ansible | lib/ansible/modules/clustering/znode.py | 46 | 7699 | #!/usr/bin/python
# Copyright 2015 WP Engine, Inc. All rights reserved.
# 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 |
rismalrv/edx-platform | openedx/core/djangoapps/course_groups/management/commands/tests/test_remove_users_from_multiple_cohorts.py | 91 | 3951 | """
Tests for cleanup of users which are added in multiple cohorts of a course
"""
from django.core.exceptions import MultipleObjectsReturned
from django.core.management import call_command
from django.test.client import RequestFactory
from openedx.core.djangoapps.course_groups.views import cohort_handler
from openedx... | agpl-3.0 |
tayfun/django | tests/check_framework/test_templates.py | 288 | 1403 | from copy import deepcopy
from django.core.checks.templates import E001
from django.test import SimpleTestCase
from django.test.utils import override_settings
class CheckTemplateSettingsAppDirsTest(SimpleTestCase):
TEMPLATES_APP_DIRS_AND_LOADERS = [
{
'BACKEND': 'django.template.backends.djan... | bsd-3-clause |
gale320/sync-engine | migrations/versions/123_remove_gmail_inbox_syncs.py | 8 | 1697 | """Remove gmail inbox syncs
Revision ID: 3c743bd31ee2
Revises:476c5185121b
Create Date: 2014-12-08 03:53:36.829238
"""
# revision identifiers, used by Alembic.
revision = '3c743bd31ee2'
down_revision = '476c5185121b'
def upgrade():
# Remove UIDs and sync status for inbox IMAP syncs -- otherwise
# archives/... | agpl-3.0 |
saiamrit/dora-s-nos | vpythonex.py | 1 | 4401 | """
This is an example for vpython
you need to install vpython to run this code.
"""
from vpython import *
# Bruce Sherwood
N = 3 # N by N by N array of atoms
# Surrounding the N**3 atoms is another layer of invisible fixed-position atoms
# that provide stability to the lattice.
k = 1
m = 1
spacing = 1
atom_radius = ... | mpl-2.0 |
krafczyk/spack | var/spack/repos/builtin/packages/gnu-prolog/package.py | 5 | 1762 | ##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 |
chango/inferno | test/lib/test_reduce.py | 4 | 4567 | import types
from nose.tools import eq_
from nose.tools import ok_
from disco.worker.classic.worker import Params
from inferno.lib.reduce import keyset_reduce
class TestKeysetReduce(object):
def test_reduce(self):
data = [
('["keyset_BBB", "key1", "key2"]', [1, 10]),
('["keyset... | mit |
MoisesTedeschi/python | Scripts-Python/Modulos-Diversos/deteccao-de-faces-com-python-e-opencv/Lib/site-packages/pip/_vendor/html5lib/treebuilders/base.py | 56 | 14579 | from __future__ import absolute_import, division, unicode_literals
from pip._vendor.six import text_type
from ..constants import scopingElements, tableInsertModeElements, namespaces
# The scope markers are inserted when entering object elements,
# marquees, table cells, and table captions, and are used to prevent for... | gpl-3.0 |
romanornr/viacoin | test/functional/p2p-fullblocktest.py | 3 | 52871 | #!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test block processing.
This reimplements tests from the bitcoinj/FullBlockTestGenerator used
by the pu... | mit |
lnielsen/invenio-metrics | docs/_ext/ultramock.py | 164 | 2830 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2015 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 your option) any later... | gpl-2.0 |
GNOME/orca | test/keystrokes/firefox/math_line_nav_torture_test.py | 1 | 17854 | #!/usr/bin/python
from macaroon.playback import *
import utils
sequence = MacroSequence()
#sequence.append(WaitForDocLoad())
sequence.append(PauseAction(5000))
sequence.append(utils.StartRecordingAction())
sequence.append(KeyComboAction("<Control>Home"))
sequence.append(utils.AssertPresentationAction(
"1. Top o... | lgpl-2.1 |
TEAM-Gummy/platform_external_chromium_org | chrome/test/mini_installer/launch_chrome.py | 127 | 1647 | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Launches Chrome.
This script launches Chrome and waits until its window shows up.
"""
import optparse
import sys
import time
import win32process
import... | bsd-3-clause |
trac-ja/trac-ja | trac/mimeview/pygments.py | 2 | 8620 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2006-2009 Edgewall Software
# Copyright (C) 2006 Matthew Good <matt@matt-good.net>
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://trac... | bsd-3-clause |
mogproject/artifact-cli | src/artifactcli/artifact/fileinfo.py | 1 | 2185 | import os
import time
import socket
import getpass
from datetime import datetime
import dateutil.parser
from .baseinfo import BaseInfo
from artifactcli.util import *
class FileInfo(BaseInfo):
keys = ['host', 'user', 'size', 'mtime', 'md5']
def __init__(self, host, user, size, mtime, md5):
super(FileI... | apache-2.0 |
macloo/flasky | manage.py | 76 | 2391 | #!/usr/bin/env python
import os
COV = None
if os.environ.get('FLASK_COVERAGE'):
import coverage
COV = coverage.coverage(branch=True, include='app/*')
COV.start()
if os.path.exists('.env'):
print('Importing environment from .env...')
for line in open('.env'):
var = line.strip().split('=')
... | mit |
saddingtonbaynes/rez | src/rez/vendor/schema/test_schema.py | 8 | 16154 | from __future__ import with_statement
import rez.vendor.unittest2 as unittest
import os
import tempfile
from schema import Schema, Use, And, Or, Optional, SchemaError
# REZ: These are some regular expressions used in converting from original
# pytest format to standard unittest format
#
# re search:
# with SE: ... | gpl-3.0 |
Bismarrck/tensorflow | tensorflow/contrib/framework/__init__.py | 7 | 4089 | # 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... | apache-2.0 |
OpenGazettes/aleph | aleph/model/validate.py | 2 | 1258 | import os
import json
from dalet import is_country_code, is_partial_date, is_language_code
from dalet import is_domain, is_url
from jsonschema import Draft4Validator, FormatChecker, RefResolver
from aleph.core import get_config
resolver = RefResolver('core.json#', {})
SCHEMA_DIR = os.path.join(os.path.dirname(__file... | mit |
GbalsaC/bitnamiP | venv/lib/python2.7/site-packages/reportlab/lib/styles.py | 27 | 13238 | #Copyright ReportLab Europe Ltd. 2000-2012
#see license.txt for license details
#history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/lib/styles.py
__version__=''' $Id$ '''
__doc__='''Classes for ParagraphStyle and similar things.
A style is a collection of attributes, but with some ... | agpl-3.0 |
adviti/melange | app/soc/views/helper/decorators.py | 1 | 1144 | #!/usr/bin/env python2.5
#
# Copyright 2008 the Melange 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 applic... | apache-2.0 |
ryanGT/sympy | sympy/thirdparty/__init__.py | 10 | 1047 | """Thirdparty Packages for internal use.
"""
import sys
import os
def import_thirdparty(lib):
"""
Imports a thirdparty package "lib" by setting all paths correctly.
At the moment, there is only the "pyglet" library, so we just put
pyglet to sys.path temporarily, then import "lib" and then restore the... | bsd-3-clause |
tdtrask/ansible | lib/ansible/utils/module_docs_fragments/ironware.py | 25 | 3932 | #
# (c) 2017, Paul Baker <@paulquack>
#
# 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.
#
# ... | gpl-3.0 |
Azure/azure-sdk-for-python | sdk/tables/azure-data-tables/tests/_shared/asynctestcase.py | 1 | 4937 | # coding: utf-8
# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# ---------------------------------------------------------------------... | mit |
iqas/e2gui | mytest.py | 2 | 27994 | import sys
import os
from time import time
if os.path.isfile("/usr/lib/enigma2/python/enigma.zip"):
sys.path.append("/usr/lib/enigma2/python/enigma.zip")
from Tools.Profile import profile, profile_final
profile("PYTHON_START")
import Tools.RedirectOutput
import enigma
from boxbranding import getBoxType, getBrandOEM... | gpl-2.0 |
bossino/dra-kernel | arch/ia64/scripts/unwcheck.py | 13143 | 1714 | #!/usr/bin/python
#
# Usage: unwcheck.py FILE
#
# This script checks the unwind info of each function in file FILE
# and verifies that the sum of the region-lengths matches the total
# length of the function.
#
# Based on a shell/awk script originally written by Harish Patil,
# which was converted to Perl by Matthew Ch... | gpl-2.0 |
zasdfgbnm/tensorflow | tensorflow/python/estimator/export/export_output_test.py | 26 | 10163 | # 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 |
ssanderson/docker-py | docker/errors.py | 3 | 2372 | # Copyright 2014 dotCloud 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 agre... | apache-2.0 |
leiserfg/flask-restplus | tests/legacy/test_api_with_blueprint.py | 3 | 7165 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import flask
import six
from flask import Blueprint, request
import flask_restplus as restplus
from nose.tools import assert_true, assert_false # you need it for tests in form of continuations
from .. import TestCase, Mock
# Add a dummy Resource to... | mit |
yury-s/v8-inspector | Source/chrome/build/landmine_utils.py | 76 | 3014 | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import functools
import logging
import os
import shlex
import sys
def memoize(default=None):
"""This decorator caches the return value of a parameterles... | bsd-3-clause |
alx-eu/django | tests/regressiontests/extra_regress/models.py | 114 | 1365 | from __future__ import unicode_literals
import copy
import datetime
from django.contrib.auth.models import User
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class RevisionableModel(models.Model):
base = models.ForeignKey('self', null=Tru... | bsd-3-clause |
hugoruscitti/irobotgame | lib/cocos/gl_pbuffer.py | 2 | 2808 | """A thin wrapper for OpenGL pbuffer objets. For implementation use only"""
import ctypes, sys
if sys.platform=='darwin':
#### Darwin (Carbon, AGL)
class Pbuffer (object):
def __init__ (self, *args, **kwargs):
raise Exception ("AGL Pbuffers not implemented")
elif sys.platform in ('win32', 'cygw... | gpl-3.0 |
ybdesire/apk_sdk_analysis | common/Androguard-2.0/androguard/decompiler/dad/ast.py | 20 | 23793 | # This file is part of Androguard.
#
# Copyright (C) 2014 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
... | gpl-3.0 |
deNULL/stagger | test/friendly.py | 16 | 15820 | #!/usr/bin/env python3
#
# friendly.py
# From the stagger project: http://code.google.com/p/stagger/
#
# Copyright (c) 2009-2011 Karoly Lorentey <karoly@lorentey.hu>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following ... | bsd-2-clause |
Nelca/buildMLSystem | ch04/blei_lda.py | 3 | 1602 | # This code is supporting material for the book
# Building Machine Learning Systems with Python
# by Willi Richert and Luis Pedro Coelho
# published by PACKT Publishing
#
# It is made available under the MIT License
from __future__ import print_function
from gensim import corpora, models, similarities
from mpltools im... | mit |
hafizrahmadi/tingroom | assets/ionicons-2.0.1/builder/generate.py | 357 | 9438 | from subprocess import call
import os
import json
BUILDER_PATH = os.path.dirname(os.path.abspath(__file__))
ROOT_PATH = os.path.join(BUILDER_PATH, '..')
FONTS_FOLDER_PATH = os.path.join(ROOT_PATH, 'fonts')
CSS_FOLDER_PATH = os.path.join(ROOT_PATH, 'css')
SCSS_FOLDER_PATH = os.path.join(ROOT_PATH, 'scss')
LESS_FOLDER_... | mit |
wbyne/QGIS | python/ext-libs/pygments/lexers/textedit.py | 47 | 6057 | # -*- coding: utf-8 -*-
"""
pygments.lexers.textedit
~~~~~~~~~~~~~~~~~~~~~~~~
Lexers for languages related to text processing.
:copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from bisect import bisect
from pygments.lexer im... | gpl-2.0 |
CYBAI/servo | tests/wpt/web-platform-tests/tools/third_party/pluggy/src/pluggy/_tracing.py | 14 | 1561 | """
Tracing utils
"""
class TagTracer(object):
def __init__(self):
self._tags2proc = {}
self._writer = None
self.indent = 0
def get(self, name):
return TagTracerSub(self, (name,))
def _format_message(self, tags, args):
if isinstance(args[-1], dict):
ex... | mpl-2.0 |
dracos/django | django/db/backends/base/validation.py | 114 | 1040 | class BaseDatabaseValidation:
"""Encapsulate backend-specific validation."""
def __init__(self, connection):
self.connection = connection
def check(self, **kwargs):
return []
def check_field(self, field, **kwargs):
errors = []
# Backends may implement a check_field_type... | bsd-3-clause |
glebb/Qt-Kata-Skeleton | 3rdparty/gtest-1.6.0/test/gtest_test_utils.py | 397 | 10437 | #!/usr/bin/env python
#
# Copyright 2006, 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... | bsd-2-clause |
kater169/libcloud | libcloud/test/compute/test_ikoula.py | 64 | 1139 | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | apache-2.0 |
jayceyxc/hue | desktop/core/ext-py/Paste-2.0.1/tests/test_util/test_datetimeutil.py | 47 | 6026 | # (c) 2005 Clark C. Evans and contributors
# This module is part of the Python Paste Project and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
# Some of this code was funded by: http://prometheusresearch.com
from time import localtime
from datetime import date
from paste.util.d... | apache-2.0 |
amboutin/GCP | appengine/standard/multitenancy/taskqueue.py | 9 | 2859 | # 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 agree... | apache-2.0 |
stemchan/smartclip | main/auth.py | 1 | 2328 | import os
from cStringIO import StringIO
from django.conf import settings
from django.template.loader import get_template
from django.template import Context
from wkhtmltopdf.utils import wkhtmltopdf
from django.contrib.auth import login
from django.contrib.auth.models import User
import smartfile
from smartclip impor... | gpl-3.0 |
rafaeldelucena/waterbutler | waterbutler/providers/figshare/provider.py | 5 | 13530 | import http
import json
import asyncio
import aiohttp
import oauthlib.oauth1
from waterbutler.core import streams
from waterbutler.core import provider
from waterbutler.core import exceptions
from waterbutler.core.path import WaterButlerPath
from waterbutler.providers.figshare import metadata
from waterbutler.provid... | apache-2.0 |
slisson/intellij-community | python/helpers/pycharm/django_manage_shell.py | 49 | 1127 | #!/usr/bin/env python
from fix_getpass import fixGetpass
import os
from django.core import management
import sys
try:
from runpy import run_module
except ImportError:
from runpy_compat import run_module
def run(working_dir):
sys.path.insert(0, working_dir)
manage_file = os.getenv('PYCHARM_DJANGO_MANAGE_MODUL... | apache-2.0 |
boundarydevices/android_external_chromium_org | build/android/pylib/utils/command_option_parser.py | 160 | 2419 | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""An option parser which handles the first arg as a command.
Add other nice functionality such as printing a list of commands
and an example in usage.
"""
... | bsd-3-clause |
Think-Silicon/qemu | scripts/analyse-9p-simpletrace.py | 333 | 9058 | #!/usr/bin/env python
# Pretty print 9p simpletrace log
# Usage: ./analyse-9p-simpletrace <trace-events> <trace-pid>
#
# Author: Harsh Prateek Bora
import os
import simpletrace
symbol_9p = {
6 : 'TLERROR',
7 : 'RLERROR',
8 : 'TSTATFS',
9 : 'RSTATFS',
12 : 'TLOPEN',
13 : 'RLOPEN',
... | gpl-2.0 |
ewjoachim/django-extensions | django_extensions/validators.py | 65 | 2090 | import unicodedata
from django.core.exceptions import ValidationError
from django.utils.deconstruct import deconstructible
from django.utils.encoding import force_text
from django.utils.translation import ugettext_lazy as _
@deconstructible
class NoControlCharactersValidator(object):
message = _("Control Charact... | mit |
EricMuller/mywebmarks-backend | requirements/twisted/Twisted-17.1.0/src/twisted/scripts/test/test_scripts.py | 12 | 4880 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for the command-line scripts in the top-level I{bin/} directory.
Tests for actual functionality belong elsewhere, written in a way that doesn't
involve launching child processes.
"""
from os import devnull, getcwd, chdir
from sys impor... | mit |
vmthunder/brick | brick/initiator/connector.py | 3 | 35458 | # Copyright 2013 OpenStack Foundation.
# 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
#
# U... | apache-2.0 |
Azure/azure-sdk-for-python | sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/_models_py3.py | 1 | 92077 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | mit |
sudheesh001/RFID-DBSync | venv/lib/python2.7/site-packages/setuptools/command/build_py.py | 110 | 8495 | import os
import sys
import fnmatch
import textwrap
import distutils.command.build_py as orig
from distutils.util import convert_path
from glob import glob
try:
from setuptools.lib2to3_ex import Mixin2to3
except ImportError:
class Mixin2to3:
def run_2to3(self, files, doctests=True):
"do not... | gpl-2.0 |
jhunufa/ArduWatchRaspSerial | virtualenv/lib/python3.4/site-packages/pip/_vendor/distlib/markers.py | 1261 | 6282 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2012-2013 Vinay Sajip.
# Licensed to the Python Software Foundation under a contributor agreement.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
"""Parser for the environment markers micro-language defined in PEP 345."""
import ast
import os
import sys
import platform
from .compa... | mit |
XiaodunServerGroup/xiaodun-platform | i18n/validate.py | 8 | 7185 | """Tests that validate .po files."""
import argparse
import codecs
import logging
import os
import sys
import textwrap
import polib
from i18n.config import LOCALE_DIR
from i18n.execute import call
from i18n.converter import Converter
log = logging.getLogger(__name__)
def validate_po_files(root, report_empty=False... | agpl-3.0 |
Integral-Technology-Solutions/ConfigNOW | Lib/jreload.py | 14 | 3632 | # java classes reload support (experimental)
# Copyright 2000 Samuele Pedroni
# ?? could have problem with import pkg.jclass.inner (this should not be used in any case)
# ?? using import * with a load-set together with reloading can be confusing
# cannot be fixed => anyway import * is not for production code
__ver... | mit |
ksmit799/Toontown-Source | toontown/hood/BRHoodDataAI.py | 1 | 1237 | from direct.directnotify import DirectNotifyGlobal
import HoodDataAI
from toontown.toonbase import ToontownGlobals
from toontown.safezone import DistributedTrolleyAI
from toontown.safezone import BRTreasurePlannerAI
from toontown.classicchars import DistributedPlutoAI
from toontown.toon import DistributedNPCFishermanAI... | mit |
matplo/rootutils | python/2.7/tdraw_cfg.py | 1 | 22331 | #!/usr/bin/env python
from time import sleep
import sys
sys.argv.append( '-b' )
import tutils
import ROOT as r
import IPython
import argparse
import os
import fnmatch
from configobj import ConfigObj
import eval_string
from tqdm import tqdm
from tabulate import tabulate
from string import atoi
from string import at... | mit |
motion2015/a3 | lms/djangoapps/courseware/management/commands/tests/test_clean_history.py | 72 | 18737 | """Test the clean_history management command."""
import fnmatch
from mock import Mock
import os.path
import textwrap
import dateutil.parser
from django.test import TransactionTestCase
from django.db import connection
from courseware.management.commands.clean_history import StudentModuleHistoryCleaner
# In lots of ... | agpl-3.0 |
shsingh/ansible | lib/ansible/modules/cloud/google/gcp_runtimeconfig_config_info.py | 13 | 5400 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Google
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
... | gpl-3.0 |
Codefans-fan/odoo | openerp/addons/base/tests/test_osv.py | 446 | 4722 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010 OpenERP S.A. http://www.openerp.com
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GN... | agpl-3.0 |
mbrubeck/servo | tests/wpt/web-platform-tests/tools/wpt/markdown.py | 17 | 1592 | def format_comment_title(product):
"""Produce a Markdown-formatted string based on a given "product"--a string
containing a browser identifier optionally followed by a colon and a
release channel. (For example: "firefox" or "chrome:dev".) The generated
title string is used both to create new comments an... | mpl-2.0 |
SLACNationalAcceleratorLaboratory/net-config | bin/config_daemon.py | 3 | 4534 | #!/usr/local/bin/python
import logging
import getopt
import sys
import os
import time
import sys
import resource
import slac.netconfig
from slac.netconfig import NetConfig, NetConfigStorage, ConfigWorker
from slac.netconfig.StorageQueue import StorageQueue
import Queue
THREADS=1
WORKING_DIR = '/tmp'
UMASK = 0
MAX_F... | gpl-2.0 |
fangxingli/hue | desktop/core/ext-py/Paste-2.0.1/tests/test_auth/test_auth_cookie.py | 47 | 1527 | # (c) 2005 Clark C. Evans
# This module is part of the Python Paste Project and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
from six.moves import xrange
import six
from paste.auth import cookie
from paste.wsgilib import raw_interactive, dump_environ
from paste.response impo... | apache-2.0 |
kantai/passe-framework-prototype | django/contrib/admin/__init__.py | 246 | 1608 | # ACTION_CHECKBOX_NAME is unused, but should stay since its import from here
# has been referenced in documentation.
from django.contrib.admin.helpers import ACTION_CHECKBOX_NAME
from django.contrib.admin.options import ModelAdmin, HORIZONTAL, VERTICAL
from django.contrib.admin.options import StackedInline, TabularInli... | bsd-3-clause |
aerialhedgehog/VyPy | trunk/VyPy/tools/redirect.py | 1 | 8439 | ## \file redirect.py
# \brief python package for file redirection
# \author Trent Lukaczyk, Aerospace Design Laboratory (Stanford University)
# \version 0.0.0
#
# ----------------------------------------------------------------------
# Imports
# --------------------------------------------------------------------... | bsd-3-clause |
wrouesnel/ansible | lib/ansible/modules/cloud/openstack/os_subnet.py | 5 | 12775 | #!/usr/bin/python
# coding: utf-8 -*-
# (c) 2013, Benno Joy <benno@ansible.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 |
anushbmx/kitsune | kitsune/notifications/models.py | 1 | 2432 | from datetime import datetime
from django.contrib.auth.models import User
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes.fields import GenericForeignKey
from django.db import models
from django.db.models.signals import post_save
from django.dispatch import receiver
from ac... | bsd-3-clause |
libyal/winevt-kb | tests/resources.py | 1 | 3379 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for the Windows Event Log resources."""
import unittest
from winevtrc import resources
from tests import test_lib
class EventLogProviderTest(test_lib.BaseTestCase):
"""Tests for the Windows Event Log provider."""
def testSetCategoryMessageFilenames(self):... | apache-2.0 |
brainelectronics/towerdefense | pyglet/window/xlib/__init__.py | 8 | 51830 | # ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistribu... | bsd-3-clause |
ml-lab/keras | tests/auto/keras/layers/test_core.py | 48 | 5211 | import unittest
import numpy as np
from numpy.testing import assert_allclose
import theano
from keras.layers import core
class TestLayerBase(unittest.TestCase):
def test_input_output(self):
nb_samples = 10
input_dim = 5
layer = core.Layer()
# As long as there is no input, an erro... | mit |
TamirEvan/mupdf | scripts/cmapflatten.py | 5 | 3170 | #!/usr/bin/env python3
# Parse a Uni* CMap file and flatten it.
#
# The Uni* CMap files only have 'cidchar' and 'cidrange' sections, never
# 'bfchar' or 'bfrange'.
import sys
def flattencmap(filename):
codespacerange = []
usecmap = ""
cmapname = ""
cmapversion = "1.0"
csi_registry = "(Adobe)"
csi_ordering = "(... | agpl-3.0 |
alfa-jor/addon | plugin.video.alfa/channels/novelashdgratis.py | 1 | 5527 | # -*- coding: utf-8 -*-
# -*- Channel Novelas HD Gratis -*-
# -*- Created for Alfa-addon -*-
# -*- By the Alfa Develop Group -*-
import re
from channelselector import get_thumb
from core import httptools
from core import scrapertools
from core import servertools
from core.item import Item
from platformcode ... | gpl-3.0 |
kmcminn/rails_survey | vendor/gems/nokogiri-1.6.0/ext/nokogiri/tmp/x86_64-linux-gnu/ports/libxml2/2.8.0/libxml2-2.8.0/python/tests/ctxterror.py | 87 | 1318 | #!/usr/bin/python -u
#
# This test exercise the redirection of error messages with a
# functions defined in Python.
#
import sys
import libxml2
# Memory debug specific
libxml2.debugMemory(1)
expect="""--> (3) xmlns: URI foo is not absolute
--> (4) Opening and ending tag mismatch: x line 0 and y
"""
err=""
def callba... | mit |
4022321818/w16b_test | static/Brython3.1.1-20150328-091302/Lib/multiprocessing/__init__.py | 693 | 6866 | #
# Package analogous to 'threading.py' but using processes
#
# multiprocessing/__init__.py
#
# This package is intended to duplicate the functionality (and much of
# the API) of threading.py but uses processes instead of threads. A
# subpackage 'multiprocessing.dummy' has the same API but is a simple
# wrapper for 't... | gpl-3.0 |
newemailjdm/pybrain | pybrain/auxiliary/gradientdescent.py | 31 | 5966 | __author__ = ('Thomas Rueckstiess, ruecksti@in.tum.de'
'Justin Bayer, bayer.justin@googlemail.com')
from scipy import zeros, asarray, sign, array, cov, dot, clip, ndarray
from scipy.linalg import inv
class GradientDescent(object):
def __init__(self):
""" initialize algorithms with standar... | bsd-3-clause |
jonasschnelli/bitcoin | test/functional/wallet_dump.py | 29 | 9641 | #!/usr/bin/env python3
# Copyright (c) 2016-2020 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the dumpwallet RPC."""
import datetime
import os
import time
from test_framework.test_framework i... | mit |
spaceone/pyjs | pyjswidgets/pyjamas/ui/StackPanel.py | 9 | 5080 | # Copyright 2006 James Tauber and contributors
# Copyright (C) 2009, 2010 Luke Kenneth Casson Leighton <lkcl@lkcl.net>
#
# 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.apach... | apache-2.0 |
nii-cloud/dodai-compute | nova/api/openstack/accounts.py | 3 | 3019 | # Copyright 2011 OpenStack LLC.
# 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 b... | apache-2.0 |
bgporter/nanobot | demo/tockbot.py | 1 | 3611 | #! /usr/bin/env/python
# Copyright (c) 2016 Brett g Porter
#
# 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, mod... | mit |
eamanu/ArgentosCompiler | Analyzer/Analyzer.py | 1 | 13039 | # -*- coding: utf-8 -*-
"""@package Reader
Módulo que analiza el código fuente
@author Arias Emmanuel
@date 24/10/2016
"""
from Reader import Reader
from enum import Enum
import string
import numpy as np
class campoCaracter:
def __init__(self):
self.mVariable = np.array([['A', 'B', 'C', 'D', 'E', '... | gpl-3.0 |
elijah513/scikit-learn | sklearn/decomposition/base.py | 313 | 5647 | """Principal Component Analysis Base Classes"""
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Olivier Grisel <olivier.grisel@ensta.org>
# Mathieu Blondel <mathieu@mblondel.org>
# Denis A. Engemann <d.engemann@fz-juelich.de>
# Kyle Kastner <kastnerkyle@gmail.com>
#
# Licen... | bsd-3-clause |
auready/django | django/middleware/gzip.py | 68 | 2082 | import re
from django.utils.cache import patch_vary_headers
from django.utils.deprecation import MiddlewareMixin
from django.utils.text import compress_sequence, compress_string
re_accepts_gzip = re.compile(r'\bgzip\b')
class GZipMiddleware(MiddlewareMixin):
"""
This middleware compresses content if the bro... | bsd-3-clause |
mgaitan/scipy | scipy/weave/examples/swig2_example.py | 100 | 1596 | """Simple example to show how to use weave.inline on SWIG2 wrapped
objects. SWIG2 refers to SWIG versions >= 1.3.
To run this example you must build the trivial SWIG2 extension called
swig2_ext. To do this you need to do something like this::
$ swig -c++ -python -I. -o swig2_ext_wrap.cxx swig2_ext.i
$ g++ -Wall ... | bsd-3-clause |
cbertinato/pandas | pandas/tests/indexes/test_setops.py | 1 | 2362 | '''
The tests in this package are to ensure the proper resultant dtypes of
set operations.
'''
import itertools as it
import numpy as np
import pytest
from pandas.core.dtypes.common import is_dtype_equal
import pandas as pd
from pandas import Int64Index, RangeIndex
from pandas.tests.indexes.conftest import indices_l... | bsd-3-clause |
csrocha/OpenUpgrade | addons/mrp_repair/__openerp__.py | 259 | 2554 | # -*- 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.