repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
DanteOnline/free-art | refs/heads/master | venv/lib/python3.4/site-packages/django/template/library.py | 348 | import functools
import warnings
from importlib import import_module
from django.utils import six
from django.utils.deprecation import RemovedInDjango20Warning
from django.utils.html import conditional_escape
from django.utils.inspect import getargspec
from django.utils.itercompat import is_iterable
from .base import... |
acdh-oeaw/defc-app | refs/heads/master | defcdb/migrations/0021_auto_20160128_1627.py | 1 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('defcdb', '0020_auto_20160120_1223'),
]
operations = [
migrations.AlterField(
model_name='dc_chronological_system... |
ksvskushal/api.ai-test | refs/heads/master | app.py | 1 | #!/usr/bin/env python
import urllib
import json
import os
from flask import Flask
from flask import request
from flask import make_response
# Flask app should start in global layout
app = Flask(__name__)
@app.route('/webhook', methods=['POST'])
def webhook():
req = request.get_json(silent=True, force=True)
... |
jrief/django-shop | refs/heads/releases/0.10.x | example/myshop/models/i18n_polymorphic/order.py | 3 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from decimal import Decimal
from django.core.exceptions import ObjectDoesNotExist
from django.db import models
from django.utils.translation import ugettext_lazy as _
from shop.models import order
from shop.models.cart import CartItemModel
class OrderIt... |
opg7371/trelby | refs/heads/master | src/locations.py | 5 | import mypickle
import util
# manages location-information for a single screenplay. a "location" is a
# single place that can be referred to using multiple scene names, e.g.
# INT. MOTEL ROOM - DAY
# INT. MOTEL ROOM - DAY - 2 HOURS LATER
# INT. MOTEL ROOM - NIGHT
class Locations:
cvars = None
def __init__(... |
tiramiseb/awesomeshop | refs/heads/master | back/shop/models/dbcart.py | 1 | # -*- coding: utf8 -*-
# Copyright 2015 Sébastien Maccagnoni
#
# This file is part of AwesomeShop.
#
# AwesomeShop 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 Foundation, either version 3 of the License, or (a... |
codecakes/random_games | refs/heads/master | bday_diff.py | 1 | #This is what I call a close to good enough program design. satisfied.
#author: @codecakes; maintainer: @codecakes
month_day = dict(zip(range(1,13), [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]))
leap = lambda yy: (yy%4 == 0 and not (yy%100 == 0)) \
or (yy%4 == 0 and yy%100 == 0 and yy%400==0)
... |
paran0ids0ul/infernal-twin | refs/heads/master | build/pillow/Tests/bench_cffi_access.py | 11 | from helper import unittest, PillowTestCase, hopper
# Not running this test by default. No DOS against Travis CI.
from PIL import PyAccess
import time
def iterate_get(size, access):
(w, h) = size
for x in range(w):
for y in range(h):
access[(x, y)]
def iterate_set(size, access):
(... |
rahul67/hue | refs/heads/master | desktop/core/ext-py/Django-1.6.10/django/contrib/redirects/tests.py | 215 | from django.conf import settings
from django.contrib.sites.models import Site
from django.core.exceptions import ImproperlyConfigured
from django.test import TestCase
from django.test.utils import override_settings
from django.utils import six
from .middleware import RedirectFallbackMiddleware
from .models import Redi... |
doismellburning/edx-platform | refs/heads/master | common/djangoapps/student/migrations/0052_auto__add_historicalcourseenrollment.py | 55 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'HistoricalCourseEnrollment'
db.create_table('student_hist... |
ohiometa/rezonable | refs/heads/stable | cache.py | 1 | # #!/usr/bin/python2
# the Rezonable cache
# use is about 1.2 kilobytes per key (50 website test)
from __future__ import division, print_function
from cPickle import load, dump
from gzip import open as gopen
from random import randrange
import config as w
from tiny import *
__all__ = '''cacheDump cacheSize createBoo... |
samabhi/pstHealth | refs/heads/master | venv/lib/python2.7/site-packages/django/core/management/utils.py | 405 | from __future__ import unicode_literals
import os
import sys
from subprocess import PIPE, Popen
from django.utils import six
from django.utils.encoding import DEFAULT_LOCALE_ENCODING, force_text
from .base import CommandError
def popen_wrapper(args, os_err_exc_type=CommandError, universal_newlines=True):
"""
... |
AlbandeCrevoisier/ldd-athens | refs/heads/master | gcc-linaro-4.9-2015.02-3-x86_64_arm-linux-gnueabihf/share/gdb/python/gdb/command/__init__.py | 126 | # Copyright (C) 2010-2014 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This progr... |
wojciechtanski/robotframework | refs/heads/master | atest/testdata/output/listeners/verify_template_listener.py | 38 | import sys
ROBOT_LISTENER_API_VERSION = 2
def start_test(name, attrs):
template = attrs['template']
expected = attrs['doc']
if template != expected:
sys.__stderr__.write("Expected template '%s' but got '%s'.\n"
% (expected, template))
end_test = start_test
|
ProjectSWGCore/NGECore2 | refs/heads/master | scripts/object/draft_schematic/chemistry/medpack_cure_disease_b.py | 85615 | import sys
def setup(core, object):
return |
oesteban/dipy | refs/heads/master | dipy/tracking/__init__.py | 13 | # Init for tracking module
""" Tracking objects """
# Test callable
from numpy.testing import Tester
test = Tester().test
bench = Tester().bench
del Tester
|
hckiang/DBLite | refs/heads/master | boost_1_54_0/libs/mpl/doc/src/docutils/tools/rst2htmlrefdoc.py | 59 | #!/usr/bin/env python
# Copyright Aleksey Gurtovoy 2004-2009
#
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
import locale
try:
locale.setlocale(locale.LC_ALL, '')
except:
pass
from docutils.parsers.... |
draugiskisprendimai/odoo | refs/heads/8.0 | addons/project_issue/__openerp__.py | 260 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# ... |
Sweetgrassbuffalo/ReactionSweeGrass-v2 | refs/heads/master | .meteor/local/dev_bundle/python/Lib/csv.py | 63 |
"""
csv.py - read/write/investigate CSV files
"""
import re
from functools import reduce
from _csv import Error, __version__, writer, reader, register_dialect, \
unregister_dialect, get_dialect, list_dialects, \
field_size_limit, \
QUOTE_MINIMAL, QUOTE_ALL, QUOTE_NON... |
danstoner/python_experiments | refs/heads/master | playing_with_kivy/tutorial4.py | 1 | # https://www.youtube.com/watch?v=ZVWAKzR63ig
# Kivy crash course 4
## Kivy language
from kivy.app import App
from kivy.uix.scatter import Scatter
from kivy.uix.label import Label
from kivy.uix.floatlayout import FloatLayout
from kivy.uix.textinput import TextInput
from kivy.uix.boxlayout import BoxLayout # puts c... |
cardmagic/PyAMF | refs/heads/master | pyamf/adapters/_django_db_models_query.py | 2 | # Copyright (c) 2007-2009 The PyAMF Project.
# See LICENSE.txt for details.
"""
Django query adapter module.
Sets up basic type mapping and class mappings for a
Django models.
@see: U{Django Project<http://www.djangoproject.com>}
@since: 0.1b
"""
from django.db.models import query
import pyamf
from pyamf.adapters ... |
ojarva/home-info-display | refs/heads/master | homedisplay/info_notifications/migrations/0001_initial.py | 1 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Notification',
fields=[
('id', models.AutoField... |
DefyVentures/edx-platform | refs/heads/master | common/test/acceptance/tests/lms/test_lms_user_preview.py | 11 | # -*- coding: utf-8 -*-
"""
Tests the "preview" selector in the LMS that allows changing between Staff, Student, and Content Groups.
"""
from nose.plugins.attrib import attr
from ..helpers import UniqueCourseTest, create_user_partition_json
from ...pages.studio.auto_auth import AutoAuthPage
from ...pages.lms.coursewar... |
smalls257/VRvisu | refs/heads/master | Library/External.LCA_RESTRICTED/Languages/CPython/27/Lib/ctypes/test/test_objects.py | 143 | r'''
This tests the '_objects' attribute of ctypes instances. '_objects'
holds references to objects that must be kept alive as long as the
ctypes instance, to make sure that the memory buffer is valid.
WARNING: The '_objects' attribute is exposed ONLY for debugging ctypes itself,
it MUST NEVER BE MODIFIED!
'_object... |
Arable/evepod | refs/heads/master | lib/python2.7/site-packages/newrelic-2.12.0.10/newrelic/packages/requests/packages/charade/universaldetector.py | 91 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer.... |
odoobgorg/odoo | refs/heads/9.0 | addons/l10n_in/__openerp__.py | 18 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Indian - Accounting',
'version': '2.0',
'description': """
Indian Accounting: Chart of Account.
====================================
Indian accounting chart and localization.
OpenERP allows to ma... |
allenlavoie/tensorflow | refs/heads/master | tensorflow/contrib/keras/api/keras/applications/xception/__init__.py | 74 | # 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... |
vitan/hue | refs/heads/master | desktop/core/ext-py/Mako-0.8.1/examples/wsgi/run_wsgi.py | 40 | #!/usr/bin/python
import cgi, re, os, posixpath, mimetypes
from mako.lookup import TemplateLookup
from mako import exceptions
root = './'
port = 8000
error_style = 'html' # select 'text' for plaintext error reporting
lookup = TemplateLookup(directories=[root + 'templates', root + 'htdocs'], filesystem_checks=True, m... |
rotofly/odoo | refs/heads/master | openerp/addons/test_documentation_examples/extension.py | 366 | # -*- coding: utf-8 -*-
from openerp import models, fields
class Extension0(models.Model):
_name = 'extension.0'
name = fields.Char(default="A")
class Extension1(models.Model):
_inherit = 'extension.0'
description = fields.Char(default="Extended")
|
kervi/kervi | refs/heads/master | kervi/kervi/utility/logging_handler.py | 1 | import logging
import logging.config
import logging.handlers
import threading
from multiprocessing import Queue
_console_log = 15
class LogLevelFilter(logging.Filter):
def __init__(self, param=None):
self._level = param
def filter(self, record):
return record.levelno in self._level and record.... |
MobinRanjbar/hue | refs/heads/master | desktop/core/ext-py/Django-1.6.10/tests/admin_views/forms.py | 241 | from django import forms
from django.contrib.admin.forms import AdminAuthenticationForm
class CustomAdminAuthenticationForm(AdminAuthenticationForm):
def clean_username(self):
username = self.cleaned_data.get('username')
if username == 'customform':
raise forms.ValidationError('custom... |
parthz/buku | refs/heads/master | buku/wsgi.py | 1 | """
WSGI config for buku project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "buku.settings.base")
from django.core.ws... |
ridfrustum/lettuce | refs/heads/master | tests/integration/lib/Django-1.2.5/django/contrib/gis/db/backends/oracle/models.py | 310 | """
The GeometryColumns and SpatialRefSys models for the Oracle spatial
backend.
It should be noted that Oracle Spatial does not have database tables
named according to the OGC standard, so the closest analogs are used.
For example, the `USER_SDO_GEOM_METADATA` is used for the GeometryColumns
model and the `SDO_... |
saurabh6790/omn-app | refs/heads/master | buying/doctype/purchase_common/__init__.py | 37694 | from __future__ import unicode_literals
|
wilvk/ansible | refs/heads/devel | lib/ansible/plugins/lookup/redis.py | 21 | # (c) 2012, Jan-Piet Mens <jpmens(at)gmail.com>
# (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = """
lookup: redis
author:
- Jan-P... |
rxz135cc/yii2sample | refs/heads/master | vendor/bower-asset/bootstrap/test-infra/s3_cache.py | 2166 | #!/usr/bin/env python2.7
# pylint: disable=C0301
from __future__ import absolute_import, unicode_literals, print_function, division
from sys import argv
from os import environ, stat, chdir, remove as _delete_file
from os.path import dirname, basename, abspath, realpath, expandvars
from hashlib import sha256
from subpr... |
GenericStudent/home-assistant | refs/heads/dev | homeassistant/components/zha/lock.py | 9 | """Locks on Zigbee Home Automation networks."""
import functools
from zigpy.zcl.foundation import Status
from homeassistant.components.lock import (
DOMAIN,
STATE_LOCKED,
STATE_UNLOCKED,
LockEntity,
)
from homeassistant.core import callback
from homeassistant.helpers.dispatcher import async_dispatcher... |
bbansalWolfPack/servo | refs/heads/master | tests/wpt/harness/wptrunner/browsers/edge.py | 59 | # 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/.
from .base import Browser, ExecutorBrowser, require_arg
from ..webdriver_server import EdgeDriverServer
from ..executors... |
open-synergy/website | refs/heads/8.0 | setup/website_backend_views/odoo_addons/__init__.py | 13048 | __import__('pkg_resources').declare_namespace(__name__)
|
gregpuzzles1/Sandbox | refs/heads/master | Example Programs/Ch_14_Student_Files/node.py | 8 | """
File: node.py
Node classes for one-way linked structures and two-way
linked structures.
"""
class Node(object):
def __init__(self, data, next = None):
"""Instantiates a Node with default next of None"""
self.data = data
self.next = next
class TwoWayNode(Node):
def __init__(self,... |
nilgoyyou/dipy | refs/heads/master | dipy/core/tests/test_ndindex.py | 19 | from dipy.core.ndindex import ndindex
import numpy as np
from numpy.testing import assert_array_equal
def test_ndindex():
x = list(ndindex((1, 2, 3)))
expected = [ix for ix, e in np.ndenumerate(np.zeros((1, 2, 3)))]
assert_array_equal(x, expected)
def test_ndindex_0d():
x = list(ndindex(np.array(1)... |
jmwright/cadquery-x | refs/heads/master | gui/libs/docutils/parsers/rst/languages/en.py | 180 | # $Id: en.py 7179 2011-10-15 22:06:45Z milde $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
# New language mappings are welcome. Before doing a new translation, please
# read <http://docutils.sf.net/docs/howto/i18n.html>. Two files must be
# translated f... |
renhaoqi/gem5-stable | refs/heads/master | scons-local-2.2.0/SCons/Tool/cvf.py | 14 | """engine.SCons.Tool.cvf
Tool-specific initialization for the Compaq Visual Fortran compiler.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and assoc... |
utluiz/utluiz.github.io | refs/heads/master | pyscript/Lib/unittest/test/test_assertions.py | 4 | import datetime
import warnings
import unittest
from itertools import product
class Test_Assertions(unittest.TestCase):
def test_AlmostEqual(self):
self.assertAlmostEqual(1.00000001, 1.0)
self.assertNotAlmostEqual(1.0000001, 1.0)
self.assertRaises(self.failureException,
... |
pigeonflight/strider-plone | refs/heads/master | docker/appengine/google/appengine/ext/datastore_admin/config.py | 12 | #!/usr/bin/env python
#
# Copyright 2007 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 applicable law o... |
avoceteditors/bacch | refs/heads/master | bacch/log.py | 2 |
from sphinx.util.console import darkblue, darkgreen, brown, darkred
from sphinx.util.logging import getLogger
class BacchLogger:
"""Configures loging operations for Sphinx"""
def init_logger(self):
self.logger = getLogger(self.__class__.__name__)
def debug(self, msg, nonl_val=False):
sel... |
dibaunaumh/tikal-corp-website | refs/heads/master | cms/templatetags/cms_tags.py | 1 | from itertools import chain
from cms.exceptions import NoHomeFound
from cms.utils import get_language_from_request, get_template_from_request
from cms.utils.moderator import get_cmsplugin_queryset, get_page_queryset
from cms.plugin_rendering import render_plugins, render_placeholder, render_placeholder_toolbar
from cms... |
technologiescollege/s2a_fr | refs/heads/portable | s2a/Python/Lib/encodings/big5.py | 816 | #
# big5.py: Python Unicode Codec for BIG5
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#
import _codecs_tw, codecs
import _multibytecodec as mbc
codec = _codecs_tw.getcodec('big5')
class Codec(codecs.Codec):
encode = codec.encode
decode = codec.decode
class IncrementalEncoder(mbc.MultibyteIncrementalE... |
BehavioralInsightsTeam/edx-platform | refs/heads/release-bit | lms/djangoapps/shoppingcart/processors/CyberSource2.py | 16 | """
Implementation of the CyberSource credit card processor using the newer "Secure Acceptance API".
The previous Hosted Order Page API is being deprecated as of 9/14.
For now, we're keeping the older implementation in the code-base so we can
quickly roll-back by updating the configuration. Eventually, we should repl... |
carquois/blobon | refs/heads/master | blobon/blogs/migrations/0082_auto__add_field_blog_facebook_link__add_field_blog_twitter_link__add_f.py | 1 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Blog.facebook_link'
db.add_column('blogs_blog', 'facebook_link',
self.... |
jeid64/dcos | refs/heads/master | packages/adminrouter/extra/src/test-harness/modules/mocker/jwt.py | 3 | # Copyright (C) Mesosphere, Inc. See LICENSE file for details.
"""This module provides a set tools for generating JSON Web Tokens
Attributes:
AUTHTOKEN_LIFETIME_SECONDS (int): default token validity period, measured from
time.time(), expressed in seconds
"""
import jwt
import logging
import t... |
mx3L/enigma2 | refs/heads/master | lib/python/Components/Renderer/FixedLabel.py | 165 | from Renderer import Renderer
from enigma import eLabel
class FixedLabel(Renderer):
GUI_WIDGET = eLabel
|
slevenhagen/odoo | refs/heads/8.0 | addons/report/models/abstract_report.py | 249 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2014-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... |
gangadhar-kadam/mtn-erpnext | refs/heads/master | selling/page/__init__.py | 37694 | from __future__ import unicode_literals
|
shaufi10/odoo | refs/heads/8.0 | addons/google_calendar/res_config.py | 256 | from openerp.osv import fields, osv
class calendar_config_settings(osv.TransientModel):
_inherit = 'base.config.settings'
_columns = {
'google_cal_sync': fields.boolean("Show tutorial to know how to get my 'Client ID' and my 'Client Secret'"),
'cal_client_id': fields.char("Client_id"),
... |
ben-e-whitney/next-train | refs/heads/master | next_train/wizard.py | 1 | """
Trim GTFS feeds according to user input.
"""
import csv
import curses
import functools
import logging
import operator
import os
import sys
import typing
import zipfile
from . import chooser
from . import gtfs
logger = logging.getLogger(__name__)
ROUTE_TYPES_FILENAME: str = os.path.join(
os.path.dirname(__fi... |
YongseopKim/crosswalk-test-suite | refs/heads/master | wrt/wrt-extension-android-tests/inst.apk.py | 10 | #!/usr/bin/env python
import os
import shutil
import glob
import time
import sys
import subprocess
from optparse import OptionParser, make_option
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
PKG_NAME = os.path.basename(SCRIPT_DIR)
TEST_PREFIX = os.environ['HOME']
PARAMETERS = None
ADB_CMD = "adb"
def do... |
ChristianFrisson/gaia | refs/heads/qt5 | src/bindings/pygaia/classification/classificationtaskmanager.py | 2 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2006-2013 Music Technology Group - Universitat Pompeu Fabra
#
# This file is part of Gaia
#
# Gaia 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 Fou... |
erichiggins/gae-mixy | refs/heads/master | api/handlers/main.py | 1 | #!/usr/bin/env python
"""
Main API handlers.
"""
from google.appengine.api import capabilities
from . import base
from tools import appstats_serializer
__all__ = [
'AppStats',
'AppStatsList',
'Health',
'Version',
]
class AppStats(base.BaseHandler):
"""Return output from AppStats."""
# TODO(e... |
wonabru/p2pool-Q | refs/heads/master | SOAPpy/SOAP.py | 294 | """This file is here for backward compatibility with versions <= 0.9.9
Delete when 1.0.0 is released!
"""
ident = '$Id: SOAP.py 541 2004-01-31 04:20:06Z warnes $'
from version import __version__
from Client import *
from Config import *
from Errors import *
from NS import *
from Parser ... |
hvy/chainer | refs/heads/master | tests/chainer_tests/links_tests/connection_tests/test_linear.py | 4 | import os
import tempfile
import unittest
import numpy
import chainer
from chainer.backends import cuda
from chainer import gradient_check
from chainer import links
from chainer.serializers import npz
from chainer import testing
from chainer.testing import attr
from chainer.testing import condition
from chainer.utils... |
sobercoder/gem5 | refs/heads/master | src/arch/power/PowerInterrupts.py | 69 | # Copyright (c) 2011 Google
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met: redistributions of source code must retain the above copyright
# notice, this list of conditions and the following dis... |
johnsonc/OTM2 | refs/heads/master | opentreemap/treemap/migrations/0030_auto__add_unique_instance_name.py | 3 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding unique constraint on 'Instance', fields ['name']
db.create_unique(u'treemap_instance', ['name'])
... |
zakuro9715/lettuce | refs/heads/master | tests/integration/lib/Django-1.3/django/contrib/webdesign/tests.py | 379 | # -*- coding: utf-8 -*-
import unittest
from django.contrib.webdesign.lorem_ipsum import *
from django.template import loader, Context
class WebdesignTest(unittest.TestCase):
def test_words(self):
self.assertEqual(words(7), u'lorem ipsum dolor sit amet consectetur adipisicing')
def test_paragraphs... |
moylop260/odoo-dev | refs/heads/master | addons/mrp/wizard/__init__.py | 374 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
TheBlackTuxCorp/selenium | refs/heads/master | py/test/selenium/webdriver/common/results_page.py | 65 | # 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... |
wdsgyj/google-breakpad-mirror | refs/heads/master | src/tools/gyp/test/make_global_settings/basics/gyptest-make_global_settings.py | 148 | #!/usr/bin/env python
# Copyright (c) 2013 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.
"""
Verifies make_global_settings.
"""
import os
import sys
import TestGyp
test_format = ['ninja']
if sys.platform in ('linux2', 'darwin')... |
ShashaQin/erpnext | refs/heads/develop | erpnext/hr/doctype/job_opening/job_opening.py | 9 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.website.website_generator import WebsiteGenerator
from frappe import _
cl... |
gnome-keysign/gnome-keysign | refs/heads/master | keysign/keylistwidget.py | 1 | #!/usr/bin/env python
from __future__ import unicode_literals
import logging
import os
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
from gi.repository import GObject # for __gsignals__
from gi.repository import GLib # for markup_escape_text
if __name__ == "__main__" and __package__ is N... |
viger/docker | refs/heads/master | proxy/proxy/code/default/python27/1.0/lib/encodings/cp860.py | 593 | """ Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP860.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_map)
def decode(self,input,errors='strict'):
... |
linwaterbin/mysql-statsd-1 | refs/heads/master | mysql_statsd/__init__.py | 3 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'Jasper Capel'
__email__ = 'jasper.capel@spilgames.com'
__version__ = '0.1.0' |
zetaops/zengine | refs/heads/develop | tests/views/check_user_task_rerun.py | 1 | # -*- coding: utf-8 -*-
# Copyright (C) 2015 ZetaOps Inc.
#
# This file is licensed under the GNU General Public License v3
# (GPLv3). See LICENSE.txt for details.
def user_task_a(current):
current.output['task_name'] = 'user_task_a'
def user_task_b(current):
current.output['task_name'] = 'user_task_b'
d... |
joshdavies89/e-commerce | refs/heads/master | src/ecommerce/settings/base.py | 2 | """
Django settings for ecommerce project.
Generated by 'django-admin startproject' using Django 1.8.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Build path... |
zstackorg/zstack | refs/heads/master | testlib/src/main/resources/zssdk_bak.py | 2 | import re
import sys
try:
import urllib3
except ImportError:
print 'urlib3 is not installed, run "pip install urlib3"'
sys.exit(1)
import string
import json
from uuid import uuid4
import time
import threading
import functools
import traceback
import base64
import hmac
import sha
from hashlib import sha1
i... |
isandlaTech/cohorte-demos | refs/heads/dev | led/dump/led-demo-raspberry/cohorte/dist/cohorte-1.0.0-20141216.234517-57-python-distribution/repo/cohorte/composer/node/history.py | 4 | #!/usr/bin/env python
# -- Content-Encoding: UTF-8 --
"""
Node Composer: Node status history
:author: Thomas Calmant
:license: Apache Software License 2.0
:version: 3.0.0
..
Copyright 2014 isandlaTech
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in com... |
rohitwaghchaure/New_Theme_Erp | refs/heads/develop | erpnext/setup/doctype/assing_master/test_assing_master.py | 7 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors and Contributors
# See license.txt
import frappe
import unittest
test_records = frappe.get_test_records('Assing Master')
class TestAssingMaster(unittest.TestCase):
pass
|
thinkerchan/thefuck | refs/heads/master | tests/rules/test_mercurial.py | 17 | import pytest
from tests.utils import Command
from thefuck.rules.mercurial import (
extract_possibilities, match, get_new_command
)
@pytest.mark.parametrize('command', [
Command('hg base', stderr=(
"hg: unknown command 'base'"
'\n(did you mean one of blame, phase, rebase?)'
)),
Comman... |
lebabouin/CouchPotatoServer-develop | refs/heads/master | libs/chardet/langhebrewmodel.py | 235 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Simon Montagu
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved... |
yashtrivedi96/coala-bears | refs/heads/master | bears/vimscript/VintBear.py | 11 | from coalib.bearlib.abstractions.Linter import linter
from dependency_management.requirements.PipRequirement import PipRequirement
@linter(executable='vint', output_format='regex',
output_regex=r'.+:(?P<line>\d+):(?P<column>\d+): (?P<message>.+)')
class VintBear:
"""
Check vimscript code for possible ... |
blackboarddd/selenium | refs/heads/master | py/test/selenium/webdriver/common/webdriverwait_tests.py | 61 | # 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... |
stvstnfrd/edx-platform | refs/heads/master | common/lib/xmodule/xmodule/modulestore/split_mongo/mongo_connection.py | 1 | """
Segregation of pymongo functions from the data modeling mechanisms for split modulestore.
"""
import datetime
import logging
import math
import re
import zlib
from contextlib import contextmanager
from time import time
import pymongo
import pytz
import six
from six.moves import cPickle as pickle
from contracts i... |
thanhacun/odoo | refs/heads/8.0 | addons/portal/wizard/portal_wizard.py | 260 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2011 OpenERP S.A (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... |
Noviat/odoo | refs/heads/8.0 | addons/crm/ir_http.py | 306 | # -*- coding: utf-8 -*-
from openerp.http import request
from openerp.osv import orm
class ir_http(orm.AbstractModel):
_inherit = 'ir.http'
def get_utm_domain_cookies(self):
return request.httprequest.host
def _dispatch(self):
response = super(ir_http, self)._dispatch()
for var, ... |
Nikea/VisTrails | refs/heads/master | vistrails/db/versions/v0_9_5/translate/v1_0_0.py | 2 | ###############################################################################
##
## Copyright (C) 2011-2014, NYU-Poly.
## Copyright (C) 2006-2011, University of Utah.
## All rights reserved.
## Contact: contact@vistrails.org
##
## This file is part of VisTrails.
##
## "Redistribution and use in source and binary for... |
salaria/odoo | refs/heads/8.0 | addons/l10n_be_invoice_bba/invoice.py | 141 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
#
# Copyright (c) 2011 Noviat nv/sa (www.noviat.be). All rights reserved.
#
# This program is free software: you can redistribute it and/or modify
# i... |
vmturbo/nova | refs/heads/master | nova/scheduler/filters/json_filter.py | 19 | # Copyright (c) 2011 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... |
sustr4/pOCCI | refs/heads/master | pOCCI/pOCCI.py | 1 | #!/usr/bin/python
import getopt
import re
import sys
import time
import os
from occi_libs import *
from CORE import *
import occi
import version
tests_definitions = {
'OCCI/CORE/DISCOVERY/001': CORE_DISCOVERY001,
'OCCI/CORE/DISCOVERY/002': CORE_DISCOVERY002,
'OCCI/CORE/READ/001': CORE_READ001,
'OCCI... |
playm2mboy/edx-platform | refs/heads/master | lms/djangoapps/instructor/tests/test_legacy_xss.py | 60 | """
Tests of various instructor dashboard features that include lists of students
"""
from django.conf import settings
from django.test.client import RequestFactory
from markupsafe import escape
from nose.plugins.attrib import attr
from student.tests.factories import UserFactory, CourseEnrollmentFactory
from edxmako.... |
40023255/2015cd_0505 | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/_io.py | 629 | """
Python implementation of the io module.
"""
import os
import abc
import codecs
import errno
# 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
import io
#brython fix me
#from io imp... |
lmazuel/ansible | refs/heads/devel | lib/ansible/modules/system/getent.py | 69 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, Brian Coca <brian.coca+dev@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... |
Vassy/odoo | refs/heads/master | openerp/osv/expression.py | 32 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
afloren/nipype | refs/heads/master | nipype/interfaces/mrtrix/tests/test_auto_Tensor2ApparentDiffusion.py | 9 | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from nipype.testing import assert_equal
from nipype.interfaces.mrtrix.preprocess import Tensor2ApparentDiffusion
def test_Tensor2ApparentDiffusion_inputs():
input_map = dict(args=dict(argstr='%s',
),
debug=dict(argstr='-debug',
position=1,
),
... |
bosszhou/ThinkStats2 | refs/heads/master | code/linear.py | 68 | """This file contains code used in "Think Stats",
by Allen B. Downey, available from greenteapress.com
Copyright 2010 Allen B. Downey
License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html
"""
from __future__ import print_function, division
import math
import numpy as np
import first
import thinkplot
import thinks... |
SeaFalcon/Musicool_Pr | refs/heads/master | lib/itsdangerous.py | 296 | # -*- coding: utf-8 -*-
"""
itsdangerous
~~~~~~~~~~~~
A module that implements various functions to deal with untrusted
sources. Mainly useful for web applications.
:copyright: (c) 2011 by Armin Ronacher and the Django Software Foundation.
:license: BSD, see LICENSE for more details.
"""
imp... |
miikka-h/Projektikurssi17 | refs/heads/master | pi3/inputReader.py | 1 | import evdev
class HasKeyboard:
def __init__(self):
print("")
def evaluator():
devices = [evdev.InputDevice(fn) for fn in evdev.list_devices()]
for device in devices:
#capabilityMap = device.capabilities(True, False)
print(device.name + " " + device.fn)
HasK... |
inspyration/odoo | refs/heads/master | addons/mrp_repair/wizard/make_invoice.py | 172 | # -*- 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... |
stratosgear/bravado | refs/heads/master | tests/client_test.py | 4 | # -*- coding: utf-8 -*-
import datetime
import tempfile
import unittest
import httpretty
import requests
import pytest
from bravado.client import SwaggerClient
@pytest.mark.xfail
class SwaggerClientTest(unittest.TestCase):
def test_from_dict(self):
client_stub = SwaggerClient.from_dict(self.resource_li... |
andresgz/django | refs/heads/master | tests/forms_tests/tests/test_error_messages.py | 145 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.core.files.uploadedfile import SimpleUploadedFile
from django.forms import (
BooleanField, CharField, ChoiceField, DateField, DateTimeField,
DecimalField, EmailField, FileField, FloatField, Form,
GenericIPAddressField, IntegerField... |
koomik/CouchPotatoServer | refs/heads/develop | libs/dateutil/easter.py | 232 | """
Copyright (c) 2003-2007 Gustavo Niemeyer <gustavo@niemeyer.net>
This module offers extensions to the standard Python
datetime module.
"""
__license__ = "Simplified BSD"
import datetime
__all__ = ["easter", "EASTER_JULIAN", "EASTER_ORTHODOX", "EASTER_WESTERN"]
EASTER_JULIAN = 1
EASTER_ORTHODOX = 2
EASTER_WEST... |
sparkslabs/kamaelia | refs/heads/master | Sketches/PO/KamPlanet/libs/easydocp.py | 54 | """Simple code to extract class & function docstrings from a module.
This code is used as an example in the library reference manual in the
section on using the parser module. Refer to the manual for a thorough
discussion of the operation of this code.
"""
import os
import parser
import symbol
import token
import ty... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.