repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
mavit/ansible | refs/heads/devel | lib/ansible/modules/storage/netapp/na_elementsw_volume_clone.py | 9 | #!/usr/bin/python
# (c) 2018, NetApp, Inc
# GNU General Public License v3.0+ (see COPYING or
# https://www.gnu.org/licenses/gpl-3.0.txt)
"""Element Software volume clone"""
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... |
zozo123/buildbot | refs/heads/master | master/buildbot/test/unit/test_contrib_buildbot_cvs_mail.py | 3 | # This file is part of Buildbot. Buildbot 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, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... |
aioue/ansible | refs/heads/devel | lib/ansible/parsing/splitter.py | 59 | # (c) 2014 James Cammarata, <jcammarata@ansible.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) any late... |
chongtianfeiyu/kbengine | refs/heads/master | kbe/src/lib/python/Lib/xml/etree/cElementTree.py | 876 | # Deprecated alias for xml.etree.ElementTree
from xml.etree.ElementTree import *
|
klaus385/openpilot | refs/heads/devel | selfdrive/controls/lib/alertmanager.py | 1 | from cereal import car, log
from selfdrive.swaglog import cloudlog
from common.realtime import sec_since_boot
import copy
# Priority
class Priority:
HIGH = 3
MID = 2
LOW = 1
LOWEST = 0
AlertSize = log.Live100Data.AlertSize
AlertStatus = log.Live100Data.AlertStatus
class Alert(object):
def __init__(self,
... |
ladybug-analysis-tools/honeybeex | refs/heads/master | plugin/src/occschduleweek_node.py | 3 | # assign inputs
_occHours_, _offHours_, _weekend_, _defValue_ = IN
schedule = values = None
try:
from honeybee.schedule import Schedule
except ImportError as e:
raise ImportError('\nFailed to import honeybee:\n\t{}'.format(e))
schedule = Schedule.from_workday_hours(
_occHours_, _offHours_, _weekend_, _def... |
tinkerinestudio/Tinkerine-Suite | refs/heads/master | TinkerineSuite/python/Lib/numpy/distutils/mingw32ccompiler.py | 76 | """
Support code for building Python extensions on Windows.
# NT stuff
# 1. Make sure libpython<version>.a exists for gcc. If not, build it.
# 2. Force windows to use gcc (we're struggling with MSVC and g77 support)
# 3. Force windows to use g77
"""
import os
import subprocess
import sys
import subp... |
jiezhu2007/scrapy | refs/heads/master | scrapy/spiders/feed.py | 151 | """
This module implements the XMLFeedSpider which is the recommended spider to use
for scraping from an XML feed.
See documentation in docs/topics/spiders.rst
"""
from scrapy.spiders import Spider
from scrapy.utils.iterators import xmliter, csviter
from scrapy.utils.spider import iterate_spider_output
from scrapy.sel... |
infobloxopen/infoblox-netmri | refs/heads/master | infoblox_netmri/api/broker/v3_1_0/job_broker.py | 10 | from ..broker import Broker
class JobBroker(Broker):
controller = "jobs"
def index(self, **kwargs):
"""Lists the available jobs. Any of the inputs listed may be be used to narrow the list; other inputs will be ignored. Of the various ways to query lists, using this method is most efficient.
... |
ctb/cvxpy | refs/heads/master | cvxpy/atoms/lambda_sum_largest.py | 12 | """
Copyright 2013 Steven Diamond
This file is part of CVXPY.
CVXPY 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.
CVXPY is distributed i... |
mrocklin/toolz | refs/heads/master | toolz/tests/test_serialization.py | 9 | from toolz import *
import pickle
def test_compose():
f = compose(str, sum)
g = pickle.loads(pickle.dumps(f))
assert f((1, 2)) == g((1, 2))
def test_curry():
f = curry(map)(str)
g = pickle.loads(pickle.dumps(f))
assert list(f((1, 2, 3))) == list(g((1, 2, 3)))
def test_juxt():
f = juxt(... |
xarus01/clockwork | refs/heads/master | clockwork/wsgi.py | 1 | """
WSGI config for clockwork project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "clockwork.settings")
from django.co... |
arante/pyloc | refs/heads/master | py2/cool-things/rfactorial.py | 2 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# rfactorial.py
# Recursive implementation of factorial.
#
# Author: Billy Wilson Arante
# Created: 2016/06/20 PHT
from sys import argv
def factorial(number):
"""Recursive factorial"""
if number <= 1:
return 1
else:
return number * factorial(... |
raildo/python-keystoneclient | refs/heads/master | keystoneclient/tests/v3/utils.py | 2 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# 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 ... |
emilsvennesson/kodi-viaplay | refs/heads/master | __init__.py | 9 | # dummy file to init the directory
|
darkwing/kuma | refs/heads/master | vendor/packages/logilab/astng/builder.py | 25 | # 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
# under the terms of the GNU Lesser General Public License as publis... |
xuweiliang/Codelibrary | refs/heads/master | nova/policies/extended_status.py | 6 | # Copyright 2016 Cloudbase Solutions Srl
# 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 r... |
apache/incubator-airflow | refs/heads/master | tests/ti_deps/deps/test_trigger_rule_dep.py | 5 | #
# 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... |
uw-it-aca/myuw | refs/heads/master | myuw/test/api/test_resources.py | 1 | # Copyright 2021 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0
import json
from django.urls import reverse
from myuw.dao.user import get_user_model
from myuw.models import ResourceCategoryPin
from myuw.test import get_request_with_user
from myuw.test.api import MyuwApiTest
class TestResources... |
deepsrijit1105/edx-platform | refs/heads/master | lms/djangoapps/course_blocks/api.py | 12 | """
API entry point to the course_blocks app with top-level
get_course_blocks function.
"""
from openedx.core.djangoapps.content.block_structure.api import get_block_structure_manager
from openedx.core.lib.block_structure.transformers import BlockStructureTransformers
from .transformers import (
library_content,
... |
vabue/RatticWeb | refs/heads/master | cred/migrations/0026_auto.py | 7 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding index on 'Cred', fields ['title']
db.create_index('cred_cred', ['title'])
# Adding index o... |
CKboss/VirtualJudgePY | refs/heads/master | Handlers/CrawlerOnlineHandler.py | 1 | import tornado.web
import tornado.gen
import json
import time
from tornado.concurrent import run_on_executor
from concurrent.futures import ThreadPoolExecutor
from Handlers.BaseHandler import BaseHandler
from Config.ParametersConfig import MID_THREAD_POOL_SIZE
from Crawler.BnuVJCrawler.BnuVJCrawler import BnuVJCrawl... |
Ecpy/ecpy | refs/heads/master | tests/app/errors/__init__.py | 803 | # -*- coding: utf-8 -*-
|
Vladkryvoruchko/PSPNet-Keras-tensorflow | refs/heads/master | caffe-tensorflow/kaffe/graph.py | 9 | from google.protobuf import text_format
from .caffe import get_caffe_resolver
from .errors import KaffeError, print_stderr
from .layers import LayerAdapter, LayerType, NodeKind, NodeDispatch
from .shapes import TensorShape
class Node(object):
def __init__(self, name, kind, layer=None):
self.name = name
... |
mtlchun/edx | refs/heads/master | pavelib/utils/test/suites/acceptance_suite.py | 10 | """
Acceptance test suite
"""
from paver.easy import sh, call_task
from pavelib.utils.test import utils as test_utils
from pavelib.utils.test.suites import TestSuite
from pavelib.utils.envs import Env
__test__ = False # do not collect
class AcceptanceTest(TestSuite):
"""
A class for running lettuce acceptan... |
40223210/w16b_test | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/errno.py | 624 | """
This module makes available standard errno system symbols.
The value of each symbol is the corresponding integer value,
e.g., on most systems, errno.ENOENT equals the integer 2.
The dictionary errno.errorcode maps numeric codes to symbol names,
e.g., errno.errorcode[2] could be the string 'ENOENT'.
Symbols that ar... |
ujenmr/ansible | refs/heads/devel | lib/ansible/modules/network/fortios/fortios_log_syslogd_setting.py | 23 | #!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019 Fortinet, Inc.
#
# 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 Lic... |
jopohl/urh | refs/heads/master | tests/data/code.py | 1 | #!/usr/bin/env python3
import os
import sys
from subprocess import call
cur_dir = os.path.dirname(os.path.realpath(__file__))
if sys.argv[1] == "e":
call(sys.executable + ' "' + os.path.join(cur_dir, "encode.py") + '"' + " " + sys.argv[2], shell=True)
elif sys.argv[1] == "d":
call(sys.executable + ' "' + os.... |
intagger/paraproxio | refs/heads/master | paraproxio.py | 1 | #!/usr/bin/env python
"""
Paraproxio is an HTTP proxy with a parallel downloading of big files.
"""
# Copyright (C) 2016 Alexander Logger <intagger@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Softwa... |
SnakeJenny/TensorFlow | refs/heads/master | tensorflow/python/kernel_tests/bcast_ops_test.py | 102 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
GhostThrone/django | refs/heads/master | django/core/cache/backends/filebased.py | 428 | "File-based cache backend"
import errno
import glob
import hashlib
import io
import os
import random
import tempfile
import time
import zlib
from django.core.cache.backends.base import DEFAULT_TIMEOUT, BaseCache
from django.core.files.move import file_move_safe
from django.utils.encoding import force_bytes
try:
f... |
williammc/gtest | refs/heads/master | test/gtest_list_tests_unittest.py | 1898 | #!/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... |
webgeodatavore/django | refs/heads/master | tests/requests/tests.py | 87 | # -*- encoding: utf-8 -*-
from __future__ import unicode_literals
import time
from datetime import datetime, timedelta
from io import BytesIO
from itertools import chain
from django.core.exceptions import SuspiciousOperation
from django.core.handlers.wsgi import LimitedStream, WSGIRequest
from django.http import (
... |
wimnat/ansible-modules-extras | refs/heads/devel | windows/win_scheduled_task.py | 12 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 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.
#
... |
oplinkoms/onos | refs/heads/master | tools/test/topos/uk.py | 4 | #!/usr/bin/env python
"""
"""
from mininet.topo import Topo
class UkTopo( Topo ):
"""Switches projected onto the UK map"""
def addSwitch( self, name, **opts ):
kwargs = { 'protocols' : 'OpenFlow13' }
kwargs.update( opts )
return super(UkTopo, self).addSwitch( name, **kwargs )
def... |
wwj718/edx-video | refs/heads/master | cms/djangoapps/contentstore/views/user.py | 8 | import json
from django.conf import settings
from django.core.exceptions import PermissionDenied
from django.core.urlresolvers import reverse
from django.contrib.auth.models import User, Group
from django.contrib.auth.decorators import login_required
from django.views.decorators.http import require_http_methods
from dj... |
FreekingDean/insteon-hub | refs/heads/master | insteon/api.py | 1 | from urllib.parse import urlencode
from threading import Lock
import json
import sys
import requests
import time
API_URL = "https://connect.insteon.com"
class APIError(Exception):
"""API Error Response
Attributes:
msg -- the error message
code -- the error code
"""
def __init__(self, ... |
Azure/azure-sdk-for-python | refs/heads/sync-eng/common-js-nightly-docs-2-1768-ForTestPipeline | sdk/cognitiveservices/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/_news_search_client_enums.py | 1 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... |
Celedhrim/persomov | refs/heads/master | couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/firstpost.py | 35 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
class FirstpostIE(InfoExtractor):
_VALID_URL = r'http://(?:www\.)?firstpost\.com/[^/]+/.*-(?P<id>[0-9]+)\.html'
_TEST = {
'url': 'http://www.firstpost.com/india/india-to-launch-indigenous-aircraft-carrier-monday-102... |
unaizalakain/django | refs/heads/master | tests/gis_tests/geo3d/views.py | 6027 | # Create your views here.
|
rabipanda/tensorflow | refs/heads/master | tensorflow/contrib/py2tf/converters/continue_canonicalization.py | 2 | # 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... |
Qalthos/ansible | refs/heads/devel | test/units/modules/cloud/docker/test_docker_swarm_service.py | 15 | import pytest
class APIErrorMock(Exception):
def __init__(self, message, response=None, explanation=None):
self.message = message
self.response = response
self.explanation = explanation
@pytest.fixture(autouse=True)
def docker_module_mock(mocker):
docker_module_mock = mocker.MagicMoc... |
praekeltfoundation/docker-xylem | refs/heads/master | twisted/plugins/docker_xylem_plugin.py | 1 | import yaml
from zope.interface import implements
from twisted.python import filepath, usage
from twisted.plugin import IPlugin
from twisted.application.service import IServiceMaker
from twisted.application import internet
from twisted.web import server
from docker_xylem import service
class Options(usage.Options)... |
Ictp/indico | refs/heads/master | bin/migration/mapAspects.py | 1 | # -*- coding: utf-8 -*-
##
##
## This file is part of Indico.
## Copyright (C) 2002 - 2014 European Organization for Nuclear Research (CERN).
##
## Indico 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; eith... |
web30s/odoo-9.0c-20160402 | refs/heads/master | hello/templates/openerp/addons/bus/models/__init__.py | 67 | # -*- coding: utf-8 -*-
import bus
import bus_presence
import res_users
import res_partner
|
CacaoMovil/guia-de-cacao-django | refs/heads/master | cacao_app/cacao/templatetags/cacao_tags.py | 1 | from pyquery import PyQuery as pq
from django import template
from django.conf import settings
from django.core.cache import get_cache
cache = get_cache('default')
register = template.Library()
@register.simple_tag
def settings_value(name):
'''
{% settings_value "LANGUAGE_CODE" %}
'''
return getattr... |
PieterMostert/Lipgloss | refs/heads/master | view/other_restriction_editor.py | 1 | # LIPGLOSS - Graphical user interface for constructing glaze recipes
# Copyright (C) 2017 Pieter Mostert
# 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, version 3 of the License.
# This progra... |
ilexius/odoo | refs/heads/master | addons/mrp_byproduct/__init__.py | 45 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import mrp_byproduct
|
robmadole/jig | refs/heads/develop | src/jig/commands/tests/test_install.py | 1 | # coding=utf-8
from os.path import join
from textwrap import dedent
from jig.exc import ForcedExit
from jig.tests.testcase import (
CommandTestCase, PluginTestCase, cd_gitrepo, result_with_hint)
from jig.commands.hints import USE_RUNNOW
from jig.commands import install
class TestInstallCommand(CommandTestCase, P... |
tracierenea/gnuradio | refs/heads/master | gr-digital/python/digital/gmsk.py | 7 | #
# GMSK modulation and demodulation.
#
#
# Copyright 2005-2007,2012 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 v... |
shaufi10/odoo | refs/heads/8.0 | openerp/addons/base/module/wizard/__init__.py | 365 | # -*- 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... |
mschmittfull/nbodykit | refs/heads/master | nbodykit/core/algorithms/PairCountCorrelation.py | 2 | from nbodykit.core import Algorithm, DataSource
import numpy
import os
def binning_type(s):
"""
Type conversion for use on the command-line that converts
a string to an array of bin edges
"""
if os.path.isfile(s):
return numpy.loadtxt(s)
else:
supported = ["`linspace: min max N... |
teslaji/homebase | refs/heads/master | venv/HomeBase/lib/python3.5/site-packages/django/views/static.py | 46 | """
Views and functions for serving static files. These are only to be used
during development, and SHOULD NOT be used in a production setting.
"""
from __future__ import unicode_literals
import mimetypes
import os
import posixpath
import re
import stat
from django.http import (
FileResponse, Http404, HttpRespons... |
sharad/calibre | refs/heads/master | src/calibre/gui2/actions/choose_library.py | 1 | #!/usr/bin/env python
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
__license__ = 'GPL v3'
__copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import os, posixpath, weakref
from functools import partial
from PyQt5.Qt import (QMenu, Qt, QInputDialog, QToolButton, QD... |
chengduoZH/Paddle | refs/heads/develop | python/paddle/fluid/tests/unittests/test_box_coder_op.py | 5 | # Copyright (c) 2018 PaddlePaddle 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 app... |
VHAINNOVATIONS/DmD | refs/heads/master | scrubber/MIST_2_0_4/src/CherryPy-3.1.2/cherrypy/_cpchecker.py | 13 | import os
import warnings
import cherrypy
class Checker(object):
"""A checker for CherryPy sites and their mounted applications.
on: set this to False to turn off the checker completely.
When this object is called at engine startup, it executes each
of its own methods whose names start with... |
sorenk/ansible | refs/heads/devel | lib/ansible/plugins/action/assemble.py | 16 | # (c) 2013-2016, Michael DeHaan <michael.dehaan@gmail.com>
# Stephen Fromm <sfromm@gmail.com>
# Brian Coca <briancoca+dev@gmail.com>
# Toshio Kuratomi <tkuratomi@ansible.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under t... |
wweiradio/django | refs/heads/master | tests/auth_tests/backend_alias.py | 512 | # For testing that auth backends can be referenced using a convenience import
from .test_auth_backends import ImportedModelBackend
__all__ = ['ImportedModelBackend']
|
stefanseefeld/qmtest | refs/heads/master | qm/external/DocumentTemplate/DT_If.py | 2 | ##############################################################################
#
# Copyright (c) 2002 Zope Corporation and Contributors. All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFT... |
denisenkom/django | refs/heads/master | tests/generic_views/test_detail.py | 10 | from __future__ import unicode_literals
from django.core.exceptions import ImproperlyConfigured
from django.test import TestCase
from django.views.generic.base import View
from .models import Artist, Author, Page
class DetailViewTest(TestCase):
fixtures = ['generic-views-test-data.json']
urls = 'generic_vie... |
ChungChe/pyamazonclouddrive | refs/heads/master | bin/acdput.py | 10 | #!/usr/bin/env python
#
# Copyright (c) 2011 anatanokeitai.com(sakurai_youhei)
#
# 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 right... |
limbail/ceamon | refs/heads/master | pandorabox/todo/system_info.py | 1 | from tornado.ioloop import PeriodicCallback
from swampdragon.pubsub_providers.data_publisher import publish_data
import psutil
import requests, json
from ceamon.models import sapnode
url = "http://localhost:9988/sapnode/"
pcb = None
def broadcast_sys_info():
global pcb
if pcb is None:
pcb = Periodic... |
lmorchard/django | refs/heads/master | tests/postgres_tests/array_default_migrations/0001_initial.py | 377 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import django.contrib.postgres.fields
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='IntegerArrayDefaultModel',
... |
gerald-yang/ubuntu-iotivity-demo | refs/heads/master | snappy/grovepi/pygrovepi/grove_electricity_sensor.py | 7 | #!/usr/bin/env python
#
# GrovePi Example for using the Grove Electricity Sensor (http://www.seeedstudio.com/wiki/Grove_-_Electricity_Sensor)
#
# The GrovePi connects the Raspberry Pi and Grove sensors. You can learn more about GrovePi here: http://www.dexterindustries.com/GrovePi
#
# Have a question about this examp... |
tomquas/mongrel2 | refs/heads/master | examples/python/mongrel2/config/commands.py | 90 | from mongrel2 import config
from mongrel2.config import args
import mongrel2.config.commands
from uuid import uuid4
from mongrel2.config import model
import getpass
import sys
import os
import signal
from sqlite3 import OperationalError
def try_reading(reader):
try:
cmd = reader.readline()
return ... |
smalls257/VRvisu | refs/heads/master | Library/External.LCA_RESTRICTED/Languages/CPython/27/Lib/test/test_difflib.py | 87 | import difflib
from test.test_support import run_unittest, findfile
import unittest
import doctest
import sys
class TestWithAscii(unittest.TestCase):
def test_one_insert(self):
sm = difflib.SequenceMatcher(None, 'b' * 100, 'a' + 'b' * 100)
self.assertAlmostEqual(sm.ratio(), 0.995, places=3)
... |
globocom/database-as-a-service | refs/heads/master | dbaas/physical/migrations/0100_auto__del_field_pool_endpoint__add_field_pool_rancher_endpoint__add_fi.py | 1 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting field 'Pool.endpoint'
db.delete_column(u'physical_pool', 'endp... |
EightMedia/djangopypi | refs/heads/master | djangopypi/admin.py | 3 | from django.conf import settings
from django.contrib import admin
from djangopypi.models import *
admin.site.register(Package)
admin.site.register(Release)
admin.site.register(Classifier)
admin.site.register(Distribution)
admin.site.register(Review)
if getattr(settings,'DJANGOPYPI_MIRRORING', False):
admin.sit... |
sahiljain/catapult | refs/heads/master | third_party/py_vulcanize/third_party/rjsmin/_setup/py2/dist.py | 43 | # -*- coding: ascii -*-
#
# Copyright 2007, 2008, 2009, 2010, 2011
# Andr\xe9 Malo or his licensors, as applicable
#
# 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.or... |
zorojean/scikit-learn | refs/heads/master | sklearn/tests/test_base.py | 216 | # Author: Gael Varoquaux
# License: BSD 3 clause
import numpy as np
import scipy.sparse as sp
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_false
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing impo... |
wubr2000/googleads-python-lib | refs/heads/master | examples/dfp/v201505/user_service/get_all_roles.py | 4 | #!/usr/bin/python
#
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... |
bellowsj/aiopogo | refs/heads/master | aiopogo/pogoprotos/data/avatar/avatar_item_pb2.py | 1 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: pogoprotos/data/avatar/avatar_item.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf ... |
Chuban/moose | refs/heads/devel | python/TestHarness/XMLDiffer.py | 4 | import os, traceback
import xml.etree.ElementTree as xml
##
# Stores error information needed for printing diff messages
class XMLError(object):
##
# Constructor.
# @param err A one line error message
# @param msg A detailed message describing the error
def __init__(self, err, msg):
self.e... |
anushreejangid/csmpe-main | refs/heads/master | csmpe/core_plugins/csm_install_operations/ios_xe/activate.py | 1 | # =============================================================================
#
# Copyright (c) 2016, Cisco Systems
# 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 ... |
abogeorge/simpleTicket | refs/heads/master | simpleTicket/siteEngine/urls.py | 1 | from django.conf.urls import patterns, url
from . import views
urlpatterns = [
# Index Page
url(r'^$', views.index, name='index'),
# User auth Page
url(r'^login/$', views.login, name='login'),
url(r'^login_auth/$', views.login_auth, name="login_auth"),
url(r'^logout/$', views.logout, name='logout'),
# Ac... |
Austin503/pyglet | refs/heads/master | examples/joystick.py | 29 | #!/usr/bin/env python
'''
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
import pyglet
from pyglet.gl import *
joysticks = pyglet.input.get_joysticks()
assert joysticks, 'No joystick device is connected'
joystick = joysticks[0]
joystick.open()
window = pyglet.window.Window()
@window.event
def on_dr... |
dhorelik/django-cms | refs/heads/develop | cms/south_migrations/0019_public_table_renames.py | 1680 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
try:
from django.contrib.auth import get_user_model
except ImportError: # django < 1.5
from django.contrib.auth.models import User
else:
User = get_user_model()
user_orm_label... |
jmerkow/VTK | refs/heads/master | Examples/GUI/Python/ImageTracerWidget.py | 22 | #!/usr/bin/env python
# initial translation from the tcl by VTK/Utilities/tcl2py.py
# further cleanup and fixes to the translation by Charl P. Botha
import vtk
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()
# This example demonstrates how to use the vtkImageTracerWidget
# to trace on a sli... |
gangadhar-kadam/verve-erp | refs/heads/v5.0 | erpnext/stock/doctype/item_customer_detail/item_customer_detail.py | 41 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class ItemCustomerDetail(Document):
pass |
bitcity/django | refs/heads/master | django/core/mail/backends/dummy.py | 835 | """
Dummy email backend that does nothing.
"""
from django.core.mail.backends.base import BaseEmailBackend
class EmailBackend(BaseEmailBackend):
def send_messages(self, email_messages):
return len(list(email_messages))
|
CourseTalk/edx-platform | refs/heads/master | lms/djangoapps/rss_proxy/models.py | 65 | """
Models for the rss_proxy djangoapp.
"""
from django.db import models
from model_utils.models import TimeStampedModel
class WhitelistedRssUrl(TimeStampedModel):
"""
Model for persisting RSS feed URLs which are whitelisted
for proxying via this rss_proxy djangoapp.
"""
url = models.CharField(max... |
ojengwa/oh-mainline | refs/heads/master | vendor/packages/Django/tests/regressiontests/test_runner/models.py | 132 | from django.db import models
class Person(models.Model):
first_name = models.CharField(max_length=20)
last_name = models.CharField(max_length=20)
|
analurandis/Tur | refs/heads/master | backend/venv/Lib/site-packages/babel/messages/catalog.py | 86 | # -*- coding: utf-8 -*-
"""
babel.messages.catalog
~~~~~~~~~~~~~~~~~~~~~~
Data structures for message catalogs.
:copyright: (c) 2013 by the Babel Team.
:license: BSD, see LICENSE for more details.
"""
import re
import time
from cgi import parse_header
from datetime import datetime, time as time_... |
NINAnor/QGIS | refs/heads/master | python/plugins/processing/algs/qgis/SimplifyGeometries.py | 10 | # -*- coding: utf-8 -*-
"""
***************************************************************************
SimplifyGeometries.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
********************... |
playpauseandstop/aiohttp | refs/heads/master | examples/web_ws.py | 4 | #!/usr/bin/env python3
"""Example for aiohttp.web websocket server
"""
import asyncio
import os
from aiohttp.web import (Application, Response, WebSocketResponse, WSMsgType,
run_app)
WS_FILE = os.path.join(os.path.dirname(__file__), 'websocket.html')
async def wshandler(request):
resp... |
koobonil/Boss2D | refs/heads/master | Boss2D/addon/tensorflow-1.2.1_for_boss/tensorflow/python/layers/utils_test.py | 63 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
keflavich/pyspeckit-obsolete | refs/heads/master | pyspeckit/spectrum/readers/readcol.py | 3 | """
readcol.py by Adam Ginsburg (keflavich@gmail.com)
readcol is meant to emulate IDL's readcol.pro, but is more capable and
flexible. It is not a particularly "pythonic" program since it is not modular.
For a modular ascii table reader, http://cxc.harvard.edu/contrib/asciitable/ is
probably better. This single-func... |
nicolasnoble/grpc | refs/heads/master | src/python/grpcio/grpc/_interceptor.py | 15 | # Copyright 2017 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... |
PetukhovVictor/compiler | refs/heads/master | src/Compiler/ASM/Codegen/expressions/arithmetic.py | 1 | from ...Core.registers import Registers
from ...Core.commands import Commands
from ...Core.types import Types
from ...Runtime.gc import GC
""" Map: arithmetic operator in programming language = arithmetic operator in ASM """
binop_compare_map = {
'+': {
'operator': Commands.ADD,
'operands': [Regist... |
kisiel/django-oscar-przelewy24 | refs/heads/master | przelewy24/views.py | 1 | import json
import requests
import logging
import hashlib
from decimal import Decimal as D
from django.contrib import messages
from django.core.urlresolvers import reverse
from django.http import Http404, HttpResponseRedirect
from django.shortcuts import get_object_or_404
from django.utils.decorators import method_dec... |
takis/django | refs/heads/master | tests/responses/tests.py | 226 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf import settings
from django.http import HttpResponse
from django.http.response import HttpResponseBase
from django.test import SimpleTestCase
UTF8 = 'utf-8'
ISO88591 = 'iso-8859-1'
class HttpResponseBaseTests(SimpleTestCase):
def ... |
puiterwijk/product-definition-center | refs/heads/master | pdc/apps/changeset/tests.py | 4 | #
# Copyright (c) 2015 Red Hat
# Licensed under The MIT License (MIT)
# http://opensource.org/licenses/MIT
#
from mock import Mock, call, patch
from django.test import TestCase
from django.core.urlresolvers import reverse
from rest_framework import status
from rest_framework.test import APITestCase
from .middleware ... |
MobileWebApps/backend-python-rest-gae | refs/heads/master | lib/markdown/extensions/toc.py | 19 | """
Table of Contents Extension for Python-Markdown
* * *
(c) 2008 [Jack Miller](http://codezen.org)
Dependencies:
* [Markdown 2.1+](http://packages.python.org/Markdown/)
"""
from __future__ import absolute_import
from __future__ import unicode_literals
from . import Extension
from ..treeprocessors import Treeproce... |
jobscore/sync-engine | refs/heads/master | inbox/models/mixins.py | 2 | import abc
from datetime import datetime
from sqlalchemy import Column, DateTime, String, inspect, Boolean, sql, func
from sqlalchemy.ext.hybrid import hybrid_property, Comparator
from inbox.sqlalchemy_ext.util import Base36UID, generate_public_id, ABCMixin
from inbox.models.constants import MAX_INDEXABLE_LENGTH
from... |
Khan/tinyquery | refs/heads/master | tinyquery/api_client_test.py | 1 | from __future__ import absolute_import
import unittest
from tinyquery import api_client
from tinyquery import tq_types
from tinyquery import tinyquery
class ApiClientTest(unittest.TestCase):
def setUp(self):
self.tinyquery = tinyquery.TinyQuery()
self.tq_service = api_client.TinyQueryApiClient(s... |
vmthunder/nova | refs/heads/master | nova/network/security_group/openstack_driver.py | 5 | # Copyright 2013 Nicira, Inc.
# All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... |
Superjom/models-1 | refs/heads/develop | fluid/image_classification/mobilenet.py | 1 | import os
import paddle.v2 as paddle
import paddle.fluid as fluid
from paddle.fluid.initializer import MSRA
from paddle.fluid.param_attr import ParamAttr
parameter_attr = ParamAttr(initializer=MSRA())
def conv_bn_layer(input,
filter_size,
num_filters,
stride,
... |
carlitosvi/django-jquery-file-upload | refs/heads/master | fileupload/templatetags/upload_tags.py | 14 | from django import template
register = template.Library()
@register.simple_tag
def upload_js():
return """
<!-- The template to display files available for upload -->
<script id="template-upload" type="text/x-tmpl">
{% for (var i=0, file; file=o.files[i]; i++) { %}
<tr class="template-upload fade">
<t... |
guyb17/class1 | refs/heads/master | ex10_parse-nonAES.py | 1 | #! /usr/bin/env python
from ciscoconfparse import CiscoConfParse
c_cfg = CiscoConfParse("cisco_ipsec.txt")
cryp_map = c_cfg.find_objects_wo_child(parentspec=r"^crypto map CRYPTO", childspec=r"set transform-set AES-SHA")
for element in cryp_map:
print element.text
for child in element.children:
p... |
un33k/CouchPotatoServer | refs/heads/master | libs/pyutil/scripts/memdump2dot.py | 106 | #!/usr/bin/env python
import bindann
bindann.install_exception_handler()
import sys
inf = open(sys.argv[1], "r")
outf = open(sys.argv[1]+".dot", "w")
outf.write("digraph %s {\n" % sys.argv[1].replace(".",""))
def parse_netstring(l, i):
try:
j = l.find(':', i)
if j == -1:
return (Non... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.