repo_name
stringlengths
5
100
path
stringlengths
4
375
copies
stringclasses
991 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
MalloyPower/parsing-python
front-end/testsuite-python-lib/Python-3.3.0/Lib/test/test_macpath.py
62
4985
import macpath from test import support, test_genericpath import unittest class MacPathTestCase(unittest.TestCase): def test_abspath(self): self.assertEqual(macpath.abspath("xx:yy"), "xx:yy") def test_isabs(self): isabs = macpath.isabs self.assertTrue(isabs("xx:yy")) self.ass...
mit
figment/falloutsnip
Vendor/IronPython/Lib/lib2to3/fixes/fix_renames.py
326
2218
"""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(members): re...
gpl-3.0
apache/allura
ForgeSVN/forgesvn/model/svn.py
2
31204
# 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 (t...
apache-2.0
TheMOOCAgency/edx-platform
lms/djangoapps/grades/config/forms.py
16
1207
""" Defines a form for providing validation of subsection grade templates. """ import logging from django import forms from lms.djangoapps.grades.config.models import CoursePersistentGradesFlag from opaque_keys import InvalidKeyError from xmodule.modulestore.django import modulestore from opaque_keys.edx.locator imp...
agpl-3.0
mayblue9/scikit-learn
benchmarks/bench_multilabel_metrics.py
276
7138
#!/usr/bin/env python """ A comparison of multilabel target formats and metrics over them """ from __future__ import division from __future__ import print_function from timeit import timeit from functools import partial import itertools import argparse import sys import matplotlib.pyplot as plt import scipy.sparse as...
bsd-3-clause
nearlyfreeapps/python-googleadwords
examples/adspygoogle/adwords/v201109/basic_operations/get_campaigns.py
1
2192
#!/usr/bin/python # # Copyright 2011 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...
apache-2.0
klenks/jobsportal
venv/bin/activate_this.py
1076
1137
"""By using execfile(this_file, dict(__file__=this_file)) you will activate this virtualenv environment. This can be used when you must use an existing Python interpreter, not the virtualenv bin/python """ try: __file__ except NameError: raise AssertionError( "You must run this like execfile('path/to/...
mit
40223133/2015cd_midterm
static/Brython3.1.1-20150328-091302/Lib/xml/dom/minidom.py
727
66854
"""Simple implementation of the Level 1 DOM. Namespaces and other minor Level 2 features are also supported. parse("foo.xml") parseString("<foo><bar/></foo>") Todo: ===== * convenience methods for getting elements and text. * more testing * bring some of the writer and linearizer code into conformance with this ...
gpl-3.0
cts2/rf2service
server/Server.py
1
3285
# -*- coding: utf-8 -*- # Copyright (c) 2013, Mayo Clinic # 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...
bsd-3-clause
tkaitchuck/nupic
external/darwin64/lib/python2.6/site-packages/numpy/random/setupscons.py
100
1384
import glob from os.path import join, split def configuration(parent_package='',top_path=None): from numpy.distutils.misc_util import Configuration, get_mathlibs config = Configuration('random',parent_package,top_path) source_files = [join('mtrand', i) for i in ['mtrand.c', ...
gpl-3.0
rodrigob/fuel
fuel/datasets/iris.py
6
1038
from fuel.datasets import H5PYDataset from fuel.utils import find_in_data_path class Iris(H5PYDataset): u"""Iris dataset. Iris [LBBH] is a simple pattern recognition dataset, which consist of 3 classes of 50 examples each having 4 real-valued features each, where each class refers to a type of iris p...
mit
vipints/oqtans
oqtans_tools/KIRMES/0.8/src/kmotif.py
2
10908
""" ####################################################################################### # # # kmotif.py is a command-line front-end to the KIRMES pipeline # # BibTeX entries below. Please cite: ...
bsd-3-clause
f-prettyland/angr
angr/block.py
4
7002
import logging l = logging.getLogger("angr.block") import pyvex from archinfo import ArchARM from .engines import SimEngineVEX DEFAULT_VEX_ENGINE = SimEngineVEX() # this is only used when Block is not initialized with a project class Block(object): BLOCK_MAX_SIZE = 4096 __slots__ = ['_project', '_bytes', ...
bsd-2-clause
blazek/QGIS
tests/src/python/test_qgsserver_apicontext.py
25
1835
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsServerApiContext class. .. note:: 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 vers...
gpl-2.0
stopthatcow/zazu
zazu/style.py
1
6180
# -*- coding: utf-8 -*- """Style functions for zazu.""" import zazu.imports zazu.imports.lazy_import(locals(), [ 'click', 'difflib', 'functools', 'os', 'threading', 'sys', 'zazu.config', 'zazu.git_helper', 'zazu.styler', 'zazu.util' ]) __author__ = 'Nicholas Wiles' __copyright__...
mit
fuselock/odoo
addons/purchase_analytic_plans/__init__.py
441
1220
# -*- 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...
agpl-3.0
Viktor-Evst/fixed-luigi
test/snakebite_test.py
25
3738
# -*- coding: utf-8 -*- # # Copyright 2012-2015 Spotify AB # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
apache-2.0
Wikidata/QueryAnalysis
tools/getSparqlStatistic.py
1
3883
import argparse import os import sys from collections import defaultdict from pprint import pprint import config from postprocess import processdata from utility import utility parser = argparse.ArgumentParser(description="Prints out the SPARQL statistic") parser.add_argument( "--monthsFolder", "-m", defa...
apache-2.0
alunarbeach/spark
examples/src/main/python/streaming/recoverable_network_wordcount.py
80
4423
# # 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
Zing22/uemscode
tmp_test.py
1
1634
# -*- coding=utf-8 -*- #### for testing steps import numpy as np import matplotlib.pyplot as plt from sklearn import svm from sklearn.externals import joblib from PIL import Image from process import toBin, cropLetters from img2feature import toFeature from main import readAllFiles TEMP_DIR = 'tmp/' def test_onePi...
mit
hoatle/odoo
addons/hw_proxy/__openerp__.py
313
1675
# -*- 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
aarsan/azure-quickstart-templates
hortonworks-on-centos/scripts/vm-bootstrap.py
89
53170
# # vm-bootstrap.py # # This script is used to prepare VMs launched via HDP Cluster Install Blade on Azure. # # Parameters passed from the bootstrap script invocation by the controller (shown in the parameter order). # Required parameters: # action: "bootstrap" to set up VM and initiate cluster deployment. "check" f...
mit
c7zero/chipsec
chipsec/hal/uefi_common.py
5
76636
#!/usr/bin/python #CHIPSEC: Platform Security Assessment Framework #Copyright (c) 2010-2016, Intel Corporation # #This program is free software; you can redistribute it and/or #modify it under the terms of the GNU General Public License #as published by the Free Software Foundation; Version 2. # #This program is distr...
gpl-2.0
proppy/appengine-try-python-flask
lib/werkzeug/testapp.py
303
9398
# -*- coding: utf-8 -*- """ werkzeug.testapp ~~~~~~~~~~~~~~~~ Provide a small test application that can be used to test a WSGI server and check it for WSGI compliance. :copyright: (c) 2013 by the Werkzeug Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ impo...
apache-2.0
jazkarta/edx-platform-for-isc
common/lib/xmodule/xmodule/modulestore/tests/test_split_modulestore_bulk_operations.py
8
33066
import copy import ddt import unittest from bson.objectid import ObjectId from mock import MagicMock, Mock, call from xmodule.modulestore.split_mongo.split import SplitBulkWriteMixin from xmodule.modulestore.split_mongo.mongo_connection import MongoConnection from opaque_keys.edx.locator import CourseLocator class T...
agpl-3.0
sandeepdsouza93/TensorFlow-15712
tensorflow/python/client/timeline.py
19
23737
# 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
lokirius/python-for-android
python3-alpha/python3-src/Lib/plat-freebsd6/IN.py
172
12416
# Generated by h2py from /usr/include/netinet/in.h # Included from sys/cdefs.h __GNUCLIKE_ASM = 3 __GNUCLIKE_ASM = 2 __GNUCLIKE___TYPEOF = 1 __GNUCLIKE___OFFSETOF = 1 __GNUCLIKE___SECTION = 1 __GNUCLIKE_ATTRIBUTE_MODE_DI = 1 __GNUCLIKE_CTOR_SECTION_HANDLING = 1 __GNUCLIKE_BUILTIN_CONSTANT_P = 1 __GNUCLIKE_BUILTIN_VARA...
apache-2.0
nikolas/lettuce
tests/integration/lib/Django-1.3/django/db/backends/sqlite3/creation.py
230
3239
import os import sys from django.db.backends.creation import BaseDatabaseCreation class DatabaseCreation(BaseDatabaseCreation): # SQLite doesn't actually support most of these types, but it "does the right # thing" given more verbose field definitions, so leave them as is so that # schema inspection is mor...
gpl-3.0
dex4er/django
tests/servers/tests.py
49
5773
# -*- encoding: utf-8 -*- """ Tests for django.core.servers. """ from __future__ import unicode_literals import os import socket from django.core.exceptions import ImproperlyConfigured from django.test import LiveServerTestCase from django.test.utils import override_settings from django.utils.http import urlencode fr...
bsd-3-clause
engdan77/edoAutoHomeMobile
twisted/internet/test/test_default.py
24
3539
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for L{twisted.internet.default}. """ from __future__ import division, absolute_import import select, sys from twisted.trial.unittest import SynchronousTestCase from twisted.python.runtime import Platform from twisted.python.reflect imp...
mit
lshain-android-source/external-chromium_org
chrome/common/extensions/docs/server2/github_file_system_test.py
23
1750
#!/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. import json import os import sys import unittest from appengine_blobstore import AppEngineBlobstore from appengine_url_fetcher imp...
bsd-3-clause
lancezlin/ml_template_py
lib/python2.7/site-packages/pip/_vendor/pyparsing.py
417
224171
# module pyparsing.py # # Copyright (c) 2003-2016 Paul T. McGuire # # 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, cop...
mit
xR86/Algo
FII-year3sem1-SI/hw1/exe3/key_manager.py
2
2576
#!/usr/bin/python2.7 from Crypto.Cipher import AES from Crypto import Random ''' key = 'Sixteen byte key' plain_text = 'Attack at dawn' iv = Random.new().read(AES.block_size) #if ECB, use PCKS#7 # append bytes to reach mod 16 boundary. # All padding bytes have the same value: the number of bytes that you are adding...
gpl-2.0
wemanuel/smry
server-auth/ls/google-cloud-sdk/.install/.backup/lib/googlecloudsdk/gcloud/sdktools/components/list.py
11
1866
# Copyright 2013 Google Inc. All Rights Reserved. """The command to list installed/available gcloud components.""" import textwrap from googlecloudsdk.calliope import base class List(base.Command): """List the status of all Cloud SDK components. List all packages and individual components in the Cloud SDK and...
apache-2.0
ricardaw/pismdev
util/PISMNC.py
5
4793
#!/usr/bin/env python try: import netCDF4 as netCDF except: import netCDF3 as netCDF class PISMDataset(netCDF.Dataset): def create_time(self, use_bounds = False, length = None, units = None): self.createDimension('time', size = length) t_var = self.createVariable('time', 'f8', ('time',)) ...
gpl-2.0
gauribhoite/personfinder
env/google_appengine/lib/django-1.5/django/contrib/markup/templatetags/markup.py
104
3499
""" Set of "markup" template filters for Django. These filters transform plain text markup syntaxes to HTML; currently there is support for: * Textile, which requires the PyTextile library available at http://loopcore.com/python-textile/ * Markdown, which requires the Python-markdown library from ...
apache-2.0
ElementsProject/elements
test/functional/test_framework/address.py
1
5297
#!/usr/bin/env python3 # Copyright (c) 2016-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. """Encode and decode Bitcoin addresses. - base58 P2PKH and P2SH addresses. - bech32 segwit v0 P2WPKH and ...
mit
mikey1234/script.module.urlresolver
lib/urlresolver/plugins/crunchyroll.py
3
3019
''' Crunchyroll urlresolver plugin Copyright (C) 2013 voinage This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is ...
gpl-2.0
iRGBit/QGIS
python/plugins/processing/tests/TestData.py
38
2242
# -*- coding: utf-8 -*- """ *************************************************************************** TestData.py --------------------- Date : March 2013 Copyright : (C) 2013 by Victor Olaya Email : volayaf at gmail dot com *******************************...
gpl-2.0
tersmitten/ansible
lib/ansible/modules/cloud/ovirt/ovirt_external_provider.py
52
14722
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (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 #...
gpl-3.0
megaprojectske/megaprojects.co.ke
megaprojects/articles/mixins.py
1
1028
# See: http://hunterford.me/django-custom-model-manager-chaining/ import models class ArticleManagerMixin(object): def published(self, status=True): if status: return self.filter(status=models.Article.STATUS_PUBLISHED) else: return self.filter(status=models.Article.STATUS_...
apache-2.0
tryton-ar/padron_afip_ar
padron_afip.py
1
7151
#! -*- coding: utf8 -*- "Herramienta para procesar y consultar el Padrón Unico de Contribuyentes AFIP" # Documentación e información adicional: # http://www.sistemasagiles.com.ar/trac/wiki/PadronContribuyentesAFIP # Basado en pyafipws padron.py de Mariano Reingart from trytond.model import ModelView, ModelSQL, fie...
gpl-2.0
ojengwa/oh-mainline
vendor/packages/docutils/test/test_readers/test_pep/test_rfc2822.py
19
6073
#! /usr/bin/env python # $Id: test_rfc2822.py 4564 2006-05-21 20:44:42Z wiemann $ # Author: David Goodger <goodger@python.org> # Copyright: This module has been placed in the public domain. """ Tests for RFC-2822 headers in PEPs (readers/pep.py). """ from __init__ import DocutilsTestSupport def suite(): s = Doc...
agpl-3.0
mitsuhiko/sentry
src/sentry/models/auditlogentry.py
1
9023
""" sentry.models.auditlogentry ~~~~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import, print_function from django.db import models from django.utils import timezone from sentry.db...
bsd-3-clause
sbellem/django
django/test/runner.py
148
14807
import logging import os import unittest from importlib import import_module from unittest import TestSuite, defaultTestLoader from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.test import SimpleTestCase, TestCase from django.test.utils import setup_test_environment, ...
bsd-3-clause
mday299/ardupilot
Tools/autotest/pysim/iris_ros.py
81
3622
#!/usr/bin/env python """ Python interface to euroc ROS multirotor simulator See https://pixhawk.org/dev/ros/sitl """ import time import mav_msgs.msg as mav_msgs import px4.msg as px4 import rosgraph_msgs.msg as rosgraph_msgs import rospy import sensor_msgs.msg as sensor_msgs from aircraft import Aircraft from rotma...
gpl-3.0
RedstonerServer/redstoner-utils
iptracker.py
1
4991
import mysqlhack import org.bukkit as bukkit import json from java.util import UUID as UUID from helpers import * from org.bukkit import * from traceback import format_exc as trace from iptracker_secrets import * iptrack_permission = "utils.iptrack" iptrack_version = "1.1.0" @hook.event("player.Player...
mit
HeraclesHX/scikit-learn
sklearn/datasets/california_housing.py
198
3877
"""California housing dataset. The original database is available from StatLib http://lib.stat.cmu.edu/ The data contains 20,640 observations on 9 variables. This dataset contains the average house value as target variable and the following input variables (features): average income, housing average age, averag...
bsd-3-clause
PythonScientists/Shape
env/lib/python3.5/site-packages/click/__init__.py
135
2858
# -*- coding: utf-8 -*- """ click ~~~~~ Click is a simple Python module that wraps the stdlib's optparse to make writing command line scripts fun. Unlike other modules, it's based around a simple API that does not come with too much magic and is composable. In case optparse ever gets removed ...
apache-2.0
elopio/snapcraft
snapcraft/cli/version.py
1
1079
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- # # Copyright (C) 2017 Canonical Ltd # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3 as # published by the Free Software Foundation. # # This program is distributed in the h...
gpl-3.0
titom1986/CouchPotatoServer
libs/tmdb3/util.py
32
16758
#!/usr/bin/env python # -*- coding: utf-8 -*- #----------------------- # Name: util.py Assorted utilities used in tmdb_api # Python Library # Author: Raymond Wagner #----------------------- from copy import copy from locales import get_locale from tmdb_auth import get_session class NameRepr(object): """Mixin ...
gpl-3.0
tobegit3hub/deep_cnn
java_predict_client/src/main/proto/tensorflow/contrib/slim/python/slim/learning_test.py
9
31311
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
apache-2.0
edry/edx-platform
lms/djangoapps/courseware/tests/test_word_cloud.py
134
8327
# -*- coding: utf-8 -*- """Word cloud integration tests using mongo modulestore.""" import json from operator import itemgetter from nose.plugins.attrib import attr from . import BaseTestXmodule from xmodule.x_module import STUDENT_VIEW @attr('shard_1') class TestWordCloud(BaseTestXmodule): """Integration test ...
agpl-3.0
collinss/Cinnamon
files/usr/share/cinnamon/cinnamon-settings/cinnamon-settings.py
1
27007
#!/usr/bin/python3 import sys import os import glob import gettext import time import traceback import locale import urllib.request as urllib from functools import cmp_to_key import unicodedata import config from setproctitle import setproctitle import gi gi.require_version('Gtk', '3.0') gi.require_version('XApp', '...
gpl-2.0
RPGOne/Skynet
scikit-learn-0.18.1/sklearn/linear_model/tests/test_ransac.py
52
17482
from scipy import sparse import numpy as np from scipy import sparse from numpy.testing import assert_equal, assert_raises from numpy.testing import assert_array_almost_equal from numpy.testing import assert_array_equal from sklearn.utils import check_random_state from sklearn.utils.testing import assert_raises_rege...
bsd-3-clause
heeraj123/oh-mainline
vendor/packages/django-assets/django_assets/jinja2/extension.py
16
2628
from jinja2.ext import Extension from jinja2 import nodes from django_assets.conf import settings from django_assets.merge import process from django_assets.bundle import Bundle from django_assets import registry __all__ = ('assets',) class AssetsExtension(Extension): """ As opposed to the Djan...
agpl-3.0
meteorcloudy/tensorflow
tensorflow/contrib/distributions/python/kernel_tests/cauchy_test.py
33
16857
# 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
kailIII/emaresa
aeroo/report_aeroo/barcode/EANBarCode.py
13
5228
# Copyright (c) 2009-2011 Alistek Ltd (http://www.alistek.com) All Rights Reserved. # General contacts <info@alistek.com> from tools import config, ustr fontsize = 15 """ This class generate EAN bar code, it required PIL (python imaging library) installed. If the code has not checksum (12 digits),...
agpl-3.0
jmighion/ansible
lib/ansible/utils/listify.py
118
1462
# (c) 2014 Michael DeHaan, <michael@ansible.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later ve...
gpl-3.0
dou800/php-buildpack-legacy
builds/runtimes/python-2.7.6/lib/python2.7/lib2to3/fixes/fix_types.py
304
1806
# Copyright 2007 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Fixer for removing uses of the types module. These work for only the known names in the types module. The forms above can include types. or not. ie, It is assumed the module is imported either as: import type...
mit
lmazuel/azure-sdk-for-python
azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_status_code_count_py3.py
5
1325
# 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 ...
mit
xXminiWHOOPERxX/xXminiWHOOPERxX-Kernel-ZaraCL-
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
adamhajari/spyre
tests/test_app.py
1
5046
# from spyre import server from spyre import server import matplotlib.pyplot as plt import numpy as np import pandas as pd from numpy import pi class TestApp(server.App): colors = [ {"label": "Green", "value": 'g'}, {"label": "Red", "value": 'r'}, {"label": "Blue", "value": 'b'}, ...
mit
stargaser/astropy
astropy/table/info.py
3
7420
""" Table property for providing information about table. """ # Licensed under a 3-clause BSD style license - see LICENSE.rst import sys import os from contextlib import contextmanager from inspect import isclass import numpy as np from astropy.utils.data_info import DataInfo __all__ = ['table_info', 'TableInfo', 'se...
bsd-3-clause
vanloswang/linux
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/SchedGui.py
12980
5411
# SchedGui.py - Python extension for perf script, basic GUI code for # traces drawing and overview. # # Copyright (C) 2010 by Frederic Weisbecker <fweisbec@gmail.com> # # This software is distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. ...
gpl-2.0
brion/cerbero
cerbero/build/recipe.py
1
15439
# cerbero - a multi-platform build system for Open Source software # Copyright (C) 2012 Andoni Morales Alastruey <ylatuya@gmail.com> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; eit...
lgpl-2.1
kornicameister/ansible-modules-extras
monitoring/pagerduty_alert.py
121
7587
#!/usr/bin/python # -*- coding: utf-8 -*- # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. ...
gpl-3.0
8u1a/plaso
plaso/cli/helpers/interface.py
3
1180
# -*- coding: utf-8 -*- """The arguments helper interface.""" class ArgumentsHelper(object): """The CLI arguments helper class.""" NAME = u'baseline' # Category further divides the registered helpers down after function, # this can be something like: analysis, output, storage, etc. CATEGORY = u'' DESCRIP...
apache-2.0
HyperBaton/ansible
lib/ansible/modules/network/fortios/fortios_switch_controller_sflow.py
7
8728
#!/usr/bin/python from __future__ import (absolute_import, division, print_function) # Copyright 2019 Fortinet, Inc. # # 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 Lic...
gpl-3.0
cmccoy/startreerenaissance
deploy/tag-instances.py
1
1583
#!/usr/bin/env python import argparse import logging import sys import boto def main(): p = argparse.ArgumentParser() p.add_argument('cluster_name') p.add_argument('--dry-run', action='store_true') a = p.parse_args() conn = boto.connect_ec2() active = [instance for res in conn.get_all_instan...
gpl-3.0
vmturbo/nova
nova/policies/certificates.py
1
1520
# Copyright 2016 Cloudbase Solutions Srl # 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 r...
apache-2.0
coxmediagroup/googleads-python-lib
examples/dfp/v201505/custom_field_service/get_all_line_item_custom_fields.py
3
2324
#!/usr/bin/python # # 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 b...
apache-2.0
cgarciabarrera/wazztrick
src/Examples/EchoClient.py
16
3147
''' Copyright (c) <2012> Tarek Galal <tare2.galal@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, modify, m...
mit
PepperPD/edx-pepper-platform
common/lib/xmodule/xmodule/modulestore/parsers.py
9
4058
import re # Prefix for the branch portion of a locator URL BRANCH_PREFIX = "/branch/" # Prefix for the block portion of a locator URL BLOCK_PREFIX = "/block/" # Prefix for the version portion of a locator URL, when it is preceded by a course ID VERSION_PREFIX = "/version/" # Prefix for version when it begins the URL (...
agpl-3.0
MER-GROUP/intellij-community
python/lib/Lib/site-packages/django/contrib/gis/db/backends/spatialite/operations.py
282
14391
import re from decimal import Decimal from django.contrib.gis.db.backends.base import BaseSpatialOperations from django.contrib.gis.db.backends.util import SpatialOperation, SpatialFunction from django.contrib.gis.db.backends.spatialite.adapter import SpatiaLiteAdapter from django.contrib.gis.geometry.backend import G...
apache-2.0
albertrdixon/CouchPotatoServer
libs/html5lib/treewalkers/genshistream.py
1730
2278
from __future__ import absolute_import, division, unicode_literals from genshi.core import QName from genshi.core import START, END, XML_NAMESPACE, DOCTYPE, TEXT from genshi.core import START_NS, END_NS, START_CDATA, END_CDATA, PI, COMMENT from . import _base from ..constants import voidElements, namespaces class ...
gpl-3.0
sestrella/ansible
lib/ansible/modules/network/fortimanager/fmgr_provisioning.py
52
11458
#!/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
TheBraveWarrior/pyload
module/plugins/hoster/LinkifierCom.py
5
2486
# -*- coding: utf-8 -*- import hashlib import pycurl from ..internal.MultiHoster import MultiHoster from ..internal.misc import json, seconds_to_midnight class LinkifierCom(MultiHoster): __name__ = "AlldebridCom" __type__ = "hoster" __version__ = "0.02" __status__ = "testing" __pattern__ = r'^u...
gpl-3.0
max3903/SFLphone
daemon/libs/pjproject/tests/cdash/cfg_msvc.py
107
2726
# # cfg_msvc.py - MSVC/Visual Studio target configurator # # Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) # # 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 L...
gpl-3.0
jjx02230808/project0223
benchmarks/bench_lasso.py
297
3305
""" Benchmarks of Lasso vs LassoLars First, we fix a training set and increase the number of samples. Then we plot the computation time as function of the number of samples. In the second benchmark, we increase the number of dimensions of the training set. Then we plot the computation time as function of the number o...
bsd-3-clause
alvarogzp/telegram-bot
bot/bot.py
1
11029
import time from bot import project_info from bot.action.core.action import Action from bot.action.core.update import Update from bot.action.standard.about import VersionAction from bot.action.standard.admin.config_status import ConfigStatus from bot.action.util.textformat import FormattedText from bot.api.api import ...
agpl-3.0
jaggu303619/asylum-v2.0
openerp/addons/point_of_sale/report/pos_payment_report_user.py
62
3251
# -*- 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
Ruide/angr-dev
angr/angr/misc/autoimport.py
4
2072
import os import importlib import logging l = logging.getLogger('angr.misc.autoimport') def auto_import_packages(base_module, base_path, ignore_dirs=(), ignore_files=(), scan_modules=True): for lib_module_name in os.listdir(base_path): if lib_module_name in ignore_dirs: continue lib_p...
bsd-2-clause
Nu3001/external_chromium_org
chrome/browser/safe_browsing/safe_browsing_testserver.py
74
1483
#!/usr/bin/env python # Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Wraps the upstream safebrowsing_test_server.py to run in Chrome tests.""" import os import sys BASE_DIR = os.path.dirname(os.path....
bsd-3-clause
antivirtel/Flexget
flexget/plugins/input/rottentomatoes_list.py
13
2974
from __future__ import unicode_literals, division, absolute_import import logging from flexget import plugin from flexget.entry import Entry from flexget.event import event from flexget.utils.cached_input import cached try: from flexget.plugins.api_rottentomatoes import lists except ImportError: raise...
mit
zhujzhuo/Sahara
sahara/service/edp/oozie/workflow_creator/hive_workflow.py
14
1576
# Copyright (c) 2013 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 writ...
apache-2.0
edbrannin/library-searcher-python
render_results.py
1
2109
import click from jinja2 import Environment, FileSystemLoader from model import * session = setup_sqlalchemy()() env = Environment(loader=FileSystemLoader(".")) template = env.get_template("results.html.j2") sql = """ select r.author, r.title, h.branch_name, h.collection_name, h.call_class, count(*) as...
mit
esrf-emotion/emotion
emotion/task_utils.py
1
2961
import sys import types import gevent import signal import functools class cleanup: def __init__(self, *args, **keys): self.cleanup_funcs = args self.keys = keys def __enter__(self): pass def __exit__(self, exc_type, value, traceback): if self.cleanup_funcs: ...
gpl-2.0
MaDKaTZe/phantomjs
src/qt/qtwebkit/Tools/gtk/gtkdoc.py
113
17832
# Copyright (C) 2011 Igalia S.L. # # This library 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 2 of the License, or (at your option) any later version. # # This library is distribute...
bsd-3-clause
github-account-because-they-want-it/django-activity-stream
actstream/south_migrations/0006_auto__add_field_action_data.py
8
5977
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models from actstream.compat import user_model_label class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Action.data' db.add_column('actstream_action', 'dat...
bsd-3-clause
edx/edx-platform
common/djangoapps/student/role_helpers.py
5
1412
""" Helpers for student roles """ from openedx.core.djangoapps.django_comment_common.models import ( FORUM_ROLE_ADMINISTRATOR, FORUM_ROLE_COMMUNITY_TA, FORUM_ROLE_GROUP_MODERATOR, FORUM_ROLE_MODERATOR, Role ) from common.djangoapps.student.roles import ( CourseBetaTesterRole, CourseInstruc...
agpl-3.0
ernestask/meson
mesonbuild/backend/xcodebackend.py
2
40565
# Copyright 2014-2016 The Meson development team # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agree...
apache-2.0
berfinsari/metricbeat
membeat/vendor/github.com/elastic/beats/packetbeat/tests/system/gen/memcache/mc.py
15
1393
from contextlib import (contextmanager) import argparse import sys import pylibmc def parse_args(args=None): p = argparse.ArgumentParser() p.add_argument('--protocol', '-p', default='text', help="choose protocol type. One of text or bin") p.add_argument('--remote', '-r', default='127....
gpl-3.0
tinkerinestudio/Tinkerine-Suite
TinkerineSuite/pypy/lib-python/2.7/lib2to3/pgen2/driver.py
98
4694
# Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. # Modifications: # Copyright 2006 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Parser driver. This provides a high-level interface to parse a file into a synta...
agpl-3.0
dragonfi/snowfall
pyglet-1.1.4/tests/font/ADD_FONT.py
12
1603
#!/usr/bin/env python '''Test that a font distributed with the application can be displayed. Four lines of text should be displayed, each in a different variant (bold/italic/regular) of Action Man at 24pt. The Action Man fonts are included in the test directory (tests/font) as action_man*.ttf. Press ESC to end the ...
mit
stscieisenhamer/ginga
ginga/tkw/TkHelp.py
1
1380
# # TkHelp.py -- help module for Ginga Tk backend # # This is open-source software licensed under a BSD license. # Please see the file LICENSE.txt for details. class Timer(object): """Abstraction of a GUI-toolkit implemented timer.""" def __init__(self, ival_sec, expire_cb, data=None, tkcanvas=None): ...
bsd-3-clause
12019/cyberflex-shell
tests/utilstest.py
2
1220
"""Unit test for utils.py""" import utils import unittest class APDUCase1Tests(unittest.TestCase): def setUp(self): self.a4 = utils.C_APDU("\x00\xa4\x00\x00") def tearDown(self): del self.a4 def testCreation(self): self.assertEqual(0, self.a4.CLA) self.assert...
gpl-2.0
thaumos/ansible
test/units/modules/network/slxos/test_slxos_interface.py
38
4938
# # (c) 2018 Extreme Networks 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. # # Ans...
gpl-3.0
Bismarrck/tensorflow
tensorflow/lite/experimental/examples/lstm/unidirectional_sequence_lstm_test.py
9
8637
# Copyright 2018 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
partofthething/home-assistant
homeassistant/components/nissan_leaf/__init__.py
1
17730
"""Support for the Nissan Leaf Carwings/Nissan Connect API.""" import asyncio from datetime import datetime, timedelta import logging import sys from pycarwings2 import CarwingsError, Session import voluptuous as vol from homeassistant.const import CONF_PASSWORD, CONF_REGION, CONF_USERNAME, HTTP_OK from homeassistant...
mit