repo_name
stringlengths
6
100
path
stringlengths
4
294
copies
stringlengths
1
5
size
stringlengths
4
6
content
stringlengths
606
896k
license
stringclasses
15 values
MiniPlayer/log-island
logisland-plugins/logisland-scripting-processors-plugin/src/main/resources/nltk/corpus/reader/timit.py
22
16956
# Natural Language Toolkit: TIMIT Corpus Reader # # Copyright (C) 2001-2007 NLTK Project # Author: Haejoong Lee <haejoong@ldc.upenn.edu> # Steven Bird <stevenbird1@gmail.com> # Jacob Perkins <japerk@gmail.com> # URL: <http://nltk.org/> # For license information, see LICENSE.TXT # [xx] this docstring is...
apache-2.0
sysalexis/kbengine
kbe/src/lib/python/Lib/encodings/cp1250.py
272
13686
""" Python Character Mapping Codec cp1250 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1250.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,in...
lgpl-3.0
azureplus/hue
desktop/core/ext-py/Paste-2.0.1/paste/auth/grantip.py
50
4021
# (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 """ Grant roles and logins based on IP address. """ import six from paste.util import ip4 class GrantIPMiddleware(object): """ On each reques...
apache-2.0
sharadagarwal/autorest
AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/SubscriptionIdApiVersion/microsoftazuretesturl/microsoft_azure_test_url.py
2
5402
# 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 ...
mit
HKUST-SING/tensorflow
tensorflow/contrib/quantization/python/array_ops.py
178
1156
# 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...
apache-2.0
CHLLHC/cs240
ns-3.26/src/energy/bindings/modulegen__gcc_ILP32.py
38
314509
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)) ...
mit
Bam4d/neon
neon/backends/test_lrn.py
2
5301
# Copyright 2014 Nervana Systems 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 applicable ...
apache-2.0
oneonestar/CloudStorage
src/client/rsa.py
1
3905
""" Load RSA keys for encryption/decryption/sign/verify. """ from ldap3 import * import json import base64 import log from cryptography import x509 from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primitives.asymmetric import rsa, padding from cryptography.hazmat.primitives.serializatio...
gpl-3.0
UniversalMasterEgg8679/ansible
test/units/modules/network/eos/test_eos_system.py
41
4517
# (c) 2016 Red Hat Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is dis...
gpl-3.0
freedomtan/tensorflow
tensorflow/python/kernel_tests/distributions/normal_test.py
14
21838
# 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...
apache-2.0
nuuuboo/odoo
addons/portal_project_issue/__openerp__.py
375
1713
# -*- 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...
agpl-3.0
dkopecek/amplify
third-party/quex-0.65.2/quex/engine/analyzer/state/drop_out.py
1
1840
from quex.engine.analyzer.commands.core import CommandList, \ IfPreContextSetPositionAndGoto def get_CommandList(TheAccepter, TheTerminalRouter): """If there is no stored acceptance involved, then one can directly conclude from the pre-contexts to the acceptan...
gpl-2.0
aequitas/CouchPotato
cherrypy/process/servers.py
57
14670
""" Starting in CherryPy 3.1, cherrypy.server is implemented as an :ref:`Engine Plugin<plugins>`. It's an instance of :class:`cherrypy._cpserver.Server`, which is a subclass of :class:`cherrypy.process.servers.ServerAdapter`. The ``ServerAdapter`` class is designed to control other servers, as well. Multiple servers/p...
gpl-3.0
utkbansal/kuma
vendor/packages/setuptools/command/easy_install.py
201
86354
#!/usr/bin/env python """ Easy Install ------------ A tool for doing automatic download/extract/build of distutils-based Python packages. For detailed documentation, see the accompanying EasyInstall.txt file, or visit the `EasyInstall home page`__. __ https://pythonhosted.org/setuptools/easy_install.html """ from...
mpl-2.0
cslarsen/wpm
wpm/record.py
1
1397
# -*- encoding: utf-8 -*- """ This file is part of the wpm software. Copyright 2017, 2018 Christian Stigen Larsen Distributed under the GNU Affero General Public License (AGPL) v3 or later. See the file LICENSE.txt for the full license text. This software makes use of open source software. The quotes database is *no...
agpl-3.0
eonpatapon/neutron
neutron/tests/api/clients.py
35
4873
# Copyright 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 requ...
apache-2.0
tdjordan/tortoisegit
gitgtk/backout.py
1
4443
# # backout.py - TortoiseHg's dialog for backing out changeset # # Copyright (C) 2008 Steve Borho <steve@borho.org> # Copyright (C) 2007 TK Soh <teekaysoh@gmail.com> # import os import sys import gtk import pango from dialog import * from hgcmd import CmdDialog import histselect class BackoutDialog(gtk.Window): "...
gpl-2.0
jaredly/pyjamas
pygtkweb/demos/062-uimanager.py
7
4567
#!/usr/bin/env python import pygtk pygtk.require('2.0') import gtk class UIManagerExample: ui = '''<ui> <menubar name="MenuBar"> <menu action="File"> <menuitem action="Quit"/> </menu> <menu action="Sound"> <menuitem action="Mute"/> </menu> <menu action="RadioBand"...
apache-2.0
hortonworks/hortonworks-sandbox
desktop/core/ext-py/south/south/creator/freezer.py
6
6312
""" Handles freezing of models into FakeORMs. """ import sys from django.db import models from django.contrib.contenttypes.generic import GenericRelation from south.orm import FakeORM from south.utils import auto_model from south import modelsinspector def freeze_apps(apps): """ Takes a list of app labels, ...
apache-2.0
fernandoacorreia/DjangoWAWSLogging
DjangoWAWSLogging/env/Lib/site-packages/pywin32-218-py2.7-win32.egg/pywin/debugger/dbgpyapp.py
41
1416
# dbgpyapp.py - Debugger Python application class # import win32con import win32ui import sys import string import os from pywin.framework import intpyapp version = '0.3.0' class DebuggerPythonApp(intpyapp.InteractivePythonApp): def LoadMainFrame(self): " Create the main applications frame " self.frame = self.C...
mit
cpritam/moose
framework/scripts/mooseExamplesLateX/gen_tex.py
35
2444
#!/usr/bin/env python import os, re from subprocess import Popen moose_examples_dir = "../../../moose_examples" preamble_file = 'preamble.tex' line_template = '\\lstinputlisting[style=<STYLE>, caption=<CAPTION>]{<PATH>}\n\clearpage\n\n' def genPreamble(out_file): in_file = open(preamble_file, 'r') out_file.writ...
lgpl-2.1
haarcuba/testix
setup.py
1
1689
import setuptools from distutils.core import setup LONG_DESCRIPTION =\ """ Testix is a Mocking framework for Python, meant to be used with [pytest](https://docs.pytest.org/en/latest/). read the full docs at the [project's homepage](https://github.com/haarcuba/testix). Testix is special because it allows you to specif...
mit
pmaunz/pyqtgraph
examples/GLVolumeItem.py
28
1968
# -*- coding: utf-8 -*- """ Demonstrates GLVolumeItem for displaying volumetric data. """ ## Add path to library (just for examples; you do not need this) import initExample from pyqtgraph.Qt import QtCore, QtGui import pyqtgraph.opengl as gl app = QtGui.QApplication([]) w = gl.GLViewWidget() w.opts['distance'] = 2...
mit
cangencer/hazelcast-python-client
hazelcast/protocol/codec/transactional_map_remove_codec.py
2
1445
from hazelcast.serialization.bits import * from hazelcast.protocol.client_message import ClientMessage from hazelcast.protocol.custom_codec import * from hazelcast.util import ImmutableLazyDataList from hazelcast.protocol.codec.transactional_map_message_type import * REQUEST_TYPE = TRANSACTIONALMAP_REMOVE RESPONSE_TYP...
apache-2.0
rherrick/XNATImageViewer
src/main/scripts/viewer/X/utils/_core/_jsfilefinder.py
5
1088
# # The XBUILD JS File finder. # # (c) 2012 The XTK Developers <dev@goXTK.com> # import sys import config # # # class JSFileFinder( object ): ''' Finds JS Files in directory. ''' def run( self, options=None ): ''' Performs the action. ''' # we need to import some closure python classes here...
bsd-3-clause
works-mobile/Diamond
src/collectors/snmpinterface/snmpinterface.py
64
8595
# coding=utf-8 """ The SNMPInterfaceCollector is designed for collecting interface data from remote SNMP-enabled devices such as routers and switches using SNMP IF_MIB #### Installation The snmpinterfacecollector.py module should be installed into your Diamond installation collectors directory. This directory is def...
mit
hkchenhongyi/django
django/conf/locale/sl/formats.py
504
2118
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'd. F Y' TIME_FORMAT = 'H:i' DATET...
bsd-3-clause
qedi-r/home-assistant
tests/helpers/test_dispatcher.py
4
4196
"""Test dispatcher helpers.""" import asyncio from homeassistant.core import callback from homeassistant.helpers.dispatcher import ( async_dispatcher_connect, dispatcher_send, dispatcher_connect, ) from tests.common import get_test_home_assistant class TestHelpersDispatcher: """Tests for discovery h...
apache-2.0
unnikrishnankgs/va
venv/lib/python3.5/site-packages/IPython/utils/module_paths.py
3
3615
"""Utility functions for finding modules Utility functions for finding modules on sys.path. `find_mod` finds named module on sys.path. `get_init` helper function that finds __init__ file in a directory. `find_module` variant of imp.find_module in std_lib that only returns path to module and not an open file object ...
bsd-2-clause
kmacinnis/sympy
examples/advanced/relativity.py
6
5054
#!/usr/bin/env python """ This example calculates the Ricci tensor from the metric and does this on the example of Schwarzschild solution. If you want to derive this by hand, follow the wiki page here: http://en.wikipedia.org/wiki/Deriving_the_Schwarzschild_solution Also read the above wiki and follow the reference...
bsd-3-clause
jan25/code_sorted
adventofcode/2020/4/2.py
1
2176
passports, lines = [], [] while True: try: line = input().strip() if line == "": passports.append(' '.join(lines)) lines = [] else: lines.append(line) except Exception: if lines: passports.append(' '.join(lines)) break '''...
unlicense
Duality4Y/py-bool-logic
LogicTests.py
1
19036
import baseLogic as logic from LogicUtils import itot from LogicUtils import ttoi from LogicUtils import getRandomInts from LogicUtils import invertTuple from LogicUtils import states from LogicUtils import appendTuple def checkNot(logic): state1 = logic(0) state2 = logic(1) print("0 : %d" % (state1)) ...
gpl-2.0
michalbe/vehiquw-chasu
python/snake.py
2
3801
import pygame import sys import copy import random pygame.init() font = pygame.font.SysFont("monospace", 15) # Configuration width = 500 height = 500 screen = pygame.display.set_mode((width, height)) cellSize = 15; cellsX = round(width/cellSize); cellsY = round(height/cellSize); snake = None food = None gameloop = Tru...
mit
atheed/servo
tests/wpt/web-platform-tests/tools/pytest/_pytest/helpconfig.py
180
5120
""" version info, help messages, tracing configuration. """ import py import pytest import os, sys def pytest_addoption(parser): group = parser.getgroup('debugconfig') group.addoption('--version', action="store_true", help="display pytest lib version and import information.") group._addoption(...
mpl-2.0
tanghaibao/jcvi
jcvi/annotation/stats.py
1
12645
#!/usr/bin/env python # -*- coding: UTF-8 -*- """ Collect gene statistics based on gff file: Exon length, Intron length, Gene length, Exon count """ import os.path as op import sys import logging from jcvi.utils.cbook import SummaryStats, percentage, human_size from jcvi.utils.range import range_interleave from jcvi....
bsd-2-clause
0Chencc/CTFCrackTools
Lib/compiler/symbols.py
134
14489
"""Module symbol-table generator""" from compiler import ast from compiler.consts import SC_LOCAL, SC_GLOBAL_IMPLICIT, SC_GLOBAL_EXPLICIT, \ SC_FREE, SC_CELL, SC_UNKNOWN from compiler.misc import mangle import types import sys MANGLE_LEN = 256 class Scope: # XXX how much information do I need about each na...
gpl-3.0
bitcity/django-allauth
allauth/socialaccount/providers/persona/views.py
59
1687
import requests from django.core.exceptions import ImproperlyConfigured from allauth.socialaccount.helpers import complete_social_login from allauth.socialaccount.helpers import render_authentication_error from allauth.socialaccount.models import SocialLogin from allauth.socialaccount import app_settings, providers f...
mit
JacquesLucke/still-lambda
pyglet/app/__init__.py
3
5516
# ---------------------------------------------------------------------------- # pyglet # Copyright (c) 2006-2008 Alex Holkner # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistribu...
bsd-3-clause
h2oai/h2o-3
h2o-py/tests/testdir_algos/gbm/pyunit_gbm_monotone_quantile.py
2
1583
import h2o from h2o.estimators import H2OGradientBoostingEstimator from tests import pyunit_utils import numpy as np def f(x): """The function to predict.""" return x * np.sin(x) def gbm_monotone_quantile_test(): # generate data x = np.atleast_1d(np.random.uniform(0, 10.0, size=100)).T y = f(x)...
apache-2.0
trader418/android_kernel_samsung_hlte_N
scripts/rt-tester/rt-tester.py
11005
5307
#!/usr/bin/python # # rt-mutex tester # # (C) 2006 Thomas Gleixner <tglx@linutronix.de> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # import os import sys import getopt import sh...
gpl-2.0
Senseg/Py4A
python3-alpha/python3-src/Lib/lib2to3/pgen2/pgen.py
161
13780
# Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. # Pgen imports from . import grammar, token, tokenize class PgenGrammar(grammar.Grammar): pass class ParserGenerator(object): def __init__(self, filename, stream=None): close_stream =...
apache-2.0
globocom/tapioca
tests/acceptance/test_rest_api.py
1
13821
import re import logging from json import loads, dumps from xml.etree import ElementTree from unittest import TestCase import tornado.web from tornado.testing import AsyncHTTPTestCase from tapioca import TornadoRESTful, ResourceHandler, \ ResourceDoesNotExist, JsonEncoder, JsonpEncoder, HtmlEncoder from test...
mit
cchurch/ansible
test/units/modules/network/f5/test_bigiq_regkey_license_assignment.py
17
4335
# -*- coding: utf-8 -*- # # Copyright: (c) 2017, F5 Networks Inc. # 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 import os import json import pytest import sys if sys.version_info < (2...
gpl-3.0
DefyVentures/edx-platform
lms/djangoapps/instructor_analytics/distributions.py
174
5760
""" Profile Distributions Aggregate sums for values of fields in students profiles. For example: The distribution in a course for gender might look like: 'gender': { 'type': 'EASY_CHOICE', 'data': { 'no_data': 1234, 'm': 5678, 'o': 2134, 'f': 5678 }, 'display_names': { ...
agpl-3.0
maohongyuan/kbengine
kbe/res/scripts/common/Lib/distutils/tests/test_extension.py
168
2768
"""Tests for distutils.extension.""" import unittest import os import warnings from test.support import check_warnings, run_unittest from distutils.extension import read_setup_file, Extension class ExtensionTestCase(unittest.TestCase): def test_read_setup_file(self): # trying to read a Setup file ...
lgpl-3.0
hpcugent/easybuild-framework
easybuild/toolchains/linalg/scalapack.py
2
1883
## # Copyright 2012-2019 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be), # Flemish Research Foundation (F...
gpl-2.0
marianinn/mingus
mingus/midi/sequencer_observer.py
10
4335
#!/usr/bin/python # -*- coding: utf-8 -*- # mingus - Music theory Python package, sequencer_observer module. # Copyright (C) 2008-2009, Bart Spaans # # 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 S...
gpl-3.0
shawnferry/ansible
lib/ansible/errors/yaml_strings.py
264
3419
# (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...
gpl-3.0
tejasapatil/spark
examples/src/main/python/mllib/correlations.py
51
2088
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
apache-2.0
adaussy/eclipse-monkey-revival
plugins/python/org.eclipse.eclipsemonkey.lang.python/Lib/cgi.py
35
34505
#! /usr/local/bin/python # NOTE: the above "/usr/local/bin/python" is NOT a mistake. It is # intentionally NOT "/usr/bin/env python". On many systems # (e.g. Solaris), /usr/local/bin is not in $PATH as passed to CGI # scripts, and /usr/local/bin is the default directory where Python is # installed, so /usr/bin/env w...
epl-1.0
AO-StreetArt/CrazyIvan_ProtoBufferTests
Scene_pb2.py
1
12510
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: Scene.proto from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import descriptor_pb2 # @@protoc_insertion_point(imports) ...
mit
hcsturix74/django
tests/model_meta/tests.py
169
11727
from django.apps import apps from django.contrib.contenttypes.fields import ( GenericForeignKey, GenericRelation, ) from django.core.exceptions import FieldDoesNotExist from django.db.models.fields import CharField, Field, related from django.db.models.options import EMPTY_RELATION_TREE, IMMUTABLE_WARNING from djan...
bsd-3-clause
QuLogic/python-future
src/future/backports/test/pystone.py
80
7427
#!/usr/bin/env python3 """ "PYSTONE" Benchmark Program Version: Python/1.1 (corresponds to C/1.1 plus 2 Pystone fixes) Author: Reinhold P. Weicker, CACM Vol 27, No 10, 10/84 pg. 1013. Translated from ADA to C by Rick Richardson. Every method to preserve ADA-likeness h...
mit
illicitonion/givabit
lib/sdks/google_appengine_1.7.1/google_appengine/lib/django_1_2/tests/regressiontests/string_lookup/models.py
92
1199
# -*- coding: utf-8 -*- from django.db import models class Foo(models.Model): name = models.CharField(max_length=50) friend = models.CharField(max_length=50, blank=True) def __unicode__(self): return "Foo %s" % self.name class Bar(models.Model): name = models.CharField(max_length=50) norm...
apache-2.0
leezu/mxnet
tests/python/gpu/test_rtc.py
61
1318
# 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 u...
apache-2.0
mkmelin/bedrock
tests/pages/firefox/do_not_track.py
11
1904
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. from selenium.webdriver.common.by import By from pages.firefox.base import FirefoxBasePage, FirefoxBaseRegion class D...
mpl-2.0
zakuro9715/lettuce
tests/integration/lib/Django-1.3/tests/regressiontests/introspection/tests.py
47
4699
from django.conf import settings from django.db import connection, DEFAULT_DB_ALIAS from django.test import TestCase, skipUnlessDBFeature from django.utils import functional from models import Reporter, Article # # The introspection module is optional, so methods tested here might raise # NotImplementedError. This is...
gpl-3.0
mtconley/turntable
test/lib/python2.7/site-packages/numpy/polynomial/polynomial.py
126
48268
""" Objects for dealing with polynomials. This module provides a number of objects (mostly functions) useful for dealing with polynomials, including a `Polynomial` class that encapsulates the usual arithmetic operations. (General information on how this module represents and works with polynomial objects is in the do...
mit
sander76/home-assistant
homeassistant/components/counter/__init__.py
3
9469
"""Component to count within automations.""" from __future__ import annotations import logging import voluptuous as vol from homeassistant.const import ( ATTR_EDITABLE, CONF_ICON, CONF_ID, CONF_MAXIMUM, CONF_MINIMUM, CONF_NAME, ) from homeassistant.core import HomeAssistant, callback from hom...
apache-2.0
alawnchen/djangoproject.com
fundraising/models.py
3
3696
from decimal import Decimal from django.db import models from django.db.models.signals import post_save from django.dispatch import receiver from django.utils import crypto, timezone from django_hosts.resolvers import reverse from sorl.thumbnail import ImageField, get_thumbnail RESTART_GOAL = Decimal("30000.00") STRE...
bsd-3-clause
kreisl/AliPhysics
PWGJE/EMCALJetTasks/Tracks/analysis/Draw/DrawRawSpectrum.py
41
4052
#************************************************************************** #* Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. * #* * #* Author: The ALICE Off-line Project. * #* Contributors ...
bsd-3-clause
skidekeersmaecker/raspi-cursus
labo4/mqtt.py
1
2464
import RPi.GPIO as GPIO import paho.mqtt.client as mqtt import time GPIO.setmode(GPIO.BOARD) #leds ledKitchen = 16 ledLivingroom = 18 GPIO.setup(ledKitchen, GPIO.OUT) GPIO.output(ledKitchen, False) GPIO.setup(ledLivingroom, GPIO.OUT) GPIO.output(ledLivingroom, False) #buttons buttonMaster = 11 buttonKitchen = 13 but...
mit
andrei4ka/fuel-web-redhat
nailgun/nailgun/objects/serializers/release.py
1
1707
# -*- coding: utf-8 -*- # Copyright 2013 Mirantis, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requi...
apache-2.0
quesnel/pyvle
src/pyvle.py
1
16780
#!/usr/bin/env python # -*- coding: utf-8 -*- # # File: pyvle.py # Author: The VLE Development Team. # Brief: Python wrapper of VLE # # VLE Environment - the multimodeling and simulation environment # This file is a part of the VLE environment (http://vle-project.org) # Copyright (C) 2003 - 2017 The VLE Development ...
gpl-3.0
wentixiaogege/newt-2.0
store/views.py
1
2855
from newt.views import AuthJSONRestView from common.response import json_response from django.conf import settings import json from importlib import import_module store_adapter = import_module(settings.NEWT_CONFIG['ADAPTERS']['STORES']['adapter']) import logging logger = logging.getLogger("newt." + __name__) # /ap...
bsd-2-clause
proversity-org/edx-platform
scripts/xblock/xblock_counts.py
12
14455
import argparse import csv import json import os import sys from datetime import datetime import requests from six import text_type # Keys for the CSV and JSON interpretation PAGINATION_KEY = 'pagination' NUM_PAGES_KEY = 'num_pages' NEXT_PAGE_URL_KEY = 'next' RESULTS_KEY = 'results' BLOCKS_URL_KEY = 'blocks_url' BLOC...
agpl-3.0
Judystudy/gooderp_addons
auto_exchange/models/auto_exchange.py
5
6575
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2016 开阖软件(<http://www.osbzr.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Aff...
agpl-3.0
peterjoel/servo
tests/wpt/web-platform-tests/eventsource/resources/cors-cookie.py
248
1220
from datetime import datetime def main(request, response): last_event_id = request.headers.get("Last-Event-Id", "") ident = request.GET.first('ident', "test") cookie = "COOKIE" if ident in request.cookies else "NO_COOKIE" origin = request.GET.first('origin', request.headers["origin"]) credentials =...
mpl-2.0
lidiamcfreitas/FenixScheduleMaker
ScheduleMaker/brython/www/src/Lib/test/test_codeccallbacks.py
28
33967
import codecs import html.entities import sys import test.support import unicodedata import unittest import warnings try: import ctypes except ImportError: ctypes = None SIZEOF_WCHAR_T = -1 else: SIZEOF_WCHAR_T = ctypes.sizeof(ctypes.c_wchar) class PosReturn: # this can be used for configurable ca...
bsd-2-clause
davidzchen/tensorflow
tensorflow/tools/compatibility/tf_upgrade_v2_main.py
5
7826
# Lint as: python2, python3 # Copyright 2018 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 # ...
apache-2.0
nschank/latexml
stringutil.py
1
2656
# import re # COMMENT_PATERN = re.compile("([^\\\\])%.*($)", flags=re.MULTILINE) # REDACT = "%" # COMMENT_REPLACE = "\\1{}\\2".format(REDACT) # def strip_comments(document_contents): # return COMMENT_PATERN.sub(COMMENT_REPLACE, document_contents) import strip_comments def strip_latex_comments(document_contents): ...
mit
lmotta/Roam
src/plugins/search_plugin/search.py
2
8786
import sqlite3 import time import os import struct from PyQt4.QtCore import Qt, QObject, pyqtSignal, QThread, QEvent from PyQt4.QtGui import QWidget, QGridLayout, QLabel, QListWidgetItem, QStyledItemDelegate, QFontMetricsF, QTextOption from PyQt4.uic import loadUiType from qgis.core import QgsMapLayer import roam.api...
gpl-2.0
commtrack/commtrack-old-to-del
apps/reports/custom/grameen.py
1
7030
#!/usr/bin/env python # vim: ai ts=4 sts=4 et sw=4 import inspect from django.template.loader import render_to_string from django.db import connection import settings from xformmanager.models import Metadata, FormDefModel, ElementDefModel from reports.models import Case, SqlReport from reports.util import get_where...
bsd-3-clause
lathen/voreen
modules/python/ext/python27/modules/xmlrpclib.py
36
51323
# # XML-RPC CLIENT LIBRARY # $Id$ # # an XML-RPC client interface for Python. # # the marshalling and response parser code can also be used to # implement XML-RPC servers. # # Notes: # this version is designed to work with Python 2.1 or newer. # # History: # 1999-01-14 fl Created # 1999-01-15 fl Changed dateTime to u...
gpl-2.0
fotinakis/sentry
tests/sentry/utils/test_numbers.py
6
2152
from __future__ import absolute_import from sentry.utils.numbers import base36_encode, base36_decode, \ base32_encode, base32_decode def test_base36(): assert [base36_encode(x) for x in range(128)] == [ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', ...
bsd-3-clause
klebercode/econordeste
econordeste/event/urls.py
1
1067
# coding: utf-8 from django.conf.urls import patterns, url from econordeste.event.views import (CalendarYearArchiveView, CalendarMonthArchiveView, CalendarDayArchiveView, CalendarListView, ...
mit
mahak/ansible
test/support/network-integration/collections/ansible_collections/vyos/vyos/plugins/module_utils/network/vyos/argspec/interfaces/interfaces.py
47
2109
# Copyright 2019 Red Hat # GNU General Public License v3.0+ # (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ############################################# # WARNING # ############################################# # # This file is auto generated by the resource # module bu...
gpl-3.0
OTAkeys/RIOT
tests/pkg_utensor/generate_digit.py
19
1149
#!/usr/bin/env python3 """Generate a binary file from a sample image of the MNIST dataset. Pixel of the sample are stored as float32, images have size 28x28. """ import os import argparse import numpy as np import matplotlib.pyplot as plt import tensorflow as tf SCRIPT_DIR = os.path.dirname(os.path.realpath(__fil...
lgpl-2.1
sarthakmeh03/django
django/dispatch/dispatcher.py
50
11613
import sys import threading import warnings import weakref from django.utils import six from django.utils.deprecation import RemovedInDjango20Warning from django.utils.inspect import func_accepts_kwargs from django.utils.six.moves import range if six.PY2: from .weakref_backports import WeakMethod else: from w...
bsd-3-clause
vnpy/vnpy
vnpy/api/apex/fiddef.py
3
116526
FID_BCZJYE = 501 # 本次资金余额 DT:C FID_BFXJJ = 502 # 买风险金 DT:C FID_BGHF = 503 # 买过户费 DT:C FID_BJE = 504 # 买入金额 DT:C FID_BJSF = 505 # 买经手费 DT:C FID_BPGDH = 506 # 报盘股东号 DT:C FID_CODE = 507 # 返回码 DT:C FID_MESSAGE = 508 # 返回说明 DT:C FID_BSL = 509 # 买入数量 DT:C FID_BYHS = 510 # 买印花税...
mit
abyssxsy/gnuradio
gr-utils/python/utils/plot_fft_base.py
53
10449
#!/usr/bin/env python # # Copyright 2007,2008,2011 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your ...
gpl-3.0
zhouzhenghui/python-for-android
python-build/python-libs/gdata/samples/oauth/oauth_on_appengine/appengine_utilities/rotmodel.py
131
2149
""" Copyright (c) 2008, appengine-utilities project 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 ...
apache-2.0
sachintaware/sublime-wakatime
packages/wakatime/packages/requests/cookies.py
204
16791
# -*- coding: utf-8 -*- """ Compatibility code to be able to use `cookielib.CookieJar` with requests. requests.utils imports from here, so be careful with imports. """ import time import collections from .compat import cookielib, urlparse, urlunparse, Morsel try: import threading # grr, pyflakes: this fixes...
bsd-3-clause
rabipanda/tensorflow
tensorflow/contrib/distributions/python/ops/normal_conjugate_posteriors.py
120
5530
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
GarySparrow/mFlaskWeb
venv/Lib/site-packages/sqlalchemy/orm/__init__.py
70
7976
# orm/__init__.py # Copyright (C) 2005-2015 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """ Functional constructs for ORM configuration. See the SQLAlchemy object relation...
mit
chfoo/wpull
wpull/scraper/util.py
1
6973
'''Misc functions.''' import functools import gettext import itertools import logging import mimetypes import re import string import wpull.url from wpull.backport.logging import BraceMessage as __ from wpull.pipeline.item import LinkType _ = gettext.gettext _logger = logging.getLogger(__name__) def parse_refresh(...
gpl-3.0
stahta01/codeblocks_svn2git_http_metadata
src/sdk/wxscintilla/src/scintilla/scripts/HeaderCheck.py
17
3240
# Script to check that headers are in a consistent order # Requires Python 2.6 or later from __future__ import print_function import codecs, glob, os, platform, sys, unicodedata def ciCompare(a,b): return cmp(a.lower(), b.lower()) def ciKey(a): return a.lower() def SortListInsensitive(l): try: # Try ...
gpl-3.0
kemalakyol48/python-for-android
python3-alpha/python3-src/Lib/encodings/euc_kr.py
816
1027
# # euc_kr.py: Python Unicode Codec for EUC_KR # # Written by Hye-Shik Chang <perky@FreeBSD.org> # import _codecs_kr, codecs import _multibytecodec as mbc codec = _codecs_kr.getcodec('euc_kr') class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class IncrementalEncoder(mbc.MultibyteIncrem...
apache-2.0
leekchan/tornado_test
tornado/test/httpserver_test.py
1
39635
#!/usr/bin/env python from __future__ import absolute_import, division, print_function, with_statement from tornado import netutil from tornado.escape import json_decode, json_encode, utf8, _unicode, recursive_unicode, native_str from tornado import gen from tornado.http1connection import HTTP1Connection from tornado...
apache-2.0
thaim/ansible
test/units/modules/storage/netapp/test_na_ontap_volume_autosize.py
21
9219
# (c) 2019, NetApp, Inc # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ''' unit tests for Ansible module: na_ontap_volume_autosize ''' from __future__ import (absolute_import, division, print_function) __metaclass__ = type import json import pytest from units.compat impo...
mit
berrange/nova
nova/api/openstack/compute/contrib/extended_status.py
20
3926
# Copyright 2011 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
apache-2.0
jeremiahyan/odoo
odoo/tools/template_inheritance.py
1
9597
from lxml import etree from lxml.builder import E import copy import itertools import logging from odoo.tools.translate import _ from odoo.tools import SKIPPED_ELEMENT_TYPES, html_escape _logger = logging.getLogger(__name__) def add_text_before(node, text): """ Add text before ``node`` in its XML tree. """ ...
gpl-3.0
liorvh/infernal-twin
build/pillow/PIL/MpegImagePlugin.py
26
1823
# # The Python Imaging Library. # $Id$ # # MPEG file handling # # History: # 95-09-09 fl Created # # Copyright (c) Secret Labs AB 1997. # Copyright (c) Fredrik Lundh 1995. # # See the README file for information on usage and redistribution. # __version__ = "0.1" from PIL import Image, ImageFile from PIL._bi...
gpl-3.0
n-west/gnuradio
gr-digital/python/digital/qa_burst_shaper.py
18
15530
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2015 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 versio...
gpl-3.0
redhat-openstack/cinder
cinder/tests/test_backup.py
3
31038
# Copyright (C) 2012 Hewlett-Packard Development Company, L.P. # 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/LICEN...
apache-2.0
tsgit/invenio
modules/miscutil/lib/upgrades/invenio_2012_11_27_new_selfcite_tables.py
24
1666
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2012 CERN. ## ## Invenio 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) a...
gpl-2.0
doctorwidget/pelican-plugins
assets/test_assets.py
40
3816
# -*- coding: utf-8 -*- # from __future__ import unicode_literals import hashlib import locale import os from codecs import open from tempfile import mkdtemp from shutil import rmtree import unittest import subprocess from pelican import Pelican from pelican.settings import read_settings from pelican.tests.support im...
agpl-3.0
sacharya/nova
nova/scheduler/filters/trusted_filter.py
13
10553
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2012 Intel, Inc. # Copyright (c) 2011-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 t...
apache-2.0
nealtodd/django
tests/custom_lookups/tests.py
117
24788
from __future__ import unicode_literals import contextlib import time import unittest from datetime import date, datetime from django.core.exceptions import FieldError from django.db import connection, models from django.test import TestCase, override_settings from django.utils import timezone from .models import Au...
bsd-3-clause
VorskiImagineering/C3PO
c3po/mod/communicator.py
2
12045
#!/usr/bin/env python # -*- coding: utf-8 -* import os import subprocess import urlparse from subprocess import Popen, PIPE import gdata.spreadsheet.service import gdata.docs.client import gdata.docs.data import gdata.data import gdata.docs.service from gdata.client import RequestError from c3po.conf import settings...
mit