repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
wnt-zhp/hufce
refs/heads/master
django/contrib/localflavor/ca/forms.py
86
""" Canada-specific Form helpers """ from __future__ import absolute_import import re from django.core.validators import EMPTY_VALUES from django.forms import ValidationError from django.forms.fields import Field, CharField, Select from django.utils.encoding import smart_unicode from django.utils.translation import ...
azumimuo/family-xbmc-addon
refs/heads/master
plugin.video.exodus/resources/lib/modules/subtitles.py
1
# -*- coding: utf-8 -*- ''' Exodus Add-on Copyright (C) 2016 lambda 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 l...
pepeportela/edx-platform
refs/heads/master
lms/djangoapps/learner_dashboard/views.py
1
"""Learner dashboard views""" from django.contrib.auth.decorators import login_required from django.core.urlresolvers import reverse from django.http import Http404 from django.views.decorators.http import require_GET from edxmako.shortcuts import render_to_response from lms.djangoapps.learner_dashboard.utils import F...
ElegantMonkey/Bat-man
refs/heads/master
main.py
1
from multiprocessing import freeze_support if __name__ == "__main__": freeze_support() print("Freeze support") from batman.gtk_batch_downloader import main main()
SiccarPoint/numpy
refs/heads/master
numpy/core/tests/test_extint128.py
94
from __future__ import division, absolute_import, print_function import sys import itertools import contextlib import operator import numpy as np import numpy.core.multiarray_tests as mt from numpy.compat import long from numpy.testing import assert_raises, assert_equal INT64_MAX = np.iinfo(np.int64).max INT64_MIN...
kevin-coder/tensorflow-fork
refs/heads/master
tensorflow/python/kernel_tests/cwise_ops_test.py
1
# Copyright 2015 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...
henriquemiranda/yambopy
refs/heads/master
yambopy/dbs/__init__.py
4
# Copyright (C) 2017 Henrique Pereira Coutada Miranda # All rights reserved. # # This file is part of yambopy # # """ submodule to handle databases from yambo Here we will add classes to read and manipulate the netcdf databases that yambo creates This will allow the user to create his own scripts to manipulate the data...
gusDuarte/software-center-5.2
refs/heads/master
softwarecenter/ui/gtk3/session/viewmanager.py
1
# Copyright (C) 2010 Canonical # # Authors: # Michael Vogt # # 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 3. # # This program is distributed in the hope that it will be useful, but W...
asimshankar/tensorflow
refs/heads/master
tensorflow/contrib/learn/python/learn/preprocessing/tests/__init__.py
193
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
RanadeepPolavarapu/kuma
refs/heads/master
kuma/core/tasks.py
25
from celery.task import task from django.db import connection from django.contrib.sessions.models import Session from django.utils import timezone from constance import config from .cache import memcache from .models import IPBan LOCK_ID = 'clean-sessions-lock' LOCK_EXPIRE = 60 * 5 def get_expired_sessions(now):...
ptisserand/ansible
refs/heads/devel
lib/ansible/modules/network/f5/bigip_iapp_template.py
28
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (c) 2017 F5 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', ...
RO-ny9/python-for-android
refs/heads/master
python3-alpha/extra_modules/pyxmpp2/mainloop/poll.py
46
# # (C) Copyright 2011 Jacek Konieczny <jajcus@jajcus.net> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License Version # 2.1 as published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful...
fxfitz/ansible
refs/heads/devel
lib/ansible/modules/cloud/amazon/aws_acm_facts.py
41
#!/usr/bin/python # Copyright (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} DOCUMENTATION = ''' module: aws...
belltailjp/scikit-learn
refs/heads/master
sklearn/covariance/graph_lasso_.py
127
"""GraphLasso: sparse inverse covariance estimation with an l1-penalized estimator. """ # Author: Gael Varoquaux <gael.varoquaux@normalesup.org> # License: BSD 3 clause # Copyright: INRIA import warnings import operator import sys import time import numpy as np from scipy import linalg from .empirical_covariance_ im...
tillahoffmann/tensorflow
refs/heads/master
tensorflow/contrib/reduce_slice_ops/python/kernel_tests/reduce_slice_ops_test.py
33
# 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...
coderSharma/starter-python-bot
refs/heads/master
bot/app.py
28
#!/usr/bin/env python import logging import os from beepboop import resourcer from beepboop import bot_manager from slack_bot import SlackBot from slack_bot import spawn_bot logger = logging.getLogger(__name__) if __name__ == "__main__": log_level = os.getenv("LOG_LEVEL", "INFO") logging.basicConfig(form...
Hanaasagi/sorator
refs/heads/master
tests/schema/test_blueprint.py
1
# -*- coding: utf-8 -*- from flexmock import flexmock, flexmock_teardown from orator.schema import Blueprint from orator.schema.grammars import SchemaGrammar from orator.connections import Connection from .. import OratorTestCase class SchemaBuilderTestCase(OratorTestCase): def tearDown(self): flexmock_...
mavit/ansible
refs/heads/devel
test/units/module_utils/network/ftd/test_fdm_swagger_parser.py
18
# Copyright (c) 2018 Cisco and/or its affiliates. # # 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) any later v...
hazrpg/calibre
refs/heads/master
src/calibre/ebooks/conversion/plugins/html_output.py
4
from __future__ import with_statement __license__ = 'GPL 3' __copyright__ = '2010, Fabian Grassl <fg@jusmeum.de>' __docformat__ = 'restructuredtext en' import os, re, shutil from os.path import dirname, abspath, relpath as _relpath, exists, basename from calibre.customize.conversion import OutputFormatPlugin, OptionR...
TRESCLOUD/odoopub
refs/heads/master
addons/l10n_be_hr_payroll/__openerp__.py
118
# -*- 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...
mahi1356/royal_mail
refs/heads/master
royal_e.py
1
#this is the first draft--- not the main program from selenium import webdriver from selenium.webdriver.common.keys import Keys import time from selenium.webdriver.support.ui import Select driver = webdriver.Firefox() driver.get('http://www.royalmail.com/price-finder') #click next button next_a = driver.find_elem...
shangwuhencc/shogun
refs/heads/develop
tests/integration/generator/distance.py
22
"""Generator for Distance""" import shogun.Distance as distance import fileop import dataop import featop import category def _compute (feats, params): """Compute a distance and gather result data. @param feats Train and test features @param params dict with parameters to distance """ fun=eval('distance.'+pa...
VaibhavAgarwalVA/sympy
refs/heads/master
sympy/series/formal.py
24
"""Formal Power Series""" from __future__ import print_function, division from collections import defaultdict from sympy import oo, zoo, nan from sympy.core.expr import Expr from sympy.core.add import Add from sympy.core.mul import Mul from sympy.core.function import Derivative, Function from sympy.core.singleton im...
IvanaXu/Test_Class_GOF
refs/heads/master
tPatterns/Behavioral_Patterns/test_Memento_Pattern.py
1
# -*-coding:utf-8-*- # @auth ivan # @time 2016-10-25 20:08:49 # @goal test for Memento Pattern class Memento: def __init__(self, state): self.state = state def getState(self): return self.state class Originator: def __init__(self): self.state = '' def setState(self, state):...
bzhou26/NRA-Crawler
refs/heads/master
openpyxl/chart/text.py
13
from __future__ import absolute_import # Copyright (c) 2010-2015 openpyxl from openpyxl.descriptors.serialisable import Serialisable from openpyxl.descriptors import ( Typed, Alias, Sequence, ) from openpyxl.drawing.text import ( RichTextProperties, ListStyle, Paragraph, ) from .data_source i...
lanbing510/GTDWeb
refs/heads/master
django/conf/locale/lt/formats.py
115
# -*- 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 = r'Y \m. E j \d.' TIME_FORMAT = 'H:...
hasadna/django
refs/heads/master
django/contrib/sessions/backends/file.py
98
import datetime import errno import os import tempfile from django.conf import settings from django.contrib.sessions.backends.base import SessionBase, CreateError, VALID_KEY_CHARS from django.core.exceptions import SuspiciousOperation, ImproperlyConfigured from django.utils import timezone class SessionStore(SessionB...
benoitsteiner/tensorflow-opencl
refs/heads/master
tensorflow/contrib/distributions/python/ops/bijectors/cholesky_outer_product.py
85
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
AlexRobson/scikit-learn
refs/heads/master
examples/linear_model/lasso_dense_vs_sparse_data.py
348
""" ============================== Lasso on dense and sparse data ============================== We show that linear_model.Lasso provides the same results for dense and sparse data and that in the case of sparse data the speed is improved. """ print(__doc__) from time import time from scipy import sparse from scipy ...
jshiv/turntable
refs/heads/master
test/lib/python2.7/site-packages/scipy/optimize/_basinhopping.py
17
""" basinhopping: The basinhopping global optimization algorithm """ from __future__ import division, print_function, absolute_import import numpy as np from numpy import cos, sin import scipy.optimize import collections __all__ = ['basinhopping'] class Storage(object): """ Class used to store the lowest en...
huawei-cloud/compass-core
refs/heads/master
compass/tests/api/test_api.py
4
import logging import simplejson as json from copy import deepcopy from celery import current_app from mock import Mock import unittest2 from compass.api import app from compass.db import database from compass.db.model import Switch from compass.db.model import Machine from compass.db.model import Cluster from compas...
sve-odoo/odoo
refs/heads/master
addons/analytic/__openerp__.py
12
# -*- 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...
lgoptimusdev/lge-kernel-lproj
refs/heads/cm-12.1-exp
tools/perf/scripts/python/check-perf-trace.py
11214
# perf script event handlers, generated by perf script -g python # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # This script tests basic functionality such as flag and symbol # strings, common_xxx() calls back into perf, begin, end, unhandled # events, etc. ...
takeflight/django
refs/heads/master
tests/urlpatterns_reverse/urls_error_handlers.py
560
# Used by the ErrorHandlerResolutionTests test case. urlpatterns = [] handler400 = 'urlpatterns_reverse.views.empty_view' handler404 = 'urlpatterns_reverse.views.empty_view' handler500 = 'urlpatterns_reverse.views.empty_view'
sebrandon1/tempest
refs/heads/master
tempest/api/compute/admin/test_simple_tenant_usage_negative.py
8
# Copyright 2013 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 ...
niteoweb/pyramid_letsencrypt
refs/heads/master
tests/test_letsencrypt.py
1
from pyramid import testing import unittest class TestLetsencryptContent(unittest.TestCase): def test_response(self): from pyramid_letsencrypt import letsencrypt_content request = testing.DummyRequest() request.registry.settings = {'letsencrypt.content': 'foo.bar'} response = le...
lastweek/gem5
refs/heads/master
src/arch/x86/isa/insts/simd128/integer/data_transfer/move_non_temporal.py
88
# Copyright (c) 2007 The Hewlett-Packard Development Company # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implemen...
jjlee3/openthread
refs/heads/master
tools/harness-automation/autothreadharness/runner.py
6
#!/usr/bin/env python # # Copyright (c) 2016, The OpenThread 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: # 1. Redistributions of source code must retain the above copyright # notic...
HuaweiSwitch/ansible
refs/heads/devel
lib/ansible/modules/database/vertica/vertica_facts.py
50
#!/usr/bin/python # -*- coding: utf-8 -*- # 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) any later version. #...
tommy-u/enable
refs/heads/master
kiva/fonttools/afm.py
1
""" This is a python interface to Adobe Font Metrics Files. Although a number of other python implementations exist (and may be more complete than mine) I decided not to go with them because either they were either 1) copyighted or used a non-BSD compatible license 2) had too many dependencies and I wanted a fre...
hieukypc/ERP
refs/heads/master
openerp/report/custom.py
48
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import os import time import openerp import openerp.tools as tools from openerp.tools.safe_eval import safe_eval as eval import print_xml import render from interface import report_int import common from openerp.osv.orm...
EmadMokhtar/Django
refs/heads/master
tests/datatypes/models.py
51
""" This is a basic model to test saving and loading boolean and date-related types, which in the past were problematic for some database backends. """ from django.db import models class Donut(models.Model): name = models.CharField(max_length=100) is_frosted = models.BooleanField(default=False) has_sprin...
endlessm/chromium-browser
refs/heads/master
build/linux/install-chromeos-fonts.py
4
#!/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. # Script to install the Chrome OS fonts on Linux. # This script can be run manually (as root), but is also run as part # install-build-...
ProjectSWGCore/NGECore2
refs/heads/master
scripts/object/static/particle/particle_test_46.py
85615
import sys def setup(core, object): return
gannetson/sportschooldeopenlucht
refs/heads/master
env/lib/python2.7/site-packages/django/db/transaction.py
105
""" This module implements a transaction manager that can be used to define transaction handling in a request or view function. It is used by transaction control middleware and decorators. The transaction manager can be in managed or in auto state. Auto state means the system is using a commit-on-save strategy (actual...
highweb-project/highweb-webcl-html5spec
refs/heads/highweb-20160310
third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/coverage/report.py
67
"""Reporter foundation for Coverage.""" import fnmatch, os from coverage.codeunit import code_unit_factory from coverage.misc import CoverageException, NoSource, NotPython class Reporter(object): """A base class for all reporters.""" def __init__(self, coverage, ignore_errors=False): """Create a repo...
anistark/mozillians
refs/heads/master
mozillians/common/middleware.py
8
import re from contextlib import contextmanager from django.conf import settings from django.contrib.auth.decorators import login_required from django.contrib import messages from django.utils.encoding import iri_to_uri from funfactory.urlresolvers import reverse from tower import ugettext_lazy as _lazy from mozilli...
xuru/pyvisdk
refs/heads/master
pyvisdk/do/host_disk_dimensions_chs.py
1
import logging from pyvisdk.exceptions import InvalidArgumentError ######################################## # Automatically generated, do not edit. ######################################## log = logging.getLogger(__name__) def HostDiskDimensionsChs(vim, *args, **kwargs): '''This data object type describes dimen...
40223139/LEGOg7-39
refs/heads/master
static/Brython3.1.3-20150514-095342/Lib/site-packages/pygame/__init__.py
603
## pygame - Python Game Library ## Copyright (C) 2000-2001 Pete Shinners ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Library General Public ## License as published by the Free Software Foundation; either ## version 2 of the License, or (...
msabramo/ansible
refs/heads/devel
test/units/parsing/vault/test_vault_editor.py
33
# (c) 2014, James Tanner <tanner.jc@gmail.com> # (c) 2014, James Cammarata, <jcammarata@ansible.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 ...
ddico/odoo
refs/heads/master
addons/payment_transfer/controllers/__init__.py
738
# -*- coding: utf-8 -*- from . import main
JCA-Developpement/Odoo
refs/heads/master
addons/account_payment/report/__init__.py
436
# -*- 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...
adamdoupe/enemy-of-the-state
refs/heads/master
pair_counter.py
1
from collections import defaultdict class PairCounter(object): def __init__(self): self._dict = defaultdict(int) def add(self, a, b): assert a != b if a < b: self._dict[(a, b)] += 1 else: self._dict[(b, a)] += 1 def addSorted(self, a, b): a...
ThomasMiconi/nupic.research
refs/heads/master
projects/wavelet_dataAggregation/runDataAggregationExperiment.py
11
from os.path import isfile, join, exists import pandas as pd import numpy as np from scipy import signal import numpy.matlib import csv import os import time os.environ['TZ'] = 'GMT' time.tzset() display = True if display: import matplotlib.pyplot as plt plt.close('all') plt.ion() def plotWaveletPower(sig, cw...
orlov-vo/mtasa
refs/heads/master
vendor/google-breakpad/src/tools/gyp/test/ninja/normalize-paths-win/gyptest-normalize-paths.py
165
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Make sure paths are normalized with VS macros properly expanded on Windows. """ import TestGyp import sys if sys.platform == 'win32':...
pedrolamarao/aasgard
refs/heads/master
googletest/scripts/release_docs.py
1167
#!/usr/bin/env python # # Copyright 2013 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 of...
richpolis/siveinpy
refs/heads/master
env/lib/python2.7/site-packages/django/template/base.py
105
from __future__ import absolute_import, unicode_literals import re from functools import partial from inspect import getargspec from django.conf import settings from django.template.context import (BaseContext, Context, RequestContext, ContextPopException) from django.utils.importlib import import_module from dja...
GarrettHoffman/ThinkStats2
refs/heads/master
code/mystery.py
68
"""This file contains code used in "Think Stats", by Allen B. Downey, available from greenteapress.com Copyright 2014 Allen B. Downey License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html """ from __future__ import print_function import random import numpy as np import scipy.stats def write_sample(sample, filena...
matthewbauer/unipkg-pacman
refs/heads/master
test/pacman/tests/mode002.py
28
self.description = "Check execute mode on files in a package" p = pmpkg("pkg1") p.files = ["bin/foo|755", "bin/bar|755"] self.addpkg(p) self.args = "-U %s" % p.filename() self.addrule("PACMAN_RETCODE=0") self.addrule("FILE_MODE=bin/foo|755") self.addrule("FILE_MODE=bin/bar|755")
blueyed/jedi
refs/heads/master
jedi/evaluate/docstrings.py
15
""" Docstrings are another source of information for functions and classes. :mod:`jedi.evaluate.dynamic` tries to find all executions of functions, while the docstring parsing is much easier. There are two different types of docstrings that |jedi| understands: - `Sphinx <http://sphinx-doc.org/markup/desc.html#info-fie...
jackrzhang/zulip
refs/heads/master
zproject/urls.py
1
from django.conf import settings from django.conf.urls import url, include from django.conf.urls.i18n import i18n_patterns from django.http import HttpResponseBadRequest, HttpRequest, HttpResponse from django.views.generic import TemplateView, RedirectView from django.utils.module_loading import import_string import os...
realgo/luigi
refs/heads/master
test/create_packages_archive_root/package/subpackage/__init__.py
475
# -*- coding: utf-8 -*- # # Copyright 2012-2015 Spotify AB # # 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...
axinging/chromium-crosswalk
refs/heads/master
native_client_sdk/src/build_tools/update_nacl_manifest.py
30
#!/usr/bin/env python # 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. """Script that reads omahaproxy and gsutil to determine version of SDK to put in manifest. """ # pylint is convinced the email mod...
sadleader/odoo
refs/heads/master
addons/account_check_writing/report/check_print.py
320
# -*- 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...
alexryndin/ambari
refs/heads/branch-adh-1.5
ambari-common/src/main/python/resource_management/core/providers/windows/service.py
5
""" 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 use this ...
84506232/AK-OnePone
refs/heads/master
Documentation/networking/cxacru-cf.py
14668
#!/usr/bin/env python # Copyright 2009 Simon Arlott # # 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. # # This program i...
marcinzaremba/libcloud
refs/heads/trunk
docs/examples/compute/create_ibm_sce_windows_node.py
62
from libcloud.compute.types import Provider from libcloud.compute.providers import get_driver Driver = get_driver(Provider.IBM) conn = Driver("user@name.com", "ibm_sce_password") images = conn.list_images() image = [i for i in images if i.id == '20014110'][0] locations = conn.list_locations() location = [l for l in ...
MediaSapiens/wavesf
refs/heads/master
django/contrib/flatpages/tests/urls.py
300
from django.conf.urls.defaults import * # special urls for flatpage test cases urlpatterns = patterns('', (r'^flatpage_root', include('django.contrib.flatpages.urls')), (r'^accounts/', include('django.contrib.auth.urls')), )
beqa2323/learntosolveit
refs/heads/version1
languages/python/software_engineering_time_converter.py
7
import time print time.time() print time.strftime("%m/%d/%y/%H:%M",time.gmtime(time.time()))
boris-p/ladybug
refs/heads/master
src/Ladybug_Wind Boundary Profile.py
1
# Wind Profile Curve Visualizer # # Ladybug: A Plugin for Environmental Analysis (GPL) started by Mostapha Sadeghipour Roudsari # # This file is part of Ladybug. # # Copyright (c) 2013-2015, Djordje Spasic and Chris Mackey <djordjedspasic@gmail.com and chris@mackeyarchitecture.com> # Ladybug is free software; you ca...
saurabh6790/medsynaptic1-app
refs/heads/master
master/doctype/test/test.py
798
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt # For license information, please see license.txt from __future__ import unicode_literals import webnotes class DocType: def __init__(self, d, dl): self.doc, self.doclist = d, dl
alfa-addon/addon
refs/heads/master
plugin.video.alfa/servers/vidtome.py
2
# -*- coding: utf-8 -*- from core import httptools from core import scrapertools from platformcode import logger def test_video_exists(page_url): logger.info("(page_url='%s')" % page_url) data = httptools.downloadpage(page_url).data if "Not Found" in data or "File Does not Exist" in data: ...
provaleks/o8
refs/heads/8.0
openerp/release.py
284
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-TODAY OpenERP S.A. <http://www.openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms o...
hubcapsc/orangefs_kmod
refs/heads/orangefs-3.19-rc2
scripts/analyze_suspend.py
1540
#!/usr/bin/python # # Tool for analyzing suspend/resume timing # Copyright (c) 2013, 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. # # This prog...
kevinjoyner/google_home_calendars
refs/heads/master
src/Actions/Command.py
1
""" doc string""" from time import sleep from Connectors.CalConnector import CalConnector from apiclient.errors import HttpError class Command(object): """ doc string """ def __init__(self): connector = CalConnector() credentials = connector.get_credentials() self.service = connector....
yuanagain/seniorthesis
refs/heads/master
venv/lib/python3.5/site-packages/pip/_vendor/requests/packages/chardet/big5freq.py
3132
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights R...
javiergarridomellado/Empresa_django
refs/heads/master
devcodela/lib/python2.7/site-packages/django/__init__.py
4
VERSION = (1, 5, 0, 'final', 0) def get_version(*args, **kwargs): # Don't litter django/__init__.py with all the get_version stuff. # Only import if it's actually called. from django.utils.version import get_version return get_version(*args, **kwargs)
savoirfairelinux/django
refs/heads/master
tests/utils_tests/test_tree.py
33
import copy import unittest from django.utils.tree import Node class NodeTests(unittest.TestCase): def setUp(self): self.node1_children = [('a', 1), ('b', 2)] self.node1 = Node(self.node1_children) self.node2 = Node() def test_str(self): self.assertEqual(str(self.node1), "(DE...
grupoprog3/proyecto_final
refs/heads/master
Entrega Final/flask/Lib/site-packages/pkg_resources/extern/__init__.py
245
import sys class VendorImporter: """ A PEP 302 meta path importer for finding optionally-vendored or otherwise naturally-installed packages from root_name. """ def __init__(self, root_name, vendored_names=(), vendor_pkg=None): self.root_name = root_name self.vendored_names = set(v...
Lucas-Armand/genetic-algorithm
refs/heads/master
vis/3DsequenceShip.py
1
# -*- coding: utf-8 -*- import os import math import csv from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt import numpy as np from itertools import product, combinations import matplotlib.animation as animation def csv_read(name): #Metodo de leitura, transforma um arquivo CSV em um vetor ...
arijitray1993/FrequentItemSetMining
refs/heads/master
analyze2.py
1
''' Code for analyzing retail_25k.dat to extract the most frequent items bought together. "Most" defined by a threshold sigma. We only consider sets where number of items in set is more than N (default 3) @author: Arijit Ray January 2017 ''' import argparse import sys import itertools from random import shuffle fro...
hdinsight/hue
refs/heads/master
desktop/core/ext-py/Django-1.6.10/django/conf/locale/lv/formats.py
117
# -*- 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 = r'Y. \g\a\d\a j. F' TIME_FORMAT = ...
AndrewGrossman/django
refs/heads/master
tests/migrations/test_autodetector.py
33
# -*- coding: utf-8 -*- from django.conf import settings from django.contrib.auth.models import AbstractBaseUser from django.db import connection, models from django.db.migrations.autodetector import MigrationAutodetector from django.db.migrations.graph import MigrationGraph from django.db.migrations.loader import Migr...
vmax-feihu/hue
refs/heads/master
desktop/core/ext-py/Django-1.6.10/django/contrib/gis/tests/distapp/tests.py
109
from __future__ import absolute_import from django.db import connection from django.db.models import Q from django.contrib.gis.geos import HAS_GEOS from django.contrib.gis.measure import D # alias for Distance from django.contrib.gis.tests.utils import ( HAS_SPATIAL_DB, mysql, oracle, postgis, spatialite, no_oracl...
indhub/mxnet
refs/heads/master
example/reinforcement-learning/dqn/replay_memory.py
43
# 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...
dpiers/coderang-meteor
refs/heads/master
public/jsrepl/extern/python/closured/lib/python2.7/atexit.py
336
""" atexit.py - allow programmer to define multiple exit functions to be executed upon normal program termination. One public function, register, is defined. """ __all__ = ["register"] import sys _exithandlers = [] def _run_exitfuncs(): """run any registered exit functions _exithandlers is traversed in rev...
thomasvincent/utilities
refs/heads/master
NagiosPlugins/check_procs/pexpect/pexpect.py
48
"""Pexpect is a Python module for spawning child applications and controlling them automatically. Pexpect can be used for automating interactive applications such as ssh, ftp, passwd, telnet, etc. It can be used to a automate setup scripts for duplicating software package installations on different servers. It can be u...
hryamzik/ansible
refs/heads/devel
lib/ansible/module_utils/facts/network/dragonfly.py
232
# 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) any later version. # # Ansible is distributed in the hope that ...
jackkiej/SickRage
refs/heads/master
tests/sickrage_tests/media/generic_media_tests.py
7
# coding=utf-8 # This file is part of SickRage. # # URL: https://SickRage.GitHub.io # Git: https://github.com/SickRage/SickRage.git # # SickRage 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...
agry/NGECore2
refs/heads/master
scripts/object/tangible/droid_battery/battery.py
85615
import sys def setup(core, object): return
curita/scrapy
refs/heads/master
scrapy/contrib/spidermiddleware/depth.py
144
import warnings from scrapy.exceptions import ScrapyDeprecationWarning warnings.warn("Module `scrapy.contrib.spidermiddleware.depth` is deprecated, " "use `scrapy.spidermiddlewares.depth` instead", ScrapyDeprecationWarning, stacklevel=2) from scrapy.spidermiddlewares.depth import *
wagtail/wagtail
refs/heads/stable/2.13.x
wagtail/embeds/forms.py
9
from django import forms from django.core.validators import URLValidator from django.utils.translation import gettext_lazy as _ class EmbedForm(forms.Form): url = forms.CharField( label=_("URL"), validators=[URLValidator(message=_("Please enter a valid URL"))] )
CredoReference/edx-platform
refs/heads/integration-hawthorn-qa
common/test/acceptance/pages/lms/library.py
56
""" Library Content XBlock Wrapper """ from bok_choy.page_object import PageObject class LibraryContentXBlockWrapper(PageObject): """ A PageObject representing a wrapper around a LibraryContent block seen in the LMS """ url = None BODY_SELECTOR = '.xblock-student_view div' def __init__(self, ...
medecau/memchan
refs/heads/master
lib/textile/textile/__init__.py
6
from functions import textile, textile_restricted, Textile __all__ = ['textile', 'textile_restricted']
simonkuang/grpc
refs/heads/master
src/python/grpcio_health_checking/grpc_health/v1/health.py
22
# Copyright 2015 gRPC authors. # # 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...
alistairlow/tensorflow
refs/heads/master
tensorflow/contrib/training/python/training/evaluation_test.py
53
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
yongtang/tensorflow
refs/heads/master
tensorflow/python/ops/histogram_ops_test.py
8
# Copyright 2015 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...
hcrlab/access_teleop
refs/heads/master
cse481wi18/fetch_api/setup.py
1
## ! DO NOT MANUALLY INVOKE THIS setup.py, USE CATKIN INSTEAD from distutils.core import setup from catkin_pkg.python_setup import generate_distutils_setup # fetch values from package.xml setup_args = generate_distutils_setup( packages=['fetch_api'], package_dir={'': 'src'}) setup(**setup_args)
aroth-arsoft/arsoft-meta-packages
refs/heads/master
grp_clamav.py
1
#!/usr/bin/python # -*- coding: utf-8 -*- # kate: space-indent on; indent-width 4; mixedindent off; indent-mode python; clamav = [ {'name':'common', 'mainpackage':True, 'shortdesc':'Installs the ClamAV', 'description':'', 'packages':['clamav', 'clamav-freshclam', 'clamav-daemon'], }, {'na...
atosatto/ansible
refs/heads/devel
lib/ansible/module_utils/six/__init__.py
59
# This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by Ansible # still belong to the author of the module, and may assign their own license # to the complete wo...