repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
taedla01/MissionPlanner | refs/heads/master | Lib/site-packages/numpy/core/tests/test_scalarmath.py | 53 | import sys
from numpy.testing import *
import numpy as np
types = [np.bool_, np.byte, np.ubyte, np.short, np.ushort, np.intc, np.uintc,
np.int_, np.uint, np.longlong, np.ulonglong,
np.single, np.double, np.longdouble, np.csingle,
np.cdouble, np.clongdouble]
real_types = [ np.byte, np.ubyte,... |
jamespcole/home-assistant | refs/heads/master | homeassistant/components/aftership/sensor.py | 4 | """
Support for non-delivered packages recorded in AfterShip.
For more details about this platform, please refer to the documentation at
https://www.home-assistant.io/components/sensor.aftership/
"""
from datetime import timedelta
import logging
import voluptuous as vol
from homeassistant.components.sensor import PL... |
paul80/CMPUT333A1 | refs/heads/master | blockreciever.py | 1 | import time
import random
import start
import statsandprint
import control
import sys
#def recieve_send_detect(numberofbits, error, feedbacktime, seed, doparity):
def recieve_send_detect(numberofbits, error,seed, doparity):
instaerror = float(error)
instaerrorcount = 0
#Commenting out lines here------... |
tectronics/bayes-swarm | refs/heads/master | mean-machine/ui/igraphdrawingarea.py | 1 | #!/usr/bin/env python
#
# Mean Machine: subclass gtk.DrawingArea in order to plot a graph
#
# == Author
# Matteo Zandi [matteo.zandi@bayesfor.eu]
#
# == Copyright
# Copyright(c) 2008 - bayes-swarm project.
# Licensed under the GNU General Public License v2.
# USA
import gtk
from gtk import gdk
import cairo
import igr... |
getnikola/plugins | refs/heads/master | v7/slides/slides.py | 2 | # -*- coding: utf-8 -*-
# Copyright © 2012-2017 Roberto Alsina and others.
# 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 t... |
jcrumb/httpie | refs/heads/master | tests/test_unicode.py | 49 | # coding=utf-8
"""
Various unicode handling related tests.
"""
from utils import http, HTTP_OK
from fixtures import UNICODE
class TestUnicode:
def test_unicode_headers(self, httpbin):
# httpbin doesn't interpret utf8 headers
r = http(httpbin.url + '/headers', u'Test:%s' % UNICODE)
assert... |
stiphyMT/plantcv | refs/heads/master | plantcv/plantcv/auto_crop.py | 2 | # Resize image
import os
import cv2
import numpy as np
from plantcv.plantcv import print_image
from plantcv.plantcv import plot_image
from plantcv.plantcv import params
from plantcv.plantcv import fatal_error
def auto_crop(img, obj, padding_x=0, padding_y=0, color='black'):
"""Resize image.
Inputs:
img ... |
abramhindle/UnnaturalCodeFork | refs/heads/master | python/testdata/launchpad/lib/lp/codehosting/puller/tests/test_worker.py | 1 | # Copyright 2009-2011 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
"""Unit tests for worker.py."""
__metaclass__ = type
import gc
from StringIO import StringIO
import bzrlib.branch
from bzrlib.branch import BranchReferenceFormat
from bzrli... |
2014c2g1/c2g1 | refs/heads/master | exts/wsgi/static/Brython2.1.0-20140419-113919/Lib/xml/etree/cElementTree.py | 876 | # Deprecated alias for xml.etree.ElementTree
from xml.etree.ElementTree import *
|
SusanJL/iris | refs/heads/master | docs/iris/example_tests/test_global_map.py | 11 | # (C) British Crown Copyright 2010 - 2016, Met Office
#
# This file is part of Iris.
#
# Iris 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 l... |
rouge8/pex | refs/heads/master | tests/test_crawler.py | 2 | # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import os
from twitter.common.contextutil import temporary_dir
from pex.crawler import Crawler, PageParser
from pex.http import Context
from pex.link import Link
try:
from unittest im... |
varunkamra/kuma | refs/heads/master | vendor/packages/logilab/astng/setup.py | 24 | #!/usr/bin/env python
# pylint: disable=W0404,W0622,W0704,W0613
# copyright 2003-2013 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
#
# This file is part of logilab-astng.
#
# logilab-astng is free software: you can redistribute it and/or modify it unde... |
MebiusHKU/flask-web | refs/heads/master | flask/lib/python2.7/site-packages/whoosh/idsets.py | 52 | """
An implementation of an object that acts like a collection of on/off bits.
"""
import operator
from array import array
from bisect import bisect_left, bisect_right, insort
from whoosh.compat import integer_types, izip, izip_longest, next, xrange
from whoosh.util.numeric import bytes_for_bits
# Number of '1' bit... |
40223141/gear | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/logging/handlers.py | 736 | # Copyright 2001-2013 by Vinay Sajip. All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
# provided that the above copyright notice appear in all copies and that
# both that copyright notice and this permissio... |
mgarg1/ecg | refs/heads/master | ecg_visualizer_ble_PC/galry/datanormalizer.py | 9 | import numpy as np
__all__ = ['DataNormalizer']
class DataNormalizer(object):
"""Handles normalizing data so that it fits the fixed [-1,1]^2 viewport."""
def __init__(self, data=None):
self.data = data
def normalize(self, initial_viewbox=None, symmetric=False):
"""Normalize data given... |
gusyussh/learntosolveit | refs/heads/version1 | languages/python/algorithm_fact2.py | 7 | import operator
print reduce(operator.mul, xrange(1,10))
|
kiwiheretic/logos-v2 | refs/heads/master | reddit/migrations/0007_auto_20160619_2130.py | 1 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('reddit', '0006_auto_20160518_0036'),
... |
zeza/gnuradio-rc-testcode | refs/heads/master | gr-flysky/docs/doxygen/doxyxml/generated/indexsuper.py | 348 | #!/usr/bin/env python
#
# Generated Thu Jun 11 18:43:54 2009 by generateDS.py.
#
import sys
import getopt
from string import lower as str_lower
from xml.dom import minidom
from xml.dom import Node
#
# User methods
#
# Calls to the methods in these classes are generated by generateDS.py.
# You can replace these metho... |
pdxwebdev/yadapy | refs/heads/master | yada/lib/python2.7/site-packages/bson/code.py | 28 | # Copyright 2009-2015 MongoDB, 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 writin... |
40223245/2015cd_midterm | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/_strptime.py | 518 | """Strptime-related classes and functions.
CLASSES:
LocaleTime -- Discovers and stores locale-specific time information
TimeRE -- Creates regexes for pattern matching a string of text containing
time information
FUNCTIONS:
_getlang -- Figure out what language is being used for the locale
... |
jcftang/ansible | refs/heads/devel | lib/ansible/modules/cloud/openstack/os_security_group.py | 29 | #!/usr/bin/python
# Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
# Copyright (c) 2013, Benno Joy <benno@ansible.com>
#
# This module 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 vers... |
kushalbhola/MyStuff | refs/heads/master | Practice/PythonApplication/env/Lib/site-packages/pandas/tests/series/test_api.py | 2 | from collections import OrderedDict
import pydoc
import warnings
import numpy as np
import pytest
import pandas as pd
from pandas import (
Categorical,
DataFrame,
DatetimeIndex,
Index,
Series,
TimedeltaIndex,
date_range,
period_range,
timedelta_range,
)
from pandas.core.arrays impo... |
AndrewIngram/django-extra-views | refs/heads/master | extra_views_tests/urls.py | 1 | from django.urls import path
from django.views.generic import TemplateView
from .formsets import AddressFormSet
from .views import (
AddressFormSetView,
AddressFormSetViewKwargs,
AddressFormSetViewNamed,
EventCalendarView,
FormAndFormSetOverrideView,
ItemModelFormSetExcludeView,
ItemModelFo... |
RossBrunton/django | refs/heads/master | tests/utils_tests/test_feedgenerator.py | 163 | from __future__ import unicode_literals
import datetime
import unittest
from django.utils import feedgenerator
from django.utils.timezone import get_fixed_timezone
class FeedgeneratorTest(unittest.TestCase):
"""
Tests for the low-level syndication feed framework.
"""
def test_get_tag_uri(self):
... |
mmulazzani/HoneyConnector | refs/heads/master | client/stem/util/log.py | 1 | # Copyright 2011-2013, Damian Johnson
# See LICENSE for licensing information
"""
Functions to aid library logging. The default logging
:data:`~stem.util.log.Runlevel` is usually NOTICE and above.
**Stem users are more than welcome to listen for stem events, but these
functions are not being vended to our users. They... |
xxiaoxiao/flasky | refs/heads/master | migrations/versions/190163627111_account_confirmation.py | 144 | """account confirmation
Revision ID: 190163627111
Revises: 456a945560f6
Create Date: 2013-12-29 02:58:45.577428
"""
# revision identifiers, used by Alembic.
revision = '190163627111'
down_revision = '456a945560f6'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Ale... |
robwarm/gpaw-symm | refs/heads/master | gpaw/test/lebedev.py | 3 | from gpaw.sphere.lebedev import run, weight_n, Y_nL, R_nv
weight0_n, Y0_nL, R0_nv = run()
assert (abs(weight0_n - weight_n).sum() +
abs(Y0_nL - Y_nL).sum() +
abs(R0_nv - R_nv).sum()) < 1e-13
|
fitermay/intellij-community | refs/heads/master | python/testData/intentions/PyConvertCollectionLiteralIntentionTest/convertListToSet.py | 156 | xs = [<caret>1, 2] |
LasLabs/website | refs/heads/8.0 | website_crm_address/__init__.py | 12 | # -*- coding: utf-8 -*-
##############################################################################
#
# This module copyright (C) 2015 Therp BV <http://therp.nl>.
#
# 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... |
ClearCorp-dev/odoo | refs/heads/8.0 | addons/mrp/wizard/change_production_qty.py | 245 | # -*- 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... |
newsapps/panda | refs/heads/master | panda/tests/test_api_data_upload.py | 6 | #!/usr/bin/env python
import os.path
from django.conf import settings
from django.test import TransactionTestCase
from django.test.client import Client
from django.utils import simplejson as json
from panda.models import DataUpload
from panda.tests import utils
class TestAPIDataUpload(TransactionTestCase):
fixt... |
dya2/python-for-android | refs/heads/master | python3-alpha/python3-src/Lib/nturl2path.py | 56 | """Convert a NT pathname to a file URL and vice versa."""
def url2pathname(url):
"""OS-specific conversion from a relative URL of the 'file' scheme
to a file system path; not recommended for general use."""
# e.g.
# ///C|/foo/bar/spam.foo
# becomes
# C:\foo\bar\spam.foo
import string, urlli... |
jiachenning/CodeIgniter | refs/heads/develop | user_guide_src/cilexer/setup.py | 397 | """
Install and setup CodeIgniter highlighting for Pygments.
"""
from setuptools import setup
entry_points = """
[pygments.lexers]
cilexer = cilexer.cilexer:CodeIgniterLexer
"""
setup(
name='pycilexer',
version='0.1',
description=__doc__,
author="EllisLab, Inc.",
packages=['cilexer'],
install... |
azumimuo/family-xbmc-addon | refs/heads/master | script.module.youtube.dl/lib/youtube_dl/extractor/xfileshare.py | 19 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
decode_packed_codes,
determine_ext,
ExtractorError,
int_or_none,
NO_DEFAULT,
urlencode_postdata,
)
class XFileShareIE(InfoExtractor):
_SITES = (
(r'daclips\.(... |
JIoJIaJIu/servo | refs/heads/master | tests/wpt/css-tests/tools/wptserve/wptserve/request.py | 123 | import base64
import cgi
import Cookie
import os
import StringIO
import tempfile
import urlparse
import stash
from utils import HTTPException
missing = object()
class Server(object):
"""Data about the server environment
.. attribute:: config
Environment configuration information with information about... |
fbossy/SickRage | refs/heads/master | lib/guessit/transfo/__init__.py | 51 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# GuessIt - A library for guessing information from filenames
# Copyright (c) 2013 Nicolas Wack <wackou@gmail.com>
#
# GuessIt is free software; you can redistribute it and/or modify it under
# the terms of the Lesser GNU General Public License as published by
# the Free ... |
prospwro/odoo | refs/heads/8.0 | addons/base_action_rule/test_models.py | 333 | from openerp.osv import fields, osv
from openerp import api
AVAILABLE_STATES = [
('draft', 'New'),
('cancel', 'Cancelled'),
('open', 'In Progress'),
('pending', 'Pending'),
('done', 'Closed')
]
class lead_test(osv.Model):
_name = "base.action.rule.lead.test"
_columns = {
'name': f... |
ar7z1/ansible | refs/heads/devel | lib/ansible/modules/network/cloudengine/ce_snmp_contact.py | 43 | #!/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... |
gi11es/thumbor | refs/heads/master | perf/static_app.py | 3 | from starlette.applications import Starlette
from starlette.routing import Mount
from starlette.staticfiles import StaticFiles
ROUTES = [
Mount("/", app=StaticFiles(directory="static"), name="static"),
]
APP = Starlette(routes=ROUTES)
|
tragiclifestories/django | refs/heads/master | tests/user_commands/management/commands/dance.py | 314 | from django.core.management.base import BaseCommand, CommandError
class Command(BaseCommand):
help = "Dance around like a madman."
args = ''
requires_system_checks = True
def add_arguments(self, parser):
parser.add_argument("-s", "--style", default="Rock'n'Roll")
parser.add_argument("... |
NikitaKoshelev/exam4sovzond | refs/heads/master | apps/dynamic_models/templatetags/dynamic_models_extras.py | 1 | # coding: utf-8
import pymorphy2
from django.template import Library, defaultfilters
from django.db.models import Model
morph = pymorphy2.MorphAnalyzer()
register = Library()
@register.filter
@defaultfilters.stringfilter
def inflect(word, grammeme):
return morph.parse(word)[0].inflect(set(grammeme.split(','))).... |
sinbazhou/odoo | refs/heads/8.0 | addons/l10n_hn/__init__.py | 411 | # -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2009-2010 Salvatore J. Trimarchi <salvatore@trimarchi.co.cc>
# (http://salvatoreweb.co.cc)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of th... |
zigitax/pupy | refs/heads/master | pupy/modules/pyexec.py | 27 | # -*- coding: UTF8 -*-
from pupylib.PupyModule import *
import StringIO
import pupylib.utils
__class_name__="PythonExec"
class PythonExec(PupyModule):
""" execute python code on a remote system """
def init_argparse(self):
self.arg_parser = PupyArgumentParser(prog='pyexec', description=self.__doc__)
group=self.... |
pymedusa/Medusa | refs/heads/master | ext/knowit/properties/duration.py | 2 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import re
from datetime import timedelta
from six import text_type
from ..property import Property
class Duration(Property):
"""Duration property."""
duration_re = re.compile(r'(?P<hours>\d{1,2}):'
r'(?P<minutes>\... |
zstyblik/infernal-twin | refs/heads/master | build/pillow/Tests/test_image_transform.py | 11 | from helper import unittest, PillowTestCase, hopper
from PIL import Image
class TestImageTransform(PillowTestCase):
def test_sanity(self):
from PIL import ImageTransform
im = Image.new("L", (100, 100))
seq = tuple(range(10))
transform = ImageTransform.AffineTransform(seq[:6])
... |
nchammas/click | refs/heads/master | examples/naval/naval.py | 43 | import click
@click.group()
@click.version_option()
def cli():
"""Naval Fate.
This is the docopt example adopted to Click but with some actual
commands implemented and not just the empty parsing which really
is not all that interesting.
"""
@cli.group()
def ship():
"""Manages ships."""
@s... |
edx/luigi | refs/heads/master | luigi/contrib/sge.py | 15 | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# 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... |
mapbased/phantomjs | refs/heads/master | src/qt/qtwebkit/Tools/QueueStatusServer/filters/__init__.py | 6014 | # Required for Python to search this directory for module files
|
maxis1314/pyutils | refs/heads/master | ml/kmeans/run.py | 1 | # -*- coding: utf-8 -*-
from matplotlib import pyplot
import scipy as sp
import numpy as np
from sklearn import svm
import matplotlib.pyplot as plt
from sklearn.cluster import KMeans
from scipy import sparse
import sys
reload(sys)
sys.setdefaultencoding('utf8')
#数据读入
data = np.loadtxt('1.txt')
... |
mollstam/UnrealPy | refs/heads/master | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/Python-2.7.10/Lib/aifc.py | 29 | """Stuff to parse AIFF-C and AIFF files.
Unless explicitly stated otherwise, the description below is true
both for AIFF-C files and AIFF files.
An AIFF-C file has the following structure.
+-----------------+
| FORM |
+-----------------+
| <size> |
+----+------------+
| | AIFC ... |
ClearCorp/account-financial-tools | refs/heads/8.0 | contract_multic_fix/account.py | 1 | # -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in module root
# directory
##############################################################################
from openerp import models, fields, api
# from ope... |
harterj/moose | refs/heads/devel | python/TestHarness/tests/test_DistributedMesh.py | 9 | #* This file is part of the MOOSE framework
#* https://www.mooseframework.org
#*
#* All rights reserved, see COPYRIGHT for full restrictions
#* https://github.com/idaholab/moose/blob/master/COPYRIGHT
#*
#* Licensed under LGPL 2.1, please see LICENSE for details
#* https://www.gnu.org/licenses/lgpl-2.1.html
from TestHa... |
yuanagain/seniorthesis | refs/heads/master | venv/bin/activate_this.py | 1076 | """By using execfile(this_file, dict(__file__=this_file)) you will
activate this virtualenv environment.
This can be used when you must use an existing Python interpreter, not
the virtualenv bin/python
"""
try:
__file__
except NameError:
raise AssertionError(
"You must run this like execfile('path/to/... |
theonlynexus/gui2py | refs/heads/master | gui/windows/htmlwin.py | 14 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"gui2py's HTML Top Level Window (uses wx.Frame and gui.HtmlBox)"
__author__ = "Mariano Reingart (reingart@gmail.com)"
__copyright__ = "Copyright (C) 2013- Mariano Reingart"
__license__ = "LGPL 3.0"
# This is an experimental approach to show rich internet application... |
koniiiik/django | refs/heads/master | tests/template_tests/syntax_tests/test_exceptions.py | 513 | from django.template import TemplateDoesNotExist, TemplateSyntaxError
from django.test import SimpleTestCase
from ..utils import setup
from .test_extends import inheritance_templates
class ExceptionsTests(SimpleTestCase):
@setup({'exception01': "{% extends 'nonexistent' %}"})
def test_exception01(self):
... |
totcoindev/totcoin | refs/heads/master | qa/rpc-tests/invalidblockrequest.py | 38 | #!/usr/bin/env python2
#
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
from test_framework.test_framework import ComparisonTestFramework
from test_framework.util import *
from test_framework.comptool import TestManager, Te... |
mrlegion/web-portfolio-server | refs/heads/master | node_modules/node-gyp/gyp/gyptest.py | 1752 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
__doc__ = """
gyptest.py -- test runner for GYP tests.
"""
import os
import optparse
import subprocess
import sys
class CommandRunner(obje... |
jzoldak/edx-platform | refs/heads/master | lms/djangoapps/verify_student/startup.py | 63 | """
Setup the signals on startup.
"""
import lms.djangoapps.verify_student.signals # pylint: disable=unused-import
|
sauloal/cnidaria | refs/heads/master | scripts/venv/local/lib/python2.7/encodings/hz.py | 817 | #
# hz.py: Python Unicode Codec for HZ
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#
import _codecs_cn, codecs
import _multibytecodec as mbc
codec = _codecs_cn.getcodec('hz')
class Codec(codecs.Codec):
encode = codec.encode
decode = codec.decode
class IncrementalEncoder(mbc.MultibyteIncrementalEncoder... |
xujun10110/golismero | refs/heads/master | tools/xsser/XSSer/tokenhub.py | 7 | #!/usr/bin/python
# -*- coding: iso-8859-15 -*-
"""
$Id$
This file is part of the xsser project, http://xsser.sourceforge.net.
Copyright (c) 2011/2012 psy <root@lordepsylon.net> - <epsylon@riseup.net>
xsser is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License a... |
symbolicdata/code | refs/heads/master | src/sdeval/classes/TaskFolder_test.py | 1 | import unittest
from TaskFolder import TaskFolder
from Task import Task
from TaskFolderTree import TaskFolderTree
from MachineSettings import MachineSettings
class TestTaskFolder(unittest.TestCase):
"""
Tests for the class TaskFolder
.. moduleauthor:: Albert Heinle <aheinle@uwaterloo.ca>
"""
def... |
CZ-NIC/conpot | refs/heads/master | conpot/protocols/modbus/slave.py | 2 | import struct
import logging
from modbus_tk.modbus import Slave, ModbusError, ModbusInvalidRequestError, InvalidArgumentError, DuplicatedKeyError,\
InvalidModbusBlockError, OverlapModbusBlockError
from modbus_tk import defines, utils
from modbus_block_databus_mediator import ModbusBlockDa... |
stephane-martin/salt-debian-packaging | refs/heads/master | salt-2016.3.2/salt/modules/solaris_fmadm.py | 2 | # -*- coding: utf-8 -*-
'''
Module for running fmadm and fmdump on Solaris
:maintainer: Jorge Schrauwen <sjorge@blackdot.be>
:maturity: new
:platform: solaris,illumos
.. versionadded:: 2016.3.0
'''
from __future__ import absolute_import
# Import Python libs
import logging
# Import Salt libs
import salt... |
dejacode/about-code-tool | refs/heads/master | src/attributecode/util.py | 1 | #!/usr/bin/env python
# -*- coding: utf8 -*-
# ============================================================================
# Copyright (c) 2013-2018 nexB Inc. http://www.nexb.com/ - All rights reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in complianc... |
exa-analytics/atomic | refs/heads/master | exatomic/qe/__pw/footer.py | 4 | ## -*- coding: utf-8 -*-
## Copyright (c) 2015-2020, Exa Analytics Development Team
## Distributed under the terms of the Apache License 2.0
#"""
#PW Footer Subsection Parser
##############################
#"""
#from exa.typed import TypedProperty
#from exa.core.parser import Sections, Parser
#
#
#class Footer(Parser):... |
netortik/yandex-tank | refs/heads/master | yandextank/__init__.py | 878 | # this is a namespace package
try:
import pkg_resources
pkg_resources.declare_namespace(__name__)
except ImportError:
import pkgutil
__path__ = pkgutil.extend_path(__path__, __name__)
|
MindPass/Code | refs/heads/master | Interface_graphique/mindmap/svgwrite-1.1.6/svgwrite/data/pattern.py | 2 | #!/usr/bin/env python
#coding:utf-8
# Author: mozman --<mozman@gmx.at>
# Purpose: pattern module
# Created: 27.09.2010
# Copyright (C) 2010, Manfred Moitzi
# License: MIT License
import re
#coordinate ::= number ("em" | "ex" | "px" | "in" | "cm" | "mm" | "pt" | "pc" | "%")?
coordinate = re.compile(r"(^[-+]?[0-9]*\.?... |
cycotech/WAR-app | refs/heads/master | env/lib/python3.5/site-packages/django/contrib/gis/db/backends/spatialite/adapter.py | 586 | from django.contrib.gis.db.backends.base.adapter import WKTAdapter
from django.db.backends.sqlite3.base import Database
class SpatiaLiteAdapter(WKTAdapter):
"SQLite adaptor for geometry objects."
def __conform__(self, protocol):
if protocol is Database.PrepareProtocol:
return str(self)
|
lstoll/tetherme | refs/heads/master | common/appenginepatch/mediautils/management/commands/generatemedia.py | 10 | # -*- coding: utf-8 -*-
"""
This app combines media files specified in the COMBINE_MEDIA setting into one
single file. It's a dictionary mapping the combined name to a tuple of files
that should be combined:
COMBINE_MEDIA = {
'global/js/combined.js': (
'global/js/main.js',
'app/js/other.js',
),... |
googleads/google-ads-python | refs/heads/master | google/ads/googleads/v8/enums/types/budget_status.py | 1 | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... |
waterice/Test-Git | refs/heads/master | arch/ia64/scripts/unwcheck.py | 916 | #!/usr/bin/env 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 Matthe... |
les69/calvin-base | refs/heads/master | calvin/runtime/north/tests/test_storage.py | 2 | # -*- coding: utf-8 -*-
# Copyright (c) 2015 Ericsson AB
#
# 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 ... |
ehabkost/avocado-vt | refs/heads/master | virttest/libvirt_xml/devices/hostdev.py | 8 | """
hostdev device support class(es)
http://libvirt.org/formatdomain.html#elementsHostDev
"""
import logging
from virttest.libvirt_xml.devices import base
from virttest.libvirt_xml import accessors
class Hostdev(base.TypedDeviceBase):
__slots__ = ('mode', 'hostdev_type', 'source_address',
'mana... |
ngouzy/smartchangelog | refs/heads/master | smartchangelog/datetools.py | 2 | from datetime import datetime
date_format = "%Y-%m-%d %H:%M:%S %z"
def str2date(string: str) -> datetime:
return datetime.strptime(string, date_format)
def date2str(dt: datetime) -> str:
return dt.strftime(date_format) |
firerszd/kbengine | refs/heads/master | kbe/src/lib/python/Lib/encodings/cp65001.py | 112 | """
Code page 65001: Windows UTF-8 (CP_UTF8).
"""
import codecs
import functools
if not hasattr(codecs, 'code_page_encode'):
raise LookupError("cp65001 encoding is only available on Windows")
### Codec APIs
encode = functools.partial(codecs.code_page_encode, 65001)
decode = functools.partial(codecs.code_page_de... |
mdavid/pledgeservice | refs/heads/master | testlib/setuptools/command/bdist_rpm.py | 111 | import distutils.command.bdist_rpm as orig
class bdist_rpm(orig.bdist_rpm):
"""
Override the default bdist_rpm behavior to do the following:
1. Run egg_info to ensure the name and version are properly calculated.
2. Always run 'install' using --single-version-externally-managed to
disable eggs ... |
doismellburning/edx-platform | refs/heads/master | common/test/data/uploads/python_lib_zip/sub/submodule.py | 223 | HELLO = "world"
|
dagwieers/ansible | refs/heads/devel | lib/ansible/modules/crypto/acme/acme_inspect.py | 20 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2018 Felix Fontein (@felixfontein)
# 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',
... |
polyaxon/polyaxon | refs/heads/master | core/polyaxon/proxies/schemas/base.py | 1 | #!/usr/bin/python
#
# Copyright 2018-2021 Polyaxon, 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 ... |
muravjov/ansible-modules-core | refs/heads/devel | cloud/rackspace/rax_cdb_database.py | 41 | #!/usr/bin/python -tt
# 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 distrib... |
CentralLabFacilities/m3meka | refs/heads/master | python/scripts/demo/m3_demo_shapes.py | 2 | #! /usr/bin/python
#Copyright 2010, Meka Robotics
#All rights reserved.
#http://mekabot.com
#Redistribution and use in source and binary forms, with or without
#modification, are permitted.
#THIS SOFTWARE IS PROVIDED BY THE Copyright HOLDERS AND CONTRIBUTORS
#"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUD... |
CoderBotOrg/coderbotsrv | refs/heads/master | server/lib/werkzeug/serving.py | 145 | # -*- coding: utf-8 -*-
"""
werkzeug.serving
~~~~~~~~~~~~~~~~
There are many ways to serve a WSGI application. While you're developing
it you usually don't want a full blown webserver like Apache but a simple
standalone one. From Python 2.5 onwards there is the `wsgiref`_ server in
the standa... |
MalloyPower/parsing-python | refs/heads/master | front-end/testsuite-python-lib/Python-3.0/Lib/lib2to3/tests/test_parser.py | 1 | #!/usr/bin/env python2.5
"""Test suite for 2to3's parser and grammar files.
This is the place to add tests for changes to 2to3's grammar, such as those
merging the grammars for Python 2 and 3. In addition to specific tests for
parts of the grammar we've changed, we also make sure we can parse the
test_grammar.py files... |
kunaltyagi/nsiqcppstyle | refs/heads/master | rules/RULE_5_2_C_provide_doxygen_struct_comment_on_struct_def.py | 1 | """
Provide the struct/union doxygen comment.
It checks if there is doxygen sytle comment in front of each struct/union definition.
== Violation ==
struct A { <== Violation. No doxygen comment.
};
/* <== Violation. It's not doxygen comment
*
*/
union B {
};
== Goo... |
stevejb71/Idris-dev | refs/heads/master | docs/conf.py | 21 | # -*- coding: utf-8 -*-
#
# Idris Manual documentation build configuration file, created by
# sphinx-quickstart on Sat Feb 28 20:41:47 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 file.
... |
jrg365/gpytorch | refs/heads/master | gpytorch/likelihoods/gaussian_likelihood.py | 1 | #!/usr/bin/env python3
import math
import warnings
from copy import deepcopy
from typing import Any, Optional
import torch
from torch import Tensor
from ..distributions import MultivariateNormal, base_distributions
from ..lazy import ZeroLazyTensor
from ..utils.warnings import GPInputWarning
from .likelihood import ... |
kevinmel2000/sl4a | refs/heads/master | python/gdata/src/gdata/apps/groups/service.py | 137 | #!/usr/bin/python
#
# Copyright (C) 2008 Google, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... |
Thraxis/SickRage | refs/heads/master | lib/sqlalchemy/exc.py | 79 | # sqlalchemy/exc.py
# Copyright (C) 2005-2014 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
"""Exceptions used with SQLAlchemy.
The base exception class is :exc:`.SQLAlchemyEr... |
ctmarinas/stgit | refs/heads/master | stgit/commands/series.py | 1 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
from stgit.argparse import opt, patch_range
from stgit.commands.common import CmdException, DirectoryHasRepository, parse_patches
from stgit.config import config
from stgit.out import out
__copyright__ = """
Cop... |
bertrandvidal/stuff | refs/heads/master | djangoprojects/django_rest_framework/tutorial/snippets/permissions.py | 21 | from rest_framework import permissions
class IsOwnerOrReadOnly(permissions.BasePermission):
"""
Custom permission to only allow owners of an object to edit it.
"""
def has_object_permission(self, request, view, obj):
# Read permissions are allowed to any request,
# so we'll always all... |
jmwright/cadquery-x | refs/heads/master | gui/libs/future/backports/_markupbase.py | 84 | """Shared support for scanning document type declarations in HTML and XHTML.
Backported for python-future from Python 3.3. Reason: ParserBase is an
old-style class in the Python 2.7 source of markupbase.py, which I suspect
might be the cause of sporadic unit-test failures on travis-ci.org with
test_htmlparser.py. The... |
gonboy/sl4a | refs/heads/master | python/src/Lib/plat-mac/lib-scriptpackages/StdSuites/Macintosh_Connectivity_Clas.py | 81 | """Suite Macintosh Connectivity Classes: Classes relating to Apple Macintosh personal computer connectivity
Level 1, version 1
Generated from /Volumes/Sap/System Folder/Extensions/AppleScript
AETE/AEUT resource version 1/0, language 0, script 0
"""
import aetools
import MacOS
_code = 'macc'
class Macintosh_Connecti... |
lordB8r/polls | refs/heads/master | ENV/lib/python2.7/site-packages/pip-1.3.1-py2.7.egg/pip/commands/search.py | 63 | import sys
import textwrap
import pkg_resources
import pip.download
from pip.basecommand import Command, SUCCESS
from pip.util import get_terminal_size
from pip.log import logger
from pip.backwardcompat import xmlrpclib, reduce, cmp
from pip.exceptions import CommandError
from pip.status_codes import NO_MATCHES_FOUND
f... |
LateNitePie/python-oauth2 | refs/heads/master | tests/test_oauth.py | 301 | # -*- coding: utf-8 -*-
"""
The MIT License
Copyright (c) 2009 Vic Fryzel
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, co... |
cloudcache/namebench | refs/heads/master | nb_third_party/dns/rdtypes/ANY/RRSIG.py | 248 | # Copyright (C) 2004-2007, 2009, 2010 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED ... |
nvoron23/socialite | refs/heads/master | jython/Lib/test/test_listcomp_jy.py | 23 | import unittest
from test import test_support
class ListCompTestCase(unittest.TestCase):
#http://bugs.jython.org/issue1205
def test_long_listcomp(self):
#for a long list comp, we compute the Hardy-Ramanujan number
#http://en.wikipedia.org/wiki/1729_(number)
res = [(x1**3+x2**3,(x1,x2),... |
iwvelando/conky_wunderground_scripts | refs/heads/master | wunderground_daily_forecast.py | 1 | import urllib2
import json
import sys
import os
# Extract command line arguments and grab the wunderground API key
location = sys.argv[1]
nPeriods = int(sys.argv[2])
apiKey = open(os.getenv('HOME') + '/.api/wunderground','r').readline().split('\n')[0]
# Wunderground API call for 10 day forecast data
f = urllib2.urlop... |
habibiefaried/ryu | refs/heads/master | ryu/services/protocols/bgp/operator/commands/root.py | 52 | from ryu.services.protocols.bgp.operator.command import Command
from ryu.services.protocols.bgp.operator.commands.clear import ClearCmd
from ryu.services.protocols.bgp.operator.commands.set import SetCmd
from ryu.services.protocols.bgp.operator.commands.show import ShowCmd
class RootCmd(Command):
subcommands = {
... |
dricciardelli/vae2vec | refs/heads/master | capt_gen_n2e_cs.py | 1 | # -*- coding: utf-8 -*-
import math
import os
import tensorflow as tf
import numpy as np
import pandas as pd
import pickle
import pickle as pkl
import cv2
import skimage
import tensorflow.python.platform
from tensorflow.python.ops import rnn
from keras.preprocessing import sequence
from collections import Counter
from... |
ecederstrand/django | refs/heads/master | django/template/loaders/app_directories.py | 635 | """
Wrapper for loading templates from "templates" directories in INSTALLED_APPS
packages.
"""
from django.template.utils import get_app_template_dirs
from .filesystem import Loader as FilesystemLoader
class Loader(FilesystemLoader):
def get_dirs(self):
return get_app_template_dirs('templates')
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.