repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
CTSRD-SOAAP/chromium-42.0.2311.135 | refs/heads/master | tools/perf/benchmarks/inbox_benchmark.py | 3 | # Copyright 2015 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.
from page_sets import inbox
from telemetry import benchmark
from telemetry.web_perf import timeline_based_measurement
@benchmark.Disabled('android', 'refere... |
bcornwellmott/frappe | refs/heads/develop | frappe/patches/v7_2/update_communications.py | 16 | import frappe
def execute():
"""
in communication move feedback details to content
remove Guest None from sender full name
setup feedback request trigger's is_manual field
"""
frappe.reload_doc('core', 'doctype', 'dynamic_link')
frappe.reload_doc('email', 'doctype', 'contact')
frappe.reload_doc("core", "d... |
smspillaz/pychecker | refs/heads/master | test_input/test55.py | 11 | 'd'
def x():
try :
print "howdy, this ain't right"
except KeyError, RuntimeError :
pass
def y():
try :
print "ok, " + "this func %s should be fine" % y.__name__
except (KeyError, RuntimeError) :
pass
def z():
try :
pass
except (KeyError, RuntimeError, I... |
konstruktoid/ansible-upstream | refs/heads/devel | lib/ansible/modules/net_tools/ldap/__init__.py | 12133432 | |
diegojromerolopez/djanban | refs/heads/master | src/djanban/apps/niko_niko_calendar/__init__.py | 12133432 | |
iogf/candocabot | refs/heads/master | plugins/router/__init__.py | 12133432 | |
houzhenggang/hiwifi-openwrt-HC5661-HC5761 | refs/heads/master | staging_dir/target-mipsel_r2_uClibc-0.9.33.2/usr/lib/python2.7/encodings/mac_iceland.py | 593 | """ Python Character Mapping Codec mac_iceland generated from 'MAPPINGS/VENDORS/APPLE/ICELAND.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,input... |
aberke/check-list | refs/heads/master | app/models/receipt.py | 2 | #********************************************************************************
#--------------------------------------------------------------------------------
#
# Significance Labs
# Brooklyn, NYC
#
# Author: Alexandra Berke (aberke)
# Written: Summer 2014
#
#
# Receipt Model
# a receipt is a static snapshot o... |
gtara/or-tools | refs/heads/master | examples/python/broken_weights.py | 32 | # Copyright 2010 Hakan Kjellerstrand hakank@bonetmail.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.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... |
absoludity/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/wptserve/wptserve/request.py | 87 | import base64
import cgi
import Cookie
import StringIO
import tempfile
import urlparse
from . import stash
from .utils import HTTPException
missing = object()
class Server(object):
"""Data about the server environment
.. attribute:: config
Environment configuration information with information about t... |
DrChat/thermoctrl | refs/heads/master | templog/tests.py | 24123 | from django.test import TestCase
# Create your tests here.
|
nishad-jobsglobal/odoo-marriot | refs/heads/master | addons/crm_mass_mailing/mass_mailing.py | 55 | from openerp.osv import osv
class MassMailing(osv.Model):
_name = 'mail.mass_mailing'
_inherit = ['mail.mass_mailing', 'crm.tracking.mixin']
def on_change_model_and_list(self, cr, uid, ids, mailing_model, list_ids, context=None):
res = super(MassMailing, self).on_change_model_and_list(cr, uid, id... |
yongshengwang/builthue | refs/heads/master | desktop/core/ext-py/django-openid-auth-0.5/django_openid_auth/exceptions.py | 45 | # django-openid-auth - OpenID integration for django.contrib.auth
#
# Copyright (C) 2008-2013 Canonical Ltd.
#
# 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 ... |
kawamon/hue | refs/heads/master | desktop/core/ext-py/Django-1.11.29/django/contrib/staticfiles/testing.py | 584 | from django.contrib.staticfiles.handlers import StaticFilesHandler
from django.test import LiveServerTestCase
class StaticLiveServerTestCase(LiveServerTestCase):
"""
Extends django.test.LiveServerTestCase to transparently overlay at test
execution-time the assets provided by the staticfiles app finders. T... |
cyyber/QRL | refs/heads/master | tests/core/txs/test_MessageTransactionStateChanges.py | 2 | from unittest import TestCase
from mock import Mock
from qrl.core import config
from qrl.core.Indexer import Indexer
from qrl.core.misc import logger
from qrl.core.State import State
from qrl.core.StateContainer import StateContainer
from qrl.core.OptimizedAddressState import OptimizedAddressState
from qrl.core.Chain... |
IndonesiaX/edx-platform | refs/heads/master | common/djangoapps/util/disable_rate_limit.py | 164 | """Utilities for disabling Django Rest Framework rate limiting.
This is useful for performance tests in which we need to generate
a lot of traffic from a particular IP address. By default,
Django Rest Framework uses the IP address to throttle traffic
for users who are not authenticated.
To disable rate limiting:
1)... |
olafhauk/mne-python | refs/heads/master | tutorials/machine-learning/plot_receptive_field.py | 8 | # -*- coding: utf-8 -*-
"""
=====================================================================
Spectro-temporal receptive field (STRF) estimation on continuous data
=====================================================================
This demonstrates how an encoding model can be fit with multiple continuous
input... |
cangencer/hazelcast-python-client | refs/heads/master | hazelcast/protocol/codec/atomic_reference_apply_codec.py | 2 | from hazelcast.serialization.bits import *
from hazelcast.protocol.client_message import ClientMessage
from hazelcast.protocol.custom_codec import *
from hazelcast.util import ImmutableLazyDataList
from hazelcast.protocol.codec.atomic_reference_message_type import *
REQUEST_TYPE = ATOMICREFERENCE_APPLY
RESPONSE_TYPE =... |
jburger424/MediaQueueHCI | refs/heads/dev | m-q-env/lib/python3.4/site-packages/sqlalchemy/connectors/zxJDBC.py | 55 | # connectors/zxJDBC.py
# Copyright (C) 2005-2016 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
import sys
from . import Connector
class ZxJDBCConnector(Connector):
driv... |
tradel/AppDynamicsREST | refs/heads/master | examples/license_count_by_env.py | 1 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
"""
Sample script to generate a count of licenses used by environment type (Prod, Devl, Qual, Cert, etc.)
"""
from __future__ import print_function
from datetime import datetime
import itertools
from appd.cmdline import parse_argv
from appd.request import AppDynamicsCl... |
tempbottle/kbengine | refs/heads/master | kbe/res/scripts/common/Lib/test/test_importlib/source/test_path_hook.py | 84 | from .. import util
from . import util as source_util
machinery = util.import_importlib('importlib.machinery')
import unittest
class PathHookTest:
"""Test the path hook for source."""
def path_hook(self):
return self.machinery.FileFinder.path_hook((self.machinery.SourceFileLoader,
self... |
chrivers/pyjaco | refs/heads/master | tests/list/in.py | 5 |
l = ['a','b','c']
def intest(item,list):
if item in list:
print str(item) + ' is in list'
else:
print str(item) + ' is not in list'
intest('a',l)
intest('b',l)
intest(99,l)
intest(0,l)
intest('z',l)
intest('c',l)
|
vjmac15/Lyilis | refs/heads/master | lib/youtube_dl/extractor/amp (VJ Washington's conflicted copy 2017-08-29).py | 28 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
int_or_none,
parse_iso8601,
mimetype2ext,
determine_ext,
ExtractorError,
)
class AMPIE(InfoExtractor):
# parse Akamai Adaptive Media Player feed
def _extract_feed_info(self, url... |
Winand/pandas | refs/heads/master | pandas/core/indexes/__init__.py | 12133432 | |
rexshihaoren/scikit-learn | refs/heads/master | sklearn/preprocessing/tests/__init__.py | 12133432 | |
computersalat/ansible | refs/heads/devel | test/units/module_utils/facts/network/__init__.py | 12133432 | |
ericdill/bokeh | refs/heads/master | bokeh/charts/builder/tests/__init__.py | 12133432 | |
Digas29/bazel | refs/heads/master | tools/j2objc/j2objc_wrapper.py | 3 | #!/usr/bin/python2.7
# Copyright 2015 The Bazel 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 requ... |
jgdwyer/ML-convection | refs/heads/master | sknn_jgd/backend/lasagne/__init__.py | 3 | # -*- coding: utf-8 -*-
from __future__ import (absolute_import, unicode_literals, print_function)
from ... import backend
from .mlp import MultiLayerPerceptronBackend
# Register this implementation as the MLP backend.
backend.MultiLayerPerceptronBackend = MultiLayerPerceptronBackend
backend.name = 'lasagne' |
jymannob/CouchPotatoServer | refs/heads/develop | couchpotato/core/media/_base/providers/torrent/publichd.py | 14 | from urlparse import parse_qs
import re
import traceback
from bs4 import BeautifulSoup
from couchpotato.core.helpers.encoding import tryUrlencode, toUnicode
from couchpotato.core.helpers.variable import tryInt
from couchpotato.core.logger import CPLog
from couchpotato.core.media._base.providers.torrent.base import Tor... |
blueboxgroup/keystone | refs/heads/master | keystone/contrib/revoke/controllers.py | 2 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... |
htcondor/htcondor | refs/heads/master | bindings/python/classad/__init__.py | 1 | # Copyright 2019 HTCondor Team, Computer Sciences Department,
# University of Wisconsin-Madison, WI.
#
# 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/LICE... |
cmoutard/mne-python | refs/heads/master | examples/visualization/plot_clickable_image.py | 4 | """
================================================================
Demonstration of how to use ClickableImage / generate_2d_layout.
================================================================
In this example, we open an image file, then use ClickableImage to
return 2D locations of mouse clicks (or load a file a... |
40023255/2015cd_midterm | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/browser/object_storage.py | 627 | import pickle
class __UnProvided():
pass
class ObjectStorage():
def __init__(self, storage):
self.storage = storage
def __delitem__(self, key):
del self.storage[pickle.dumps(key)]
def __getitem__(self, key):
return pickle.loads(self.storage[pickle.dumps(key)])
def __se... |
jameswatt2008/jameswatt2008.github.io | refs/heads/master | python/Python核心编程/网络编程/截图和代码/概述、SOCKET/多进程copy文件/test-复件/_pyio.py | 3 | """
Python implementation of the io module.
"""
import os
import abc
import codecs
import errno
import array
import stat
import sys
# Import _thread instead of threading to reduce startup cost
try:
from _thread import allocate_lock as Lock
except ImportError:
from _dummy_thread import allocate_lock as Lock
if ... |
tellesnobrega/horizon | refs/heads/master | horizon/decorators.py | 85 | # Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 CRS4
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License... |
Boldie/gourmet | refs/heads/master | gourmet/shopEditor.py | 6 | import gtk, gobject, backends.db, re, pickle
from gglobals import uibase
from gtk_extras import WidgetSaver
from gtk_extras import cb_extras as cb
from gtk_extras import dialog_extras as de
class ShopEditor:
"""ShopEditor sets up a GUI to allow editing which shopping
categories correspond to which items throu... |
krishna-pandey-git/django | refs/heads/master | tests/gis_tests/geoadmin/models.py | 300 | from django.contrib.gis.gdal import HAS_GDAL
from django.utils.encoding import python_2_unicode_compatible
from ..admin import admin
from ..models import models
@python_2_unicode_compatible
class City(models.Model):
name = models.CharField(max_length=30)
point = models.PointField()
objects = models.GeoM... |
MobileWebApps/backend-python-rest-gae | refs/heads/master | django_filters/filters.py | 6 | from __future__ import absolute_import
from __future__ import unicode_literals
from datetime import timedelta
from django import forms
from django.db.models import Q
from django.db.models.sql.constants import QUERY_TERMS
from django.utils import six
from django.utils.timezone import now
from django.utils.translation... |
CI-WATER/TethysCluster | refs/heads/master | tethyscluster/tests/templates/__init__.py | 2 | # Copyright 2009-2014 Justin Riley
#
# This file is part of TethysCluster.
#
# TethysCluster is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the Free
# Software Foundation, either version 3 of the License, or (at your option) any
# la... |
mrry/tensorflow | refs/heads/windows | tensorflow/contrib/learn/python/learn/dataframe/transforms/in_memory_source.py | 4 | # 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... |
potatolondon/django-nonrel-1-4 | refs/heads/master | django/contrib/localflavor/de/__init__.py | 12133432 | |
350dotorg/Django | refs/heads/master | tests/regressiontests/cache/__init__.py | 12133432 | |
Venturi/oldcms | refs/heads/master | env/lib/python2.7/site-packages/cms/test_utils/project/fakemlng/south_migrations/__init__.py | 12133432 | |
abhiii5459/sympy | refs/heads/master | sympy/printing/pretty/tests/__init__.py | 12133432 | |
resmo/ansible | refs/heads/devel | lib/ansible/module_utils/network/aci/__init__.py | 12133432 | |
tiagochiavericosta/edx-platform | refs/heads/master | cms/djangoapps/contentstore/views/component.py | 57 | from __future__ import absolute_import
import json
import logging
from django.http import HttpResponseBadRequest, Http404
from django.contrib.auth.decorators import login_required
from django.views.decorators.http import require_GET
from django.core.exceptions import PermissionDenied
from django.conf import settings
... |
brayden2544/Mystuff-final | refs/heads/master | manage/cached_templates/templates/base.htm.py | 1 | # -*- coding:ascii -*-
from mako import runtime, filters, cache
UNDEFINED = runtime.UNDEFINED
__M_dict_builtin = dict
__M_locals_builtin = locals
_magic_number = 9
_modified_time = 1397177451.490061
_enable_loop = True
_template_filename = 'C:\\app\\manage\\templates/base.htm'
_template_uri = 'base.htm'
_source_encodin... |
tangyiyong/odoo | refs/heads/8.0 | addons/account_analytic_default/__openerp__.py | 264 | # -*- 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... |
uw-it-aca/myuw | refs/heads/master | myuw/dao/messages.py | 1 | # Copyright 2021 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0
import csv
import os
import datetime
import bleach
from dateutil.parser import parse
from myuw.models import BannerMessage
from myuw.dao import get_netid_of_current_user, is_using_file_dao
from myuw.dao.admin import is_admin
from my... |
smartlinux/nsxapitest | refs/heads/master | identity/case01_nsx_identity_login_script.py | 1 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Test script for identity function.
# 用户处于已认证状态时,可以正常调用API;而已经注销的用户,则不能成功调用API;默认情况下用户处于已认证状态,调用API操作全程由HTTPS加密
#
import sys
import datetime
import libxml2
sys.path.append("..")
import rest
from nsx_basic_input import *
caseName = 'case01_nsx_identity_login'
restclient... |
Rom4eg/myCompany | refs/heads/master | myCompany/users/views/auth.py | 1 | from django.contrib.auth import authenticate, login, logout
from rest_framework.views import APIView
from rest_framework.renderers import JSONRenderer, TemplateHTMLRenderer
from rest_framework import status
from rest_framework.response import Response
from rest_framework.permissions import AllowAny
from users.serialize... |
jimi-c/ansible | refs/heads/devel | lib/ansible/plugins/filter/ipaddr.py | 2 | # (c) 2014, Maciej Delmanowski <drybjed@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later ... |
drummonds/remittance | refs/heads/master | tests/__init__.py | 1 | # -*- coding: utf-8 -*-
"""Unit test package for remittance."""
|
kreatorkodi/repository.torrentbr | refs/heads/master | plugin.video.elementum/resources/site-packages/bjsonrpc/varsync/__init__.py | 11 | # encoding: UTF-8
"""
Variables Syncronized over json-rpc at both ends.
This package has several datatypes to ease variable-sharing across peers.
Proposed Utils:
* FIFOBuffer: streams lists of bytes/numbers/etc over network.
Proposed Types:
* FloatSync: floating point number synced over ... |
fitermay/intellij-community | refs/heads/master | plugins/hg4idea/testData/bin/hgext/convert/darcs.py | 94 | # darcs.py - darcs support for the convert extension
#
# Copyright 2007-2009 Matt Mackall <mpm@selenic.com> and others
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
from common import NoRepo, checktool, commandline, commit, con... |
hip-odoo/odoo | refs/heads/10.0 | addons/website_mail/models/__init__.py | 24 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import mail_message
import update
|
swegener/micropython | refs/heads/master | tests/float/python36.py | 6 | # tests for things that only Python 3.6 supports, needing floats
# underscores in numeric literals
print(1_000.1_8)
print('%.2g' % 1e1_2)
# underscore supported by int/float constructors
print(float('1_2_3'))
print(float('1_2_3.4'))
print('%.2g' % float('1e1_3'))
|
patrioticcow/MessagesForSkype | refs/heads/master | packages/win32/bundle/MessagesForSkype/modules/python/1.3.1-beta/Lib/pdb.py | 90 | #! /usr/bin/env python
"""A Python debugger."""
# (See pdb.doc for documentation.)
import sys
import linecache
import cmd
import bdb
from repr import Repr
import os
import re
import pprint
import traceback
# Create a custom safe Repr instance and increase its maxstring.
# The default of 30 truncates error messages t... |
hlt-mt/tensorflow | refs/heads/master | tensorflow/python/framework/framework_lib.py | 6 | # Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
ChristinaHammer/Client_Database | refs/heads/master | cdbfunctions.py | 1 | """cdbfunctions.py
Developer: Noelle Todd
Last Updated: August 30, 2014
This module consists of functions which will be called by the user
interface, in order to insert, delete, update, etc. data in the database.
This module is still in its early testing stages; many more functions will
be added or edited in the foll... |
vmax-feihu/hue | refs/heads/master | apps/zookeeper/src/zookeeper/windmilltests.py | 36 | #!/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... |
zakuro9715/lettuce | refs/heads/master | tests/integration/lib/Django-1.3/django/conf/urls/shortcut.py | 353 | from django.conf.urls.defaults import *
urlpatterns = patterns('django.views',
(r'^(?P<content_type_id>\d+)/(?P<object_id>.*)/$', 'defaults.shortcut'),
)
|
petrleocompel/gnome15 | refs/heads/master | src/gnome15/g15util.py | 8 | # Gnome15 - Suite of tools for the Logitech G series keyboards and headsets
# Copyright (C) 2010 Brett Smith <tanktarta@blueyonder.co.uk>
# Copyright (C) 2013 Nuno Araujo <nuno.araujo@russo79.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Publi... |
jalilm/ryu | refs/heads/master | tools/install_venv.py | 56 | #!/usr/bin/env python
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2010 OpenStack LLC.
#
# Licensed under the Apache License, Version 2.0 (the "Li... |
flotre/sickbeard-vfvo | refs/heads/master | sickbeard/scene_exceptions.py | 30 | # Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of Sick Beard.
#
# Sick Beard 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... |
mortonjt/scipy | refs/heads/master | scipy/weave/examples/print_example.py | 100 | from __future__ import absolute_import, print_function
import sys
sys.path.insert(0,'..')
import inline_tools
import time
def print_compare(n):
print('Printing %d integers:' % n)
t1 = time.time()
for i in range(n):
print(i, end=' ')
t2 = time.time()
py = (t2-t1)
# get it in cache
... |
petrjasek/superdesk-core | refs/heads/master | superdesk/factory/sentry.py | 2 | import logging
from raven.contrib.flask import Sentry
from raven.contrib.celery import register_signal, register_logger_signal
SENTRY_DSN = "SENTRY_DSN"
class SuperdeskSentry:
"""Sentry proxy that will do nothing in case sentry is not configured."""
def __init__(self, app):
if app.config.get(SENTRY... |
sapcc/monasca-api | refs/heads/master | monasca_api/v2/reference/metrics.py | 1 | # (C) Copyright 2014-2017 Hewlett Packard Enterprise Development LP
#
# 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 appli... |
TangXT/GreatCatMOOC | refs/heads/master | common/djangoapps/cache_toolbox/middleware.py | 211 | """
Cache-backed ``AuthenticationMiddleware``
-----------------------------------------
``CacheBackedAuthenticationMiddleware`` is an
``django.contrib.auth.middleware.AuthenticationMiddleware`` replacement to
avoid querying the database for a ``User`` instance in each request.
Whilst the built-in ``AuthenticationMidd... |
mammique/django | refs/heads/tp_alpha | django/contrib/formtools/tests/wizard/wizardtests/forms.py | 313 | import os
import tempfile
from django import forms
from django.contrib.auth.models import User
from django.core.files.storage import FileSystemStorage
from django.forms.formsets import formset_factory
from django.forms.models import modelformset_factory
from django.http import HttpResponse
from django.template import ... |
pdarragh/Viper | refs/heads/master | viper/parser/grammar_parsing/tokenize/grammar_token.py | 1 | from typing import ClassVar
class GrammarToken:
def __init__(self, lexeme_class: ClassVar, text=None):
self._lexeme_class = lexeme_class
self._text = text
def __eq__(self, other):
if isinstance(other, GrammarToken):
return self._lexeme_class == other._lexeme_class
... |
fortizc/fiware-orion | refs/heads/develop | test/acceptance/lettuce/integration/terrain.py | 8 | # -*- coding: utf-8 -*-
"""
# Copyright 2015 Telefonica Investigacion y Desarrollo, S.A.U
#
# This file is part of Orion Context Broker.
#
# Orion Context Broker is free software: you can redistribute it and/or
# modify it under the terms of the GNU Affero General Public License as
# published by the Free Software Foun... |
AlbertoAlfredo/exercicios-cursos | refs/heads/master | Curso-em-video/Python/aulas-python/Desafios/desafio043.py | 1 | peso = float(input("Digite seu peso: "))
altura = float(input("Digite sua altura: "))
imc = peso/(altura ** 2)
print("Seu IMC é {:.1f}".format(imc))
if imc < 18.5 :
print("Você está abaixo do peso.")
elif imc <= 25 :
print("Você está no peso ideal.")
elif imc <= 30 :
print("Você está com sobrepeso.")
elif i... |
tarzan0820/odoo | refs/heads/8.0 | addons/account_payment/wizard/account_payment_pay.py | 382 | # -*- 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... |
mxOBS/deb-pkg_trusty_chromium-browser | refs/heads/master | chrome/test/ispy/common/mock_cloud_bucket.py | 122 | # 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.
"""Subclass of CloudBucket used for testing."""
import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), os.pardir, os.pardir))
import ... |
interstar/OWL | refs/heads/master | web.py | 1 | #!/usr/bin/env python
"""web.py: makes web apps (http://webpy.org)"""
__version__ = "0.1381"
__revision__ = "$Rev: 72 $"
__license__ = "public domain"
__author__ = "Aaron Swartz <me@aaronsw.com>"
__contributors__ = "see http://webpy.org/changes"
# todo:
# - get rid of upvars
# - break up into separate fi... |
stonegithubs/micropython | refs/heads/master | tests/basics/set_copy.py | 118 | s = {1, 2, 3, 4}
t = s.copy()
s.add(5)
t.add(7)
for i in s, t:
print(sorted(i))
|
ifduyue/django | refs/heads/master | django/contrib/postgres/functions.py | 98 | from django.db.models import DateTimeField, Func, UUIDField
class RandomUUID(Func):
template = 'GEN_RANDOM_UUID()'
output_field = UUIDField()
class TransactionNow(Func):
template = 'CURRENT_TIMESTAMP'
output_field = DateTimeField()
|
Jgarcia-IAS/localizacion | refs/heads/master | openerp/addons-extra/odoo-pruebas/odoo-server/addons/website_sale_options/models/product.py | 395 | # -*- coding: utf-8 -*-
from openerp import tools
from openerp.osv import osv, fields
class product_template(osv.Model):
_inherit = "product.template"
_columns = {
'optional_product_ids': fields.many2many('product.template','product_optional_rel','src_id','dest_id',string='Optional Products', help="Pr... |
firebase/grpc | refs/heads/master | bazel/test/python_test_repo/helloworld.py | 13 | # Copyright 2019 the 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 wri... |
hurricup/intellij-community | refs/heads/master | python/lib/Lib/site-packages/django/contrib/gis/db/backends/mysql/base.py | 308 | from django.db.backends.mysql.base import *
from django.db.backends.mysql.base import DatabaseWrapper as MySQLDatabaseWrapper
from django.contrib.gis.db.backends.mysql.creation import MySQLCreation
from django.contrib.gis.db.backends.mysql.introspection import MySQLIntrospection
from django.contrib.gis.db.backends.mysq... |
hungtt57/matchmaker | refs/heads/master | lib/python2.7/site-packages/django/core/files/uploadhandler.py | 102 | """
Base file upload handler classes, and the built-in concrete subclasses
"""
from __future__ import unicode_literals
from io import BytesIO
from django.conf import settings
from django.core.files.uploadedfile import (
InMemoryUploadedFile, TemporaryUploadedFile,
)
from django.utils.encoding import python_2_uni... |
razzius/PyClassLessons | refs/heads/master | instructors/need-rework/15_classy_OOP/cat_class.py | 3 | import random
class Cat(object):
#import random
enemies = 5
def __init__(self, name=None, top_speed=9223372036854775808L, cat=None, hunger=None, food=None):
self.name = name
self.top_speed = top_speed
self.hunger = random.randint(1,10)
self.food = []
self.at_vet = False
#if self.hunger >= 10:
# retu... |
liulion/mayavi | refs/heads/master | examples/mayavi/mlab/magnetic_field_lines.py | 10 | """
This example uses the streamline module to display field lines of a
magnetic dipole (a current loop).
This example requires scipy.
The magnetic field from an arbitrary current loop is calculated from
eqns (1) and (2) in Phys Rev A Vol. 35, N 4, pp. 1535-1546; 1987.
To get a prettier result, we use a fairly large... |
ncoop/i3pystatus | refs/heads/master | i3pystatus/core/modules.py | 7 | import inspect
import traceback
from i3pystatus.core.settings import SettingsBase
from i3pystatus.core.threading import Manager
from i3pystatus.core.util import (convert_position,
MultiClickHandler)
from i3pystatus.core.command import execute
def is_method_of(method, object):
""... |
hxddh/youtube-dl | refs/heads/master | youtube_dl/extractor/qqmusic.py | 76 | # coding: utf-8
from __future__ import unicode_literals
import random
import time
import re
from .common import InfoExtractor
from ..utils import (
strip_jsonp,
unescapeHTML,
clean_html,
)
from ..compat import compat_urllib_request
class QQMusicIE(InfoExtractor):
IE_NAME = 'qqmusic'
IE_DESC = 'Q... |
imsparsh/python-social-auth | refs/heads/master | social/tests/backends/test_utils.py | 11 | import unittest
from sure import expect
from social.tests.models import TestStorage
from social.tests.strategy import TestStrategy
from social.backends.utils import load_backends, get_backend
from social.backends.github import GithubOAuth2
class BaseBackendUtilsTest(unittest.TestCase):
def setUp(self):
s... |
areteix/powerline | refs/heads/develop | tests/setup_statusline_catcher.py | 28 | # vim:fileencoding=utf-8:noet
import json
import vim
from powerline.lib.unicode import u
_powerline_old_render = powerline.render # NOQA
def _powerline_test_render_function(*args, **kwargs):
ret = _powerline_old_render(*args, **kwargs)
vim.eval('add(g:statusline_values, %s)' % json.dumps(u(ret)))
return ret
... |
webkom/django-auth-abakus | refs/heads/master | docs/conf.py | 1 | # -*- coding: utf-8 -*-
#
# django-auth-abakus documentation build configuration file, created by
# sphinx-quickstart on Fri Mar 13 15:34:59 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated ... |
ktbs/ktbs-bench | refs/heads/master | bin/bench.py | 1 | #!/usr/bin/env python
# -*- coding:utf-8 -*-
"""Run benchmarks.
Usage:
bench.py <bench_folder> [<output_folder>]
Options:
-h --help Show this help screen.
"""
from docopt import docopt
from os import listdir, path
from sys import path as sys_path
def scan_bench_files(directory):
"""Scan a directory fo... |
aospx-kitkat/platform_external_chromium_org | refs/heads/kitkat | tools/perf_expectations/update_perf_expectations.py | 161 | #!/usr/bin/env python
# Copyright (c) 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.
"""Prepare tests that require re-baselining for input to make_expectations.py.
The regularly running perf-AV tests require re-base... |
pepsi7959/ProtocolBuffer-c | refs/heads/master | gtest/test/gtest_test_utils.py | 408 | #!/usr/bin/env python
#
# Copyright 2006, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... |
VitalPet/c2c-rd-addons | refs/heads/8.0 | c2c_autosearch_check/__init__.py | 4 | # -*- coding: utf-8 -*-
##############################################
#
# ChriCar Beteiligungs- und Beratungs- GmbH
# Copyright (C) ChriCar Beteiligungs- und Beratungs- GmbH
# all rights reserved
# created 2009-08-18 23:44:30+02
#
# WARNING: This program as such is intended to be used by professional
# programmers who... |
AXAz0r/apex-sigma | refs/heads/master | sigma/plugins/minigames/slots/slot_core.py | 2 | import random
import asyncio
import arrow
import discord
from config import SlotWinChannelID
slot_back_data = {}
async def spin_slots(cmd, message, bet_amt, symbols, min_spins=4, max_spins=8, spin_cycle_timeout=1):
# Cooldown Check
not_on_cd = True
current_time = arrow.utcnow().timestamp
if message.... |
almeidapaulopt/erpnext | refs/heads/develop | erpnext/hr/doctype/employee_advance/test_employee_advance.py | 17 | # -*- coding: utf-8 -*-
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
from frappe.utils import nowdate
from erpnext.hr.doctype.employee_advance.employee_advance import make_bank_entry
from erpnext.hr.doctype.... |
brutasse/djangopeople | refs/heads/master | djangopeople/django_openidauth/migrations/0001_initial.py | 2 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.Create... |
grampajoe/django-tenant-templates | refs/heads/master | django_tenant_templates/middleware.py | 1 | """
Middleware!
"""
from django_tenant_templates import local
class TenantMiddleware(object):
"""Middleware for enabling tenant-aware template loading."""
slug_property_name = 'tenant_slug'
def process_request(self, request):
local.tenant_slug = getattr(request, self.slug_property_name, None)
|
mattclay/ansible | refs/heads/devel | test/integration/targets/collections/collections/ansible_collections/testns/content_adj/plugins/module_utils/sub1/__init__.py | 12133432 | |
phenoxim/nova | refs/heads/master | nova/tests/unit/objects/__init__.py | 12133432 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.