repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
cnsuperx/Cocos2d-x-2.2.5 | refs/heads/master | tools/cocos2d-console/console/cocos2d_jscompile.py | 5 | #!/usr/bin/python
# ----------------------------------------------------------------------------
# cocos2d "jscompile" plugin
#
# Copyright 2013 (C) Intel
#
# License: MIT
# ----------------------------------------------------------------------------
'''
"jscompile" plugin for cocos2d command line tool
'''
__docformat... |
ManjiriBirajdar/coala | refs/heads/master | tests/settings/DocstringMetadataTest.py | 11 | import unittest
from coalib.settings.DocstringMetadata import DocstringMetadata
class DocstringMetadataTest(unittest.TestCase):
def test_from_docstring(self):
self.check_from_docstring_dataset("")
self.check_from_docstring_dataset(" description only ",
d... |
akaihola/django | refs/heads/master | tests/regressiontests/views/tests/static.py | 4 | from __future__ import absolute_import
import mimetypes
from os import path
from django.conf import settings
from django.conf.urls.static import static
from django.test import TestCase
from django.http import HttpResponseNotModified
from .. import urls
from ..urls import media_dir
class StaticTests(TestCase):
... |
EmanueleCannizzaro/scons | refs/heads/master | test/CC/CCCOMSTR.py | 1 | #!/usr/bin/env python
#
# Copyright (c) 2001 - 2016 The SCons Foundation
#
# 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 us... |
himadriganguly/featurerequest | refs/heads/master | ticketing/tests/test_functional.py | 1 | from django.test import LiveServerTestCase
from django.contrib.staticfiles.testing import StaticLiveServerTestCase
from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
class LoginTestCase(StaticLiveServerTestCase):
fixtures = ['auth_user.json']
def s... |
benfinke/ns_python | refs/heads/master | nssrc/com/citrix/netscaler/nitro/resource/config/tunnel/tunneltrafficpolicy_binding.py | 3 | #
# Copyright (c) 2008-2015 Citrix Systems, 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 l... |
vivekananda/fbeats | refs/heads/master | django/contrib/localflavor/ch/ch_states.py | 544 | # -*- coding: utf-8 -*
from django.utils.translation import ugettext_lazy as _
STATE_CHOICES = (
('AG', _('Aargau')),
('AI', _('Appenzell Innerrhoden')),
('AR', _('Appenzell Ausserrhoden')),
('BS', _('Basel-Stadt')),
('BL', _('Basel-Land')),
('BE', _('Berne')),
('FR', _('Fribourg')),
('... |
fxfitz/ansible | refs/heads/devel | lib/ansible/modules/cloud/ovirt/ovirt_host_networks.py | 19 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016, 2018 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... |
RydrDojo/Ridr_app | refs/heads/master | pylotVenv/lib/python2.7/site-packages/jinja2/loaders.py | 333 | # -*- coding: utf-8 -*-
"""
jinja2.loaders
~~~~~~~~~~~~~~
Jinja loader classes.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import os
import sys
import weakref
from types import ModuleType
from os import path
from hashlib import sha1
from jinja2.excepti... |
devops2014/djangosite | refs/heads/master | tests/template_backends/test_django.py | 32 | from template_tests.test_response import test_processor_name
from django.template import RequestContext
from django.template.backends.django import DjangoTemplates
from django.test import RequestFactory, ignore_warnings
from django.utils.deprecation import RemovedInDjango20Warning
from .test_dummy import TemplateStri... |
Micronaet/micronaet-sql7 | refs/heads/master | sql_accounting_product_status_bs_set_date/wizard/set_date_wizard.py | 2 | # -*- coding: utf-8 -*-
###############################################################################
#
# Copyright (C) 2001-2014 Micronaet SRL (<http://www.micronaet.it>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License a... |
robobrobro/ballin-octo-shame | refs/heads/master | lib/Python-3.4.3/Lib/concurrent/futures/_base.py | 88 | # Copyright 2009 Brian Quinlan. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
__author__ = 'Brian Quinlan (brian@sweetapp.com)'
import collections
import logging
import threading
import time
FIRST_COMPLETED = 'FIRST_COMPLETED'
FIRST_EXCEPTION = 'FIRST_EXCEPTION'
ALL_COMPLETED = 'ALL_COMPLETED... |
klahnakoski/cloc | refs/heads/master | cloc/util/vendor/dateutil/__init__.py | 147 | # -*- coding: utf-8 -*-
"""
Copyright (c) 2003-2010 Gustavo Niemeyer <gustavo@niemeyer.net>
This module offers extensions to the standard Python
datetime module.
"""
__author__ = "Tomi Pieviläinen <tomi.pievilainen@iki.fi>"
__license__ = "Simplified BSD"
__version__ = "2.1"
|
trondhindenes/ansible | refs/heads/devel | lib/ansible/plugins/lookup/csvfile.py | 80 | # (c) 2013, Jan-Piet Mens <jpmens(at)gmail.com>
# (c) 2017 Ansible Project
# 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
DOCUMENTATION = """
lookup: csvfile
author: Jan-Piet Me... |
ecosoft-odoo/odoo | refs/heads/8.0 | addons/procurement/__init__.py | 374 | # -*- 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... |
gentledevil/ansible | refs/heads/devel | lib/ansible/plugins/connections/funcd.py | 140 | # Based on local.py (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
# Based on chroot.py (c) 2013, Maykel Moya <mmoya@speedyrails.com>
# (c) 2013, Michael Scherer <misc@zarb.org>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU Gene... |
michalliu/OpenWrt-Firefly-Libraries | refs/heads/master | staging_dir/target-mipsel_1004kc+dsp_uClibc-0.9.33.2/usr/lib/python2.7/json/tests/test_default.py | 145 | from json.tests import PyTest, CTest
class TestDefault(object):
def test_default(self):
self.assertEqual(
self.dumps(type, default=repr),
self.dumps(repr(type)))
class TestPyDefault(TestDefault, PyTest): pass
class TestCDefault(TestDefault, CTest): pass
|
SerpentCS/odoo | refs/heads/8.0 | openerp/report/render/simple.py | 324 | # -*- 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... |
Jenselme/unlog | refs/heads/master | unlog/unlog.py | 1 | import sys
import os
import copy
try:
from config import Config
from filter import Filter
except ImportError:
from unlog.config import Config
from unlog.filter import Filter
class Unlog:
"""Filter the output of a command or a log file according to pattern passed
in the *args* argument or acco... |
TheWardoctor/Wardoctors-repo | refs/heads/master | script.module.urlresolver/lib/urlresolver/plugins/vshareeu.py | 2 | """
vshare.eu urlresolver plugin
Copyright (C) 2017 jsergio
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 3 of the License, or
(at your option) any later version.
This program is di... |
sonaht/ansible | refs/heads/devel | hacking/report.py | 46 | #!/usr/bin/env python
# PYTHON_ARGCOMPLETE_OK
"""A tool to aggregate data about Ansible source and testing into a sqlite DB for reporting."""
from __future__ import (absolute_import, print_function)
import argparse
import os
import requests
import sqlite3
import sys
DATABASE_PATH = os.path.expanduser('~/.ansible/rep... |
qingpingguo/git-repo | refs/heads/master | subcmds/sync.py | 48 | #
# Copyright (C) 2008 The Android Open Source Project
#
# 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 la... |
laurivosandi/certidude | refs/heads/master | certidude/errors.py | 2 |
class RequestExists(Exception):
pass
class RequestDoesNotExist(Exception):
pass
class FatalError(Exception):
"""
Exception to be raised when user intervention is required
"""
pass
class DuplicateCommonNameError(FatalError):
pass
|
sadikovi/octohaven | refs/heads/master | src/job.py | 1 | #!/usr/bin/env python
#
# Copyright 2015 sadikovi
#
# 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 ... |
Peddle/hue | refs/heads/master | desktop/core/ext-py/boto-2.38.0/boto/ec2/elb/policies.py | 152 | # Copyright (c) 2010 Reza Lotun http://reza.lotun.name
#
# 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, m... |
festeh/BuildingMachineLearningSystemsWithPython | refs/heads/master | ch12/chapter.py | 20 | from jug import TaskGenerator
from glob import glob
import mahotas as mh
@TaskGenerator
def compute_texture(im):
from features import texture
imc = mh.imread(im)
return texture(mh.colors.rgb2gray(imc))
@TaskGenerator
def chist_file(fname):
from features import chist
im = mh.imread(fname)
ret... |
levkar/odoo-addons | refs/heads/8.0 | stock_remit/sale.py | 1 | # -*- coding: utf-8 -*-
from openerp import models
class sale_order(models.Model):
_inherit = "sale.order"
# def _prepare_order_picking(self, cr, uid, order, context=None):
# result = super(sale_order, self)._prepare_order_picking(
# cr, uid, order, context=context)
# if order.sho... |
saturn597/stem | refs/heads/master | test/unit/exit_policy/rule.py | 7 | """
Unit tests for the stem.exit_policy.ExitPolicyRule class.
"""
import unittest
from stem.exit_policy import AddressType, ExitPolicyRule
class TestExitPolicyRule(unittest.TestCase):
def test_accept_or_reject(self):
self.assertTrue(ExitPolicyRule("accept *:*").is_accept)
self.assertFalse(ExitPolicyRule("... |
TigorC/zulip | refs/heads/master | zerver/views/webhooks/travis.py | 28 | # Webhooks for external integrations.
from __future__ import absolute_import
from django.http import HttpRequest, HttpResponse
from zerver.decorator import REQ, has_request_variables, api_key_only_webhook_view
from zerver.lib.actions import check_send_message
from zerver.lib.response import json_success
from zerver.l... |
fhaoquan/kbengine | refs/heads/master | kbe/res/scripts/common/Lib/test/test_genexps.py | 97 | doctests = """
Test simple loop with conditional
>>> sum(i*i for i in range(100) if i&1 == 1)
166650
Test simple nesting
>>> list((i,j) for i in range(3) for j in range(4) )
[(0, 0), (0, 1), (0, 2), (0, 3), (1, 0), (1, 1), (1, 2), (1, 3), (2, 0), (2, 1), (2, 2), (2, 3)]
Test nesting with the inner ... |
aiguofer/bokeh | refs/heads/master | bokeh/models/axes.py | 2 | ''' Guide renderers for various kinds of axes that can be added to
Bokeh plots
'''
from __future__ import absolute_import
from ..core.has_props import abstract
from ..core.properties import Auto, Datetime, Either, Enum, Float, Include, Instance, Int, Override, String, Tuple
from ..core.property_mixins import LineProp... |
PW-Sat2/PWSat2OBC | refs/heads/master | integration_tests/emulator/beacon_parser/experiment_telemetry_parser.py | 1 | from emulator.beacon_parser.units import enum
from experiment_type import ExperimentType, StartResult, IterationResult
from parser import CategoryParser
class ExperimentTelemetryParser(CategoryParser):
def __init__(self, reader, store):
CategoryParser.__init__(self, '09: Experiments', reader, store)
... |
snnn/tensorflow | refs/heads/master | tensorflow/contrib/boosted_trees/python/training/functions/gbdt_batch.py | 4 | # 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... |
cpennington/edx-platform | refs/heads/master | common/lib/capa/capa/xqueue_interface.py | 4 | #
# LMS Interface to external queueing system (xqueue)
#
import hashlib
import json
import logging
import requests
import six
log = logging.getLogger(__name__)
dateformat = '%Y%m%d%H%M%S'
XQUEUE_METRIC_NAME = 'edxapp.xqueue'
# Wait time for response from Xqueue.
XQUEUE_TIMEOUT = 35 # seconds
CONNECT_TIMEOUT = 3... |
davisein/jitsudone | refs/heads/master | django/django/conf/locale/nn/formats.py | 170 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
# 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'
DATETIME_FORMAT = 'j. F Y H:i'
YEAR_MONTH_FOR... |
AnthonyTruchet/breathe | refs/heads/master | breathe/__init__.py | 2 |
__version__ = '4.0.0'
def setup(app):
# We can't do the import at the module scope as setup.py has to be able to
# import this file to read __version__ without hitting any syntax errors
# from both Python 2 & Python 3.
# By the time this function is called, the directives code will have been
# ... |
m3brown/pantheon | refs/heads/master | devdash/osw/pipeline.py | 5 | from social.pipeline.partial import partial
from django.shortcuts import redirect
from django.http import HttpResponse
from django.conf import settings
from github.client import GitHubAdmin, get_org_name, is_org_member, is_2fa_enabled
gha = GitHubAdmin()
@partial
def join_org(request, backend, user, details, **kwargs... |
StevenBlack/phantomjs | refs/heads/master | src/qt/qtwebkit/Tools/Scripts/webkitpy/common/lru_cache.py | 134 | # Copyright (C) 2011 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 ... |
rvalieris/bioconda-recipes | refs/heads/master | recipes/biopet-scatterregions/0.2/biopet-scatterregions.py | 72 | #!/usr/bin/env python
#
# Wrapper script for starting the biopet-scatterregions JAR package
#
# This script is written for use with the Conda package manager and is copied
# from the peptide-shaker wrapper. Only the parameters are changed.
# (https://github.com/bioconda/bioconda-recipes/blob/master/recipes/peptide-shak... |
gpoesia/servo | refs/heads/master | tests/wpt/css-tests/tools/pytest/doc/en/example/py2py3/conftest.py | 233 | import sys
import pytest
py3 = sys.version_info[0] >= 3
class DummyCollector(pytest.collect.File):
def collect(self):
return []
def pytest_pycollect_makemodule(path, parent):
bn = path.basename
if "py3" in bn and not py3 or ("py2" in bn and py3):
return DummyCollector(path, parent=parent)... |
dongsenfo/pymatgen | refs/heads/master | pymatgen/analysis/tests/test_molecule_structure_comparator.py | 3 | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
import os
from unittest import TestCase
import unittest
from pymatgen.analysis.molecule_structure_comparator import \
MoleculeStructureComparator
from pymatgen.core.structure import Molecule
from pymatgen.... |
ArianaGashi/Techstitution | refs/heads/master | venv/lib/python2.7/site-packages/pip/__main__.py | 834 | from __future__ import absolute_import
import os
import sys
# If we are running from a wheel, add the wheel to sys.path
# This allows the usage python pip-*.whl/pip install pip-*.whl
if __package__ == '':
# __file__ is pip-*.whl/pip/__main__.py
# first dirname call strips of '/__main__.py', second strips off ... |
cundi/pyramid_sacrud | refs/heads/master | pyramid_sacrud/includes/routes.py | 1 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2014 uralbash <root@uralbash.ru>
#
# Distributed under terms of the MIT license.
"""
Routes for pyramid_sacrud
"""
from ..common import pkg_prefix
from ..security import (PYRAMID_SACRUD_CREATE, PYRAMID_SACRUD_DELETE,
... |
dmlc/tvm | refs/heads/main | python/tvm/topi/rocm/batch_matmul.py | 3 | # 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... |
fmacias64/Dato-Core | refs/heads/master | src/unity/python/graphlab/data_structures/__init__.py | 13 | """
GraphLab Create offers several data structures for data analysis.
Concise descriptions of the data structures and their methods are contained in
the API documentation, along with a small number of simple examples. For more
detailed descriptions and examples, please see the `User Guide
<https://dato.com/learn/userg... |
kubaszostak/gdal-dragndrop | refs/heads/master | osgeo/apps/Python27/Lib/site-packages/numpy/matrixlib/tests/test_multiarray.py | 15 | from __future__ import division, absolute_import, print_function
import numpy as np
from numpy.testing import assert_, assert_equal, assert_array_equal
class TestView(object):
def test_type(self):
x = np.array([1, 2, 3])
assert_(isinstance(x.view(np.matrix), np.matrix))
def test_keywords(self... |
securechain/securechain-wallet | refs/heads/master | share/qt/extract_strings_qt.py | 2945 | #!/usr/bin/python
'''
Extract _("...") strings for translation and convert to Qt4 stringdefs so that
they can be picked up by Qt linguist.
'''
from subprocess import Popen, PIPE
import glob
import operator
OUT_CPP="src/qt/bitcoinstrings.cpp"
EMPTY=['""']
def parse_po(text):
"""
Parse 'po' format produced by x... |
lipis/life-line | refs/heads/master | main/control/error.py | 2 | # coding: utf-8
import logging
from flask.ext.babel import lazy_gettext as _
import flask
from api import helpers
import config
from main import app
@app.errorhandler(400) # Bad Request
@app.errorhandler(401) # Unauthorized
@app.errorhandler(403) # Forbidden
@app.errorhandler(404) # Not Found
@app.errorhandle... |
tusimbe/APM | refs/heads/master | Tools/autotest/apm_unit_tests/mustpass/arducopter_takeoff.py | 250 | import arducopter
def unit_test(mavproxy, mav):
'''A scripted flight plan'''
if (
arducopter.calibrate_level(mavproxy, mav) and
arducopter.arm_motors(mavproxy, mav) and
arducopter.takeoff(mavproxy,mav, alt_min=30, takeoff_throttle=1510)):
return True
return False
|
usc-isi/horizon-old | refs/heads/hpc-horizon | horizon/horizon/api/glance.py | 1 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2011 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# no... |
takeflight/wagtail | refs/heads/master | wagtail/tests/testapp/migrations/0050_customimagewithauthor_customrenditionwithauthor.py | 9 | # Generated by Django 2.2 on 2019-04-26 15:48
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import taggit.managers
import wagtail.core.models
import wagtail.images.models
import wagtail.search.index
class Migration(migrations.Migration):
dependencies ... |
mbedmicro/mbed | refs/heads/master | storage/filesystem/littlefsv2/littlefs/scripts/test.py | 13 | #!/usr/bin/env python3
# This script manages littlefs tests, which are configured with
# .toml files stored in the tests directory.
#
import toml
import glob
import re
import os
import io
import itertools as it
import collections.abc as abc
import subprocess as sp
import base64
import sys
import copy
import shlex
imp... |
yanchen036/tensorflow | refs/heads/master | tensorflow/python/data/kernel_tests/list_files_dataset_op_test.py | 12 | # 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... |
wangcy6/storm_app | refs/heads/master | frame/c++/grpc-master/src/python/grpcio_reflection/grpc_version.py | 3 | # Copyright 2016 gRPC 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 writing... |
google-code/android-scripting | refs/heads/master | python/src/Lib/test/test_future1.py | 432 | """This is a test"""
# Import the name nested_scopes twice to trigger SF bug #407394 (regression).
from __future__ import nested_scopes, nested_scopes
def f(x):
def g(y):
return x + y
return g
result = f(2)(4)
|
yashodhank/erpnext | refs/heads/develop | erpnext/patches/v6_3/convert_applicable_territory.py | 42 | import frappe
def execute():
frappe.reload_doc("stock", "doctype", "price_list_country")
frappe.reload_doc("accounts", "doctype", "shipping_rule_country")
frappe.reload_doctype("Price List")
frappe.reload_doctype("Shipping Rule")
frappe.reload_doctype("shopping_cart", "doctype", "shopping_cart_settings")
# for ... |
wfxiang08/django190 | refs/heads/master | tests/conditional_processing/urls.py | 360 | from django.conf.urls import url
from . import views
urlpatterns = [
url('^condition/$', views.index),
url('^condition/last_modified/$', views.last_modified_view1),
url('^condition/last_modified2/$', views.last_modified_view2),
url('^condition/etag/$', views.etag_view1),
url('^condition/etag2/$', ... |
kemalakyol48/python-for-android | refs/heads/master | python3-alpha/extra_modules/gdata/apps/emailsettings/data.py | 81 | #!/usr/bin/python
#
# Copyright 2010 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 ... |
emk/pyjamas | refs/heads/master | pygtkweb/demos/053-actions.py | 13 | #!/usr/bin/env python
import pygtk
pygtk.require('2.0')
import gtk
class ActionExample:
def __init__(self):
# Create the toplevel window
window = gtk.Window()
window.connect('destroy', lambda w: gtk.main_quit())
window.set_size_request(300, -1)
vbox = gtk.VBox()
win... |
BT-fgarbely/odoo | refs/heads/8.0 | addons/mass_mailing/models/mass_mailing_report.py | 364 | # -*- coding: utf-8 -*-
from openerp.osv import fields, osv
from openerp import tools
class MassMailingReport(osv.Model):
_name = 'mail.statistics.report'
_auto = False
_description = 'Mass Mailing Statistics'
_columns = {
'scheduled_date': fields.datetime('Scheduled Date', readonly=True),
... |
DavideCanton/Python3 | refs/heads/master | provaqt/prova.py | 1 | __author__ = 'davide'
import sys
from PyQt4.QtGui import QMainWindow, QApplication, QMessageBox
from finestra import Ui_finestra
class ProvaFinestra(QMainWindow, Ui_finestra):
def __init__(self):
QMainWindow.__init__(self)
# Set up the user interface from Designer.
self.setupUi(self)
... |
st-tu-dresden/inloop | refs/heads/main | inloop/solutions/migrations/0003_add_scoped_id.py | 1 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.3 on 2016-12-02 14:35
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
... |
RicardoJohann/um | refs/heads/master | erpnext/setup/doctype/country/country.py | 41 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class Country(Document):
pass |
3nids/QGIS | refs/heads/master | tests/src/python/test_qgslayoutpicture.py | 30 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsLayoutPicture.
.. note:: 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.
"""
... |
xuewei4d/scikit-learn | refs/heads/master | examples/cluster/plot_mini_batch_kmeans.py | 23 | """
====================================================================
Comparison of the K-Means and MiniBatchKMeans clustering algorithms
====================================================================
We want to compare the performance of the MiniBatchKMeans and KMeans:
the MiniBatchKMeans is faster, but give... |
msebire/intellij-community | refs/heads/master | python/testData/inspections/PyArgumentListInspection/TimetupleOnAssertedDate/_datetime.py | 30 | class date:
def timetuple(self):
pass |
Seagate/swift | refs/heads/master | test/probe/__init__.py | 52 | from test import get_config
from swift.common.utils import config_true_value
config = get_config('probe_test')
CHECK_SERVER_TIMEOUT = int(config.get('check_server_timeout', 30))
VALIDATE_RSYNC = config_true_value(config.get('validate_rsync', False))
|
steromano87/Woodpecker | refs/heads/develop | setup.py | 1 | from setuptools import setup
import versioneer
def readme():
with open('README.rst') as f:
return f.read()
def requirements():
with open('requirements.txt') as f:
return f.readlines()
setup(
name='woodpecker',
version=versioneer.get_version(),
cmdclass=versioneer.get_cmdclass(... |
wrouesnel/ansible | refs/heads/devel | lib/ansible/modules/cloud/cloudstack/cs_portforward.py | 73 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2015, René Moser <mail@renemoser.net>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... |
neumerance/deploy | refs/heads/master | .venv/lib/python2.7/site-packages/django/contrib/localflavor/it/it_province.py | 110 | # -*- coding: utf-8 -*
from __future__ import unicode_literals
PROVINCE_CHOICES = (
('AG', 'Agrigento'),
('AL', 'Alessandria'),
('AN', 'Ancona'),
('AO', 'Aosta'),
('AR', 'Arezzo'),
('AP', 'Ascoli Piceno'),
('AT', 'Asti'),
('AV', 'Avellino'),
('BA', 'Bari'),
('BT', 'Barletta-Andr... |
dcroc16/skunk_works | refs/heads/master | google_appengine/lib/django-1.4/tests/modeltests/generic_relations/models.py | 36 | """
34. Generic relations
Generic relations let an object have a foreign key to any object through a
content-type/object-id field. A ``GenericForeignKey`` field can point to any
object, be it animal, vegetable, or mineral.
The canonical example is tags (although this example implementation is *far*
from complete).
""... |
yamahata/neutron | refs/heads/master | neutron/services/metering/agents/__init__.py | 252 | # Copyright (C) 2013 eNovance SAS <licensing@enovance.com>
#
# Author: Sylvain Afchain <sylvain.afchain@enovance.com>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apach... |
vitan/hue | refs/heads/master | desktop/core/src/desktop/api2.py | 4 | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... |
vitan/hue | refs/heads/master | apps/hbase/src/hbase/server/__init__.py | 646 | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... |
rmoorman/sqlalchemy-utils | refs/heads/master | sqlalchemy_utils/utils.py | 6 | import sys
from collections import Iterable
import six
def str_coercible(cls):
if sys.version_info[0] >= 3: # Python 3
def __str__(self):
return self.__unicode__()
else: # Python 2
def __str__(self):
return self.__unicode__().encode('utf8')
cls.__str__ = __str__... |
6112/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/html5lib/html5lib/filters/lint.py | 979 | from __future__ import absolute_import, division, unicode_literals
from gettext import gettext
_ = gettext
from . import _base
from ..constants import cdataElements, rcdataElements, voidElements
from ..constants import spaceCharacters
spaceCharacters = "".join(spaceCharacters)
class LintError(Exception):
pass
... |
hchen13/ethanbit | refs/heads/master | projects/admin.py | 1 | from django.contrib import admin
from .models import *
admin.site.register(Project) |
dhp-denero/LibrERP | refs/heads/master | l10n_it_sale/__init__.py | 2 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2010 Associazione OpenERP Italia
# (<http://www.openerp-italia.org>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero G... |
brettwooldridge/buck | refs/heads/master | third-party/py/unittest2/unittest2/loader.py | 139 | """Loading unittests."""
import os
import re
import sys
import traceback
import types
import unittest
from fnmatch import fnmatch
from unittest2 import case, suite
try:
from os.path import relpath
except ImportError:
from unittest2.compatibility import relpath
__unittest = True
def _CmpToKey(mycmp):
... |
EraYaN/CouchPotatoServer | refs/heads/master | couchpotato/core/downloaders/synology.py | 34 | import json
import traceback
from couchpotato.core._base.downloader.main import DownloaderBase
from couchpotato.core.helpers.encoding import isInt
from couchpotato.core.helpers.variable import cleanHost
from couchpotato.core.logger import CPLog
import requests
log = CPLog(__name__)
autoload = 'Synology'
class Syn... |
piyush1911/git-cola | refs/heads/master | cola/version.py | 11 | # Copyright (c) David Aguilar
"""Provide git-cola's version number"""
from __future__ import division, absolute_import, unicode_literals
import os
import sys
if __name__ == '__main__':
srcdir = os.path.dirname(os.path.dirname(__file__))
sys.path.insert(1, srcdir)
from cola.git import git
from cola.git import... |
JorgeCoock/django | refs/heads/master | tests/model_validation/models.py | 260 | from django.db import models
class ThingItem(object):
def __init__(self, value, display):
self.value = value
self.display = display
def __iter__(self):
return (x for x in [self.value, self.display])
def __len__(self):
return 2
class Things(object):
def __iter__(se... |
ByStudent666/XsCrypto | refs/heads/master | XsCrypto/Des.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'ByStudent'
from Crypto.Cipher import DES
def de_DES(c,key,mode,iv=0):
"""
:param c: 密文
:param key: 密钥(8byte)
:param mode: 加密方式(ecb/cbc)
:param iv: iv
:return: 明文
"""
if mode == 'ecb':
cipher = DES.new(key, DES.MODE_ECB)
... |
moutai/scikit-learn | refs/heads/master | sklearn/datasets/setup.py | 24 |
import numpy
import os
def configuration(parent_package='', top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('datasets', parent_package, top_path)
config.add_data_dir('data')
config.add_data_dir('descr')
config.add_data_dir('images')
config.add_data_d... |
chudaol/edx-platform | refs/heads/master | lms/djangoapps/courseware/tests/test_entrance_exam.py | 10 | """
Tests use cases related to LMS Entrance Exam behavior, such as gated content access (TOC)
"""
from mock import patch, Mock
from django.core.urlresolvers import reverse
from nose.plugins.attrib import attr
from courseware.model_data import FieldDataCache
from courseware.module_render import toc_for_course, get_mod... |
evamwangi/bc-7-Todo_List | refs/heads/master | venv/Lib/site-packages/flask/testsuite/blueprints.py | 563 | # -*- coding: utf-8 -*-
"""
flask.testsuite.blueprints
~~~~~~~~~~~~~~~~~~~~~~~~~~
Blueprints (and currently modules)
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import flask
import unittest
import warnings
from flask.testsuite import FlaskTestCase, emi... |
MaxStrange/ArtieInfant | refs/heads/master | scripts/spectrogram_verifier/verifier.py | 1 | """
Verifies if all the spectrograms in a directory are the same dimensionality.
Prints out any that are not the expected dimensionality.
"""
import imageio
import os
import sys
import tqdm
if __name__ == "__main__":
if len(sys.argv) != 3:
print("USAGE: python {} <path-to-dir> <remove: y/n>".format(sys.arg... |
huguesv/PTVS | refs/heads/master | Python/Product/Miniconda/Miniconda3-x64/Tools/scripts/gprof2html.py | 28 | #! /usr/bin/env python3
"""Transform gprof(1) output into useful HTML."""
import html
import os
import re
import sys
import webbrowser
header = """\
<html>
<head>
<title>gprof output (%s)</title>
</head>
<body>
<pre>
"""
trailer = """\
</pre>
</body>
</html>
"""
def add_escapes(filename):
with open(filename)... |
ebenezzerr/search-bot | refs/heads/master | plugins/canary.py | 1 | import time
outputs = []
def canary():
#NOTE: you must add a real channel ID for this to work
outputs.append(["D0FEYBP9V", "bot started: " + str(time.time())])
canary()
|
CyanogenMod/android_external_chromium_org | refs/heads/cm-12.0 | tools/cr/cr/actions/gyp.py | 59 | # Copyright 2013 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.
"""A module to add gyp support to cr."""
import cr
import os
GYP_DEFINE_PREFIX = 'GYP_DEF_'
class GypPrepareOut(cr.PrepareOut):
"""A prepare action that... |
sudheesh001/oh-mainline | refs/heads/master | vendor/packages/twisted/doc/lore/howto/listings/lore/a_lore_plugin.py | 21 |
from zope.interface import implements
from twisted.plugin import IPlugin
from twisted.lore.scripts.lore import IProcessor
class MyHTML(object):
implements(IPlugin, IProcessor)
name = "myhtml"
moduleName = "myhtml.factory"
|
dpgeorge/micropython | refs/heads/master | tests/basics/bytes_compare.py | 117 | print(b"" == b"")
print(b"" > b"")
print(b"" < b"")
print(b"" == b"1")
print(b"1" == b"")
print("==")
print(b"" > b"1")
print(b"1" > b"")
print(b"" < b"1")
print(b"1" < b"")
print(b"" >= b"1")
print(b"1" >= b"")
print(b"" <= b"1")
print(b"1" <= b"")
print(b"1" == b"1")
print(b"1" != b"1")
print(b"1" == b"2")
print(b"1... |
anntzer/scipy | refs/heads/master | scipy/stats/_binned_statistic.py | 12 | import builtins
import numpy as np
from numpy.testing import suppress_warnings
from operator import index
from collections import namedtuple
__all__ = ['binned_statistic',
'binned_statistic_2d',
'binned_statistic_dd']
BinnedStatisticResult = namedtuple('BinnedStatisticResult',
... |
t-abe/chainer | refs/heads/master | tests/chainer_tests/functions_tests/loss_tests/test_hinge.py | 3 | import unittest
import numpy
import six
import chainer
from chainer import cuda
from chainer import functions
from chainer import gradient_check
from chainer import testing
from chainer.testing import attr
from chainer.testing import condition
class TestHinge(unittest.TestCase):
def setUp(self):
self.x... |
pierreg/tensorflow | refs/heads/master | tensorflow/python/training/adagrad_test.py | 19 | # 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... |
nkrishnaswami/census | refs/heads/master | uscensus/data/__init__.py | 1 | from .discovery import DiscoveryInterface
|
looooo/pivy | refs/heads/master | scons/scons-local-1.2.0.d20090919/SCons/Tool/mssdk.py | 2 | #
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons Foundation
#
# 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 limitati... |
Tokyo-Buffalo/tokyosouth | refs/heads/master | env/lib/python3.6/site-packages/twisted/pair/ip.py | 13 | # -*- test-case-name: twisted.pair.test.test_ip -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
#
"""Support for working directly with IP packets"""
import struct
import socket
from twisted.internet import protocol
from twisted.pair import raw
from zope.interface import implementer
cl... |
gocardless/gocardless-pro-python | refs/heads/master | gocardless_pro/services/subscriptions_service.py | 1 | # WARNING: Do not edit by hand, this file was generated by Crank:
#
# https://github.com/gocardless/crank
#
from . import base_service
from .. import resources
from ..paginator import Paginator
from .. import errors
class SubscriptionsService(base_service.BaseService):
"""Service class that provides access to t... |
jasonbot/django | refs/heads/master | tests/utils_tests/test_safestring.py | 278 | from __future__ import unicode_literals
from django.template import Context, Template
from django.test import SimpleTestCase
from django.utils import html, six, text
from django.utils.encoding import force_bytes, force_text
from django.utils.functional import lazy
from django.utils.safestring import (
EscapeData, ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.