repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
pepetreshere/odoo | refs/heads/patch-2 | addons/membership/__init__.py | 114 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import models
from . import wizard
from . import report
|
kerr-huang/SL4A | refs/heads/master | python-build/python-libs/gdata/samples/oauth/oauth_on_appengine/appengine_utilities/sessions.py | 128 | # -*- coding: utf-8 -*-
"""
Copyright (c) 2008, appengine-utilities project
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
... |
M4rtinK/tsubame | refs/heads/master | core/bundle/future/moves/tkinter/scrolledtext.py | 118 | from __future__ import absolute_import
from future.utils import PY3
if PY3:
from tkinter.scrolledtext import *
else:
try:
from ScrolledText import *
except ImportError:
raise ImportError('The ScrolledText module is missing. Does your Py2 '
'installation include tk... |
bohlian/frappe | refs/heads/develop | frappe/data_migration/doctype/data_migration_mapping/data_migration_mapping.py | 3 | # -*- coding: utf-8 -*-
# Copyright (c) 2017, Frappe Technologies and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class DataMigrationMapping(Document):
def get_filters(self):
if self.condition:
re... |
bigswitch/snac-nox-zaku | refs/heads/zaku | src/nox/lib/packet/t/icmp_parse_test.py | 10 | # Copyright 2008 (C) Nicira, Inc.
#
# This file is part of NOX.
#
# NOX 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.
#
# NOX is d... |
mitya57/django | refs/heads/master | tests/sitemaps_tests/test_http.py | 22 | import os
from datetime import date
from unittest import skipUnless
from django.apps import apps
from django.conf import settings
from django.contrib.sitemaps import Sitemap
from django.contrib.sites.models import Site
from django.core.exceptions import ImproperlyConfigured
from django.test import modify_settings, ove... |
ramusus/django-facebook-pages | refs/heads/master | facebook_pages/migrations/0003_auto__add_field_page_posts_count.py | 2 | # -*- 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 'Page.posts_count'
db.add_column('facebook_pages_page', 'posts_count',
... |
azverkan/scons | refs/heads/master | test/Deprecated/SourceSignatures/overrides.py | 5 | #!/usr/bin/env python
#
# __COPYRIGHT__
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
... |
apache/incubator-allura | refs/heads/master | ForgeSVN/forgesvn/tests/__init__.py | 3 | # -*- coding: utf-8 -*-
# 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 Apach... |
mirjalil/IMDB-reviews | refs/heads/master | code/classify_NB.exhaustive_GSCV.py | 1 |
from matplotlib import pyplot as plt
import pandas as pd
import numpy as np
import scipy
import sklearn
import sys
### Get the parameters from the command-line arguments
assert(len(sys.argv)==7)
param_dict = {
'max_df': float(sys.argv[1]),
'sublinear_tf': bool(sys.argv[2]),
'max_features': int(sys.ar... |
maxentile/msm-learn | refs/heads/master | projects/metric-learning/KPCA Inverse Transform.py | 1 |
# coding: utf-8
# In[1]:
from sklearn.decomposition import KernelPCA
# In[2]:
import matplotlib.pyplot as plt
# In[3]:
get_ipython().magic(u'matplotlib inline')
# In[4]:
from sklearn.datasets import load_digits
X,Y = load_digits().data,load_digits().target
# In[7]:
kpca = KernelPCA(gamma=0.1,kernel='rbf'... |
lllucius/climacast | refs/heads/master | requests/packages/chardet/hebrewprober.py | 2928 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Shy Shalom
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved.
#... |
sharbison3/python-docs-samples | refs/heads/master | appengine/standard/ndb/modeling/relation_model_models_test.py | 8 | # Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... |
haveal/googleads-python-lib | refs/heads/master | examples/dfp/v201505/creative_template_service/__init__.py | 618 | #!/usr/bin/python
#
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... |
lisa-lab/pylearn2 | refs/heads/master | pylearn2/datasets/tests/test_transformer_dataset.py | 44 | """
Unit tests for ../transformer_dataset.py
"""
import os
import pylearn2
from pylearn2.blocks import Block
from pylearn2.datasets.csv_dataset import CSVDataset
from pylearn2.datasets.transformer_dataset import TransformerDataset
def test_transformer_iterator():
"""
Tests whether TransformerIterator is ite... |
dc3-plaso/plaso | refs/heads/master | plaso/cli/helpers/windows_services_analysis.py | 1 | # -*- coding: utf-8 -*-
"""The Windows Services analysis plugin CLI arguments helper."""
from plaso.lib import errors
from plaso.cli.helpers import interface
from plaso.cli.helpers import manager
from plaso.analysis import windows_services
class WindowsServicesAnalysisArgumentsHelper(interface.ArgumentsHelper):
""... |
cloudant/bigcouch | refs/heads/master | couchjs/scons/scons-local-2.0.1/SCons/Environment.py | 61 | """SCons.Environment
Base class for construction Environments. These are
the primary objects used to communicate dependency and
construction information to the build engine.
Keyword arguments supplied when the construction Environment
is created are construction variables used to initialize the
Environment
"""
#
# ... |
bcorbet/SickRage | refs/heads/master | lib/imdb/parser/http/searchPersonParser.py | 76 | """
parser.http.searchPersonParser module (imdb package).
This module provides the HTMLSearchPersonParser class (and the
search_person_parser instance), used to parse the results of a search
for a given person.
E.g., when searching for the name "Mel Gibson", the parsed page would be:
http://akas.imdb.com/find?q=Me... |
intermezzo-fr/pipreqs | refs/heads/master | tests/__init__.py | 14224 | # -*- coding: utf-8 -*-
|
ThinkingBridge/platform_external_chromium_org | refs/heads/kitkat | third_party/protobuf/python/google/protobuf/internal/wire_format.py | 561 | # 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... |
chrisndodge/edx-platform | refs/heads/master | pavelib/utils/test/utils.py | 16 | """
Helper functions for test tasks
"""
from paver.easy import sh, task, cmdopts
from pavelib.utils.envs import Env
from pavelib.utils.timer import timed
import os
import re
import subprocess
MONGO_PORT_NUM = int(os.environ.get('EDXAPP_TEST_MONGO_PORT', '27017'))
MONGO_HOST = os.environ.get('EDXAPP_TEST_MONGO_HOST', '... |
juanyaw/python | refs/heads/develop | cpython/Lib/encodings/cp875.py | 272 | """ Python Character Mapping Codec cp875 generated from 'MAPPINGS/VENDORS/MICSFT/EBCDIC/CP875.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,input... |
Genymobile/genymotion-kernel | refs/heads/genymotion-goldfish-3.10 | tools/perf/scripts/python/netdev-times.py | 11271 | # Display a process of packets and processed time.
# It helps us to investigate networking or network device.
#
# options
# tx: show only tx chart
# rx: show only rx chart
# dev=: show only thing related to specified device
# debug: work with debug mode. It shows buffer status.
import os
import sys
sys.path.append(os... |
kingvuplus/bh-s | refs/heads/master | lib/python/Screens/Scart.py | 126 | from Screen import Screen
from MessageBox import MessageBox
from Components.AVSwitch import AVSwitch
from Tools import Notifications
class Scart(Screen):
def __init__(self, session, start_visible=True):
Screen.__init__(self, session)
self.msgBox = None
self.notificationVisible = None
self.avswitch = AVSwitch... |
chiamingyen/pygroup_sqlite | refs/heads/master | wsgi/static/Brython2.1.4-20140810-083054/Lib/unittest/test/dummy.py | 1061 | # Empty module for testing the loading of modules
|
maliciamrg/xbmc-addon-tvtumbler | refs/heads/master | tvtumbler/housekeeper.py | 2 | '''
This file is part of TvTumbler.
@author: Dermot Buckley
@copyright: Copyright (c) 2013, Dermot Buckley
@license: GPL
@contact: info@tvtumbler.com
'''
import time
import xbmc
from . import logger, fastcache, blacklist, epdb, showsettings
from .names import scene
_fastcache_expire_last_run = time.time()
_blacklis... |
TEAM-Gummy/platform_external_chromium_org | refs/heads/kk4.4 | tools/telemetry/telemetry/exception_formatter.py | 25 | # 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.
"""Print prettier and more detailed exceptions."""
import math
import os
import sys
import traceback
from telemetry.core import util
def InstallUnhandled... |
strk/QGIS | refs/heads/master | python/plugins/processing/algs/grass7/ext/r_li_patchnum.py | 45 | # -*- coding: utf-8 -*-
"""
***************************************************************************
r_li_patchnum.py
----------------
Date : February 2016
Copyright : (C) 2016 by Médéric Ribreux
Email : medspx at medspx dot fr
**************************... |
agentxan/nzbToMedia | refs/heads/master | libs/requests/packages/urllib3/contrib/ntlmpool.py | 1009 | """
NTLM authenticating pool, contributed by erikcederstran
Issue #10, see: http://code.google.com/p/urllib3/issues/detail?id=10
"""
try:
from http.client import HTTPSConnection
except ImportError:
from httplib import HTTPSConnection
from logging import getLogger
from ntlm import ntlm
from urllib3 import HTT... |
codingisacopingstrategy/unicornify | refs/heads/master | background.py | 2 | # Copyright 2010 Benjamin Dumke
#
# This file is part of Unicornify
#
# Unicornify 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
# (at your option) any later vers... |
CubicERP/geraldo | refs/heads/master | site/newsite/site-geraldo/django/utils/html.py | 26 | """HTML utilities suitable for global use."""
import re
import string
from django.utils.safestring import SafeData, mark_safe
from django.utils.encoding import force_unicode
from django.utils.functional import allow_lazy
from django.utils.http import urlquote
# Configuration for urlize() function.
LEADING_PUNCTUATIO... |
arthurchan1111/EventPlanner | refs/heads/master | node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.py | 1407 | # 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.
"""
This module helps emulate Visual Studio 2008 behavior on top of other
build systems, primarily ninja.
"""
import os
import re
import subprocess
import sys
fr... |
jymannob/CouchPotatoServer | refs/heads/develop | couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/engadget.py | 18 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from .fivemin import FiveMinIE
from ..utils import (
url_basename,
)
class EngadgetIE(InfoExtractor):
_VALID_URL = r'''(?x)https?://www.engadget.com/
(?:video/5min/(?P<id>\d+)|
[\d/]+/.*?)
'''
... |
adoosii/edx-platform | refs/heads/master | cms/djangoapps/contentstore/views/tests/test_checklists.py | 104 | """ Unit tests for checklist methods in views.py. """
from contentstore.utils import reverse_course_url
from contentstore.views.checklist import expand_checklist_action_url
from xmodule.modulestore.tests.factories import CourseFactory
from xmodule.modulestore.django import modulestore
import json
from contentstore.tes... |
oe-alliance/oe-alliance-enigma2 | refs/heads/master | lib/python/Components/Renderer/PiconBg.py | 62 | from Renderer import Renderer
from enigma import ePixmap
from Components.config import config
from Tools.Directories import SCOPE_ACTIVE_SKIN, resolveFilename
class PiconBg(Renderer):
def __init__(self):
Renderer.__init__(self)
self.pngname = ""
GUI_WIDGET = ePixmap
def postWidgetCreate(self, instance):
sel... |
AMObox/teammaniac | refs/heads/master | plugin.video.p2psport/default.py | 6 | # -*- coding: utf-8 -*-
import re
import urllib2
import HTMLParser
import urllib,urlparse
import xbmcgui
import xbmcplugin
import xbmcaddon
import requests
from BeautifulSoup import BeautifulSoup as bs
from utils.webutils import *
from scrapers import *
try:
from addon.common.addon import Addon
from addon.... |
aldian/tensorflow | refs/heads/master | tensorflow/python/feature_column/feature_column.py | 9 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
aerickson/ansible | refs/heads/devel | lib/ansible/plugins/action/assemble.py | 4 | # (c) 2013-2016, Michael DeHaan <michael.dehaan@gmail.com>
# Stephen Fromm <sfromm@gmail.com>
# Brian Coca <briancoca+dev@gmail.com>
# Toshio Kuratomi <tkuratomi@ansible.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under t... |
leeseuljeong/leeseulstack_neutron | refs/heads/master | neutron/extensions/lbaas_agentscheduler.py | 24 | # Copyright (c) 2013 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... |
LLNL/spack | refs/heads/develop | var/spack/repos/builtin/packages/py-pydatalog/package.py | 5 | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class PyPydatalog(PythonPackage):
"""pyDatalog adds logic programming to Python."""
homepage... |
florentx/OpenUpgrade | refs/heads/8.0 | addons/base_gengo/__init__.py | 377 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Openerp sa (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of th... |
reddraggone9/youtube-dl | refs/heads/master | youtube_dl/extractor/cmt.py | 31 | from __future__ import unicode_literals
from .mtv import MTVIE
class CMTIE(MTVIE):
IE_NAME = 'cmt.com'
_VALID_URL = r'https?://www\.cmt\.com/(?:videos|shows)/(?:[^/]+/)*(?P<videoid>\d+)'
_FEED_URL = 'http://www.cmt.com/sitewide/apps/player/embed/rss/'
_TESTS = [{
'url': 'http://www.cmt.com/vi... |
xiaocong/github-timeline | refs/heads/master | ghdata/worker.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from celery import Celery
from celery.utils.log import get_task_logger
from . import celeryconfig
logger = get_task_logger(__name__)
worker = Celery('ghdata.worker')
# Optional configuration, see the application user guide.
worker... |
laonawuli/addrest | refs/heads/master | web2py/handlers/wsgihandler.py | 25 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This file is part of the web2py Web Framework
Copyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu>
License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html)
This is a WSGI handler for Apache
Requires apache+mod_wsgi.
In httpd.conf put something like:
LoadMo... |
Sidney84/pa-chromium | refs/heads/master | chrome/common/extensions/docs/server2/api_data_source.py | 3 | # Copyright (c) 2012 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.
import copy
import logging
import os
from collections import defaultdict, Mapping
import third_party.json_schema_compiler.json_parse as json_parse
impor... |
dudepare/django | refs/heads/master | django/core/management/commands/dumpdata.py | 305 | from collections import OrderedDict
from django.apps import apps
from django.core import serializers
from django.core.management.base import BaseCommand, CommandError
from django.db import DEFAULT_DB_ALIAS, router
class Command(BaseCommand):
help = ("Output the contents of the database as a fixture of the given ... |
kosz85/django | refs/heads/master | tests/timezones/admin.py | 146 | from django.contrib import admin
from .models import Event, Timestamp
class EventAdmin(admin.ModelAdmin):
list_display = ('dt',)
class TimestampAdmin(admin.ModelAdmin):
readonly_fields = ('created', 'updated')
site = admin.AdminSite(name='admin_tz')
site.register(Event, EventAdmin)
site.register(Timestam... |
pvdheijden/OpenCaster | refs/heads/master | libs/dvbobjects/dvbobjects/DSMCC/__init__.py | 15 | #! /usr/bin/env python
# This file is part of the dvbobjects library.
#
# Copyright 2000-2001, GMD, Sankt Augustin
# -- German National Research Center for Information Technology
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publis... |
ibuildthecloud/dstack | refs/heads/master | code/agent/src/agents/pyagent/dstack/plugins/core/event_router.py | 1 | from dstack.type_manager import get_type_list
from dstack.type_manager import PRE_REQUEST_HANDLER, STORAGE_DRIVER
from dstack.type_manager import COMPUTE_DRIVER, POST_REQUEST_HANDLER
class Router:
def __init__(self):
pass
def route(self, req):
for handler in _handlers(req):
resp =... |
sagarduwal/programming | refs/heads/master | hash_tables/min-hashing/main.py | 2 | def shingles_from_document(k, doc):
word = ""
temp = ""
shingles = set()
word = doc.read(k)
if not word:
return
while True:
ch=doc.read(1)
if not ch: break
temp = word[1:] + ch
word = temp
shingles.add(word)
return shingles
if __name__ == "__main__":
f = open("file.txt", "r+")
print(shingles_from_... |
kumar303/zamboni | refs/heads/master | mkt/webpay/models.py | 19 | import os
from django.conf import settings
from django.db import models
from lib.utils import static_url
from mkt.site.helpers import absolutify
from mkt.site.models import ModelBase
class ProductIcon(ModelBase):
ext_url = models.CharField(max_length=255, db_index=True, unique=True)
# Height/width of square... |
ghchinoy/tensorflow | refs/heads/master | tensorflow/python/tpu/async_checkpoint.py | 12 | # Copyright 2018 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... |
oavasquez/ingeneria_software | refs/heads/master | web-project/bower_components/bootstrap-datepicker/docs/conf.py | 171 | # -*- coding: utf-8 -*-
#
# bootstrap-datepicker documentation build configuration file, created by
# sphinx-quickstart on Fri Aug 2 14:45:57 2013.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated ... |
dapeng0802/django-blog-zinnia | refs/heads/develop | zinnia/urls/capabilities.py | 8 | """Urls for the zinnia capabilities"""
from django.conf.urls import url
from zinnia.views.capabilities import RsdXml
from zinnia.views.capabilities import HumansTxt
from zinnia.views.capabilities import OpenSearchXml
from zinnia.views.capabilities import WLWManifestXml
urlpatterns = [
url(r'^rsd.xml$', RsdXml.as... |
tymofij/adofex | refs/heads/master | transifex/resources/urls/ajax.py | 1 | # -*- coding: utf-8 -*-
from django.conf.urls.defaults import *
from transifex.resources.urls import RESOURCE_URL_PARTIAL, RESOURCE_LANG_URL_PARTIAL
from transifex.resources.views import resource_actions, update_translation, \
lock_and_get_translation_file, resource_pseudo_translation_actions
urlpatterns = pattern... |
mikalstill/nova | refs/heads/master | nova/tests/unit/virt/test_configdrive.py | 24 | # Copyright 2014 IBM Corp.
#
# 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 agree... |
zak-k/cartopy | refs/heads/master | lib/cartopy/tests/crs/test_rotated_geodetic.py | 3 | # (C) British Crown Copyright 2014 - 2016, Met Office
#
# This file is part of cartopy.
#
# cartopy is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the
# Free Software Foundation, either version 3 of the License, or
# (at your option)... |
40223139/LEGOg7-39 | refs/heads/master | static/Brython3.1.3-20150514-095342/Lib/_sre.py | 622 | # NOT_RPYTHON
"""
A pure Python reimplementation of the _sre module from CPython 2.4
Copyright 2005 Nik Haldimann, licensed under the MIT license
This code is based on material licensed under CNRI's Python 1.6 license and
copyrighted by: Copyright (c) 1997-2001 by Secret Labs AB
"""
MAXREPEAT = 2147483648
#import ar... |
WangDequan/pyvision | refs/heads/master | experiments/occlusionreport.py | 4 | import pickle
from pylab import *
loaded = pickle.load(open("occlusion.pkl"))
labeledframes = [0]
ranges = {
"Visible": ([(270, 330), (469, 500)], "black"),
"Partial Occlusion": ([(330, 375), (455, 469)], "green"),
"Severe Occlusion": ([(390, 420)], "blue"),
"Total Occlusion": ([(375, 390), (420, 455... |
h2oai/h2o-dev | refs/heads/master | h2o-py/tests/testdir_algos/deeplearning/pyunit_weights_and_distributions_deeplearning.py | 6 | from builtins import range
import sys, os
sys.path.insert(1, os.path.join("..","..",".."))
import h2o
from tests import pyunit_utils
from h2o.estimators.deeplearning import H2ODeepLearningEstimator
def weights_and_distributions():
htable = h2o.upload_file(pyunit_utils.locate("smalldata/gbm_test/moppe.csv"))
htab... |
arlowhite/kivy | refs/heads/master | kivy/uix/settings.py | 6 | '''
Settings
========
.. versionadded:: 1.0.7
This module provides a complete and extensible framework for adding a
Settings interface to your application. By default, the interface uses
a :class:`SettingsWithSpinner`, which consists of a
:class:`~kivy.uix.spinner.Spinner` (top) to switch between individual
settings ... |
barryrobison/arsenalsuite | refs/heads/master | cpp/lib/PyQt4/examples/widgets/tetrix.py | 17 | #!/usr/bin/env python
#############################################################################
##
## Copyright (C) 2010 Riverbank Computing Limited.
## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
## All rights reserved.
##
## This file is part of the examples of PyQt.
##
## $QT_BEGIN_LICENS... |
minhtuancn/odoo | refs/heads/8.0 | addons/payment_ogone/tests/test_ogone.py | 430 | # -*- coding: utf-8 -*-
from lxml import objectify
import time
import urlparse
from openerp.addons.payment.models.payment_acquirer import ValidationError
from openerp.addons.payment.tests.common import PaymentAcquirerCommon
from openerp.addons.payment_ogone.controllers.main import OgoneController
from openerp.tools i... |
LukeHoersten/ansible | refs/heads/devel | lib/ansible/plugins/shell/__init__.py | 7690 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... |
notriddle/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/third_party/pytest/testing/logging/test_fixture.py | 30 | # -*- coding: utf-8 -*-
import logging
import pytest
logger = logging.getLogger(__name__)
sublogger = logging.getLogger(__name__ + ".baz")
def test_fixture_help(testdir):
result = testdir.runpytest("--fixtures")
result.stdout.fnmatch_lines(["*caplog*"])
def test_change_level(caplog):
caplog.set_level(... |
arthurdejong/python-stdnum | refs/heads/master | stdnum/br/cnpj.py | 1 | # cnpj.py - functions for handling CNPJ numbers
# coding: utf-8
#
# Copyright (C) 2015 Arthur de Jong
#
# 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... |
mezz64/home-assistant | refs/heads/dev | tests/components/bond/test_init.py | 7 | """Tests for the Bond module."""
from aiohttp import ClientConnectionError
from homeassistant.components.bond.const import DOMAIN
from homeassistant.config_entries import (
ENTRY_STATE_LOADED,
ENTRY_STATE_NOT_LOADED,
ENTRY_STATE_SETUP_RETRY,
)
from homeassistant.const import CONF_ACCESS_TOKEN, CONF_HOST
fr... |
finfish/scrapy | refs/heads/master | extras/qps-bench-server.py | 178 | #!/usr/bin/env python
from __future__ import print_function
from time import time
from collections import deque
from twisted.web.server import Site, NOT_DONE_YET
from twisted.web.resource import Resource
from twisted.internet import reactor
class Root(Resource):
def __init__(self):
Resource.__init__(self... |
Grirrane/odoo | refs/heads/master | openerp/addons/base/module/wizard/base_module_upgrade.py | 7 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (C) 2004-2012 OpenERP SA (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... |
GunoH/intellij-community | refs/heads/master | python/testData/intentions/PyAnnotateVariableTypeIntentionTest/typeCommentLocalForTargetWithExistingComment_after.py | 19 | def func():
for var in 'foo': # type: [str] # comment
var |
anbangr/trusted-nova | refs/heads/master | nova/rpc/__init__.py | 5 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
# Copyright 2011 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not... |
antonve/s4-project-mooc | refs/heads/master | common/test/acceptance/pages/common/logout.py | 162 | """
Logout Page.
"""
from bok_choy.page_object import PageObject
from . import BASE_URL
class LogoutPage(PageObject):
"""
Logout page to logout current logged in user.
"""
url = BASE_URL + "/logout"
def is_browser_on_page(self):
return self.q(css='.cta-login').present
|
ghtmtt/QGIS | refs/heads/master | tests/src/python/test_qgssvgcache.py | 31 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsSvgCache.
.. note:: 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 2 of the License, or
(at your option) any later version.
"""
__aut... |
rtucker-mozilla/inventory | refs/heads/master | mozdns/srv/models.py | 2 | from django.db import models
from mozdns.domain.models import Domain
from mozdns.models import MozdnsRecord
from mozdns.validation import validate_srv_label, validate_srv_port
from mozdns.validation import validate_srv_priority, validate_srv_weight
from mozdns.validation import validate_srv_name
from mozdns.validatio... |
devoid/nova | refs/heads/sheepdog-nova-support | nova/tests/integrated/v3/test_pci.py | 2 | # Copyright 2013 Intel.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... |
victorbriz/rethinkdb | refs/heads/next | external/v8_3.30.33.16/build/gyp/test/mac/gyptest-postbuild-copy-bundle.py | 172 | #!/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.
"""
Verifies that a postbuild copying a dependend framework into an app bundle is
rerun if the resources in the framework change.
"""
impor... |
giruenf/GRIPy | refs/heads/master | algo/KusterToksoz.py | 1 | # -*- coding: utf-8 -*-
"""
Created on Fri Jul 19 14:25:07 2013
@author: fsantos2
"""
import numpy as np
__all__ = ['T', 'F', 'Kd', 'Gd']
def T(K, G, a): # Tiijj/3
R = 1.0 / (K / G + 4.0 / 3.0)
C0 = 1.0 - a * a
t = a * np.arccos(a) / C0 / np.sqrt(C0) - a * a / (C0)
f = a * a * (3.0 * t - 2.0) / C0... |
rmfitzpatrick/pytest | refs/heads/master | _pytest/debugging.py | 15 | """ interactive debugging with PDB, the Python Debugger. """
from __future__ import absolute_import, division, print_function
import pdb
import sys
def pytest_addoption(parser):
group = parser.getgroup("general")
group._addoption(
'--pdb', dest="usepdb", action="store_true",
help="start the in... |
gperdomor/dendrite | refs/heads/master | vendor/src/github.com/apache/thrift/lib/py/src/transport/__init__.py | 348 | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
flashycud/timestack | refs/heads/master | django/contrib/comments/signals.py | 425 | """
Signals relating to comments.
"""
from django.dispatch import Signal
# Sent just before a comment will be posted (after it's been approved and
# moderated; this can be used to modify the comment (in place) with posting
# details or other such actions. If any receiver returns False the comment will be
# discarded a... |
adedayo/intellij-community | refs/heads/master | python/lib/Lib/modjy/modjy_impl.py | 109 | ###
#
# Copyright Alan Kennedy.
#
# You may contact the copyright holder at this uri:
#
# http://www.xhaus.com/contact/modjy
#
# The licence under which this code is released is the Apache License v2.0.
#
# The terms and conditions of this license are listed in a file contained
# in the distribution that also cont... |
pbhide/net-next-rocker | refs/heads/master | tools/perf/scripts/python/export-to-postgresql.py | 617 | # export-to-postgresql.py: export perf data to a postgresql database
# Copyright (c) 2014, Intel Corporation.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms and conditions of the GNU General Public License,
# version 2, as published by the Free Software Foundation.
#
# Thi... |
mominaripublic/jubileealbum | refs/heads/master | node_modules/node-gyp/gyp/pylib/gyp/MSVSUserFile.py | 2710 | # 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.
"""Visual Studio user preferences file writer."""
import os
import re
import socket # for gethostname
import gyp.common
import gyp.easy_xml as easy_xml
#------... |
slank/ansible | refs/heads/devel | test/units/playbook/test_conditional.py | 78 |
from ansible.compat.tests import unittest
from units.mock.loader import DictDataLoader
from ansible.plugins.strategy import SharedPluginLoaderObj
from ansible.template import Templar
from ansible import errors
from ansible.playbook import conditional
class TestConditional(unittest.TestCase):
def setUp(self):
... |
chouseknecht/openshift-restclient-python | refs/heads/master | openshift/ansiblegen/cli.py | 1 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import print_function
import argparse
import logging
import sys
from logging import config
from .. import __version__
from ..helper.exceptions import KubernetesException
from .docstrings import KubernetesDocStrings, OpenShiftDocStrings
f... |
danielvdao/TheAnimalFarm | refs/heads/master | venv/lib/python2.7/site-packages/werkzeug/debug/__init__.py | 310 | # -*- coding: utf-8 -*-
"""
werkzeug.debug
~~~~~~~~~~~~~~
WSGI application traceback debugger.
:copyright: (c) 2013 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
import json
import mimetypes
from os.path import join, dirname, basename, isfile
... |
CottageLabs/finance | refs/heads/develop | migrations/versions/fa0f07475596_create_projects_table.py | 1 | """create projects table
Revision ID: fa0f07475596
Revises: 370e142881f5
Create Date: 2016-03-04 18:48:01.297273
"""
# revision identifiers, used by Alembic.
revision = 'fa0f07475596'
down_revision = '370e142881f5'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.create_table('projects',
s... |
inoshiro/symposion-demo | refs/heads/master | symposion_project/apps/symposion/email_lists/accepted_speakers.py | 5 | def email_list():
from symposion.schedule.models import Presentation
speakers = {}
for presentation in Presentation.objects.select_related("speaker__user"):
for speaker in presentation.speakers():
if speaker is not None and speaker.user is not None:
speakers[speaker.user.... |
damdam-s/bank-payment | refs/heads/8.0 | account_banking_payment_transfer/model/payment_mode.py | 11 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2009 EduSense BV (<http://www.edusense.nl>).
# (C) 2011 - 2013 Therp BV (<http://therp.nl>).
# (C) 2014 Akretion (www.akretion.com)
#
# All other contributions are (C)... |
paetzke/format-sql | refs/heads/master | tests/data/test_02/test_03_expected.py | 1 | def args():
X.objects.raw("""
SELECT
*
FROM
k; """)
|
chand3040/sree_odoo | refs/heads/master | openerp/addons/website_blog/__init__.py | 373 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... |
balloob/home-assistant | refs/heads/dev | tests/components/fritzbox/test_climate.py | 13 | """Tests for AVM Fritz!Box climate component."""
from datetime import timedelta
from requests.exceptions import HTTPError
from homeassistant.components.climate.const import (
ATTR_CURRENT_TEMPERATURE,
ATTR_HVAC_MODE,
ATTR_HVAC_MODES,
ATTR_MAX_TEMP,
ATTR_MIN_TEMP,
ATTR_PRESET_MODE,
ATTR_PRE... |
SophosBlitz/glacon | refs/heads/master | plugins/help.py | 25 | import re
from util import hook
@hook.command(autohelp=False)
def help(inp, bot=None, pm=None):
".help [command] -- gives a list of commands/help for a command"
funcs = {}
disabled = bot.config.get('disabled_plugins', [])
disabled_comm = bot.config.get('disabled_commands', [])
for command, (func... |
selivan/ansible-modules-core | refs/heads/devel | files/assemble.py | 79 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, Stephen Fromm <sfromm@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 Lice... |
robertour/commas | refs/heads/master | plugins/cms_plugins.py | 1 | from cms.plugin_base import CMSPluginBase
from cms.plugin_pool import plugin_pool
from django.utils.translation import ugettext_lazy as _
from cms.plugins.text.models import Text
from cms.plugins.text.cms_plugins import TextPlugin as TextPluginCMS
from cmsplugin_filer_file.cms_plugins import FilerFilePlugin
from django... |
alekz112/statsmodels | refs/heads/master | statsmodels/sandbox/distributions/tests/distparams.py | 38 |
distcont = [
['alpha', (3.5704770516650459,)],
['anglit', ()],
['arcsine', ()],
['beta', (2.3098496451481823, 0.62687954300963677)],
['betaprime', (5, 6)], # avoid unbound error in entropy with (100, 86)],
['bradford', (0.29891359763170633,)],
['burr', (10.5, 4.3)], #incorrect mean an... |
braintreeps/moto | refs/heads/master | moto/emr/urls.py | 14 | from __future__ import unicode_literals
from .responses import ElasticMapReduceResponse
url_bases = [
"https?://(.+).elasticmapreduce.amazonaws.com",
"https?://elasticmapreduce.(.+).amazonaws.com",
]
url_paths = {
'{0}/$': ElasticMapReduceResponse.dispatch,
}
|
DarioGT/OMS-PluginXML | refs/heads/master | org.modelsphere.sms/lib/jython-2.2.1/Lib/encodings/unicode_escape.py | 3 | """ Python 'unicode-escape' Codec
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
"""
import codecs
### Codec APIs
class Codec(codecs.Codec):
# Note: Binding these as C functions will result in the class not
# converting them to method... |
KitKatXperience/platform_external_chromium_org | refs/heads/kk | tools/telemetry/telemetry/core/extension_unittest.py | 23 | # Copyright (c) 2012 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.
import logging
import os
import shutil
import tempfile
import unittest
from telemetry.core import browser_finder
from telemetry.core import extension_to_... |
cliffe/SecGen | refs/heads/master | modules/utilities/unix/audit_tools/ghidra/files/release/Ghidra/Features/Python/data/jython-2.7.1/Lib/encodings/euc_jis_2004.py | 816 | #
# euc_jis_2004.py: Python Unicode Codec for EUC_JIS_2004
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#
import _codecs_jp, codecs
import _multibytecodec as mbc
codec = _codecs_jp.getcodec('euc_jis_2004')
class Codec(codecs.Codec):
encode = codec.encode
decode = codec.decode
class IncrementalEncoder(m... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.