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 |
|---|---|---|---|---|---|
martinbuc/missionplanner | Lib/collections.py | 52 | 26030 | __all__ = ['Counter', 'deque', 'defaultdict', 'namedtuple', 'OrderedDict']
# For bootstrapping reasons, the collection ABCs are defined in _abcoll.py.
# They should however be considered an integral part of collections.py.
from _abcoll import *
import _abcoll
__all__ += _abcoll.__all__
from _collections import ... | gpl-3.0 |
paveljanik/bitcoin | test/functional/p2p_invalid_block.py | 8 | 3841 | #!/usr/bin/env python3
# Copyright (c) 2015-2017 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 node responses to invalid blocks.
In this test we connect to one node over p2p, and test block re... | mit |
n4hy/gnuradio | gr-wxgui/src/python/constsink_gl.py | 24 | 4252 | #
# Copyright 2008 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your option)
# any later version.
#
#... | gpl-3.0 |
spinicist/ITK | Wrapping/Generators/Python/Tests/OldStyleBinaryDilateImageFilter.py | 19 | 1251 | #==========================================================================
#
# Copyright Insight Software Consortium
#
# 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... | apache-2.0 |
woodpecker1/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/port/factory_unittest.py | 118 | 3965 | # Copyright (C) 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 of conditions and the f... | bsd-3-clause |
jkankiewicz/kivy | kivy/adapters/dictadapter.py | 12 | 6059 | '''
DictAdapter
===========
.. versionadded:: 1.5
.. deprecated:: 1.10.0
The feature has been deprecated.
.. warning::
This code is still experimental, and its API is subject to change in a
future version.
A :class:`~kivy.adapters.dictadapter.DictAdapter` is an adapter around a
python dictionary of rec... | mit |
olegpshenichniy/Booktype | lib/booktype/importer/docx/styles.py | 7 | 2924 | STYLE_EDITOR = '''
#contenteditor {
font-family: serif;
line-height: 120%;
font-size: 1em;
}
#contenteditor P {
text-align: left;
windows: 2;
orphans: 2;
margin-top:0em;
margin-bottom:0em;
line-height: 120%;
}
#contenteditor P, #contenteditor TD {
line-height: 120%;
font-f... | agpl-3.0 |
cole945/binutils-gdb | gdb/contrib/excheck.py | 41 | 11670 | # Copyright 2011-2014 Free Software Foundation, Inc.
#
# This 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 prog... | gpl-2.0 |
denisff/python-for-android | python3-alpha/python3-src/Lib/test/test_math.py | 55 | 46049 | # Python test set -- math module
# XXXX Should not do tests around zero only
from test.support import run_unittest, verbose, requires_IEEE_754
import unittest
import math
import os
import sys
import random
import struct
import sysconfig
eps = 1E-05
NAN = float('nan')
INF = float('inf')
NINF = float('-inf')
# detect ... | apache-2.0 |
julienr/vispy | vispy/testing/__init__.py | 21 | 2415 | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Vispy Development Team.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
"""
Testing
=======
This module provides functions useful for running tests in vispy.
Tests can be run in a few ways:
* From Python, you can import ``vispy`` and do ``vis... | bsd-3-clause |
anurag313/scikit-learn | sklearn/tree/export.py | 78 | 15814 | """
This module defines export functions for decision trees.
"""
# Authors: Gilles Louppe <g.louppe@gmail.com>
# Peter Prettenhofer <peter.prettenhofer@gmail.com>
# Brian Holt <bdholt1@gmail.com>
# Noel Dawe <noel@dawe.me>
# Satrajit Gosh <satrajit.ghosh@gmail.com>
# Trevor... | bsd-3-clause |
pjotrp/cloudbiolinux | contrib/flavor/pjotrp/biotest/biotestflavor.py | 10 | 1800 | from fabric.api import *
from fabric.contrib.files import *
from cloudbio.flavor import Flavor
from cloudbio.custom.shared import (_fetch_and_unpack)
class BioTestFlavor(Flavor):
"""A Flavor for cross Bio* tests
"""
def __init__(self, env):
Flavor.__init__(self,env)
self.name = "Bio* cros... | mit |
JIC-CSB/jicimagelib | tests/FileBackend_unit_tests.py | 1 | 2437 | """Tests for the :class:`jicimagelib.image.FileBackend` class."""
import unittest
import os
import os.path
import shutil
CURRENT_WORKING_DIR = os.getcwd()
HERE = os.path.dirname(__file__)
TMP_DIR = os.path.join(HERE, 'tmp')
class FileBackendTests(unittest.TestCase):
def setUp(self):
if not os.path.i... | mit |
louisLouL/pair_trading | capstone_env/lib/python3.6/site-packages/numpy/testing/tests/test_doctesting.py | 224 | 1322 | """ Doctests for NumPy-specific nose/doctest modifications
"""
from __future__ import division, absolute_import, print_function
# try the #random directive on the output line
def check_random_directive():
'''
>>> 2+2
<BadExample object at 0x084D05AC> #random: may vary on your system
'''
# check the ... | mit |
sudheesh001/oh-mainline | vendor/packages/Django/tests/modeltests/get_latest/tests.py | 89 | 2242 | from __future__ import absolute_import
from datetime import datetime
from django.test import TestCase
from .models import Article, Person
class LatestTests(TestCase):
def test_latest(self):
# Because no Articles exist yet, latest() raises ArticleDoesNotExist.
self.assertRaises(Article.DoesNotEx... | agpl-3.0 |
ctrlaltdel/neutrinator | vendor/chardet/sjisprober.py | 290 | 3774 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org 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 Reserved.
#
# Con... | gpl-3.0 |
mach0/QGIS | python/plugins/grassprovider/ext/r_li_padcv.py | 45 | 1291 | # -*- coding: utf-8 -*-
"""
***************************************************************************
r_li_padcv.py
-------------
Date : February 2016
Copyright : (C) 2016 by Médéric Ribreux
Email : medspx at medspx dot fr
********************************... | gpl-2.0 |
robdennis/sideboard | tests/plugins/different_versions/rdflib3_0_0/env/lib/python2.7/site-packages/pip-1.3.1-py2.7.egg/pip/commands/list.py | 63 | 5403 | from pip.basecommand import Command
from pip.exceptions import DistributionNotFound, BestVersionAlreadyInstalled
from pip.index import PackageFinder
from pip.log import logger
from pip.req import InstallRequirement
from pip.util import get_installed_distributions, dist_is_editable
from pip.cmdoptions import make_option... | bsd-3-clause |
geodynamics/pylith | tests/libtests/materials/data/obsolete/GenMaxwellQpQsIsotropic3DTimeDep.py | 1 | 17156 | #!/usr/bin/env python
#
# ----------------------------------------------------------------------
#
# Brad T. Aagaard, U.S. Geological Survey
# Charles A. Williams, GNS Science
# Matthew G. Knepley, University of Chicago
#
# This code was developed as part of the Computational Infrastructure
# for Geodynamics (http://ge... | mit |
caengcjd/shadowsocks | shadowsocks/eventloop.py | 26 | 7930 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2014 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... | mit |
yjwoo92/yjwoo92.github.io | node_modules/node-gyp/gyp/pylib/gyp/MSVSVersion.py | 1509 | 17165 | # Copyright (c) 2013 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.
"""Handle version information related to Visual Stuio."""
import errno
import os
import re
import subprocess
import sys
import gyp
import glob
class VisualStudi... | apache-2.0 |
cloudera/hue | desktop/core/ext-py/markdown/regression-tests.py | 44 | 8693 | #!/usr/bin/python
"""
Python-Markdown Regression Tests
================================
Tests of the various APIs with the python markdown lib.
"""
import unittest
from doctest import DocTestSuite
import os
import markdown
class TestMarkdown(unittest.TestCase):
""" Tests basics of the Markdown class. """
d... | apache-2.0 |
orablu/heroku-buildpack | vendor/setuptools-0.9.7/tests/test_pkg_resources.py | 10 | 2371 | import sys
import tempfile
import os
import zipfile
import pkg_resources
try:
unicode
except NameError:
unicode = str
class EggRemover(unicode):
def __call__(self):
if self in sys.path:
sys.path.remove(self)
if os.path.exists(self):
os.remove(self)
class TestZipPr... | mit |
Canaan-Creative/Avalon-nano | pyminer/pyminer.py | 1 | 12289 | #!/usr/bin/python
#
# Copyright 2015 Mikeqin Fengling.Qin@gmail.com
# Copyright 2011 Jeff Garzik
#
# 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.
#
# This program is distributed in the hope tha... | unlicense |
40223117cda/w17test | static/Brython3.1.0-20150301-090019/Lib/ui/slider.py | 603 | 2394 | from . import widget
from browser import doc,html
class Slider(widget.Widget):
def __init__(self, id=None, label=False):
self._div_shell=html.DIV(Class="ui-slider ui-slider-horizontal ui-widget ui-widget-content ui-corner-all")
widget.Widget.__init__(self, self._div_shell, 'slider', id)
self._h... | gpl-3.0 |
ChrisTimperley/RepairBox | docs/conf.py | 3 | 6118 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# repairbox documentation build configuration file, created by
# sphinx-quickstart on Mon Oct 2 20:16:23 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# ... | mit |
boolgom/blockly_entry | i18n/common.py | 8 | 9697 | #!/usr/bin/python
# Code shared by translation conversion scripts.
#
# Copyright 2013 Google Inc.
# https://blockly.googlecode.com/
#
# 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... | apache-2.0 |
jocave/snapcraft | snaps_tests/demos_tests/test_opencv.py | 9 | 1069 | # -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2015, 2016 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... | gpl-3.0 |
tvrcopgg/edm_xadmin | xadmin/plugins/sortable.py | 27 | 1266 | #coding:utf-8
from xadmin.sites import site
from xadmin.views import BaseAdminPlugin, ListAdminView
SORTBY_VAR = '_sort_by'
class SortablePlugin(BaseAdminPlugin):
sortable_fields = ['sort']
# Media
def get_media(self, media):
if self.sortable_fields and self.request.GET.get(SORTBY_VAR):
... | bsd-3-clause |
cloudbase/neutron-virtualbox | neutron/tests/unit/test_l3_agent.py | 1 | 84855 | # Copyright 2012 VMware, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | apache-2.0 |
PetrDlouhy/django | tests/i18n/test_extraction.py | 117 | 35075 | # -*- encoding: utf-8 -*-
from __future__ import unicode_literals
import io
import os
import re
import shutil
import time
import warnings
from unittest import SkipTest, skipUnless
from django.conf import settings
from django.core import management
from django.core.management import execute_from_command_line
from djan... | bsd-3-clause |
kimoonkim/spark | python/pyspark/sql/types.py | 15 | 51697 | #
# 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 |
scieloorg/opac | opac/tests/test_interface_footer.py | 3 | 6078 | # coding: utf-8
from flask import url_for, current_app
from .base import BaseTestCase
from . import utils
class FooterTestCase(BaseTestCase):
def test_collection_open_access_home(self):
"""
Testa se os links e o conteúdo da licença esta de acordo com a licença
cadastrada na coleção.
... | bsd-2-clause |
HyperloopTeam/FullOpenMDAO | lib/python2.7/site-packages/openmdao.lib-0.13.0-py2.7.egg/openmdao/lib/casehandlers/pymongo_bson/tz_util.py | 20 | 1518 | # Copyright 2010-2014 MongoDB, 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 writin... | gpl-2.0 |
kubeflow/kfp-tekton | components/gcp/container/component_sdk/python/kfp_component/launcher/__main__.py | 2 | 1475 | # Copyright 2018 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | apache-2.0 |
docmeth02/CouchPotatoServer | libs/requests/packages/urllib3/contrib/pyopenssl.py | 488 | 9326 | '''SSL with SNI_-support for Python 2. Follow these instructions if you would
like to verify SSL certificates in Python 2. Note, the default libraries do
*not* do certificate checking; you need to do additional work to validate
certificates yourself.
This needs the following packages installed:
* pyOpenSSL (tested wi... | gpl-3.0 |
manhong2112/CodeColle | Python/Pygame/pygame~/tests/image_test.py | 7 | 18414 | if __name__ == '__main__':
import sys
import os
pkg_dir = os.path.split(os.path.abspath(__file__))[0]
parent_dir, pkg_name = os.path.split(pkg_dir)
is_pygame_pkg = (pkg_name == 'tests' and
os.path.split(parent_dir)[1] == 'pygame')
if not is_pygame_pkg:
sys.path.inser... | mit |
nguyenquan012/robot-audition-experiments | src/hark_turtlebot_fdnetworks/experiment/HARK_test/plotaoa.py | 1 | 4250 | #!/usr/bin/env python
#
# read HARK localization output and calculate + display AOA in degree
#
import pylab
import sys
import math
import numpy
azimuths = []
azimuths1 = []
azimuths2 = []
azimuths3 = []
azimuths4 = []
source1 = []
source2 = []
source3 = []
source4 = []
f = open(sys.argv[1])
fileout = open("aoa.txt... | gpl-3.0 |
Workday/OpenFrame | tools/telemetry/third_party/gsutilz/third_party/protorpc/protorpc/webapp/forms_test.py | 21 | 4048 | #!/usr/bin/env python
#
# Copyright 2010 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... | bsd-3-clause |
Zumochi/eve-wspace | evewspace/API/migrations/0005_auto__chg_field_apicharacter_apikey.py | 10 | 10878 | # -*- 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):
# Changing field 'APICharacter.apikey'
db.alter_column('API_apicharacter', 'apikey_id', self.gf('django.db.... | apache-2.0 |
qrkourier/ansible | lib/ansible/modules/source_control/github_release.py | 26 | 6049 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: Ansible Team
# 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 |
waytai/odoo | addons/l10n_fr/report/__init__.py | 424 | 1475 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2008 JAILLET Simon - CrysaLEAD - www.crysalead.fr
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
#... | agpl-3.0 |
hobarrera/django | tests/gis_tests/geoapp/models.py | 34 | 2479 | from django.utils.encoding import python_2_unicode_compatible
from ..models import models
from ..utils import gisfield_may_be_null
@python_2_unicode_compatible
class NamedModel(models.Model):
name = models.CharField(max_length=30)
objects = models.GeoManager()
class Meta:
abstract = True
... | bsd-3-clause |
rahul-c1/scikit-learn | examples/datasets/plot_random_dataset.py | 348 | 2254 | """
==============================================
Plot randomly generated classification dataset
==============================================
Plot several randomly generated 2D classification datasets.
This example illustrates the :func:`datasets.make_classification`
:func:`datasets.make_blobs` and :func:`datasets.... | bsd-3-clause |
TalShafir/ansible | lib/ansible/module_utils/network/iosxr/iosxr.py | 20 | 21182 | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... | gpl-3.0 |
vitan/hue | desktop/core/ext-py/Django-1.6.10/tests/template_tests/test_custom.py | 108 | 24098 | from __future__ import absolute_import, unicode_literals
from django import template
from django.utils import six
from django.utils.unittest import TestCase
from .templatetags import custom
class CustomFilterTests(TestCase):
def test_filter(self):
t = template.Template("{% load custom %}{{ string|trim:5... | apache-2.0 |
pouyana/satgen | config_dict.py | 1 | 10534 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
A dict for all the cfg xml transition names
STELA is sortsenstive, how the xml items are sorted play a role
"""
class ConfigDict:
def get_sort_space_object(self):
"""
Returns the sorting way of space object
"""
return {
... | mit |
bastichelaar/kubernetes | cluster/saltbase/salt/_states/container_bridge.py | 96 | 5593 | # 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 by applicable law or a... | apache-2.0 |
sbtourist/cassandra | pylib/cqlshlib/test/cassconnect.py | 15 | 5106 | # 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-2.0 |
ingmarschuster/ModelSelection | modsel/evidence.py | 1 | 3969 | # -*- coding: utf-8 -*-
"""
Created on Fri Oct 31 16:15:43 2014
@author: Ingmar Schuster
"""
from __future__ import division, print_function, absolute_import
from numpy import exp, log, sqrt
from scipy.misc import logsumexp
from scipy.special import multigammaln
from numpy.linalg import inv
import numpy as np
import... | gpl-3.0 |
indro/t2c | apps/external_apps/django_extensions/utils/uuid.py | 170 | 20165 | r"""UUID objects (universally unique identifiers) according to RFC 4122.
This module provides immutable UUID objects (class UUID) and the functions
uuid1(), uuid3(), uuid4(), uuid5() for generating version 1, 3, 4, and 5
UUIDs as specified in RFC 4122.
If all you want is a unique ID, you should probably call uuid1() ... | mit |
drgarcia1986/aiomcache | aiomcache/client.py | 1 | 13709 | import asyncio
import functools
import re
from . import constants as const
from .pool import MemcachePool
from .exceptions import ClientException, ValidationException
__all__ = ['Client']
def acquire(func):
@asyncio.coroutine
@functools.wraps(func)
def wrapper(self, *args, **kwargs):
conn = yi... | bsd-2-clause |
dushu1203/chromium.src | tools/telemetry/telemetry/core/discover_unittest.py | 42 | 1833 | # 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 os
import unittest
from telemetry.core import discover
from telemetry.core import util
class DiscoverTest(unittest.TestCase):
def setUp(self):
... | bsd-3-clause |
rghe/ansible | lib/ansible/modules/network/nxos/nxos_logging.py | 6 | 15484 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Ansible by Red Hat, inc
#
# This file is part of Ansible by Red Hat
#
# 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 Li... | gpl-3.0 |
tonioo/modoboa | modoboa/admin/templatetags/admin_tags.py | 1 | 8999 | # -*- coding: utf-8 -*-
"""Admin extension tags."""
from __future__ import unicode_literals
from functools import reduce
from django import template
from django.template.loader import render_to_string
from django.urls import reverse
from django.utils.safestring import mark_safe
from django.utils.translation import ... | isc |
batermj/algorithm-challenger | code-analysis/programming_anguage/python/source_codes/Python3.5.9/Python-3.5.9/Lib/lib2to3/pgen2/pgen.py | 40 | 13812 | # Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
# Pgen imports
from . import grammar, token, tokenize
class PgenGrammar(grammar.Grammar):
pass
class ParserGenerator(object):
def __init__(self, filename, stream=None):
close_stream =... | apache-2.0 |
eeshangarg/oh-mainline | vendor/packages/PyYaml/tests/lib3/test_emitter.py | 62 | 4305 |
import yaml
def _compare_events(events1, events2):
assert len(events1) == len(events2), (events1, events2)
for event1, event2 in zip(events1, events2):
assert event1.__class__ == event2.__class__, (event1, event2)
if isinstance(event1, yaml.NodeEvent):
assert event1.anchor == event... | agpl-3.0 |
ALSchwalm/python-prompt-toolkit | examples/autocompletion.py | 3 | 1095 | #!/usr/bin/env python
"""
Autocompletion example.
Press [Tab] to complete the current word.
- The first Tab press fills in the common part of all completions.
- The second Tab press shows all the completions. (In the menu)
- Any following tab press cycles through all the possible completions.
"""
from __future__ impor... | bsd-3-clause |
spikebachman/bootstrap | test-infra/s3_cache.py | 2166 | 5734 | #!/usr/bin/env python2.7
# pylint: disable=C0301
from __future__ import absolute_import, unicode_literals, print_function, division
from sys import argv
from os import environ, stat, chdir, remove as _delete_file
from os.path import dirname, basename, abspath, realpath, expandvars
from hashlib import sha256
from subpr... | mit |
whitepyro/debian_server_setup | lib/sqlalchemy/orm/sync.py | 78 | 4698 | # orm/sync.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
"""private module containing functions used for copying data
between instances based on jo... | gpl-3.0 |
nharraud/b2share | invenio/legacy/websubmit/file_metadata_plugins/extractor_plugin.py | 13 | 2472 | # This file is part of Invenio.
# Copyright (C) 2010, 2011 CERN.
#
# Invenio 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.
#
# Inveni... | gpl-2.0 |
savoirfairelinux/odoo | addons/account/project/wizard/project_account_analytic_line.py | 362 | 2343 | # -*- 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 |
markrawlingson/SickRage | sickbeard/postProcessor.py | 2 | 51246 | # Author: Nic Wolfe <nic@wolfeden.ca>
# URL: https://sickrage.tv
# Git: https://github.com/SiCKRAGETV/SickRage.git
#
# This file is part of SickRage.
#
# SickRage is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation... | gpl-3.0 |
linktlh/Toontown-journey | toontown/building/DistributedHQInterior.py | 4 | 8767 | import cPickle
import random
import ToonInteriorColors
from direct.directnotify import DirectNotifyGlobal
from direct.distributed import DistributedObject
from direct.task.Task import Task
from pandac.PandaModules import *
from toontown.toonbase import TTLocalizer
from toontown.toonbase.ToonBaseGlobal import *
from too... | apache-2.0 |
with-git/tensorflow | tensorflow/contrib/kernel_methods/python/losses.py | 31 | 5600 | # 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 |
AlexHatesUnicorns/FDTD_Solver | world_surface/helpers/output.py | 6 | 1132 | # -*- coding: utf-8 -*-
from PIL import Image
def output_array_to_file(arr, filename, size_x):
f = open(filename, 'w')
for i in range(len(arr)):
x = i % size_x
y = int(i / size_x)
f.write(' '.join([str(x), str(y), str(arr[i])]) + '\n')
f.close()
def output_png(arr, filename, max_... | mit |
d40223223/40223223w0511 | static/Brython3.1.0-20150301-090019/Lib/unittest/test/test_program.py | 738 | 10833 | import io
import os
import sys
import unittest
class Test_TestProgram(unittest.TestCase):
def test_discovery_from_dotted_path(self):
loader = unittest.TestLoader()
tests = [self]
expectedPath = os.path.abspath(os.path.dirname(unittest.test.__file__))
self.wasRun = False
... | gpl-3.0 |
pizzapanther/Church-Source | churchsource/static/gmedia/js/compress.py | 784 | 1896 | #!/usr/bin/env python
import os
import optparse
import subprocess
import sys
here = os.path.dirname(__file__)
def main():
usage = "usage: %prog [file1..fileN]"
description = """With no file paths given this script will automatically
compress all jQuery-based files of the admin app. Requires the Google Closure... | gpl-3.0 |
weaver-viii/h2o-3 | h2o-py/tests/testdir_hdfs/pyunit_HDFS_kmeans_converge_large.py | 1 | 2174 | #----------------------------------------------------------------------
# Purpose: This tests convergence of k-means on a large dataset.
#----------------------------------------------------------------------
import sys
sys.path.insert(1, "../../")
import h2o
def hdfs_kmeans_converge(ip, port):
# Check if ... | apache-2.0 |
waynedkim/sgs3-kernel | 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 |
klmitch/glance | glance/tests/functional/test_bin_glance_cache_manage.py | 11 | 11591 | # 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 requ... | apache-2.0 |
yjmade/odoo | addons/account_anglo_saxon/stock.py | 112 | 3767 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of t... | agpl-3.0 |
beni55/PyGithub | github/tests/BadAttributes.py | 39 | 8361 | # -*- coding: utf-8 -*-
# ########################## Copyrights and license ############################
# #
# Copyright 2013 Vincent Jacques <vincent@vincent-jacques.net> #
# ... | gpl-3.0 |
joshmoore/zeroc-ice | py/test/Ice/inheritance/AllTests.py | 1 | 4509 | # **********************************************************************
#
# Copyright (c) 2003-2011 ZeroC, Inc. All rights reserved.
#
# This copy of Ice is licensed to you under the terms described in the
# ICE_LICENSE file included in this distribution.
#
# ***********************************************************... | gpl-2.0 |
Jumpscale/web | pythonlib/flask_admin/contrib/sqla/tools.py | 3 | 6039 | from sqlalchemy import tuple_, or_, and_
from sqlalchemy.sql.operators import eq
from sqlalchemy.exc import DBAPIError
from ast import literal_eval
def parse_like_term(term):
if term.startswith('^'):
stmt = '%s%%' % term[1:]
elif term.startswith('='):
stmt = term[1:]
else:
stmt = '%... | apache-2.0 |
Elbagoury/odoo | addons/base_report_designer/plugin/openerp_report_designer/bin/script/ConvertBracesToField.py | 384 | 12556 | #########################################################################
#
# Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com
# Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>).
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser Gene... | agpl-3.0 |
LiveZenLK/CeygateERP | addons/stock/stock.py | 3 | 292002 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from datetime import date, datetime
from dateutil import relativedelta
import json
import time
import sets
import openerp
from openerp.osv import fields, osv
from openerp.tools.float_utils import float_compare, float_ro... | gpl-3.0 |
lmaycotte/quark | quark/protocols.py | 1 | 5838 | # Copyright 2014 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 requ... | apache-2.0 |
CSC-ORG/Dynamic-Dashboard-2015 | engine/lib/python2.7/site-packages/django/contrib/gis/geos/prototypes/geom.py | 114 | 4443 | from ctypes import c_char_p, c_int, c_size_t, c_ubyte, POINTER
from django.contrib.gis.geos.libgeos import CS_PTR, GEOM_PTR
from django.contrib.gis.geos.prototypes.errcheck import (
check_geom, check_minus_one, check_sized_string, check_string, check_zero)
from django.contrib.gis.geos.prototypes.threadsafe import G... | mit |
motion2015/edx-platform | common/djangoapps/cache_toolbox/templatetags/cache_toolbox.py | 239 | 2059 | from django import template
from django.core.cache import cache
from django.template import Node, TemplateSyntaxError, Variable
from django.template import resolve_variable
register = template.Library()
class CacheNode(Node):
def __init__(self, nodelist, expire_time, key):
self.nodelist = nodelist
... | agpl-3.0 |
sinpantuflas/aubio | waflib/Tools/gxx.py | 196 | 2806 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
from waflib.Tools import ccroot,ar
from waflib.Configure import conf
@conf
def find_gxx(conf):
cxx=conf.find_program(['g++','c++'],var='CXX')
cxx=conf.cmd_to_list(cxx)
conf... | gpl-3.0 |
bhargav/scikit-learn | sklearn/semi_supervised/label_propagation.py | 14 | 15965 | # coding=utf8
"""
Label propagation in the context of this module refers to a set of
semisupervised classification algorithms. In the high level, these algorithms
work by forming a fully-connected graph between all points given and solving
for the steady-state distribution of labels at each point.
These algorithms per... | bsd-3-clause |
frewsxcv/keyczar | cpp/src/tools/scons/scons-local-1.2.0.d20090223/SCons/Tool/MSCommon/netframework.py | 19 | 2839 | #
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 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 Software without restriction, including
# without limitati... | apache-2.0 |
xgcm/xhistogram | xhistogram/test/test_core.py | 1 | 12013 | import numpy as np
import pandas as pd
from itertools import combinations
import dask.array as dsa
from ..core import (
histogram,
_ensure_correctly_formatted_bins,
_ensure_correctly_formatted_range,
)
from .fixtures import empty_dask_array
import pytest
bins_int = 10
bins_str = "auto"
bins_arr = np.li... | mit |
elkingtonmcb/h2o-2 | py/testdir_multi_jvm/test_mixed_int_enum_many.py | 9 | 6340 | import unittest, time, sys, random, math, getpass
sys.path.extend(['.','..','../..','py'])
import h2o, h2o_cmd, h2o_import as h2i, h2o_util, h2o_print as h2p, h2o_browse as h2b
ENABLE_ASSERTS = False
ROWS = 1000000
COLS = 2
def write_syn_dataset(csvPathname, rowCount, colCount, SEED, enumChoices, intChoices):
r1... | apache-2.0 |
lelandg/PWM-Servo-Hat-Through-Apache-Demo | PiServed.py | 1 | 6694 | import _piserved
service = _piserved.PiServed()
page_text = """
<html>
<head>
</head>
<body>
<FORM value="form" action="/PiServed/show_info" method="post">
<table width="800" align="center" border="2">
<tr>
<td align="center">
<table columns="2" cellpadding="5" cellspacing="5">
... | mit |
shdevops/JAF-Dice-Roller | node_modules/node-gyp/gyp/pylib/gyp/ordered_dict.py | 2354 | 10366 | # Unmodified from http://code.activestate.com/recipes/576693/
# other than to add MIT license header (as specified on page, but not in code).
# Linked from Python documentation here:
# http://docs.python.org/2/library/collections.html#collections.OrderedDict
#
# This should be deleted once Py2.7 is available on all bot... | gpl-3.0 |
krintoxi/NoobSec-Toolkit | NoobSecToolkit /tools/inject/thirdparty/pagerank/pagerank.py | 17 | 2162 | #!/usr/bin/env python
#
# Script for getting Google Page Rank of page
# Google Toolbar 3.0.x/4.0.x Pagerank Checksum Algorithm
#
# original from http://pagerank.gamesaga.net/
# this version was adapted from http://www.djangosnippets.org/snippets/221/
# by Corey Goldberg - 2010
#
# important update (http://www.ser... | gpl-2.0 |
gugu/django-social-auth-1 | social_auth/views.py | 3 | 8032 | """Views
Notes:
* Some views are marked to avoid csrf tocken check because they rely
on third party providers that (if using POST) won't be sending csrf
token back.
"""
from urllib2 import quote
from django.http import HttpResponseRedirect, HttpResponse
from django.contrib.auth import login, REDIRECT_... | bsd-3-clause |
calexil/FightstickDisplay | pyglet/libs/x11/xf86vmode.py | 1 | 15292 | # ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# Copyright (c) 2008-2021 pyglet contributors
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the follo... | gpl-3.0 |
JGarcia-Panach/odoo | openerp/report/render/rml2pdf/__init__.py | 381 | 1101 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 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 |
l0ner/bcut | bcut/cutLine.py | 1 | 2237 | ####################################################################
#
# bcut - a better cut utility
#
# Copyright (C) 2014 Pawel 'l0ner' Soltys <pwslts@gmail.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 S... | gpl-3.0 |
lispc/Paddle | python/paddle/v2/framework/default_scope_funcs.py | 3 | 1916 | """
Default scope function.
`Paddle` manages Scope as programming language's scope. It just a
thread-local stack of Scope. Top of that stack is current scope, the bottom
of that stack is all scopes' parent.
Invoking `new_var/find_var` can `new/find` variable in current scope.
Invoking `enter_local_scope/leave_l... | apache-2.0 |
wkschwartz/django | tests/db_functions/migrations/0002_create_test_models.py | 44 | 3206 | from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('db_functions', '0001_setup_extensions'),
]
operations = [
migrations.CreateModel(
name='Author',
fields=[
('name', models.CharField(max_length=50)),
... | bsd-3-clause |
danieljohnlewis/pisces | test.py | 1 | 3938 | #! /usr/bin/env python
"""Minimal test harness for pisces package
Every test should raise AssertionError if it fails. The script prints
"test okay" when it finishes, which would be misleading if a test
failed but didn't raise an exception.
"""
from pisces.spkilib import spki
from pisces.utils import loadModule
imp... | mit |
yaroslavprogrammer/django-filebrowser-no-grappelli | filebrowser/tests/sites.py | 3 | 9809 | # coding: utf-8
"""
Tests for FileBrowser sites and their views.
Note that we *dynamically generate* test cases for each deployed FileBrowser site.
This includes creation of TestCase subclasses at runtime and also creation of
instance methods from functions.
"""
# PYTHON IMPORTS
import os
import sys
import shutil... | bsd-3-clause |
mcepl/youtube-dl | youtube_dl/extractor/tlc.py | 15 | 1578 | # encoding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from .brightcove import BrightcoveLegacyIE
from ..compat import compat_parse_qs
class TlcDeIE(InfoExtractor):
IE_NAME = 'tlc.de'
_VALID_URL = r'https?://www\.tlc\.de/(?:[^/]+/)*videos/(?P<title>[^/?#]+)?(?:.... | unlicense |
FlorianLudwig/odoo | addons/website_mail/controllers/main.py | 203 | 4237 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | agpl-3.0 |
rbian/avocado-vt | scripts/tapfd_helper.py | 12 | 1862 | #!/usr/bin/python
import sys
import os
import re
# simple magic for using scripts within a source tree
basedir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
if os.path.isdir(os.path.join(basedir, 'virttest')):
sys.path.append(basedir)
from virttest import utils_net
def destroy_tap(tapfd_list):
... | gpl-2.0 |
JimCircadian/ansible | lib/ansible/module_utils/network/cnos/cnos_errorcodes.py | 187 | 12205 | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by
# Ansible still belong to the author of the module, and may assign their own
# license to the complete wo... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.