code stringlengths 2 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int32 2 1.05M |
|---|---|---|---|---|---|
from south.v2 import DataMigration
from zinnia.migrations import user_name
from zinnia.migrations import user_table
from zinnia.migrations import user_orm_label
from zinnia.migrations import user_model_label
class Migration(DataMigration):
def forwards(self, orm):
"""Create the new permission for changi... | pczhaoyun/obtainfo | zinnia/migrations/0008_add_status_permission.py | Python | apache-2.0 | 8,642 |
#####################################################################################
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# This source code is subject to terms and conditions of the Apache License, Version 2.0. A
# copy of the license can be found in the License.html file at the root of t... | tempbottle/ironpython3 | Src/Scripts/radix_generator.py | Python | apache-2.0 | 1,031 |
# 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... | apache/incubator-airflow | tests/api_connexion/conftest.py | Python | apache-2.0 | 1,735 |
#!/usr/bin/env python
# Copyright 2015 ARM Limited
#
# Licensed under the Apache License, Version 2.0
# See LICENSE file for details.
# standard library modules, , ,
import unittest
import os
import tempfile
import subprocess
import copy
import re
import datetime
# internal modules:
from yotta.lib.fsutils import mkDi... | BlackstoneEngineering/yotta | yotta/test/cli/build.py | Python | apache-2.0 | 8,600 |
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under th... | stackforge/solum | solum/tests/objects/test_operation.py | Python | apache-2.0 | 1,849 |
#!/usr/bin/python -u
# Copyright (c) 2010-2016 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 ap... | openstack/swift | test/functional/test_domain_remap.py | Python | apache-2.0 | 7,932 |
from __future__ import absolute_import
from contextlib import contextmanager, nested
from django.contrib.auth.decorators import login_required
from django.shortcuts import redirect
from django.test import TestCase as BaseTestCase
from django.test.client import Client
from django.test.utils import modify_settings, ove... | akatsoulas/mozillians | mozillians/common/tests/__init__.py | Python | bsd-3-clause | 2,319 |
from django.conf.urls.defaults import *
from piston.resource import Resource
from api_v2.system_handler import SystemHandler
from api_v2.networkadapter_handler import NetworkAdapterHandler
from api_v2.keyvalue_handler import KeyValueHandler
from api_v2.truth_handler import TruthHandler
from api_v2.dhcp_handler import D... | mozilla/inventory | api_v1/urls.py | Python | bsd-3-clause | 2,107 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from operator import itemgetter
import itertools
from datetime import datetime
def format_datetime(dt):
""" Format datetime.datetime object to make HAR validator happy """
return dt.isoformat() + 'Z'
def get_duration(start, end=None):
""" Re... | sunu/splash | splash/har/utils.py | Python | bsd-3-clause | 847 |
from __future__ import absolute_import, print_function
import six
from sentry.testutils import APITestCase
from sentry.testutils.helpers.datetime import iso_format, before_now
from sentry.models import GroupShare
class SharedGroupDetailsTest(APITestCase):
def test_simple(self):
self.login_as(user=self.u... | mvaled/sentry | tests/sentry/api/endpoints/test_shared_group_details.py | Python | bsd-3-clause | 2,593 |
#!/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.
''' Runs various chrome tests through valgrind_test.py.'''
import glob
import logging
import optparse
import os
import subprocess
... | andoma/pdfium | tools/drmemory/scripts/pdfium_tests.py | Python | bsd-3-clause | 16,135 |
from django.contrib import admin
from markedit.widgets import AdminMarkEdit
class MarkEditAdmin(admin.ModelAdmin):
class MarkEdit:
fields = ['text', ]
options = {}
class Media:
css = {'all': (
'//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/themes/smoothness/jquery-ui.cs... | SaptakS/pune.pycon.org | markedit/admin.py | Python | bsd-3-clause | 901 |
# -*- coding: utf-8 -*-
#
# Copyright 2008 Zuza Software Foundation
#
# This file is part of translate.
#
# translate 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 y... | staranjeet/fjord | vendor/packages/translate-toolkit/translate/search/indexing/CommonIndexer.py | Python | bsd-3-clause | 25,337 |
#!/usr/bin/python3
# Halide tutorial lesson 13: Tuples
# This lesson describes how to write Funcs that evaluate to multiple
# values.
# On linux, you can compile and run it like so:
# g++ lesson_13*.cpp -g -I ../include -L ../bin -lHalide -lpthread -ldl -o lesson_13 -std=c++11
# LD_LIBRARY_PATH=../bin ./lesson_13
# ... | kgnk/Halide | python_bindings/tutorial/lesson_13_tuples.py | Python | mit | 11,459 |
from _pytest.pytester import Pytester
def test_show_fixtures_and_test(
pytester: Pytester, dummy_yaml_custom_test: None
) -> None:
"""Verify that fixtures are not executed."""
pytester.makepyfile(
"""
import pytest
@pytest.fixture
def arg():
assert False
... | nicoddemus/pytest | testing/test_setupplan.py | Python | mit | 3,498 |
from authorize import Configuration
class BankAccount(object):
@staticmethod
def create(customer_id, params={}):
return Configuration.api.bank_account.create(customer_id, params)
@staticmethod
def details(customer_id, payment_id):
return Configuration.api.bank_account.details(custome... | aryeh/py-authorize | authorize/bank_account.py | Python | mit | 633 |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
import datetime
from frappe.utils import formatdate, fmt_money, flt, cstr, cint, format_datetime
from frappe.model.meta import get_field_currency, get_field_precisio... | elba7r/builder | frappe/utils/formatters.py | Python | mit | 2,313 |
# coding=utf-8
from kivy.lang import Builder
from kivy.properties import StringProperty, BooleanProperty, ObjectProperty, \
NumericProperty, ListProperty, OptionProperty
from kivy.uix.behaviors import ButtonBehavior
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.floatlayout import FloatLayout
from kivymd.ri... | PeterSurda/PyBitmessage | src/kivymd/grid.py | Python | mit | 5,125 |
from chainer.functions.array import concat
from chainer.functions.array import expand_dims
def stack(xs, axis=0):
"""Concatenate variables along a new axis.
Args:
xs (list of chainer.Variable): Variables to be concatenated.
axis (int): Axis of result along which variables are stacked.
Re... | kikusu/chainer | chainer/functions/array/stack.py | Python | mit | 481 |
"""
PymageJ Copyright (C) 2015 Jochem Smit
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 is distributed in the... | Jhsmit/PymageJ | tests/__init__.py | Python | gpl-2.0 | 730 |
import numpy
import theano
from theano.misc.gnumpy_utils import gnumpy_available
if not gnumpy_available:
from nose.plugins.skip import SkipTest
raise SkipTest("gnumpy not installed. Skip test related to it.")
from theano.misc.gnumpy_utils import (garray_to_cudandarray,
... | valexandersaulys/airbnb_kaggle_contest | venv/lib/python3.4/site-packages/Theano-0.7.0-py3.4.egg/theano/misc/tests/test_gnumpy_utils.py | Python | gpl-2.0 | 2,052 |
import os
import unittest
from ubuntutweak.janitor.mozilla_plugin import FirefoxCachePlugin
class TestJanitorPlugin(unittest.TestCase):
def setUp(self):
self.firefox_plugin = FirefoxCachePlugin()
def test_firefox_plugin(self):
self.assertTrue(os.path.expanduser('~/.mozilla/firefox/5tzbwjwa.de... | frdb194/ubuntu-tweak | tests/test_janitor_plugins.py | Python | gpl-2.0 | 409 |
#!/usr/bin/env python
import os, sys
SALVUS_ROOT=os.environ['SALVUS_ROOT']
sys.path.append(SALVUS_ROOT)
import admin
a = admin.Services('%s/conf/deploy_smc/'%SALVUS_ROOT, password='')
for x in a._hosts('hub', 'cd salvus/salvus; . smc-env; ./update',timeout=60):
print x
| haraldschilly/smc | src/scripts/update_hubs.py | Python | gpl-3.0 | 280 |
"""
cmdline drivers for unipen data set
"""
import cPickle
import os.path
import sys
import numpy as np
from dataset import DatFile
def read_file(input_name, output_name, box, to_array=True, to_csv=False):
dat = DatFile()
dat.read(open(input_name, 'rb'))
segments = ['nan, nan']
num_sequences = 5
... | Vidhyalakshimi/blog | Control/Tasks/Write/read_trajectory.py | Python | gpl-3.0 | 2,097 |
""" Unit tests for Time Series data type
:Author: Titiruck Nuntapramote (titiruck.nuntapramote@dfki.de)
:Created: 2011/04/23
"""
import unittest
if __name__ == '__main__':
import sys
import os
# The root of the code
file_path = os.path.dirname(os.path.abspath(__file__))
sys.path.append(file_path[:... | Crespo911/pyspace | pySPACE/tests/unittests/data_types/test_time_series.py | Python | gpl-3.0 | 3,589 |
import _surface
import chimera
try:
import chimera.runCommand
except:
pass
from VolumePath import markerset as ms
try:
from VolumePath import Marker_Set, Link
new_marker_set=Marker_Set
except:
from VolumePath import volume_path_dialog
d= volume_path_dialog(True)
new_marker_set= d.new_marker_set
marker_set... | batxes/4Cin | SHH_INV_models/SHH_INV_models_final_output_0.2_-0.1_10000/mtx1_models/SHH_INV_models19205.py | Python | gpl-3.0 | 17,572 |
#########################################################################
#
# Copyright (C) 2012 OpenPlans
#
# 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
#... | IMIO/imio.geonode.portal | geonode/layers/management/__init__.py | Python | gpl-3.0 | 1,791 |
# -*- coding: utf-8 -*-
"""
pygments.lexers.lisp
~~~~~~~~~~~~~~~~~~~~
Lexers for Lispy languages.
:copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, include, bygroups, words, default
from... | unreal666/outwiker | plugins/source/source/pygments/lexers/lisp.py | Python | gpl-3.0 | 143,585 |
#!/usr/bin/python
# Copyright (C) Vladimir Prus 2006.
# Distributed under the Boost Software License, Version 1.0. (See
# accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
# Tests for the target id resolution process.
from BoostBuild import Tester, List
# Create a temporary wo... | gorkinovich/DefendersOfMankind | dependencies/luabind/boost-build/test/resolution.py | Python | gpl-3.0 | 876 |
from alias import Alias
from source import Source, SourceUrlCouldNotBeRetrieved, SourceCouldNotParseTimeString
from venue import Venue
from sitting import Sitting
from entry import Entry
| hzj123/56th | pombola/hansard/models/__init__.py | Python | agpl-3.0 | 194 |
# -*- coding: utf-8 -*-
"""
End-to-end tests for the Account Settings page.
"""
from datetime import datetime
from unittest import skip
import six
from bok_choy.page_object import XSS_INJECTION
from pytz import timezone, utc
from common.test.acceptance.pages.common.auto_auth import FULL_NAME, AutoAuthPage
from comm... | edx-solutions/edx-platform | common/test/acceptance/tests/lms/test_account_settings.py | Python | agpl-3.0 | 19,924 |
"""SCons.Tool.aixf77
Tool-specific initialization for IBM Visual Age f77 Fortran compiler.
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.
"""
#
# __COPYRIGHT__
#
# Permission is hereby granted, free of charge, t... | lightmare/mapnik | scons/scons-local-4.1.0/SCons/Tool/aixf77.py | Python | lgpl-2.1 | 2,630 |
#!/usr/bin/env python
#pylint: disable=missing-docstring
####################################################################################################
# DO NOT MODIFY THIS HEADER #
# MOOSE - Multiphysics Object Oriented Simu... | liuwenf/moose | python/MooseDocs/tests/common/moose_app_syntax/test_MooseAppSyntax.py | Python | lgpl-2.1 | 8,374 |
#!/usr/bin/env python
from tempfile import TemporaryFile, SpooledTemporaryFile
import os, sys, re, socket, time, pickle, csv, uuid, subprocess, argparse, decimal, select, platform, signal
class Debugger:
"""
The Debugger class is the entry point to our stack tracing capabilities.
It determins which debugger to inhe... | joshua-cogliati-inl/moose | scripts/memory_logger.py | Python | lgpl-2.1 | 49,156 |
from __future__ import unicode_literals
import errno
import os
import socket
import time
import random
import re
from .common import FileDownloader
from ..compat import (
compat_str,
compat_urllib_error,
)
from ..utils import (
ContentTooShortError,
encodeFilename,
int_or_none,
sanitize_open,
... | rrooij/youtube-dl | youtube_dl/downloader/http.py | Python | unlicense | 15,515 |
# Copyright 2013-2016 DataStax, 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 writi... | Richard-Mathie/cassandra_benchmark | vendor/github.com/datastax/python-driver/tests/integration/cqlengine/query/test_named.py | Python | apache-2.0 | 15,782 |
#!/usr/bin/env python
#
# 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 "Li... | schaffino/impyla | dev/merge-pr.py | Python | apache-2.0 | 9,688 |
#!/usr/bin/python
#
# Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | coxmediagroup/googleads-python-lib | examples/dfp/v201411/order_service/update_orders.py | Python | apache-2.0 | 2,386 |
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# 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 ... | srajag/nova | nova/test.py | Python | apache-2.0 | 13,462 |
#!/usr/bin/env python
#
# 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
# "... | dcristoloveanu/qpid-proton | examples/python/db_ctrl.py | Python | apache-2.0 | 1,739 |
#
# Copyright 2013 Quantopian, 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 wr... | humdings/zipline | zipline/data/treasuries.py | Python | apache-2.0 | 3,414 |
#!/usr/bin/env python
#
# Copyright 2015 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 o... | cherba/apitools | apitools/gen/gen_client_lib.py | Python | apache-2.0 | 11,303 |
# 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... | mixturemodel-flow/tensorflow | tensorflow/contrib/framework/python/ops/variables.py | Python | apache-2.0 | 28,437 |
"""Add User
Revision ID: 5677ef75c712
Revises: 45e1cfacfc7d
Create Date: 2014-01-15 11:06:25.217408
"""
# revision identifiers, used by Alembic.
revision = '5677ef75c712'
down_revision = '45e1cfacfc7d'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.create_table(
'user',
sa.Co... | bowlofstew/changes | migrations/versions/5677ef75c712_add_user.py | Python | apache-2.0 | 679 |
#
# 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... | michalsenkyr/spark | python/pyspark/serializers.py | Python | apache-2.0 | 26,207 |
"""
Decision Tree Classification of photometry
------------------------------------------
Figure 9.13
Decision tree applied to the RR Lyrae data (see caption of figure 9.3 for
details). This example uses tree depths of 7 and 12. With all four colors,this
decision tree achieves a completeness of 0.569 and a contaminati... | eramirem/astroML | book_figures/chapter9/fig_rrlyrae_decisiontree.py | Python | bsd-2-clause | 4,685 |
# Copyright (c) 2009, 2012-2013, 2015 ARM Limited
# 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 implementation of t... | SanchayanMaity/gem5 | src/arch/arm/ArmSystem.py | Python | bsd-3-clause | 4,979 |
# BuildTarget: images/conceptPerformanceBestPracticesContextsGraphEditor.png
# BuildTarget: images/conceptPerformanceBestPracticesContextsImprovedStats.png
# BuildTarget: images/conceptPerformanceBestPracticesContextsStats.png
# BuildTarget: images/conceptPerformanceBestPracticesContextsViewer.png
# BuildTarget: images... | hradec/gaffer | doc/source/WorkingWithTheNodeGraph/PerformanceBestPractices/screengrab.py | Python | bsd-3-clause | 5,338 |
#!/usr/bin/python
from mod_pywebsocket import msgutil
import time
import urllib
def web_socket_do_extra_handshake(request):
msgutil._write(request, 'x')
time.sleep(2)
def web_socket_transfer_data(request):
msgutil._write(request, urllib.unquote(request.ws_location.split('?', 1)[1]).decode("string-escape"))
time... | operasoftware/presto-testo | wpt/websockets/websock_handlers/sleep_2_then_open_raw_wsh.py | Python | bsd-3-clause | 330 |
from __future__ import unicode_literals
import cgi
import codecs
import logging
import sys
from io import BytesIO
from threading import Lock
import warnings
from django import http
from django.conf import settings
from django.core import signals
from django.core.handlers import base
from django.core.urlresolvers impo... | DrMeers/django | django/core/handlers/wsgi.py | Python | bsd-3-clause | 9,435 |
from django.conf import settings
from django.conf.urls import include, patterns, url
from django.contrib import admin
from django.shortcuts import render
import autocomplete_light
import tower
from mozillians.common.monkeypatches import patch
# Funfactory monkeypatches customized to work with Django 1.7 admin
patch(... | chirilo/mozillians | mozillians/urls.py | Python | bsd-3-clause | 2,122 |
"""
.. todo::
WRITEME
"""
import logging
import numpy as np
plt = None
axes = None
from theano.compat.six.moves import xrange
import warnings
try:
import matplotlib.pyplot as plt
import matplotlib.axes
except (RuntimeError, ImportError) as matplotlib_exception:
warnings.warn("Unable to import matplotli... | JesseLivezey/plankton | pylearn2/utils/image.py | Python | bsd-3-clause | 16,346 |
import time
import datetime
from flask_admin.babel import lazy_gettext
class BaseFilter(object):
"""
Base filter class.
"""
def __init__(self, name, options=None, data_type=None):
"""
Constructor.
:param name:
Displayed name
:param opti... | sfpprxy/py-reminder | libs/model/filters.py | Python | bsd-3-clause | 8,753 |
"""
This file contains a minimal set of tests for compliance with the extension
array interface test suite, and should contain no other tests.
The test suite for the full functionality of the array is located in
`pandas/tests/arrays/`.
The tests in this file are inherited from the BaseExtensionTests, and only
minimal ... | rs2/pandas | pandas/tests/extension/test_period.py | Python | bsd-3-clause | 5,274 |
# -*- coding: utf-8 -*-
# Natural Language Toolkit: An Incremental Earley Chart Parser
#
# Copyright (C) 2001-2017 NLTK Project
# Author: Peter Ljunglöf <peter.ljunglof@heatherleaf.se>
# Rob Speer <rspeer@mit.edu>
# Edward Loper <edloper@gmail.com>
# Steven Bird <stevenbird1@gmail.com>
# ... | sdoran35/hate-to-hugs | venv/lib/python3.6/site-packages/nltk/parse/earleychart.py | Python | mit | 18,690 |
#!/usr/bin/env python
import sys
from os.path import dirname, abspath
sys.path.insert(0, dirname(abspath(__file__)))
from django.conf import settings
if not settings.configured:
settings.configure(
DATABASES={
'default': {
'ENGINE': 'django.db.backends.sqlite3',
... | iivvoo/nashvegas | runtests.py | Python | mit | 1,302 |
"""distutils.spawn
Provides the 'spawn()' function, a front-end to various platform-
specific functions for launching another program in a sub-process.
Also provides the 'find_executable()' to search the path for a given
executable name.
"""
# created 1999/07/24, Greg Ward
__revision__ = "$Id: spawn.py,v 1.10 2000/0... | atmark-techno/atmark-dist | user/python/Lib/distutils/spawn.py | Python | gpl-2.0 | 5,773 |
import os
import re
import time
import kodi
import log_utils # @UnusedImport
from salts_lib import utils2
from salts_lib.constants import FORCE_NO_MATCH
from salts_lib.constants import VIDEO_TYPES
__all__ = ['scraper', 'proxy', 'local_scraper', 'pw_scraper', 'watchseries_scraper', 'movie25_scraper', 'nitertv_scraper... | mrquim/mrquimrepo | repo/plugin.video.salts/scrapers/__init__.py | Python | gpl-2.0 | 8,416 |
#!/usr/bin/env python
"""
Updates the dependency lists in makefile.deps for all object files produced
from sources in src and subfolders, so that changing a header file always
leads to the recompilation of all the files depending on this header.
"""
import os, re, fnmatch, util2, update_vs, update_vs2008
pjo... | ibb-zimmers/betsynetpdf | sumatrapdf/scripts/update_dependencies.py | Python | gpl-3.0 | 4,222 |
# coding=utf-8
"""Tests for the keyword wizard."""
import unittest
from safe.definitions.constants import INASAFE_TEST
from safe.test.utilities import get_qgis_app
QGIS_APP, CANVAS, IFACE, PARENT = get_qgis_app(qsetting=INASAFE_TEST)
import os
import shutil
import unittest
from datetime import datetime
from safe.co... | lucernae/inasafe | safe/gui/tools/wizard/test/test_keyword_wizard.py | Python | gpl-3.0 | 116,135 |
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | ganeshrn/ansible | test/units/playbook/role/test_role.py | Python | gpl-3.0 | 13,819 |
from mod_pywebsocket import msgutil
def web_socket_do_extra_handshake(request):
# must set request.ws_protocol to the selected version from ws_requested_protocols
request.ws_protocol = request.ws_requested_protocols[0]
if (request.ws_protocol == 'error'):
raise ValueError('Error')
pass
def web_socket_t... | Yukarumya/Yukarum-Redfoxes | dom/base/test/file_websocket_basic_wsh.py | Python | mpl-2.0 | 773 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# Account Cut-off Prepaid module for OpenERP
# Copyright (C) 2013 Akretion (http://www.akretion.com)
# @author Alexis de Lattre <alexis.delattre@akretion.com>
#
# This program is free software: you can... | xpansa/account-closing | account_cutoff_prepaid/__openerp__.py | Python | agpl-3.0 | 1,816 |
# -*- Mode: Python -*-
#
# Author: Sam Rushing <rushing@nightmare.com>
# Copyright 1996-2000 by Sam Rushing
# All Rights Reserved.
#
RCS_ID = '$Id: redirecting_handler.py,v 1.4 2002/03/20 17:37:48 amk Exp $'
import re
import counter
class redirecting_handle... | XiaoMi/minos | supervisor/supervisor/medusa/redirecting_handler.py | Python | apache-2.0 | 1,396 |
# coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
from colle... | landism/pants | tests/python/pants_test/backend/jvm/tasks/jvm_compile/java/test_cache_compile_integration.py | Python | apache-2.0 | 9,196 |
# Copyright (c) 2015-2016 Claudiu Popa <pcmanticore@gmail.com>
# Copyright (c) 2016 Cara Vinson <ceridwenv@gmail.com>
# Licensed under the LGPL: https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html
# For details: https://github.com/PyCQA/astroid/blob/master/COPYING.LESSER
"""Astroid hooks for dateutil"""
impor... | arju88nair/projectCulminate | venv/lib/python3.5/site-packages/astroid/brain/brain_dateutil.py | Python | apache-2.0 | 714 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2015 clowwindy
#
# 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 u... | qingran001/bushu | utils/autoban.py | Python | apache-2.0 | 2,219 |
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Test methods in twisted.internet.threads and reactor thread APIs.
"""
import sys, os, time
from twisted.trial import unittest
from twisted.internet import reactor, defer, interfaces, threads, protocol, error
from twisted.python import fail... | nlloyd/SubliminalCollaborator | libs/twisted/test/test_threads.py | Python | apache-2.0 | 13,048 |
# 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... | airbnb/superset | superset/migrations/versions/c5756bec8b47_time_grain_sqla.py | Python | apache-2.0 | 2,191 |
from __future__ import print_function
import re
INDENT = 1
NAME = 2
INHERIT = 3
ARGUMENTS = 3
PASS=' pass\n'
def pythonize_arguments(arg_str):
"""
Remove types from function arguments in cython
"""
out_args = []
# If there aren't any arguments return the empty string
if arg_str is None:
... | clab/cnn | doc/source/doc_util.py | Python | apache-2.0 | 3,948 |
from ..libc.scanf import scanf
class __isoc99_scanf(scanf):
pass
| chubbymaggie/angr | angr/procedures/glibc/scanf.py | Python | bsd-2-clause | 71 |
# (C) Copyright 2014 Eucalyptus Systems, Inc.
#
# Redistribution and use of this software 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 conditions a... | vasiliykochergin/euca2ools | euca2ools/commands/euimage/pack/__init__.py | Python | bsd-2-clause | 1,405 |
from itertools import count
from .compatibility import zip_longest
from .core import (istask, get_dependencies, subs, toposort, flatten,
reverse_dict, add, inc, ishashable, preorder_traversal)
from .rewrite import END
from toolz import identity
def cull(dsk, keys):
""" Return new dask with only... | jayhetee/dask | dask/optimize.py | Python | bsd-3-clause | 13,546 |
"""
python generate_sparsetools.py
Generate manual wrappers for C++ sparsetools code.
Type codes used:
'i': integer scalar
'I': integer array
'T': data array
'B': boolean array
'V': std::vector<integer>*
'W': std::vector<data>*
'*': indicates that the next argument is an output arg... | anntzer/scipy | scipy/sparse/_generate_sparsetools.py | Python | bsd-3-clause | 12,609 |
# Test generation of a WPS request from input arguments.
# The specific request involves a FeatureWeightedGridStatisticsAlgorithm process over a WFS feature.
from tests.utils import resource_file, compare_xml
from owslib.wps import WPSExecution, WFSFeatureCollection, WFSQuery
from owslib.etree import etree
def test_... | tomkralidis/OWSLib | tests/test_wps_request2.py | Python | bsd-3-clause | 2,182 |
# coding: utf-8
import numpy as np
from ._draw import _coords_inside_image
def _ellipse_in_shape(shape, center, radiuses):
"""Generate coordinates of points within ellipse bounded by shape."""
y, x = np.ogrid[0:float(shape[0]), 0:float(shape[1])]
cy, cx = center
ry, rx = radiuses
distances = ((y -... | Britefury/scikit-image | skimage/draw/draw.py | Python | bsd-3-clause | 5,187 |
# Data Preprocessing
# Importing the libraries
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
# Importing the dataset
dataset = pd.read_csv('Data.csv')
X = dataset.iloc[:, :-1].values
y = dataset.iloc[:, 3].values
# Taking care of missing data
from sklearn.preprocessing import Imputer
imputer... | xavialex/Deep-Learning-Templates | Volume 1 - Supervised Deep Learning/Part 1 - Artificial Neural Networks (ANN)/Section 4 - Building an ANN/categorical_data.py | Python | mit | 859 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | lmazuel/autorest | src/generator/AutoRest.Python.Azure.Tests/Expected/AcceptanceTests/AzureSpecials/fixtures/acceptancetestsazurespecials/auto_rest_azure_special_parameters_test_client.py | Python | mit | 6,304 |
# This is a virtual module that is entirely implemented server side
# Copyright: (c) 2012, Ansible Project
# 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
DOCUMENTATION = r'''
---
modul... | indrajitr/ansible | lib/ansible/modules/raw.py | Python | gpl-3.0 | 3,103 |
# -*- test-case-name: twisted.web.test.test_httpauth -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
A guard implementation which supports HTTP header-based authentication
schemes.
If no I{Authorization} header is supplied, an anonymous login will be
attempted by using a L{Anonymous} c... | Architektor/PySnip | venv/lib/python2.7/site-packages/twisted/web/_auth/wrapper.py | Python | gpl-3.0 | 8,356 |
# -*- coding: utf-8 -*-
# Copyright 2016 Christoph Reiter
#
# 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... | nwokeo/supysonic | venv/lib/python2.7/site-packages/mutagen/_senf/_temp.py | Python | agpl-3.0 | 2,805 |
# 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... | zhaochao/fuel-web | fuel_agent/fuel_agent/openstack/common/importutils.py | Python | apache-2.0 | 2,365 |
# -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... | adamhaney/airflow | airflow/contrib/operators/gcs_operator.py | Python | apache-2.0 | 4,816 |
# 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... | srome/jacksearch | im2txt/run_inference.py | Python | apache-2.0 | 3,047 |
# Copyright (c) 2015-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
#
# If you are using a c... | Shenil/PathPicker | src/repos.py | Python | bsd-3-clause | 566 |
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import copy
import os.path
import re
class ParseException(Exception):
"""Thrown when data in the model is invalid.
"""
def __init__(self, parent, ... | gx1997/chrome-loongson | tools/json_schema_compiler/model.py | Python | bsd-3-clause | 13,227 |
# -*- coding: utf-8 -*-
"""
wechatpy.client.jsapi
~~~~~~~~~~~~~~~~~~~~
This module provides some APIs for JS SDK
:copyright: (c) 2014 by messense.
:license: MIT, see LICENSE for more details.
"""
from __future__ import absolute_import, unicode_literals
import time
from wechatpy.utils import WeCha... | tdautc19841202/wechatpy | wechatpy/client/api/jsapi.py | Python | mit | 1,766 |
# -*- coding: utf-8 -*-
# -------------------------------------------------------------------------------
# Name: sfp_websvr
# Purpose: SpiderFoot plug-in for scanning retreived content by other
# modules (such as sfp_spider) and identifying web servers used
#
# Author: Steve Mical... | Wingless-Archangel/spiderfoot | modules/sfp_websvr.py | Python | gpl-2.0 | 3,664 |
# Copyright (C) 2007-2010 Samuel Abels.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2, as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANT... | gnperumal/exscript | src/Exscript/util/mail.py | Python | gpl-2.0 | 14,239 |
# -*- coding: utf-8 -*-
# Copyright(C) 2013 Florent Fourcot
#
# This file is part of weboob.
#
# weboob 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 o... | sputnick-dev/weboob | weboob/applications/boobsize/boobsize.py | Python | agpl-3.0 | 7,094 |
'''Autogenerated by xml_generate script, do not edit!'''
from OpenGL import platform as _p, arrays
# Code generation uses this
from OpenGL.raw.GL import _types as _cs
# End users want this...
from OpenGL.raw.GL._types import *
from OpenGL.raw.GL import _errors
from OpenGL.constant import Constant as _C
import ctypes
_... | stack-of-tasks/rbdlpy | tutorial/lib/python2.7/site-packages/OpenGL/raw/GL/EXT/texture.py | Python | lgpl-3.0 | 2,667 |
#!/usr/bin/python -u
# Copyright (c) 2010-2012 OpenStack, 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 applica... | Mirantis/swift-encrypt | test/probe/test_object_async_update.py | Python | apache-2.0 | 2,679 |
# Copyright 2019 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 ... | theflofly/tensorflow | tensorflow/contrib/tpu/python/tpu/datasets.py | Python | apache-2.0 | 989 |
'''
Harvester for the Iowa Research Online for the SHARE project
Example API call: http://ir.uiowa.edu/do/oai/?verb=ListRecords&metadataPrefix=oai_dc
'''
from __future__ import unicode_literals
from scrapi.base import OAIHarvester
class IowaresearchHarvester(OAIHarvester):
short_name = 'iowaresearch'
long_n... | fabianvf/scrapi | scrapi/harvesters/iowaresearch.py | Python | apache-2.0 | 520 |
__author__ = 'fjlopez'
| Swaathik/cellbase | clients/python/lib/exceptions/__init__.py | Python | apache-2.0 | 23 |
# Copyright 2021 The 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 writ... | ejona86/grpc | src/python/grpcio_tests/tests/admin/test_admin.py | Python | apache-2.0 | 2,110 |
# 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 applicable ... | ghchinoy/tensorflow | tensorflow/python/distribute/cluster_resolver/gce_cluster_resolver.py | Python | apache-2.0 | 6,761 |
#!/usr/bin/env python
# vim: ai ts=4 sts=4 et sw=4 coding=utf-8
import os, glob
from django.core.management.base import BaseCommand
from django.core.management import call_command
from django.utils.translation import ugettext_lazy
class Command(BaseCommand):
help = ugettext_lazy("Import ODK forms and instances."... | GeoODK/formhub | odk_viewer/management/commands/import.py | Python | bsd-2-clause | 525 |
from socket import *
from struct import unpack
from time import ctime, sleep
from sys import argv
argv = argv[1:]
if len(argv) == 0:
argv = [ 'time-nw.nist.gov' ]
s = socket(AF_INET, SOCK_DGRAM)
s.settimeout(5.0)
for server in argv:
print server, ":",
try:
s.sendto('', 0, (server, 37))
t = lon... | uthcode/learntosolveit | languages/python/networking_udp_time.py | Python | bsd-3-clause | 544 |
#################################################################
# seSceneGraphExplorer.py
# Originally from SceneGraphExplorer.py
# Altered by Yi-Hong Lin, yihhongl@andrew.cmu.edu, 2004
#
# we need a customized SceneGraphExplorer.
#
# Do forget to check the seTree.
#
##################################################... | chandler14362/panda3d | contrib/src/sceneeditor/seSceneGraphExplorer.py | Python | bsd-3-clause | 7,053 |