repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
MatthewWilkes/mw4068-packaging | refs/heads/master | thirdparty/google_appengine/lib/django/django/utils/datastructures.py | 32 | class MergeDict(object):
"""
A simple class for creating new "virtual" dictionaries that actualy look
up values in more than one dictionary, passed in the constructor.
"""
def __init__(self, *dicts):
self.dicts = dicts
def __getitem__(self, key):
for dict in self.dicts:
... |
LiJingkang/PyQt5 | refs/heads/master | Learn/基础组件/PyQt5_1_空窗口.py | 1 | import sys
# QWidget 组件导入
from PyQt5.QtWidgets import QApplication, QWidget
if __name__ == '__main__':
# sys.argv 来自命令行的参数列表
# PyQt5 都必须创建一个 Application 对象
app = QApplication(sys.argv)
# 所有用户界面的基础类 提供默认的构造方法 没有父类的 Widget 组件将当作一个窗口使用
w = QWidget()
# 宽 高
w.resize(250, 150)
# 移动 QWidget 组... |
adarob/magenta | refs/heads/master | magenta/models/latent_transfer/nn.py | 2 | # Copyright 2019 The Magenta 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 ... |
vit2/vit-e2 | refs/heads/master | lib/python/Tools/Alternatives.py | 9 | from enigma import eServiceCenter, eServiceReference
def getAlternativeChannels(service):
alternativeServices = eServiceCenter.getInstance().list(eServiceReference(service))
return alternativeServices and alternativeServices.getContent("S", True)
def CompareWithAlternatives(serviceA, serviceB):
return serviceA an... |
mdaif/olympia | refs/heads/master | migrations/653-backfill-app-install-counts.py | 39 | import datetime
from stats.models import GlobalStat
from mkt.monolith.models import MonolithRecord
METRIC = 'apps_count_installed'
def run():
"""Backfill apps_count_installed."""
# Get the first metric and increment daily until today's date.
today = datetime.datetime.today().replace(hour=0, minute=0, s... |
aapris/linkedevents | refs/heads/master | events/tests/test_api.py | 2 | import pytest
from ..models import Event
from .utils import versioned_reverse as reverse
@pytest.mark.django_db
def test_api_page_size(api_client, event):
event_count = 200
id_base = event.id
for i in range(0, event_count):
event.pk = "%s-%d" % (id_base, i)
event.save(force_insert=True)
... |
yaybu/touchdown | refs/heads/master | touchdown/tests/fixtures/aws/network_acl.py | 1 | # Copyright 2016 Isotoma Limited
#
# 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... |
crazcalm/AngelHack_python34 | refs/heads/master | myenv/Lib/site-packages/pip/_vendor/requests/packages/chardet/euckrprober.py | 2930 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... |
oberlin/django | refs/heads/master | django/dispatch/__init__.py | 758 | """Multi-consumer multi-producer dispatching mechanism
Originally based on pydispatch (BSD) http://pypi.python.org/pypi/PyDispatcher/2.0.1
See license.txt for original license.
Heavily modified for Django's purposes.
"""
from django.dispatch.dispatcher import Signal, receiver # NOQA
|
fedesanchez/suite-3.1 | refs/heads/master | recipes/resources/openlayers/tools/shrinksafe.py | 293 | #!/usr/bin/env python
#
# Script to provide a wrapper around the ShrinkSafe "web service"
# <http://shrinksafe.dojotoolkit.org/>
#
#
# We use this script for two reasons:
#
# * This avoids having to install and configure Java and the standalone
# ShrinkSafe utility.
#
# * The current ShrinkSafe standalone utility... |
bluedynamics/activities.metamodel | refs/heads/master | src/activities/metamodel/tests/testrunner.py | 1 | # -*- coding: utf-8 -*-
#
# Copyright 2009: Johannes Raggam, BlueDynamics Alliance
# http://bluedynamics.com
# GNU Lesser General Public License Version 2 or later
__author__ = """Johannes Raggam <johannes@raggam.co.at>"""
__docformat__ = 'plaintext'
import unittest
import doctest
from interlude impor... |
hurricup/intellij-community | refs/heads/master | python/testData/inspections/AddParameter.py | 83 | def foo(a, *er):
return <error descr="Unresolved reference 'test'">tes<caret>t</error> |
agusc/scrapy | refs/heads/master | scrapy/extensions/corestats.py | 189 | """
Extension for collecting core stats like items scraped and start/finish times
"""
import datetime
from scrapy import signals
class CoreStats(object):
def __init__(self, stats):
self.stats = stats
@classmethod
def from_crawler(cls, crawler):
o = cls(crawler.stats)
crawler.sign... |
tylertian/Openstack | refs/heads/master | openstack F/cinder/cinder/tests/api/openstack/test_xmlutil.py | 4 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack LLC.
# 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/... |
M0Rf30/sacks | refs/heads/master | voip/py_voipDialog.py | 1 | # Sacks: a video conference-meeting system
# Copyright (C) 2009 Associazione Intellicom
#
# Authors: Marcello Di Guglielmo, Daniel Donato
# info_AT_riunionidigitali.org
#
# 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 ... |
ybenitezf/nstock | refs/heads/master | modules/whoosh/codec/plaintext.py | 22 | # Copyright 2012 Matt Chaput. 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 the... |
pcm17/tensorflow | refs/heads/master | tensorflow/contrib/slim/python/slim/learning.py | 3 | # 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... |
isaiasmercadom/foursquared.eclair | refs/heads/master | util/gen_class.py | 262 | #!/usr/bin/python
import datetime
import sys
import textwrap
import common
from xml.dom import pulldom
HEADER = """\
/**
* Copyright 2009 Joe LaPenna
*/
package com.joelapenna.foursquare.types;
%(imports)s
/**
* Auto-generated: %(timestamp)s
*
* @author Joe LaPenna (joe@joelapenna.com)
*/
public class %(type... |
sauloal/cufflinksviewer | refs/heads/master | venvlin/lib/python2.7/site-packages/Werkzeug-0.8.3-py2.7.egg/werkzeug/formparser.py | 84 | # -*- coding: utf-8 -*-
"""
werkzeug.formparser
~~~~~~~~~~~~~~~~~~~
This module implements the form parsing. It supports url-encoded forms
as well as non-nested multipart uploads.
:copyright: (c) 2011 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more deta... |
SeaFalcon/Musicool_Pr | refs/heads/master | lib/sqlalchemy/ext/serializer.py | 33 | # ext/serializer.py
# Copyright (C) 2005-2014 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Serializer/Deserializer objects for usage with SQLAlchemy query structures,
all... |
polyval/CNC | refs/heads/master | flask/Lib/site-packages/migrate/tests/fixture/models.py | 124 | from sqlalchemy import *
# test rundiffs in shell
meta_old_rundiffs = MetaData()
meta_rundiffs = MetaData()
meta = MetaData()
tmp_account_rundiffs = Table('tmp_account_rundiffs', meta_rundiffs,
Column('id', Integer, primary_key=True),
Column('login', Text()),
Column('passwd', Text()),
)
tmp_sql_table = T... |
gorkinovich/DefendersOfMankind | refs/heads/master | dependencies/boost-1.46.0/tools/build/v2/test/symlink.py | 20 | #!/usr/bin/python
# Copyright 2003 Dave Abrahams
# 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)
# Test the 'symlink' rule.
import os
import BoostBuild
if os.name != 'posix':
print "The... |
zlorb/mitmproxy | refs/heads/master | test/mitmproxy/test_connections.py | 3 | import socket
import threading
import ssl
import OpenSSL
import pytest
from unittest import mock
from mitmproxy import connections
from mitmproxy import exceptions
from mitmproxy.net import tcp
from mitmproxy.net.http import http1
from mitmproxy.test import tflow
from .net import tservers
from pathod import test
cla... |
YangSongzhou/django | refs/heads/master | tests/validation/tests.py | 301 | from __future__ import unicode_literals
from django import forms
from django.core.exceptions import NON_FIELD_ERRORS
from django.test import TestCase
from django.utils.functional import lazy
from . import ValidationTestCase
from .models import (
Article, Author, GenericIPAddressTestModel, GenericIPAddrUnpackUniqu... |
Elico-Corp/odoo_OCB | refs/heads/9.0 | addons/mass_mailing/controllers/__init__.py | 47 | # -*- coding: utf-8 -*-
import main
import web_editor
|
johngian/mozillians | refs/heads/master | mozillians/users/migrations/0007_auto_20160516_0814.py | 4 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import mozillians.users.models
class Migration(migrations.Migration):
dependencies = [
('users', '0006_auto_20160505_0348'),
]
operations = [
migrations.AddField(
model_n... |
rakeshmi/cinder | refs/heads/master | cinder/tests/unit/api/contrib/test_volume_image_metadata.py | 3 | # Copyright 2012 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 applicable law or a... |
apixandru/intellij-community | refs/heads/master | python/testData/inspections/RenameShadowingBuiltins_after.py | 65 | def f(name):
a = open(name, 'rb')
return a.read()
|
gangadharkadam/saloon_erp | refs/heads/master | erpnext/manufacturing/doctype/production_plan_item/production_plan_item.py | 121 | # Copyright (c) 2015, Frappe 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 ProductionPlanItem(Document):
pass |
lgeiger/ide-python | refs/heads/master | dist/debugger/VendorLib/vs-py-debugger/pythonFiles/experimental/ptvsd/ptvsd/exit_handlers.py | 2 | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See LICENSE in the project root
# for license information.
import atexit
import os
import platform
import signal
class AlreadyInstalledError(RuntimeError):
"""Exit handlers were already installed."""
class Unsupported... |
vyouzhis/energy | refs/heads/master | epyalgo/pyAlgoBollinger.py | 1 | #!/usr/bin/python2
# -*- coding: utf-8 -*-
# home
#
#
# vim:fileencoding=utf-8:sw=4:et -*- coding: utf-8 -*-
#
# 测试 pyalgotrade 回测
#
import _index
from energy.libs.MongoStock import Feed
from energy.libs.eAlgoLib import eAlgoLib as eal
from pyalgotrade import strategy
from pyalgotrade import bar
from pyalgotrade.tec... |
Fujin-Suzukaze/GT-I9505-Kernel-JB-4.3 | refs/heads/master | 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... |
yangzilong1986/python | refs/heads/master | 4disland/0000/add_num.py | 38 | from PIL import Image, ImageDraw, ImageFont
def add_num(img):
draw = ImageDraw.Draw(img)
myfont = ImageFont.truetype('C:/windows/fonts/Arial.ttf', size=40)
fillcolor = "#ff0000"
width, height = img.size
draw.text((width-40, 0), '99', font=myfont, fill=fillcolor)
img.save('result.jpg','jpeg')
... |
tommystendahl/cassandra | refs/heads/trunk | pylib/cqlshlib/test/test_cqlsh_commands.py | 32 | # 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... |
adviti/melange | refs/heads/master | thirdparty/google_appengine/lib/django_1_2/tests/regressiontests/signals_regress/tests.py | 43 | import sys
from StringIO import StringIO
from django.test import TestCase
from django.db import models
from regressiontests.signals_regress.models import Author, Book
signal_output = []
def pre_save_test(signal, sender, instance, **kwargs):
signal_output.append('pre_save signal, %s' % instance)
if kwargs.get... |
sxjscience/tvm | refs/heads/master | tests/python/frontend/onnx/test_forward.py | 1 | # 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... |
Kodiack/WhileyWeb | refs/heads/master | lib/cherrypy/_cpwsgi_server.py | 82 | """WSGI server interface (see PEP 333). This adds some CP-specific bits to
the framework-agnostic wsgiserver package.
"""
import sys
import cherrypy
from cherrypy import wsgiserver
class CPWSGIServer(wsgiserver.CherryPyWSGIServer):
"""Wrapper for wsgiserver.CherryPyWSGIServer.
wsgiserver has been design... |
whitehorse-io/encarnia | refs/heads/master | pyenv/lib/python2.7/site-packages/twisted/internet/iocpreactor/udp.py | 13 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
UDP support for IOCP reactor
"""
import socket, operator, struct, warnings, errno
from zope.interface import implementer
from twisted.internet import defer, address, error, interfaces
from twisted.internet.abstract import isIPAddress, isIPv... |
guker/spear | refs/heads/master | config/database/mobio/mobile0-female.py | 1 | #!/usr/bin/env python
import xbob.db.verification.filelist
# 0/ The database to use
name = 'mobile0-female'
db = xbob.db.verification.filelist.Database('protocols/mobio/mobile0-female/')
protocol = None
wav_input_dir = "/idiap/resource/database/mobio/denoisedAUDIO_16k/"
wav_input_ext = ".wav"
|
neuropsychology/NeuroKit.py | refs/heads/master | examples/UnderDev/eeg/eeg_time_frequency.py | 1 | """
Time-frequency submodule.
"""
from .eeg_data import eeg_select_electrodes
from ..miscellaneous import Time
import numpy as np
import pandas as pd
import mne
# ==============================================================================
# =========================================================================... |
SergiuMir/python-phonenumbers | refs/heads/dev | python/phonenumbers/shortdata/region_VI.py | 11 | """Auto-generated file, do not edit by hand. VI metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_VI = PhoneMetadata(id='VI', country_code=None, international_prefix=None,
general_desc=PhoneNumberDesc(national_number_pattern='9\\d{2}', possible_number_pattern='\\d{... |
jbonofre/incubator-beam | refs/heads/master | sdks/python/apache_beam/metrics/execution.py | 2 | #
# 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... |
AtaraxiaEta/ardupilot | refs/heads/master | mk/PX4/Tools/genmsg/src/genmsg/base.py | 216 | # Software License Agreement (BSD License)
#
# Copyright (c) 2011, Willow Garage, 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 ... |
steveb/heat | refs/heads/master | heat/tests/clients/test_keystone_client.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
# ... |
mansenfranzen/ultimate | refs/heads/master | django/app_tutorial/admin.py | 1 | from django.contrib import admin
# Register your models here.
from .models import Tournament, Team, TournamentParticipation, Game, \
GameReport, SpirtScore, Profile, Nationality, Division, TournamentType, \
GameReportEventType, GameType, SpiritScoreCategory
admin.site.register(Profile)
admin.site.register(Te... |
kswiat/django | refs/heads/master | tests/apps/tests.py | 7 | from __future__ import unicode_literals
import os
import sys
from unittest import skipUnless
from django.apps import apps, AppConfig
from django.apps.registry import Apps
from django.contrib.admin.models import LogEntry
from django.core.exceptions import ImproperlyConfigured
from django.db import models
from django.t... |
pshen/ansible | refs/heads/devel | lib/ansible/plugins/action/net_command.py | 450 | # (c) 2017, Ansible Inc,
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is di... |
minishift/minishift-centos-iso | refs/heads/master | tests/utils/minishift_latest_version.py | 3 | #!/usr/bin/env python
import requests
import re
import os
import platform
distributionInfo = platform.platform()
matchObj = re.match( r'linux|darwin', distributionInfo, re.I)
OS= matchObj.group().lower()
def main():
pattern = re.compile(".*%s-amd64.tgz$" % OS)
r = requests.get('https://api.github.com/repos/... |
kevinlondon/flexx | refs/heads/master | flexx/ui/_progressbar.py | 20 | """
Simple example:
.. UIExample:: 50
p = ui.ProgressBar(value=0.7)
Interactive example:
.. UIExample:: 100
from flexx import app, ui, react
class Example(ui.Widget):
def init(self):
with ui.HBox():
self.b1 = ui.Button(flex=0, text='Less')
... |
information-node/information-node | refs/heads/master | informationnode/daemon/encryption/test_identity.py | 1 |
'''
information-node - an advanced tool for data synchronization
Copyright (C) 2015 Information Node Development Team (see AUTHORS.md)
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... |
frappe/erpnext | refs/heads/develop | erpnext/non_profit/doctype/chapter/__init__.py | 12133432 | |
jcoady9/python-for-android | refs/heads/master | python-build/python-libs/gdata/tests/all_tests_clear_cache.py | 128 | #!/usr/bin/env python
#
# Copyright (C) 2009 Google 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... |
eCurrency-eCur/eCurrency-v1.0 | refs/heads/eCurrency-(v)-1.0-Release | share/qt/clean_mac_info_plist.py | 1 | #!/usr/bin/env python
# Jonas Schnelli, 2013
# make sure the Bitcoin-Qt.app contains the right plist (including the right version)
# fix made because of serval bugs in Qt mac deployment (https://bugreports.qt-project.org/browse/QTBUG-21267)
from string import Template
from datetime import date
bitcoinDir = "./";
inF... |
stryder199/RyarkAssignments | refs/heads/master | Assignment2/web2py/applications/welcome/views/__init__.py | 12133432 | |
dnozay/lettuce | refs/heads/master | tests/integration/lib/Django-1.2.5/tests/regressiontests/__init__.py | 12133432 | |
anksp21/Community-Zenpacks | refs/heads/master | ZenPacks.community.RDBMS/ZenPacks/community/RDBMS/modeler/__init__.py | 12133432 | |
sunils34/buffer-django-nonrel | refs/heads/master | tests/regressiontests/utils/test_module/__init__.py | 12133432 | |
isyippee/oslo.messaging | refs/heads/master | oslo_messaging/_drivers/protocols/__init__.py | 12133432 | |
vipulroxx/kivy | refs/heads/master | examples/demo/multistroke/main.py | 29 | #!/usr/bin/env python
'''
Multistroke Recognition Database Demonstration
==============================================
This application records gestures and attempts to match them. You should
see a black drawing surface with some buttons across the bottom. As you
make a gesture on the drawing surface, the gesture wil... |
openstack/heat | refs/heads/master | heat/tests/openstack/cinder/test_volume_utils.py | 1 | #
# 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
# ... |
damahou/sagewui | refs/heads/master | sagewui_kernels/sage/workers.py | 1 | """
sagewui_kernels.sage workers
AUTHORS:
- J Miguel Farto
"""
#############################################################################
#
# Copyright (C) 2015 J Miguel Farto <jmfarto@gmail.com>
# Distributed under the terms of the GNU General Public License (GPL)
# The full text of the GPL is availabl... |
customcommander/selenium | refs/heads/master | py/selenium/common/exceptions.py | 68 | # Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... |
azanegin/miptcommuna | refs/heads/master | bootstrap3/renderers.py | 4 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib.auth.forms import ReadOnlyPasswordHashWidget
from django.forms import (
TextInput, DateInput, FileInput, CheckboxInput,
ClearableFileInput, Select, RadioSelect, CheckboxSelectMultiple
)
from django.forms.extras import SelectDat... |
sun3shines/swift-1.7.4 | refs/heads/master | swift/lib/utils.py | 1 | # -*- coding: utf-8 -*-
def file_decrypt(data,mode,storetype):
return data
|
ueshin/apache-spark | refs/heads/master | examples/src/main/python/ml/aft_survival_regression.py | 27 | #
# 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... |
VanirAOSP/external_chromium_org | refs/heads/kk44 | tools/cr/cr/targets/chromium_testshell.py | 24 | # 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.
"""Module for the chromium_testshell targets."""
import cr
class ChromiumTestShellTarget(cr.NamedTarget):
NAME = 'chromium_testshell'
DEFAULT = cr.Con... |
elover/python-django-blog | refs/heads/master | myblog/pygments/styles/manni.py | 364 | # -*- coding: utf-8 -*-
"""
pygments.styles.manni
~~~~~~~~~~~~~~~~~~~~~
A colorful style, inspired by the terminal highlighting style.
This is a port of the style used in the `php port`_ of pygments
by Manni. The style is called 'default' there.
:copyright: Copyright 2006-2013 by the Pygments... |
phobson/wqio | refs/heads/master | wqio/samples.py | 2 | from matplotlib import pyplot
import seaborn
import pandas
from wqio import utils
from pandas.plotting import register_matplotlib_converters
register_matplotlib_converters()
class Parameter(object):
def __init__(self, name, units, usingTex=False):
""" Class representing a single analytical parameter (p... |
theflofly/tensorflow | refs/heads/master | tensorflow/contrib/boosted_trees/estimator_batch/custom_export_strategy.py | 13 | # 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... |
davidsiefert/ansible-modules-extras | refs/heads/devel | monitoring/zabbix_screen.py | 59 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013-2014, Epic Games, Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (... |
janusnic/21v-pyqt | refs/heads/master | unit_08/main6.py | 1 | # -*- coding:utf-8 -*-
import os
import sys
from PyQt4.QtGui import *
from PyQt4.QtCore import *
from sqldb import *
from add_customer import *
class ShopWindow(QMainWindow):
def __init__(self, parent=None):
super(ShopWindow, self).__init__(parent)
self.setMinimumWidth(850)
self.setWindow... |
coreycb/charm-keystone | refs/heads/master | charmhelpers/cli/commands.py | 3 | # Copyright 2014-2015 Canonical Limited.
#
# 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 ... |
drkitty/cyder | refs/heads/master | cyder/cydns/domain/urls.py | 5 | from django.conf.urls.defaults import *
from cyder.cydns.urls import cydns_urls
from cyder.cydns.domain.views import domain_detail, get_all_domains, search
urlpatterns = cydns_urls('domain') + patterns(
'',
url(r'^search/', search, name='domain-search'),
url(r'^get_all_domains/$', get_all_domains, name='... |
biotrump/ITK | refs/heads/master | Utilities/Maintenance/BuildHeaderTest.py | 10 | #!/usr/bin/env python
#==========================================================================
#
# Copyright Insight Software Consortium
#
# 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 Licen... |
AlexisTM/Indoor_Position_lasers | refs/heads/master | laserpack/bin/Kalman.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Kalman.py
Kalman.py is an implementation of the 1D Kalman filter to get a mean
and an implementation of a custom 4D Kalman filter to track position
& heading of the UAV
This file is part of ILPS (Indoor Laser Positioning System).
ILPS is free software: you can re... |
astrobin/astrobin | refs/heads/master | astrobin_apps_premium/models.py | 1 | from django.contrib.auth.models import User
from django.db import models
from django.utils.translation import ugettext_lazy as _
class DataLossCompensationRequest(models.Model):
user = models.ForeignKey(
User,
editable=False
)
created = models.DateTimeField(
auto_now_add=True,
... |
veerupandey/Penetration-Testing-Toolkit | refs/heads/master | lab/harvester/discovery/DNS/Opcode.py | 65 | """
$Id: Opcode.py,v 1.6 2002/04/23 10:51:43 anthonybaxter Exp $
This file is part of the pydns project.
Homepage: http://pydns.sourceforge.net
This code is covered by the standard Python License.
Opcode values in message header. RFC 1035, 1996, 2136.
"""
QUERY = 0
IQUERY = 1
STATUS = 2
NOTIFY = 4
UPDATE = 5... |
ngugi/geonode | refs/heads/master | geonode/documents/views.py | 1 | import json
from django.shortcuts import render_to_response, get_object_or_404
from django.http import HttpResponse, HttpResponseRedirect, Http404
from django.template import RequestContext, loader
from django.utils.translation import ugettext as _
from django.contrib.auth.decorators import login_required
from django.... |
sdague/home-assistant | refs/heads/dev | tests/components/cover/test_init.py | 21 | """The tests for Cover."""
import homeassistant.components.cover as cover
def test_deprecated_base_class(caplog):
"""Test deprecated base class."""
class CustomCover(cover.CoverDevice):
pass
CustomCover()
assert "CoverDevice is deprecated, modify CustomCover" in caplog.text
|
sandow-digital/django-likes | refs/heads/master | likes/exceptions.py | 6 | class LikesNotEnabledException(Exception):
pass
class CannotVoteException(Exception):
pass
|
joshuamorton/tut | refs/heads/master | tut/tools/__init__.py | 1 | from tut.tools import vcs
from tut.tools import env
from tut.tools import lang
from tut.tools import dep
from tut.tools import test
EVALUATION_ORDER = ['vcs', 'env', 'lang' ,'dep', 'test']
TOOL_MAPPING = {
'vcs': {
'git': vcs.GitTool,
'hg': None
},
'env': {
... |
paplorinc/intellij-community | refs/heads/master | plugins/hg4idea/testData/bin/mercurial/unionrepo.py | 91 | # unionrepo.py - repository class for viewing union of repository changesets
#
# Derived from bundlerepo.py
# Copyright 2006, 2007 Benoit Boissinot <bboissin@gmail.com>
# Copyright 2013 Unity Technologies, Mads Kiilerich <madski@unity3d.com>
#
# This software may be used and distributed according to the terms of the
# ... |
quinot/ansible | refs/heads/devel | lib/ansible/modules/network/aci/aci_tenant_span_src_group_to_dst_group.py | 5 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 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',
'status': ['preview'],
... |
semonte/intellij-community | refs/heads/master | python/testData/resolve/multiFile/functionAndSubmoduleNamedIdentically/p1/__init__.py | 83 | from m1 import m1 |
calfonso/ansible | refs/heads/devel | lib/ansible/modules/storage/netapp/netapp_e_snapshot_volume.py | 36 | #!/usr/bin/python
# (c) 2016, NetApp, 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',
'status': ['preview'],
... |
JetBrains/intellij-community | refs/heads/master | python/testData/resolve/TypeShedInsteadPy.py | 15 | from datetime import MINYEAR
# <ref> |
brechtvl/OpenShadingLanguage | refs/heads/master | testsuite/error-dupes/run.py | 434 | #!/usr/bin/env python
command = testshade("-g 2 2 test")
|
stinos/micropython | refs/heads/master | tests/basics/class_number.py | 118 | # test class with __add__ and __sub__ methods
class C:
def __init__(self, value):
self.value = value
def __add__(self, rhs):
print(self.value, '+', rhs)
def __sub__(self, rhs):
print(self.value, '-', rhs)
c = C(0)
c + 1
c - 2
|
crchemist/scioncc | refs/heads/master | src/pyon/container/shell_api.py | 2 | #!/usr/bin/env python
"""Provides the interactive API for the pyon container."""
__author__ = 'Michael Meisinger'
container = None
def get_console_dimensions():
"""Returns (rowns, columns) of current terminal"""
import os
rows, columns = os.popen('stty size', 'r').read().split()
return int(rows), i... |
iotile/coretools | refs/heads/master | iotilebuild/test/test_iotilebuild/python_component/python/vtile.py | 1 |
class VirtualTile(object):
pass
|
squarerootfury/distrochooser | refs/heads/master | backend/distrochooser/migrations/0019_auto_20190406_1248.py | 2 | # Generated by Django 2.1.2 on 2019-04-06 10:48
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('distrochooser', '0018_auto_20190406_1248'),
]
operations = [
migrations.AlterField(
model_name='us... |
indictranstech/omnitech-frappe | refs/heads/master | frappe/patches/v4_0/change_varchar_length.py | 32 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
def execute():
for dt in frappe.db.sql_list("""select name from `tabDocType` where ifnull(issingle, 0)=0"""):
desc = dict((d["Field"], d) for d in frappe.db.sql(... |
fairyzoro/python | refs/heads/master | llluiop/0007/CodeLine.py | 38 | #!/usr/bin.env python
import os
def main():
f = open('code.cpp')
blanks = 0
comments = 0
lines = 0
for line in f.readlines():
if len(line.split()) == 0:
blanks += 1
elif line.startswith("//"):
comments += 1
elif line.startswith("/*"):
c... |
leggitta/mne-python | refs/heads/master | mne/io/open.py | 8 | # Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Matti Hamalainen <msh@nmr.mgh.harvard.edu>
#
# License: BSD (3-clause)
from ..externals.six import string_types
import numpy as np
import os.path as op
from io import BytesIO
from .tag import read_tag_info, read_tag, read_big, Tag
from... |
seeminglee/pyglet64 | refs/heads/master | experimental/mt_media/mt_app_carbon.py | 28 | # ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistribu... |
onitake/ansible | refs/heads/devel | lib/ansible/modules/monitoring/pingdom.py | 7 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: 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
ANSIBLE_METADATA = {'metadata_version': '1.1',
... |
MackZxh/OCA-Choice | refs/heads/8.0 | account-analytic/pos_analytic_by_config/tests/__init__.py | 4 | # -*- coding: utf-8 -*-
from . import test_pos_analytic_by_config
|
pdellaert/ansible | refs/heads/devel | lib/ansible/modules/network/panos/_panos_admpwd.py | 37 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Ansible module to manage PaloAltoNetworks Firewall
# (c) 2016, techbizdev <techbizdev@paloaltonetworks.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publish... |
Hasimir/brython | refs/heads/master | www/speed/benchmarks/function_call_complex.py | 9 | def f(x, y=0, *args, **kw):
return x
for i in range(100000):
f(i, 5, 6, a=8)
|
bittikettu/JTimer | refs/heads/master | htmlc.py | 4 | # -*- encoding: utf8 -*-
#
# $Id: html.py 5409 2011-06-29 07:07:25Z rjones $
# $HeadURL: svn+ssh://svn/svn/trunk/api/eklib/html.py $
#
'''Simple, elegant HTML, XHTML and XML generation.
Constructing your HTML
----------------------
To construct HTML start with an instance of ``html.HTML()``. Add
tags by accessing the... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.