repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
Pablo126/SSBW | refs/heads/master | Entrega1/lib/python3.5/site-packages/rest_framework/urlpatterns.py | 18 | from __future__ import unicode_literals
from django.conf.urls import url
from rest_framework.compat import RegexURLResolver, include
from rest_framework.settings import api_settings
def apply_suffix_patterns(urlpatterns, suffix_pattern, suffix_required):
ret = []
for urlpattern in urlpatterns:
if is... |
ephes/scikit-learn | refs/heads/master | examples/svm/plot_svm_anova.py | 250 | """
=================================================
SVM-Anova: SVM with univariate feature selection
=================================================
This example shows how to perform univariate feature before running a SVC
(support vector classifier) to improve the classification scores.
"""
print(__doc__)
import... |
tesidroni/mp | refs/heads/master | Lib/site-packages/numpy/distutils/command/build.py | 99 | import os
import sys
from distutils.command.build import build as old_build
from distutils.util import get_platform
from numpy.distutils.command.config_compiler import show_fortran_compilers
class build(old_build):
sub_commands = [('config_cc', lambda *args: True),
('config_fc', lambda... |
mpedrero/quill | refs/heads/master | src/generators/BlogPostGenerator.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import codecs
import shutil
import pystache
import containers.TagData as TagData
import PyRSS2Gen as RSS2
import datetime
class BlogPostGenerator:
def __init__(self, blogMetadata):
self.blogMetadata = blogMetadata
self.outputFolder = blogMetadata.blogFold... |
airspeed-velocity/asv | refs/heads/master | test/test_environment.py | 2 | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import os
import sys
import six
import pytest
import json
from collections import defaultdict
from asv import config
fro... |
Fale/ansible | refs/heads/devel | test/integration/targets/module_utils/module_utils/spam8/ham/bacon.py | 298 | data = 'spam8:bacon'
|
kk47/C-Cpp | refs/heads/master | deppends/python/google/protobuf/descriptor_database.py | 230 | # Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# http://code.google.com/p/protobuf/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions o... |
mozilla/mozilla-ignite | refs/heads/master | vendor-local/lib/python/south/creator/__init__.py | 179 | """
The creator module is responsible for making new migration files, either
as blank templates or autodetecting changes. It contains code that used to
all be in startmigration.py.
"""
|
henrytao-me/openerp.positionq | refs/heads/master | openerp/addons/account_check_writing/wizard/account_check_batch_printing.py | 54 | # -*- 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... |
wolverton-research-group/qmpy | refs/heads/master | qmpy/web/views/api/formationenergy_list_view.py | 1 | from rest_framework import generics
import django_filters.rest_framework
from qmpy.web.serializers.formationenergy import FormationEnergySerializer
from qmpy.materials.formation_energy import FormationEnergy
from qmpy.materials.composition import Composition
from qmpy.materials.element import Element
from qmpy.utils im... |
jazztpt/edx-platform | refs/heads/master | lms/djangoapps/certificates/migrations/0023_auto__del_unique_badgeassertion_course_id_user__add_unique_badgeassert.py | 52 | # -*- 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):
# Removing unique constraint on 'BadgeAssertion', fields ['course_id', 'user']
... |
ivanbaldo/yowsup | refs/heads/master | yowsup/layers/protocol_groups/structs/group.py | 59 | class Group(object):
def __init__(self, groupId, creatorJid, subject, subjectOwnerJid, subjectTime, creationTime, participants=None):
self._groupId = groupId
self._creatorJid = creatorJid
self._subject = subject
self._subjectOwnerJid = subjectOwnerJid
... |
sajao/CrisisLex | refs/heads/master | src-collect/tweepy1/utils.py | 30 | # Tweepy
# Copyright 2010 Joshua Roesslein
# See LICENSE for details.
from datetime import datetime
import time
import htmlentitydefs
import re
import locale
from urllib import quote
def parse_datetime(string):
# Set locale for date parsing
locale.setlocale(locale.LC_TIME, 'C')
# We must parse datetime ... |
yugang/crosswalk-test-suite | refs/heads/master | tools/atip/atip/common/steps.py | 3 | # Copyright (c) 2014 Intel Corporation.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# * Redistributions of works must retain the original copyright notice, this list
# of conditions and the following disclaimer.... |
kisna72/django | refs/heads/master | tests/admin_changelist/urls.py | 810 | from django.conf.urls import url
from . import admin
urlpatterns = [
url(r'^admin/', admin.site.urls),
]
|
jmcabandara/imagefactory | refs/heads/master | imgfac/rest/OAuthTools.py | 4 | #
# Copyright 2012 Red Hat, 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 or agreed ... |
idegtiarov/ceilometer | refs/heads/master | ceilometer/tests/functional/api/v2/test_statistics_scenarios.py | 1 | #
# Copyright 2012 New Dream Network, LLC (DreamHost)
#
# 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... |
hip-odoo/odoo | refs/heads/10.0 | odoo/tools/which.py | 80 | #!/usr/bin/env python
""" Which - locate a command
* adapted from Brian Curtin's http://bugs.python.org/file15381/shutil_which.patch
* see http://bugs.python.org/issue444582
* uses ``PATHEXT`` on Windows
* searches current directory before ``PATH`` on Windows,
but not before an explicitly passed ... |
163gal/Time-Line | refs/heads/master | libs64/wxPython/lib/editor/__init__.py | 6 | from editor import Editor
|
skyfielders/python-skyfield | refs/heads/master | skyfield/named_stars.py | 1 | # This list was seeded from:
# https://en.wikipedia.org/wiki/List_of_stars_in_the_Hipparcos_Catalogue
# Recent discussion:
# https://github.com/skyfielders/python-skyfield/issues/304
named_star_dict= {
'Achernar': 7588,
'Acrux': 60718,
'Adhara': 33579,
'Agena': 68702,
'Albireo': 95947,
'Alcor': 65477,
'Aldebar... |
KAMI911/loec | refs/heads/master | examples/Sharpen/binaries-windows-python26/ImageTk.py | 3 | #
# The Python Imaging Library.
# $Id: ImageTk.py 2134 2004-10-06 08:55:20Z fredrik $
#
# a Tk display interface
#
# History:
# 96-04-08 fl Created
# 96-09-06 fl Added getimage method
# 96-11-01 fl Rewritten, removed image attribute and crop method
# 97-05-09 fl Use PyImagingPaste method instead of im... |
cleverhans-lab/cleverhans | refs/heads/master | cleverhans_v3.1.0/cleverhans/experimental/certification/utils.py | 2 | """File containing some simple helper functions."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import tensorflow as tf
def diag(diag_elements):
"""Function to create tensorflow diagonal matrix with input diagonal entries.
... |
sonuyos/couchpotato | refs/heads/master | libs/tornado/web.py | 63 | #!/usr/bin/env python
#
# Copyright 2009 Facebook
#
# 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... |
ovresko/erpnext | refs/heads/master | erpnext/restaurant/doctype/restaurant_order_entry/restaurant_order_entry.py | 24 | # -*- coding: utf-8 -*-
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe, json
from frappe.model.document import Document
from frappe import _
from erpnext.controllers.queries import item_query
... |
michalliu/OpenWrt-Firefly-Libraries | refs/heads/master | staging_dir/host/lib/python2.7/test/test_textwrap.py | 85 | #
# Test suite for the textwrap module.
#
# Original tests written by Greg Ward <gward@python.net>.
# Converted to PyUnit by Peter Hansen <peter@engcorp.com>.
# Currently maintained by Greg Ward.
#
# $Id$
#
import unittest
from test import test_support
from textwrap import TextWrapper, wrap, fill, dedent
class Base... |
manasapte/pants | refs/heads/master | contrib/android/tests/python/pants_test/contrib/android/test_android_manifest_parser.py | 14 | # coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from pants_test.util... |
Ziemin/telepathy-gabble | refs/heads/untested-otr | tests/twisted/tubes/accept-muc-stream-tube.py | 2 | """Test IBB stream tube support in the context of a MUC."""
import sys
import dbus
from servicetest import call_async, EventPattern, assertEquals, assertSameSets
from gabbletest import acknowledge_iq, make_muc_presence, send_error_reply, disconnect_conn
import constants as cs
import ns
import tubetestutil as t
from ... |
handroissuazo/tensorflow | refs/heads/master | venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/langgreekmodel.py | 2762 | ######################## 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... |
windskyer/nova | refs/heads/master | nova/api/openstack/compute/schemas/image_metadata.py | 95 | # Copyright 2014 IBM Corporation. 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 ... |
rowemoore/odoo | refs/heads/8.0 | addons/hr_expense/tests/test_journal_entries.py | 251 | from openerp.tests.common import TransactionCase
from openerp import netsvc, workflow
class TestCheckJournalEntry(TransactionCase):
"""
Check journal entries when the expense product is having tax which is tax included.
"""
def setUp(self):
super(TestCheckJournalEntry, self).setUp()
... |
qma/pants | refs/heads/master | src/python/pants/goal/run_tracker.py | 2 | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import json
import m... |
lepistone/odoo | refs/heads/master | addons/product_email_template/__openerp__.py | 65 | # -*- coding: utf-8 -*-
{
'name': 'Product Email Template',
'depends': ['account'],
'author': 'OpenERP SA',
'category': 'Accounting & Finance',
'description': """
Add email templates to products to be send on invoice confirmation
==================================================================
W... |
nnethercote/servo | refs/heads/master | components/script/dom/bindings/codegen/parser/tests/test_putForwards.py | 142 | def WebIDLTest(parser, harness):
threw = False
try:
parser.parse("""
interface I {
[PutForwards=B] readonly attribute long A;
};
""")
results = parser.finish()
except:
threw = True
harness.ok(threw, "Should have thrown.")
parse... |
evgchz/scikit-learn | refs/heads/master | sklearn/feature_extraction/tests/test_image.py | 12 | # Authors: Emmanuelle Gouillart <emmanuelle.gouillart@normalesup.org>
# Gael Varoquaux <gael.varoquaux@normalesup.org>
# License: BSD 3 clause
import numpy as np
import scipy as sp
from scipy import ndimage
from nose.tools import assert_equal, assert_true
from numpy.testing import assert_raises
from ..image... |
vitan/hue | refs/heads/master | desktop/core/ext-py/Django-1.6.10/tests/urlpatterns_reverse/urls_error_handlers_callables.py | 53 | # Used by the ErrorHandlerResolutionTests test case.
from __future__ import absolute_import
from django.conf.urls import patterns
from .views import empty_view
urlpatterns = patterns('')
handler400 = empty_view
handler404 = empty_view
handler500 = empty_view
|
fuzzyhandle/pihangout | refs/heads/master | testweet/tweetexternalip.py | 1 | from __future__ import absolute_import, print_function
import json
import urllib
from pprint import pprint
from tweepy.streaming import StreamListener
from tweepy import OAuthHandler
from tweepy import Stream
from tweepy import API
def getTwitterAPIHandle():
with open('api_secret_token.json') as data_file:
... |
ceph/Diamond | refs/heads/master | src/collectors/openstackswift/test/testopenstackswift.py | 37 | #!/usr/bin/python
# coding=utf-8
################################################################################
from test import CollectorTestCase
from test import get_collector_config
from openstackswift import OpenstackSwiftCollector
class TestOpenstackSwiftCollector(CollectorTestCase):
def setUp(self, allo... |
xin3liang/platform_external_chromium_org_tools_gyp | refs/heads/master | test/win/gyptest-lib-ltcg.py | 269 | #!/usr/bin/env python
# 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.
"""
Make sure LTCG setting is extracted properly.
"""
import TestGyp
import sys
if sys.platform == 'win32':
test = TestGyp.TestGyp(form... |
olifre/rootStaticAnalyzer | refs/heads/master | .ycm_extra_conf.py | 1 | # This file is NOT licensed under the GPLv3, which is the license for the rest
# of YouCompleteMe.
#
# Here's the license text for this file:
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either... |
juanyaw/python | refs/heads/develop | cpython/Tools/msi/make_zip.py | 3 | import argparse
import re
import sys
import shutil
import os
import tempfile
from pathlib import Path
from zipfile import ZipFile, ZIP_DEFLATED
import subprocess
TKTCL_RE = re.compile(r'^(_?tk|tcl).+\.(pyd|dll)', re.IGNORECASE)
DEBUG_RE = re.compile(r'_d\.(pyd|dll|exe)$', re.IGNORECASE)
PYTHON_DLL_RE = re.compile(r'p... |
saltstar/spark | refs/heads/master | examples/src/main/python/ml/train_validation_split.py | 71 | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... |
bigmlcom/bigmler | refs/heads/master | bigmler/options/main.py | 1 | # -*- coding: utf-8 -*-
#
# Copyright 2014-2021 BigML
#
# 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 ... |
mdrumond/tensorflow | refs/heads/master | tensorflow/python/ops/distributions/kullback_leibler.py | 35 | # 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... |
DepthDeluxe/ansible | refs/heads/devel | test/compile/compile.py | 126 | #!/usr/bin/env python
"""Python syntax checker with lint friendly output."""
import os
import parser
import re
import sys
def main():
paths, verbose, skip_patterns = parse_options()
paths = filter_paths(paths, skip_patterns)
check(paths, verbose)
def parse_options():
paths = []
skip_patterns = ... |
ice9js/servo | refs/heads/master | tests/unit/net/cookie_http_state_utils.py | 111 | # 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 subprocess
import tempfile
REPO = "https://github.com/abarth/http-state.git"
TEST_FILE = "cookie_http_... |
windedge/odoomrp-wip | refs/heads/8.0 | mrp_bom_by_percentage/models/mrp_bom.py | 20 | # -*- encoding: utf-8 -*-
##############################################################################
#
# This program 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... |
hexxter/home-assistant | refs/heads/dev | homeassistant/components/notify/command_line.py | 6 | """
Support for command line notification services.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/notify.command_line/
"""
import logging
import subprocess
import voluptuous as vol
from homeassistant.const import (CONF_COMMAND, CONF_NAME)
from homeass... |
postlund/home-assistant | refs/heads/dev | tests/components/search/__init__.py | 23 | """Tests for the Search integration."""
|
SujaySKumar/django | refs/heads/master | django/conf/locale/cs/formats.py | 504 | # -*- 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 = 'j. E Y'
TIME_FORMAT = 'G:i'
DATET... |
coursemdetw/2014c2 | refs/heads/master | exts/w2/static/Brython2.0.0-20140209-164925/Lib/xml/dom/minidom.py | 727 | """Simple implementation of the Level 1 DOM.
Namespaces and other minor Level 2 features are also supported.
parse("foo.xml")
parseString("<foo><bar/></foo>")
Todo:
=====
* convenience methods for getting elements and text.
* more testing
* bring some of the writer and linearizer code into conformance with this
... |
emencia/emencia.recipe.patch | refs/heads/master | emencia/recipe/__init__.py | 916 | # See http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages
try:
__import__('pkg_resources').declare_namespace(__name__)
except ImportError:
from pkgutil import extend_path
__path__ = extend_path(__path__, __name__)
|
amyvmiwei/kbengine | refs/heads/master | kbe/src/lib/python/Lib/ctypes/test/test_cfuncs.py | 11 | # A lot of failures in these tests on Mac OS X.
# Byte order related?
import unittest
from ctypes import *
import _ctypes_test
class CFunctions(unittest.TestCase):
_dll = CDLL(_ctypes_test.__file__)
def S(self):
return c_longlong.in_dll(self._dll, "last_tf_arg_s").value
def U(self):
retu... |
will-moore/openmicroscopy | refs/heads/develop | components/tools/OmeroPy/test/unit/clitest/test_db.py | 12 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Test of the omero db control.
Copyright 2009-2013 Glencoe Software, Inc. All rights reserved.
Use is subject to license terms supplied in LICENSE.txt
"""
import pytest
import os
from path import path
from omero.plugins.db import DatabaseControl
from omero.u... |
Dandandan/wikiprogramming | refs/heads/master | jsrepl/extern/python/closured/lib/python2.7/email/__init__.py | 262 | # Copyright (C) 2001-2006 Python Software Foundation
# Author: Barry Warsaw
# Contact: email-sig@python.org
"""A package for parsing, handling, and generating email messages."""
__version__ = '4.0.3'
__all__ = [
# Old names
'base64MIME',
'Charset',
'Encoders',
'Errors',
'Generator',
'Head... |
Pulgama/supriya | refs/heads/master | supriya/ugens/Dbufrd.py | 1 | import collections
from supriya import CalculationRate
from supriya.ugens.DUGen import DUGen
class Dbufrd(DUGen):
"""
A buffer-reading demand-rate UGen.
::
>>> dbufrd = supriya.ugens.Dbufrd(
... buffer_id=0,
... loop=1,
... phase=0,
... )
... |
fusion809/fusion809.github.io-old | refs/heads/master | vendor/bundle/ruby/2.1.0/gems/pygments.rb-0.6.3/vendor/pygments-main/pygments/formatters/terminal256.py | 59 | # -*- coding: utf-8 -*-
"""
pygments.formatters.terminal256
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Formatter for 256-color terminal output with ANSI sequences.
RGB-to-XTERM color conversion routines adapted from xterm256-conv
tool (http://frexx.de/xterm-256-notes/data/xterm256-conv2.tar.bz2)
by Wolfg... |
Yadnyawalkya/integration_tests | refs/heads/master | cfme/tests/services/test_myservice.py | 1 | # -*- coding: utf-8 -*-
from datetime import datetime
import pytest
from cfme import test_requirements
from cfme.infrastructure.provider.virtualcenter import VMwareProvider
from cfme.markers.env_markers.provider import ONE_PER_TYPE
from cfme.services.myservice.ui import MyServiceDetailView
from cfme.utils import brow... |
moreati/django | refs/heads/master | django/views/debug.py | 50 | from __future__ import unicode_literals
import re
import sys
import types
from django.conf import settings
from django.core.urlresolvers import Resolver404, resolve
from django.http import HttpResponse, HttpResponseNotFound
from django.template import Context, Engine, TemplateDoesNotExist
from django.template.default... |
songmonit/CTTMSONLINE_V8 | refs/heads/master | addons/payment_ogone/controllers/__init__.py | 4497 | # -*- coding: utf-8 -*-
import main
|
AnthonyBroadCrawford/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/html5lib/html5lib/__init__.py | 426 | """
HTML parsing library based on the WHATWG "HTML5"
specification. The parser is designed to be compatible with existing
HTML found in the wild and implements well-defined error recovery that
is largely compatible with modern desktop web browsers.
Example usage:
import html5lib
f = open("my_document.html")
tree = ht... |
NoahFlowa/glowing-spoon | refs/heads/master | venv/lib/python2.7/site-packages/pip/_vendor/distlib/scripts.py | 333 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2013-2015 Vinay Sajip.
# Licensed to the Python Software Foundation under a contributor agreement.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
from io import BytesIO
import logging
import os
import re
import struct
import sys
from .compat import sysconfig, detect_encoding, ZipFi... |
ademmers/ansible | refs/heads/devel | test/lib/ansible_test/_internal/provider/source/unversioned.py | 23 | """Fallback source provider when no other provider matches the content root."""
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
from ... import types as t
from ...constants import (
TIMEOUT_PATH,
)
from ...encoding import (
to_bytes,
)
from . import (
S... |
klunwebale/odoo | refs/heads/8.0 | addons/hr_timesheet/report/hr_timesheet_report.py | 262 |
from openerp import tools
from openerp.osv import fields,osv
from openerp.addons.decimal_precision import decimal_precision as dp
class hr_timesheet_report(osv.osv):
_name = "hr.timesheet.report"
_description = "Timesheet"
_auto = False
_columns = {
'date': fields.date('Date', readonly=True),
... |
vv1133/home_web | refs/heads/master | tests/model_forms/models.py | 51 | """
XX. Generating HTML forms from models
This is mostly just a reworking of the ``form_for_model``/``form_for_instance``
tests to use ``ModelForm``. As such, the text may not make sense in all cases,
and the examples are probably a poor fit for the ``ModelForm`` syntax. In other
words, most of these tests should be r... |
Rogentos/argent-anaconda | refs/heads/master | storage/formats/dmraid.py | 3 | # dmraid.py
# dmraid device formats
#
# Copyright (C) 2009 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program is dis... |
slongwang/selenium | refs/heads/master | py/test/selenium/webdriver/common/correct_event_firing_tests.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... |
nerginer/GrovePi | refs/heads/master | Software/Python/grove_thumb_joystick.py | 5 | #!/usr/bin/env python
#
# GrovePi Example for using the Grove Thumb Joystick (http://www.seeedstudio.com/wiki/Grove_-_Thumb_Joystick)
#
# The GrovePi connects the Raspberry Pi and Grove sensors. You can learn more about GrovePi here: http://www.dexterindustries.com/GrovePi
#
# Have a question about this example... |
Lyleo/nupic | refs/heads/master | tests/swarming/nupic/swarming/experiments/dummy_multi_v2/permutations.py | 8 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, 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... |
ionelmc/python-mongoql-conv | refs/heads/master | tests/test_mongoql_conv.py | 1 | import sys
import doctest
if __name__ == '__main__':
from django.core.management import execute_from_command_line
execute_from_command_line([sys.argv[0], 'syncdb', '--noinput'])
results = doctest.testfile('../README.rst', optionflags=doctest.ELLIPSIS|doctest.IGNORE_EXCEPTION_DETAIL)
print(results)
... |
gromez/Sick-Beard | refs/heads/development | sickbeard/clients/requests/packages/urllib3/__init__.py | 309 | # urllib3/__init__.py
# Copyright 2008-2012 Andrey Petrov and contributors (see CONTRIBUTORS.txt)
#
# This module is part of urllib3 and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""
urllib3 - Thread-safe connection pooling and re-using.
"""
__author__ = 'Andrey Petrov (a... |
huguesv/PTVS | refs/heads/master | Python/Templates/Web/ProjectTemplates/Python/Web/StarterBottleProject/app.py | 8 | """
This script runs the application using a development server.
"""
import bottle
import os
import sys
# routes contains the HTTP handlers for our server and must be imported.
import routes
if '--debug' in sys.argv[1:] or 'SERVER_DEBUG' in os.environ:
# Debug mode will enable more verbose output in the console ... |
prarthitm/edxplatform | refs/heads/master | common/test/acceptance/pages/lms/course_page.py | 16 | """
Base class for pages in courseware.
"""
from bok_choy.page_object import PageObject
from common.test.acceptance.pages.lms import BASE_URL
from common.test.acceptance.pages.lms.tab_nav import TabNavPage
class CoursePage(PageObject):
"""
Abstract base class for page objects within a course.
"""
# ... |
xwolf12/django | refs/heads/master | django/apps/__init__.py | 597 | from .config import AppConfig
from .registry import apps
__all__ = ['AppConfig', 'apps']
|
vks/servo | refs/heads/master | tests/wpt/css-tests/tools/html5lib/html5lib/trie/py.py | 817 | from __future__ import absolute_import, division, unicode_literals
from six import text_type
from bisect import bisect_left
from ._base import Trie as ABCTrie
class Trie(ABCTrie):
def __init__(self, data):
if not all(isinstance(x, text_type) for x in data.keys()):
raise TypeError("All keys m... |
dims/cinder | refs/heads/master | cinder/tests/unit/scheduler/test_rpcapi.py | 1 |
# Copyright 2012, Red Hat, 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 or ag... |
noselhq/skia | refs/heads/master | bench/tile_analyze.py | 198 | #!/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.
""" Analyze per-tile and viewport bench data, and output visualized results.
"""
__author__ = 'bensong@google.com (Ben Chen)'
imp... |
diorcety/intellij-community | refs/heads/master | python/lib/Lib/site-packages/django/contrib/localflavor/jp/forms.py | 333 | """
JP-specific Form helpers
"""
from django.forms import ValidationError
from django.utils.translation import ugettext_lazy as _
from django.forms.fields import RegexField, Select
class JPPostalCodeField(RegexField):
"""
A form field that validates its input is a Japanese postcode.
Accepts 7 digits, wit... |
ArthurGarnier/SickRage | refs/heads/master | lib/pgi/foreign/cairo.py | 19 | # Copyright 2016 Christoph Reiter
#
# This library 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 2.1 of the License, or (at your option) any later version.
import cffi
import cairocf... |
chimney37/ml-snippets | refs/heads/master | neural_network_test.py | 1 | #! /usr/bin/env python
# -*- coding:utf-8
# Testing a deep neural network (multi layered perceptron model) with tensorflow.
# Special thanks: Harisson@pythonprogramming.net
'''
File name: neural_network_test.py
Author: chimney37
Date created: 11/03/2017
Python Version: 3.62
'''
import tensorflow as tf
... |
andreparames/odoo | refs/heads/8.0 | openerp/tools/safe_eval.py | 250 | # -*- coding: utf-8 -*-
##############################################################################
# Copyright (C) 2004-2014 OpenERP s.a. (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# ... |
Slysliver/AutoRPG | refs/heads/master | combatCommands.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# combatCommands.py
#
# Copyright 2016 Slysliver <slysliver@Bucket-Lite>
#
# 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... |
clarkperkins/readthedocs.org | refs/heads/master | readthedocs/core/management/commands/reindex_elasticsearch.py | 26 | import logging
from optparse import make_option
from django.core.management.base import BaseCommand
from django.conf import settings
from readthedocs.builds.constants import LATEST
from readthedocs.builds.models import Version
from readthedocs.search import parse_json
from readthedocs.restapi.utils import index_searc... |
ilexius/odoo | refs/heads/master | addons/website_quote/models/order.py | 3 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from openerp import api
from openerp.osv import osv, fields
import uuid
import time
import datetime
import openerp.addons.decimal_precision as dp
from openerp import SUPERUSER_ID
from openerp.tools.translate import _
... |
LarsMichelsen/pmatic | refs/heads/master | ccu_pkg/python/lib/python2.7/encodings/mbcs.py | 860 | """ Python 'mbcs' Codec for Windows
Cloned by Mark Hammond (mhammond@skippinet.com.au) from ascii.py,
which was written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
"""
# Import them explicitly to cause an ImportError
# on non-Windows systems
from codecs import mbcs... |
whtsky/Catsup | refs/heads/master | catsup/generator/renderer.py | 1 | import os
from jinja2 import Environment, FileSystemLoader, TemplateNotFound
from catsup.options import g
from catsup.utils import mkdir, static_url, url_for, urljoin
class Renderer(object):
def __init__(self, templates_path, generator):
self.env = Environment(
loader=FileSystemLoader(templat... |
funkyfuture/cerberus | refs/heads/master | cerberus/tests/test_rule_items.py | 2 | from cerberus import errors
from cerberus.tests import assert_fail
def test_items(validator):
field = 'a_list_of_values'
value = ['a string', 'not an integer']
assert_fail(
document={field: value},
validator=validator,
error=(
field,
(field, 'items'),
... |
philanthropy-u/edx-platform | refs/heads/master | cms/djangoapps/maintenance/tests.py | 4 | """
Tests for the maintenance app views.
"""
import json
import ddt
from django.conf import settings
from django.urls import reverse
from contentstore.management.commands.utils import get_course_versions
from student.tests.factories import AdminFactory, UserFactory
from xmodule.modulestore import ModuleStoreEnum
from... |
mancoast/CPythonPyc_test | refs/heads/master | cpython/273_test_pprint.py | 72 | import pprint
import test.test_support
import unittest
import test.test_set
try:
uni = unicode
except NameError:
def uni(x):
return x
# list, tuple and dict subclasses that do or don't overwrite __repr__
class list2(list):
pass
class list3(list):
def __repr__(self):
return list.__repr... |
sazlin/data-structures | refs/heads/master | quick_sort.py | 1 | def quick_sort(values):
"""simple quick sort implementation"""
if len(values) == 0:
return []
elif len(values) == 1:
return values
elif len(values) == 2:
if values[0] > values[1]:
return values[::-1]
else:
return values
pivot = values[0]
le... |
fritsvanveen/QGIS | refs/heads/master | python/ext-libs/future/xmlrpc/__init__.py | 109 | from __future__ import absolute_import
import sys
if sys.version_info[0] < 3:
pass
else:
raise ImportError('This package should not be accessible on Python 3. '
'Either you are trying to run from the python-future src folder '
'or your installation of python-future i... |
ojengwa/oh-mainline | refs/heads/master | vendor/packages/celery/examples/eventlet/bulk_task_producer.py | 19 | from __future__ import with_statement
from eventlet import spawn_n, monkey_patch, Timeout
from eventlet.queue import LightQueue
from eventlet.event import Event
from celery import current_app
monkey_patch()
class Receipt(object):
result = None
def __init__(self, callback=None):
self.callback = Non... |
alexryndin/ambari | refs/heads/branch-adh-1.5 | ambari-common/src/main/python/resource_management/libraries/functions/simulate_perf_cluster_alert_behaviour.py | 5 | #!/usr/bin/env python
"""
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License")... |
amenonsen/ansible | refs/heads/devel | lib/ansible/plugins/doc_fragments/nso.py | 38 | # -*- coding: utf-8 -*-
# Copyright: (c) 2017, Cisco and/or its affiliates.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
class ModuleDocFragment(object):
DOCUMENTATION = r'''
options:
url:
description: NSO JSON-RPC URL, http://localhost:8080/jsonrpc
type... |
jshufelt/volatility | refs/heads/master | volatility/plugins/overlays/windows/win7_sp1_x64_vtypes.py | 58 | ntkrnlmp_types = {
'_ARBITER_INTERFACE' : [ 0x30, {
'Size' : [ 0x0, ['unsigned short']],
'Version' : [ 0x2, ['unsigned short']],
'Context' : [ 0x8, ['pointer64', ['void']]],
'InterfaceReference' : [ 0x10, ['pointer64', ['void']]],
'InterfaceDereference' : [ 0x18, ['pointer64', ['void']]],
'Arb... |
pombredanne/django-narcissus | refs/heads/master | setup.py | 1 | from distutils.core import setup
VERSION = __import__('narcissus').__version__
try:
long_description = open('README.rst', 'rt').read()
except IOError:
long_description = ''
description = "A blogging app that helps you easily share status updates, "
description += "links, photos, videos, and long-form article... |
tensorflow/models | refs/heads/master | official/nlp/xlnet/preprocess_classification_data.py | 1 | # Copyright 2021 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... |
ojengwa/sympy | refs/heads/master | sympy/printing/jscode.py | 7 | """
Javascript code printer
The JavascriptCodePrinter converts single sympy expressions into single
Javascript expressions, using the functions defined in the Javascript
Math object where possible.
"""
from __future__ import print_function, division
from sympy.core import S, C
from sympy.printing.codeprinter import... |
hjanime/VisTrails | refs/heads/master | vistrails/db/versions/v1_0_2/domain/log.py | 4 | ###############################################################################
##
## Copyright (C) 2014-2015, New York University.
## 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.
##
## ... |
mathspace/libcloud | refs/heads/trunk | docs/examples/dns/auroradns/enable_disable_record.py | 31 | from libcloud.dns.types import Provider
from libcloud.dns.types import RecordType
from libcloud.dns.providers import get_driver
cls = get_driver(Provider.AURORADNS)
driver = cls('myapikey', 'mysecret')
zone = driver.get_zone('auroradns.eu')
record = zone.create_record(name='www', type=RecordType.AAAA,
... |
ScreamingUdder/mantid | refs/heads/master | Testing/SystemTests/tests/analysis/SphinxWarnings.py | 3 | #pylint: disable=invalid-name
"""
Some of the sphinx warnings come from the C++ code, from the properties of the algorithms or from the summary string
This test tries to detect the most common such errors.
It also detects if a new category is created (i.e. someone uses Utilities instead of Utility)
"""
from __future__ ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.