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 |
|---|---|---|---|---|---|
coderfi/ansible-modules-extras | database/mongodb_user.py | 24 | 8978 | #!/usr/bin/python
# (c) 2012, Elliott Foster <elliott@fourkitchens.com>
# Sponsored by Four Kitchens http://fourkitchens.com.
# (c) 2014, Epic Games, Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publi... | gpl-3.0 |
ThomasWu/PersonalNewsWeb | backend/common/configuration_service_client_test.py | 1 | 1367 | import configuration_service_client as conf_client
def test_basic_get():
amqp_settings = conf_client.getSystemSettings('amqp')
print amqp_settings
assert amqp_settings is not None
assert len(amqp_settings) > 0
print 'test basic get passed'
def test_setAndDrop():
system = 'test'
settings = ... | mit |
marifersahin/pyfolio | venv/bin/player.py | 1 | 2205 | #!/Users/polizom/Django/pyfolio/venv/bin/python2.7
#
# The Python Imaging Library
# $Id$
#
from __future__ import print_function
try:
from tkinter import *
except ImportError:
from Tkinter import *
from PIL import Image, ImageTk
import sys
# -----------------------------------------------------------------... | mit |
a25kk/tam | src/tam.sitecontent/tam/sitecontent/testing.py | 1 | 1960 | # -*- coding: utf-8 -*-
"""Base module for unittesting."""
from plone.app.testing import applyProfile
from plone.app.testing import FunctionalTesting
from plone.app.testing import IntegrationTesting
from plone.app.testing import login
from plone.app.testing import PLONE_FIXTURE
from plone.app.testing import PloneSandb... | mit |
bguillot/OpenUpgrade | openerp/report/render/rml2html/rml2html.py | 438 | 15438 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2005, Fabien Pinckaers, UCL, FSA
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesse... | agpl-3.0 |
mscuthbert/abjad | abjad/tools/pitchtools/NumberedInterval.py | 2 | 12039 | # -*- encoding: utf-8 -*-
import functools
from abjad.tools import mathtools
from abjad.tools.pitchtools.Interval import Interval
@functools.total_ordering
class NumberedInterval(Interval):
'''A numbered interval.
::
>>> numbered_interval = pitchtools.NumberedInterval(-14)
>>> numbered_inter... | gpl-3.0 |
iamkingmaker/zipline | tests/risk/answer_key.py | 39 | 11989 | #
# Copyright 2014 Quantopian, 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 wr... | apache-2.0 |
carljm/django | tests/extra_regress/tests.py | 8 | 16055 | from __future__ import unicode_literals
import datetime
from collections import OrderedDict
from django.contrib.auth.models import User
from django.test import TestCase
from .models import Order, RevisionableModel, TestObject
class ExtraRegressTests(TestCase):
def setUp(self):
self.u = User.objects.cr... | bsd-3-clause |
facelessuser/Pywin32 | lib/x32/win32comext/axdebug/util.py | 11 | 3672 | # Utility function for wrapping objects. Centralising allows me to turn
# debugging on and off for the entire package in a single spot.
import sys
import win32com.server.util
from win32com.server.exception import Exception
import winerror
import win32api
import os
try:
os.environ["DEBUG_AXDEBUG"]
debugging =... | bsd-3-clause |
ioram7/keystone-federado-pgid2013 | build/paste/build/lib.linux-x86_64-2.7/paste/auth/digest.py | 12 | 8174 | # (c) 2005 Clark C. Evans
# This module is part of the Python Paste Project and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
# This code was written with funding by http://prometheusresearch.com
"""
Digest HTTP/1.1 Authentication
This module implements ``Digest`` authenticati... | apache-2.0 |
pdehaye/theming-edx-platform | i18n/tests/test_validate.py | 16 | 1119 | import os, sys, logging
from unittest import TestCase
from nose.plugins.skip import SkipTest
from config import LOCALE_DIR
from execute import call
def test_po_files(root=LOCALE_DIR):
"""
This is a generator. It yields all of the .po files under root, and tests each one.
"""
log = logging.getL... | agpl-3.0 |
meisterkleister/erpnext | erpnext/patches/v5_1/fix_against_account.py | 107 | 1271 | from __future__ import unicode_literals
import frappe
from erpnext.accounts.doctype.gl_entry.gl_entry import update_against_account
def execute():
from_date = "2015-05-01"
for doc in frappe.get_all("Journal Entry",
filters={"creation": (">", from_date), "docstatus": "1"}):
# update in gl_en... | agpl-3.0 |
lanselin/pysal | pysal/core/IOHandlers/arcgis_dbf.py | 20 | 6913 | import pysal
import os.path
import pysal.core.FileIO as FileIO
from pysal.weights import W
from pysal.weights.util import remap_ids
from warnings import warn
__author__ = "Myunghwa Hwang <mhwang4@gmail.com>"
__all__ = ["ArcGISDbfIO"]
class ArcGISDbfIO(FileIO.FileIO):
"""
Opens, reads, and writes weights file... | bsd-3-clause |
TNosredna/CouchPotatoServer | libs/pyutil/assertutil.py | 106 | 2753 | # Copyright (c) 2003-2009 Zooko Wilcox-O'Hearn
# This file is part of pyutil; see README.rst for licensing terms.
"""
Tests useful in assertion checking, prints out nicely formated messages too.
"""
from humanreadable import hr
def _assert(___cond=False, *___args, **___kwargs):
if ___cond:
return True
... | gpl-3.0 |
jeffery9/mixprint_addons | base_action_rule/tests/__init__.py | 178 | 1129 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2012-TODAY OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... | agpl-3.0 |
liamgh/liamgreenhughes-sl4a-tf101 | python/src/Lib/encodings/iso8859_13.py | 593 | 13527 | """ Python Character Mapping Codec iso8859_13 generated from 'MAPPINGS/ISO8859/8859-13.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,input,errors... | apache-2.0 |
iAMr00t/opencog | examples/python/conceptual_blending/blend_with_interaction_information.py | 22 | 9180 | #! /usr/bin/env python
#
# blend_with_information_interaction.py
#
"""
Example usage of Conceptual Blending API.
Instantiates blender with a simple dataset stored in an AtomSpace
and learns a new concept.
For complete documentation on how to pass additional parameters to
blender, refer to the documentation at the follo... | agpl-3.0 |
fauskanger/Pretreat | app/classes/graph/path.py | 1 | 1741 | from app.config import config
from app.pythomas import shapes as shapelib
from app.pythomas import pythomas as lib
class Path:
def __init__(self, path_nodes):
path_nodes = None if path_nodes == [None] else path_nodes
self.nodes = [] if not path_nodes else path_nodes
self.complete = False
... | gpl-2.0 |
jdobes/spacewalk | rel-eng/copr-fork.py | 5 | 2000 | #!/usr/bin/python
from copr import CoprClient
import argparse
import json
parser = argparse.ArgumentParser(
description='Fork copr nightly repo after Spacewalk release branching')
parser.add_argument('--force', action='store_true', default=False,
help='force fork into an existing p... | gpl-2.0 |
goddino/libjingle | talk/site_scons/site_tools/talk_linux.py | 22 | 11731 | # Copyright 2010 Google Inc.
# All Rights Reserved.
# Author: tschmelcher@google.com (Tristan Schmelcher)
"""Tool for helpers used in linux building process."""
import os
import SCons.Defaults
import subprocess
def _OutputFromShellCommand(command):
process = subprocess.Popen(command, shell=True, stdout=subprocess... | bsd-3-clause |
h4ck3rm1k3/OpenWrt-Firefly-SDK | staging_dir/host/lib/scons-2.3.1/SCons/Tool/JavaCommon.py | 8 | 12755 | """SCons.Tool.JavaCommon
Stuff for processing Java.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the... | gpl-2.0 |
eriser/picasso-graphic | tools/gyp/pylib/gyp/MSVSNew.py | 225 | 12061 | # 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.
"""New implementation of Visual Studio project generation for SCons."""
import os
import random
import gyp.common
# hashlib is supplied as of Python 2.5 as the ... | bsd-3-clause |
rob-nn/open_gait_analytics | api/oga_api/ml/basic_cmac.py | 2 | 6480 | import oga_api.ml.cmac as cmac
import numpy as np
import matplotlib.pyplot as plt
import oga_api.physics.cinematic as c
class BasicCMAC(cmac.CMAC):
def __init__(self, trajectories, pos_angles, time_frame, markers, angles, activations, output, num_iterations):
self._num_iterations = num_iterations
c... | mit |
pdehaye/theming-edx-platform | common/lib/xmodule/xmodule/errortracker.py | 74 | 1472 | import logging
import sys
import traceback
from collections import namedtuple
log = logging.getLogger(__name__)
ErrorLog = namedtuple('ErrorLog', 'tracker errors')
def exc_info_to_str(exc_info):
"""Given some exception info, convert it into a string using
the traceback.format_exception() function.
"""
... | agpl-3.0 |
zhiyisun/linux | tools/perf/scripts/python/sched-migration.py | 1910 | 11965 | #!/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 |
proxysh/Safejumper-for-Desktop | buildlinux/env32/lib/python2.7/site-packages/pyasn1/type/namedval.py | 25 | 2380 | #
# This file is part of pyasn1 software.
#
# Copyright (c) 2005-2017, Ilya Etingof <etingof@gmail.com>
# License: http://pyasn1.sf.net/license.html
#
# ASN.1 named integers
#
from pyasn1 import error
__all__ = ['NamedValues']
class NamedValues(object):
def __init__(self, *namedValues):
self.nameToValIdx... | gpl-2.0 |
DNX/django-e1337cms | docs/conf.py | 1 | 7732 | # -*- coding: utf-8 -*-
#
# e1337cms documentation build configuration file, created by
# sphinx-quickstart on Fri Jun 1 09:47:07 2012.
#
# 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
# autogenerated file.
#
# Al... | bsd-3-clause |
tao12345666333/tornado-zh | tornado/curl_httpclient.py | 12 | 22169 | #!/usr/bin/env python
#
# Copyright 2009 Facebook
#
# 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... | mit |
ytechie/coreclr | src/pal/automation/tests.py | 154 | 1078 | import sys
import getopt
import os
import subprocess
import shutil
import logging as log
def RunPalTests(fullbuilddirpath, workspace):
print "\n==================================================\n"
print "Running PAL Tests."
print "\n==================================================\n"
print "Running... | mit |
quoideneuf/selenium | py/selenium/webdriver/chrome/options.py | 80 | 5289 | # Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | apache-2.0 |
emi420/sotsiaal | app/urls.py | 1 | 2985 | from django.conf.urls import patterns, include, url
import settings
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
from django.conf.urls.defaults import *
from django.views.generic.simple import direct_to_template
urlpatterns = patterns('',
(r'^admin/', i... | gpl-3.0 |
pantheon-systems/libcloud | libcloud/storage/drivers/azure_blobs.py | 30 | 37231 | # 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 |
lmazuel/azure-sdk-for-python | azure-mgmt-authorization/azure/mgmt/authorization/models/role_assignment_create_parameters.py | 1 | 1625 | # 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 |
astrofrog/numpy | doc/sphinxext/numpydoc.py | 47 | 5680 | """
========
numpydoc
========
Sphinx extension that handles docstrings in the Numpy standard format. [1]
It will:
- Convert Parameters etc. sections to field lists.
- Convert See Also section to a See also entry.
- Renumber references.
- Extract the signature from the docstring, if it can't be determined otherwise.... | bsd-3-clause |
noroutine/ansible | test/units/parsing/utils/test_jsonify.py | 119 | 1499 | # -*- coding: utf-8 -*-
# (c) 2016, James Cammarata <jimi@sngx.net>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your o... | gpl-3.0 |
pombredanne/pattern | pattern/server/cherrypy/cherrypy/lib/reprconf.py | 36 | 14521 | """Generic configuration system using unrepr.
Configuration data may be supplied as a Python dictionary, as a filename,
or as an open file object. When you supply a filename or file, Python's
builtin ConfigParser is used (with some extensions).
Namespaces
----------
Configuration keys are separated into namespaces b... | bsd-3-clause |
FescueFungiShare/hydroshare | hs_core/tests/api/native/test_get_citation.py | 2 | 5860 | from unittest import TestCase
from datetime import date
from hs_core.hydroshare import resource
from django.contrib.auth.models import Group, User
from hs_core.models import GenericResource, Creator
from hs_core import hydroshare
from hs_core.testing import MockIRODSTestCaseMixin
class TestGetCitation(MockIRODSTestC... | bsd-3-clause |
spbguru/repo1 | nupic/encoders/geospatial_coordinate.py | 3 | 4081 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2014, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | gpl-3.0 |
lucidmotifs/newtopia | newtopia/ntgame/models/effect.py | 1 | 3504 | # python modules
from enum import Enum
# django modules
from django.db import models
# nt modules
from .province import Province
from .infrastructure import Building
# meta
from ntmeta.models import Entity
class Effect(models.Model):
""" The core component of province change """
""" e.g. Peasant Growth - ... | gpl-3.0 |
nurmd2/nurmd | openerp/addons/base/module/wizard/base_export_language.py | 43 | 2692 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import base64
import contextlib
import cStringIO
from openerp import tools
from openerp.osv import fields,osv
from openerp.tools.translate import _
from openerp.tools.misc import get_iso_codes
NEW_LANG_KEY = '__new__'
... | gpl-3.0 |
ogenstad/ansible | lib/ansible/modules/cloud/amazon/ec2_vol.py | 33 | 20090 | #!/usr/bin/python
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['stableinterf... | gpl-3.0 |
Knewton/lentil | lentil/viztools.py | 2 | 9752 | """
Module for visualizing skill embeddings
@author Siddharth Reddy <sgr45@cornell.edu>
"""
import logging
import matplotlib
from matplotlib import pyplot as plt
import numpy as np
from . import models
_logger = logging.getLogger(__name__)
def plot_embedding(
model,
timestep=-1,
show_students=True,
... | apache-2.0 |
pidydx/grr | grr/lib/log_test.py | 1 | 2267 | #!/usr/bin/env python
"""Tests for logging classes."""
import logging
import time
from werkzeug import wrappers as werkzeug_wrappers
from grr.gui import wsgiapp
from grr.lib import flags
from grr.lib import log
from grr.lib import stats
from grr.lib import test_lib
from grr.lib import utils
from grr.proto import j... | apache-2.0 |
pgmillon/ansible | lib/ansible/modules/network/f5/bigip_sys_db.py | 38 | 11001 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2016, 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 |
rkvsraman/gitinspector | gitinspector/timeline.py | 47 | 8918 | # coding: utf-8
#
# Copyright © 2012-2013 Ejwa Software. All rights reserved.
#
# This file is part of gitinspector.
#
# gitinspector 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 |
suutari/shoop | shuup/simple_supplier/models.py | 1 | 3252 | # -*- coding: utf-8 -*-
# This file is part of Shuup.
#
# Copyright (c) 2012-2016, Shoop Commerce Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
from django.conf import settings
from django.db import models
from ... | agpl-3.0 |
andaag/scikit-learn | sklearn/naive_bayes.py | 128 | 28358 | # -*- coding: utf-8 -*-
"""
The :mod:`sklearn.naive_bayes` module implements Naive Bayes algorithms. These
are supervised learning methods based on applying Bayes' theorem with strong
(naive) feature independence assumptions.
"""
# Author: Vincent Michel <vincent.michel@inria.fr>
# Minor fixes by Fabian Pedre... | bsd-3-clause |
Yas3r/Empire | lib/modules/privesc/powerup/find_dllhijack.py | 10 | 3098 | from lib.common import helpers
class Module:
def __init__(self, mainMenu, params=[]):
self.info = {
'Name': 'Invoke-FindDLLHijack',
'Author': ['@harmj0y'],
'Description': ('Finds generic .DLL hijacking opportunities.'),
'Background' : True,
... | bsd-3-clause |
trishnaguha/ansible | lib/ansible/modules/network/f5/bigip_ssl_ocsp.py | 14 | 24105 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2018, 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 |
Acidburn0zzz/servo | tests/wpt/web-platform-tests/tools/third_party/html5lib/html5lib/serializer.py | 45 | 15746 | from __future__ import absolute_import, division, unicode_literals
from six import text_type
import re
from codecs import register_error, xmlcharrefreplace_errors
from .constants import voidElements, booleanAttributes, spaceCharacters
from .constants import rcdataElements, entities, xmlEntities
from . import treewal... | mpl-2.0 |
BjoernT/python-openstackclient | openstackclient/identity/v3/unscoped_saml.py | 2 | 2818 | # 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
# distrib... | apache-2.0 |
pitunti/alfaPitunti | plugin.video.alfa/channels/seriesblanco.py | 1 | 13145 | # -*- coding: utf-8 -*-
import re
import urlparse
from channels import filtertools
from channelselector import get_thumb
from core import httptools
from core import scrapertoolsV2
from core import servertools
from core.item import Item
from platformcode import config, logger
from channels import autoplay
HOST = "h... | gpl-3.0 |
joisig/grit-i18n | grit/pseudo.py | 62 | 4072 | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
'''Pseudotranslation support. Our pseudotranslations are based on the
P-language, which is a simple vowel-extending language. Exa... | bsd-2-clause |
JoyMonteiro/CliMT | lib/examples/basic_radiation.py | 4 | 1313 | #!/usr/bin/env python
#
# Set up realistic tropical temperature and moisture profiles
# and compute radiative fluxes
#
from numpy import *
import climt
#--- instantiate radiation module
r = climt.radiation(scheme='cam3')
#--- initialise T,q
# Surface temperature
Ts = 273.15 + 30.
# Strosphe... | bsd-3-clause |
benchisell/photostream-bc | flask/lib/python2.7/site-packages/pip-1.5.6-py2.7.egg/pip/exceptions.py | 398 | 1086 | """Exceptions used throughout package"""
class PipError(Exception):
"""Base pip exception"""
class InstallationError(PipError):
"""General exception during installation"""
class UninstallationError(PipError):
"""General exception during uninstallation"""
class DistributionNotFound(InstallationError)... | bsd-3-clause |
TechAtNYU/feedback-service | feedback.py | 1 | 3796 | import requests
import secrets
import smtplib
headers = {
'content-type': 'application/vnd.api+json',
'accept': 'application/*, text/*',
'authorization': 'Bearer ' + secrets.tnyu_api_key
}
def get_emails(event_id, event_data, eboard_members, attendees):
res = requests.get('https://api.tnyu.org/v3/eve... | mit |
RTS2/rts2 | python/rts2/progressbar.py | 3 | 1665 | # Prints to console pretty progress bar
#
# (C) 2016 Petr Kubanek <petr@kubanek.net>
#
# 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 ... | lgpl-3.0 |
bsmr-eve/Pyfa | gui/fitCommands/guiToggleModuleState.py | 2 | 1208 | import wx
from service.fit import Fit
import gui.mainFrame
from gui import globalEvents as GE
from .calc.fitChangeState import FitChangeStatesCommand
class GuiModuleStateChangeCommand(wx.Command):
def __init__(self, fitID, baseMod, modules, click):
# todo: instead of modules, needs to be positions. Dead ... | gpl-3.0 |
drybjed/ansible-modules-extras | notification/mqtt.py | 101 | 4848 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, 2014, Jan-Piet Mens <jpmens () gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of... | gpl-3.0 |
andybak/ansible-modules-extras | messaging/rabbitmq_parameter.py | 104 | 4614 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Chatham Financial <oss@chathamfinancial.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... | gpl-3.0 |
arjunasuresh3/Mypykoans | python 2/runner/path_to_enlightenment.py | 20 | 4759 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# The path to enlightenment starts with the following:
import unittest
from koans.about_asserts import AboutAsserts
from koans.about_none import AboutNone
from koans.about_lists import AboutLists
from koans.about_list_assignments import AboutListAssignments
from koans.ab... | mit |
PaddlePaddle/Paddle | python/paddle/fluid/tests/unittests/test_pad_op.py | 2 | 3374 | # Copyright (c) 2018 PaddlePaddle 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 app... | apache-2.0 |
thurt/arangodb | 3rdParty/V8-4.3.61/third_party/python_26/Lib/distutils/spawn.py | 63 | 6991 | """distutils.spawn
Provides the 'spawn()' function, a front-end to various platform-
specific functions for launching another program in a sub-process.
Also provides the 'find_executable()' to search the path for a given
executable name.
"""
# This module should be kept compatible with Python 2.1.
__revision__ = "$I... | apache-2.0 |
bobbyrward/fr0st | fr0stlib/gui/utils.py | 1 | 8708 | import wx, os
from functools import partial
from fr0stlib.decorators import *
def LoadIcon(*path):
# Check for an icons dir in app base path first for development
filename = os.path.join(wx.GetApp().AppBaseDir, 'icons', *path) + '.png'
if not os.path.exists(filename):
# Not there, check install p... | gpl-3.0 |
sam-m888/gramps | gramps/plugins/docgen/gtkprint.py | 9 | 20880 | #
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2007 Zsolt Foldvari
# Copyright (C) 2008-2009 Brian G. Matherly
#
# 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; eithe... | gpl-2.0 |
qwefi/nova | nova/network/driver.py | 13 | 1391 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Red Hat, 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
#
#... | apache-2.0 |
repotvsupertuga/tvsupertuga.repository | plugin.video.loganaddon/resources/lib/libraries/cachemeta.py | 23 | 2531 | # -*- coding: utf-8 -*-
'''
Specto Add-on
Copyright (C) 2015 lambda
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 l... | gpl-2.0 |
geekboxzone/lollipop_external_chromium_org | build/android/gyp/pack_arm_relocations.py | 28 | 4068 | #!/usr/bin/env python
#
# Copyright 2014 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.
"""Pack ARM relative relocations in a library (or copy unchanged).
If --enable-packing and --configuration-name=='Release', invoke t... | bsd-3-clause |
eLRuLL/scrapy | scrapy/http/response/text.py | 1 | 9259 | """
This module implements the TextResponse class which adds encoding handling and
discovering (through HTTP headers) to base Response class.
See documentation in docs/topics/request-response.rst
"""
from contextlib import suppress
from typing import Generator
from urllib.parse import urljoin
import parsel
from w3li... | bsd-3-clause |
dianchen96/gym | gym/envs/mujoco/mujoco_env.py | 1 | 9674 | import os
from gym import error, spaces
from gym.utils import seeding
import numpy as np
from os import path
import gym
import six
try:
import mujoco_py
from mujoco_py.mjlib import mjlib
except ImportError as e:
raise error.DependencyNotInstalled("{}. (HINT: you need to install mujoco_py, and also perform... | mit |
GauravSahu/odoo | addons/fetchmail/res_config.py | 437 | 5234 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | agpl-3.0 |
mrknow/filmkodi | plugin.video.mrknow/mylib/third_party/pep8/lib2to3/lib2to3/fixes/fix_apply.py | 315 | 1904 | # Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Fixer for apply().
This converts apply(func, v, k) into (func)(*v, **k)."""
# Local imports
from .. import pytree
from ..pgen2 import token
from .. import fixer_base
from ..fixer_util import Call, Comma, parenthesi... | apache-2.0 |
tthtlc/dpkt | dpkt/llc.py | 22 | 2099 | import struct
import dpkt, stp, ethernet
class LLC(dpkt.Packet):
_typesw = {}
def _unpack_data(self, buf):
if self.type == ethernet.ETH_TYPE_8021Q:
self.tag, self.type = struct.unpack('>HH', buf[:4])
buf = buf[4:]
elif self.type == ethernet.ETH_TYPE_MPLS or \
... | bsd-3-clause |
Curahelper/Cura | cura/Settings/UserChangesModel.py | 4 | 4859 | from UM.Qt.ListModel import ListModel
from PyQt5.QtCore import pyqtSlot, Qt
from UM.Application import Application
from cura.Settings.ExtruderManager import ExtruderManager
from UM.Settings.ContainerRegistry import ContainerRegistry
from UM.i18n import i18nCatalog
from UM.Settings.SettingFunction import SettingFunctio... | agpl-3.0 |
N3da/incubator-airflow | airflow/operators/generic_transfer.py | 46 | 2863 | # -*- coding: utf-8 -*-
#
# 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
... | apache-2.0 |
chenlian2015/skia_from_google | tools/skp/page_sets/skia_jsfiddlebigcar_desktop.py | 2 | 1282 | # Copyright 2014 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.
# pylint: disable=W0401,W0614
from telemetry.page import page as page_module
from telemetry.page import page_set as page_set_module
class SkiaBuildbotDesk... | bsd-3-clause |
michaelb42/ethersex | contrib/transgraph/transform.py | 17 | 5467 | import sys
import random
import re
from xml.dom.ext.reader import Sax2
from xml.dom.ext import Print
from xml.dom.NodeFilter import NodeFilter
scripts = []
deleteNodes = []
def handle_text_node(node):
text = node.firstChild.nodeValue.strip()
if text.find("%%") != -1:
pre = text[0:text.find("%%")]
rest = text[te... | gpl-3.0 |
seem-sky/rt-thread | tools/codeblocks.py | 53 | 4627 | #
# File : codeblocks.py
# This file is part of RT-Thread RTOS
# COPYRIGHT (C) 2006 - 2015, RT-Thread Development Team
#
# 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 ... | gpl-2.0 |
Djabbz/wakatime | wakatime/packages/pygments_py3/pygments/lexers/installers.py | 72 | 12866 | # -*- coding: utf-8 -*-
"""
pygments.lexers.installers
~~~~~~~~~~~~~~~~~~~~~~~~~~
Lexers for installer/packager DSLs and formats.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, includ... | bsd-3-clause |
soma0sd/pyNuc | ensdf/dbgen.py | 1 | 2763 | # -*- coding: utf-8 -*-
"""Inner Module Import"""
from ensdf.genlib import files
from ensdf.genlib import regexp
"""Python Packages"""
import pickle
def get_card(ident=''):
data = []
file_list = files.get_all_files()
prog = lambda i: (i+1)*100/len(file_list)
for ix, f in enumerate(file_list):
card = []
... | mit |
dagnello/ansible-modules-core | cloud/openstack/os_ironic_node.py | 131 | 12309 | #!/usr/bin/python
# coding: utf-8 -*-
# (c) 2015, Hewlett-Packard Development Company, L.P.
#
# This module 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 optio... | gpl-3.0 |
seaotterman/tensorflow | tensorflow/contrib/distributions/python/ops/bijectors/sigmoid_centered_impl.py | 104 | 1375 | # 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 |
jbloom/epitopefinder | scripts/epitopefinder_plotdistributioncomparison.py | 1 | 3447 | #!python
"""Script for plotting distributions of epitopes per site for two sets of sites.
Uses matplotlib. Designed to analyze output of epitopefinder_getepitopes.py.
Written by Jesse Bloom."""
import os
import sys
import random
import epitopefinder.io
import epitopefinder.plot
def main():
"""Main body of sc... | gpl-3.0 |
dazult/EPA-2012-Residential-Exposure-SOPs | sop_calcs/forms.py | 1 | 76603 | from __future__ import absolute_import
import copy
import datetime
from itertools import chain
from urlparse import urljoin
from django.conf import settings
from django.forms.util import flatatt, to_current_timezone
from django.utils.datastructures import MultiValueDict, MergeDict
from django.utils.html import escape... | agpl-3.0 |
petrus-v/odoo | addons/website_event/controllers/main.py | 209 | 11805 | # -*- 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 |
iceroad/baresoil-benchmark-image-resizer | lambda/src/PIL/TgaImagePlugin.py | 15 | 4942 | #
# The Python Imaging Library.
# $Id$
#
# TGA file handling
#
# History:
# 95-09-01 fl created (reads 24-bit files only)
# 97-01-04 fl support more TGA versions, including compressed images
# 98-07-04 fl fixed orientation and alpha layer bugs
# 98-09-11 fl fixed orientation for runlength decoder
#
# Copyright ... | apache-2.0 |
jmennen/group5 | Code/buzzit/buzzit_messaging/urls.py | 1 | 2558 | __author__ = 'User'
from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^myfollowers/$', views.beingFollowedByView, name="my_followers"),
url(r'^circle/new/$', views.CreateCircleView.as_view(), name="new_circle"),
url(r'^circle/(?P<slug>[0-9]+)/$', views.circleDetails, name="circle_d... | bsd-2-clause |
aeklant/scipy | scipy/optimize/_trustregion_constr/minimize_trustregion_constr.py | 10 | 24909 | import time
import numpy as np
from scipy.sparse.linalg import LinearOperator
from .._differentiable_functions import VectorFunction
from .._constraints import (
NonlinearConstraint, LinearConstraint, PreparedConstraint, strict_bounds)
from .._hessian_update_strategy import BFGS
from ..optimize import OptimizeResul... | bsd-3-clause |
mathieulavoie/Bitcluster | web/web.py | 1 | 5465 | #from web import app
from web.dao import getNodeFromAddress, getNodeInformation, getTransations, groupByAllDistribution, groupbyNode, \
groupbyAmount, groupbyDate
from flask import *
import re
import csv
import io
from datetime import datetime, timedelta
app = Flask(__name__)
@app.route('/',methods=['POST', 'G... | mit |
alazyer/oscar | frobshop/oscar/apps/offer/migrations/0007_auto__add_field_conditionaloffer_max_global_applications.py | 17 | 15124 | # -*- 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):
# Adding field 'ConditionalOffer.max_global_applications'
db.add_column('offer_conditionaloffer', 'max_globa... | gpl-2.0 |
NCI-Cloud/horizon | openstack_dashboard/local/dashboards/project_nci/instances/workflows/create_instance.py | 1 | 41960 | # openstack_dashboard.local.dashboards.project_nci.instances.workflows.create_instance
#
# Copyright (c) 2015, NCI, Australian National University.
# 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 ... | apache-2.0 |
beiko-lab/gengis | bin/Lib/_MozillaCookieJar.py | 62 | 5958 | """Mozilla / Netscape cookie loading / saving."""
import re, time
from cookielib import (_warn_unhandled_exception, FileCookieJar, LoadError,
Cookie, MISSING_FILENAME_TEXT)
class MozillaCookieJar(FileCookieJar):
"""
WARNING: you may want to backup your browser's cookies file... | gpl-3.0 |
rohlandm/servo | tests/wpt/harness/wptrunner/wptmanifest/parser.py | 133 | 23444 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#default_value:foo
#include: other.manifest
#
#[test_name.js]
# expected: ERROR
#
# [subtest 1]
# expected:
# ... | mpl-2.0 |
jjyycchh/phantomjs | src/qt/qtwebkit/Tools/gtk/common.py | 116 | 4728 | #!/usr/bin/env python
# Copyright (C) 2011 Igalia S.L.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This... | bsd-3-clause |
JianyuWang/nova | nova/api/openstack/compute/disk_config.py | 13 | 5375 | # Copyright 2011 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 |
basho-labs/riak-cxx-client | deps/boost-1.47.0/tools/build/v2/build_system.py | 10 | 34262 | # Status: mostly ported. Missing is --out-xml support, 'configure' integration
# and some FIXME.
# Base revision: 64351
# Copyright 2003, 2005 Dave Abrahams
# Copyright 2006 Rene Rivera
# Copyright 2003, 2004, 2005, 2006, 2007 Vladimir Prus
# Distributed under the Boost Software License, Version 1.0.
# (See accomp... | apache-2.0 |
CodingVault/LeetCodeInPython | sorted_array_to_binary_tree.py | 1 | 1250 | #!/usr/bin/env python
# encoding: utf-8
"""
sorted_array_to_binary_tree.py
Created by Shengwei on 2014-07-03.
"""
# https://oj.leetcode.com/problems/convert-sorted-array-to-binary-search-tree/
# tags: easy, tree, array, sorted, convert, D&C
"""
Given an array where elements are sorted in ascending order, convert it ... | apache-2.0 |
sgerhart/ansible | test/units/module_utils/basic/test_imports.py | 30 | 5537 | # -*- coding: utf-8 -*-
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2016 Toshio Kuratomi <tkuratomi@ansible.com>
# (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
... | mit |
cwilkes/event_store_meta | tests/test_functional.py | 1 | 3668 | # -*- coding: utf-8 -*-
"""Functional tests using WebTest.
See: http://webtest.readthedocs.org/
"""
import pytest
from flask import url_for
from event_store_meta.user.models import User
from .factories import UserFactory
class TestLoggingIn:
def test_can_log_in_returns_200(self, user, testapp):
# Goes... | bsd-3-clause |
Parkjihooni6186/TizenRT | external/iotivity/iotivity_1.2-rel/tools/scons/URLDownload.py | 29 | 7661 | # -*- coding: utf-8 -*-
# -- Dual Licence ----------------------------------------------------------
############################################################################
# GPL License #
# ... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.