repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
akash1808/tempest | refs/heads/master | tempest/services/compute/json/migrations_client.py | 6 | # Copyright 2014 NEC Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
Pistachitos/Sick-Beard | refs/heads/Pistachitos | sickbeard/db.py | 2 | # 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... |
2014c2g9/c2g9 | refs/heads/master | exts/w2/static/Brython2.0.0-20140209-164925/Lib/unittest/test/test_program.py | 738 | import io
import os
import sys
import unittest
class Test_TestProgram(unittest.TestCase):
def test_discovery_from_dotted_path(self):
loader = unittest.TestLoader()
tests = [self]
expectedPath = os.path.abspath(os.path.dirname(unittest.test.__file__))
self.wasRun = False
... |
wildtetris/python-social-auth | refs/heads/master | social/backends/weibo.py | 67 | # coding:utf8
# author:hepochen@gmail.com https://github.com/hepochen
"""
Weibo OAuth2 backend, docs at:
http://psa.matiasaguirre.net/docs/backends/weibo.html
"""
from social.backends.oauth import BaseOAuth2
class WeiboOAuth2(BaseOAuth2):
"""Weibo (of sina) OAuth authentication backend"""
name = 'weibo'
... |
telefonicaid/murano | refs/heads/master | murano/tests/functional/engine/__init__.py | 12133432 | |
WikipediaLibrary/TWLight | refs/heads/master | TWLight/ezproxy/__init__.py | 12133432 | |
charleswhchan/huey | refs/heads/master | huey/backends/__init__.py | 12133432 | |
petertodd/namecoin | refs/heads/master | client/DNS/Type.py | 40 | # -*- encoding: utf-8 -*-
"""
$Id: Type.py,v 1.6.2.2 2009/06/09 18:39:06 customdesigned Exp $
This file is part of the pydns project.
Homepage: http://pydns.sourceforge.net
This code is covered by the standard Python License.
TYPE values (section 3.2.2)
"""
A = 1 # a host address
NS = 2 # an... |
ftomassetti/intellij-community | refs/heads/master | python/testData/console/indent8.py | 160 | def foo():
print 'foo'
#comment with indent
print 'bar' |
ddurdle/GDrive-for-KODI | refs/heads/master | decryptFolder.py | 2 | from resources.lib import encryption
#from subprocess import call
import sys
import os
saltFile = str(sys.argv[1])
password = str(sys.argv[2])
source = str(sys.argv[3])
target = str(sys.argv[4])
encrypt = encryption.encryption(saltFile,password)
#encrypt.encryptString(file)
#print encrypt.decryptString(file)
def ... |
Monaden/Collaborastory | refs/heads/master | src/main/models.py | 1 | from django.db import models
from django.contrib.auth.models import User
from uuid import uuid1
class Story(models.Model):
text = models.TextField()
completed = models.BooleanField(default=False)
date = models.DateTimeField(verbose_name=u"Time",auto_now=True)
score = models.IntegerField(default=5)
... |
Russell-IO/ansible | refs/heads/devel | lib/ansible/modules/network/aci/aci_tenant_span_src_group_to_dst_group.py | 12 | #!/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'],
... |
ge0rgi/cinder | refs/heads/stable/ocata | cinder/tests/unit/api/v3/test_snapshot_manage.py | 1 | # Copyright (c) 2016 Stratoscale, Ltd.
#
# 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 ... |
hujiajie/chromium-crosswalk | refs/heads/master | tools/site_compare/operators/equals.py | 189 | # Copyright (c) 2011 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.
"""Compare two images for equality."""
from PIL import Image
from PIL import ImageChops
def Compare(file1, file2, **kwargs):
"""Compares two images ... |
mreq/dotfiles | refs/heads/master | scripts/wm/x11winmatch.py | 1 | #!/usr/bin/env python3
from Xlib import display, X, Xatom
import time
import os
class X11WinWatch:
def __init__(self):
self.display = display.Display()
self.root = self.display.screen().root
self.root.change_attributes(event_mask=(X.PropertyChangeMask))
self.ACTIVE = self.display.intern_atom("_NET_ACTIVE_WIND... |
supersven/intellij-community | refs/heads/master | python/helpers/python-skeletons/itertools.py | 62 | """Skeleton for 'itertools' stdlib module."""
class islice(object):
def __init__(self, iterable, start, stop=None, step=None):
"""
:type iterable: collections.Iterable[T]
:type start: numbers.Integral
:type stop: numbers.Integral | None
:type step: numbers.Integral | None
... |
gchp/django | refs/heads/master | django/contrib/sites/shortcuts.py | 615 | from __future__ import unicode_literals
from django.apps import apps
def get_current_site(request):
"""
Checks if contrib.sites is installed and returns either the current
``Site`` object or a ``RequestSite`` object based on the request.
"""
# Imports are inside the function because its point is ... |
GDGLima/contentbox | refs/heads/master | third_party/django/contrib/gis/geos/polygon.py | 219 | from ctypes import c_uint, byref
from django.contrib.gis.geos.geometry import GEOSGeometry
from django.contrib.gis.geos.libgeos import get_pointer_arr, GEOM_PTR
from django.contrib.gis.geos.linestring import LinearRing
from django.contrib.gis.geos import prototypes as capi
from django.utils import six
from django.utils... |
yangxianbo/jym | refs/heads/master | account/tests.py | 24123 | from django.test import TestCase
# Create your tests here.
|
ywcui1990/htmresearch | refs/heads/master | htmresearch/frameworks/layers/laminar_network.py | 3 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2016, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... |
wfxiang08/django185 | refs/heads/master | tests/utils_tests/test_archive.py | 372 | import os
import shutil
import tempfile
import unittest
from django.utils._os import upath
from django.utils.archive import Archive, extract
TEST_DIR = os.path.join(os.path.dirname(upath(__file__)), 'archives')
class ArchiveTester(object):
archive = None
def setUp(self):
"""
Create temporar... |
4talesa/rethinkdb | refs/heads/next | external/v8_3.30.33.16/tools/nacl-run.py | 77 | #!/usr/bin/env python
#
# Copyright 2013 the V8 project authors. 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
# noti... |
MaximeGir/StarTrekCorpora | refs/heads/master | utils/email_utils.py | 1 | from email_validator import validate_email
from flask_app.flask_app import config
class EmailValidator(object):
def __init__(self):
self.blacklisted_domains = config.MAIL['BLACKLISTED_DOMAINS']
self.is_valid = False
def is_blacklisted(self, domain):
return domain in self.blacklisted_d... |
rahul-c1/scikit-learn | refs/heads/master | benchmarks/bench_isotonic.py | 268 | """
Benchmarks of isotonic regression performance.
We generate a synthetic dataset of size 10^n, for n in [min, max], and
examine the time taken to run isotonic regression over the dataset.
The timings are then output to stdout, or visualized on a log-log scale
with matplotlib.
This alows the scaling of the algorith... |
tuenti/Diamond | refs/heads/master | src/diamond/handler/cloudwatch.py | 27 | # coding=utf-8
"""
Output the collected values to AWS CloudWatch
Automatically adds the InstanceID Dimension
#### Dependencies
* [boto](http://boto.readthedocs.org/en/latest/index.html)
#### Configuration
Enable this handler
* handers = diamond.handler.cloudwatch.cloudwatchHandler
Example Config:
[[cloudwatch... |
avtoritet/scrapy | refs/heads/master | scrapy/contrib/statsmailer.py | 144 | import warnings
from scrapy.exceptions import ScrapyDeprecationWarning
warnings.warn("Module `scrapy.contrib.statsmailer` is deprecated, "
"use `scrapy.extensions.statsmailer` instead",
ScrapyDeprecationWarning, stacklevel=2)
from scrapy.extensions.statsmailer import *
|
dsaraujo/circulante | refs/heads/master | django/contrib/sessions/middleware.py | 323 | import time
from django.conf import settings
from django.utils.cache import patch_vary_headers
from django.utils.http import cookie_date
from django.utils.importlib import import_module
class SessionMiddleware(object):
def process_request(self, request):
engine = import_module(settings.SESSION_ENGINE)
... |
xujun10110/golismero | refs/heads/master | thirdparty_libs/requests/packages/charade/jisfreq.py | 3130 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client 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 R... |
2013Commons/HUE-SHARK | refs/heads/master | desktop/core/ext-py/Django-1.2.3/build/lib.linux-i686-2.7/django/conf/locale/bg/formats.py | 36 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
DATE_FORMAT = 'd F Y'
TIME_FORMAT = 'H:i:s'
# DATETIME_FORMAT =
# YEAR_MONTH_FORMAT =
MONTH_DAY_FORMAT = 'j F'
SHORT_DATE_FORMAT = 'd.m.Y'
# SHORT_DATETIME_FORMAT =
# FIRST_DAY_OF_WEEK =
# DATE_INPUT_FORMATS =
# T... |
smsisko/Voodoo-Mock | refs/heads/master | voodoo/voodoodbiterator.py | 2 | import shelve
import iterateapi
import atexit
import filelock
class VoodooDBIterator( iterateapi.IterateAPI ):
def __init__( self, perFileSettingsNotUsed, dbFilename ):
self._dbFilename = dbFilename
iterateapi.IterateAPI.__init__( self )
self._db = {}
atexit.register( self._atExit )... |
jscissr/djangae | refs/heads/master | djangae/noseplugin.py | 21 | from nose.plugins import Plugin
from djangae.test_runner import init_testbed
class DjangaePlugin(Plugin):
enabled = True
def configure(self, options, conf):
pass
def startTest(self, test):
self.bed = init_testbed()
def stopTest(self, test):
self.bed.deactivate()
|
westinedu/newertrends | refs/heads/master | django/forms/util.py | 311 | from django.utils.html import conditional_escape
from django.utils.encoding import StrAndUnicode, force_unicode
from django.utils.safestring import mark_safe
# Import ValidationError so that it can be imported from this
# module to maintain backwards compatibility.
from django.core.exceptions import ValidationError
d... |
monuszko/django-nyancat | refs/heads/master | nyancat/migrations/0002_person_email.py | 1 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('nyancat', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='person',
name='email',
... |
joerocklin/gem5 | refs/heads/master | src/mem/ruby/network/BasicRouter.py | 53 | # Copyright (c) 2011 Advanced Micro Devices, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met: redistributions of source code must retain the above copyright
# notice, this list of conditions... |
patcon/open-cabinet | refs/heads/master | venv/lib/python2.7/site-packages/django/conf/locale/mn/formats.py | 619 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'd F Y'
TIME_FORMAT = 'g:i A'
# DA... |
s0lst1c3/eaphammer | refs/heads/master | core/redirect_server.py | 1 | import time
import sys
import random
import string
from http.server import BaseHTTPRequestHandler, HTTPServer
from socketserver import ThreadingMixIn
from multiprocessing import Process
upper_alnum = string.ascii_uppercase + string.digits
bind_addr = None
bind_port = None
class RedirectHandler(BaseHTTPRequestHandler... |
caldwell/servo | refs/heads/master | tests/wpt/css-tests/tools/html5lib/html5lib/serializer/__init__.py | 1731 | from __future__ import absolute_import, division, unicode_literals
from .. import treewalkers
from .htmlserializer import HTMLSerializer
def serialize(input, tree="etree", format="html", encoding=None,
**serializer_opts):
# XXX: Should we cache this?
walker = treewalkers.getTreeWalker(tree)
... |
zengenti/ansible | refs/heads/devel | lib/ansible/modules/storage/netapp/__init__.py | 12133432 | |
adelton/django | refs/heads/master | django/contrib/admin/decorators.py | 558 | def register(*models, **kwargs):
"""
Registers the given model(s) classes and wrapped ModelAdmin class with
admin site:
@register(Author)
class AuthorAdmin(admin.ModelAdmin):
pass
A kwarg of `site` can be passed as the admin site, otherwise the default
admin site will be used.
... |
bspink/django | refs/heads/master | django/conf/project_template/project_name/urls.py | 244 | """{{ project_name }} URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/{{ docs_version }}/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.ho... |
lulandco/SickRage | refs/heads/develop | lib/hachoir_parser/misc/chm.py | 74 | """
InfoTech Storage Format (ITSF) parser, used by Microsoft's HTML Help (.chm)
Document:
- Microsoft's HTML Help (.chm) format
http://www.wotsit.org (search "chm")
- chmlib library
http://www.jedrea.com/chmlib/
- Unofficial CHM Spec
http://savannah.nongnu.org/projects/chmspec
- Microsoft's HTML Help (.chm) form... |
AntonPalich/sublime-evernote | refs/heads/master | lib/pygments/lexers/__init__.py | 9 | # -*- coding: utf-8 -*-
"""
pygments.lexers
~~~~~~~~~~~~~~~
Pygments lexers.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import sys
import types
import fnmatch
import re
from os.path import basename
from pygments.lexers._mapping ... |
cypod/arsenalsuite | refs/heads/master | cpp/apps/bach/plugins/gen_thumbs.py | 10 | import initbach
import bachutil
from Bach import *
from PyQt4.QtCore import *
import os
def listMissingThumbs(width):
assets = BachAsset.select("exclude=false")
for asset in assets:
path = asset.path()
cachePath = "%s/%s_%sx%s.png" % ("/drd/reference/.thumbnails", path, width,width)
if... |
twister/twister.github.io | refs/heads/master | binaries/PacketSnifferPlugin/PacketSniffer/PacketSnifferClasses.py | 4 | #!/usr/bin/env python
# version: 2.002
#
# -*- coding: utf-8 -*-
#
# File: PacketSniffer.py ; This file is part of Twister.
#
# Copyright (C) 2012 , Luxoft
#
# Authors:
# Adrian Toader <adtoader@luxoft.com>
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in c... |
joyxu/autotest | refs/heads/master | database_legacy/migrations/020_add_host_dirty_and_job_reboots.py | 6 | UP_SQL = """
ALTER TABLE hosts ADD COLUMN `dirty` bool NOT NULL;
ALTER TABLE jobs ADD COLUMN `reboot_before` smallint NOT NULL;
ALTER TABLE jobs ADD COLUMN `reboot_after` smallint NOT NULL;
"""
DOWN_SQL = """
ALTER TABLE hosts DROP COLUMN `dirty`;
ALTER TABLE jobs DROP COLUMN `reboot_before`;
ALTER TABLE jobs DROP COL... |
ar45/django | refs/heads/master | django/contrib/gis/gdal/feature.py | 439 | from django.contrib.gis.gdal.base import GDALBase
from django.contrib.gis.gdal.error import GDALException, OGRIndexError
from django.contrib.gis.gdal.field import Field
from django.contrib.gis.gdal.geometries import OGRGeometry, OGRGeomType
from django.contrib.gis.gdal.prototypes import ds as capi, geom as geom_api
fro... |
NLeSC/cptm | refs/heads/master | cptm/experiment_cptcorpus_count_words.py | 1 | """Count the number of topic and opinion words in the corpus.
Usage: python experiment_cptcorpus_count_words.py <experiment.json>
"""
import logging
import argparse
import sys
import tarfile
import os
from utils.experiment import load_config, get_corpus, get_sampler, \
thetaFileName, topicFileName, opinionFileNam... |
gannetson/django | refs/heads/master | tests/gis_tests/geoapp/feeds.py | 367 | from __future__ import unicode_literals
from django.contrib.gis import feeds
from .models import City
class TestGeoRSS1(feeds.Feed):
link = '/city/'
title = 'Test GeoDjango Cities'
def items(self):
return City.objects.all()
def item_link(self, item):
return '/city/%s/' % item.pk
... |
nagyistoce/euca2ools | refs/heads/master | euca2ools/commands/iam/updateaccesskey.py | 5 | # Copyright 2009-2015 Eucalyptus Systems, Inc.
#
# Redistribution and use of this software 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 ... |
wliu2016/sending_email | refs/heads/master | emaildata/__init__.py | 1349 | # -*- coding: utf-8 -*- |
Just-D/chromium-1 | refs/heads/master | tools/perf/metrics/speedindex.py | 14 | # 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.
from telemetry.util import image_util
from telemetry.util import rgba_color
from telemetry.value import scalar
from metrics import Metric
class SpeedIndex... |
Web5design/node-gyp | refs/heads/master | gyp/pylib/gyp/MSVSSettings.py | 437 | # Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Code to validate and convert settings of the Microsoft build tools.
This file contains code to validate and convert settings of the Microsoft
build tools. The... |
stephenmcd/ratemyflight | refs/heads/master | ratemyflight/forms.py | 1 |
from hashlib import md5
from django import forms
from django.utils.translation import ugettext_lazy as _
from ratemyflight.models import Rating
from ratemyflight.settings import GRAVATAR_SIZE
class RatingForm(forms.ModelForm):
email = forms.EmailField(label=_("Email"), required=False,
help_text="Only... |
neilh10/micropython | refs/heads/master | tests/basics/slots_bool_len.py | 118 | class A:
def __bool__(self):
print('__bool__')
return True
def __len__(self):
print('__len__')
return 1
class B:
def __len__(self):
print('__len__')
return 0
print(bool(A()))
print(len(A()))
print(bool(B()))
print(len(B()))
|
sangit/heekscnc | refs/heads/master | pycnc/Tools.py | 24 | from Object import Object
from Tool import Tool
from consts import *
import HeeksCNC
class Tools(Object):
def __init__(self):
Object.__init__(self)
def TypeName(self):
return "Tools"
def icon(self):
# the name of the PNG file in the HeeksCNC icons folder
... |
Wafflespeanut/servo | refs/heads/master | tests/wpt/update_css.py | 116 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import os
import sys
here = os.path.split(__file__)[0]
def wpt_path(*args):
return os.path.join(here, *args)
# I... |
brianhouse/housepy | refs/heads/master | lib/xbee/__init__.py | 1 | """
XBee package initalization file
By Paul Malmsten, 2010
pmalmsten@gmail.com
"""
from .ieee import XBee
from .zigbee import ZigBee
|
Mego/DataBot | refs/heads/master | SE-Chatbot/templates/ModuleTemplate.py | 1 | # The commands listed in this file can be read and loaded as a Module into a MetaModule by the load_module() function
# Add necessary import to this file, including:
# from Module import Command
# import SaveIO # For if you want to save and load objects for this module.
# save_subdir = '<subdir_name>' # Define a save... |
siosio/intellij-community | refs/heads/master | python/testData/refactoring/changeSignature/removeKeywordFromArgumentBeforeVararg.after.py | 27 | def f(y, x, *args):
pass
f(1, 42, 2, 3) |
DMLoy/ECommerceBasic | refs/heads/master | lib/python2.7/site-packages/django/conf/locale/sk/__init__.py | 12133432 | |
einarhuseby/arctic | refs/heads/master | arctic/scripts/__init__.py | 12133432 | |
chand3040/cloud_that | refs/heads/named-release/cypress.rc | common/djangoapps/embargo/__init__.py | 12133432 | |
pablohoffman/scrapy | refs/heads/master | scrapy/contrib/__init__.py | 12133432 | |
lixt/lily2-gem5 | refs/heads/master | ext/ply/test/lex_error1.py | 174 | # lex_error1.py
#
# Missing t_error() rule
import sys
if ".." not in sys.path: sys.path.insert(0,"..")
import ply.lex as lex
tokens = [
"PLUS",
"MINUS",
"NUMBER",
]
t_PLUS = r'\+'
t_MINUS = r'-'
t_NUMBER = r'\d+'
lex.lex()
|
kosior/eventful | refs/heads/master | eventful/common/validators.py | 1 | from django.core.exceptions import ValidationError
from django.utils import timezone
def validate_start_date(value):
if value < timezone.now() + timezone.timedelta(hours=1):
raise ValidationError('Start date must be at least an hour from now.')
|
nmayorov/scikit-learn | refs/heads/master | sklearn/datasets/mlcomp.py | 289 | # Copyright (c) 2010 Olivier Grisel <olivier.grisel@ensta.org>
# License: BSD 3 clause
"""Glue code to load http://mlcomp.org data as a scikit.learn dataset"""
import os
import numbers
from sklearn.datasets.base import load_files
def _load_document_classification(dataset_path, metadata, set_=None, **kwargs):
if ... |
stephen144/odoo | refs/heads/9.0 | addons/website_membership/controllers/__init__.py | 7372 | import main
|
kwikadi/orange3 | refs/heads/master | Orange/evaluation/clustering.py | 17 | import numpy as np
from sklearn.metrics import silhouette_score, adjusted_mutual_info_score, silhouette_samples
from Orange.data import Table
from Orange.evaluation.testing import Results
from Orange.evaluation.scoring import Score
__all__ = ['ClusteringEvaluation']
class ClusteringResults(Results):
def __init... |
davibe/gstreamersdk_pygobject | refs/heads/build | gi/types.py | 3 | # -*- Mode: Python; py-indent-offset: 4 -*-
# vim: tabstop=4 shiftwidth=4 expandtab
#
# Copyright (C) 2005-2009 Johan Dahlin <johan@gnome.org>
#
# types.py: base types for introspected items.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public... |
davidecaminati/Domotics-Raspberry | refs/heads/master | Software/Android/Minix/cherrypy/test/_test_decorators.py | 12 | """Test module for the @-decorator syntax, which is version-specific"""
from cherrypy import expose, tools
from cherrypy._cpcompat import ntob
class ExposeExamples(object):
@expose
def no_call(self):
return "Mr E. R. Bradshaw"
@expose()
def call_empty(self):
return "Mrs. B.J. Smegma... |
gallardjm/TUM_WebTech_DjangoExample | refs/heads/master | webtech_django1/box/migrations/0001_initial.py | 1 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('storage', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Box',
fields=[
... |
kustodian/ansible | refs/heads/devel | test/units/modules/network/netscaler/netscaler_module.py | 68 | import sys
from units.compat.mock import patch, Mock
from units.modules.utils import AnsibleExitJson, AnsibleFailJson, ModuleTestCase
base_modules_mock = Mock()
nitro_service_mock = Mock()
nitro_exception_mock = Mock()
base_modules_to_mock = {
'nssrc': base_modules_mock,
'nssrc.com': base_modules_mock,
... |
Sodki/ansible | refs/heads/devel | lib/ansible/modules/windows/__init__.py | 12133432 | |
tbeadle/django | refs/heads/master | tests/gis_tests/gis_migrations/migrations/__init__.py | 12133432 | |
rationalAgent/edx-platform-custom | refs/heads/master | common/djangoapps/student/__init__.py | 12133432 | |
jbzdak/edx-platform | refs/heads/master | openedx/core/djangoapps/theming/tests/__init__.py | 12133432 | |
ryfeus/lambda-packs | refs/heads/master | Tensorflow_Pandas_Numpy/source3.6/tensorflow/python/training/optimizer.py | 13 | # 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... |
xq262144/hue | refs/heads/master | desktop/core/ext-py/Django-1.6.10/django/conf/locale/es_AR/formats.py | 118 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = r'j N Y'
TIME_FORMAT = r'H:i:s'
DA... |
ianmtaylor1/pacal | refs/heads/master | pacal/examples/springer_book/Chapter5_functions.py | 1 | #!
#!-----------------------
#! CHAPTER 5 - FUNCTIONS
#!-----------------------
#!
from functools import partial
import numpy
import time
from pylab import figure, show
from pacal import *
from pacal.distr import demo_distr
if __name__ == "__main__":
tic = time.time()
#! Example 5.1.3
d = Normal... |
petewarden/tensorflow_makefile | refs/heads/master | tensorflow/examples/skflow/resnet.py | 4 | # Copyright 2015-present The Scikit Flow 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 require... |
sahutd/youtube-dl | refs/heads/master | youtube_dl/extractor/xboxclips.py | 132 | # encoding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
int_or_none,
parse_filesize,
unified_strdate,
)
class XboxClipsIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?xboxclips\.com/(?:video\.php\?.*vid=|[^/]+/)(?P<id>[\w-]{36})'
_TES... |
danlrobertson/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/wpt/markdown.py | 43 | from functools import reduce
def format_comment_title(product):
"""Produce a Markdown-formatted string based on a given "product"--a string
containing a browser identifier optionally followed by a colon and a
release channel. (For example: "firefox" or "chrome:dev".) The generated
title string is used ... |
wasade/improved-octo-waddle | refs/heads/master | cdef_bp_tests.py | 1 | import bp.tests.test_bp_cy
for n in dir(bp.tests.test_bp_cy):
if n.startswith('test_'):
getattr(bp.tests.test_bp_cy, n)()
|
alexcuellar/odoo | refs/heads/8.0 | addons/website_sale/tests/test_sale_process.py | 347 | import openerp.tests
@openerp.tests.common.at_install(False)
@openerp.tests.common.post_install(True)
class TestUi(openerp.tests.HttpCase):
def test_01_admin_shop_tour(self):
self.phantom_js("/", "openerp.Tour.run('shop', 'test')", "openerp.Tour.tours.shop", login="admin")
def test_02_admin_checkout(s... |
danlrobertson/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/third_party/attrs/src/attr/filters.py | 57 | """
Commonly useful filters for :func:`attr.asdict`.
"""
from __future__ import absolute_import, division, print_function
from ._compat import isclass
from ._make import Attribute
def _split_what(what):
"""
Returns a tuple of `frozenset`s of classes and attributes.
"""
return (
frozenset(cls... |
adamjmcgrath/glancydesign | refs/heads/master | src/djangotoolbox/setup.py | 9 | from setuptools import setup, find_packages
DESCRIPTION = "Djangotoolbox for Django-nonrel"
LONG_DESCRIPTION = None
try:
LONG_DESCRIPTION = open('README.rst').read()
except:
pass
CLASSIFIERS = [
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'Operating System :: OS Independe... |
dropbox/XCoverage | refs/heads/master | TestApp/build_scripts/export_build_vars.py | 2 | #!/usr/bin/env python
# Copyright (c) 2015 Dropbox, Inc
import os
import sys
import json
EXPORT_PATH = os.path.join(os.path.dirname(os.path.realpath(__file__)), '.build_vars')
def get_build_vars():
with open(EXPORT_PATH) as fd:
ret = json.load(fd)
return ret
def write_vars_to_file(kv_list):
with... |
hei-hilman/microblog | refs/heads/master | db_repository/__init__.py | 12133432 | |
webostin/django-btc | refs/heads/master | tests/staticfiles_tests/apps/no_label/__init__.py | 12133432 | |
PolymorhicCode/Veil-Evasion | refs/heads/master | modules/payloads/c/__init__.py | 12133432 | |
aitormf/JdeRobot | refs/heads/master | src/drivers/MAVLinkServer/MAVProxy/pymavlink/dialects/__init__.py | 12133432 | |
jk977/twitch-plays | refs/heads/master | bot/tests/__init__.py | 12133432 | |
dfunckt/django | refs/heads/master | tests/dispatch/__init__.py | 12133432 | |
audaciouscode/Books-Mac-OS-X | refs/heads/master | Versions/Books_3.0b5/Bundled plugins/Amazon (JP).plugin/Contents/Resources/amazonScript.py | 12 | #!/usr/bin/python
from amazon import Bag
from xml.dom.minidom import Document, parse
from difflib import SequenceMatcher
from string import replace
import amazon
import sys
searchLocale = "jp"
fieldMap = {
"Asin" : "ASIN",
"Authors" : "Authors",
"ImageUrlLarge" : "CoverImageURL",
"ImageUrlMediu... |
divio/django | refs/heads/master | tests/cache/tests.py | 142 | # -*- coding: utf-8 -*-
# Unit tests for cache framework
# Uses whatever cache backend is set in the test settings file.
from __future__ import unicode_literals
import copy
import os
import re
import shutil
import tempfile
import threading
import time
import unittest
import warnings
from django.conf import settings
... |
rush2catch/algorithms-leetcode | refs/heads/master | Trees/leet_145_BinaryTreePostorderTraversal.py | 1 | # Problem: Binary Tree Post-order Traversal
# Difficulty: Hard
# Category: Tree
# Leetcode 145: https://leetcode.com/problems/binary-tree-postorder-traversal/description/
# Description:
"""
Given a binary tree, return the postorder traversal of its nodes' values.
For example:
Given binary tree {1,#,2,3},
1
\
... |
dhalleine/tensorflow | refs/heads/master | tensorflow/python/kernel_tests/depthtospace_op_test.py | 4 | # 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... |
barbuza/django | refs/heads/master | django/db/migrations/operations/__init__.py | 394 | from .fields import AddField, AlterField, RemoveField, RenameField
from .models import (
AlterIndexTogether, AlterModelManagers, AlterModelOptions, AlterModelTable,
AlterOrderWithRespectTo, AlterUniqueTogether, CreateModel, DeleteModel,
RenameModel,
)
from .special import RunPython, RunSQL, SeparateDatabase... |
Kimanicodes/bc-9-jibiza | refs/heads/master | Questions/__init__.py | 12133432 | |
synasius/django | refs/heads/master | tests/gis_tests/relatedapp/__init__.py | 12133432 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.