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
hodgem/XNATImageViewer
src/main/scripts/viewer/X/lib/selenium/selenium/webdriver/remote/utils.py
37
3643
# Copyright 2008-2009 WebDriver committers # Copyright 2008-2009 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
bsd-3-clause
GbalsaC/bitnamiP
pavelib/utils/envs.py
1
6330
""" 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 import memcache class Env(object): """ Load information about the execution environment. """ # Root of the git repository (edx-...
agpl-3.0
patricksnape/imageio
imageio/plugins/_freeimage.py
4
51820
# -*- coding: utf-8 -*- # Copyright (c) 2015, imageio contributors # imageio is distributed under the terms of the (new) BSD License. # styletest: ignore E261 """ Module imageio/freeimage.py This module contains the wrapper code for the freeimage library. The functions defined in this module are relatively thin; jus...
bsd-2-clause
sebastian-code/system_overview
system_report.py
1
9502
#! /usr/bin/python3 # -*- coding:utf-8 -*- import platform import os import subprocess # cat /proc/cpuinfo | grep 'model name' | head -n 1 | sed 's/model name.*: //g' def nom_proc(): p1 = subprocess.Popen(['cat', '/proc/cpuinfo'], stdout=subprocess.PIPE) p2 = subprocess.Popen(['grep', 'model name'], stdin=p1...
mit
eemirtekin/edx-platform
common/djangoapps/util/migrations/0002_default_rate_limit_config.py
102
4097
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import DataMigration from django.db import models class Migration(DataMigration): def forwards(self, orm): """Ensure that rate limiting is enabled by default. """ orm['util.RateLimitConfiguration'].objects.create(enable...
agpl-3.0
kimjaejoong/nova
nova/image/glance.py
3
25512
# Copyright 2010 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
ccoss/fas
fas/feeds.py
4
2066
# -*- coding: utf-8 -*- ''' Provides feeds interface to FAS ''' # # Copyright © 2008 Ricky Zhou # Copyright © 2008 Red Hat, Inc. # # This copyrighted material is made available to anyone wishing to use, modify, # copy, or redistribute it subject to the terms and conditions of the GNU # General Public License v.2. Thi...
gpl-2.0
TileHalo/servo
tests/wpt/harness/wptrunner/update/state.py
196
4417
# 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 os import cPickle as pickle here = os.path.abspath(os.path.split(__file__)[0]) class State(object): filenam...
mpl-2.0
kensipe/dcos
packages/adminrouter/extra/src/test-harness/tests/test_auth.py
4
11132
# Copyright (C) Mesosphere, Inc. See LICENSE file for details. import os import time import pytest import requests from generic_test_code.common import assert_endpoint_response from util import GuardedSubprocess, SearchCriteria, auth_type_str EXHIBITOR_PATH = "/exhibitor/foo/bar" # Note(JP): this test assumes tha...
apache-2.0
mpetyx/palmdrop
venv/lib/python2.7/site-packages/gunicorn/workers/ggevent.py
7
4871
# -*- coding: utf-8 - # # This file is part of gunicorn released under the MIT license. # See the NOTICE for more information. from __future__ import with_statement import os import sys from datetime import datetime from functools import partial import time # workaround on osx, disable kqueue if sys.platform == "dar...
apache-2.0
firewalld/firewalld
src/firewall/core/logger.py
3
31038
# -*- coding: utf-8 -*- # # Copyright (C) 2005-2007,2012 Red Hat, Inc. # # Authors: # Thomas Woerner <twoerner@redhat.com> # # 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 t...
gpl-2.0
LogicalDash/kivy
kivy/tests/test_urlrequest.py
5
5098
''' UrlRequest tests ================ ''' import unittest try: # py3k import _thread except ImportError: # py27 import thread as _thread from kivy.network.urlrequest import UrlRequest from time import sleep from base64 import b64encode from kivy.clock import Clock import os class UrlRequestTest(uni...
mit
JGarcia-Panach/odoo
doc/conf.py
184
8222
# -*- coding: utf-8 -*- import sys, os import sphinx # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. DIR = os.path.dirname(__file...
agpl-3.0
haoyuchen1992/CourseBuilder
appengine_config.py
4
3741
# Copyright 2013 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 ...
apache-2.0
suprzer0/aoc2016
day2/tests.py
1
1060
from io import StringIO import unittest from solve import load_data, solve_p1, solve_p2 class LoadDataTestCase(unittest.TestCase): def test_example(self): example = ( "ULL\n" "RRDDD\n" "LURDL\n" "UUUUD\n") s = StringIO(example) data = load_data(s) ...
mit
popas90/filebarn
filebarn/models.py
1
1149
from filebarn import db from werkzeug.security import generate_password_hash, check_password_hash class User(db.Model): __tablename__ = 'users' id = db.Column(db.Integer, primary_key=True) username = db.Column(db.String(64), index=True, unique=True) password_hash = db.Column(db.String(128)) email ...
mit
pprett/statsmodels
statsmodels/examples/tsa/arma_plots.py
4
2478
'''Plot acf and pacf for some ARMA(1,1) ''' import numpy as np import matplotlib.pyplot as plt import statsmodels.tsa.arima_process as tsp from statsmodels.sandbox.tsa.fftarma import ArmaFft as FftArmaProcess import statsmodels.tsa.stattools as tss from statsmodels.graphics.tsaplots import plotacf np.set_printoptio...
bsd-3-clause
gvanhorn38/active_neurofinder
baselearners/train_full.py
1
18123
# Trains network on the full neurofinder dataset ## IMPORT import json import numpy as np from scipy.misc import imread from glob import glob import os import random import neurofinder as nf from keras.layers import Input, Convolution2D, MaxPooling2D, Convolution3D, MaxPooling3D, merge, Dropout, BatchNormalization, ...
mit
TheTypoMaster/calligra
3rdparty/google-breakpad/src/tools/gyp/test/mac/gyptest-copies.py
258
1437
#!/usr/bin/env python # Copyright (c) 2012 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 that 'copies' with app bundles are handled correctly. """ import TestGyp import os import sys import time if sys.platform ==...
gpl-2.0
faloi/pygobstones
examples/PixelArt/misc/generator.py
3
4067
#!/usr/bin/python # # Copyright (C) 2011-2013 Ary Pablo Batista <arypbatista@gmail.com> # # 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) a...
gpl-3.0
behzadnouri/scipy
tools/cythonize.py
67
6228
#!/usr/bin/env python """ cythonize Cythonize pyx files into C files as needed. Usage: cythonize [root_dir] Default [root_dir] is 'scipy'. Checks pyx files to see if they have been changed relative to their corresponding C files. If they have, then runs cython on these files to recreate the C files. The script th...
bsd-3-clause
gndpig/hadoop
src/contrib/hod/hodlib/Hod/nodePool.py
182
3753
#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 use thi...
apache-2.0
Lingotek/client
python2/ltk/actions/reference_action.py
2
11464
from ltk.actions.action import * class ReferenceAction(Action): def __init__(self, path): Action.__init__(self, path) def reference_add_action(self, filename, doc_id): if self._check_filename(filename, doc_id): material = [] while True: while True: ...
mit
ltilve/ChromiumGStreamerBackend
tools/telemetry/third_party/gsutilz/gslib/boto_resumable_upload.py
23
24348
# -*- coding: utf-8 -*- # Copyright 2010 Google Inc. 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 rights to u...
bsd-3-clause
yanchen036/tensorflow
tensorflow/python/keras/utils/vis_utils.py
26
5247
# Copyright 2018 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
andreimacavei/coala
coalib/tests/collecting/DependenciesTest.py
3
1647
import sys import unittest sys.path.insert(0, ".") from coalib.bears.Bear import Bear from coalib.collecting import Dependencies class BearWithoutDeps(Bear): @staticmethod def get_dependencies(): return [] class ResolvableBear1(Bear): @staticmethod def get_dependencies(): return [Be...
agpl-3.0
fginter/docs-fginterfork
gen_index/index_page.py
2
12420
#Note: much of the at-glance table generation happens in templates/atglance.html -> go see there # this code produces the dictionary which holds the data for rendering the template # and then simply feeds that dictionary to jinja2 which does its magic with the template import sys import glob import os.path import json...
apache-2.0
mttr/django
tests/model_fields/test_uuid.py
81
6563
import json import uuid from django.core import exceptions, serializers from django.db import IntegrityError, models from django.test import ( SimpleTestCase, TestCase, TransactionTestCase, skipUnlessDBFeature, ) from .models import ( NullableUUIDModel, PrimaryKeyUUIDModel, RelatedToUUIDModel, UUIDGrandchild,...
bsd-3-clause
MicroTrustRepos/microkernel
src/l4/pkg/python/contrib/Lib/plat-mac/lib-scriptpackages/StdSuites/QuickDraw_Graphics_Suite.py
81
11738
"""Suite QuickDraw Graphics Suite: A set of basic classes for graphics Level 1, version 1 Generated from /Volumes/Sap/System Folder/Extensions/AppleScript AETE/AEUT resource version 1/0, language 0, script 0 """ import aetools import MacOS _code = 'qdrw' class QuickDraw_Graphics_Suite_Events: pass class arc(...
gpl-2.0
davidbradway/py-package-example
setup.py
1
1232
import os from setuptools import setup with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme: README = readme.read() # allow setup.py to be run from any path os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) setup( name='django-polls', version='0.1', ...
bsd-2-clause
sbalde/edx-platform
cms/djangoapps/contentstore/features/pages.py
36
5109
# pylint: disable=missing-docstring # pylint: disable=redefined-outer-name # pylint: disable=unused-argument from lettuce import world, step from nose.tools import assert_equal, assert_in # pylint: disable=no-name-in-module CSS_FOR_TAB_ELEMENT = "li[data-tab-id='{0}'] input.toggle-checkbox" @step(u'I go to the pa...
agpl-3.0
Khan/git-bigfile
vendor/boto/rds/dbsecuritygroup.py
185
6651
# Copyright (c) 2009 Mitch Garnaat http://garnaat.org/ # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, m...
mit
mrcrgl/gge-storage
lib/socket/management/commands/runsockettest.py
1
2692
from __future__ import unicode_literals import socket import multiprocessing from django.core.management.base import BaseCommand, CommandError import logging logger = logging.getLogger(__name__) class Socket: '''demonstration class only - coded for clarity, not efficiency ''' close_bit = "\x00" ...
mit
akiyoko/oscar_project
src/oscar/apps/dashboard/communications/views.py
20
3090
from django.contrib import messages from django.contrib.sites.shortcuts import get_current_site from django.template import TemplateSyntaxError from django.utils import six from django.utils.translation import ugettext_lazy as _ from django.views import generic from oscar.core.loading import get_class, get_model Comm...
bsd-3-clause
elzurdo/happynoamchomskyday
happynoamchomskyday/chomsky.py
1
6340
import os import requests import httplib2 from googleapiclient import discovery from oauth2client import client from oauth2client import tools from oauth2client.file import Storage SCOPES = ['https://www.googleapis.com/auth/calendar'] path = '{}/aux/'.format(os.getcwd()) CLIENT_SECRET_FILE = '{}client_secret_choms...
mit
scottpurdy/nupic
src/nupic/data/generators/__init__.py
50
1027
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2015, Numenta, Inc. Unless you have purchased from # Numenta, Inc. a separate commercial license for this software code, the # following terms and conditions apply: # # This pro...
agpl-3.0
nibanks/openthread
tests/scripts/thread-cert/__init__.py
5
1600
#!/usr/bin/python # # Copyright (c) 2016, The OpenThread Authors. # 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 # not...
bsd-3-clause
eclipse/ice
examples/org.eclipse.ice.examples.reflectivity/listFromScratchPython.py
1
4003
# **************************************************************************** # Copyright (c) 2015 UT-Battelle, LLC. # All rights reserved. This program and the accompanying materials # are made available under the terms of the Eclipse Public License v1.0 # which accompanies this distribution, and is available a...
epl-1.0
terhorstd/nest-simulator
doc/topology/grid_iaf_oc.py
17
1696
# -*- coding: utf-8 -*- # # grid_iaf_oc.py # # This file is part of NEST. # # Copyright (C) 2004 The NEST Initiative # # NEST 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...
gpl-2.0
JeanFred/graphite-web
docs/conf.py
27
7754
# -*- coding: utf-8 -*- # # Graphite documentation build configuration file, created by # sphinx-quickstart on Mon Mar 21 12:31:35 2011. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # Al...
apache-2.0
gusg21/painless
lineparser.py
1
2250
import mistune, datetime, yaml def tilde(line): try: command = line[line.index("~")+1:line.index(":")] # get the command except ValueError: print("Malformed command: \"" + line + "\"") sys.exit() args = line[line.index(":")+1:].split() # get the rest of the args in a list if command =...
apache-2.0
cproctor/scratch_nxt
nxtbrick.py
1
2682
import lightblue from nxt import Motor, find_one_brick, PORT_A, PORT_B, PORT_C, PORT_1, PORT_2, PORT_3, PORT_4 from nxt.sensor import Touch, Sound, Ultrasonic, Light from time import sleep class PortMap(dict): def __init__(self, ports, factory): self.factory = factory self.ports = ports def __m...
mit
shahar-stratoscale/nova
nova/openstack/common/systemd.py
6
3056
# Copyright 2012-2014 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
apache-2.0
ramanajee/phantomjs
src/breakpad/src/third_party/protobuf/protobuf/python/google/protobuf/internal/test_util.py
295
27103
# 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: # # * Redistributions o...
bsd-3-clause
wbsoft/frescobaldi
frescobaldi_app/backup.py
3
1938
# This file is part of the Frescobaldi project, http://www.frescobaldi.org/ # # Copyright (c) 2008 - 2014 by Wilbert Berendsen # # 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 ...
gpl-2.0
affan2/django-envelope
setup.py
1
1120
import os from setuptools import setup, find_packages def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() setup( name='django-envelope', version=__import__('envelope').__version__, description='A contact form app for Django', long_description=read('README.rst'), ...
mit
davidjb/sqlalchemy
test/orm/test_manytomany.py
32
14049
from sqlalchemy.testing import assert_raises, \ assert_raises_message, eq_ import sqlalchemy as sa from sqlalchemy import testing from sqlalchemy import Integer, String, ForeignKey from sqlalchemy.testing.schema import Table from sqlalchemy.testing.schema import Column from sqlalchemy.orm import mapper, relationshi...
mit
ubiar/odoo
addons/sale/edi/__init__.py
454
1065
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2011 OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GN...
agpl-3.0
3nids/QGIS
tests/src/python/test_qgsproviderregistry.py
6
5049
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsProviderRegistry. .. 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 Foundation; either version 2 of the License, or (at your option) any later version. "...
gpl-2.0
vmturbo/nova
nova/scheduler/filters/exact_disk_filter.py
18
1846
# Copyright (c) 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 ...
apache-2.0
jupyter-widgets/ipywidgets
ipywidgets/widgets/tests/test_datetime_serializers.py
1
2132
#!/usr/bin/env python # coding: utf-8 # Copyright (c) Vidar Tonaas Fauske. # Distributed under the terms of the Modified BSD License. import pytest import datetime import pytz from traitlets import TraitError from ..trait_types import ( time_to_json, time_from_json, datetime_to_json, datetime_from_...
bsd-3-clause
Lawrence-Liu/scikit-learn
sklearn/tests/test_metaestimators.py
226
4954
"""Common tests for metaestimators""" import functools import numpy as np from sklearn.base import BaseEstimator from sklearn.externals.six import iterkeys from sklearn.datasets import make_classification from sklearn.utils.testing import assert_true, assert_false, assert_raises from sklearn.pipeline import Pipeline...
bsd-3-clause
Arundhatii/erpnext
erpnext/accounts/report/asset_depreciations_and_balances/asset_depreciations_and_balances.py
32
6129
# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe import _ from frappe.utils import formatdate, getdate, flt, add_days def execute(filters=None): filters.day_before_from_date = add_d...
gpl-3.0
ceph/autotest
client/tests/kvm/tests/nic_promisc.py
1
4334
import logging, threading from autotest_lib.client.common_lib import error from autotest_lib.client.bin import utils import kvm_utils, kvm_test_utils def run_nic_promisc(test, params, env): """ Test nic driver in promisc mode: 1) Boot up a VM. 2) Repeatedly enable/disable promiscuous mode in guest. ...
gpl-2.0
AgataGibas/python101
bazy/orm/sqlalchemy/ormsa03.py
2
1954
#! /usr/bin/env python # -*- coding: utf-8 -*- import sys, os from sqlalchemy import Column, ForeignKey, Integer, String, create_engine from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import relationship, sessionmaker if os.path.exists('test.db'): os.remove('test.db') # tworzymy instan...
mit
esc/pip
pip/_vendor/packaging/markers.py
76
7341
# 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 import operator import os import platform import sys from pip._vendor.pyp...
mit
ephes/trivago2015
config/settings/production.py
1
5032
# -*- coding: utf-8 -*- ''' Production Configurations - Use djangosecure - Use Amazon's S3 for storing static files and uploaded media - Use sendgrid to send emails - Use MEMCACHIER on Heroku ''' from __future__ import absolute_import, unicode_literals from boto.s3.connection import OrdinaryCallingFormat from django...
bsd-3-clause
Lab41/try41
api.py
1
10454
from flask import Flask from flask import g from flask import jsonify from flask import redirect from flask import render_template from flask import render_template_string from flask import request from flask import send_from_directory from flask import url_for from flask.ext.babel import Babel from flask.ext.mail impo...
apache-2.0
Yellowen/Owrang
patches/march_2013/p05_payment_reconciliation.py
2
1304
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. # License: GNU General Public License v3. See license.txt import webnotes def execute(): # delete wrong gle entries created due to a bug in make_gl_entries of Account Controller # when using payment reconciliation res = webnotes.conn.sql_list("""select distinc...
agpl-3.0
philipz/PyCV-time
opencv-official-samples/2.4.9/gabor_threads.py
7
1704
#!/usr/bin/env python ''' gabor_threads.py ========= Sample demonstrates: - use of multiple Gabor filter convolutions to get Fractalius-like image effect (http://www.redfieldplugins.com/filterFractalius.htm) - use of python threading to accelerate the computation Usage ----- gabor_threads.py [image filename] ''' i...
mit
tal-nino/ansible
lib/ansible/plugins/lookup/sequence.py
82
7066
# (c) 2013, Jayson Vantuyl <jayson@aggressive.ly> # # 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 v...
gpl-3.0
elijah513/django
django/contrib/sites/managers.py
472
2132
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.conf import settings from django.core import checks from django.core.exceptions import FieldDoesNotExist from django.db import models class CurrentSiteManager(models.Manager): "Use this to limit objects to those associated with the curre...
bsd-3-clause
bj7/pwndbg
pwndbg/constants/s390.py
1
26907
from .constant import Constant __NR_exit = Constant('__NR_exit',1) __NR_fork = Constant('__NR_fork',2) __NR_read = Constant('__NR_read',3) __NR_write = Constant('__NR_write',4) __NR_open = Constant('__NR_open',5) __NR_close = Constant('__NR_close',6) __NR_creat = Constant('__NR_creat',8) __NR_link = Constant('__NR_link...
mit
mollstam/UnrealPy
UnrealPyEmbed/Source/Python/Lib/python27/xdrlib.py
54
6069
"""Implements (a subset of) Sun XDR -- eXternal Data Representation. See: RFC 1014 """ import struct try: from cStringIO import StringIO as _StringIO except ImportError: from StringIO import StringIO as _StringIO from functools import wraps __all__ = ["Error", "Packer", "Unpacker", "ConversionError"] # exc...
mit
rockyzhang/zhangyanhit-python-for-android-mips
python-modules/twisted/twisted/conch/test/test_userauth.py
59
39075
# -*- test-case-name: twisted.conch.test.test_userauth -*- # Copyright (c) 2007-2010 Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for the implementation of the ssh-userauth service. Maintainer: Paul Swartz """ from zope.interface import implements from twisted.cred.checkers import ICredentialsC...
apache-2.0
Perferom/android_external_chromium
chrome/common/extensions/docs/examples/apps/hello-python/oauth2/__init__.py
257
25629
""" 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
clouddocx/boto
tests/integration/s3/test_multidelete.py
111
6815
# -*- coding: utf-8 -*- # Copyright (c) 2011 Mitch Garnaat http://garnaat.org/ # 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 # witho...
mit
endlessm/chromium-browser
v8/third_party/inspector_protocol/pdl.py
14
4966
# Copyright 2018 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from __future__ import print_function import collections import json import os.path import re import sys description = '' primitiveTypes = ['integer', 'nu...
bsd-3-clause
sidzan/netforce
netforce_ecom/netforce_ecom/controllers/ecom_brands.py
4
2070
# Copyright (c) 2012-2015 Netforce Co. Ltd. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publ...
mit
wendlers/edubot-nodemcu-fw
firmware/mp/ultrasonic.py
1
2227
## # Ultrasonic library for MicroPython's pyboard. # Compatible with HC-SR04 and SRF04. # # Copyright 2014 - Sergio Conde Gómez <skgsergio@gmail.com> # Improved by Mithru Vigneshwara # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as publis...
mit
cristiana214/cristianachavez214-cristianachavez
python/src/Demo/pdist/client.py
47
4708
"""RPC Client module.""" import sys import socket import pickle import __builtin__ import os # Default verbosity (0 = silent, 1 = print connections, 2 = print requests too) VERBOSE = 1 class Client: """RPC Client class. No need to derive a class -- it's fully generic.""" def __init__(self, address, verb...
apache-2.0
ofermend/medicare-demo
socialite/jython/Lib/SimpleXMLRPCServer.py
87
20934
"""Simple XML-RPC Server. This module can be used to create simple XML-RPC servers by creating a server and either installing functions, a class instance, or by extending the SimpleXMLRPCServer class. It can also be used to handle XML-RPC requests in a CGI environment using CGIXMLRPCRequestHandler. A list of possibl...
apache-2.0
Nowheresly/account-financial-tools
account_partner_required/tests/__init__.py
18
1078
# -*- encoding: utf-8 -*- ############################################################################## # # Account partner required module for OpenERP # Copyright (C) 2014 Acsone (http://acsone.eu). # @author Stéphane Bidoul <stephane.bidoul@acsone.eu> # # This program is free software: you can redistribu...
agpl-3.0
watspidererik/testenv
flask/lib/python2.7/site-packages/whoosh/matching/combo.py
92
9926
# Copyright 2010 Matt Chaput. 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 conditions and the...
mit
ubgarbage/gae-blog
django/contrib/gis/tests/layermap/tests.py
152
12640
import os from decimal import Decimal from django.utils.copycompat import copy from django.utils.unittest import TestCase from django.contrib.gis.gdal import DataSource, OGRException from django.contrib.gis.tests.utils import mysql from django.contrib.gis.utils.layermapping import LayerMapping, LayerMapError, Invalid...
bsd-3-clause
The-Compiler/qutebrowser
scripts/dev/check_doc_changes.py
1
1899
#!/usr/bin/env python3 # vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: # Copyright 2016-2020 Florian Bruhin (The Compiler) <mail@qutebrowser.org> # This file is part of qutebrowser. # # qutebrowser is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as pub...
gpl-3.0
ThirdProject/android_external_chromium_org
chrome/app/nibs/PRESUBMIT.py
126
3062
# 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. """Presubmit script to verify that XIB changes are done with the right version. See http://dev.chromium.org/developers/design-documents/mac-xib-files fo...
bsd-3-clause
kmod/icbd
stdlib/python2.5/idlelib/GrepDialog.py
67
4023
import os import fnmatch import sys from Tkinter import * import SearchEngine from SearchDialogBase import SearchDialogBase def grep(text, io=None, flist=None): root = text._root() engine = SearchEngine.get(root) if not hasattr(engine, "_grepdialog"): engine._grepdialog = GrepDialog(root, engine, f...
mit
bmazin/ARCONS-pipeline
examples/Pal2014-J0337/plotLightCurve.py
1
1690
import numpy as np import matplotlib.pyplot as plt import figureHeader def plotPulseProfile(phaseBinEdges,pulseProfile,profileErrors=None,plotDoublePulse=True,ax=None,**kwargs): label = kwargs.pop('label','') if plotDoublePulse: doublePhaseBinEdges = np.concatenate([phaseBinEdges,phaseBinEdges[1:]+1.])...
gpl-2.0
JimCircadian/ansible
lib/ansible/modules/cloud/amazon/ec2_asg.py
3
64972
#!/usr/bin/python # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distributed...
gpl-3.0
wpjesus/codematch
ietf/doc/tests_conflict_review.py
1
18487
# -*- coding: utf-8 -*- import os import shutil from pyquery import PyQuery from StringIO import StringIO from textwrap import wrap from django.conf import settings from django.core.urlresolvers import reverse as urlreverse from ietf.doc.models import Document, DocEvent, NewRevisionDocEvent, BallotPositionDocEvent, ...
bsd-3-clause
arifsetiawan/edx-platform
lms/djangoapps/instructor/tests/test_proctoring.py
4
2726
""" Unit tests for Edx Proctoring feature flag in new instructor dashboard. """ from mock import patch from django.conf import settings from django.core.urlresolvers import reverse from nose.plugins.attrib import attr from student.roles import CourseFinanceAdminRole from student.tests.factories import AdminFactory f...
agpl-3.0
meredith-digops/ansible
lib/ansible/modules/web_infrastructure/jenkins_plugin.py
35
25710
#!/usr/bin/python # encoding: utf-8 # (c) 2016, Jiri Tyr <jiri.tyr@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or #...
gpl-3.0
GoogleCloudPlatform/declarative-resource-client-library
python/services/servicenetworking/connection.py
1
4860
# Copyright 2021 Google LLC. 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 o...
apache-2.0
muku42/bokeh
bokeh/charts/builder/tests/test_step_builder.py
4
2479
""" This is the Bokeh charts testing interface. """ #----------------------------------------------------------------------------- # Copyright (c) 2012 - 2014, Continuum Analytics, Inc. All rights reserved. # # Powered by the Bokeh Development Team. # # The full license is in the file LICENSE.txt, distributed with thi...
bsd-3-clause
idncom/odoo
addons/account_check_writing/__openerp__.py
313
1808
# -*- 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
bradallred/gemrb
gemrb/GUIScripts/ie_stats.py
2
10616
# -*-python-*- # GemRB - Infinity Engine Emulator # Copyright (C) 2003 The GemRB Project # # 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) ...
gpl-2.0
sosterwalder/ldif3
ldif3.py
1
11669
"""ldif3 - generate and parse LDIF data (see RFC 2849).""" from __future__ import unicode_literals __version__ = '3.1.1' __all__ = [ # constants 'LDIF_PATTERN', # classes 'LDIFWriter', 'LDIFParser', ] import base64 import re import logging from collections import OrderedDict try: # pragma: noc...
bsd-2-clause
twobob/buildroot-kindle
output/build/host-python-2.7.2/Lib/plat-mac/lib-scriptpackages/StdSuites/Type_Names_Suite.py
82
9491
"""Suite Type Names Suite: Terminology for Registry data types Level 1, version 1 Generated from /Volumes/Sap/System Folder/Extensions/AppleScript AETE/AEUT resource version 1/0, language 0, script 0 """ import aetools import MacOS _code = 'tpnm' class Type_Names_Suite_Events: pass class PostScript_picture(a...
gpl-2.0
emidln/django_roa
env/lib/python2.7/site-packages/django/views/decorators/http.py
151
7044
""" Decorators for views based on HTTP headers. """ try: from functools import wraps except ImportError: from django.utils.functional import wraps # Python 2.4 fallback. from calendar import timegm from datetime import timedelta from django.utils.decorators import decorator_from_middleware, available_attrs ...
bsd-3-clause
gmacchi93/serverInfoParaguay
apps/venv/lib/python2.7/site-packages/django/contrib/gis/forms/widgets.py
422
3659
from __future__ import unicode_literals import logging from django.conf import settings from django.contrib.gis import gdal from django.contrib.gis.geos import GEOSException, GEOSGeometry from django.forms.widgets import Widget from django.template import loader from django.utils import six, translation logger = log...
apache-2.0
rahuldan/sympy
sympy/polys/tests/test_sqfreetools.py
123
4389
"""Tests for square-free decomposition algorithms and related tools. """ from sympy.polys.rings import ring from sympy.polys.domains import FF, ZZ, QQ from sympy.polys.specialpolys import f_polys from sympy.utilities.pytest import raises f_0, f_1, f_2, f_3, f_4, f_5, f_6 = f_polys() def test_dup_sqf(): R, x = r...
bsd-3-clause
wskplho/sl4a
python/src/Demo/tkinter/matt/canvas-gridding.py
47
2271
from Tkinter import * # this is the same as simple-demo-1.py, but uses # subclassing. # note that there is no explicit call to start Tk. # Tkinter is smart enough to start the system if it's not already going. class Test(Frame): def printit(self): print "hi" def createWidgets(self): self.QUIT...
apache-2.0
team-xue/xue
xue/cms/tests/apphooks.py
2
5527
# -*- coding: utf-8 -*- from __future__ import with_statement from cms.apphook_pool import apphook_pool from cms.appresolver import applications_page_check, clear_app_resolvers from cms.models.titlemodels import Title from cms.test.testcases import CMSTestCase from cms.test.util.context_managers import SettingsOverrid...
bsd-3-clause
thaim/ansible
lib/ansible/modules/network/system/_net_user.py
20
4718
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2017, Ansible by Red Hat, 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 ANSIBLE_METADATA = {'metadata_version': '1.1', ...
mit
angstwad/ansible
contrib/inventory/lxc_inventory.py
89
2556
#!/usr/bin/env python # # (c) 2015-16 Florian Haas, hastexo Professional Services GmbH # <florian@hastexo.com> # Based in part on: # libvirt_lxc.py, (c) 2013, Michael Scherer <misc@zarb.org> # # This file is part of Ansible, # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the...
gpl-3.0
CM-zenfone2/android_kernel_asus_moorefield
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
mishravikas/geonode-permissions
geonode/base/templatetags/base_tags.py
2
2227
from django import template from agon_ratings.models import Rating from django.contrib.contenttypes.models import ContentType from django.contrib.auth import get_user_model from guardian.shortcuts import get_objects_for_user from geonode import settings from geonode.layers.models import Layer from geonode.maps.model...
gpl-3.0
w1kke/pylearn2
pylearn2/models/tests/test_mlp.py
2
31654
from __future__ import print_function from itertools import product import numpy as np from theano.compat import six from theano.compat.six.moves import reduce, xrange import theano from theano import tensor, config from nose.tools import assert_raises from pylearn2.datasets.vector_spaces_dataset import VectorSpaces...
bsd-3-clause
appsembler/edx-platform
common/djangoapps/util/tests/test_memcache.py
24
3676
""" Tests for memcache in util app """ from django.core.cache import caches from django.test import TestCase from util.memcache import safe_key class MemcacheTest(TestCase): """ Test memcache key cleanup """ # Test whitespace, control characters, and some non-ASCII UTF-16 UNICODE_CHAR_CODES = (...
agpl-3.0