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 |
|---|---|---|---|---|---|
mollstam/UnrealPy | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/pywin32-219/com/win32comext/axscript/client/pyscript_rexec.py | 35 | 1973 | # A version of the ActiveScripting engine that enables rexec support
# This version supports hosting by IE - however, due to Python's
# rexec module being neither completely trusted nor private, it is
# *not* enabled by default.
# As of Python 2.2, rexec is simply not available - thus, if you use this,
# a HTML page ca... | mit |
chiemseesurfer/thumbor-mogilefs-loader | loaders/mogilefs_loader_http_fallback.py | 1 | 1218 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2017 Max Oberberger (max@oberbergers.de)
#
# 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 |
ptoraskar/django | django/conf/locale/de_CH/formats.py | 504 | 1445 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
from __future__ import unicode_literals
DATE_FORMAT = 'j. F Y'
TIME_FORMAT = 'H:i'
DATE... | bsd-3-clause |
abought/osf.io | website/tokens/__init__.py | 38 | 3558 | import httplib as http
import functools
import jwt
from flask import request
from framework.exceptions import HTTPError
from website import settings
from website.tokens import handlers
from website.tokens.exceptions import TokenHandlerNotFound
class TokenHandler(object):
HANDLERS = {
'approve_registrati... | apache-2.0 |
ByteInternet/libcloud | libcloud/test/storage/test_dummy.py | 2 | 2061 | # 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 |
Banbury/cartwheel-3d | Python/Data/Characters/Bip/Controllers/Jumping.py | 1 | 21457 | from App.Proxys import *
data = SimBiController(
name = 'Jumping',
controlParamsList = [
ControlParams( joint = 'root', kp = 3000.0, kd = 300.0, tauMax = 10000.0, scale = ( 1.0, 0.2, 1.0 ) ),
ControlParams( joint = 'pelvis_torso', kp = 1000.0, kd = 100.0, tauMax = 10000.0, scale = (... | apache-2.0 |
jonparrott/google-cloud-python | bigquery/google/cloud/bigquery/dbapi/_helpers.py | 2 | 3860 | # Copyright 2017 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | apache-2.0 |
cloudbase/cinder | cinder/backup/manager.py | 5 | 44128 | # Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
# 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/LICEN... | apache-2.0 |
double-y/django | django/db/backends/oracle/features.py | 356 | 2345 | from django.db.backends.base.features import BaseDatabaseFeatures
from django.db.utils import InterfaceError
try:
import pytz
except ImportError:
pytz = None
class DatabaseFeatures(BaseDatabaseFeatures):
empty_fetchmany_value = ()
interprets_empty_strings_as_nulls = True
uses_savepoints = True
... | bsd-3-clause |
jian-li/rpg_svo | svo_analysis/scripts/compare_results.py | 17 | 6127 | #!/usr/bin/python
import os
import sys
import time
import rospkg
import numpy as np
import matplotlib.pyplot as plt
import yaml
import argparse
from matplotlib import rc
# tell matplotlib to use latex font
rc('font',**{'family':'serif','serif':['Cardo']})
rc('text', usetex=True)
from mpl_toolkits.axes_grid1.in... | gpl-3.0 |
GaleDragon/django-push-notifications | push_notifications/models.py | 3 | 3484 | from __future__ import unicode_literals
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _
from .fields import HexIntegerField
from .settings import PUSH_NOTIFICATIONS_SETTINGS as SETTINGS
@python_2_unicode_compatible
cl... | mit |
maurofaccenda/ansible | lib/ansible/modules/cloud/docker/docker_service.py | 47 | 36552 | #!/usr/bin/python
#
# Copyright 2016 Red Hat | Ansible
#
# 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 la... | gpl-3.0 |
juancarlospaco/microraptor | setup.py | 1 | 4696 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
#
# To generate DEB package from Python Package:
# sudo pip3 install stdeb
# python3 setup.py --verbose --command-packages=stdeb.command bdist_deb
#
#
# To generate RPM package from Python Package:
# sudo apt-get install rpm
# python3 setup.py bdist_rpm --verbose --fix-p... | gpl-3.0 |
mohierf/shinken | test/test_parse_perfdata.py | 18 | 5339 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2009-2014:
# Gabes Jean, naparuba@gmail.com
# Gerhard Lausser, Gerhard.Lausser@consol.de
#
# This file is part of Shinken.
#
# Shinken is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License... | agpl-3.0 |
HarryRybacki/osf.io | tests/test_rubeus.py | 9 | 19323 | #!/usr/bin/env python
# encoding: utf-8
import os
from types import NoneType
from xmlrpclib import DateTime
import mock
from nose.tools import *
from webtest_plus import TestApp
from tests.base import OsfTestCase
from tests.factories import (UserFactory, ProjectFactory, NodeFactory,
AuthFactory, PointerFactory, ... | apache-2.0 |
COCS4950G7/COSC4950 | Source/GUI/frameGUI_V1.4.py | 1 | 4896 | __author__ = 'Jon'
import Tkconstants
import tkFileDialog
from Tkinter import *
import Tkinter as Tk
########################################################################
## adding a hashinng button, used to test basic functionality of enter text.
## Test commit for pycharm rebuild
class MyApp(object):
""""""
... | gpl-3.0 |
beni55/picochess | libs/enum34/__init__.py | 33 | 28578 | """Python Enumerations"""
import sys as _sys
__all__ = ['Enum', 'IntEnum', 'unique']
pyver = float('%s.%s' % _sys.version_info[:2])
try:
any
except NameError:
def any(iterable):
for element in iterable:
if element:
return True
return False
try:
from collectio... | gpl-3.0 |
tudorvio/tempest | tempest/api/network/base_security_groups.py | 17 | 2072 | # Copyright 2013 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | apache-2.0 |
anandology/pyjamas | examples/infohierarchy/public/services/jsonrpc/http.py | 17 | 1249 | """
Copyright (c) 2006 Jan-Klaas Kollhof
This file is part of jsonrpc.
jsonrpc 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.1 of the License, or
(at your option) any later ... | apache-2.0 |
jjinux/party-playlist-picker | third-party/atom/service.py | 78 | 28927 | #!/usr/bin/python
#
# Copyright (C) 2006, 2007, 2008 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 app... | apache-2.0 |
vamsirajendra/nupic | tests/swarming/nupic/swarming/experiments/field_contrib_temporal/permutations.py | 38 | 4712 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, 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... | agpl-3.0 |
ghorn/casadi | external_packages/hpmpc/make2cmake.py | 3 | 2653 | import subprocess
import re
import os
targets = set()
for L in file("src/Makefile","r"):
m = re.match("ifeq \(\$\(TARGET\), ([A-Z0-9_]+)\)", L)
if m:
targets.add(m.group(1))
targets = sorted(list(targets))
combinations = [
("X64_AVX","GENERIC"),
("X64_AVX2","X64_INTEL_HASWELL"),
("X64_AVX","X64_INTEL_SANDY_B... | lgpl-3.0 |
ptitjes/quodlibet | quodlibet/packages/raven/utils/json.py | 4 | 2613 | """
raven.utils.json
~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
import codecs
import datetime
import uuid
import json
try:
JSONDecodeError = json.JSONDecodeError
exce... | gpl-2.0 |
hoangt/tpzsimul.gem5 | src/arch/x86/isa/insts/x87/control/clear_exceptions.py | 91 | 2159 | # Copyright (c) 2007 The Hewlett-Packard Development Company
# 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 implemen... | bsd-3-clause |
nelango/ViralityAnalysis | model/lib/nltk/test/unit/test_tgrep.py | 8 | 30801 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Natural Language Toolkit: TGrep search
#
# Copyright (C) 2001-2015 NLTK Project
# Author: Will Roberts <wildwilhelm@gmail.com>
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
'''
Unit tests for nltk.tgrep.
'''
from __future__ import absolute_impor... | mit |
edcast-inc/edx-platform-edcast | cms/djangoapps/contentstore/management/commands/create_course.py | 163 | 2188 | """
Django management command to create a course in a specific modulestore
"""
from django.core.management.base import BaseCommand, CommandError
from django.contrib.auth.models import User
from xmodule.modulestore import ModuleStoreEnum
from contentstore.views.course import create_new_course_in_store
from contentstore.... | agpl-3.0 |
quattor/aquilon | lib/aquilon/worker/templates/personality.py | 1 | 10046 | # -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2008-2016,2018 Contributor
#
# 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... | apache-2.0 |
fnordahl/nova | nova/db/sqlalchemy/migrate_repo/versions/234_add_expire_reservations_index.py | 146 | 1511 | # All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | apache-2.0 |
imdaveho/boilerplates | django-boilerplate/project_name/settings/production.py | 1 | 1544 | import sys
from {{ project_name }}.settings.default import *
# Custom Project Structure:
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
APPS_DIR = os.path.join(BASE_DIR, 'apps')
sys.path.insert(0, BASE_DIR)
sys.path.insert(1, APPS_DIR)
sys.path.insert(2, os.path.join(BASE_DIR, 'libs'))
# Production Configs (o... | gpl-2.0 |
davidhrbac/spacewalk | client/rhel/rhnlib/test/04-authenticated-proxy.py | 36 | 1278 | #!/usr/bin/python
#
#
#
#
# Usage: $0 SERVER PROXY:PORT [SYSTEMID] [PROXY_USER] [PROXY_PASS]
import sys
import httplib
sys.path.append('..')
from rhn.rpclib import Server
SERVER = "xmlrpc.rhn.redhat.com"
HANDLER = "/XMLRPC"
PROXY = "proxy.example.com:8080"
PROXY_USERNAME = None
PROXY_PASSWORD = None
system_id_file = ... | gpl-2.0 |
jdavidrcamacho/Tests_GP | 02 - Programs being tested/RV_function.py | 1 | 3615 | # -*- coding: utf-8 -*-
"""
Created on Fri Feb 3 11:36:58 2017
@author: camacho
"""
import numpy as np
import matplotlib.pyplot as pl
pl.close("all")
##### RV FUNCTION 1 - circular orbit
def RV_circular(P=365,K=0.1,T=0,gamma=0,time=100,space=20):
#parameters
#P = period in days
#K = semi-amplitude of t... | mit |
pathompongoo/ThGovJobApp | env/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.py | 224 | 39043 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2013-2014 Vinay Sajip.
# Licensed to the Python Software Foundation under a contributor agreement.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
from __future__ import unicode_literals
import base64
import codecs
import datetime
import distutils.util
from email import message_from... | gpl-3.0 |
Zord13appdesa/python-for-android | python-modules/twisted/twisted/words/protocols/jabber/component.py | 52 | 15543 | # -*- test-case-name: twisted.words.test.test_jabbercomponent -*-
#
# Copyright (c) 2001-2009 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
External server-side components.
Most Jabber server implementations allow for add-on components that act as a
seperate entity on the Jabber network, but use the ser... | apache-2.0 |
TheSimoms/Felleshoelet | spotifyconnector/venv/lib/python3.6/site-packages/werkzeug/debug/repr.py | 12 | 9621 | # -*- coding: utf-8 -*-
"""
werkzeug.debug.repr
~~~~~~~~~~~~~~~~~~~
This module implements object representations for debugging purposes.
Unlike the default repr these reprs expose a lot more information and
produce HTML instead of ASCII.
Together with the CSS and JavaScript files of the debug... | gpl-2.0 |
NeCTAR-RC/murano | murano/engine/yaql_yaml_loader.py | 2 | 2716 | # Copyright (c) 2014 Mirantis Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | apache-2.0 |
privb0x23/bliss-initramfs | pkg/hooks/Firmware.py | 1 | 1964 | # Copyright 2012-2017 Jonathan Vasquez <jon@xyinn.org>
#
# 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 notice, this
# list of conditions and the fol... | bsd-2-clause |
EdTsft/pyswip | examples/coins/coins_new.py | 10 | 1832 | # -*- coding: utf-8 -*-
# pyswip -- Python SWI-Prolog bridge
# Copyright (c) 2007-2012 Yüce Tekol
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without ... | mit |
IamJeffG/geopandas | geopandas/plotting.py | 1 | 13216 | from __future__ import print_function
import warnings
import numpy as np
from six import next
from six.moves import xrange
from shapely.geometry import Polygon
def plot_polygon(ax, poly, facecolor='red', edgecolor='black', alpha=0.5, linewidth=1.0, **kwargs):
""" Plot a single Polygon geometry """
from desc... | bsd-3-clause |
spillai/crisp | crisp/rotations.py | 1 | 9499 | # -*- coding: utf-8 -*-
from __future__ import division, print_function, absolute_import
"""
Rotation handling module
"""
__author__ = "Hannes Ovrén"
__copyright__ = "Copyright 2013, Hannes Ovrén"
__license__ = "GPL"
__email__ = "hannes.ovren@liu.se"
import numpy as np
from numpy.testing import assert_almost_equal
... | gpl-3.0 |
prim/ocempgui | doc/examples/table.py | 1 | 2042 | # Table examples.
from ocempgui.widgets import Renderer, Table, Label, Button
from ocempgui.widgets.Constants import *
def create_table_view ():
# Crate and display a Table.
table = Table (9, 2)
table.spacing = 5
table.topleft = 5, 5
label = Label ("Nonaligned wide Label")
table.add_child (0, ... | bsd-2-clause |
MERegistro/meregistro | meregistro/apps/reportes/views/normativa_jurisdiccional.py | 1 | 1076 | # -*- coding: UTF-8 -*-
from django.http import HttpResponse, HttpResponseRedirect
from datetime import datetime, date
from apps.seguridad.decorators import login_required, credential_required
from apps.seguridad.models import Usuario, Perfil
from apps.titulos.models.NormativaJurisdiccional import NormativaJurisdiccio... | bsd-3-clause |
waidyanatha/sambro-eden | modules/tests/volunteer/create_volunteer_programme.py | 27 | 2099 | """ Sahana Eden Automated Test - HRM001 Create a Volunteer Programme
@copyright: 2011-2012 (c) Sahana Software Foundation
@license: MIT
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the ... | mit |
aselle/tensorflow | tensorflow/contrib/boosted_trees/python/ops/quantile_ops.py | 23 | 8791 | # 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 |
k1995/shadowsocks | shadowsocks/eventloop.py | 30 | 7194 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2014 clowwindy
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to u... | mit |
huanchenz/STX-h-store | third_party/python/boto/pyami/startup.py | 107 | 2471 | # Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modi... | gpl-3.0 |
crr0004/taiga-back | tests/unit/test_deferred.py | 20 | 1974 | # Copyright (C) 2014 Andrey Antukh <niwi@niwi.be>
# Copyright (C) 2014 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014 David Barragán <bameda@dbarragan.com>
# This program 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 F... | agpl-3.0 |
mozbhearsum/balrog | auslib/test/web/api/test_releases.py | 1 | 2720 | from auslib.test.web.api.base import CommonTestBase
class TestPublicReleasesAPI(CommonTestBase):
def test_get_releases(self):
ret = self.public_client.get("/api/v1/releases")
got = ret.get_json()
self.assertEqual(len(got["releases"]), 3)
self.assertIsInstance(got["releases"][0], di... | mpl-2.0 |
inovasolutions/django-knowledge | tests/mock/tests/models.py | 5 | 9768 | from django.contrib.auth.models import User, AnonymousUser
from django.core.urlresolvers import reverse
from django.template.defaultfilters import slugify
from django.core import mail
from mock.tests.base import TestCase
from knowledge.models import Question, Response
class BasicModelTest(TestCase):
def test_bas... | isc |
vikatory/kbengine | kbe/src/lib/python/Lib/distutils/command/check.py | 78 | 5484 | """distutils.command.check
Implements the Distutils 'check' command.
"""
from distutils.core import Command
from distutils.errors import DistutilsSetupError
try:
# docutils is installed
from docutils.utils import Reporter
from docutils.parsers.rst import Parser
from docutils import frontend
from d... | lgpl-3.0 |
steffgrez/aio-jsonrpc-2.0 | aio_jsonrpc_20/response.py | 1 | 1779 |
class ResponseMaker(object):
__slot__ = ['error_verbose']
def __init__(self, error_verbose=True):
self.error_verbose = error_verbose
def get_response(self, result, request_id):
return {
"jsonrpc": "2.0",
"result": result,
"id": request_id
}
... | mit |
sklam/numba | numba/roc/tests/hsapy/test_matmul.py | 4 | 3369 | from timeit import default_timer as timer
import numpy as np
from numba import roc, float32
from numba.roc.hsadrv.error import HsaKernelLaunchError
import unittest
class TestMatMul(unittest.TestCase):
def test_matmul_naive(self):
@roc.jit
def matmul(A, B, C):
i = roc.get_global_id(0)
... | bsd-2-clause |
markovmodel/molPX | molpx/_linkutils.py | 1 | 18471 | import numpy as _np
from matplotlib.widgets import AxesWidget as _AxesWidget
from matplotlib.colors import is_color_like as _is_color_like
from matplotlib.axes import Axes as _mplAxes
from matplotlib.figure import Figure as _mplFigure
from IPython.display import display as _ipydisplay
from pyemma.util.types import is... | lgpl-3.0 |
2014c2g4/2015cda0623 | static/Brython3.1.1-20150328-091302/Lib/xml/dom/minidom.py | 727 | 66854 | """Simple implementation of the Level 1 DOM.
Namespaces and other minor Level 2 features are also supported.
parse("foo.xml")
parseString("<foo><bar/></foo>")
Todo:
=====
* convenience methods for getting elements and text.
* more testing
* bring some of the writer and linearizer code into conformance with this
... | gpl-3.0 |
dereneaton/pyrad | pyrad/overlapcheck.py | 3 | 7635 | #!/usr/bin/env python2
import glob
import multiprocessing
import gzip
import subprocess
import sys
import os
import itertools
from potpour import Worker
def mergepairs(WORK, UCLUST, handle, match, Q):
handle1 = handle
handle2 = handle.replace("_R1.","_R2.")
outfile = handle.replace("_R1.","M.")
whi... | gpl-3.0 |
junmin-zhu/chromium-rivertrail | media/tools/constrained_network_server/cns_test.py | 168 | 9899 | #!/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.
"""Tests for Constrained Network Server."""
import os
import signal
import subprocess
import tempfile
import time
import unittest
i... | bsd-3-clause |
robhudson/django | django/http/cookie.py | 460 | 4390 | from __future__ import unicode_literals
import sys
from django.utils import six
from django.utils.encoding import force_str
from django.utils.six.moves import http_cookies
# Some versions of Python 2.7 and later won't need this encoding bug fix:
_cookie_encodes_correctly = http_cookies.SimpleCookie().value_encode(';... | bsd-3-clause |
fernandezcuesta/ansible | lib/ansible/modules/monitoring/icinga2_feature.py | 77 | 4541 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Ansible module to manage Icinga2 feature state
(c) 2016, Loic Blot <loic.blot@unix-experience.fr>
Sponsored by Infopro Digital. http://www.infopro-digital.com/
Sponsored by E.T.A.I. http://www.etai.fr/
This file is part of Ansible
Ansible is free software: you can redi... | gpl-3.0 |
RyokoAkizuki/mtasa-blue | vendor/google-breakpad/src/tools/gyp/test/product/gyptest-product.py | 290 | 1588 | #!/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.
"""
Verifies simplest-possible build of a "Hello, world!" program
using the default build target.
"""
import TestGyp
# Android does not su... | gpl-3.0 |
Lapotor/libretime | python_apps/media-monitor/mm2/tests/test_pure.py | 12 | 2661 | # -*- coding: utf-8 -*-
import unittest
import os
import media.monitor.pure as mmp
class TestMMP(unittest.TestCase):
def setUp(self):
self.md1 = {'MDATA_KEY_MD5': '71185323c2ab0179460546a9d0690107',
'MDATA_KEY_FTYPE': 'audioclip',
'MDATA_KEY_MIME': 'audio/vorbis',
... | agpl-3.0 |
aykut/django-oscar | oscar/apps/shipping/tests.py | 1 | 4176 | from decimal import Decimal as D
from django.utils import unittest
from django.test.client import Client
from oscar.apps.shipping.methods import FreeShipping, FixedPriceShipping
from oscar.apps.shipping.models import OrderAndItemLevelChargeMethod
from oscar.apps.basket.models import Basket
from oscar.test.helpers imp... | bsd-3-clause |
qrkourier/ansible | lib/ansible/modules/cloud/pubnub/pubnub_blocks.py | 84 | 23806 | #!/usr/bin/python
#
# PubNub Real-time Cloud-Hosted Push API and Push Notification Client
# Frameworks
# Copyright (C) 2016 PubNub Inc.
# http://www.pubnub.com/
# http://www.pubnub.com/terms
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_i... | gpl-3.0 |
Liamraystanley/dropbin | lib/werkzeug/contrib/securecookie.py | 294 | 12204 | # -*- coding: utf-8 -*-
r"""
werkzeug.contrib.securecookie
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This module implements a cookie that is not alterable from the client
because it adds a checksum the server checks for. You can use it as
session replacement if all you have is a user id or something to mark
... | mit |
liangazhou/django-rdp | packages/Django-1.8.6/django/views/generic/list.py | 471 | 7630 | from __future__ import unicode_literals
from django.core.exceptions import ImproperlyConfigured
from django.core.paginator import InvalidPage, Paginator
from django.db.models.query import QuerySet
from django.http import Http404
from django.utils import six
from django.utils.translation import ugettext as _
from djang... | apache-2.0 |
zerobatu/edx-platform | common/lib/xmodule/xmodule/library_root_xblock.py | 47 | 5037 | """
'library' XBlock (LibraryRoot)
"""
import logging
from xmodule.studio_editable import StudioEditableModule
from xblock.fields import Scope, String, List, Boolean
from xblock.fragment import Fragment
from xblock.core import XBlock
log = logging.getLogger(__name__)
# Make '_' a no-op so we can scrape strings
_ = ... | agpl-3.0 |
cuongnv23/ansible | lib/ansible/modules/cloud/rackspace/rax_dns_record.py | 12 | 11374 | #!/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': ['preview'],
... | gpl-3.0 |
damonkohler/sl4a | python/src/Lib/test/test_tempfile.py | 34 | 26273 | # tempfile.py unit tests.
import tempfile
import os
import sys
import re
import errno
import warnings
import unittest
from test import test_support
warnings.filterwarnings("ignore",
category=RuntimeWarning,
message="mktemp", module=__name__)
if hasattr(os, 'stat'):
... | apache-2.0 |
jmesteve/medical | openerp/addons/base_rml_edit/__init__.py | 14 | 1470 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2011 Cubic ERP - Teradata SAC. (http://cubicerp.com).
#
# WARNING: This program as such is intended to be used by professional
# programmers who take t... | agpl-3.0 |
diofeher/django-nfa | build/lib/django/core/files/uploadhandler.py | 2 | 7978 | """
Base file upload handler classes, and the built-in concrete subclasses
"""
import os
import tempfile
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.core.files.uploaded... | bsd-3-clause |
r3b/phantomjs | src/breakpad/src/third_party/protobuf/protobuf/python/google/protobuf/message.py | 261 | 9669 | # Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# http://code.google.com/p/protobuf/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions o... | bsd-3-clause |
brianhouse/wavefarm | granu/braid/pattern.py | 1 | 2625 | """ Pattern is just a list (of whatever) that can be specified in compacted form
... with the addition of the Markov expansion of tuples on calling resolve
"""
import random
class Pattern(list):
def __init__(self, value=[0]):
list.__init__(self, value)
self.resolve()
def resolve(self... | gpl-3.0 |
kumar303/zamboni | mkt/receipts/tests/test_utils_.py | 21 | 1156 | import calendar
import time
from nose.tools import eq_
from receipts.receipts import Receipt
from mkt.receipts.utils import reissue_receipt, sign
from mkt.receipts.tests.test_verify import ReceiptTest
class TestReissue(ReceiptTest):
def test_expired(self):
receipt_data = self.sample_app_receipt()
... | bsd-3-clause |
cggh/scikit-allel | allel/test/test_api.py | 1 | 8225 | # -*- coding: utf-8 -*-
def test_public_api():
# The idea of this test is to ensure that all functions we expect to be in the
# public API under the correct namespace are indeed there.
import allel
# allel.model.ndarray
assert callable(allel.GenotypeVector)
assert callable(allel.GenotypeArray)... | mit |
igemsoftware/SYSU-Software2013 | project/Python27_32/Lib/site-packages/pythonwin/pywin/Demos/dyndlg.py | 40 | 2496 | # dyndlg.py
# contributed by Curt Hagenlocher <chi@earthlink.net>
# Dialog Template params:
# Parameter 0 - Window caption
# Parameter 1 - Bounds (rect tuple)
# Parameter 2 - Window style
# Parameter 3 - Extended style
# Parameter 4 - Font tuple
# Parameter 5 - Menu name
# Parameter 6 - Window class
# Dialog item para... | mit |
pyokagan/gyp | gyptest.py | 1752 | 8019 | #!/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.
__doc__ = """
gyptest.py -- test runner for GYP tests.
"""
import os
import optparse
import subprocess
import sys
class CommandRunner(obje... | bsd-3-clause |
cwmartin/rez | src/rez/vendor/distlib/_backport/tarfile.py | 422 | 92628 | #-------------------------------------------------------------------
# tarfile.py
#-------------------------------------------------------------------
# Copyright (C) 2002 Lars Gustaebel <lars@gustaebel.de>
# All rights reserved.
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy ... | lgpl-3.0 |
mick-d/nipype | nipype/interfaces/fsl/tests/test_auto_Complex.py | 1 | 3814 | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from __future__ import unicode_literals
from ..utils import Complex
def test_Complex_inputs():
input_map = dict(args=dict(argstr='%s',
),
complex_cartesian=dict(argstr='-complex',
position=1,
xor=['real_polar', 'real_cartesian', 'complex_cartes... | bsd-3-clause |
david-ragazzi/nupic | tests/unit/nupic/data/aggregator_test.py | 17 | 2186 | #!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions ... | gpl-3.0 |
jimstorch/tokp | tokp_lib/xml_store.py | 1 | 4808 | #------------------------------------------------------------------------------
# File: xml_store.py
# Purpose: Store and Retrieve data from XML files
# Author: Jim Storch
# License: GPLv3 see LICENSE.TXT
#------------------------------------------------------------------------------
import... | gpl-3.0 |
qianqians/Screw | 3rdparty/protobuf/python/google/protobuf/internal/message_factory_test.py | 1 | 8361 | #! /usr/bin/env python
#
# Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# https://developers.google.com/protocol-buffers/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions ... | lgpl-2.1 |
bjolivot/ansible | lib/ansible/errors/yaml_strings.py | 145 | 3816 | # (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 |
elkingtonmcb/nupic | src/regions/ImageSensorExplorers/ExhaustiveSweep.py | 17 | 11957 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, 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... | agpl-3.0 |
westinedu/newertrends | mezzanine/twitter/migrations/0001_initial.py | 20 | 3866 | # encoding: 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 model 'Query'
db.create_table('twitter_query', (
('interested', self.gf('django.db.models.fie... | bsd-3-clause |
resmo/ansible | lib/ansible/module_utils/oneandone.py | 109 | 10662 | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... | gpl-3.0 |
tamnm/kodi.mp3.zing.vn | dev/service.vnmusic/service.py | 1 | 5800 | import time
import xbmc
import urlparse
import SimpleHTTPServer
import SocketServer
import urllib2
import urllib
import re
import json
import base64
import requests
import httplib
songInfoApi = 'http://api.mp3.zing.vn/api/mobile/song/getsonginfo?keycode=fafd463e2131914934b73310aa34a23f&requestdata={"id"... | gpl-2.0 |
imply/chuu | native_client_sdk/src/tools/tests/quote_test.py | 54 | 5596 | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import optparse
import os
import sys
import unittest
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
PARENT_DIR = os.path.... | bsd-3-clause |
tangfeixiong/nova | nova/tests/unit/virt/test_block_device.py | 11 | 36872 | # All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | apache-2.0 |
znerol/spreadflow-delta | spreadflow_delta/test/test_symlink.py | 1 | 1301 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import copy
from mock import Mock, patch
from testtools import TestCase
from spreadflow_core.scheduler import Scheduler
from spreadflow_delta.test.matchers import MatchesSendDeltaIte... | mit |
robbiet480/home-assistant | homeassistant/components/emulated_hue/upnp.py | 2 | 5602 | """Support UPNP discovery method that mimics Hue hubs."""
import logging
import select
import socket
import threading
from aiohttp import web
from homeassistant import core
from homeassistant.components.http import HomeAssistantView
from .const import HUE_SERIAL_NUMBER, HUE_UUID
_LOGGER = logging.getLogger(__name__... | apache-2.0 |
EvanK/ansible | test/integration/targets/vault/password-script.py | 129 | 1025 | #!/usr/bin/env python
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that it will b... | gpl-3.0 |
vikatory/kbengine | kbe/res/scripts/common/Lib/encodings/iso2022_jp_ext.py | 816 | 1069 | #
# iso2022_jp_ext.py: Python Unicode Codec for ISO2022_JP_EXT
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#
import _codecs_iso2022, codecs
import _multibytecodec as mbc
codec = _codecs_iso2022.getcodec('iso2022_jp_ext')
class Codec(codecs.Codec):
encode = codec.encode
decode = codec.decode
class Incr... | lgpl-3.0 |
mkrzewic/AliPhysics | PWGJE/EMCALJetTasks/Tracks/analysis/GetScalers.py | 41 | 2699 | #**************************************************************************
#* Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. *
#* *
#* Author: The ALICE Off-line Project. *
#* Contributors ... | bsd-3-clause |
schelleg/PYNQ | sdbuild/packages/show_ip/show_ip.py | 4 | 1970 | #!/usr/bin/python3.6
from pynq.overlays.base import BaseOverlay
from pynq import PL
from pynq.lib.pmod import PMOD_GROVE_G3
from pynq.lib.pmod import Grove_OLED
import subprocess as sp
import signal
from sys import exit
def show_ip(ol, interface, ip_addr):
"""Displays the given IP address on a GROVE OLED screen"... | bsd-3-clause |
cuboxi/android_external_chromium_org | third_party/tlslite/tlslite/integration/SMTP_TLS.py | 87 | 4726 | """TLS Lite + smtplib."""
from smtplib import SMTP
from tlslite.TLSConnection import TLSConnection
from tlslite.integration.ClientHelper import ClientHelper
class SMTP_TLS(SMTP):
"""This class extends L{smtplib.SMTP} with TLS support."""
def starttls(self,
username=None, password=None, share... | bsd-3-clause |
StefanRijnhart/OpenUpgrade | addons/hr_timesheet_invoice/report/account_analytic_profit.py | 96 | 5733 | # -*- 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 |
unho/translate | translate/storage/test_yaml.py | 1 | 12717 | # -*- coding: utf-8 -*-
import pytest
import ruamel.yaml
from translate.storage import base, test_monolingual, yaml
class TestYAMLResourceUnit(test_monolingual.TestMonolingualUnit):
UnitClass = yaml.YAMLUnit
def test_getlocations(self):
unit = self.UnitClass("teststring")
unit.setid('some-... | gpl-2.0 |
oxfishapp/RESTful | src/commons.py | 1 | 9031 | # -*- coding: utf-8 -*-
#!/usr/bin/env python
#!flask/bin/python
from flask.ext.restful.fields import Raw
from api_errors import error_handled
class Set_to_List(Raw):
def format(self, value):
""" (set) -> list
Convertir un set a list y retornarlo.
"""
return list(value)
class... | unlicense |
Ziqi-Li/bknqgis | pandas/pandas/core/window.py | 3 | 68731 | """
provide a generic structure to support window functions,
similar to how we have a Groupby object
"""
from __future__ import division
import warnings
import numpy as np
from collections import defaultdict
from datetime import timedelta
from pandas.core.dtypes.generic import (
ABCSeries,
ABCDataFrame,
... | gpl-2.0 |
tarzan0820/odoo | addons/account/report/__init__.py | 381 | 1513 | # -*- 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 |
her0e1c1/pystock | stock/signals.py | 1 | 2696 | import pandas as pd
from . import line, util
def rolling_mean(series, period):
"""現在の株価(短期)と長期移動平均線(長期)のクロス"""
slow = series.rolling(window=period, center=False).mean()
return util.cross(series, slow)
def rolling_mean_ratio(series, period, ratio):
"""長期移動平均線と現在の株価の最終日の差がratio乖離したら売買シグナル"""
mean ... | gpl-3.0 |
ted-dunstone/ivs | hub_demo/test_match.py | 1 | 1043 | import pika
import sys
import logging
logging.basicConfig()
connection = pika.BlockingConnection(pika.ConnectionParameters(
host='localhost'))
channel = connection.channel()
channel.exchange_declare(exchange='Australia_NZ_Exchange',
type='headers')
result = channel.queue_declare(excl... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.