repo_name stringlengths 5 100 | path stringlengths 4 375 | copies stringclasses 991
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
jetskijoe/SickGear | lib/requests/packages/urllib3/connectionpool.py | 1 | 34964 | from __future__ import absolute_import
import errno
import logging
import sys
import warnings
from socket import error as SocketError, timeout as SocketTimeout
import socket
from .exceptions import (
ClosedPoolError,
ProtocolError,
EmptyPoolError,
HeaderParsingError,
HostChangedError,
Locatio... | gpl-3.0 |
szymanskirafal/ab | baza/views.py | 1 | 42658 | from django.core.urlresolvers import reverse, reverse_lazy
from django.db.models.functions import Lower
from django.http import HttpResponseRedirect
from django.shortcuts import render
from django.views import generic
from django.contrib.auth.decorators import login_required
from django.contrib.auth.mixins import Logi... | mit |
felipenaselva/felipe.repository | script.module.universalscrapers/lib/universalscrapers/modules/js2py/legecy_translators/exps.py | 96 | 3097 | """
exp_translate routine:
It takes a single line of JS code and returns a SINGLE line of Python code.
Note var is not present here because it was removed in previous stages. Also remove this useless void keyword
If case of parsing errors it must return a pos of error.
1. Convert all assignment operations to put operat... | gpl-2.0 |
Elico-Corp/odoo_OCB | addons/website_event_sale/controllers/main.py | 40 | 3571 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from openerp import SUPERUSER_ID
from openerp.addons.web import http
from openerp.addons.web.http import request
from openerp.addons.website_event.controllers.main import website_event
from openerp.addons.website_sale.co... | agpl-3.0 |
rahushen/ansible | lib/ansible/modules/cloud/openstack/os_router.py | 5 | 17920 | #!/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 |
hentaiPanda/bgm_tenkou | bs4/builder/__init__.py | 1 | 11471 | from collections import defaultdict
import itertools
import sys
from bs4.element import (
CharsetMetaAttributeValue,
ContentMetaAttributeValue,
whitespace_re
)
__all__ = [
'HTMLTreeBuilder',
'SAXTreeBuilder',
'TreeBuilder',
'TreeBuilderRegistry',
]
# Some useful fea... | mit |
WillisXChen/django-oscar | oscar/lib/python2.7/site-packages/_pytest/runner.py | 9 | 16852 | """ basic collect and runtest protocol implementations """
import bdb
import sys
from time import time
import py
import pytest
from py._code.code import TerminalRepr
def pytest_namespace():
return {
'fail' : fail,
'skip' : skip,
'importorskip' : importorskip,
'exit'... | bsd-3-clause |
mlperf/training_results_v0.5 | v0.5.0/google/cloud_v2.8/gnmt-tpuv2-8/code/gnmt/model/t2t/tensor2tensor/data_generators/text_encoder.py | 3 | 36279 | # coding=utf-8
# Copyright 2018 The Tensor2Tensor Authors.
#
# 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... | apache-2.0 |
proversity-org/edx-platform | common/test/acceptance/pages/studio/course_info.py | 25 | 4871 | """
Course Updates page.
"""
from common.test.acceptance.pages.common.utils import click_css, confirm_prompt
from common.test.acceptance.pages.studio.course_page import CoursePage
from common.test.acceptance.pages.studio.utils import set_input_value, type_in_codemirror
class CourseUpdatesPage(CoursePage):
"""
... | agpl-3.0 |
2ndQuadrant/ansible | lib/ansible/plugins/become/su.py | 54 | 4974 | # -*- coding: utf-8 -*-
# Copyright: (c) 2018, 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
DOCUMENTATION = """
become: su
short_description: Substitute User
... | gpl-3.0 |
caisq/tensorflow | tensorflow/contrib/tensorboard/plugins/projector/__init__.py | 97 | 2351 | # 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 |
AMOboxTV/AMOBox.LegoBuild | plugin.video.ManiacTV/resources/lib/resolvers/exashare.py | 23 | 1135 | # -*- 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 |
jinie/sublime-wakatime | packages/wakatime/packages/simplejson/tests/test_tool.py | 140 | 2853 | from __future__ import with_statement
import os
import sys
import textwrap
import unittest
import subprocess
import tempfile
try:
# Python 3.x
from test.support import strip_python_stderr
except ImportError:
# Python 2.6+
try:
from test.test_support import strip_python_stderr
except ImportEr... | bsd-3-clause |
orgito/ansible | test/units/modules/remote_management/lxca/test_lxca_nodes.py | 34 | 4821 | import json
import pytest
from units.compat import mock
from ansible.module_utils import basic
from ansible.module_utils._text import to_bytes
from ansible.modules.remote_management.lxca import lxca_nodes
from ansible.module_utils.remote_management.lxca.common import setup_conn
from ansible.module_utils.remote_managem... | gpl-3.0 |
fkarb/xltable | xltable/__init__.py | 2 | 3697 | """
xltable
=======
A package for writing excel worksheets with formulas and styles.
Introduction
------------
:py:mod:`xltable` is an API for writing tabular data and charts to Excel.
It is not a replacement for other Excel writing packages such as :py:mod:`xlsxwriter`,
:py:mod:`xlwt` or :py:mod:`pywin32`. Instead ... | mit |
refeed/coala-bears | bears/general/URLHeadBear.py | 1 | 5212 | import requests
from urllib.parse import urlparse
from bears.general.URLBear import URLBear, LINK_CONTEXT
from coalib.bears.LocalBear import LocalBear
from dependency_management.requirements.PipRequirement import PipRequirement
from coalib.bearlib import deprecate_settings
from coalib.results.HiddenResult import Hidd... | agpl-3.0 |
bank-netforce/netforce | netforce_account/netforce_account/models/account_statement.py | 2 | 4968 | # Copyright (c) 2012-2015 Netforce Co. Ltd.
#
# 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, modify, merge, publ... | mit |
meh/servo | tests/wpt/web-platform-tests/tools/pywebsocket/src/test/test_mux.py | 427 | 91852 | #!/usr/bin/env python
#
# Copyright 2012, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | mpl-2.0 |
hjarmstrong/Odme-plusplus | 3rd/build/tools/build/v2/test/core_nt_cmd_line.py | 45 | 8815 | #!/usr/bin/python
# Copyright 2001 Dave Abrahams
# Copyright 2011 Steven Watanabe
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
# Tests Windows command line construction.
#
# Note that the regular 'echo' is an i... | mit |
Aklaran/trickingGame | code/tricker.py | 1 | 13040 | from direct.actor.Actor import Actor
from direct.task import Task
from panda3d.core import *
from direct.interval.IntervalGlobal import Sequence, Func
from direct.interval.ActorInterval import ActorInterval
from tricks import *
import math
class Tricker(object):
def __init__(self):
## tricker-model tak... | mit |
guettli/django | tests/update/models.py | 282 | 1196 | """
Tests for the update() queryset method that allows in-place, multi-object
updates.
"""
from django.db import models
from django.utils import six
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class DataPoint(models.Model):
name = models.CharField(max_length=20)
... | bsd-3-clause |
sebrandon1/neutron | neutron/tests/functional/base.py | 5 | 2979 | # Copyright (c) 2014 OpenStack Foundation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... | apache-2.0 |
toontownfunserver/Panda3D-1.9.0 | python/Lib/site-packages/pip/_vendor/requests/packages/charade/codingstatemachine.py | 2931 | 2318 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org 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 Reserved.
#
# Con... | bsd-3-clause |
codrut3/tensorflow | tensorflow/contrib/timeseries/python/timeseries/math_utils_test.py | 67 | 14242 | # 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 |
awemulya/fieldsight-kobocat | kobocat/lib/python3.5/site-packages/pip/_vendor/requests/packages/chardet/mbcharsetprober.py | 2924 | 3268 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... | bsd-2-clause |
Pexego/odoo | addons/account_followup/__openerp__.py | 64 | 2998 | # -*- 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 |
datasift/datasift-python | datasift/historics.py | 1 | 8895 | from datasift.exceptions import HistoricSourcesRequired
class Historics(object):
""" Represents the DataSift Historics REST API and provides the ability to query it.
Internal class instantiated as part of the Client object. """
def __init__(self, request):
self.request = request.with_prefix('h... | mit |
hgl888/chromium-crosswalk-efl | printing/cups_config_helper.py | 61 | 2570 | #!/usr/bin/env python
# Copyright (c) 2011 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.
"""cups-config wrapper.
cups-config, at least on Ubuntu Lucid and Natty, dumps all
cflags/ldflags/libs when passed the --libs argu... | bsd-3-clause |
OSU-Net/cyder | vendor-local/src/django-extensions/django_extensions/management/commands/sqlcreate.py | 22 | 4129 | from optparse import make_option
import sys
import django
from django.core.management.base import CommandError, BaseCommand
from django.conf import settings
class Command(BaseCommand):
option_list = BaseCommand.option_list + (
make_option('-R', '--router', action='store',
dest='router'... | bsd-3-clause |
Jarn/jarn.mkrelease | jarn/mkrelease/tests/test_getoptions.py | 1 | 13673 | import unittest
from jarn.mkrelease.mkrelease import ReleaseMaker
from jarn.mkrelease.testing import JailSetup
from jarn.mkrelease.testing import quiet
class serverinfo:
sign = None
identity = None
register = None
def __init__(self, sign=None, identity=None, register=None):
self.sign = sign... | bsd-2-clause |
h3biomed/ansible | test/units/module_utils/urls/test_urls.py | 74 | 4040 | # -*- coding: utf-8 -*-
# (c) 2018 Matt Martz <matt@sivel.net>
# 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
from ansible.module_utils import urls
from ansible.module_utils._text import... | gpl-3.0 |
khazhyk/geoq | geoq/accounts/views.py | 4 | 1462 | # -*- coding: utf-8 -*-
# This technical data was produced for the U. S. Government under Contract No. W15P7T-13-C-F600, and
# is subject to the Rights in Technical Data-Noncommercial Items clause at DFARS 252.227-7013 (FEB 2012)
import requests
from django.contrib.auth.decorators import login_required
from django.co... | mit |
vipulroxx/sympy | sympy/physics/quantum/tensorproduct.py | 64 | 13572 | """Abstract tensor product."""
from __future__ import print_function, division
from sympy import Expr, Add, Mul, Matrix, Pow, sympify
from sympy.core.compatibility import u, range
from sympy.core.trace import Tr
from sympy.printing.pretty.stringpict import prettyForm
from sympy.physics.quantum.qexpr import QuantumEr... | bsd-3-clause |
Moriadry/tensorflow | tensorflow/python/kernel_tests/check_ops_test.py | 56 | 41530 | # 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 |
jimi-c/ansible | lib/ansible/modules/cloud/digital_ocean/digital_ocean_account_facts.py | 37 | 2100 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Ansible Project
# Copyright: (c) 2018, Abhijeet Kasurde <akasurde@redhat.com>
# 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__ = ty... | gpl-3.0 |
elky/django | tests/template_tests/templatetags/inclusion.py | 65 | 8486 | import operator
from django.template import Engine, Library
engine = Engine(app_dirs=True)
register = Library()
@register.inclusion_tag('inclusion.html')
def inclusion_no_params():
"""Expected inclusion_no_params __doc__"""
return {"result": "inclusion_no_params - Expected result"}
inclusion_no_params.any... | bsd-3-clause |
nfco/netforce | netforce_stock/netforce_stock/models/pick_validate.py | 2 | 4427 | # Copyright (c) 2012-2015 Netforce Co. Ltd.
#
# 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, modify, merge, publ... | mit |
hungtt57/matchmaker | lib/python2.7/site-packages/django/utils/termcolors.py | 260 | 7480 | """
termcolors.py
"""
from django.utils import six
color_names = ('black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white')
foreground = {color_names[x]: '3%s' % x for x in range(8)}
background = {color_names[x]: '4%s' % x for x in range(8)}
RESET = '0'
opt_dict = {'bold': '1', 'underscore': '4', 'blink... | mit |
SeedScientific/polio | datapoints/migrations/0040_auto__del_unique_region_region_code.py | 1 | 15180 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Removing unique constraint on 'Region', fields ['region_code']
db.delet... | agpl-3.0 |
budnyjj/ofagent | doc/source/conf.py | 1 | 8221 | # -*- coding: utf-8 -*-
#
# networking-ofagent documentation build configuration file, created by
# sphinx-quickstart on Mon Jan 26 13:04:07 2015.
#
# 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 ... | apache-2.0 |
daenamkim/ansible | lib/ansible/modules/system/cron.py | 16 | 24949 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2012, Dane Summers <dsummers@pinedesk.biz>
# Copyright: (c) 2013, Mike Grozak <mike.grozak@gmail.com>
# Copyright: (c) 2013, Patrick Callahan <pmc@patrickcallahan.com>
# Copyright: (c) 2015, Evan Kaufman <evan@digitalflophouse.com>
# Copyright: (c) 2015, Luca... | gpl-3.0 |
ajyoon/brown | brown/core/flowable.py | 1 | 9523 | from brown.core import brown
from brown.core.auto_new_line import AutoNewLine
from brown.core.break_opportunity import BreakOpportunity
from brown.core.invisible_object import InvisibleObject
from brown.utils.exceptions import OutOfBoundsError
from brown.utils.point import Point
from brown.utils.units import Mm, Unit
... | gpl-3.0 |
johanneskoester/staged-recipes | .CI/create_feedstocks.py | 1 | 11589 | #!/usr/bin/env python
"""
Convert all recipes into feedstocks.
This script is to be run in a TravisCI context, with all secret environment variables defined (BINSTAR_TOKEN, GH_TOKEN)
Such as:
export GH_TOKEN=$(cat ~/.conda-smithy/github.token)
"""
from __future__ import print_function
from conda_build.metadata ... | bsd-3-clause |
111pontes/ydk-py | cisco-ios-xr/ydk/models/cisco_ios_xr/Cisco_IOS_XR_vservice_cfg.py | 1 | 64632 | """ Cisco_IOS_XR_vservice_cfg
This module contains a collection of YANG definitions
for Cisco IOS\-XR vservice package configuration.
This module contains definitions
for the following management objects\:
vservice\: configure vservice node
Copyright (c) 2013\-2016 by Cisco Systems, Inc.
All rights reserved.
"""... | apache-2.0 |
chuckwondo/ThinkStats2 | code/probability.py | 69 | 4286 | """This file contains code used in "Think Stats",
by Allen B. Downey, available from greenteapress.com
Copyright 2014 Allen B. Downey
License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html
"""
from __future__ import print_function
import math
import numpy as np
import nsfg
import first
import thinkstats2
import th... | gpl-3.0 |
bdrung/audacity | lib-src/lv2/serd/waflib/Tools/c_config.py | 177 | 22817 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
import os,re,shlex,sys
from waflib import Build,Utils,Task,Options,Logs,Errors,ConfigSet,Runner
from waflib.TaskGen import after_method,feature
from waflib.Configure import co... | gpl-2.0 |
BunsenMcDubbs/beaglecar | src/gyro-tests/motorControl.py | 1 | 1764 | #!/usr/bin/env python
import rospy
from std_msgs.msg import Float32
import time
import Adafruit_BBIO.PWM as PWM
# This script receives turn rates from the "chatter" topic
# and integrates it to find the current relative angle.
# Then it converts the angle to a PWM signal to drive a
# motor controller.
# servo variab... | mit |
michaelgugino/turbo-lister | sqlalchemy/orm/instrumentation.py | 4 | 16908 | # orm/instrumentation.py
# Copyright (C) 2005-2013 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Defines SQLAlchemy's system of class instrumentation.
This module is usuall... | gpl-3.0 |
SunghanKim/numpy | numpy/lib/__init__.py | 114 | 1146 | from __future__ import division, absolute_import, print_function
import math
from .info import __doc__
from numpy.version import version as __version__
from .type_check import *
from .index_tricks import *
from .function_base import *
from .nanfunctions import *
from .shape_base import *
from .stride_tricks import *... | bsd-3-clause |
lauria/Samba4 | source4/heimdal/lib/wind/gen-map.py | 82 | 4339 | #!/usr/local/bin/python
# -*- coding: iso-8859-1 -*-
# $Id$
# Copyright (c) 2004 Kungliga Tekniska Högskolan
# (Royal Institute of Technology, Stockholm, Sweden).
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following... | gpl-3.0 |
jachym/PyWPS-SVN | pywps/Wps/Execute/UMN.py | 1 | 12415 | # Author: Jachym Cepicky
# http://les-ejk.cz
# jachym at les-ejk dot cz
# License:
#
# Web Processing Service implementation
# Copyright (C) 2006 Jachym Cepicky
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publis... | gpl-2.0 |
BigEgg/LeetCode | Python/LeetCode.Test/_051_100/Test_075_SortColors.py | 1 | 1306 | import unittest
import sys
sys.path.append('LeetCode/_051_100')
sys.path.append('LeetCode.Test')
from _075_SortColors import Solution
import AssertHelper
class Test_075_SortColors(unittest.TestCase):
def test_sortColors_1(self):
solution = Solution()
input = [2,0,2,1,1,0]
solution.sortCol... | mit |
josephsnyder/VistA | Packages/Clinical Reminders/Patches/PXRM_2.0_27/PXRM_2.0_27.py | 2 | 2878 | #---------------------------------------------------------------------------
# Copyright 2012-2019 The Open Source Electronic Health Record Alliance
#
# 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 Licen... | apache-2.0 |
MaxHalford/xam | xam/feature_selection/forward_backward.py | 1 | 3502 | import math
import operator
class ForwardBackwardSelector:
"""Forward-backward feature selector.
Parameters:
score_func (callable): Function taking two arrays X and y, and returning score. The
TokenSelector will attempt to minimize this score.
n_forward (int): Number of steps goin... | mit |
cernops/nova | nova/tests/functional/api_sample_tests/test_access_ips.py | 9 | 3652 | # Copyright 2012 Nebula, Inc.
# Copyright 2013 IBM Corp.
#
# 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... | apache-2.0 |
PlanTool/plantool | wrappingPlanners/Deterministic/LAMA/seq-sat-lama(finished)/translate/build_model.py | 6 | 11152 | #! /usr/bin/env python
# -*- coding: latin-1 -*-
#######################################################################
#
# Author: Malte Helmert (helmert@informatik.uni-freiburg.de)
# (C) Copyright 2003-2004 Malte Helmert
#
# This file is part of LAMA.
#
# LAMA is free software; you can redistribute it and/or
# modi... | gpl-2.0 |
jmcarbo/openerp7 | openerp/addons/idea/idea.py | 53 | 3165 | # -*- 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 |
GheRivero/ansible | lib/ansible/plugins/action/net_vrf.py | 756 | 1058 | # (c) 2017, Ansible 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 published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is di... | gpl-3.0 |
geektophe/shinken | shinken/stats.py | 4 | 11676 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2009-2014:
# Gabes Jean, naparuba@gmail.com
# Gerhard Lausser, Gerhard.Lausser@consol.de
# Gregory Starck, g.starck@gmail.com
# Hartmut Goebel, h.goebel@goebel-consult.de
#
# This file is part of Shinken.
#
# Shinken is free software: you ca... | agpl-3.0 |
i5o/openshot-sugar | ignacio/openshot/uploads/youtube/gdata/tlslite/utils/Python_RSAKey.py | 239 | 7707 | """Pure-Python RSA implementation."""
from cryptomath import *
import xmltools
from ASN1Parser import ASN1Parser
from RSAKey import *
class Python_RSAKey(RSAKey):
def __init__(self, n=0, e=0, d=0, p=0, q=0, dP=0, dQ=0, qInv=0):
if (n and not e) or (e and not n):
raise AssertionError()
... | gpl-3.0 |
wenderen/servo | tests/wpt/css-tests/tools/wptserve/wptserve/handlers.py | 89 | 13047 | import cgi
import json
import os
import traceback
import urllib
import urlparse
from constants import content_types
from pipes import Pipeline, template
from ranges import RangeParser
from request import Authentication
from response import MultipartContent
from utils import HTTPException
__all__ = ["file_handler", "p... | mpl-2.0 |
tfroehlich82/erpnext | erpnext/assets/doctype/asset_movement/test_asset_movement.py | 7 | 1529 | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import now
import unittest
from erpnext.assets.doctype.asset.test_asset import create_asset
class TestAssetMovement(unittest.TestCase)... | gpl-3.0 |
prune998/ansible | lib/ansible/modules/cloud/google/gcpubsub_facts.py | 70 | 4771 | #!/usr/bin/python
# Copyright 2016 Google 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 published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later vers... | gpl-3.0 |
Zhongqilong/mykbengineer | kbe/res/scripts/common/Lib/test/test_pyexpat.py | 67 | 25587 | # XXX TypeErrors on calling handlers, or on bad return values from a
# handler, are obscure and unhelpful.
from io import BytesIO
import unittest
from xml.parsers import expat
from xml.parsers.expat import errors
from test.support import sortdict, run_unittest
class SetAttributeTest(unittest.TestCase):
def set... | lgpl-3.0 |
PypestreamProducts/connect-pypestream | functions/source/integration/pypestrea-lambda.py | 1 | 1138 | import base64
import json
import os
import urllib
from urllib import request, parse
populated_url = "https://prod-webserviceext-v3r3.pype.tech/v3/broadcast"
def lambda_handler(event, context):
customerPhoneNumber = event.get('Details').get('ContactData').get('CustomerEndpoint').get('Address');
resultMap = {"... | apache-2.0 |
dhongu/l10n-romania | __unported__/l10n_ro_account_constrains/__openerp__.py | 3 | 1412 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Fekete Mihai <mihai.fekete@forbiom.eu>
# Copyright (C) 2014 FOREST AND BIOMASS SERVICES ROMANIA SA
# (http://www.forbiom.eu).
#
# This program is free software: you can redistribute it and/or... | agpl-3.0 |
guilhermetavares/createsend-python | createsend/person.py | 2 | 1955 | try:
import json
except ImportError:
import simplejson as json
from createsend import CreateSendBase, BadRequest
from utils import json_to_py
class Person(CreateSendBase):
"""Represents a person and associated functionality."""
def __init__(self, auth=None, client_id=None, email_address=None):
self.client... | mit |
maloL/nao-fsm | recognition_from_file.py | 1 | 6977 | # object tracking algorithm with trajectory points plotting on
# video stream window and gesture recognition
from naoqi import ALProxy, ALBroker, ALModule
import time
from vision_definitions import kVGA, kBGRColorSpace
import cv2 as opencv
import numpy as np
import random
from ghmm import *
import ConfigParser, argpar... | lgpl-3.0 |
secret-transaction/ScratchPadPython | experimento/libs/bs4/builder/__init__.py | 447 | 11151 | from collections import defaultdict
import itertools
import sys
from bs4.element import (
CharsetMetaAttributeValue,
ContentMetaAttributeValue,
whitespace_re
)
__all__ = [
'HTMLTreeBuilder',
'SAXTreeBuilder',
'TreeBuilder',
'TreeBuilderRegistry',
]
# Some useful features for a Tree... | mit |
cyberphox/MissionPlanner | Lib/threading.py | 44 | 33709 | """Thread module emulating a subset of Java's threading model."""
import sys as _sys
try:
import thread
except ImportError:
del _sys.modules[__name__]
raise
import warnings
from time import time as _time, sleep as _sleep
from traceback import format_exc as _format_exc
from collections impo... | gpl-3.0 |
GhostThrone/django | tests/template_tests/syntax_tests/test_spaceless.py | 521 | 1766 | from django.test import SimpleTestCase
from ..utils import setup
class SpacelessTagTests(SimpleTestCase):
@setup({'spaceless01': "{% spaceless %} <b> <i> text </i> </b> {% endspaceless %}"})
def test_spaceless01(self):
output = self.engine.render_to_string('spaceless01')
self.assertEqu... | bsd-3-clause |
shujaatak/UAV_MissionPlanner | Lib/site-packages/scipy/optimize/tests/test_zeros.py | 51 | 1272 | #!"C:\Users\hog\Documents\Visual Studio 2010\Projects\ArdupilotMega\ArdupilotMega\bin\Debug\ipy.exe"
from math import sqrt
from numpy.testing import TestCase, assert_almost_equal, assert_warns, \
assert_, run_module_suite
from scipy.optimize import zeros as cc
# Import testing parameters... | gpl-2.0 |
ninemoreminutes/lmiapi | examples/public_v1.py | 1 | 1283 | #!/usr/bin/env python
# Python
import logging
import os
# LogMeIn API
from lmiapi import LogMeInPublicAPIv1
logging.basicConfig(level=logging.DEBUG,
format='%(levelname)-8s %(name)s:%(message)s')
# Read authentication settings from environment variables.
company_id = int(os.environ.get('LMIAPI_C... | bsd-3-clause |
crosswalk-project/blink-crosswalk | Tools/Scripts/webkitpy/layout_tests/port/server_process_unittest.py | 59 | 6084 | # Copyright (C) 2011 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | bsd-3-clause |
jdubs/cloud-custodian | tests/test_utils.py | 1 | 9568 | # Copyright 2015-2017 Capital One Services, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... | apache-2.0 |
CalebSLane/openelisglobal-core | liquibase/OE3.4/testCatalogCI_LNSP/scripts/testSignificantDigits.py | 29 | 1852 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from string import Template
test_names = []
sample_types = []
low_valid = []
descriptions = []
name_file = open('testName.txt','r')
sample_type_file = open("sampleType.txt",'r')
low_valid_file = open("lowValid.txt", 'r')
results = open("../significantDigits.... | mpl-2.0 |
luca-vercelli/l10n-italy | l10n_it_rea/res_partner.py | 8 | 1640 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 Alessio Gerace <alessio.gerace@agilebg.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 pub... | agpl-3.0 |
jvoegele/picard | contrib/plugins/albumartist_website.py | 3 | 5050 | # -*- coding: utf-8 -*-
PLUGIN_NAME = _(u'Album Artist Website')
PLUGIN_AUTHOR = u'Sophist'
PLUGIN_DESCRIPTION = u'''Add's the album artist(s) Official Homepage(s)
(if they are defined in the MusicBrainz database).'''
PLUGIN_VERSION = '0.3'
PLUGIN_API_VERSIONS = ["0.15.0", "0.15.1", "0.16.0", "1.0.0", "1.1.0", "1.2.0"... | gpl-2.0 |
xpansa/sale-workflow | sale_order_add_variants/model/res_config.py | 28 | 1241 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Hugo Santos
# Copyright 2015 FactorLibre
#
# 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... | agpl-3.0 |
tsdmgz/ansible | test/units/module_utils/facts/hardware/test_linux.py | 71 | 7196 | # 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 in the hope that ... | gpl-3.0 |
midnightmagic/bitcoin | test/lint/lint-format-strings.py | 51 | 13066 | #!/usr/bin/env python3
#
# Copyright (c) 2018-2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Lint format strings: This program checks that the number of arguments passed
# to a variadic format ... | mit |
eallrich/watchword | ww/api/models.py | 1 | 4845 | from datetime import timedelta
import uuid
from django.contrib.auth.models import User
from django.db import models
from django.utils import timezone
from ww.api import flares
# When a Watch is first created, it is Fresh. Once a watchword is received,
# the Watch becomes Quiet. It remains Quiet as long as watchwords... | mit |
affo/nova | nova/objects/instance_fault.py | 2 | 4273 | # Copyright 2013 IBM Corp.
#
# 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 agree... | apache-2.0 |
cyp-opennet/ons_cyp_github | l10n_ch_lsv_dd/wizard/dd_export_wizard.py | 1 | 17991 | ##############################################################################
#
# Swiss localization Direct Debit module for OpenERP
# Copyright (C) 2014 Compassion (http://www.compassion.ch)
# @author: Cyril Sester <cyril.sester@outlook.com>
#
# This program is free software: you can redistribute it... | agpl-3.0 |
KohlsTechnology/ansible | lib/ansible/modules/cloud/ovirt/ovirt_disk.py | 12 | 27762 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016 Red Hat, 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 published by
# the Free Software Foundation, either version 3 of the License, or
#... | gpl-3.0 |
redhat-openstack/neutron | neutron/plugins/vmware/common/nsx_utils.py | 11 | 13302 | # Copyright 2013 VMware 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 ap... | apache-2.0 |
queenp/wakatime | wakatime/packages/pytz/tests/test_tzinfo.py | 11 | 28136 | # -*- coding: ascii -*-
import sys, os, os.path
import unittest, doctest
try:
import cPickle as pickle
except ImportError:
import pickle
from datetime import datetime, time, timedelta, tzinfo
import warnings
if __name__ == '__main__':
# Only munge path if invoked as a script. Testrunners should have setup... | bsd-3-clause |
ardekantur/pyglet | contrib/scene2d/scene2d/debug.py | 29 | 3106 | #!/usr/bin/env python
'''
Simple images etc. to aid debugging
===================================
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import math
from scene2d import *
from pyglet import image
from scene2d.drawable import *
from pyglet.gl import *
def brensenham_line(x, y, x2, y2):
'''... | bsd-3-clause |
CydarLtd/ansible | lib/ansible/plugins/terminal/eos.py | 12 | 2722 | #
# (c) 2016 Red Hat 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 published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is d... | gpl-3.0 |
IllusionRom/android_kernel_lge_hammerhead | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py | 12527 | 1935 | # Util.py - Python extension for perf script, miscellaneous utility code
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
import errno, os
FUTEX_WAIT = 0... | gpl-2.0 |
lmprice/ansible | lib/ansible/modules/cloud/amazon/ec2_vpc_igw_facts.py | 19 | 4756 | #!/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 |
w4-sjcho/grpc | src/python/grpcio/grpc/framework/core/_constants.py | 20 | 2941 | # Copyright 2015, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | bsd-3-clause |
ovnicraft/odoo | addons/account/wizard/account_automatic_reconcile.py | 340 | 11604 | # -*- 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 |
ruuk/script.bluray.com | lib/unidecode/x0fd.py | 252 | 3764 | data = (
'', # 0x00
'', # 0x01
'', # 0x02
'', # 0x03
'', # 0x04
'', # 0x05
'', # 0x06
'', # 0x07
'', # 0x08
'', # 0x09
'', # 0x0a
'', # 0x0b
'', # 0x0c
'', # 0x0d
'', # 0x0e
'', # 0x0f
'', # 0x10
'', # 0x11
'', # 0x12
'', # 0x13
'', # 0x14
'', # 0x15
'',... | gpl-2.0 |
proversity-org/edx-platform | lms/djangoapps/courseware/features/problems.py | 23 | 6532 | '''
Steps for problem.feature lettuce tests
'''
# pylint: disable=missing-docstring
# pylint: disable=redefined-outer-name
from lettuce import step, world
from common import i_am_registered_for_the_course, visit_scenario_item
from problems_setup import PROBLEM_DICT, add_problem_to_course, answer_problem, problem_has... | agpl-3.0 |
gaddman/ansible | lib/ansible/modules/network/nxos/nxos_vlan.py | 29 | 23488 | #!/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 distribut... | gpl-3.0 |
eduNEXT/edx-platform | openedx/core/djangoapps/user_api/accounts/tests/test_settings_views.py | 3 | 12170 | """ Tests for views related to account settings. """
from unittest import mock
from django.conf import settings
from django.contrib import messages
from django.contrib.messages.middleware import MessageMiddleware
from django.http import HttpRequest
from django.test import TestCase
from django.test.utils import overri... | agpl-3.0 |
john-kurkowski/tldextract | tests/main_test.py | 1 | 10392 | # -*- coding: utf-8 -*-
'''Main tldextract unit tests.'''
import logging
import os
import tempfile
import pytest
import responses
import tldextract
from tldextract.cache import DiskCache
from tldextract.suffix_list import SuffixListNotFound
from tldextract.tldextract import ExtractResult
extract = tldextract.TLDExt... | bsd-3-clause |
madecoste/swarming | appengine/components/components/third_party/protobuf/google/protobuf/message_factory.py | 228 | 4178 | # 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... | apache-2.0 |
frootloops/swift | utils/jobstats/jobstats.py | 7 | 10591 | #!/usr/bin/python
#
# ==-- jobstats - support for reading the contents of stats dirs --==#
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014-2017 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See https://swift.org/... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.