PageRenderTime 280ms queryTime 53ms sortTime 2ms getByIdsTime 64ms findMatchingLines 88ms

100+ results results for 'python config loop' (280 ms)

Not the results you expected?
tt070.py https://github.com/jasoncbautista/Focus-Motivator.git | Python | 156 lines
                    
97Note that in order to see this information printed out on the console, you
                    
98must run this program using python (not pythonw) from a console window.
                    
99
                    
119		self.button1 = Button(self.myContainer1)
                    
120		self.button1.configure(text="OK", background= "green")
                    
121		self.button1.pack(side=LEFT)
                    
126		self.button2 = Button(self.myContainer1)
                    
127		self.button2.configure(text="Cancel", background="red")   
                    
128		self.button2.pack(side=RIGHT)
                    
155myapp = MyApp(root)
                    
156root.mainloop()
                    
                
submitter_app.py https://github.com/luser/socorro.git | Python | 240 lines
                    
1#! /usr/bin/env python
                    
2# This Source Code Form is subject to the terms of the Mozilla Public
                    
15
                    
16from configman import Namespace
                    
17
                    
35    instances of the CrashStorageSystem."""
                    
36    required_config = Namespace()
                    
37    required_config.add_option(
                    
42    )
                    
43    required_config.add_option(
                    
44        'dump_suffix',
                    
47    )
                    
48    required_config.add_option(
                    
49        'dump_field',
                    
54    #--------------------------------------------------------------------------
                    
55    def __init__(self, config, quit_check_callback=None):
                    
56        if isinstance(quit_check_callback, basestring):
                    
                
mboxreader.py https://gitlab.com/janninematt/janninematt | Python | 318 lines
                    
53
                    
54def init_default_config(pelican):
                    
55    from pelican.settings import DEFAULT_CONFIG
                    
55    from pelican.settings import DEFAULT_CONFIG
                    
56    set_default_settings(DEFAULT_CONFIG)
                    
57    if pelican:
                    
109
                    
110        # Loop over all messages, turn them into article objects.
                    
111        all_articles = []
                    
127
                    
128            # Get date object, using python-dateutil as an easy hack.
                    
129            # If there is no date in the message, abort, we shouldn't bother.
                    
134            else:
                    
135                logger.error('No python-dateutil, we cannot continue as ' +
                    
136                             'date formats cannot be parsed. ')
                    
                
hmc.py https://github.com/delallea/DeepLearningTutorials.git | Python | 393 lines
                    
11sharedX = lambda X, name : \
                    
12        shared(numpy.asarray(X, dtype=theano.config.floatX), name=name)
                    
13
                    
42        Symbolic matrix whose rows are velocity vectors.
                    
43    energy_fn: python function
                    
44        Python function, operating on symbolic theano variables, used to compute
                    
64        Symbolic theano tensor which contains the energy associated with the
                    
65        configuration at time-step t.    
                    
66    energy_next: theano vector
                    
67        Symbolic theano tensor which contains the energy associated with the
                    
68        proposed configuration at time-step t+1.    
                    
69    s_rng: theano.tensor.shared_randomstreams.RandomStreams
                    
94        Scalar value controlling amount by which to move
                    
95    energy_fn: python function
                    
96        Python function, operating on symbolic theano variables, used to compute
                    
                
pkgng.py https://gitlab.com/0072016/ansible-modules-extras | Python | 316 lines
                    
1#!/usr/bin/python
                    
2# -*- coding: utf-8 -*-
                    
63              for newer pkgng versions, specify a the name of a repository
                    
64              configured in /usr/local/etc/pkg/repos
                    
65        required: false
                    
121    remove_c = 0
                    
122    # Using a for loop incase of error, we can report the package that failed
                    
123    for package in packages:
                    
                
hql.py https://github.com/aherbert/openmicroscopy.git | Python | 233 lines
                    
1#!/usr/bin/env python
                    
2"""
                    
25
                    
26    def _configure(self, parser):
                    
27        parser.set_defaults(func=self.__call__)
                    
43                    break
                    
44                if not self.hql(args, loop = True):
                    
45                    break
                    
46
                    
47    def hql(self, args, loop = False):
                    
48        from omero_sys_ParametersI import ParametersI
                    
68"""
                    
69        if loop:
                    
70            input = input + """To run another query, press enter\n"""
                    
75
                    
76            # Exit loop
                    
77            if not id:
                    
                
kernelmanager.py https://gitlab.com/pooja043/Globus_Docker_4 | Python | 128 lines
                    
8#-----------------------------------------------------------------------------
                    
9#  Copyright (C) 2013  The IPython Development Team
                    
10#
                    
22
                    
23from IPython.kernel.multikernelmanager import MultiKernelManager
                    
24from IPython.utils.traitlets import (
                    
27
                    
28from IPython.html.utils import to_os_path
                    
29from IPython.utils.py3compat import getcwd
                    
39    def _kernel_manager_class_default(self):
                    
40        return "IPython.kernel.ioloop.IOLoopKernelManager"
                    
41
                    
43    
                    
44    root_dir = Unicode(getcwd(), config=True)
                    
45
                    
                
gdb_si446x.py https://github.com/cire831/mm.git | Python | 305 lines
                    
6#
                    
7# add the following python packages
                    
8#   sudo pip install future
                    
126        bx = radio_config_cmd_ids.parse(ba)
                    
127        bxa = radio_config_commands[radio_config_cmd_ids.build(bx)][1].parse(rt_b)
                    
128    except:
                    
192            ss = None
                    
193            if (i_loop > a_start) and (i_loop <= a_end):
                    
194                ss = get_spi_trace_row_repr(i_this)
                    
219            bgrp = 'PAx' if (grp == 'PA') else grp
                    
220            str = radio_config_groups[radio_config_group_ids.build(grp)]
                    
221            r_a, r_s = get_buf_repr(rd[bgrp], str.sizeof())
                    
278                bgrp = 'PAx' if (grp == 'PA') else grp  # fixup construct module bug
                    
279                buf = radio_config_groups[radio_config_group_ids.build(grp)]
                    
280                r_a, r_s = get_buf_repr(rd[bgrp], buf.sizeof)
                    
                
pywnshow.py https://github.com/balajeerc/lexiconator.git | Python | 174 lines
                    
1#! /usr/bin/env python
                    
2
                    
20		self.pos = None;
                    
21		self.posMenu.config(text='Any')
                    
22	def setPOSNoun(self):
                    
23		self.pos = 'n';
                    
24		self.posMenu.config(text='Noun')
                    
25	def setPOSVerb(self):
                    
26		self.pos = 'v';
                    
27		self.posMenu.config(text='Verb')
                    
28	def setPOSAdj(self):
                    
29		self.pos = 'a';
                    
30		self.posMenu.config(text='Adj')
                    
31	def setPOSAdv(self):
                    
32		self.pos = 'r';
                    
33		self.posMenu.config(text='Adv')
                    
34
                    
                
fastdev.py https://github.com/bataboske/titanium_mobile.git | Python | 468 lines
                    
12
                    
13# we use our compatibility code for python 2.5
                    
14if sys.version_info < (2, 6):
                    
18
                    
19logging.basicConfig(format='[%(levelname)s] [%(asctime)s] %(message)s', level=logging.INFO)
                    
20
                    
118			except socket.timeout, e:
                    
119				# only break the loop when not serving, otherwise timeouts are normal
                    
120				serving = False
                    
                
autoreport.py https://github.com/heca/rextest2.git | Python | 397 lines
                    
1#!/usr/local/bin/python
                    
2
                    
5# - globals-
                    
6# - os.tmpfile() http://docs.python.org/library/os.html#os.tmpfile
                    
7# feature: archives all avatar-test output folders if moveold isnt enabled (or preservelogs is on) wildcard glob
                    
21
                    
22# FTP-CONFIG for fileUpload
                    
23FTPHOST="xxx"
                    
26
                    
27# GITHUB-CONFIG for createGithubIssue
                    
28GITHUBLOGIN="rex-test-autoreport" # user
                    
35# Option for preserving test output files after archive has been created
                    
36configPreserveLogs = False
                    
37# Option for moving test output files to an old archives folder (debug-standalone-run)
                    
38# if preserveLogs is set to false option is ignored
                    
39configMoveOld = False
                    
40# Option for cleaning up (removing temp files) the the folder after running the script
                    
                
app.py https://gitlab.com/baserock/ybd | Python | 320 lines
                    
179    config['total'] = config['tasks'] = config['counter'] = 0
                    
180    config['systems'] = config['strata'] = config['chunks'] = 0
                    
181    config['reproduced'] = []
                    
186    config['defdir'] = os.getcwd()
                    
187    config['extsdir'] = os.path.join(config['defdir'], 'extensions')
                    
188    if config.get('manifest') is True:
                    
188    if config.get('manifest') is True:
                    
189        config['manifest'] = os.path.join(config['defdir'],
                    
190                                          os.path.basename(config['target']) +
                    
228            config['instances'] = 1 + (cpu_count() / 10)
                    
229            config['max-jobs'] = cpu_count() / config['instances']
                    
230
                    
235
                    
236def load_configs(config_files):
                    
237    for config_file in reversed(config_files):
                    
                
pup.py https://bitbucket.org/d1rk/dd-agent.git | Python | 262 lines
                    
1#!/usr/bin/python
                    
2
                    
34# project
                    
35from config import get_config
                    
36from util import json
                    
107
                    
108# Check if using old version of Python. Pup's usage of defaultdict requires 2.5 or later,
                    
109# and tornado only supports 2.5 or later. The agent supports 2.6 onwards it seems.
                    
110if int(sys.version_info[1]) <= 5:
                    
111    sys.stderr.write("Pup requires python 2.6 or later.\n")
                    
112    sys.exit(2)
                    
224
                    
225def run_pup(config):
                    
226    """ Run the pup server. """
                    
237    interval_ms = 2000
                    
238    io_loop = ioloop.IOLoop.instance()
                    
239    scheduler = ioloop.PeriodicCallback(send_metrics, interval_ms, io_loop=io_loop)
                    
                
importOldDatabase.py https://github.com/shamelmerchant/RMG-database.git | Python | 224 lines
                    
1#!/usr/bin/env python
                    
2# encoding: utf-8
                    
32    try:
                    
33        p=subprocess.Popen('git config --get user.name'.split(),
                    
34                stdout=subprocess.PIPE)
                    
43    try:
                    
44        p=subprocess.Popen('git config --get user.email'.split(),
                    
45                stdout=subprocess.PIPE)
                    
98                entry.history.append(event_new)
                    
99                continue # next in for loop
                    
100            entry.history.extend(old_entry.history)
                    
115                entry.history.append(event_new)
                    
116                continue # next in for loop
                    
117            entry.history.extend(old_entry.history)
                    
132                entry.history.append(event_new)
                    
133                continue # next in for loop
                    
134            entry.history.extend(old_entry.history)
                    
                
viastitching_dialog.py https://gitlab.com/benjamin.bonnal/viastitching | Python | 334 lines
                    
1#!/usr/bin/env python
                    
2
                    
67        #Check for selected area
                    
68        if not self.GetAreaConfig():
                    
69            wx.MessageBox(_(u"Please select a valid area"))
                    
110
                    
111    def GetAreaConfig(self):
                    
112        """Check selected area (if any) and verify if it is a valid container for vias.
                    
136
                    
137        #Tricky loop, the iterator should return two values, unluckly I'm not able to use the
                    
138        #first value of the couple so I'm recycling it as netname.
                    
                
PSetTweak.py https://github.com/dmwm/WMCore.git | Python | 448 lines
                    
1#!/usr/bin/env python
                    
2"""
                    
4
                    
5Record a set of tweakable parameters from a CMSSW Configuration in a CMSSW
                    
6independent python structure
                    
28    Dummy PSet object used to construct the Tweak object to mimic
                    
29    the config structure
                    
30
                    
177        Add an attribute as process.pset1.pset2.param = value
                    
178        Value should be the appropriate python type
                    
179
                    
214
                    
215        Loop over all parameters in the tweak, returning the
                    
216        parameter name as a . delimited path and the value
                    
256        Generate setattr call for each parameter in the pset structure
                    
257        Used for generating python format
                    
258
                    
                
register_vpcom.py https://github.com/mypinballs/pyprocgame.git | Python | 333 lines
                    
6import win32com
                    
7import pythoncom
                    
8import win32com.server.util
                    
36
                    
37IID_IController = pythoncom.MakeIID('{CE9ECC7C-960F-407E-B27B-62E39AB1E30F}')
                    
38
                    
101
                    
102		vp_game_map_file = config.value_for_key_path(keypath='vp_game_map_file', default='/.')
                    
103		vp_game_map = yaml.load(open(vp_game_map_file, 'r'))
                    
110
                    
111		#game_config = yaml.load(open(yamlpath, 'r'))
                    
112		#machine_type = game_config['PRGame']['machineType']
                    
128			self.SetSwitch(i, False)
                    
129		thread.start_new_thread(self.game.run_loop,())
                    
130
                    
                
records.py https://gitlab.com/5stones/scylla-spree | Python | 428 lines
                    
4from scylla import convert
                    
5from scylla import configuration
                    
6from scylla import orientdb
                    
39
                    
40        python_classname = 'Spree{0}'.format(classname)
                    
41        for subclass in cls.__subclasses__():
                    
41        for subclass in cls.__subclasses__():
                    
42            if subclass.__name__ == python_classname:
                    
43                cls = subclass
                    
75
                    
76        # check record cache (creates circular reference instead of an infinite loop)
                    
77        if '@rid' in obj and obj['@rid'] in _record_cache:
                    
386    def get_url(self, page=''):
                    
387        return '{}/admin/orders/{}{}'.format(configuration.get('Spree', 'url'),
                    
388                                             self['number'],
                    
                
wps-ap-nfc.py https://gitlab.com/Atomic-ROM/external_wpa_supplicant_8 | Python | 342 lines
                    
1#!/usr/bin/python
                    
2#
                    
23wpas_ctrl = '/var/run/hostapd'
                    
24continue_loop = True
                    
25summary_file = None
                    
70
                    
71def wpas_get_config_token():
                    
72    wpas = wpas_connect()
                    
74        return None
                    
75    ret = wpas.request("WPS_NFC_CONFIG_TOKEN NDEF")
                    
76    if "FAIL" in ret:
                    
198    if only_one:
                    
199        global continue_loop
                    
200        continue_loop = False
                    
204
                    
205def wps_write_config_tag(clf, wait_remove=True):
                    
206    summary("Write WPS config token")
                    
                
dispatcher.py https://gitlab.com/areema/myproject | Python | 317 lines
                    
92        # If DEBUG is on, check that we got a good receiver
                    
93        if settings.configured and settings.DEBUG:
                    
94            assert callable(receiver), "Signal receivers must be callable."
                    
173        If any receiver raises an error, the error propagates back through send,
                    
174        terminating the dispatch loop. So it's possible that all receivers
                    
175        won't be called if an error is raised.
                    
202            sender
                    
203                The sender of the signal. Can be any python object (normally one
                    
204                registered with a connect if you actually want something to
                    
                
Tutorial_3_kernel.py https://gitlab.com/Skibbe/comet | Python | 116 lines
                    
31    # init all 9 combinations for FID's
                    
32    loop0 = ph.loop.buildRectangle([[-40, -20], [0, 20]], max_length=2)
                    
33    loop1 = ph.loop.buildRectangle([[-20, -20], [20, 20]], max_length=2)
                    
33    loop1 = ph.loop.buildRectangle([[-20, -20], [20, 20]], max_length=2)
                    
34    loop2 = ph.loop.buildRectangle([[0, -20], [40, 20]], max_length=2)
                    
35    site = snmr.survey.Survey()
                    
35    site = snmr.survey.Survey()
                    
36    site.addLoop([loop0, loop1, loop2])
                    
37    site.setEarth(mag=48000e-9, incl=60, decl=0)
                    
38    config = ph.config(rho=[1000, 10], d=[10], f=site.earth.larmor)
                    
39    site.setLoopConfig(config)
                    
40    for tx_i in range(3):
                    
50    print(kern)
                    
51    # The kernel class itself has only references to the survey, loops and FID
                    
52    # Changes of parameters like pulses, loop turns etc are made there and
                    
                
irc.py https://gitlab.com/foresterh/skybot | Python | 251 lines
                    
21    replacement = '[censored]'
                    
22    if 'censored_strings' in bot.config:
                    
23        words = map(re.escape, bot.config['censored_strings'])
                    
46        self.socket.connect((self.host, self.port))
                    
47        thread.start_new_thread(self.recv_loop, ())
                    
48        thread.start_new_thread(self.send_loop, ())
                    
62
                    
63    def recv_loop(self):
                    
64        last_timestamp = time.time()
                    
85
                    
86    def send_loop(self):
                    
87        while True:
                    
139
                    
140        thread.start_new_thread(self.parse_loop, ())
                    
141
                    
                
openvpn-dbus-poc-server.py https://gitlab.com/dazo/openvpn-dbus-poc | Python | 351 lines
                    
51#
                    
52#        $ python ./openvpn-dbus-poc-server.py myconfig.ini
                    
53#
                    
56#
                    
57#        $ python ./openvpn-dbus-poc-client.py
                    
58#
                    
88import dbus.service
                    
89from dbus.mainloop.glib import DBusGMainLoop
                    
90
                    
318    # Parse config and do some very simple validation
                    
319    cfg = ConfigParser.ConfigParser()
                    
320    cfg.read(sys.argv[1])
                    
338
                    
339    # Configure our D-Bus main event loop
                    
340    DBusGMainLoop(set_as_default=True)
                    
                
commandline.py https://github.com/fmarani/localXchange.git | Python | 344 lines
                    
1#!/usr/bin/python
                    
2
                    
16import StringIO
                    
17import ConfigParser
                    
18import os.path
                    
338    try:
                    
339        client.cmdloop()
                    
340    except:
                    
                
redemo.py https://gitlab.com/abhi1tb/build | Python | 171 lines
                    
1#!/usr/bin/env python3
                    
2
                    
52        self.stringdisplay.pack(fill=BOTH, expand=1)
                    
53        self.stringdisplay.tag_configure("hit", background="yellow")
                    
54
                    
105            bg = self.promptdisplay['background']
                    
106            self.statusdisplay.config(text="", background=bg)
                    
107        except re.error as msg:
                    
108            self.compiled = None
                    
109            self.statusdisplay.config(
                    
110                    text="re.error: %s" % str(msg),
                    
125            return
                    
126        self.stringdisplay.tag_configure("hit", background="yellow")
                    
127        self.stringdisplay.tag_configure("hit0", background="orange")
                    
155        if nmatches == 0:
                    
156            self.statusdisplay.config(text="(no match)",
                    
157                                      background="yellow")
                    
                
flingo.py https://github.com/vicboy1109/Flingo.git | Python | 344 lines
                    
25from PyQt4 import QtCore, QtGui
                    
26from ConfigParser import RawConfigParser
                    
27#initialize the qt application and load the reactor for qt and twisted
                    
33#get the values from the configuration file
                    
34def update_config(conf_file, config={}):
                    
35   c = config
                    
47def find_config():
                    
48    config = update_config('flingo.conf')
                    
49    conf = os.getenv('FLING_CONF', default='')
                    
50    if conf:
                    
51        config = update_config(conf, config)
                    
52    return config
                    
96#initialize the configuration file and get the values
                    
97config = find_config()
                    
98PORT = int(config.get('port', 8080))
                    
                
test_tiles.py https://github.com/plone/plone.app.blocks.git | Python | 283 lines
                    
7from zope import schema
                    
8from zope.configuration import xmlconfig
                    
9from zope.interface import implementer
                    
15try:
                    
16    # Python 2: "unicode" is built-in
                    
17    unicode
                    
86
                    
87    def setUpZope(self, app, configurationContext):
                    
88        xmlconfig.string(
                    
89            """\
                    
90<configure
                    
91    xmlns="http://namespaces.zope.org/zope"
                    
137
                    
138</configure>
                    
139""",
                    
                
dispatcher.py https://gitlab.com/benji-bou/urotechchallenge-Serenity | Python | 317 lines
                    
78                The sender to which the receiver should respond. Must either be
                    
79                a Python object, or None to receive events from any sender.
                    
80
                    
94        # If DEBUG is on, check that we got a good receiver
                    
95        if settings.configured and settings.DEBUG:
                    
96            assert callable(receiver), "Signal receivers must be callable."
                    
174        If any receiver raises an error, the error propagates back through send,
                    
175        terminating the dispatch loop. So it's possible that all receivers
                    
176        won't be called if an error is raised.
                    
202            sender
                    
203                The sender of the signal. Can be any python object (normally one
                    
204                registered with a connect if you actually want something to
                    
                
threadpoolserver.py https://github.com/frankladen/Orion-avec-cheveux.git | Python | 251 lines
                    
123        threads=len(self.pool)
                    
124        if threads>Pyro4.config.THREADPOOL_MINTHREADS:
                    
125            idle=threads-self.__working
                    
125            idle=threads-self.__working
                    
126            if idle>Pyro4.config.THREADPOOL_MINTHREADS and (time.time()-self.__lastshrink)>Pyro4.config.THREADPOOL_IDLETIMEOUT:
                    
127                for _ in range(idle-Pyro4.config.THREADPOOL_MINTHREADS):
                    
137        bind_location=unixsocket if unixsocket else (host,port)
                    
138        self.sock=socketutil.createSocket(bind=bind_location, reuseaddr=Pyro4.config.SOCK_REUSE, timeout=Pyro4.config.COMMTIMEOUT, noinherit=True)
                    
139        self._socketaddr=self.sock.getsockname()
                    
162
                    
163    def loop(self, loopCondition=lambda: True):
                    
164        log.debug("threadpool server requestloop")
                    
164        log.debug("threadpool server requestloop")
                    
165        while (self.sock is not None) and loopCondition():
                    
166            try:
                    
                
insertkeys.py https://gitlab.com/drgroovestarr/system_sepolicy | Python | 267 lines
                    
94
                    
95            # The last thing to do before looping up is to increment line number
                    
96            lineNo = lineNo + 1
                    
109
                    
110class ParseConfig(ConfigParser.ConfigParser):
                    
111
                    
127                if option != target_build_variant and \
                    
128                option != ParseConfig.OPTION_WILDCARD_TAG:
                    
129                    logging.info("Skipping " + tag + " : " + option +
                    
215    usage  = "usage: %prog [options] CONFIG_FILE MAC_PERMISSIONS_FILE [MAC_PERMISSIONS_FILE...]\n"
                    
216    usage += "This tool allows one to configure an automatic inclusion\n"
                    
217    usage += "of signing keys into the mac_permision.xml file(s) from the\n"
                    
249    # Read the config file
                    
250    config = ParseConfig()
                    
251    config.read(args[0])
                    
                
rtsp.py https://gitlab.com/antarpreets/pynvr | Python | 175 lines
                    
1#!/usr/bin/env python3
                    
2
                    
30logger = logging.getLogger("rtsp")
                    
31logging.basicConfig(filename="/tmp/{}.log".format(deviceid),level=logging.DEBUG)
                    
32
                    
151
                    
152	# Run Live555's event loop in a background thread:
                    
153	t = threading.Thread(target=live555.runEventLoop, args=())
                    
167
                    
168	# Tell Live555's event loop to stop:
                    
169	live555.stopEventLoop()
                    
                
manager.py https://gitlab.com/jerdog/openpilot | Python | 358 lines
                    
1#!/usr/bin/env python
                    
2import os
                    
24
                    
25from selfdrive.loggerd.config import ROOT
                    
26
                    
90  if isinstance(proc, basestring):
                    
91    cloudlog.info("starting python %s" % proc)
                    
92    running[name] = Process(name=name, target=launcher, args=(proc, gctx))
                    
137
                    
138# ****************** run loop ******************
                    
139
                    
168
                    
169  # now loop
                    
170  context = zmq.Context()
                    
274
                    
275# optional, build the c++ binaries and preimport the python for speed
                    
276def manager_prepare():
                    
                
ipengineapp.py https://github.com/cboos/ipython.git | Python | 330 lines
                    
29import zmq
                    
30from zmq.eventloop import ioloop
                    
31
                    
43
                    
44from IPython.config.configurable import Configurable
                    
45
                    
226        sys.path.insert(0, '')
                    
227        config = self.config
                    
228        # print config
                    
273        try:
                    
274            self.engine = EngineFactory(config=config, log=self.log)
                    
275        except:
                    
292        global mpi
                    
293        self.mpi = MPI(config=self.config)
                    
294
                    
                
engine.py https://gitlab.com/pooja043/Globus_Docker_4 | Python | 305 lines
                    
22import zmq
                    
23from zmq.eventloop import ioloop, zmqstream
                    
24
                    
44    # configurables:
                    
45    out_stream_factory=Type('IPython.kernel.zmq.iostream.OutStream', config=True,
                    
46        help="""The OutStream for handling stdout/err.
                    
246                self.log.info("Starting to monitor the heartbeat signal from the hub every %i ms." , self.hb_check_period)
                    
247                self._hb_reporter = ioloop.PeriodicCallback(self._hb_monitor, self.hb_check_period, self.loop)
                    
248                self._hb_reporter.start()
                    
299    def start(self):
                    
300        dc = ioloop.DelayedCallback(self.register, 0, self.loop)
                    
301        dc.start()
                    
301        dc.start()
                    
302        self._abort_dc = ioloop.DelayedCallback(self.abort, self.timeout*1000, self.loop)
                    
303        self._abort_dc.start()
                    
                
errordocument.py https://github.com/renfers/ageliaco.tracker.git | Python | 383 lines
                    
1# (c) 2005-2006 James Gardner <james@pythonweb.org>
                    
2# This module is part of the Python Paste Project and is released under
                    
14from urlparse import urlparse
                    
15from paste.recursive import ForwardRequestException, RecursiveMiddleware, RecursionLoop
                    
16from paste.util import converters
                    
86            return self.app(environ, keep_status_start_response)
                    
87        except RecursionLoop, e:
                    
88            environ['wsgi.errors'].write('Recursion error getting error page: %s\n' % e)
                    
114    ``global_conf``
                    
115        Optional default configuration from your config file. If ``debug`` is
                    
116        set to ``true`` a message will be written to ``wsgi.errors`` on each
                    
119    ``**params``
                    
120        Optional, any other configuration and extra arguments you wish to
                    
121        pass which will in turn be passed back to the custom mapper object.
                    
127
                    
128    .. code-block:: python
                    
129
                    
                
glances_client_browser.py https://gitlab.com/132nd-etcher/glances | Python | 262 lines
                    
43
                    
44    def __init__(self, config=None, args=None):
                    
45        # Store the arg/config
                    
46        self.args = args
                    
47        self.config = config
                    
48        self.static_server = None
                    
65        # Init the static server list (if defined)
                    
66        self.static_server = GlancesStaticServer(config=self.config)
                    
67
                    
68        # Init the password list (if defined)
                    
69        self.password = GlancesPassword(config=self.config)
                    
70
                    
207                args_server.password = self.get_servers_list()[self.screen.active_server]['password']
                    
208                client = GlancesClient(config=self.config, args=args_server, return_to_browser=True)
                    
209
                    
                
test_l2bd.py https://gitlab.com/x1046882802/flexiroutervpp | Python | 289 lines
                    
1#!/usr/bin/env python3
                    
2
                    
22        class VppTestCase) before running the test case, set test case related
                    
23        variables and configure VPP.
                    
24
                    
31        :var int dot1ad_inner_tag: VLAN C-tag for dot1ad sub-interface.
                    
32        :var int sl_pkts_per_burst: Number of packets in burst for single-loop
                    
33            test.
                    
33            test.
                    
34        :var int dl_pkts_per_burst: Number of packets in burst for dual-loop
                    
35            test.
                    
253    def test_l2bd_sl(self):
                    
254        """ L2BD MAC learning single-loop test
                    
255
                    
256        Test scenario:
                    
257            1.config
                    
258                MAC learning enabled
                    
                
definitions.py https://bitbucket.org/tferma/ffc.git | Python | 290 lines
                    
76
                    
77        # FIXME: Make this configurable for easy experimentation with dolfin!
                    
78        # Coordinate dofs for each component are interleaved? Must match dolfin.
                    
80
                    
81        # Configure definitions behaviour
                    
82        if self.ir["integral_type"] in ("custom", "vertex"):
                    
127
                    
128        # Empty loop needs to be skipped as zero tables may not be generated
                    
129        # FIXME: remove at earlier stage so dependent code can also be removed
                    
137        entity = self.symbols.entity(self.ir["entitytype"], mt.restriction)
                    
138        iq = self.symbols.quadrature_loop_index()
                    
139        idof = self.symbols.coefficient_dof_sum_index()
                    
169        #if not ( end - begin <= num_scalar_dofs):
                    
170        #    import IPython; IPython.embed()
                    
171        assert end - begin <= num_scalar_dofs
                    
                
status.py https://bitbucket.org/ikelkar/ece1779_project2.git | Python | 392 lines
                    
1#!/usr/bin/env python
                    
2#
                    
72class MapperInfo(validation.Validated):
                    
73  """Configuration parameters for the mapper part of the job."""
                    
74
                    
140    Returns:
                    
141      A list of configuration dictionaries.
                    
142    """
                    
142    """
                    
143    all_configs = []
                    
144    for config in mapreduce_yaml.mapreduce:
                    
145      out = {
                    
146          "name": config.name,
                    
147          "mapper_input_reader": config.mapper.input_reader,
                    
147          "mapper_input_reader": config.mapper.input_reader,
                    
148          "mapper_handler": config.mapper.handler,
                    
149      }
                    
                
app.py https://gitlab.com/JonW/PCFastRelease-NanoPi | Python | 176 lines
                    
39    global a
                    
40    global continue_loop
                    
41    LoopCount = 600
                    
48    while continue_loop:
                    
49        LoopCount = LoopCount + 1
                    
50        (status,TagType) = MIFAREReader.MFRC522_Request(MIFAREReader.PICC_REQIDL)
                    
59                print("HeartBeat of NFCReader Loop")
                    
60                LoopCount = 0
                    
61                
                    
108        global a
                    
109        global continue_loop
                    
110        LoopCount = 1500
                    
114        while continue_loop:
                    
115            continue_loop = continue_loop + 1
                    
116            if LoopCount >= 1500:
                    
                
plus.py https://bitbucket.org/ts/google-api-python-client.git | Python | 138 lines
                    
1#!/usr/bin/python2.4
                    
2# -*- coding: utf-8 -*-
                    
23Usage:
                    
24  $ python plus.py
                    
25
                    
28
                    
29  $ python plus.py --help
                    
30
                    
32
                    
33  $ python plus.py --logging_level=DEBUG
                    
34"""
                    
62MISSING_CLIENT_SECRETS_MESSAGE = """
                    
63WARNING: Please configure OAuth 2.0
                    
64
                    
121
                    
122    # Don't execute the request until we reach the paging loop below
                    
123    request = service.activities().list(
                    
                
Wirebot.py https://github.com/kvoisine/Make-Projects.git | Python | 238 lines
                    
10Once you have this file all setup.  (Your vertices all set) then it will open the serial port that you specified and connect to the grblShield.  
                    
11Once this is connected  the instructions being sent to your wirebot motors are a "configuration loop".  
                    
12This means that all motors move your center object.  Ours was a ping pong ball up and down.. Forever... This is done to make sure
                    
13that your machine is behaving correctly before trying any of the other pre-defined shapes.   Once you know your machine is functioning 
                    
14correctly (moving up and down) you can comment  out the code that calls the configurationLoop() function.  You can read more about 
                    
15how to do this at the bottom of the source code. 
                    
167        DELAY = 2
                    
168        print "In Configuration Loop... Hit CTRL-C to break this loop..."
                    
169        while(1):
                    
178            sleep(DELAY)
                    
179        print "In Configuration Loop... Hit CTRL-C to break this loop..."
                    
180
                    
231    wb.Zero()              #This will "zero" your wirebot machine.  Make sure your center object is in your desired (0,0,0) or origin.
                    
232    wb.ConfigureLoop()  #Runs the configuration loop,  Comment this out by placing a # in front of it once you determine your machine is behaving correctly
                    
233    
                    
                
tcpclient.py https://github.com/deavid/irpc.git | Python | 235 lines
                    
1#!/usr/local/bin/python3
                    
2import socket
                    
121        self.chatter = irpcchatter.BaseChatter(sock = self.socket, addr = self.addr)
                    
122        self.chatter.setup(self.lang) # Configura y da de alta todo el lenguaje 
                    
123        self.thread = threading.Thread(target=self.chatter.loop)
                    
                
cli_withlist.py https://gitlab.com/pratik4/mailman | Python | 301 lines
                    
26from mailman import public
                    
27from mailman.config import config
                    
28from mailman.core.i18n import _
                    
167                abort=config.db.abort,
                    
168                config=config,
                    
169                getUtility=getUtility
                    
181            try:
                    
182                use_ipython = as_boolean(config.shell.use_ipython)
                    
183            except ValueError:
                    
197        shell = None
                    
198        for starter in (_start_ipython4, _start_ipython1):
                    
199            shell = starter(overrides, banner, debug=debug)
                    
203        else:
                    
204            print(_('ipython is not available, set use_ipython to no'))
                    
205
                    
                
runserver.py https://gitlab.com/HerrTapper/PokemonGoMap | Python | 354 lines
                    
1#!/usr/bin/env python
                    
2# -*- coding: utf-8 -*-
                    
21
                    
22from pogom import config
                    
23from pogom.app import Pogom
                    
27from pogom.models import (init_database, create_tables, drop_tables,
                    
28                          Pokemon, db_updater, clean_db_loop)
                    
29from pogom.webhook import wh_updater
                    
35
                    
36# Moved here so logger is configured at load time.
                    
37logging.basicConfig(
                    
170
                    
171    config['parse_pokemon'] = not args.no_pokemon
                    
172    config['parse_pokestops'] = not args.no_pokestops
                    
172    config['parse_pokestops'] = not args.no_pokestops
                    
173    config['parse_gyms'] = not args.no_gyms
                    
174
                    
                
test_jit_hook.py https://bitbucket.org/pypy/pypy/ | Python | 259 lines
                    
77        token.number = 0
                    
78        di_loop = JitDebugInfo(MockJitDriverSD, logger, token, oplist, 'loop',
                    
79                   greenkey)
                    
81                                        oplist, 'loop', greenkey)
                    
82        di_loop.asminfo = AsmInfo(offset, 0x42, 12)
                    
83        di_bridge = JitDebugInfo(MockJitDriverSD, logger, JitCellToken(),
                    
88            di_loop.oplist = cls.oplist
                    
89            pypy_hooks.after_compile(di_loop)
                    
90
                    
177        def hook(loop):
                    
178            loops.append(loop)
                    
179        pypyjit.set_compile_hook(hook)
                    
180        self.on_compile()
                    
181        loop = loops[0]
                    
182        op = loop.operations[2]
                    
                
coordinator_kamal_approach.py https://gitlab.com/jsanch/udom | Python | 245 lines
                    
1#!/usr/bin/env python
                    
2# -*- encoding: utf-8 -*-
                    
5on force and position sensing.
                    
6The component serves as a configurator/coordinator, i.e. it sets the required
                    
7parameters for all the components and starts/stops them accordingly.
                    
39
                    
40  * `loop_rate`: Node cycle rate (in Hz).
                    
41
                    
68        # Node cycle rate (in Hz).
                    
69        self.loop_rate = rospy.Rate(rospy.get_param('~loop_rate', 10))
                    
70
                    
163            rospy.logdebug("State: {0}".format(state))
                    
164            self.loop_rate.sleep()
                    
165
                    
                
default.py https://gitlab.com/0072016/Facebook-SDK-json- | Python | 258 lines
                    
17
                    
18# Make coding more python3-ish
                    
19from __future__ import (absolute_import, division, print_function)
                    
48
                    
49        if result._task.loop and 'results' in result._result:
                    
50            self._process_items(result)
                    
79
                    
80        if result._task.loop and 'results' in result._result:
                    
81            self._process_items(result)
                    
91        if C.DISPLAY_SKIPPED_HOSTS:
                    
92            if result._task.loop and 'results' in result._result:
                    
93                self._process_items(result)
                    
119        #
                    
120        # So we give people a config option to affect display of the args so
                    
121        # that they can secure this if they feel that their stdout is insecure
                    
                
coordinator.py https://gitlab.com/jsanch/udom | Python | 298 lines
                    
1#!/usr/bin/env python
                    
2# -*- encoding: utf-8 -*-
                    
4This node uses a pipeline of components to demonstrate deformation sensing.
                    
5The component serves as a configurator/coordinator, i.e. it sets the required
                    
6parameters for all the components and starts/stops them accordingly.
                    
35**Parameter(s):**
                    
36  * `loop_rate`: Node cycle rate (in Hz).
                    
37  * `mesh_filename`: Filename of the volumetric mesh in a .veg format. **Note:** This file
                    
37  * `mesh_filename`: Filename of the volumetric mesh in a .veg format. **Note:** This file
                    
38        should be located in the config directory of the `deformation_sensing` package.
                    
39  * `reference_frame`: Reference frame of the object.
                    
73        # Node cycle rate (in Hz).
                    
74        self.loop_rate = rospy.Rate(rospy.get_param('~loop_rate', 10))
                    
75
                    
208            rospy.logdebug("State: {0}".format(state))
                    
209            self.loop_rate.sleep()
                    
210
                    
                
selectreactor.py https://github.com/analogue/mythbox.git | Python | 204 lines
                    
21from twisted.internet import posixbase
                    
22from twisted.python import log
                    
23from twisted.python.runtime import platformType
                    
94        """
                    
95        Run one iteration of the I/O monitor loop.
                    
96
                    
197def install():
                    
198    """Configure the twisted mainloop to be run using the select() reactor.
                    
199    """
                    
                
utils.py https://gitlab.com/yenny.prathivi/PokemonGo-Map | Python | 210 lines
                    
14
                    
15from . import config
                    
16
                    
24
                    
25def verify_config_file_exists(filename):
                    
26    fullpath = os.path.join(os.path.dirname(__file__), filename)
                    
33    # fuck PEP8
                    
34    configpath = os.path.join(os.path.dirname(__file__), '../config/config.ini')
                    
35    parser = configargparse.ArgParser(default_config_files=[configpath])
                    
62                        check {} for more)'.
                    
63                        format(config['LOCALE'], config['LOCALES_DIR']), default='en')
                    
64    parser.add_argument('-c', '--china',
                    
119
                    
120        if config["PASSWORD"] is None and args.password is None:
                    
121            config["PASSWORD"] = args.password = getpass.getpass()
                    
                
cli_withlist.py https://gitlab.com/nikhilrayaprolu/mailman | Python | 301 lines
                    
25from lazr.config import as_boolean
                    
26from mailman.config import config
                    
27from mailman.core.i18n import _
                    
167                abort=config.db.abort,
                    
168                config=config,
                    
169                getUtility=getUtility
                    
181            try:
                    
182                use_ipython = as_boolean(config.shell.use_ipython)
                    
183            except ValueError:
                    
197        shell = None
                    
198        for starter in (_start_ipython4, _start_ipython1):
                    
199            shell = starter(overrides, banner, debug=debug)
                    
203        else:
                    
204            print(_('ipython is not available, set use_ipython to no'))
                    
205
                    
                
coverage.py https://github.com/bcwaldon/nova.git | Python | 324 lines
                    
27
                    
28from oslo.config import cfg
                    
29from webob import exc
                    
45def _import_coverage():
                    
46    """This function ensures loading coverage module from python-coverage."""
                    
47    try:
                    
94        #TODO(mtreinish): Figure out how to bind the backdoor socket to 0.0.0.0
                    
95        # Currently this will only work if the host is resolved as loopback on
                    
96        # the same host as api-server
                    
105            #NOTE(mtreinish): if the port is None then it wasn't set in
                    
106            # the configuration file for this service. However, that
                    
107            # doesn't necessarily mean that we don't have backdoor ports
                    
131        if not self.coverInst:
                    
132            msg = _("Python coverage module is not installed.")
                    
133            raise exc.HTTPServiceUnavailable(explanation=msg)
                    
                
startup.py https://gitlab.com/hounge.mobile/cuckoo-android | Python | 342 lines
                    
21from lib.cuckoo.common.colors import red, green, yellow, cyan
                    
22from lib.cuckoo.common.config import Config
                    
23from lib.cuckoo.common.constants import CUCKOO_ROOT, CUCKOO_VERSION
                    
42    """Checks if working directories are ready.
                    
43    @raise CuckooStartupError: if directories are not properly configured.
                    
44    """
                    
54
                    
55def check_configs():
                    
56    """Checks if config files exist.
                    
62
                    
63    for config in configs:
                    
64        if not os.path.exists(config):
                    
64        if not os.path.exists(config):
                    
65            raise CuckooStartupError("Config file does not exist at "
                    
66                                     "path: {0}".format(config))
                    
                
tcp_serial_redirect.py https://github.com/bewest/pyserial.git | Python | 326 lines
                    
1#!/usr/bin/env python
                    
2
                    
4# redirect data from a TCP/IP connection to a serial port and vice versa
                    
5# requires Python 2.2 'cause socket.sendall is used
                    
6
                    
40    def reader(self):
                    
41        """loop forever and copy serial->socket"""
                    
42        while self.alive:
                    
77    def writer(self):
                    
78        """loop forever and copy socket->serial"""
                    
79        while self.alive:
                    
193        "Network settings",
                    
194        "Network configuration."
                    
195    )
                    
307            sys.stderr.write('Connected by %s\n' % (addr,))
                    
308            # enter network <-> serial loop
                    
309            r = Redirector(
                    
                
wicd-daemon.py https://github.com/RoDaniel/featurehouse.git | Python | 185 lines
                    
17else:
                    
18    from dbus.mainloop.glib import DBusGMainLoop
                    
19    DBusGMainLoop(set_as_default=True)
                    
33        self.options = options
                    
34        if not options.no_load_configuration:
                    
35            self.LoadConfiguration()
                    
84    @dbus.service.method('org.wicd.daemon')
                    
85    def SaveConfiguration(self):
                    
86        ''' Saves the state of the daemon. '''
                    
86        ''' Saves the state of the daemon. '''
                    
87        print 'saving configuration...'
                    
88        self.interface_manager.save()
                    
167    signal.signal(signal.SIGTERM, sigterm_caught)
                    
168    mainloop = gobject.MainLoop()
                    
169    mainloop.run()
                    
                
bot.py https://github.com/tarmack/irctk.git | Python | 222 lines
                    
13from .logging import create_logger
                    
14from .config import Config
                    
15from .reloader import ReloadHandler
                    
39    def __init__(self):
                    
40        self.config = Config(self.root_path, self.default_config)
                    
41        self.plugin = PluginHandler(self.config, self.logger, self.reply)
                    
56                self.config['SSL'],
                    
57                self.config['TIMEOUT'],
                    
58                logger=self.logger,
                    
63                self.config['NICK'], 
                    
64                self.config['REALNAME'], 
                    
65                self.config['CHANNELS'],
                    
216        
                    
217        plugin_lists = [self.config['PLUGINS'], self.config['EVENTS']]
                    
218        self.reloader = ReloadHandler(plugin_lists, self.plugin, self.logger)
                    
                
arandas_controller_node.py https://gitlab.com/jsanch/udom | Python | 314 lines
                    
4This node computes the poses for a set of robots/points to move from a current
                    
5configuration to a target configuration.
                    
6
                    
128        # Dynamic Server Reconfiguration
                    
129        dynamic_reconfig_srv = Server(ArandasController, self.dynamic_reconfig_cb)
                    
130
                    
130
                    
131    def dynamic_reconfig_cb(self, config, level):
                    
132        """
                    
135        """
                    
136        self.gain = config.gain
                    
137        self.scale = config.scale
                    
137        self.scale = config.scale
                    
138        self.saturation = config.saturation
                    
139        self.weights[0] = config.similarity_weight
                    
                
Generatord.py https://github.com/Wkasel/qooxdoo.git | Python | 134 lines
                    
1#!/usr/bin/env python
                    
2# -*- coding: utf-8 -*-
                    
60        uri = daemon.connect(GeneratordWorker(self.num), "genworker"+str(self.num))
                    
61        daemon.requestLoop()
                    
62
                    
97        print "\nrunning on Pyro server", str(self.num), ":", jobname
                    
98        config = generator_context['config']
                    
99        console = generator_context['console']
                    
99        console = generator_context['console']
                    
100        expjobs = config.resolveExtendsAndRuns([jobname])
                    
101        config.includeSystemDefaults(expjobs)
                    
101        config.includeSystemDefaults(expjobs)
                    
102        config.resolveMacros(expjobs)
                    
103        config.resolveLibs(expjobs)
                    
103        config.resolveLibs(expjobs)
                    
104        config.checkSchema(expjobs, checkJobTypes=True)
                    
105        config.cleanUpJobs(expjobs)
                    
                
singletest.py https://gitlab.com/YaoQ/mbed-for-linknode | Python | 263 lines
                    
37           "disk":"J:\\",
                    
38           "peripherals": ["TMP102", "digital_loop", "port_loop", "analog_loop", "SD"]
                    
39    },
                    
43           "disk":"G:\\",
                    
44           "peripherals": ["digital_loop", "port_loop", "analog_loop"]
                    
45    }
                    
111
                    
112    if opts.db_url and opts.verbose_test_configuration_only:
                    
113        detect_database_verbose(opts.db_url)
                    
185
                    
186    if opts.verbose_test_configuration_only:
                    
187        print "MUTs configuration in %s:" % ('auto-detected' if opts.auto_detect else opts.muts_spec_filename)
                    
223
                    
224    single_test = SingleTestRunner(_global_loops_count=opts.test_global_loops_value,
                    
225                                   _test_loops_list=opts.test_loops_list,
                    
                
misc.py https://github.com/kerspoon/laos.git | Python | 347 lines
                    
1#! /usr/local/bin/python
                    
2
                    
42 
                    
43logging.basicConfig(stream=sys.stdout, level=logging.DEBUG,
                    
44    format="%(levelname)s: %(message)s")
                    
55
                    
56       <http://docs.python.org/library/re.html>
                    
57       it's highly recommended that you use raw strings for 
                    
96def TEST_split_every():
                    
97    # should not enter infinite loop with generators and lists
                    
98    split_every(itertools.count(), 10)
                    
299
                    
300    http://stackoverflow.com/questions/894088/how-do-i-get-the-current-file-current-class-and-current-method-with-python
                    
301    http://docs.python.org/library/sys.html
                    
301    http://docs.python.org/library/sys.html
                    
302    http://docs.python.org/library/traceback.html
                    
303    http://www.doughellmann.com/PyMOTW/traceback/
                    
                
system.py https://github.com/hivesolutions/colony_plugins.git | Python | 339 lines
                    
1#!/usr/bin/python
                    
2# -*- coding: utf-8 -*-
                    
85        context_name = connection_parameters.get("context_name", "default")
                    
86        base_path = connection_parameters.get("base_path", "%configuration:" + self.plugin.id + "%")
                    
87
                    
88        # creates the (full) base path by appending the context name and
                    
89        # resolves it (for configuration directories) using the plugin manager
                    
90        base_path = os.path.join(base_path, context_name)
                    
175                if not source_chunk:
                    
176                    # breaks the loop (no more
                    
177                    # data to be copied)
                    
220                if not source_chunk:
                    
221                    # breaks the loop (no more
                    
222                    # data to be copied)
                    
                
checks.py https://gitlab.com/hook/binary-analysis-tool | Python | 328 lines
                    
1#!/usr/bin/python
                    
2
                    
31		## make a copy and add a bogus value for the last
                    
32		## byte to a temporary blacklist to make the loop work
                    
33		## well.
                    
89## in the binary (unless RPATH is used) but determined at runtime: it is dependent on
                    
90## the dynamic linker configuration on the device. With some mixing and matching it is
                    
91## nearly always to determine which library in which path is used, since most installations
                    
                
test_glib.py https://gitlab.com/gregier/pygobject | Python | 247 lines
                    
1# -*- Mode: Python -*-
                    
2# encoding: UTF-8
                    
49
                    
50        for d in GLib.get_system_config_dirs():
                    
51            self.assertTrue('/' in d, d)
                    
87
                    
88    def test_main_loop(self):
                    
89        # note we do not test run() here, as we use this in countless other
                    
90        # tests
                    
91        ml = GLib.MainLoop()
                    
92        self.assertFalse(ml.is_running())
                    
99
                    
100    def test_main_loop_with_context(self):
                    
101        context = GLib.MainContext()
                    
101        context = GLib.MainContext()
                    
102        ml = GLib.MainLoop(context)
                    
103        self.assertFalse(ml.is_running())
                    
                
xlib.py https://bitbucket.org/kolauren/morbify_hackathon.git | Python | 260 lines
                    
1#!/usr/bin/env python
                    
2
                    
62        import traceback
                    
63        print('Python stack trace (innermost last):')
                    
64        traceback.print_stack()
                    
110
                    
111        # Add to event loop select list.  Assume we never go away.
                    
112        app.platform_event_loop._select_devices.add(self)
                    
176 
                    
177    def get_matching_configs(self, template):
                    
178        canvas = XlibCanvas(self.display, None)
                    
178        canvas = XlibCanvas(self.display, None)
                    
179        configs = template.match(canvas)
                    
180        # XXX deprecate
                    
180        # XXX deprecate
                    
181        for config in configs:
                    
182            config.screen = self
                    
                
wicd-cli.py https://github.com/cbxbiker61/wicd.git | Python | 242 lines
                    
1#!/usr/bin/python
                    
2
                    
28else:
                    
29    from dbus.mainloop.glib import DBusGMainLoop
                    
30    DBusGMainLoop(set_as_default=True)
                    
39            'org.wicd.daemon.wired')
                    
40    config = dbus.Interface(bus.get_object('org.wicd.daemon', '/org/wicd/daemon/config'),
                    
41            'org.wicd.daemon.config')
                    
98    is_valid_wired_network_profile(options.name)
                    
99    config.ReadWiredNetworkProfile(options.name)
                    
100    op_performed = True
                    
202                # avoid a race condition where status is updated to "done" after the
                    
203                # loop check
                    
204                if next == "done":
                    
234        is_valid_wireless_network_id(options.network)
                    
235        config.SaveWirelessNetworkProfile(options.network)
                    
236    elif options.wired:
                    
                
json.py https://github.com/davidmorrison/indico.git | Python | 159 lines
                    
24try:
                    
25    from indico.web.wsgi import webinterface_handler_config as apache
                    
26except ImportError:
                    
53    """ obj must be a unicode object, a list or a dictionary
                    
54        This method will loop through the object and change unicode objects into str objects encoded in utf-8.
                    
55        If a list or a dictionary is found during the loop, a recursive call is made.
                    
77            #keys in JSON objects can only be strings, but we still call unicodeToUtf8
                    
78            #for the key in case we have a Python object whose key is a number, etc.
                    
79            obj[unicodeToUtf8(k)] = unicodeToUtf8(v)
                    
                
enigma.py https://github.com/kakunbsc/enigma2.1.git | Python | 364 lines
                    
96eButton = None
                    
97eListboxPythonStringContent = None
                    
98eListbox = None
                    
300
                    
301print "import config"
                    
302import Components.config
                    
308
                    
309Components.config.config.unpickle(my_config)
                    
310
                    
327	import Components.RecordingConfig
                    
328	Components.RecordingConfig.InitRecordingConfig()
                    
329
                    
348	import Components.UsageConfig
                    
349	Components.UsageConfig.InitUsageConfig()
                    
350
                    
                
runserver.py https://gitlab.com/tecta/PokemonGo-Map | Python | 165 lines
                    
1#!/usr/bin/python
                    
2# -*- coding: utf-8 -*-
                    
13
                    
14# Moved here so logger is configured at load time
                    
15logging.basicConfig(format='%(asctime)s [%(threadName)16s][%(module)14s][%(levelname)8s] %(message)s')
                    
43
                    
44from pogom import config
                    
45from pogom.app import Pogom
                    
47
                    
48from pogom.search import search_overseer_thread, fake_search_loop
                    
49from pogom.models import init_database, create_tables, drop_tables, Pokemon, Pokestop, Gym
                    
78
                    
79    config['parse_pokemon'] = not args.no_pokemon
                    
80    config['parse_pokestops'] = not args.no_pokestops
                    
80    config['parse_pokestops'] = not args.no_pokestops
                    
81    config['parse_gyms'] = not args.no_gyms
                    
82
                    
                
registry.py https://github.com/theosp/google_appengine.git | Python | 240 lines
                    
1#!/usr/bin/env python
                    
2#
                    
30
                    
31A configured registry is itself a remote service and should reference itself.
                    
32"""
                    
119      registry: Map of name to service class.  This map is not copied and may
                    
120        be modified after the reigstry service has been configured.
                    
121      modules: Module dict to draw descriptors from.  Defaults to sys.modules.
                    
128    #     that they refer to.  This cache is used to make repeated look-ups
                    
129    #     faster and to prevent circular references from causing endless loops.
                    
130
                    
                
__init__.py https://github.com/joaoalf/geraldo.git | Python | 151 lines
                    
36            # Assign directly to self.__dict__, because otherwise we'd call
                    
37            # __setattr__(), which would be an infinite loop.
                    
38            self.__dict__['_target'] = value
                    
47        is used the first time we need any settings at all, if the user has not
                    
48        previously configured the settings manually.
                    
49        """
                    
55            # NOTE: This is arguably an EnvironmentError, but that causes
                    
56            # problems with Python's interactive help.
                    
57            raise ImportError("Settings cannot be imported, because environment variable %s is undefined." % ENVIRONMENT_VARIABLE)
                    
62        """
                    
63        Called to manually configure the settings. The 'default_settings'
                    
64        parameter sets where to retrieve any unspecified values from (its
                    
78        return bool(self._target)
                    
79    configured = property(configured)
                    
80
                    
                
sqlitedb.py https://github.com/cboos/ipython.git | Python | 408 lines
                    
23
                    
24from zmq.eventloop import ioloop
                    
25
                    
95        help="""The filename of the sqlite task database. [default: 'tasks.db']""")
                    
96    location = Unicode('', config=True,
                    
97        help="""The directory containing the sqlite task database.  The default
                    
98        is to use the cluster_dir location.""")
                    
99    table = Unicode("", config=True,
                    
100        help="""The SQLite Table to use for storing tasks for this session. If unspecified,
                    
160            # get current profile
                    
161            from IPython.core.application import BaseIPythonApplication
                    
162            if BaseIPythonApplication.initialized():
                    
174        # assumes we are being run in a zmq ioloop app
                    
175        loop = ioloop.IOLoop.instance()
                    
176        pc = ioloop.PeriodicCallback(self._db.commit, 2000, loop)
                    
                
css_vcp.py https://github.com/araisrobo/linuxcnc.git | Python | 324 lines
                    
1#/usr/bin/env python
                    
2# -*- coding: UTF-8 -*
                    
12import linuxcnc
                    
13import ConfigParser
                    
14import zmq
                    
118        # looping: if (task_mode == "MANUAL") and (task_state == "ON") and (exec_state == "DONE") and (interp_state == "IDLE"):
                    
119        # looping:     # print ("task_mode: manual...")
                    
120        # looping:     # print ("about to cycle-start...")
                    
120        # looping:     # print ("about to cycle-start...")
                    
121        # looping:     # if self.emcstat.interp_state == self.emc.INTERP_IDLE:
                    
122        # looping:     self.e.c.mode(linuxcnc.MODE_AUTO)
                    
122        # looping:     self.e.c.mode(linuxcnc.MODE_AUTO)
                    
123        # looping:     self.e.c.wait_complete()    # linuxcnc.command
                    
124        # looping:     self.e.c.auto(linuxcnc.AUTO_RUN, 0)
                    
210        # set ui theme
                    
211        config = ConfigParser.ConfigParser()
                    
212        fn = os.path.expanduser(".touchy_preferences")
                    
                
test.py https://github.com/esmanhotto/emesene.git | Python | 142 lines
                    
1#!/usr/bin/env python
                    
2
                    
14
                    
15logging.basicConfig(level=logging.DEBUG)
                    
16
                    
122
                    
123    mainloop = gobject.MainLoop(is_running=True)
                    
124
                    
125    def quit():
                    
126        mainloop.quit()
                    
127
                    
134
                    
135    while mainloop.is_running():
                    
136        try:
                    
136        try:
                    
137            mainloop.run()
                    
138        except KeyboardInterrupt:
                    
                
cw.py https://github.com/sinzim/Campus-Warder.git | Python | 392 lines
                    
37        self.mainframe = Frame(self.root, bg='white', border=0)
                    
38        self.values = CONFIG()
                    
39        self.labels_pnames = []
                    
218
                    
219        config = ConfigParser.RawConfigParser()
                    
220        config.read('cw.cfg')
                    
231                    'process_name')
                    
232                up_limit = int(config.get('Program' + str(program_no),
                    
233                    'up_limit'))
                    
299    def __init__(self, config):
                    
300        self.config = config
                    
301        self.up = 0
                    
311            '%s:%s' % (self.config.router_user, 
                    
312            self.config.router_pass))[:-1]
                    
313        authheader =  "Basic %s" % base64string
                    
                
coordinator_icra.py https://gitlab.com/jsanch/udom | Python | 357 lines
                    
1#!/usr/bin/env python
                    
2# -*- encoding: utf-8 -*-
                    
4This node uses a pipeline of components to perform deformation control using a
                    
5a KUKA arm and a force/torque sensor. The component serves as a configurator/coordinator,
                    
6i.e. it sets the required parameters for all the components and starts/stops them accordingly.
                    
56
                    
57  * `loop_rate`: Node cycle rate (in Hz).
                    
58  * `mesh_filename`: Filename of the volumetric mesh in a .veg format. **Note:** This file
                    
58  * `mesh_filename`: Filename of the volumetric mesh in a .veg format. **Note:** This file
                    
59        should be located in the config directory of the `deformation_sensing` package.
                    
60  * `object_frame`: Reference frame of the object.
                    
97        # Node cycle rate (in Hz).
                    
98        self.loop_rate = rospy.Rate(rospy.get_param('~loop_rate', 500))
                    
99
                    
260            rospy.logdebug("State: {0}".format(state))
                    
261            self.loop_rate.sleep()
                    
262
                    
                
hybrid.py https://gitlab.com/GCS2016/AppRecommender | Python | 227 lines
                    
1#!/usr/bin/env python
                    
2"""
                    
29
                    
30from config import Config
                    
31from recommender import Recommender, RecommendationResult
                    
49
                    
50    cfg = Config()
                    
51    population_sample = []
                    
112
                    
113    # main loop per user
                    
114    for submission_file in population_sample:
                    
                
manager_worker_broker.py https://gitlab.com/brian0218/rk3066_r-box_android4.2.2_sdk | Python | 349 lines
                    
32(TestRunner2) to the workers: it provides a messaging abstraction and
                    
33message loops (building on top of message_broker2), and handles starting
                    
34workers by launching threads and/or processes depending on the
                    
34workers by launching threads and/or processes depending on the
                    
35requested configuration.
                    
36
                    
55
                    
56# Handle Python < 2.6 where multiprocessing isn't available.
                    
57try:
                    
98    Returns:
                    
99        A handle to an object that will talk to a message broker configured
                    
100        for the normal manager/worker communication.
                    
137        """Callback for the worker to start executing. Typically does any
                    
138        remaining initialization and then calls broker_connection.run_message_loop()."""
                    
139        raise NotImplementedError
                    
                
climain.py https://gitlab.com/dglmoore/betse | Python | 368 lines
                    
86        #  * If a global "help.SUBCOMMANDS_{subcommand.name}" dictionary
                    
87        #    exists, non-recursively loop over that dictionary in the same
                    
88        #    manner as well. Hence, this generalizes support of subcommand
                    
99
                    
100        # Configure arg parsing for subcommands of the "plot" subcommand.
                    
101        self._arg_parser_plot = subcommand_name_to_subparser['plot']
                    
187        # Basename of the sample configuration file to be created.
                    
188        config_basename = 'sample_sim.yaml'
                    
189
                    
201            logs.log_info(
                    
202                'Reusing simulation configuration "%s".', config_basename)
                    
203        # Else, create this file.
                    
360        '''
                    
361        Simulation runner preconfigured with sane defaults.
                    
362        '''
                    
                
counter.py https://github.com/ChuguluGames/mediawiki-svn.git | Python | 127 lines
                    
1#!/usr/bin/python
                    
2
                    
4#	Reads squid logs (https://wikitech.leuksman.com/view/Squid_log_format)
                    
5#	Normalizes page name, aggregates them for a configurable time window, shoves the 
                    
6#	aggregates into a database.
                    
10#Notes:
                    
11# * Requires pyjudy (http://www.dalkescientific.com/Python/PyJudy.html)
                    
12#   (python dicts and sets use too much darn memory)
                    
30
                    
31def runLoop(inputFile, targetPages=None):
                    
32	for line in inputFile:
                    
124		targetPages = setFromFile(sys.argv[1])
                    
125		runLoop(sys.stdin, targetPages)
                    
126	else:
                    
126	else:
                    
127		runLoop(sys.stdin)
                    
128
                    
                
StageInMgr.py https://github.com/PerilousApricot/WMCore.git | Python | 291 lines
                    
1#!/usr/bin/env python
                    
2"""
                    
12
                    
13from WMCore.Storage.SiteLocalConfig import loadSiteLocalConfig
                    
14
                    
24
                    
25    Exception used to escape stage out loop when stage out is successful
                    
26    """
                    
60        if self.override == False:
                    
61            self.siteCfg = loadSiteLocalConfig()
                    
62
                    
79            msg = "Unable to retrieve local stage out command\n"
                    
80            msg += "From site config file.\n"
                    
81            msg += "Unable to perform StageOut operation"
                    
88            msg = "Unable to retrieve local stage out se-name\n"
                    
89            msg += "From site config file.\n"
                    
90            msg += "Unable to perform StageOut operation"
                    
                
socks5.py https://gitlab.com/jslee1/bitcoin | Python | 161 lines
                    
1#!/usr/bin/env python3
                    
2# Copyright (c) 2015-2016 The Bitcoin Core developers
                    
33### Implementation classes
                    
34class Socks5Configuration(object):
                    
35    '''Proxy configuration'''
                    
155        self.running = False
                    
156        # connect to self to end run loop
                    
157        s = socket.socket(self.conf.af)
                    
                
slidepuzzle.py https://gitlab.com/omair.hassaan/RaspberryPi_Codes-Tutorials | Python | 332 lines
                    
1# Slide Puzzle
                    
2# By Al Sweigart al@inventwithpython.com
                    
3# http://inventwithpython.com/pygame
                    
58    SOLVEDBOARD = getStartingBoard() # a solved board is the same as the board in a start state.
                    
59    allMoves = [] # list of moves made from the solved configuration
                    
60
                    
60
                    
61    while True: # main game loop
                    
62        slideTo = None # the direction, if any, a tile should slide
                    
69        checkForQuit()
                    
70        for event in pygame.event.get(): # event handling loop
                    
71            if event.type == MOUSEBUTTONUP:
                    
295def generateNewPuzzle(numSlides):
                    
296    # From a starting configuration, make numSlides number of moves (and
                    
297    # animate these moves).
                    
                
gthread.py https://gitlab.com/chaifegn/myblog | Python | 363 lines
                    
6# design:
                    
7# a threaded worker accepts connections in the main loop, accepted
                    
8# connections are are added to the thread pool as a connection job. On
                    
8# connections are are added to the thread pool as a connection job. On
                    
9# keepalive connections are put back in the loop waiting for an event.
                    
10# If no event happen after the keep alive timeout, the connectoin is
                    
35    You need to install the 'futures' package to use this worker with this
                    
36    Python version.
                    
37    """)
                    
97    @classmethod
                    
98    def check_config(cls, cfg, log):
                    
99        max_keepalived = cfg.worker_connections - cfg.threads
                    
193    def run(self):
                    
194        # init listeners, add them to the event loop
                    
195        for s in self.sockets:
                    
                
baseapp.py https://github.com/cboos/ipython.git | Python | 263 lines
                    
31
                    
32from IPython.config.application import catch_config_error
                    
33from IPython.core import release
                    
61        contact_email = release.author_email
                    
62        bug_tracker = 'https://github.com/ipython/ipython/issues'
                    
63        super(ParallelCrashHandler,self).__init__(
                    
137    def _config_files_default(self):
                    
138        return ['ipcontroller_config.py', 'ipengine_config.py', 'ipcluster_config.py']
                    
139    
                    
139    
                    
140    loop = Instance('zmq.eventloop.ioloop.IOLoop')
                    
141    def _loop_default(self):
                    
141    def _loop_default(self):
                    
142        from zmq.eventloop.ioloop import IOLoop
                    
143        return IOLoop.instance()
                    
                
menuDemo.py https://bitbucket.org/haploc/pythonscripts.git | Python | 110 lines
                    
17        self.master.title("Toolbars and Menus") # set window-manager info
                    
18        self.master.iconname('tkpython')        # label when iconified
                    
19
                    
23        L = Label(self, text='Menu and Toolbar Demo')
                    
24        L.config(relief=SUNKEN, width=40, height=10, bg='white')
                    
25        L.pack(expand=YES, fill=BOTH)
                    
39        toolbar.pack(side=BOTTOM, fill=X)
                    
40        photos = 'ora-lp4e-big.jpg', 'PythonPoweredAnim.gif', 'python_conf_ora.gif'
                    
41        self.toolPhotoObjs = []
                    
57        toolbar.pack(side=BOTTOM, fill=X)
                    
58        photos = 'ora-lp4e.gif', 'pythonPowered.gif', 'python_conf_ora.gif'
                    
59        self.toolPhotoObjs = []
                    
92    def imageMenu(self):
                    
93        photoFiles = ('ora-lp4e.gif', 'pythonPowered.gif', 'python_conf_ora.gif')
                    
94        pulldown = Menu(self.menubar)
                    
                
mesh_publisher_gui_node.py https://gitlab.com/jsanch/udom | Python | 228 lines
                    
11**Parameter(s):**
                    
12  * `loop_rate`: Node cycle rate (in Hz).
                    
13  * `zero_index`: Whether the elements index start from zero (false means they start from one).
                    
13  * `zero_index`: Whether the elements index start from zero (false means they start from one).
                    
14  * `mesh_config`: The name of the folder containing a .ele and a .node file with the same
                    
15    name as the directory, which describe the configuration of the mesh. The path is assumed
                    
15    name as the directory, which describe the configuration of the mesh. The path is assumed
                    
16    to be the `config` directory of this package.
                    
17
                    
81    mesh_file = entry.get()
                    
82    config_path = package_path + '/config/' + mesh_file + '/'
                    
83    # TODO: handle the case where zero_index is False
                    
127    # Node cycle rate (in Hz).
                    
128    loop_rate = rospy.Rate(rospy.get_param('~loop_rate', 100))
                    
129
                    
                
test_prefilter.py https://github.com/cboos/ipython.git | Python | 440 lines
                    
6
                    
7Usage: run from the command line with *normal* python, not ipython:
                    
8> python test_prefilter.py
                    
17sys.path.append('..')
                    
18import IPython
                    
19import IPython.ipapi
                    
23    if sys.argv[1] == '-v':
                    
24        sys.argv = sys.argv[:-1]  # IPython is confused by -v, apparently
                    
25        verbose = True
                    
26
                    
27IPython.Shell.start()
                    
28
                    
425#
                    
426# user > ipython internal > python builtin > alias > magic
                    
427
                    
                
lda_worker.py https://gitlab.com/pierreEffiScience/TwitterClustering | Python | 134 lines
                    
1#!/usr/bin/env python
                    
2# -*- coding: utf-8 -*-
                    
14
                    
15Example: python -m gensim.models.lda_worker
                    
16"""
                    
56        """
                    
57        Request jobs from the dispatcher, in a perpetual loop until `getstate()` is called.
                    
58        """
                    
117def main():
                    
118    logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO)
                    
119    logger.info("running %s" % " ".join(sys.argv))
                    
                
controlsd.py https://gitlab.com/jerdog/openpilot | Python | 375 lines
                    
1#!/usr/bin/env python
                    
2import os
                    
12
                    
13from selfdrive.config import Conversions as CV
                    
14from common.services import service_list
                    
89
                    
90  # start the loop
                    
91  set_realtime_priority(2)
                    
238
                    
239      # reset the PID loops
                    
240      LaC.reset()
                    
251
                    
252    # *** gas/brake PID loop ***
                    
253    final_gas, final_brake = LoC.update(enabled, CS.vEgo, v_cruise_kph, AC.v_target_lead, AC.a_target, AC.jerk_factor, CP)
                    
254
                    
255    # *** steering PID loop ***
                    
256    final_steer, sat_flag = LaC.update(enabled, CS.vEgo, CS.steeringAngle, CS.steeringPressed, PP.d_poly, angle_offset, CP)
                    
                
Interactive.py https://github.com/akesling/chromium.git | Python | 376 lines
                    
79#
                    
80# - A command to run the configure subsystem separately (must see how
                    
81#   this interacts with the new automake model).
                    
83# - Command-line completion of target names; maybe even of SCons options?
                    
84#   Completion is something that's supported by the Python cmd module,
                    
85#   so this should be doable without too much trouble.
                    
375                            target_top = target_top)
                    
376    c.cmdloop()
                    
377
                    
                
realm.py https://github.com/sduchesneau/shinken.git | Python | 431 lines
                    
1#!/usr/bin/env python
                    
2#Copyright (C) 2009-2010 :
                    
75    # Use to make pyton properties
                    
76    # TODO : change itemgroup function pythonize?
                    
77    def pythonize(self):
                    
81                old_val = getattr(self, prop)
                    
82                new_val = tab.pythonize(old_val)
                    
83                #print "Changing ", old_val, "by", new_val
                    
98        # rec_tag is set to False avery HG we explode
                    
99        # so if True here, it must be a loop in HG
                    
100        # calls... not GOOD!
                    
101        if self.rec_tag:
                    
102            err = "Error : we've got a loop in realm definition %s" % self.get_name()
                    
103            self.configuration_errors.append(err)
                    
108
                    
109        #Ok, not a loop, we tag it and continue
                    
110        self.rec_tag = True
                    
                
nvwave.py https://bitbucket.org/nvdaaddonteam/nvda.git | Python | 328 lines
                    
6
                    
7"""Provides a simple Python interface to playing audio using the Windows multimedia waveOut functions, as well as other useful utilities.
                    
8"""
                    
14import wave
                    
15import config
                    
16
                    
46	("dwFlags", DWORD),
                    
47	("dwLoops", DWORD),
                    
48	("lpNext", LPWAVEHDR),
                    
319		fileWavePlayer.stop()
                    
320	fileWavePlayer = WavePlayer(channels=f.getnchannels(), samplesPerSec=f.getframerate(),bitsPerSample=f.getsampwidth()*8, outputDevice=config.conf["speech"]["outputDevice"])
                    
321	fileWavePlayer.feed(f.readframes(f.getnframes()))
                    
                
pure.py https://gitlab.com/GCS2016/AppRecommender | Python | 223 lines
                    
1#!/usr/bin/env python
                    
2"""
                    
29
                    
30from config import Config
                    
31from evaluation import Evaluation, Precision, F_score
                    
67
                    
68    cfg = Config()
                    
69    population_sample = []
                    
119
                    
120        # main loop per user
                    
121        for submission_file in population_sample:
                    
                
app.py https://github.com/comger/kpages.git | Python | 113 lines
                    
1#!/usr/bin/env python
                    
2# -*- coding:utf-8 -*-
                    
6import tornado.web
                    
7import tornado.ioloop
                    
8import tornado.options
                    
15from kpages.context import LogicContext
                    
16from kpages.utility import refresh_config, app_path, set_default_encoding, get_members
                    
17
                    
84            server.start(0)
                    
85        #tornado.ioloop.IOLoop.instance().start()
                    
86        tornado.ioloop.IOLoop.current().start()
                    
94define("port", default=None, help="run on the given port", type=int)
                    
95define("config", default='setting.py', help="set config for server")
                    
96define("ip",  help="bind accept ip  for server")
                    
104    opts = options
                    
105    refresh_config(opts.config)
                    
106
                    
                
update.py https://github.com/sunlightlabs/billy.git | Python | 403 lines
                    
1#!/usr/bin/env python
                    
2from __future__ import print_function
                    
36
                    
37def _get_configured_scraper(scraper_type, options, metadata):
                    
38    try:
                    
63
                    
64    scraper = _get_configured_scraper(scraper_type, options, metadata)
                    
65    ua_email = os.environ.get('BILLY_UA_EMAIL')
                    
77
                    
78    # Removed from the inner loop due to non-bicameral scrapers
                    
79    scrape = {
                    
119    _clear_scraped_data(options.output_dir, 'bills')
                    
120    scraper = _get_configured_scraper('bills', options, metadata)
                    
121
                    
169            'what to scrape', 'flags that help select what data to scrape')
                    
170        scrape = parser.add_argument_group('scraper config',
                    
171                                           'settings for the scraper')
                    
                
__init__.py https://github.com/andrewkuzmych/litclub.git | Python | 144 lines
                    
1"""
                    
2Settings and configuration for Django.
                    
3
                    
17    A lazy proxy for either global Django settings or a custom settings object.
                    
18    The user can manually configure settings prior to using them. Otherwise,
                    
19    Django uses the settings module pointed to by DJANGO_SETTINGS_MODULE.
                    
36            # Assign directly to self.__dict__, because otherwise we'd call
                    
37            # __setattr__(), which would be an infinite loop.
                    
38            self.__dict__['_target'] = value
                    
47        is used the first time we need any settings at all, if the user has not
                    
48        previously configured the settings manually.
                    
49        """
                    
55            # NOTE: This is arguably an EnvironmentError, but that causes
                    
56            # problems with Python's interactive help.
                    
57            raise ImportError("Settings cannot be imported, because environment variable %s is undefined." % ENVIRONMENT_VARIABLE)
                    
                
aboutDialog.py https://bitbucket.org/glix/python.git | Python | 150 lines
                    
16        Toplevel.__init__(self, parent)
                    
17        self.configure(borderwidth=5)
                    
18        self.geometry("+%d+%d" % (parent.winfo_rootx()+30,
                    
51        #                  padx=0, pady=3)
                    
52        byline = "Python's Integrated DeveLopment Environment" + 5*'\n'
                    
53        labelDesc = Label(frameBg, text=byline, justify=LEFT,
                    
55        labelDesc.grid(row=2, column=0, sticky=W, columnspan=3, padx=10, pady=5)
                    
56        labelEmail = Label(frameBg, text='email:  idle-dev@python.org',
                    
57                           justify=LEFT, fg=self.fg, bg=self.bg)
                    
59                        sticky=W, padx=10, pady=0)
                    
60        labelWWW = Label(frameBg, text='www:  http://www.python.org/idle/',
                    
61                         justify=LEFT, fg=self.fg, bg=self.bg)
                    
65                                         columnspan=3, padx=5, pady=5)
                    
66        labelPythonVer = Label(frameBg, text='Python version:  ' + \
                    
67                               sys.version.split()[0], fg=self.fg, bg=self.bg)
                    
                
sparse_tensor_dense_matmul_op_test.py https://gitlab.com/github-cloud-corporation/tensorflow | Python | 262 lines
                    
26
                    
27from tensorflow.python.ops import sparse_ops
                    
28# pylint: enable=g-bad-import-order,unused-import
                    
134  def _timeit(iterations, _):
                    
135    (_, final) = tf.while_loop(
                    
136        lambda t, _: t < iterations, body, (t0, v0),
                    
163    thresh, m, k, n, adjoint_a, adjoint_b, use_gpu, skip_dense=False):
                    
164  config = tf.ConfigProto()
                    
165  config.allow_soft_placement = True
                    
192  else:
                    
193    with tf.Session("", config=config, graph=tf.Graph()) as sess:
                    
194      if not use_gpu:
                    
207  # Using sparse_tensor_dense_matmul.
                    
208  with tf.Session("", config=config, graph=tf.Graph()) as sess:
                    
209    if not use_gpu:
                    
                
prey-trigger.py https://github.com/LongRider/prey.git | Python | 134 lines
                    
17
                    
18from SystemConfiguration import \
                    
19	SCDynamicStoreCreate, \
                    
24	CFAbsoluteTimeGetCurrent, \
                    
25	CFRunLoopAddSource,  \
                    
26	CFRunLoopGetCurrent, \
                    
49def interface_connected(interface):
                    
50	return subprocess.call(["ipconfig", "getifaddr", interface]) == 0
                    
51
                    
111	CFRunLoopAddSource(
                    
112		# NSRunLoop.currentRunLoop().getCFRunLoop(),
                    
113		CFRunLoopGetCurrent(),
                    
123	CFRunLoopAddTimer(
                    
124		NSRunLoop.currentRunLoop().getCFRunLoop(),
                    
125		CFRunLoopTimerCreate(None, CFAbsoluteTimeGetCurrent(), 2.0, 0, 0, timer_callback, None),
                    
                
echoserver.py https://github.com/frankladen/Orion-avec-cheveux.git | Python | 128 lines
                    
4
                    
5  :command:`python -m Pyro4.test.echoserver`
                    
6
                    
9
                    
10Pyro - Python Remote Objects.  Copyright by Irmen de Jong (irmen@razorvine.net).
                    
11"""
                    
57        self.started.set()
                    
58        self.ns_daemon.requestLoop()
                    
59
                    
90        hmac=bytes(hmac,"utf-8")
                    
91    Pyro4.config.HMAC_KEY=hmac or Pyro4.config.HMAC_KEY
                    
92    if not options.quiet and Pyro4.config.HMAC_KEY:
                    
123    else:
                    
124        d.requestLoop(loopCondition=lambda:not echo.must_shutdown)
                    
125    d.close()
                    
                
runcpserver.py https://github.com/jcrobak/hue.git | Python | 146 lines
                    
1#!/usr/bin/env python
                    
2# Licensed to Cloudera, Inc. under one
                    
52        if not conf.ENABLE_CHERRYPY_SERVER.get():
                    
53          logging.info("Desktop is configured to not start CherryPy server.")
                    
54          sys.exit(0)
                    
119        drop_privileges_if_necessary(options)
                    
120        server.listen_and_loop()
                    
121    except KeyboardInterrupt:
                    
                
conftest.py https://github.com/shazow/urllib3.git | Python | 343 lines
                    
28
                    
29        asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())  # type: ignore[attr-defined]
                    
30
                    
68
                    
69    io_loop = ioloop.IOLoop.current()
                    
70    app = web.Application([(r".*", TestingApp)])
                    
96
                    
97    io_loop = ioloop.IOLoop.current()
                    
98    app = web.Application([(r".*", TestingApp)])
                    
99    server_app, port = run_tornado_app(app, io_loop, server_certs, "https", "localhost")
                    
100    server_config = ServerConfig("https", "localhost", port, ca_cert_path)
                    
101
                    
213    tmp_path_factory: pytest.TempPathFactory,
                    
214) -> Generator[Tuple[ServerConfig, ServerConfig], None, None]:
                    
215    tmpdir = tmp_path_factory.mktemp("certs")
                    
                
logwatcher.py https://github.com/cboos/ipython.git | Python | 114 lines
                    
25import zmq
                    
26from zmq.eventloop import ioloop, zmqstream
                    
27
                    
27
                    
28from IPython.config.configurable import LoggingConfigurable
                    
29from IPython.utils.traitlets import Int, Unicode, Instance, List
                    
42    
                    
43    # configurables
                    
44    topics = List([''], config=True,
                    
55    
                    
56    loop = Instance(zmq.eventloop.ioloop.IOLoop)
                    
57    def _loop_default(self):
                    
57    def _loop_default(self):
                    
58        return ioloop.IOLoop.instance()
                    
59    
                    
                
app.py https://github.com/haldun/bookmarks.git | Python | 292 lines
                    
31define("port", default=8888, type=int)
                    
32define("config_file", default="app_config.yml", help="app_config file")
                    
33
                    
48    settings = dict(
                    
49      debug=self.config.debug,
                    
50      login_url='/auth/google',
                    
53      xsrf_cookies=True,
                    
54      cookie_secret=self.config.cookie_secret,
                    
55      ui_modules=uimodules,
                    
67  @property
                    
68  def config(self):
                    
69    if not hasattr(self, '_config'):
                    
288  http_server.listen(options.port)
                    
289  tornado.ioloop.IOLoop.instance().start()
                    
290
                    
                
edit.py https://gitlab.com/sixsamuraisoldier/DIGITS | Python | 166 lines
                    
20
                    
21    levels = [('INSTANCE', config_file.InstanceConfigFile())]
                    
22    # filter out the files which don't exist
                    
74    suggestions = []
                    
75    instanceConfig = config_file.InstanceConfigFile()
                    
76    if instanceConfig.can_write():
                    
115
                    
116    configFile = config_file.ConfigFile(filename)
                    
117
                    
148        print
                    
149        configFile.set(option.config_file_key(), value)
                    
150
                    
151    configFile.save()
                    
152    print 'New config saved at %s' % configFile.filename()
                    
153    print
                    
                
__init__.py https://bitbucket.org/nagyv/openerp.git | Python | 104 lines
                    
83    openerp.wsgi.core.stop_server()
                    
84    config = openerp.tools.config
                    
85    _logger.info("Initiating shutdown")
                    
90    # to trigger _force_quit() in case some non-daemon threads won't exit cleanly.
                    
91    # threading.Thread.join() should not mask signals (at least in python 2.5).
                    
92    for thread in threading.enumerate():
                    
94            while thread.isAlive():
                    
95                # Need a busyloop here as thread.join() masks signals
                    
96                # and would prevent the forced shutdown.
                    
                
conftest.py https://github.com/andymccurdy/redis-py.git | Python | 462 lines
                    
115    parser.addoption(
                    
116        "--uvloop", action=BooleanOptionalAction, help="Run tests with uvloop"
                    
117    )
                    
144    try:
                    
145        redismod_url = session.config.getoption("--redismod-url")
                    
146        info = _get_info(redismod_url)
                    
153    if cluster_enabled:
                    
154        cluster_nodes = session.config.getoption("--redis-cluster-nodes")
                    
155        wait_for_cluster_creation(redis_url, cluster_nodes)
                    
156
                    
157    use_uvloop = session.config.getoption("--uvloop")
                    
158
                    
158
                    
159    if use_uvloop:
                    
160        try:
                    
                
menu-all-types-of-entries.py https://bitbucket.org/glix/python.git | Python | 244 lines
                    
61    # make the pulldown part of the File menu. The parameter passed is the master.
                    
62    # we attach it to the button as a python attribute called "menu" by convention.
                    
63    # hopefully this isn't too confusing...
                    
68    # undo is the 0th entry...
                    
69    Command_button.menu.entryconfig(0, state=DISABLED)
                    
70
                    
123    Cascade_button.menu.choices.add_command(label='TuttiFruiti')
                    
124    Cascade_button.menu.choices.add_command(label='WopBopaLoopBapABopBamBoom')
                    
125    Cascade_button.menu.choices.add_command(label='Rocky Road')
                    
243
                    
244root.mainloop()
                    
245
                    
                
puppet.py https://gitlab.com/ricardo.hernandez/salt | Python | 399 lines
                    
5
                    
6# Import python libs
                    
7from __future__ import absolute_import
                    
53        Setup a puppet instance, based on the premis that default usage is to
                    
54        run 'puppet agent --test'. Configuration and run states are stored in
                    
55        the default locations.
                    
162
                    
163    ret = __salt__['cmd.run_all'](repr(puppet), python_shell=puppet.useshell)
                    
164    if ret['retcode'] in [0, 2]:
                    
320            result['time'] = {}
                    
321            for key in ('total', 'config_retrieval'):
                    
322                if key in report['time']:
                    
369
                    
370    # Loop over the facter output and  properly
                    
371    # parse it into a nice dictionary for using
                    
                
libraryOptions.py https://bitbucket.org/karpeev/petsc.git | Python | 110 lines
                    
6
                    
7class Configure(config.base.Configure):
                    
8  def __init__(self, framework):
                    
8  def __init__(self, framework):
                    
9    config.base.Configure.__init__(self, framework)
                    
10    self.headerPrefix = ''
                    
27  def setupDependencies(self, framework):
                    
28    config.base.Configure.setupDependencies(self, framework)
                    
29    self.debugging   = framework.require('PETSc.options.debugging', self)
                    
36
                    
37  def configureLibraryOptions(self):
                    
38    '''Sets PETSC_USE_DEBUG, PETSC_USE_INFO, PETSC_USE_LOG, PETSC_USE_CTABLE and PETSC_USE_FORTRAN_KERNELS'''
                    
53      self.addDefine('USE_DEBUG',1)
                    
54    elif not config.setCompilers.Configure.isIBM(self.framework.getCompiler()):
                    
55      # IBM XLC version 12.1 (BG/Q and POWER) miscompiles PetscMalloc3()
                    
                
loop_plugin.py https://github.com/dlazzari/oe-core.git | Python | 255 lines
                    
25from mic.plugin import pluginmgr
                    
26from mic.imager.loop import LoopImageCreator, load_mountpoints
                    
27
                    
164            size = size * 1024L * 1024L
                    
165            loop = myDiskMount(fs_related.SparseLoopbackDisk(name, size),
                    
166                               os.path.join(mntdir, mp.lstrip('/')),
                    
181
                    
182            loops.append(loop)
                    
183
                    
192        finally:
                    
193            for loop in reversed(loops):
                    
194                chroot.cleanup_after_chroot("img", loop, None, mntdir)
                    
221        extmnt = misc.mkdtemp()
                    
222        extloop = myDiskMount(fs_related.SparseLoopbackDisk(img, imgsize),
                    
223                                                         extmnt,
                    
                
__init__.py https://github.com/psychopy/psychopy.git | Python | 300 lines
                    
1#!/usr/bin/env python
                    
2# -*- coding: utf-8 -*-
                    
48        # params
                    
49        self.order += ['config']  # first param after the name
                    
50
                    
276        if len(self.exp.flow._loopList):
                    
277            currLoop = self.exp.flow._loopList[-1]  # last (outer-most) loop
                    
278        else:
                    
278        else:
                    
279            currLoop = self.exp._expHandler
                    
280        name = self.params['name']
                    
288            code = (
                    
289                f"{currLoop.params['name']}.addData('{name}.numLooks', {name}.numLooks)\n"
                    
290                f"if {name}.numLooks:\n"
                    
290                f"if {name}.numLooks:\n"
                    
291                f"   {currLoop.params['name']}.addData('{name}.timesOn', {name}.timesOn{index})\n"
                    
292                f"   {currLoop.params['name']}.addData('{name}.timesOff', {name}.timesOff{index})\n"
                    
                
plot-kicker.py https://gitlab.com/balajimude.it/robocup-firmware | Python | 224 lines
                    
1#!/usr/bin/env python
                    
2
                    
3# The electrical side of the kicker is a series RLC circuit.
                    
4# The current around the loop is measured directly.
                    
5#
                    
29
                    
30# Sample rate, fixed by scope configuration
                    
31sample_rate = 200e3
                    
                
router.py https://github.com/PichayGuriGuri/rapidsms.git | Python | 322 lines
                    
1#!/usr/bin/env python
                    
2# vim: ai ts=4 sts=4 et sw=4
                    
30        """Imports and instantiates an module, given a dict with 
                    
31           the config key/value pairs to pass along."""
                    
32        # break the class name off the end of the module template
                    
47        try:
                    
48            component._configure(**conf)
                    
49        except TypeError, e:
                    
107                # an exception was raised in backend.start()
                    
108                # sleep for 5 seconds, then loop and restart it
                    
109                self.log_last_exception("Error in the %s backend" % backend.slug)
                    
264        
                    
265        # loop through all of the apps and notify them of
                    
266        # the incoming message so that they all get a
                    
                
glances_client_browser.py https://gitlab.com/xbsd/glances | Python | 226 lines
                    
27except ImportError:
                    
28    # Python 2
                    
29    from xmlrpclib import ServerProxy, Fault, ProtocolError
                    
42
                    
43    def __init__(self, config=None, args=None):
                    
44        # Store the arg/config
                    
45        self.args = args
                    
46        self.config = config
                    
47
                    
48        # Init the static server list (if defined)
                    
49        self.static_server = GlancesStaticServer(config=self.config)
                    
50
                    
181                args_server.password = self.get_servers_list()[self.screen.get_active()]['password']
                    
182                client = GlancesClient(config=self.config,
                    
183                                       args=args_server)
                    
                
test_wxagg.py https://github.com/tris-sondon/matplotlib.git | Python | 176 lines
                    
1#!/usr/bin/env pythonw
                    
2# Name: test_wxagg.py
                    
47####################
                    
48# Test Configuration
                    
49####################
                    
82
                    
83def time_loop(function, args):
                    
84    i = 0
                    
121
                    
122    # test the pure python implementation
                    
123    if TEST_PY:
                    
145
                    
146    # time the pure python implementation
                    
147    if TIME_PY:
                    
147    if TIME_PY:
                    
148        t = time_loop(_py_convert_agg_to_wx_image, (agg,None))
                    
149        print('Python agg2img:        %.4f seconds (%.1f HZ)' % (t, 1/t))
                    
                
rescan_header.py https://gitlab.com/cdeclare/intcrypt | Python | 265 lines
                    
1#!/usr/bin/python
                    
2
                    
8
                    
9t = BoostBuild.Tester(use_test_config=False)
                    
10
                    
10
                    
11# Test a header loop that depends on (but does not contain) a generated header.
                    
12t.write("test.cpp", '#include "header1.h"\n')
                    
82
                    
83# Test a loop in generated headers.
                    
84t.write("test.cpp", '#include "header1.h"\n')
                    
132
                    
133# Test that all the dependencies of a loop are updated before any of the
                    
134# dependents.
                    
202
                    
203# Test a loop that includes a generated header
                    
204t.write("test1.cpp", '#include "header1.h"\n')
                    
                
gplay-arm.py https://bitbucket.org/manaphassan/raspberry-pwn.git | Python | 348 lines
                    
22    print "\n\nTesting JTAG for ARM\n"
                    
23    client.writecmd(0x33,0xd0,4,[0x40,0x40,0x40,0x40]); print "loopback:   \t %s"%repr(client.data)                  # loopback
                    
24    data.append(client.data)
                    
87    client.writecmd(0x33,0xd0,4,[0xf7,0xf7,0xf7,0xf7])
                    
88    print "Loopback:   \t %s"%repr(client.data)                  # loopback
                    
89    print "Debug State: %x"%client.ARMget_dbgstate ()
                    
107    client.writecmd(0x33,0xd0,4,[0xf7,0xf7,0xf7,0xf7])
                    
108    print "Loopback:   \t %s"%repr(client.data)                  # loopback
                    
109    client.writecmd(0x33,0xd5,8,[0,0,0,0,0xf7,0xf7,0xf7,0xf7])
                    
195    client.CCwr_config(1);
                    
196    print "Config is %02x" % client.CCrd_config();
                    
197    
                    
230if(sys.argv[1]=="config"):
                    
231    print "Config is %02x" % client.CCrd_config();
                    
232
                    
                
protocol_loop.py https://github.com/hradec/chemshapes.git | Python | 262 lines
                    
1#! python
                    
2#
                    
2#
                    
3# Python Serial Port Extension for Win32, Linux, BSD, Jython
                    
4# see __init__.py
                    
5#
                    
6# This module implements a loop back connection receiving itself what it sent.
                    
7#
                    
13#
                    
14# URL format:    loop://[option[/option...]]
                    
15# options:
                    
31
                    
32class LoopbackSerial(SerialBase):
                    
33    """Serial port implementation for plain sockets."""
                    
44        self.buffer_lock = threading.Lock()
                    
45        self.loop_buffer = bytearray()
                    
46        self.cts = False
                    
                
test_worker_comm.py https://gitlab.com/murder187ss/buildbot | Python | 327 lines
                    
19from twisted.internet import reactor
                    
20from twisted.python import log
                    
21from twisted.spread import pb
                    
25
                    
26from buildbot import config
                    
27from buildbot import pbmanager
                    
208        # reconfig the master to get it set up
                    
209        new_config = self.master.config
                    
210        new_config.protocols = {"pb": {"port": "tcp:0:interface=127.0.0.1"}}
                    
211        new_config.workers = [self.buildworker]
                    
212        new_config.builders = [config.BuilderConfig(name='bldr',
                    
213                                                    workername='testworker', factory=factory.BuildFactory())]
                    
214
                    
215        yield self.botmaster.reconfigServiceWithBuildbotConfig(new_config)
                    
216        yield self.workers.reconfigServiceWithBuildbotConfig(new_config)
                    
                
test_commands_perfdata.py https://github.com/sduchesneau/shinken.git | Python | 100 lines
                    
1#!/usr/bin/env python2.6
                    
2#Copyright (C) 2009-2010 :
                    
28
                    
29class TestConfig(ShinkenTest):
                    
30
                    
54        self.assert_(svc.__class__.perfdata_command.__class__.my_type == 'CommandCall')
                    
55        self.scheduler_loop(1, [[svc, 0, 'OK | bibi=99%']])
                    
56        print "Actions", self.sched.actions
                    
62        self.sched.run_external_command(cmd)
                    
63        self.scheduler_loop(1, [[svc, 0, 'OK | bibi=99%']])
                    
64        print "Actions", self.sched.actions
                    
85        self.assert_(host.__class__.perfdata_command.__class__.my_type == 'CommandCall')
                    
86        self.scheduler_loop(1, [[host, 0, 'UP | bibi=99%']])
                    
87        print "Actions", self.sched.actions
                    
93        self.sched.run_external_command(cmd)
                    
94        self.scheduler_loop(1, [[host, 0, 'UP | bibi=99%']])
                    
95        print "Actions", self.sched.actions
                    
                
landmask.py https://bitbucket.org/jkibele/multispectral-land-masker.git | Python | 114 lines
                    
40        # initialize plugin directory
                    
41        self.plugin_dir = QFileInfo(QgsApplication.qgisUserDbFilePath()).path() + "/python/plugins/landmask"
                    
42        # initialize locale
                    
59    def initGui(self):
                    
60        # Create action that will start plugin configuration
                    
61        self.action = QAction(
                    
81        self.dlg.show()
                    
82        # Run the dialog event loop
                    
83        result = self.dlg.exec_()
                    
                
fake-pgo-api.py https://gitlab.com/HerrTapper/PokemonGoMap | Python | 189 lines
                    
1#!/usr/bin/env python
                    
2# -*- coding: utf-8 -*-
                    
20import logging
                    
21import configargparse
                    
22import math
                    
32
                    
33logging.basicConfig(format=(
                    
34    '%(asctime)s [%(threadName)16s][%(module)14s][%(levelname)8s] ' +
                    
37
                    
38# Configish
                    
39parser = configargparse.ArgParser()
                    
64# TODO: This method is suuuuper inefficient.
                    
65#       Namely, it loops over EVERY POSSIBLE fort and does a distance calc
                    
66#       Not a time-cheap operation to do at all. It would be way more efficient
                    
                
test_prefilter.py https://github.com/tinyclues/ipython.git | Python | 440 lines
                    
6
                    
7Usage: run from the command line with *normal* python, not ipython:
                    
8> python test_prefilter.py
                    
17sys.path.append('..')
                    
18import IPython
                    
19import IPython.ipapi
                    
23    if sys.argv[1] == '-v':
                    
24        sys.argv = sys.argv[:-1]  # IPython is confused by -v, apparently
                    
25        verbose = True
                    
26    
                    
27IPython.Shell.start()
                    
28
                    
425#
                    
426# user > ipython internal > python builtin > alias > magic
                    
427
                    
                
backend_macosx.py https://github.com/ericliang/matplotlib.git | Python | 415 lines
                    
21def show():
                    
22    """Show all the figures and enter the Cocoa mainloop.
                    
23    This function will not return until all windows are closed or
                    
24    the interpreter exits."""
                    
25    # Having a Python-level function "show" wrapping the built-in
                    
26    # function "show" in the _macosx extension module allows us to
                    
26    # function "show" in the _macosx extension module allows us to
                    
27    # to add attributes to "show". This is something ipython does.
                    
28    _macosx.show()
                    
33    methods forwards the command to the renderer's graphics context. The
                    
34    renderer does not wrap a C object and is written in pure Python.
                    
35    """
                    
81        texmanager = self.get_texmanager()
                    
82        key = s, size, self.dpi, angle, texmanager.get_font_config()
                    
83        im = self.texd.get(key) # Not sure what this does; just copied from backend_agg.py
                    
                
__main__.py https://github.com/albertz/CPython.git | Python | 386 lines
                    
1#!/usr/bin/env python3
                    
2
                    
34
                    
35      - Until the EVENTLOOP is entered everything works
                    
36      as in an ordinary demo script.
                    
37
                    
38      - When the EVENTLOOP is entered, you control the
                    
39      application by using the mouse and/or keys (or it's
                    
42
                    
43      While the EVENTLOOP is running, the examples menu is disabled.
                    
44
                    
73        main()
                    
74        mainloop()  # keep window open
                    
75
                    
75
                    
76    python -m turtledemo.mydemo  # will then run it
                    
77
                    
                
avatar-test.py https://github.com/heca/rextest2.git | Python | 167 lines
                    
1#!/usr/local/bin/python
                    
2
                    
17from optparse import OptionParser
                    
18import config
                    
19
                    
25
                    
26#folder config
                    
27scriptDir = os.path.abspath(os.getcwd())
                    
27scriptDir = os.path.abspath(os.getcwd())
                    
28rexbinDir = config.rexbinDir
                    
29#rexbinDir = os.path.abspath(os.path.join(scriptDir, '../../bin'))
                    
108
                    
109    #while-loop to check if viewer is running
                    
110    while running == True:
                    
                
 

Source

Language