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 |
|---|---|---|---|---|---|
PythonNut/servo | python/mach/mach/mixin/process.py | 124 | 6762 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# This module provides mixins to perform process execution.
from __future__ import absolute_import, unicode_literals
i... | mpl-2.0 |
hwine/build-relengapi | relengapi/blueprints/slaveloan/model.py | 2 | 5153 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import
import sqlalchemy as sa
from sqlalchemy.orm import relationship
from sqlalchemy.... | mpl-2.0 |
0x90sled/catapult | third_party/gsutil/third_party/boto/tests/unit/manage/test_ssh.py | 114 | 2004 | #!/usr/bin/env python
# Copyright (c) 2013 Amazon.com, Inc. or its affiliates. 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 ... | bsd-3-clause |
gpoesia/servo | tests/wpt/web-platform-tests/tools/lint/tests/test_path_lints.py | 93 | 1350 | from __future__ import unicode_literals
from ..lint import check_path
from .base import check_errors
import pytest
import six
def test_allowed_path_length():
basename = 29 * "test/"
for idx in range(5):
filename = basename + idx * "a"
errors = check_path("/foo/", filename, False)
che... | mpl-2.0 |
zhangtuoparis13/Vintageous | ex/plat/windows.py | 9 | 1838 | import subprocess
from subprocess import PIPE
import os
import tempfile
try:
import ctypes
except ImportError:
import plat
if plat.HOST_PLATFORM == plat.WINDOWS:
raise EnvironmentError("ctypes module missing for Windows.")
ctypes = None
def get_startup_info():
# Hide the child process wi... | mit |
aurelijusb/arangodb | 3rdParty/V8-4.3.61/third_party/python_26/Lib/user.py | 313 | 1627 | """Hook to allow user-specified customization code to run.
As a policy, Python doesn't run user-specified code on startup of
Python programs (interactive sessions execute the script specified in
the PYTHONSTARTUP environment variable if it exists).
However, some programs or sites may find it convenient to allow users... | apache-2.0 |
jamesls/boto | boto/mturk/qualification.py | 20 | 6762 | # Copyright (c) 2008 Chris Moyer http://coredumped.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, modify, ... | mit |
40223249-1/-w16b_test | static/Brython3.1.1-20150328-091302/Lib/tempfile.py | 728 | 22357 | """Temporary files.
This module provides generic, low- and high-level interfaces for
creating temporary files and directories. The interfaces listed
as "safe" just below can be used without fear of race conditions.
Those listed as "unsafe" cannot, and are provided for backward
compatibility only.
This module also pr... | agpl-3.0 |
red-hood/calendarserver | twistedcaldav/directory/calendaruserproxyloader.py | 1 | 5460 | ##
# Copyright (c) 2009-2015 Apple 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 l... | apache-2.0 |
rsnakamura/oldape | apetools/lexicographers/parametertree.py | 1 | 3506 |
# python standard library
from collections import namedtuple
Parameters = namedtuple("Parameters", "name parameters".split())
class TreeNode(object):
"""
A Class to represent a node in a tree with arbitrary number of children
"""
def __init__(self, cargo, children=None):
"""
:param:... | apache-2.0 |
Bl4ckb0ne/ring-api | ring_api/server/flask/api/crypto.py | 1 | 1832 | #
# Copyright (C) 2016 Savoir-faire Linux Inc
#
# Authors: Simon Zeni <simon.zeni@savoirfairelinux.com>
#
# 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
# ... | gpl-3.0 |
POFK/utilTool | vim/after/pydiction.py | 17 | 9252 | #!/usr/bin/env python
# Last modified: July 23rd, 2009
"""
pydiction.py 1.2 by Ryan Kulla (rkulla AT gmail DOT com).
Description: Creates a Vim dictionary of Python module attributes for Vim's
completion feature. The created dictionary file is used by
the Vim ftplugin "python_pydiction.vim... | mit |
MounirMesselmeni/django-highlightjs | highlightjs/settings.py | 1 | 1267 | from django.conf import settings
HIGHLIGHTJS_DEFAULTS = {
"jquery_url": "//code.jquery.com/jquery.min.js",
"base_url": "//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.3/highlight.min.js",
"css_url": "//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.3/styles/{0}.min.css",
"include_jquery": False,
"... | mit |
shakamunyi/sahara | sahara/tests/integration/tests/gating/test_vanilla_two_gating.py | 10 | 14237 | # 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 |
bdfoster/blumate | blumate/components/sensor/steam_online.py | 1 | 2169 | """
Sensor for Steam account status.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.steam_online/
"""
from blumate.helpers.entity import Entity
from blumate.const import CONF_API_KEY
ICON = 'mdi:steam'
REQUIREMENTS = ['steamodd==4.21']
# pylin... | mit |
rsvip/Django | tests/aggregation/tests.py | 12 | 44227 | from __future__ import unicode_literals
import datetime
import re
from decimal import Decimal
from django.core.exceptions import FieldError
from django.db import connection
from django.db.models import (
F, Aggregate, Avg, Count, DecimalField, DurationField, FloatField, Func,
IntegerField, Max, Min, Sum, Valu... | bsd-3-clause |
david4096/ga4gh-server | ga4gh/server/auth/__init__.py | 1 | 11719 | """
Helps to implement authentication and authorization using Auth0.
Offers functions for generating the view functions needed to implement Auth0,
a login screen, callback maker, and a function decorator for protecting
endpoints.
"""
import flask
import requests
import functools
import json
import base64
import jwt
... | apache-2.0 |
mouton5000/DiscreteEventApplicationEditor | test/testsTriggersExpressions/testRand.py | 1 | 3182 | __author__ = 'mouton'
from unittest import TestCase
from triggerExpressions import Rand, Evaluation
from database import Variable
from test.testsTriggersExpressions import simpleTests
from arithmeticExpressions import ALitteral
class TestRand(TestCase):
@classmethod
def setUpClass(cls):
import gramm... | mit |
ESOedX/edx-platform | openedx/core/djangoapps/header_control/decorators.py | 2 | 2011 | """
Middleware decorator for removing headers.
"""
from __future__ import absolute_import
from functools import wraps
from openedx.core.djangoapps.header_control import force_header_for_response, remove_headers_from_response
def remove_headers(*headers):
"""
Decorator that removes specific headers from the... | agpl-3.0 |
libvirt/autotest | client/virt/ppm_utils.py | 1 | 7287 | """
Utility functions to deal with ppm (qemu screendump format) files.
@copyright: Red Hat 2008-2009
"""
import os, struct, time, re
from autotest_lib.client.bin import utils
# Some directory/filename utils, for consistency
def find_id_for_screendump(md5sum, dir):
"""
Search dir for a PPM file whose name en... | gpl-2.0 |
shanethehat/skype4py | Skype4Py/lang/pl.py | 23 | 7712 | apiAttachAvailable = u'API jest dost\u0119pne'
apiAttachNotAvailable = u'Niedost\u0119pny'
apiAttachPendingAuthorization = u'Autoryzacja w toku'
apiAttachRefused = u'Odmowa'
apiAttachSuccess = u'Sukces'
apiAttachUnknown = u'Nieznany'
budDeletedFriend = u'Usuni\u0119ty z listy znajomych'
budFriend = u'Znajomy'
budNeverB... | bsd-3-clause |
sdfd/linux-socfpga | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/SchedGui.py | 12980 | 5411 | # SchedGui.py - Python extension for perf script, basic GUI code for
# traces drawing and overview.
#
# Copyright (C) 2010 by Frederic Weisbecker <fweisbec@gmail.com>
#
# This software is distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
... | gpl-2.0 |
chrisdickinson/nojs | build/android/pylib/utils/decorators.py | 14 | 1080 | # Copyright 2017 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 functools
import logging
def Memoize(f):
"""Decorator to cache return values of function."""
memoize_dict = {}
@functools.wraps(f)
def wrapp... | bsd-3-clause |
MyRobotLab/pyrobotlab | home/kwatters/harry/gestures/stoprockpaperscissors.py | 1 | 1477 | def stoprockpaperscissors():
global inmoov
global human
rest()
sleep(5)
if inmoov < human:
i01.mouth.speak("congratulations you won with" + str(human - inmoov) + "points")
sleep(3)
i01.mouth.speak(str(human) + "points to you and" + str(inmoov) + "points to me")
elif inmoov > human: ... | apache-2.0 |
pelson/conda-rpms | conda_rpms/tests/unit/test_build.py | 1 | 1052 | import textwrap
import unittest
from conda_rpms.build import name_version_release
class Test_name_version_release(unittest.TestCase):
def _check_output(self, spec):
expected = {'name': 'foo', 'release':'2', 'version':'1'}
actual = name_version_release(textwrap.dedent(spec).split('\n'))
se... | bsd-3-clause |
aisworld/mailmanclient | src/mailmanclient/tests/test_domain.py | 1 | 1531 | # Copyright (C) 2015 by the Free Software Foundation, Inc.
#
# This file is part of mailman.client.
#
# mailman.client 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, version 3 of the License.
#
# mailm... | lgpl-3.0 |
zerebubuth/mapnik | plugins/input/csv/build.py | 2 | 2790 | #
# This file is part of Mapnik (c++ mapping toolkit)
#
# Copyright (C) 2015 Artem Pavlenko
#
# Mapnik 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 op... | lgpl-2.1 |
benjyw/pants | src/python/pants/bin/pants_runner.py | 4 | 4366 | # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import logging
import os
import sys
import warnings
from dataclasses import dataclass
from typing import List, Mapping
from pants.base.exception_sink import ExceptionSink
from pants.base.... | apache-2.0 |
nebulans/testfixtures | testfixtures/tests/test_comparison.py | 1 | 20153 | from unittest import TestCase
import sys
from testfixtures import Comparison as C, TempDirectory, compare, diff
from testfixtures.compat import PY2, PY3, exception_module
from testfixtures.shouldraise import ShouldAssert
from testfixtures.tests.sample1 import SampleClassA, a_function
import pytest
class AClass:
... | mit |
pupboss/xndian | deploy/site-packages/pip/cmdoptions.py | 361 | 9507 | """
shared options and groups
The principle here is to define options once, but *not* instantiate them globally.
One reason being that options with action='append' can carry state between parses.
pip parse's general options twice internally, and shouldn't pass on state.
To be consistent, all options will follow this d... | mit |
Justin-Yuan/Image2Music-Generator | library/jython2.5.3/Lib/test/test_sax.py | 9 | 21680 | # -*- coding: iso-8859-1 -*-
# regression test for SAX 2.0
# $Id: test_sax.py,v 1.13 2004/03/20 07:46:04 fdrake Exp $
import urllib
from xml.sax import handler, make_parser, ContentHandler, \
SAXException, SAXReaderNotAvailable, SAXParseException
try:
make_parser()
except SAXReaderNotAvailable:... | gpl-2.0 |
basicthinker/THNVM | configs/ruby/MI_example.py | 13 | 7567 | # Copyright (c) 2006-2007 The Regents of The University of Michigan
# Copyright (c) 2009 Advanced Micro Devices, 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 co... | bsd-3-clause |
gnumdk/eolie | eolie/toolbar.py | 1 | 2783 | # Copyright (c) 2017 Cedric Bellegarde <cedric.bellegarde@adishatz.org>
# 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 later version.
... | gpl-3.0 |
Kongsea/tensorflow | tensorflow/examples/speech_commands/freeze.py | 37 | 6965 | # 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 |
ChetnaChaudhari/hadoop | hadoop-mapreduce-project/hadoop-mapreduce-examples/src/main/java/org/apache/hadoop/examples/terasort/job_history_summary.py | 323 | 3444 | #!/usr/bin/env python
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "... | apache-2.0 |
GabrielBrascher/cloudstack | plugins/network-elements/stratosphere-ssp/sspmock/sspmock.py | 8 | 3571 | # 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 |
yoer/hue | desktop/core/ext-py/Django-1.6.10/django/contrib/gis/management/commands/ogrinspect.py | 104 | 6065 | from optparse import make_option
from django.contrib.gis import gdal
from django.core.management.base import LabelCommand, CommandError
def layer_option(option, opt, value, parser):
"""
Callback for `make_option` for the `ogrinspect` `layer_key`
keyword option which may be an integer or a string.
"""
... | apache-2.0 |
AyoubZahid/odoo | addons/website_forum/tests/test_forum.py | 27 | 12005 | # -*- coding: utf-8 -*-
from .common import KARMA, TestForumCommon
from ..models.forum import KarmaError
from openerp.exceptions import UserError, AccessError
from openerp.tools import mute_logger
class TestForum(TestForumCommon):
@mute_logger('openerp.addons.base.ir.ir_model', 'openerp.models')
def test_as... | gpl-3.0 |
sschiau/swift | utils/swift_build_support/tests/test_targets.py | 60 | 1427 | # test_targets.py - Unit tests for swift_build_support.targets -*- python -*-
#
# 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/LICENSE.txt... | apache-2.0 |
nelseric/qmk_firmware | lib/python/qmk/cli/c2json.py | 4 | 2196 | """Generate a keymap.json from a keymap.c file.
"""
import json
from milc import cli
import qmk.keymap
import qmk.path
@cli.argument('--no-cpp', arg_only=True, action='store_false', help='Do not use \'cpp\' on keymap.c')
@cli.argument('-o', '--output', arg_only=True, type=qmk.path.normpath, help='File to write to')... | gpl-2.0 |
dulems/hue | desktop/core/ext-py/Django-1.6.10/django/contrib/auth/hashers.py | 95 | 17370 | from __future__ import unicode_literals
import base64
import binascii
import hashlib
from django.dispatch import receiver
from django.conf import settings
from django.test.signals import setting_changed
from django.utils import importlib
from django.utils.datastructures import SortedDict
from django.utils.encoding im... | apache-2.0 |
facelessuser/Pywin32 | lib/x32/win32com/demos/connect.py | 10 | 3658 | # Implements _both_ a connectable client, and a connectable server.
#
# Note that we cheat just a little - the Server in this demo is not created
# via Normal COM - this means we can avoid registering the server.
# However, the server _is_ accessed as a COM object - just the creation
# is cheated on - so this is still ... | bsd-3-clause |
aselle/tensorflow | tensorflow/python/keras/wrappers/scikit_learn.py | 26 | 12799 | # Copyright 2015 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 |
fangxingli/hue | desktop/core/ext-py/boto-2.38.0/boto/beanstalk/__init__.py | 145 | 1680 | # Copyright (c) 2013 Amazon.com, Inc. or its affiliates.
# 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 |
surgebiswas/poker | PokerBots_2017/Johnny/yaml/representer.py | 64 | 17711 |
__all__ = ['BaseRepresenter', 'SafeRepresenter', 'Representer',
'RepresenterError']
from error import *
from nodes import *
import datetime
import sys, copy_reg, types
class RepresenterError(YAMLError):
pass
class BaseRepresenter(object):
yaml_representers = {}
yaml_multi_representers = {}
d... | mit |
GunoH/intellij-community | python/helpers/pydev/pydev_tests_runfiles/test_pydevd_property.py | 26 | 3422 | '''
Created on Aug 22, 2011
@author: hussain.bohra
@author: fabioz
'''
import os
import sys
import unittest
#=======================================================================================================================
# Test
#================================================================================... | apache-2.0 |
SOKP/external_chromium_org | tools/perf/metrics/timeline_unittest.py | 32 | 7170 | # Copyright 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 unittest
from metrics import test_page_test_results
from metrics import timeline
from telemetry.timeline import model as model_module
from telemetry.... | bsd-3-clause |
XiaosongWei/blink-crosswalk | Tools/Scripts/webkitpy/common/checksvnconfigfile.py | 37 | 2672 | # Copyright (C) 2012 Balazs Ankes (bank@inf.u-szeged.hu) University of Szeged
#
# 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 lis... | bsd-3-clause |
sysadminmatmoz/OCB | addons/account_budget/__openerp__.py | 27 | 2220 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Budgets Management',
'version': '1.0',
'category': 'Accounting & Finance',
'description': """
This module allows accountants to manage analytic and crossovered budgets.
========================... | agpl-3.0 |
ansible/ansible | test/lib/ansible_test/_internal/ci/__init__.py | 21 | 8224 | """Support code for CI environments."""
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import abc
import base64
import json
import os
import tempfile
from .. import types as t
from ..encoding import (
to_bytes,
to_text,
)
from ..io import (
read_text_file,
w... | gpl-3.0 |
rbarlow/pulp_puppet | pulp_puppet_plugins/test/unit/plugins/importer/downloaders/test_web.py | 4 | 5848 | import os
import mock
from nectar.report import DownloadReport
import base_downloader
from pulp_puppet.common import constants
from pulp_puppet.plugins.importers.downloaders import exceptions, web
from pulp_puppet.plugins.importers.downloaders.web import HttpDownloader
TEST_SOURCE = 'http://forge.puppetlabs.com/'
... | gpl-2.0 |
andrewtron3000/hacdc-ros-pkg | irobot_sensor_simulator/src/sensor_simulator.py | 1 | 4289 | #! /usr/bin/env python
#*********************************************************************
# Software License Agreement (BSD License)
#
# Copyright (c) 2011 andrewtron3000
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the... | bsd-2-clause |
lociii/googleads-python-lib | examples/adspygoogle/dfp/v201208/create_mobile_line_item.py | 4 | 3764 | #!/usr/bin/python
#
# Copyright 2012 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 b... | apache-2.0 |
hermes-jr/npui | netprofile_entities/netprofile_entities/__init__.py | 2 | 4304 | #!/usr/bin/env python
# -*- coding: utf-8; tab-width: 4; indent-tabs-mode: t -*-
#
# NetProfile: Entities module
# © Copyright 2013-2014 Alex 'Unik' Unigovsky
#
# This file is part of NetProfile.
# NetProfile is free software: you can redistribute it and/or
# modify it under the terms of the GNU Affero General Public
#... | agpl-3.0 |
vkomenda/linux-sunxi | arch/ia64/scripts/unwcheck.py | 13143 | 1714 | #!/usr/bin/python
#
# Usage: unwcheck.py FILE
#
# This script checks the unwind info of each function in file FILE
# and verifies that the sum of the region-lengths matches the total
# length of the function.
#
# Based on a shell/awk script originally written by Harish Patil,
# which was converted to Perl by Matthew Ch... | gpl-2.0 |
marissazhou/django | django/contrib/auth/__init__.py | 69 | 7305 | import inspect
import re
from django.apps import apps as django_apps
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured, PermissionDenied
from django.middleware.csrf import rotate_token
from django.utils.crypto import constant_time_compare
from django.utils.module_loading import i... | bsd-3-clause |
SuperTux/flexlay | flexlay/objmap_sprite_object.py | 1 | 2634 | # Flexlay - A Generic 2D Game Editor
# Copyright (C) 2014 Ingo Ruhnke <grumbel@gmail.com>
#
# 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)... | gpl-3.0 |
jiazichenzhan/Server_Manage_Plugin | ironic-plugin-pike/ironic/tests/unit/common/test_cinder.py | 4 | 36754 | # Copyright 2016 Hewlett Packard Enterprise Development Company 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... | apache-2.0 |
toshywoshy/ansible | lib/ansible/modules/network/f5/bigip_device_dns.py | 23 | 16644 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2017, F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
stuartbfox/Diamond | src/collectors/sockstat/test/testsockstat.py | 31 | 2201 | #!/usr/bin/python
# coding=utf-8
##########################################################################
from test import CollectorTestCase
from test import get_collector_config
from test import unittest
from mock import Mock
from mock import patch
from mock import call
from collections import Iterator
from diamon... | mit |
Vogtinator/micropython | tests/pyb/modtime.py | 9 | 1487 | import time
DAYS_PER_MONTH = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
def is_leap(year):
return (year % 4) == 0
def test():
seconds = 0
wday = 5 # Jan 1, 2000 was a Saturday
for year in range(2000, 2034):
print("Testing %d" % year)
yday = 1
for month in range(1, ... | mit |
barseghyanartur/magic-wormhole | src/wormhole/blocking/transit.py | 4 | 15256 | from __future__ import print_function
import re, time, threading, socket, SocketServer
from binascii import hexlify, unhexlify
from nacl.secret import SecretBox
from ..util import ipaddrs
from ..util.hkdf import HKDF
class TransitError(Exception):
pass
# The beginning of each TCP connection consists of the follow... | mit |
smurfix/gevent-socketio | examples/twitterstream/twitterstream/serve.py | 12 | 2293 | from gevent import monkey; monkey.patch_all()
import gevent
import tweetstream
import getpass
from socketio import socketio_manage
from socketio.server import SocketIOServer
from socketio.namespace import BaseNamespace
def broadcast_msg(server, ns_name, event, *args):
pkt = dict(type="event",
name... | bsd-3-clause |
mahak/cinder | cinder/volume/drivers/remotefs.py | 2 | 91230 | # Copyright (c) 2012 NetApp, Inc.
# Copyright (c) 2014 Red Hat, 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... | apache-2.0 |
galtys/odoo | addons/document/test_cindex.py | 444 | 1553 | #!/usr/bin/python
import sys
import os
import glob
import time
import logging
from optparse import OptionParser
logging.basicConfig(level=logging.DEBUG)
parser = OptionParser()
parser.add_option("-q", "--quiet",
action="store_false", dest="verbose", default=True,
help="don't prin... | agpl-3.0 |
kantai/passe-framework-prototype | django/contrib/flatpages/tests/forms.py | 155 | 1271 | from django.conf import settings
from django.contrib.flatpages.admin import FlatpageForm
from django.test import TestCase
class FlatpageAdminFormTests(TestCase):
def setUp(self):
self.form_data = {
'title': "A test page",
'content': "This is a test",
'sites': [settings.S... | bsd-3-clause |
insomnia-lab/calibre | src/calibre/ebooks/markdown/blockprocessors.py | 47 | 22371 | """
CORE MARKDOWN BLOCKPARSER
===========================================================================
This parser handles basic parsing of Markdown blocks. It doesn't concern itself
with inline elements such as **bold** or *italics*, but rather just catches
blocks, lists, quotes, etc.
The BlockParser is made up ... | gpl-3.0 |
jmesteve/openerpseda | openerp/addons/sale_stock/__init__.py | 64 | 1123 | # -*- 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 |
Cal-CS-61A-Staff/ok-client | tests/sources/ok_test/load_test.py | 3 | 1874 | from client import exceptions as ex
from client.sources import ok_test
from client.sources.ok_test import models
import mock
import unittest
class LoadTest(unittest.TestCase):
NAME = 'valid'
VALID_FILE = 'test/' + NAME + '.py'
INVALID_FILE = 'invalid.ext'
def setUp(self):
self.patcherIsFile = ... | apache-2.0 |
foobnix/foobnix | foobnix/gui/treeview/virtual_tree.py | 2 | 7402 | '''
Created on Sep 29, 2010
@author: ivan
'''
import logging
from gi.repository import Gtk
from foobnix.gui.state import LoadSave
from foobnix.util.mouse_utils import is_double_left_click, is_rigth_click,\
right_click_optimization_for_trees, is_empty_click
from foobnix.helpers.menu import Popup
from foobnix.help... | gpl-3.0 |
DukeOfHazard/crits | crits/indicators/migrate.py | 13 | 3846 | from crits.core.crits_mongoengine import EmbeddedCampaign
def migrate_indicator(self):
"""
Migrate to the latest schema version.
"""
migrate_2_to_3(self)
def migrate_2_to_3(self):
"""
Migrate from schema 2 to 3.
"""
if self.schema_version < 2:
migrate_1_to_2(self)
if sel... | mit |
CRUDNS/CRUDNS | src/accounts/views.py | 1 | 2858 | from django.shortcuts import get_object_or_404
from django_rest_logger import log
from knox.auth import TokenAuthentication
from knox.models import AuthToken
from rest_framework import status
from rest_framework.authentication import BasicAuthentication
from rest_framework.decorators import api_view
from rest_framework... | mit |
dipanjanS/text-analytics-with-python | New-Second-Edition/Ch05 - Text Classification/model_evaluation_utils.py | 2 | 9263 | # -*- coding: utf-8 -*-
"""
Created on Mon Jul 31 20:05:23 2017
@author: DIP
@Copyright: Dipanjan Sarkar
"""
from sklearn import metrics
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.preprocessing import LabelEncoder
from sklearn.base import clone
from sklearn.preprocessing impor... | apache-2.0 |
korandabit/dresherMachine | main.py | 1 | 4223 | #mainscript
from __future__ import print_function
from collections import Counter
import csv,ast,re, itertools, glob,sys,os,datetime
import dresher_LSA as d
import main_1inventoryMover as m
import main_2inventoryParser2 as k
import main_3min_analysis as a1
import main_4efficiency_analysis as a2
"""
2017.0... | mit |
BioGRID/BioGRID-Annotation | QUICK_buildOrganisms.py | 2 | 2630 |
# Create the quick lookup organism table
import Config
import sys, string
import MySQLdb
import Database
with Database.db as cursor :
# EMPTY EXISTING DATA
cursor.execute( "TRUNCATE TABLE " + Config.DB_QUICK + ".quick_organisms" )
cursor.execute( "TRUNCATE TABLE " + Config.DB_QUICK + ".quick_refseq_o... | mit |
vanpact/scipy | scipy/weave/accelerate_tools.py | 97 | 12946 | #**************************************************************************#
#* FILE ************** accelerate_tools.py ************************#
#**************************************************************************#
#* Author: Patrick Miller February 9 2002 *#
#***********... | bsd-3-clause |
smarkwell/asuswrt-merlin | release/src/router/samba-3.0.25b/source/stf/smbcontrol.py | 137 | 7998 | #!/usr/bin/python
#
# Test for smbcontrol command line argument handling.
#
import comfychair
class NoArgs(comfychair.TestCase):
"""Test no arguments produces usage message."""
def runtest(self):
out = self.runcmd("smbcontrol", expectedResult = 1)
self.assert_re_match("Usage: smbcontrol", out[... | gpl-2.0 |
yasn77/whitepy | whitepy/lexer.py | 1 | 2383 | from .lexerconstants import CHAR_MAP, HAS_ARGS, IMP_CONST, \
STACK_MANIPULATION_CONST, ARITHMETIC_CONST, HEAP_ACCESS_CONST, \
FLOW_CONTROL_CONST, IO_CONST, NUM_CONST
from .ws_token import Tokeniser
class IntError(ValueError):
'''Exception when invalid integer is found'''
class Lexer(object):
def __i... | apache-2.0 |
Denisolt/IEEE-NYIT-MA | local/lib/python2.7/site-packages/unidecode/x081.py | 252 | 4673 | data = (
'Cheng ', # 0x00
'Tiao ', # 0x01
'Zhi ', # 0x02
'Cui ', # 0x03
'Mei ', # 0x04
'Xie ', # 0x05
'Cui ', # 0x06
'Xie ', # 0x07
'Mo ', # 0x08
'Mai ', # 0x09
'Ji ', # 0x0a
'Obiyaakasu ', # 0x0b
'[?] ', # 0x0c
'Kuai ', # 0x0d
'Sa ', # 0x0e
'Zang ', # 0x0f
'Qi ', # 0x... | gpl-3.0 |
gpocentek/python-gitlab | gitlab/client.py | 1 | 35035 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2013-2017 Gauvain Pocentek <gauvain@pocentek.net>
#
# This program 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 3 of the License, or
# (at you... | lgpl-3.0 |
UniversalMasterEgg8679/ansible | lib/ansible/module_utils/docker_common.py | 21 | 18341 | #
# 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 later version.
#
# ... | gpl-3.0 |
tjanez/ansible | lib/ansible/modules/cloud/softlayer/sl_vm.py | 14 | 11641 | #!/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 |
MycChiu/tensorflow | tensorflow/python/framework/file_system_test.py | 36 | 1896 | # Copyright 2015 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 |
freedomtan/tensorflow | tensorflow/python/keras/engine/deferred_sequential_test.py | 4 | 8673 | # Copyright 2020 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 |
kxepal/simpleubjson | simpleubjson/tools/inspect.py | 4 | 4487 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2011-2014 Alexander Shorin
# All rights reserved.
#
# This software is licensed as described in the file LICENSE, which
# you should have received as part of this distribution.
#
import sys
import simpleubjson
from ..draft8 import Draft8Decoder
from ..draft9 import Draft9Decod... | bsd-2-clause |
josecanciani/pyparser | lang/php/grammar/pclass.py | 1 | 2429 |
from pyparser.grammar.pclass import Class as BaseClass, Extractor as BaseExtractor
from pyparser.grammar.exception import InvalidSyntax
from pyparser.lang.php.grammar.method import Extractor as MethodExtractor
from pyparser.lang.php.grammar.classprop import Extractor as PropExtractor
keywords = ['abstract', 'class']
... | gpl-3.0 |
jinzo27/infoGrabr | lib/cpp/scons/scons-local-2.0.0.final.0/SCons/Conftest.py | 118 | 27708 | """SCons.Conftest
Autoconf-like configuration support; low level implementation of tests.
"""
#
# Copyright (c) 2003 Stichting NLnet Labs
# Copyright (c) 2001, 2002, 2003 Steven Knight
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation file... | mit |
ujjvala-addsol/addsol_hr | openerp/addons/purchase/company.py | 383 | 1576 | # -*- 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 |
bhilburn/gnuradio | gr-digital/python/digital/qa_clock_recovery_mm.py | 45 | 5378 | #!/usr/bin/env python
#
# Copyright 2011-2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your optio... | gpl-3.0 |
Fokko/incubator-airflow | airflow/example_dags/example_branch_python_dop_operator_3.py | 1 | 2116 | # -*- coding: utf-8 -*-
#
# 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
#... | apache-2.0 |
iivic/BoiseStateX | common/lib/capa/capa/safe_exec/lazymod.py | 193 | 1200 | """A module proxy for delayed importing of modules.
From http://barnesc.blogspot.com/2006/06/automatic-python-imports-with-autoimp.html,
in the public domain.
"""
import sys
class LazyModule(object):
"""A lazy module proxy."""
def __init__(self, modname):
self.__dict__['__name__'] = modname
... | agpl-3.0 |
AndrewLvov/django-registration | registration/forms.py | 38 | 4537 | """
Forms and validation code for user registration.
Note that all of these forms assume Django's bundle default ``User``
model; since it's not possible for a form to anticipate in advance the
needs of custom user models, you will need to write your own forms if
you're using a custom model.
"""
from django.contrib.... | bsd-3-clause |
ValentineBlacker/TopDownMap | src/sprite.py | 2 | 9275 | '''
Created on Apr 7, 2012
@author: Demicow
'''
import pygame
#Tie circle collion to self. leftside etc
class customSprite(pygame.sprite.DirtySprite):
def __init__(self, scene, image, location):
#init the sprite!
pygame.sprite.DirtySprite.__init__(self)
#info about t... | gpl-2.0 |
divio/djangocms-accordion | djangocms_accordion/cms_plugins.py | 1 | 1171 | # -*- coding: utf-8 -*-
from django.utils.translation import ugettext_lazy as _
from cms.plugin_pool import plugin_pool
from cms.plugin_base import CMSPluginBase
from djangocms_accordion.models import Accordion, AccordionEntry
class AccordionPlugin(CMSPluginBase):
model = Accordion
name = _('Accordion')
... | bsd-3-clause |
Johnzero/OE7 | openerp/addons-modules/account/project/report/account_journal.py | 61 | 2142 | # -*- 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... | agpl-3.0 |
hwroitzsch/BikersLifeSaver | lib/python3.5/site-packages/numpy/lib/tests/test_type_check.py | 103 | 10247 | from __future__ import division, absolute_import, print_function
import numpy as np
from numpy.compat import long
from numpy.testing import (
TestCase, assert_, assert_equal, assert_array_equal, run_module_suite
)
from numpy.lib.type_check import (
common_type, mintypecode, isreal, iscomplex, isposinf, isn... | mit |
dezelin/snaily-lib | 3rd_party/gtest-1.6.0/test/gtest_xml_output_unittest.py | 397 | 11279 | #!/usr/bin/env python
#
# Copyright 2006, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | gpl-3.0 |
criteo/biggraphite | biggraphite/cli/command_stats.py | 1 | 13270 | #!/usr/bin/env python
# Copyright 2016 Criteo
#
# 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 |
kaplun/invenio | modules/bibencode/lib/bibencode_utils.py | 24 | 12430 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2011, 2013 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 |
mgrman/BitportViewer | BitportViewer_Kodi/BitportAPI.py | 1 | 4087 | import sys
import json
import requests
import re
class BitportAPI:
access_token = ""
apiBaseUrl = "https://api.bitport.io/v2"
isTvShowRegex = re.compile("[Ss]\d{1,2}[Ee]\d{1,2}")
getNameRegex = re.compile("(^[a-zA-Z. _\-0-9()'\"]*?)\(?2\d\d\d|(^[a-zA-Z. _\-0-9()'\"]*)([Ss]\d{1,2}[Ee]\d{1,2})")
... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.