repo_name
stringlengths
5
100
path
stringlengths
4
294
copies
stringclasses
990 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
SphinxKnight/kuma
kuma/wiki/management/commands/populate_attachments.py
2
6623
from collections import defaultdict from django.core.management.base import BaseCommand from django.db import models from django.utils.text import get_text_list from kuma.attachments.models import Attachment from ...constants import DEKI_FILE_URL, KUMA_FILE_URL from ...models import Document, DocumentAttachment cl...
mpl-2.0
liangfok/controlit_demos
dreamer_controlit_demos/nodes/TestSMACHFSM.py
1
1694
#!/usr/bin/env python import roslib; #roslib.load_manifest('smach_tutorials') import rospy import smach import smach_ros # define state Foo class Foo(smach.State): def __init__(self): smach.State.__init__(self, outcomes=['outcome1','outcome2']) self.counter = 0 def execute(self, userdata): ...
lgpl-2.1
arron9/promotion
vendor/mockery/mockery/docs/conf.py
468
8442
# -*- coding: utf-8 -*- # # Mockery Docs documentation build configuration file, created by # sphinx-quickstart on Mon Mar 3 14:04:26 2014. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. ...
gpl-2.0
kustodian/ansible
lib/ansible/modules/web_infrastructure/ansible_tower/tower_workflow_launch.py
21
5320
#!/usr/bin/python # coding: utf-8 -*- # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], ...
gpl-3.0
routeflow/AutomaticConfigurationRouteFlow
POX_CONTROLLER/pox/lib/packet/eapol.py
47
3220
# Copyright 2011 James McCauley # Copyright 2008 (C) Nicira, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ap...
apache-2.0
praveenkumar/ansible
lib/ansible/plugins/shell/csh.py
92
1131
# (c) 2014, Chris Church <chris@ninemoreminutes.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 lat...
gpl-3.0
harisibrahimkv/django
django/contrib/gis/gdal/prototypes/errcheck.py
82
4151
""" This module houses the error-checking routines used by the GDAL ctypes prototypes. """ from ctypes import c_void_p, string_at from django.contrib.gis.gdal.error import ( GDALException, SRSException, check_err, ) from django.contrib.gis.gdal.libgdal import lgdal # Helper routines for retrieving pointers and...
bsd-3-clause
azatoth/scons
test/no-target.py
5
2417
#!/usr/bin/env python # # __COPYRIGHT__ # # 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, ...
mit
nsat/gnuradio
gr-analog/python/analog/qa_phase_modulator.py
47
1742
#!/usr/bin/env python # # Copyright 2012,2013 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 optio...
gpl-3.0
jhawkesworth/ansible
lib/ansible/modules/storage/netapp/na_elementsw_admin_users.py
38
7113
#!/usr/bin/python # (c) 2017, NetApp, 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 ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], ...
gpl-3.0
mathieurodic/hamsterdb
python/samples/db1.py
2
2752
# # Copyright (C) 2005-2015 Christoph Rupp (chris@crupp.de). # # 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 applicab...
apache-2.0
amyvmiwei/kbengine
kbe/src/lib/python/Lib/distutils/tests/test_util.py
94
11250
"""Tests for distutils.util.""" import os import sys import unittest from copy import copy from test.support import run_unittest from distutils.errors import DistutilsPlatformError, DistutilsByteCompileError from distutils.util import (get_platform, convert_path, change_root, check_environ,...
lgpl-3.0
robbiet480/home-assistant
homeassistant/helpers/collection.py
5
15156
"""Helper to deal with YAML + storage.""" from abc import ABC, abstractmethod import asyncio import logging from typing import Any, Awaitable, Callable, Dict, List, Optional, cast import voluptuous as vol from voluptuous.humanize import humanize_error from homeassistant.components import websocket_api from homeassist...
apache-2.0
ecoal95/servo
tests/wpt/web-platform-tests/tools/third_party/html5lib/html5lib/tests/test_alphabeticalattributes.py
47
2138
from __future__ import absolute_import, division, unicode_literals from collections import OrderedDict import pytest import html5lib from html5lib.filters.alphabeticalattributes import Filter from html5lib.serializer import HTMLSerializer @pytest.mark.parametrize('msg, attrs, expected_attrs', [ ( 'no a...
mpl-2.0
xflows/clowdflows
workflows/migrations/0002_auto__add_field_output_value.py
6
13083
# encoding: 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 field 'Output.value' db.add_column('workflows_output', 'value', self.gf('django.db.models.fields....
mit
54Pany/shadowsocks
shadowsocks/encrypt.py
990
5180
#!/usr/bin/env python # # Copyright 2012-2015 clowwindy # # 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 la...
apache-2.0
ovnicraft/openerp-restaurant
account_analytic_plans/report/__init__.py
445
1084
# -*- 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...
agpl-3.0
TunedMystic/normandy
webapp/settings/dev.py
2
1045
""" Django development settings. """ from base import * import os # --- Debug Settings --- DEBUG = TEMPLATE_DEBUG = True # --- /Debug Settings --- # --- Email Configuration --- # https://docs.djangoproject.com/en/dev/ref/settings/#email-backend EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' # ---...
gpl-2.0
wjcjenny/jinja2
jinja2/compiler.py
335
63846
# -*- coding: utf-8 -*- """ jinja2.compiler ~~~~~~~~~~~~~~~ Compiles nodes into python code. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ from itertools import chain from copy import deepcopy from keyword import iskeyword as is_python_keyword from jinja2...
bsd-3-clause
michael-dev2rights/ansible
lib/ansible/modules/remote_management/foreman/katello.py
15
16607
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2016, Eric D Helms <ericdhelms@gmail.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
gpl-3.0
rizen1892/SmartHomeSolutions-Web
app/motion.py
2
2849
import picamera.array _THRESHOLD = 3 _SKIP_FRAMES = 4 _MIN_FRAMES_WITH_MOTION = 2 _MAG_ERROR = 2 # 2 in scale from 0 to 255 _ANG_ERROR = 0.174 # 0.174 rad (about 10 deg) class Motion(picamera.array.PiMotionAnalysis): def __init__(self, *args, **kwargs): import threading import Queue su...
gpl-2.0
MalloyPower/parsing-python
front-end/testsuite-python-lib/Python-2.4.3/Lib/plat-irix6/WAIT.py
15
5443
# Generated by h2py from /usr/include/sys/wait.h # Included from standards.h def _W_INT(i): return (i) WUNTRACED = 0004 WNOHANG = 0100 _WSTOPPED = 0177 def WIFEXITED(stat): return ((_W_INT(stat)&0377)==0) def WEXITSTATUS(stat): return ((_W_INT(stat)>>8)&0377) def WTERMSIG(stat): return (_W_INT(stat)&0177) def WSTO...
mit
Danielhiversen/home-assistant
tests/components/camera/test_push.py
3
3648
"""The tests for generic camera component.""" import io from datetime import timedelta from homeassistant import core as ha from homeassistant.setup import async_setup_component from homeassistant.util import dt as dt_util from homeassistant.components.http.auth import setup_auth async def test_bad_posting(aioclien...
mit
orgito/ansible
lib/ansible/modules/cloud/google/gcp_container_cluster.py
2
37620
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2017 Google # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # ---------------------------------------------------------------------------- # # *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** # ...
gpl-3.0
asgard-lab/neutron
neutron/agent/l3/dvr_edge_ha_router.py
5
5092
# Copyright (c) 2015 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
hadim/Probabilistic-Programming-and-Bayesian-Methods-for-Hackers
ExamplesFromChapters/Chapter3/ClusteringWithGaussians.py
90
1034
import numpy as np import pymc as pm data = np.loadtxt("../../Chapter3_MCMC/data/mixture_data.csv", delimiter=",") p = pm.Uniform("p", 0, 1) assignment = pm.Categorical("assignment", [p, 1 - p], size=data.shape[0]) taus = 1.0 / pm.Uniform("stds", 0, 100, size=2) ** 2 # notice the size! centers = pm.Normal("cent...
mit
salguarnieri/intellij-community
plugins/hg4idea/testData/bin/hgext/inotify/server.py
90
14406
# server.py - common entry point for inotify status server # # Copyright 2009 Nicolas Dumazet <nicdumz@gmail.com> # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. from mercurial.i18n import _ from mercurial import cmdutil, posix, o...
apache-2.0
40023256/W17test
static/Brython3.1.3-20150514-095342/Lib/inspect.py
637
78935
"""Get useful information from live Python objects. This module encapsulates the interface provided by the internal special attributes (co_*, im_*, tb_*, etc.) in a friendlier fashion. It also provides some help for examining source code and class layout. Here are some of the useful functions provided by this module:...
agpl-3.0
alpgarcia/panels
src/owlwatch/owlwatch.py
1
18230
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright (C) 2015-2017 Bitergia # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any l...
gpl-3.0
Endika/account-payment
account_due_list/__openerp__.py
2
1800
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2011 Domsense srl (<http://www.domsense.com>) # Copyright (C) 2011-2013 Agile Business Group sagl # (<http://www.agilebg.com>) # @author Jordi Esteve <jesteve@zikzakmedia.com> # @autho...
agpl-3.0
kuriositeetti/wamp-tikki
venv/lib/python2.7/site-packages/pip/_vendor/requests/structures.py
1160
2977
# -*- coding: utf-8 -*- """ requests.structures ~~~~~~~~~~~~~~~~~~~ Data structures that power Requests. """ import collections class CaseInsensitiveDict(collections.MutableMapping): """ A case-insensitive ``dict``-like object. Implements all methods and operations of ``collections.MutableMapping...
mit
spoqa/protobuf-v120
python/google/protobuf/internal/descriptor_database_test.py
73
2924
#! /usr/bin/python # # Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # https://developers.google.com/protocol-buffers/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are ...
bsd-3-clause
un33k/robotframework
utest/reporting/test_stringcache.py
26
2601
import time import random import string import unittest import sys from robot.reporting.stringcache import StringCache, StringIndex from robot.utils.asserts import assert_equals, assert_true, assert_false class TestStringCache(unittest.TestCase): def setUp(self): # To make test reproducable log the rand...
apache-2.0
eceglov/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/style/checkers/png_unittest.py
124
5663
# Copyright (C) 2012 Balazs Ankes (bank@inf.u-szeged.hu) University of Szeged # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this lis...
bsd-3-clause
BassantMorsi/finderApp
lib/python2.7/site-packages/numpy/distutils/command/build_src.py
28
30933
""" Build swig and f2py sources. """ from __future__ import division, absolute_import, print_function import os import re import sys import shlex import copy from distutils.command import build_ext from distutils.dep_util import newer_group, newer from distutils.util import get_platform from distutils.errors import D...
mit
Azure/azure-sdk-for-python
sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations/_virtual_network_gateway_connections_operations.py
1
39335
# 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 may ...
mit
karesansui/karesansui
karesansui/gadget/hostby1.py
1
15575
# -*- coding: utf-8 -*- # # This file is part of Karesansui. # # Copyright (C) 2009-2012 HDE, Inc. # # 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 lim...
mit
BlaisProteomics/mzStudio
mzStudio/Comet_GUI.py
1
30899
import wx import os from collections import defaultdict from multiplierz.mzSearch import CometSearch from multiplierz.settings import settings from multiplierz.mzGUI_standalone import file_chooser from multiplierz.mass_biochem import unimod cometExe = settings.get_comet() mod_list = sorted(unimod.site_form_mod_names...
gpl-3.0
lgscofield/odoo
addons/email_template/tests/__init__.py
260
1093
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2012-TODAY OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
agpl-3.0
safarijv/django-waffle
waffle/models.py
8
6824
try: from django.utils import timezone as datetime except ImportError: from datetime import datetime from django.contrib.auth.models import Group from django.db import models from django.db.models.signals import post_save, post_delete, m2m_changed from waffle.compat import AUTH_USER_MODEL, cache from waffle.u...
bsd-3-clause
pybrain2/pybrain2
pybrain/supervised/evolino/variate.py
32
1438
__author__ = 'Michael Isik' from random import uniform, random, gauss from numpy import tan, pi class UniformVariate: def __init__(self, min_val=0., max_val=1.): """ Initializes the uniform variate with a min and a max value. """ self._min_val = min_val self._max_val = max_val ...
bsd-3-clause
binhqnguyen/ln
nsc/scons-local-1.2.0.d20090223/SCons/Tool/pdflatex.py
19
2896
"""SCons.Tool.pdflatex Tool-specific initialization for pdflatex. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons Foundation #...
gpl-2.0
sxjscience/tvm
vta/tests/python/unittest/test_environment.py
5
1176
# 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
addition-it-solutions/project-all
addons/mail/tests/test_invite.py
4
1974
# -*- coding: utf-8 -*- from openerp.addons.mail.tests.common import TestMail from openerp.tools import mute_logger class TestInvite(TestMail): @mute_logger('openerp.addons.mail.mail_mail') def test_invite_email(self): mail_invite = self.env['mail.wizard.invite'].with_context({ 'default_...
agpl-3.0
vaniakov/twisted-intro
twisted-deferred/defer-block.py
10
1216
import sys, time from twisted.internet.defer import Deferred def start_chain(_): print "The start of the callback chain." def blocking_poem(_): def delayed_write(s, delay): time.sleep(delay) sys.stdout.write(s) sys.stdout.flush() delayed_write('\n', 0) delayed_write('I', .6) ...
mit
rht/zulip
zerver/webhooks/librato/tests.py
1
3657
# -*- coding: utf-8 -*- import urllib from zerver.lib.test_classes import WebhookTestCase class LibratoHookTests(WebhookTestCase): STREAM_NAME = 'librato' URL_TEMPLATE = u"/api/v1/external/librato?api_key={api_key}&stream={stream}" FIXTURE_DIR_NAME = 'librato' IS_ATTACHMENT = False def get_body(...
apache-2.0
manazhao/tf_recsys
tensorflow/contrib/tensor_forest/hybrid/python/models/decisions_to_data_then_nn_test.py
101
4681
# 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
birdonwheels5/p2pool-dgbsha
p2pool/util/variable.py
270
2541
import itertools import weakref from twisted.internet import defer, reactor from twisted.python import failure, log class Event(object): def __init__(self): self.observers = {} self.id_generator = itertools.count() self._once = None self.times = 0 def run_and_watch(self, f...
gpl-3.0
drawks/ansible
lib/ansible/modules/network/fortios/fortios_vpn_ipsec_phase2.py
21
21260
#!/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...
gpl-3.0
dudepare/django
django/test/signals.py
240
5928
import os import threading import time import warnings from django.core.signals import setting_changed from django.db import connections, router from django.db.utils import ConnectionRouter from django.dispatch import Signal, receiver from django.utils import timezone from django.utils.functional import empty templat...
bsd-3-clause
techdragon/django
tests/view_tests/tests/test_csrf.py
24
5268
from django.template import TemplateDoesNotExist from django.test import ( Client, RequestFactory, SimpleTestCase, override_settings, ) from django.test.utils import ignore_warnings from django.utils.deprecation import RemovedInDjango20Warning from django.utils.translation import override from django.views.csrf imp...
bsd-3-clause
ntt-sic/keystone
keystone/openstack/common/gettextutils.py
6
12823
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 Red Hat, Inc. # Copyright 2013 IBM Corp. # 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 # # ...
apache-2.0
patrikpettersson/rest-engine
lib/werkzeug/contrib/kickstart.py
95
11336
# -*- coding: utf-8 -*- """ werkzeug.contrib.kickstart ~~~~~~~~~~~~~~~~~~~~~~~~~~ This module provides some simple shortcuts to make using Werkzeug simpler for small scripts. These improvements include predefined `Request` and `Response` objects as well as a predefined `Application` object whi...
mit
xiangke/pycopia
core/pycopia/charbuffer.py
1
2001
#!/usr/bin/python2.4 # vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab # # $Id$ # # Copyright (C) 1999-2006 Keith Dart <keith@kdart.com> # # 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...
lgpl-2.1
ChenJunor/hue
desktop/core/ext-py/PyYAML-3.09/examples/yaml-highlight/yaml_hl.py
95
4429
#!/usr/bin/python import yaml, codecs, sys, os.path, optparse class Style: def __init__(self, header=None, footer=None, tokens=None, events=None, replaces=None): self.header = header self.footer = footer self.replaces = replaces self.substitutions = {} for doma...
apache-2.0
raildo/nova
nova/db/sqlalchemy/migrate_repo/versions/280_add_nullable_false_to_keypairs_name.py
81
1503
# Copyright 2015 Intel Corporation # 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...
apache-2.0
ewindisch/nova
nova/volume/__init__.py
29
1462
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # 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 ...
apache-2.0
sauloal/linuxscripts
apache/var/www/html/saulo/torrent/html/bin/clients/mainline/BTL/platform.py
3
3777
# The contents of this file are subject to the BitTorrent Open Source License # Version 1.1 (the License). You may not copy or use this file, in either # source code or executable form, except in compliance with the License. You # may obtain a copy of the License at http://www.bittorrent.com/license/. # # Software di...
mit
doganaltunbay/odoo
addons/product/report/__init__.py
452
1080
# -*- 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...
agpl-3.0
lisong521/wireshark
tools/dftestlib/time_relative.py
40
1244
# Copyright (c) 2013 by Gilbert Ramirez <gram@alumni.rice.edu> # # 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. # # Th...
gpl-2.0
mrwangxc/zstack-utility
zstacklib/zstacklib/utils/puppet.py
5
1507
''' @author: Frank ''' import shell import ssh import os.path import log import lock logger = log.get_logger(__name__) class PuppetError(Exception): '''puppet error''' def deploy_puppet_module(module_path, node_express=None, node_file_name=None, puppet_node_path='/etc/puppet/manifests/nodes', puppet_module...
apache-2.0
michalliu/OpenWrt-Firefly-Libraries
staging_dir/target-mipsel_1004kc+dsp_uClibc-0.9.33.2/usr/lib/python2.7/lib-tk/Tkconstants.py
375
1493
# Symbolic constants for Tk # Booleans NO=FALSE=OFF=0 YES=TRUE=ON=1 # -anchor and -sticky N='n' S='s' W='w' E='e' NW='nw' SW='sw' NE='ne' SE='se' NS='ns' EW='ew' NSEW='nsew' CENTER='center' # -fill NONE='none' X='x' Y='y' BOTH='both' # -side LEFT='left' TOP='top' RIGHT='right' BOTTOM='bottom' # -relief RAISED='rai...
gpl-2.0
jaryn/dt174b
dt174b/dt174b.py
1
9468
# # Python tool for interfacing the CEM DT-174B Weather Datalogger. # Copyright (C) 2013 Jaroslav Henner # # 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 ...
gpl-3.0
supriyantomaftuh/syzygy
third_party/numpy/files/numpy/lib/benchmarks/benchmark.py
45
1366
from timeit import Timer class Benchmark(dict): """Benchmark a feature in different modules.""" def __init__(self,modules,title='',runs=3,reps=1000): self.module_test = dict((m,'') for m in modules) self.runs = runs self.reps = reps self.title = title def __setitem__(self,...
apache-2.0
sammerry/ansible
lib/ansible/plugins/lookup/redis_kv.py
69
2504
# (c) 2012, Jan-Piet Mens <jpmens(at)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) any later ver...
gpl-3.0
sodafree/backend
build/lib.linux-i686-2.7/django/core/cache/backends/dummy.py
209
1229
"Dummy cache backend" from django.core.cache.backends.base import BaseCache class DummyCache(BaseCache): def __init__(self, host, *args, **kwargs): BaseCache.__init__(self, *args, **kwargs) def add(self, key, value, timeout=None, version=None): key = self.make_key(key, version=version) ...
bsd-3-clause
bgxavier/nova
nova/api/openstack/compute/extensions.py
35
1332
# Copyright 2011 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
TalShafir/ansible
lib/ansible/modules/web_infrastructure/ansible_tower/tower_team.py
27
3178
#!/usr/bin/python # coding: utf-8 -*- # (c) 2017, Wayne Witzel III <wayne@riotousliving.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1...
gpl-3.0
marcusrehm/serenata-de-amor
jarbas/chamber_of_deputies/management/commands/receipts_text.py
2
2681
import csv import lzma import os from concurrent.futures import ThreadPoolExecutor from bulk_update.helper import bulk_update from jarbas.core.management.commands import LoadCommand from jarbas.chamber_of_deputies.models import Reimbursement class Command(LoadCommand): help = 'Load Serenata de Amor receipts tex...
mit
mshuler/cassandra
pylib/cqlshlib/test/basecase.py
21
3011
# 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
boooka/GeoPowerOff
venv/lib/python2.7/site-packages/django/utils/deconstruct.py
70
2066
from __future__ import absolute_import # Avoid importing `importlib` from this package. from importlib import import_module def deconstructible(*args, **kwargs): """ Class decorator that allow the decorated class to be serialized by the migrations subsystem. Accepts an optional kwarg `path` to speci...
apache-2.0
EvanK/ansible
lib/ansible/modules/network/ovs/openvswitch_port.py
102
8041
#!/usr/bin/python # coding: utf-8 -*- # (c) 2013, David Stygstra <david.stygstra@gmail.com> # Portions copyright @ 2015 VMware, 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 ANSI...
gpl-3.0
henrytao-me/openerp.positionq
openerp/addons/project_timesheet/__init__.py
441
1084
# -*- 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
rawodb/bitcoin
test/functional/rpc_bind.py
9
6033
#!/usr/bin/env python3 # Copyright (c) 2014-2017 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test running bitcoind with the -rpcbind and -rpcallowip options.""" import sys from test_framework.te...
mit
zy02636/emacs-config
python-libs/ropemacs/__init__.py
7
19234
"""ropemacs, an emacs mode for using rope refactoring library""" import sys import ropemode.decorators import ropemode.environment import ropemode.interface from Pymacs import lisp from rope.base import utils class LispUtils(ropemode.environment.Environment): def ask(self, prompt, default=None, starting=None): ...
gpl-3.0
Xeralux/tensorflow
tensorflow/contrib/py2tf/impl/conversion.py
1
12693
# 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
rosudrag/eve-wspace
evewspace/account/tests.py
138
1244
# Eve W-Space # Copyright (C) 2013 Andrew Austin and other contributors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your ...
gpl-3.0
mahendra-r/edx-platform
common/lib/chem/chem/chemtools.py
250
10721
"""This module originally includes functions for grading Vsepr problems. Also, may be this module is the place for other chemistry-related grade functions. TODO: discuss it. """ import json import unittest import itertools def vsepr_parse_user_answer(user_input): """ user_input is json generated by vsepr.js...
agpl-3.0
mixturemodel-flow/tensorflow
tensorflow/contrib/cluster_resolver/python/training/cluster_resolver_test.py
57
8759
# 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 applicable ...
apache-2.0
ryano144/intellij-community
python/lib/Lib/site-packages/django/core/management/commands/inspectdb.py
110
7529
import keyword from optparse import make_option from django.core.management.base import NoArgsCommand, CommandError from django.db import connections, DEFAULT_DB_ALIAS class Command(NoArgsCommand): help = "Introspects the database tables in the given database and outputs a Django model module." option_list =...
apache-2.0
rhatdan/selinux
libsemanage/src/pywrap-test.py
3
39446
#!/usr/bin/python import sys import getopt import semanage usage = "\ Choose one of the following tests:\n\ -m for modules\n\ -u for users\n\ -U for add user (warning this will write!)\n\ -s for seusers\n\ -S for add seuser (warning this will write!)\n\ -p for ports\n\ -P for add port (warning this will write!)\n\ -f ...
gpl-2.0
priyesh16/thesis
src/nix-vector-routing/bindings/modulegen__gcc_LP64.py
24
370694
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)) ...
gpl-2.0
wxgeo/geophar
wxgeometrie/sympy/polys/tests/test_injections.py
126
1795
"""Tests for functions that inject symbols into the global namespace. """ from sympy.polys.rings import vring from sympy.polys.fields import vfield from sympy.polys.domains import QQ from sympy.utilities.pytest import raises # make r1 with call-depth = 1 def _make_r1(): return vring("r1", QQ) # make r2 with cal...
gpl-2.0
ConectividadInnovadoraSAdeCV/WeOn
src/weon_daemon_interface.py
1
4440
#!/usr/bin/python import logging import time import datetime import urllib2 import os import sys import subprocess from daemon import runner import multiprocessing import weon_threads import weon_user_management import weon_utils import weon_test class weon_daemonize(): def __init__(self): self.stdin_pa...
apache-2.0
iankronquist/hamper
hamper/tests/test_command.py
3
1166
from unittest import TestCase from hamper.interfaces import Command class CommandSubclass(Command): regex = "^!test(.*)$" def command(self, unused, d, matches): self.matches = matches class TestCommand(TestCase): """ The Command class provides some basic structure for regex-powered com...
mit
AnhellO/DAS_Sistemas
Ago-Dic-2017/Enrique Castillo/Ordinario/test/Lib/site-packages/django/contrib/gis/ptr.py
59
1276
from ctypes import c_void_p class CPointerBase: """ Base class for objects that have a pointer access property that controls access to the underlying C pointer. """ _ptr = None # Initially the pointer is NULL. ptr_type = c_void_p destructor = None null_ptr_exception_class = AttributeE...
mit
anntzer/scikit-learn
sklearn/datasets/_species_distributions.py
11
8726
""" ============================= Species distribution dataset ============================= This dataset represents the geographic distribution of species. The dataset is provided by Phillips et. al. (2006). The two species are: - `"Bradypus variegatus" <http://www.iucnredlist.org/details/3038/0>`_ , the Bro...
bsd-3-clause
40223125/w16btest1
static/Brython3.1.3-20150514-095342/Lib/unittest/test/test_loader.py
738
49593
import sys import types import unittest class Test_TestLoader(unittest.TestCase): ### Tests for TestLoader.loadTestsFromTestCase ################################################################ # "Return a suite of all tests cases contained in the TestCase-derived # class testCaseClass" def te...
agpl-3.0
puzan/ansible
lib/ansible/constants.py
3
29560
# (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
sanketn26/Slic
client/async/loadtest/EchoClient.py
1
1275
__author__ = 'slic' from autobahn.twisted.websocket import WebSocketClientProtocol, \ WebSocketClientFactory class WebSocketEchoProtocol(WebSocketClientProtocol): def onConnect(self, response): print("Server connected: {0}".format(response.peer)) def onOpen(self): print("WebSocket conne...
apache-2.0
ptchankue/youtube-dl
youtube_dl/extractor/abc7news.py
132
2364
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import parse_iso8601 class Abc7NewsIE(InfoExtractor): _VALID_URL = r'https?://abc7news\.com(?:/[^/]+/(?P<display_id>[^/]+))?/(?P<id>\d+)' _TESTS = [ { 'url': 'http://abc7news.com/entertainmen...
unlicense
asbjorn/segpy
segpy-ext/segpy_numpy/segpy_numpy/extract.py
5
21692
"""Tools for interoperability between Segpy and Numpy arrays.""" from collections import namedtuple import numpy as np from segpy.header import Header, SubFormatMeta from segpy.packer import make_header_packer from segpy.util import ensure_superset from segpy_numpy.dtypes import make_dtype def extract_trace_header_f...
agpl-3.0
Natim/sentry
src/sentry/utils/runner.py
5
13876
#!/usr/bin/env python """ sentry.utils.runner ~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2012 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import, print_function from logan.runner import run_app, configure_app import base64 import os impo...
bsd-3-clause
trueblue2704/AskMeAnything
lib/python2.7/site-packages/flask/testsuite/templating.py
562
11237
# -*- coding: utf-8 -*- """ flask.testsuite.templating ~~~~~~~~~~~~~~~~~~~~~~~~~~ Template functionality :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import flask import unittest from flask.testsuite import FlaskTestCase class TemplatingTestCase(Flask...
mit
devanshdalal/scikit-learn
examples/svm/plot_svm_margin.py
88
2540
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= SVM Margins Example ========================================================= The plots below illustrate the effect the parameter `C` has on the separation line. A large value of `C` basically tells our model that w...
bsd-3-clause
rogerscristo/BotFWD
env/lib/python3.6/site-packages/pytests/test_inlinequeryresultcachedphoto.py
1
4943
#!/usr/bin/env python # # A library that provides a Python interface to the Telegram Bot API # Copyright (C) 2015-2017 # Leandro Toledo de Souza <devs@python-telegram-bot.org> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as publis...
mit
Fantu/Cinnamon
files/usr/share/cinnamon/cinnamon-settings/bin/CinnamonGtkSettings.py
3
19824
#!/usr/bin/python3 import os.path import signal try: import tinycss2 except: pass import gi gi.require_version("Gtk", "3.0") from gi.repository import GLib, Gtk, Gio, GObject from xapp.SettingsWidgets import SettingsWidget, Range, Switch SETTINGS_GROUP_NAME = "Settings" ini_instance = None def get_ini_ed...
gpl-2.0
ygol/dotfiles
bin/.venv-ansible-venv/lib/python2.6/site-packages/pip/_vendor/requests/packages/urllib3/packages/ordered_dict.py
1093
8936
# Backport of OrderedDict() class that runs on Python 2.4, 2.5, 2.6, 2.7 and pypy. # Passes Python2.7's test suite and incorporates all the latest updates. # Copyright 2009 Raymond Hettinger, released under the MIT License. # http://code.activestate.com/recipes/576693/ try: from thread import get_ident as _get_ide...
mit
JamesMGreene/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/style/optparser.py
175
19377
# Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org) # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and...
bsd-3-clause
grilo/ansible-1
lib/ansible/modules/cloud/amazon/cloudformation.py
4
23240
#!/usr/bin/python # Copyright: (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 # upcoming features: # - Ted's multifile YAML concatenation # - changesets (and bl...
gpl-3.0