repo_name stringlengths 5 100 | path stringlengths 4 375 | copies stringclasses 991
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
AlexanderFabisch/scikit-learn | doc/tutorial/text_analytics/solutions/exercise_02_sentiment.py | 46 | 2798 | """Build a sentiment analysis / polarity model
Sentiment analysis can be casted as a binary text classification problem,
that is fitting a linear classifier on features extracted from the text
of the user messages so as to guess wether the opinion of the author is
positive or negative.
In this examples we will use a ... | bsd-3-clause |
meh/servo | tests/wpt/update/upstream.py | 43 | 13551 | import os
import re
import subprocess
import sys
import urlparse
from wptrunner.update.sync import LoadManifest
from wptrunner.update.tree import get_unique_name
from wptrunner.update.base import Step, StepRunner, exit_clean, exit_unclean
from .tree import Commit, GitTree, Patch
import github
from .github import GitH... | mpl-2.0 |
ubc/compair | compair/kaltura/media.py | 1 | 3320 | import requests
from flask import current_app
from compair.core import abort
from . import KalturaCore
class Media(object):
@classmethod
def generate_media_entry(cls, ks, upload_token_id, media_type):
entry = cls._api_add(ks, media_type)
entry = cls._api_add_content(ks, entry.get('id'), upload... | gpl-3.0 |
paladin74/neural-network-animation | matplotlib/tests/test_dviread.py | 15 | 1788 | from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
from nose.tools import assert_equal
import matplotlib.dviread as dr
import os.path
original_find_tex_file = dr.find_tex_file
def setup():
dr.find_tex_file = lambda x: x
def teardown():
dr... | mit |
alexgleith/Quantum-GIS | python/plugins/sextante/algs/QGISAlgorithmProvider.py | 2 | 8315 | # -*- coding: utf-8 -*-
"""
***************************************************************************
QGISAlgorithmProvider.py
---------------------
Date : December 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
***************... | gpl-2.0 |
Novasoft-India/OperERP-AM-Motors | openerp/conf/deprecation.py | 76 | 1602 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the G... | agpl-3.0 |
eezee-it/account-invoicing | account_invoice_merge_payment/models/account_invoice.py | 24 | 1583 | # -*- coding: utf-8 -*-
##############################################################################
#
# This file is part of account_invoice_merge_payment,
# an Odoo module.
#
# Copyright (c) 2015 ACSONE SA/NV (<http://acsone.eu>)
#
# account_invoice_merge_payment is free software:
# you can redi... | agpl-3.0 |
patricklaw/pants | src/python/pants/backend/python/goals/setup_py_test.py | 3 | 33865 | # Copyright 2019 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import annotations
import textwrap
from typing import Iterable, Type
import pytest
from pants.backend.python import target_types_rules
from pants.backend.python.goals.se... | apache-2.0 |
xin3liang/platform_external_chromium_org_third_party_WebKit | Tools/Scripts/webkitpy/common/system/logutils.py | 68 | 7376 | # Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org)
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and... | bsd-3-clause |
SerCeMan/intellij-community | plugins/hg4idea/testData/bin/hgext/convert/cvsps.py | 91 | 31477 | # Mercurial built-in replacement for cvsps.
#
# Copyright 2008, Frank Kingswood <frank@kingswood-consulting.co.uk>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
import os
import re
import cPickle as pickle
from mercurial import ... | apache-2.0 |
scith/htpc-manager_ynh | sources/libs/cherrypy/test/test_routes.py | 22 | 2383 | import os
curdir = os.path.join(os.getcwd(), os.path.dirname(__file__))
import cherrypy
from cherrypy.test import helper
import nose
class RoutesDispatchTest(helper.CPWebCase):
def setup_server():
try:
import routes
except ImportError:
raise nose.SkipTest('Install route... | gpl-3.0 |
QualiSystems/Ansible-Shell | package/cloudshell/cm/ansible/domain/temp_folder_scope.py | 1 | 1075 | import os
from .file_system_service import FileSystemService
from logging import Logger
class TempFolderScope(object):
def __init__(self, file_system, logger):
"""
:type file_system: FileSystemService
:type logger: Logger
"""
self.file_system = file_system
self.logg... | apache-2.0 |
eamars/shadowsocks | tests/nose_plugin.py | 1072 | 1164 | #!/usr/bin/env python
#
# Copyright 2015 clowwindy
#
# 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 ... | apache-2.0 |
sargas/scipy | scipy/weave/examples/md5_speed.py | 3 | 2569 | """
Storing actual strings instead of their md5 value appears to
be about 10 times faster.
>>> md5_speed.run(200,50000)
md5 build(len,sec): 50000 0.870999932289
md5 retrv(len,sec): 50000 0.680999994278
std build(len,sec): 50000 0.259999990463
std retrv(len,sec): 50000 0.0599999427795
This test actually takes several ... | bsd-3-clause |
BellScurry/gem5-fault-injection | src/python/m5/main.py | 9 | 14422 | # Copyright (c) 2005 The Regents of The University of Michigan
# 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-3-clause |
napkindrawing/ansible | lib/ansible/plugins/callback/logstash.py | 22 | 6893 | # (C) 2016, Ievgen Khmelenko <ujenmr@gmail.com>
#
# 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 ver... | gpl-3.0 |
zuowang/incubator-hawq | tools/bin/gppylib/commands/dca.py | 54 | 1705 | #!/usr/bin/env python
#
# Copyright (c) Greenplum Inc 2011. All Rights Reserved.
#
"""
Module for commands that are DCA specific
"""
import os
from gppylib.gplog import get_default_logger
from base import Command, LOCAL, REMOTE
logger = get_default_logger()
# NOTE THIS IS A CHECK FOR 1040 or later appliance
def is... | apache-2.0 |
bksim/chinese-translation | nltk/metrics/scores.py | 5 | 7814 | # Natural Language Toolkit: Evaluation
#
# Copyright (C) 2001-2012 NLTK Project
# Author: Edward Loper <edloper@gradient.cis.upenn.edu>
# Steven Bird <sb@csse.unimelb.edu.au>
# URL: <http://www.nltk.org/>
# For license information, see LICENSE.TXT
from __future__ import print_function
from itertools import iz... | apache-2.0 |
damdam-s/OpenUpgrade | addons/mass_mailing/tests/test_mail.py | 388 | 1221 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms... | agpl-3.0 |
youprofit/zato | code/zato-common/src/zato/common/util.py | 6 | 44974 | # -*- coding: utf-8 -*-
"""
Copyright (C) 2010 Dariusz Suchojad <dsuch at zato.io>
Licensed under LGPLv3, see LICENSE.txt for terms and conditions.
"""
from __future__ import absolute_import, division, print_function, unicode_literals
# stdlib
import copy, errno, gc, inspect, json, linecache, logging, os, random, r... | gpl-3.0 |
rohitwaghchaure/frappe-alec | frappe/website/permissions.py | 28 | 2434 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
def remove_empty_permissions():
permissions_cache_to_be_cleared = frappe.db.sql_list("""select distinct user
from `tabWebsite Route Permission`
where ifnull... | mit |
nexusz99/boto | boto/ses/exceptions.py | 151 | 1830 | """
Various exceptions that are specific to the SES module.
"""
from boto.exception import BotoServerError
class SESError(BotoServerError):
"""
Sub-class all SES-related errors from here. Don't raise this error
directly from anywhere. The only thing this gets us is the ability to
catch SESErrors separ... | mit |
GoogleCloudPlatform/training-data-analyst | courses/machine_learning/deepdive2/production_ml/labs/samples/contrib/azure-samples/databricks-pipelines/databricks_notebook_pipeline.py | 3 | 5367 | """Import a notebook into a Databricks workspace and submit a job run to execute it in a cluster.
Notebook will accept some parameters and access a file in DBFS and some secrets in a secret scope.
"""
from pathlib import Path
import base64
import kfp.dsl as dsl
import kfp.compiler as compiler
import databricks
def cre... | apache-2.0 |
celiafish/VisTrails | vistrails/core/modules/abstraction.py | 2 | 8400 | ###############################################################################
##
## Copyright (C) 2011-2014, NYU-Poly.
## Copyright (C) 2006-2011, University of Utah.
## All rights reserved.
## Contact: contact@vistrails.org
##
## This file is part of VisTrails.
##
## "Redistribution and use in source and binary for... | bsd-3-clause |
shivarammysore/faucet | faucet/check_faucet_config.py | 7 | 2275 | #!/usr/bin/env python
"""Standalone script to check FAUCET configuration, return 0 if provided config OK."""
# Copyright (C) 2015 Brad Cowie, Christopher Lorier and Joe Stringer.
# Copyright (C) 2015 Research and Education Advanced Network New Zealand Ltd.
# Copyright (C) 2015--2019 The Contributors
#
# Licensed unde... | apache-2.0 |
eos87/Booktype | lib/booktype/convert/assets.py | 7 | 2181 | # This file is part of Booktype.
# Copyright (c) 2013 Borko Jandras <borko.jandras@sourcefabric.org>
#
# Booktype is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (a... | agpl-3.0 |
sajeeshcs/nested_quota_final | nova/ipv6/account_identifier.py | 97 | 1952 | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2011 Justin Santa Barbara
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance wi... | apache-2.0 |
krkini16/Floascope | server.py | 1 | 1533 | from flask import Flask
import eventlet
eventlet.monkey_patch()
from flask import render_template
from sniffer import Sniffer
from flask_socketio import SocketIO, emit
import argparse
PORT = 8000
app = Flask(__name__)
app.config['SECRET_KEY'] = 'kmh_floascope'
socketio = SocketIO(app, async_mode="eventlet")
app.debug ... | mit |
TwinkleChawla/nova | nova/api/openstack/compute/extended_status.py | 24 | 2633 | # Copyright 2011 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | apache-2.0 |
sysadminmatmoz/odoo-clearcorp | product_category_code/__init__.py | 3 | 1059 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Addons modules by CLEARCORP S.A.
# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>).
#
# This program is free software: you can redistribute... | agpl-3.0 |
alexanderturner/ansible | lib/ansible/modules/cloud/amazon/ec2.py | 10 | 62187 | #!/usr/bin/python
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed... | gpl-3.0 |
nitin-cherian/LifeLongLearning | Python/PythonProgrammingLanguage/Encapsulation/encap_env/lib/python3.5/site-packages/IPython/lib/inputhook.py | 12 | 23594 | # coding: utf-8
"""
Deprecated since IPython 5.0
Inputhook management for GUI event loop integration.
"""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
try:
import ctypes
except ImportError:
ctypes = None
except SystemError: # IronPython issue, 2/8/2014
... | mit |
davidbuzz/ardupilot | Tools/ardupilotwaf/boards.py | 1 | 30037 | #!/usr/bin/env python
# encoding: utf-8
from collections import OrderedDict
import sys, os
import fnmatch
import waflib
from waflib import Utils
from waflib.Configure import conf
_board_classes = {}
_board = None
class BoardMeta(type):
def __init__(cls, name, bases, dct):
super(BoardMeta, cls).__init__(... | gpl-3.0 |
Harunx9/Transaltors | Lexer/Lexer/env/Lib/site-packages/pip/_vendor/html5lib/html5parser.py | 310 | 117029 | from __future__ import absolute_import, division, unicode_literals
from pip._vendor.six import with_metaclass
import types
from . import inputstream
from . import tokenizer
from . import treebuilders
from .treebuilders._base import Marker
from . import utils
from . import constants
from .constants import spaceChara... | mit |
Alwnikrotikz/visvis.dev | core/events.py | 5 | 18145 | # -*- coding: utf-8 -*-
# Copyright (C) 2012, Almar Klein
#
# Visvis is distributed under the terms of the (new) BSD License.
# The full license can be found in 'license.txt'.
""" Module events
Defines the events and a timer class.
"""
import sys
import time
import traceback
import weakref
class CallableObject:
... | bsd-3-clause |
sharoonthomas/fulfil-python-api | fulfil_client/signals.py | 2 | 1553 | # -*- coding: utf-8 -*-
"""
flask.signals
~~~~~~~~~~~~~
Implements signals based on blinker if available, otherwise
falls silently back to a noop.
:copyright: (c) 2018 Fulfil.IO Inc.
The blinker fallback code is inspired by Armin's implementation
on Flask.
:copyright: (c) 2015 by Armin... | isc |
tximikel/kuma | vendor/packages/logilab/common/deprecation.py | 92 | 7417 | # copyright 2003-2012 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 Lesser General Public License as publ... | mpl-2.0 |
sbalun/namebench | nb_third_party/dns/tsig.py | 215 | 7851 | # Copyright (C) 2001-2007, 2009, 2010 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED ... | apache-2.0 |
adamchainz/ansible | lib/ansible/modules/network/dellos10/dellos10_command.py | 46 | 7522 | #!/usr/bin/python
#
# (c) 2015 Peter Sprygada, <psprygada@ansible.com>
#
# Copyright (c) 2017 Dell Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either versi... | gpl-3.0 |
crdrost/fm-demo | accumulators.py | 1 | 3054 | import itertools
'''
An `accumulator` adds some push-based stream semantics to Python iterators,
which are pull-based (they do stuff when you ask for values, not when data is
available). To do this we define an accumulator as a function from iterators to
iterators, where the output iterator will make exactly one reque... | mpl-2.0 |
vied12/superdesk | server/superdesk/commands/rebuild_elastic_index.py | 1 | 1856 | # -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/license
from superd... | agpl-3.0 |
kanagasabapathi/python-for-android | python-modules/twisted/twisted/conch/test/test_openssh_compat.py | 60 | 3381 | # Copyright (c) 2001-2008 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.conch.openssh_compat}.
"""
import os
from twisted.trial.unittest import TestCase
from twisted.python.filepath import FilePath
from twisted.python.compat import set
try:
import Crypto.Cipher.DES3
import ... | apache-2.0 |
kostyll/usb-flash-network-monitor | server/indexpage.py | 2 | 23167 | import html
from html import *
from copy import deepcopy
import web_face_gen_templatete
from web_face_gen_templatete import render_html
from utils import _
DEBUG = web_face_gen_templatete.DEBUG
class rendered(object):
def __call__(self,func):
def wrapper(class_instance,ctx):
context = deepco... | mit |
jchanvfx/bpNodeGraph | NodeGraphQt/widgets/properties_bin.py | 1 | 6926 | #!/usr/bin/python
from NodeGraphQt import QtWidgets, QtCore, QtGui, QtCompat
from NodeGraphQt.widgets.properties import NodePropWidget
class PropertiesDelegate(QtWidgets.QStyledItemDelegate):
def paint(self, painter, option, index):
"""
Args:
painter (QtGui.QPainter):
opt... | mit |
aabadie/scikit-learn | sklearn/utils/tests/test_testing.py | 24 | 7902 | import warnings
import unittest
import sys
from nose.tools import assert_raises
from sklearn.utils.testing import (
_assert_less,
_assert_greater,
assert_less_equal,
assert_greater_equal,
assert_warns,
assert_no_warnings,
assert_equal,
set_random_state,
assert_raise_message,
ig... | bsd-3-clause |
msegado/edx-platform | lms/djangoapps/instructor/tests/utils.py | 121 | 2732 | """
Utilities for instructor unit tests
"""
import datetime
import json
import random
from django.utils.timezone import utc
from util.date_utils import get_default_time_display
class FakeInfo(object):
"""Parent class for faking objects used in tests"""
FEATURES = []
def __init__(self):
for featur... | agpl-3.0 |
ak2703/edx-platform | lms/djangoapps/instructor/features/common.py | 63 | 4609 | """
Define common steps for instructor dashboard acceptance tests.
"""
# pylint: disable=missing-docstring
# pylint: disable=redefined-outer-name
from __future__ import absolute_import
from lettuce import world, step
from mock import patch
from nose.tools import assert_in # pylint: disable=no-name-in-module
from c... | agpl-3.0 |
matthiasdiener/spack | var/spack/repos/builtin/packages/r-desolve/package.py | 5 | 1817 | ##############################################################################
# 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 |
Khan/agar | lib/unittest2/test/test_functiontestcase.py | 122 | 5570 | import unittest2
from unittest2.test.support import LoggingResult
class Test_FunctionTestCase(unittest2.TestCase):
# "Return the number of tests represented by the this test object. For
# unittest2.TestCase instances, this will always be 1"
def test_countTestCases(self):
test = unittest2.Functio... | mit |
pheelee/tinynfogen | libs/enzyme/mkv.py | 163 | 30439 | # -*- coding: utf-8 -*-
# enzyme - Video metadata parser
# Copyright 2011-2012 Antoine Bertin <diaoulael@gmail.com>
# Copyright 2003-2006 Thomas Schueppel <stain@acm.org>
# Copyright 2003-2006 Dirk Meyer <dischi@freevo.org>
# Copyright 2003-2006 Jason Tackaberry <tack@urandom.ca>
#
# This file is part of enzyme.
#
# en... | gpl-2.0 |
TaiwanStat/real.taiwanstat.com | wind-weather/update_data10hpa.py | 1 | 2850 | import sys
import subprocess
import datetime
'''
http://nomads.ncep.noaa.gov/cgi-bin/filter_gfs_1p00.pl?dir=%2Fgfs.2015051406
http://www.nco.ncep.noaa.gov/pmb/products/gfs/gfs.t00z.pgrbf00.grib2.shtml
'''
import os
base_dir = os.path.dirname(os.path.abspath(__file__))
os.chdir(base_dir)
i = (datetime.datetime.now() - ... | mit |
njwilson23/rasterio | examples/total.py | 7 | 1277 | import numpy
import rasterio
import subprocess
with rasterio.drivers(CPL_DEBUG=True):
# Read raster bands directly to Numpy arrays.
with rasterio.open('tests/data/RGB.byte.tif') as src:
r, g, b = src.read()
# Combine arrays using the 'iadd' ufunc. Expecting that the sum will
# exceed the 8-bi... | bsd-3-clause |
scriptnull/coala | coalib/misc/StringConverter.py | 2 | 4772 | from collections import Iterable, OrderedDict
import re
from coalib.misc import Constants
from coalib.parsing.StringProcessing import (unescaped_split,
unescaped_strip,
unescape)
class StringConverter:
"""
Converts strin... | agpl-3.0 |
maclandrol/ete | ete2/nexml/_nexml.py | 3 | 749187 | # #START_LICENSE###########################################################
#
#
# This file is part of the Environment for Tree Exploration program
# (ETE). http://etetoolkit.org
#
# ETE is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# t... | gpl-3.0 |
phobson/statsmodels | statsmodels/sandbox/tsa/movstat.py | 34 | 14871 | '''using scipy signal and numpy correlate to calculate some time series
statistics
original developer notes
see also scikits.timeseries (movstat is partially inspired by it)
added 2009-08-29
timeseries moving stats are in c, autocorrelation similar to here
I thought I saw moving stats somewhere in python, maybe not)... | bsd-3-clause |
mattmccarthy11/vidly-development | bk/mediadrop/lib/tests/players_test.py | 10 | 1427 | # -*- coding: utf-8 -*-
# This file is a part of MediaDrop (http://www.mediadrop.net),
# Copyright 2009-2015 MediaDrop contributors
# For the exact contribution history, see the git revision log.
# The source code in this file is dual licensed under the MIT license or
# the GPLv3 or (at your option) any later version.
... | gpl-3.0 |
Wen777/beets | beets/util/functemplate.py | 16 | 19245 | # This file is part of beets.
# Copyright 2013, Adrian Sampson.
#
# 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, ... | mit |
MariaSolovyeva/inasafe | safe/impact_functions/volcanic/volcano_point_building/impact_function.py | 2 | 8807 | # coding=utf-8
"""InaSAFE Disaster risk tool by Australian Aid - Volcano Point on Building
Impact Function.
Contact : ole.moller.nielsen@gmail.com
.. note:: 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 Soft... | gpl-3.0 |
somehume/wavefu | src/python/api/django_oauth.py | 9 | 4076 | #!/usr/bin/python2.4
#
# Copyright (C) 2009 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 l... | apache-2.0 |
GeyerA/android_external_chromium_org | build/extract_from_cab.py | 51 | 2058 | #!/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.
"""Extracts a single file from a CAB archive."""
import os
import shutil
import subprocess
import sys
import tempfile
def run_qui... | bsd-3-clause |
Johnetordoff/osf.io | api_tests/providers/preprints/views/test_preprint_provider_list.py | 13 | 3037 | import mock
import pytest
from waffle.testutils import override_switch
from osf import features
from api.base.settings.defaults import API_BASE
from osf_tests.factories import (
AuthUserFactory,
PreprintProviderFactory,
)
@pytest.fixture(params=['/{}preprint_providers/?version=2.2&', '/{}providers/preprints/?... | apache-2.0 |
wireservice/agate | tests/test_py3.py | 1 | 7971 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import csv
import six
import os
try:
import unittest2 as unittest
except ImportError:
import unittest
from agate import csv_py3
from agate.exceptions import FieldSizeLimitError
@unittest.skipIf(six.PY2, "Not supported in Python 2.")
class TestReader(unittest.Te... | mit |
otsaloma/pan-bikes | providers/test/test_hsl.py | 1 | 1746 | # -*- coding: utf-8 -*-
# Copyright (C) 2017 Osmo Salomaa
#
# 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 pr... | gpl-3.0 |
ecosoft-odoo/odoo | openerp/report/render/rml.py | 457 | 3244 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
sarakha63/persomov | libs/git/repository.py | 109 | 20401 | # Copyright (c) 2009, Rotem Yaari <vmalloc@gmail.com>
# 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 li... | gpl-3.0 |
QingChenmsft/azure-cli | src/command_modules/azure-cli-component/azure/cli/command_modules/component/custom.py | 4 | 8044 | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | mit |
jemmyw/ansible | lib/ansible/plugins/callback/oneline.py | 144 | 3487 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# 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) an... | gpl-3.0 |
ryfeus/lambda-packs | Keras_tensorflow/source/tensorflow/python/debug/cli/offline_analyzer.py | 16 | 2561 | # 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... | mit |
naturali/tensorflow | tensorflow/python/kernel_tests/stack_ops_test.py | 21 | 5173 | # 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 |
mattclay/ansible | lib/ansible/inventory/group.py | 22 | 9603 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# 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) an... | gpl-3.0 |
okor/thumbor | tests/error_handlers/test_file.py | 7 | 4551 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# thumbor imaging service
# https://github.com/thumbor/thumbor/wiki
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license
# Copyright (c) 2011 globo.com thumbor@googlegroups.com
import json
import tempfile
from preggy import expect
from thumbor... | mit |
moreati/django | django/contrib/admin/templatetags/admin_urls.py | 553 | 1812 | from django import template
from django.contrib.admin.utils import quote
from django.core.urlresolvers import Resolver404, get_script_prefix, resolve
from django.utils.http import urlencode
from django.utils.six.moves.urllib.parse import parse_qsl, urlparse, urlunparse
register = template.Library()
@register.filter
... | bsd-3-clause |
FireWRT/OpenWrt-Firefly-Libraries | staging_dir/target-mipsel_1004kc+dsp_uClibc-0.9.33.2/usr/lib/python2.7/multiprocessing/dummy/connection.py | 168 | 2807 | #
# Analogue of `multiprocessing.connection` which uses queues instead of sockets
#
# multiprocessing/dummy/connection.py
#
# Copyright (c) 2006-2008, R Oudkerk
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditi... | gpl-2.0 |
d40223223/2015cdb_g6-team | static/Brython3.1.1-20150328-091302/Lib/_imp.py | 625 | 2115 | """(Extremely) low-level import machinery bits as used by importlib and imp."""
class __loader__(object):pass
def _fix_co_filename(*args,**kw):
raise NotImplementedError("%s:not implemented" % ('_imp.py:_fix_co_filename'))
def acquire_lock(*args,**kw):
"""acquire_lock() -> None Acquires the interpreter's... | gpl-3.0 |
mollstam/UnrealPy | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/Cython-0.22.1/tests/run/for_in_iter.py | 26 | 2837 | # mode: run
# tag: forin
import sys
import cython
try:
from builtins import next
except ImportError:
def next(it):
return it.next()
def for_in_pyiter_pass(it):
"""
>>> it = Iterable(5)
>>> for_in_pyiter_pass(it)
>>> next(it)
Traceback (most recent call last):
StopIteration
... | mit |
Ma233/django-xadmin-fonts | setup.py | 19 | 1635 | #!/usr/bin/env python
from setuptools import setup
# version_tuple = __import__('xadmin.version').VERSION
# version = ".".join([str(v) for v in version_tuple])
setup(
name='django-xadmin',
version='0.5.0',
description='Drop-in replacement of Django admin comes with lots of goodies, fully extensible with p... | bsd-3-clause |
justinpotts/mozillians | mozillians/users/migrations/0058_auto__add_field_userprofile_geo_country__add_field_userprofile_geo_reg.py | 3 | 16957 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'UserProfile.geo_country'
db.add_column('profile', 'geo_country',
self.... | bsd-3-clause |
Architektor/PySnip | venv/lib/python2.7/site-packages/twisted/spread/ui/tkutil.py | 11 | 12919 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""Utilities for building L{PB<twisted.spread.pb>} clients with L{Tkinter}.
"""
from Tkinter import (
ACTIVE, Button, Canvas, E, END, Entry, Frame, Label, LEFT, Listbox,
mainloop, N, S, StringVar, Toplevel, Tk, W)
from tkSimpleDialog impor... | gpl-3.0 |
ianstalk/Flexget | flexget/components/tmdb/api.py | 2 | 5008 | from flask import jsonify
from flask_restx import inputs
from flexget import plugin
from flexget.api import APIResource, api
from flexget.api.app import BadRequest, NotFoundError, etag
tmdb_api = api.namespace('tmdb', description='TMDB lookup endpoint')
class ObjectsContainer:
poster_object = {
'type': ... | mit |
dendisuhubdy/tensorflow | tensorflow/contrib/linear_optimizer/__init__.py | 158 | 1308 | # 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 |
Yannig/ansible | lib/ansible/modules/packaging/language/bundler.py | 12 | 7076 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Tim Hoiberg <tim.hoiberg@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 |
wizkid057/eloipool | bitcoin/txn.py | 16 | 4465 | # Eloipool - Python Bitcoin pool server
# Copyright (C) 2011-2012 Luke Dashjr <luke-jr+eloipool@utopios.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# L... | agpl-3.0 |
bigjosh/Arduino | arduino-core/src/processing/app/i18n/python/requests/packages/charade/langbulgarianmodel.py | 2965 | 12784 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client 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 R... | lgpl-2.1 |
IV-GII/SocialCookies | ENV1/lib/python2.7/site-packages/django/contrib/gis/db/models/sql/where.py | 118 | 3987 | from django.db.models.constants import LOOKUP_SEP
from django.db.models.fields import FieldDoesNotExist
from django.db.models.sql.expressions import SQLEvaluator
from django.db.models.sql.where import Constraint, WhereNode
from django.contrib.gis.db.models.fields import GeometryField
class GeoConstraint(Constraint):
... | gpl-2.0 |
JioCloud/horizon | openstack_dashboard/test/test_data/glance_data.py | 2 | 8133 | # Copyright 2012 Nebula, 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 agree... | apache-2.0 |
skevy/django | django/contrib/auth/models.py | 2 | 18017 | import datetime
import hashlib
import urllib
from django.contrib import auth
from django.contrib.auth.signals import user_logged_in
from django.core.exceptions import ImproperlyConfigured
from django.db import models
from django.db.models.manager import EmptyManager
from django.contrib.contenttypes.models import Conte... | bsd-3-clause |
mheap/ansible | test/units/module_utils/urls/test_generic_urlparse.py | 144 | 1919 | # -*- coding: utf-8 -*-
# (c) 2018 Matt Martz <matt@sivel.net>
# 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
from ansible.module_utils.urls import generic_urlparse
from ansible.module_u... | gpl-3.0 |
v-iam/azure-sdk-for-python | azure-servicefabric/azure/servicefabric/models/service_type_health_policy.py | 2 | 3884 | # 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 ... | mit |
40023256/2015cdag1man | static/Brython3.1.3-20150514-095342/Lib/unittest/test/test_suite.py | 791 | 12066 | import unittest
import sys
from .support import LoggingResult, TestEquality
### Support code for Test_TestSuite
################################################################
class Test(object):
class Foo(unittest.TestCase):
def test_1(self): pass
def test_2(self): pass
def test_3(self... | gpl-3.0 |
niieani/rethinkdb | external/gtest_1.6.0/test/gtest_xml_outfiles_test.py | 2526 | 5340 | #!/usr/bin/env python
#
# Copyright 2008, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | agpl-3.0 |
camradal/ansible | lib/ansible/modules/notification/sendgrid.py | 9 | 9032 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Matt Makai <matthew.makai@gmail.com>
#
# 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 ... | gpl-3.0 |
mcsosa121/cafa | cafaenv/lib/python2.7/site-packages/django/contrib/admin/widgets.py | 345 | 14769 | """
Form Widget classes specific to the Django admin site.
"""
from __future__ import unicode_literals
import copy
from django import forms
from django.contrib.admin.templatetags.admin_static import static
from django.core.urlresolvers import reverse
from django.db.models.deletion import CASCADE
from django.forms.uti... | mit |
AnsgarSchmidt/sensomatic | server/Chromecast.py | 1 | 6445 | import os
import sys
import pafy
import time
import Queue
import logging
import threading
import ConfigParser
import pychromecast
import paho.mqtt.client as mqtt
class Chromecast(threading.Thread):
def _readConfig(self):
update = False
if not os.path.isdir(self._homeDir):
print ... | apache-2.0 |
lattwood/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/common/read_checksum_from_png.py | 207 | 1877 | # Copyright (c) 2011 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... | bsd-3-clause |
dklann/rivendell | apis/pypad/scripts/pypad_live365.py | 2 | 2842 | #!%PYTHON_BANGPATH%
# pypad_live365.py
#
# Write PAD updates to Live365 stations
#
# (C) Copyright 2018-2019 Fred Gleason <fredg@paravelsystems.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Fr... | gpl-2.0 |
aungmyo/iso8583py | ISO8583/ISO8583.py | 6 | 50397 | """
(C) Copyright 2009 Igor V. Custodio
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
any later version.
This program is distributed in the hope that ... | gpl-3.0 |
superchilli/webapp | venv/lib/python2.7/site-packages/setuptools/ssl_support.py | 104 | 8220 | import os
import socket
import atexit
import re
import functools
from setuptools.extern.six.moves import urllib, http_client, map, filter
from pkg_resources import ResolutionError, ExtractionError
try:
import ssl
except ImportError:
ssl = None
__all__ = [
'VerifyingHTTPSHandler', 'find_ca_bundle', 'is_a... | mit |
wonder-sk/QGIS | python/plugins/processing/gui/GeometryPredicateSelectionPanel.py | 5 | 4757 | # -*- coding: utf-8 -*-
"""
***************************************************************************
PredicatePanel.py
---------------------
Date : January 2015
Copyright : (C) 2015 by Arnaud Morvan
Email : arnaud dot morvan at camptocamp dot com
Con... | gpl-2.0 |
xin3liang/platform_external_chromium_org_third_party_WebKit | Tools/Scripts/webkitpy/style/filereader_unittest.py | 51 | 6710 | # Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org)
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and... | bsd-3-clause |
sebgoa/client-python | kubernetes/client/models/v1alpha1_policy_rule.py | 2 | 8145 | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.7.4
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.