repo_name
stringlengths
5
100
path
stringlengths
4
294
copies
stringclasses
990 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
duyetdev/openerp-6.1.1
openerp/addons/project/wizard/project_task_reevaluate.py
9
3451
# -*- 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
zdszxp/gamesrc
Trdlib/src/boost_1_60_0/libs/numeric/odeint/performance/plot_result.py
43
2225
""" Copyright 2011-2014 Mario Mulansky Copyright 2011-2014 Karsten Ahnert 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) """ import numpy as np from matplotlib import pyplot as plt plt.rc("font", size=16) def g...
gpl-3.0
kustodian/ansible
lib/ansible/plugins/cliconf/frr.py
29
7774
# # (c) 2018 Red Hat 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 # (at your option) any later version. # # Ansible is d...
gpl-3.0
hottwaj/django
django/contrib/gis/gdal/geomtype.py
297
3228
from django.contrib.gis.gdal.error import GDALException from django.utils import six class OGRGeomType(object): "Encapulates OGR Geometry Types." wkb25bit = -2147483648 # Dictionary of acceptable OGRwkbGeometryType s and their string names. _types = {0: 'Unknown', 1: 'Point', ...
bsd-3-clause
xiandiancloud/ji
lms/djangoapps/instructor/features/data_download.py
34
3374
""" Define steps for instructor dashboard - data download tab acceptance tests. """ # pylint: disable=C0111 # pylint: disable=W0621 from lettuce import world, step from nose.tools import assert_in, assert_regexp_matches # pylint: disable=E0611 from terrain.steps import reload_the_page from splinter.request_handler.r...
agpl-3.0
supersam654/backbone-tracer
writers.py
1
1449
import json from threading import Lock import struct def _to_bin(trace): source = trace['source'] destination = trace['destination'] oneDimension = [] for hop in trace['hops']: count, ip, time = hop oneDimension.extend([ip, count, time]) format_str = 'QQ' + 'QII' * len(trace['hops']...
gpl-2.0
barbarubra/Don-t-know-What-i-m-doing.
python/src/Lib/test/test_htmlparser.py
56
10661
"""Tests for HTMLParser.py.""" import HTMLParser import pprint import unittest from test import test_support class EventCollector(HTMLParser.HTMLParser): def __init__(self): self.events = [] self.append = self.events.append HTMLParser.HTMLParser.__init__(self) def get_events(self): ...
apache-2.0
TimYi/django
tests/messages_tests/test_api.py
337
1453
from django.contrib import messages from django.test import RequestFactory, SimpleTestCase class DummyStorage(object): """ dummy message-store to test the api methods """ def __init__(self): self.store = [] def add(self, level, message, extra_tags=''): self.store.append(message) ...
bsd-3-clause
louietsai/python-for-android
python-modules/pybluez/examples/simple/rfcomm-client.py
67
1148
# file: rfcomm-client.py # auth: Albert Huang <albert@csail.mit.edu> # desc: simple demonstration of a client application that uses RFCOMM sockets # intended for use with rfcomm-server # # $Id: rfcomm-client.py 424 2006-08-24 03:35:54Z albert $ from bluetooth import * import sys addr = None if len(sys.argv) < ...
apache-2.0
gborri/SickRage
sickrage/libs/trakt/interfaces/users/lists/__init__.py
3
2046
from __future__ import absolute_import, division, print_function import requests from trakt.core.helpers import clean_username from trakt.interfaces.base import Interface # Import child interfaces from trakt.interfaces.users.lists.list_ import UsersListInterface # noqa: I100 from trakt.mapper import ListMapper __all...
gpl-3.0
tensorflow/tfx
tfx/types/artifact_test.py
1
27046
# Copyright 2019 Google LLC. 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
EnTeQuAk/nms
nms/utils/dialogs.py
1
1883
#-*- coding: utf-8 -*- import gtk def _clear_gtk_entry_on_activate_event(widget): if widget.get_text(): widget.set_text('') def new_recipient_dialog(title, description): dialog = gtk.Dialog(title=title) dialog.set_modal(True) dialog.set_position(gtk.WIN_POS_CENTER) dialog.set_border_widt...
bsd-3-clause
airbnb/airflow
tests/providers/google/cloud/transfers/test_presto_to_gcs.py
7
12362
# # 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...
apache-2.0
cauchycui/scikit-learn
sklearn/ensemble/tests/test_gradient_boosting.py
127
37672
""" Testing for the gradient boosting module (sklearn.ensemble.gradient_boosting). """ import warnings import numpy as np from sklearn import datasets from sklearn.base import clone from sklearn.ensemble import GradientBoostingClassifier from sklearn.ensemble import GradientBoostingRegressor from sklearn.ensemble.grad...
bsd-3-clause
junhuac/MQUIC
depot_tools/external_bin/gsutil/gsutil_4.15/gsutil/gslib/cat_helper.py
28
3005
# -*- coding: utf-8 -*- # 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 require...
mit
shiora/The-Perfect-Pokemon-Team-Balancer
libs/env/Lib/site-packages/sqlalchemy/orm/query.py
75
131823
# orm/query.py # Copyright (C) 2005-2014 the SQLAlchemy authors and contributors <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """The Query class and support. Defines the :class:`.Query` class, the central construct...
gpl-2.0
Kryz/sentry
tests/sentry/web/frontend/test_create_organization.py
8
1195
from __future__ import absolute_import from django.core.urlresolvers import reverse from exam import fixture from sentry.models import ( Organization, OrganizationMember, OrganizationMemberType ) from sentry.testutils import TestCase class CreateOrganizationTest(TestCase): @fixture def path(self): ...
bsd-3-clause
HyperloopTeam/FullOpenMDAO
lib/python2.7/site-packages/Pyevolve-0.6-py2.7.egg/pyevolve/__init__.py
1
1444
""" :mod:`pyevolve` -- the main pyevolve namespace ================================================================ This is the main module of the pyevolve, every other module is above this namespace, for example, to import :mod:`Mutators`: >>> from pyevolve import Mutators """ __all__ = ["Consts", "Crossovers",...
gpl-2.0
frank10704/DF_GCS_W
MissionPlanner-master/Lib/httplib.py
50
49485
"""HTTP/1.1 client library <intro stuff goes here> <other stuff, too> HTTPConnection goes through a number of "states", which define when a client may legally make another request or fetch the response for a particular request. This diagram details these state transitions: (null) | | HTTPC...
gpl-3.0
yasoob/youtube-dl-GUI
youtube_dl/extractor/pinterest.py
3
7598
# coding: utf-8 from __future__ import unicode_literals import json import re from .common import InfoExtractor from ..compat import compat_str from ..utils import ( determine_ext, float_or_none, int_or_none, try_get, unified_timestamp, url_or_none, ) class PinterestBaseIE(InfoExtractor): ...
mit
firebase/firebase-admin-python
integration/test_ml.py
1
15310
# Copyright 2020 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
legalsylvain/OpenUpgrade
addons/mail/tests/test_invite.py
187
2616
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2012-TODAY OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
agpl-3.0
delete/estofadora
estofadora/core/views.py
1
2781
import datetime from django.shortcuts import render, redirect, get_object_or_404 from django.core.urlresolvers import reverse from django.contrib.auth.decorators import login_required from django.contrib import messages from estofadora.item.models import Item, Picture from estofadora.bills.models import Bill from .f...
mit
wuhengzhi/chromium-crosswalk
third_party/logilab/logilab/common/changelog.py
90
8075
# copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This file is part of logilab-common. # # logilab-common is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as publ...
bsd-3-clause
phillip-hopper/tools
uwb/uwb_usfm_rename.py
2
1374
#!/usr/bin/env python # -*- coding: utf8 -*- # # Copyright (c) 2014 unfoldingWord # http://creativecommons.org/licenses/MIT/ # See LICENSE file for details. # # Contributors: # Jesse Griffin <jesse@distantshores.org> """ This script renames the DokuWiki export UTB files to appropriate USFM filenames. Requires t...
mit
napoler/t-drupal-module
modules/t_google_play_download/gplay-cli/ext_libs/androguard/core/bytecodes/jvm_generate.py
10
3707
# This file is part of Androguard. # # Copyright (C) 2012 Anthony Desnos <desnos at t0t0.fr> # All rights reserved. # # Androguard is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of the...
apache-2.0
eduNEXT/edx-platform
openedx/core/djangoapps/content_libraries/migrations/0001_initial.py
4
2896
# Generated by Django 1.11.23 on 2019-08-28 20:27 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('o...
agpl-3.0
sergei-maertens/django
tests/template_tests/filter_tests/test_wordcount.py
521
1107
from django.template.defaultfilters import wordcount from django.test import SimpleTestCase from django.utils.safestring import mark_safe from ..utils import setup class WordcountTests(SimpleTestCase): @setup({'wordcount01': '{% autoescape off %}{{ a|wordcount }} {{ b|wordcount }}{% endautoescape %}'}) def ...
bsd-3-clause
intgr/django
tests/shell/tests.py
56
2372
import sys import unittest from unittest import mock from django import __version__ from django.core.management import CommandError, call_command from django.test import SimpleTestCase from django.test.utils import captured_stdin, captured_stdout, patch_logger class ShellCommandTestCase(SimpleTestCase): def tes...
bsd-3-clause
0rC0/DBS
ueb7/aufgabe4.py
1
4406
#!/usr/bin/python # -*- coding: utf-8 -*- # Quellcode auf: https://github.com/0rC0/DBS/tree/master/ueb7 # imports from __future__ import absolute_import, print_function from tweepy import OAuthHandler from tweepy import Stream from tweepy.streaming import StreamListener import psycopg2 import csv import json class M...
gpl-3.0
simone/django-gb
django/db/backends/postgresql_psycopg2/introspection.py
81
9244
from __future__ import unicode_literals from django.db.backends import BaseDatabaseIntrospection, FieldInfo from django.utils.encoding import force_text class DatabaseIntrospection(BaseDatabaseIntrospection): # Maps type codes to Django Field types. data_types_reverse = { 16: 'BooleanField', ...
bsd-3-clause
sestrella/ansible
test/units/modules/network/aireos/aireos_module.py
52
2520
# (c) 2016 Red Hat 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 # (at your option) any later version. # # Ansible is dis...
gpl-3.0
kiwifb/numpy
tools/win32build/misc/x86analysis.py
29
5885
#! /usr/bin/env python # Last Change: Sat Mar 28 02:00 AM 2009 J # Try to identify instruction set used in binary (x86 only). This works by # checking the assembly for instructions specific to sse, etc... Obviously, # this won't work all the times (for example, if some instructions are used # only after proper detecti...
bsd-3-clause
etetoolkit/ete
ete3/tools/ete.py
2
9846
#!/usr/bin/env python # #START_LICENSE########################################################### # # # This file is part of the Environment for Tree Exploration program # (ETE). http://etetoolkit.org # # ETE is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public Licens...
gpl-3.0
alexthered/kienhoc-platform
lms/djangoapps/shoppingcart/migrations/0003_auto__del_field_orderitem_line_cost.py
182
8538
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Deleting field 'OrderItem.line_cost' db.delete_column('shoppingcart_orderitem', 'line_cost') def back...
agpl-3.0
google/tf-quant-finance
tf_quant_finance/black_scholes/vanilla_prices_test.py
1
32345
# Lint as: python3 # Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
apache-2.0
chjw8016/GreenOdoo7-haibao
openerp/addons/account_test/report/account_test_report.py
44
3637
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved # $Id$ # # This program is free software: you can redistribute it and/or modify #...
mit
with-git/tensorflow
tensorflow/python/kernel_tests/multinomial_op_big_test.py
86
3462
# 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...
apache-2.0
Xzya/CodeAbbeySolutions
VowelCount.py
1
1250
#input # 19 # fp rffo txcrg wwxryaah skl vf boaa fun awx qed io eubztskcp # pwwqxdoaxcot jmgsyktanxbn aeipa wklblmy oou hv xrt pubki # h fwz jlsdytfch ecswig nidurekeltulhlubvbubk # opt z yvfkxunhb ddrsvtasiianpuflvxkiyqzl wnvfvip # hiqjvtmvjcz tsdzzaxkbveibobwbifgt bp eypiajz xstwdush ak # wsmce ugijkdyndp ...
mit
carsongee/edx-platform
common/lib/capa/capa/capa_problem.py
21
33285
# # File: capa/capa_problem.py # # Nomenclature: # # A capa Problem is a collection of text and capa Response questions. # Each Response may have one or more Input entry fields. # The capa problem may include a solution. # """ Main module which shows problems (of "capa" type). This is used by capa_module. """ from ...
agpl-3.0
schleichdi2/OPENNFR-6.0-CORE
bitbake/lib/bb/cooker.py
1
91318
#!/usr/bin/env python # ex:ts=4:sw=4:sts=4:et # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- # # Copyright (C) 2003, 2004 Chris Larson # Copyright (C) 2003, 2004 Phil Blundell # Copyright (C) 2003 - 2005 Michael 'Mickey' Lauer # Copyright (C) 2005 Holger Hans Peter Freyther # Copyright (C) 20...
gpl-2.0
kushG/osf.io
framework/transactions/handlers.py
34
2780
# -*- coding: utf-8 -*- import httplib import logging from flask import request, current_app from pymongo.errors import OperationFailure from framework.transactions import utils, commands, messages from website import settings LOCK_ERROR_CODE = httplib.BAD_REQUEST NO_AUTO_TRANSACTION_ATTR = '_no_auto_transaction'...
apache-2.0
kirca/odoo
addons/account_cancel/__init__.py
702
1046
# -*- 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
gimoh/ansible-modules-core
files/file.py
22
16116
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, 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...
gpl-3.0
sidzan/netforce
netforce_stock/netforce_stock/models/stock_barcode_item.py
4
1662
# Copyright (c) 2012-2015 Netforce Co. Ltd. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publ...
mit
mbayon/TFG-MachineLearning
venv/lib/python3.6/site-packages/sklearn/kernel_ridge.py
48
6731
"""Module :mod:`sklearn.kernel_ridge` implements kernel ridge regression.""" # Authors: Mathieu Blondel <mathieu@mblondel.org> # Jan Hendrik Metzen <jhm@informatik.uni-bremen.de> # License: BSD 3 clause import numpy as np from .base import BaseEstimator, RegressorMixin from .metrics.pairwise import pairwise...
mit
lokeshjindal15/pd-gem5
src/arch/x86/isa/insts/simd64/integer/data_transfer/move.py
65
2969
# 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...
bsd-3-clause
appapantula/scikit-learn
examples/cluster/plot_adjusted_for_chance_measures.py
286
4353
""" ========================================================== Adjustment for chance in clustering performance evaluation ========================================================== The following plots demonstrate the impact of the number of clusters and number of samples on various clustering performance evaluation me...
bsd-3-clause
tianweizhang/nova
nova/tests/api/openstack/compute/contrib/test_admin_password.py
8
4196
# Copyright 2011 OpenStack Foundation # Copyright 2013 IBM Corp. # 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/LIC...
apache-2.0
Jgarcia-IAS/localizacion
openerp/addons-extra/odoo-pruebas/odoo-server/addons/hr_recruitment/report/hr_recruitment_report.py
325
4836
# -*- 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
TeslaProject/external_chromium_org
chrome/common/extensions/docs/server2/app_yaml_helper.py
78
4676
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import logging from extensions_paths import APP_YAML _APP_YAML_CONTAINER = ''' application: chrome-apps-doc version: %s runtime: python27 api_version: 1 t...
bsd-3-clause
bittorrent/bigcouch
couchjs/scons/scons-local-2.0.1/SCons/Tool/packaging/__init__.py
61
10760
"""SCons.Tool.Packaging SCons Packaging Tool. """ # # 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 in the ...
apache-2.0
nickleefly/youtube-dl
youtube_dl/extractor/motherless.py
26
4350
from __future__ import unicode_literals import datetime import re from .common import InfoExtractor from ..utils import ( ExtractorError, str_to_int, unified_strdate, ) class MotherlessIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?motherless\.com/(?:g/[a-z0-9_]+/)?(?P<id>[A-Z0-9]+)' _TEST...
unlicense
abagh0703/RetailTrail
flask/lib/python2.7/site-packages/whoosh/qparser/default.py
53
17071
# Copyright 2011 Matt Chaput. 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 notice, # this list of conditions and the...
mit
botland/bitcoin
qa/rpc-tests/invalidateblock.py
146
3110
#!/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. # # Test InvalidateBlock code # from test_framework.test_framework import BitcoinTestFramework from test_fram...
mit
elventear/ansible
lib/ansible/modules/windows/win_reg_stat.py
20
4331
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2016, Ansible, 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 # (at your o...
gpl-3.0
nguyenhongson03/scrapy
scrapy/utils/log.py
108
6012
# -*- coding: utf-8 -*- import sys import logging import warnings from logging.config import dictConfig from twisted.python.failure import Failure from twisted.python import log as twisted_log import scrapy from scrapy.settings import overridden_settings, Settings from scrapy.exceptions import ScrapyDeprecationWarni...
bsd-3-clause
p0psicles/SickGear
lib/unidecode/x07a.py
252
4669
data = ( 'Xi ', # 0x00 'Kao ', # 0x01 'Lang ', # 0x02 'Fu ', # 0x03 'Ze ', # 0x04 'Shui ', # 0x05 'Lu ', # 0x06 'Kun ', # 0x07 'Gan ', # 0x08 'Geng ', # 0x09 'Ti ', # 0x0a 'Cheng ', # 0x0b 'Tu ', # 0x0c 'Shao ', # 0x0d 'Shui ', # 0x0e 'Ya ', # 0x0f 'Lun ', # 0x10 'Lu '...
gpl-3.0
SecurityCompass/libcloud
libcloud/storage/drivers/ktucloud.py
60
1946
# 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
chroust/torrentflux
html/TF_BitTornado/BitTornado/CreateIcons.py
17
5369
# Generated from bt_MakeCreateIcons - 05/10/04 22:15:33 # T-0.3.0 (BitTornado) from binascii import a2b_base64 from zlib import decompress from os.path import join icons = { "icon_bt.ico": "eJyt1K+OFEEQx/FaQTh5GDRZhSQpiUHwCrxCBYXFrjyJLXeXEARPsZqUPMm+" + "AlmP+PGtngoLDji69zMz2zt/qqtr1mxHv7621d4+Mnv...
gpl-2.0
geoscript/geoscript-py
geoscript/layer/io/json.py
1
1550
import sys from org.geotools.geojson.feature import FeatureJSON from geoscript.util import doOutput, doInput from geoscript.layer.cursor import Cursor _fjson = FeatureJSON() def writeJSON(obj, output=sys.stdout): """ Writes a :class:`Layer <geoscript.layer.layer.Layer>` object as GeoJSON. This method also acce...
mit
nxnfufunezn/servo
tests/wpt/harness/wptrunner/wptmanifest/tests/test_serializer.py
131
4691
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. import unittest from cStringIO import StringIO from .. import parser, serializer class TokenizerTest(unittest.TestCa...
mpl-2.0
mrry/tensorflow
tensorflow/contrib/distributions/python/kernel_tests/shape_test.py
20
16020
# 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
ammarkhann/FinalSeniorCode
lib/python2.7/site-packages/numpy/lib/tests/test_ufunclike.py
188
2024
from __future__ import division, absolute_import, print_function import numpy.core as nx import numpy.lib.ufunclike as ufl from numpy.testing import ( run_module_suite, TestCase, assert_, assert_equal, assert_array_equal ) class TestUfunclike(TestCase): def test_isposinf(self): a = nx.array([nx....
mit
LICEF/edx-platform
common/djangoapps/embargo/middleware.py
18
4226
"""Middleware for embargoing site and courses. IMPORTANT NOTE: This code WILL NOT WORK if you have a misconfigured proxy server. If you are configuring embargo functionality, or if you are experiencing mysterious problems with embargoing, please check that your reverse proxy is setting any of the well known client IP...
agpl-3.0
aidanhs/servo
tests/wpt/harness/wptrunner/executors/base.py
33
10114
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. import hashlib import json import os import traceback import urlparse from abc import ABCMeta, abstractmethod from ..te...
mpl-2.0
ChinaQuants/bokeh
bokeh/compat/mplexporter/utils.py
35
11620
""" Utility Routines for Working with Matplotlib Objects ==================================================== """ import itertools import io import base64 import numpy as np import warnings import matplotlib from matplotlib.colors import colorConverter from matplotlib.path import Path from matplotlib.markers import ...
bsd-3-clause
mattcaldwell/django-cms
cms/plugins/picture/migrations/0003_freeze.py
49
6589
# -*- coding: utf-8 -*- from south.db import db from django.db import models from cms.plugins.picture.models import * class Migration: def forwards(self, orm): "Write your forwards migration here" def backwards(self, orm): "Write your backwards migration here" models = { 'cm...
bsd-3-clause
hsr-ba-fs15-dat/python-social-auth
social/tests/backends/test_stocktwits.py
91
1658
import json from social.tests.backends.oauth import OAuth2Test class StocktwitsOAuth2Test(OAuth2Test): backend_path = 'social.backends.stocktwits.StocktwitsOAuth2' user_data_url = 'https://api.stocktwits.com/api/2/account/verify.json' expected_username = 'foobar' access_token_body = json.dumps({ ...
bsd-3-clause
mgoulish/qpid-dispatch
tests/system_tests_delivery_counts.py
1
60187
# # 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...
apache-2.0
sillywilly42/simian
src/simian/mac/admin/misc.py
1
9362
#!/usr/bin/env python # # Copyright 2016 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 require...
apache-2.0
n0trax/ansible
lib/ansible/modules/cloud/rackspace/rax_mon_notification.py
29
5164
#!/usr/bin/python # Copyright: 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 ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], ...
gpl-3.0
marratj/ansible
lib/ansible/modules/network/netscaler/netscaler_cs_policy.py
27
9487
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2017 Citrix Systems # 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
neoareslinux/neutron
neutron/extensions/securitygroup.py
17
13509
# Copyright (c) 2012 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...
apache-2.0
jaxalbert/PythonExperiments
StackList.py
1
1113
#!/usr/bin/env python from DCList import DCList class StackList(DCList): """ StackList Class """ def __init__(self): """ Constructor Calls init from DCList """ DCList.__init__(self) def push(self, data): """ Push an object onto the StackList :param da...
mit
vukae/eve-wspace
evewspace/account/utils.py
16
1522
# Eve W-Space # Copyright (C) 2013 Andrew Austin and other contributors # # 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...
gpl-3.0
rzeszut/cpp-synchronized
thirdparty/gtest-1.7.0/test/gtest_catch_exceptions_test.py
2139
9901
#!/usr/bin/env python # # Copyright 2010 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 o...
mit
liamgh/liamgreenhughes-sl4a-tf101
python/gdata/samples/base/baseQueryExample.py
94
1680
#!/usr/bin/python # # Copyright (C) 2007 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 ...
apache-2.0
chrisndodge/edx-platform
openedx/core/djangoapps/user_api/course_tag/api.py
174
1940
""" A service-like user_info interface. Could be made into an http API later, but for now just in-process. Exposes global and per-course key-value pairs for users. Implementation note: Stores global metadata using the UserPreference model, and per-course metadata using the UserCourseTag model. """ from ..models imp...
agpl-3.0
nyuwireless/ns3-mmwave
src/energy/bindings/modulegen__gcc_ILP32.py
38
314509
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers import pybindgen.settings import warnings class ErrorHandler(pybindgen.settings.ErrorHandler): def handle_error(self, wrapper, exception, traceback_): warnings.warn("exception %r in wrapper %s" % (exception, wrapper)) ...
gpl-2.0
philgyford/django-spectator
spectator/core/imagegenerators.py
1
1455
from imagekit import ImageSpec, register from imagekit.processors import ResizeToFit from spectator.core import app_settings # NOTE: All of these generators are deprecated. # Use the thumbnail properties on Publication and Reading models instead. class Thumbnail(ImageSpec): "Base class" format = "JPEG" ...
mit
nordri/check_domains
lib/python2.7/site-packages/django/contrib/auth/views.py
65
11470
from django.conf import settings from django.core.urlresolvers import reverse from django.http import HttpResponseRedirect, QueryDict from django.template.response import TemplateResponse from django.utils.http import is_safe_url, urlsafe_base64_decode from django.utils.translation import ugettext as _ from django.util...
gpl-3.0
misterhat/youtube-dl
devscripts/buildserver.py
17
14017
#!/usr/bin/python3 import argparse import ctypes import functools import shutil import subprocess import sys import tempfile import threading import traceback import os.path sys.path.insert(0, os.path.dirname(os.path.dirname((os.path.abspath(__file__))))) from youtube_dl.compat import ( compat_input, compat_h...
unlicense
cpe/VAMDC-VALD
nodes/vald/node_common/models.py
2
7964
from django.db.models import * #from vamdctap.bibtextools import * class RefCharField(CharField): description = "Subclass to CharField that returns strings split at commas" def to_python(self, value): #tmp = super(RefCharField, self).to_python(self, value) if hasattr(value,'split'): ...
gpl-3.0
y94anden/RPi_UART_1-wire
test_onewire.py
1
1861
#!/usr/bin/python3 # -*- Coding: utf-8 -*- import unittest, sys import onewire, simulator class TestOW(unittest.TestCase): def setUp(self): self.ow = onewire.OneWire(simulated = True) self.stdout = sys.stdout sys.stdout = None def tearDown(self): sys.stdout = self.stdout ...
gpl-2.0
chidea/GoPythonDLLWrapper
bin/lib/site-packages/pip/_vendor/requests/packages/chardet/charsetgroupprober.py
2929
3791
######################## 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 ...
mit
edisona/dpkt
dpkt/sctp.py
17
2426
# $Id$ """Stream Control Transmission Protocol.""" import dpkt, crc32c # Stream Control Transmission Protocol # http://tools.ietf.org/html/rfc2960 # Chunk Types DATA = 0 INIT = 1 INIT_ACK = 2 SACK = 3 HEARTBEAT = 4 HEARTBEAT_ACK = 5 ABORT = 6 SHUTDOWN = 7 SHUTDOWN_ACK = 8 ERROR = 9 COOKIE_ECHO = 10 ...
bsd-3-clause
bluegod/OSCAAR
oscaar/tests.py
2
14733
''' Created on Sep 12, 2013 @author: Dharmatej Mikkilineni ''' import unittest from oscaarGUI import (OscaarFrame, wx, os, oscaar, InvalidParameter, checkParams) IL = os.path.join(os.path.dirname(os.path.abspath(oscaar.__file__)), "testFiles") IL += os.sep class Test(unittest...
mit
veerhiremath7/veerhiremath7.github.io
node_modules/node-gyp/gyp/pylib/gyp/xcode_ninja.py
1789
10585
# Copyright (c) 2014 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. """Xcode-ninja wrapper project file generator. This updates the data structures passed to the Xcode gyp generator to build with ninja instead. The Xcode project i...
unlicense
simonwydooghe/ansible
test/units/modules/network/f5/test_bigip_software_update.py
22
3522
# -*- 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 import os import json import pytest import sys if sys.version_info < (2, ...
gpl-3.0
ArabellaTech/contactBox
contactbox/tests/test_main.py
1
2501
from django.test import TestCase from django.core.management import call_command from django.core import mail from django.core.urlresolvers import reverse from contactbox.models import Message, Receiver class MainTestCase(TestCase): def setUp(self): Receiver.objects.create( name='test', ...
mit
mysidewalk/training-django
01-middling-python/02-generators/generators.py
1
4052
# String Formatting # You can create strings by using just "string" or 'string' or '''string''' or """string""". You can # create more dynamic or template style strings by using some placeholders and arguments using the # .format method full_name = 'My full name is {} {}' print full_name # You can use the {} as place...
mit
jimmykimani/Cp2-Bucketlist-API
tests/base.py
1
1773
import unittest import json from app import create_app, db from app.models import User class BaseTestCase(unittest.TestCase): """ Base config for running the tests """ def setUp(self): self.app = create_app(config_name='testing') self.client = self.app.test_client() self.app_contex...
mit
MattNolanLab/ei-attractor
grid_cell_model/visitors/data_manipulation.py
1
3568
'''Data manipulation visitors. .. currentmodule:: grid_cell_model.visitors.data_manipulation Visitors that do some specific/generic manipulations with the data they receive. Classes ------- .. autosummary:: VelocityDataVisitor VelocityPruningVisitor VelocityConversionVisitor ''' import collections from...
gpl-3.0
Hazer/namebench
nb_third_party/jinja2/compiler.py
199
61044
# -*- coding: utf-8 -*- """ jinja2.compiler ~~~~~~~~~~~~~~~ Compiles nodes into python code. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ from cStringIO import StringIO from itertools import chain from copy import deepcopy from jinja2 import nodes from j...
apache-2.0
jkuruzovich/MGMT6963
examples/kaggle-titanic-python/Python Examples/agc_simp_gendermodel.py
6
1886
# A basic model using only an individual's gender as a predictor. # y=b0+b1(gender) import csv as csv import numpy as np data=[] with open('train.csv', 'rb') as f: # deals with opening and closing csv_file = csv.reader(open('train.csv', 'rb')) csv_file.next() # skips the header, so we can get to the data. ...
agpl-3.0
evidation-health/bokeh
examples/plotting/file/choropleth.py
45
1461
from bokeh.sampledata import us_states, us_counties, unemployment from bokeh.plotting import figure, show, output_file us_states = us_states.data.copy() us_counties = us_counties.data.copy() unemployment = unemployment.data del us_states["HI"] del us_states["AK"] state_xs = [us_states[code]["lons"] for code in us_st...
bsd-3-clause
jiangzhuo/kbengine
kbe/res/scripts/common/Lib/test/test_normalization.py
72
3226
from test.support import run_unittest, open_urlresource import unittest from http.client import HTTPException import sys import os from unicodedata import normalize, unidata_version TESTDATAFILE = "NormalizationTest.txt" TESTDATAURL = "http://www.unicode.org/Public/" + unidata_version + "/ucd/" + TESTDATAFILE def ch...
lgpl-3.0
atlashealth/ansible-modules-extras
notification/pushover.py
8
3193
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2012, Jim Richardson <weaselkeeper@gmail.com> # All rights reserved. # # 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 F...
gpl-3.0
ppericard/matamog
scripts/fastq_name_filter.py
3
3494
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ fastq_name_filter Description: Filter a fastq file based on a string to find in the sequences headers fastq_name_filter.py -i input.fq -o output.fq -s "stringtofind" ----------------------------------------------------------------------- Author: T...
agpl-3.0