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 |
|---|---|---|---|---|---|
kvar/ansible | lib/ansible/modules/network/f5/bigip_service_policy.py | 38 | 13122 | #!/usr/bin/python
# -*- 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
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
schumi2004/NOT_UPDATED_Sick-Beard-Dutch | lib/hachoir_core/field/link.py | 90 | 3184 | from lib.hachoir_core.field import Field, FieldSet, ParserError, Bytes, MissingField
from lib.hachoir_core.stream import FragmentedStream
class Link(Field):
def __init__(self, parent, name, *args, **kw):
Field.__init__(self, parent, name, 0, *args, **kw)
def hasValue(self):
return True
d... | gpl-3.0 |
flingone/frameworks_base_cmds_remoted | libs/boost/tools/build/src/tools/doxproc.py | 9 | 37762 | #!/usr/bin/python
# Copyright 2006 Rene Rivera
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
'''
Processing of Doxygen generated XML.
'''
import os
import os.path
import sys
import time
import string
import ... | apache-2.0 |
utilitarianexe/wiki_poverty_list_bot | create_table.py | 1 | 7817 | '''
dev things----------
update to use https://pypi.python.org/pypi/wbpy/2.0.1
we need tests
need to handle all error conditions
make sure all pylint is good
read all doc strings
code review
copy paste
redundant code
bad naming
---------need-----------
legend on image
upload image
image should save
readme notes on ima... | agpl-3.0 |
shinglyu/servo | tests/wpt/css-tests/tools/py/testing/path/test_svnauth.py | 163 | 16079 | import py
import svntestbase
from py.path import SvnAuth
import time
import sys
svnbin = py.path.local.sysfind('svn')
def make_repo_auth(repo, userdata):
""" write config to repo
user information in userdata is used for auth
userdata has user names as keys, and a tuple (password, readwrite) as
... | mpl-2.0 |
Kazade/NeHe-Website | google_appengine/lib/django-1.5/extras/csrf_migration_helper.py | 72 | 13037 | #!/usr/bin/env python
# This script aims to help developers locate forms and view code that needs to
# use the new CSRF protection in Django 1.2. It tries to find all the code that
# may need the steps described in the CSRF documentation. It does not modify
# any code directly, it merely attempts to locate it. Deve... | bsd-3-clause |
BlackPole/bp-dvbapp | lib/python/Screens/Dish.py | 9 | 5663 | # -*- coding: utf-8 -*-
from Screen import Screen
from Components.BlinkingPixmap import BlinkingPixmapConditional
from Components.Pixmap import Pixmap
from Components.config import config, ConfigInteger
from Components.Sources.Boolean import Boolean
from Components.Label import Label
from Components.ProgressBar import ... | gpl-2.0 |
drawks/ansible | lib/ansible/modules/network/avi/avi_serviceengine.py | 28 | 5958 | #!/usr/bin/python
#
# @author: Gaurav Rastogi (grastogi@avinetworks.com)
# Eric Anderson (eanderson@avinetworks.com)
# module_check: supported
#
# Copyright: (c) 2017 Gaurav Rastogi, <grastogi@avinetworks.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
ANSIB... | gpl-3.0 |
Linux-Box/lbgui | lib/python/Components/Converter/MovieReference.py | 43 | 1361 | # Movie Selection:
#<widget source="Service" render="Picon" position="1120,95" zPosition="14" size="100,60" transparent="12" alphatest="blend">
# <convert type="MovieReference"/>
#</widget>
# Movie Player Infobar:
#<widget source="session.CurrentService" render="Picon" position="1120,95" zPosition="14" size="100,60" tr... | gpl-2.0 |
tarzan0820/odoo | addons/account/edi/invoice.py | 342 | 13984 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2011-2012 OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of t... | agpl-3.0 |
alephu5/Soundbyte | environment/lib/python3.3/site-packages/sympy/simplify/tests/test_cse.py | 1 | 9707 | import itertools
from sympy import (Add, Pow, Symbol, exp, sqrt, symbols, sympify, cse,
Matrix, S, cos, sin, Eq, Function, Tuple, RootOf, IndexedBase, Idx, MatrixSymbol)
from sympy.simplify.cse_opts import sub_pre, sub_post
from sympy.functions.special.hyper import meijerg
from sympy.simplify import... | gpl-3.0 |
euroscipy/symposion | symposion/cms/models.py | 2 | 2066 | import datetime
import os
import re
from django.conf import settings
from django.core.urlresolvers import reverse
from django.core.exceptions import ValidationError
from django.db import models
from django.utils.translation import ugettext_lazy as _
from markitup.fields import MarkupField
from taggit.managers import... | bsd-3-clause |
FICTURE7/youtube-dl | youtube_dl/extractor/porn91.py | 27 | 2548 | # encoding: utf-8
from __future__ import unicode_literals
from ..compat import compat_urllib_parse
from .common import InfoExtractor
from ..utils import (
parse_duration,
int_or_none,
ExtractorError,
)
class Porn91IE(InfoExtractor):
IE_NAME = '91porn'
_VALID_URL = r'(?:https?://)(?:www\.|)91porn\... | unlicense |
low-sky/spectral-cube | spectral_cube/tests/test_regrid.py | 4 | 18594 | import sys
import pytest
import tempfile
import numpy as np
from astropy import units as u
from astropy import convolution
from astropy.wcs import WCS
from astropy import wcs
from astropy.io import fits
try:
import tracemalloc
tracemallocOK = True
except ImportError:
tracemallocOK = False
# The compariso... | bsd-3-clause |
nvbn/pysrt | setup.py | 1 | 1305 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
from setuptools import setup, find_packages
README = ''
try:
f = open('README.rst')
README = f.read()
f.close()
except:
pass
REQUIRES = []
if sys.version_info < (2, 6):
REQUIRES.append('chardet')
else:
REQUIRES.append('charade')
if sys.ver... | gpl-3.0 |
payeezy/payeezy | python/Dependancy/requests-master/requests/packages/urllib3/contrib/ntlmpool.py | 1010 | 4507 | """
NTLM authenticating pool, contributed by erikcederstran
Issue #10, see: http://code.google.com/p/urllib3/issues/detail?id=10
"""
try:
from http.client import HTTPSConnection
except ImportError:
from httplib import HTTPSConnection
from logging import getLogger
from ntlm import ntlm
from urllib3 import HTT... | mit |
aifil/odoo | addons/stock/res_config.py | 29 | 10812 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from openerp.osv import fields, osv
from openerp.tools.translate import _
class res_company(osv.osv):
_inherit = "res.company"
_columns = {
'propagation_minimum_delta': fields.integer('Minimum Delta for ... | gpl-3.0 |
thousandparsec/daneel-ai | extra/objectutils.py | 2 | 7047 | """\
This file contains functions used to deal with objects.
"""
from tp.netlib.objects import Structures
from tp.netlib.objects import parameters
from tp.netlib import objects
from tp.netlib import GenericRS
def getPositionList(obj):
"""
Get a list of the position references of a DynamicObject as tu... | gpl-2.0 |
mganeva/mantid | Framework/PythonInterface/test/python/plugins/algorithms/WorkflowAlgorithms/sans/SANSCreateAdjustmentWorkspacesTest.py | 1 | 10642 | # Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source
# & Institut Laue - Langevin
# SPDX - License - Identifier: GPL - 3.0 +
from __future__ import (absolute_import, divi... | gpl-3.0 |
zdary/intellij-community | python/helpers/generator3/module_redeclarator.py | 10 | 53225 | from generator3.core import OriginType
from generator3.util_methods import *
from generator3.util_methods import get_relative_path_by_qname
from generator3.docstring_parsing import *
class emptylistdict(dict):
"""defaultdict not available before 2.5; simplest reimplementation using [] as default"""
def __get... | apache-2.0 |
ODInfoBiz/pyyacp | pyyacp/testing/test_format_aggregator.py | 1 | 2644 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import unittest
import sys
from random import randint, shuffle
from pyyacp.column_format_detector import aggregate, aggregate_group_of_same_symbols
from pyyacp.testing.value_pattern_types_list import random_number, random_date, random_time, random_iso860... | mit |
sunlianqiang/kbengine | kbe/res/scripts/common/Lib/site-packages/setuptools/tests/test_markerlib.py | 449 | 2506 | import os
import unittest
from setuptools.tests.py26compat import skipIf
try:
import ast
except ImportError:
pass
class TestMarkerlib(unittest.TestCase):
@skipIf('ast' not in globals(),
"ast not available (Python < 2.6?)")
def test_markers(self):
from _markerlib import interpret, defa... | lgpl-3.0 |
bssrikanth/virt-test | virttest/installer_unittest.py | 17 | 1934 | #!/usr/bin/python
import unittest
import common
import installer
import cartesian_config
class installer_test(unittest.TestCase):
def setUp(self):
self.registry = installer.InstallerRegistry()
def test_register_get_installer(self):
install_mode = 'custom_install_mode'
virt_type = '... | gpl-2.0 |
bitcrystal/volatility | volatility/plugins/overlays/windows/tcpip_vtypes.py | 44 | 13881 | # Volatility
#
# This file is part of Volatility.
#
# Volatility 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.
#
# Volatility is dist... | gpl-2.0 |
mrquim/mrquimrepo | repo/plugin.program.super.favourites/globalSearch.py | 7 | 2283 | # Copyright (C) 2013-2014
# Sean Poyser (seanpoyser@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 Software Foundation; either version 2, or (at your option)
# any later version.
#
# T... | gpl-2.0 |
wuyuewen/libcloud | libcloud/compute/drivers/runabove.py | 12 | 15316 | # 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 |
gauribhoite/personfinder | env/google_appengine/google/appengine/tools/os_compat.py | 8 | 1395 | #!/usr/bin/env python
#
# Copyright 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 o... | apache-2.0 |
paypal/keystone | keystone/token/backends/memcache.py | 4 | 4968 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 OpenStack LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | apache-2.0 |
Eksmo/calibre | src/calibre/web/feeds/recipes/collection.py | 1 | 19062 | #!/usr/bin/env python
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
from __future__ import with_statement
__license__ = 'GPL v3'
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import os, calendar, zipfile
from threading import RLock
from datetime import timedel... | gpl-3.0 |
metacloud/python-openstackclient | openstackclient/compute/v2/aggregate.py | 4 | 9543 | # Copyright 2012 OpenStack Foundation
# Copyright 2013 Nebula 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... | apache-2.0 |
carljm/django | tests/lookup/models.py | 41 | 2205 | """
The lookup API
This demonstrates features of the database API.
"""
from __future__ import unicode_literals
from django.db import models
from django.utils import six
from django.utils.encoding import python_2_unicode_compatible
class Alarm(models.Model):
desc = models.CharField(max_length=100)
time = mo... | bsd-3-clause |
suranap/qiime | qiime/parallel/assign_taxonomy.py | 15 | 6565 | #!/usr/bin/env python
from __future__ import division
__author__ = "Jai Ram Rideout"
__copyright__ = "Copyright 2012, The QIIME project"
__credits__ = ["Jai Ram Rideout"]
__license__ = "GPL"
__version__ = "1.9.1-dev"
__maintainer__ = "Jai Ram Rideout"
__email__ = "jai.rideout@gmail.com"
from bfillings.formatdb import... | gpl-2.0 |
veger/ansible | test/units/modules/network/f5/test_bigiq_application_fastl4_tcp.py | 21 | 5130 | # -*- 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 |
MERegistro/meregistro | django/conf/project_template/settings.py | 65 | 3389 | # Django settings for {{ project_name }} project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@domain.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
... | bsd-3-clause |
Alberto-Beralix/Beralix | i386-squashfs-root/usr/share/pyshared/chardet/langhebrewmodel.py | 235 | 11340 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Simon Montagu
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved... | gpl-3.0 |
beeftornado/sentry | src/sentry/utils/json.py | 1 | 4342 | # Avoid shadowing the standard library json module
from __future__ import absolute_import
# XXX(epurkhiser): We import JSONDecodeError just to have it be exported as
# part of this module. We don't use it directly within the module, but modules
# that import it from here will. Do not remove.
from simplejson import JSO... | bsd-3-clause |
h4ck3rm1k3/FEC-Field-Documentation | fec/version/v6_4/F91.py | 6 | 1125 | import fechbase
class Records(fechbase.RecordsBase):
def __init__(self):
fechbase.RecordsBase.__init__(self)
self.fields = [
{'name': 'FORM TYPE', 'number': '1'},
{'name': 'FILER COMMITTEE ID NUMBER', 'number': '2'},
{'name': 'TRANSACTION ID NUMBER', 'number': '3'... | unlicense |
Voluntarynet/BitmessageKit | BitmessageKit/Vendor/static-python/Lib/plat-irix6/FILE.py | 66 | 11296 | # Generated by h2py from /usr/include/sys/file.h
from warnings import warnpy3k
warnpy3k("the FILE module has been removed in Python 3.0", stacklevel=2)
del warnpy3k
# Included from standards.h
# Included from sys/types.h
# Included from sgidefs.h
_MIPS_ISA_MIPS1 = 1
_MIPS_ISA_MIPS2 = 2
_MIPS_ISA_MIPS3 = 3
_MIPS_ISA_... | mit |
repotvsupertuga/tvsupertuga.repository | script.module.streamtvsupertuga/lib/resources/lib/indexers/tvshows.py | 1 | 54234 | # -*- coding: utf-8 -*-
'''
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 distributed in... | gpl-2.0 |
poswald/django-endless-pagination | endless_pagination/tests/test_models.py | 7 | 10909 | """Model tests."""
from __future__ import unicode_literals
from contextlib import contextmanager
from django.test import TestCase
from django.test.client import RequestFactory
from endless_pagination import (
models,
settings,
utils,
)
from endless_pagination.paginators import DefaultPaginator
@context... | mit |
thalamus/Flexget | flexget/plugins/output/subtitles_subliminal.py | 3 | 8293 | import collections
import logging
import os
import sys
import tempfile
from flexget import plugin
from flexget.event import event
log = logging.getLogger('subtitles')
PROVIDERS = [
'opensubtitles',
'thesubdb',
'podnapisi',
'addic7ed',
'tvsubtitles'
]
class PluginSubliminal(object):
"""
... | mit |
tecan/xchat-rt | plugins/scripts/Supybot-0.83.4.1-bitcoinotc-bot/plugins/Later/plugin.py | 6 | 6786 | ###
# Copyright (c) 2004, Jeremiah Fincher
# 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 conditi... | gpl-2.0 |
attackjz/Cocos2d-x_CustomSliderList | CustomSliderList/cocos2d/plugin/tools/android-build.py | 240 | 5896 | #!/usr/bin/python
# android-build.py
# Build android samples
import sys
import os, os.path
import shutil
from optparse import OptionParser
CPP_SAMPLES = ["HelloPlugins"]
ALL_SAMPLES = CPP_SAMPLES
def check_environment_variables():
''' Checking the environment NDK_ROOT, which will be used for building
'''
... | mit |
manipopopo/tensorflow | tensorflow/contrib/remote_fused_graph/pylib/__init__.py | 96 | 1290 | # 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 |
OpenPymeMx/OCB | addons/contacts/__openerp__.py | 119 | 1623 | # -*- 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 |
pgmillon/ansible | test/units/module_utils/conftest.py | 80 | 2314 | # Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
import json
import sys
from io import BytesIO
import pytest
import ansible.module_utils.basic
from ansible.module_utils.six import PY3, string_types
from ansible.module_utils._text import... | gpl-3.0 |
udienz/ubuntu-cdimage | cdimage/lib/cdimage/osextras.py | 2 | 3303 | # Copyright (C) 2012 Canonical Ltd.
# Author: Colin Watson <cjwatson@ubuntu.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; version 3 of the License.
#
# This program is distributed in the... | gpl-2.0 |
dbarbier/privot | python/test/t_ComplexMatrix_std.py | 1 | 4842 | #! /usr/bin/env python
from openturns import *
from math import *
TESTPREAMBLE()
try:
# DEFAULT CONSTRUCTOR AND STRING CONVERTER
print "test 0 : default constructor and string converter"
# Default constructor
matrix0 = ComplexMatrix()
# String converter
print "matrix0 = " , repr(matrix0)... | lgpl-3.0 |
LEDS/mapabem-backend | wsgi/mb_backend/core/views.py | 1 | 4454 | from django.shortcuts import render,get_object_or_404
from rest_framework import generics
from django.contrib.auth.models import User
from rest_framework import permissions
from .permissions import IsOwnerOrReadOnly
from rest_framework.authentication import SessionAuthentication, BasicAuthentication
from django.contrib... | lgpl-3.0 |
dabiboo/youtube-dl | youtube_dl/extractor/daum.py | 118 | 2755 | # encoding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import (
compat_urllib_parse,
)
class DaumIE(InfoExtractor):
_VALID_URL = r'https?://(?:m\.)?tvpot\.daum\.net/(?:v/|.*?clipid=)(?P<id>[^?#&]+)'
IE_NAME = 'daum.net'
_TESTS = [{
... | unlicense |
robertwb/incubator-beam | sdks/python/apache_beam/testing/benchmarks/nexmark/models/auction_bid.py | 5 | 2026 | #
# 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 |
pong3489/TEST_Mission | Lib/dummy_threading.py | 70 | 2882 | """Faux ``threading`` version using ``dummy_thread`` instead of ``thread``.
The module ``_dummy_threading`` is added to ``sys.modules`` in order
to not have ``threading`` considered imported. Had ``threading`` been
directly imported it would have made all subsequent imports succeed
regardless of whether ``thread... | gpl-3.0 |
bjorand/python-social-auth | social/tests/backends/test_utils.py | 80 | 1776 | import unittest2 as unittest
from social.tests.models import TestStorage
from social.tests.strategy import TestStrategy
from social.backends.utils import load_backends, get_backend
from social.backends.github import GithubOAuth2
from social.exceptions import MissingBackend
class BaseBackendUtilsTest(unittest.TestCas... | bsd-3-clause |
smallyear/linuxLearn | salt/salt/states/rabbitmq_plugin.py | 3 | 2921 | # -*- coding: utf-8 -*-
'''
Manage RabbitMQ Plugins
=======================
.. versionadded:: 2014.1.0
Example:
.. code-block:: yaml
some_plugin:
rabbitmq_plugin.enabled: []
'''
# Import Python Libs
from __future__ import absolute_import
import logging
# Import Salt Libs
from salt.exceptions import Comm... | apache-2.0 |
GreenJoey/My-Simple-Programs | python/scrapy/OfficialSpider/tutorial/tutorial/middlewares.py | 13 | 1882 | # -*- coding: utf-8 -*-
# Define here the models for your spider middleware
#
# See documentation in:
# http://doc.scrapy.org/en/latest/topics/spider-middleware.html
from scrapy import signals
class TutorialSpiderMiddleware(object):
# Not all methods need to be defined. If a method is not defined,
# scrapy ... | gpl-2.0 |
nijel/weblate | weblate/addons/discovery.py | 2 | 2378 | #
# Copyright © 2012 - 2021 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <https://weblate.org/>
#
# 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 Lice... | gpl-3.0 |
adamtiger/tensorflow | tensorflow/contrib/slim/python/slim/data/prefetch_queue.py | 63 | 3559 | # 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 |
stephenpascoe/luigi | test/dynamic_import_test.py | 19 | 1462 | # -*- 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 |
GhostSquad57/discord-bot | main.py | 1 | 3804 | import discord
from discord.ext import commands
import random
import sys
import re
import smug_anime
import watchlist
import music
description = """An example bot to showcase the discord.ext.commands extension
module.
There are a number of utility commands being showcased here."""
bot = commands.Bot(command_prefix='$'... | mit |
vicnet/weboob | modules/wordreference/browser.py | 2 | 1427 | # -*- coding: utf-8 -*-
# Copyright(C) 2012 Lucien Loiseau
#
# This file is part of a weboob module.
#
# This weboob module is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the Licen... | lgpl-3.0 |
unreal666/outwiker | src/test/core/test_version.py | 2 | 6473 | # -*- coding: UTF-8 -*-
import unittest
from outwiker.core.version import Version, Status, StatusSet
class StatusTest(unittest.TestCase):
def setUp(self):
pass
def testEqual(self):
self.assertTrue(StatusSet.DEV == StatusSet.DEV)
self.assertTrue(StatusSet.BETA == StatusSet.BETA)
... | gpl-3.0 |
mazaclub/electrum-dash | gui/qt/address_dialog.py | 2 | 2527 | #!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2012 thomasv@gitorious
#
# 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... | gpl-3.0 |
tuxfux-hlp-notes/python-batches | archieves/batch-57/modules/sheets/lib/python2.7/site-packages/pip/commands/check.py | 336 | 1382 | import logging
from pip.basecommand import Command
from pip.operations.check import check_requirements
from pip.utils import get_installed_distributions
logger = logging.getLogger(__name__)
class CheckCommand(Command):
"""Verify installed packages have compatible dependencies."""
name = 'check'
usage =... | gpl-3.0 |
vikas1885/test1 | openedx/core/djangoapps/credit/migrations/0011_auto__add_field_creditrequirement_order.py | 79 | 12467 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'CreditRequirement.order'
db.add_column('credit_creditrequ... | agpl-3.0 |
blaggacao/OpenUpgrade | addons/stock/__openerp__.py | 261 | 4008 | # -*- 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 |
svn2github/exiv2_ | msvc/configure.py | 1 | 16725 | #!/usr/bin/env python3
import os
import sys
import uuid
import optparse
import datetime
import platform
import xml.dom.minidom
def empty():
return set([])
global uid # dict: UID of every projects
global project # dict: dependency sets for every project
global strings # dict: Visual Studio Strings
globa... | gpl-2.0 |
btcgroup2/bitcoin | contrib/testgen/base58.py | 99 | 2978 | # Copyright (c) 2012-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Bitcoin base58 encoding and decoding.
Based on https://bitcointalk.org/index.php?topic=1026.0 (public domain)
'''
import has... | mit |
bikong2/django | tests/httpwrappers/tests.py | 179 | 27774 | # -*- encoding: utf-8 -*-
from __future__ import unicode_literals
import copy
import json
import os
import pickle
import unittest
import uuid
from django.core.exceptions import SuspiciousOperation
from django.core.serializers.json import DjangoJSONEncoder
from django.core.signals import request_finished
from django.d... | bsd-3-clause |
slaff/attachix | server/core/notify/plugins/available/changes.py | 1 | 2343 | from core.models.event import Event
from core.notify.plugins import base
import core.utils as utils
import time
import urlparse
class Plugin(base.Plugin):
subscribe = ['PUT', 'MKCOL','POST', 'PROPPATCH', 'COPY','MOVE', 'DELETE']
name = 'Changes Plugin'
description = 'Plugin that reports changes of a fi... | mit |
cdegroc/scikit-learn | benchmarks/bench_sgd_covertype.py | 1 | 7493 | """
================================
Covertype dataset with dense SGD
================================
Benchmark stochastic gradient descent (SGD), Liblinear, and Naive Bayes, CART
(decision tree), RandomForest and Extra-Trees on the forest covertype dataset
of Blackard, Jock, and Dean [1]. The dataset comprises 581,0... | bsd-3-clause |
tbachman/group-based-policy | gbpservice/neutron/db/migration/alembic_migrations/versions/1fadeb573886_es_ip_allocation_fix_constraints.py | 3 | 1577 | # Copyright 2014 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | apache-2.0 |
tmtowtdi/MontyLacuna | lib/lacuna/binutils/libspies_report.py | 1 | 7463 |
import lacuna, lacuna.binutils.libbin
import lacuna.exceptions as err
import argparse, csv, os, sys
class PlanetSpyData():
""" Contains the data gathered on spies homed from a single planet.
"""
def __init__(self, pname, spies):
self.pname = pname
self.spies = spies
def _organize_co... | mit |
adocherty/polymode | tests/old/test_blockarray.py | 5 | 3513 | #Unit test for VWE_Action
from __future__ import division
from numpy import *
from numpy.testing import *
#--------------------------------------------------------------------------
import sys,os
sys.path.append(os.pardir)
#--------------------------------------------------------------------------
from Polymode.mat... | gpl-3.0 |
BoyuanYan/CIFAR-10 | cs231n/vis_utils.py | 1 | 1944 | from math import sqrt, ceil
import numpy as np
def visualize_grid(Xs, ubound=255.0, padding=1):
"""
Reshape a 4D tensor of image data to a grid for easy visualization.
Inputs:
- Xs: Data of shape (N, H, W, C)
- ubound: Output grid will have values scaled to the range [0, ubound]
- padding: The number of b... | apache-2.0 |
datamade/la-metro-councilmatic | lametro/views.py | 1 | 27586 | import re
from itertools import groupby
from operator import attrgetter
import itertools
import urllib
import json
from datetime import date, timedelta, datetime, MINYEAR
from dateutil.relativedelta import relativedelta
from dateutil import parser
import requests
import sqlalchemy as sa
from collections import namedtup... | mit |
edulramirez/nova | nova/tests/unit/scheduler/test_host_filters.py | 67 | 1522 | # Copyright 2011 OpenStack Foundation # All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | apache-2.0 |
wobh/xpython | space-age/space_age_test.py | 15 | 1528 | import unittest
from space_age import SpaceAge
class SpaceAgeTest(unittest.TestCase):
def test_age_in_seconds(self):
age = SpaceAge(1e6)
self.assertEqual(1e6, age.seconds)
def test_age_in_earth_years(self):
age = SpaceAge(1e9)
self.assertEqual(31.69, age.on_earth())
def ... | mit |
pombreda/https-gitorious.org-appstream-software-center | apt-xapian-index-plugin/software-center.py | 3 | 5723 | # add software-center custom metadata to the index
import apt
import os
import sys
import xapian
sys.path.insert(0, "/usr/share/software-center")
from softwarecenter.enums import (
CustomKeys,
XapianValues,
)
from softwarecenter.db.update import index_name
from softwarecenter.distro import get_distro
cl... | gpl-3.0 |
digideskio/lets-encrypt-preview | acme/jose/b64.py | 3 | 1459 | """JOSE Base64.
`JOSE Base64`_ is defined as:
- URL-safe Base64
- padding stripped
.. _`JOSE Base64`:
https://tools.ietf.org/html/draft-ietf-jose-json-web-signature-37#appendix-C
.. warning:: Do NOT try to call this module "base64",
as it will "shadow" the standard library.
"""
import base64
def b64... | apache-2.0 |
yangming85/lettuce | tests/integration/lib/Django-1.3/django/test/simple.py | 150 | 15012 | import unittest as real_unittest
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.db.models import get_app, get_apps
from django.test import _doctest as doctest
from django.test.utils import setup_test_environment, teardown_test_environment
from django.test.testcases ... | gpl-3.0 |
kapilt/cloud-custodian | c7n/filters/offhours.py | 5 | 24223 | # Copyright 2015-2017 Capital One Services, 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 ... | apache-2.0 |
philippjfr/bokeh | bokeh/tests/test___main__.py | 2 | 1798 | #-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2017, Anaconda, Inc. All rights reserved.
#
# Powered by the Bokeh Development Team.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#---------------------------------------------------... | bsd-3-clause |
intermezzo-fr/onedrive-d | onedrive_d/api/items.py | 2 | 6619 | from onedrive_d import str_to_datetime
from onedrive_d.api import resources
from onedrive_d.api import facets
class OneDriveItemTypes:
FILE = 'file'
FOLDER = 'folder'
IMAGE = 'image'
PHOTO = 'photo'
AUDIO = 'audio'
VIDEO = 'video'
ALL = [FOLDER, IMAGE, PHOTO, AUDIO, VIDEO, FILE... | gpl-3.0 |
jbu/personis | personis/client/__init__.py | 1 | 27443 | '''
.. module:: personis.client
:platform: Unix, Windows
:synopsis: Client for the personis user model server
'''
__docformat__ = "restructuredtext en"
import time
import httplib2
from util import *
import logging
class Connection(object):
"""Connection object
Contains the state of you... | gpl-3.0 |
Jgarcia-IAS/ReporsitorioVacioOdoo | openerp/addons/website_report/report.py | 257 | 2124 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2014-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 |
icebluesun/nflgame | nflgame/update_players.py | 7 | 18467 | # Here's an outline of how this program works.
# Firstly, we load a dictionary mapping GSIS identifier to a dictionary of
# player meta data. This comes from either the flag `json-update-file` or
# nflgame's "players.json" file. We then build a reverse map from profile
# identifier (included in player meta data) to GSI... | unlicense |
rabipanda/tensorflow | tensorflow/python/keras/wrappers/scikit_learn/__init__.py | 73 | 1062 | # 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 |
pjryan126/solid-start-careers | store/api/glassdoor/venv/lib/python2.7/site-packages/setuptools/tests/test_svn.py | 300 | 7806 | # -*- coding: utf-8 -*-
"""svn tests"""
import io
import os
import subprocess
import sys
import unittest
from setuptools.tests import environment
from setuptools.compat import unicode, unichr
from setuptools import svn_utils
from setuptools.tests.py26compat import skipIf
def _do_svn_check():
try:
subpro... | gpl-2.0 |
ksachs/invenio | modules/bibrank/lib/bibrank_regression_tests.py | 13 | 8207 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 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 ... | gpl-2.0 |
irachex/gunicorn | tests/test_010-statsd.py | 2 | 1641 | from datetime import timedelta
import t
from gunicorn.config import Config
from gunicorn.instrument.statsd import Statsd
class TestException(Exception): pass
class MockSocket(object):
"Pretend to be a UDP socket"
def __init__(self, failp):
self.failp = failp
self.msgs = [] # accumulate mess... | mit |
jameswatt2008/jameswatt2008.github.io | python/Python核心编程/网络编程/截图和代码/概述、SOCKET/多进程copy文件/test/asyncore.py | 13 | 20104 | # -*- Mode: Python -*-
# Id: asyncore.py,v 2.51 2000/09/07 22:29:26 rushing Exp
# Author: Sam Rushing <rushing@nightmare.com>
# ======================================================================
# Copyright 1996 by Sam Rushing
#
# All Rights Reserved
#
# Permission to use, copy, modify,... | gpl-2.0 |
mgit-at/ansible | lib/ansible/module_utils/cloudscale.py | 70 | 2876 | # -*- coding: utf-8 -*-
#
# (c) 2017, Gaudenz Steinlin <gaudenz.steinlin@cloudscale.ch>
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
import json
from ansible.module_util... | gpl-3.0 |
FabriceLapeyrere/audiostories-python | modules/user/__init__.py | 1 | 5884 | import db, ws, sys, hashlib, json
this = sys.modules[__name__]
def build_users(entries):
res=[]
for e in entries:
e['verrou']=ws.get_verrou('user/%s' % (e['id']))
res.append(e)
return res
def get_users(iduser):
return db.connexion.runQuery("SELECT id, login, name, role FROM users WHERE active=1").addCallback(t... | gpl-3.0 |
ksen007/jalangi2 | scripts/runalltests.py | 1 | 1328 | # Copyright 2013 Samsung Information Systems America, 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 applica... | apache-2.0 |
borisroman/vdsm | vdsm/storage/iscsi.py | 1 | 19378 | #
# Copyright 2009-2012 Red Hat, 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 2 of the License, or
# (at your option) any later version.
#
# This program is distributed ... | gpl-2.0 |
luistorresm/odoo | addons/email_template/html2text.py | 440 | 14143 | #!/usr/bin/env python
"""html2text: Turn HTML into equivalent Markdown-structured text."""
__version__ = "2.36"
__author__ = "Aaron Swartz (me@aaronsw.com)"
__copyright__ = "(C) 2004-2008 Aaron Swartz. GNU GPL 3."
__contributors__ = ["Martin 'Joey' Schulze", "Ricardo Reyes", "Kevin Jay North"]
# TODO:
# Support deco... | agpl-3.0 |
cmorgan/pybrain | pybrain/rl/environments/cartpole/doublepole.py | 25 | 1795 | __author__ = 'Tom Schaul, tom@idsia.ch'
from .cartpole import CartPoleEnvironment
from pybrain.rl.environments import Environment
class DoublePoleEnvironment(Environment):
""" two poles to be balanced from the same cart. """
indim = 1
ooutdim = 6
def __init__(self):
self.p1 = CartPoleEnviro... | bsd-3-clause |
provaleks/o8 | addons/mail/mail_vote.py | 439 | 1647 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2012-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 |
liamhawkes/ukvi_services_govuk | node_modules/node-gyp/gyp/pylib/gyp/generator/ninja_test.py | 1843 | 1786 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
""" Unit tests for the ninja.py file. """
import gyp.generator.ninja as ninja
import unittest
import StringIO
import sys
import TestCommon
... | mit |
SethMMorton/input_reader | input_reader/tests/test_block.py | 1 | 4972 | from __future__ import unicode_literals
from input_reader import InputReader, ReaderError, SUPPRESS, Namespace
from pytest import raises, fixture
from re import search
def test_block_missing_keyname():
r = InputReader()
with raises(TypeError):
r.add_block_key()
with raises(TypeError):
r.add... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.