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
mtlynch/mlab-observatory
convert_from_telescope/convert_from_telescope.py
1
7124
#!/usr/bin/env python # -*- coding: UTF-8 -*- # # Copyright 2015 Measurement Lab # # 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
aarushi12002/cassandra
pylib/cqlshlib/formatting.py
17
11961
# 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
sjsucohort6/openstack
python/venv/lib/python2.7/site-packages/openstack/block_store/v2/volume.py
3
4149
# 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...
mit
beeva-fernandocerezal/rasa_nlu
_pytest/test_featurizers.py
2
4141
from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import import os import numpy as np import pytest from rasa_nlu.tokenizers.mitie_tokenizer import MitieTokenizer from rasa_nlu.tokenizers.spacy_tokenizer import SpacyTokenizer ...
apache-2.0
naresh21/synergetics-edx-platform
common/test/acceptance/tests/studio/test_studio_help.py
3
49206
""" Test the Studio help links. """ from nose.plugins.attrib import attr from unittest import skip from common.test.acceptance.fixtures.course import XBlockFixtureDesc from common.test.acceptance.tests.studio.base_studio_test import StudioCourseTest, ContainerBase from common.test.acceptance.pages.studio.index import...
agpl-3.0
mancoast/CPythonPyc_test
cpython/265_test_pty.py
58
7437
import errno import fcntl import pty import os import sys import signal from test.test_support import verbose, TestSkipped, run_unittest import unittest TEST_STRING_1 = "I wish to buy a fish license.\n" TEST_STRING_2 = "For my pet fish, Eric.\n" if verbose: def debug(msg): print msg else: def debug(ms...
gpl-3.0
mzizzi/ansible
lib/ansible/modules/notification/flowdock.py
16
6195
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright 2013 Matt Coddington <coddington@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 ...
gpl-3.0
alsrgv/tensorflow
tensorflow/contrib/quantization/python/array_ops.py
178
1156
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
ddbeck/gittip-calculator
gittip_calculator/gittip_calculator/wsgi.py
1
1452
""" WSGI config for gittip_calculator 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_APPL...
mit
tbachman/python-group-based-policy-client
gbpclient/gbpshell.py
1
34075
# 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 # d...
apache-2.0
jchevin/MissionPlanner-master
Lib/distutils/command/bdist.py
228
5596
"""distutils.command.bdist Implements the Distutils 'bdist' command (create a built [binary] distribution).""" __revision__ = "$Id$" import os from distutils.util import get_platform from distutils.core import Command from distutils.errors import DistutilsPlatformError, DistutilsOptionError def show_formats(): ...
gpl-3.0
pyIMS/pyimzML
pyimzml/ontology/dump_obo_files.py
2
1779
# This file is not intended for general use. Its purpose is to dump the .obo files that define # the cvParam accession fields into a dependency-free format that can be bundled with pyimzml. # # It requires the additonal pip dependency obonet==0.2.6 import re from collections import defaultdict from datetime import date...
apache-2.0
lmyrefelt/CouchPotatoServer
libs/suds/xsd/__init__.py
205
3007
# This program is free software; you can redistribute it and/or modify # it under the terms of the (LGPL) GNU Lesser General Public License as # published by the Free Software Foundation; either version 3 of the # License, or (at your option) any later version. # # This program is distributed in the hope that it will ...
gpl-3.0
lintzc/gpdb
gpMgmt/bin/gppylib/operations/test_utils_helper.py
52
1452
from gppylib.operations import Operation """ These objects needed for gppylib.operations.test.test_utils are pulled out of said file for pickle/import/visibility reasons. See gppylib.operations.utils.RemoteOperation, #4. """ class TestOperation(Operation): def execute(self): return 1 class MyException(Ex...
apache-2.0
nathanaevitas/odoo
openerp/addons/website/models/ir_actions.py
363
3074
# -*- coding: utf-8 -*- import urlparse from openerp.http import request from openerp.osv import fields, osv class actions_server(osv.Model): """ Add website option in server actions. """ _name = 'ir.actions.server' _inherit = ['ir.actions.server'] def _compute_website_url(self, cr, uid, id, websit...
agpl-3.0
jayceyxc/hue
desktop/core/ext-py/boto-2.42.0/tests/integration/swf/test_layer1.py
136
10743
""" Tests for Layer1 of Simple Workflow """ import os import unittest import time from boto.swf.layer1 import Layer1 from boto.swf import exceptions as swf_exceptions # A standard AWS account is permitted a maximum of 100 of SWF domains, # registered or deprecated. Deleting deprecated domains on demand does # not...
apache-2.0
paradox41/heroprotocol
heroprotocol/protocols/protocol47479.py
21
26853
# Copyright (c) 2015 Blizzard Entertainment # # 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, publi...
mit
40223139/39g7test
static/Brython3.1.1-20150328-091302/Lib/long_int1/__init__.py
503
3858
from browser import html, document, window import javascript #memorize/cache? def _get_value(other): if isinstance(other, LongInt): return other.value return other class BigInt: def __init__(self): pass def __abs__(self): return LongInt(self.value.abs()) def __add__(self, other): ...
gpl-3.0
chatelak/RMG-Py
rmgpy/tools/canteraTest.py
7
3597
import unittest import os import numpy from rmgpy.tools.canteraModel import findIgnitionDelay, CanteraCondition, Cantera from rmgpy.quantity import Quantity import rmgpy class CanteraTest(unittest.TestCase): def testIgnitionDelay(self): """ Test that findIgnitionDelay() works. """ ...
mit
qyuz/reXChat
dateutil/easter.py
291
2633
""" Copyright (c) 2003-2007 Gustavo Niemeyer <gustavo@niemeyer.net> This module offers extensions to the standard python 2.3+ datetime module. """ __author__ = "Gustavo Niemeyer <gustavo@niemeyer.net>" __license__ = "PSF License" import datetime __all__ = ["easter", "EASTER_JULIAN", "EASTER_ORTHODOX", "EASTER_WESTE...
gpl-2.0
indradhanush/filesync-server
src/backends/db/schemas/fsync_shard/patch_11.py
6
1270
# Copyright 2008-2015 Canonical # # 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 # License, or (at your option) any later version. # # This program is distributed...
agpl-3.0
kku1993/libquic
src/third_party/protobuf/python/google/protobuf/service_reflection.py
243
11023
# Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # https://developers.google.com/protocol-buffers/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redi...
bsd-3-clause
taito/scrapy
scrapy/downloadermiddlewares/httpcompression.py
17
2605
import zlib from scrapy.utils.gz import gunzip from scrapy.http import Response, TextResponse from scrapy.responsetypes import responsetypes from scrapy.exceptions import NotConfigured ACCEPTED_ENCODINGS = [b'gzip', b'deflate'] try: import brotli ACCEPTED_ENCODINGS.append(b'br') except ImportError: pass...
bsd-3-clause
TheTimmy/spack
var/spack/repos/builtin/packages/listres/package.py
3
1832
############################################################################## # Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
Eureka22/ASM_xf
PythonD/site_python/MMTK/ForceFields/BondedInteractions.py
2
5390
# This module implements classes that represent force fields # for bonded interactions. # # Written by Konrad Hinsen # last revision: 2000-2-10 # _undocumented = 1 from ForceField import ForceField, ForceFieldData from MMTK import Utility from Scientific.Geometry import Vector import Numeric # # The base class Bonde...
gpl-2.0
bkiehl/lol
scripts/devSetup/factories.py
70
8066
__author__ = u'schmatz' import errors import configuration import mongo import node import repositoryInstaller import ruby import shutil import os import glob import subprocess def print_computer_information(os_name,address_width): print(os_name + " detected, architecture: " + str(address_width) + " bit") def constr...
mit
helpmoeny/pythoncode
Python_labs/lab09/cards.py
1
3991
import random # required for shuffle method of Deck class Card(object): ''' Suit and rank are ints, and index into suit_list and rank_list. Value is different from rank: for example face cards are equal in value (all 10) ''' # Use these lists to map the ints of suit and rank to nice words. #...
unlicense
akrherz/dep
scripts/cscap/mlra_summary.py
2
2705
"""Summarize for MLRA, somehow""" import sys from pandas.io.sql import read_sql import matplotlib matplotlib.use("agg") import matplotlib.pyplot as plt from pyiem.util import get_dbconn LABELS = { 29: "CC No-Till", 30: "CS Conv w/ Cover", 31: "CS Conv", 32: "CS Plow", 33: "CS No-Till", 34: "C...
mit
CollabQ/CollabQ
vendor/gdata/tlslite/utils/RSAKey.py
253
8575
"""Abstract class for RSA.""" from cryptomath import * class RSAKey: """This is an abstract base class for RSA keys. Particular implementations of RSA keys, such as L{OpenSSL_RSAKey.OpenSSL_RSAKey}, L{Python_RSAKey.Python_RSAKey}, and L{PyCrypto_RSAKey.PyCrypto_RSAKey}, inherit from this. ...
apache-2.0
makinacorpus/rdiff-backup
testing/connectiontest.py
4
6912
import unittest, types, tempfile, os, sys from commontest import * from rdiff_backup.connection import * from rdiff_backup import Globals, rpath, FilenameMapping class LocalConnectionTest(unittest.TestCase): """Test the dummy connection""" lc = Globals.local_connection def testGetAttrs(self): """Test getting of ...
gpl-2.0
ESOedX/edx-platform
openedx/core/djangoapps/content/block_structure/transformer.py
2
9170
""" This module provides the abstract base class for all Block Structure Transformers. """ from __future__ import absolute_import from abc import abstractmethod class BlockStructureTransformer(object): """ Abstract base class for all block structure transformers. """ # All Transformers are expected ...
agpl-3.0
talon-one/talon_one.py
test/test_loyalty_membership.py
1
2104
# coding: utf-8 """ Talon.One API The Talon.One API is used to manage applications and campaigns, as well as to integrate with your application. The operations in the _Integration API_ section are used to integrate with our platform, while the other operations are used to manage applications and campaigns. #...
mit
listingmirror/boto
boto/rds/dbsubnetgroup.py
170
2825
# Copyright (c) 2013 Franc Carter - franc.carter@gmail.com # # 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, modif...
mit
40223101/w17test
static/Brython3.1.1-20150328-091302/Lib/io.py
623
9405
import builtins open = builtins.open # for seek() SEEK_SET = 0 SEEK_CUR = 1 SEEK_END = 2 r"""File-like objects that read from or write to a string buffer. This implements (nearly) all stdio methods. f = StringIO() # ready for writing f = StringIO(buf) # ready for reading f.close() # explicitly rel...
gpl-3.0
Edraak/edraak-platform
common/lib/xmodule/xmodule/assetstore/tests/test_asset_xml.py
13
3646
""" Test for asset XML generation / parsing. """ import unittest from path import Path as path from lxml import etree from contracts import ContractNotRespected from opaque_keys.edx.locator import CourseLocator from xmodule.assetstore import AssetMetadata from xmodule.modulestore.tests.test_assetstore import AssetSto...
agpl-3.0
thjashin/tensorflow
tensorflow/contrib/session_bundle/gc_test.py
34
4560
# 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
cetic/ansible
lib/ansible/modules/network/cloudengine/ce_info_center_log.py
42
20630
#!/usr/bin/python # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distribut...
gpl-3.0
kkreis/espressopp
src/tools/lammps.py
7
16178
# Copyright (C) 2012,2013 # Max Planck Institute for Polymer Research # Copyright (C) 2008,2009,2010,2011 # Max-Planck-Institute for Polymer Research & Fraunhofer SCAI # # This file is part of ESPResSo++. # # ESPResSo++ is free software: you can redistribute it and/or modify # it under the terms of t...
gpl-3.0
atruberg/django-custom
django/template/loaders/app_directories.py
105
2354
""" Wrapper for loading templates from "templates" directories in INSTALLED_APPS packages. """ import os import sys from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.template.base import TemplateDoesNotExist from django.template.loader import BaseLoader from django.u...
bsd-3-clause
fenginx/django
tests/model_fields/models.py
12
12373
import os import tempfile import uuid from django.contrib.contenttypes.fields import ( GenericForeignKey, GenericRelation, ) from django.contrib.contenttypes.models import ContentType from django.core.files.storage import FileSystemStorage from django.db import models from django.db.models.fields.files import Imag...
bsd-3-clause
TeamOrion-Devices/kernel_htc_msm8974
Documentation/target/tcm_mod_builder.py
4981
41422
#!/usr/bin/python # The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD # # Copyright (c) 2010 Rising Tide Systems # Copyright (c) 2010 Linux-iSCSI.org # # Author: nab@kernel.org # import os, sys import subprocess as sub import string import re import optparse tcm_dir = "" fabric_ops...
gpl-2.0
Hodorable/0602
horizon/utils/functions.py
26
4693
# 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
chacoroot/planetary
addons/calendar/controllers/main.py
329
3390
import simplejson import openerp import openerp.http as http from openerp.http import request import openerp.addons.web.controllers.main as webmain import json class meeting_invitation(http.Controller): @http.route('/calendar/meeting/accept', type='http', auth="calendar") def accept(self, db, token, action, ...
agpl-3.0
evaschalde/odoo
addons/l10n_br/__init__.py
430
1403
# -*- encoding: utf-8 -*- ############################################################################### # # # Copyright (C) 2009 Renato Lima - Akretion # # ...
agpl-3.0
wfxiang08/ansible
lib/ansible/playbook/play.py
10
11982
# (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
synweap15/pyload
module/plugins/hoster/LinksnappyCom.py
12
1628
# -*- coding: utf-8 -*- import re import urlparse from module.common.json_layer import json_loads, json_dumps from module.plugins.internal.MultiHoster import MultiHoster, create_getInfo class LinksnappyCom(MultiHoster): __name__ = "LinksnappyCom" __type__ = "hoster" __version__ = "0.11" __stat...
gpl-3.0
GladeRom/android_external_chromium_org
third_party/gtk+/gtk/compose-parse.py
149
34346
#!/usr/bin/env python # -*- coding: utf-8 -*- # # compose-parse.py, version 1.3 # # multifunction script that helps manage the compose sequence table in GTK+ (gtk/gtkimcontextsimple.c) # the script produces statistics and information about the whole process, run with --help for more. # # You may need to switch your pyt...
bsd-3-clause
kamyu104/django
tests/auth_tests/models/custom_permissions.py
295
1433
""" The CustomPermissionsUser users email as the identifier, but uses the normal Django permissions model. This allows us to check that the PermissionsMixin includes everything that is needed to interact with the ModelBackend. """ from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin from django.con...
bsd-3-clause
mukgupta/django-fast-deploy
fab_deploy_tests/test_project3/test_project3/wsgi.py
1
1148
""" WSGI config for test_project3 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_APPLICAT...
bsd-3-clause
tgsd96/gargnotes
venv/lib/python2.7/site-packages/django/conf/locale/cy/formats.py
160
1822
# -*- 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' # '25 Hy...
mit
luken/SpockBot
spockbot/plugins/helpers/movement.py
2
2851
""" MovementPlugin provides a centralized plugin for controlling client movement so the client doesn't try to pull itself in a dozen directions. """ from spockbot.plugins.base import PluginBase, pl_announce from spockbot.plugins.tools.event import EVENT_UNREGISTER from spockbot.vector import Vector3 class MovementCo...
mit
aagusti/i-sipkd
setup.py
1
1775
import os import sys import subprocess from setuptools import setup, find_packages here = os.path.abspath(os.path.dirname(__file__)) README = open(os.path.join(here, 'README.txt')).read() CHANGES = open(os.path.join(here, 'CHANGES.txt')).read() requires=['pyramid>=1.5a2', 'SQLAlchemy', 'transactio...
lgpl-3.0
afandria/mojo
mojo/python/tests/bindings_constants_unittest.py
10
1458
# 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. import math import unittest # Generated files # pylint: disable=F0401 import sample_service_mojom import test_constants_mojom class ConstantBindingsTest(un...
bsd-3-clause
gptech/ansible
lib/ansible/plugins/action/nxos.py
14
6174
# # (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 d...
gpl-3.0
vatlab/SOS
test/check_zombie.py
2
1533
import sys import subprocess import psutil def run_process(args): proc_before = subprocess.check_output( 'ps aux | grep -v root', shell=True).decode().splitlines() # run the main process ret = subprocess.Popen(args) ret.wait() proc_after = subprocess.check_output( 'ps aux | grep ...
gpl-3.0
LiXizhi/NPLRuntime
Client/trunk/externals/bullet3/Extras/Serialize/HeaderGenerator/blenderGenerate.py
49
2903
import dump header = """/* Copyright (C) 2006 Charlie C * * This software is provided 'as-is', without any express or implied * warranty. In no event will the authors be held liable for any damages * arising from the use of this software. * * Permission is granted to anyone to use this software for any purpose, * in...
gpl-2.0
liqi328/rjrepaircompany
djangotoolbox/db/base.py
46
3591
import datetime from django.db.backends import BaseDatabaseFeatures, BaseDatabaseOperations, \ BaseDatabaseWrapper, BaseDatabaseClient, BaseDatabaseValidation, \ BaseDatabaseIntrospection from .creation import NonrelDatabaseCreation class NonrelDatabaseFeatures(BaseDatabaseFeatures): can_return_id_from_in...
bsd-3-clause
wuga214/Django-Wuga
env/lib/python2.7/site-packages/django/template/loaders/cached.py
120
7116
""" Wrapper class that takes a list of template loaders as an argument and attempts to load templates from them in order, caching the result. """ import hashlib import warnings from django.template import Origin, Template, TemplateDoesNotExist from django.template.backends.django import copy_exception from django.uti...
apache-2.0
niwtr/map-walker
src/server/transmitter.py
1
15362
#! /usr/bin/python # -*- coding: utf-8 -*- ''' Current version : 0.4 2016-5-25 by Heranort ''' import threading #for thread creation import socket #socket offical module import time #time official module import o...
mit
glob3mobile/qgis-g3m
QGIS-Plugin/webappbuilder/ext-libs/httplib2-0.8-py2.7.egg/httplib2/__init__.py
246
69621
from __future__ import generators """ httplib2 A caching http interface that supports ETags and gzip to conserve bandwidth. Requires Python 2.3 or later Changelog: 2007-08-18, Rick: Modified so it's able to use a socks proxy if needed. """ __author__ = "Joe Gregorio (joe@bitworking.org)" __copyright__ = "Copyright...
epl-1.0
wong2/sentry
src/sentry/migrations/0038_auto__add_searchtoken__add_unique_searchtoken_document_field_token__ad.py
36
17201
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'SearchToken' db.create_table('sentry_searchtoken', ( ('id', self.gf('sentry.db.models....
bsd-3-clause
morinim/vita
src/examples/sr/csv2xrff.py
1
3344
#!/usr/bin/env python3 # # Copyright (C) 2011 EOS di Manlio Morini. # # 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 argparse import csv import os from xm...
mpl-2.0
toshywoshy/ansible
lib/ansible/modules/system/aix_inittab.py
43
7431
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2017, Joris Weijters <joris.weijters@gmail.com> # 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_v...
gpl-3.0
hiidef/oauth2app
tests/testsite/apps/api/tests/json.py
4
1225
#-*- coding: utf-8 -*- try: import simplejson as json except ImportError: import json from .base import * class JSONTestCase(BaseTestCase): def test_00_email(self): client = DjangoTestClient() token = self.get_token() # Sufficient scope. response = client.get( "/api/em...
mit
ademuk/django-oscar
sites/demo/apps/offers.py
33
1268
from oscar.apps.offer import models class AlphabetRange(object): name = "Products that start with D" def contains_product(self, product): return product.title.startswith('D') def num_products(self): return None class BasketOwnerCalledBarry(models.Condition): name = "User must be ca...
bsd-3-clause
mdublin/Brightcove-Dynamic-Ingest-App
ENV/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/dom.py
920
8469
from __future__ import absolute_import, division, unicode_literals from xml.dom import minidom, Node import weakref from . import _base from .. import constants from ..constants import namespaces from ..utils import moduleFactoryFactory def getDomBuilder(DomImplementation): Dom = DomImplementation class A...
mit
drufat/vispy
examples/demo/gloo/galaxy/galaxy_simulation.py
18
7753
# -*- coding: utf-8 -*- # vispy: testskip # ----------------------------------------------------------------------------- # A Galaxy Simulator based on the density wave theory # (c) 2012 Ingo Berg # # Simulating a Galaxy with the density wave theory # http://beltoforion.de/galaxy/galaxy_en.html # # Python version...
bsd-3-clause
smistad/FAST
source/FAST/Examples/Python/extract_surface_mesh.py
1
1229
## @example extract_surface_mesh.py # This examples extract a surface mesh with over 3 million triangles from a CT volume # using the Marching Cubes algorithm. # It also shows how you can access the vertex and triangle data directly. import fast importer = fast.ImageFileImporter.New() importer.setFilename(fast.Config....
bsd-2-clause
shermanng10/superathletebuilder
env/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/packages/six.py
2375
11628
"""Utilities for writing code that runs on Python 2 and 3""" #Copyright (c) 2010-2011 Benjamin Peterson #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 l...
mit
DrDos0016/z2
museum_site/ajax.py
1
3215
from django.http import HttpResponse from .models import * from .common import * import zipfile import binascii import base64 import os def get_zip_file(request): letter = request.GET.get("letter") zip = request.GET.get("zip") filename = request.GET.get("filename", "") format = request.GET.get("form...
mit
becm/meson
mesonbuild/templates/cpptemplates.py
1
5439
# Copyright 2019 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 agreed to ...
apache-2.0
kdwink/intellij-community
python/lib/Lib/site-packages/django/contrib/databrowse/plugins/fieldchoices.py
252
3856
from django import http from django.db import models from django.contrib.databrowse.datastructures import EasyModel from django.contrib.databrowse.sites import DatabrowsePlugin from django.shortcuts import render_to_response from django.utils.text import capfirst from django.utils.encoding import smart_str, force_unico...
apache-2.0
thanatos/lets-encrypt-preview
letsencrypt/plugins/webroot.py
1
6187
"""Webroot plugin.""" import errno import logging import os from collections import defaultdict import zope.interface import six from acme import challenges from letsencrypt import errors from letsencrypt import interfaces from letsencrypt.plugins import common logger = logging.getLogger(__name__) @zope.interfac...
apache-2.0
laslabs/odoo
addons/account_check_printing/account_journal_dashboard.py
45
1200
# -*- coding: utf-8 -*- from openerp import models, api, _ class account_journal(models.Model): _inherit = "account.journal" @api.multi def get_journal_dashboard_datas(self): domain_checks_to_print = [ ('journal_id', '=', self.id), ('payment_method_id.code', '=', 'check_pr...
agpl-3.0
zouyapeng/horizon
openstack_dashboard/dashboards/admin/volumes/volume_types/forms.py
7
5903
# 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 # d...
apache-2.0
TNick/pylearn2
pylearn2/models/dbm/__init__.py
43
9023
""" This module contains functionality related to deep Boltzmann machines. They are implemented generically in order to make it easy to support convolution versions, etc. This code was moved piece by piece incrementally over time from Ian's private research repository, and it is altogether possible that he broke somet...
bsd-3-clause
DragonDevs/android_kernel_zte_msm8226
tools/perf/scripts/python/syscall-counts.py
11181
1522
# system call counts # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide system call totals, broken down by syscall. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os import sys sys.path.append(os.envir...
gpl-2.0
wsmith323/django
django/contrib/gis/gdal/error.py
535
1996
""" This module houses the GDAL & SRS Exception objects, and the check_err() routine which checks the status code returned by GDAL/OGR methods. """ # #### GDAL & SRS Exceptions #### class GDALException(Exception): pass # Legacy name OGRException = GDALException class SRSException(Exception): pass cla...
bsd-3-clause
archyufa/CloudFerry
tests/cloudferrylib/os/storage/test_cinder_storage.py
2
10299
# Copyright 2014: Mirantis 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 b...
apache-2.0
kubeflow/pipelines
sdk/python/kfp/v2/compiler_cli_tests/test_data/pipeline_with_after.py
1
1319
# Copyright 2020 The Kubeflow 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
apache-2.0
cyc805/FR_Comparison_LRD
src/antenna/bindings/modulegen__gcc_LP64.py
14
89068
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers import pybindgen.settings import warnings class ErrorHandler(pybindgen.settings.ErrorHandler): def handle_error(self, wrapper, exception, traceback_): warnings.warn("exception %r in wrapper %s" % (exception, wrapper)) ...
gpl-2.0
sanja7s/SR_Twitter
src_taxonomy/bubble_tree_map.py
1
3686
#!/usr/bin/env python # -*- coding: UTF-8 -*- import random from ete2 import Tree, TreeStyle, NodeStyle, faces, AttrFace, CircleFace, TextFace def layout(node): if not node.is_root(): # Add node name to laef nodes #N = AttrFace("name", fsize=14, fgcolor="black") #faces.add_face_to_node(N, node, 0) #pass fa...
mit
nmndeep/Multi_lingual-tools
dmrs_chk.py
1
5743
import os import re def ff(): path='path_to_ace/ace-0.9.24/output' srr=r'_human_dmrs.txt' ans_fil=[] #get user input for checking in regex. print("1- check for lemma relations\n2-check for gpred-x\n3-check for gpred-e\n4-check for realpred-x\n5-check for realpred-e") que=eval(raw_input()) # for...
mit
DPaaS-Raksha/horizon
openstack_dashboard/dashboards/admin/info/tables.py
9
2161
import logging from django.utils.translation import ugettext_lazy as _ from horizon import tables LOG = logging.getLogger(__name__) class QuotaFilterAction(tables.FilterAction): def filter(self, table, tenants, filter_string): q = filter_string.lower() def comp(tenant): if q in te...
apache-2.0
cg31/tensorflow
tensorflow/contrib/tensor_forest/python/constants.py
30
1062
# 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
dpeters19/webassign2
science_utils.py
1
2996
import re def is_hyper_scientific(number): """ Determines if an answer is hyper-scientific Args: number (String) Returns: bool: True if is hyper-scientific, False otherwise Example: >>> is_hyper_scientific("1.00e2") True >>> is_hyper_scientific...
mit
grlee77/nipype
examples/fmri_spm.py
9
16091
#!/usr/bin/env python # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: """ ============== fMRI: SPM, FSL ============== The fmri_spm.py integrates several interfaces to perform a first and second level analysis on a two-subject data set. The tutorial ca...
bsd-3-clause
hgl888/chromium-crosswalk-efl
ppapi/generators/idl_diff.py
180
9073
#!/usr/bin/env 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. import glob import os import subprocess import sys from idl_option import GetOption, Option, ParseOptions from idl_outfile import ...
bsd-3-clause
gamesbrewer/kegger
kegger/myapp/libs/pyramid/tests/test_integration.py
2
27516
# -*- coding: utf-8 -*- import datetime import locale import os import unittest from pyramid.wsgi import wsgiapp from pyramid.view import view_config from pyramid.static import static_view from pyramid.compat import ( text_, url_quote, ) from zope.interface import Interface # 5 years from now (more or l...
cc0-1.0
rtucker-mozilla/WhistlePig
whistlepig/ical/ical_entries_feed.py
1
2217
import datetime import django_cal from django_cal.views import Events import dateutil.rrule as rrule import whistlepig.whistlepig.models as models from django.conf import settings import pytz class iCalEntriesFeed(Events): def items(self): return models.StatusUpdate.objects.filter(is_private = False).all(...
bsd-3-clause
josecolella/PLD
bin/osx/treasurehunters.app/Contents/Resources/lib/python3.4/numpy/core/tests/test_memmap.py
65
4208
from __future__ import division, absolute_import, print_function import sys from tempfile import NamedTemporaryFile, TemporaryFile, mktemp, mkdtemp import os import shutil from numpy import memmap from numpy import arange, allclose, asarray from numpy.testing import * class TestMemmap(TestCase): def setUp(self):...
mit
andela-angene/coursebuilder-core
coursebuilder/modules/manual_progress/manual_progress.py
3
10308
# 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 ...
apache-2.0
xujun10110/twittor
implant.py
18
5478
from tweepy import Stream from tweepy import OAuthHandler from tweepy import API from tweepy.streaming import StreamListener from uuid import getnode as get_mac import ctypes import json import threading import subprocess import base64 import platform api = None # These values are appropriately filled in the code CO...
mit
google/rekall
tools/layout_expert/layout_expert/parsers/c_parser.py
1
18196
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2016 Google Inc. All Rights Reserved. # # Authors: # Arkadiusz Socała <as277575@mimuw.edu.pl> # Michael Cohen <scudette@google.com> # # Licensed under the Apache License, Version 2.0 (the "License"); you may not # use this file except in compliance with the...
gpl-2.0
elysium001/zamboni
mkt/comm/forms.py
1
2741
from django import forms from django.conf import settings from django.forms import ValidationError import happyforms from jinja2.filters import do_filesizeformat from tower import ugettext as _, ugettext_lazy as _lazy from mkt.api.forms import SluggableModelChoiceField from mkt.comm.models import CommunicationThread ...
bsd-3-clause
edisonlz/fruit
web_project/base/site-packages/django/contrib/gis/utils/wkt.py
219
1880
""" Utilities for manipulating Geometry WKT. """ from django.utils import six def precision_wkt(geom, prec): """ Returns WKT text of the geometry according to the given precision (an integer or a string). If the precision is an integer, then the decimal places of coordinates WKT will be truncated to...
apache-2.0
KyoungRan/Django_React_ex
Django_React_Workshop-mbrochh/django/myvenv/lib/python3.4/site-packages/django/views/decorators/csrf.py
586
2202
from functools import wraps from django.middleware.csrf import CsrfViewMiddleware, get_token from django.utils.decorators import available_attrs, decorator_from_middleware csrf_protect = decorator_from_middleware(CsrfViewMiddleware) csrf_protect.__name__ = "csrf_protect" csrf_protect.__doc__ = """ This decorator adds...
mit
ashhher3/invenio
modules/webjournal/lib/elements/bfe_webjournal_rss.py
25
5765
# -*- coding: utf-8 -*- ## $Id: bfe_webjournal_widget_whatsNew.py,v 1.24 2009/01/27 07:25:12 jerome Exp $ ## ## This file is part of Invenio. ## Copyright (C) 2009, 2010, 2011 CERN. ## ## Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## publis...
gpl-2.0
dltn/tortellini
server-firmware/Processing/DataPusher/requests/compat.py
101
2600
# -*- coding: utf-8 -*- """ pythoncompat """ from .packages import chardet import sys # ------- # Pythons # ------- # Syntax sugar. _ver = sys.version_info #: Python 2.x? is_py2 = (_ver[0] == 2) #: Python 3.x? is_py3 = (_ver[0] == 3) #: Python 3.0.x is_py30 = (is_py3 and _ver[1] == 0) #: Python 3.1.x is_py31 =...
mit
Mickey32111/pogom
pogom/pgoapi/protos/POGOProtos/Settings/Master/Item/EggIncubatorAttributes_pb2.py
16
3599
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: POGOProtos/Settings/Master/Item/EggIncubatorAttributes.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message f...
mit