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 |
|---|---|---|---|---|---|
virtualnobi/MediaFiler | Model/MediaClassHandler.py | 1 | 18503 | """Provides class and element handling functionality.
(c) by nobisoft 2016-
"""
# Imports
## Standard
import sys
import copy
import re
import codecs
import logging
## Contributed
## nobi
## Project
#from .MediaOrganization import MediaOrganization
# Package Variables
Logger = logging.getLogger... | gpl-3.0 |
aurex-linux/virt-manager | virtManager/mediacombo.py | 1 | 6975 | #
# Copyright (C) 2014 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; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed i... | gpl-2.0 |
chapmanb/cloudbiolinux | deploy/test_install_galaxy_tool.py | 10 | 2616 | """
Test script for building Python API for installing Galaxy tools using
CBL without any dependencies (i.e. it clones down CBL and utilizes it
like bcbio-nextgen's installer).
Goal is to ultimately fold something like this to Galaxy tool shed
client code to provide high-level support for easy CloudBioLinux based
tool... | mit |
AKAMobi/ibot | ibot-kernel/ibot/extractor/startup.py | 1 | 4162 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from common import get_regs, get_compile_regs
import re
REGS = get_compile_regs(get_regs('startup'))
def get_startup(document):
""" 抽取项目名
@document: Document对象 chunk
@rtype: str 项目名
"""
global REGS
startup = ''
... | apache-2.0 |
littlstar/chromium.src | tools/json_schema_compiler/dart_generator.py | 80 | 27686 | # 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.
"""
Generator language component for compiler.py that adds Dart language support.
"""
from code import Code
from model import Function, PropertyType
from... | bsd-3-clause |
40223143/cda-w15 | static/Brython3.1.1-20150328-091302/Lib/_random.py | 518 | 2451 | from browser import window
def _randint(a, b):
return int(window.Math.random()*(b-a+1)+a)
def _urandom(n):
"""urandom(n) -> str
Return n random bytes suitable for cryptographic use."""
randbytes= [_randint(0,255) for i in range(n)]
return bytes(randbytes)
class Random:
"""Random n... | agpl-3.0 |
dsajkl/reqiop | common/lib/xmodule/xmodule/tests/test_crowdsource_hinter.py | 47 | 22206 | """
Tests the crowdsourced hinter xmodule.
"""
from mock import Mock, MagicMock
import unittest
import copy
from xmodule.crowdsource_hinter import CrowdsourceHinterModule
from xmodule.vertical_module import VerticalModule, VerticalDescriptor
from xmodule.x_module import STUDENT_VIEW
from xblock.field_data import Dict... | agpl-3.0 |
KrzysztofStachanczyk/Sensors-WWW-website | www/env/lib/python2.7/site-packages/django/contrib/admin/actions.py | 66 | 3365 | """
Built-in, globally-available admin actions.
"""
from django.contrib import messages
from django.contrib.admin import helpers
from django.contrib.admin.utils import get_deleted_objects, model_ngettext
from django.core.exceptions import PermissionDenied
from django.db import router
from django.template.response impo... | gpl-3.0 |
vinu76jsr/django-memoize | setup.py | 1 | 1282 | #!/usr/bin/env python
"""
django-memoize
--------------
**django-memoize** is an implementation
of `memoization <http://en.wikipedia.org/wiki/Memoization>`_ technique
for Django. You can think of it as a cache for function or method results.
"""
from setuptools import setup, find_packages
setup(
name='django-me... | bsd-3-clause |
SatoshiNXSimudrone/sl4a-damon-clone | python/gdata/tests/gdata_tests/docs/service_test.py | 87 | 17205 | #!/usr/bin/python
#
# 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/licenses/LICENSE-2.0
#
# Unless required b... | apache-2.0 |
andreaso/ansible | lib/ansible/modules/system/systemd.py | 42 | 18567 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Brian Coca <bcoca@ansible.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... | gpl-3.0 |
kinsney/sport | sport/settings.py | 1 | 4682 | #coding:utf-8
# -*- coding: utf-8 -*-
"""
Django settings for sport project.
Generated by 'django-admin startproject' using Django 1.9.4.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en... | mit |
zchokri/parameter-framework | test/functional-tests/PfwTestCase/Domains/tDomain_Configuration.py | 10 | 28508 | # -*-coding:utf-8 -*
# Copyright (c) 2011-2015, Intel Corporation
# 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, thi... | bsd-3-clause |
ltiao/scikit-learn | sklearn/tests/test_base.py | 216 | 7045 | # Author: Gael Varoquaux
# License: BSD 3 clause
import numpy as np
import scipy.sparse as sp
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_false
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing impo... | bsd-3-clause |
kelvindk/Video-Stabilization | boost_1_42_0/tools/build/v2/test/load_order.py | 15 | 1372 | #!/usr/bin/python
# Copyright 2004 Vladimir Prus.
# 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)
# Test that we load parent projects before loading children.
import BoostBuild
import string
t = BoostBuild.Teste... | gpl-3.0 |
libscie/liberator | liberator/lib/python3.6/site-packages/django/core/servers/basehttp.py | 44 | 6321 | """
HTTP server that implements the Python WSGI protocol (PEP 333, rev 1.21).
Based on wsgiref.simple_server which is part of the standard library since 2.5.
This is a simple server for use in testing or debugging Django apps. It hasn't
been reviewed for security issues. DON'T USE IT FOR PRODUCTION USE!
"""
from __f... | cc0-1.0 |
scode/pants | tests/python/pants_test/backend/python/tasks/checkstyle/test_print_statements.py | 6 | 1158 | # coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from pants.backend.p... | apache-2.0 |
mahinthjoe/bedrock | bedrock/mozorg/tests/test_hierarchy.py | 37 | 8343 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from mock import patch
from nose.tools import eq_, ok_
from bedrock.mozorg.hierarchy import PageNode, PageRoot
from bed... | mpl-2.0 |
dbaxa/jira | jira/resilientsession.py | 8 | 3347 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from requests import Session
from requests.exceptions import ConnectionError
from .utils import raise_on_error
import logging
import time
import json
class ResilientSession(Session):
"""
This class is supposed to retry requests that do return te... | bsd-2-clause |
GeoNode/geonode | geonode/favorite/models.py | 2 | 4297 | # -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2016 OSGeo
#
# 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 ... | gpl-3.0 |
hexlism/css_platform | sleepyenv/lib/python2.7/site-packages/Flask_Admin-1.2.0-py2.7.egg/examples/layout/app.py | 41 | 6077 | import os
import os.path as op
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
import flask_admin as admin
from flask_admin.contrib.sqla import ModelView
# Create application
app = Flask(__name__)
# Create dummy secrey key so we can use sessions
app.config['SECRET_KEY'] = '123456790'
# Create in-me... | apache-2.0 |
oaelhara/numbbo | docs/coco-generic/coco-perf-assessment/source/conf.py | 1 | 9586 | # -*- coding: utf-8 -*-
#
# docs/coco-generic/coco-perf-assessment documentation build configuration
# file, created by sphinx-quickstart on Fri Feb 12 14:40:02 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in t... | bsd-3-clause |
WarrenWeckesser/scipy | scipy/special/tests/test_precompute_gammainc.py | 12 | 4556 | import numpy as np # np is actually used, in the decorators below.
import pytest
from scipy.special._testutils import MissingModule, check_version
from scipy.special._mptestutils import (
Arg, IntArg, mp_assert_allclose, assert_mpmath_equal)
from scipy.special._precompute.gammainc_asy import (
compute_g, comp... | bsd-3-clause |
demitri/cornish | source/cornish/region/region.py | 1 | 28830 |
from __future__ import annotations # remove in Python 3.10
# Needed for forward references, see:
# https://stackoverflow.com/a/33533514/2712652
import logging
from abc import ABCMeta, abstractproperty, abstractmethod
from typing import Union, Iterable, Tuple
import math
from math import radians as deg2rad
from math ... | mit |
kcpawan/django | django/contrib/gis/admin/options.py | 379 | 5649 | from django.contrib.admin import ModelAdmin
from django.contrib.gis.admin.widgets import OpenLayersWidget
from django.contrib.gis.db import models
from django.contrib.gis.gdal import HAS_GDAL, OGRGeomType
from django.core.exceptions import ImproperlyConfigured
spherical_mercator_srid = 3857
class GeoModelAdmin(Model... | bsd-3-clause |
jvrsantacruz/XlsxWriter | xlsxwriter/test/comparison/test_chart_drop_lines01.py | 8 | 1689 | ###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparsion_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""... | bsd-2-clause |
LIMXTEC/BitSend | qa/rpc-tests/netutil.py | 35 | 4352 | # Linux network utilities
import sys
import socket
import fcntl
import struct
import array
import os
import binascii
# Roughly based on http://voorloopnul.com/blog/a-python-netstat-in-less-than-100-lines-of-code/ by Ricardo Pascal
STATE_ESTABLISHED = '01'
STATE_SYN_SENT = '02'
STATE_SYN_RECV = '03'
STATE_FIN_WAIT1 = ... | mit |
xmyth/rt-thread | bsp/avr32uc3b0/rtconfig.py | 36 | 1661 | import os
# toolchains options
ARCH = 'avr32'
CPU = 'uc3'
PART = 'uc3b0256'
BOARD = 'USERBOARD'
CROSS_TOOL = 'gcc'
if os.getenv('RTT_CC'):
CROSS_TOOL = os.getenv('RTT_CC')
if CROSS_TOOL == 'gcc':
PLATFORM = 'gcc'
EXEC_PATH = 'C:/Program Files/Atmel/AVR Tools/AVR Toolchain/bin'
elif CROSS_TOOL... | gpl-2.0 |
bw4sz/DeepMeerkat | training/Detection/object_detection/matchers/bipartite_matcher.py | 21 | 2176 | # 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... | gpl-3.0 |
zsiciarz/django | tests/serializers/test_data.py | 27 | 15683 | """
A test spanning all the capabilities of all the serializers.
This class defines sample data and a dynamically generated
test case that is capable of testing the capabilities of
the serializers. This includes all valid data values, plus
forward, backwards and self references.
"""
import datetime
import decimal
impo... | bsd-3-clause |
Artea/p2pool | p2pool/util/graph.py | 226 | 7325 | from __future__ import absolute_import
from __future__ import division
import math
from p2pool.util import math as math2
class DataViewDescription(object):
def __init__(self, bin_count, total_width):
self.bin_count = bin_count
self.bin_width = total_width/bin_count
def _shift(x, shift, pad_item... | gpl-3.0 |
Coderhypo/UIAMS | manage.py | 1 | 1085 | #-*- coding: UTF-8 -*-
import os
from app import app, db
from app.models import User, Role
from flask.ext.script import Manager, Server, Shell
from flask.ext.migrate import Migrate, MigrateCommand
manager = Manager(app)
def make_shell_context():
return dict(app=app, db=db, User=User, Role=Role)
manager.add_comma... | lgpl-3.0 |
maestromusic/maestro | maestro/core/domains.py | 1 | 5562 | # -*- coding: utf-8 -*-
# Maestro Music Manager - https://github.com/maestromusic/maestro
# Copyright (C) 2014-2015 Martin Altmayer, Michael Helmling
#
# 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 Foun... | gpl-3.0 |
hifly/OpenUpgrade | addons/analytic_contract_hr_expense/__openerp__.py | 312 | 1637 | # -*- 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 |
PaloAltoNetworks/minemeld-core | minemeld/flask/config.py | 1 | 5920 | # Copyright 2015-2016 Palo Alto Networks, 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... | apache-2.0 |
40023256/2015cdag1man | static/Brython3.1.3-20150514-095342/Lib/warnings.py | 752 | 13825 | """Python part of the warnings subsystem."""
# Note: function level imports should *not* be used
# in this module as it may cause import lock deadlock.
# See bug 683658.
import linecache
import sys
__all__ = ["warn", "showwarning", "formatwarning", "filterwarnings",
"resetwarnings", "catch_warnings"]
def... | gpl-3.0 |
cubieboard/openbox_external_chromium | chrome/common/extensions/docs/examples/apps/hello-python/oauth2/clients/smtp.py | 884 | 1680 | """
The MIT License
Copyright (c) 2007-2010 Leah Culver, Joe Stump, Mark Paschal, Vic Fryzel
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 ... | bsd-3-clause |
eugenj/global-notes | Adaptive Python/test_helper.py | 10 | 6166 | import sys
def get_file_text(path):
""" Returns file text by path"""
file_io = open(path, "r")
text = file_io.read()
file_io.close()
return text
def get_file_output(encoding="utf-8", path=sys.argv[-1], arg_string=""):
"""
Returns answer file output
:param encoding: to decode output i... | mit |
CTSRD-SOAAP/chromium-42.0.2311.135 | tools/telemetry/telemetry/value/histogram_util_unittest.py | 41 | 2704 | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import json
import unittest
from telemetry.value import histogram_util
class TestHistogram(unittest.TestCase):
def testSubtractHistogram(self):
basel... | bsd-3-clause |
jopohl/urh | src/urh/dev/native/SoundCard.py | 1 | 4702 | from collections import OrderedDict
from multiprocessing import Array
from multiprocessing.connection import Connection
import numpy as np
import pyaudio
from urh.dev.native.Device import Device
from urh.util.Logger import logger
class SoundCard(Device):
DEVICE_LIB = pyaudio
ASYNCHRONOUS = False
DEVICE_... | gpl-3.0 |
codeforseoul/seoul_serenity--deprecated | seoul_serenity/client/views.py | 2 | 3317 | # -*- coding: utf-8 -*-
from flask import Blueprint, render_template, request, redirect, url_for
# from flask import (Blueprint, request, render_template, flash, url_for,
# redirect, session)
from flask.ext.login import login_required, current_user
from seoul_serenity.extensions import login_manag... | bsd-3-clause |
mario23285/ProyectoElectrico | src/Leg.py | 1 | 6591 | """
UNIVERSIDAD DE COSTA RICA Escuela de Ingeniería Eléctrica
IE0499 | Proyecto Eléctrico
Mario Alberto Castresana Avendaño
A41267
Programa: BVH_TuneUp
-------------------------------------------------------------------------------
archivo: Leg.py
descripción:
Este archivo contiene la clase Leg... | gpl-2.0 |
cloudbase/nova-virtualbox | nova/tests/unit/scheduler/ironic_fakes.py | 45 | 4222 | # Copyright 2014 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 |
Azulinho/ansible | lib/ansible/modules/network/panos/panos_mgtconfig.py | 13 | 6125 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Ansible module to manage PaloAltoNetworks Firewall
# (c) 2016, techbizdev <techbizdev@paloaltonetworks.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 publish... | gpl-3.0 |
cades/qualitybots | src/appengine/handlers/url_handler.py | 26 | 2478 | #!/usr/bin/python2.4
#
# Copyright 2011 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... | apache-2.0 |
renhaoqi/gem5-stable | scons-local-2.2.0/SCons/Tool/JavaCommon.py | 14 | 12757 | """SCons.Tool.JavaCommon
Stuff for processing Java.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software... | bsd-3-clause |
brocade/pynos | pynos/versions/ver_7/ver_7_0_0/yang/brocade_common_def.py | 4 | 130591 | #!/usr/bin/env python
import xml.etree.ElementTree as ET
class brocade_common_def(object):
"""Auto generated class.
"""
def __init__(self, **kwargs):
self._callback = kwargs.pop('callback')
def ip_dns_dom_name_domain_name(self, **kwargs):
"""Auto Generated Code
""... | apache-2.0 |
npdoty/pywikibot | tests/category_bot_tests.py | 5 | 2681 | # -*- coding: utf-8 -*-
"""Tests for the category bot script."""
#
# (C) Pywikibot team, 2015-2016
#
# Distributed under the terms of the MIT license.
#
from __future__ import absolute_import, unicode_literals
try:
from unittest.mock import patch, Mock
except ImportError:
from mock import patch, Mock
from pyw... | mit |
dennisobrien/bokeh | examples/plotting/file/glyphs.py | 5 | 5197 | import numpy as np
from bokeh.layouts import gridplot
from bokeh.plotting import figure
from bokeh.io import curdoc, show, output_file
from bokeh.themes import Theme
N = 9
x = np.linspace(-2, 2, N)
y = x**2
sizes = np.linspace(10, 20, N)
xpts = np.array([-.09, -.12, .0, .12, .09])
ypts = np.array([-.1, .02, .1, .02... | bsd-3-clause |
katrid/django | tests/flatpages_tests/test_forms.py | 165 | 4569 | from __future__ import unicode_literals
from django.conf import settings
from django.contrib.flatpages.forms import FlatpageForm
from django.contrib.flatpages.models import FlatPage
from django.contrib.sites.models import Site
from django.test import TestCase, modify_settings, override_settings
from django.utils impor... | bsd-3-clause |
WPMedia/dd-agent | ddagent.py | 3 | 21346 | #!/opt/datadog-agent/embedded/bin/python
'''
Datadog
www.datadoghq.com
----
Make sense of your IT Data
Licensed under Simplified BSD License (see LICENSE)
(C) Boxed Ice 2010 all rights reserved
(C) Datadog, Inc. 2010-2016 all rights reserved
'''
# set up logging before importing any other c... | bsd-3-clause |
kevinlondon/sentry | tests/sentry/web/helpers/tests.py | 12 | 2126 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import mock
from sentry.models import AnonymousUser
from sentry.web.helpers import group_is_public
from sentry.testutils import TestCase
class GroupIsPublicTest(TestCase):
@mock.patch('sentry.models.Project.objects.get_for_user')
def test_non_p... | bsd-3-clause |
cryptapus/electrum-uno | gui/qt/__init__.py | 1 | 7412 | #!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2012 thomasv@gitorious
#
# 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 witho... | mit |
wesley1001/ssbc | ssbc/urls.py | 22 | 1229 | """ssbc URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-based ... | gpl-2.0 |
teltek/edx-platform | common/djangoapps/terrain/stubs/tests/test_http.py | 172 | 3969 | """
Unit tests for stub HTTP server base class.
"""
import unittest
import requests
import json
from terrain.stubs.http import StubHttpService, StubHttpRequestHandler, require_params
class StubHttpServiceTest(unittest.TestCase):
def setUp(self):
super(StubHttpServiceTest, self).setUp()
self.serv... | agpl-3.0 |
jacksonwilliams/arsenalsuite | python/scripts/email_farm_stats.py | 10 | 3129 | #!/usr/bin/python
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from blur.Stone import *
from blur.Classes import *
import sys, re, blur.email
# First Create a Qt Application
app = QCoreApplication(sys.argv)
# Load database config
if sys.platform=='win32':
initConfig("c:\\blur\\resin\\resin.ini")
else:
init... | gpl-2.0 |
jwhonce/openshift-ansible | roles/lib_openshift/library/oc_image.py | 18 | 54406 | #!/usr/bin/env python
# pylint: disable=missing-docstring
# flake8: noqa: T001
# ___ ___ _ _ ___ ___ _ _____ ___ ___
# / __| __| \| | __| _ \ /_\_ _| __| \
# | (_ | _|| .` | _|| / / _ \| | | _|| |) |
# \___|___|_|\_|___|_|_\/_/_\_\_|_|___|___/_ _____
# | \ / _ \ | \| |/ _ \_ _| | __| \_ ... | apache-2.0 |
bmentges/brainiak_api | src/brainiak/suggest/json_schema.py | 1 | 6725 | # -*- coding: utf-8 -*-
from brainiak.utils.links import merge_schemas, pagination_schema
SUGGEST_PARAM_SCHEMA = {
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Describe the parameters given to the suggest primitive",
"type": "object",
"required": ["search"],
"additionalProp... | gpl-2.0 |
Changaco/oh-mainline | vendor/packages/Django/tests/regressiontests/syndication/feeds.py | 47 | 3651 | from __future__ import absolute_import, unicode_literals
from django.contrib.syndication import views
from django.core.exceptions import ObjectDoesNotExist
from django.utils import feedgenerator, tzinfo
from .models import Article, Entry
class ComplexFeed(views.Feed):
def get_object(self, request, foo=None):
... | agpl-3.0 |
jsoref/django | tests/utils_tests/test_lazyobject.py | 38 | 11862 | from __future__ import unicode_literals
import copy
import pickle
import sys
import warnings
from unittest import TestCase
from django.utils import six
from django.utils.functional import LazyObject, SimpleLazyObject, empty
from .models import Category, CategoryInfo
class Foo(object):
"""
A simple class wi... | bsd-3-clause |
vitmod/linux | tools/perf/scripts/python/failed-syscalls-by-pid.py | 11180 | 2058 | # failed system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide failed system call totals, broken down by pid.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.pa... | gpl-2.0 |
Bitcoin-ABC/bitcoin-abc | test/functional/test_framework/coverage.py | 3 | 3401 | #!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Utilities for doing coverage analysis on the RPC interface.
Provides a way to track which RPC commands... | mit |
Weihonghao/ECM | Vpy34/lib/python3.5/site-packages/tensorflow/core/framework/tensor_pb2.py | 9 | 10588 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: tensorflow/core/framework/tensor.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.protobuf im... | agpl-3.0 |
gamerlulea/linux-3.5-rc | 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 |
yasoob/PythonRSSReader | venv/lib/python2.7/dist-packages/reportlab/lib/fonts.py | 2 | 3435 | #! /usr/bin/python
#Copyright ReportLab Europe Ltd. 2000-2012
#see license.txt for license details
#history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/lib/fonts.py
__version__=''' $Id$ '''
__doc__='''Utilities to associate bold and italic versions of fonts into families
Bold, itali... | mit |
jerli/sympy | sympy/physics/mechanics/rigidbody.py | 15 | 12510 | # -*- encoding: utf8 -*-
from __future__ import print_function, division
__all__ = ['RigidBody']
from sympy import sympify
from sympy.physics.vector import Point, ReferenceFrame, Dyadic
from sympy.utilities.exceptions import SymPyDeprecationWarning
class RigidBody(object):
"""An idealized rigid body.
This ... | bsd-3-clause |
rajathkumarmp/numpy | numpy/fft/fftpack.py | 72 | 45497 | """
Discrete Fourier Transforms
Routines in this module:
fft(a, n=None, axis=-1)
ifft(a, n=None, axis=-1)
rfft(a, n=None, axis=-1)
irfft(a, n=None, axis=-1)
hfft(a, n=None, axis=-1)
ihfft(a, n=None, axis=-1)
fftn(a, s=None, axes=None)
ifftn(a, s=None, axes=None)
rfftn(a, s=None, axes=None)
irfftn(a, s=None, axes=None... | bsd-3-clause |
GustavoHennig/ansible | test/runner/lib/http.py | 53 | 3199 | """
Primitive replacement for requests to avoid extra dependency.
Avoids use of urllib2 due to lack of SNI support.
"""
from __future__ import absolute_import, print_function
import json
try:
from urllib import urlencode
except ImportError:
# noinspection PyCompatibility,PyUnresolvedReferences,PyUnresolvedRe... | gpl-3.0 |
mekinik232/ambipi | lib/freetype/src/tools/docmaker/formatter.py | 515 | 4962 | # Formatter (c) 2002, 2004, 2007, 2008 David Turner <david@freetype.org>
#
from sources import *
from content import *
from utils import *
# This is the base Formatter class. Its purpose is to convert
# a content processor's data into specific documents (i.e., table of
# contents, global index, and individual API... | gpl-2.0 |
joariasl/odoo | addons/l10n_hr/__openerp__.py | 430 | 2728 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Module: l10n_hr
# Author: Goran Kliska
# mail: goran.kliska(AT)slobodni-programi.hr
# Copyright: Slobodni programi d.o.o., Zagreb
# Contributions:
#... | agpl-3.0 |
arbrandes/edx-platform | openedx/core/djangoapps/profile_images/images.py | 3 | 8120 | """
Image file manipulation functions related to profile images.
"""
import binascii
from collections import namedtuple
from contextlib import closing
from io import BytesIO
import piexif
from django.conf import settings
from django.core.files.base import ContentFile
from django.utils.translation import ugettext as ... | agpl-3.0 |
cyanna/edx-platform | common/lib/capa/capa/tests/test_input_templates.py | 17 | 38933 | """
Tests for the logic in input type mako templates.
"""
import unittest
import capa
import os.path
import json
from lxml import etree
from mako.template import Template as MakoTemplate
from mako import exceptions
from capa.inputtypes import Status
class TemplateError(Exception):
"""
Error occurred while re... | agpl-3.0 |
hakatashi/youtube-dl | youtube_dl/extractor/ctsnews.py | 14 | 3648 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import unified_timestamp
from .youtube import YoutubeIE
class CtsNewsIE(InfoExtractor):
IE_DESC = '華視新聞'
_VALID_URL = r'https?://news\.cts\.com\.tw/[a-z]+/[a-z]+/\d+/(?P<id>\d+)\.html'
_TESTS = [{
... | unlicense |
gladsonvm/haystackdemo | lib/python2.7/site-packages/pyelasticsearch/client.py | 1 | 39599 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from datetime import datetime
from operator import itemgetter
from functools import wraps
from logging import getLogger
import re
from six import (iterkeys, binary_type, text_type, string_types, integer_types,
iteritems, PY3)
from six.move... | mit |
adamdaigian/ad_old | node_modules/npm-shrinkwrap/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSVersion.py | 486 | 15539 | # Copyright (c) 2013 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Handle version information related to Visual Stuio."""
import errno
import os
import re
import subprocess
import sys
import gyp
import glob
class VisualStudi... | mit |
gengue/django | tests/staticfiles_tests/test_views.py | 279 | 1312 | from __future__ import unicode_literals
import posixpath
from django.conf import settings
from django.test import override_settings
from .cases import StaticFilesTestCase, TestDefaults
@override_settings(ROOT_URLCONF='staticfiles_tests.urls.default')
class TestServeStatic(StaticFilesTestCase):
"""
Test sta... | bsd-3-clause |
hsaputra/tensorflow | tensorflow/contrib/slim/__init__.py | 101 | 2359 | # 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 |
aioue/ansible | lib/ansible/modules/cloud/misc/virt.py | 16 | 15358 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Virt management features
Copyright 2007, 2012 Red Hat, Inc
Michael DeHaan <michael.dehaan@gmail.com>
Seth Vidal <skvidal@fedoraproject.org>
This software may be freely redistributed under the terms of the GNU
general public license.
You should have received a copy of th... | gpl-3.0 |
nvoron23/hue | desktop/core/ext-py/tablib-develop/tablib/packages/xlrd3/sheet.py | 54 | 74917 | # Portions copyright © 2005-2009 Stephen John Machin, Lingfo Pty Ltd
# This module is part of the xlrd3 package, which is released under a
# BSD-style licence.
# 2009-05-31 SJM Fixed problem with no CODEPAGE record on extremely minimal BIFF2.x 3rd-party file
# 2009-04-27 SJM Integrated on_demand patch by Armando ... | apache-2.0 |
vertcoin/electrum-vtc | gui/kivy/uix/context_menu.py | 2 | 1366 | #!python
#!/usr/bin/env python
from kivy.app import App
from kivy.uix.bubble import Bubble
from kivy.animation import Animation
from kivy.uix.floatlayout import FloatLayout
from kivy.lang import Builder
from kivy.factory import Factory
from kivy.clock import Clock
from electrum_vtc_gui.kivy.i18n import _
Builder.load... | mit |
gentoo/layman | layman/tests/external.py | 1 | 28009 | # -*- coding: utf-8 -*-
#################################################################################
# EXTERNAL LAYMAN TESTS
#################################################################################
# File: external.py
#
# Runs external (non-doctest) test cases.
#
# Copyright:
# ... | gpl-2.0 |
AbhiAgarwal/prep | python/trie.py | 1 | 3121 | class Node:
"""Node for Python Trie Implementation"""
def __init__(self):
self.word = None
self.nodes = {} # dict of nodes
def __get_all__(self):
"""Get all of the words in the trie"""
x = []
for key, node in self.nodes.iteritems() :
... | mit |
tobiz/OGN-Flight-Logger_V2 | flogger_email_msg.py | 1 | 1204 | import smtplib
import base64
from email.MIMEText import MIMEText
from email.MIMEMultipart import MIMEMultipart
from email.MIMEText import MIMEText
from email.MIMEBase import MIMEBase
from email import encoders
from __builtin__ import file
import settings
import os
import datetime
def email_msg(sender, receiver, msg, ... | gpl-3.0 |
coldfix/udiskie | udiskie/tray.py | 1 | 16508 | """
Tray icon for udiskie.
"""
from gi.repository import Gio
from gi.repository import Gtk
from .async_ import run_bg, Future
from .common import setdefault, DaemonBase, cachedmethod
from .locale import _
from .mount import Action, prune_empty_node
from .prompt import Dialog
from .icons import IconDist
import os
_... | mit |
dylan-reeves/home_backup | backupclient-env/Lib/encodings/cp273.py | 212 | 14132 | """ Python Character Mapping Codec cp273 generated from 'python-mappings/CP273.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,input,errors='strict... | gpl-3.0 |
jfpla/odoo | openerp/modules/migration.py | 279 | 7522 | # -*- 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 is free software: you ca... | agpl-3.0 |
fperez/sympy | sympy/thirdparty/pyglet/pyglet/gl/wglext_arb.py | 7 | 61360 | # ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistribu... | bsd-3-clause |
FMCalisto/FMCalisto.github.io | node_modules/node-gyp/gyp/pylib/gyp/input_test.py | 1841 | 3207 | #!/usr/bin/env python
# Copyright 2013 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Unit tests for the input.py file."""
import gyp.input
import unittest
import sys
class TestFindCycles(unittest.TestCase):
def setUp(self... | mit |
DavidAndreev/indico | indico/modules/events/timetable/legacy.py | 1 | 15015 | # 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 |
subroto08820/python101 | babynames/solution/babynames.py | 212 | 3852 | #!/usr/bin/python
# Copyright 2010 Google Inc.
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
# Google's Python Class
# http://code.google.com/edu/languages/google-python-class/
import sys
import re
"""Baby Names exercise
Define the extract_names() function below and c... | apache-2.0 |
shinpeimuraoka/ryu | ryu/controller/ofp_event.py | 9 | 4647 | # Copyright (C) 2012 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2011 Isaku Yamahata <yamahata at valinux co jp>
#
# 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://... | apache-2.0 |
cycotech/WAR-app | env/lib/python3.5/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 |
onlyjus/pyqtgraph | pyqtgraph/tests/test_stability.py | 9 | 3557 | """
PyQt/PySide stress test:
Create lots of random widgets and graphics items, connect them together randomly,
the tear them down repeatedly.
The purpose of this is to attempt to generate segmentation faults.
"""
from pyqtgraph.Qt import QtTest
import pyqtgraph as pg
from random import seed, randint
import sys, gc, ... | mit |
thnee/ansible | test/units/modules/network/f5/test_bigip_sys_daemon_log_tmm.py | 22 | 4510 | # -*- coding: utf-8 -*-
#
# Copyright: (c) 2018, F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import json
import pytest
import sys
if sys.version_info < (2... | gpl-3.0 |
xiangel/hue | desktop/core/ext-py/thrift-0.9.1/src/server/TNonblockingServer.py | 111 | 11818 | #
# 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 |
abadger/stellarmagnate | magnate/ui/urwid/abcwidget.py | 1 | 1128 | # Stellar Magnate - A space-themed commodity trading game
# Copyright (C) 2016-2017 Toshio Kuratomi <toshio@fedoraproject.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 ver... | agpl-3.0 |
pombredanne/http-repo.gem5.org-gem5- | src/cpu/testers/traffic_gen/TrafficGen.py | 46 | 4094 | # Copyright (c) 2012 ARM Limited
# 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 implementation of the functionality ... | bsd-3-clause |
tweakos/HD-Kernel | scripts/build-all.py | 308 | 9473 | #! /usr/bin/env python
# Copyright (c) 2009-2011, Code Aurora Forum. 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
# n... | gpl-2.0 |
bigdataelephants/scikit-learn | sklearn/metrics/cluster/tests/test_unsupervised.py | 26 | 2870 | import numpy as np
from scipy.sparse import csr_matrix
from .... import datasets
from ..unsupervised import silhouette_score
from ... import pairwise_distances
from sklearn.utils.testing import assert_false, assert_almost_equal
from sklearn.utils.testing import assert_raises_regexp
def test_silhouette():
"""Test... | bsd-3-clause |
jptomo/rpython-lang-scheme | rpython/translator/c/test/test_extfunc.py | 1 | 28437 | import py
import os, time, sys
from rpython.tool.udir import udir
from rpython.rlib.rarithmetic import r_longlong
from rpython.annotator import model as annmodel
from rpython.translator.c.test.test_genc import compile
from rpython.translator.c.test.test_standalone import StandaloneTests
posix = __import__(os.name)
def... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.