repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
google/TaglessCRM | refs/heads/master | src/plugins/pipeline_plugins/hooks/cm_hook.py | 1 | # python3
# coding=utf-8
# Copyright 2020 Google LLC.
#
# 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 ... |
hyperized/ansible | refs/heads/devel | lib/ansible/modules/source_control/gitlab_project_variable.py | 1 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2019, Markus Bergholz (markuman@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_version... |
Work4Labs/lettuce | refs/heads/master | tests/integration/lib/Django-1.2.5/django/http/utils.py | 200 | """
Functions that modify an HTTP request or response in some way.
"""
# This group of functions are run as part of the response handling, after
# everything else, including all response middleware. Think of them as
# "compulsory response middleware". Be careful about what goes here, because
# it's a little fiddly to ... |
ncc-unesp/goo-server | refs/heads/master | dispatcher/backend/globus.py | 1 | # This file is part of goo-server.
#
# Copyright (c) 2103-2014 by Nucleo de Computacao Cientifica, UNESP
#
# Authors:
# Beraldo Leal <beraldo AT ncc DOT unesp DOT br>
# Gabriel von. Winckler <winckler AT ncc DOT unesp DOT br>
#
# goo-server is free software: you can redistribute it and/or modify
# it under the te... |
Nicop06/ansible | refs/heads/devel | lib/ansible/modules/network/avi/avi_sslprofile.py | 27 | #!/usr/bin/python
#
# Created on Aug 25, 2016
# @author: Gaurav Rastogi (grastogi@avinetworks.com)
# Eric Anderson (eanderson@avinetworks.com)
# module_check: supported
# Avi Version: 17.1.1
#
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the te... |
proxysh/Safejumper-for-Desktop | refs/heads/master | buildlinux/env32/lib/python2.7/site-packages/twisted/web/_auth/basic.py | 21 | # -*- test-case-name: twisted.web.test.test_httpauth -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
HTTP BASIC authentication.
@see: U{http://tools.ietf.org/html/rfc1945}
@see: U{http://tools.ietf.org/html/rfc2616}
@see: U{http://tools.ietf.org/html/rfc2617}
"""
from __future__ impor... |
yewang15215/django | refs/heads/master | tests/managers_regress/tests.py | 16 | from __future__ import unicode_literals
import warnings
from django.db import models
from django.db.utils import DatabaseError
from django.template import Context, Template
from django.test import TestCase, override_settings
from django.test.utils import isolate_apps
from django.utils.deprecation import RemovedInDjan... |
hryamzik/ansible | refs/heads/devel | lib/ansible/modules/network/f5/bigip_profile_udp.py | 18 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2017, F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... |
kulawczukmarcin/mypox | refs/heads/master | pox.py | 47 | #!/bin/sh -
# Copyright 2011-2012 James McCauley
#
# 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 ... |
withtone/depot_tools | refs/heads/master | third_party/logilab/common/cache.py | 117 | # copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
#
# This file is part of logilab-common.
#
# logilab-common is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as publ... |
rowhit/h2o-2 | refs/heads/master | py/testdir_multi_jvm/test_0_NA_2enum.py | 9 | import unittest, random, sys, time, os
sys.path.extend(['.','..','../..','py'])
import h2o, h2o_cmd, h2o_glm, h2o_import as h2i, h2o_exec as h2e
# all zeroes, the summary looks like
# column: {
# "colname": "C1",
# "hbrk": null,
# "hcnt": [
# 100
# ],
# "hstart": 0.0,
# "hstep": 1.0,
# "nacnt": ... |
rfuentess/RIOT | refs/heads/master | tests/pkg_tinycrypt/tests/01-run.py | 32 | #!/usr/bin/env python3
# Copyright (C) 2017 Freie Universität Berlin
#
# This file is subject to the terms and conditions of the GNU Lesser
# General Public License v2.1. See the file LICENSE in the top level
# directory for more details.
import sys
from testrunner import run
def testfunc(child):
child.expect_e... |
mpasternak/michaldtz-fix-552 | refs/heads/master | tools/epydoc/epydoc/docintrospecter.py | 8 | # epydoc -- Introspection
#
# Copyright (C) 2005 Edward Loper
# Author: Edward Loper <edloper@loper.org>
# URL: <http://epydoc.sf.net>
#
# $Id: docintrospecter.py 1501 2007-02-14 08:36:59Z edloper $
"""
Extract API documentation about python objects by directly introspecting
their values.
The function L{introspect_do... |
jkossen/showoff | refs/heads/master | run_frontend.py | 1 | #!/usr/bin/env python
from flask import Flask
from showoff.frontend.controllers import frontend
app = Flask(__name__)
app.config.from_pyfile('config.py')
app.config.from_envvar('SHOWOFF_FRONTEND_CONFIG', silent=True)
app.register_blueprint(frontend, url_prefix=app.config['FRONTEND_PREFIX'])
if __name__ == '__main__'... |
thunderhoser/GewitterGefahr | refs/heads/master | gewittergefahr/gg_utils/geodetic_utils_test.py | 1 | """Unit tests for geodetic_utils.py."""
import unittest
import numpy
from gewittergefahr.gg_utils import geodetic_utils
DEFAULT_TOLERANCE = 1e-6
LATLNG_TOLERANCE_DEG = 0.01
# The following constants are used to test find_invalid_latitudes.
MESSY_LATITUDES_DEG = numpy.array(
[numpy.nan, -numpy.inf, -180., -100., ... |
oerb/DTS | refs/heads/master | DTSERVER/views.py | 1 |
__author__ = 'Bjoer Leppin'
__copyright__ = 'Copyright 2016, Björn Leppin'
__email__ = 'bjoern@oerb.de'
__license__ = "privat"
__status__ = "Alpha"
from django.contrib.auth.models import User, Group
from DTSERVER.models import Worktime, Worktyp, Work_Interval
from rest_framework import viewsets
from DTSERVER.serializ... |
lebabouin/CouchPotatoServer-develop | refs/heads/master | libs/pynmwp/__init__.py | 53 | from xml.dom.minidom import parseString
from httplib import HTTPSConnection
from urllib import urlencode
__version__ = "0.1"
API_SERVER = 'notifymywindowsphone.com'
ADD_PATH = '/publicapi/notify'
USER_AGENT = "PyNMWP/v%s" % __version__
def uniq_preserve(seq): # Dave Kirby
# Order preserving
seen = set()
... |
subutai/nupic | refs/heads/master | src/nupic/support/decorators.py | 28 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... |
thaumos/ansible | refs/heads/devel | lib/ansible/modules/database/influxdb/influxdb_user.py | 18 | #!/usr/bin/python
# (c) 2017, Vitaliy Zhhuta <zhhuta () gmail.com>
# insipred by Kamil Szczygiel <kamil.szczygiel () intel.com> influxdb_database module
# 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
__meta... |
mathLab/RBniCS | refs/heads/master | rbnics/backends/dolfin/wrapping/tensor_load.py | 1 | # Copyright (C) 2015-2021 by the RBniCS authors
#
# This file is part of RBniCS.
#
# SPDX-License-Identifier: LGPL-3.0-or-later
import os
from petsc4py import PETSc
from rbnics.utils.cache import Cache
from rbnics.utils.decorators import overload
from rbnics.utils.io import Folders, PickleIO
from rbnics.utils.mpi impo... |
asadziach/tensorflow | refs/heads/pedestrian_detection_walabot_tf | tensorflow/contrib/graph_editor/reroute.py | 45 | # 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... |
gaurav38/QosRouting | refs/heads/master | pox/lib/graph/nom.py | 6 | # Copyright 2012 James McCauley
#
# 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 writi... |
Shanec132006/lab3 | refs/heads/master | lib/itsdangerous.py | 296 | # -*- coding: utf-8 -*-
"""
itsdangerous
~~~~~~~~~~~~
A module that implements various functions to deal with untrusted
sources. Mainly useful for web applications.
:copyright: (c) 2011 by Armin Ronacher and the Django Software Foundation.
:license: BSD, see LICENSE for more details.
"""
imp... |
roselleebarle04/django | refs/heads/master | django/contrib/postgres/forms/array.py | 258 | import copy
from django import forms
from django.contrib.postgres.validators import (
ArrayMaxLengthValidator, ArrayMinLengthValidator,
)
from django.core.exceptions import ValidationError
from django.utils import six
from django.utils.safestring import mark_safe
from django.utils.translation import string_concat,... |
ogrisel/numpy | refs/heads/master | numpy/compat/setup.py | 51 | #!/usr/bin/env python
from __future__ import division, print_function
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('compat', parent_package, top_path)
return config
if __name__ == '__main__':
from numpy.distutils.core ... |
blutooth/gp-svi | refs/heads/master | tests/test_performance.py | 11 | # TODO:
# Do a huge calculation with trivial primitive computations
# and lots of diamonds and get a benchmark per-node time and
# memory cost.
|
openstack/freezer-api | refs/heads/master | freezer_api/tests/unit/v1/test_backups.py | 1 | """Freezer swift.py related tests
(c) Copyright 2014,2015 Hewlett-Packard Development Company, L.P.
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
... |
moagstar/python-uncompyle6 | refs/heads/master | test/simple_source/stmts/10_if_break_finally.py | 2 | # Tests
# while1stmt ::= SETUP_LOOP l_stmts JUMP_BACK POP_BLOCK COME_FROM
# tryfinallystmt ::= SETUP_FINALLY suite_stmts_opt POP_BLOCK
try:
while 1:
if __file__:
break
finally:
pass
|
antmd/graph-tool | refs/heads/master | doc/sphinxext/phantom_import.py | 4 | """
==============
phantom_import
==============
Sphinx extension to make directives from ``sphinx.ext.autodoc`` and similar
extensions to use docstrings loaded from an XML file.
This extension loads an XML file in the Pydocweb format [1] and
creates a dummy module that contains the specified docstrings. This
can be ... |
michaelkirk/QGIS | refs/heads/master | python/plugins/processing/gui/MultipleInputDialog.py | 17 | # -*- coding: utf-8 -*-
"""
***************************************************************************
MultipleInputDialog.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
*******************... |
atuljain/coderbounty | refs/heads/master | website/migrations/0009_auto_20151117_1000.py | 2 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('website', '0008_userprofile_github_link'),
]
operations = [
migrations.AlterField(
model_name='userprofile',
... |
otherness-space/myProject003 | refs/heads/master | my_project_003/lib/python2.7/site-packages/pip/cmdoptions.py | 239 | """
shared options and groups
The principle here is to define options once, but *not* instantiate them
globally. One reason being that options with action='append' can carry state
between parses. pip parses general options twice internally, and shouldn't
pass on state. To be consistent, all options will follow this de... |
TGM-Oldenburg/earyx | refs/heads/master | setup.py | 1 | from setuptools import setup, find_packages
setup(
name = "earyx",
version = "0.1",
packages=find_packages(exclude=['docs']),
package_data={'earyx.gui': ['*.html', '*.js']},
include_package_data=True,
# Project uses reStructuredText, so ensure that the docutils get
# installed or upgraded o... |
jamezpolley/pip | refs/heads/develop | pip/_vendor/requests/structures.py | 1159 | # -*- coding: utf-8 -*-
"""
requests.structures
~~~~~~~~~~~~~~~~~~~
Data structures that power Requests.
"""
import collections
class CaseInsensitiveDict(collections.MutableMapping):
"""
A case-insensitive ``dict``-like object.
Implements all methods and operations of
``collections.MutableMapping... |
tcpcloud/contrail-neutron-plugin | refs/heads/master | neutron_plugin_contrail/plugins/opencontrail/agent/contrail_vif_driver.py | 3 | #
# 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... |
robk5uj/invenio | refs/heads/bft2012-01-03 | modules/bibrank/lib/bibrank_citation_indexer_tests.py | 10 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2005, 2006, 2007, 2008, 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
## published by the Free Software Foundation; either version 2 of the
## ... |
pbrady/sympy | refs/heads/master | sympy/liealgebras/weyl_group.py | 76 | # -*- coding: utf-8 -*-
from sympy.core import Basic, Rational
from sympy.core.compatibility import range
from sympy.core.numbers import igcd
from .cartan_type import CartanType
from mpmath import fac
from sympy.matrices import Matrix, eye
class WeylGroup(Basic):
"""
For each semisimple Lie group, we have a ... |
robertpearce/chord-finder | refs/heads/master | chordfinder/Palettes.py | 1 | class Palette:
'''A class which allows the entire image colour mode to be set together'''
def __init__(self, colour_mode):
if colour_mode == 0: # Full Colour
self.nut_colour = (255, 255, 255)
self.fret_colour = (187, 187, 187)
self.fret_marker_colour = (200, 200, 200)
self.string_colour ... |
zhanghui9700/eonboard | refs/heads/master | eoncloud_web/frontend/models.py | 10644 | from django.db import models
# Create your models here.
|
mdanielwork/intellij-community | refs/heads/master | python/testData/inspections/PyTypeCheckerInspection/BuiltinsPy3.py | 5 | def test_operators():
print(2 + <warning descr="Expected type 'int', got 'str' instead">'foo'</warning>)
print(b'foo' + <warning descr="Expected type 'bytes', got 'str' instead">'bar'</warning>)
print(b'foo' + <warning descr="Expected type 'bytes', got 'int' instead">3</warning>)
def test_numerics():
... |
georgemarshall/django | refs/heads/master | tests/forms_tests/widget_tests/test_widget.py | 84 | from django.forms import Widget
from django.forms.widgets import Input
from .base import WidgetTest
class WidgetTests(WidgetTest):
def test_format_value(self):
widget = Widget()
self.assertIsNone(widget.format_value(None))
self.assertIsNone(widget.format_value(''))
self.assertEqu... |
gengue/django | refs/heads/master | django/contrib/admin/templatetags/log.py | 499 | from django import template
from django.contrib.admin.models import LogEntry
register = template.Library()
class AdminLogNode(template.Node):
def __init__(self, limit, varname, user):
self.limit, self.varname, self.user = limit, varname, user
def __repr__(self):
return "<GetAdminLog Node>"
... |
Mikk36/OctoPrint | refs/heads/master | tests/plugin/__init__.py | 47 | # coding=utf-8
"""
Unit tests for ``octoprint.plugin``.
"""
from __future__ import absolute_import
__author__ = "Gina Häußge <osd@foosel.net>"
__license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html'
__copyright__ = "Copyright (C) 2014 The OctoPrint Project - Released under terms of the... |
WillisXChen/django-oscar | refs/heads/master | src/oscar/apps/basket/middleware.py | 15 | from django.conf import settings
from django.contrib import messages
from django.core.signing import BadSignature, Signer
from django.utils.functional import SimpleLazyObject, empty
from django.utils.translation import ugettext_lazy as _
from oscar.core.loading import get_class, get_model
Applicator = get_class('offe... |
developerQuinnZ/this_will_work | refs/heads/master | labeler/forms.py | 2 | from django import forms
from .models import Image
class FileUploadForm(forms.ModelForm):
class Meta:
model = Image
fields = ('caption', 'file',)
|
niboshi/chainer | refs/heads/master | tests/chainermn_tests/datasets_tests/test_scatter.py | 3 | from __future__ import with_statement
import itertools
import unittest
from chainer import testing
import mpi4py.MPI
import numpy as np
import pytest
import chainermn
from chainermn.communicators.flat_communicator import FlatCommunicator
from chainermn.communicators.naive_communicator import NaiveCommunicator
class... |
9618211/phptrace | refs/heads/master | tests/gtest-1.7.0/scripts/pump.py | 2471 | #!/usr/bin/env python
#
# Copyright 2008, 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... |
deepmind/bsuite | refs/heads/master | bsuite/environments/mountain_car.py | 1 | # python3
# pylint: disable=g-bad-file-header
# Copyright 2019 DeepMind Technologies Limited. 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... |
plumgrid/plumgrid-nova | refs/heads/master | nova/virt/baremetal/baremetal_states.py | 25 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2012 NTT DOCOMO, INC.
# Copyright 2010 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 L... |
newrocknj/horizon | refs/heads/master | openstack_dashboard/dashboards/project/volumes/urls.py | 63 | # Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... |
spyf/sligen | refs/heads/master | src/wordgen/__init__.py | 8 | from .wordgen import Wordgen
|
lukeiwanski/tensorflow | refs/heads/master | tensorflow/contrib/framework/python/ops/checkpoint_ops_test.py | 47 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
maihde/quant | refs/heads/master | indicators/rsi.py | 3 | #!/usr/bin/env python
LICENSE="""
Copyright (C) 2011 Michael Ihde
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This progra... |
musically-ut/numpy | refs/heads/master | numpy/core/code_generators/generate_numpy_api.py | 113 | from __future__ import division, print_function
import os
import genapi
from genapi import \
TypeApi, GlobalVarApi, FunctionApi, BoolValuesApi
import numpy_api
# use annotated api when running under cpychecker
h_template = r"""
#if defined(_MULTIARRAYMODULE) || defined(WITH_CPYCHECKER_STEALS_REFERENCE_TO_AR... |
loneknightpy/spark | refs/heads/master | examples/src/main/python/ml/linearsvc.py | 52 | #
# 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 us... |
C-Y-Coin/cyc-master | refs/heads/master | contrib/spendfrom/spendfrom.py | 792 | #!/usr/bin/env python
#
# Use the raw transactions API to spend bitcoins received on particular addresses,
# and send any change back to that same address.
#
# Example usage:
# spendfrom.py # Lists available funds
# spendfrom.py --from=ADDRESS --to=ADDRESS --amount=11.00
#
# Assumes it will talk to a bitcoind or Bit... |
chand3040/cloud_that | refs/heads/named-release/cypress.rc | lms/djangoapps/bulk_email/migrations/0010_auto__chg_field_optout_course_id__add_field_courseemail_template_name_.py | 120 | # -*- coding: 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):
# Changing field 'Optout.course_id'
db.alter_column('bulk_email_optout', 'course_id', self.gf('xmodule_djan... |
agconti/Shopify-Django | refs/heads/master | venv/lib/python2.7/site-packages/django/db/backends/postgresql_psycopg2/creation.py | 107 | import psycopg2.extensions
from django.db.backends.creation import BaseDatabaseCreation
from django.db.backends.util import truncate_name
class DatabaseCreation(BaseDatabaseCreation):
# This dictionary maps Field objects to their associated PostgreSQL column
# types, as strings. Column-type strings can conta... |
andrius-preimantas/odoo | refs/heads/master | addons/delivery/stock.py | 28 | # -*- 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... |
catacgc/ansible-modules-core | refs/heads/devel | cloud/rackspace/rax_keypair.py | 43 | #!/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 distributed... |
laosiaudi/tensorflow | refs/heads/master | tensorflow/contrib/distributions/python/ops/chi2.py | 18 | # 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... |
Swetha5/gnome-games | refs/heads/master | gnome-sudoku/src/lib/simple_debug.py | 5 | # -*- coding: utf-8 -*-
import optparse
import defaults
parser = optparse.OptionParser(
version=defaults.VERSION,
option_list=[
optparse.make_option("-v", const=True, action="store_const",
dest="debug", help="Print debug information",
default=False),
op... |
Adnn/django | refs/heads/master | tests/gis_tests/layermap/models.py | 235 | from django.utils.encoding import python_2_unicode_compatible
from ..models import models
@python_2_unicode_compatible
class NamedModel(models.Model):
name = models.CharField(max_length=25)
objects = models.GeoManager()
class Meta:
abstract = True
required_db_features = ['gis_enabled']
... |
igueths/ansible-modules-extras | refs/heads/devel | cloud/cloudstack/cs_portforward.py | 17 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2015, René Moser <mail@renemoser.net>
#
# 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 Lice... |
mixu-/fMBT | refs/heads/devel | utils/fmbtrdp.py | 13 | # fMBT, free Model Based Testing tool
# Copyright (c) 2014, Intel Corporation.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms and conditions of the GNU Lesser General Public License,
# version 2.1, as published by the Free Software Foundation.
#
# This program is distribut... |
adamrw/ghost-test3 | refs/heads/master | node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/build-2.7/pygments/formatters/terminal256.py | 362 | # -*- coding: utf-8 -*-
"""
pygments.formatters.terminal256
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Formatter for 256-color terminal output with ANSI sequences.
RGB-to-XTERM color conversion routines adapted from xterm256-conv
tool (http://frexx.de/xterm-256-notes/data/xterm256-conv2.tar.bz2)
by Wolfg... |
CounterpartyXCP/counterparty-cli | refs/heads/master | counterpartycli/wallet/btcwallet.py | 1 | import binascii
import logging
logger = logging.getLogger(__name__)
import sys
import json
import time
import requests
from counterpartylib.lib import config
from counterpartycli.util import wallet_api as rpc
def get_wallet_addresses():
addresses = []
for output in rpc('listunspent', [0, 99999]):
if o... |
brett-patterson/pyface | refs/heads/master | pyface/workbench/action/delete_user_perspective_action.py | 2 | #-----------------------------------------------------------------------------
#
# Copyright (c) 2005-2006 by Enthought, Inc.
# All rights reserved.
#
# Author: David C. Morrill <dmorrill@enthought.com>
#
#-----------------------------------------------------------------------------
""" An action that deletes a user... |
apache/incubator-airflow | refs/heads/master | airflow/www/gunicorn_config.py | 8 | #!/usr/bin/env python
#
# 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
# "... |
ajhager/copycat | refs/heads/master | lib/pyglet/extlibs/future/py2_3/libfuturize/main.py | 60 | """
futurize: automatic conversion to clean 2/3 code using ``python-future``
======================================================================
Like Armin Ronacher's modernize.py, ``futurize`` attempts to produce clean
standard Python 3 code that runs on both Py2 and Py3.
One pass
--------
Use it like this on Py... |
JioCloud/horizon | refs/heads/master | openstack_dashboard/dashboards/project/networks/tables.py | 4 | # Copyright 2012 NEC Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... |
stynr/pupy | refs/heads/master | pupy/packages/windows/amd64/psutil/_compat.py | 70 | #!/usr/bin/env python
# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Module which provides compatibility with older Python versions."""
import collections
import functools
import sys
__all__ = ["P... |
meyersbs/misc_nlp_scripts | refs/heads/master | english_to_soundex.py | 1 | #!usr/bin/python
# @AUTHOR: Benjamin S. Meyers
# @DESCRIPTION: A simple function to translate an English string into soundex. https://en.wikipedia.org/wiki/Soundex
import sys
__copyright__= """
The MIT License (MIT)
Copyright (c) Benjamin S. Meyers <bsm9339@rit.edu>
Permission is hereby granted, free of charge, to ... |
anderson7ru/bienestarues | refs/heads/master | reportesapp/apps.py | 1 | from django.apps import AppConfig
class ReportesappConfig(AppConfig):
name = 'reportesapp'
|
xtrymind/android_kernel_msm | refs/heads/lolipop | 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... |
kmonsoor/npyscreen | refs/heads/master | build/lib/npyscreen/muNewMenu.py | 15 | #!/usr/bin/env python
# encoding: utf-8
import weakref
class NewMenu(object):
"""docstring for NewMenu"""
def __init__(self, name=None, shortcut=None, preDisplayFunction=None, pdfuncArguments=None, pdfuncKeywords=None):
self.name = name
self._menuList = []
self.enabled = True
... |
KokareIITP/django | refs/heads/master | django/contrib/messages/__init__.py | 741 | from django.contrib.messages.api import * # NOQA
from django.contrib.messages.constants import * # NOQA
default_app_config = 'django.contrib.messages.apps.MessagesConfig'
|
plotly/plotly.py | refs/heads/master | packages/python/plotly/plotly/validators/parcoords/line/colorbar/_lenmode.py | 1 | import _plotly_utils.basevalidators
class LenmodeValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self, plotly_name="lenmode", parent_name="parcoords.line.colorbar", **kwargs
):
super(LenmodeValidator, self).__init__(
plotly_name=plotly_name,
p... |
BenjamenMeyer/eom | refs/heads/master | eom/version.py | 3 | # Copyright (c) 2014 Rackspace Hosting, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... |
drukhil/frappe | refs/heads/master | frappe/model/mapper.py | 6 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe, json
from frappe import _
from frappe.utils import cstr
from frappe.model import default_fields
def get_mapped_doc(from_doctype, from_docname, table_maps, target_d... |
ytjiang/django | refs/heads/master | tests/known_related_objects/models.py | 166 | """
Existing related object instance caching.
Test that queries are not redone when going back through known relations.
"""
from django.db import models
class Tournament(models.Model):
name = models.CharField(max_length=30)
class Organiser(models.Model):
name = models.CharField(max_length=30)
class Pool... |
pcabido/socorro | refs/heads/master | socorro/external/postgresql/bugs.py | 9 | # 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/.
"""Deprecated by socorro/external/postgresql/bugs_service.py"""
import logging
from socorro.external import MissingArg... |
PeterWangIntel/chromium-crosswalk | refs/heads/master | third_party/cython/src/Cython/Debugger/Tests/test_libcython_in_gdb.py | 112 | """
Tests that run inside GDB.
Note: debug information is already imported by the file generated by
Cython.Debugger.Cygdb.make_command_file()
"""
import os
import re
import sys
import trace
import inspect
import warnings
import unittest
import textwrap
import tempfile
import functools
import traceback
import itertool... |
hmpf/nav | refs/heads/master | tests/unittests/metrics/graphs_test.py | 2 | from mock import patch
from nav.metrics.graphs import get_sensor_meta
from nav.models.manage import Sensor
def test_get_sensor_meta_should_not_crash_on_missing_human_readable():
sensor = Sensor(human_readable=None)
with patch('nav.metrics.lookup.lookup') as lookup:
lookup.return_value = sensor
... |
jhgg/graphqllib | refs/heads/master | tests/core_validation/test_no_fragment_cycles.py | 5 | from graphql.core.language.location import SourceLocation as L
from graphql.core.validation.rules import NoFragmentCycles
from utils import expect_passes_rule, expect_fails_rule
def cycle_error_message(fragment_name, spread_names, *locations):
return {
'message': NoFragmentCycles.cycle_error_message(fragm... |
kbidarkar/robottelo | refs/heads/master | tests/foreman/cli/test_usergroup.py | 2 | # -*- encoding: utf-8 -*-
"""Test class for User Group CLI
:Requirement: Usergroup
:CaseAutomation: Automated
:CaseLevel: Acceptance
:CaseComponent: CLI
:TestType: Functional
:CaseImportance: High
:Upstream: No
"""
from random import randint
from robottelo.cli.usergroup import UserGroup
from robottelo.cli.base ... |
google/contentbox | refs/heads/master | third_party/oauthlib/oauth2/rfc6749/endpoints/base.py | 6 | # -*- coding: utf-8 -*-
"""
oauthlib.oauth2.rfc6749
~~~~~~~~~~~~~~~~~~~~~~~
This module is an implementation of various logic needed
for consuming and providing OAuth 2.0 RFC6749.
"""
from __future__ import absolute_import, unicode_literals
import functools
from oauthlib.common import log
from ..errors import Tempo... |
kdwink/intellij-community | refs/heads/master | python/lib/Lib/xml/dom/__init__.py | 112 | ########################################################################
#
# File Name: __init__.py
#
#
"""
WWW: http://4suite.org/4DOM e-mail: support@4suite.org
Copyright (c) 2000 Fourthought Inc, USA. All Rights Reserved.
See http://4suite.org/COPYRIGHT for license and copyright information
"... |
muntasirsyed/intellij-community | refs/heads/master | python/testData/refactoring/introduceField/variableToField.py | 75 | class Foo:
def bar(self):
<selection>c</selection> = ""
print c
|
scottsilverlabs/raspberrystem | refs/heads/master | projects/camp/space_invaders/space_invaders3.py | 1 | from rstem.accel import Accel
from rstem.led_matrix import FrameBuffer
import time
fb = FrameBuffer()
accel = Accel()
spaceship_position = fb.width / 2
TILT_FORCE = 0.1
SPACESHIP_STEP = 0.1
while True:
# ########################################
# Get inputs
# ########################################
... |
maellak/invenio | refs/heads/master | modules/miscutil/lib/crossrefutils.py | 8 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2012 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (at your option) a... |
Bloodyaugust/pongsugarlabcpp | refs/heads/master | lib/boost/tools/build/test/expansion.py | 6 | #!/usr/bin/python
# Copyright 2003 Vladimir Prus
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
import BoostBuild
t = BoostBuild.Tester(use_test_config=False)
t.write("a.cpp", """
#ifdef CF_IS_OFF
int main(... |
lisael/pg-django | refs/heads/master | django/contrib/contenttypes/views.py | 86 | from django import http
from django.contrib.contenttypes.models import ContentType
from django.contrib.sites.models import Site, get_current_site
from django.core.exceptions import ObjectDoesNotExist
from django.utils.translation import ugettext as _
def shortcut(request, content_type_id, object_id):
"""
Redir... |
0jpq0/kbengine | refs/heads/master | kbe/src/lib/python/Lib/idlelib/configHelpSourceEdit.py | 82 | "Dialog to specify or edit the parameters for a user configured help source."
import os
import sys
from tkinter import *
import tkinter.messagebox as tkMessageBox
import tkinter.filedialog as tkFileDialog
class GetHelpSourceDialog(Toplevel):
def __init__(self, parent, title, menuItem='', filePath='', _htest=Fals... |
PyOCL/OpenCLGA | refs/heads/master | OpenCLGA/ocl_ga.py | 3 | #!/usr/bin/python3
import os
import sys
import zlib
import time
import random
import numpy
import pickle
import pyopencl as cl
import threading
from . import utils
from .utilities.generaltaskthread import TaskThread, Task, Logger
## A decorator class to notify state change before/after the action.
class EnterExit(obje... |
ymcagodme/Norwalk-Judo | refs/heads/master | django/db/backends/mysql/creation.py | 311 | from django.db.backends.creation import BaseDatabaseCreation
class DatabaseCreation(BaseDatabaseCreation):
# This dictionary maps Field objects to their associated MySQL column
# types, as strings. Column-type strings can contain format strings; they'll
# be interpolated against the values of Field.__dict_... |
FiloSottile/youtube-dl | refs/heads/master | youtube_dl/extractor/hotnewhiphop.py | 129 | from __future__ import unicode_literals
import base64
from .common import InfoExtractor
from ..compat import (
compat_urllib_parse,
compat_urllib_request,
)
from ..utils import (
ExtractorError,
HEADRequest,
)
class HotNewHipHopIE(InfoExtractor):
_VALID_URL = r'http://www\.hotnewhiphop\.com/.*\.... |
justintweaver/mtchi-cert-game | refs/heads/master | makahiki/apps/managers/score_mgr/migrations/0005_auto__add_field_scoresetting_name.py | 7 | # 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 field 'ScoreSetting.name'
db.add_column('score_mgr_scoresetting', 'name', self.gf('django.db.mode... |
drxzcl/iot_testbed | refs/heads/master | lib/werkzeug/contrib/iterio.py | 318 | # -*- coding: utf-8 -*-
r"""
werkzeug.contrib.iterio
~~~~~~~~~~~~~~~~~~~~~~~
This module implements a :class:`IterIO` that converts an iterator into
a stream object and the other way round. Converting streams into
iterators requires the `greenlet`_ module.
To convert an iterator into a stream... |
cloudbase/cinder | refs/heads/master | cinder/volume/targets/cxt.py | 6 | # Copyright 2015 Chelsio Communications 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
#
# Unle... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.