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
DelazJ/QGIS
tests/src/python/test_qgsserver_wms_getlegendgraphic.py
21
41277
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsServer WMS GetLegendGraphic. From build dir, run: ctest -R PyQgsServerWMSGetLegendGraphic -V .. note:: This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundati...
gpl-2.0
Shrhawk/edx-platform
cms/djangoapps/contentstore/features/video.py
134
8674
# pylint: disable=missing-docstring from lettuce import world, step from selenium.webdriver.common.keys import Keys from xmodule.modulestore.django import modulestore VIDEO_BUTTONS = { 'CC': '.hide-subtitles', 'volume': '.volume', 'play': '.video_control.play', 'pause': '.video_control.pause', 'ha...
agpl-3.0
ATSTI/administra
alterando_produtos_odoo/oerplib/service/inspect/on_change.py
4
4037
# -*- coding: UTF-8 -*- ############################################################################## # # OERPLib # Copyright (C) 2013 Sébastien Alix. # # 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 ...
gpl-2.0
elggem/tensorflow_node
src/tensorflow_node/input/opencv.py
2
1954
# -*- coding: utf-8 -*- import rospy import numpy as np import cv2 import os.path import rospy from tensorflow_node.input import InputLayer class OpenCVInputLayer(InputLayer): """ Contains OpenCV to feed in video feeds to TF. """ def __init__(self, batch_size=1, output_size=[28, 28], input="", numb...
unlicense
lmazuel/azure-sdk-for-python
azure-mgmt-machinelearningcompute/azure/mgmt/machinelearningcompute/models/container_service_credentials.py
2
1932
# 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
seldon/django-flexi-auth
flexi_auth/exceptions.py
1
2184
# Copyright (C) 2011 REES Marche <http://www.reesmarche.org> # # This file is part of ``django-flexi-auth``. # ``django-flexi-auth`` 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, version 3 of the Lic...
agpl-3.0
shoreflyer/cerbero
cerbero/packages/packagesstore.py
5
7907
# cerbero - a multi-platform build system for Open Source software # Copyright (C) 2012 Andoni Morales Alastruey <ylatuya@gmail.com> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; eit...
lgpl-2.1
georgyberdyshev/ascend
pygtk/loading.py
1
4002
import sys import config import os.path global have_gtk have_gtk = False #if not sys.executable.endswith("pythonw.exe"): # print "PYTHON PATH =",sys.path try: import pygtk pygtk.require('2.0') import gtk have_gtk = True except Exception,e: if sys.platform=="win32": try: from ctypes import c_int, WINFUNC...
gpl-2.0
andrewsomething/python-digitalocean
digitalocean/LoadBalancer.py
2
12222
# -*- coding: utf-8 -*- from .baseapi import BaseAPI, GET, POST, DELETE class StickySesions(object): """ An object holding information on a LoadBalancer's sticky sessions settings. Args: type (str): The type of sticky sessions used. Can be "cookies" or "none" cookie_name (str,...
lgpl-3.0
lindsayad/sympy
sympy/__init__.py
42
2442
"""SymPy is a Python library for symbolic mathematics. It aims to become a full-featured computer algebra system (CAS) while keeping the code as simple as possible in order to be comprehensible and easily extensible. SymPy is written entirely in Python and does not require any external libraries, except optionally for ...
bsd-3-clause
maftieu/CouchPotatoServer
libs/sqlalchemy/dialects/postgresql/pypostgresql.py
18
2155
# postgresql/pypostgresql.py # Copyright (C) 2005-2013 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 """Support for the PostgreSQL database via py-postgresql. Connecting -----...
gpl-3.0
LamCiuLoeng/budget
budget/widgets/access.py
1
2516
# -*- coding: utf-8 -*- from tw.api import WidgetsList from tw.forms import TableForm from tw.forms.fields import HiddenField from budget.model import DBSession from budget.model import * from budget.widgets.components import * #class SearchForm(RPACForm): # # group_options = DBSession.query(Group.group_id,...
mit
ubc/edx-platform
lms/djangoapps/shoppingcart/migrations/0002_auto__add_field_paidcourseregistration_mode.py
182
8687
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'PaidCourseRegistration.mode' db.add_column('shoppingcart_paidcourseregistration', 'mode', ...
agpl-3.0
mglukhikh/intellij-community
python/helpers/py2only/docutils/transforms/__init__.py
186
6505
# $Id: __init__.py 6433 2010-09-28 08:21:25Z milde $ # Authors: David Goodger <goodger@python.org>; Ueli Schlaepfer # Copyright: This module has been placed in the public domain. """ This package contains modules for standard tree transforms available to Docutils components. Tree transforms serve a variety of purposes...
apache-2.0
iver333/phantomjs
src/breakpad/src/third_party/protobuf/protobuf/python/google/protobuf/internal/wire_format_test.py
571
10848
#! /usr/bin/python # # Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # http://code.google.com/p/protobuf/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # ...
bsd-3-clause
ruiliLaMeilleure/11ad-backhaul
src/aodv/bindings/callbacks_list.py
95
1688
callback_classes = [ ['void', 'ns3::Ptr<ns3::Packet const>', 'ns3::Ipv4Header const&', 'ns3::Socket::SocketErrno', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], ['void', 'ns3::Ptr<ns3::Ipv4Route>', 'ns3::Ptr<ns3::Packet const>', 'ns3::Ipv4Header const&', 'ns3::empty', 'ns3...
gpl-2.0
vitaly-krugl/nupic
src/nupic/support/__init__.py
10
15849
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
agpl-3.0
XDEMOND/holamundo
plugins/ti.alloy/plugin.py
1729
5251
import os, sys, subprocess, hashlib import subprocess def check_output(*popenargs, **kwargs): r"""Run command with arguments and return its output as a byte string. Backported from Python 2.7 as it's implemented as pure python on stdlib. >>> check_output(['/usr/bin/python', '--version']) Python 2.6....
apache-2.0
ipsosante/django-audit-log
audit_log/middleware.py
1
3349
from django.db.models import signals from django.utils.functional import curry from django.conf import settings from audit_log import registration from audit_log.models import fields from audit_log.models.managers import AuditLogManager def _disable_audit_log_managers(instance): for attr in dir(instance): ...
bsd-3-clause
edx/edx-platform
cms/djangoapps/contentstore/management/commands/tests/test_backfill_course_outlines.py
4
4869
""" Tests for `backfill_course_outlines` Studio (cms) management command. """ from django.core.management import call_command from opaque_keys.edx.keys import CourseKey from openedx.core.djangoapps.content.course_overviews.models import CourseOverview from openedx.core.djangoapps.content.learning_sequences.api import ...
agpl-3.0
MobinRanjbar/hue
desktop/core/ext-py/pycrypto-2.6.1/lib/Crypto/SelfTest/Hash/test_SHA256.py
116
3663
# -*- coding: utf-8 -*- # # SelfTest/Hash/test_SHA256.py: Self-test for the SHA-256 hash function # # Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net> # # =================================================================== # The contents of this file are dedicated to the public domain. To # the extent that...
apache-2.0
Romaingin/Antlia
antlia/blueprint/text.py
1
1690
from .primitive import * from ..rect import Rect from .unicode import NAME_TO_UNICODE import re import time as ti class Text(Primitive): def __init__(self, text, font_path, size, align="center"): super(Text, self).__init__() self.text = text self.size = int(size) self.align = align # Test if icon icon =...
mit
CydarLtd/ansible
lib/ansible/modules/network/netconf/netconf_config.py
38
10019
#!/usr/bin/python # (c) 2016, Leandro Lisboa Penz <lpenz at lpenz.org> # # 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 yo...
gpl-3.0
kevinkindom/chrome_depto_tools
third_party/boto/auth.py
51
26228
# Copyright 2010 Google Inc. # Copyright (c) 2011 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2011, Eucalyptus Systems, Inc. # # 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 re...
bsd-3-clause
lenovor/reweighted-ws
caltech/nade-nade.py
6
1678
import numpy as np from learning.dataset import CalTechSilhouettes from learning.preproc import PermuteColumns from learning.termination import LogLikelihoodIncrease, EarlyStopping from learning.monitor import MonitorLL, DLogModelParams, SampleFromP from learning.training import Trainer from learning.models.rws imp...
agpl-3.0
chubbymaggie/miasm
test/utils/testset.py
2
9436
import os import subprocess import sys import time from multiprocessing import cpu_count, Queue, Process from test import Test class Message(object): "Message exchanged in the TestSet message queue" pass class MessageTaskNew(Message): "Stand for a new task" def __init__(self, task): self...
gpl-2.0
CloudWareChile/OpenChile
openerp/addons/hr_expense/__openerp__.py
9
2716
# -*- 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
jcoady9/python-for-android
python-modules/twisted/twisted/python/util.py
56
29731
# -*- test-case-name: twisted.python.test.test_util -*- # Copyright (c) 2001-2010 Twisted Matrix Laboratories. # See LICENSE for details. import os, sys, hmac, errno, new, inspect, warnings try: import pwd, grp except ImportError: pwd = grp = None try: from os import setgroups, getgroups except ImportError...
apache-2.0
elijah513/django
django/db/models/manager.py
301
10722
import copy import inspect from importlib import import_module from django.db import router from django.db.models.query import QuerySet from django.utils import six from django.utils.encoding import python_2_unicode_compatible def ensure_default_manager(cls): """ Ensures that a Model subclass contains a defa...
bsd-3-clause
ai-guild/ncm-adv
lib/twitter.py
1
1203
import data_utils import numpy as np PATH = '../data/twitter/' class Twitter(object): def __init__(self, path=PATH): # data metadata, idx_q, idx_a = data_utils.load_data('../data/') # get dictionaries i2w = metadata['idx2w'] w2i = metadata['w2idx'] ...
gpl-3.0
garnaat/boto
tests/integration/datapipeline/test_cert_verification.py
121
1524
# Copyright (c) 2014 Amazon.com, Inc. or its affiliates. # All rights reserved. # # 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 right...
mit
jbosboom/opentuner
examples/hpl/hpl.py
5
4117
import adddeps #fix sys.path import argparse import logging import opentuner from opentuner.search.manipulator import (ConfigurationManipulator, IntegerParameter, FloatParameter) from opentuner.search.objective import MinimizeTime fro...
mit
gangadharkadam/smrterp
erpnext/config/desktop.py
30
1190
from frappe import _ def get_data(): return { "Accounts": { "color": "#3498db", "icon": "icon-money", "type": "module" }, "Activity": { "color": "#e67e22", "icon": "icon-play", "label": _("Activity"), "link": "activity", "type": "page" }, "Buying": { "color": "#c0392b", "icon":...
agpl-3.0
efortuna/AndroidSDKClone
ndk_experimental/prebuilt/linux-x86_64/lib/python2.7/MimeWriter.py
315
6482
"""Generic MIME writer. This module defines the class MimeWriter. The MimeWriter class implements a basic formatter for creating MIME multi-part files. It doesn't seek around the output file nor does it use large amounts of buffer space. You must write the parts out in the order that they should occur in the final f...
apache-2.0
andyh616/mne-python
mne/stats/regression.py
3
14851
# Authors: Tal Linzen <linzen@nyu.edu> # Teon Brooks <teon.brooks@gmail.com> # Denis A. Engemann <denis.engemann@gmail.com> # Jona Sassenhagen <jona.sassenhagen@gmail.com> # Marijn van Vliet <w.m.vanvliet@gmail.com> # # License: BSD (3-clause) from collections import namedtuple from...
bsd-3-clause
MuhammadShuaib/mwmetrics
setup.py
3
1293
import os from setuptools import find_packages, setup def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() def requirements(fname): return [line.strip() for line in open(os.path.join(os.path.dirname(__file__), fname))] setup( name = "mwmetrics", version = ...
mit
kelseyoo14/Wander
venv_2_7/lib/python2.7/site-packages/Django-1.9-py2.7.egg/django/contrib/admin/filters.py
188
16608
""" This encapsulates the logic for displaying filters in the Django admin. Filters are specified in models with the "list_filter" option. Each filter subclass knows how to display a filter for a field that passes a certain test -- e.g. being a DateField or ForeignKey. """ import datetime from django.contrib.admin.op...
artistic-2.0
tboyce1/home-assistant
tests/components/scene/test_init.py
20
4086
"""The tests for the Scene component.""" import io import unittest from homeassistant.setup import setup_component from homeassistant import loader from homeassistant.components import light, scene from homeassistant.util import yaml from tests.common import get_test_home_assistant class TestScene(unittest.TestCase...
apache-2.0
Simran-B/arangodb
3rdParty/V8-4.3.61/third_party/python_26/Lib/test/test_shelve.py
55
4168
import os import unittest import shelve import glob from test import test_support class TestCase(unittest.TestCase): fn = "shelftemp" + os.extsep + "db" def test_close(self): d1 = {} s = shelve.Shelf(d1, protocol=2, writeback=False) s['key1'] = [1,2,3,4] self.assertEqual(s['ke...
apache-2.0
GheRivero/ansible
test/units/modules/network/f5/test_bigiq_regkey_license_assignment.py
12
4419
# -*- coding: utf-8 -*- # # Copyright: (c) 2017, 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 from nose.plugins.skip i...
gpl-3.0
Wilee999/panda3d
contrib/src/sceneeditor/seMopathRecorder.py
8
85754
################################################################# # seMopathRecorder.py # Originally from MopathRecorder.py # Altered by Yi-Hong Lin, yihhongl@andrew.cmu.edu, 2004 # # We have to change something about data flow and UI # so the curves data can be saved into our dataHolder. # Other things we have changed...
bsd-3-clause
matthiasplappert/keras-rl
tests/rl/test_util.py
1
2969
from __future__ import division import pytest import numpy as np from numpy.testing import assert_allclose from keras.models import Model, Sequential from keras.layers import Input, Dense, Concatenate from keras.optimizers import SGD import keras.backend as K from rl.util import clone_optimizer, clone_model, huber_lo...
mit
broferek/ansible
test/units/modules/network/fortios/test_fortios_wireless_controller_hotspot20_anqp_ip_address_type.py
21
9225
# 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 License, or # (at your option) any later version. # # This program is distributed in the...
gpl-3.0
RefugeeMatchmaking/HackZurich
GAE_Playground/libs/networkx/readwrite/tests/test_p2g.py
91
1328
from nose.tools import assert_equal, assert_raises, assert_not_equal import networkx as nx import io import tempfile import os from networkx.readwrite.p2g import * from networkx.testing import * class TestP2G: def setUp(self): self.G=nx.Graph(name="test") e=[('a','b'),('b','c'),('c','d'),('d','e'...
mit
VAMDC/NodeSoftware
nodes/chianti/node/models.py
2
6610
# This is an auto-generated Django model module. # You'll have to do the following manually to clean this up: # * Rearrange models' order # * Make sure each model has one field with primary_key=True # Feel free to rename the models, but don't rename db_table values or field names. # # Also note: You'll have to ...
gpl-3.0
formiano/enigma2
lib/python/Components/Renderer/Watches.py
7
3012
####################################################################### # # Renderer for Dreambox-Enigma2 # Coded by shamann (c)2010 # # 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 Foundati...
gpl-2.0
40223219/2015_midterm
static/Brython3.1.1-20150328-091302/Lib/unittest/test/testmock/testhelpers.py
737
25793
import unittest from unittest.mock import ( call, _Call, create_autospec, MagicMock, Mock, ANY, _CallList, patch, PropertyMock ) from datetime import datetime class SomeClass(object): def one(self, a, b): pass def two(self): pass def three(self, a=None): pass class AnyT...
gpl-3.0
Yen-Chung-En/2015cdb_W12
static/Brython3.1.1-20150328-091302/Lib/unittest/loader.py
739
13883
"""Loading unittests.""" import os import re import sys import traceback import types import functools from fnmatch import fnmatch from . import case, suite, util __unittest = True # what about .pyc or .pyo (etc) # we would need to avoid loading the same tests multiple times # from '.py', '.pyc' *and* '.pyo' VALID...
agpl-3.0
anbangleo/NlsdeWeb
Python-3.6.0/Lib/test/test_abstract_numbers.py
109
1528
"""Unit tests for numbers.py.""" import math import operator import unittest from numbers import Complex, Real, Rational, Integral class TestNumbers(unittest.TestCase): def test_int(self): self.assertTrue(issubclass(int, Integral)) self.assertTrue(issubclass(int, Complex)) self.assertEqua...
mit
Lab603/PicEncyclopedias
jni-build/jni/include/tensorflow/python/ops/batch_norm_benchmark.py
19
9591
# 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...
mit
nhippenmeyer/django
tests/middleware_exceptions/tests.py
147
44086
import sys from django.conf import settings from django.core.exceptions import MiddlewareNotUsed from django.core.signals import got_request_exception from django.http import HttpResponse from django.template import engines from django.template.response import TemplateResponse from django.test import RequestFactory, S...
bsd-3-clause
Serg09/socorro
socorro/external/hbase/connection_context.py
11
8757
# 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/. import threading import contextlib from socorro.external.hbase import hbase_client from configman.config_manager import...
mpl-2.0
kenshay/ImageScript
ProgramData/SystemFiles/opencv/sources/samples/python2/hist.py
9
3575
#!/usr/bin/env python ''' This is a sample for histogram plotting for RGB images and grayscale images for better understanding of colour distribution Benefit : Learn how to draw histogram of images Get familier with cv2.calcHist, cv2.equalizeHist,cv2.normalize and some drawing functions Level : Beginner or...
gpl-3.0
pauloschilling/sentry
tests/sentry/web/frontend/test_organization_home.py
13
2199
from __future__ import absolute_import from django.core.urlresolvers import reverse from sentry.models import AuthProvider from sentry.testutils import TestCase, PermissionTestCase class OrganizationHomePermissionTest(PermissionTestCase): def setUp(self): super(OrganizationHomePermissionTest, self).setU...
bsd-3-clause
CoDEmanX/ArangoDB
3rdParty/V8-4.3.61/third_party/python_26/Lib/uuid.py
59
20331
r"""UUID objects (universally unique identifiers) according to RFC 4122. This module provides immutable UUID objects (class UUID) and the functions uuid1(), uuid3(), uuid4(), uuid5() for generating version 1, 3, 4, and 5 UUIDs as specified in RFC 4122. If all you want is a unique ID, you should probably call uuid1() ...
apache-2.0
guijomatos/SickRage
lib/pysrt/commands.py
71
8471
#!/usr/bin/env python # -*- coding: utf-8 -*- # pylint: disable-all import os import re import sys import codecs import shutil import argparse from textwrap import dedent from chardet import detect from pysrt import SubRipFile, SubRipTime, VERSION_STRING def underline(string): return "\033[4m%s\033[0m" % string...
gpl-3.0
simplegeo/shapely
shapely/geometry/base.py
1
17241
"""Base geometry class and utilities """ from functools import wraps import sys import warnings from shapely.coords import CoordinateSequence from shapely.geos import lgeos from shapely.impl import DefaultImplementation from shapely import wkb, wkt GEOMETRY_TYPES = [ 'Point', 'LineString', 'LinearRing', 'Poly...
bsd-3-clause
betoesquivel/CIE
flask/lib/python2.7/site-packages/tornado/httpclient.py
22
25772
"""Blocking and non-blocking HTTP client interfaces. This module defines a common interface shared by two implementations, ``simple_httpclient`` and ``curl_httpclient``. Applications may either instantiate their chosen implementation class directly or use the `AsyncHTTPClient` class from this module, which selects an...
mit
xxsergzzxx/python-for-android
python3-alpha/python3-src/Lib/importlib/test/test_util.py
51
3794
from importlib import util from . import util as test_util import imp import sys import types import unittest class ModuleForLoaderTests(unittest.TestCase): """Tests for importlib.util.module_for_loader.""" def return_module(self, name): fxn = util.module_for_loader(lambda self, module: module) ...
apache-2.0
zhmcclient/zhmccli
zhmccli/_cmd_storagegroup.py
1
24874
# Copyright 2020 IBM Corp. 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 agre...
apache-2.0
rzr/synapse
synapse/rest/client/v1/base.py
4
1585
# -*- coding: utf-8 -*- # Copyright 2014, 2015 OpenMarket Ltd # # 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
CantemoInternal/django-comments-xtd
django_comments_xtd/demos/simple/settings.py
1
3973
#-*- coding: utf-8 -*- from __future__ import unicode_literals import os PRJ_PATH = os.path.abspath(os.path.curdir) DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( ('Alice Bloggs', 'alice@example.com'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', ...
bsd-2-clause
tangyibin/goblin-core
riscv/llvm/3.5/cfe-3.5.0.src/bindings/python/examples/cindex/cindex-includes.py
110
1644
#!/usr/bin/env python #===- cindex-includes.py - cindex/Python Inclusion Graph -----*- python -*--===# # # The LLVM Compiler Infrastructure # # This file is distributed under the University of Illinois Open Source # License. See LICENSE.TXT for details. # #===---------------------------------------...
bsd-3-clause
gsnedders/presto-testo
core/standards/scripts/opjsunit/harness/winprocess.py
14
9554
# A module to expose various thread/process/job related structures and # methods from kernel32 # # The MIT License # # Copyright (c) 2006 the Mozilla Foundation <http://www.mozilla.org> # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files...
bsd-3-clause
Livit/Livit.Learn.EdX
pavelib/utils/envs.py
9
7028
""" Helper functions for loading environment settings. """ from __future__ import print_function import os import sys import json from lazy import lazy from path import Path as path import memcache class Env(object): """ Load information about the execution environment. """ # Root of the git reposito...
agpl-3.0
szilveszter/django
django/utils/importlib.py
98
1547
# Taken from Python 2.7 with permission from/by the original author. import warnings import sys from django.utils import six from django.utils.deprecation import RemovedInDjango19Warning warnings.warn("django.utils.importlib will be removed in Django 1.9.", RemovedInDjango19Warning, stacklevel=2) def _resolve_...
bsd-3-clause
wimberosa/samba
buildtools/wafadmin/Tools/tex.py
16
7234
#!/usr/bin/env python # encoding: utf-8 # Thomas Nagy, 2006 (ita) "TeX/LaTeX/PDFLaTeX support" import os, re import Utils, TaskGen, Task, Runner, Build from TaskGen import feature, before from Logs import error, warn, debug re_tex = re.compile(r'\\(?P<type>include|input|import|bringin|lstinputlisting){(?P<file>[^{}]...
gpl-3.0
JustasB/MitralSuite
Models/Migliore2014/mkmitral.py
1
1261
from neuron import h h.load_file('mitral.hoc') from getmitral import getmitral def mkmitral(gid): nrn = getmitral(gid) m = h.Mitral() m.createsec(len(nrn.dend), len(nrn.tuft)) m.subsets() m.topol(0) # need to connect secondary dendrites explicitly for i, d in enumerate(nrn.dend): # <<< check m...
mit
pataquets/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/common/system/environment_unittest.py
124
1853
# Copyright (C) 2011 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
bsd-3-clause
ryfeus/lambda-packs
LightGBM_sklearn_scipy_numpy/source/scipy/optimize/_lsq/bvls.py
15
4994
"""Bounded-Variable Least-Squares algorithm.""" from __future__ import division, print_function, absolute_import import numpy as np from numpy.linalg import norm, lstsq from scipy.optimize import OptimizeResult from .common import print_header_linear, print_iteration_linear def compute_kkt_optimality(g, on_bound): ...
mit
freedryk/cloudtracker
cloudtracker/generate_cloudlets.py
1
6967
#!/usr/bin/env python """ This program generates a pkl file containing a list of dictionaries. Each dictionary in the list represents a condensedlet. The dictionaries have the structure: {'core': array of ints of core points, 'condensed': array of ints of condensed points, 'plume': array of ints of plume points, 'u_con...
bsd-2-clause
Ahuge/ShortcutEditorNuke
keyboard/keys/base_key.py
1
1369
import weakref from PySide import QtGui, QtCore from resources import HEX_COLOUR_NONE, HEX_COLOUR_RED, HEX_COLOUR_GREEN, HEX_COLOUR_BLUE class BaseKey(QtGui.QPushButton): KEY_TYPE = "default" KEY_CLICKED = QtCore.Signal(weakref.ReferenceType) BG_COLOUR = HEX_COLOUR_NONE def __init__(self, *args, **kw...
gpl-3.0
geraldinepascal/FROGS
assessment/bin/its_assessRealMock.py
1
14370
#!/usr/bin/env python2.7 # # Copyright (C) 2016 INRA # # 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 ...
gpl-3.0
tinkerinestudio/Tinkerine-Suite
TinkerineSuite/python/Lib/OpenGL/raw/GL/EXT/pixel_transform.py
3
2932
'''OpenGL extension EXT.pixel_transform Automatically generated by the get_gl_extensions script, do not edit! ''' from OpenGL import platform, constants, constant, arrays from OpenGL import extensions from OpenGL.GL import glget import ctypes EXTENSION_NAME = 'GL_EXT_pixel_transform' _DEPRECATED = False GL_PIXEL_TRANS...
agpl-3.0
doismellburning/django
django/conf/locale/de_CH/formats.py
115
1445
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date from __future__ import unicode_literals DATE_FORMAT = 'j. F Y' TIME_FORMAT = 'H:i' DATE...
bsd-3-clause
nttks/edx-platform
cms/djangoapps/contentstore/tests/test_libraries.py
1
45755
""" Content library unit tests that require the CMS runtime. """ from django.test.client import RequestFactory from django.test.utils import override_settings from contentstore.tests.utils import AjaxEnabledTestClient, parse_json, switch_ga_global_course_creator from contentstore.utils import reverse_url, reverse_usage...
agpl-3.0
b-cube/OwsCapable
owscapable/map/wms130.py
1
25313
# -*- coding: iso-8859-15 -*- # ============================================================================= # Copyright (c) 2004, 2006 Sean C. Gillies # Copyright (c) 2005 Nuxeo SARL <http://nuxeo.com> # # Authors : Sean Gillies <sgillies@frii.com> # Julien Anguenot <ja@nuxeo.com> # # Contact email: sgillie...
bsd-3-clause
jakirkham/dask-distance
dask_distance/_utils.py
1
1884
import functools import itertools import numpy import dask import dask.array from . import _compat from . import _pycompat def _broadcast_uv(u, v): U = _compat._atleast_2d(u) V = _compat._atleast_2d(v) if U.ndim != 2: raise ValueError("u must be a 1-D or 2-D array.") if V.ndim != 2: ...
bsd-3-clause
lrowe/rdflib
rdflib/plugins/parsers/pyRdfa/transform/OpenID.py
26
2119
# -*- coding: utf-8 -*- """ Simple transfomer: handle OpenID elements. Ie: an openid namespace is added and the usual 'link' elements for openid are exchanged against a namespaced version. @summary: OpenID transformer module. @requires: U{RDFLib package<http://rdflib.net>} @organization: U{World Wide Web Consortium<ht...
bsd-3-clause
zh021589/robotframework-restlibrary
RestLibrary.py
2
7284
# -*- coding: UTF-8 -*- """ This is a HTTP/REST client library, primarily designed for use as a `Robot Framework <http://robotframework.org/>`_ test library. It provides keywords for calling REST-style services and inspecting the response. Copyright (c) 2008 Niklas Lindström <lindstream@gmail.com>, all rights reserved...
apache-2.0
apache/incubator-allura
ForgeSVN/forgesvn/tests/test_tasks.py
2
2803
# -*- coding: utf-8 -*- # 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 Apach...
apache-2.0
alimony/django
django/db/migrations/operations/fields.py
18
12979
from django.db.models.fields import NOT_PROVIDED from django.utils.functional import cached_property from .base import Operation class FieldOperation(Operation): def __init__(self, model_name, name): self.model_name = model_name self.name = name @cached_property def model_name_lower(self...
bsd-3-clause
manics/openmicroscopy
components/tools/OmeroWeb/omeroweb/webclient/webclient_utils.py
12
2113
#!/usr/bin/env python # -*- coding: utf-8 -*- # # # Copyright (C) 2011 University of Dundee & Open Microscopy Environment. # All rights reserved. # # 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 Fou...
gpl-2.0
KiChjang/servo
components/script/dom/bindings/codegen/parser/tests/test_method.py
15
9920
import WebIDL def WebIDLTest(parser, harness): parser.parse(""" interface TestMethods { void basic(); static void basicStatic(); void basicWithSimpleArgs(boolean arg1, byte arg2, unsigned long arg3); boolean basicBoolean(); static boolean basicStaticBoolean...
mpl-2.0
alexlib/Qt-Python-Binding-Examples
style_and_theme/disable_highlight.py
1
1096
#!/usr/bin/env python #-*- coding:utf-8 -*- """ disable highlight focused widget Tested environment: Mac OS X 10.6.8 http://stackoverflow.com/questions/1987546/qt4-stylesheets-and-focus-rect """ import sys try: from PySide import QtCore from PySide import QtGui except ImportError: from PyQt4 import Q...
bsd-3-clause
unseenlaser/machinekit
src/machinetalk/messagebus/python-mockup/commandsubmitter.py
8
2327
import os, time import zmq from message_pb2 import Container from types_pb2 import * from optparse import OptionParser parser = OptionParser() parser.add_option("-c", "--cmd", dest="cmduri", default="tcp://127.0.0.1:5571", help="command URI") parser.add_option("-r", "--response", dest="responseuri"...
lgpl-2.1
tshrjn/courses
cs/udacity/cs101-intro-cs/code/lesson6/search_engine.py
4
2795
import subprocess, sys # gets the first link on any webpage def get_next_target(page): copy = page repl = ['= ', ' =', ' = '] for i in range(0, len(repl)): copy = copy.replace(repl[i], "=") first_link_start = copy.find("<a") if (first_link_start == -1): return None else: ...
mit
pongem/python-bot-project
appengine/standard/botapp/lib/django/templatetags/static.py
91
4391
from django import template from django.apps import apps from django.utils.encoding import iri_to_uri from django.utils.six.moves.urllib.parse import urljoin register = template.Library() class PrefixNode(template.Node): def __repr__(self): return "<PrefixNode for %r>" % self.name def __init__(self...
apache-2.0
alfonsodev/ansible-modules-extras
monitoring/stackdriver.py
58
6848
#!/usr/bin/python # -*- coding: utf-8 -*- # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. ...
gpl-3.0
Motaku/ansible
contrib/inventory/serf.py
395
3032
#!/usr/bin/env python # (c) 2015, Marc Abramowitz <marca@surveymonkey.com> # # This file is part of Ansible. # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (...
gpl-3.0
Schevo/kiwi
kiwi/desktopparser.py
3
5236
# # Kiwi: a Framework and Enhanced Widgets for Python # # Copyright (C) 2006 Johan Dahlin <jdahlin@async.com.br> # # This library 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; either # version 2.1 of ...
lgpl-2.1
cristianquaglio/odoo
addons/website_mail/controllers/main.py
149
4279
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
apache-2.0
chrishas35/django-travis-ci
django/db/models/sql/subqueries.py
87
8259
""" Query subclasses which provide extra functionality beyond simple data retrieval. """ from django.core.exceptions import FieldError from django.db.models.fields import DateField, FieldDoesNotExist from django.db.models.sql.constants import * from django.db.models.sql.datastructures import Date from django.db.models...
bsd-3-clause
ragnarokkrr/rgn_vm_containers
rgn_k8s_kafka_python/snippets/avro_producer_plain.py
1
1038
from confluent_kafka import avro from confluent_kafka.avro import AvroProducer from lipsum import generate_words import os import random SCHEMA_REGISTRY_URL = 'http://172.17.0.5:8081' BOOTSTRAP_SERVERS = '172.17.0.4' AVSC_DIR = os.path.dirname(os.path.realpath(__file__)) KEY_SCHEMA = avro.load(os.path.join(AVSC_DIR, ...
apache-2.0
abaditsegay/arangodb
3rdParty/V8-4.3.61/build/gyp/test/subdirectory/gyptest-SYMROOT-default.py
399
1260
#!/usr/bin/env python # Copyright (c) 2009 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. """ Verifies building a target and a subsidiary dependent target from a .gyp file in a subdirectory, without specifying an explicit output b...
apache-2.0
Changaco/oh-mainline
vendor/packages/celery/celery/tests/test_events/__init__.py
18
6120
from __future__ import absolute_import from __future__ import with_statement import socket from celery import events from celery.app import app_or_default from celery.tests.utils import unittest class MockProducer(object): raise_on_publish = False def __init__(self, *args, **kwargs): self.sent = []...
agpl-3.0
joachimmetz/dfvfs
dfvfs/resolver_helpers/os_resolver_helper.py
2
1201
# -*- coding: utf-8 -*- """The operating system path specification resolver helper implementation.""" from dfvfs.file_io import os_file_io from dfvfs.lib import definitions from dfvfs.resolver_helpers import manager from dfvfs.resolver_helpers import resolver_helper from dfvfs.vfs import os_file_system class OSResol...
apache-2.0
Nagriar/mongo-connector
tests/test_gridfs_file.py
31
3939
# Copyright 2013-2014 MongoDB, 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 in writin...
apache-2.0
leki75/ansible
lib/ansible/module_utils/cloudstack.py
30
23809
# -*- coding: utf-8 -*- # # (c) 2015, René Moser <mail@renemoser.net> # # This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by Ansible # still belong to the aut...
gpl-3.0
duythanhphan/gumbo
python/gumbo/gumboc.py
2
12639
# Copyright 2012 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