repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
harmsm/roboDOD | refs/heads/master | rpyBot/devices/gpio/rangefinder.py | 2 |
import time
from . import hardware, GPIORobotDevice
class RangeFinder(GPIORobotDevice):
"""
Class wrapping a GPIO range finder.
"""
def __init__(self,trigger_pin,echo_pin,name=None,timeout=5000):
"""
Initialize ranging system.
trigger_pin and echo_pin set GPIO pins.
... |
aricchen/openHR | refs/heads/master | openerp/addons/project/__init__.py | 436 | # -*- 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... |
buckket/PyRfK | refs/heads/master | lib/rfk/site/streaming.py | 4 | from flask import Blueprint
from flask.ext.login import login_required, current_user
from flask.ext.babel import to_user_timezone, to_utc
streaming = Blueprint('streaming', __name__)
# What's that supposed do to?
@streaming.route('/nowplaying')
def now_playing():
return ''
|
paweljasinski/ironpython3 | refs/heads/master | Src/StdLib/Lib/lib2to3/tests/test_parser.py | 6 | """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 from both Python 2 and P... |
wcwu/bitcoin | refs/heads/master | qa/rpc-tests/test_framework/socks5.py | 182 | # Copyright (c) 2015 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Dummy Socks5 server for testing.
'''
from __future__ import print_function, division, unicode_literals
import socket, threading, Q... |
c7zero/chipsec | refs/heads/master | chipsec/modules/tools/vmm/venom.py | 8 | #CHIPSEC: Platform Security Assessment Framework
#Copyright (c) 2010-2015, Intel Corporation
#
#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 2.
#
#This program is distributed in the hope... |
fabiomontefuscolo/reciclapy | refs/heads/master | music.py | 1 | # -*- coding: utf-8 -*-
import pygame
import sys
from pygame.locals import *
from pygame.mixer import *
class Music:
alert = 'sounds/alert.ogg'
beginning = 'sounds/beginning.ogg'
enviroment1 = 'sounds/enviroment1.ogg'
enviroment2 = 'sounds/enviroment2.ogg'
enviroment3 = 'sounds/enviroment3.ogg'
... |
avielman/IU-SCRUM | refs/heads/master | back-end/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs_test.py | 2687 | #!/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.
""" Unit tests for the msvs.py file. """
import gyp.generator.msvs as msvs
import unittest
import StringIO
class TestSequenceFunctions(uni... |
datacommonsorg/data | refs/heads/master | scripts/eurostat/regional_statistics_by_nuts/population_density/csv_template_mcf_compatibility_checker.py | 5 | # 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
martindisch/pytry | refs/heads/master | distribute.py | 1 | def get_input():
items = []
print (
"Enter the runtimes of your files in the order you plan on watching"
" them.\nOptionally you can add the number of times an episode of the "
"same length\nappears. Type \"done\" or press enter again to finish."
)
while True:
inp = input... |
tafaRU/account-invoicing | refs/heads/8.0 | __unported__/stock_invoice_picking_incoterm/__openerp__.py | 3 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2014 Agile Business Group sagl
# (<http://www.agilebg.com>)
# @author Alex Comba <alex.comba@agilebg.com>
#
# This program is free software: you can redistribute it and/or modify
# it ... |
stanley-cheung/grpc | refs/heads/master | src/python/grpcio_tests/tests_aio/unit/auth_context_test.py | 10 | # Copyright 2020 The 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 writ... |
QUANTAXIS/QUANTAXIS | refs/heads/master | QUANTAXIS/QAFetch/QAThs.py | 2 | # coding:utf-8
#
# The MIT License (MIT)
#
# Copyright (c) 2016-2021 yutiansut/QUANTAXIS
#
# 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 th... |
thechampanurag/django-oscar | refs/heads/master | src/oscar/apps/promotions/admin.py | 32 | from django.contrib import admin
from oscar.apps.promotions.models import Image, MultiImage, RawHTML, \
HandPickedProductList, OrderedProduct, AutomaticProductList, TabbedBlock, \
PagePromotion, KeywordPromotion, SingleProduct
class OrderProductInline(admin.TabularInline):
model = OrderedProduct
class ... |
vaultcoin/VaultCoin | refs/heads/master | contrib/testgen/gen_base58_test_vectors.py | 1064 | #!/usr/bin/env python
'''
Generate valid and invalid base58 address and private key test vectors.
Usage:
gen_base58_test_vectors.py valid 50 > ../../src/test/data/base58_keys_valid.json
gen_base58_test_vectors.py invalid 50 > ../../src/test/data/base58_keys_invalid.json
'''
# 2012 Wladimir J. van der Laan
# R... |
Felix5721/voc | refs/heads/master | tests/structures/test_function.py | 1 | from ..utils import TranspileTestCase
class FunctionTests(TranspileTestCase):
def test_function(self):
self.assertCodeExecution("""
def myfunc(value):
print(value * 3)
return value + 5
print("value =", myfunc(5))
print('Done.')
... |
xujb/odoo | refs/heads/8.0 | openerp/osv/expression.py | 65 | # -*- 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... |
google/ldif | refs/heads/master | ldif/results/make_unseen_results.py | 1 | # 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
TakayukiSakai/tensorflow | refs/heads/master | tensorflow/python/ops/linalg_grad.py | 2 | # 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... |
slevenhagen/odoomrp-wip-npg | refs/heads/8.0 | mrp_production_capacity/__init__.py | 4 | # -*- encoding: utf-8 -*-
##############################################################################
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the... |
acecheese/CloudBot | refs/heads/master | plugins/admin_bot.py | 24 | import asyncio
import re
from cloudbot import hook
@asyncio.coroutine
@hook.command("groups", "listgroups", "permgroups", permissions=["permissions_users"], autohelp=False)
def get_permission_groups(conn):
"""- lists all valid groups
:type conn: cloudbot.client.Client
"""
return "Valid groups: {}".fo... |
stsquad/Gwibber | refs/heads/bzr/mainline | gwibber/microblog/jaiku.py | 1 |
"""
Jaiku interface for Gwibber
SegPhault (Ryan Paul) - 01/05/2008
"""
from . import can, support
import urllib2, urllib, re, simplejson, urlparse
PROTOCOL_INFO = {
"name": "Jaiku",
"version": 0.1,
"config": [
"private:password",
"username",
"message_color",
"comment_color",
"receive_e... |
Pal3love/otRebuilder | refs/heads/master | setup.py | 1 | #!/usr/bin/env python
# -*- coding:utf-8 -*-
from setuptools import setup, find_packages
setup(
name = "otrebuilder",
version = "1.5.6",
description = "A simple tool for OpenType standardization with multi-language support, powered by fontTools.",
author = "Pal3love",
author_email = "pal3love@gma... |
jenskutilek/Glyphs-Scripts | refs/heads/master | Effects/Ribbonize.py | 1 | #for i in range(0x1D00, 0x1DC0):
# print "uni%04X" % i
#FLM: jkRibbonize
# Farbbandeffekt
# (C) Jens Kutilek 2009
# Einstellungen
# Schrittweite der einzelnen Rasterpunkte in units
resx = 20
resy = 20
# Minimaler und maximaler Radius der Rasterpunkte in units
lmin = 6
lmax = 17
# Streuung der einzelnen Rasterpunkt... |
ff94315/hiwifi-openwrt-HC5661-HC5761 | refs/heads/master | staging_dir/target-mipsel_r2_uClibc-0.9.33.2/usr/lib/python2.7/idlelib/GrepDialog.py | 81 | import os
import fnmatch
import sys
from Tkinter import *
from idlelib import SearchEngine
from idlelib.SearchDialogBase import SearchDialogBase
def grep(text, io=None, flist=None):
root = text._root()
engine = SearchEngine.get(root)
if not hasattr(engine, "_grepdialog"):
engine._grepdialog = GrepD... |
houssemFat/MeeM-Dev | refs/heads/master | student/apps/courses/documents/apps.py | 1 | from django.apps import AppConfig
class AppConfig(AppConfig):
label = 'student_apps_courses_documents'
name = 'student.apps.courses.documents'
verbose_name = "student videos apps" |
Onetaway/YouCompleteMe | refs/heads/master | python/ycm/client/completion_request.py | 4 | #!/usr/bin/env python
#
# Copyright (C) 2013 Google Inc.
#
# This file is part of YouCompleteMe.
#
# YouCompleteMe 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 you... |
allotria/intellij-community | refs/heads/master | python/helpers/py3only/docutils/parsers/rst/languages/it.py | 52 | # $Id: it.py 7119 2011-09-02 13:00:23Z milde $
# Authors: Nicola Larosa <docutils@tekNico.net>;
# Lele Gaifax <lele@seldati.it>
# Copyright: This module has been placed in the public domain.
# Beware: the italian translation of the reStructuredText documentation
# at http://docit.bice.dyndns.org/static/ReST, ... |
tfahl/printfo | refs/heads/master | local_scripts/runner.py | 1 | import subprocess
cmd = "wget "
URL = ".cce.oregonstate.edu"
printer1 = 'owen335-prn'
printer2 = 'owen-color'
p = subprocess.Popen(cmd + printer1 + URL, shell=True )
p = subprocess.Popen(cmd + printer2 + URL, shell=True)
|
stregoika/aislib | refs/heads/master | ais/expandais.py | 1 | #!/usr/bin/env python
__version__ = '$Revision: 4820 $'.split()[1]
__date__ = '$Date: 2006-09-28 12:11:51 -0400 (Thu, 28 Sep 2006) $'.split()[1]
__author__ = 'Kurt Schwehr'
__doc__='''
Expand structs in ais xml to include-struct elements while applying name mangling
@requires: U{lxml<http://codespeak.net/lxml/>}
@re... |
trudikampfschaf/flask-microblog | refs/heads/master | flask/lib/python2.7/site-packages/werkzeug/contrib/wrappers.py | 318 | # -*- coding: utf-8 -*-
"""
werkzeug.contrib.wrappers
~~~~~~~~~~~~~~~~~~~~~~~~~
Extra wrappers or mixins contributed by the community. These wrappers can
be mixed in into request objects to add extra functionality.
Example::
from werkzeug.wrappers import Request as RequestBase
fr... |
brianjgeiger/osf.io | refs/heads/develop | scripts/analytics/migrate_analytics.py | 7 | # A script to migrate old keen analytics to a new collection, generate in-between points for choppy
# data, or a little of both
import os
import csv
import copy
import pytz
import logging
import argparse
import datetime
from dateutil.parser import parse
from keen.client import KeenClient
from website.settings import ... |
payamsm/django-allauth | refs/heads/master | allauth/socialaccount/providers/base.py | 53 | from django.utils.encoding import python_2_unicode_compatible
from allauth.socialaccount import app_settings
from allauth.account.models import EmailAddress
from ..models import SocialApp, SocialAccount, SocialLogin
from ..adapter import get_adapter
class AuthProcess(object):
LOGIN = 'login'
CONNECT = 'conn... |
switchboardOp/ansible | refs/heads/devel | lib/ansible/plugins/connection/chroot.py | 44 | # Based on local.py (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2013, Maykel Moya <mmoya@speedyrails.com>
# (c) 2015, Toshio Kuratomi <tkuratomi@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 ... |
r4fek/django-cassandra-engine | refs/heads/master | testproject/settings/base.py | 1 | """
Django settings for testproject project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ..... |
vincentleeuwen/followfrenzy | refs/heads/master | followfrenzy/wsgi.py | 1 | """
WSGI config for followfrenzy 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.6/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "followfrenzy.settings")
from dja... |
seckcoder/lang-learn | refs/heads/master | python/sklearn/examples/linear_model/plot_ols.py | 3 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
Linear Regression Example
=========================================================
This example uses the only the first feature of the `diabetes` dataset, in
order to illustrate a two-dimensional plot of this regre... |
alxgu/ansible-modules-extras | refs/heads/devel | packaging/language/pear.py | 157 | #!/usr/bin/python -tt
# -*- coding: utf-8 -*-
# (c) 2012, Afterburn <http://github.com/afterburn>
# (c) 2013, Aaron Bull Schaefer <aaron@elasticdog.com>
# (c) 2015, Jonathan Lestrelin <jonathan.lestrelin@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# i... |
geminy/aidear | refs/heads/master | oss/qt/qt-everywhere-opensource-src-5.9.0/qtwebengine/src/3rdparty/chromium/tools/grit/grit/format/policy_templates/writers/plist_strings_writer.py | 44 | #!/usr/bin/env python
# Copyright (c) 2012 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.
from grit.format.policy_templates.writers import plist_helper
from grit.format.policy_templates.writers import template_writer
d... |
devoid/nova | refs/heads/sheepdog-nova-support | nova/tests/pci/test_pci_stats.py | 16 | # Copyright (c) 2012 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... |
daviddrysdale/python-phonenumbers | refs/heads/dev | python/phonenumbers/shortdata/region_BS.py | 1 | """Auto-generated file, do not edit by hand. BS metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_BS = PhoneMetadata(id='BS', country_code=None, international_prefix=None,
general_desc=PhoneNumberDesc(national_number_pattern='9\\d\\d', possible_length=(3,)),
to... |
ankurmittal/OS-u2fs | refs/heads/master | tools/perf/scripts/python/sctop.py | 11180 | # system call top
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Periodically displays system-wide system call totals, broken down by
# syscall. If a [comm] arg is specified, only syscalls called by
# [comm] are displayed. If an [interval] arg is specified,... |
DennisBold/CodeAurora-MSM-Kernel | refs/heads/master | tools/perf/scripts/python/sctop.py | 11180 | # system call top
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Periodically displays system-wide system call totals, broken down by
# syscall. If a [comm] arg is specified, only syscalls called by
# [comm] are displayed. If an [interval] arg is specified,... |
IllusionRom-deprecated/android_platform_external_chromium_org | refs/heads/illusion-4.4 | native_client_sdk/src/build_tools/sdk_tools/command/uninstall.py | 164 | # Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import logging
import command_common
import sdk_update_common
def Uninstall(install_dir, local_manifest, bundle_names):
valid_bundles, inva... |
srivasta/debian.packaging.vm | refs/heads/master | lisp/autoloads.py | 2 | #!/usr/bin/python
# -*- python -*-
import sys
def identifier_start(string, startpos=0):
#print string, startpos
while (startpos < len(string) and
("() \t\r\n.,".find(string[startpos]) != -1)):
startpos = startpos + 1
return startpos
def identifier_end(string, startpos=0):
#print string, startpos... |
harisibrahimkv/django | refs/heads/master | django/contrib/gis/db/backends/spatialite/schema.py | 33 | from django.db.backends.sqlite3.schema import DatabaseSchemaEditor
from django.db.utils import DatabaseError
class SpatialiteSchemaEditor(DatabaseSchemaEditor):
sql_add_geometry_column = (
"SELECT AddGeometryColumn(%(table)s, %(column)s, %(srid)s, "
"%(geom_type)s, %(dim)s, %(null)s)"
)
sq... |
yindaz/pbrs | refs/heads/master | mitsuba-af602c6fd98a/build/config-macos10.7-icl-x86.py | 2 | BUILDDIR = '#build/release'
DISTDIR = '#Mitsuba.app'
CXX = 'icpc'
CC = 'icc'
CCFLAGS = ['-arch', 'i386', '-mmacosx-version-min=10.7', '-mfpmath=sse', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk', '-O3', '-ipo... |
mogoweb/chromium-crosswalk | refs/heads/master | tools/telemetry/telemetry/core/heap/chrome_js_heap_snapshot_parser.py | 38 | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import json
from telemetry.core.heap import live_heap_object
from telemetry.core.heap import retaining_edge
class ChromeJsHeapSnapshotParser(object):
"""... |
stepos01/ns3-lr-wpan-mlme | refs/heads/master | src/config-store/bindings/modulegen__gcc_LP64.py | 72 | from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
import pybindgen.settings
import warnings
class ErrorHandler(pybindgen.settings.ErrorHandler):
def handle_error(self, wrapper, exception, traceback_):
warnings.warn("exception %r in wrapper %s" % (exception, wrapper))
... |
cntnboys/410Lab6 | refs/heads/master | build/django/django/db/models/sql/subqueries.py | 66 | """
Query subclasses which provide extra functionality beyond simple data retrieval.
"""
from django.conf import settings
from django.core.exceptions import FieldError
from django.db import connections
from django.db.models.query_utils import Q
from django.db.models.constants import LOOKUP_SEP
from django.db.models.fi... |
SteveG/tracks-queue | refs/heads/master | src/pagecontextview.py | 1 | """
Copyright (C) 2010 Stephen Georg
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 License, or
(at your option) any later version.
This program is ... |
brokenjacobs/ansible | refs/heads/devel | lib/ansible/modules/cloud/azure/azure_rm_networkinterface.py | 56 | #!/usr/bin/python
#
# Copyright (c) 2016 Matt Davis, <mdavis@ansible.com>
# Chris Houseknecht, <house@redhat.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 Soft... |
uberamd/NGECore2 | refs/heads/master | scripts/object/draft_schematic/dance_prop/prop_sparkler_r_s05.py | 85615 | import sys
def setup(core, object):
return |
uberamd/NGECore2 | refs/heads/master | scripts/object/tangible/terminal/terminal_pm_register.py | 85615 | import sys
def setup(core, object):
return |
uberamd/NGECore2 | refs/heads/master | scripts/object/tangible/lair/krayt_dragon/lair_krayt_dragon_desert.py | 85615 | import sys
def setup(core, object):
return |
azureplus/hue | refs/heads/master | desktop/libs/librdbms/src/librdbms/server/dbms.py | 25 | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... |
MakesmithAccessibleTech/MakesmithGroundControl | refs/heads/master | UIElements/buttonTemplate.py | 2 | from kivy.properties import StringProperty
from kivy.properties import ObjectProperty
from kivy.uix.behaviors import ButtonBehavior
from kivy.uix.floatlayout import FloatLayout
class ButtonTemplate(FloatLayout, ButtonBehavior):
btnBackground = StringProperty('atlas://data/images/... |
IllusionRom-deprecated/android_platform_tools_idea | refs/heads/master | python/testData/keywordCompletion/lambdaInExpression.after.py | 83 | types = {
"key1" : lambda <caret>
} |
40223236/w16b_test | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/site-packages/pygame/__init__.py | 603 | ## pygame - Python Game Library
## Copyright (C) 2000-2001 Pete Shinners
##
## This library is free software; you can redistribute it and/or
## modify it under the terms of the GNU Library General Public
## License as published by the Free Software Foundation; either
## version 2 of the License, or (... |
yuhangwang/creator | refs/heads/master | creator/platform.py | 2 | # Copyright (C) 2015 Niklas Rosenstein
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, d... |
fridex/gofed | refs/heads/master | modules/specParser.py | 1 | # ####################################################################
# gofed - set of tools to automize packaging of golang devel codes
# Copyright (C) 2014 Jan Chaloupka, jchaloup@redhat.com
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public Licen... |
GenericStudent/home-assistant | refs/heads/dev | homeassistant/components/lifx_cloud/scene.py | 15 | """Support for LIFX Cloud scenes."""
import asyncio
import logging
from typing import Any
import aiohttp
from aiohttp.hdrs import AUTHORIZATION
import async_timeout
import voluptuous as vol
from homeassistant.components.scene import Scene
from homeassistant.const import (
CONF_PLATFORM,
CONF_TIMEOUT,
CONF... |
siosio/intellij-community | refs/heads/master | python/helpers/syspath.py | 85 | import sys
import os.path
for x in sys.path:
if x != os.path.dirname(sys.argv [0]) and x != '.': sys.stdout.write(x+chr(10)) |
FABtotum/fabui-colibri | refs/heads/master | fabui/ext/py/fabtotum/utils/singleton.py | 3 | class Singleton(type):
"""
Class to ensure singleton behaviour.
.. code-block:: python
from fabtotum.utils.singleton import Singleton
class MyClass:
__metaclass__ = Singleton
"""
_instances = {}
def __call__(cls, *args, **kwargs):
if cls not in cls._inst... |
mbauskar/Das_Erpnext | refs/heads/develop | erpnext/utilities/transaction_base.py | 10 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import cstr, now_datetime, cint, flt
import frappe.share
from erpnext.controllers.status_updater i... |
alexus37/AugmentedRealityChess | refs/heads/master | pythonAnimations/pyOpenGLChess/engineDirectory/oglc-env/lib/python2.7/site-packages/numpy/f2py/cfuncs.py | 38 | #!/usr/bin/env python
"""
C declarations, CPP macros, and C functions for f2py2e.
Only required declarations/macros/functions will be used.
Copyright 1999,2000 Pearu Peterson all rights reserved,
Pearu Peterson <pearu@ioc.ee>
Permission to use, modify, and distribute this software is given under the
terms of the NumP... |
andreparames/odoo | refs/heads/8.0 | addons/web_diagram/__init__.py | 597 | from . import controllers
|
SiccarPoint/landlab | refs/heads/master | landlab/components/potentiality_flowrouting/examples/drive_pot_fr_coupled3b.py | 1 | # -*- coding: utf-8 -*-
"""drive_pot_fr
Drive the landlab potentiality flow routing component.
Created on Wed Mar 4 2015
@author: danhobley
"""
from __future__ import print_function
from six.moves import range
from landlab import RasterModelGrid, ModelParameterDictionary
from landlab.plot.imshow import imshow_node... |
lociii/googleads-python-lib | refs/heads/master | examples/adspygoogle/dfp/v201306/get_custom_targeting_keys_by_statement.py | 3 | #!/usr/bin/python
#
# Copyright 2013 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... |
udomsak/RedisLive | refs/heads/master | src/api/controller/TopKeysController.py | 7 | from BaseController import BaseController
import tornado.ioloop
import tornado.web
import dateutil.parser
import datetime
class TopKeysController(BaseController):
def get(self):
return_data = dict(data=[], timestamp=datetime.datetime.now().isoformat())
server = self.get_argument("server")
from_d... |
xoan/Printrun | refs/heads/master | printrun/gviz.py | 2 | # This file is part of the Printrun suite.
#
# Printrun 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.
#
# Printrun is distributed in ... |
olivierdalang/QGIS | refs/heads/master | tests/src/python/test_qgsfieldmappingwidget.py | 30 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsFieldMapping widget and model.
.. note:: 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 License, or
(at your option) any lat... |
eeshangarg/oh-mainline | refs/heads/master | mysite/missions/irc/views.py | 13 | from mysite.base.decorators import view
from mysite.missions.irc import forms
from mysite.missions.models import IrcMissionSession
from django.http import HttpResponseRedirect
from django.core.urlresolvers import reverse
from django.contrib.auth.decorators import login_required
from django.conf import settings
@login... |
motatoes/gitlab-class-utils | refs/heads/master | cmd.py | 1 | from loader import get_settings
from gitlab import GitlabAPI
if __name__ == '__main__':
print("command line args")
config = get_settings()
private_token = config['GITLAB_PRIVATE_TOKEN']
private_token
gl = GitlabAPI(private_token)
group_id = gl.get_group_details(config['GROUPNAME'])["id"]
... |
Alberto-Beralix/Beralix | refs/heads/master | i386-squashfs-root/usr/lib/python2.7/dist-packages/Crypto/pct_warnings.py | 2 | ../../../../share/pyshared/Crypto/pct_warnings.py |
smilefreak/ancient_dna_pipeline | refs/heads/master | python_scripts/extract_informative_sites.py | 2 | #!/usr/bin/env python
#
# Extract informative sites from a VCF
#
# @author James Boocock
#
#
import pyfasta
import argparse
import sys
def check_fasta(fasta):
sequences = sorted(fasta.keys())
# make sure the lengths are the same
for i, sequence in enumerate(sequences):
if i == 0:
len... |
LazySix/mymenu | refs/heads/master | mymenu/restaurant/views.py | 6445 | from django.shortcuts import render
# Create your views here.
|
EverythingMe/rainbow | refs/heads/master | rainbow/datasources/cfn_datasource.py | 2 | from rainbow.cloudformation import Cloudformation
from base import DataSourceBase
__all__ = ['CfnOutputsDataSource', 'CfnResourcesDataSource', 'CfnParametersDataSource']
class CfnDataSourceBase(DataSourceBase):
def __init__(self, data_source):
super(CfnDataSourceBase, self).__init__(data_source)
... |
6WIND/scapy | refs/heads/master | scapy/contrib/openflow.py | 1 | # This file is part of Scapy
# See http://www.secdev.org/projects/scapy for more information
# Copyright (C) Philippe Biondi <phil@secdev.org>
# This program is published under a GPLv2 license
# Copyright (C) 2014 Maxence Tury <maxence.tury@ssi.gouv.fr>
# OpenFlow is an open standard used in SDN deployments.
# Based o... |
johnkeepmoving/oss-ftp | refs/heads/master | python27/win32/Lib/encodings/cp1026.py | 593 | """ Python Character Mapping Codec cp1026 generated from 'MAPPINGS/VENDORS/MICSFT/EBCDIC/CP1026.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,inp... |
asser/django | refs/heads/master | tests/admin_changelist/models.py | 276 | from django.db import models
from django.utils.encoding import python_2_unicode_compatible
class Event(models.Model):
# Oracle can have problems with a column named "date"
date = models.DateField(db_column="event_date")
class Parent(models.Model):
name = models.CharField(max_length=128)
class Child(mo... |
ulope/django | refs/heads/master | tests/proxy_model_inheritance/app2/models.py | 736 | from django.db import models
class NiceModel(models.Model):
pass
|
openwrt/openwrt | refs/heads/master | scripts/json_add_image_info.py | 14 | #!/usr/bin/env python3
from os import getenv
from pathlib import Path
from sys import argv
import hashlib
import json
if len(argv) != 2:
print("ERROR: JSON info script requires output arg")
exit(1)
json_path = Path(argv[1])
bin_dir = Path(getenv("BIN_DIR"))
image_file = bin_dir / getenv("DEVICE_IMG_NAME")
i... |
klindenbach/cmput410lab | refs/heads/master | name-family.py | 1 | class Student:
def __init__(self, name, family):
self.name = name
self.family = family
self.marks = {}
def addCourseMark(self, course, mark):
self.marks[course] = mark
def average(self):
sum = 0
for course in self.marks:
sum += self.marks[course]... |
noelevans/sandpit | refs/heads/master | bayesian_methods_for_hackers/normal_distributions_ch02.py | 1 | import numpy as np
import scipy.stats as stats
from matplotlib import pyplot as plt
def main():
x = np.linspace(-8, 7, 150)
mu = (-2, 0, 3)
tau = (.7, 1, 2.8)
colors = ["#348ABD", "#A60628", "#7A68A6"]
parameters = zip(mu, tau, colors)
for _mu, _tau, _color in parameters:
plt.plot(x, ... |
pearsonlab/nipype | refs/heads/master | nipype/interfaces/camino/tests/test_auto_AnalyzeHeader.py | 12 | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from ....testing import assert_equal
from ..convert import AnalyzeHeader
def test_AnalyzeHeader_inputs():
input_map = dict(args=dict(argstr='%s',
),
centre=dict(argstr='-centre %s',
units='mm',
),
data_dims=dict(argstr='-datadims %s',
u... |
SlimRoms/kernel_lge_mako | refs/heads/ng7.1 | arch/ia64/scripts/unwcheck.py | 13143 | #!/usr/bin/python
#
# Usage: unwcheck.py FILE
#
# This script checks the unwind info of each function in file FILE
# and verifies that the sum of the region-lengths matches the total
# length of the function.
#
# Based on a shell/awk script originally written by Harish Patil,
# which was converted to Perl by Matthew Ch... |
tim-donahue/pystrix | refs/heads/master | pystrix/ami/core_events.py | 3 | """
pystrix.ami.core_events
=======================
Provides defnitions and filtering rules for events that may be raised by Asterisk.
Legal
-----
This file is part of pystrix.
pystrix is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published
by ... |
printedheart/h2o-3 | refs/heads/master | h2o-py/tests/testdir_demos/pyunit_gbm_demo.py | 6 | import sys
sys.path.insert(1, "../../")
import h2o, tests
def demo_gbm():
h2o.demo(func="gbm", interactive=False, test=True)
if __name__ == "__main__":
tests.run_test(sys.argv, demo_gbm)
|
MalloyPower/parsing-python | refs/heads/master | front-end/testsuite-python-lib/Python-3.6.0/Lib/wsgiref/validate.py | 20 | # (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org)
# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
# Also licenced under the Apache License, 2.0: http://opensource.org/licenses/apache2.0.php
# Licensed to PSF under a Contributor Agreement
"""
Middlew... |
jswoboda/SimISR | refs/heads/master | Test/testisrmatrix.py | 2 | #!/usr/bin/env python
"""
Created on Tue Oct 20 13:20:27 2015
@author: John Swoboda
"""
from SimISR import Path
import scipy as sp
import shutil
#from SimISR.utilFunctions import makedefaultfile
#from SimISR.operators import makematPA
from SimISR.IonoContainer import MakeTestIonoclass
from SimISR.analysisplots import ... |
yongshengwang/builthue | refs/heads/master | desktop/core/ext-py/tablib-develop/tablib/packages/odf/number.py | 100 | # -*- coding: utf-8 -*-
# Copyright (C) 2006-2007 Søren Roug, European Environment Agency
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at you... |
sloanyang/android_external_webkit | refs/heads/master | Tools/Scripts/webkitpy/common/config/ports.py | 15 | # Copyright (C) 2009, 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 of conditions and the... |
s40523208/2016fallcp_hw | refs/heads/gh-pages | plugin/summary/summary.py | 30 | """
Summary
-------
This plugin allows easy, variable length summaries directly embedded into the
body of your articles.
"""
from __future__ import unicode_literals
from pelican import signals
from pelican.generators import ArticlesGenerator, StaticGenerator, PagesGenerator
def initialized(pelican):
... |
BaichuanWu/Blog_on_django | refs/heads/master | site-packages/django/contrib/gis/tests/distapp/models.py | 75 | from django.contrib.gis.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class NamedModel(models.Model):
name = models.CharField(max_length=30)
objects = models.GeoManager()
class Meta:
abstract = True
app_label = 'distapp'
... |
rdeheele/odoo | refs/heads/master | addons/gamification/__init__.py | 389 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013 OpenERP SA (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
uberamd/NGECore2 | refs/heads/master | scripts/object/mobile/pit_droid.py | 85615 | import sys
def setup(core, object):
return |
f3r/scikit-learn | refs/heads/master | sklearn/metrics/cluster/tests/test_supervised.py | 41 | import numpy as np
from sklearn.metrics.cluster import adjusted_rand_score
from sklearn.metrics.cluster import homogeneity_score
from sklearn.metrics.cluster import completeness_score
from sklearn.metrics.cluster import v_measure_score
from sklearn.metrics.cluster import homogeneity_completeness_v_measure
from sklearn... |
abadger/ansible | refs/heads/devel | lib/ansible/plugins/lookup/varnames.py | 15 | # (c) 2017 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
DOCUMENTATION = """
name: varnames
author: Ansible Core Team
version_added: "2.8"
short_descrip... |
xgouchet/ArachneMergeTool | refs/heads/main | automergetool/amt_lcs.py | 2 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
from typing import TypeVar, Generic, List, Any
S = TypeVar('S') # Generic Sequence
I = TypeVar('I') # Generic Item
class SubSeq(Generic[S]):
"""
Represents a SubSequence
"""
def __init__(self):
pass
class CommonSubSeq(Generic[S],... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.