repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
cginternals/cmake-init
refs/heads/master
source/tests/googletest/googlemock/test/gmock_test_utils.py
88
# Copyright 2006, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
SANDEISON/Python
refs/heads/master
04 - Funções e Arquivos À Solta/03 - Agrupando códigos em Módulos/02 - embaralha_nome.py
2
def embaralha (x): import random lista = list(x) random.shuffle(lista) return ''.join(lista) nome = input ("Digite algum nome : ") print (embaralha(nome))
supersven/intellij-community
refs/heads/master
python/testData/quickFixes/AddCallSuperQuickFixTest/oldStyle_after.py
80
class A(): def __init__(self): a = 1 class C(A): def __init__(self): A.__init__(self) def foo(self): pass
uberamd/NGECore2
refs/heads/master
scripts/object/installation/mining_organic/mining_organic_flora_farm_heavy.py
85615
import sys def setup(core, object): return
agry/NGECore2
refs/heads/master
scripts/object/tangible/tcg/series7/garage_display_vehicles/walker_at_rt_reg.py
85615
import sys def setup(core, object): return
RuudBurger/CouchPotatoServer
refs/heads/master
libs/httplib2/iri2uri.py
706
""" iri2uri Converts an IRI to a URI. """ __author__ = "Joe Gregorio (joe@bitworking.org)" __copyright__ = "Copyright 2006, Joe Gregorio" __contributors__ = [] __version__ = "1.0.0" __license__ = "MIT" __history__ = """ """ import urlparse # Convert an IRI to a URI following the rules in RFC 3987 # # The character...
kawasaki2013/python-for-android-x86
refs/heads/master
python-modules/twisted/twisted/words/protocols/__init__.py
93
"Chat protocols"
ampax/edx-platform
refs/heads/master
lms/djangoapps/course_api/blocks/transformers/tests/test_block_depth.py
35
""" Tests for BlockDepthTransformer. """ # pylint: disable=protected-access import ddt from unittest import TestCase from openedx.core.lib.block_structure.tests.helpers import ChildrenMapTestMixin from openedx.core.lib.block_structure.block_structure import BlockStructureModulestoreData from ..block_depth import Blo...
singhj/locality-sensitive-hashing
refs/heads/master
mapreduce/api/map_job/__init__.py
4
#!/usr/bin/env python """Map job package.""" # All the public API should be imported here. # 1. Seasoned Python user should simply import this package. # 2. Other users may import individual files so filenames should still have # "map_job" prefix. But adding the prefix won't mandate the first type # of user to t...
jakebailey/PrairieLearn
refs/heads/master
tools/external-grading-load-test/fib.py
6
def fib(n): return n
bruceyou/NewsBlur
refs/heads/master
vendor/reverend/ui/util.py
25
# This module is part of the Divmod project and is Copyright 2003 Amir Bakhtiar: # amir@divmod.org. This is free software; you can redistribute it and/or # modify it under the terms of version 2.1 of the GNU Lesser General Public # License as published by the Free Software Foundation. # from Tkinter import * ...
sametmax/Django--an-app-at-a-time
refs/heads/master
ignore_this_directory/django/db/backends/mysql/operations.py
5
import uuid from django.conf import settings from django.db.backends.base.operations import BaseDatabaseOperations from django.utils import timezone from django.utils.duration import duration_microseconds class DatabaseOperations(BaseDatabaseOperations): compiler_module = "django.db.backends.mysql.compiler" ...
algiopensource/knowledge
refs/heads/8.0
document_reindex/models/ir_attachment.py
9
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # This module copyright (C) 2015 Therp BV (<http://therp.nl>). # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
kosugi/plurk4ji
refs/heads/master
api.py
1
# -*- coding: utf-8 -*- from json import loads from oauth2 import Token, Consumer, Client from urllib import urlencode import logging import traceback class Api(object): BASE = 'https://www.plurk.com/APP' def __init__(self, config): self.consumer = Consumer(config['consumer_key'], config['consumer_s...
owais/Fogger
refs/heads/master
fogger_lib/__init__.py
3
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- ### BEGIN LICENSE # Copyright (C) 2012 Owais Lone <hello@owaislone.org> # 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 ...
maddox/home-assistant
refs/heads/dev
homeassistant/components/notify/nma.py
9
""" homeassistant.components.notify.nma ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ NMA (Notify My Android) notification service. Configuration: To use the NMA notifier you will need to add something like the following to your configuration.yaml file. notify: platform: nma api_key: YOUR_API_KEY Variables: api_key *Req...
citrix-openstack-build/neutron-fwaas
refs/heads/master
doc/source/conf.py
2
# -*- coding: utf-8 -*- # Copyright (c) 2010 OpenStack Foundation. # # 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 app...
lbdreyer/iris
refs/heads/pin_cfunits
lib/iris/tests/unit/plot/test_scatter.py
5
# Copyright Iris contributors # # This file is part of Iris and is released under the LGPL license. # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """Unit tests for the `iris.plot.scatter` function.""" # Import iris.tests first so that some things can be initialised before...
alshedivat/tensorflow
refs/heads/master
tensorflow/contrib/learn/python/learn/preprocessing/tests/__init__.py
193
# 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...
devops2014/djangosite
refs/heads/master
django/conf/locale/ga/formats.py
619
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j F Y' TIME_FORMAT = 'H:i' # DATE...
bdoner/SickRage
refs/heads/master
sickbeard/autoPostProcesser.py
10
# Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/sickbeard/ # # This file is part of SickRage. # # SickRage 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,...
Juniper/contrail-dev-controller
refs/heads/master
src/config/common/network.py
19
# # Copyright (c) 2013 Juniper Networks, Inc. All rights reserved. # from quantumclient.quantum import client from quantumclient.client import HTTPClient from quantumclient.common import exceptions class CommonQuantumClient(object): def __init__(self, project, user, passwd, api_server_ip): AUTH_URL = 'ht...
prodromou87/gem5
refs/heads/master
configs/topologies/Mesh.py
47
# Copyright (c) 2010 Advanced Micro Devices, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: redistributions of source code must retain the above copyright # notice, this list of conditions...
sumedhasingla/VTK
refs/heads/master
ThirdParty/Twisted/twisted/internet/test/test_fdset.py
46
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for implementations of L{IReactorFDSet}. """ __metaclass__ = type import os, socket, traceback from zope.interface import implementer from twisted.python.runtime import platform from twisted.trial.unittest import SkipTest from twiste...
Azure/azure-sdk-for-python
refs/heads/sync-eng/common-js-nightly-docs-2-1768-ForTestPipeline
sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/aio/_configuration.py
1
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
tagliateller/openshift-ansible
refs/heads/master
roles/lib_openshift/src/test/unit/test_oc_secret.py
62
''' Unit tests for oc secret ''' import os import six import sys import unittest import mock # Removing invalid variable names for tests so that I can # keep them brief # pylint: disable=invalid-name,no-name-in-module # Disable import-error b/c our libraries aren't loaded in jenkins # pylint: disable=import-error,wr...
git-cola/git-cola
refs/heads/main
cola/widgets/toolbar.py
3
from __future__ import division, absolute_import, unicode_literals from functools import partial from qtpy import QtGui from qtpy.QtCore import Qt from qtpy import QtWidgets from ..i18n import N_ from ..widgets import standard from ..qtutils import get from .. import icons from .. import qtutils from .toolbarcmds imp...
godoppl/project
refs/heads/master
shellcode/x86/latin_1/mixedcase/getpc/call/__init__.py
7
import ALPHA3 LOCAL_PATH = __path__[0] def encodeShellcode(seh_getpc, shellcode): call_getpc = ALPHA3.io.ReadFile("ECX+2.bin", LOCAL_PATH) return call_getpc + ALPHA3.x86.ascii.mixedcase.rm32.encodeShellcode("ECX+2", shellcode) encoders = [{ "base address": "^(call)$", "base address samples": ["...
ultrasystem/kernel
refs/heads/rt-patch
tools/perf/scripts/python/syscall-counts.py
11181
# 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...
tylercal/dragonfly
refs/heads/master
dragonfly/grammar/recobs.py
1
# # This file is part of Dragonfly. # (c) Copyright 2007, 2008 by Christo Butcher # Licensed under the LGPL. # # Dragonfly is free software: you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published # by the Free Software Foundation, either version 3 of th...
ehsanfar/ofspy_v2
refs/heads/master
ofspy/groundStation.py
1
""" Copyright 2015 Paul T. Grogan, Massachusetts Institute of Technology 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 applicabl...
Distrotech/qtwebkit
refs/heads/distrotech-qtwebkit
Tools/Scripts/webkitpy/common/system/fileset.py
161
# Copyright (C) 2010 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: # # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and th...
hbrunn/OCB
refs/heads/8.0
addons/pad/pad.py
179
# -*- coding: utf-8 -*- from openerp.osv import fields, osv import random import re import string import urllib2 import logging from openerp import SUPERUSER_ID from openerp.tools.translate import _ from openerp.tools import html2plaintext from py_etherpad import EtherpadLiteClient _logger = logging.getLogger(__name__...
WhireCrow/openwrt-mt7620
refs/heads/master
staging_dir/host/lib/python2.7/test/test_descr.py
16
import __builtin__ import sys import types import unittest from copy import deepcopy from test import test_support class OperatorsTest(unittest.TestCase): def __init__(self, *args, **kwargs): unittest.TestCase.__init__(self, *args, **kwargs) self.binops = { 'add': '+', 's...
BryceARich/TransactionsMR
refs/heads/master
python/demo/pbr/hooks/commands.py
12
# Copyright 2013 Hewlett-Packard Development Company, L.P. # 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 # # Unles...
thekondor/p4-identify
refs/heads/master
test_identify.py
1
### The MIT License (MIT) ### ### Copyright (c) 2014 (c) Andrew Sichevoi, http://thekondor.net ### ### 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...
cpaulik/pyscaffold
refs/heads/master
src/pyscaffold/contrib/setuptools_scm/integration.py
1
import os from .version import _warn_if_setuptools_outdated from .utils import do from .discover import iter_matching_entrypoints from . import get_version def version_keyword(dist, keyword, value): _warn_if_setuptools_outdated() if not value: return if value is True: value = {} if ge...
goha2/labs_2016
refs/heads/master
past/sem 3/3.py
1
__author__ = 'student' import turtle turtle.shape('turtle') turtle.forward(50) turtle.left(90) turtle.forward(50) turtle.left(90) turtle.forward(50) turtle.left(90) turtle.forward(50) turtle.left(90) turtle.forward(50)
wjohnston888/pynet_test-
refs/heads/master
E-LAN/juniper.py
1
#!/usr/bin/env python ''' This is a script configures and MEF service on MRV devices. 1. The Configuration Service CLI is generated based on parameters provided. 2. The Configuration change is saved and then pushed to the device. INPUT FILES mrv_files.yml OUTPUT FILES mrv_service_SERVICE-NAME-Date.cfg ''' fro...
jeffque/exam_maker
refs/heads/master
repo/quest_viewer/migrations/0011_auto_20141102_2026.py
1
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('quest_viewer', '0010_auto_20141030_0259'), ] operations = [ migrations.AlterUniqueTogether( name='source', ...
team23/django_imagequery
refs/heads/master
imagequery/views.py
1
from django.http import HttpResponseRedirect, Http404 from django.core.exceptions import ImproperlyConfigured def generate_lazy(request, pk): try: from imagequery.models import LazyFormat except ImportError: raise ImproperlyConfigured('You have to set "IMAGEQUERY_ALLOW_LAZY_FORMAT = True" in o...
tjsavage/sfcsdatabase
refs/heads/master
sfcs/django/contrib/gis/db/backends/util.py
377
""" A collection of utility routines and classes used by the spatial backends. """ def gqn(val): """ The geographic quote name function; used for quoting tables and geometries (they use single rather than the double quotes of the backend quotename function). """ if isinstance(val, basestring): ...
fjbatresv/odoo
refs/heads/8.0
openerp/service/security.py
126
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the...
slovenwd/0install
refs/heads/master
zeroinstall/0launch-gui/mainwindow.py
4
# Copyright (C) 2009, Thomas Leonard # See the README file for details, or visit http://0install.net. import gtk import sys from logging import info, warn from zeroinstall import _, translation from zeroinstall import SafeException from zeroinstall.support import tasks, pretty_size from zeroinstall.injector import do...
MattCrystal/tripping-hipster
refs/heads/master
tools/perf/scripts/python/check-perf-trace.py
11214
# perf script event handlers, generated by perf script -g python # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # This script tests basic functionality such as flag and symbol # strings, common_xxx() calls back into perf, begin, end, unhandled # events, etc. ...
sixam/dw6824
refs/heads/master
src/rpc/clerk.py
1
import xmlrpclib from threading import Thread from rpc.common import PeerState import time from utils.utils import Utils from ui.stroke import Stroke import copy from utils.log import Log import socket class Clerk: """ Clerk for the UI thread, handles the emission of RPC calls""" def __init__(self,state): ...
uberamd/NGECore2
refs/heads/master
scripts/object/tangible/loot/creature_loot/collections/sm_oval_tile_generic.py
85615
import sys def setup(core, object): return
agry/NGECore2
refs/heads/master
scripts/object/tangible/hair/human/base/hair_human_male_base.py
85615
import sys def setup(core, object): return
agry/NGECore2
refs/heads/master
scripts/object/building/restuss/restuss_bank.py
85615
import sys def setup(core, object): return
mahak/cinder
refs/heads/master
cinder/volume/drivers/synology/synology_iscsi.py
2
# Copyright (c) 2016 Synology 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 ...
jaidevd/scikit-learn
refs/heads/master
sklearn/learning_curve.py
35
"""Utilities to evaluate models with respect to a variable """ # Author: Alexander Fabisch <afabisch@informatik.uni-bremen.de> # # License: BSD 3 clause import warnings import numpy as np from .base import is_classifier, clone from .cross_validation import check_cv from .externals.joblib import Parallel, delayed fro...
robertdolca/linux
refs/heads/master
scripts/analyze_suspend.py
1540
#!/usr/bin/python # # Tool for analyzing suspend/resume timing # Copyright (c) 2013, Intel Corporation. # # This program is free software; you can redistribute it and/or modify it # under the terms and conditions of the GNU General Public License, # version 2, as published by the Free Software Foundation. # # This prog...
rsethur/ThinkStats2
refs/heads/master
book/mylocals.py
69
""" export PYTHONPATH=/home/downey/thinkstats/trunk make plastex """ from plasTeX import Command, Environment class exercise(Environment): pass print '******************************************************'
diegocortassa/TACTIC
refs/heads/master
src/tactic/ui/sync/sync_utils.py
1
############################################################ # # Copyright (c) 2011, Southpaw Technology # All Rights Reserved # # PROPRIETARY INFORMATION. This software is proprietary to # Southpaw Technology, and is not to be reproduced, transmitted, # or disclosed in any way witho...
2014c2g1/c2g1
refs/heads/master
exts/wsgi/static/Brython2.1.0-20140419-113919/Lib/unittest/test/test_runner.py
785
import io import os import sys import pickle import subprocess import unittest from .support import LoggingResult, ResultWithNoStartTestRunStopTestRun class TestCleanUp(unittest.TestCase): def testCleanUp(self): class TestableTest(unittest.TestCase): def testNothing(self): p...
vrieni/orange
refs/heads/master
Orange/testing/unit/tests/test_refactoring.py
6
""" Tests for orange2to25 fixers. """ try: import unittest2 as unittest except: import unittest from Orange.fixes import fix_changed_names from Orange.fixes import fix_orange_imports NAME_MAPPING = fix_changed_names.MAPPING IMPORT_MAPPING = fix_orange_imports.MAPPING def q_name_split(name): """ Split th...
meghana1995/sympy
refs/heads/master
sympy/functions/special/polynomials.py
3
""" This module mainly implements special orthogonal polynomials. See also functions.combinatorial.numbers which contains some combinatorial polynomials. """ from __future__ import print_function, division from sympy.core.singleton import S from sympy.core import Rational from sympy.core.function import Function, A...
karanjeets/CSCI-544
refs/heads/master
Experimental/svm/tweet_svm_es.py
1
# -*- coding: utf-8 -*- import nltk import csv import random import codecs import re from nltk.corpus import stopwords import sys from sklearn.feature_extraction.text import CountVectorizer from sklearn.feature_extraction.text import TfidfTransformer from sklearn.pipeline import Pipeline from sklearn.linear_model impo...
Addepar/buck
refs/heads/master
tools/release/platforms/chocolatey.py
4
# 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 ...
ytec/instaforex-web
refs/heads/master
app/open/migrations/0001_initial.py
1
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('cms', '0016_auto_20160608_1535'), ] operations = [ migrations.CreateModel( name='form', fields=[ ...
weolar/miniblink49
refs/heads/master
v8_7_5/tools/release/PRESUBMIT.py
12
# Copyright 2017 the V8 project authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. def CheckChangeOnCommit(input_api, output_api): tests = input_api.canned_checks.GetUnitTestsInDirectory( input_api, output_api, '.', whitelist=['te...
johannakate/twilio-python
refs/heads/master
twilio/rest/resources/sip/credential_lists.py
51
from .. import InstanceResource, ListResource class Credential(InstanceResource): """ A username/password entry in a CredentialList. .. attribute:: sid A 34 character string that uniquely identifies this resource. .. attribute:: account_sid The unique id of the Account responsible for ...
arthuralvim/django-gevsckio-example
refs/heads/master
echoesrv/sockets.py
1
from socketio.namespace import BaseNamespace from socketio.sdjango import namespace @namespace('/echo') class EchoNamespace(BaseNamespace): def on_msg(self, msg): pkt = dict(type='event', name='msg', args='Someone said: {0}'.format(msg), endpoint=se...
iivic/BoiseStateX
refs/heads/master
common/djangoapps/third_party_auth/settings.py
76
"""Settings for the third-party auth module. The flow for settings registration is: The base settings file contains a boolean, ENABLE_THIRD_PARTY_AUTH, indicating whether this module is enabled. startup.py probes the ENABLE_THIRD_PARTY_AUTH. If true, it: a) loads this module. b) calls apply_settings(), passi...
JeyZeta/Dangerous
refs/heads/master
Dangerous/sqlmap/plugins/generic/filesystem.py
9
#!/usr/bin/env python """ Copyright (c) 2006-2015 sqlmap developers (http://sqlmap.org/) See the file 'doc/COPYING' for copying permission """ import os import sys from lib.core.agent import agent from lib.core.common import dataToOutFile from lib.core.common import Backend from lib.core.common import checkFile from...
Opshun/API
refs/heads/master
venv/lib/python2.7/site-packages/setuptools/lib2to3_ex.py
907
""" Customized Mixin2to3 support: - adds support for converting doctests This module raises an ImportError on Python 2. """ from distutils.util import Mixin2to3 as _Mixin2to3 from distutils import log from lib2to3.refactor import RefactoringTool, get_fixers_from_package import setuptools class DistutilsRefactorin...
henrykironde/scikit-learn
refs/heads/master
examples/semi_supervised/plot_label_propagation_versus_svm_iris.py
286
""" ===================================================================== Decision boundary of label propagation versus SVM on the Iris dataset ===================================================================== Comparison for decision boundary generated on iris dataset between Label Propagation and SVM. This demon...
dvliman/jaikuengine
refs/heads/master
.google_appengine/lib/django-1.5/tests/regressiontests/max_lengths/tests.py
149
from __future__ import absolute_import from django.utils import unittest from .models import PersonWithDefaultMaxLengths, PersonWithCustomMaxLengths class MaxLengthArgumentsTests(unittest.TestCase): def verify_max_length(self, model,field,length): self.assertEqual(model._meta.get_field(field).max_lengt...
CentOS-PaaS-SIG/linch-pin
refs/heads/develop
linchpin/provision/roles/azure/library/dummy.py
6
#!/usr/bin/python # -*- coding: utf-8 -*- # # Author: Clint Savage- @herlo <herlo@redhat.com> # # Provision a dummy server. Useful for testing the linchpin api provisioner # without using actual resources. from __future__ import absolute_import import os import re import tempfile from ansible.module_utils.basic impor...
humberto-garza/SparkFunEdisonADC
refs/heads/master
Python/Spark_ADC.py
1
# Copyright (c) 2015, Intel Corporation # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright notice, # this list of conditions and the following disclaimer...
redebian/documentation
refs/heads/master
django/contrib/gis/tests/relatedapp/tests.py
127
from django.test import TestCase from django.contrib.gis.geos import GEOSGeometry, Point, MultiPoint from django.contrib.gis.db.models import Collect, Count, Extent, F, Union from django.contrib.gis.geometry.backend import Geometry from django.contrib.gis.tests.utils import mysql, oracle, no_mysql, no_oracle, no_spati...
andrewsmedina/django
refs/heads/master
django/conf/app_template/views.py
6445
from django.shortcuts import render # Create your views here.
sanabby/kubernetes
refs/heads/master
cluster/juju/charms/trusty/kubernetes/unit_tests/lib/test_registrator.py
96
#!/usr/bin/env python # Copyright 2015 The Kubernetes 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 # # Unle...
agry/NGECore2
refs/heads/master
scripts/object/tangible/lair/huf_dun_hill/lair_huf_dun_hill.py
85615
import sys def setup(core, object): return
sharifmamun/ansible
refs/heads/devel
lib/ansible/plugins/shell/sh.py
20
# (c) 2014, Chris Church <chris@ninemoreminutes.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 lat...
balloob/home-assistant
refs/heads/dev
homeassistant/components/fibaro/lock.py
14
"""Support for Fibaro locks.""" from homeassistant.components.lock import DOMAIN, LockEntity from . import FIBARO_DEVICES, FibaroDevice def setup_platform(hass, config, add_entities, discovery_info=None): """Set up the Fibaro locks.""" if discovery_info is None: return add_entities( [Fib...
overtherain/scriptfile
refs/heads/master
software/googleAppEngine/lib/django_1_2/django/utils/itercompat.py
294
""" Providing iterator functions that are not in all version of Python we support. Where possible, we try to use the system-native version and only fall back to these implementations if necessary. """ import itertools # Fallback for Python 2.4, Python 2.5 def product(*args, **kwds): """ Taken from http://docs...
markberger/stanford-powwow-2016
refs/heads/master
fabfile.py
2
from fabric.api import local from fabric.api import put from fabric.api import task from fabric.api import execute from flask_frozen import Freezer from main import app HOST = "cardinal.stanford.edu" @task def freeze(): print("Building static version of app...") freezer = Freezer(app) freezer.freeze() print("Free...
SoftwareMaven/django
refs/heads/master
tests/aggregation/models.py
282
# -*- coding: utf-8 -*- from django.db import models from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class Author(models.Model): name = models.CharField(max_length=100) age = models.IntegerField() friends = models.ManyToManyField('self', blank=True) def __st...
AByzhynar/sdl_core
refs/heads/master
src/components/dbus/codegen/make_hmi_requests.py
13
#!/usr/bin/env python # -*- coding: utf-8 -*- # # @file make_qml_dbus_cpp.py # @brief Generator of QML to QDbus C++ part # # This file is a part of HMI D-Bus layer. # # Copyright (c) 2014, Ford Motor Company # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification,...
aidanlister/django
refs/heads/master
tests/one_to_one/models.py
203
""" One-to-one relationships To define a one-to-one relationship, use ``OneToOneField()``. In this example, a ``Place`` optionally can be a ``Restaurant``. """ from __future__ import unicode_literals from django.db import models from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compat...
saurabhjn76/sympy
refs/heads/master
sympy/plotting/pygletplot/plot_object.py
124
from __future__ import print_function, division class PlotObject(object): """ Base class for objects which can be displayed in a Plot. """ visible = True def _draw(self): if self.visible: self.draw() def draw(self): """ OpenGL rendering code for the plo...
dstroppa/openstack-smartos-nova-grizzly
refs/heads/master
nova/network/api_deprecated.py
6
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2011 X.commerce, a business unit of eBay Inc. # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (t...
SantosDevelopers/sborganicos
refs/heads/master
venv/lib/python3.5/site-packages/django/template/defaulttags.py
45
"""Default tags used by the template system, available to all templates.""" from __future__ import unicode_literals import re import sys import warnings from collections import namedtuple from datetime import datetime from itertools import cycle as itertools_cycle, groupby from django.conf import settings from django...
akarol/cfme_tests
refs/heads/master
cfme/test_framework/pytest_plugin.py
1
""" cfme main plugin this loads all of the elemental cfme plugins and prepares configuration """ import pytest @pytest.mark.tryfirst def pytest_addoption(parser): # Create the cfme option group for use in other plugins parser.getgroup('cfme', 'cfme: options related to cfme/miq appliances') def pytest_conf...
lucidbard/NewsBlur
refs/heads/master
vendor/paypal/standard/ipn/urls.py
23
from django.conf.urls import patterns, url urlpatterns = patterns('paypal.standard.ipn.views', url(r'^$', 'ipn', name="paypal-ipn"), )
adyliu/mysql-connector-python
refs/heads/master
tests/py2/test_utils.py
2
# MySQL Connector/Python - MySQL driver written in Python. # Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. # MySQL Connector/Python is licensed under the terms of the GPLv2 # <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most # MySQL Connectors. There are special exceptio...
t-hey/QGIS-Original
refs/heads/master
python/plugins/processing/algs/gdal/ogr2ogrtabletopostgislist.py
1
# -*- coding: utf-8 -*- """ *************************************************************************** ogr2ogrtabletopostgislist.py --------------------- Date : November 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com ***********...
israeltobias/DownMedia
refs/heads/master
youtube-dl/youtube_dl/extractor/tass.py
64
# coding: utf-8 from __future__ import unicode_literals import json from .common import InfoExtractor from ..utils import ( js_to_json, qualities, ) class TassIE(InfoExtractor): _VALID_URL = r'https?://(?:tass\.ru|itar-tass\.com)/[^/]+/(?P<id>\d+)' _TESTS = [ { 'url': 'http://tas...
feigaochn/leetcode
refs/heads/master
p241_different_ways_to_add_parentheses.py
2
# coding: utf-8 # author: Fei Gao # # Different Ways To Add Parentheses # Given a string of numbers and operators, return all possible results from computing all the different possible ways to group numbers and operators. The valid operators are +, - and *. # Example 1 # Input: "2-1-1". # ((2-1)-1) = 0 # (2-(1-1)) =...
jantuomi/py3status
refs/heads/master
py3status/modules/sysdata.py
7
# -*- coding: utf-8 -*- """ Display system RAM and CPU utilization. Configuration parameters: - format: output format string - high_threshold: percent to consider CPU or RAM usage as 'high load' - med_threshold: percent to consider CPU or RAM usage as 'medium load' Format of status string placeholders: ...
vvv1559/intellij-community
refs/heads/master
python/testData/resolve/multiFile/importAs/ImportAs.py
83
import ImportedFile as IF IF.func() # <ref>
ariestiyansyah/python-social-auth
refs/heads/master
social/backends/fitbit.py
49
""" Fitbit OAuth1 backend, docs at: http://psa.matiasaguirre.net/docs/backends/fitbit.html """ from social.backends.oauth import BaseOAuth1 class FitbitOAuth(BaseOAuth1): """Fitbit OAuth authentication backend""" name = 'fitbit' AUTHORIZATION_URL = 'https://www.fitbit.com/oauth/authorize' REQUEST_...
eoogbe/api-client-staging
refs/heads/master
generated/python/grpc-google-devtools-cloudtrace-v1/google/devtools/__init__.py
13048
__import__('pkg_resources').declare_namespace(__name__)
qma/pants
refs/heads/master
contrib/cpp/src/python/pants/contrib/__init__.py
13048
__import__('pkg_resources').declare_namespace(__name__)
FireWRT/OpenWrt-Firefly-Libraries
refs/heads/master
staging_dir/host/lib/python3.4/ftplib.py
9
"""An FTP client class and some helper functions. Based on RFC 959: File Transfer Protocol (FTP), by J. Postel and J. Reynolds Example: >>> from ftplib import FTP >>> ftp = FTP('ftp.python.org') # connect to host, default port >>> ftp.login() # default, i.e.: user anonymous, passwd anonymous@ '230 Guest login ok, ac...
jenca-cloud/jenca-authentication
refs/heads/master
storage/storage.py
1
""" A storage service for use by a Jenca Cloud authentication service. """ import os from flask import Flask, json, jsonify, request, make_response from flask.ext.sqlalchemy import SQLAlchemy from flask_jsonschema import JsonSchema, ValidationError from flask_negotiate import consumes from requests import codes db...
purpleidea/macaronic-net
refs/heads/master
django/bin/daily_cleanup.py
421
#!/usr/bin/env python """ Daily cleanup job. Can be run as a cronjob to clean out old data from the database (only expired sessions at the moment). """ from django.core import management if __name__ == "__main__": management.call_command('cleanup')
feroda/odoo
refs/heads/pos-multicurrency
openerp/addons/base/res/res_users.py
45
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # Copyright (C) 2010-2014 OpenERP s.a. (<http://openerp.com>). # # This program is free software: you ca...
kurazu/pycon_quiz
refs/heads/master
solutions/poss2.py
1
import itertools digits = map(str, xrange(1, 10)) s = 0 for perm in itertools.permutations(digits): num = int(''.join(perm)) print num s += num print 'SUM', s