repo_name
stringlengths
5
100
path
stringlengths
4
375
copies
stringclasses
991 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
jamesblunt/psutil
test/_posix.py
4
9932
#!/usr/bin/env python # Copyright (c) 2009, Giampaolo Rodola'. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """POSIX specific tests. These are implicitly run by test_psutil.py.""" import datetime import os import subprocess import sys imp...
bsd-3-clause
LegoStormtroopr/canard
SQBLWidgets/languagePicker.py
1
4028
import sqblUI from SQBLutil import * # Dont like this, need to fix later. from PyQt4 import QtGui, QtCore import isoLangCodes from lxml import etree def languagePickerDialog(title = "Enter Language", default = None): lang,success = QtGui.QInputDialog.getItem(None, title, """Enter a <a href='http://...
gpl-3.0
bols-blue/ansible
lib/ansible/parsing/__init__.py
19
7957
# (c) 2012-2014, Michael DeHaan <michael.dehaan@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 # (at your option) an...
gpl-3.0
dattatreya303/zulip
zerver/tests/test_reactions.py
13
10382
# -*- coding: utf-8 -*- from __future__ import absolute_import import ujson from typing import Any, Dict, List from six import string_types from zerver.lib.test_helpers import tornado_redirected_to_list, get_display_recipient from zerver.lib.test_classes import ZulipTestCase from zerver.models import get_user_profile...
apache-2.0
PwnArt1st/searx
utils/fabfile.py
8
2621
from fabric.api import cd, run, sudo, put from cStringIO import StringIO base_dir = '/usr/local' hostname = 'searx.me' searx_dir = base_dir + '/searx' searx_ve_dir = searx_dir + '/searx-ve' current_user = run('whoami').stdout.strip() uwsgi_file = ''' [uwsgi] # Who will run the code uid = {user} gid = {user} # Numbe...
agpl-3.0
atheed/servo
tests/wpt/harness/wptrunner/wptmanifest/tests/test_tokenizer.py
195
11355
# 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 sys import os import unittest sys.path.insert(0, os.path.abspath("..")) from cStringIO import StringIO from .. ...
mpl-2.0
jnmclarty/trump
trump/extensions/source/tx-dbapi/dbapiext.py
2
2524
""" The DBAPI driver, will use by default the same driver SQLAlchemy is using for trump. There is currently no way to change this default. It's assumed that the driver is DBAPI 2.0 compliant. Required kwargs include: - 'dbinsttype' which must be one of 'COMMAND', 'KEYCOL', 'TWOKEYCOL' - 'dsn', 'user', 'password', '...
bsd-3-clause
cyc805/VM
waf-tools/misc.py
53
11741
#!/usr/bin/env python # encoding: utf-8 # Thomas Nagy, 2006-2010 (ita) """ This tool is totally deprecated Try using: .pc.in files for .pc files the feature intltool_in - see demos/intltool make-like rules """ import shutil, re, os from waflib import TaskGen, Node, Task, Utils, Build, Errors from waflib.TaskGen i...
gpl-2.0
nickster5001/ctracker
flask/lib/python3.4/site-packages/pymysql/err.py
4
4306
import struct try: Exception, Warning except ImportError: try: from exceptions import Exception, Warning except ImportError: import sys e = sys.modules['exceptions'] Exception = e.Exception Warning = e.Warning from .constants import ER import sys class MySQLEr...
mit
andreaso/ansible
lib/ansible/modules/net_tools/ipinfoio_facts.py
50
4074
#!/usr/bin/python # # (c) 2016, Aleksei Kostiuk <unitoff@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 # (at your o...
gpl-3.0
QuLogic/meson
mesonbuild/backend/vs2010backend.py
1
81951
# Copyright 2014-2016 The Meson development team # 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 agree...
apache-2.0
jamezpolley/pip
pip/_vendor/requests/packages/chardet/chardetect.py
1786
2504
#!/usr/bin/env python """ Script which takes one or more file paths and reports on their detected encodings Example:: % chardetect somefile someotherfile somefile: windows-1252 with confidence 0.5 someotherfile: ascii with confidence 1.0 If no paths are provided, it takes its input from stdin. """ from...
mit
iamApalive/robocop
bin/execute.py
1
1957
import robot,os from robot import libraries #from robot import robot_imports #from robot.api import ExecutionResult #from robot.api import TestData def main(): #Push required data in builtins from optparse import OptionParser parser = OptionParser() parser.add_option("-t", "--test", dest="testlist...
apache-2.0
Crystalnix/house-of-life-chromium
third_party/harfbuzz/contrib/tables/category-parse.py
55
2223
import sys from unicode_parse_common import * # http://www.unicode.org/Public/5.1.0/ucd/extracted/DerivedGeneralCategory.txt category_to_harfbuzz = { 'Mn': 'HB_Mark_NonSpacing', 'Mc': 'HB_Mark_SpacingCombining', 'Me': 'HB_Mark_Enclosing', 'Nd': 'HB_Number_DecimalDigit', 'Nl': 'HB_Number_Letter', 'No': 'H...
bsd-3-clause
CharithYMendis/Helium
utility/drclient.py
1
3592
import os import subprocess import common def get_drclient_command(client_args,exec_args): dr32 = os.environ.get('DYNAMORIO_32_RELEASE_HOME') dr_path = dr32 + '/bin32/drrun.exe' command = dr_path + ' -root ' + dr32 + ' -syntax_intel -c exalgo.dll ' + client_args + ' -- ' + exec_args re...
mit
Netuitive/Diamond
src/collectors/cephstats/cephstats.py
26
1581
# coding=utf-8 """ Get ceph status from one node """ import subprocess import re import os import sys sys.path.insert(0, os.path.join(os.path.dirname(os.path.dirname(__file__)), 'ceph')) from ceph import CephCollector patternchk = re.compile(r'\bclient io .*') numberchk = re.compile(r...
mit
hslee16/ansible-modules-extras
packaging/os/svr4pkg.py
126
7874
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, Boyd Adamson <boyd () boydadamson.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 th...
gpl-3.0
alanquillin/quark
quark/protocols.py
3
5847
# 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
zwaters/CLAtoolkit
clatoolkit_project/xapi/tincan/context_activities.py
7
3538
# Copyright 2014 Rustici Software # # 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...
gpl-3.0
biddyweb/merchant
billing/tests/test_world_pay.py
3
2608
try: from urlparse import urlparse except ImportError: from urllib.parse import urlparse from xml.dom import minidom from django.test import TestCase from django.template import Template, Context from django.conf import settings from django.utils.unittest import skipIf from billing import get_integration @s...
bsd-3-clause
skumagai/esf_multi
ext/gtest/test/gtest_shuffle_test.py
3023
12549
#!/usr/bin/env python # # Copyright 2009 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...
mit
dgwakeman/mne-python
mne/io/proc_history.py
13
11641
# -*- coding: utf-8 -*- # Authors: Denis A. Engemann <denis.engemann@gmail.com> # Eric Larson <larson.eric.d@gmail.com> # License: Simplified BSD import numpy as np from scipy.sparse import csc_matrix import warnings from .open import read_tag from .tree import dir_tree_find from .write import (start_block, ...
bsd-3-clause
hammerlab/cohorts
cohorts/provenance.py
1
2332
# Copyright (c) 2017. Mount Sinai School of Medicine # # 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
RobotLocomotion/director
src/python/scripts/cameraViewer.py
1
2349
import argparse from director.consoleapp import ConsoleApp from director import cameraview from director import vtkAll as vtk import PythonQt from PythonQt import QtCore, QtGui, QtUiTools def addWidgetsToDict(widgets, d): for widget in widgets: if widget.objectName: d[str(widget.objectName)] =...
bsd-3-clause
antoviaque/edx-platform
lms/djangoapps/gating/tests/test_api.py
11
6311
""" Unit tests for gating.signals module """ from mock import patch from ddt import ddt, data, unpack from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase from courseware.tests.helpers import LoginEnrollmentTestCase from miles...
agpl-3.0
reflechant/eulerproject
.vscode/.ropeproject/config.py
41
4774
# The default ``config.py`` # flake8: noqa def set_prefs(prefs): """This function is called before opening the project""" # Specify which files and folders to ignore in the project. # Changes to ignored resources are not added to the history and # VCSs. Also they are not returned in `Project.get_fil...
unlicense
fxia22/ASM_xf
PythonD/site_python/twisted/test/test_imap.py
2
47492
# Twisted, the Framework of Your Internet # Copyright (C) 2001 Matthew W. Lefkowitz # # This library is free software; you can redistribute it and/or # modify it under the terms of version 2.1 of the GNU Lesser General Public # License as published by the Free Software Foundation. # # This library is distributed in t...
gpl-2.0
artemh/asuswrt-merlin
release/src/router/samba36/source3/build/dynconfig.py
19
4157
import string, Utils # list of directory options to offer in configure dir_options = { 'with-cachedir' : [ '${PREFIX}/var/locks', 'where to put temporary cache files' ], 'with-codepagedir' : [ '${PREFIX}/lib/samba', 'where to put codepages' ], 'with-configdir' ...
gpl-2.0
sillydan1/WhatEverEngine
packages/IronPython.StdLib.2.7.5/content/Lib/wsgiref/handlers.py
109
15932
"""Base classes for server/gateway implementations""" from types import StringType from util import FileWrapper, guess_scheme, is_hop_by_hop from headers import Headers import sys, os, time __all__ = ['BaseHandler', 'SimpleHandler', 'BaseCGIHandler', 'CGIHandler'] try: dict except NameError: def dict(items)...
apache-2.0
bretlowery/snakr
lib/django/contrib/gis/geos/geometry.py
216
23649
""" This module contains the 'base' GEOSGeometry object -- all GEOS Geometries inherit from this object. """ from __future__ import unicode_literals import json from ctypes import addressof, byref, c_double from django.contrib.gis import gdal from django.contrib.gis.geometry.regex import hex_regex, json_regex, wkt_...
bsd-3-clause
factorlibre/OCB
addons/note_pad/__openerp__.py
312
1691
# -*- 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
caesar2164/edx-platform
lms/djangoapps/instructor/tests/test_services.py
10
5649
""" Tests for the InstructorService """ import json from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase from xmodule.modulestore.tests.factories import CourseFactory from courseware.models import StudentModule from lms.djangoapps.instructor.access import allow_access from lms.djangoapps.instru...
agpl-3.0
KousikaGanesh/purchaseandInventory
openerp/addons/sale_stock/sale_stock.py
11
34326
# -*- 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
indashnet/InDashNet.Open.UN2000
android/external/chromium_org/third_party/pexpect/screen.py
171
11281
"""This implements a virtual screen. This is used to support ANSI terminal emulation. The screen representation and state is implemented in this class. Most of the methods are inspired by ANSI screen control codes. The ANSI class extends this class to add parsing of ANSI escape codes. PEXPECT LICENSE This license...
apache-2.0
efdutra/zaproxy
python/scripts/watcher/watcher.py
28
8154
# Zed Attack Proxy (ZAP) and its related class files. # # ZAP is an HTTP/HTTPS proxy for assessing web application security. # # Copyright 2012 ZAP Development Team # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may ob...
apache-2.0
lujinda/gale
sample/login/run.py
1
1105
#!/usr/bin/env python #coding:utf-8 # Author : tuxpy # Email : q8886888@qq.com.com # Last modified : 2015-06-09 15:20:13 # Filename : test.py # Description : from gale.web import app_run, router, RequestHandler class BaseHandler(RequestHandler): def get_current_user(self): return sel...
mit
jiajiechen/mxnet
example/kaggle-ndsb1/train_dsb.py
41
4039
# 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
levkar/odoo
addons/website_sale/models/res_config.py
20
7095
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import api, models, fields class WebsiteConfigSettings(models.TransientModel): _inherit = 'website.config.settings' def _default_order_mail_template(self): if self.env['ir.module.module'].sea...
agpl-3.0
Jorge-Rodriguez/ansible
lib/ansible/modules/cloud/google/gce_labels.py
104
12673
#!/usr/bin/python # Copyright 2017 Google 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', 'status': ['preview'], ...
gpl-3.0
alshedivat/tensorflow
tensorflow/contrib/mixed_precision/python/loss_scale_optimizer.py
20
6862
# 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
keedio/hue
desktop/core/ext-py/PyYAML-3.09/tests/lib/test_canonical.py
60
1135
import yaml, canonical def test_canonical_scanner(canonical_filename, verbose=False): data = open(canonical_filename, 'rb').read() tokens = list(yaml.canonical_scan(data)) assert tokens, tokens if verbose: for token in tokens: print token test_canonical_scanner.unittest = ['.canon...
apache-2.0
guillermooo/dart-sublime-bundle-releases
out_there/yaml/tokens.py
985
2573
class Token(object): def __init__(self, start_mark, end_mark): self.start_mark = start_mark self.end_mark = end_mark def __repr__(self): attributes = [key for key in self.__dict__ if not key.endswith('_mark')] attributes.sort() arguments = ', '.join(['%s=...
bsd-3-clause
Leeft/three.js
utils/exporters/blender/addons/io_three/exporter/io.py
201
2836
import os import shutil from .. import constants, logger from . import _json def copy_registered_textures(dest, registration): """Copy the registered textures to the destination (root) path :param dest: destination directory :param registration: registered textures :type dest: str :type registrat...
mit
michaelld/gnuradio
gr-blocks/python/blocks/qa_unpack_k_bits.py
7
1845
#!/usr/bin/env python # # Copyright 2006,2010,2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, or (at your ...
gpl-3.0
lucidmotifs/codenamev
mediaplayer/migrations/0002_auto_20150211_0549.py
1
4196
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('mediaplayer', '0001_initial'), ] ...
mit
VictoriaRoux/oppia
core/domain/value_generators_domain_test.py
34
1211
# coding: utf-8 # # Copyright 2014 The Oppia 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 requi...
apache-2.0
anandpdoshi/frappe
frappe/core/doctype/doctype/doctype.py
2
21596
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import re import MySQLdb import frappe from frappe import _ from frappe.utils import now, cint from frappe.model import no_value_fields from frappe.model.document import Documen...
mit
t794104/ansible
test/units/modules/network/nxos/test_nxos_vrf.py
68
3059
# (c) 2016 Red Hat Inc. # # 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 dis...
gpl-3.0
zhuango/python
pythonLearning/oo/vector.py
2
2835
from array import array import reprlib import math import numbers import functools import operator import itertools class Vector: typecode = 'd' def __init__(self, components): self._components = array(self.typecode, components) def __iter__(self): return iter(self._components) ...
gpl-2.0
Zumochi/eve-wspace
evewspace/Map/default_settings.py
5
1540
# Eve W-Space # Copyright 2014 Andrew Austin and contributors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requi...
apache-2.0
fusion809/fusion809.github.io-old
vendor/bundle/ruby/2.2.0/gems/pygments.rb-0.6.3/vendor/pygments-main/pygments/formatters/latex.py
49
17273
# -*- coding: utf-8 -*- """ pygments.formatters.latex ~~~~~~~~~~~~~~~~~~~~~~~~~ Formatter for LaTeX fancyvrb output. :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from __future__ import division from pygments.formatter import Forma...
gpl-3.0
Glutanimate/image-occlusion-2-enhanced
src/image_occlusion_enhanced/template.py
1
8175
# -*- coding: utf-8 -*- # Image Occlusion Enhanced Add-on for Anki # # Copyright (C) 2016-2020 Aristotelis P. <https://glutanimate.com/> # Copyright (C) 2012-2015 Tiago Barroso <tmbb@campus.ul.pt> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General ...
bsd-2-clause
aaronorosen/horizon-congress
openstack_dashboard/dashboards/project/networks/ports/forms.py
4
2591
# Copyright 2012 NEC Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
apache-2.0
redknight1138/First
attack/ftp.py
3
2460
#!./env/bin/python """ FTP Scanner/Brute Forcer Use this to either scan a host for anonymous FTP logins or to try a password list against a host. Don't be a moron, please don't use this for something illegal. Usage: ftp.py brute [-v] <host> <user> <password_file> ftp.py anon [-v] <ho...
mit
pitrou/numba
numba/funcdesc.py
2
6703
""" Function descriptors. """ from __future__ import print_function, division, absolute_import from collections import defaultdict import itertools import sys from types import ModuleType from . import six, types def transform_arg_name(arg): if isinstance(arg, types.Record): return "Record_%s" % arg._co...
bsd-2-clause
sidzan/netforce
netforce_account/netforce_account/models/account_budget.py
4
1571
# 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
ukanga/SickRage
lib/unidecode/x084.py
252
4646
data = ( 'Hu ', # 0x00 'Qi ', # 0x01 'He ', # 0x02 'Cui ', # 0x03 'Tao ', # 0x04 'Chun ', # 0x05 'Bei ', # 0x06 'Chang ', # 0x07 'Huan ', # 0x08 'Fei ', # 0x09 'Lai ', # 0x0a 'Qi ', # 0x0b 'Meng ', # 0x0c 'Ping ', # 0x0d 'Wei ', # 0x0e 'Dan ', # 0x0f 'Sha ', # 0x10 'Hu...
gpl-3.0
florianholzapfel/home-assistant
homeassistant/components/sleepiq.py
15
3418
""" Support for SleepIQ from SleepNumber. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/sleepiq/ """ import logging from datetime import timedelta import voluptuous as vol import homeassistant.helpers.config_validation as cv from homeassistant.helper...
mit
keedio/hue
desktop/core/ext-py/Django-1.6.10/tests/admin_changelist/admin.py
52
3133
from __future__ import absolute_import from django.contrib import admin from django.core.paginator import Paginator from .models import (Event, Child, Parent, Genre, Band, Musician, Group, Quartet, Membership, ChordsMusician, ChordsBand, Invitation, Swallow) site = admin.AdminSite(name="admin") class CustomPag...
apache-2.0
nguyentu1602/statsmodels
statsmodels/stats/tests/test_groups_sw.py
34
2750
# -*- coding: utf-8 -*- """Test for a helper function for PanelHAC robust covariance the functions should be rewritten to make it more efficient Created on Thu May 17 21:09:41 2012 Author: Josef Perktold """ import numpy as np from numpy.testing import assert_equal, assert_raises import statsmodels.stats.sandwich_co...
bsd-3-clause
markusappel/McCode
tools/Python/www/www-django/mcwww/mcwww/wsgi.py
3
1132
""" WSGI config for mcwww project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI_APPLICATION`` se...
gpl-2.0
drewandersonnz/openshift-tools
ansible/roles/lib_zabbix/library/zbx_graphprototype.py
16
10207
#!/usr/bin/env python ''' Ansible module for zabbix graphprototypes ''' # vim: expandtab:tabstop=4:shiftwidth=4 # # Zabbix graphprototypes ansible module # # # Copyright 2015 Red Hat Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with t...
apache-2.0
protochron/aurora
src/main/python/apache/thermos/core/helper.py
7
14943
# # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under ...
apache-2.0
dandan94/OpenGLTest
finalOpenGL/HelloGLFW/lib/boost_1_59_0/libs/python/test/pickle1.py
46
1189
# Copyright David Abrahams 2004. 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) r'''>>> import pickle1_ext >>> import pickle >>> pickle1_ext.world.__module__ 'pickle1_ext' >>> pickle1_ext.world.__safe...
gpl-3.0
ahojjati/grr
lib/aff4_objects/aff4_grr_test.py
6
9733
#!/usr/bin/env python # Copyright 2011 Google Inc. All Rights Reserved. """Test the grr aff4 objects.""" import time from grr.lib import aff4 from grr.lib import flow from grr.lib import rdfvalue from grr.lib import test_lib from grr.lib import utils from grr.lib.rdfvalues import client as rdf_client from grr.lib.rdf...
apache-2.0
joshimio/blog
node_modules/pygmentize-bundled/vendor/pygments/build-2.7/pygments/lexers/_openedgebuiltins.py
370
40661
# -*- coding: utf-8 -*- """ pygments.lexers._openedgebuiltins ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Builtin list for the OpenEdgeLexer. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ OPENEDGEKEYWORDS = [ 'ABSOLUTE', 'ABS', 'ABSO', 'A...
mit
abstract-open-solutions/hr
__unported__/hr_report_payroll_attendance_summary/report/attendance_summary.py
21
9460
# -*- coding:utf-8 -*- # # # Copyright (C) 2013 Michael Telahun Makonnen <mmakonnen@gmail.com> # # 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 version 3 of the Licens...
agpl-3.0
codepython/restcommander
play-1.2.4/python/Lib/pkgutil.py
66
20001
"""Utilities to support packages.""" # NOTE: This module must remain compatible with Python 2.3, as it is shared # by setuptools for distribution with Python 2.3 and up. import os import sys import imp import os.path from types import ModuleType __all__ = [ 'get_importer', 'iter_importers', 'get_loader', 'find_l...
apache-2.0
debugger22/sympy
sympy/matrices/tests/test_interactions.py
58
1881
""" We have a few different kind of Matrices Matrix, ImmutableMatrix, MatrixExpr Here we test the extent to which they cooperate """ from sympy import symbols from sympy.matrices import (Matrix, MatrixSymbol, eye, Identity, ImmutableMatrix) from sympy.core.compatibility import range from sympy.matrices.expres...
bsd-3-clause
hehongliang/tensorflow
tensorflow/compiler/tests/permute_test.py
16
3387
# 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
Shrulik/Open-Knesset
mks/migrations/0009_add_action_stream.py
10
28666
# encoding: utf-8 import datetime from south.db import db from south.v2 import DataMigration from django.db import models class Migration(DataMigration): def _get_FIELD_display(self, field): value = getattr(self, field.attname) return force_unicode(dict(field.flatchoices).get(value, value), string...
bsd-3-clause
pgdeniverville/Hidden-Sector-Limits
Hidden_Sector_Limits.py
1
8466
#!/usr/bin/env python from Hidden_Sec_Utilities import * from Hidden_Sec_Physics import * import itertools """ I use kappa and epsilon interchangeably. They mean the same thing. Many of these limits are not valid in the off-shell regime, or change dramatically. Use at your own risk! """ #Default value of alpha_p to...
mit
heke123/chromium-crosswalk
native_client_sdk/src/build_tools/extract_artifacts.py
25
4283
#!/usr/bin/env python # Copyright (c) 2014 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 argparse import glob import os import sys if sys.version_info < (2, 7, 0): sys.stderr.write("python 2.7 or later is requi...
bsd-3-clause
lahosken/pants
src/python/pants/engine/rules.py
2
5514
# coding=utf-8 # Copyright 2016 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) import logging from ...
apache-2.0
Buggaboo/Triathlon
TriathlonBeta/Triathlon-Breeder.py
1
34773
#!/usr/bin/python # -*- coding: iso-8859-1 -*- # Howto, Code license, Credits, etc: http://code.google.com/B/BCI-Project-Triathlon/ noGL = False # Set noGL to True for disabling the use of OpenGL (to gain speed, or to avoid python-wx-opengl problems) import pyfann from pyfann import libfann import string import o...
mit
Praveen-1987/devstack-Quantumleap
files/pip-1.4.1/pip/vendor/distlib/database.py
79
49606
# -*- coding: utf-8 -*- # # Copyright (C) 2012-2013 The Python Software Foundation. # See LICENSE.txt and CONTRIBUTORS.txt. # """PEP 376 implementation.""" from __future__ import unicode_literals import base64 import codecs import hashlib import logging import os import sys import zipimport from . import DistlibExce...
apache-2.0
golismero/golismero-devel
thirdparty_libs/django/conf/locale/nb/formats.py
107
1585
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j. F Y' TIME_FORMAT = 'H:i' DATET...
gpl-2.0
jstammers/EDMSuite
NavPython/IronPython/Tutorial/Extend/csxtest.py
1
1219
##################################################################################### # # Copyright (c) Microsoft Corporation. All rights reserved. # # This source code is subject to terms and conditions of the Apache License, Version 2.0. A # copy of the license can be found in the License.html file at the root of t...
mit
pgleeson/TestArea
lib/jython/Lib/test/test_methods.py
10
1114
# Python test set -- part 7, bound and unbound methods from test_support import * print 'Bound and unbound methods (test_methods.py)' class A: def one(self): return 'one' class B(A): def two(self): return 'two' class C(A): def one(self): return 'another one' a = A() b = B() c = C() print 'unbound met...
gpl-2.0
rhattersley/iris
lib/iris/tests/unit/fileformats/pp_rules/test__dim_or_aux.py
12
2233
# (C) British Crown Copyright 2014 - 2015, Met Office # # This file is part of Iris. # # Iris 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 3 of the License, or # (at your option) any l...
lgpl-3.0
uclouvain/osis_louvain
assessments/tests/views/test_score_sheet.py
1
5429
############################################################################## # # OSIS stands for Open Student Information System. It's an application # designed to manage the core business of higher education institutions, # such as universities, faculties, institutes and professional schools. # The core ...
agpl-3.0
ogenstad/ansible
lib/ansible/modules/monitoring/airbrake_deployment.py
56
3599
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright 2013 Bruce Pennypacker <bruce@pennypacker.org> # 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_versio...
gpl-3.0
harrijs/gns3-server
gns3server/modules/dynamips/hypervisor.py
1
6210
# -*- coding: utf-8 -*- # # Copyright (C) 2015 GNS3 Technologies 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. ...
gpl-3.0
boundlessgeo/QGIS
python/plugins/processing/tests/ProjectProvider.py
8
4883
# -*- coding: utf-8 -*- """ *************************************************************************** Project Provider tests --------------------- Date : July 2018 Copyright : (C) 2018 by Nyall Dawson Email : nyall dot dawson at gmail dot com ************...
gpl-2.0
insiderr/insiderr-app
ios-patches/basemodules/twisted/python/test/test_runtime.py
33
5431
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for L{twisted.python.runtime}. """ from __future__ import division, absolute_import import sys from twisted.trial.util import suppress as SUPRESS from twisted.trial.unittest import SynchronousTestCase from twisted.python.runtime impo...
gpl-3.0
vprusso/youtube_tutorials
data_structures/linked_list/circular_linked_list/circular_linked_list_remove.py
1
2755
# YouTube Video: https://www.youtube.com/watch?v=op42w-5o3nE class Node: def __init__(self, data): self.data = data self.next = None class CircularLinkedList: def __init__(self): self.head = None def prepend(self, data): new_node = Node(data) cur = self.head ...
gpl-3.0
fiddlerwoaroof/sandbox
unsorted/pythonsnippets_0045.py
1
1853
import functools import collections def instantiate(cls): return cls() class Namespace(object): def registry(name, bases, dict_): cls = type(name, bases, dict_) cls.__dict = {} return cls __metaclass__ = registry def __init__(self, instance=None): self.__dict__ = self.__dict...
bsd-3-clause
CollabQ/CollabQ
poboxopenid/util.py
1
2590
import logging from django import http from django.conf import settings from common import api from common import clean from common.models import ExternalProfile from common import memcache from common import twitter from common import user from common import util def get_nick_from_email(email): nick = util.displa...
apache-2.0
bmc/digest
setup.py
1
2013
#!/usr/bin/env python # # EasyInstall setup script for digest # # $Id$ # --------------------------------------------------------------------------- import sys import os sys.path += [os.getcwd()] from setuptools import setup, find_packages import re import imp PKG = 'digest' DESCRIPTION = 'Calculate message digests ...
bsd-3-clause
wkschwartz/django
tests/auth_tests/models/custom_user.py
73
3779
from django.contrib.auth.models import ( AbstractBaseUser, AbstractUser, BaseUserManager, Group, Permission, PermissionsMixin, UserManager, ) from django.db import models # The custom user uses email as the unique identifier, and requires # that every user provide a date of birth. This lets us test # changes ...
bsd-3-clause
cherry-wb/viper
viper/core/ui/commands.py
1
10438
import os import getopt import tempfile from viper.common.out import * from viper.common.objects import File from viper.common.colors import bold, cyan, white from viper.common.network import download from viper.core.session import __session__ from viper.core.plugins import __modules__ from viper.core.database import ...
bsd-3-clause
quanganh/fckeditor
public/javascripts/fckeditor/editor/filemanager/connectors/py/config.py
93
7095
#!/usr/bin/env python """ * FCKeditor - The text editor for Internet - http://www.fckeditor.net * Copyright (C) 2003-2008 Frederico Caldeira Knabben * * == BEGIN LICENSE == * * Licensed under the terms of any of the following licenses at your * choice: * * - GNU General Public License Version 2 or l...
mit
rcrowder/nupic
tests/swarming/nupic/swarming/experiments/dummyV2/permutations.py
10
3634
# ---------------------------------------------------------------------- # 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
moyogo/defcon
Lib/defcon/objects/image.py
1
9304
from __future__ import absolute_import import weakref from defcon.objects.base import BaseDictObject from defcon.objects.color import Color _defaultTransformation = { "xScale" : 1, "xyScale" : 0, "yxScale" : 0, "yScale" : 1, "xOffset" : 0, "yOffset" : 0 } class Image(BaseDictObject): "...
mit
britcey/ansible
lib/ansible/utils/module_docs_fragments/ios.py
101
4360
# # (c) 2015, Peter Sprygada <psprygada@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, or # (at your option) any late...
gpl-3.0
nikitasingh981/scikit-learn
examples/tree/plot_tree_regression_multioutput.py
73
1854
""" =================================================================== Multi-output Decision Tree Regression =================================================================== An example to illustrate multi-output regression with decision tree. The :ref:`decision trees <tree>` is used to predict simultaneously the ...
bsd-3-clause
rubyinhell/brython
www/src/Lib/test/test_syntax.py
87
18064
"""This module tests SyntaxErrors. Here's an example of the sort of thing that is tested. >>> def f(x): ... global x Traceback (most recent call last): SyntaxError: name 'x' is parameter and global The tests are all raise SyntaxErrors. They were created by checking each C call that raises SyntaxError. There ar...
bsd-3-clause
abhattad4/Digi-Menu
build/lib.linux-x86_64-2.7/django/utils/ipv6.py
225
7971
# This code was mostly based on ipaddr-py # Copyright 2007 Google Inc. http://code.google.com/p/ipaddr-py/ # Licensed under the Apache License, Version 2.0 (the "License"). from django.core.exceptions import ValidationError from django.utils.six.moves import range from django.utils.translation import ugettext_lazy as _...
bsd-3-clause
ssomenzi/silence
node_modules/laravel-elixir/node_modules/gulp-sass/node_modules/node-sass/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...
agpl-3.0
iradul/qtwebkit
Tools/Scripts/webkitpy/port/image_diff_unittest.py
121
2509
# Copyright (C) 2012 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...
gpl-2.0