repo_name stringlengths 5 104 | path stringlengths 4 248 | content stringlengths 102 99.9k |
|---|---|---|
rhololkeolke/eecs_600_robot_project1 | src/octomap_server/scripts/octomap_eraser_cli.py | #!/usr/bin/env python
"""Clear a region specified by a global axis-aligned bounding box in stored
OctoMap.
"""
import sys
from time import sleep
import roslib
roslib.load_manifest('octomap_server')
from geometry_msgs.msg import Point
import octomap_msgs.srv
import rospy
SRV_NAME = '/octomap_server/clear_bbx'
SRV_... |
Dexhub/MTX | src/python/m5/simulate.py | # Copyright (c) 2012 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of the functionality ... |
frankyao47/open-hackathon | open-hackathon-server/src/hackathon/hazure/cloud_service_adapter.py | # -*- coding: utf-8 -*-
"""
Copyright (c) Microsoft Open Technologies (Shanghai) Co. Ltd. All rights reserved.
The MIT License (MIT)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restr... |
sadanandb/pmt | src/tactic/ui/panel/schema_section_wdg.py | ###########################################################
#
# 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... |
PennartLoettring/Poettrix | rootfs/usr/lib/python3.4/idlelib/configDialog.py | """IDLE Configuration Dialog: support user customization of IDLE by GUI
Customize font faces, sizes, and colorization attributes. Set indentation
defaults. Customize keybindings. Colorization and keybindings can be
saved as user defined sets. Select startup options including shell/editor
and default window size. ... |
nacc/autotest | frontend/afe/rpc_client_lib.py | """
This module provides utility functions useful when writing clients for the RPC
server.
"""
__author__ = 'showard@google.com (Steve Howard)'
import getpass, os
from json_rpc import proxy
from autotest.client.shared import utils
class AuthError(Exception):
pass
def get_proxy(*args, **kwargs):
"""Use thi... |
akshay-bhardwaj/python-webdriver | test/selenium/webdriver/common/driver_element_finding_tests.py | #!/usr/bin/python
# Copyright 2008-2010 WebDriver committers
# Copyright 2008-2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License")
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2... |
Architektor/PySnip | venv/lib/python2.7/site-packages/pygeoip/const.py | # -*- coding: utf-8 -*-
"""
Copyright (c) 2010-2014 Jennifer Ennis, William Tisäter.
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 your option) any la... |
ritchyteam/odoo | openerp/tools/convert.py | # -*- 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... |
LLNL/spack | var/spack/repos/builtin/packages/abduco/package.py | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Abduco(MakefilePackage):
"""abduco provides session management i.e. it allows programs to ... |
stack-of-tasks/rbdlpy | tutorial/lib/python2.7/site-packages/OpenGL/raw/WGL/ARB/pixel_format.py | '''Autogenerated by xml_generate script, do not edit!'''
from OpenGL import platform as _p, arrays
# Code generation uses this
from OpenGL.raw.WGL import _types as _cs
# End users want this...
from OpenGL.raw.WGL._types import *
from OpenGL.raw.WGL import _errors
from OpenGL.constant import Constant as _C
import ctype... |
Rudloff/youtube-dl | youtube_dl/extractor/fox.py | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
smuggle_url,
update_url_query,
)
class FOXIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?fox\.com/watch/(?P<id>[0-9]+)'
_TEST = {
'url': 'http://www.fox.com/watch/255180355939... |
cernops/ceilometer | ceilometer/hardware/inspector/snmp.py | #
# Copyright 2014 ZHAW SoE
# Copyright 2014 Intel Corp
#
# Authors: Lucas Graf <graflu0@students.zhaw.ch>
# Toni Zehnder <zehndton@students.zhaw.ch>
# Lianhao Lu <lianhao.lu@intel.com>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance... |
mattt416/neutron | neutron/tests/unit/db/test_migration.py | # Copyright 2012 New Dream Network, LLC (DreamHost)
# 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
#
# ... |
tensorflow/tensorflow | tensorflow/python/ops/special_math_ops_test.py | # 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... |
bbc/kamaelia | Sketches/THF/Packages/Kamaelia/Community/THF/Kamaelia/UI/OpenGL/Movement.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Contributors are listed in the AUTHORS file and at
# http://www.kamaelia.org/AUTHORS - please extend this file,
# not this notice.
#
# Licensed under the Apache License... |
pexip/os-python-pyasn1-modules | tools/snmpget.py | #!/usr/bin/env python
#
# This file is part of pyasn1-modules software.
#
# Copyright (c) 2005-2017, Ilya Etingof <etingof@gmail.com>
# License: http://pyasn1.sf.net/license.html
#
# Generate SNMPGET request, parse response
#
import socket
import sys
from pyasn1.codec.ber import decoder
from pyasn1.codec.ber import en... |
zenefits/sentry | src/sentry/api/serializers/models/broadcast.py | from __future__ import absolute_import
import six
from sentry.api.serializers import Serializer, register
from sentry.models import Broadcast, BroadcastSeen
@register(Broadcast)
class BroadcastSerializer(Serializer):
def get_attrs(self, item_list, user):
if not user.is_authenticated():
seen ... |
xmbcrios/riostv | script.artistslideshow/resources/common/xlogger.py | #v.0.1.4
try:
import xbmc
LOGTYPE = 'xbmc'
except:
import logging, logging.handlers
LOGTYPE = 'file'
#this class creates an object used to log stuff to the xbmc log file
class Logger():
def __init__(self, preamble='', logfile='logfile.log', logdebug='true'):
self.LOGPREAMBLE = preamble
... |
diagramsoftware/l10n-spain | account_balance_reporting/wizard/wizard_print.py | # -*- coding: utf-8 -*-
# Copyright 2009 Pexego Sistemas Informáticos.
# Copyright 2016 Vicent Cubells <vicent.cubells@tecnativa.com>
# Copyright 2016 Pedro M. Baeza <pedro.baeza@tecnativa.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from openerp import api, fields, models
class PrintWizard(m... |
CingHu/neutron-ustack | neutron/services/loadbalancer/agent/agent.py | # Copyright 2013 New Dream Network, LLC (DreamHost)
#
# 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 a... |
hodgesds/streamparse | test/streamparse/cli/test_remove_logs.py | from __future__ import absolute_import, unicode_literals
import argparse
import unittest
from streamparse.cli.remove_logs import subparser_hook
from nose.tools import ok_
class RemoveLogsTestCase(unittest.TestCase):
def test_subparser_hook(self):
parser = argparse.ArgumentParser()
subparsers =... |
axbaretto/beam | sdks/python/.tox/py27gcp/lib/python2.7/site-packages/dill/temp.py | #!/usr/bin/env python
#
# Author: Mike McKerns (mmckerns @caltech and @uqfoundation)
# Copyright (c) 2008-2016 California Institute of Technology.
# Copyright (c) 2016-2017 The Uncertainty Quantification Foundation.
# License: 3-clause BSD. The full license text is available at:
# - http://trac.mystic.cacr.caltech.ed... |
psychopenguin/st2contrib | packs/reamaze/actions/article_update.py | from lib.actions import BaseAction
class ArticleUpdate(BaseAction):
def run(self, slug, title, body):
slug = self._convert_slug(slug)
path = '/articles/%s' % slug
payload = self._create_payload(title=title, body=body)
response = self._api_put(path, json=payload)
return resp... |
sileht/deb-openstack-nova | nova/tests/api/openstack/compute/test_limits.py | # Copyright 2011 OpenStack LLC.
# 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... |
grace-/opencv-3.0.0-cvpr | opencv/samples/python2/mser.py | #!/usr/bin/env python
'''
MSER detector demo
==================
Usage:
------
mser.py [<video source>]
Keys:
-----
ESC - exit
'''
import numpy as np
import cv2
import video
if __name__ == '__main__':
import sys
try: video_src = sys.argv[1]
except: video_src = 0
cam = video.create_captur... |
hujiajie/chromium-crosswalk | build/android/test_runner.py | #!/usr/bin/env python
#
# 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.
"""Runs all types of tests from one unified interface."""
import argparse
import collections
import itertools
import logging
import ... |
beqa2323/learntosolveit | languages/python/networking_allifaces.py | #:w/usr/bin/python
# $Id$
"""
List Network Interfaces
**Purpose**: This program provides list of network interfaces available on
your machine.
**Description**: man netdevice provides the following information about
SIOCGIFCONF which is used to retrieve the interfaces information.
SIOCGIFCONF
Return a list of inter... |
mouadino/Shapely | shapely/geometry/linestring.py | """Line strings and related utilities
"""
import sys
if sys.version_info[0] < 3:
range = xrange
from ctypes import c_double, cast, POINTER
from shapely.coords import required
from shapely.geos import lgeos, TopologicalError
from shapely.geometry.base import (
BaseGeometry, geom_factory, JOIN_STYLE, geos_geo... |
dbbhattacharya/kitsune | vendor/packages/translate-toolkit/translate/storage/symbian.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2008 Zuza Software Foundation
#
# This file is part of translate.
#
# translate 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... |
alsoicode/django-filer | filer/tests/helpers.py | #-*- coding: utf-8 -*-
from PIL import Image, ImageChops, ImageDraw
try:
from django.contrib.auth import get_user_model
User = get_user_model()
except ImportError:
from django.contrib.auth.models import User # NOQA
from filer.models.foldermodels import Folder
from filer.models.clipboardmodels import Clipb... |
nucular/AutobahnPython | examples/twisted/websocket/pingpong_keepalive/server.py | ###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) Tavendo GmbH
#
# 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 with... |
kkragenbrink/los-angeles | server/conf/at_search.py | """
Search and multimatch handling
This module allows for overloading two functions used by Evennia's
search functionality:
at_search_result:
This is called whenever a result is returned from an object
search (a common operation in commands). It should (together
with at_multimatch_input b... |
alikins/func-alikins-devel | func/overlord/modules/netapp.py | ##
## Overlord library to interface with minion-side netapp operations
##
## Most of this is just wrappers to create some cleaner, earier to use
## interfaces. Also allows users to get function signatures and use
## nice things like kwargs client side, for those of us who can't live
## without ipython introspection.
#... |
noroutine/ansible | test/units/modules/network/iosxr/test_iosxr_system.py | # (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 dis... |
huangciyin/youtube-dl | youtube_dl/extractor/rutv.py | # encoding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
ExtractorError,
int_or_none
)
class RUTVIE(InfoExtractor):
IE_DESC = 'RUTV.RU'
_VALID_URL = r'''(?x)
https?://player\.(?:rutv\.ru|vgtrk\.com)/
(?P<path>flas... |
rawlingsj/gofabric8 | vendor/k8s.io/minikube/hack/get_k8s_version.py | #!/usr/bin/env python
# Copyright 2016 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... |
wearpants/osf.io | website/addons/dataverse/views.py | """Views for the node settings page."""
# -*- coding: utf-8 -*-
import datetime
import httplib as http
from requests.exceptions import SSLError
from flask import request
from modularodm import Q
from modularodm.storage.base import KeyExistsException
from framework.auth.decorators import must_be_logged_in
from framewo... |
ric2b/Vivaldi-browser | chromium/chrome/test/enterprise/e2e/policy/webprotect_file_download/webprotect_file_download_webdriver.py | # Copyright 2020 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 os
import re
import time
from absl import app, flags
from selenium import webdriver
from pywinauto.application import Application
from pywinauto.find... |
newvem/pytz | pytz/zoneinfo/Asia/Macau.py | '''tzinfo timezone information for Asia/Macau.'''
from pytz.tzinfo import DstTzInfo
from pytz.tzinfo import memorized_datetime as d
from pytz.tzinfo import memorized_ttinfo as i
class Macau(DstTzInfo):
'''Asia/Macau timezone definition. See datetime.tzinfo for details'''
zone = 'Asia/Macau'
_utc_transiti... |
saeki-masaki/glance | glance/tests/unit/v2/test_image_actions_resource.py | # Copyright 2015 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 req... |
dhalperi/beam | sdks/python/apache_beam/transforms/timeutil.py | #
# 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 us... |
ULHPC/modules | easybuild/easybuild-easyblocks/easybuild/easyblocks/s/slepc.py | ##
# Copyright 2009-2015 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en),
# the Hercules foundation (htt... |
PennartLoettring/Poettrix | rootfs/usr/lib/python3.4/test/test_robotparser.py | import io
import unittest
import urllib.robotparser
from urllib.error import URLError, HTTPError
from urllib.request import urlopen
from test import support
class RobotTestCase(unittest.TestCase):
def __init__(self, index=None, parser=None, url=None, good=None, agent=None):
# workaround to make unittest di... |
dgsantana/arsenalsuite | python/scripts/unassign_tasks.py | #!/usr/bin/python
from PyQt4.QtCore import *
from PyQt4.QtSql import *
from blur.Stone import *
from blur.Classes import *
import blur
import sys
import time
from blur.defaultdict import *
from math import ceil
if sys.argv.count('-daemonize'):
from blur.daemonize import createDaemon
createDaemon()
# First Create a ... |
avedaee/DIRAC | Core/scripts/dirac-stop-component.py | #!/usr/bin/env python
# $HeadURL: svn+ssh://svn.cern.ch/reps/dirac/DIRAC/trunk/DIRAC/Core/scripts/dirac-install.py $
"""
Do the initial installation and configuration of the DIRAC MySQL server
"""
__RCSID__ = "$Id: dirac-install.py 26844 2010-07-16 08:44:22Z rgracian $"
#
from DIRAC.Core.Base import Script
Script.disab... |
klahnakoski/SpotManager | vendor/mo_math/vendor/aespython/cipher_mode.py | #!/usr/bin/env python
"""
Cipher Mode of operation
Running this file as __main__ will result in a self-test of the algorithm.
Algorithm per NIST SP 800-38A http://csrc.nist.gov/publications/nistpubs/800-38a/sp800-38a.pdf
Copyright (c) 2010, Adam Newman http://www.caller9.com/
Licensed under the MIT license http://ww... |
ywcui1990/nupic | examples/prediction/experiments/generated_data/description.py | from nupic.encoders import (LogEncoder, DateEncoder, MultiEncoder, ScalarEncoder)
from nupic.data import FunctionSource
from nupic.frameworks.prediction.callbacks import displaySPCoincidences, printSPCoincidences
from nupic.data.dict_utils import DictObj
nCoincidences = 30
iterationCount = 10000
nRandomFields = 1
r... |
Achint08/open-event-orga-server | migrations/versions/202b15987640_.py | """empty message
Revision ID: 202b15987640
Revises: 30ca70296a1c
Create Date: 2016-03-27 14:36:59.712765
"""
# revision identifiers, used by Alembic.
revision = '202b15987640'
down_revision = '30ca70296a1c'
from alembic import op
import sqlalchemy as sa
import sqlalchemy_utils
def upgrade():
### commands auto... |
gnu-sandhi/sandhi | modules/gr36/gr-blocks/python/qa_boolean_operators.py | #!/usr/bin/env python
#
# Copyright 2004,2007,2008,2010 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 ... |
stormbeard/pyvmomi-community-samples | samples/create_snapshot.py | # Copyright 2015 Michael Rice <michael@michaelrice.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... |
umitproject/tease-o-matic | mediagenerator/management/commands/importsassframeworks.py | from ...filters import sass
from ...utils import get_media_dirs
from django.conf import settings
from django.core.management.base import NoArgsCommand
from subprocess import Popen, PIPE
import os
import shutil
import sys
import __main__
_frameworks_dir = 'imported-sass-frameworks'
if hasattr(__main__, '__file__'):
... |
archifix/settings | sublime/Packages/Jedi - Python autocompletion/dependencies/jedi/evaluate/usages.py | from jedi.evaluate import imports
from jedi.evaluate.filters import TreeNameDefinition
from jedi.evaluate.context import ModuleContext
def _resolve_names(definition_names, avoid_names=()):
for name in definition_names:
if name in avoid_names:
# Avoiding recursions here, because goto on a modul... |
js0701/chromium-crosswalk | tools/auto_bisect/bisect_utils.py | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Utility functions used by the bisect tool.
This includes functions related to checking out the depot and outputting
annotations for the Buildbot waterfal... |
TangXT/GreatCatMOOC | lms/djangoapps/instructor/tests/test_enrollment.py | """
Unit tests for instructor.enrollment methods.
"""
import json
from abc import ABCMeta
from courseware.models import StudentModule
from django.test import TestCase
from student.tests.factories import UserFactory
from student.models import CourseEnrollment, CourseEnrollmentAllowed
from instructor.enrollment import ... |
gdementen/PyTables | bench/plot-bar.py | #!/usr/bin/env python
# a stacked bar plot with errorbars
from __future__ import print_function
from pylab import *
checks = ['open_close', 'only_open',
'full_browse', 'partial_browse',
'full_browse_attrs', 'partial_browse_attrs',
'open_group', 'open_leaf',
'total']
width = 0.1... |
wangscript/libjingle-1 | trunk/third_party/jsoncpp/source/amalgamate.py | """Amalgate json-cpp library sources into a single source and header file.
Requires Python 2.6
Example of invocation (must be invoked from json-cpp top directory):
python amalgate.py
"""
import os
import os.path
import sys
class AmalgamationFile:
def __init__( self, top_dir ):
self.top_dir = top_dir
... |
Cheaterman/kivy | kivy/uix/label.py | '''Label
=====
.. image:: images/label.png
:align: right
The :class:`Label` widget is for rendering text. It supports ascii and unicode
strings::
# hello world text
l = Label(text='Hello world')
# unicode text; can only display glyphs that are available in the font
l = Label(text=u'Hello world '... |
louyihua/edx-platform | openedx/core/djangoapps/user_api/management/tests/test_email_opt_in_list.py | # -*- coding: utf-8 -*-
"""Tests for the email opt-in list management command. """
import os.path
import tempfile
import shutil
import csv
from collections import defaultdict
from nose.plugins.attrib import attr
from unittest import skipUnless
import ddt
from django.conf import settings
from django.contrib.auth.models... |
google/aistreams | third_party/pybind11/tests/test_iostream.py | from pybind11_tests import iostream as m
import sys
from contextlib import contextmanager
try:
# Python 3
from io import StringIO
except ImportError:
# Python 2
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
try:
# Python 3.4
from con... |
ekasitk/sahara | sahara/service/edp/oozie/workflow_creator/pig_workflow.py | # Copyright (c) 2013 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... |
vad/django-cms | cms/toolbar_pool.py | # -*- coding: utf-8 -*-
from cms.exceptions import ToolbarAlreadyRegistered, ToolbarNotRegistered
from cms.utils.conf import get_cms_setting
from cms.utils.django_load import load, iterload_objects
from django.core.exceptions import ImproperlyConfigured
from django.utils.datastructures import SortedDict
class Toolbar... |
martbhell/wasthereannhlgamelastnight | src/lib/pyasn1_modules/rfc2315.py | #
# This file is part of pyasn1-modules software.
#
# Copyright (c) 2005-2019, Ilya Etingof <etingof@gmail.com>
# License: http://snmplabs.com/pyasn1/license.html
#
# PKCS#7 message syntax
#
# ASN.1 source from:
# https://opensource.apple.com/source/Security/Security-55179.1/libsecurity_asn1/asn1/pkcs7.asn.auto.html
#
... |
CenturylinkTechnology/ansible-modules-extras | cloud/amazon/ecs_service.py | #!/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... |
aaronsw/watchdog | vendor/pyExcelerator-0.6.3a/pyExcelerator/ExcelFormulaParser.py | ### $ANTLR 2.7.5 (20050128): "excel-formula.g" -> "ExcelFormulaParser.py"$
### import antlr and other modules ..
import sys
import antlr
version = sys.version.split()[0]
if version < '2.2.1':
False = 0
if version < '2.3':
True = not False
### header action >>>
__rev_id__ = """$Id: ExcelFormulaParser.py,v 1.4 ... |
zachjanicki/osf.io | website/addons/dropbox/tests/test_views.py | # -*- coding: utf-8 -*-
"""Views tests for the Dropbox addon."""
import httplib as http
import unittest
from nose.tools import * # noqa (PEP8 asserts)
import mock
from framework.auth import Auth
from dropbox.rest import ErrorResponse
from urllib3.exceptions import MaxRetryError
from tests.factories import AuthUser... |
WarrenWeckesser/scipy | doc/source/tutorial/stats/plots/qmc_plot_conv_mc_sobol.py | """Integration convergence comparison: MC vs Sobol'.
The function is a synthetic example specifically designed
to verify the correctness of the implementation [2]_.
References
----------
.. [1] I. M. Sobol. The distribution of points in a cube and the accurate
evaluation of integrals. Zh. Vychisl. Mat. i Mat. Phy... |
wxgeo/geophar | wxgeometrie/sympy/simplify/tests/test_sqrtdenest.py | from sympy import sqrt, root, S, Symbol, sqrtdenest, Integral, cos
from sympy.simplify.sqrtdenest import _subsets as subsets
r2, r3, r5, r6, r7, r10, r15, r29 = [sqrt(x) for x in [2, 3, 5, 6, 7, 10,
15, 29]]
def test_sqrtdenest():
d = {sqrt(5 + 2 * r6): r2 + r3,
... |
anthgur/servo | tests/wpt/web-platform-tests/mixed-content/generic/tools/common_paths.py | from __future__ import print_function
import os, sys, json, re
script_directory = os.path.dirname(os.path.abspath(__file__))
generic_directory = os.path.abspath(os.path.join(script_directory, '..'))
template_directory = os.path.abspath(os.path.join(script_directory,
... |
naparuba/shinken | shinken/objects/hostdependency.py | #!/usr/bin/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 can redis... |
icing/nghttp2 | python/calcratio.py | #!/usr/bin/env python
#
# This script takes directories which contain the hpack-test-case json
# files, and calculates the compression ratio in each file and outputs
# the result in table formatted in rst.
#
# The each directory contains the result of various HPACK compressor.
#
# The table is laid out so that we can s... |
andrius-preimantas/purchase-workflow | purchase_group_hooks/purchase_group_hooks.py | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Leonardo Pistone
# Copyright 2014 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# pu... |
mkaluza/external_chromium_org | tools/telemetry/telemetry/core/timeline/inspector_importer.py | # 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.
'''Imports event data obtained from the inspector's timeline.'''
from telemetry.core.timeline import importer
import telemetry.core.timeline.thread as ti... |
drufat/sympy | sympy/sets/conditionset.py | from __future__ import print_function, division
from sympy import S
from sympy.core.basic import Basic
from sympy.core.function import Lambda
from sympy.core.logic import fuzzy_bool
from sympy.logic.boolalg import And
from sympy.sets.sets import (Set, Interval, Intersection, EmptySet, Union,
... |
loic/django | tests/utils_tests/test_safestring.py | from __future__ import unicode_literals
from django.template import Context, Template
from django.test import SimpleTestCase, ignore_warnings
from django.utils import html, six, text
from django.utils.deprecation import RemovedInDjango20Warning
from django.utils.encoding import force_bytes
from django.utils.functional... |
waseem18/oh-mainline | vendor/packages/kombu/kombu/transport/django/models.py | from __future__ import absolute_import
from django.db import models
from django.utils.translation import ugettext_lazy as _
from .managers import QueueManager, MessageManager
class Queue(models.Model):
name = models.CharField(_('name'), max_length=200, unique=True)
objects = QueueManager()
class Meta:... |
shekkbuilder/pyNES | pynes/tests/cpy_test.py | # -*- coding: utf-8 -*-
'''
CPY, Compare with Y Test
'''
import unittest
from pynes.compiler import lexical, syntax, semantic
class CpyTest(unittest.TestCase):
def test_cpy_imm(self):
tokens = list(lexical('CPY #$10'))
self.assertEquals(2, len(tokens))
self.assertEquals('T_INSTRUCTION'... |
ted-gould/nova | nova/objects/dns_domain.py | # Copyright (C) 2014, Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... |
detrout/debian-statsmodels | examples/python/tsa_arma_1.py |
## Autoregressive Moving Average (ARMA): Artificial data
from __future__ import print_function
import numpy as np
import statsmodels.api as sm
from statsmodels.tsa.arima_process import arma_generate_sample
np.random.seed(12345)
# Generate some data from an ARMA process:
arparams = np.array([.75, -.25])
maparams = ... |
nikesh-mahalka/nova | nova/tests/unit/virt/vmwareapi/test_ds_util.py | # Copyright (c) 2014 VMware, 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 a... |
danlrobertson/servo | tests/wpt/web-platform-tests/tools/third_party/hyper/hyper/tls.py | # -*- coding: utf-8 -*-
"""
hyper/tls
~~~~~~~~~
Contains the TLS/SSL logic for use in hyper.
"""
import os.path as path
from .common.exceptions import MissingCertFile
from .compat import ignore_missing, ssl
NPN_PROTOCOL = 'h2'
H2_NPN_PROTOCOLS = [NPN_PROTOCOL, 'h2-16', 'h2-15', 'h2-14']
SUPPORTED_NPN_PROTOCOLS = H2_... |
Bluehorn/cx_Oracle | test/test_dbapi20.py | """Driver specific portion of the DB API test suite provided by Stuart Bishop
available at http://stuartbishop.net/Software/DBAPI20TestSuite/"""
import cx_Oracle
import dbapi20
import unittest
import TestEnv
class TestSuite(dbapi20.DatabaseAPI20Test):
connect_args = (TestEnv.USERNAME, TestEnv.PASSWORD, TestE... |
renzongxian/Show-Me-the-Code | Matafight/0012/ResenWord.py | # -*-coding:utf-8-*-
import string
class senseWord():
def __init__(self):
self.list=[]
self.word=[]
inputfile=file('filtered_word.txt','r')
for lines in inputfile.readlines():
self.list.append(lines.decode('utf-8').encode('gbk'))#I've set the file coding type as utf-8
... |
alxgu/ansible | lib/ansible/modules/network/nso/nso_action.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2017 Cisco and/or its affiliates.
#
# 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... |
projecthamster/hamster | waflib/Tools/c_preproc.py | #!/usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2006-2018 (ita)
"""
C/C++ preprocessor for finding dependencies
Reasons for using the Waf preprocessor by default
#. Some c/c++ extensions (Qt) require a custom preprocessor for obtaining the dependencies (.moc files)
#. Not all compilers provide .d files for ob... |
simonwydooghe/ansible | test/units/modules/network/eos/eos_module.py | # (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 dis... |
camilonova/django | tests/admin_views/test_templatetags.py | from django.contrib.admin.templatetags.admin_modify import submit_row
from django.contrib.auth.admin import UserAdmin
from django.contrib.auth.models import User
from django.test import RequestFactory
from django.urls import reverse
from .admin import site
from .tests import AdminViewBasicTestCase
class AdminTemplat... |
scs/uclinux | user/samba/samba-3.0.25a/examples/scripts/shares/python/smbparm.py | ######################################################################
##
## autogenerated file of smb.conf parameters
## generate_parm_table <..../param/loadparm.c>
##
## Copyright (C) Gerald Carter 2004.
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the... |
skycucumber/Messaging-Gateway | webapp/venv/lib/python2.7/site-packages/twisted/protocols/wire.py | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""Implement standard (and unused) TCP protocols.
These protocols are either provided by inetd, or are not provided at all.
"""
# system imports
import time, struct
from zope.interface import implements
# twisted import
from twisted.internet im... |
mzdaniel/oh-mainline | vendor/packages/python-openid/openid/test/test_sreg.py | from openid.extensions import sreg
from openid.message import NamespaceMap, Message, registerNamespaceAlias
from openid.server.server import OpenIDRequest, OpenIDResponse
import unittest
class SRegURITest(unittest.TestCase):
def test_is11(self):
self.failUnlessEqual(sreg.ns_uri_1_1, sreg.ns_uri)
class Ch... |
valexandersaulys/prudential_insurance_kaggle | venv/lib/python2.7/site-packages/scipy/weave/tests/test_blitz_tools.py | from __future__ import absolute_import, print_function
import time
import parser
import warnings
from numpy import (float32, float64, complex64, complex128,
zeros, random, array)
from numpy.testing import (TestCase, assert_equal,
assert_allclose, run_module_suite)
from ... |
dpac-vlsi/SynchroTrace | util/ext/ply/test/testlex.py | # testlex.py
import unittest
try:
import StringIO
except ImportError:
import io as StringIO
import sys
sys.path.insert(0,"..")
sys.tracebacklimit = 0
import ply.lex
def check_expected(result,expected):
if sys.version_info[0] >= 3:
if isinstance(result,str):
result = result.encode('as... |
BitWriters/Zenith_project | zango/lib/python3.5/site-packages/setuptools/lib2to3_ex.py | """
Customized Mixin2to3 support:
- adds support for converting doctests
This module raises an ImportError on Python 2.
"""
from distutils.util import Mixin2to3 as _Mixin2to3
from distutils import log
from lib2to3.refactor import RefactoringTool, get_fixers_from_package
import setuptools
class DistutilsRefactor... |
kennethreitz-archive/python-convore | setup.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
from distutils.core import setup
def publish():
"""Publish to PyPi"""
os.system("python setup.py sdist upload")
if sys.argv[-1] == "publish":
publish()
sys.exit()
elif sys.argv[-1] == "test":
import tox
tox.cmdline()
requi... |
wohlfea/django_imager | imagersite/imager_images/migrations/0007_album_cover.py | # -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2016-04-20 01:55
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('imager_images', '0006_remove_album_cover'),
]
opera... |
boyombo/django-stations | stations/heathen/migrations/0004_auto_20161128_0550.py | # -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2016-11-28 05:50
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('heathen', '0003_auto_20161128_0519'),
]
operations = [
migrations.AlterModelOptions(... |
Chengyumeng/spider163 | spider163/spider/mp3.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import requests
from terminaltables import AsciiTable
from spider163 import settings
from spider163.utils import pylog
from spider163.utils import tools
from spider163.utils import encrypt
from spider163.spider import public as uapi
class MP3:
def __init... |
gghezzo/prettypython | PythonEveryDay2015/shapes.py | # Playing with Pygames
# From : http://pythonprogramming.net/dashboard/#tab_games
# Typer: Ginny C Ghezzo
# What I learned: event is SO COOL: (what event, pos, button, rel), why is
import pygame
pygame.init()
white = (255,255,255)
black = (0,0,0)
red = (255,0,0)
green = (0, 255, 0)
blue = (0,0, 255)
gameDisplay ... |
ningirsu/stepmania-server | smserver/services/chat.py | """ Chat service """
from smserver import event
from smserver import messaging
def send_message_token(token, message, source=None):
"""
Send a chat message to the given target
:param str token: target of the message (token of the connection)
:param str message: Message to send
:pa... |
gklyne/annalist | src/annalist_root/annalist/tests/test_entity_subtype_selection.py | from __future__ import unicode_literals
from __future__ import absolute_import, division, print_function
"""
Tests for EntityData subtype selection in list views and select dropdowns
"""
__author__ = "Graham Klyne (GK@ACM.ORG)"
__copyright__ = "Copyright 2014, G. Klyne"
__license__ = "MIT (http://opensourc... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.