repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
Titulacion-Sistemas/PythonTitulacion-EV | refs/heads/master | Lib/site-packages/simplejson/tests/test_decimal.py | 147 | import decimal
from decimal import Decimal
from unittest import TestCase
from simplejson.compat import StringIO, reload_module
import simplejson as json
class TestDecimal(TestCase):
NUMS = "1.0", "10.00", "1.1", "1234567890.1234567890", "500"
def dumps(self, obj, **kw):
sio = StringIO()
json.d... |
fresskarma/tinyos-1.x | refs/heads/master | contrib/nestfe/python/MetricsMonitor.py | 2 | # Monitoring tools for interacting with MetricsMote and TestDetectionEvent
# with the KrakenMetrics module
#
# USAGE:
# 1) setup your PYTHONPATH to include the directory containing
# this file
# -- Option I --
# 2a) Start PyTOS using PytosShell.py in the TestDetectionEvent or
# MetricsMote directory
# 2b) assign... |
bufferx/tornado | refs/heads/master | tornado/concurrent.py | 19 | #!/usr/bin/env python
#
# Copyright 2012 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... |
midnightercz/pulp_docker | refs/heads/master | plugins/pulp_docker/plugins/distributors/publish_steps.py | 1 | from gettext import gettext as _
import logging
import os
from mongoengine import Q
from pulp.plugins.util.publish_step import PluginStep, \
AtomicDirectoryPublishStep, SaveTarFilePublishStep
from pulp.plugins.util import misc as plugin_utils
from pulp.server.controllers import repository as repo_controller
from ... |
windedge/odoomrp-wip | refs/heads/8.0 | account_treasury_forecast_banking/models/__init__.py | 124 | # -*- 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... |
OSSHealth/ghdata | refs/heads/master | conftest.py | 1 | #SPDX-License-Identifier: MIT
import pytest
import re
from augur.application import Application
from augur.cli.backend import initialize_components
default_repo_id = "25430"
default_repo_group_id = "10"
def create_full_routes(routes):
full_routes = []
for route in routes:
route = re.sub("<default_rep... |
aerophile/django | refs/heads/master | tests/staticfiles_tests/tests.py | 19 | # -*- encoding: utf-8 -*-
from __future__ import unicode_literals
import codecs
import os
import posixpath
import shutil
import sys
import tempfile
import unittest
from django.conf import settings
from django.contrib.staticfiles import finders, storage
from django.contrib.staticfiles.management.commands import collec... |
goodwinnk/intellij-community | refs/heads/master | python/testData/resolve/FormatStringWithPackedDictAsArgument.py | 38 | v = "first is {<ref>fst}, second is {snd}".format(**{"fst": "f", "snd": "s"}) |
noikiy/mitmproxy | refs/heads/master | test/test_controller.py | 33 | import mock
from libmproxy import controller
class TestMaster:
def test_default_handler(self):
m = controller.Master(None)
msg = mock.MagicMock()
m.handle("type", msg)
assert msg.reply.call_count == 1
|
uclouvain/OSIS-Louvain | refs/heads/master | attribution/tests/models/test_attribution_charge_new.py | 1 | ##############################################################################
#
# OSIS stands for Open Student Information System. It's an application
# designed to manage the core business of higher education institutions,
# such as universities, faculties, institutes and professional schools.
# The core ... |
kylerbrown/arfview | refs/heads/master | _arfview/rasterPlot.py | 2 | import pyqtgraph as pg
import numpy as np
# class rasterTick(pg.GraphItem):
# def __init__(self, toe, trial_number):
# super(rasterTick,self).__init__()
# x = (toe, toe)
# y = (trial_number - .5, trial_number + .5)
# self.setData(x, y)
class rasterPlot(pg.PlotItem):
"""Plots a ... |
efiring/scipy | refs/heads/master | scipy/weave/examples/vtk_example.py | 100 | """ A simple example to show how to use weave with VTK. This lets one
create VTK objects using the standard VTK-Python API (via 'import
vtk') and then accelerate any of the computations by inlining C++ code
inside Python.
Please note the use of the `inc_dirs` and the `lib_dirs` variables in
the call to weave.inline. ... |
anhstudios/swganh | refs/heads/develop | data/scripts/templates/object/tangible/lair/structure/exterior/shared_lair_cave_large_exterior_kai-tok.py | 2 | #### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/lair/structure/exterior/shared_lair_cave_large_exterior_kai-tok.iff"... |
bkerler/ida | refs/heads/master | plugins/rizzo/rizzo.py | 7 | ##########################################################################
# An IDAPython plugin that generates "fuzzy" function signatures that can
# be shared and applied amongst different IDBs.
#
# There are multiple sets of signatures that are generated:
#
# o "Formal" signatures, where functions must match exact... |
RobertoMalatesta/phantomjs | refs/heads/master | src/breakpad/src/tools/gyp/test/subdirectory/gyptest-subdir-default.py | 137 | #!/usr/bin/env python
# Copyright (c) 2009 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 building a subsidiary dependent target from a .gyp file in a
subdirectory, without specifying an explicit output build director... |
Jimmy-Morzaria/scikit-learn | refs/heads/master | sklearn/lda.py | 15 | """
Linear Discriminant Analysis (LDA)
"""
# Authors: Clemens Brunner
# Martin Billinger
# Matthieu Perrot
# Mathieu Blondel
# License: BSD 3-Clause
from __future__ import print_function
import warnings
import numpy as np
from scipy import linalg
from .externals.six import string_types
f... |
mcking49/apache-flask | refs/heads/master | Python/Lib/site-packages/pylint/test/functional/fallback_import_disabled.py | 12 | # pylint: disable=missing-docstring,unused-import
try:
import urllib2 as urllib_request #@
import urllib2 as urllib_error
from urlparse import urlparse
except ImportError:
# python2
from urllib import request as urllib_request
from urllib import error as urllib_error
from urllib.parse import... |
neerajvashistha/pa-dude | refs/heads/master | lib/python2.7/site-packages/django/contrib/sites/__init__.py | 808 | default_app_config = 'django.contrib.sites.apps.SitesConfig'
|
lmaurits/phyltr | refs/heads/master | src/phyltr/__init__.py | 1 | from .__main__ import run_command, build_pipeline, COMMANDS # noqa: F401
|
cloudant/mango | refs/heads/master | test/01-index-crud-test.py | 1 | # Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the ... |
venomJ/AndroidViewClient | refs/heads/master | examples/click-button-by-text.py | 9 | #! /usr/bin/env python
'''
Copyright (C) 2012 Diego Torres Milano
Created on May 5, 2012
@author: diego
'''
import sys
import os
import time
try:
sys.path.append(os.path.join(os.environ['ANDROID_VIEW_CLIENT_HOME'], 'src'))
except:
pass
from com.dtmilano.android.viewclient import ViewClient
vc = ViewClient... |
conorpp/napkis | refs/heads/master | napkis/deployment/python2.7/django/core/validators.py | 107 | from __future__ import unicode_literals
import re
try:
from urllib.parse import urlsplit, urlunsplit
except ImportError: # Python 2
from urlparse import urlsplit, urlunsplit
from django.core.exceptions import ValidationError
from django.utils.translation import ugettext_lazy as _
from django.utils.encodin... |
pyfirst/samplecode | refs/heads/master | 4_scraping/requests-json.py | 2 | # JSON形式のAPIレスポンスを取得
import requests
r = requests.get('https://connpass.com/api/v1/event/?keyword=python')
data = r.json() # JSONをデコードしたデータを取得
for event in data['events']:
print(event['title'])
|
hujiajie/chromium-crosswalk | refs/heads/master | chrome/common/extensions/docs/server2/document_parser_test.py | 121 | #!/usr/bin/env python
# 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.
import unittest
from document_parser import ParseDocument, RemoveTitle
_WHOLE_DOCUMENT = '''
Preamble before heading.
<h1 id='main'... |
scs/uclinux | refs/heads/master | user/python/python-2.4.4/Lib/nntplib.py | 156 | """An NNTP client class based on RFC 977: Network News Transfer Protocol.
Example:
>>> from nntplib import NNTP
>>> s = NNTP('news')
>>> resp, count, first, last, name = s.group('comp.lang.python')
>>> print 'Group', name, 'has', count, 'articles, range', first, 'to', last
Group comp.lang.python has 51 articles, rang... |
sanyaade-teachings/oppia | refs/heads/master | extensions/objects/models/objects.py | 15 | # coding: utf-8
#
# Copyright 2014 The Oppia 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 requi... |
kingvuplus/enigma2 | refs/heads/master | lib/python/Plugins/newplugin.py | 37 | #!/usr/bin/python
import os
os.system("clear")
internalname = raw_input("Internal plugin name (no whitespaces, plugin directory): ")
name = raw_input("Visible plugin name: ")
print
os.system("clear")
dirlist = []
count = 0
print "Plugin categories:"
for dir in os.listdir("."):
if os.path.isdir(dir):
count += 1
... |
dsaraujo/circulante | refs/heads/master | django/core/files/storage.py | 158 | import os
import errno
import urlparse
import itertools
from datetime import datetime
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured, SuspiciousOperation
from django.core.files import locks, File
from django.core.files.move import file_move_safe
from django.utils.encoding impo... |
jaywreddy/django | refs/heads/master | tests/forms_tests/tests/test_utils.py | 130 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import copy
from django.core.exceptions import ValidationError
from django.forms.utils import ErrorDict, ErrorList, flatatt
from django.test import SimpleTestCase
from django.utils import six
from django.utils.encoding import force_text, python_2_unicode... |
pannarale/pycbc | refs/heads/master | examples/gw150914/gw150914_h1_snr.py | 9 | from pycbc.frame import read_frame
from pycbc.filter import highpass_fir, matched_filter
from pycbc.waveform import get_fd_waveform
from pycbc.psd import welch, interpolate
try:
from urllib.request import urlretrieve
except ImportError: # python < 3
from urllib import urlretrieve
# Read data and remove low fr... |
YathishReddy/Robust_ECN_Signalling_With_Nonces | refs/heads/master | src/mpi/bindings/modulegen__gcc_LP64.py | 28 | from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
import pybindgen.settings
import warnings
class ErrorHandler(pybindgen.settings.ErrorHandler):
def handle_error(self, wrapper, exception, traceback_):
warnings.warn("exception %r in wrapper %s" % (exception, wrapper))
... |
GdZ/scriptfile | refs/heads/master | software/googleAppEngine/lib/webapp2/tests/resources/handlers.py | 25 | import webapp2
class LazyHandler(webapp2.RequestHandler):
def get(self, **kwargs):
self.response.out.write('I am a laaazy view.')
class CustomMethodHandler(webapp2.RequestHandler):
def custom_method(self):
self.response.out.write('I am a custom method.')
def handle_exception(request, respo... |
SnappleCap/oh-mainline | refs/heads/master | vendor/packages/gdata/tests/all_tests_local.py | 41 | #!/usr/bin/env python
#
# Copyright (C) 2009 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... |
rakeshmi/tempest | refs/heads/master | tempest/api_schema/response/compute/v2_1/floating_ips.py | 17 | # Copyright 2014 NEC 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 ... |
GdZ/scriptfile | refs/heads/master | software/googleAppEngine/lib/django_1_3/tests/regressiontests/middleware/urls.py | 122 | from django.conf.urls.defaults import patterns
urlpatterns = patterns('',
(r'^noslash$', 'view'),
(r'^slash/$', 'view'),
(r'^needsquoting#/$', 'view'),
)
|
ThirdProject/android_external_chromium_org | refs/heads/cm-11.0 | tools/telemetry/telemetry/core/__init__.py | 461 | # 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.
|
waytai/odoo | refs/heads/8.0 | addons/product_extended/product_extended.py | 185 | ##############################################################################
#
# OpenERP, Open Source Management Solution
# 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 G... |
satary/fretty | refs/heads/master | image_widget.py | 2 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) Grigoriy A. Armeev, 2015
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as·
# published by the Free Software Foundation.
#
# This program is distributed in the hope th... |
zaina/nova | refs/heads/master | nova/api/openstack/compute/contrib/extended_volumes.py | 56 | # Copyright 2013 OpenStack Foundation
#
# 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... |
Pablo126/SSBW | refs/heads/master | Entrega1/lib/python3.5/site-packages/django/conf/locale/mk/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 = 'd F Y'
TIME_FORMAT = 'H:i'
DATETI... |
OpringaoDoTurno/airflow | refs/heads/master | airflow/security/kerberos.py | 5 | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... |
chjw8016/GreenOdoo7-haibao | refs/heads/master | openerp/addons/account/wizard/account_unreconcile.py | 56 | # -*- 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... |
sysadminmatmoz/odoo-clearcorp | refs/heads/8.0 | account_partner_balance_report/report/account_partner_balance_report.py | 3 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Addons modules by CLEARCORP S.A.
# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>).
#
# This program is free software: you can redistribute... |
phoebusliang/parallel-lettuce | refs/heads/master | tests/integration/lib/Django-1.3/django/contrib/sessions/backends/cached_db.py | 270 | """
Cached, database-backed sessions.
"""
from django.conf import settings
from django.contrib.sessions.backends.db import SessionStore as DBStore
from django.core.cache import cache
class SessionStore(DBStore):
"""
Implements cached, database backed sessions.
"""
def __init__(self, session_key=None)... |
jkshaver/virtualenv-1.8.2 | refs/heads/master | env/lib/python2.7/site-packages/django/template/defaulttags.py | 50 | """Default tags used by the template system, available to all templates."""
import sys
import re
from datetime import datetime
from itertools import groupby, cycle as itertools_cycle
from django.conf import settings
from django.template.base import (Node, NodeList, Template, Library,
TemplateSyntaxError, Variable... |
mezz64/home-assistant | refs/heads/dev | homeassistant/components/zha/core/channels/manufacturerspecific.py | 14 | """Manufacturer specific channels module for Zigbee Home Automation."""
from homeassistant.core import callback
from .. import registries
from ..const import (
ATTR_ATTRIBUTE_ID,
ATTR_ATTRIBUTE_NAME,
ATTR_VALUE,
REPORT_CONFIG_ASAP,
REPORT_CONFIG_MAX_INT,
REPORT_CONFIG_MIN_INT,
SIGNAL_ATTR_U... |
draugiskisprendimai/odoo | refs/heads/8.0 | addons/resource/faces/resource.py | 433 | #@+leo-ver=4
#@+node:@file resource.py
#@@language python
#@<< Copyright >>
#@+node:<< Copyright >>
############################################################################
# Copyright (C) 2005, 2006, 2007, 2008 by Reithinger GmbH
# [email protected]
#
# This file is part of faces.
#
# faces is free softwa... |
p0psicles/SickGear | refs/heads/master | lib/sqlalchemy/testing/runner.py | 79 | #!/usr/bin/env python
# testing/runner.py
# Copyright (C) 2005-2014 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""
Nose test runner module.
This script is a front-end to "no... |
jptomo/rpython-lang-scheme | refs/heads/master | rpython/jit/metainterp/counter.py | 2 | from rpython.rlib.rarithmetic import r_singlefloat, r_uint
from rpython.rtyper.lltypesystem import lltype, rffi
from rpython.translator.tool.cbuild import ExternalCompilationInfo
r_uint32 = rffi.r_uint
assert r_uint32.BITS == 32
UINT32MAX = 2 ** 32 - 1
# keep in sync with the C code in pypy__decay_jit_counters below... |
danielballan/scikit-xray | refs/heads/master | skbeam/core/spectroscopy.py | 8 | # ######################################################################
# Copyright (c) 2014, Brookhaven Science Associates, Brookhaven #
# National Laboratory. All rights reserved. #
# #
# Redistribution and use in ... |
mstreatfield/anim-studio-tools | refs/heads/master | review_tool/sources/reviewTool/api/entity.py | 5 | ##
# \namespace reviewTool.api.entity
#
# \remarks [desc::commented]
#
# \author Dr. D Studios
# \date 08/02/11
#
import socket
from ..database import db
from ..database.threads import EntityVersionsThread
from .version import Version
from .clip import Clip
class Enti... |
ifearcompilererrors/fle_redesign | refs/heads/master | fle_redesign/apps/main/views.py | 1 | import pygeoip
import json
import re
from django.shortcuts import render_to_response
from fle_redesign import settings
# gic = pygeoip.GeoIP(settings.GEOIPDAT)
def home(request):
return render_to_response("home.html")
def map(request):
ips = open(settings.PROJECT_PATH + "/ips.txt").readlines()
records = [gic.... |
timohtey/mediadrop_copy | refs/heads/master | mediadrop/lib/app_globals.py | 1 | # This file is a part of MediaDrop (http://www.mediadrop.net),
# Copyright 2009-2014 MediaDrop contributors
# For the exact contribution history, see the git revision log.
# The source code contained in this file is licensed under the GPLv3 or
# (at your option) any later version.
# See LICENSE.txt in the main project ... |
ZENGXH/scikit-learn | refs/heads/master | sklearn/linear_model/perceptron.py | 245 | # Author: Mathieu Blondel
# License: BSD 3 clause
from .stochastic_gradient import BaseSGDClassifier
from ..feature_selection.from_model import _LearntSelectorMixin
class Perceptron(BaseSGDClassifier, _LearntSelectorMixin):
"""Perceptron
Read more in the :ref:`User Guide <perceptron>`.
Parameters
-... |
GreenBlast/Linger | refs/heads/master | LingerAdapters/GMailAdapter.py | 1 | import LingerAdapters.LingerBaseAdapter as lingerAdapters
# Operation specific imports
import imaplib
import smtplib
import email
#
# try:
# from email.MIMEMultipart import MIMEMultipart
# from email.MIMEBase import MIMEBase
# from email.MIMEText import MIMEText
# from email.Encoders import encode_bas... |
hlin117/statsmodels | refs/heads/master | statsmodels/sandbox/distributions/tests/test_multivariate.py | 31 | # -*- coding: utf-8 -*-
"""
Created on Sat Apr 16 15:02:13 2011
@author: Josef Perktold
"""
import numpy as np
from numpy.testing import assert_almost_equal, assert_array_almost_equal
from statsmodels.sandbox.distributions.multivariate import (
mvstdtprob, mvstdnormcdf)
from statsmodels.sandbox.distri... |
40423206/2016fallcadp_hw | refs/heads/gh-pages | plugin/liquid_tags/test_flickr.py | 278 | from . import flickr
try:
from unittest.mock import patch
except ImportError:
from mock import patch
import os
import pytest
import re
PLUGIN_DIR = os.path.dirname(__file__)
TEST_DATA_DIR = os.path.join(PLUGIN_DIR, 'test_data')
@pytest.mark.parametrize('input,expected', [
('18873146680 large "test 1"',
... |
msebire/intellij-community | refs/heads/master | python/testData/override/py3k_after.py | 83 | class A:
def m(self):
pass
class B(A):
def m(self):
<selection>super().m()</selection>
|
BackupTheBerlios/pixies-svn | refs/heads/master | pixies/elements/inline.py | 1 |
"""
$Id$
$URL$
Copyright (C) 2004 Matteo Merli <[email protected]>
This code is licenced under the GPL. See LICENSE file.
"""
from pixies.utils import *
from properties import *
from link import *
class Inline( Properties ):
""" This represent the <fo:inline> element. """
def __init__(self, node):
... |
emfcamp/micropython | refs/heads/tilda-master | tests/extmod/ujson_dumps_float.py | 61 | try:
import ujson as json
except ImportError:
import json
print(json.dumps(1.2))
|
xingyepei/edx-platform | refs/heads/release | lms/djangoapps/lti_provider/tests/test_tasks.py | 36 | """
Tests for the LTI outcome service handlers, both in outcomes.py and in tasks.py
"""
import ddt
from django.test import TestCase
from mock import patch, MagicMock
from student.tests.factories import UserFactory
from lti_provider.models import GradedAssignment, LtiConsumer, OutcomeService
import lti_provider.tasks ... |
rfguri/vimfiles | refs/heads/master | bundle/ycm/third_party/ycmd/ycmd/tests/clang/testdata/noflags/.ycm_extra_conf.py | 7 | def FlagsForFile( filename ):
return { 'flags': [] }
|
vickenty/ookoobah | refs/heads/master | pyglet-c9188efc2e30/experimental/input/input.py | 20 | #!/usr/bin/env python
'''
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
import sys
class InputException(Exception):
pass
class InputDeviceExclusiveException(InputException):
pass
if sys.platform == 'darwin':
import osx
get_devices = osx.get_devices
elif sys.platform.startswith('lin... |
andrewor14/spark | refs/heads/master | examples/src/main/python/ml/rformula_example.py | 123 | #
# 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... |
exercism/xpython | refs/heads/master | exercises/scrabble-score/scrabble_score.py | 7 | def score(word):
pass
|
siosio/intellij-community | refs/heads/master | python/testData/inspections/PyGlobalUndefinedInspection/trueNegative.py | 75 | __author__ = 'ktisha'
bar = 1
def foo():
global bar
print bar
foo() |
leereilly/django-1 | refs/heads/master | django/contrib/gis/db/backends/spatialite/models.py | 403 | """
The GeometryColumns and SpatialRefSys models for the SpatiaLite backend.
"""
from django.db import models
from django.contrib.gis.db.backends.base import SpatialRefSysMixin
class GeometryColumns(models.Model):
"""
The 'geometry_columns' table from SpatiaLite.
"""
f_table_name = models.CharField(ma... |
NickleDave/hybrid-vocal-classifier | refs/heads/main | tests/unit_test/test_features.py | 1 | """
test features.extract module
"""
import os
import evfuncs
import numpy as np
import pytest
import yaml
import hvc.audiofileIO
import hvc.features
from hvc.utils import annotation
from hvc.parse.ref_spect_params import refs_dict
@pytest.fixture()
def has_window_error(test_data_dir):
filename = os.path.join(
... |
ccomb/OpenUpgrade | refs/heads/master | addons/website/tests/test_ui.py | 34 | import openerp.tests
class TestUi(openerp.tests.HttpCase):
def test_01_public_homepage(self):
self.phantom_js("/", "console.log('ok')", "openerp.website.snippet")
def test_03_admin_homepage(self):
self.phantom_js("/", "console.log('ok')", "openerp.website.editor", login='admin')
def test_... |
sehlat57/slack-messages-files-graber | refs/heads/master | models.py | 1 | import re
import os
import requests
import time
import datetime
from slacker import Slacker
from utils import Utils
status_bar = Utils()
class SlackerGraber(object):
def __init__(self, token):
self.slacker = Slacker(token)
def get_channels_id(self, chanls):
"""
function gets id of g... |
mateuszdargacz/lux_dom | refs/heads/master | lux_dom/urls.py | 1 | from django.conf.urls import patterns, include, url
from django.conf import settings
from django.views.generic import TemplateView
from django.conf.urls.static import static
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
url(r'^... |
adblockplus/gyp | refs/heads/master | test/same-source-file-name/gyptest-pass-shared.py | 51 | #!/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.
"""
Checks that gyp does not fail on shared_library targets which have several files
with the same basename.
"""
import TestGyp
test = Tes... |
quentin-xia/Maticv | refs/heads/master | common/app.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os,socket,tempfile,time
try:
import http.client as httplib
from urllib import request as url_request
except ImportError: #above is available in py3+,below is py2.7
import httplib as httplib
import urllib as url_request
#配置app
def configure_app(app)... |
Foxfanmedium/python_training | refs/heads/master | Book_courses/Berry_P/chapter_4/mymodules/setup.py | 1 | from setuptools import setup
setup(
name='vsearch',
version='1.0',
description='The Head First Python Search Tools',
author='HF Python 2e',
author_email='[email protected]',
url='headfirstlabs.com',
py_modules=['vsearch'],
) |
rustychris/freebird | refs/heads/master | software/freebird/test_ellipse_fit.py | 1 | import compass_cal
reload(compass_cal)
fn="../../../../../ct_river/data/2014-05/tioga_winch/freebird/20140514/compass-0x5002930054E40942-20140514T0643.dat.npz"
cf=compass_cal.CalibrationFit(fn)
cf.fit()
cf.write_cal('compass.cal',overwrite=True)
samples=cf.raw_data['samples']
figure(1).clf()
plot(samples[:,0]... |
SOM-st/RPySOM | refs/heads/master | src/som/compiler/symbol.py | 1 | # Symbol is a 'lightweight' enum, in Python 3.4, we could use Enum as superclass
class Symbol(object):
NONE = -1
Integer = 0
Double = 1
Not = 2
And = 3
Or = 4
Star = 5
Div = 6
Mod ... |
Tekcafe/Test-kernel | refs/heads/master | Documentation/target/tcm_mod_builder.py | 4981 | #!/usr/bin/python
# The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD
#
# Copyright (c) 2010 Rising Tide Systems
# Copyright (c) 2010 Linux-iSCSI.org
#
# Author: [email protected]
#
import os, sys
import subprocess as sub
import string
import re
import optparse
tcm_dir = ""
fabric_ops... |
Andrey-Pavlov/robomongo | refs/heads/master | src/third-party/mongodb/src/third_party/v8/tools/disasm.py | 25 | #!/usr/bin/env python
#
# Copyright 2011 the V8 project authors. All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# noti... |
keithrob/openshift-node4 | refs/heads/master | bin/node/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/gypsh.py | 2779 | # Copyright (c) 2011 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.
"""gypsh output module
gypsh is a GYP shell. It's not really a generator per se. All it does is
fire up an interactive Python session with a few local variables... |
gfreed/android_external_chromium-org | refs/heads/android-4.4 | tools/perf/metrics/smoothness_unittest.py | 23 | # 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.
import unittest
from metrics import smoothness
from metrics.gpu_rendering_stats import GpuRenderingStats
from telemetry.page import page
from telemetry.page.... |
mrshelly/openerp71313 | refs/heads/master | openerp/addons/l10n_be_hr_payroll/__init__.py | 438 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 OpenERP SA (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the G... |
krissrex/python_projects | refs/heads/master | Projects/nodeGraph.py | 1 | # -*- coding: utf-8 -*-
"""
Created on Wed Aug 27 22:23:08 2014
@author: kristian
"""
import tkinter
from sys import argv
class Link(object):
def __init__(self, startNode, endNode):
self.setStart(startNode)
self.setEnd(endNode)
self.l = None
def setStart(self, node):
if isin... |
enitihas/SAC-Website | refs/heads/master | venv/bin/venv/lib/python2.7/site-packages/flask/ctx.py | 776 | # -*- coding: utf-8 -*-
"""
flask.ctx
~~~~~~~~~
Implements the objects required to keep the context.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from __future__ import with_statement
import sys
from functools import update_wrapper
from werkzeug.excep... |
booto/dolphin | refs/heads/master | Tools/symbolicate-ppc.py | 132 | #!/usr/bin/python
# This filter replace all occurences of JIT_PPC_${address} by a
# corresponding function name JIT_PPC_${symbol} as defined by a .map file.
# TODO, add an option to append the block address (JIT_PPC_${symbol}@${addr})
# Example 1: guest function profiling (excluding host callees)
#
# $ perf record -t... |
CamLib/AltmetricClient | refs/heads/master | tests_issues/test_issue9.py | 1 | import configparser
import os
from altmetric_client.altmetric_api_config import AltmetricAPIConfig
from altmetric_client.output_writer_csv.csv_writer_master import CSVWriterMaster
from altmetric_client.url_builder import URLBuilder
from altmetric_client.altmetric_request import AltmetricRequest
from altmetric_client.a... |
defionscode/ansible | refs/heads/devel | lib/ansible/modules/system/mount.py | 13 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2012, Red Hat, inc
# Written by Seth Vidal
# based on the mount modules from salt and puppet
# 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
__metacl... |
dezGusty/googletest | refs/heads/master | test/gtest_env_var_test.py | 2408 | #!/usr/bin/env python
#
# Copyright 2008, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... |
TRESCLOUD/odoopub | refs/heads/master | addons/association/__openerp__.py | 119 | # -*- 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... |
vmthunder/virtman | refs/heads/master | virtman/utils/singleton.py | 1 | #!/usr/bin/env python
import threading
def singleton(cls):
"""
singleton decorator, thread safe singleton mode.
Maybe GIL makes sure thread safe?
P.S., No singleton in cls()
"""
lock = threading.Lock()
instances = {}
def _singleton(*args, **kwargs):
if cls not in instances:
... |
titom1986/CouchPotatoServer | refs/heads/develop | couchpotato/core/media/movie/providers/trailer/youtube_dl/__init__.py | 6 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
__authors__ = (
'Ricardo Garcia Gonzalez',
'Danny Colligan',
'Benjamin Johnson',
'Vasyl\' Vavrychuk',
'Witold Baryluk',
'Paweł Paprota',
'Gergely Imreh',
'Rogério Brito',
'Philipp Hagemeister',
'Sören Schulze',
'Kevin Ngo',
... |
umkcdcrg01/ryu_openflow | refs/heads/master | pbr-1.0.1-py2.7.egg/pbr/hooks/__init__.py | 101 | # Copyright 2013 Hewlett-Packard Development Company, L.P.
# 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
#
# Unles... |
TEAM-Gummy/android_kernel_xiaomi_aries | refs/heads/kk4.4 | scripts/build-all.py | 1182 | #! /usr/bin/env python
# Copyright (c) 2009-2011, The Linux Foundation. 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
# ... |
Multiposting/mongoengine | refs/heads/master | tests/migration/__init__.py | 30 | from convert_to_new_inheritance_model import *
from decimalfield_as_float import *
from refrencefield_dbref_to_object_id import *
from turn_off_inheritance import *
from uuidfield_to_binary import *
if __name__ == '__main__':
unittest.main()
|
marcosbontempo/inatelos | refs/heads/master | poky-daisy/scripts/lib/mic/plugins/imager/fs_plugin.py | 1 | #!/usr/bin/python -tt
#
# Copyright (c) 2011 Intel, 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; version 2 of the License
#
# This program is distributed in the hope that it will be us... |
ignorabimus/micropython-c-api | refs/heads/master | micropython/py/makeqstrdata.py | 29 | """
Process raw qstr file and output qstr data with length, hash and data bytes.
This script works with Python 2.6, 2.7, 3.3 and 3.4.
"""
from __future__ import print_function
import re
import sys
# Python 2/3 compatibility:
# - iterating through bytes is different
# - codepoint2name lives in a different module... |
Nexenta/s3-tests | refs/heads/master | virtualenv/lib/python2.7/site-packages/boto/cacerts/__init__.py | 260 | # Copyright 2010 Google Inc.
# All rights reserved.
#
# 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, merg... |
rob356/SickRage | refs/heads/master | lib/bs4/builder/_htmlparser.py | 412 | """Use the HTMLParser library to parse HTML files that aren't too bad."""
__all__ = [
'HTMLParserTreeBuilder',
]
from HTMLParser import (
HTMLParser,
HTMLParseError,
)
import sys
import warnings
# Starting in Python 3.2, the HTMLParser constructor takes a 'strict'
# argument, which we'd like to s... |
Simran-B/arangodb | refs/heads/docs_3.0 | 3rdParty/V8-4.3.61/third_party/python_26/Lib/site-packages/win32/test/test_win32event.py | 17 | import unittest
import win32event
import time
import os
import sys
class TestWaitableTimer(unittest.TestCase):
def testWaitableFire(self):
h = win32event.CreateWaitableTimer(None, 0, None)
dt = -160L # 160 ns.
win32event.SetWaitableTimer(h, dt, 0, None, None, 0)
rc = win32event.Wait... |
bitsgalore/omSipCreator | refs/heads/master | omSipCreator/cdinfo.py | 2 | #! /usr/bin/env python
"""Wrapper module for reading and parsing cd-info output"""
import io
from lxml import etree
from . import shared
from . import config
def parseCDInfoLog(fileCDInfo):
"""Determine carrier type and number of sessions on carrier"""
# Create cd-info element
cdInfoName = etree.QName(c... |
mcfletch/AutobahnPython | refs/heads/master | examples/twisted/wamp/basic/rpc/slowsquare/__init__.py | 561 | ###############################################################################
##
## Copyright (C) 2014 Tavendo GmbH
##
## 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:/... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.