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
ChemiKhazi/Sprytile
rx/testing/coldobservable.py
2
1816
from rx.core import ObservableBase, Observer, AnonymousObserver, Disposable from rx.disposables import CompositeDisposable from .subscription import Subscription from .reactive_assert import AssertList class ColdObservable(ObservableBase): def __init__(self, scheduler, messages): super(ColdObservable, se...
mit
bricky/xbmc-addon-tvtumbler
resources/lib/unidecode/x097.py
252
4643
data = ( 'Xu ', # 0x00 'Ji ', # 0x01 'Mu ', # 0x02 'Chen ', # 0x03 'Xiao ', # 0x04 'Zha ', # 0x05 'Ting ', # 0x06 'Zhen ', # 0x07 'Pei ', # 0x08 'Mei ', # 0x09 'Ling ', # 0x0a 'Qi ', # 0x0b 'Chou ', # 0x0c 'Huo ', # 0x0d 'Sha ', # 0x0e 'Fei ', # 0x0f 'Weng ', # 0x10 'Z...
gpl-3.0
almarklein/scikit-image
doc/examples/plot_gabors_from_lena.py
3
3341
""" ======================================================= Gabors / Primary Visual Cortex "Simple Cells" from Lena ======================================================= How to build a (bio-plausible) "sparse" dictionary (or 'codebook', or 'filterbank') for e.g. image classification without any fancy math and with j...
bsd-3-clause
smohsinali/HPOlib
optimizers/tpe/random_hyperopt_august2013_mod.py
5
7067
#!/usr/bin/env python ## # wrapping: A program making it easy to use hyperparameter # optimization software. # Copyright (C) 2013 Katharina Eggensperger and Matthias Feurer # # 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 # ...
gpl-3.0
pranavtendolkr/horizon
openstack_dashboard/dashboards/project/stacks/urls.py
56
1765
# 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 th...
apache-2.0
UOMx/edx-platform
cms/djangoapps/contentstore/tests/test_crud.py
15
5989
from xmodule import templates from xmodule.modulestore import ModuleStoreEnum from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase, TEST_DATA_SPLIT_MODULESTORE from xmodule.course_module import CourseDescriptor from xmodule.seq...
agpl-3.0
mathLab/RBniCS
rbnics/utils/decorators/reduction_method_decorator_for.py
1
1598
# Copyright (C) 2015-2021 by the RBniCS authors # # This file is part of RBniCS. # # SPDX-License-Identifier: LGPL-3.0-or-later import inspect import types from rbnics.utils.cache import cache from rbnics.utils.decorators.dispatch import dispatch def ReductionMethodDecoratorFor(Algorithm, replaces=None, replaces_if=...
lgpl-3.0
markYoungH/chromium.src
third_party/typ/typ/stats.py
82
2958
# Copyright 2014 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 ag...
bsd-3-clause
arnavd96/Cinemiezer
myvenv/lib/python3.4/site-packages/boto/sdb/db/test_db.py
153
5427
import logging import time from datetime import datetime from boto.sdb.db.model import Model from boto.sdb.db.property import StringProperty, IntegerProperty, BooleanProperty from boto.sdb.db.property import DateTimeProperty, FloatProperty, ReferenceProperty from boto.sdb.db.property import PasswordProperty, ListPrope...
mit
kraj/systemd
test/run-unit-tests.py
35
1710
#!/usr/bin/env python3 import argparse import dataclasses import glob import os import subprocess import sys try: import colorama as c GREEN = c.Fore.GREEN YELLOW = c.Fore.YELLOW RED = c.Fore.RED RESET_ALL = c.Style.RESET_ALL BRIGHT = c.Style.BRIGHT except ImportError: GREEN = YELLOW = RED ...
gpl-2.0
peterbrook/assetjet
deploy/setup_esky.py
1
2048
import sys, os from esky.bdist_esky import Executable from distutils.core import setup import assetjet from deploy import exeName, appName from glob import glob def get_data_files(dirs): """ Recursively include data directories. """ results = [] for directory in dirs: for root, dirs, files ...
gpl-3.0
lento/cortex
test/IECore/ops/splineInput/splineInput-1.py
12
2469
########################################################################## # # Copyright (c) 2009-2010, Image Engine Design 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: # # * Redis...
bsd-3-clause
ltiao/networkx
networkx/utils/tests/test_heaps.py
64
3979
from nose.tools import * import networkx as nx from networkx.utils import * class X(object): def __eq__(self, other): raise self is other def __ne__(self, other): raise self is not other def __lt__(self, other): raise TypeError('cannot compare') def __le__(self, other): ...
bsd-3-clause
domenicosolazzo/practice-django
venv/lib/python2.7/site-packages/django/core/files/utils.py
901
1230
class FileProxyMixin(object): """ A mixin class used to forward file methods to an underlaying file object. The internal file object has to be called "file":: class FileProxy(FileProxyMixin): def __init__(self, file): self.file = file """ encoding = property(la...
mit
sdierauf/laundrytime
app/bower_components/bootstrap/test-infra/s3_cache.py
1700
3523
#!/usr/bin/env python2.7 from __future__ import absolute_import, unicode_literals, print_function, division from sys import argv from os import environ, stat, remove as _delete_file from os.path import isfile, dirname, basename, abspath from hashlib import sha256 from subprocess import check_call as run from boto.s3....
mit
joeythesaint/yocto-autobuilder
lib/python2.7/site-packages/Twisted-12.2.0-py2.7-linux-x86_64.egg/twisted/words/tap.py
60
2422
# -*- test-case-name: twisted.words.test.test_tap -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Shiny new words service maker """ import sys, socket from twisted.application import strports from twisted.application.service import MultiService from twisted.python import usage from twi...
gpl-2.0
VanirAOSP/external_chromium_org
native_client_sdk/src/doc/conf.py
24
5904
# -*- coding: utf-8 -*- # # Native Client documentation build configuration file, created by # sphinx-quickstart on Thu Aug 15 11:31:06 2013. # # 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. #...
bsd-3-clause
Mercador/python-keystoneclient
keystoneclient/auth/cli.py
6
3244
# 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 t...
apache-2.0
xantin/qualitybots
src/webdriver/chrome_resize.py
26
4879
#!/usr/bin/python2.6 # # Copyright 2011 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required...
apache-2.0
deepinsight/Deformable-ConvNets
Cdiscount/symbols/resnet.py
56
9630
# 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
HellerCommaA/flask-angular
lib/python2.7/site-packages/gunicorn/sock.py
31
6594
# -*- coding: utf-8 - # # This file is part of gunicorn released under the MIT license. # See the NOTICE for more information. import errno import os import socket import stat import sys import time from gunicorn import util from gunicorn.six import string_types SD_LISTEN_FDS_START = 3 class BaseSocket(object): ...
mit
Havate/havate-openstack
proto-build/gui/horizon/Horizon_GUI/openstack_dashboard/dashboards/project/images_and_snapshots/images/forms.py
4
9619
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # no...
apache-2.0
grumpyjames/buck
third-party/py/unittest2/unittest2/loader.py
139
13421
"""Loading unittests.""" import os import re import sys import traceback import types import unittest from fnmatch import fnmatch from unittest2 import case, suite try: from os.path import relpath except ImportError: from unittest2.compatibility import relpath __unittest = True def _CmpToKey(mycmp): ...
apache-2.0
ElDeveloper/scikit-learn
examples/decomposition/plot_pca_iris.py
253
1801
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= PCA example with Iris Data-set ========================================================= Principal Component Analysis applied to the Iris dataset. See `here <http://en.wikipedia.org/wiki/Iris_flower_data_set>`_ fo...
bsd-3-clause
FescueFungiShare/hydroshare
hs_tracking/views.py
2
2158
import csv from cStringIO import StringIO from django.views.generic import TemplateView from django.utils.decorators import method_decorator from django.contrib.auth.decorators import user_passes_test from django.http import HttpResponse from . import models as hs_tracking class UseTrackingView(TemplateView): t...
bsd-3-clause
avidoggy/Pygorithm
ArtificialIntelligence/Path_Finding.py
1
6073
#Your code here #You can import some modules or create additional functions def checkio(maze_map): #replace this for solution #This is just example for first maze MOVE = {"S": (1, 0), "N": (-1, 0), "W": (0, -1), "E": (0, 1)} copy_maze_map = [row[:] for row in maze_map] #print type(copy_maze_map) ...
gpl-2.0
zbqf109/goodo
openerp/tests/common.py
2
14850
# -*- coding: utf-8 -*- """ The module :mod:`openerp.tests.common` provides unittest2 test cases and a few helpers and classes to write tests. """ import errno import glob import importlib import json import logging import os import select import subprocess import threading import time import itertools import unittest...
gpl-3.0
EnriqueIzel2/jogo
funcoes.py
1
6140
import pygame import random from pygame.locals import* pygame.init() x = 800 y = 600 janela = pygame.display.set_mode((x, y)) fundo_verde = (4, 166, 1) # cor do fundo da tela cor_letra = (0, 0, 0) # cor da letra cor_cursor = (50, 60, 50) cor_cobra = (255, 55, 255) red = (255, 0, 0) # s...
apache-2.0
matrix-org/synapse
tests/storage/test_end_to_end_keys.py
1
3855
# Copyright 2016-2021 The Matrix.org Foundation C.I.C. # # 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...
apache-2.0
drybjed/ansible-modules-extras
system/osx_defaults.py
77
12888
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2014, GeekChimp - Franck Nijhof <franck@geekchimp.com> # # 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 you...
gpl-3.0
jonathanslenders/pymux-test
pymux/rc.py
2
2237
""" Initial configuration. """ from __future__ import unicode_literals __all__ = ( 'STARTUP_COMMANDS' ) STARTUP_COMMANDS = """ bind-key '"' split-window -v bind-key % split-window -h bind-key c new-window bind-key Right select-pane -R bind-key Left select-pane -L bind-key Up select-pane -U bind-key Down select-pa...
bsd-3-clause
stephane-martin/salt-debian-packaging
salt-2016.3.2/salt/runners/asam.py
2
11014
# -*- coding: utf-8 -*- ''' Novell ASAM Runner ================== .. versionadded:: Beryllium Runner to interact with Novell ASAM Fan-Out Driver :codeauthor: Nitin Madhok <nmadhok@clemson.edu> To use this runner, set up the Novell Fan-Out Driver URL, username and password in the master configuration at ``/etc/salt/...
apache-2.0
RobertABT/heightmap
build/scipy/scipy/lib/lapack/tests/test_gesv.py
13
3510
from __future__ import division, print_function, absolute_import import numpy as np from numpy.testing import TestCase, assert_array_almost_equal, dec, \ assert_equal, assert_, run_module_suite from common import FUNCS_TP, FLAPACK_IS_EMPTY, CLAPACK_IS_EMPTY, FUNCS_FLAPACK, \ ...
mit
bakerlover/project4
lib/jinja2/_compat.py
638
4042
# -*- coding: utf-8 -*- """ jinja2._compat ~~~~~~~~~~~~~~ Some py2/py3 compatibility support based on a stripped down version of six so we don't have to depend on a specific version of it. :copyright: Copyright 2013 by the Jinja team, see AUTHORS. :license: BSD, see LICENSE for details. ""...
apache-2.0
the100rabh/Barcamp-Bangalore-Android-App
gcm_flask/werkzeug/debug/__init__.py
81
7867
# -*- coding: utf-8 -*- """ werkzeug.debug ~~~~~~~~~~~~~~ WSGI application traceback debugger. :copyright: (c) 2011 by the Werkzeug Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ import mimetypes from os.path import join, dirname, basename, isfile from werkzeu...
apache-2.0
mjdarby/RogueDetective
tiles.py
1
2723
# Tiles, tiles, tiles! Doors, walls.. If it's not a player but it's # on the map, it goes here. # Our imports from constants import Constants class Tile(object): """Represents a tile in vision. Once seen, a tile will show what is currently on it via the game draw method. Once a tile goes out of view, ever...
gpl-2.0
jiachenning/odoo
addons/stock_landed_costs/__openerp__.py
220
1914
# -*- 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
kornicameister/ansible-modules-extras
cloud/vmware/vmware_vmkernel.py
75
7458
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Joseph Callen <jcallen () csc.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 Li...
gpl-3.0
openiitbombayx/edx-platform
common/djangoapps/track/backends/mongodb.py
41
3046
"""MongoDB event tracker backend.""" from __future__ import absolute_import import logging import pymongo from pymongo import MongoClient from pymongo.errors import PyMongoError from bson.errors import BSONError from track.backends import BaseBackend log = logging.getLogger(__name__) class MongoBackend(BaseBack...
agpl-3.0
defionscode/ansible
lib/ansible/module_utils/azure_rm_common_rest.py
35
2605
# Copyright (c) 2018 Zim Kalinowski, <zikalino@microsoft.com> # # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) try: from msrestazure.azure_exceptions import CloudError from msrestazure.azure_configuration import AzureConfiguration from msrest.service_client imp...
gpl-3.0
ENCODE-DCC/chip-seq-pipeline
dnanexus/make_trackhub_from_analysis.py
1
18930
#!/usr/bin/env python import os, sys, subprocess, logging, dxpy, json, re, socket, getpass, urlparse from posixpath import basename, dirname import common EPILOG = '''Notes: Examples: %(prog)s ''' DEFAULT_APPLET_PROJECT = 'E3 ChIP-seq' KEYFILE = os.path.expanduser("~/keypairs.json") def get_args(): import...
mit
tensorflow/agents
tf_agents/bandits/agents/mixture_agent.py
1
7660
# coding=utf-8 # Copyright 2020 The TF-Agents Authors. # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable la...
apache-2.0
cvegaj/ElectriCERT
venv3/lib/python3.6/site-packages/chardet/universaldetector.py
244
12485
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
gpl-3.0
amboxer21/scrapy
scrapy/spiders/sitemap.py
56
2706
import re import logging from scrapy.spiders import Spider from scrapy.http import Request, XmlResponse from scrapy.utils.sitemap import Sitemap, sitemap_urls_from_robots from scrapy.utils.gz import gunzip, is_gzipped logger = logging.getLogger(__name__) class SitemapSpider(Spider): sitemap_urls = () sitem...
bsd-3-clause
NonnEmilia/OpenGenfri
pos/webpos/dbmanager.py
2
2516
from django.contrib.auth.models import User from webpos.models import Item, Bill, BillItem def commit_bill(output, reqdata, user): billhd = Bill(customer_name=reqdata['customer_name'], server=User.objects.get(pk=user.id).username) billitms = [] reqquants = reqdata['items'] dbitms = I...
mit
belmiromoreira/nova
nova/console/websocketproxy.py
12
6728
# Copyright (c) 2012 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
vacuus/django-codesnip
codesnip/migrations/0001_initial.py
1
13039
# -*- coding: utf-8 -*- # Generated by Django 1.10.3 on 2016-12-25 00:48 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Snippe...
lgpl-3.0
pepeportela/edx-platform
common/lib/xmodule/xmodule/block_metadata_utils.py
32
3027
""" Simple utility functions that operate on block metadata. This is a place to put simple functions that operate on block metadata. It allows us to share code between the XModuleMixin and CourseOverview and BlockStructure. """ def url_name_for_block(block): """ Given a block, returns the block's URL name. ...
agpl-3.0
Eric89GXL/vispy
examples/demo/gloo/quiver.py
2
2368
#!/usr/bin/env python # -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) 2014, Nicolas P. Rougier. All Rights Reserved. # Distributed under the (new) BSD License. # ----------------------------------------------------------------------------- from vi...
bsd-3-clause
pytroll/pygac
pygac/gac_io.py
1
27380
#!/usr/bin/env python # Copyright (c) 2012, 2014 Abhay Devasthale # Author(s): # Abhay Devasthale <abhay.devasthale@smhi.se> # Adam Dybbroe <adam.dybbroe@smhi.se> # Sara Hornquist <sara.hornquist@smhi.se> # Martin Raspaud <martin.raspaud@smhi.se> # Carlos Horn <carlos.horn@external.eumetsat.int> # This pr...
gpl-3.0
hectord/lettuce
tests/integration/lib/Django-1.3/django/contrib/localflavor/is_/is_postalcodes.py
438
4913
# -*- coding: utf-8 -*- IS_POSTALCODES = ( ('101', u'101 Reykjavík'), ('103', u'103 Reykjavík'), ('104', u'104 Reykjavík'), ('105', u'105 Reykjavík'), ('107', u'107 Reykjavík'), ('108', u'108 Reykjavík'), ('109', u'109 Reykjavík'), ('110', u'110 Reykjavík'), ('111', u'111 Reykjavík'...
gpl-3.0
roderickmackenzie/gpvdm
gpvdm_gui/gui/command_args.py
1
7098
# # General-purpose Photovoltaic Device Model - a drift diffusion base/Shockley-Read-Hall # model for 1st, 2nd and 3rd generation solar cells. # Copyright (C) 2012-2017 Roderick C. I. MacKenzie r.c.i.mackenzie at googlemail.com # # https://www.gpvdm.com # Room B86 Coates, University Park, Nottingham, NG7 2RD...
gpl-2.0
wweiradio/django
tests/contenttypes_tests/models.py
70
1803
from __future__ import unicode_literals from django.db import models from django.utils.encoding import python_2_unicode_compatible from django.utils.http import urlquote @python_2_unicode_compatible class Author(models.Model): name = models.CharField(max_length=100) def __str__(self): return self.na...
bsd-3-clause
SatoshiNXSimudrone/sl4a-damon-clone
python/gdata/src/gdata/tlslite/integration/ClientHelper.py
285
7021
""" A helper class for using TLS Lite with stdlib clients (httplib, xmlrpclib, imaplib, poplib). """ from gdata.tlslite.Checker import Checker class ClientHelper: """This is a helper class used to integrate TLS Lite with various TLS clients (e.g. poplib, smtplib, httplib, etc.)""" def __init__...
apache-2.0
Mozta/pagina-diagnostijuego
venv/lib/python2.7/site-packages/setuptools/ssl_support.py
86
8131
import os import socket import atexit import re from setuptools.extern.six.moves import urllib, http_client, map import pkg_resources from pkg_resources import ResolutionError, ExtractionError try: import ssl except ImportError: ssl = None __all__ = [ 'VerifyingHTTPSHandler', 'find_ca_bundle', 'is_avail...
gpl-3.0
0jpq0/kbengine
kbe/res/scripts/common/Lib/distutils/tests/test_dir_util.py
106
4654
"""Tests for distutils.dir_util.""" import unittest import os import stat import sys from unittest.mock import patch from distutils import dir_util, errors from distutils.dir_util import (mkpath, remove_tree, create_tree, copy_tree, ensure_relative) from distutils import log from distu...
lgpl-3.0
keven/ibpy
build/lib/ib/lib/__init__.py
3
8650
#!/usr/bin/env python # -*- coding: utf-8 -*- ## # Just enough auxiliary bits to make the translated code work. # # This package provides the support necessary to use the translated # code. The configuration modules used in translation take care of # many semantic differences between Java and Python, while this # pac...
bsd-3-clause
bob-the-hamster/commandergenius
project/jni/python/src/Lib/test/test_urllib2.py
48
45551
import unittest from test import test_support import os import socket import StringIO import urllib2 from urllib2 import Request, OpenerDirector # XXX # Request # CacheFTPHandler (hard to write) # parse_keqv_list, parse_http_list, HTTPDigestAuthHandler class TrivialTests(unittest.TestCase): def test_trivial(sel...
lgpl-2.1
markYoungH/chromium.src
tools/usb_gadget/gadget.py
54
14586
# Copyright 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. """Generic USB gadget functionality. """ import struct import usb_constants class Gadget(object): """Basic functionality for a USB device. Implement...
bsd-3-clause
antonve/s4-project-mooc
common/djangoapps/student/tests/test_password_policy.py
113
12723
# -*- coding: utf-8 -*- """ This test file will verify proper password policy enforcement, which is an option feature """ import json from django.test import TestCase from django.test.client import RequestFactory from django.core.urlresolvers import reverse from django.contrib.auth.models import AnonymousUser from djan...
agpl-3.0
ATIX-AG/ansible
test/units/modules/network/dellos10/test_dellos10_command.py
44
4313
# (c) 2016 Red Hat Inc. # # (c) 2017 Dell EMC. # # 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 vers...
gpl-3.0
shahar-stratoscale/nova
nova/cells/state.py
9
18148
# Copyright (c) 2012 Rackspace Hosting # 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 req...
apache-2.0
kuiwei/edx-platform
common/djangoapps/microsite_configuration/templatetags/microsite.py
107
2058
""" Template tags and helper functions for displaying breadcrumbs in page titles based on the current micro site. """ from django import template from django.conf import settings from microsite_configuration import microsite from django.templatetags.static import static register = template.Library() def page_title_b...
agpl-3.0
brookisme/gitnb
gitnb/tonb.py
1
4712
import os import sys import json import re import errno import gitnb.config as con import gitnb.utils as utils from gitnb.constants import * import gitnb.default as default class Py2NB(object): """CONVERT NBPY to Notebook Args: path: <str> path to file """ def __init__(self,path,nb_pat...
mit
thunsaker/cloudpebble
fabfile.py
2
4971
# WARNING: This file is extremely specific to how Katharine happens to have her # local machines set up. # In particular, to run without modification, you will need: # - An EC2 keypair in ~/Downloads/katharine-keypair.pem # - A keypair for the ycmd servers in ~/.ssh/id_rsa # - The tintin source tree in ~/projects/tint...
mit
upptalk/uppsell
uppsell/migrations/0004_auto__add_field_listing_shipping.py
1
17786
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Listing.shipping' db.add_column('listings', 'shipping', ...
mit
sherazkasi/SabreSoftware
Lib/site-packages/scipy/setupscons.py
59
1685
from os.path import join as pjoin def configuration(parent_package='', top_path=None, setup_name='setupscons.py'): from numpy.distutils.misc_util import Configuration from numpy.distutils.misc_util import scons_generate_config_py pkgname = 'scipy' config = Configuration(pkgname, parent_package, top_pa...
gpl-3.0
nurmd2/nurmd
addons/product/__openerp__.py
18
1558
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. { 'name': 'Products & Pricelists', 'version': '1.2', 'category': 'Sales Management', 'depends': ['base', 'decimal_precision', 'mail', 'report'], 'demo': [ 'product_demo.xml', 'product...
gpl-3.0
akrherz/iem
htdocs/plotting/auto/scripts100/p160.py
1
8613
""" TODO: add table listing each forecast's peak and peak time... """ import datetime import pytz import numpy as np import pandas as pd from pandas.io.sql import read_sql import matplotlib.dates as mdates from pyiem.plot import figure_axes from pyiem.util import get_autoplot_context, get_dbconn from pyiem.exceptions ...
mit
hnjamba/onaclone
onadata/apps/main/tests/test_past_bugs.py
5
2294
import os from pyxform.errors import PyXFormError from onadata.apps.logger.models import XForm, Instance from test_base import TestBase class TestInputs(TestBase): """ This is where I'll input all files that proved problematic for users when uploading. """ def test_uniqueness_of_group_names_enfo...
bsd-2-clause
Nettacker/Nettacker
lib/transactions/maltego/nettacker_transforms/src/nettacker_transforms/transforms/shodan_scan.py
1
1847
import random from canari.maltego.transform import Transform from canari.maltego.entities import URL from canari.framework import EnableDebugWindow from common.entities import NettackerScan from lib.scan.shodan.engine import start from database.db import __logs_by_scan_id as find_log __author__ = 'Shaddy Garg' __cop...
gpl-3.0
koss822/misc
Linux/MySettings/myvim/vim/bundle/jedi-vim/pythonx/jedi/test/run.py
1
15920
#!/usr/bin/env python """ |jedi| is mostly being tested by what I would call "Blackbox Tests". These tests are just testing the interface and do input/output testing. This makes a lot of sense for |jedi|. Jedi supports so many different code structures, that it is just stupid to write 200'000 unittests in the manner of...
gpl-3.0
prakritish/ansible
lib/ansible/modules/network/panos/panos_address.py
78
6066
#!/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
tavern-consulting/easter-egg
easter_egg/tests.py
1
4000
import json import base64 import os from django.core.urlresolvers import reverse from django.test import TestCase, LiveServerTestCase import requests from selenium import webdriver from selenium.webdriver.common.keys import Keys from easter_egg.models import split_image class _HelperTestCase(TestCase): path_to...
mit
tuxfux-hlp-notes/python-batches
batch-67/19-files/myenv/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/langbulgarianmodel.py
2965
12784
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights R...
gpl-3.0
cbrunet/ouf
src/ouf/view/fileview.py
1
4520
import os import subprocess import sys from PyQt5 import QtCore, QtWidgets from ouf.filemodel.proxymodel import FileProxyModel from ouf.view.filenamedelegate import FileNameDelegate from ouf import shortcuts # TODO: modifiers to open in new window # TODO: switch icons / tree # TODO: modify icon size class FileView...
gpl-3.0
josepht/snapcraft
snapcraft/internal/repo/__init__.py
2
1151
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- # # Copyright (C) 2017 Canonical Ltd # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3 as # published by the Free Software Foundation. # # This program is distributed in the h...
gpl-3.0
soldag/home-assistant
homeassistant/components/zha/core/typing.py
15
1647
"""Typing helpers for ZHA component.""" from typing import TYPE_CHECKING, Callable, TypeVar import zigpy.device import zigpy.endpoint import zigpy.group import zigpy.zcl import zigpy.zdo # pylint: disable=invalid-name CALLABLE_T = TypeVar("CALLABLE_T", bound=Callable) ChannelType = "ZigbeeChannel" ChannelsType = "Ch...
apache-2.0
wtmmac/p2pool
wstools/Utility.py
292
50865
# Copyright (c) 2003, The Regents of the University of California, # through Lawrence Berkeley National Laboratory (subject to receipt of # any required approvals from the U.S. Dept. of Energy). All rights # reserved. # # Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved. # # This software is ...
gpl-3.0
facebook/buck
third-party/py/pex/pex/tracer.py
55
3628
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). import sys import threading import time from contextlib import contextmanager from .variables import ENV __all__ = ('TraceLogger',) class Trace(object): __slots__ = ('msg', 'verbosit...
apache-2.0
julien78910/CouchPotatoServer
libs/bencode/__init__.py
171
3305
# The contents of this file are subject to the BitTorrent Open Source License # Version 1.1 (the License). You may not copy or use this file, in either # source code or executable form, except in compliance with the License. You # may obtain a copy of the License at http://www.bittorrent.com/license/. # # Software di...
gpl-3.0
antar2801/namebench
nb_third_party/dns/rcode.py
248
3106
# Copyright (C) 2001-2007, 2009, 2010 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and this permission notice # appear in all copies. # # THE SOFTWARE IS PROVIDED ...
apache-2.0
muzena/deluge
deluge/plugins/Stats/deluge/plugins/stats/core.py
7
8233
# # core.py # # Copyright (C) 2009 Ian Martin <ianmartin@cantab.net> # Copyright (C) 2008 Damien Churchill <damoxc@gmail.com> # Copyright (C) 2008 Martijn Voncken <mvoncken@gmail.com> # Copyright (C) Marcos Pinto 2007 <markybob@gmail.com> # # Deluge is free software. # # You may redistribute it and/or modify it under t...
gpl-3.0
beckastar/django
django/contrib/gis/gdal/prototypes/geom.py
79
4718
from ctypes import c_char_p, c_double, c_int, c_void_p, POINTER from django.contrib.gis.gdal.envelope import OGREnvelope from django.contrib.gis.gdal.libgdal import lgdal from django.contrib.gis.gdal.prototypes.errcheck import check_envelope from django.contrib.gis.gdal.prototypes.generation import (const_string_output...
bsd-3-clause
dtroyer/python-openstacksdk
openstack/network/v2/metering_label.py
1
1534
# 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 t...
apache-2.0
jamesblunt/sympy
sympy/assumptions/handlers/matrices.py
71
13732
""" This module contains query handlers responsible for calculus queries: infinitesimal, bounded, etc. """ from __future__ import print_function, division from sympy.logic.boolalg import conjuncts from sympy.assumptions import Q, ask from sympy.assumptions.handlers import CommonHandler, test_closed_group from sympy.ma...
bsd-3-clause
xcgoner/dist-mxnet
tools/caffe_converter/test_converter.py
8
4408
# 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
blue-yonder/pyscaffold
tests/test_termui.py
1
2915
# -*- coding: utf-8 -*- from importlib import reload from io import StringIO import pytest from pyscaffold import termui @pytest.fixture(scope="module") def after(): # Reload termui after tests to ensure constants are calculated # with original logic (without mocks). yield reload(termui) @pytest....
mit
ianjuma/usiu-app-dir
benchcare/patients/models.py
1
5931
from django.db import models from django.utils.translation import ugettext_lazy as _ from django.core.urlresolvers import reverse from django.contrib import admin class Patient(models.Model): GENDER = ( ('F', 'Female'), ('M', 'Male'), ) MARRIAGE_STATUS = ( ('S', 'Single'), ...
gpl-2.0
verma-varsha/zulip
zerver/webhooks/gosquared/view.py
1
1441
from __future__ import absolute_import from django.utils.translation import ugettext as _ from zerver.lib.actions import check_send_message from zerver.lib.response import json_success, json_error from zerver.decorator import REQ, has_request_variables, api_key_only_webhook_view from zerver.models import UserProfile ...
apache-2.0
hasadna/django
django/contrib/localflavor/pt/forms.py
100
1601
""" PT-specific Form helpers """ from __future__ import unicode_literals import re from django.core.validators import EMPTY_VALUES from django.forms import ValidationError from django.forms.fields import Field, RegexField from django.utils.encoding import smart_text from django.utils.translation import ugettext_lazy ...
bsd-3-clause
alexlib/Qt-Python-Binding-Examples
common_widgets/checkbox/checkbox.py
1
1200
#!/usr/bin/env python #-*- coding:utf-8 -*- """ QCheckBox demo Tested environment: Mac OS X 10.6.8 http://doc.qt.nokia.com/latest/qcheckbox.html http://doc.qt.nokia.com/latest/qabstractbutton.html http://doc.qt.nokia.com/latest/qt.html#CheckState-enum """ import sys try: from PySide import QtCore from Py...
bsd-3-clause
vileopratama/vitech
src/addons/point_of_lounge/report/lounge_receipt.py
1
1856
from openerp.osv import osv import time from openerp.report import report_sxw def titlize(journal_name): words = journal_name.split() while words.pop() != 'journal': continue return ' '.join(words) class order(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): super(order, self)...
mit
paulrouget/servo
tests/jquery/run_jquery.py
13
9583
#!/usr/bin/env python # 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 https://mozilla.org/MPL/2.0/. import os import re import subprocess import sys import BaseHTTPServer import SimpleHTTPServer i...
mpl-2.0
xxxIsaacPeralxxx/anim-studio-tools
probe/sources/probe/plugins/nose_tank_scratch.py
5
3677
# Dr. D Studios - Software Disclaimer # # Copyright 2010 Dr D Studios Pty Limited (ACN 127 184 954) (Dr. D Studios), its # affiliates and/or its licensors. # import itch.tank_scratch import nose.plugins class TankScratchNosePlugin(nose.plugins.Plugin): """ Adds Tank scratch setup and teardown capabilit...
gpl-3.0
cortedeltimo/SickRage
lib/sqlalchemy/ext/mutable.py
76
22912
# ext/mutable.py # Copyright (C) 2005-2014 the SQLAlchemy authors and contributors <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """Provide support for tracking of in-place changes to scalar values, which are propaga...
gpl-3.0
epiqc/ScaffCC
llvm/utils/benchmark/tools/gbench/util.py
70
5178
"""util.py - General utilities for running, loading, and processing benchmarks """ import json import os import tempfile import subprocess import sys # Input file type enumeration IT_Invalid = 0 IT_JSON = 1 IT_Executable = 2 _num_magic_bytes = 2 if sys.platform.startswith('win') else 4 def is_executable_file...
bsd-2-clause
duongbaoduy/gtools
third_party/boto/pyami/bootstrap.py
89
5739
# Copyright (c) 2006,2007 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, modi...
bsd-3-clause
sumyfly/nw.js
tests/automation/buff_from_string/internal/test.py
169
1430
#!/usr/bin/env python from selenium import webdriver import os import traceback import time from selenium import webdriver from platform import platform import socket from sys import argv port = 13013 if len(argv) >= 2: port = int(argv[1]) path = os.path dirname = path.abspath(path.dirname(__file__)) chromedriv...
mit
visi0nary/mt6735-kernel-3.10.61
tools/perf/scripts/python/futex-contention.py
11261
1486
# futex contention # (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com> # Licensed under the terms of the GNU GPL License version 2 # # Translation of: # # http://sourceware.org/systemtap/wiki/WSFutexContention # # to perf python scripting. # # Measures futex contention import os, sys sys.path.append(os.environ['PER...
gpl-2.0