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 |
|---|---|---|---|---|---|
ajoubert-mitre/geoq | geoq/maps/migrations/0014_add_map_layer_user_remembered_params.py | 5 | 20522 | # -*- 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 model 'MapLayerUserRememberedParams'
db.create_table(u'maps_maplayeruserrememberedparams', (
... | mit |
DONIKAN/django | django/core/serializers/xml_serializer.py | 124 | 15694 | """
XML serializer.
"""
from __future__ import unicode_literals
from collections import OrderedDict
from xml.dom import pulldom
from xml.sax import handler
from xml.sax.expatreader import ExpatParser as _ExpatParser
from django.apps import apps
from django.conf import settings
from django.core.serializers import bas... | bsd-3-clause |
gurneyalex/odoo | addons/payment_test/models/payment_acquirer.py | 4 | 1751 | # coding: utf-8
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from datetime import datetime
from uuid import uuid4
from odoo import api, exceptions, fields, models, _
class PaymentAcquirerTest(models.Model):
_inherit = 'payment.acquirer'
provider = fields.Selection(selection_ad... | agpl-3.0 |
BigDataforYou/movie_recommendation_workshop_1 | big_data_4_you_demo_1/venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/mbcssm.py | 1783 | 19590 | ######################## 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 |
damdam-s/OCB | openerp/tools/config.py | 10 | 36945 | #openerp.loggers.handlers. -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010-2014 OpenERP s.a. (<http://openerp.com>).
#
# This program... | agpl-3.0 |
mindbender-studio/setup | bin/windows/python36/Lib/site-packages/pkg_resources/_vendor/packaging/_structures.py | 1152 | 1416 | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
class Infinity(object):
def __repr__(self):
return "Infinity... | mit |
devoid/nova | nova/console/rpcapi.py | 12 | 2746 | # Copyright 2013 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 agre... | apache-2.0 |
DivineHime/seishirou | lib/requests/packages/chardet/jpcntx.py | 289 | 19643 | ######################## 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... | gpl-3.0 |
fuzeman/plex.py | tests/test_preferences.py | 1 | 1457 | from plex import Plex
from tests.core.helpers import read
import responses
# Set client configuration defaults
Plex.configuration.defaults.server(host='mock')
@responses.activate
def test_get_all():
responses.add(
responses.GET, 'http://mock:32400/:/prefs',
body=read('fixtures/prefs.xml'), statu... | mit |
rouault/pycsw | docs/conf.py | 3 | 10581 | # -*- coding: utf-8 -*-
# =================================================================
#
# Authors: Tom Kralidis <tomkralidis@gmail.com>
#
# Copyright (c) 2015 Tom Kralidis
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
# files (the ... | mit |
ayoubg/gem5-graphics | gem5/src/arch/x86/isa/insts/simd128/floating_point/arithmetic/reciprocal_estimation.py | 62 | 2158 | # Copyright (c) 2007 The Hewlett-Packard Development Company
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implemen... | bsd-3-clause |
cmeessen/VelocityConversion | test.py | 1 | 1632 | import unittest
import numpy as np
from VelocityConversion import MantleConversion, UnavailableMethodError
def assemblage():
a = {
"ol": 0.617,
"cpx": 0.133,
"opx": 0.052,
"gnt": 0.153,
"jd": 0.045,
"XFe": 0.11
}
return a
class TestVelocityConversion(unittes... | gpl-3.0 |
lmazuel/azure-sdk-for-python | azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/__init__.py | 4 | 3967 | # 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 |
DrMeers/django | django/contrib/admin/views/main.py | 5 | 17274 | from collections import OrderedDict
import sys
import warnings
from django.core.exceptions import SuspiciousOperation, ImproperlyConfigured
from django.core.paginator import InvalidPage
from django.core.urlresolvers import reverse
from django.db import models
from django.db.models.fields import FieldDoesNotExist
from ... | bsd-3-clause |
ramineni/myironic | ironic/tests/conf_fixture.py | 11 | 1431 | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# 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 ... | apache-2.0 |
Sumith1896/sympy | sympy/polys/compatibility.py | 96 | 56525 | """Compatibility interface between dense and sparse polys. """
from __future__ import print_function, division
from sympy.polys.densearith import dup_add_term
from sympy.polys.densearith import dmp_add_term
from sympy.polys.densearith import dup_sub_term
from sympy.polys.densearith import dmp_sub_term
from sympy.poly... | bsd-3-clause |
e-sensing/wtss.py | src/setup.py | 1 | 1272 | #
# Copyright (C) 2014 National Institute For Space Research (INPE) - Brazil.
#
# This file is part of Python Client API for Web Time Series Service.
#
# Web Time Series Service for Python is free software: you can
# redistribute it and/or modify it under the terms of the
# GNU Lesser General Public License as pu... | lgpl-3.0 |
kaixinjxq/crosswalk-test-suite | cordova/cordova-sampleapp-android-tests/sampleapp/Eh_build.py | 18 | 1913 | #!/usr/bin/env python
#
# Copyright (c) 2015 Intel Corporation.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of works must retain the original copyright notice, this
# list of conditions and t... | bsd-3-clause |
adrianschroeter/kiwi | test/unit/tasks_system_prepare_test.py | 1 | 8707 | import sys
import mock
import os
from mock import patch, call
import kiwi
from .test_helper import argv_kiwi_tests
from kiwi.tasks.system_prepare import SystemPrepareTask
class TestSystemPrepareTask(object):
def setup(self):
sys.argv = [
sys.argv[0], '--profile', 'vmxFlavour', 'system', 'p... | gpl-3.0 |
rockstor/rockstor-core | src/rockstor/smart_manager/views/docker_service.py | 2 | 6894 | """
Copyright (c) 2012-2020 RockStor, Inc. <http://rockstor.com>
This file is part of RockStor.
RockStor 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 la... | gpl-3.0 |
hwu25/AppPkg | Applications/Python/Python-2.7.2/Lib/rfc822.py | 58 | 34306 | """RFC 2822 message manipulation.
Note: This is only a very rough sketch of a full RFC-822 parser; in particular
the tokenizing of addresses does not adhere to all the quoting rules.
Note: RFC 2822 is a long awaited update to RFC 822. This module should
conform to RFC 2822, and is thus mis-named (it's not wort... | bsd-2-clause |
voer-platform/vp.web | vpw/migrations/0012_auto__add_settings.py | 1 | 8038 | # -*- 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
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Settings'
db.create_table(u'vpw_settings', (
... | agpl-3.0 |
alianmohammad/pd-gem5 | src/arch/x86/isa/insts/simd128/floating_point/data_conversion/convert_floating_point_to_floating_point.py | 90 | 4105 | # Copyright (c) 2007 The Hewlett-Packard Development Company
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implemen... | bsd-3-clause |
dset0x/invenio | invenio/base/utils.py | 4 | 11822 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2011, 2012, 2013, 2014, 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 (a... | gpl-2.0 |
gibiansky/tensorflow | tensorflow/contrib/learn/python/learn/utils/inspect_checkpoint.py | 19 | 2317 | # 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 |
jch1/models | pcl_rl/controller.py | 7 | 16079 | # 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 applicab... | apache-2.0 |
ZeitOnline/zeit.retresco | setup.py | 1 | 1668 | from setuptools import setup, find_packages
import os.path
def project_path(*names):
return os.path.join(os.path.dirname(__file__), *names)
setup(
name='zeit.retresco',
version='1.32.3.dev0',
author='gocept, Zeit Online',
author_email='zon-backend@zeit.de',
url='http://www.zeit.de/',
des... | bsd-3-clause |
mattclark/osf.io | api_tests/nodes/views/test_node_sparse_fieldsets.py | 2 | 10117 | import pytest
from api.base.settings.defaults import API_BASE
from osf_tests.factories import (
ProjectFactory,
AuthUserFactory,
PrivateLinkFactory,
)
from osf.utils import permissions
@pytest.fixture()
def user():
return AuthUserFactory()
@pytest.mark.django_db
@pytest.mark.enable_quickfiles_creat... | apache-2.0 |
hail-is/hail | hail/python/hail/ir/table_ir.py | 1 | 25125 | import json
import hail as hl
from hail.expr.types import dtype
from hail.ir.base_ir import BaseIR, TableIR
from hail.utils.java import Env
from hail.utils.misc import escape_str, parsable_strings, dump_json, escape_id
class MatrixRowsTable(TableIR):
def __init__(self, child):
super().__init__(child)
... | mit |
grnet/snf-image-creator | image_creator/distro/unsupported.py | 2 | 1326 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2011-2018 GRNET S.A.
#
# 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.
#
# Thi... | gpl-3.0 |
pymedusa/Medusa | ext/github/Project.py | 2 | 7975 | # -*- coding: utf-8 -*-
############################ Copyrights and license ############################
# #
# Copyright 2018 bbi-yggy <yossarian@blackbirdinteractive.com> #
# ... | gpl-3.0 |
jordotech/sherri_satchmo | satchmo/apps/satchmo_store/shop/listeners.py | 4 | 3503 | from livesettings import config_value
from payment.listeners import capture_on_ship_listener
from product.models import Product
from product.listeners import default_product_search_listener, discount_used_listener
from satchmo_store.contact import signals as contact_signals
from satchmo_store.mail import send_html_emai... | bsd-3-clause |
neerajvashistha/pa-dude | lib/python2.7/site-packages/numpy/core/tests/test_numeric.py | 18 | 83788 | from __future__ import division, absolute_import, print_function
import sys
import warnings
import itertools
import platform
from decimal import Decimal
import numpy as np
from numpy.core import umath
from numpy.random import rand, randint, randn
from numpy.testing import (
TestCase, run_module_suite, assert_, as... | mit |
eval1749/elang | build/android/devil/android/sdk/aapt.py | 7 | 1152 | # Copyright 2015 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.
"""This module wraps the Android Asset Packaging Tool."""
import os
from devil.utils import cmd_helper
from pylib import constants
_AAPT_PATH = os.path.jo... | apache-2.0 |
wawtechnologies/linux-kernel-3.14.51-catchwire-kalitap | Documentation/target/tcm_mod_builder.py | 868 | 40692 | #!/usr/bin/python
# The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD
#
# Copyright (c) 2010 Rising Tide Systems
# Copyright (c) 2010 Linux-iSCSI.org
#
# Author: nab@kernel.org
#
import os, sys
import subprocess as sub
import string
import re
import optparse
tcm_dir = ""
fabric_ops... | gpl-2.0 |
scramblingbalam/Alta_Real | tweet_dumper.py | 1 | 2119 | # -*- coding: utf-8 -*-
"""
Created on Tue Mar 28 15:18:19 2017
@author: yanofsky
from https://gist.github.com/yanofsky/5436496
"""
#!/usr/bin/env python
# encoding: utf-8
import tweepy #https://github.com/tweepy/tweepy
import csv
#Twitter API credentials
consumer_key = "hGqgNKnozGGUZB3IyW6Noheky"
consumer_secret =... | mit |
vmrob/needy | tests/unit/test_process.py | 3 | 1049 | import os
import subprocess
import sys
import unittest
import needy.process
class ProcessTest(unittest.TestCase):
def test_list_command_output(self):
self.assertEqual('hello', needy.process.command_output([sys.executable, '-c', 'print(\'hello\')']).strip())
def test_shell_command_output(self):
... | mit |
tmimori/frappe | frappe/email/doctype/auto_email_report/test_auto_email_report.py | 17 | 1091 | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest, json
# test_records = frappe.get_test_records('Auto Email Report')
class TestAutoEmailReport(unittest.TestCase):
def test_auto_email(self):
fr... | mit |
deeice/bunjalloo | waf_tools/devkitarm.py | 5 | 2313 | #!/usr/bin/python
import os
def get_devkitarm_bin():
try:
return os.path.join(os.environ['DEVKITARM'], 'bin')
except KeyError:
return ''
def detect(conf):
from Logs import warn
if 'DEVKITARM' not in os.environ:
warn("`DEVKITARM' variable is not set, compiler may not be found")
... | gpl-3.0 |
horance-liu/tensorflow | tensorflow/contrib/learn/python/learn/datasets/synthetic.py | 120 | 6827 | # 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 |
rrohan/scikit-learn | examples/cluster/plot_kmeans_stability_low_dim_dense.py | 338 | 4324 | """
============================================================
Empirical evaluation of the impact of k-means initialization
============================================================
Evaluate the ability of k-means initializations strategies to make
the algorithm convergence robust as measured by the relative stan... | bsd-3-clause |
nivertech/libsnark | src/reductions/tbcs_to_uscs/get_tbcs_reduction.py | 6 | 1708 | #!/usr/bin/env python
##
# @author This file is part of libsnark, developed by SCIPR Lab
# and contributors (see AUTHORS).
# @copyright MIT license (see LICENSE file)
from __future__ import division
import itertools
def valid_formula(truth_table, x_coeff, y_coeff, z_coeff, offset):
for x in [0,1]... | mit |
RobertABT/heightmap | build/scipy/scipy/linalg/decomp_cholesky.py | 16 | 9462 | """Cholesky decomposition functions."""
from __future__ import division, print_function, absolute_import
from numpy import asarray_chkfinite, asarray
# Local imports
from .misc import LinAlgError, _datacopied
from .lapack import get_lapack_funcs
__all__ = ['cholesky', 'cho_factor', 'cho_solve', 'cholesky_banded',
... | mit |
certik/hermes1d | hermes_common/convert_api.py | 9 | 1932 | #! /usr/bin/env python
from time import strftime, localtime
def convert_h():
f = open("_hermes_common_api_new.h", "w")
f.write("/* Generated by convert_api.py on %s */\n\n" % \
strftime("%a %b %d %H:%M:%S %Y", localtime()));
lines = open("_hermes_common_api.h").readlines()
line = lines[0];... | bsd-3-clause |
PaulWay/spacewalk | client/debian/packages-already-in-debian/rhn-client-tools/src/firstboot/rhn_start_gui.py | 21 | 4456 | # Copyright 2006--2010 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT... | gpl-2.0 |
Qalthos/ansible | lib/ansible/plugins/connection/winrm.py | 5 | 30875 | # (c) 2014, Chris Church <chris@ninemoreminutes.com>
# Copyright (c) 2017 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
DOCUMENTATION = """
author: Ansible Core Te... | gpl-3.0 |
perimosocordiae/scipy | scipy/interpolate/_pade.py | 18 | 1798 | from numpy import zeros, asarray, eye, poly1d, hstack, r_
from scipy import linalg
__all__ = ["pade"]
def pade(an, m, n=None):
"""
Return Pade approximation to a polynomial as the ratio of two polynomials.
Parameters
----------
an : (N,) array_like
Taylor series coefficients.
m : int
... | bsd-3-clause |
furf/pledge_service | lib/mailchimp/requests/packages/chardet/chardistribution.py | 2755 | 9226 | ######################## 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... | apache-2.0 |
RelentlessCoffee/tea2 | product.py | 1 | 1495 | import requests
import bs4
import json
class NoMaxQuantity(Exception):
pass
def load_single_page(url):
response = requests.get(url)
soup = bs4.BeautifulSoup(response.text, 'html.parser')
return soup
def _find_options_from_form(soup):
form = soup.find("form", class_="variations_form cart")
... | mit |
onitake/ansible | lib/ansible/modules/system/cronvar.py | 73 | 13521 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Cronvar Plugin: The goal of this plugin is to provide an idempotent
# method for set cron variable values. It should play well with the
# exi... | gpl-3.0 |
DavidAndreev/indico | indico/modules/events/timetable/blueprint.py | 1 | 6179 | # This file is part of Indico.
# Copyright (C) 2002 - 2016 European Organization for Nuclear Research (CERN).
#
# Indico 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 (a... | gpl-3.0 |
cogniteev/flask-oauthlib | tests/oauth1/server.py | 16 | 7152 | # coding: utf-8
from flask import g, render_template, request, jsonify
from flask_sqlalchemy import SQLAlchemy
from flask_oauthlib.provider import OAuth1Provider
db = SQLAlchemy()
def enable_log(name='flask_oauthlib'):
import logging
logger = logging.getLogger(name)
logger.addHandler(logging.StreamHandl... | bsd-3-clause |
marineam/nagcat | python/nagcat/query.py | 1 | 9568 | # Copyright 2008-2009 ITA Software, 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 ... | apache-2.0 |
ZhouJiaLinmumu/Grasp-and-lift-EEG-challenge | lvl2/genEns.py | 4 | 3742 | # -*- coding: utf-8 -*-
"""
Created on Sat Aug 15 14:12:12 2015
@author: rc, alex
"""
import os
import sys
if __name__ == '__main__' and __package__ is None:
filePath = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.append(filePath)
import numpy as np
import yaml
from copy import deepcop... | bsd-3-clause |
koushikcgit/xen-api | ocaml/idl/binding_sanity_checks/metrics.py | 34 | 5011 | #!/usr/bin/env python
import XenAPI
import sanitychecklib
from pprint import pprint, pformat
#Generally, we wish to announce the name of this file.
#When running in the interpreter, however, this doesn't exist, and we
#probably shouldn't log out either
try:
this_test_name = __file__
logout_after_test = True
e... | lgpl-2.1 |
SaschaMester/delicium | chrome/common/extensions/docs/server2/cache_chain_object_store.py | 53 | 3339 | # 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.
from future import All, Future
from object_store import ObjectStore
class CacheChainObjectStore(ObjectStore):
'''Maintains an in-memory cache along with ... | bsd-3-clause |
telwertowski/QGIS | tests/src/python/test_authmanager_ogr_postgres.py | 15 | 8858 | # -*- coding: utf-8 -*-
"""
Tests for auth manager Basic Auth access to postgres.
This is an integration test for QGIS Desktop Auth Manager postgres provider that
checks if QGIS can use a stored auth manager auth configuration to access
a username/password protected postgres.
Configuration from the environment:
... | gpl-2.0 |
mojwang/selenium | py/selenium/webdriver/common/keys.py | 53 | 2347 | # Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | apache-2.0 |
samba-team/samba | third_party/waf/waflib/Tools/ccroot.py | 40 | 26260 | #!/usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2005-2018 (ita)
"""
Classes and methods shared by tools providing support for C-like language such
as C/C++/D/Assembly/Go (this support module is almost never used alone).
"""
import os, re
from waflib import Task, Utils, Node, Errors, Logs
from waflib.TaskGen im... | gpl-3.0 |
matmutant/sl4a | python/src/Lib/test/test_with.py | 53 | 23715 | #!/usr/bin/env python
"""Unit tests for the with statement specified in PEP 343."""
__author__ = "Mike Bland"
__email__ = "mbland at acm dot org"
import sys
import unittest
from collections import deque
from contextlib import GeneratorContextManager, contextmanager
from test.test_support import run_unittest
class... | apache-2.0 |
shawnlinq/SlqBlog2 | accounts/permissions.py | 1 | 1727 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from flask import current_app
from flask_principal import Permission, RoleNeed, UserNeed, identity_loaded
from flask_login import current_user
# admin_need = RoleNeed('admin')
# editor_need = RoleNeed('editor')
# writer_need = RoleNeed('writer')
# reader_need = ... | gpl-2.0 |
bmanojlovic/ansible | lib/ansible/modules/network/basics/uri.py | 7 | 17956 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Romeo Theriault <romeot () hawaii.edu>
#
# 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 th... | gpl-3.0 |
avaitla/Haskell-to-C---Bridge | pygccxml-1.0.0/unittests/copy_constructor_tester.py | 1 | 1665 | # Copyright 2004-2008 Roman Yakovenko.
# Distributed under the Boost Software License, Version 1.0. (See
# accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
import os
import unittest
import autoconfig
import parser_test_case
from pygccxml import utils
from pygccxml import... | bsd-3-clause |
tgroh/incubator-beam | sdks/python/apache_beam/utils/proto_utils.py | 9 | 1963 | #
# 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 |
atlashealth/ansible-modules-extras | monitoring/nagios.py | 2 | 30634 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# This file is largely copied from the Nagios module included in the
# Func project. Original copyright follows:
#
# func-nagios - Schedule downtime and enables/disable notifications
# Copyright 2011, Red Hat, Inc.
# Tim Bielawa <tbielawa@redhat.com>
#
# This software may be ... | gpl-3.0 |
mandeepdhami/nova | nova/tests/unit/network/test_neutronv2.py | 9 | 172164 | # Copyright 2012 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
#
# Unless requi... | apache-2.0 |
YannThorimbert/PyWorld2D | rendering/tilers/beachtiler.py | 1 | 4188 | from thorpy._utils.images import load_image
from thorpy._utils.interpolation import get_y
from pygame import surfarray
import math, pygame
from PyWorld2D.rendering.tilers.roundtiler import RoundTiler
class BeachTiler(RoundTiler):
def get_round(self, radius, background):
w,h = self.c.get_size()
s... | mit |
hiikezoe/android_kernel_asus_tf300t | Documentation/networking/cxacru-cf.py | 14668 | 1626 | #!/usr/bin/env python
# Copyright 2009 Simon Arlott
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 2 of the License, or (at your option)
# any later version.
#
# This program i... | gpl-2.0 |
agjohnson/readthedocs.org | readthedocs/projects/models.py | 2 | 33611 | import fnmatch
import logging
import os
from urlparse import urlparse
from distlib.version import UnsupportedVersionError
from django.conf import settings
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.db import models
from django.template.defaultfilters import slu... | mit |
unreal666/outwiker | plugins/thumbgallery/thumbgallery/thumbtablegenerator.py | 3 | 3320 | # -*- coding: utf-8 -*-
from outwiker.core.attachment import Attachment
from outwiker.core.defines import PAGE_ATTACH_DIR
from .basethumbgenerator import BaseThumbGenerator
class ThumbTableGenerator (BaseThumbGenerator):
"""
Создание списка превьюшек в виде таблицы
"""
def __init__(self, items, thum... | gpl-3.0 |
Hazelsuko07/17WarmingUp | py3.6/lib/python3.6/site-packages/click/decorators.py | 204 | 10941 | import sys
import inspect
from functools import update_wrapper
from ._compat import iteritems
from ._unicodefun import _check_for_unicode_literals
from .utils import echo
from .globals import get_current_context
def pass_context(f):
"""Marks a callback as wanting to receive the current context
object as fir... | mit |
tiagofrepereira2012/tensorflow | tensorflow/python/ops/candidate_sampling_ops.py | 55 | 17656 | # 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 |
r3dshirt/Python-Koans | python 3/libs/colorama/win32.py | 86 | 2730 |
# from winbase.h
STDOUT = -11
STDERR = -12
try:
from ctypes import windll
except ImportError:
windll = None
SetConsoleTextAttribute = lambda *_: None
else:
from ctypes import (
byref, Structure, c_char, c_short, c_uint32, c_ushort
)
handles = {
STDOUT: windll.kernel32.GetStdHa... | mit |
Manojkumar91/odoo_inresto | addons/base_action_rule/__openerp__.py | 7 | 1830 | # -*- 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 |
vigneras/sequencer | tests/commons.py | 2 | 2223 | # -*- coding: utf-8 -*-
###############################################################################
# Copyright (C) Bull S.A.S (2010, 2011)
# Contributor: Pierre Vignéras <pierre.vigneras@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Publ... | gpl-3.0 |
firmlyjin/brython | www/tests/test_storage.py | 17 | 1710 | from browser.local_storage import storage # legacy import
from browser.session_storage import storage as sess_storage # legacy import
from browser.object_storage import ObjectStorage
assert(storage.storage_type == "local_storage")
assert(sess_storage.storage_type == "session_storage")
storage.clear()
sess_storage.c... | bsd-3-clause |
cs-au-dk/Artemis | WebKit/Tools/Scripts/webkitpy/common/memoized_unittest.py | 84 | 2595 | # Copyright (c) 2010 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 ... | gpl-3.0 |
psci2195/espresso-ffans | testsuite/python/linear_momentum.py | 5 | 1406 | # Copyright (C) 2019 The ESPResSo project
#
# This file is part of ESPResSo.
#
# ESPResSo 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 versio... | gpl-3.0 |
jn7163/django | tests/template_tests/syntax_tests/test_exceptions.py | 513 | 2099 | from django.template import TemplateDoesNotExist, TemplateSyntaxError
from django.test import SimpleTestCase
from ..utils import setup
from .test_extends import inheritance_templates
class ExceptionsTests(SimpleTestCase):
@setup({'exception01': "{% extends 'nonexistent' %}"})
def test_exception01(self):
... | bsd-3-clause |
wkennington/rethinkdb | external/v8_3.30.33.16/testing/gmock/gtest/scripts/common.py | 1180 | 2919 | # Copyright 2013 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 foll... | agpl-3.0 |
fccagou/pynotif | blink1/blink1_pyusb.py | 1 | 4544 | """
blink1_pyusb.py -- blink(1) Python library using PyUSB
Uses "PyUSB 1.0" to do direct USB HID commands
See: https://github.com/walac/pyusb
Linux (Ubuntu/Debian):
% sudo apt-get install pip
% sudo pip install pyusb
Note: will give "not claimed" error or similar. Try blink1.py instead
Mac OS X:
do "brew inst... | gpl-2.0 |
lowitty/server | libsLinux/zope/interface/verify.py | 53 | 4727 | ##############################################################################
#
# Copyright (c) 2001, 2002 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# TH... | mit |
Pytwitcher/pytwitcherapi | src/pytwitcherapi/session.py | 1 | 22538 | """API for communicating with twitch"""
from __future__ import absolute_import
import functools
import logging
import os
import threading
import m3u8
import oauthlib.oauth2
import requests
import requests.utils
import requests_oauthlib
from pytwitcherapi.chat import client
from . import constants, exceptions, model... | bsd-3-clause |
kevingu1003/python-pptx | tests/unitutil/file.py | 5 | 1816 | # encoding: utf-8
"""
Utility functions for loading files for unit testing
"""
import os
import sys
from lxml import etree
from pptx.oxml import oxml_parser
_thisdir = os.path.split(__file__)[0]
test_file_dir = os.path.abspath(os.path.join(_thisdir, '..', 'test_files'))
def abspath(relpath):
thisdir = os.pa... | mit |
miguelfervi/SSBW-Restaurantes | restaurantes/lib/python2.7/site-packages/django/contrib/gis/gdal/raster/source.py | 297 | 13274 | import json
import os
from ctypes import addressof, byref, c_double, c_void_p
from django.contrib.gis.gdal.base import GDALBase
from django.contrib.gis.gdal.driver import Driver
from django.contrib.gis.gdal.error import GDALException
from django.contrib.gis.gdal.prototypes import raster as capi
from django.contrib.gis... | gpl-3.0 |
sorenk/ansible | lib/ansible/modules/utilities/logic/assert.py | 67 | 1396 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2012 Dag Wieers <dag@wieers.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 |
mavenlin/tensorflow | tensorflow/tools/docs/doc_generator_visitor_test.py | 118 | 4695 | # 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 |
drexly/tonginBlobStore | lib/django/conf/global_settings.py | 56 | 22768 | # Default Django settings. Override these with settings in the module
# pointed-to by the DJANGO_SETTINGS_MODULE environment variable.
# This is defined here as a do-nothing function because we can't import
# django.utils.translation -- that module depends on the settings.
gettext_noop = lambda s: s
#################... | bsd-3-clause |
guerrerocarlos/odoo | addons/hw_scale/__openerp__.py | 82 | 1646 | # -*- 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 |
xpansa/stock-logistics-workflow | stock_dropshipping_dual_invoice/wizard/stock_invoice_onshipping.py | 15 | 5807 | # Author: Leonardo Pistone
# Copyright 2015 Camptocamp SA
# Contributor: Pedro M. Baeza
# Copyright 2015 Serv. Tecnol. Avanzados
#
# 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... | agpl-3.0 |
rajalokan/nova | nova/cmd/api.py | 1 | 2267 | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# 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 ... | apache-2.0 |
tizianasellitto/servo | tests/wpt/web-platform-tests/tools/pytest/_pytest/pdb.py | 176 | 3491 | """ interactive debugging with PDB, the Python Debugger. """
from __future__ import absolute_import
import pdb
import sys
import pytest
def pytest_addoption(parser):
group = parser.getgroup("general")
group._addoption('--pdb',
action="store_true", dest="usepdb", default=False,
h... | mpl-2.0 |
jwhitlock/web-platform-compat | webplatformcompat/v1/routers.py | 2 | 2122 | # -*- coding: utf-8 -*-
"""URL router for v1 API endpoints."""
from ..routers import GroupedRouter
from .viewsets import (
BrowserViewSet, FeatureViewSet, MaturityViewSet, ReferenceViewSet,
SectionViewSet, SpecificationViewSet, SupportViewSet, VersionViewSet,
HistoricalBrowserViewSet, HistoricalFeatureView... | mpl-2.0 |
lthall/Leonard_ardupilot | Tools/autotest/param_metadata/xmlemit_mp.py | 10 | 3219 | #!/usr/bin/env python
from xml.sax.saxutils import escape, quoteattr
from emit import Emit
from param import known_param_fields, known_units
from lxml import etree
# Emit ArduPilot documentation in an machine readable XML format for Mission Planner
class XmlEmitMP(Emit):
def __init__(self, *args, **kwargs):
... | gpl-3.0 |
gautam1858/tensorflow | tensorflow/contrib/quantize/python/fold_batch_norms_test.py | 17 | 34203 | # 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 |
xujun10110/weevely3 | modules/file/cp.py | 16 | 1559 | from core.vectors import PhpCode, ShellCmd, ModuleExec, Os
from core.module import Module
from core import modules
class Cp(Module):
"""Copy single file."""
aliases = [ 'cp', 'copy' ]
def init(self):
self.register_info(
{
'author': [
'Emilio Pinna... | gpl-3.0 |
user-none/calibre | src/calibre/library/__init__.py | 14 | 2490 | __license__ = 'GPL v3'
__copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>'
''' Code to manage ebook library'''
def db(path=None, read_only=False):
from calibre.db.legacy import LibraryDatabase
from calibre.utils.config import prefs
from calibre.utils.filenames import expanduser
return Libra... | gpl-3.0 |
Abhinav117/pymtl | pisa/pisa_inst_slt_test.py | 4 | 5401 | #=========================================================================
# pisa_slt_test.py
#=========================================================================
import pytest
import random
import pisa_encoding
from pymtl import Bits
from PisaSim import PisaSim
from pisa_inst_test_utils import *
#---------... | bsd-3-clause |
Redsift/offlineimap | test/OLItest/TestRunner.py | 10 | 10132 | # Copyright (C) 2012- Sebastian Spaeth & contributors
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# ... | gpl-2.0 |
amunategui/phraug | unshuffle.py | 5 | 1774 | """
Unshuffle previously shuffled file
unshuffle.py input_file.csv output_file.csv <max. lines in memory> <random seed>
"""
import sys
import random
input_file = sys.argv[1]
output_file = sys.argv[2]
try:
lines_in_memory = int( sys.argv[3] )
except IndexError:
lines_in_memory = 100000
print "caching %s lines at... | bsd-2-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.