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
avanov/django
tests/generic_views/urls.py
194
14571
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.conf.urls import url from django.contrib.auth import views as auth_views from django.contrib.auth.decorators import login_required from django.views.decorators.cache import cache_page from django.views.generic import TemplateView from . impor...
bsd-3-clause
kyrias/cjdns
node_build/dependencies/libuv/build/gyp/test/escaping/gyptest-colon.py
216
1428
#!/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. """ Tests that filenames that contain colons are handled correctly. (This is important for absolute paths on Windows.) """ import os import...
gpl-3.0
paulsoh/moxie
moxie/social/strategies/django_strategy.py
52
5052
from django.conf import settings from django.http import HttpResponse from django.db.models import Model from django.contrib.contenttypes.models import ContentType from django.contrib.auth import authenticate from django.shortcuts import redirect from django.template import TemplateDoesNotExist, RequestContext, loader ...
mit
ropik/androguard
androguard/core/bytecodes/apk.py
1
58292
# This file is part of Androguard. # # Copyright (C) 2012, Anthony Desnos <desnos at t0t0.fr> # 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...
apache-2.0
Limags/MissionPlanner
Lib/site-packages/numpy/distutils/tests/test_misc_util.py
51
2430
#!"C:\Users\hog\Documents\Visual Studio 2010\Projects\ArdupilotMega\ArdupilotMega\bin\Debug\ipy.exe" from numpy.testing import * from numpy.distutils.misc_util import appendpath, minrelpath, gpaths, rel_path from os.path import join, sep, dirname ajoin = lambda *paths: join(*((sep,)+paths)) class TestAppendpath(Test...
gpl-3.0
MathieuDuponchelle/gobject-introspection
giscanner/girwriter.py
1
26509
# -*- Mode: Python -*- # GObject-Introspection - a framework for introspecting GObject libraries # Copyright (C) 2008 Johan Dahlin # Copyright (C) 2008, 2009 Red Hat, Inc. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as publish...
gpl-2.0
Serag8/Bachelor
google_appengine/google/appengine/ext/admin_redirect/main.py
8
2616
#!/usr/bin/env python # # Copyright 2007 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 required by applicable law o...
mit
helium/helium-client-python
setup.py
1
2330
#!/usr/bin/env python """ setup.py file for helium-client-python """ from setuptools import setup, find_packages from setuptools.extension import Extension from setuptools.command.build_ext import build_ext import codecs import versioneer def get_ext_modules(): local_inc = 'helium_client/helium-client' local...
bsd-3-clause
MyAOSP/external_chromium_org
ppapi/native_client/src/untrusted/pnacl_support_extension/pnacl_component_crx_gen.py
48
13105
#!/usr/bin/python # 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. """This script lays out the PNaCl translator files for a normal Chrome installer, for one platform. Once run num-of-arches times, ...
bsd-3-clause
xeoron/namebench
nb_third_party/jinja2/tests.py
285
3313
# -*- coding: utf-8 -*- """ jinja2.tests ~~~~~~~~~~~~ Jinja test functions. Used with the "is" operator. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ import re from jinja2.runtime import Undefined # nose, nothing here to test __test__ = False number_r...
apache-2.0
bukepo/openthread
tests/scripts/thread-cert/pktverify/verify.py
7
3121
#!/usr/bin/env python3 # # Copyright (c) 2020, 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 # ...
bsd-3-clause
KousikaGanesh/purchaseandInventory
openerp/addons/mrp_repair/__openerp__.py
35
2497
# -*- 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
datamade/openelections-core
openelex/us/ia/transform.py
2
1161
from openelex.base.transform import Transform, registry from openelex.models import RawResult class FixVanBurenTransform(Transform): """ s/VanBuren/Van Buren in RawResults from the source file 20001107__ia__general__state_senate__county.csv """ name = 'fix_van_buren' def __call__(self): ...
mit
sumanthns/flask-project
flask_project/templates/factory.py
1
2162
from flask import Flask from werkzeug.utils import import_string class NoBlueprintException(Exception): pass class NoRouteModuleException(Exception): pass def _get_imported_stuff_by_path(path): module_name, object_name = path.rsplit('.', 1) module = import_string(module_name) return module, o...
mit
cloudmesh/cmd3light
cloudmesh_cmd3light/console.py
1
3669
import textwrap from colorama import Fore, Back, Style import colorama colorama.init() class Console(object): """ A simple way to print in a console terminal in color. Instead of using simply the print statement you can use special methods to indicate warnings, errors, ok and regular messages. ...
apache-2.0
jemofthewest/mykoans
python2/koans/about_asserts.py
10
2289
#!/usr/bin/env python # -*- coding: utf-8 -*- from runner.koan import * class AboutAsserts(Koan): def test_assert_truth(self): """ We shall contemplate truth by testing reality, via asserts. """ # Confused? This video should help: # # http://bit.ly/about_assert...
mit
darkleons/odoo
addons/hr_expense/report/hr_expense_report.py
287
5652
# -*- 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
thnee/ansible
lib/ansible/modules/cloud/vultr/vultr_dns_record.py
21
10067
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2017, René Moser <mail@renemoser.net> # 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', ...
gpl-3.0
dhomeier/astropy
astropy/convolution/tests/test_convolve_nddata.py
12
1761
# Licensed under a 3-clause BSD style license - see LICENSE.rst import pytest import numpy as np from astropy.convolution.convolve import convolve, convolve_fft from astropy.convolution.kernels import Gaussian2DKernel from astropy.nddata import NDData def test_basic_nddata(): arr = np.zeros((11, 11)) arr[5,...
bsd-3-clause
47lining/ansible
lib/ansible/runner/lookup_plugins/csvfile.py
121
2645
# (c) 2013, Jan-Piet Mens <jpmens(at)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) any later ver...
gpl-3.0
froch/kubernetes-py
kubernetes_py/models/v1/LoadBalancerStatus.py
3
1579
#!/usr/bin/env python # -*- coding: utf-8 -*- # # This file is subject to the terms and conditions defined in # file 'LICENSE.md', which is part of this source code package. # from kubernetes_py.models.v1.LoadBalancerIngress import LoadBalancerIngress from kubernetes_py.utils import is_valid_list class LoadBalancer...
apache-2.0
Johnzero/OE7
openerp/addons-modules/base_gengo/res_company.py
34
1601
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
phase4ground/DVB-receiver
modem/python/library/demodulator.py
1
2190
import numpy as np import iir_filter import pi_filter class demodulator: 'General purpose demodulator that supports BPSK, QPSK and OQPSK' def __init__(self, modulation_type, samples_per_symbol): """ Create the classical Costas loop carrier recovery object """ # store the pa...
gpl-3.0
drowningchild/lgog_old
scripts/rt-tester/rt-tester.py
11005
5307
#!/usr/bin/python # # rt-mutex tester # # (C) 2006 Thomas Gleixner <tglx@linutronix.de> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # import os import sys import getopt import sh...
gpl-2.0
psgganesh/sparkplug
packages/Sparkplug/Admin/src/node_modules/laravel-elixir/node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/MSVSProject.py
2736
6387
# 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. """Visual Studio project reader/writer.""" import gyp.common import gyp.easy_xml as easy_xml #-------------------------------------------------------------------...
mit
usirin/koding
go/src/vendor/github.com/caglar10ur/lxc/config/apparmor/lxc-generate-aa-rules.py
34
3770
#!/usr/bin/env python3 import sys blocks = [] # # blocks is an array of paths under which we want to block by # default. # # blocks[0] = ['path' = '/sys', 'children' = [A,B] ] # blocks[1] = ['path' = '/proc/sys', 'children' = [ E ] ] # A = [ 'path' = 'fs', children = [C] ] # C = [ 'path' = 'cgroup', children = [...
apache-2.0
jaxxstorm/fullerite
src/diamond/collectors/portstat/portstat.py
51
1984
""" The PortStatCollector collects metrics about ports listed in config file. ##### Dependencies * psutil """ from collections import defaultdict import diamond.collector try: import psutil except ImportError: psutil = None def get_port_stats(port): """ Iterate over connections and count states f...
apache-2.0
jruiperezv/ANALYSE
lms/djangoapps/shoppingcart/processors/helpers.py
169
1025
""" Helper methods for credit card processing modules. These methods should be shared among all processor implementations, but should NOT be imported by modules outside this package. """ from django.conf import settings from microsite_configuration import microsite def get_processor_config(): """ Return a dic...
agpl-3.0
kenrachynski/powerline
powerline/renderers/vim.py
32
5785
# vim:fileencoding=utf-8:noet from __future__ import (unicode_literals, division, absolute_import, print_function) import sys import vim from powerline.bindings.vim import vim_get_func, vim_getoption, environ, current_tabpage, get_vim_encoding from powerline.renderer import Renderer from powerline.colorscheme import...
mit
saurabhbajaj207/CarpeDiem
venv/Lib/site-packages/Crypto/SelfTest/Cipher/test_DES3.py
117
15558
# -*- coding: utf-8 -*- # # SelfTest/Cipher/DES3.py: Self-test for the Triple-DES cipher # # 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 dedicati...
mit
MSusik/invenio
invenio/legacy/webstyle/templates.py
3
29772
## This file is part of Invenio. ## Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 CERN. ## ## Invenio 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 ## Lic...
gpl-2.0
davgibbs/django
django/forms/widgets.py
184
37166
""" HTML Widget classes """ from __future__ import unicode_literals import copy import datetime import re from itertools import chain from django.conf import settings from django.forms.utils import flatatt, to_current_timezone from django.utils import datetime_safe, formats, six from django.utils.datastructures impo...
bsd-3-clause
project-magpie/enigma2-openpli
lib/python/Components/PluginList.py
6
1926
from MenuList import MenuList from Tools.Directories import resolveFilename, SCOPE_SKIN_IMAGE from Components.MultiContent import MultiContentEntryText, MultiContentEntryPixmapAlphaTest from enigma import eListboxPythonMultiContent, gFont from Tools.LoadPixmap import LoadPixmap def PluginEntryComponent(plugin, width...
gpl-2.0
paolodedios/shift-detect
build.py
1
6581
# -*- c-file-style: "sourcery" -*- # # Use and distribution of this software and its source code is governed # by the terms and conditions defined in the "LICENSE" file that is part # of this source code package. # from pybuilder.core import use_bldsup from pybuilder.core import use_plugin from pybuilder.core import...
mpl-2.0
zafar-hussain/or-tools
examples/python/traffic_lights.py
32
3902
# Copyright 2010 Hakan Kjellerstrand hakank@bonetmail.com # # 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 ...
apache-2.0
isaac-playground/git-python
run_git_python.py
1
1941
""" """ import os.path import git REPO_ROOT = os.path.abspath(os.path.dirname(__file__)) DATA_DIR = os.path.join(REPO_ROOT, 'data') CURRENT_EXECUTION_VERSION = 16 NEW_AND_MODIFIED = '.' REMOVED = '-A' COMMIT_MSG='-m "Automated commit {index}. Running through."'.format(index=CURRENT_EXECUTION_VERSION) VERSION_TAG = 'v1...
mit
ahamilton/vigil
eris/webserver.py
1
2593
#!/usr/bin/env python3.8 # Copyright (C) 2018-2019 Andrew Hamilton. All rights reserved. # Licensed under the Artistic License 2.0. import gzip import http.server import os import sys import pickle import eris.fill3 as fill3 import eris.tools as tools USAGE = """Usage: eris-webserver <directory> Example: eri...
artistic-2.0
yd0str/infernal-twin
build/pillow/PIL/FliImagePlugin.py
26
4782
# # The Python Imaging Library. # $Id$ # # FLI/FLC file handling. # # History: # 95-09-01 fl Created # 97-01-03 fl Fixed parser, setup decoder tile # 98-07-15 fl Renamed offset attribute to avoid name clash # # Copyright (c) Secret Labs AB 1997-98. # Copyright (c) Fredrik Lundh 1995-97. # ...
gpl-3.0
imzers/gsutil-with-php
gslib/tests/test_defacl.py
22
8847
# -*- coding: utf-8 -*- # 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 require...
apache-2.0
ddelemeny/calligra
3rdparty/google-breakpad/src/tools/gyp/test/small/gyptest-small.py
89
1405
#!/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. """ Runs small tests. """ import imp import os import sys import unittest import TestGyp test = TestGyp.TestGyp() # Add pylib to the im...
gpl-2.0
claws/txcosm
examples/subscribe.py
1
3214
#!/usr/bin/env python """ Subscribe to a feed or a datastream that is visible to the supplied Cosm user API key To use this script you must create a text file containing your API key and pass it to this script using the --keyfile argument as follows: Subscribe for updates to a particular feed: $ simple_subscribe.py ...
mit
followloda/PornGuys
FlaskServer/venv/Lib/site-packages/werkzeug/exceptions.py
176
18733
# -*- coding: utf-8 -*- """ werkzeug.exceptions ~~~~~~~~~~~~~~~~~~~ This module implements a number of Python exceptions you can raise from within your views to trigger a standard non-200 response. Usage Example ------------- :: from werkzeug.wrappers import BaseRequest ...
gpl-3.0
flit/cmdis
cmdis/formatter.py
1
6910
# Copyright (c) 2016-2019 Chris Reed # # SPDX-License-Identifier: Apache-2.0 # # 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
mdblv2/joatu-django
application/site-packages/django/contrib/admindocs/utils.py
216
3801
"Misc. utility functions/classes for admin documentation generator." import re from email.parser import HeaderParser from email.errors import HeaderParseError from django.utils.safestring import mark_safe from django.core.urlresolvers import reverse from django.utils.encoding import force_bytes try: import docuti...
apache-2.0
ismtabo/huffman_algorithm
main.py
2
2098
#!/usr/bin/env python # -*- coding: utf-8 -*- """Python implementation of Huffman Coding This script test the implementation software of Huffman Coding at \'main.py\'. """ __author__ = 'Ismael Taboada' __version__= '1.0' from collections import defaultdict import csv import os.path import time from huffman import...
gpl-2.0
harterj/moose
modules/tensor_mechanics/test/tests/capped_mohr_coulomb/small_deform_hard_21.py
12
1567
#!/usr/bin/env python3 #* This file is part of the MOOSE framework #* https://www.mooseframework.org #* #* All rights reserved, see COPYRIGHT for full restrictions #* https://github.com/idaholab/moose/blob/master/COPYRIGHT #* #* Licensed under LGPL 2.1, please see LICENSE for details #* https://www.gnu.org/licenses/lgp...
lgpl-2.1
zas/picard
picard/webservice/api_helpers.py
3
11862
# -*- coding: utf-8 -*- # # Picard, the next-generation MusicBrainz tagger # # Copyright (C) 2017 Sambhav Kothari # Copyright (C) 2018, 2020 Laurent Monin # Copyright (C) 2018-2021 Philipp Wolfer # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public Lice...
gpl-2.0
WIZARD-CXY/container-agent
tests/run_containers_test.py
6
16625
#!/usr/bin/python """Tests for run_containers.""" import unittest import yaml from container_agent import run_containers class RunContainersTest(unittest.TestCase): def testKnownVersion(self): yaml_code = """ version: v1beta1 """ run_containers.CheckVersion(yaml.load(yaml_code)) ...
apache-2.0
jonathonwalz/ansible
lib/ansible/modules/network/panos/panos_lic.py
78
4915
#!/usr/bin/python # -*- coding: utf-8 -*- # # Ansible module to manage PaloAltoNetworks Firewall # (c) 2016, techbizdev <techbizdev@paloaltonetworks.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as publish...
gpl-3.0
tcheehow/MissionPlanner
Lib/sgmllib.py
64
18437
"""A parser for SGML, using the derived class as a static DTD.""" # XXX This only supports those SGML features used by HTML. # XXX There should be a way to distinguish between PCDATA (parsed # character data -- the normal case), RCDATA (replaceable character # data -- only char and entity references and end tag...
gpl-3.0
paplorinc/intellij-community
plugins/hg4idea/testData/bin/hgext/inotify/linux/watcher.py
92
10504
# watcher.py - high-level interfaces to the Linux inotify subsystem # Copyright 2006 Bryan O'Sullivan <bos@serpentine.com> # 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, or any later version. '''High-level interfa...
apache-2.0
ChenJunor/hue
desktop/core/src/desktop/redaction/tests.py
30
14341
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
apache-2.0
mtbc/openmicroscopy
components/tools/OmeroPy/src/omero/plugins/cecog.py
11
6684
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Methods for working with cecog Copyright 2010 University of Dundee, Inc. All rights reserved. Use is subject to license terms supplied in LICENSE.txt """ import os import re import sys from omero.cli import BaseControl, CLI import omero import omero.consta...
gpl-2.0
yordan-desta/QgisIns
python/plugins/processing/gui/ScriptEditorDialog.py
2
7417
# -*- coding: utf-8 -*- """ *************************************************************************** EditScriptDialog.py --------------------- Date : December 2012 Copyright : (C) 2012 by Alexander Bruy Email : alexander dot bruy at gmail dot com *******...
gpl-2.0
miki725/django-sub-query
sub_query/db/models/sql/compiler.py
2
2389
# -*- coding: utf-8 -*- from __future__ import print_function, unicode_literals from django.contrib.gis.db.models.sql.compiler import * # noqa class SubQueryGeoSQLCompiler(GeoSQLCompiler): def __init__(self, *args, **kwargs): super(SubQueryGeoSQLCompiler, self).__init__(*args, **kwargs) self.is_...
mit
luisgg/iteexe
exe/export/singlepage.py
1
6261
# =========================================================================== # eXe # Copyright 2004-2005, University of Auckland # Copyright 2004-2008 eXe Project, http://eXeLearning.org/ # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as...
gpl-2.0
kret0s/gnuhealth-live
tryton/server/trytond-3.8.3/trytond/modules/health_icd10/__init__.py
1
1084
# -*- coding: utf-8 -*- ############################################################################## # # GNU Health: The Free Health and Hospital Information System # Copyright (C) 2008-2016 Luis Falcon <lfalcon@gnusolidario.org> # Copyright (C) 2011-2016 GNU Solidario <health@gnusolidario.org> # # # This...
gpl-3.0
weynsee/chompy
chompy/chom.py
1
10122
# Copyright 2009 Wayne See # # 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 wri...
apache-2.0
TaintTrap/platform_external_chromium
testing/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...
bsd-3-clause
cubarco/tunasync
tunasync/jobs.py
1
4053
#!/usr/bin/env python2 # -*- coding:utf-8 -*- import sh import sys from setproctitle import setproctitle import signal import Queue import traceback def run_job(sema, child_q, manager_q, provider, **settings): aquired = False setproctitle("tunasync-{}".format(provider.name)) def before_quit(*args): ...
gpl-3.0
SickGear/SickGear
lib/hachoir_py2/parser/archive/cab.py
2
11532
""" Microsoft Cabinet (CAB) archive. Author: Victor Stinner, Robert Xiao Creation date: 31 january 2007 - Microsoft Cabinet SDK http://msdn2.microsoft.com/en-us/library/ms974336.aspx """ from __future__ import absolute_import from hachoir_py2.parser import Parser from hachoir_py2.field import (FieldSet, Enum, ...
gpl-3.0
topliceanu/learn
python/python_koans/python2/koans/about_lists.py
1
3314
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Based on AboutArrays in the Ruby Koans # from runner.koan import * class AboutLists(Koan): def test_creating_lists(self): empty_list = list() self.assertEqual(list, type(empty_list)) self.assertEqual(0, len(empty_list)) def test_list...
mit
ghevcoul/pycraft
pycraft/window.py
1
10596
# python imports import math # 3rd party imports import pyglet.clock import pyglet.graphics import pyglet.window from pyglet.gl import * # noqa from pyglet.window import key, mouse from pycraft.util import sectorize, cube_vertices, normalize from pycraft.objects.block import get_block from pycraft.configuration impo...
mit
jcfrank/myrepo
tests/test_git_config.py
90
1229
import os import unittest import git_config def fixture(*paths): """Return a path relative to test/fixtures. """ return os.path.join(os.path.dirname(__file__), 'fixtures', *paths) class GitConfigUnitTest(unittest.TestCase): """Tests the GitConfig class. """ def setUp(self): """Create a GitConfig obje...
apache-2.0
glorizen/nupic
examples/opf/clients/hotgym/prediction/one_gym/run.py
21
5172
#!/usr/bin/env python # ---------------------------------------------------------------------- # 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 ...
agpl-3.0
eternity-group/eternity
qa/rpc-tests/listtransactions.py
1
10134
#!/usr/bin/env python2 # Copyright (c) 2014-2015 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # Exercise the listtransactions API from test_framework.test_framework import BitcoinTestFramework from ...
mit
wkfwkf/statsmodels
examples/run_all.py
34
1740
"""run all examples to make sure we don't get an exception Note: If an example contaings plt.show(), then all plot windows have to be closed manually, at least in my setup. uncomment plt.show() to show all plot windows """ from __future__ import print_function from statsmodels.compat import input stop_on_error = Tru...
bsd-3-clause
kavasoglu/ocl_web
ocl_web/apps/collections/views.py
1
33279
""" OCL Collection views """ import logging import re import requests import simplejson as json from apps.core.utils import SearchStringFormatter from apps.core.views import UserOrOrgMixin from braces.views import LoginRequiredMixin from django.contrib import messages from django.core.paginator import Paginator from d...
mpl-2.0
SoCo/SoCo
soco/events_asyncio.py
1
20247
"""Classes to handle Sonos UPnP Events and Subscriptions using asyncio. The `Subscription` class from this module will be used in :py:mod:`soco.services` if `config.EVENTS_MODULE` is set to point to this module. Example: Run this code, and change your volume, tracks etc:: import logging logging...
mit
alshedivat/tensorflow
tensorflow/contrib/gan/python/eval/python/eval_utils_impl.py
73
5394
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
rohitwaghchaure/New_Theme_Erp
erpnext/accounts/report/gross_profit/gross_profit.py
10
4692
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe.utils import flt from erpnext.stock.utils import get_buying_amount, get_sales_bom_buying_amount def execute(filters=None):...
agpl-3.0
thnee/ansible
lib/ansible/module_utils/splitter.py
197
9433
# 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 author of the module, and may assign their own license # to the complete wo...
gpl-3.0
mcaleavya/bcc
examples/networking/vlan_filter/data-plane-tracing.py
4
7701
#!/usr/bin/python from __future__ import print_function from bcc import BPF import sys import socket import os import argparse import time import netifaces as ni from sys import argv from kafka import KafkaProducer from kafka.errors import KafkaError from datetime import datetime #args def usage(): print("USAGE:...
apache-2.0
massmutual/scikit-learn
sklearn/utils/estimator_checks.py
1
54609
from __future__ import print_function import types import warnings import sys import traceback import pickle from copy import deepcopy import numpy as np from scipy import sparse import struct from sklearn.externals.six.moves import zip from sklearn.externals.joblib import hash, Memory from sklearn.utils.testing imp...
bsd-3-clause
spauka/therm_flask
scripts/BlueFors Scripts/TC_monitor.py
1
7020
import os, os.path import sys import re import time, datetime import csv, json import urllib.request, urllib.error PATH = "C:\\BlueFors logs" FOLDER_PATTERN = r"([0-9]{2})-([0-9]{2})-([0-9]{2})" FRIDGE = 'BlueFors_QT1' SENSORS = ((1, "Fifty_K"), (2, "Four_K"), (3, "Magnet"), (5, "Still...
mit
dannyboi104/SickRage
lib/github/tests/Issue214.py
39
3361
# -*- coding: utf-8 -*- # ########################## Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> # # Copyright 2012 Zearin <zearin@gonk.net> ...
gpl-3.0
NihilistBrew/Dust
typeclasses/objects.py
10
8575
""" Object The Object is the "naked" base class for things in the game world. Note that the default Character, Room and Exit does not inherit from this Object, but from their respective default implementations in the evennia library. If you want to use this class as a parent to change the other types, you can do so b...
mit
eayun/ovirt-engine
packaging/setup/ovirt_engine_setup/util.py
5
8581
# # ovirt-engine-setup -- ovirt engine setup # Copyright (C) 2013-2015 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 # # Unl...
apache-2.0
ivanvladimir/gensim
gensim/test/test_doc2vec.py
1
16473
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2010 Radim Rehurek <radimrehurek@seznam.cz> # Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html """ Automated tests for checking transformation algorithms (the models package). """ from __future__ import with_statement import logg...
gpl-3.0
40223149/2015cd_midterm
static/Brython3.1.0-20150301-090019/Lib/site-packages/pygame/__init__.py
603
6082
## pygame - Python Game Library ## Copyright (C) 2000-2001 Pete Shinners ## ## 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; either ## version 2 of the License, or (...
gpl-3.0
mm112287/2015cda-24
static/Brython3.1.1-20150328-091302/Lib/codecs.py
739
35436
""" codecs -- Python Codec Registry, API and helpers. Written by Marc-Andre Lemburg (mal@lemburg.com). (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. """#" import builtins, sys ### Registry and builtin stateless codec functions try: from _codecs import * except ImportError as why: raise SystemErro...
gpl-3.0
georgeha/mandelbrot
mandelbrot_core/mandelbrot_pilot_cores.py
1
7097
__author__ = "George Chantzialexiou" __copyright__ = "Copyright 2012-2013, The Pilot Project" __license__ = "MIT" """ A Mandelbrot Fractal Generator Using Pilot Job This is an example of mandelbrot Fracatl Generator using the capabilities of Pilot Job API. It requires the Python Image Library (PIL) which c...
mit
nexiles/odoo
addons/stock/procurement.py
227
22183
# -*- 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
mailboxly/po
pymongo/auth.py
23
15619
# Copyright 2013-2015 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...
agpl-3.0
LeZhang2016/openthread
tests/scripts/thread-cert/ipv6.py
11
35649
#!/usr/bin/env 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 # ...
bsd-3-clause
southpawtech/TACTIC-DEV
3rd_party/CherryPy/cherrypy/process/plugins.py
6
20583
"""Site services for use with a Web Site Process Bus.""" import os import re try: set except NameError: from sets import Set as set import signal as _signal import sys import time import thread import threading # _module__file__base is used by Autoreload to make # absolute any filenames retrieved from sys.mod...
epl-1.0
smn/onadata
onadata/apps/main/tests/test_form_edit.py
13
5646
from django.core.urlresolvers import reverse from onadata.apps.main.models import MetaData from onadata.apps.main.views import edit from onadata.apps.logger.models import XForm from onadata.apps.logger.views import delete_xform from test_base import TestBase class TestFormEdit(TestBase): def setUp(self): ...
bsd-2-clause
kwrobert/heat-templates
tests/software_config/test_heat_config_kubelet.py
7
4615
# # 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 # ...
apache-2.0
enlighter/ndl-question-papers-search-hub
qp_search_project/searcher/models.py
1
3438
from django.db import models from django.contrib.auth.models import AbstractUser, UserManager from django.utils import timezone from django.dispatch import receiver from django.db.models.signals import post_save from localflavor.in_ import in_states gettext_noop = lambda s: s EDUCATIONAL_ROLE= ( ('vb', gettext_n...
mit
shaulkf/bitcoin
qa/rpc-tests/proxy_test.py
93
7769
#!/usr/bin/env python2 # Copyright (c) 2015 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. import socket import traceback, sys from binascii import hexlify import time, os from test_framework.socks5 im...
mit
nguyentruongtho/buck
programs/subprocutils.py
5
3349
# Copyright (c) Facebook, Inc. and its affiliates. # # 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
ppries/tensorflow
tensorflow/contrib/distributions/python/ops/transformed_distribution.py
1
9906
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
adw0rd/lettuce
tests/integration/lib/Django-1.3/django/contrib/localflavor/fi/fi_municipalities.py
394
10822
# -*- coding: utf-8 -*- """ An alphabetical list of Finnish municipalities for use as `choices` in a formfield. This exists in this standalone file so that it's only imported into memory when explicitly needed. """ MUNICIPALITY_CHOICES = ( ('akaa', u"Akaa"), ('alajarvi', u"Alajärvi"), ('alavieska', u"Alav...
gpl-3.0
cmbruns/vr_samples
test/python/test_sphere.py
1
2362
#!/bin/env python import unittest import glfw from OpenGL import GL from PIL import Image import numpy from vrprim.imposter import sphere def images_are_identical(img1, img2): ar1 = numpy.array(img1.convert('RGBA')) ar2 = numpy.array(img2.convert('RGBA')) return numpy.array_equiv(ar1, ar2)...
mit
pdee/pdee
python-libs/rope/base/project.py
40
11976
import cPickle as pickle import os import shutil import sys import warnings import rope.base.fscommands from rope.base import exceptions, taskhandle, prefs, history, pycore, utils from rope.base.resourceobserver import * from rope.base.resources import File, Folder, _ResourceMatcher class _Project(object): def ...
gpl-3.0
giovannimanzoni/project2
test/RS485/python/readFromRS485.py
2
1384
#!/usr/bin/env python # # Python sample application that reads from the raspicomm's RS-485 Port # # Thanks to Acmesystems, program edited by Giovanni Manzoni @ HardElettroSoft # # 9600 8N1 flow control Xon/Xoff # import array import serial maxReadCount=10 readBuffer = array.array('c') print('this sample application...
cc0-1.0
FrankBian/kuma
kuma/humans/models.py
5
2264
from __future__ import with_statement import json import os import subprocess import urllib from django.conf import settings GITHUB_REPOS = "https://api.github.com/repos/mozilla/kuma/contributors" class Human(object): def __init__(self): self.name = None self.website = None class HumansTXT(ob...
mpl-2.0
ravello/ansible
v2/ansible/plugins/lookup/flattened.py
60
2408
# (c) 2013, Serge van Ginderachter <serge@vanginderachter.be> # # 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)...
gpl-3.0
openpaperwork/paperwork
paperwork-gtk/src/paperwork/frontend/beacon/__init__.py
1
7272
import datetime import dateutil.parser import http import http.client import json import logging import multiprocessing import os import platform import ssl import re import threading import urllib logger = logging.getLogger(__name__) class Beacon(object): USER_AGENT = "Paperwork" UPDATE_CHECK_INTERVAL = d...
gpl-3.0
atodorov/dnf-plugins-core
plugins/needs_restarting.py
2
6405
# needs_restarting.py # DNF plugin to check for running binaries in a need of restarting. # # Copyright (C) 2014 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, or (at ...
gpl-2.0