repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values |
|---|---|---|---|---|---|
juliakreutzer/bandit-neuralmonkey | neuralmonkey/decoders/word_alignment_decoder.py | 1 | 3918 | from typing import cast
import numpy as np
import tensorflow as tf
from neuralmonkey.dataset import Dataset
from neuralmonkey.encoders.recurrent import RecurrentEncoder
from neuralmonkey.decoders.decoder import Decoder
from neuralmonkey.logging import warn
from neuralmonkey.model.model_part import ModelPart, FeedDict... | bsd-3-clause |
ralphbean/ansible | lib/ansible/runner/action_plugins/set_fact.py | 133 | 1754 | # Copyright 2013 Dag Wieers <dag@wieers.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 versio... | gpl-3.0 |
taliax/easybuild-easyblocks | easybuild/easyblocks/m/metavelvet.py | 12 | 2000 | ##
# This file is an EasyBuild reciPY as per https://github.com/hpcugent/easybuild
#
# Copyright:: Copyright 2012-2015 Uni.Lu/LCSB, NTUA
# Authors:: Cedric Laczny <cedric.laczny@uni.lu>, Fotis Georgatos <fotis@cern.ch>, Kenneth Hoste
# License:: MIT/GPL
# $Id$
#
# This work implements a part of the HPCBIOS project ... | gpl-2.0 |
mrquim/repository.mrquim | plugin.video.mrpiracy/resources/lib/Player.py | 4 | 9729 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import os, base64
import xbmcgui
import xbmc
import xbmcvfs
import time
import urllib
import urllib2
import re
import sys
import traceback
import json
import Trakt
import Database
from t0mm0.common.net import Net
import mrpiracy
import controlo
__HEADERS__ = {'User-Agent': '... | gpl-2.0 |
fbsder/openthread | tests/scripts/thread-cert/Cert_9_2_15_PendingPartition.py | 5 | 5744 | #!/usr/bin/env python
#
# Copyright (c) 2016, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# ... | bsd-3-clause |
rscnt/django-cms | cms/south_migrations/0037_auto__del_pagemoderator__del_field_globalpagepermission_can_moderate__.py | 48 | 17126 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
try:
from django.contrib.auth import get_user_model
except ImportError: # django < 1.5
from django.contrib.auth.models import User
else:
User = get_user_model()
user_orm_label... | bsd-3-clause |
gram001/UkrainianCadastralMap | test/test_init.py | 121 | 1860 | # coding=utf-8
"""Tests QGIS plugin init."""
__author__ = 'Tim Sutton <tim@linfiniti.com>'
__revision__ = '$Format:%H$'
__date__ = '17/10/2010'
__license__ = "GPL"
__copyright__ = 'Copyright 2012, Australia Indonesia Facility for '
__copyright__ += 'Disaster Reduction'
import os
import unittest
import logging
import ... | gpl-2.0 |
JulienRst/OpenGLIMAC | files/third-party/gtest-1.7.0/test/gtest_break_on_failure_unittest.py | 2140 | 7339 | #!/usr/bin/env python
#
# Copyright 2006, 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... | mit |
Endika/mhn | server/mhn/common/clio.py | 8 | 16160 | """
Clio
Mnemosyne Client Library
ThreatStream 2014
"""
import pymongo
from dateutil.parser import parse as parse_date
from collections import Counter
from bson import ObjectId, son
import json
import datetime
class Clio():
"""
Main interface for Clio - Mnemosyne Client Library -
Usage:
clio = Clio... | lgpl-2.1 |
citrix-openstack-build/nova | nova/test.py | 8 | 11356 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compli... | apache-2.0 |
msebire/intellij-community | python/helpers/python-skeletons/cStringIO.py | 80 | 2717 | """Skeleton for 'cStringIO' stdlib module."""
import cStringIO
def StringIO(s=None):
"""Return a StringIO-like stream for reading or writing.
:type s: T <= bytes | unicode
:rtype: cStringIO.OutputType[T]
"""
return cStringIO.OutputType(s)
class OutputType(object):
def __init__(self, s):
... | apache-2.0 |
JamesSample/ecosystem_services_impacts | Code/01_es_lu_cc.py | 1 | 21539 | #------------------------------------------------------------------------------
# Name: 01_es_lu_cc.py
# Purpose: Processing for the CREW project on ES, LUC and CC.
#
# Author: James Sample
#
# Created: 14/01/2015
# Copyright: (c) James Sample and JHI, 2015
# License: https://github.com/JamesS... | mit |
ktritz/vispy | vispy/util/svg/style.py | 22 | 1727 | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (c) 2014, Nicolas P. Rougier
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
# -----------------------------------------------------------------------------
from . color import ... | bsd-3-clause |
Stupeflix/django-haystack | example_project/regular_app/search_indexes.py | 22 | 1337 | # encoding: utf-8
from __future__ import absolute_import, division, print_function, unicode_literals
from regular_app.models import Dog
from haystack import indexes
# More typical usage involves creating a subclassed `SearchIndex`. This will
# provide more control over how data is indexed, generally resulting in b... | bsd-3-clause |
noba3/KoTos | lib/libUPnP/Neptune/Build/Tools/SCons/gcc-generic.py | 199 | 1249 | import os
def generate(env, gcc_cross_prefix=None, gcc_strict=True, gcc_stop_on_warning=None):
if gcc_stop_on_warning == None: gcc_stop_on_warning = env['stop_on_warning']
### compiler flags
if gcc_strict:
env.AppendUnique(CCFLAGS = ['-pedantic', '-Wall', '-W', '-Wundef', '-Wno-long-long'])
... | gpl-2.0 |
tinloaf/home-assistant | tests/components/luftdaten/test_config_flow.py | 12 | 3701 | """Define tests for the Luftdaten config flow."""
from datetime import timedelta
from unittest.mock import patch
from homeassistant import data_entry_flow
from homeassistant.components.luftdaten import DOMAIN, config_flow
from homeassistant.components.luftdaten.const import CONF_SENSOR_ID
from homeassistant.const impo... | apache-2.0 |
exploreodoo/datStruct | odoo/addons/sale_mrp/__openerp__.py | 262 | 1912 | # -*- 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... | gpl-2.0 |
Antiun/odoo | addons/product/product.py | 5 | 69698 | # -*- 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 |
WoLpH/EventGhost | lib27/site-packages/tornado/gen.py | 15 | 44093 | """``tornado.gen`` is a generator-based interface to make it easier to
work in an asynchronous environment. Code using the ``gen`` module
is technically asynchronous, but it is written as a single generator
instead of a collection of separate functions.
For example, the following asynchronous handler:
.. testcode::
... | gpl-2.0 |
pangolinfc/gensim | gensim/models/lda_dispatcher.py | 48 | 6724 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2010 Radim Rehurek <radimrehurek@seznam.cz>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
USAGE: %(program)s SIZE_OF_JOBS_QUEUE
Dispatcher process which orchestrates distributed LDA computations. Run this \
script onl... | gpl-3.0 |
Abner1zhou/awesome-python3-webapp | www/markdown2.py | 59 | 97819 | #!/usr/bin/env python
# Copyright (c) 2012 Trent Mick.
# Copyright (c) 2007-2008 ActiveState Corp.
# License: MIT (http://www.opensource.org/licenses/mit-license.php)
from __future__ import generators
r"""A fast and complete Python implementation of Markdown.
[from http://daringfireball.net/projects/markdown/]
> Mar... | gpl-3.0 |
dreamhost/ceilometer | ceilometer/openstack/common/rpc/impl_zmq.py | 2 | 27115 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 Cloudscaling Group, 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/LI... | apache-2.0 |
Tinychat/Tinychat-Bot | pyamf/tests/test_basic.py | 6 | 22388 | # Copyright (c) The PyAMF Project.
# See LICENSE.txt for details.
"""
General tests.
@since: 0.1.0
"""
import unittest
import new
import pyamf
from pyamf.tests.util import ClassCacheClearingTestCase, replace_dict, Spam
class ASObjectTestCase(unittest.TestCase):
"""
I exercise all functionality relating to... | mit |
jonludlam/xen | tools/python/xen/xend/server/DevController.py | 42 | 24407 | #============================================================================
# This library is free software; you can redistribute it and/or
# modify it under the terms of version 2.1 of the GNU Lesser General Public
# License as published by the Free Software Foundation.
#
# This library is distributed in the hope th... | gpl-2.0 |
kamalx/edx-platform | common/test/acceptance/tests/lms/test_learner_profile.py | 20 | 31702 | # -*- coding: utf-8 -*-
"""
End-to-end tests for Student's Profile Page.
"""
from flaky import flaky
from contextlib import contextmanager
from datetime import datetime
from bok_choy.web_app_test import WebAppTest
from nose.plugins.attrib import attr
from ...pages.common.logout import LogoutPage
from ...pages.lms.acc... | agpl-3.0 |
severin-lemaignan/minimalkb | testing/test_reasoner.py | 1 | 3841 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import logging
import unittest
import time
try:
import kb
except ImportError:
import sys
print("You must first install pykb")
sys.exit(1)
from minimalkb import __version__
from queue import Empty
REASONING_DELAY = 0.2
class TestRDFSReasoner(unittest.Tes... | bsd-3-clause |
silky/ProbablyOverthinkingIt | thinkstats2.py | 1 | 69096 | """This file contains code for use with "Think Stats" and
"Think Bayes", both by Allen B. Downey, available from greenteapress.com
Copyright 2014 Allen B. Downey
License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html
"""
from __future__ import print_function, division
"""This file contains class definitions for:
H... | mit |
ARMmbed/yotta_osx_installer | workspace/lib/python2.7/site-packages/github/StatsParticipation.py | 74 | 2654 | # -*- coding: utf-8 -*-
# ########################## Copyrights and license ############################
# #
# Copyright 2013 Vincent Jacques <vincent@vincent-jacques.net> #
# ... | apache-2.0 |
brijeshkesariya/odoo | addons/payment_sips/models/sips.py | 150 | 9160 | # -*- coding: utf-'8' "-*-"
try:
import simplejson as json
except ImportError:
import json
import logging
from hashlib import sha256
import urlparse
import unicodedata
from openerp import models, fields, api
from openerp.tools.float_utils import float_compare
from openerp.tools.translate import _
from openerp... | agpl-3.0 |
Thhhza/XlsxWriter | xlsxwriter/test/comparison/test_chart_axis23.py | 8 | 1661 | ###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparsion_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""... | bsd-2-clause |
toogad/PooPyLab_Project | examples/MLE_test.py | 2 | 1436 | # This file is part of PooPyLab.
#
# PooPyLab is a simulation software for biological wastewater treatment
# processes using the International Water Association Activated Sludge
# Models.
#
# Copyright (C) Kai Zhang
#
# This program is free software: you can redistribute it and/or modify
# it und... | gpl-3.0 |
redhat-openstack/rdo-infra | ci-scripts/dlrnapi_promoter/test_dlrn_integration.py | 1 | 6534 | """
This test is launched as part of the existing tox command
It tests if promoter and dlrn server are interacting correctly
Uses standard pytest fixture as a setup/teardown method
"""
import logging
import os
import promoter_integration_checks
import pytest
import yaml
from common import close_logging
from config_... | apache-2.0 |
benjaminy/Charcoal | RealAppAnalysis/Browsers/updated_chromeanalysis/cpuprofileparser.py | 2 | 3825 | import json
import pprint
import utils
'''
The CPU-profile comes as an "instant event", usually as the last JSON object in the performance analysis output.
It has a process ID and thread ID associaiated with it, along with a list of "nodes". Every node is a dictionairy
and appears to represent a function call. A node ... | mit |
Cog-Creators/Red-DiscordBot | tests/cogs/test_economy.py | 4 | 2557 | import pytest
from redbot.pytest.economy import *
@pytest.mark.asyncio
async def test_bank_register(bank, ctx):
default_bal = await bank.get_default_balance(ctx.guild)
assert default_bal == (await bank.get_account(ctx.author)).balance
async def has_account(member, bank):
balance = await bank.get_balance... | gpl-3.0 |
Rydgel/chip8 | tests/lib/gtest-1.8.0/test/gtest_help_test.py | 2968 | 5856 | #!/usr/bin/env python
#
# Copyright 2009, 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... | bsd-3-clause |
Sing-Li/go-buildpack | builds/runtimes/python-2.7.6/lib/python2.7/test/test_future4.py | 136 | 1516 | from __future__ import unicode_literals
import unittest
from test import test_support
class TestFuture(unittest.TestCase):
def assertType(self, obj, typ):
self.assertTrue(type(obj) is typ,
"type(%r) is %r, not %r" % (obj, type(obj), typ))
def test_unicode_strings(self):
self.asser... | mit |
diego-d5000/MisValesMd | env/lib/python2.7/site-packages/django/contrib/auth/tests/custom_user.py | 1 | 3775 | from django.contrib.auth.models import (
AbstractBaseUser, AbstractUser, BaseUserManager, Group, Permission,
PermissionsMixin, UserManager,
)
from django.db import models
# The custom User uses email as the unique identifier, and requires
# that every user provide a date of birth. This lets us test
#... | mit |
wxgeo/geophar | wxgeometrie/sympy/physics/tests/test_secondquant.py | 8 | 46268 | from sympy.physics.secondquant import (
Dagger, Bd, VarBosonicBasis, BBra, B, BKet, FixedBosonicBasis,
matrix_rep, apply_operators, InnerProduct, Commutator, KroneckerDelta,
AnnihilateBoson, CreateBoson, BosonicOperator,
F, Fd, FKet, BosonState, CreateFermion, AnnihilateFermion,
evaluate_deltas, Ant... | gpl-2.0 |
BIT-SYS/gem5-spm-module | src/cpu/BaseCPU.py | 8 | 12218 | # Copyright (c) 2012 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of the functionality ... | bsd-3-clause |
diversys/wubi | src/bittorrent/zurllib.py | 11 | 4494 | #
# zurllib.py
#
# This is (hopefully) a drop-in for urllib which will request gzip/deflate
# compression and then decompress the output if a compressed response is
# received while maintaining the API.
#
# by Robert Stone 2/22/2003
#
from urllib import *
from urllib2 import *
from gzip import GzipFile
from StringIO ... | gpl-2.0 |
FHannes/intellij-community | python/lib/Lib/opcode.py | 94 | 5210 |
"""
opcode module - potentially shared between dis and other modules which
operate on bytecodes (e.g. peephole optimizers).
"""
__all__ = ["cmp_op", "hasconst", "hasname", "hasjrel", "hasjabs",
"haslocal", "hascompare", "hasfree", "opname", "opmap",
"HAVE_ARGUMENT", "EXTENDED_ARG"]
cmp_op = ('<... | apache-2.0 |
creasyw/IMTAphy | modules/phy/copper/PyConfig/copper/TimeDependentDistBER.py | 1 | 5027 | ###############################################################################
# This file is part of openWNS (open Wireless Network Simulator)
# _____________________________________________________________________________
#
# Copyright (C) 2004-2009
# Chair of Communication Networks (ComNets)
# Kopernikusstr. 5, D-5... | gpl-2.0 |
Manouchehri/metagoofil | hachoir_parser/archive/zip.py | 72 | 17756 | """
Zip splitter.
Status: can read most important headers
Authors: Christophe Gisquet and Victor Stinner
"""
from hachoir_parser import Parser
from hachoir_core.field import (FieldSet, ParserError,
Bit, Bits, Enum,
TimeDateMSDOS32, SubFile,
UInt8, UInt16, UInt32, UInt64,
String, PascalString16,
Ra... | gpl-2.0 |
agaurav/ansible | lib/ansible/errors/__init__.py | 163 | 7342 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | gpl-3.0 |
sander76/home-assistant | homeassistant/components/demo/lock.py | 21 | 1862 | """Demo lock platform that has two fake locks."""
from homeassistant.components.lock import SUPPORT_OPEN, LockEntity
from homeassistant.const import STATE_LOCKED, STATE_UNLOCKED
async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):
"""Set up the Demo lock platform."""
async_ad... | apache-2.0 |
mikel-egana-aranguren/SADI-Galaxy-Docker | galaxy-dist/eggs/WebError-0.8a-py2.7.egg/weberror/exceptions/serial_number_generator.py | 2 | 3811 | # (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org)
# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
"""
Creates a human-readable identifier, using numbers and digits,
avoiding ambiguous numbers and letters. hash_identifier can be used
to create comp... | gpl-3.0 |
jamiefolsom/xblock-sdk | workbench/test/test_runtime.py | 4 | 5969 | """Test Workbench Runtime"""
from unittest import TestCase
import mock
from django.conf import settings
from xblock.fields import Scope
from xblock.runtime import KeyValueStore
from xblock.runtime import KvsFieldData
from xblock.reference.user_service import UserService
from ..runtime import WorkbenchRuntime, Scena... | agpl-3.0 |
pyspeckit/pyspeckit | pyspeckit/spectrum/writers/txt_writer.py | 7 | 1660 | from __future__ import print_function
import os
try:
import atpy
atpyOK = True
except ImportError:
atpyOK = False
# rewrite this garbage
class write_txt(object):
def __init__(self, Spectrum):
self.Spectrum = Spectrum
def write_data(self, overwrite = True):
"""
Write all fi... | mit |
efortuna/AndroidSDKClone | ndk/prebuilt/linux-x86_64/share/pretty-printers/libstdcxx/gcc-4.8/printers.py | 106 | 37546 | # Pretty-printers for libstc++.
# Copyright (C) 2008-2013 Free Software Foundation, 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 License, or
# (at your option) ... | apache-2.0 |
hbrunn/bank-payment | account_banking_mandate/__openerp__.py | 1 | 1321 | # -*- coding: utf-8 -*-
# © 2014 Compassion CH - Cyril Sester <csester@compassion.ch>
# © 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza
# © 2015 Akretion - Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
'name': 'Account Banking Mandate',
'... | agpl-3.0 |
wanglongqi/sympy | sympy/polys/ring_series.py | 4 | 57242 | """Power series evaluation and manipulation using sparse Polynomials
Implementing a new function
---------------------------
There are a few things to be kept in mind when adding a new function here::
- The implementation should work on all possible input domains/rings.
Special cases include the ``EX`` rin... | bsd-3-clause |
sopier/django | django/db/migrations/migration.py | 326 | 8023 | from __future__ import unicode_literals
from django.db.transaction import atomic
from django.utils.encoding import python_2_unicode_compatible
from .exceptions import IrreversibleError
@python_2_unicode_compatible
class Migration(object):
"""
The base class for all migrations.
Migration files will impo... | bsd-3-clause |
Nick-OpusVL/odoo | openerp/addons/base/ir/ir_actions.py | 174 | 60020 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2014 OpenERP S.A. <http://www.openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of... | agpl-3.0 |
django-oscar/django-oscar-adyen | adyen/models.py | 2 | 1590 | # -*- coding: utf-8 -*-
from django.conf import settings
from django.db import models
from django.utils import timezone
from oscar.core.loading import get_class
Constants = get_class('adyen.gateway', 'Constants')
class AdyenTransaction(models.Model):
# Note we don't use a foreign key as the order hasn't been c... | bsd-3-clause |
CenterForOpenScience/osf.io | osf_tests/management_commands/test_update_old_sanction_states.py | 5 | 2993 | import pytest
from osf.management.commands.update_old_sanction_states import update_old_sanction_states
from osf.models import Embargo, Retraction
from osf_tests import factories
@pytest.mark.django_db
class TestUpdateOldSanctionStates:
def test_update_old_sanction_states(self):
new_style_embargo = facto... | apache-2.0 |
supersven/intellij-community | python/lib/Lib/site-packages/django/contrib/gis/gdal/field.py | 264 | 6059 | from ctypes import byref, c_int
from datetime import date, datetime, time
from django.contrib.gis.gdal.base import GDALBase
from django.contrib.gis.gdal.error import OGRException
from django.contrib.gis.gdal.prototypes import ds as capi
# For more information, see the OGR C API source code:
# http://www.gdal.org/ogr/... | apache-2.0 |
ndimiduk/phoenix | bin/psql.py | 6 | 1669 | #!/usr/bin/env python
############################################################################
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The A... | apache-2.0 |
sniemi/SamPy | sandbox/src1/examples/multi_image.py | 1 | 1769 | #!/usr/bin/env python
'''
Make a set of images with a single colormap, norm, and colorbar.
It also illustrates colorbar tick labelling with a multiplier.
'''
from matplotlib.pyplot import figure, show, sci
from matplotlib import cm, colors
from matplotlib.font_manager import FontProperties
from numpy import amin, ama... | bsd-2-clause |
mattstep/ansible | lib/ansible/playbook/role/include.py | 39 | 1716 | # (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 |
reinaH/osf.io | framework/email/tasks.py | 32 | 1454 | import smtplib
import logging
from email.mime.text import MIMEText
from framework.tasks import app
from website import settings
logger = logging.getLogger(__name__)
@app.task
def send_email(from_addr, to_addr, subject, message, mimetype='html', ttls=True, login=True,
username=None, password=None, ma... | apache-2.0 |
apanju/GMIO_Odoo | addons/account/wizard/account_move_line_reconcile_select.py | 385 | 2362 | # -*- 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 |
hlzz/dotfiles | graphics/VTK-7.0.0/Filters/Texture/Testing/Python/AutomaticPlaneGeneration.py | 2 | 1327 | #!/usr/bin/env python
import vtk
from vtk.test import Testing
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()
# Create the RenderWindow, Renderer
#
ren1 = vtk.vtkRenderer()
renWin = vtk.vtkRenderWindow()
renWin.AddRenderer(ren1)
iren = vtk.vtkRenderWindowInteractor()
iren.SetRende... | bsd-3-clause |
LegNeato/buck | third-party/py/typing/src/typing.py | 25 | 70677 | import abc
from abc import abstractmethod, abstractproperty
import collections
import contextlib
import functools
import re as stdlib_re # Avoid confusion with the re we export.
import sys
import types
try:
import collections.abc as collections_abc
except ImportError:
import collections as collections_abc # F... | apache-2.0 |
clef/python-social-auth | social/apps/django_app/tests.py | 83 | 2416 | from social.tests.test_exceptions import *
from social.tests.test_pipeline import *
from social.tests.test_storage import *
from social.tests.test_utils import *
from social.tests.actions.test_associate import *
from social.tests.actions.test_disconnect import *
from social.tests.actions.test_login import *
from social... | bsd-3-clause |
mikalstill/nova | nova/console/manager.py | 3 | 4597 | # Copyright (c) 2010 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | apache-2.0 |
eunchong/build | scripts/slave/recipe_modules/chromium_tests/chromium_webrtc_fyi.py | 1 | 3616 | # Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import copy
import collections
from . import chromium_linux
from . import chromium_mac
from . import chromium_win
from . import chromium_webrtc
# GN build... | bsd-3-clause |
thundernet8/WRGameVideos-API | venv/lib/python2.7/site-packages/requests/packages/urllib3/util/request.py | 780 | 2128 | from __future__ import absolute_import
from base64 import b64encode
from ..packages.six import b
ACCEPT_ENCODING = 'gzip,deflate'
def make_headers(keep_alive=None, accept_encoding=None, user_agent=None,
basic_auth=None, proxy_basic_auth=None, disable_cache=None):
"""
Shortcuts for generatin... | gpl-2.0 |
coolbombom/CouchPotatoServer | couchpotato/core/providers/nzb/nzbx/main.py | 8 | 1269 | from couchpotato.core.helpers.encoding import tryUrlencode
from couchpotato.core.helpers.variable import tryInt
from couchpotato.core.logger import CPLog
from couchpotato.core.providers.nzb.base import NZBProvider
from couchpotato.environment import Env
log = CPLog(__name__)
class Nzbx(NZBProvider):
urls = {
... | gpl-3.0 |
Protoneer/fadecandy | examples/python/firmware-config-ui.py | 16 | 1037 | #!/usr/bin/env python
#
# Simple UI for firmware configuration flags.
# Talks to an fcserver running on localhost.
#
# Micah Elizabeth Scott
# This example code is released into the public domain.
#
import Tkinter as tk
import socket
import struct
s = socket.socket()
s.connect(('localhost', 7890))
print "Connected to... | mit |
michaelmcandrew/readthedocs.org | readthedocs/restapi/permissions.py | 18 | 2215 | from rest_framework import permissions
from readthedocs.privacy.backend import AdminPermission
class IsOwner(permissions.BasePermission):
"""
Custom permission to only allow owners of an object to edit it.
"""
def has_object_permission(self, request, view, obj):
# Write permissions are only a... | mit |
hyperized/ansible | lib/ansible/modules/network/fortios/fortios_system_resource_limits.py | 13 | 12995 | #!/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 |
nkhuyu/commons | tests/python/twitter/common/config/properties_test.py | 15 | 2563 | # ==================================================================================================
# Copyright 2011 Twitter, Inc.
# --------------------------------------------------------------------------------------------------
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use thi... | apache-2.0 |
BitWriters/Zenith_project | zango/lib/python3.5/site-packages/setuptools/command/egg_info.py | 105 | 24773 | """setuptools.command.egg_info
Create a distribution's .egg-info directory and contents"""
from distutils.filelist import FileList as _FileList
from distutils.errors import DistutilsInternalError
from distutils.util import convert_path
from distutils import log
import distutils.errors
import distutils.filelist
import... | mit |
BackSlasher/greg | greg/__main__.py | 1 | 2640 | #!/usr/bin/env python
import argparse
import greg.config
def main():
parser = argparse.ArgumentParser(description='Integrate your build server and source control')
parser.add_argument('--config', default='config.yaml', help='Path to config file')
parser.add_argument('--fix-hooks', action='store_const', con... | gpl-3.0 |
helldorado/ansible | lib/ansible/modules/cloud/hcloud/hcloud_volume.py | 10 | 9639 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2019, Hetzner Cloud GmbH <info@hetzner-cloud.de>
# 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 = {
"met... | gpl-3.0 |
jhnphm/boar | front.py | 1 | 29536 | # -*- coding: utf-8 -*-
# Copyright 2010 Mats Ekberg
#
# 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... | apache-2.0 |
nirinA/scripts_python | mangorona.py | 1 | 12832 | '''game of mangorona.
goal:
keep more pawn on the board than your opponent.
movement:
move your pawn to an unoccupied place.
pick:
fill or create an empty place beetwen your pawn and
your opponent's, and pick all opponent pawn in the
same line of movement.
'''
import sys
import random
import time... | unlicense |
kawamon/hue | desktop/core/ext-py/Django-1.11.29/django/core/files/storage.py | 51 | 18802 | import errno
import os
import warnings
from datetime import datetime
from django.conf import settings
from django.core.exceptions import SuspiciousFileOperation
from django.core.files import File, locks
from django.core.files.move import file_move_safe
from django.core.signals import setting_changed
from django.utils ... | apache-2.0 |
FredLoney/nipype | doc/sphinxext/autosummary_generate.py | 15 | 7571 | #!/usr/bin/env python
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
r"""
autosummary_generate.py OPTIONS FILES
Generate automatic RST source files for items referred to in
autosummary:: directives.
Each generated RST file contains a single auto*:: di... | bsd-3-clause |
wdv4758h/ZipPy | lib-python/3/unittest/runner.py | 51 | 7453 | """Running tests"""
import sys
import time
import warnings
from . import result
from .signals import registerResult
__unittest = True
class _WritelnDecorator(object):
"""Used to decorate file-like objects with a handy 'writeln' method"""
def __init__(self,stream):
self.stream = stream
def __ge... | bsd-3-clause |
rjschwei/azure-sdk-for-python | azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/azure_sku.py | 1 | 1111 | # 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 |
o5k/openerp-oemedical-v0.1 | openerp/addons/portal/__openerp__.py | 55 | 2360 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2012 OpenERP S.A (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | agpl-3.0 |
suranap/qiime | qiime/quality_scores_plot.py | 9 | 6918 | #!/usr/bin/env python
# File created Sept 29, 2010
from __future__ import division
__author__ = "William Walters"
__copyright__ = "Copyright 2011, The QIIME Project"
__credits__ = ["William Walters", "Greg Caporaso"]
__license__ = "GPL"
__version__ = "1.9.1-dev"
__maintainer__ = "William Walters"
__email__ = "William.... | gpl-2.0 |
briancurtin/python-openstacksdk | openstack/tests/unit/message/v2/test_proxy.py | 1 | 9468 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | apache-2.0 |
munyirik/python | cpython/Lib/test/test_codecencodings_iso2022.py | 8 | 1415 | # Codec encoding tests for ISO 2022 encodings.
from test import support
from test import multibytecodec_support
import unittest
COMMON_CODEC_TESTS = (
# invalid bytes
(b'ab\xFFcd', 'replace', 'ab\uFFFDcd'),
(b'ab\x1Bdef', 'replace', 'ab\x1Bdef'),
(b'ab\x1B$def', 'replace', 'ab\uFFFD'),... | bsd-3-clause |
K1773R/p2pool | wstools/TimeoutSocket.py | 293 | 5293 | """Based on code from timeout_socket.py, with some tweaks for compatibility.
These tweaks should really be rolled back into timeout_socket, but it's
not totally clear who is maintaining it at this point. In the meantime,
we'll use a different module name for our tweaked version to avoid any
confusion.
T... | gpl-3.0 |
MenZil/kuma | kuma/users/tests/test_views.py | 4 | 36891 | import mock
import json
from urlparse import urlparse, parse_qs
from nose.tools import eq_, ok_
from nose.plugins.attrib import attr
from pyquery import PyQuery as pq
from django.conf import settings
from django.contrib.auth.hashers import UNUSABLE_PASSWORD_PREFIX
from django.contrib.sites.models import Site
from dja... | mpl-2.0 |
stahta01/codeblocks_obfuscated | src/sdk/wxscintilla/src/scintilla/scripts/ScintillaData.py | 19 | 11009 | # ScintillaData.py - implemented 2013 by Neil Hodgson neilh@scintilla.org
# Released to the public domain.
# Common code used by Scintilla and SciTE for source file regeneration.
# The ScintillaData object exposes information about Scintilla as properties:
# Version properties
# version
# versionDotted
# v... | gpl-3.0 |
jeremydane/Info3180-Project2 | server/lib/werkzeug/contrib/limiter.py | 319 | 1333 | # -*- coding: utf-8 -*-
"""
werkzeug.contrib.limiter
~~~~~~~~~~~~~~~~~~~~~~~~
A middleware that limits incoming data. This works around problems with
Trac_ or Django_ because those directly stream into the memory.
.. _Trac: http://trac.edgewall.org/
.. _Django: http://www.djangoproject.com/
... | apache-2.0 |
Neil741/ryu-master | ryu/services/protocols/bgp/utils/internable.py | 33 | 3224 | # Copyright (C) 2014 Nippon Telegraph and Telephone Corporation.
#
# 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 appli... | apache-2.0 |
izgzhen/servo | tests/wpt/web-platform-tests/webvtt/webvtt-file-format-parsing/webvtt-cue-text-parsing-rules/buildtests.py | 132 | 1947 | #!/usr/bin/python
import os
import urllib
import hashlib
doctmpl = """<!doctype html>
<title>WebVTT cue data parser test %s</title>
<style>video { display:none }</style>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script src=/html/syntax/parsing/template.js><... | mpl-2.0 |
pabulumm/neighbors | lib/python3.4/site-packages/wheel/install.py | 472 | 18070 | """
Operations on existing wheel files, including basic installation.
"""
# XXX see patched pip to install
import sys
import warnings
import os.path
import re
import zipfile
import hashlib
import csv
import shutil
try:
_big_number = sys.maxsize
except NameError:
_big_number = sys.maxint
from wheel.decorato... | bsd-3-clause |
ashwingoldfish/eddy | eddy/core/commands/common.py | 2 | 11316 | # -*- coding: utf-8 -*-
##########################################################################
# #
# Eddy: a graphical editor for the specification of Graphol ontologies #
# Copyright (C) 2015 Daniele Pantaleone <danielepantaleone@me.com> ... | gpl-3.0 |
doduytrung/odoo-8.0 | addons/l10n_be_invoice_bba/invoice.py | 3 | 12542 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
#
# Copyright (c) 2011 Noviat nv/sa (www.noviat.be). All rights reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under ... | agpl-3.0 |
dubslow/pycparser | pycparser/ply/ctokens.py | 363 | 3170 | # ----------------------------------------------------------------------
# ctokens.py
#
# Token specifications for symbols in ANSI C and C++. This file is
# meant to be used as a library in other tokenizers.
# ----------------------------------------------------------------------
# Reserved words
tokens = [
# Li... | bsd-3-clause |
JVenberg/PokemonGo-Bot-Desktop | pywin/Lib/lib2to3/fixes/fix_filter.py | 326 | 2107 | # Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Fixer that changes filter(F, X) into list(filter(F, X)).
We avoid the transformation if the filter() call is directly contained
in iter(<>), list(<>), tuple(<>), sorted(<>), ...join(<>), or
for V in <>:.
NOTE: This... | mit |
albertomurillo/ansible | lib/ansible/modules/windows/win_pagefile.py | 52 | 3997 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Liran Nisanov <lirannis@gmail.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# this is a windows documentation stub. actual code lives in the .ps1
# file of the same name
ANSIBLE_METADATA = {'metadata... | gpl-3.0 |
dfalt974/SickRage | lib/oauthlib/oauth2/rfc6749/grant_types/refresh_token.py | 9 | 5645 | # -*- coding: utf-8 -*-
"""
oauthlib.oauth2.rfc6749.grant_types
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"""
from __future__ import absolute_import, unicode_literals
import json
import logging
from .. import errors, utils
from ..request_validator import RequestValidator
from .base import GrantTypeBase
log = logging.getL... | gpl-3.0 |
Acidburn0zzz/servo | tests/wpt/web-platform-tests/webdriver/tests/get_element_property/user_prompts.py | 26 | 4054 | # META: timeout=long
import pytest
from tests.support.asserts import assert_error, assert_success, assert_dialog_handled
from tests.support.inline import inline
def get_element_property(session, element_id, name):
return session.transport.send(
"GET", "session/{session_id}/element/{element_id}/property/... | mpl-2.0 |
vjlux/luxlib | LuxSynth/LuxSynth/LuxPreprocessor.py | 1 | 1130 | #!/usr/bin/env python3
## Copyright (c) MIT. All rights reserved.
## lux (vjlux@gmx.at) 2016
############################################################
# Imports
############################################################
import logging
import LuxImage
import open3d as o3d
import numpy as np
##################... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.