repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
zihua/scikit-learn
refs/heads/master
sklearn/utils/tests/test_metaestimators.py
3
from nose.tools import assert_true, assert_false from sklearn.utils.metaestimators import if_delegate_has_method class Prefix(object): def func(self): pass class MockMetaEstimator(object): """This is a mock meta estimator""" a_prefix = Prefix() @if_delegate_has_method(delegate="a_prefix") ...
numerigraphe/server-tools
refs/heads/8.0
__unported__/server_env_base_external_referentials/__init__.py
70
# -*- coding: utf-8 -*- ############################################################################## # # Author: Guewen Baconnier # Copyright 2012 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # pu...
gian88/django-ckeditor-amazon-s3
refs/heads/master
ckeditor/static/google-code-prettify/tools/googlecode_upload.py
210
#!/usr/bin/env python # # Copyright 2006, 2007 Google Inc. All Rights Reserved. # Author: danderson@google.com (David Anderson) # # Script for uploading files to a Google Code project. # # This is intended to be both a useful script for people who want to # streamline project uploads and a reference implementation for ...
kbrebanov/ansible
refs/heads/devel
lib/ansible/modules/cloud/google/gcdns_record.py
29
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2015 CallFire Inc. # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ###########################################################...
Lawrence-Liu/scikit-learn
refs/heads/master
examples/svm/plot_oneclass.py
249
""" ========================================== One-class SVM with non-linear kernel (RBF) ========================================== An example using a one-class SVM for novelty detection. :ref:`One-class SVM <svm_outlier_detection>` is an unsupervised algorithm that learns a decision function for novelty detection: ...
chrismbarnes/ndnSIM
refs/heads/ndnSIM-v1
src/propagation/bindings/modulegen__gcc_LP64.py
24
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)) ...
samthor/intellij-community
refs/heads/master
python/lib/Lib/site-packages/django/contrib/localflavor/no/forms.py
309
""" Norwegian-specific Form helpers """ import re, datetime from django.core.validators import EMPTY_VALUES from django.forms import ValidationError from django.forms.fields import Field, RegexField, Select from django.utils.translation import ugettext_lazy as _ class NOZipCodeField(RegexField): default_error_mes...
erlimar/prototypeguide
refs/heads/master
src/lib/flask/testsuite/test_apps/moduleapp/__init__.py
628
from flask import Flask app = Flask(__name__) from moduleapp.apps.admin import admin from moduleapp.apps.frontend import frontend app.register_module(admin) app.register_module(frontend)
louyihua/edx-platform
refs/heads/master
cms/envs/microsite_test.py
183
""" This is a localdev test for the Microsite processing pipeline """ # We intentionally define lots of variables that aren't used, and # want to import all variables from base settings files # pylint: disable=wildcard-import, unused-wildcard-import from .dev import * MICROSITE_NAMES = ['openedx'] MICROSITE_CONFIGURA...
lnielsen/flask-appexts
refs/heads/master
flask_appexts/collect.py
1
# -*- coding: utf-8 -*- # # This file is part of Flask-AppExts # Copyright (C) 2015 CERN. # # Flask-AppExts is free software; you can redistribute it and/or # modify it under the terms of the Revised BSD License; see LICENSE # file for more details. """Flask-Collect extension.""" from __future__ import absolute_impor...
avneesh91/django
refs/heads/master
tests/migrations/test_migrations_squashed_erroneous/7_auto.py
266
from django.db import migrations class Migration(migrations.Migration): dependencies = [("migrations", "6_auto")] operations = [ migrations.RunPython(migrations.RunPython.noop) ]
ztemt/U9180_kernel
refs/heads/master
tools/perf/scripts/python/sctop.py
11180
# system call top # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Periodically displays system-wide system call totals, broken down by # syscall. If a [comm] arg is specified, only syscalls called by # [comm] are displayed. If an [interval] arg is specified,...
martynovp/edx-platform
refs/heads/master
common/djangoapps/embargo/models.py
29
""" Models for embargoing visits to certain courses by IP address. WE'RE USING MIGRATIONS! If you make changes to this model, be sure to create an appropriate migration file and check it in at the same time as your model changes. To do that, 1. Go to the edx-platform dir 2. ./manage.py lms schemamigration embargo --...
XileForce/Vindicator-S6-Test
refs/heads/master
tools/perf/scripts/python/sctop.py
11180
# system call top # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Periodically displays system-wide system call totals, broken down by # syscall. If a [comm] arg is specified, only syscalls called by # [comm] are displayed. If an [interval] arg is specified,...
oihane/stock-logistics-workflow
refs/heads/8.0
stock_ownership_availability_rules/tests/test_delivery_with_company_owner.py
20
# Author: Leonardo Pistone # Copyright 2014 Camptocamp SA # # 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 # License, or (at your option) any la...
klahnakoski/jx-sqlite
refs/heads/dev
vendor/jx_base/expressions/from_unix_op.py
4
# encoding: utf-8 # # # 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/. # # Contact: Kyle Lahnakoski (kyle@lahnakoski.com) # """ # NOTE: THE self.lang[operator] PATTERN ...
StevenAston/donkbot
refs/heads/master
plugins/dotnetpad.py
23
"dotnetpad.py: by sklnd, because gobiner wouldn't shut up" import urllib import httplib import socket import json from util import hook def dotnetpad(lang, code, timeout=30): "Posts a provided snippet of code in a provided langugage to dotnetpad.net" code = code.encode('utf8') params = urllib.urlencode...
CodingCat/mxnet
refs/heads/master
python/mxnet/gluon/data/__init__.py
52
# 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...
jcai19/smm_gem5
refs/heads/master
util/stats/profile.py
87
# Copyright (c) 2005 The Regents of The University of Michigan # 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 ...
lgierth/cjdns
refs/heads/master
node_build/dependencies/libuv/build/gyp/test/mac/gyptest-global-settings.py
249
#!/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 the global xcode_settings processing doesn't throw. Regression test for http://crbug.com/109163 """ import TestGyp impor...
w1kke/pylearn2
refs/heads/master
pylearn2/datasets/zca_dataset.py
5
""" The ZCA Dataset class. This is basically a prototype for a more general idea of being able to invert preprocessors and view data in more than one format. This should be expected to change, but had to go in pylearn2 to support pylearn2/scripts/papers/maxout """ __authors__ = "Ian Goodfellow" __copyright__ = "Copyri...
cecep-edu/edx-platform
refs/heads/eucalyptus.2
lms/djangoapps/oauth_dispatch/views.py
6
""" Views that dispatch processing of OAuth requests to django-oauth2-provider or django-oauth-toolkit as appropriate. """ from __future__ import unicode_literals import json from time import time import jwt from auth_exchange import views as auth_exchange_views from django.conf import settings from django.utils.fun...
johankaito/fufuka
refs/heads/master
microblog/flask/venv/lib/python2.7/site-packages/pip/_vendor/cachecontrol/cache.py
947
""" The cache object API for implementing caches. The default is a thread safe in-memory dictionary. """ from threading import Lock class BaseCache(object): def get(self, key): raise NotImplemented() def set(self, key, value): raise NotImplemented() def delete(self, key): raise ...
ddboline/pytest
refs/heads/master
testing/test_paths.py
1
import sys import py import pytest from _pytest.pathlib import fnmatch_ex class TestPort: """Test that our port of py.common.FNMatcher (fnmatch_ex) produces the same results as the original py.path.local.fnmatch method. """ @pytest.fixture(params=["pathlib", "py.path"]) def match(self, request...
Edraak/circleci-edx-platform
refs/heads/circleci-master
common/djangoapps/student/management/commands/anonymized_id_mapping.py
186
# -*- coding: utf-8 -*- """Dump username, per-student anonymous id, and per-course anonymous id triples as CSV. Give instructors easy access to the mapping from anonymized IDs to user IDs with a simple Django management command to generate a CSV mapping. To run, use the following: ./manage.py lms anonymized_id_mappin...
pytroll/mipp
refs/heads/master
mipp/xrit/loader.py
1
# # $id$ # # Inspired by NWCLIB # import copy import logging import types import numpy import mipp from mipp.xrit import _xrit, convert logger = logging.getLogger('mipp') __all__ = ['ImageLoader'] def _null_converter(blob): return blob class ImageLoader(object): def __init__(self, mda, image_files, ma...
Alpstein/imposm
refs/heads/master
imposm/psqldb.py
2
# Copyright 2011 Omniscale (http://omniscale.com) # # 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...
syaiful6/django
refs/heads/master
django/db/migrations/recorder.py
478
from __future__ import unicode_literals from django.apps.registry import Apps from django.db import models from django.db.utils import DatabaseError from django.utils.encoding import python_2_unicode_compatible from django.utils.timezone import now from .exceptions import MigrationSchemaMissing class MigrationRecor...
dmittov/AlcoBot
refs/heads/master
bot.py
1
#!/usr/bin/env python # -*- coding: utf-8 -*- # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is dist...
hartym/bonobo
refs/heads/develop
bonobo/examples/types/__main__.py
2
import bonobo from bonobo.examples.types.strings import get_graph if __name__ == "__main__": parser = bonobo.get_argument_parser() with bonobo.parse_args(parser): bonobo.run(get_graph())
sdague/home-assistant
refs/heads/dev
homeassistant/components/mysensors/device.py
14
"""Handle MySensors devices.""" from functools import partial import logging from homeassistant.const import ATTR_BATTERY_LEVEL, STATE_OFF, STATE_ON from homeassistant.core import callback from homeassistant.helpers.dispatcher import async_dispatcher_connect from homeassistant.helpers.entity import Entity from .const...
damnfine/mezzanine
refs/heads/master
mezzanine/accounts/__init__.py
34
""" Provides features for non-staff user accounts, such as login, signup with optional email verification, password reset, and integration with user profiles models defined by the ``AUTH_PROFILE_MODULE`` setting. Some utility functions for probing the profile model are included below. """ from __future__ import unicode...
wacrea/DBStatusREST-nodejs
refs/heads/master
node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSUtil.py
566
# Copyright (c) 2013 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Utility functions shared amongst the Windows generators.""" import copy import os _TARGET_TYPE_EXT = { 'executable': '.exe', 'loadable_module': '.dll', ...
fdvarela/odoo8
refs/heads/master
addons/account_followup/report/account_followup_print.py
24
# -*- 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...
realitix/vulk
refs/heads/master
vulk/context.py
1
"""Module to create Window and Vulkan context This module contains class to create the SDL2 window and the Vulkan logical device and queues. The context will be then passed to the Application to use it. Vulk uses a specific way to interact with Vulkan that allow a good abstraction. Instead of performing the final dra...
lupyuen/RaspberryPiImage
refs/heads/master
home/pi/GrovePi/Software/Python/others/temboo/Library/Box/Comments/UpdateComment.py
5
# -*- coding: utf-8 -*- ############################################################################### # # UpdateComment # Updates an existing comment. # # Python versions 2.6, 2.7, 3.x # # Copyright 2014, Temboo Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file exce...
Sonictherocketman/metapipe
refs/heads/master
test/test_pbs_job.py
2
""" Tests for the Torque/PBS Job """ import sure from mock import Mock from .fixtures import * from metapipe.models import pbs_job def test_qstat_queued(): j = pbs_job.PBSJob('', None) pbs_job.call = Mock(return_value=pbs_job_qstat_queued) j.is_queued().should.equal(True) def test_qstat_running(): ...
Archethought/spark-charm
refs/heads/master
hooks/charmhelpers/core/services/helpers.py
4
from charmhelpers.core import hookenv from charmhelpers.core import templating from charmhelpers.core.services.base import ManagerCallback __all__ = ['RelationContext', 'TemplateCallback', 'render_template', 'template'] class RelationContext(dict): """ Base class for a context generator that get...
gauribhoite/personfinder
refs/heads/master
env/site-packages/django/contrib/gis/shortcuts.py
197
import zipfile from io import BytesIO from django.conf import settings from django.http import HttpResponse from django.template import loader def compress_kml(kml): "Returns compressed KMZ from the given KML string." kmz = BytesIO() zf = zipfile.ZipFile(kmz, 'a', zipfile.ZIP_DEFLATED) zf.writestr('d...
tvalacarta/tvalacarta
refs/heads/master
python/main-classic/lib/youtube_dl/extractor/nrl.py
12
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor class NRLTVIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?nrl\.com/tv(/[^/]+)*/(?P<id>[^/?&#]+)' _TEST = { 'url': 'https://www.nrl.com/tv/news/match-highlights-titans-v-knights-862805/', 'info_dict...
meghana1995/sympy
refs/heads/master
sympy/physics/matrices.py
91
"""Known matrices related to physics""" from __future__ import print_function, division from sympy import Matrix, I, pi, sqrt from sympy.functions import exp from sympy.core.compatibility import range def msigma(i): r"""Returns a Pauli matrix `\sigma_i` with `i=1,2,3` References ========== .. [1] ...
Maspear/odoo
refs/heads/8.0
addons/point_of_sale/wizard/pos_discount.py
382
# -*- 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...
shaggytwodope/qutebrowser
refs/heads/master
qutebrowser/browser/webkit/network/filescheme.py
2
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: # Copyright 2014-2016 Florian Bruhin (The Compiler) <mail@qutebrowser.org> # Copyright 2015-2016 Antoni Boucher (antoyo) <bouanto@zoho.com> # # This file is part of qutebrowser. # # qutebrowser is free software: you can redistribute it and/or modify # it under the ter...
trustdarkness/chicago_demographics
refs/heads/master
py/dhelper.py
1
#!/usr/bin/python2 import cherrypy import pickle import simplejson import os MEDIA_DIR = os.path.join(os.path.abspath("."), u"media") def get_race_by_neighborhood(slug): with open("../data/%s_race.pickle" % slug, "rb") as f: return pickle.load(f) def get_age_by_neighborhood(slug): with open("../data/%s_age.p...
mrshu/scikit-learn
refs/heads/master
examples/linear_model/plot_lasso_and_elasticnet.py
1
""" ======================================== Lasso and Elastic Net for Sparse Signals ======================================== """ print __doc__ import numpy as np import pylab as pl from sklearn.metrics import r2_score ############################################################################### # generate some ...
p0psicles/SickRage
refs/heads/master
lib/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...
sriks/titanium_mobile
refs/heads/master
apidoc/generators/jsca_generator.py
31
#!/usr/bin/env python # # Copyright (c) 2010-2012 Appcelerator, Inc. All Rights Reserved. # Licensed under the Apache Public License (version 2) import os, sys, re this_dir = os.path.dirname(os.path.abspath(__file__)) sys.path.append(os.path.abspath(os.path.join(this_dir, ".."))) from common import dict_has_non_empt...
Urvik08/ns3-gpcr
refs/heads/master
src/mesh/bindings/modulegen__gcc_LP64.py
2
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)) ...
MattsFleaMarket/python-for-android
refs/heads/master
python3-alpha/python3-src/Lib/email/message.py
46
# Copyright (C) 2001-2007 Python Software Foundation # Author: Barry Warsaw # Contact: email-sig@python.org """Basic message object for the email package object model.""" __all__ = ['Message'] import re import uu import base64 import binascii import warnings from io import BytesIO, StringIO # Intrapackage imports f...
eLBati/account-financial-tools
refs/heads/8.0
__unported__/account_move_batch_validate/wizard/move_marker.py
27
# -*- coding: utf-8 -*- ############################################################################### # # # Author: Leonardo Pistone # Copyright 2014 Camptocamp SA # ...
kfwang/Glance-OVA-OVF
refs/heads/ovf
glance/tests/functional/db/test_registry.py
19
# Copyright 2013 Red Hat, 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...
promptworks/horizon
refs/heads/master
horizon/forms/fields.py
44
# Copyright 2012 Nebula, 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 agree...
rlmitchell/coursera
refs/heads/master
py4e/2_data_structures/ex-7-2.py
1
''' 7.2 Write a program that prompts for a file name, then opens that file and reads through the file, looking for lines of the form: X-DSPAM-Confidence: 0.8475 Count these lines and extract the floating point values from each of the lines and compute the average of those values and produce an output i as shown be...
csrocha/OpenUpgrade
refs/heads/8.0
addons/website_forum/__init__.py
363
# -*- coding: utf-8 -*- import controllers import models import tests
evansd/django
refs/heads/master
tests/migrations/test_migrations_squashed/0001_initial.py
975
from django.db import migrations, models class Migration(migrations.Migration): operations = [ migrations.CreateModel( "Author", [ ("id", models.AutoField(primary_key=True)), ("name", models.CharField(max_length=255)), ("slug", mode...
kevin8909/xjerp
refs/heads/master
openerp/addons/stock_qc/__init__.py
1
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (c) 2001-2014 Zhuhai sunlight software development co.,ltd. All Rights Reserved. # Author: Kenny # # This program is free software: you can redistri...
andrewsmedina/django
refs/heads/master
django/contrib/gis/geos/prototypes/geom.py
214
from ctypes import c_char_p, c_int, c_size_t, c_ubyte, POINTER from django.contrib.gis.geos.libgeos import CS_PTR, GEOM_PTR from django.contrib.gis.geos.prototypes.errcheck import ( check_geom, check_minus_one, check_sized_string, check_string, check_zero) from django.contrib.gis.geos.prototypes.threadsafe import G...
fanstatic/js.deform
refs/heads/master
js/deform/tests/conftest.py
2
# See http://kotti.readthedocs.org/en/latest/developing/testing.html
simpace/simpace
refs/heads/master
simpace/utils/_utils.py
1
from __future__ import print_function import nibabel as nib import numpy as np import os.path as osp import glob as gb import scipy.linalg as lin from six import string_types import warnings from collections import OrderedDict # import matplotlib.pyplot as plt # import nipy # import json # from warnings import warn # ...
kwierman/osf.io
refs/heads/develop
scripts/remove_wiki_title_forward_slashes.py
26
""" Remove forward slashes from wiki page titles, since it is no longer an allowed character and breaks validation. """ import logging import sys from framework.mongo import database as db from framework.transactions.context import TokuTransaction from website.app import init_app from website.project.model import Nod...
dfunckt/django
refs/heads/master
tests/flatpages_tests/test_templatetags.py
67
from django.contrib.auth.models import AnonymousUser, User from django.contrib.flatpages.models import FlatPage from django.contrib.sites.models import Site from django.template import Context, Template, TemplateSyntaxError from django.test import TestCase class FlatpageTemplateTagTests(TestCase): @classmethod ...
grigorisg9gr/menpo
refs/heads/master
menpo/image/test/image_blank_test.py
5
import numpy as np from menpo.image import * def test_blank_1_channel_image(): mask = np.zeros((10, 10), dtype=np.bool) im = MaskedImage.init_blank((10, 10), mask=mask) assert np.all(im.pixels == 0.0) assert im.n_channels == 1 assert np.all(im.mask.pixels == 0.0) im = MaskedImage.init_blank((...
tmpkus/photivo
refs/heads/master
scons-local-2.2.0/SCons/Tool/rpm.py
14
"""SCons.Tool.rpm Tool-specific initialization for rpm. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. The rpm tool calls the rpmbuild command. The first and only argument should a tar.gz consisting of the sourc...
borysiasty/inasafe
refs/heads/develop
realtime/tasks/flood.py
3
# coding=utf-8 import logging import os from realtime.celery_app import app from realtime.celeryconfig import FLOOD_WORKING_DIRECTORY from realtime.flood.make_map import process_event from realtime.utilities import realtime_logger_name __author__ = 'Rizky Maulana Nugraha <lana.pcfre@gmail.com>' __date__ = '2/16/16' ...
googleapis/googleapis-gen
refs/heads/master
google/cloud/securitycenter/v1/securitycenter-v1-py/tests/unit/gapic/securitycenter_v1/__init__.py
951
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
doublebits/osf.io
refs/heads/develop
tests/utils.py
15
import contextlib import functools import mock import datetime from django.http import HttpRequest from nose import SkipTest from nose.tools import assert_equal, assert_not_equal, assert_in from framework.auth import Auth from website.archiver import ARCHIVER_SUCCESS from website.archiver import listeners as archiver...
lgscofield/odoo
refs/heads/8.0
addons/mail/wizard/__init__.py
438
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2010-Today OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms o...
wa1tnr/ainsuSPI
refs/heads/master
0-Distribution.d/circuitpython-master/tests/basics/closure2.py
119
# closures; closing over an argument def f(x): y = 2 * x def g(z): return x + y + z return g print(f(1)(1)) x = f(2) y = f(3) print(x(1), x(2), x(3)) print(y(1), y(2), y(3)) print(x(1), x(2), x(3)) print(y(1), y(2), y(3))
veger/ansible
refs/heads/devel
lib/ansible/modules/network/voss/voss_config.py
11
#!/usr/bin/python # Copyright: (c) 2018, Extreme Networks Inc. # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status':...
OpenTreeOfLife/peyotl
refs/heads/master
tests/local_repos_tests/test_git_workflows.py
2
#! /usr/bin/env python from peyotl.git_storage.git_workflow import acquire_lock_raise, merge_from_master from peyotl.phylesystem.git_workflows import commit_and_try_merge2master, GitWorkflowError from peyotl.phylesystem.phylesystem_umbrella import Phylesystem from peyotl.utility.input_output import read_as_json from pe...
iledarn/addons-yelizariev
refs/heads/9.0
project_tags/__init__.py
16
# -*- coding: utf-8 -*- ############################################################################## # # Project Tags # Copyright (C) 2013 Sistemas ADHOC # No email # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as ...
mnesvold/sitemask
refs/heads/master
sitemask/migrations/0001_initial.py
1
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Mask', fields=[ ('id', models.AutoField(primary...
llaera/namebench
refs/heads/master
nb_third_party/simplejson/encoder.py
296
"""Implementation of JSONEncoder """ import re from decimal import Decimal def _import_speedups(): try: from simplejson import _speedups return _speedups.encode_basestring_ascii, _speedups.make_encoder except ImportError: return None, None c_encode_basestring_ascii, c_make_encoder = _im...
morelab/labman_ud
refs/heads/master
labman_ud/labman_setup/migrations/0002_twittercardsconfiguration.py
2
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import labman_setup.models class Migration(migrations.Migration): dependencies = [ ('labman_setup', '0001_initial'), ] operations = [ migrations.CreateModel( name='Twitte...
http404error/roseco
refs/heads/master
pyscraper/distro_scraper/inquirer.py
1
import db_extract as dbe import db_control as dbc con, cur = dbc.conCur(db='ROSdb') def inquire(quest, cmd, cur=cur): answer = dbe.exFetch(cur, cmd, single = True) return '\n{0}\t{1}\n\t{2}'.format(quest, answer, cmd) def inquire(quest, cmd, cur=cur): answer = dbe.exFetch(cur, cmd, single = True) return '\n{0}\...
BAMitUp/Fantasy-Football-Shuffler
refs/heads/master
ENV/lib/python2.7/site-packages/pkg_resources/_vendor/packaging/version.py
1151
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function import collections import itertools import re from ._structures import In...
Eric-Gaudiello/tensorflow_dev
refs/heads/master
tensorflow_home/tensorflow_venv/lib/python3.4/site-packages/pip/_vendor/cachecontrol/compat.py
317
try: from urllib.parse import urljoin except ImportError: from urlparse import urljoin try: import cPickle as pickle except ImportError: import pickle from pip._vendor.requests.packages.urllib3.response import HTTPResponse from pip._vendor.requests.packages.urllib3.util import is_fp_closed
Pointedstick/ReplicatorG
refs/heads/master
skein_engines/skeinforge-35/fabmetheus_utilities/geometry/geometry_tools/path_elements/arc.py
6
""" Arc vertexes. From: http://www.w3.org/TR/SVG/paths.html#PathDataEllipticalArcCommands """ from __future__ import absolute_import #Init has to be imported first because it has code to workaround the python bug where relative imports don't work if the module is imported as a main module. import __init__ from fabm...
SciLifeLab/TACA
refs/heads/master
setup.py
1
from setuptools import setup, find_packages import glob import os import sys from taca import __version__ from io import open try: with open("requirements.txt", "r") as f: install_requires = [x.strip() for x in f.readlines()] except IOError: install_requires = [] try: with open("dependency_links....
mcalmer/spacewalk
refs/heads/master
backend/server/action_extra_data/packages.py
10
# # Copyright (c) 2008--2016 Red Hat, Inc. # # This software is licensed to you under the GNU General Public License, # version 2 (GPLv2). There is NO WARRANTY for this software, express or # implied, including the implied warranties of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. You should have received a c...
gkotton/neutron
refs/heads/master
neutron/tests/unit/extensions/foxinsocks.py
8
# Copyright 2011 OpenStack Foundation. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless req...
Lujeni/ansible
refs/heads/devel
test/units/modules/network/netvisor/test_pn_snmp_community.py
23
# Copyright: (c) 2018, Pluribus Networks # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type from units.compat.mock import patch from ansible.modules.network.netvisor import pn_snmp_communi...
matllubos/django-is-core
refs/heads/master
is_core/contrib/background_export/resource.py
1
from django.contrib.contenttypes.models import ContentType from django.db.models.query import QuerySet from django.shortcuts import render from django.utils import translation from django.utils.encoding import force_text from django.utils.translation import ugettext from is_core.config import settings from is_core.res...
loic/django
refs/heads/master
tests/utils_tests/test_safestring.py
28
from __future__ import unicode_literals from django.template import Context, Template from django.test import SimpleTestCase, ignore_warnings from django.utils import html, six, text from django.utils.deprecation import RemovedInDjango20Warning from django.utils.encoding import force_bytes from django.utils.functional...
nikhilprathapani/python-for-android
refs/heads/master
python3-alpha/python3-src/Lib/test/test_fractions.py
51
"""Tests for Lib/fractions.py.""" from decimal import Decimal from test.support import run_unittest, requires_IEEE_754 import math import numbers import operator import fractions import unittest from copy import copy, deepcopy from pickle import dumps, loads F = fractions.Fraction gcd = fractions.gcd class DummyFloat...
anhstudios/swganh
refs/heads/develop
data/scripts/templates/object/static/space/asteroid/shared_asteroid_medium_01.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 = Static() result.template = "object/static/space/asteroid/shared_asteroid_medium_01.iff" result.attribute_template...
pyfisch/servo
refs/heads/master
tests/wpt/web-platform-tests/service-workers/service-worker/resources/update-nocookie-worker.py
158
import time def main(request, response): # no-cache itself to ensure the user agent finds a new version for each update. headers = [('Cache-Control', 'no-cache, must-revalidate'), ('Pragma', 'no-cache')] # Set a normal mimetype. content_type = 'application/javascript' headers.appen...
village-people/flying-pig
refs/heads/master
malmopy/util/images.py
2
# Copyright (c) 2017 Microsoft Corporation. # # 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, publis...
andela-kndungu/kevgathuku
refs/heads/master
kevgathuku/settings/testing.py
2
from .base import * DEBUG = True TEMPLATE_DEBUG = True
amenonsen/ansible
refs/heads/devel
test/units/modules/cloud/docker/test_docker_container.py
23
from __future__ import (absolute_import, division, print_function) __metaclass__ = type import unittest from ansible.modules.cloud.docker.docker_container import TaskParameters class TestTaskParameters(unittest.TestCase): """Unit tests for TaskParameters.""" def test_parse_exposed_ports_tcp_udp(self): ...
4rado/RepositoryForProject
refs/heads/master
Lib/site-packages/numpy/core/tests/test_datetime.py
55
from os import path import numpy as np from numpy.testing import * import datetime class TestDateTime(TestCase): def test_creation(self): for unit in ['Y', 'M', 'W', 'B', 'D', 'h', 'm', 's', 'ms', 'us', 'ns', 'ps', 'fs', 'as']: dt1 = np.dtype('M8[750%s]...
amaas-fintech/amaas-core-sdk-python
refs/heads/master
tests/unit/assets/interface.py
1
# coding=utf-8 from __future__ import absolute_import, division, print_function, unicode_literals from amaasutils.logging_utils import DEFAULT_LOGGING import random import requests_mock import unittest from amaascore.assets.asset import Asset from amaascore.assets.bond_option import BondOption from amaascore.assets.f...
tjcsl/ion
refs/heads/master
intranet/apps/emerg/views.py
1
import logging import time import requests from bs4 import BeautifulSoup, CData from django.conf import settings from django.core.cache import cache from django.utils import timezone from ...utils.html import safe_fcps_emerg_html logger = logging.getLogger(__name__) def check_emerg(): """Fetch from FCPS' emer...
upliftaero/MissionPlanner
refs/heads/master
Lib/webbrowser.py
42
#! /usr/bin/env python """Interfaces for launching and remotely controlling Web browsers.""" # Maintained by Georg Brandl. import os import shlex import sys import stat import subprocess import time __all__ = ["Error", "open", "open_new", "open_new_tab", "get", "register"] class Error(Exception): p...
synopat/pyload
refs/heads/stable
module/plugins/hoster/IfolderRu.py
8
# -*- coding: utf-8 -*- import re from ..internal.SimpleHoster import SimpleHoster class IfolderRu(SimpleHoster): __name__ = "IfolderRu" __type__ = "hoster" __version__ = "0.44" __status__ = "testing" __pattern__ = r'http://(?:www)?(files\.)?(ifolder\.ru|metalarea\.org|rusfolder\.(com|net|ru))/...
plaidml/plaidml
refs/heads/master
networks/keras/examples/mnist_hierarchical_rnn.py
1
"""This is an example of using Hierarchical RNN (HRNN) to classify MNIST digits. HRNNs can learn across multiple levels of temporal hiearchy over a complex sequence. Usually, the first recurrent layer of an HRNN encodes a sentence (e.g. of word vectors) into a sentence vector. The second recurrent layer then encodes ...
MITRECND/multiscanner
refs/heads/master
multiscanner/modules/Metadata/TrID.py
2
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. from __future__ import division, absolute_import, with_statement, print_function, unicode_literals import os import subp...
djw8605/campus-factory
refs/heads/master
python-lib/GlideinWMS/condorExe.py
7
# # Project: # glideinWMS # # File Version: # $Id: condorExe.py,v 1.6.12.1.8.1.6.1 2010/11/05 18:28:23 sfiligoi Exp $ # # Description: # This module implements the functions to execute condor commands # # Author: # Igor Sfiligoi (Sept 7th 2006) # import os import os.path import popen2 import string class Un...
veridiam/Madcow-Waaltz
refs/heads/master
madcow/include/simplejson/tests/test_default.py
261
from unittest import TestCase import simplejson as json class TestDefault(TestCase): def test_default(self): self.assertEquals( json.dumps(type, default=repr), json.dumps(repr(type)))
Epirex/android_external_chromium_org
refs/heads/cm-11.0
chrome/common/extensions/docs/server2/chained_compiled_file_system.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. from compiled_file_system import CompiledFileSystem from file_system import FileNotFoundError from future import Gettable, Future class ChainedCompiledFile...