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 |
|---|---|---|---|---|---|
ycl2045/nova-master | nova/tests/api/openstack/compute/contrib/test_services.py | 2 | 18914 | # Copyright 2012 IBM Corp.
#
# 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 t... | apache-2.0 |
mihaic/brainiak | examples/fcma/mvpa_voxel_selection.py | 2 | 3996 | # Copyright 2016 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | apache-2.0 |
jinnykoo/wuyisj | src/oscar/apps/promotions/south_migrations/0003_auto__chg_field_image_image.py | 17 | 19078 | # -*- 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):
# Changing field 'Image.image'
db.alter_column(u'promotions_image', 'image', self.gf('django.db.models.fiel... | bsd-3-clause |
VinGarcia/kivy | kivy/support.py | 34 | 8423 | '''
Support
=======
Activate other frameworks/toolkits inside the kivy event loop.
'''
__all__ = ('install_gobject_iteration', 'install_twisted_reactor',
'uninstall_twisted_reactor', 'install_android')
def install_gobject_iteration():
'''Import and install gobject context iteration inside our event ... | mit |
bob-the-hamster/commandergenius | project/jni/python/src/Lib/test/test_modulefinder.py | 56 | 7928 | import __future__
import os
import unittest
import distutils.dir_util
import tempfile
from test import test_support
try: set
except NameError: from sets import Set as set
import modulefinder
# Note: To test modulefinder with Python 2.2, sets.py and
# modulefinder.py must be available - they are not in the standard
... | lgpl-2.1 |
synergeticsedx/deployment-wipro | common/djangoapps/third_party_auth/migrations/0004_add_visible_field.py | 39 | 3056 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('third_party_auth', '0001_initial'),
('third_party_auth', '0002_schema__provider_icon_image'),
('third_party_auth', '0003_saml... | agpl-3.0 |
indashnet/InDashNet.Open.UN2000 | android/external/chromium_org/native_client_sdk/src/build_tools/sdk_tools/config.py | 31 | 2138 | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import json
import logging
import urlparse
from sdk_update_common import Error
SOURCE_WHITELIST = [
'http://localhost/', # For testing.
'https://co... | apache-2.0 |
waseem18/oh-mainline | vendor/packages/kombu/kombu/transport/django/__init__.py | 20 | 2175 | """Kombu transport using the Django database as a message store."""
from __future__ import absolute_import
from anyjson import loads, dumps
from django.conf import settings
from django.core import exceptions as errors
from kombu.five import Empty
from kombu.transport import virtual
from kombu.utils.encoding import b... | agpl-3.0 |
dvliman/jaikuengine | .google_appengine/lib/django-1.3/django/contrib/admin/actions.py | 160 | 3285 | """
Built-in, globally-available admin actions.
"""
from django import template
from django.core.exceptions import PermissionDenied
from django.contrib.admin import helpers
from django.contrib.admin.util import get_deleted_objects, model_ngettext
from django.db import router
from django.shortcuts import render_to_resp... | apache-2.0 |
jejimenez/django | tests/urlpatterns_reverse/tests.py | 154 | 50058 | # -*- coding: utf-8 -*-
"""
Unit tests for reverse URL lookups.
"""
from __future__ import unicode_literals
import sys
import unittest
from admin_scripts.tests import AdminScriptTestCase
from django.conf import settings
from django.conf.urls import include, url
from django.contrib.auth.models import User
from django... | bsd-3-clause |
mjhouse/scripts | hex/env.py | 1 | 2609 | import re, shlex
import math
hextag = re.compile('{{(.*?)}}',flags=re.MULTILINE|re.DOTALL)
class HexExpression:
delimiters = (' ', '=','-','+','*','(',')')
quotes = ('\"','\'')
def __init__( self, tokens ):
self.operations = {
'=':self.assign,
'-':self.minus,
... | gpl-2.0 |
ampax/edx-platform | openedx/core/djangoapps/user_api/helpers.py | 25 | 18830 | """
Helper functions for the account/profile Python APIs.
This is NOT part of the public API.
"""
from collections import defaultdict
from functools import wraps
import logging
import json
from django import forms
from django.core.serializers.json import DjangoJSONEncoder
from django.http import HttpResponseBadRequest... | agpl-3.0 |
thejevans/pointSourceAnalysis | convertH5_GFU.py | 1 | 1276 | #!/usr/bin/env python
'''
Template to convert from HDF5 files to NPY numpy array Files. This implementation uses
parseGFU.py to parse the data
'''
# Imports
from __future__ import print_function
from optparse import OptionParser
import tables
import numpy as np
import parseGFU
# Command parsing
usage = '%prog [optio... | gpl-3.0 |
proxysh/Safejumper-for-Desktop | buildmac/Resources/env/lib/python2.7/site-packages/pyasn1_modules/rfc2314.py | 127 | 1170 | #
# PKCS#10 syntax
#
# ASN.1 source from:
# http://tools.ietf.org/html/rfc2314
#
# Sample captures could be obtained with "openssl req" command
#
from pyasn1.type import tag, namedtype, namedval, univ, constraint
from pyasn1_modules.rfc2459 import *
class Attributes(univ.SetOf):
componentType = Attribute()
class ... | gpl-2.0 |
flgiordano/netcash | +/google-cloud-sdk/lib/googlecloudsdk/core/resource/resource_projection_spec.py | 1 | 10147 | # 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 ag... | bsd-3-clause |
pelya/commandergenius | project/jni/python/src/Lib/_MozillaCookieJar.py | 152 | 5821 | """Mozilla / Netscape cookie loading / saving."""
import re, time
from cookielib import (_warn_unhandled_exception, FileCookieJar, LoadError,
Cookie, MISSING_FILENAME_TEXT)
class MozillaCookieJar(FileCookieJar):
"""
WARNING: you may want to backup your browser's cookies file if you us... | lgpl-2.1 |
r-kitaev/lucid-python-tinydav | test/TestTinyDAV.py | 1 | 39023 | # Unittests for tinydav lib.
# coding: utf-8
# Copyright (C) 2009 Manuel Hermann <manuel-hermann@gmx.net>
#
# This file is part of tinydav.
#
# tinydav is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, e... | gpl-3.0 |
towerjoo/DjangoNotes | Django-1.5.1/tests/modeltests/update/tests.py | 118 | 4307 | from __future__ import absolute_import, unicode_literals
from django.test import TestCase
from .models import A, B, C, D, DataPoint, RelatedPoint
class SimpleTest(TestCase):
def setUp(self):
self.a1 = A.objects.create()
self.a2 = A.objects.create()
for x in range(20):
B.objec... | mit |
DMLoy/ECommerceBasic | lib/python2.7/site-packages/django/contrib/auth/tests/__init__.py | 101 | 1191 | from django.contrib.auth.tests.custom_user import *
from django.contrib.auth.tests.auth_backends import *
from django.contrib.auth.tests.basic import *
from django.contrib.auth.tests.context_processors import *
from django.contrib.auth.tests.decorators import *
from django.contrib.auth.tests.forms import *
from django.... | mit |
cmr/automatafl | old_python_prototype/server.py | 1 | 6501 | """
Automatafl HTTP game server.
There is a central store of all currently-running games, with the board and
game state. Each game is identified by a UUIDv4. When creating a game, the
client has an option to make the game public or private. Public games will be
listed publically. A player may join any game which they ... | apache-2.0 |
matematik7/CSSQC | tests/test_colonFormat.py | 1 | 4046 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# ----------------------------------------------------------------
# test_colonFormat.py
#
# test for colonFormat rule
# ----------------------------------------------------------------
# copyright (c) 2014 - Domen Ipavec
# Distributed under The MIT License, see LICENSE
#... | mit |
naresh21/synergetics-edx-platform | cms/djangoapps/course_creators/views.py | 230 | 3176 | """
Methods for interacting programmatically with the user creator table.
"""
from course_creators.models import CourseCreator
from student.roles import CourseCreatorRole
from student import auth
def add_user_with_status_unrequested(user):
"""
Adds a user to the course creator table with status 'unrequested'.... | agpl-3.0 |
maohongyuan/kbengine | kbe/res/scripts/common/Lib/encodings/cp1250.py | 272 | 13686 | """ Python Character Mapping Codec cp1250 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1250.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,in... | lgpl-3.0 |
tseaver/gcloud-python | automl/google/cloud/automl_v1beta1/proto/image_pb2.py | 3 | 7609 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/cloud/automl_v1beta1/proto/image.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.prot... | apache-2.0 |
ioanpocol/superdesk-core | tests/elasticsearch_settings_test.py | 7 | 4397 | # -*- 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
import json
f... | agpl-3.0 |
DickJC123/mxnet | example/gluon/style_transfer/option.py | 48 | 7063 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | apache-2.0 |
adamwwt/chvac | venv/lib/python2.7/site-packages/sqlalchemy/ext/declarative/api.py | 21 | 17787 | # ext/declarative/api.py
# Copyright (C) 2005-2015 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Public API functions and helpers for declarative."""
from ...schema impor... | mit |
ppy/angle | scripts/generate_android_bp.py | 1 | 19660 | # Copyright The ANGLE Project Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
# Generates an Android.bp file from the json output of a 'gn desc' command.
# Example usage:
# gn desc out/Android --format=json "*" > desc.json
# py... | bsd-3-clause |
fx2003/tensorflow-study | TensorFlow实战/models/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py | 4 | 43127 | # 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... | mit |
NeCTAR-RC/nova | nova/tests/unit/scheduler/fakes.py | 9 | 6005 | # Copyright 2011 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 requ... | apache-2.0 |
biothings/biothings_explorer | tests/test_apis/test_cordmolecularactivity.py | 1 | 4943 | import unittest
from biothings_explorer.registry import Registry
from biothings_explorer.user_query_dispatcher import SingleEdgeQueryDispatcher
from .utils import get_apis
reg = Registry()
class TestSingleHopQuery(unittest.TestCase):
def test_ma2protein(self):
"""Test gene-protein"""
seqd = Singl... | apache-2.0 |
cfg2015/EPT-2015-2 | addons/account_voucher/account_voucher.py | 8 | 85473 | # -*- 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 |
pyspace/pyspace | pySPACE/tests/unittests/nodes/spatial_filtering/test_fda.py | 3 | 3962 | #!/usr/bin/python
"""
This module contains unittests that test splitter nodes
:Author: Jan Hendrik Metzen (jhm@informatik.uni-bremen.de)
:Created: 2008/12/18
"""
import unittest
import numpy
if __name__ == '__main__':
import sys
import os
# The root of the code
file_path = os.path.dirname(os.path.ab... | bsd-3-clause |
pranner/CMPUT410-Lab6-Django | v1/lib/python2.7/site-packages/django/apps/config.py | 75 | 8224 | from importlib import import_module
import os
from django.core.exceptions import AppRegistryNotReady, ImproperlyConfigured
from django.utils.module_loading import module_has_submodule
from django.utils._os import upath
MODELS_MODULE_NAME = 'models'
class AppConfig(object):
"""
Class representing a Django a... | apache-2.0 |
adjih/RIOT | tests/gnrc_sock_ip/tests/01-run.py | 24 | 3510 | #!/usr/bin/env python3
# Copyright (C) 2016 Kaspar Schleiser <kaspar@schleiser.de>
#
# This file is subject to the terms and conditions of the GNU Lesser
# General Public License v2.1. See the file LICENSE in the top level
# directory for more details.
import os
import sys
from datetime import datetime
sys.path.app... | lgpl-2.1 |
ubiar/odoo | addons/resource/tests/common.py | 305 | 5016 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2013-TODAY OpenERP S.A. <http://www.openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms... | agpl-3.0 |
ESOedX/edx-platform | openedx/core/lib/blockstore_api/methods.py | 1 | 12782 | """
API Client methods for working with Blockstore bundles and drafts
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import base64
from uuid import UUID
import dateutil.parser
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
import request... | agpl-3.0 |
rosmo/ansible | lib/ansible/modules/network/fortios/fortios_switch_controller_managed_switch.py | 19 | 58189 | #!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019 Fortinet, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Lic... | gpl-3.0 |
ahmadia/binder | web/app.py | 1 | 5636 | import Queue
import json
import signal
import time
from tornado import gen
from tornado.ioloop import IOLoop
from tornado.web import Application, RequestHandler
from tornado.httpserver import HTTPServer
from binder.service import Service
from binder.app import App
from binder.cluster import ClusterManager
from .buil... | apache-2.0 |
hnakamur/django | django/core/management/commands/startproject.py | 503 | 1359 | from importlib import import_module
from django.core.management.base import CommandError
from django.core.management.templates import TemplateCommand
from django.utils.crypto import get_random_string
class Command(TemplateCommand):
help = ("Creates a Django project directory structure for the given "
... | bsd-3-clause |
madsmpedersen/MMPE | datastructures/unittests/test_caching.py | 1 | 1854 | '''
Created on 08/11/2013
@author: mmpe
'''
import multiprocessing
import time
import unittest
from mmpe.functions.timing import get_time
from mmpe.datastructures.caching import cache_function, set_cache_property
class Example(object):
def __init__(self, *args, **kwargs):
object.__init__(self, *args, *... | apache-2.0 |
conversocial/tweepy | tweepy/cache.py | 4 | 12961 | # Tweepy
# Copyright 2009-2010 Joshua Roesslein
# See LICENSE for details.
from __future__ import print_function
import time
import datetime
import threading
import os
import logging
try:
import cPickle as pickle
except ImportError:
import pickle
try:
import hashlib
except ImportError:
# python 2.4
... | mit |
ibazzi/rk3288-kernel | tools/perf/scripts/python/netdev-times.py | 11271 | 15048 | # Display a process of packets and processed time.
# It helps us to investigate networking or network device.
#
# options
# tx: show only tx chart
# rx: show only rx chart
# dev=: show only thing related to specified device
# debug: work with debug mode. It shows buffer status.
import os
import sys
sys.path.append(os... | gpl-2.0 |
sub-b/android_kernel_samsung_matissewifi-old | tools/perf/scripts/python/netdev-times.py | 11271 | 15048 | # Display a process of packets and processed time.
# It helps us to investigate networking or network device.
#
# options
# tx: show only tx chart
# rx: show only rx chart
# dev=: show only thing related to specified device
# debug: work with debug mode. It shows buffer status.
import os
import sys
sys.path.append(os... | gpl-2.0 |
ishankhare07/weather-widget | requests/packages/urllib3/connection.py | 371 | 8967 | import datetime
import sys
import socket
from socket import timeout as SocketTimeout
import warnings
from .packages import six
try: # Python 3
from http.client import HTTPConnection as _HTTPConnection, HTTPException
except ImportError:
from httplib import HTTPConnection as _HTTPConnection, HTTPException
cla... | mit |
mithro/HDMI2USB-litex-firmware | targets/neso/base.py | 1 | 5595 | # Support for the Numato Neso Artix 7 100T Board
from migen import *
from migen.genlib.resetsync import AsyncResetSynchronizer
from litex.soc.integration.soc_core import mem_decoder
from litex.soc.integration.soc_sdram import *
from litex.soc.integration.builder import *
from litedram.modules import MT41K128M16
from ... | bsd-2-clause |
ColtonProvias/sqlalchemy-jsonapi | sqlalchemy_jsonapi/unittests/declarative_tests/test_serialize.py | 1 | 20770 | """Tests for declarative JSONAPISerializer serialize method."""
import unittest
import datetime
from sqlalchemy import (
create_engine, Column, String, Integer, ForeignKey, Boolean, DateTime)
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import backref, relationship, sessionmaker
fr... | mit |
malcolmcrossley/sm | drivers/fjournaler.py | 12 | 4716 | #!/usr/bin/python
#
# Copyright (C) Citrix Systems Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation; version 2.1 only.
#
# This program is distributed in the hope that it will be u... | lgpl-2.1 |
manufacturedba/pinax | pinax/middleware/security.py | 3 | 1058 | import re
from django.conf import settings
MASK_IN_EXCEPTION_EMAIL = ["password", "protected", "private"]
PINAX_SECURITY_SENSITIVE_FIELDS = getattr(settings, "PINAX_SECURITY_SENSITIVE_FIELDS", [])
PINAX_SECURITY_SENSITIVE_FIELDS.extend(MASK_IN_EXCEPTION_EMAIL)
mask_re = re.compile("(" + "|".join(PINAX_SECURITY_SEN... | mit |
VectorBlox/PYNQ | python/pynq/iop/arduino_analog.py | 2 | 13096 | # Copyright (c) 2016, Xilinx, 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:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of ... | bsd-3-clause |
zycdragonball/tensorflow | tensorflow/contrib/cloud/__init__.py | 95 | 1145 | # 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 |
PingHao/support-tools | wiki_to_md/wiki2gfm.py | 25 | 4695 | # Copyright 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
#
# Unless required by applicable law or a... | apache-2.0 |
jwheare/digest | lib/simplejson/tests/test_fail.py | 18 | 2889 | from unittest import TestCase
import simplejson as S
# Fri Dec 30 18:57:26 2005
JSONDOCS = [
# http://json.org/JSON_checker/test/fail1.json
'"A JSON payload should be an object or array, not a string."',
# http://json.org/JSON_checker/test/fail2.json
'["Unclosed array"',
# http://json.org/JSON_che... | bsd-3-clause |
heeraj123/oh-mainline | vendor/packages/twisted/twisted/enterprise/adbapi.py | 19 | 17461 | # -*- test-case-name: twisted.test.test_adbapi -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
An asynchronous mapping to U{DB-API 2.0<http://www.python.org/topics/database/DatabaseAPI-2.0.html>}.
"""
import sys
from twisted.internet import threads
from twisted.python import reflect, ... | agpl-3.0 |
klnprj/testapp | django/contrib/sessions/backends/signed_cookies.py | 94 | 3019 | try:
import cPickle as pickle
except ImportError:
import pickle
from django.conf import settings
from django.core import signing
from django.contrib.sessions.backends.base import SessionBase
class PickleSerializer(object):
"""
Simple wrapper around pickle to be used in signing.dumps and
signing.... | bsd-3-clause |
joshbruning/selenium | py/selenium/webdriver/firefox/extension_connection.py | 52 | 2875 | # 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 |
markofu/security_monkey | security_monkey/auditors/rds/rds_snapshot.py | 3 | 3444 | # Copyright 2017 Netflix, 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... | apache-2.0 |
jpshort/odoo | addons/hw_posbox_homepage/__init__.py | 1894 | 1075 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... | agpl-3.0 |
ysywh/ryu | ryu/tests/integrated/test_add_flow_v12_matches.py | 34 | 40869 | # Copyright (C) 2012 Nippon Telegraph and Telephone Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | apache-2.0 |
soarpenguin/ansible | lib/ansible/modules/network/cloudengine/ce_stp.py | 39 | 37593 | #!/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 distribut... | gpl-3.0 |
danielet/ns3Bayes | .waf-1.7.13-5a064c2686fe54de4e11018d22148cfc/waflib/Tools/fc_scan.py | 109 | 1874 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
import re
from waflib import Utils,Task,TaskGen,Logs
from waflib.TaskGen import feature,before_method,after_method,extension
from waflib.Configure import conf
INC_REGEX="""(?:... | gpl-2.0 |
aospx-kitkat/platform_external_chromium_org | chrome/test/functional/ispy/ispy_core/tools/image_tools.py | 24 | 9536 | # 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.
"""Utilities for performing pixel-by-pixel image comparision."""
import itertools
import StringIO
from PIL import Image
def _AreTheSameSize(images):
"""... | bsd-3-clause |
darkleons/BE | addons/stock_dropshipping/__init__.py | 90 | 1059 | # -*- 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 |
potash/scikit-learn | sklearn/cluster/affinity_propagation_.py | 60 | 10688 | """Affinity Propagation clustering algorithm."""
# Author: Alexandre Gramfort alexandre.gramfort@inria.fr
# Gael Varoquaux gael.varoquaux@normalesup.org
# License: BSD 3 clause
import numpy as np
from ..base import BaseEstimator, ClusterMixin
from ..utils import as_float_array, check_array
from ..utils.valid... | bsd-3-clause |
ayushgarg95/spojstalker | bs4/tests/test_html5lib.py | 293 | 2929 | """Tests to ensure that the html5lib tree builder generates good trees."""
import warnings
try:
from bs4.builder import HTML5TreeBuilder
HTML5LIB_PRESENT = True
except ImportError, e:
HTML5LIB_PRESENT = False
from bs4.element import SoupStrainer
from bs4.testing import (
HTML5TreeBuilderSmokeTest,
... | mit |
yhpeng-git/mxnet | example/stochastic-depth/sd_module.py | 15 | 6525 | import logging
import mxnet as mx
import numpy as np
class RandomNumberQueue(object):
def __init__(self, pool_size=1000):
self._pool = np.random.rand(pool_size)
self._index = 0
def get_sample(self):
if self._index >= len(self._pool):
self._pool = np.random.rand(len(self._p... | apache-2.0 |
qwertyjune/BethSaidaBible | venv/lib/python2.7/site-packages/django/conf/__init__.py | 57 | 6710 | """
Settings and configuration for Django.
Values will be read from the module specified by the DJANGO_SETTINGS_MODULE environment
variable, and then from django.conf.global_settings; see the global settings file for
a list of all possible variables.
"""
import importlib
import os
import time # Needed for Windows... | gpl-3.0 |
mikalstill/nova | nova/tests/unit/virt/libvirt/test_config.py | 2 | 127905 | # Copyright (C) 2012 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 ... | apache-2.0 |
maestrano/openerp | openerp/addons/account_budget/__init__.py | 444 | 1097 | # -*- 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 |
NixaSoftware/CVis | venv/lib/python2.7/site-packages/numpy/distutils/fcompiler/hpux.py | 229 | 1464 | from __future__ import division, absolute_import, print_function
from numpy.distutils.fcompiler import FCompiler
compilers = ['HPUXFCompiler']
class HPUXFCompiler(FCompiler):
compiler_type = 'hpux'
description = 'HP Fortran 90 Compiler'
version_pattern = r'HP F90 (?P<version>[^\s*,]*)'
executables... | apache-2.0 |
JamesMura/sentry | src/sentry/search/django/backend.py | 2 | 10606 | """
sentry.search.django.backend
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
import six
from django.db import router
from django.db.models import Q
from sentry.api.pag... | bsd-3-clause |
hassoon3/odoo | addons/l10n_ma/l10n_ma.py | 336 | 1952 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# ... | agpl-3.0 |
SergeyStaroletov/Patterns17 | CourseWorkReports/Курсовой проект Киреков ПИ-42/Исходный код/Model/Classifiers/ImageClassifier.py | 1 | 1143 | import keras
import numpy as np
from keras.preprocessing import image
from .IClassifier import IClassifier
class ImageClassifier(IClassifier):
""" классификатор изображений """
def __init__(self):
self.__input_shape = None
self.__aliases = None
self.__model = None
... | mit |
thomasgilgenast/spqr-nonrel | django/contrib/gis/db/models/sql/aggregates.py | 309 | 1804 | from django.db.models.sql.aggregates import *
from django.contrib.gis.db.models.fields import GeometryField
from django.contrib.gis.db.models.sql.conversion import GeomField
class GeoAggregate(Aggregate):
# Default SQL template for spatial aggregates.
sql_template = '%(function)s(%(field)s)'
# Conversion ... | bsd-3-clause |
Jgarcia-IAS/ReporsitorioVacioOdoo | openerp/addons/marketing_campaign_crm_demo/__openerp__.py | 260 | 1623 | # -*- 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 |
quinot/ansible | lib/ansible/plugins/shell/csh.py | 118 | 1217 | # Copyright (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
from ansible.plugins.shell import Shel... | gpl-3.0 |
LangmuirSim/langmuir | LangmuirPython/convert/chk2vtk.py | 2 | 4299 | # -*- coding: utf-8 -*-
"""
chk2vtk.py
==========
.. argparse::
:module: chk2vtk
:func: create_parser
:prog: chk2vtk.py
.. moduleauthor:: Adam Gagorik <adam.gagorik@gmail.com>
"""
import langmuir as lm
import numpy as np
import argparse
import vtk
import os
desc = \
"""
Create vtk files for visualization... | gpl-2.0 |
tanmaykm/edx-platform | lms/djangoapps/courseware/tests/helpers.py | 46 | 6508 | import json
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.test import TestCase
from django.test.client import RequestFactory
from courseware.access import has_access
from openedx.core.djangoapps.content.course_overviews.models import CourseOverview
from student.m... | agpl-3.0 |
The01000001Team/PythonGroceryList | requests/requests/api.py | 188 | 5419 | # -*- coding: utf-8 -*-
"""
requests.api
~~~~~~~~~~~~
This module implements the Requests API.
:copyright: (c) 2012 by Kenneth Reitz.
:license: Apache2, see LICENSE for more details.
"""
from . import sessions
def request(method, url, **kwargs):
"""Constructs and sends a :class:`Request <Request>`.
:par... | mit |
olivergs/glsleditor | src/glsleditor.py | 2 | 1317 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright (C) 2008 EVO Sistemas Libres <central@evosistemas.com>
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License a... | mit |
Nu3001/external_chromium_org | tools/telemetry/telemetry/unittest/simple_mock_unittest.py | 57 | 1895 | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import unittest
from telemetry.unittest import simple_mock
_ = simple_mock.DONT_CARE
class SimpleMockUnitTest(unittest.TestCase):
def testBasic(self)... | bsd-3-clause |
gmr/mikkoo | mikkoo/statsd.py | 1 | 5519 | """
Statsd Client that takes configuration first from the rejected configuration
file, falling back to environment variables, and finally default values.
Environment Variables:
- STATSD_HOST
- STATSD_PORT
- STATSD_PREFIX
"""
import logging
import os
import socket
from tornado import iostream
LOGGER = logging.ge... | bsd-3-clause |
openstack/keystone | keystone/tests/unit/ksfixtures/hacking.py | 2 | 10379 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | apache-2.0 |
gaurav9991/enjarify | enjarify/dalvikformats.py | 30 | 4154 | # 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 a... | apache-2.0 |
jfvelte-dev/android_kernel_samsung_jf | tools/perf/scripts/python/net_dropmonitor.py | 1258 | 1562 | # Monitor the system for dropped packets and proudce a report of drop locations and counts
import os
import sys
sys.path.append(os.environ['PERF_EXEC_PATH'] + \
'/scripts/python/Perf-Trace-Util/lib/Perf/Trace')
from perf_trace_context import *
from Core import *
from Util import *
drop_log = {}
kallsyms = []
def... | gpl-2.0 |
f3at/feat | src/feat/configure/uninstalled.py | 1 | 1393 | # F3AT - Flumotion Asynchronous Autonomous Agent Toolkit
# Copyright (C) 2010,2011 Flumotion Services, S.A.
# All rights reserved.
# 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... | gpl-2.0 |
bibarz/bibarz.github.io | dabble/ab/auth_algorithms.py | 1 | 17145 | # Import any required libraries or modules.
import numpy as np
from sklearn import svm
from sklearn.ensemble import RandomForestClassifier
from sklearn.neighbors import KNeighborsClassifier
import csv
import sys
class MetaParams:
n_lda_ensemble = 101
lda_ensemble_feature_fraction = 0.4
mode = 'lda_ensembl... | mit |
Davarg/blocks-revenge-of-sparrow | proj.android/build_native.py | 38 | 5740 | #!/usr/bin/python
# build_native.py
# Build native codes
import sys
import os, os.path
import shutil
from optparse import OptionParser
def get_num_of_cpu():
''' The build process can be accelerated by running multiple concurrent job processes using the -j-option.
'''
try:
import multiprocessing
return multipr... | gpl-2.0 |
dietrichc/streamline-ppc-reports | examples/dfp/v201411/line_item_service/create_line_items.py | 4 | 5441 | #!/usr/bin/python
#
# Copyright 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
#
# Unless required b... | apache-2.0 |
eteq/bokeh | examples/plotting/file/markers.py | 45 | 1530 | from numpy.random import random
from bokeh.plotting import figure, show, output_file
def mscatter(p, x, y, typestr):
p.scatter(x, y, marker=typestr,
line_color="#6666ee", fill_color="#ee6666", fill_alpha=0.5, size=12)
def mtext(p, x, y, textstr):
p.text(x, y, text=[textstr],
text_color="... | bsd-3-clause |
kmike/django-coverage | assets/badges/drone.io/badge_maker.py | 3 | 1424 | """
Drone.io badge generator.
Currently set up to work on Mac.
Requires Pillow.
"""
import os
from PIL import Image, ImageDraw, ImageFont
SIZE = (95, 18)
def hex_colour(hex):
if hex[0] == '#':
hex = hex[1:]
return (
int(hex[:2], 16),
int(hex[2:4], 16),
int(hex[4:6], 16),
... | apache-2.0 |
paulnice/bmpreceiver | BGP.py | 3 | 28974 | #!/usr/bin/python2.5 # pylint: disable-msg=C6301,C6409
#
# Copyright 2009 Google Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/lic... | apache-2.0 |
kenorb-contrib/BitTorrent | BitTorrent/IPC.py | 2 | 16178 | # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# bu... | gpl-3.0 |
maferelo/saleor | saleor/site/migrations/0017_auto_20180803_0528.py | 3 | 1357 | # Generated by Django 2.0.3 on 2018-08-03 10:28
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("site", "0016_auto_20180719_0520")]
operations = [
migrations.CreateModel(
name="SiteSettingsTranslation",
... | bsd-3-clause |
thomashaw/SecGen | modules/utilities/unix/labtainers/files/Labtainers-master/labs/kali-test/kali-test/attacks/scans.py | 2 | 1883 | from os import *
import sys
import time
import datetime
from datetime import timedelta
# IMPORT & ALIAS
import setup as s
printtime = s.printtime
funcprinttime = s.funcprinttime
counter=60 # 60 = 1 minute
#### NMAP OS DISCOVERY
def nmap_os(n):
starttime=time.time()
endtime = time.time()+n
funcprinttime(" Star... | gpl-3.0 |
Zhongqilong/mykbengineer | kbe/src/lib/python/Lib/unittest/runner.py | 195 | 7484 | """Running tests"""
import sys
import time
import warnings
from . import result
from .signals import registerResult
__unittest = True
class _WritelnDecorator(object):
"""Used to decorate file-like objects with a handy 'writeln' method"""
def __init__(self,stream):
self.stream = stream
def __ge... | lgpl-3.0 |
Azure/azure-sdk-for-python | sdk/servicebus/azure-servicebus/tests/perf_tests/receive_message_batch.py | 1 | 1324 | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | mit |
hmgaudecker/econ-project-templates | docs/.mywaflib/waflib/Logs.py | 17 | 9665 | #!/usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2005-2018 (ita)
"""
logging, colors, terminal width and pretty-print
"""
import os, re, traceback, sys
from waflib import Utils, ansiterm
if not os.environ.get('NOSYNC', False):
# synchronized output is nearly mandatory to prevent garbled output
if sys.stdout.... | bsd-3-clause |
opoplawski/ansible-modules-extras | network/snmp_facts.py | 77 | 13314 | #!/usr/bin/python
# This file is part of Networklore's snmp library for Ansible
#
# The module 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 ... | gpl-3.0 |
slogan621/tscharts | tscharts/views.py | 1 | 9381 | #(C) Copyright Syd Logan 2016-2021
#(C) Copyright Thousand Smiles Foundation 2016-2021
#
#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 req... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.