repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
mhaberler/machinekit | refs/heads/master | src/machinetalk/tutorial/json-ws/zmq-protobuf-micromot-client.py | 18 | import zmq
import time
import pb2json
import json # for pretty printer
import sys,os
sys.path.append("../protobuf")
from demo_pb2 import *
# create a message object:
d = DemoContainer()
# fill in what's required
d.type = DT_POLYLINE
d.velocity = 50
d.acceleration = 500
s = d.segment.add()
s.type = ST_LINE
s.end... |
rldhont/Quantum-GIS | refs/heads/master | python/core/auto_additions/qgsmaplayermodel.py | 51 | # The following has been generated automatically from src/core/qgsmaplayermodel.h
QgsMapLayerModel.ItemDataRole.baseClass = QgsMapLayerModel
|
agry/NGECore2 | refs/heads/master | scripts/object/tangible/loot/mustafar/cube_loot/cube_loot_0c.py | 85615 | import sys
def setup(core, object):
return |
gr4viton/gr4Dalek | refs/heads/master | spine/dd/spine/actions.py | 2 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
class Actions():
num_del = '_'
cmd_end = '\n'
gamepad_input_del = ':'
speed_rot_stick = 'R'
strafe_stick = 'L'
turn_on = 'up'
turn_off = 'down'
gamepad = 'control_via_gamepad'
motor_control = 'motor_control'
motor_slow = 'motor_sl... |
confusatron/funtappd | refs/heads/master | CheckIn.py | 1 | from datetime import datetime
class CheckIn(object):
def __init__(self):
self.beer_name = ''
self.brewery_name = ''
self.beer_type = ''
self.beer_abv = 0
self.beer_ibu = 0
self.comment = ''
self.venue_name = ''
self.venue_city = ''
self.venue_... |
alexbruy/QGIS | refs/heads/master | python/plugins/db_manager/db_manager.py | 1 | # -*- coding: utf-8 -*-
"""
/***************************************************************************
Name : DB Manager
Description : Database manager plugin for QGIS
Date : May 23, 2011
copyright : (C) 2011 by Giuseppe Sucameli
email : brush.tyler@... |
carlcarl/django-webpack-loader | refs/heads/master | webpack_loader/contrib/jinja2ext.py | 8 | import jinja2.ext
from ..templatetags.webpack_loader import render_bundle
class WebpackExtension(jinja2.ext.Extension):
def __init__(self, environment):
super(WebpackExtension, self).__init__(environment)
environment.globals["render_bundle"] = lambda *a, **k: jinja2.Markup(render_bundle(*a, **k))... |
heromod/migrid | refs/heads/master | mig/shared/jobfeasibility.py | 1 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# --- BEGIN_HEADER ---
#
# jobfeasibility - capability of the submitted job to be executed
# Copyright (C) 2003-2010 The MiG Project lead by Brian Vinter
#
# This file is part of MiG.
#
# MiG is free software: you can redistribute it and/or modify
# it under the terms of the... |
paboldin/rally | refs/heads/master | rally/api.py | 1 | # Copyright 2013: Mirantis 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... |
dohoangkhiem/ansible | refs/heads/devel | lib/ansible/constants.py | 23 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... |
amjith/python-prompt-toolkit | refs/heads/master | examples/system-prompt.py | 1 | #!/usr/bin/env python
from __future__ import unicode_literals
from prompt_toolkit import prompt
from prompt_toolkit.filters import Always
if __name__ == '__main__':
print('If you press meta-! or esc-! at the following prompt, you can enter system commands.')
answer = prompt('Give me some input: ', enable_syst... |
cooperhewitt/py-cooperhewitt-roboteyes-colors | refs/heads/master | cooperhewitt/roboteyes/__init__.py | 22 | # https://pythonhosted.org/setuptools/setuptools.html#namespace-packages
__import__('pkg_resources').declare_namespace(__name__)
|
scikit-hep/uproot | refs/heads/master | uproot3/write/compress.py | 1 | #!/usr/bin/env python
# BSD 3-Clause License; see https://github.com/scikit-hep/uproot3/blob/master/LICENSE
from __future__ import absolute_import
import numbers
import struct
import copy
import numpy
import uproot3
import uproot3.const
class Compression(object):
def __init__(self, level):
self.level ... |
mozilla/source | refs/heads/master | vendor-local/lib/python/dateutil/__init__.py | 83 | # -*- coding: utf-8 -*-
"""
Copyright (c) 2003-2010 Gustavo Niemeyer <gustavo@niemeyer.net>
This module offers extensions to the standard Python
datetime module.
"""
__author__ = "Tomi Pieviläinen <tomi.pievilainen@iki.fi>"
__license__ = "Simplified BSD"
__version__ = "2.2"
|
rbnvrw/FRAPalyzer | refs/heads/master | tests/test_frapalyzer.py | 1 | from frapalyzer import FRAPalyzer
from os import path
import unittest
class TestFrapalyzer(unittest.TestCase):
def setUp(self):
dir_path = path.dirname(path.realpath(__file__))
self.files = [
path.join(dir_path, 'test_data/data001.nd2'),
path.join(dir_path, 'test_data/data0... |
frankban/juju-bundlelib | refs/heads/master | jujubundlelib/tests/test_cli.py | 4 | # Copyright 2015 Canonical Ltd.
# Licensed under the AGPLv3, see LICENCE file for details.
from __future__ import unicode_literals
import unittest
from jujubundlelib import cli
from jujubundlelib.tests import helpers
@helpers.mock_print()
class TestGetChangeset(helpers.BundleFileTestsMixin, unittest.TestCase):
... |
ylcolala/scrapy | refs/heads/master | tests/test_crawler.py | 127 | import warnings
import unittest
import scrapy
from scrapy.crawler import Crawler, CrawlerRunner, CrawlerProcess
from scrapy.settings import Settings, default_settings
from scrapy.spiderloader import SpiderLoader
from scrapy.utils.spider import DefaultSpider
from scrapy.utils.misc import load_object
from scrapy.extensi... |
dallaspythondojo/python | refs/heads/master | Francisco_Trujillo/Assignments/printodd/PrintOddNum.py | 2 | # print all the odd numbers from 1 to 1000
print 'Odd number from 1 to 1000'
for count in range(1,1000,2):
print count
|
jwren/intellij-community | refs/heads/master | python/testData/inspections/PyMethodMayBeStaticInspection/fString.py | 27 | class C:
def method(self):
print(r'foobar' f'{self}') |
gauribhoite/personfinder | refs/heads/master | env/google_appengine/google/appengine/ext/deferred/__init__.py | 8 | #!/usr/bin/env python
#
# Copyright 2007 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 o... |
fladi/drf-haystack | refs/heads/master | ez_setup.py | 103 | #!python
"""Bootstrap distribute installation
If you want to use setuptools in your package's setup.py, just include this
file in the same directory with it, and add this to the top of your setup.py::
from distribute_setup import use_setuptools
use_setuptools()
If you want to require a specific version of se... |
Proggie02/TestRepo | refs/heads/master | django/utils/formats.py | 104 | import decimal
import datetime
from django.conf import settings
from django.utils import dateformat, numberformat, datetime_safe
from django.utils.importlib import import_module
from django.utils.encoding import force_str
from django.utils.functional import lazy
from django.utils.safestring import mark_safe
from djang... |
jlmcdonald/byu-hummedia-api | refs/heads/master | hummedia/vtt.py | 5 | import re
import codecs
import contextlib
import chardet
import os
import unicodedata
from pycaption import WebVTTWriter, SRTReader, CaptionConverter
VALIDATION_BIN = 'node ' + os.path.dirname(os.path.realpath(__file__)) +\
os.sep + 'validate-vtt.js'
class SubtitleException(Exception):
""" Raised w... |
Nermannen/eth-e-voting-project | refs/heads/master | node_modules/node-forge/tests/policyserver.py | 171 | #!/usr/bin/env python
"""
Flash Socket Policy Server.
- Starts Flash socket policy file server.
- Defaults to port 843.
- NOTE: Most operating systems require administrative privileges to use
ports under 1024.
$ ./policyserver.py [options]
"""
"""
Also consider Adobe's solutions:
http://www.adobe.com/devnet/fla... |
renatolrr/perlmongers | refs/heads/master | script/scrapy/fecha/fecha/settings.py | 1 | # -*- coding: utf-8 -*-
# Scrapy settings for fecha project
#
# For simplicity, this file contains only settings considered important or
# commonly used. You can find more settings consulting the documentation:
#
# http://doc.scrapy.org/en/latest/topics/settings.html
# http://scrapy.readthedocs.org/en/latest/t... |
xfournet/intellij-community | refs/heads/master | python/testData/refactoring/invertBoolean/negate.before.py | 83 | def foo():
va<caret>r = True
return not var |
MLTSHP/mltshp | refs/heads/master | models/comment.py | 1 | from datetime import datetime, timedelta
import re
from tornado import escape
from tornado.options import options
from lib.flyingcow import Model, Property
from lib.utilities import pretty_date
from BeautifulSoup import BeautifulSoup
import user
import notification
import sharedfile
import conversation
class Commen... |
uwdata/termite-stm | refs/heads/master | web2py/applications-original/admin/languages/plural-uk.py | 33 | #!/usr/bin/env python
{
# "singular form (0)": ["first plural form (1)", "second plural form (2)", ...],
'останній': ['останні','останніх'],
'файл': ['файли','файлів'],
'твіт': ['твіти','твітів'],
}
|
gitcoinco/web | refs/heads/master | app/grants/migrations/0079_auto_20200914_2031.py | 1 | # Generated by Django 2.2.4 on 2020-09-14 20:31
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('grants', '0078_auto_20200914_2013'),
]
operations = [
migrations.AlterField(
model_name='grant',
name='hidden',
... |
turbokongen/home-assistant | refs/heads/dev | homeassistant/components/lupusec/switch.py | 14 | """Support for Lupusec Security System switches."""
from datetime import timedelta
import lupupy.constants as CONST
from homeassistant.components.switch import SwitchEntity
from . import DOMAIN as LUPUSEC_DOMAIN, LupusecDevice
SCAN_INTERVAL = timedelta(seconds=2)
def setup_platform(hass, config, add_entities, dis... |
omprakasha/odoo | refs/heads/8.0 | addons/board/board.py | 175 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010-2013 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you ca... |
wxgeo/geophar | refs/heads/master | wxgeometrie/sympy/utilities/tests/test_pickling.py | 1 | import sys
import inspect
import copy
import pickle
import warnings
from sympy.physics.units import meter
from sympy.utilities.pytest import XFAIL
from sympy.core.basic import Atom, Basic
from sympy.core.core import BasicMeta
from sympy.core.singleton import SingletonRegistry
from sympy.core.symbol import Dummy, Sym... |
MERegistro/meregistro | refs/heads/master | tests/regressiontests/utils/decorators.py | 82 | from django.test import TestCase
class DecoratorFromMiddlewareTests(TestCase):
"""
Tests for view decorators created using
``django.utils.decorators.decorator_from_middleware``.
"""
def test_process_view_middleware(self):
"""
Test a middleware that implements process_view.
... |
hurricup/intellij-community | refs/heads/master | python/testData/inspections/GoogleDocStringAddKeywordVararg.py | 53 | def f(**kwa<caret>rgs):
"""
""" |
amith01994/intellij-community | refs/heads/master | python/lib/Lib/distutils/errors.py | 137 | """distutils.errors
Provides exceptions used by the Distutils modules. Note that Distutils
modules may raise standard exceptions; in particular, SystemExit is
usually raised for errors that are obviously the end-user's fault
(eg. bad command-line arguments).
This module is safe to use in "from ... import *" mode; it... |
maartenq/ansible | refs/heads/devel | lib/ansible/modules/notification/typetalk.py | 78 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... |
agconti/Shopify-Django | refs/heads/master | venv/lib/python2.7/site-packages/django/contrib/gis/db/backends/mysql/creation.py | 613 | from django.db.backends.mysql.creation import DatabaseCreation
class MySQLCreation(DatabaseCreation):
def sql_indexes_for_field(self, model, f, style):
from django.contrib.gis.db.models.fields import GeometryField
output = super(MySQLCreation, self).sql_indexes_for_field(model, f, style)
... |
Arafatk/sympy | refs/heads/master | sympy/matrices/expressions/__init__.py | 86 | """ A module which handles Matrix Expressions """
from .slice import MatrixSlice
from .blockmatrix import BlockMatrix, BlockDiagMatrix, block_collapse, blockcut
from .funcmatrix import FunctionMatrix
from .inverse import Inverse
from .matadd import MatAdd
from .matexpr import (Identity, MatrixExpr, MatrixSymbol, ZeroM... |
aneeshusa/servo | refs/heads/master | tests/wpt/css-tests/css-text-decor-3_dev/html/support/generate-text-emphasis-position-property-tests.py | 841 | #!/usr/bin/env python
# - * - coding: UTF-8 - * -
"""
This script generates tests text-emphasis-position-property-001 ~ 006
which cover all possible values of text-emphasis-position property with
all combination of three main writing modes and two orientations. Only
test files are generated by this script. It also out... |
HUANG-YI-CHEN/jieba | refs/heads/master | test/extract_tags_with_weight.py | 65 | import sys
sys.path.append('../')
import jieba
import jieba.analyse
from optparse import OptionParser
USAGE = "usage: python extract_tags_with_weight.py [file name] -k [top k] -w [with weight=1 or 0]"
parser = OptionParser(USAGE)
parser.add_option("-k", dest="topK")
parser.add_option("-w", dest="withWeight")
opt,... |
kmad1729/website | refs/heads/master | django/core/cache/backends/filebased.py | 229 | "File-based cache backend"
import os
import time
import shutil
try:
import cPickle as pickle
except ImportError:
import pickle
from django.core.cache.backends.base import BaseCache
from django.utils.hashcompat import md5_constructor
class FileBasedCache(BaseCache):
def __init__(self, dir, params):
... |
chuckSMASH/pong | refs/heads/master | setup.py | 1 | import codecs
import os
import re
from setuptools import setup, find_packages
PACKAGE_NAME = 'pong'
PACKAGE_DIR = os.path.dirname(__file__)
SCRIPT_DIR = os.path.join(PACKAGE_DIR, 'bin')
def read(fname):
with codecs.open(fname, 'r', encoding='utf-8') as f:
return f.read()
def get_version(package):
... |
dholm/voidwalker | refs/heads/master | voidwalker/framework/utils/ordereddict.py | 1 | ## {{{ http://code.activestate.com/recipes/576693/ (r9)
# Backport of OrderedDict() class that runs on Python 2.4, 2.5, 2.6, 2.7 and
# pypy.
# Passes Python2.7's test suite and incorporates all the latest updates.
try:
from thread import get_ident as _get_ident
except ImportError:
from dummy_thread import get_... |
neversun/sailfish-hackernews | refs/heads/master | pyPackages/requests-noarch/requests/packages/urllib3/packages/ssl_match_hostname/_implementation.py | 2359 | """The match_hostname() function from Python 3.3.3, essential when using SSL."""
# Note: This file is under the PSF license as the code comes from the python
# stdlib. http://docs.python.org/3/license.html
import re
__version__ = '3.4.0.2'
class CertificateError(ValueError):
pass
def _dnsname_match(dn, host... |
everwind/py-leveldb | refs/heads/master | test/try.py | 43 | #!/usr/bin/python
# Copyright (c) Arni Mar Jonsson.
# See LICENSE for details.
import leveldb, pointless, random, string, itertools, collections
from twisted.internet import reactor, defer, threads
def compare(a, b):
return cmp(a, b)
c = 'bytewise'
c = ('leveldb.BytewiseComparator', compare)
kw = {
'create_if_m... |
dawnpower/nova | refs/heads/master | nova/tests/unit/scheduler/filters/test_pci_passthrough_filters.py | 41 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... |
asmodehn/entityx | refs/heads/master | gtest-1.6.0/test/gtest_xml_output_unittest.py | 397 | #!/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... |
anthgur/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/third_party/pytest/_pytest/outcomes.py | 16 | """
exception classes and constants handling test outcomes
as well as functions creating them
"""
from __future__ import absolute_import, division, print_function
import py
import sys
class OutcomeException(BaseException):
""" OutcomeException and its subclass instances indicate and
contain info about tes... |
live-clones/netgen | refs/heads/master | tests/pytest/test_splinegeo_tensordomainmeshing.py | 1 | from netgen.geom2d import *
def test_tensordomainmeshing():
geo = SplineGeometry()
w = 10
h = 0.01
p = [ (0, 0), (w, 0), (w, h), (0, h) ]
p = [geo.AppendPoint(*px) for px in p]
l0 = geo.Append ( ["line", p[0], p[1]], leftdomain=1, rightdomain=0 )
l1 = geo.Append ( ["line", p[1], p[2]], le... |
clovett/MissionPlanner | refs/heads/master | Lib/unittest/loader.py | 55 | """Loading unittests."""
import os
import re
import sys
import traceback
import types
from functools import cmp_to_key as _CmpToKey
from fnmatch import fnmatch
from . import case, suite
__unittest = True
# what about .pyc or .pyo (etc)
# we would need to avoid loading the same tests multiple times
... |
supersven/intellij-community | refs/heads/master | python/testData/inspections/PyUnresolvedReferencesInspection/DateTodayReturnType/datetime.py | 83 | class datetime(object):
def date(self):
return 'foo'
class date(object):
def __init__(self, year, month, day):
pass
@classmethod
def today(cls):
return date(0, 0, 0)
def strftime(self, fmt):
return 'bar' |
firerszd/kbengine | refs/heads/master | kbe/src/lib/python/Lib/test/doctest_aliases.py | 194 | # Used by test_doctest.py.
class TwoNames:
'''f() and g() are two names for the same method'''
def f(self):
'''
>>> print(TwoNames().f())
f
'''
return 'f'
g = f # define an alias for f
|
iRGBit/QGIS | refs/heads/master | python/plugins/processing/gui/CreateNewScriptAction.py | 17 | # -*- coding: utf-8 -*-
"""
***************************************************************************
CreateNewScriptAction.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
*****************... |
pacoqueen/ginn | refs/heads/master | ginn/formularios/consulta_cartera.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright (C) 2005-2013 Francisco José Rodríguez Bogado #
# (pacoqueen@users.sourceforge.net) #
# ... |
cuongthai/cuongthai-s-blog | refs/heads/master | django/core/management/commands/syncdb.py | 161 | from optparse import make_option
import sys
from django.conf import settings
from django.core.management.base import NoArgsCommand
from django.core.management.color import no_style
from django.core.management.sql import custom_sql_for_model, emit_post_sync_signal
from django.db import connections, router, transaction,... |
wildjan/Flask | refs/heads/master | Work/Trivia - Module 5/env/Lib/site-packages/pip/exceptions.py | 398 | """Exceptions used throughout package"""
class PipError(Exception):
"""Base pip exception"""
class InstallationError(PipError):
"""General exception during installation"""
class UninstallationError(PipError):
"""General exception during uninstallation"""
class DistributionNotFound(InstallationError)... |
CoolCloud/ansible | refs/heads/devel | contrib/inventory/vagrant.py | 150 | #!/usr/bin/env python
"""
Vagrant external inventory script. Automatically finds the IP of the booted vagrant vm(s), and
returns it under the host group 'vagrant'
Example Vagrant configuration using this script:
config.vm.provision :ansible do |ansible|
ansible.playbook = "./provision/your_playbook.yml"
... |
nicole-a-tesla/meetup.pizza | refs/heads/master | pizzaplace/services/yelp_api_response_parser.py | 1 | class YelpApiResponseParser():
def __init__(self, response):
self.response = response.json()
def parse(self):
return {'rating': self.response.get('rating')}
|
kaushik94/python-twitter | refs/heads/master | twitter/api.py | 2 | #!/usr/bin/env python
#
# vim: sw=2 ts=2 sts=2
#
# Copyright 2007 The Python-Twitter Developers
#
# 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... |
sailorsenergy/windb2 | refs/heads/master | windb2/model/wrf/test_config.py | 1 | import unittest
from windb2.model.wrf import config
import os
class TestConfigMethods(unittest.TestCase):
temp_config = None
def testExisting(self):
# Just make sure this doesn't throw a schema exception
config.Windb2WrfConfigParser(os.environ['WINDB2_HOME'] + '/config/windb2-wrf.json')
if _... |
kwailamchan/programming-languages | refs/heads/master | javascript/backbone/backbone-templates/backbone-fileupload/venvs/lib/python2.7/site-packages/django/contrib/gis/geos/prototypes/misc.py | 334 | """
This module is for the miscellaneous GEOS routines, particularly the
ones that return the area, distance, and length.
"""
from ctypes import c_int, c_double, POINTER
from django.contrib.gis.geos.libgeos import GEOM_PTR, GEOS_PREPARE
from django.contrib.gis.geos.prototypes.errcheck import check_dbl, check_string
f... |
RockySteveJobs/python-for-android | refs/heads/master | python-modules/twisted/twisted/internet/gtkreactor.py | 56 | # Copyright (c) 2001-2010 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
This module provides support for Twisted to interact with the PyGTK mainloop.
In order to use this support, simply do the following::
| from twisted.internet import gtkreactor
| gtkreactor.install()
Then use twisted.inte... |
w1ll1am23/home-assistant | refs/heads/dev | tests/components/airly/test_sensor.py | 4 | """Test sensor of Airly integration."""
from datetime import timedelta
from homeassistant.components.airly.sensor import ATTRIBUTION
from homeassistant.const import (
ATTR_ATTRIBUTION,
ATTR_DEVICE_CLASS,
ATTR_ENTITY_ID,
ATTR_ICON,
ATTR_UNIT_OF_MEASUREMENT,
CONCENTRATION_MICROGRAMS_PER_CUBIC_MET... |
claudep/django-linkcheck | refs/heads/master | linkcheck/tests/sampleapp/linklists.py | 3 | from linkcheck import Linklist
from linkcheck.tests.sampleapp.models import Author, Book
class BookLinklist(Linklist):
""" Class to let linkcheck app discover fields containing links """
model = Book
object_filter = {}
html_fields = ['description']
class AuthorLinklist(Linklist):
""" Class to le... |
redbear/micropython | refs/heads/redbear-duo | tests/inlineasm/asmblbx.py | 99 | # test bl and bx instructions
@micropython.asm_thumb
def f(r0):
# jump over the internal functions
b(entry)
label(func1)
add(r0, 2)
bx(lr)
label(func2)
sub(r0, 1)
bx(lr)
label(entry)
bl(func1)
bl(func2)
print(f(0))
print(f(1))
|
feilongfl/micropython | refs/heads/master | tools/make-frozen.py | 34 | #!/usr/bin/env python
#
# Create frozen modules structure for MicroPython.
#
# Usage:
#
# Have a directory with modules to be frozen (only modules, not packages
# supported so far):
#
# frozen/foo.py
# frozen/bar.py
#
# Run script, passing path to the directory above:
#
# ./make-frozen.py frozen > frozen.c
#
# Include ... |
hkawasaki/kawasaki-aio8-1 | refs/heads/gacco2/master | common/djangoapps/monitoring/signals.py | 32 | """
Add receivers for django signals, and feed data into the monitoring system.
If a model has a class attribute 'METRIC_TAGS' that is a list of strings,
those fields will be retrieved from the model instance, and added as tags to
the recorded metrics.
"""
from django.db.models.signals import post_save, post_delete,... |
sparkslabs/kamaelia_ | refs/heads/master | Sketches/AB/Bookmarks-Dev/App/web/bookmarks/output/models.py | 9 | from django.db import models
# Create your models here.
# IMPORTANT: Use the schema provided and not this to generate the database. Default values and utf8 for the rawdata.text field don't work
class programmes(models.Model):
pid = models.CharField(max_length=10,primary_key=True,db_column="pid")
channel ... |
janezhango/BigDataMachineLearning | refs/heads/master | py/ec2_stuff/show_all_ec2_instances.py | 11 | # may need to
# easy_install boto
# if you didn't already
# The AWS* environment variables need to be set (in your .bashrc?)
# you can get them from files in your ~/.ec2 probably, since you need them there
# for running test stuff usually..i.e. good to have .ec2 in your home everywhere
from pprint import pprin... |
zerocool240/plugin.video.amerika | refs/heads/master | servers/allmyvideos.py | 30 | # -*- coding: utf-8 -*-
#------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Conector para allmyvideos adaptadtado a livestream
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#------------------------------------------------------------
import urllib2
import re
def g... |
ghchinoy/tensorflow | refs/heads/master | tensorflow/contrib/data/python/ops/grouping.py | 22 | # 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... |
ovnicraft/openerp-restaurant | refs/heads/master | product_property/__openerp__.py | 6 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2011-2013 Serpent Consulting Services Pvt. Ltd. (<http://serpentcs.com>).
#
# This progr... |
mr-niels-christensen/finna-be-octo-archer | refs/heads/master | briefme/src/main/rdflib/compat.py | 23 | #
# code to simplify supporting older python versions
#
import sys
from decimal import Decimal
if sys.version_info[:2] < (2, 7):
# Pre-2.7 decimal and float did not compare correctly
def numeric_greater(a, b):
if isinstance(a, Decimal) and isinstance(b, float):
return float(a) > b
... |
azumimuo/family-xbmc-addon | refs/heads/master | plugin.video.phstreams/resources/lib/resolvers/veetle.py | 2 | # -*- coding: utf-8 -*-
'''
Genesis Add-on
Copyright (C) 2015 lambda
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any ... |
AltSchool/django | refs/heads/master | tests/i18n/commands/__init__.py | 35 | from django.utils.translation import ugettext as _, ungettext
# Translators: This comment should be extracted
dummy1 = _("This is a translatable string.")
# This comment should not be extracted
dummy2 = _("This is another translatable string.")
# This file has a literal with plural forms. When processed first, makem... |
alex/django-ajax-validation | refs/heads/master | ajax_validation/models.py | 10644 | from django.db import models
# Create your models here.
|
chaosblog/pyload | refs/heads/stable | module/plugins/hoster/MyfastfileCom.py | 12 | # -*- coding: utf-8 -*-
import re
from module.common.json_layer import json_loads
from module.plugins.internal.MultiHoster import MultiHoster, create_getInfo
class MyfastfileCom(MultiHoster):
__name__ = "MyfastfileCom"
__type__ = "hoster"
__version__ = "0.10"
__status__ = "testing"
__pat... |
streamlio/heron | refs/heads/master | integration_test/src/python/integration_test/topology/__init__.py | 2 | """Integration test topologies"""
__all__ = [
'all_grouping',
'basic_one_task'
'bolt_double_emit_tuples',
'fields_grouping',
'global_grouping',
'multi_spouts_multi_tasks',
'none_grouping',
'one_bolt_multi_tasks',
'one_spout_bolt_multi_tasks',
'one_spout_multi_tasks',
'one_spo... |
WouterVH/bots | refs/heads/master | src/bots/usersys/mappings/excel/__init__.py | 14224 | # -*- coding: utf-8 -*-
|
jsaveta/Lance | refs/heads/master | src/rescal/build/lib.linux-x86_64-2.7/setuptools/tests/test_bdist_egg.py | 70 | """develop tests
"""
import sys
import os, re, shutil, tempfile, unittest
import tempfile
import site
from StringIO import StringIO
from distutils.errors import DistutilsError
from setuptools.command.bdist_egg import bdist_egg
from setuptools.command import easy_install as easy_install_pkg
from setuptools.dist import ... |
rohitwaghchaure/erpnext_develop | refs/heads/develop | erpnext/accounts/doctype/bank_reconciliation/__init__.py | 37694 | from __future__ import unicode_literals
|
jbarnes007/python-crowd | refs/heads/master | tests/unittests.py | 1 | # vim: set fileencoding=utf-8 :
# Copyright 2012 Alexander Else <aelse@else.id.au>.
#
# This file is part of the python-crowd library.
#
# python-crowd 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 ve... |
mastbaum/rat-pac | refs/heads/master | python/SCons/Tool/aixcc.py | 19 | """SCons.Tool.aixcc
Tool-specific initialization for IBM xlc / Visual Age C compiler.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The... |
NewCell/Call-Text-v1 | refs/heads/master | jni/pjsip/sources/tests/cdash/cfg_msvc.py | 107 | #
# cfg_msvc.py - MSVC/Visual Studio target configurator
#
# Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.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 2 of the L... |
schwagdawg/pupy | refs/heads/master | client/sources/gen_library_compressed_string.py | 33 | #!/usr/bin/env python
# -*- coding: UTF8 -*-
import StringIO, zipfile, os.path, imp, sys
import marshal
import zlib
def get_encoded_library_string(arch):
filepath=None
if arch=="x86":
filepath=os.path.join("resources","libraryx86.zip")
elif arch=="x64":
filepath=os.path.join("resources","libraryx64.zip")
else:... |
elainenaomi/sciwonc-dataflow-examples | refs/heads/master | dissertation2017/Experiment 1B/instances/8_2_workflow_full_10files_secondary_wmj_1sh_3rs_with_annot_with_proj_3s/mediancpu_0/ConfigDB_MedianCPU_0.py | 1 | HOST = "wfSciwoncGW:enw1989@172.31.25.253:27001,172.31.25.251:27001,172.31.2.76:27001/?authSource=admin"
PORT = ""
USER = ""
PASSWORD = ""
DATABASE = "googlew"
READ_PREFERENCE = "secondary"
WRITE_CONCERN = "majority"
READ_PREFERENCE = "secondary"
WRITE_CONCERN = "majority"
COLLECTION_INPUT = "task_events"
COLLECTION_OU... |
pcwalton/skia | refs/heads/master | platform_tools/android/tradefed/upload_dm_results.py | 68 | #!/usr/bin/env python
# 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.
"""Upload DM output PNG files and JSON summary to Google Storage."""
import datetime
import os
import shutil
import sys
import tempfi... |
stevekinney/electron | refs/heads/master | script/pylint.py | 178 | #!/usr/bin/env python
import glob
import os
import subprocess
import sys
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
def main():
os.chdir(SOURCE_ROOT)
pylint = os.path.join(SOURCE_ROOT, 'vendor', 'depot_tools', 'pylint.py')
settings = ['--rcfile=vendor/depot_tools/pylintrc']
p... |
qsnake/gpaw | refs/heads/master | doc/install/Linux/Niflheim/slid-infiniband.py | 3 | scalapack = True
extra_link_args += ['-cc=gcc']
extra_compile_args += [
'-cc=gcc',
'-O2',
'-m64',
]
libraries = [
'pathfortran',
'gfortran',
'mpiblacsCinit',
'acml',
'mpiblacs',
'scalapack'
]
library_dirs = [
'/opt/pathscale/lib/2.5',
'/opt/acml-4.0.1/gfortran64/lib',
'/usr/local/blacs-1.1-24.... |
zxtstarry/src | refs/heads/master | book/Recipes/dix.py | 3 | from rsf.proj import *
def dix(data, # data name
agc, # migrated image
npk, # migration velocity
smb, # semblance slice
v0, # minimum velocity
vm, # median velocity
nx, # lateral dimension
dx=0.01, # m... |
emrah-b/oclapi | refs/heads/master | django-nonrel/ocl/concepts/views.py | 5 | from django.core.exceptions import ValidationError
from django.db.models import Q
from django.db.models.query import EmptyQuerySet
from django.http import Http404
from django.views.decorators.csrf import csrf_exempt
from rest_framework import mixins, status
from rest_framework.generics import (RetrieveAPIView, get_obje... |
geertj/draco2 | refs/heads/master | draco2/core/filter.py | 1 | # vi: ts=8 sts=4 sw=4 et
#
# filer: output filters
#
# This file is part of Draco2. Draco2 is free software and is made available
# under the MIT license. Consult the file "LICENSE" that is distributed
# together with this file for the exact licensing terms.
#
# Draco2 is copyright (c) 1999-2007 by the Draco2 authors. ... |
proxysh/Safejumper-for-Mac | refs/heads/master | buildmac/Resources/env/lib/python2.7/site-packages/twisted/web/test/test_web.py | 13 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for various parts of L{twisted.web}.
"""
import os
import zlib
from zope.interface import implementer
from zope.interface.verify import verifyObject
from twisted.python import reflect, failure
from twisted.python.compat import _PY3, u... |
Josh-Willhite/proc-serve | refs/heads/master | tests/test_proc_serve.py | 1 | import sys
import json
sys.path.append('../src')
from proc_serve import get_info, proc_to_dict
def test_proc_to_dict():
for proc_file in ['cpuinfo', 'meminfo']:
info_raw = get_info(proc_file)
info = proc_to_dict(info_raw)
with open('./{}.json'.format(proc_file), 'r') as f:
ex... |
Elektropippo/kernel_852i | refs/heads/master | tools/perf/scripts/python/syscall-counts.py | 11181 | # system call counts
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.path.append(os.envir... |
BLQ-Software/black-widow | refs/heads/master | src/blackwidow/parser/__init__.py | 1 | from parser import config_network
|
jotes/pontoon | refs/heads/master | pontoon/translations/views.py | 1 | from django.contrib.auth.decorators import login_required
from django.db import transaction
from django.http import JsonResponse
from django.shortcuts import get_object_or_404
from django.utils import timezone
from django.utils.datastructures import MultiValueDictKeyError
from django.views.decorators.http import requir... |
jamesfolberth/NGC_STEM_camp_AWS | refs/heads/master | notebooks/data8_notebooks/lab05/tests/q1_6.py | 3 | test = {
'name': '',
'points': 1,
'suites': [
{
'cases': [
{
'code': r"""
>>> # Make sure your estimator is subtracting a reasonable value from the mean observation
>>> ok_test_array = make_array(1, 2, 3, 4, 5, 6, 7)
>>> abs(11 - (np.mean(ok_test_array) - ... |
mandrav/bCNC | refs/heads/pospat_regex | CNC.py | 2 | # -*- coding: latin1 -*-
# $Id: CNC.py,v 1.8 2014/10/15 15:03:49 bnv Exp $
#
# Author: vvlachoudis@gmail.com
# Date: 24-Aug-2014
import os
import re
import pdb
import sys
import math
import string
import undo
import Macros
import Unicode
from motionpath import Path, Segment
from dxf import DXF
from bmath impor... |
ukanga/SickRage | refs/heads/master | lib/mako/_ast_util.py | 39 | # mako/_ast_util.py
# Copyright (C) 2006-2015 the Mako authors and contributors <see AUTHORS file>
#
# This module is part of Mako and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""
ast
~~~
The `ast` module helps Python applications to process trees of the Pyth... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.