repo_name stringlengths 5 100 | path stringlengths 4 294 | copies stringclasses 990
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
thanhacun/odoo | openerp/addons/base/ir/ir_ui_view.py | 44 | 52067 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
frankyrumple/ope | libs/gluon/contrib/pymysql/tests/test_basic.py | 45 | 9146 | from pymysql.tests import base
from pymysql import util
import time
import datetime
class TestConversion(base.PyMySQLTestCase):
def test_datatypes(self):
""" test every data type """
conn = self.connections[0]
c = conn.cursor()
c.execute("create table test_datatypes (b bit, i int, ... | mit |
40223136/20150616test1 | static/Brython3.1.1-20150328-091302/Lib/unittest/test/test_result.py | 788 | 19069 | import io
import sys
import textwrap
from test import support
import traceback
import unittest
class Test_TestResult(unittest.TestCase):
# Note: there are not separate tests for TestResult.wasSuccessful(),
# TestResult.errors, TestResult.failures, TestResult.testsRun or
# TestResult.shouldStop because t... | gpl-3.0 |
PACKED-vzw/scoremodel | scoremodel/modules/api/generic.py | 1 | 6105 | from flask_babel import gettext as _
from scoremodel.modules.msg.messages import module_error_msg as _e
from scoremodel.modules.error import RequiredAttributeMissing, DatabaseItemDoesNotExist
from scoremodel.models.general import Section, Answer, Report, RiskFactor, Question
from sqlalchemy import and_, or_
from dateti... | gpl-2.0 |
alshedivat/tensorflow | tensorflow/contrib/learn/python/learn/learn_io/__init__.py | 42 | 2656 | # 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 |
andresgz/django | tests/template_tests/tests.py | 67 | 4770 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import sys
from django.contrib.auth.models import Group
from django.core import urlresolvers
from django.template import Context, Engine, TemplateSyntaxError
from django.template.base import UNKNOWN_SOURCE
from django.test import SimpleTestCase, override... | bsd-3-clause |
syoamakase/Re-ROS | re_agent/src/dqn.py | 1 | 3442 | from chainerrl import agents
from logging import getLogger
from chainerrl.misc.batch_states import batch_states
from chainerrl.misc.copy_param import synchronize_parameters
from chainer import cuda
import chainer.functions as F
import chainer
import cv2
import numpy as np
import copy
import rospy
class DQN(agents.doub... | apache-2.0 |
talha81/TACTIC-DEV | src/pyasm/deprecated/flash/widget/flash_render_wdg.py | 6 | 7359 | ###########################################################
#
# Copyright (c) 2005, Southpaw Technology
# All Rights Reserved
#
# PROPRIETARY INFORMATION. This software is proprietary to
# Southpaw Technology, and is not to be reproduced, transmitted,
# or disclosed in any way without written permi... | epl-1.0 |
vinayan3/clpricehistory | django/contrib/auth/context_processors.py | 152 | 2229 | from django.utils.functional import lazy, memoize, SimpleLazyObject
from django.contrib import messages
# PermWrapper and PermLookupDict proxy the permissions system into objects that
# the template system can understand.
class PermLookupDict(object):
def __init__(self, user, module_name):
self.user, self... | bsd-3-clause |
Zord13appdesa/python-for-android | python3-alpha/extra_modules/gdata/tlslite/utils/rijndael.py | 48 | 11313 | """
A pure python (slow) implementation of rijndael with a decent interface
To include -
from rijndael import rijndael
To do a key setup -
r = rijndael(key, block_size = 16)
key must be a string of length 16, 24, or 32
blocksize must be 16, 24, or 32. Default is 16
To use -
ciphertext = r.encrypt(plaintext)
plai... | apache-2.0 |
jaredivey/ns-3-sdn | src/antenna/bindings/modulegen__gcc_ILP32.py | 42 | 89098 | from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
import pybindgen.settings
import warnings
class ErrorHandler(pybindgen.settings.ErrorHandler):
def handle_error(self, wrapper, exception, traceback_):
warnings.warn("exception %r in wrapper %s" % (exception, wrapper))
... | gpl-2.0 |
googleapis/python-automl | samples/snippets/vision_classification_create_dataset_test.py | 1 | 1341 | # Copyright 2020 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, s... | apache-2.0 |
admcrae/tensorflow | tensorflow/contrib/learn/python/learn/learn_io/graph_io.py | 10 | 34494 | # 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 |
ibotty/alot | alot/settings/utils.py | 7 | 2696 | # Copyright (C) 2011-2012 Patrick Totzke <patricktotzke@gmail.com>
# This file is released under the GNU GPL, version 3 or a later revision.
# For further details see the COPYING file
from configobj import ConfigObj, ConfigObjError, flatten_errors
from validate import Validator
from errors import ConfigError
from urwi... | gpl-3.0 |
Dectinc/leetcode | python/212 - Word Search II.py | 1 | 1726 | # -*- coding: utf-8 -*-
# @filename 212 - Word Search II
# @author v-shijch
# @date 2015-07-08 14:57 PM
class Node():
def __init__(self):
self.next = {}
self.word = None
class Solution:
def __init__(self):
self.m = 0
self.n = 0
self.res = set()
# @param {ch... | gpl-2.0 |
dava/dava.engine | RepoTools/Teamcity/report_build_status.py | 1 | 2847 | #!/usr/bin/env python
import sys
import os
import argparse
import json
import time
import stash_api
import team_city_api
import stash_api
import common_tool
def __parser_args():
arg_parser = argparse.ArgumentParser()
stash_api.argparse_add_argument( arg_parser )
team_city_api.argparse_add_argument( arg_p... | bsd-3-clause |
cbeloni/pychronesapp | backend/venv/lib/python2.7/site-packages/unidecode/x076.py | 252 | 4639 | data = (
'Yu ', # 0x00
'Cui ', # 0x01
'Ya ', # 0x02
'Zhu ', # 0x03
'Cu ', # 0x04
'Dan ', # 0x05
'Shen ', # 0x06
'Zhung ', # 0x07
'Ji ', # 0x08
'Yu ', # 0x09
'Hou ', # 0x0a
'Feng ', # 0x0b
'La ', # 0x0c
'Yang ', # 0x0d
'Shen ', # 0x0e
'Tu ', # 0x0f
'Yu ', # 0x10
'Gua ',... | mit |
markslwong/tensorflow | tensorflow/python/ops/distributions/multinomial.py | 25 | 11069 | # 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 |
XiaosongWei/chromium-crosswalk | third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/coverage/html.py | 64 | 10721 | """HTML reporting for Coverage."""
import os, re, shutil
import coverage
from coverage.backward import pickle, write_encoded
from coverage.misc import CoverageException, Hasher
from coverage.phystokens import source_token_lines
from coverage.report import Reporter
from coverage.templite import Templite
# Disable pyl... | bsd-3-clause |
DayGitH/Python-Challenges | DailyProgrammer/DP20120713A.py | 1 | 1390 | """
Write a function that transforms a string into title case
[http://en.wikipedia.org/wiki/Letter_case#Headings_and_publication_titles]. This mostly means: capitalizing only every
first letter of every word in the string. However, there are some non-obvious exceptions to title case which can't
easily be hard-coded. Yo... | mit |
mantidproject/mantid | scripts/SANS/sans/gui_logic/models/SummationSettingsModel.py | 3 | 4523 | # Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source,
# Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
# SPDX - License - Identifier: GPL - 3.0 +
from... | gpl-3.0 |
muffinresearch/olympia | apps/editors/tests/test_models.py | 8 | 25695 | # -*- coding: utf-8 -*-
import datetime
import time
from django.core import mail
from nose.tools import eq_
import amo
import amo.tests
from amo.tests import addon_factory
from addons.models import Addon
from versions.models import Version, version_uploaded, ApplicationsVersions
from files.models import File
from ap... | bsd-3-clause |
djgagne/scikit-learn | sklearn/covariance/tests/test_robust_covariance.py | 213 | 3359 | # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Gael Varoquaux <gael.varoquaux@normalesup.org>
# Virgile Fritsch <virgile.fritsch@inria.fr>
#
# License: BSD 3 clause
import numpy as np
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_alm... | bsd-3-clause |
nin042/phantomjs | src/qt/qtbase/src/3rdparty/freetype/src/tools/chktrcmp.py | 381 | 3826 | #!/usr/bin/env python
#
# Check trace components in FreeType 2 source.
# Author: suzuki toshiya, 2009
#
# This code is explicitly into the public domain.
import sys
import os
import re
SRC_FILE_LIST = []
USED_COMPONENT = {}
KNOWN_COMPONENT = {}
SRC_FILE_DIRS = [ "src" ]
TRACE_DEF_FILES = [ "include/freetype/in... | bsd-3-clause |
jsoref/django | django/contrib/gis/maps/google/zoom.py | 527 | 6676 | from __future__ import unicode_literals
from math import atan, exp, log, pi, sin
from django.contrib.gis.geos import GEOSGeometry, LinearRing, Point, Polygon
from django.contrib.gis.maps.google.gmap import GoogleMapException
from django.utils.six.moves import range
# Constants used for degree to radian conversion, a... | bsd-3-clause |
Wandern/UdacityScalable | Lesson_3/additions/utils.py | 384 | 1576 | import json
import os
import time
import uuid
from google.appengine.api import urlfetch
from models import Profile
def getUserId(user, id_type="email"):
if id_type == "email":
return user.email()
if id_type == "oauth":
"""A workaround implementation for getting userid."""
auth = os.ge... | gpl-3.0 |
robotpilot/crazyflie_ros | crazyflie_controller/scripts/controller.py | 2 | 5431 | #!/usr/bin/env python
import rospy
import math
import tf
import numpy as np
from tf import TransformListener
from std_msgs.msg import Empty, Float32
from geometry_msgs.msg import Twist, PoseStamped, Pose
import std_srvs.srv
from pid import PID
class Controller:
Idle = 0
Automatic = 1
TakingOff = 2
Lan... | mit |
clab/cnn | examples/reinforcement-learning/network.py | 4 | 2989 | import dynet as dy
class Network(object):
def __init__(self, pc):
self.pc = dy.ParameterCollection() if pc is None else pc
def update(self, other, soft=False, tau=0.1):
params_self, params_other = self.pc.parameters_list(), other.pc.parameters_list()
for x, y in zip(params_self, param... | apache-2.0 |
articuluxe/harmsway | .emacs.d/elisp/emacs-jedi/jediepcserver.py | 4 | 17215 | #!/usr/bin/env python
"""
Jedi EPC server.
Copyright (C) 2012 Takafumi Arakaki
Author: Takafumi Arakaki <aka.tkf at gmail.com>
This file is NOT part of GNU Emacs.
Jedi EPC server 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 So... | mit |
ehooo/safecreative-python-api | example_register.py | 1 | 1191 | import SafeCreativeAPI
if __name__=='__main__':
share_key=""
priv_key =""
api = SafeCreativeAPI.SafeCreativeAPI(share_key, priv_key, True)
#Para que no se muestre el texto extra del modo debug
SafeCreativeAPI.DEBUG_MODE = False
#Podriamos insertar un usuario directamente o crear uno como es el caso
api.AUTH_KE... | gpl-3.0 |
parameshbabu/samples | AllJoyn/Samples/OICAdapter/iotivity-1.0.0/build_common/iotivityconfig/compiler/default_configuration.py | 64 | 2636 | # ------------------------------------------------------------------------
# Copyright 2015 Intel 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/li... | mit |
jabesq/home-assistant | homeassistant/components/ambiclimate/config_flow.py | 3 | 4888 | """Config flow for Ambiclimate."""
import logging
import ambiclimate
from homeassistant import config_entries
from homeassistant.components.http import HomeAssistantView
from homeassistant.core import callback
from homeassistant.helpers.aiohttp_client import async_get_clientsession
from .const import (AUTH_CALLBACK_N... | apache-2.0 |
utke1/numpy | tools/swig/test/testSuperTensor.py | 100 | 16492 | #! /usr/bin/env python
from __future__ import division
# System imports
from distutils.util import get_platform
from math import sqrt
import os
import sys
import unittest
# Import NumPy
import numpy as np
major, minor = [ int(d) for d in np.__version__.split(".")[:2] ]
if major == 0: BadListError = Type... | bsd-3-clause |
Yadnyawalkya/integration_tests | cfme/physical/physical_rack.py | 3 | 11141 | # -*- coding: utf-8 -*-
"""A model of an Infrastructure PhysicalRack in CFME."""
import attr
from lxml.html import document_fromstring
from navmazing import NavigateToAttribute
from widgetastic.widget import Text
from widgetastic.widget import View
from widgetastic_patternfly import Accordion
from widgetastic_patternfl... | gpl-2.0 |
wri/gfw-api | lib/requests/packages/chardet/chardistribution.py | 2755 | 9226 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | gpl-2.0 |
leo-the-manic/django-typetables | testproject/testproject/settings.py | 1 | 2021 | """
Django settings for testproject project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...... | lgpl-3.0 |
jonathanchu/pickleback | settings.py | 1 | 3930 | # Django settings for pickleback project.
import os
import sys
## GLOBAL PATHS
# ---------------------------------------------------------------------------
#
join = lambda p1,p2: os.path.abspath(os.path.join(p1,p2))
PROJECT = os.path.abspath(os.path.dirname(__file__))
LIBRARIES = join(PROJECT, 'libraries')
APPLICAT... | mit |
AlirezaShahabi/zipline | zipline/assets/futures.py | 15 | 5311 | from pandas import Timestamp, Timedelta
from pandas.tseries.tools import normalize_date
class FutureChain(object):
""" Allows users to look up future contracts.
Parameters
----------
asset_finder : AssetFinder
An AssetFinder for future contract lookups, in particular the
AssetFinder o... | apache-2.0 |
y12uc231/edx-platform | lms/djangoapps/course_wiki/editors.py | 101 | 2244 | from django import forms
from django.forms.util import flatatt
from django.utils.encoding import force_unicode
from django.utils.html import conditional_escape
from django.utils.safestring import mark_safe
from django.template.loader import render_to_string
from wiki.editors.base import BaseEditor
from wiki.editors.m... | agpl-3.0 |
praveen-pal/edx-platform | common/lib/xmodule/xmodule/contentstore/utils.py | 17 | 1691 | from xmodule.modulestore import Location
from xmodule.contentstore.content import StaticContent
from .django import contentstore
def empty_asset_trashcan(course_locs):
'''
This method will hard delete all assets (optionally within a course_id) from the trashcan
'''
store = contentstore('trashcan')
... | agpl-3.0 |
kenwang815/KodiPlugins | script.module.youtube.dl/lib/youtube_dl/extractor/makerschannel.py | 66 | 1593 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
class MakersChannelIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?makerschannel\.com/.*(?P<id_type>video|production)_id=(?P<id>[0-9]+)'
_TEST = {
'url': 'http://makerschannel.com/en/zoomin/commu... | gpl-2.0 |
justajeffy/arsenalsuite | python/pythondotnet/pythonnet/src/tests/leaktest.py | 10 | 11909 | # ===========================================================================
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE D... | gpl-2.0 |
alexpirine/python-trivial-sudoku | setup.py | 1 | 1212 | #!/usr/bin/env python
# coding: utf-8
# Copyright (c) 2016 Alexandre Syenchuk (alexpirine)
from setuptools import setup
if __name__ == '__main__':
setup(
name='Trivial-Sudoku',
version='2.0',
url='https://github.com/alexpirine/python-trivial-sudoku',
license='New BSD License',
... | bsd-2-clause |
kogotko/carburetor | openstack_dashboard/dashboards/project/images/images/views.py | 3 | 6045 | # Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the... | apache-2.0 |
Nukesor/spacesurvival | server/data/types.py | 1 | 1056 | """All valid types for Research, Resources and Models."""
from enum import Enum
class ResearchTypes(Enum):
"""This class contains all types of valid researches.
It's used to check against the names in `research_data.yml`, to validate types in requests
and to guarantee database string integrity.
"""
... | mit |
vedun/aiohttp | tests/test_streams.py | 6 | 21126 | """Tests for streams.py"""
import asyncio
import unittest
from unittest import mock
from aiohttp import streams
from aiohttp import test_utils
class TestStreamReader(unittest.TestCase):
DATA = b'line1\nline2\nline3\n'
def setUp(self):
self.loop = asyncio.new_event_loop()
asyncio.set_event_... | apache-2.0 |
wogong/xunlei-lixian | lixian_plugins/parsers/__init__.py | 14 | 1246 |
import re
page_parsers = {}
def register_parser(site, extend_link):
page_parsers[site] = extend_link
def in_site(url, site):
if url.startswith(site):
return True
if '*' in site:
import fnmatch
p = fnmatch.translate(site)
return re.match(p, url)
def find_parser(link):
for p in page_parsers:
if in_sit... | mit |
jeremybrodt/mbed | tools/host_tests/stdio_auto.py | 122 | 2105 | """
mbed SDK
Copyright (c) 2011-2013 ARM Limited
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 |
elieux/kaira | gui/codeedit.py | 5 | 8156 | #
# Copyright (C) 2010-2013 Stanislav Bohm
# 2011 Ondrej Garncarz
#
# This file is part of Kaira.
#
# Kaira is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3 of t... | gpl-3.0 |
MicroTrustRepos/microkernel | src/l4/pkg/python/contrib/Lib/test/test_wsgiref.py | 55 | 17810 | from __future__ import nested_scopes # Backward compat for 2.1
from unittest import TestCase
from wsgiref.util import setup_testing_defaults
from wsgiref.headers import Headers
from wsgiref.handlers import BaseHandler, BaseCGIHandler
from wsgiref import util
from wsgiref.validate import validator
from wsgiref.simple... | gpl-2.0 |
bd339/servo | tests/wpt/web-platform-tests/tools/html5lib/html5lib/sanitizer.py | 423 | 16428 | from __future__ import absolute_import, division, unicode_literals
import re
from xml.sax.saxutils import escape, unescape
from .tokenizer import HTMLTokenizer
from .constants import tokenTypes
class HTMLSanitizerMixin(object):
""" sanitization of XHTML+MathML+SVG and of inline style attributes."""
accepta... | mpl-2.0 |
LABSN/expyfun | expyfun/analyze/_viz.py | 2 | 22433 | """Analysis visualization functions
"""
import numpy as np
from itertools import chain
from .._utils import string_types
def format_pval(pval, latex=True, scheme='default'):
"""Format a p-value using one of several schemes.
Parameters
----------
pval : float | array-like
The raw p-value(s).... | bsd-3-clause |
gpailler/AtlassianBot | tests/test_bamboo.py | 1 | 6229 | import json
import pytest
import re
import requests
from urllib.parse import parse_qs
from .common import get_message, controlled_responses
from plugins.bamboo import BambooBot
with open('tests/test_bamboo_data.json') as data_file:
data = json.load(data_file)
server = {'host': 'http://host', 'username': 'user', ... | mit |
c-bit/c-bit | contrib/linearize/linearize-data.py | 1 | 8825 | #!/usr/bin/python
#
# linearize-data.py: Construct a linear, no-fork version of the chain.
#
# Copyright (c) 2013-2014 The C-Bit Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
from __future__ import print_functi... | mit |
labordoc/labordoc-next | modules/bibmatch/lib/bibmatch_regression_tests.py | 1 | 28340 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2010, 2011 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (at your opt... | gpl-2.0 |
mravikumar281/staging-server | emis/build/django-socketio/django_socketio/example_project/chat/events.py | 10 | 1749 |
from django.shortcuts import get_object_or_404
from django.utils.html import strip_tags
from django_socketio import events
from chat.models import ChatRoom
@events.on_message(channel="^room-")
def message(request, socket, context, message):
"""
Event handler for a room receiving a message. First validates a... | mit |
thunderhoser/GewitterGefahr | gewittergefahr/deep_learning/permutation_test.py | 1 | 13205 | """Unit tests for permutation.py."""
import unittest
import numpy
from gewittergefahr.gg_utils import radar_utils
from gewittergefahr.gg_utils import soundings
from gewittergefahr.deep_learning import cnn
from gewittergefahr.deep_learning import permutation
from gewittergefahr.deep_learning import input_examples
from ... | mit |
adamwwt/chvac | venv/lib/python2.7/site-packages/blinker/base.py | 87 | 14847 | # -*- coding: utf-8; fill-column: 76 -*-
"""Signals and events.
A small implementation of signals, inspired by a snippet of Django signal
API client code seen in a blog post. Signals are first-class objects and
each manages its own receivers and message emission.
The :func:`signal` function provides singleton behavi... | mit |
Samsung-AG/kubernetes | cluster/juju/charms/trusty/kubernetes-master/hooks/hooks.py | 101 | 11762 | #!/usr/bin/env python
# Copyright 2015 The Kubernetes 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
#
# Unle... | apache-2.0 |
kiith-sa/QGIS | cmake/FindPyQt.py | 14 | 2617 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2007, Simon Edwards <simon@simonzone.com>
# 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... | gpl-2.0 |
storm-computers/odoo | openerp/addons/test_inherit/tests/test_inherit.py | 44 | 4554 | # -*- coding: utf-8 -*-
from openerp.tests import common
class test_inherits(common.TransactionCase):
def test_00_inherits(self):
""" Check that a many2one field with delegate=True adds an entry in _inherits """
daughter = self.env['test.inherit.daughter']
self.assertEqual(daughter._inher... | agpl-3.0 |
dlazz/ansible | lib/ansible/playbook/conditional.py | 12 | 10014 | # (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 |
AndKyr/GETELEC | python/lengthtest.py | 1 | 1605 | #!/usr/bin/python
"""This plots the spectra as outputed in spectra.csv from getelec. Spectra has to be
T in the GetelecPar.in"""
import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mb
import os
font = 30
mb.rcParams["font.family"] = "Serif"
mb.rcParams["font.size"] = font
mb.rcParams["axes.labe... | gpl-3.0 |
aliok/trnltk | trnltk/statistics/test/test_suffixtransitionstats.py | 1 | 4956 | # coding=utf-8
"""
Copyright 2012 Ali Ok (aliokATapacheDOTorg)
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 |
CloudServer/cinder | cinder/tests/unit/api/v2/test_snapshots.py | 1 | 18203 | # Copyright 2011 Denali Systems, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | apache-2.0 |
GunnerJnr/_CodeInstitute | Stream-3/Full-Stack-Development/19.Djangos-Testing-Framework/3.How-To-Load-Test-Data-With-Fixtures/we_are_social/hello/tests.py | 7 | 1498 | # -*- coding: utf-8 -*-
"""
Test.py:
"""
from __future__ import unicode_literals
from django.core.urlresolvers import resolve
from django.shortcuts import render_to_response
from django.test import TestCase
from hello.views import get_index
from accounts.models import User
# Create your tests here.
class HomePageTe... | mit |
alexus37/AugmentedRealityChess | pythonAnimations/pyOpenGLChess/engineDirectory/oglc-env/lib/python2.7/site-packages/setuptools/tests/test_test.py | 286 | 3710 | # -*- coding: UTF-8 -*-
"""develop tests
"""
import sys
import os, shutil, tempfile, unittest
import tempfile
import site
from distutils.errors import DistutilsError
from setuptools.compat import StringIO
from setuptools.command.test import test
from setuptools.command import easy_install as easy_install_pkg
from set... | mit |
wido/cloudstack | test/integration/component/test_deploy_vgpu_vm.py | 6 | 83687 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | apache-2.0 |
abligh/xen-4.2-live-migrate | tools/python/scripts/xapi.py | 18 | 29223 | #!/usr/bin/python
#============================================================================
# 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 distribu... | gpl-2.0 |
MRigal/django | tests/utils_tests/test_numberformat.py | 307 | 4049 | # -*- encoding: utf-8 -*-
from __future__ import unicode_literals
from decimal import Decimal
from sys import float_info
from unittest import TestCase
from django.utils.numberformat import format as nformat
class TestNumberFormat(TestCase):
def test_format_number(self):
self.assertEqual(nformat(1234, '... | bsd-3-clause |
jayceyxc/hue | desktop/core/ext-py/boto-2.42.0/tests/integration/dynamodb/test_layer2.py | 114 | 19814 | # Copyright (c) 2012 Mitch Garnaat http://garnaat.org/
# All rights reserved.
#
# 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 ... | apache-2.0 |
kvesteri/postgresql-audit | tests/test_custom_schema.py | 1 | 5435 | # -*- coding: utf-8 -*-
import pytest
import sqlalchemy as sa
from sqlalchemy.ext.declarative import declarative_base
from postgresql_audit import VersioningManager
from .utils import last_activity
@pytest.fixture
def schema_name():
return 'audit'
@pytest.yield_fixture
def versioning_manager(base, schema_nam... | bsd-2-clause |
sergio-incaser/odoo | addons/mrp/wizard/__init__.py | 374 | 1199 | # -*- 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 |
gdkar/pyglet | contrib/scene2d/scene2d/event.py | 29 | 4915 | #!/usr/bin/env python
'''
Event filters for scene2d Views
===============================
This module provides decorators which limit the cells and sprites for which
events are generated by scene2d Views. Some examples of usage::
# attach the following event handler to the map
@event(view)
# only highli... | bsd-3-clause |
40223119/2015w13-1 | static/Brython3.1.3-20150514-095342/Lib/multiprocessing/dummy/__init__.py | 693 | 4380 | #
# Support for the API of the multiprocessing package using threads
#
# multiprocessing/dummy/__init__.py
#
# Copyright (c) 2006-2008, R Oudkerk
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
... | gpl-3.0 |
linked67/p2pool-kryptonite | SOAPpy/WSDL.py | 294 | 5100 | """Parse web services description language to get SOAP methods.
Rudimentary support."""
ident = '$Id: WSDL.py 1467 2008-05-16 23:32:51Z warnes $'
from version import __version__
import wstools
import xml
from Errors import Error
from Client import SOAPProxy, SOAPAddress
from Config import Config
import urllib
class... | gpl-3.0 |
arjun372/Analog-Utility-Meter-Reader | py_camServer.py | 1 | 1707 | #!/usr/bin/python
'''
Author: Igor Maculan - n3wtron@gmail.com
A Simple mjpg stream http server
'''
import cv2
from PIL import Image
from BaseHTTPServer import BaseHTTPRequestHandler,HTTPServer
import StringIO
import time
capture=None
class CamHandler(BaseHTTPRequestHandler):
def do_GET(self):
if self.path.endswi... | mit |
davharris/retriever | try_install_all.py | 2 | 1795 | """Attempt to install all datasets into all database management systems
This module, when run, attempts to install datasets from all Retriever scripts
in the /scripts folder (except for those listed in IGNORE), for each engine in
ENGINE_LIST() from __init__.py. In other words, it runs trys to install using
all possibl... | mit |
dipspb/ardupilot | mk/PX4/Tools/genmsg/test/test_genmsg_command_line.py | 216 | 1937 | # Software License Agreement (BSD License)
#
# Copyright (c) 2011, Willow Garage, 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... | gpl-3.0 |
neutrongenious/plex-PKChannel | Contents/Code/__init__.py | 1 | 8835 | PLUGIN_PREFIX = "/video/pakitvtv"
NAME = L('Title')
# make sure to replace artwork with what you want
# these filenames reference the example files in
# the Contents/Resources/ folder in the bundle
ART = 'art-default.jpg'
ICON = 'icon.png'
##############################################################################... | apache-2.0 |
muntasirsyed/intellij-community | python/helpers/docutils/readers/python/moduleparser.py | 50 | 25783 | # $Id: moduleparser.py 5738 2008-11-30 08:59:04Z grubert $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
Parser for Python modules.
The `parse_module()` function takes a module's text and file name,
runs it through the module parser (using compiler.py ... | apache-2.0 |
chenziliang/google | Splunk_TA_google/bin/googleapiclient/errors.py | 57 | 3622 | # Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | mit |
TeachAtTUM/edx-platform | openedx/core/djangoapps/contentserver/migrations/0001_initial.py | 62 | 1129 | # -*- coding: utf-8 -*-
#pylint: skip-file
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),... | agpl-3.0 |
sekikn/incubator-airflow | airflow/providers/amazon/aws/operators/sqs.py | 7 | 3016 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | apache-2.0 |
ResearchSoftwareInstitute/greendatatranslator | src/greentranslator/python-client/test/test_date_range.py | 1 | 1325 | # coding: utf-8
"""
Environmental Exposures API
Environmental Exposures API
OpenAPI spec version: 1.0.0
Contact: stealey@renci.org
Generated by: https://github.com/swagger-api/swagger-codegen.git
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file ex... | bsd-3-clause |
gnu-sandhi/sandhi | modules/gr36/gr-utils/src/python/modtool/gr-newmod/docs/doxygen/doxyxml/generated/indexsuper.py | 348 | 19286 | #!/usr/bin/env python
#
# Generated Thu Jun 11 18:43:54 2009 by generateDS.py.
#
import sys
import getopt
from string import lower as str_lower
from xml.dom import minidom
from xml.dom import Node
#
# User methods
#
# Calls to the methods in these classes are generated by generateDS.py.
# You can replace these metho... | gpl-3.0 |
fuzzyray/pynet_test | my_devices.py | 4 | 1428 | """
pynet-rtr1 (Cisco IOS) 184.105.247.70
pynet-rtr2 (Cisco IOS) 184.105.247.71
pynet-sw1 (Arista EOS) 184.105.247.72
pynet-sw2 (Arista EOS) 184.105.247.73
pynet-sw3 (Arista EOS) 184.105.247.74
pynet-sw4 (Arista EOS) 184.105.247.75
juniper-srx 184.105.247.76
"""
from getpass import getpass
std_pwd = ... | apache-2.0 |
Epirex/android_external_chromium_org | build/config/linux/pkg-config.py | 23 | 2319 | # Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import json
import subprocess
import sys
import re
from optparse import OptionParser
# This script runs pkg-config, optionally filtering out some result... | bsd-3-clause |
libracore/erpnext | erpnext/hr/doctype/employee/test_employee.py | 8 | 2637 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
import erpnext
import unittest
import frappe.utils
from erpnext.hr.doctype.employee.employee import EmployeeLeftValidationError
test_rec... | gpl-3.0 |
mozvip/CouchPotatoServer | couchpotato/core/_base/clientscript/main.py | 3 | 6869 | from couchpotato.core.event import addEvent
from couchpotato.core.helpers.encoding import ss
from couchpotato.core.helpers.variable import tryInt
from couchpotato.core.logger import CPLog
from couchpotato.core.plugins.base import Plugin
from couchpotato.environment import Env
from minify.cssmin import cssmin
from minif... | gpl-3.0 |
tanmaythakur/django | tests/generic_views/models.py | 382 | 1631 | from django.core.urlresolvers import reverse
from django.db import models
from django.db.models import QuerySet
from django.db.models.manager import BaseManager
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Artist(models.Model):
name = models.CharField(max_length... | bsd-3-clause |
Split-Screen/android_kernel_samsung_d2 | tools/perf/scripts/python/syscall-counts-by-pid.py | 11180 | 1927 | # system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os, sys
sys.path.append(os.env... | gpl-2.0 |
ugoertz/django-familio | base/auth_backend.py | 1 | 1114 | from django.contrib.auth import get_user_model
from django.contrib.sites.models import Site
from django.core.exceptions import ObjectDoesNotExist
from userena.backends import UserenaAuthenticationBackend
class SiteBackend(UserenaAuthenticationBackend):
def authenticate(self, request, **credentials):
if '... | bsd-3-clause |
hyperized/ansible | lib/ansible/modules/network/aci/aci_tenant.py | 27 | 6322 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 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 |
HewlettPackard/python-proliant-sdk | examples/Rest/ex35_set_bios_iscsi.py | 1 | 2018 | # Copyright 2016 Hewlett Packard Enterprise Development, LP.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | apache-2.0 |
dongjoon-hyun/neon | neon/data/text.py | 3 | 12492 | # ----------------------------------------------------------------------------
# Copyright 2014 Nervana Systems 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.o... | apache-2.0 |
pinterest/mysql_utils | mysql_grants.py | 1 | 7967 | #!/usr/bin/env python
import argparse
import difflib
import pprint
import re
import MySQLdb
import sys
from lib import host_utils
from lib import mysql_lib
def main():
action_desc = """Action description:
stdout - dump grants to stdout
check - check grants on the instance and ouput errors to stdout
import - impo... | gpl-2.0 |
tacitia/ThoughtFlow | project/project/settings-deploy.py | 1 | 4952 | # !/usr/bin/python
import os
# CUSTOM PATH SETTINGS
PROJECT_DIR = os.path.dirname(os.path.dirname(__file__))
REPO_DIR = os.path.realpath(os.path.join(PROJECT_DIR, '..'))
HOME_DIR = os.path.realpath(os.path.join(REPO_DIR, '..'))
STATIC_DIR = os.path.realpath(os.path.join(HOME_DIR, 'staticfiles'))
MEDIA_DIR = os.path.r... | mit |
Anonymouslemming/ansible | lib/ansible/modules/cloud/amazon/ec2_snapshot.py | 78 | 10123 | #!/usr/bin/python
# 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 version.
#
# Ansible is distributed... | gpl-3.0 |
steedos/odoo7 | openerp/addons/base_report_designer/plugin/openerp_report_designer/bin/script/AddAttachment.py | 384 | 11148 | #########################################################################
#
# Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com
# Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>).
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser Gene... | agpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.