repo_name
stringlengths
6
100
path
stringlengths
4
294
copies
stringlengths
1
5
size
stringlengths
4
6
content
stringlengths
606
896k
license
stringclasses
15 values
CyanogenMod/android_kernel_amazon_otter-common
tools/perf/scripts/python/sched-migration.py
11215
11670
#!/usr/bin/python # # Cpu task migration overview toy # # Copyright (C) 2010 Frederic Weisbecker <fweisbec@gmail.com> # # perf script event handlers have been generated by perf script -g python # # This software is distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Fre...
gpl-2.0
acshi/osf.io
admin/common_auth/views.py
2
4130
from __future__ import absolute_import, unicode_literals from django.core.urlresolvers import reverse, reverse_lazy from django.http import Http404, HttpResponseBadRequest from django.shortcuts import redirect from django.utils.decorators import method_decorator from django.views.decorators.cache import never_cache fr...
apache-2.0
MartinSavc/scikit-learn
sklearn/utils/sparsetools/_graph_validation.py
364
2407
from __future__ import division, print_function, absolute_import import numpy as np from scipy.sparse import csr_matrix, isspmatrix, isspmatrix_csc from ._graph_tools import csgraph_to_dense, csgraph_from_dense,\ csgraph_masked_from_dense, csgraph_from_masked DTYPE = np.float64 def validate_graph(csgraph, direc...
bsd-3-clause
rampage644/impala-cut
tests/common/impala_cluster.py
2
8302
#!/usr/bin/env python # Copyright (c) 2012 Cloudera, 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 requir...
apache-2.0
Bdanilko/EdPy
src/lib/program.py
1
21793
#!/usr/bin/env python2 # * **************************************************************** ** # File: program.py # Requires: Python 2.7+ (but not Python 3.0+) # Note: For history, changes and dates for this file, consult git. # Author: Brian Danilko, Likeable Software (brian@likeablesoftware.com) # Copyright 2015-2017...
gpl-2.0
matte1/mavlink
pymavlink/tools/magfit_rotation_gps.py
11
3924
#!/usr/bin/env python ''' fit best estimate of magnetometer rotation to GPS data ''' import sys, time, os, math from optparse import OptionParser parser = OptionParser("magfit_rotation_gps.py [options]") parser.add_option("--no-timestamps",dest="notimestamps", action='store_true', help="Log doesn't have timestamps")...
lgpl-3.0
achow101/bitcoin
test/functional/interface_zmq.py
13
25979
#!/usr/bin/env python3 # Copyright (c) 2015-2020 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test the ZMQ notification interface.""" import struct from test_framework.address import ADDRESS_BCRT1...
mit
nazo/ansible
lib/ansible/modules/network/nxos/nxos_ntp_options.py
19
8688
#!/usr/bin/python # # 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 distribut...
gpl-3.0
kevinkellyspacey/standalone-dell-recovery
Dell/recovery_xml.py
1
5532
#!/usr/bin/python3 # -*- coding: utf-8 -*- # # «recovery_xml» - Helper Class for parsing and using a bto.xml # # Copyright (C) 2010-2011, Dell Inc. # # Author: # - Mario Limonciello <Mario_Limonciello@Dell.com> # # This is free software; you can redistribute it and/or modify it under # the terms of the GNU General Pub...
gpl-2.0
BarrelfishOS/barrelfish
tools/harness/machines/gem5.py
1
5282
########################################################################## # Copyright (c) 2012-2016 ETH Zurich. # All rights reserved. # # This file is distributed under the terms in the attached LICENSE file. # If you do not find this file, copies can be found by writing to: # ETH Zurich D-INFK, Universitaetstr 6, CH...
mit
chirilo/kuma
vendor/packages/pygments/formatters/terminal256.py
76
7680
# -*- coding: utf-8 -*- """ pygments.formatters.terminal256 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Formatter for 256-color terminal output with ANSI sequences. RGB-to-XTERM color conversion routines adapted from xterm256-conv tool (http://frexx.de/xterm-256-notes/data/xterm256-conv2.tar.bz2) by Wolfg...
mpl-2.0
sbc100/yapf
yapf/yapflib/format_decision_state.py
1
38486
# Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
apache-2.0
2uller/LotF
App/Lib/lib2to3/fixes/fix_renames.py
61
2288
"""Fix incompatible renames Fixes: * sys.maxint -> sys.maxsize """ # Author: Christian Heimes # based on Collin Winter's fix_import # Local imports from .. import fixer_base from ..fixer_util import Name, attr_chain MAPPING = {"sys": {"maxint" : "maxsize"}, } LOOKUP = {} def alternates(...
gpl-2.0
faratro/django-oscar
src/oscar/apps/dashboard/reviews/utils.py
78
1231
from oscar.core.loading import get_class, get_classes OrderReportGenerator = get_class('order.reports', 'OrderReportGenerator') ProductReportGenerator, UserReportGenerator \ = get_classes('analytics.reports', ['ProductReportGenerator', 'UserReportGenerator']) OpenBasketReport...
bsd-3-clause
mantidproject/mantid
scripts/Muon/GUI/Common/results_tab_widget/results_tab_model.py
3
14074
# Mantid Repository : https://github.com/mantidproject/mantid # # Copyright &copy; 2019 ISIS Rutherford Appleton Laboratory UKRI, # NScD Oak Ridge National Laboratory, European Spallation Source, # Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS # SPDX - License - Identifier: GPL - 3.0 + # T...
gpl-3.0
waiteb3/FrameworkBenchmarks
toolset/benchmark/test_types/plaintext_type.py
21
1394
from benchmark.test_types.framework_test_type import FrameworkTestType class PlaintextTestType(FrameworkTestType): def __init__(self): args = ['plaintext_url'] FrameworkTestType.__init__(self, name='plaintext', requires_db=False, accept_header=self.accept_plaintext, args=args) def verify(self, base_url): ...
bsd-3-clause
jiezhu2007/scrapy
scrapy/http/cookies.py
94
5486
import time from six.moves.http_cookiejar import ( CookieJar as _CookieJar, DefaultCookiePolicy, IPV4_RE ) from scrapy.utils.httpobj import urlparse_cached from scrapy.utils.python import to_native_str class CookieJar(object): def __init__(self, policy=None, check_expired_frequency=10000): self.policy...
bsd-3-clause
shpark76/WhereHows
wherehows-etl/src/main/resources/jython/requests/packages/urllib3/connectionpool.py
147
32713
from __future__ import absolute_import import errno import logging import sys import warnings from socket import error as SocketError, timeout as SocketTimeout import socket try: # Python 3 from queue import LifoQueue, Empty, Full except ImportError: from Queue import LifoQueue, Empty, Full # Queue is im...
apache-2.0
ekasitk/sahara
sahara/db/migration/alembic_migrations/versions/018_volume_local_to_instance.py
13
1175
# Copyright 2014 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 agreed to in ...
apache-2.0
fxfitz/ansible
lib/ansible/modules/cloud/azure/azure_rm_availabilityset_facts.py
7
4641
#!/usr/bin/python # # Copyright (c) 2016 Julien Stroheker, <juliens@microsoft.com> # 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', ...
gpl-3.0
chdecultot/frappe
frappe/utils/dateutils.py
8
2109
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe import frappe.defaults import datetime from frappe.utils import get_datetime from six import string_types # global values -- used for caching dateformats = { 'yyyy...
mit
ZuluPro/libcloud
libcloud/common/azure.py
2
9641
# 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 ...
apache-2.0
demisto/content
Packs/ThinkstCanary/Integrations/ThinkstCanary/ThinkstCanary_test.py
1
3171
import demistomock as demisto MOCK_PARAMS = { 'access-key': 'fake_access_key', 'secret-key': 'fake_access_key', 'server': 'http://123-fake-api.com/', 'unsecure': True, 'proxy': True } def test_fetch_incidents(mocker, requests_mock): """ Given: An existing last run time. When: Running...
mit
rajarsheem/libsdae-autoencoder-tensorflow
deepautoencoder/stacked_autoencoder.py
1
6154
import numpy as np import deepautoencoder.utils as utils import tensorflow as tf allowed_activations = ['sigmoid', 'tanh', 'softmax', 'relu', 'linear'] allowed_noises = [None, 'gaussian', 'mask'] allowed_losses = ['rmse', 'cross-entropy'] class StackedAutoEncoder: """A deep autoencoder with denoising capability"...
mit
manipopopo/tensorflow
tensorflow/python/keras/applications/vgg19.py
2
1151
# 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...
apache-2.0
foglamp/FogLAMP
python/foglamp/services/core/api/plugins/discovery.py
1
4032
# -*- coding: utf-8 -*- # FOGLAMP_BEGIN # See: http://foglamp.readthedocs.io/ # FOGLAMP_END import logging import json from aiohttp import web from foglamp.common.plugin_discovery import PluginDiscovery from foglamp.services.core.api.plugins import common from foglamp.common import logger from foglamp.services.core....
apache-2.0
Iotic-Labs/py-IoticAgent
src/IoticAgent/third/amqp/tests/case.py
6
1973
from __future__ import absolute_import import sys from functools import wraps from io import StringIO import mock from nose import SkipTest # noqa try: import unittest unittest.skip except AttributeError: import unittest2 as unittest # noqa PY3 = sys.version_info[0] == 3 patch = mock.patch call = m...
apache-2.0
pyblish/pyblish-win
lib/Python27/Lib/lib-tk/tkFileDialog.py
196
5727
# # Instant Python # $Id: tkFileDialog.py 36560 2004-07-18 06:16:08Z tim_one $ # # tk common file dialogues # # this module provides interfaces to the native file dialogues # available in Tk 4.2 and newer, and the directory dialogue available # in Tk 8.3 and newer. # # written by Fredrik Lundh, May 1997. # # # options...
lgpl-3.0
acdha/django-test-utils
test_utils/testmaker/processors/base.py
2
4411
import logging import re import time from django.template.defaultfilters import slugify as base_slugify from django.template import Template, Context from django.utils.encoding import force_unicode from django.utils.safestring import mark_safe from test_utils.templatetags import TemplateParser TEST_TEMPLATE = 'Overr...
mit
cpennington/edx-platform
openedx/core/djangoapps/zendesk_proxy/tests/test_v1_views.py
4
4142
"""Tests for zendesk_proxy views.""" from copy import deepcopy import json import ddt from django.urls import reverse from django.test.utils import override_settings from mock import MagicMock, patch import six from six.moves import range from openedx.core.djangoapps.zendesk_proxy.v1.views import ZendeskProxyThrott...
agpl-3.0
he7d3r/revscoring
tests/extractors/test_extractor.py
2
1601
from revscoring.datasources import Datasource, revision_oriented from revscoring.extractors.extractor import Extractor, OfflineExtractor def get_last_two(id): return int(str(id)[-2:]) def test_offline_extractor(): last_two_in_id = Datasource("last_two_in_id", get_last_two, d...
mit
ofermend/medicare-demo
socialite/jython/Lib/threading.py
80
11944
from java.lang import InterruptedException from java.util import Collections, WeakHashMap from java.util.concurrent import Semaphore, CyclicBarrier from java.util.concurrent.locks import ReentrantLock from org.python.util import jython from org.python.core import Py from thread import _newFunctionThread from thread imp...
apache-2.0
wesokes/django-dynamic-initial-data
dynamic_initial_data/tests/migrations/0001_initial.py
3
1403
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Account', fields=[ ...
mit
resmo/ansible
test/integration/targets/error_from_connection/connection_plugins/dummy.py
56
1040
from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = """ author: - John Doe connection: dummy short_description: defective connection plugin description: - defective connection plugin version_added: "2.0" options: {} """ import ...
gpl-3.0
yaojenkuo/stockflow
ctrls/CandleDrawer.py
2
3513
#!/bin/python # -*- coding: utf-8 -*- import numpy as np from settings import * from datetime import datetime from ctrls.Reader import Reader import matplotlib.pyplot as plt from matplotlib.finance import candlestick_ohlc class CandleDrawer(): '''畫出近 n 天 K 線圖+Ma20布林通道+高低通道+量''' def _getBooleanBand(self, seri...
mit
diagramsoftware/odoo
openerp/addons/base/tests/test_view_validation.py
396
3427
# This test can be run stand-alone with something like: # > PYTHONPATH=. python2 openerp/tests/test_view_validation.py from lxml import etree from StringIO import StringIO import unittest2 from openerp.tools.view_validation import (valid_page_in_book, valid_att_in_form, valid_type_in_colspan, ...
agpl-3.0
tdtrask/ansible
lib/ansible/modules/storage/netapp/sf_check_connections.py
49
5271
#!/usr/bin/python # (c) 2017, NetApp, 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': ['preview'], ...
gpl-3.0
endlessm/chromium-browser
third_party/catapult/third_party/google-endpoints/Crypto/Hash/MD5.py
123
2863
# -*- coding: utf-8 -*- # # =================================================================== # The contents of this file are dedicated to the public domain. To # the extent that dedication to the public domain is not available, # everyone is granted a worldwide, perpetual, royalty-free, # non-exclusive license to e...
bsd-3-clause
optima-ict/odoo
openerp/tools/import_email.py
70
5420
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import os, sys import re import smtplib import email, mimetypes from email.header import decode_header from email.mime.text import MIMEText import xmlrpclib warn_msg = """ Bonjour, Le message avec le sujet "%s" n'a pu ...
agpl-3.0
devendermishrajio/nova_test_latest
nova/tests/unit/pci/test_device.py
7
4380
# Copyright 2014 Intel 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 require...
apache-2.0
evandrix/zxing
cpp/scons/scons-local-2.0.0.final.0/SCons/SConf.py
34
39052
"""SCons.SConf Autoconf-like configuration support. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal i...
apache-2.0
Jordan-wicker/Bread
node_modules/node-gyp/gyp/buildbot/buildbot_run.py
1467
4228
#!/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. """Argument-less script to select what to run on the buildbots.""" import os import shutil import subprocess import sys BUILDBOT_DIR = os....
mit
platformio/platformio-core
platformio/commands/run/helpers.py
2
2348
# Copyright (c) 2014-present PlatformIO <contact@platformio.org> # # 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 appli...
apache-2.0
scottdangelo/cinderclient-api-microversions
cinderclient/openstack/common/importutils.py
93
2189
# 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...
apache-2.0
Salat-Cx65/python-for-android
python-build/python-libs/gdata/src/gdata/codesearch/__init__.py
274
4934
# -*- coding: utf-8 -*- # # Copyright (c) 2007 Benoit Chesneau <benoitc@metavers.net> # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS...
apache-2.0
lmyrefelt/CouchPotatoServer
libs/oauthlib/oauth2/draft25/utils.py
112
3876
""" oauthlib.utils ~~~~~~~~~~~~~~ This module contains utility methods used by various parts of the OAuth 2 spec. """ import random import string import time import urllib from urlparse import urlparse, urlunparse, parse_qsl UNICODE_ASCII_CHARACTER_SET = (string.ascii_letters.decode('ascii') + string.digits.deco...
gpl-3.0
hsnlab/nffg
nffg_diff.py
2
2072
#!/usr/bin/env python # Copyright 2017 Janos Czentye, Balazs Nemeth, Balazs Sonkoly # # 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 ...
apache-2.0
meteorcloudy/tensorflow
tensorflow/contrib/rnn/python/kernel_tests/lstm_ops_test.py
21
21832
# 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...
apache-2.0
aamirmajeedkhan/P4-conference-central
conference.py
1
35026
#!/usr/bin/env python """ conference.py -- Udacity conference server-side Python App Engine API; uses Google Cloud Endpoints $Id: conference.py,v 1.25 2014/05/24 23:42:19 wesc Exp wesc $ created by wesc on 2014 apr 21 """ __author__ = 'wesc+api@google.com (Wesley Chun)' from datetime import datetime,time im...
apache-2.0
sanjeevtripurari/hue
desktop/core/ext-py/Paste-2.0.1/paste/auth/open_id.py
50
16276
# (c) 2005 Ben Bangert # This module is part of the Python Paste Project and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """ OpenID Authentication (Consumer) OpenID is a distributed authentication system for single sign-on originally developed at/for LiveJournal.com. ht...
apache-2.0
foursquare/fsqio
src/jvm/io/fsq/twofishes/scripts/match-flickr.py
1
2018
#!/usr/bin/python import sys import csv import urllib import urllib2 import json import geojson output = {} files = sys.argv[1:] for f in files: fdata = open(f).read() try: data = geojson.loads(fdata) except: print 'failed to parse: ' + fdata continue for feature in data['features']: woeid = s...
apache-2.0
Tesora/tesora-horizon
openstack_dashboard/dashboards/project/images/snapshots/views.py
53
2477
# Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # 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...
apache-2.0
jriegel/FreeCAD
src/Mod/Arch/ArchStructure.py
16
36960
#*************************************************************************** #* * #* Copyright (c) 2011 * #* Yorik van Havre <yorik@uncreated.net> * #* ...
lgpl-2.1
musically-ut/statsmodels
statsmodels/sandbox/tsa/examples/try_ld_nitime.py
34
1354
'''Levinson Durbin recursion adjusted from nitime ''' from statsmodels.compat.python import range import numpy as np from statsmodels.tsa.stattools import acovf def levinson_durbin_nitime(s, order=10, isacov=False): '''Levinson-Durbin recursion for autoregressive processes ''' #from nitime ## if sx...
bsd-3-clause
natduca/quickopen
src/temporary_daemon.py
2
2831
# Copyright 2011 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 applicable law or agreed to in writing,...
apache-2.0
baali/Tweet_De_Feed
feeds/serializers.py
2
1624
from rest_framework import serializers from feeds.models import PushNotificationToken, TwitterAccount,\ UrlShared, TwitterStatus class SmallerSetJsonField(serializers.JSONField): """Class to expose Smaller set of JSON fields.""" def to_representation(self, value): limited_dict = {} if 'pro...
gpl-3.0
phil-lopreiato/the-blue-alliance
tests/test_notification_alliance.py
5
1321
import unittest2 from google.appengine.ext import ndb from google.appengine.ext import testbed from consts.notification_type import NotificationType from helpers.event.event_test_creator import EventTestCreator from helpers.model_to_dict import ModelToDict from notifications.alliance_selections import AllianceSelecti...
mit
botswana-harvard/edc-lab
old/lab_clinic_api/migrations/0001_initial.py
1
31522
# -*- coding: utf-8 -*- # Generated by Django 1.9 on 2016-05-07 13:52 from __future__ import unicode_literals import datetime import django.core.validators from django.db import migrations, models import django.db.models.deletion import django_extensions.db.fields import django_revision.revision_field import edc_base....
gpl-2.0
Pluto-tv/chromium-crosswalk
tools/telemetry/third_party/gsutilz/third_party/boto/boto/rds/dbsubnetgroup.py
170
2825
# Copyright (c) 2013 Franc Carter - franc.carter@gmail.com # # 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, modif...
bsd-3-clause
cloudbase/cinder
cinder/tests/unit/volume/drivers/emc/scaleio/test_manage_existing_snapshot.py
6
7106
# Copyright (c) 2016 EMC 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 # # Un...
apache-2.0
mmasaki/trove
trove/guestagent/module/drivers/module_driver.py
1
2114
# Copyright 2016 Tesora, 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 ...
apache-2.0
jbonofre/beam
sdks/python/apache_beam/runners/__init__.py
23
1342
# # 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...
apache-2.0
Glottotopia/aagd
moin/local/moin/build/lib.linux-x86_64-2.6/MoinMoin/support/passlib/handlers/des_crypt.py
2
19451
"""passlib.handlers.des_crypt - traditional unix (DES) crypt and variants""" #============================================================================= # imports #============================================================================= # core import re import logging; log = logging.getLogger(__name__) f...
mit
msmolens/VTK
Filters/General/Testing/Python/WarpScalarImage.py
20
1081
#!/usr/bin/env python import vtk from vtk.test import Testing from vtk.util.misc import vtkGetDataRoot VTK_DATA_ROOT = vtkGetDataRoot() # create a rendering window renWin = vtk.vtkRenderWindow() renWin.SetMultiSamples(0) renWin.SetSize(200, 200) iren = vtk.vtkRenderWindowInteractor() iren.SetRenderWindow(renWin) w...
bsd-3-clause
bennlich/scikit-image
skimage/transform/pyramids.py
4
9910
import math import numpy as np from scipy import ndimage from ..transform import resize from ..util import img_as_float def _smooth(image, sigma, mode, cval): """Return image with each channel smoothed by the Gaussian filter.""" smoothed = np.empty(image.shape, dtype=np.double) # apply Gaussian filter t...
bsd-3-clause
easy-as-pie-labs/tweap
tweap/project_management/tests.py
1
11427
from django.test import TestCase from project_management.models import Project, Invitation, Tag from project_management.tools import invite_users, get_tags from django.contrib.auth.models import User import json from django.http.response import HttpResponse, HttpResponseRedirect, HttpResponseNotAllowed class ModelTest...
gpl-3.0
CameronLonsdale/sec-tools
letsjusthackshit/lib/python3.5/site-packages/pip/commands/completion.py
343
2453
from __future__ import absolute_import import sys from pip.basecommand import Command BASE_COMPLETION = """ # pip %(shell)s completion start%(script)s# pip %(shell)s completion end """ COMPLETION_SCRIPTS = { 'bash': """ _pip_completion() { COMPREPLY=( $( COMP_WORDS="${COMP_WORDS[*]}" \\ CO...
mit
qpxu007/Flask-AppBuilder
examples/masterdetail/testdata.py
3
1443
from app import db from app.models import ContactGroup, Gender, Contact import random from datetime import datetime def get_random_name(names_list, size=1): name_lst = [names_list[random.randrange(0, len(names_list))].capitalize() for i in range(0, size)] return " ".join(name_lst) try: db.session.add(Co...
bsd-3-clause
konstruktoid/ansible-upstream
lib/ansible/modules/network/nxos/nxos_overlay_global.py
84
5899
#!/usr/bin/python # # 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 distribut...
gpl-3.0
harshilasu/GraphicMelon
y/google-cloud-sdk/.install/.backup/lib/googlecloudapis/developerprojects/v2beta1/developerprojects_v2beta1_messages.py
5
8064
"""Generated message classes for developerprojects version v2beta1. Developer Projects API. """ from protorpc import messages package = 'developerprojects' class DeveloperprojectsProjectsCreateRequest(messages.Message): """A DeveloperprojectsProjectsCreateRequest object. Fields: appengineStorageLocation:...
gpl-3.0
tibor95/phatch-python2.7
build/lib.linux-i686-2.7/phatch/pyWx/nuovext.py
4
51417
# Phatch - Photo Batch Processor # Copyright (C) 2007-2008 www.stani.be # # 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 versio...
gpl-3.0
frouty/odoogoeen
addons/account_followup/__openerp__.py
58
3009
# -*- 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...
agpl-3.0
samuelmaudo/yepes
yepes/utils/unidecode/x0c0.py
253
4856
data = ( 'bbweok', # 0x00 'bbweot', # 0x01 'bbweop', # 0x02 'bbweoh', # 0x03 'bbwe', # 0x04 'bbweg', # 0x05 'bbwegg', # 0x06 'bbwegs', # 0x07 'bbwen', # 0x08 'bbwenj', # 0x09 'bbwenh', # 0x0a 'bbwed', # 0x0b 'bbwel', # 0x0c 'bbwelg', # 0x0d 'bbwelm', # 0x0e 'bbwelb', # 0x...
bsd-3-clause
sandeepgupta2k4/tensorflow
tensorflow/contrib/opt/python/training/moving_average_optimizer.py
84
5839
# 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...
apache-2.0
Wyn10/Cnchi
cnchi/ui/gtk/pages/features.py
1
13668
#!/usr/bin/env python # -*- coding: utf-8 -*- # # features.py # # Copyright © 2013-2016 Antergos # # This file is part of Cnchi. # # Cnchi 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...
gpl-3.0
emma-d-cotter/iAMP-Novelty-Detection
doc/sphinxext/numpydoc.py
82
6623
""" ======== numpydoc ======== Sphinx extension that handles docstrings in the Numpy standard format. [1] It will: - Convert Parameters etc. sections to field lists. - Convert See Also section to a See also entry. - Renumber references. - Extract the signature from the docstring, if it can't be determined otherwis...
bsd-3-clause
bankonme/MUE-Src
qa/rpc-tests/listtransactions.py
164
4718
#!/usr/bin/env python2 # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # Exercise the listtransactions API from test_framework import BitcoinTestFramework from bitcoinrpc.authproxy...
mit
engdan77/edoAutoHomeMobile
twisted/internet/test/test_main.py
52
1436
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for L{twisted.internet.main}. """ from __future__ import division, absolute_import from twisted.trial import unittest from twisted.internet.error import ReactorAlreadyInstalledError from twisted.internet.main import installReactor fro...
mit
SVilgelm/CloudFerry
cloudferry/lib/os/storage/plugins/copy_mechanisms.py
1
5969
# Copyright 2016 Mirantis Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
apache-2.0
40223226/W17test2
static/Brython3.1.3-20150514-095342/Lib/errno.py
624
4096
""" This module makes available standard errno system symbols. The value of each symbol is the corresponding integer value, e.g., on most systems, errno.ENOENT equals the integer 2. The dictionary errno.errorcode maps numeric codes to symbol names, e.g., errno.errorcode[2] could be the string 'ENOENT'. Symbols that ar...
gpl-3.0
pshen/ansible
lib/ansible/modules/network/lenovo/cnos_save.py
59
5059
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2017 Lenovo, Inc. # # 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 # ...
gpl-3.0
pkats15/hdt_analyzer
django_test/django_venv/Lib/site-packages/setuptools/command/easy_install.py
201
86354
#!/usr/bin/env python """ Easy Install ------------ A tool for doing automatic download/extract/build of distutils-based Python packages. For detailed documentation, see the accompanying EasyInstall.txt file, or visit the `EasyInstall home page`__. __ https://pythonhosted.org/setuptools/easy_install.html """ from...
mit
saullocastro/pyNastran
pyNastran/bdf/dev_vectorized/cards/elements/rod/ptube.py
1
8276
from __future__ import print_function from six.moves import zip from numpy import array, zeros, unique, searchsorted, arange, pi from pyNastran.bdf.dev_vectorized.cards.elements.property import Property #from pyNastran.bdf.field_writer_8 import set_blank_if_default from pyNastran.bdf.field_writer_8 import print_card...
lgpl-3.0
allenlavoie/tensorflow
tensorflow/contrib/learn/python/learn/learn_io/pandas_io.py
28
5024
# 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...
apache-2.0
goliveirab/odoo
addons/sale/wizard/sale_line_invoice.py
222
6126
# -*- 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...
agpl-3.0
calebbrown/calebcc
feedgenerator/feeds.py
1
8744
""" Syndication feed generation library -- used for generating RSS, etc. Sample usage: >>> from django.utils import feedgenerator >>> feed = feedgenerator.Rss201rev2Feed( ... title=u"Poynter E-Media Tidbits", ... link=u"http://www.poynter.org/column.asp?id=31", ... description=u"A group Weblog by the shar...
bsd-3-clause
openiitbombayx/edx-platform
cms/djangoapps/contentstore/views/tests/test_assets.py
21
21518
""" Unit tests for the asset upload endpoint. """ from datetime import datetime from io import BytesIO from pytz import UTC from PIL import Image import json from django.conf import settings from contentstore.tests.utils import CourseTestCase from contentstore.views import assets from contentstore.utils import revers...
agpl-3.0
qdk0901/shadowsocks
shadowsocks/common.py
945
8921
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright 2013-2015 clowwindy # # 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...
apache-2.0
Hasimir/pyjs
pyjswidgets/pyjamas/ui/VerticalPanel.py
8
2174
# Copyright 2006 James Tauber and contributors # Copyright (C) 2009 Luke Kenneth Casson Leighton <lkcl@lkcl.net> # # 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/...
apache-2.0
mathslinux/ceilometer
ceilometer/opts.py
1
5518
# Copyright 2014 eNovance # # 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, so...
apache-2.0
google/j2cl
dev/test_all.py
1
1081
# Copyright 2021 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
apache-2.0
yencarnacion/jaikuengine
.google_appengine/lib/django-1.3/django/core/urlresolvers.py
159
17094
""" This module converts requested URLs to callback view functions. RegexURLResolver is the main class here. Its resolve() method takes a URL (as a string) and returns a tuple in this format: (view_function, function_args, function_kwargs) """ import re from threading import local from django.http import Http40...
apache-2.0
wbyne/QGIS
python/ext-libs/future/future/types/newbytes.py
24
14906
""" Pure-Python implementation of a Python 3-like bytes object for Python 2. Why do this? Without it, the Python 2 bytes object is a very, very different beast to the Python 3 bytes object. """ from collections import Iterable from numbers import Integral import string from future.utils import istext, isbytes, PY3, ...
gpl-2.0
riklaunim/django-custom-multisite
django/contrib/auth/models.py
1
17160
import urllib from django.core.exceptions import ImproperlyConfigured from django.core.mail import send_mail from django.db import models from django.db.models.manager import EmptyManager from django.utils.crypto import get_random_string from django.utils.encoding import smart_str from django.utils.translation import ...
bsd-3-clause
alanquillin/ryu
ryu/ofproto/ofproto_v1_4.py
5
61693
# Copyright (C) 2012,2013 Nippon Telegraph and Telephone Corporation. # Copyright (C) 2012 Isaku Yamahata <yamahata at valinux co jp> # # 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 # # ht...
apache-2.0
yunxliu/crosswalk-test-suite
webapi/tct-video-html5-tests/inst.apk.py
1996
3186
#!/usr/bin/env python import os import shutil import glob import time import sys import subprocess from optparse import OptionParser, make_option SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) PARAMETERS = None ADB_CMD = "adb" def doCMD(cmd): # Do not need handle timeout in this short script, let tool...
bsd-3-clause
Azure/azure-sdk-for-python
sdk/digitaltwins/azure-digitaltwins-core/tests/_preparer.py
1
5928
# -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- from coll...
mit
AICIDNN/graphite-web
webapp/tests/test_finders.py
39
1517
import random import time from django.test import TestCase from graphite.intervals import Interval, IntervalSet from graphite.node import LeafNode, BranchNode from graphite.storage import Store, get_finder class FinderTest(TestCase): def test_custom_finder(self): store = Store(finders=[get_finder('tests...
apache-2.0
ArturGaspar/scrapy
scrapy/utils/signal.py
133
2969
"""Helper functions for working with signals""" import logging from twisted.internet.defer import maybeDeferred, DeferredList, Deferred from twisted.python.failure import Failure from pydispatch.dispatcher import Any, Anonymous, liveReceivers, \ getAllReceivers, disconnect from pydispatch.robustapply import robu...
bsd-3-clause
caktus/django-opendebates
opendebates/tests/test_flatpage_metadata_override.py
1
2796
from django.contrib.flatpages.models import FlatPage from django.contrib.sites.models import Site from django.test import TestCase from django.utils.html import escape from opendebates.models import FlatPageMetadataOverride from opendebates import site_defaults from .factories import SiteFactory, DebateFactory class...
apache-2.0