_id
stringlengths
2
7
title
stringlengths
1
88
partition
stringclasses
3 values
text
stringlengths
75
19.8k
language
stringclasses
1 value
meta_information
dict
q20400
MessageReceiver.on_state_changed
train
def on_state_changed(self, previous_state, new_state): """Callback called whenever the underlying Receiver undergoes a change of state. This function can be overridden. :param previous_state: The previous Receiver state. :type previous_state: ~uamqp.constants.MessageReceiverState ...
python
{ "resource": "" }
q20401
AMQPClient.open
train
def open(self, connection=None): """Open the client. The client can create a new Connection or an existing Connection can be passed in. This existing Connection may have an existing CBS authentication Session, which will be used for this client as well. Otherwise a new Session will be ...
python
{ "resource": "" }
q20402
AMQPClient.close
train
def close(self): """Close the client. This includes closing the Session and CBS authentication layer as well as the Connection. If the client was opened using an external Connection, this will be left intact. No further messages can be sent or received and the client can...
python
{ "resource": "" }
q20403
AMQPClient.do_work
train
def do_work(self): """Run a single connection iteration. This will return `True` if the connection is still open and ready to be used for further work, or `False` if it needs to be shut down. :rtype: bool :raises: TimeoutError or ~uamqp.errors.ClientTimeout if CBS authen...
python
{ "resource": "" }
q20404
SendClient._on_message_sent
train
def _on_message_sent(self, message, result, delivery_state=None): """Callback run on a message send operation. If message has a user defined callback, it will be called here. If the result of the operation is failure, the message state will be reverted to 'pending' up to the maximum retr...
python
{ "resource": "" }
q20405
SendClient.send_message
train
def send_message(self, messages, close_on_done=False): """Send a single message or batched message. :param messages: A message to send. This can either be a single instance of `Message`, or multiple messages wrapped in an instance of `BatchMessage`. :type message: ~uamqp.message.Messag...
python
{ "resource": "" }
q20406
SendClient.wait
train
def wait(self): """Run the client until all pending message in the queue have been processed. Returns whether the client is still running after the messages have been processed, or whether a shutdown has been initiated. :rtype: bool """ running = True while runni...
python
{ "resource": "" }
q20407
SendClient.send_all_messages
train
def send_all_messages(self, close_on_done=True): """Send all pending messages in the queue. This will return a list of the send result of all the pending messages so it can be determined if any messages failed to send. This function will open the client if it is not already open. ...
python
{ "resource": "" }
q20408
ReceiveClient._message_generator
train
def _message_generator(self): """Iterate over processed messages in the receive queue. :rtype: generator[~uamqp.message.Message] """ self.open() auto_complete = self.auto_complete self.auto_complete = False receiving = True message = None try: ...
python
{ "resource": "" }
q20409
ReceiveClient.receive_message_batch
train
def receive_message_batch(self, max_batch_size=None, on_message_received=None, timeout=0): """Receive a batch of messages. Messages returned in the batch have already been accepted - if you wish to add logic to accept or reject messages based on custom criteria, pass in a callback. This method w...
python
{ "resource": "" }
q20410
ReceiveClient.receive_messages_iter
train
def receive_messages_iter(self, on_message_received=None): """Receive messages by generator. Messages returned in the generator have already been accepted - if you wish to add logic to accept or reject messages based on custom criteria, pass in a callback. :param on_message_received: A ...
python
{ "resource": "" }
q20411
send_message
train
def send_message(target, data, auth=None, debug=False): """Send a single message to AMQP endpoint. :param target: The target AMQP endpoint. :type target: str, bytes or ~uamqp.address.Target :param data: The contents of the message to send. :type data: str, bytes or ~uamqp.message.Message :param...
python
{ "resource": "" }
q20412
receive_message
train
def receive_message(source, auth=None, timeout=0, debug=False): """Receive a single message from an AMQP endpoint. :param source: The AMQP source endpoint to receive from. :type source: str, bytes or ~uamqp.address.Source :param auth: The authentication credentials for the endpoint. This should be...
python
{ "resource": "" }
q20413
receive_messages
train
def receive_messages(source, auth=None, max_batch_size=None, timeout=0, debug=False, **kwargs): """Receive a batch of messages from an AMQP endpoint. :param source: The AMQP source endpoint to receive from. :type source: str, bytes or ~uamqp.address.Source :param auth: The authentication credentials fo...
python
{ "resource": "" }
q20414
Address._validate_address
train
def _validate_address(self, address): """Confirm that supplied address is a valid URL and has an `amqp` or `amqps` scheme. :param address: The endpiont URL. :type address: str :rtype: ~urllib.parse.ParseResult """ parsed = compat.urlparse(address) if not ...
python
{ "resource": "" }
q20415
Source.get_filter
train
def get_filter(self, name=constants.STRING_FILTER): """Get the filter on the source. :param name: The name of the filter. This will be encoded as an AMQP Symbol. By default this is set to b'apache.org:selector-filter:string'. :type name: bytes """ try: filte...
python
{ "resource": "" }
q20416
Source.set_filter
train
def set_filter(self, value, name=constants.STRING_FILTER, descriptor=constants.STRING_FILTER): """Set a filter on the endpoint. Only one filter can be applied to an endpoint. :param value: The filter to apply to the endpoint. Set to None for a NULL filter. :type value: bytes or str or N...
python
{ "resource": "" }
q20417
CBSAsyncAuthMixin.create_authenticator_async
train
async def create_authenticator_async(self, connection, debug=False, loop=None, **kwargs): """Create the async AMQP session and the CBS channel with which to negotiate the token. :param connection: The underlying AMQP connection on which to create the session. :type connection: ...
python
{ "resource": "" }
q20418
CBSAsyncAuthMixin.close_authenticator_async
train
async def close_authenticator_async(self): """Close the CBS auth channel and session asynchronously.""" _logger.info("Shutting down CBS session on connection: %r.", self._connection.container_id) try: self._cbs_auth.destroy() _logger.info("Auth closed, destroying session ...
python
{ "resource": "" }
q20419
CBSAsyncAuthMixin.handle_token_async
train
async def handle_token_async(self): """This coroutine is called periodically to check the status of the current token if there is one, and request a new one if needed. If the token request fails, it will be retried according to the retry policy. A token refresh will be attempted if the t...
python
{ "resource": "" }
q20420
SessionAsync.destroy_async
train
async def destroy_async(self): """Asynchronously close any open management Links and close the Session. Cleans up and C objects for both mgmt Links and Session. """ for _, link in self._mgmt_links.items(): await link.destroy_async() self._session.destroy()
python
{ "resource": "" }
q20421
MgmtOperationAsync.execute_async
train
async def execute_async(self, operation, op_type, message, timeout=0): """Execute a request and wait on a response asynchronously. :param operation: The type of operation to be performed. This value will be service-specific, but common values include READ, CREATE and UPDATE. This valu...
python
{ "resource": "" }
q20422
main
train
def main(): """Provide the entry point to the subreddit_stats command.""" parser = arg_parser(usage='usage: %prog [options] SUBREDDIT VIEW') parser.add_option('-c', '--commenters', type='int', default=10, help='Number of top commenters to display ' '[default %defa...
python
{ "resource": "" }
q20423
SubredditStats.basic_stats
train
def basic_stats(self): """Return a markdown representation of simple statistics.""" comment_score = sum(comment.score for comment in self.comments) if self.comments: comment_duration = (self.comments[-1].created_utc - self.comments[0].created_utc) ...
python
{ "resource": "" }
q20424
SubredditStats.fetch_recent_submissions
train
def fetch_recent_submissions(self, max_duration): """Fetch recent submissions in subreddit with boundaries. Does not include posts within the last day as their scores may not be representative. :param max_duration: When set, specifies the number of days to include """ ...
python
{ "resource": "" }
q20425
SubredditStats.fetch_submissions
train
def fetch_submissions(self, submissions_callback, *args): """Wrap the submissions_callback function.""" logger.debug('Fetching submissions') submissions_callback(*args) logger.info('Found {} submissions'.format(len(self.submissions))) if not self.submissions: return...
python
{ "resource": "" }
q20426
SubredditStats.fetch_top_submissions
train
def fetch_top_submissions(self, top): """Fetch top submissions by some top value. :param top: One of week, month, year, all :returns: True if any submissions were found. """ for submission in self.subreddit.top(limit=None, time_filter=top): self.submissions[submissi...
python
{ "resource": "" }
q20427
SubredditStats.process_commenters
train
def process_commenters(self): """Group comments by author.""" for index, submission in enumerate(self.submissions.values()): if submission.num_comments == 0: continue real_submission = self.reddit.submission(id=submission.id) real_submission.comment_so...
python
{ "resource": "" }
q20428
SubredditStats.process_submitters
train
def process_submitters(self): """Group submissions by author.""" for submission in self.submissions.values(): if submission.author and (self.distinguished or submission.distinguished is None): self.submitters[submission.author].append(sub...
python
{ "resource": "" }
q20429
SubredditStats.run
train
def run(self, view, submitters, commenters): """Run stats and return the created Submission.""" logger.info('Analyzing subreddit: {}'.format(self.subreddit)) if view in TOP_VALUES: callback = self.fetch_top_submissions else: callback = self.fetch_recent_submissio...
python
{ "resource": "" }
q20430
SubredditStats.top_commenters
train
def top_commenters(self, num): """Return a markdown representation of the top commenters.""" num = min(num, len(self.commenters)) if num <= 0: return '' top_commenters = sorted( iteritems(self.commenters), key=lambda x: (-sum(y.score for y in x[1]), ...
python
{ "resource": "" }
q20431
SubredditStats.top_submitters
train
def top_submitters(self, num): """Return a markdown representation of the top submitters.""" num = min(num, len(self.submitters)) if num <= 0: return '' top_submitters = sorted( iteritems(self.submitters), key=lambda x: (-sum(y.score for y in x[1]), ...
python
{ "resource": "" }
q20432
SubredditStats.top_submissions
train
def top_submissions(self): """Return a markdown representation of the top submissions.""" num = min(10, len(self.submissions)) if num <= 0: return '' top_submissions = sorted( [x for x in self.submissions.values() if self.distinguished or x.distingui...
python
{ "resource": "" }
q20433
SubredditStats.top_comments
train
def top_comments(self): """Return a markdown representation of the top comments.""" num = min(10, len(self.comments)) if num <= 0: return '' top_comments = sorted( self.comments, key=lambda x: (-x.score, str(x.author)))[:num] retval = self.post_header.for...
python
{ "resource": "" }
q20434
arg_parser
train
def arg_parser(*args, **kwargs): """Return a parser with common options used in the prawtools commands.""" msg = { 'site': 'The site to connect to defined in your praw.ini file.', 'update': 'Prevent the checking for prawtools package updates.'} kwargs['version'] = 'BBoe\'s PRAWtools {}'.for...
python
{ "resource": "" }
q20435
ModUtils.add_users
train
def add_users(self, category): """Add users to 'banned', 'contributor', or 'moderator'.""" mapping = {'banned': 'ban', 'contributor': 'make_contributor', 'moderator': 'make_moderator'} if category not in mapping: print('{!r} is not a valid option for --add'.format...
python
{ "resource": "" }
q20436
ModUtils.clear_empty
train
def clear_empty(self): """Remove flair that is not visible or has been set to empty.""" for flair in self.current_flair(): if not flair['flair_text'] and not flair['flair_css_class']: print(self.reddit.flair.update(flair['user'])) print('Removed flair for {0}'...
python
{ "resource": "" }
q20437
ModUtils.current_flair
train
def current_flair(self): """Generate the flair, by user, for the subreddit.""" if self._current_flair is None: self._current_flair = [] if self.verbose: print('Fetching flair list for {}'.format(self.sub)) for flair in self.sub.flair: s...
python
{ "resource": "" }
q20438
ModUtils.flair_template_sync
train
def flair_template_sync(self, editable, limit, # pylint: disable=R0912 static, sort, use_css, use_text): """Synchronize templates with flair that already exists on the site. :param editable: Indicates that all the options should be editable. :param limit: The minimu...
python
{ "resource": "" }
q20439
ModUtils.message
train
def message(self, category, subject, msg_file): """Send message to all users in `category`.""" users = getattr(self.sub, category) if not users: print('There are no {} users on {}.'.format(category, self.sub)) return if msg_file: try: ...
python
{ "resource": "" }
q20440
ModUtils.output_current_flair
train
def output_current_flair(self, as_json=False): """Display the current flair for all users in the subreddit.""" flair_list = sorted(self.current_flair(), key=lambda x: x['user'].name) if as_json: print(json.dumps(flair_list, sort_keys=True, indent=4)) return for f...
python
{ "resource": "" }
q20441
ModUtils.output_list
train
def output_list(self, category): """Display the list of users in `category`.""" print('{} users:'.format(category)) for user in getattr(self.sub, category): print(' {}'.format(user))
python
{ "resource": "" }
q20442
quick_url
train
def quick_url(comment): """Return the URL for the comment without fetching its submission.""" def to_id(fullname): return fullname.split('_', 1)[1] return ('http://www.reddit.com/r/{}/comments/{}/_/{}?context=3' .format(comment.subreddit.display_name, to_id(comment.link_id), ...
python
{ "resource": "" }
q20443
main
train
def main(): """Provide the entry point into the reddit_alert program.""" usage = 'Usage: %prog [options] KEYWORD...' parser = arg_parser(usage=usage) parser.add_option('-s', '--subreddit', action='append', help=('When at least one `-s` option is provided ' ...
python
{ "resource": "" }
q20444
get_object_executor
train
def get_object_executor(obj, green_mode=None): """Returns the proper executor for the given object. If the object has *_executors* and *_green_mode* members it returns the submit callable for the executor corresponding to the green_mode. Otherwise it returns the global executor for the given green_mode...
python
{ "resource": "" }
q20445
green
train
def green(fn=None, consume_green_mode=True): """Make a function green. Can be used as a decorator.""" def decorator(fn): @wraps(fn) def greener(obj, *args, **kwargs): args = (obj,) + args wait = kwargs.pop('wait', None) timeout = kwargs.pop('timeout', None) ...
python
{ "resource": "" }
q20446
green_callback
train
def green_callback(fn, obj=None, green_mode=None): """Return a green verion of the given callback.""" executor = get_object_executor(obj, green_mode) @wraps(fn) def greener(*args, **kwargs): return executor.submit(fn, *args, **kwargs) return greener
python
{ "resource": "" }
q20447
__struct_params_s
train
def __struct_params_s(obj, separator=', ', f=repr, fmt='%s = %s'): """method wrapper for printing all elements of a struct""" s = separator.join([__single_param(obj, n, f, fmt) for n in dir(obj) if __inc_param(obj, n)]) return s
python
{ "resource": "" }
q20448
__struct_params_str
train
def __struct_params_str(obj, fmt, f=repr): """method wrapper for printing all elements of a struct.""" return __struct_params_s(obj, '\n', f=f, fmt=fmt)
python
{ "resource": "" }
q20449
__registerSeqStr
train
def __registerSeqStr(): """helper function to make internal sequences printable""" _SeqStr = lambda self: (self and "[%s]" % (", ".join(map(repr, self)))) or "[]" _SeqRepr = lambda self: (self and "[%s]" % (", ".join(map(repr, self)))) or "[]" seqs = (StdStringVector, StdLongVector, CommandInfoList, ...
python
{ "resource": "" }
q20450
__registerStructStr
train
def __registerStructStr(): """helper method to register str and repr methods for structures""" structs = (LockerInfo, DevCommandInfo, AttributeDimension, CommandInfo, DeviceInfo, DeviceAttributeConfig, AttributeInfo, AttributeAlarmInfo, ChangeEventInfo, PeriodicEventInfo, ArchiveEv...
python
{ "resource": "" }
q20451
alias_package
train
def alias_package(package, alias, extra_modules={}): """Alias a python package properly. It ensures that modules are not duplicated by trying to import and alias all the submodules recursively. """ path = package.__path__ alias_prefix = alias + '.' prefix = package.__name__ + '.' # Alia...
python
{ "resource": "" }
q20452
AsyncioExecutor.delegate
train
def delegate(self, fn, *args, **kwargs): """Return the given operation as an asyncio future.""" callback = functools.partial(fn, *args, **kwargs) coro = self.loop.run_in_executor(self.subexecutor, callback) return asyncio.ensure_future(coro)
python
{ "resource": "" }
q20453
AsyncioExecutor.access
train
def access(self, accessor, timeout=None): """Return a result from an asyncio future.""" if self.loop.is_running(): raise RuntimeError("Loop is already running") coro = asyncio.wait_for(accessor, timeout, loop=self.loop) return self.loop.run_until_complete(coro)
python
{ "resource": "" }
q20454
__EncodedAttribute_encode_jpeg_gray8
train
def __EncodedAttribute_encode_jpeg_gray8(self, gray8, width=0, height=0, quality=100.0): """Encode a 8 bit grayscale image as JPEG format :param gray8: an object containning image information :type gray8: :py:obj:`str` or :class:`numpy.ndarray` or seq< seq<element> > :param width: ...
python
{ "resource": "" }
q20455
__EncodedAttribute_encode_jpeg_rgb24
train
def __EncodedAttribute_encode_jpeg_rgb24(self, rgb24, width=0, height=0, quality=100.0): """Encode a 24 bit rgb color image as JPEG format. :param rgb24: an object containning image information :type rgb24: :py:obj:`str` or :class:`numpy.ndarray` or seq< seq<element> > :param width...
python
{ "resource": "" }
q20456
__EncodedAttribute_encode_jpeg_rgb32
train
def __EncodedAttribute_encode_jpeg_rgb32(self, rgb32, width=0, height=0, quality=100.0): """Encode a 32 bit rgb color image as JPEG format. :param rgb32: an object containning image information :type rgb32: :py:obj:`str` or :class:`numpy.ndarray` or seq< seq<element> > :param width...
python
{ "resource": "" }
q20457
is_tango_object
train
def is_tango_object(arg): """Return tango data if the argument is a tango object, False otherwise. """ classes = attribute, device_property if isinstance(arg, classes): return arg try: return arg.__tango_command__ except AttributeError: return False
python
{ "resource": "" }
q20458
inheritance_patch
train
def inheritance_patch(attrs): """Patch tango objects before they are processed by the metaclass.""" for key, obj in attrs.items(): if isinstance(obj, attribute): if getattr(obj, 'attr_write', None) == AttrWriteType.READ_WRITE: if not getattr(obj, 'fset', None): ...
python
{ "resource": "" }
q20459
run
train
def run(classes, args=None, msg_stream=sys.stdout, verbose=False, util=None, event_loop=None, post_init_callback=None, green_mode=None, raises=False): """ Provides a simple way to run a tango server. It handles exceptions by writting a message to the msg_stream. The `classes` pa...
python
{ "resource": "" }
q20460
BaseDevice.run_server
train
def run_server(cls, args=None, **kwargs): """Run the class as a device server. It is based on the tango.server.run method. The difference is that the device class and server name are automatically given. Args: args (iterable): args as given in the tango.server.run m...
python
{ "resource": "" }
q20461
attribute.setter
train
def setter(self, fset): """ To be used as a decorator. Will define the decorated method as a write attribute method to be called when client writes the attribute """ self.fset = fset if self.attr_write == AttrWriteType.READ: if getattr(self, 'fget', No...
python
{ "resource": "" }
q20462
pipe.setter
train
def setter(self, fset): """ To be used as a decorator. Will define the decorated method as a write pipe method to be called when client writes to the pipe """ self.fset = fset self.pipe_write = PipeWriteType.PIPE_READ_WRITE return self
python
{ "resource": "" }
q20463
Server.__prepare
train
def __prepare(self): """Update database with existing devices""" self.log.debug("prepare") if self.__phase > 0: raise RuntimeError("Internal error: Can only prepare in phase 0") server_instance = self.server_instance db = Database() # get list of server dev...
python
{ "resource": "" }
q20464
Server.get_devices
train
def get_devices(self): """ Helper that retuns a dict of devices for this server. :return: Returns a tuple of two elements: - dict<tango class name : list of device names> - dict<device names : tango class name> :rtype: tuple<dict, dict> ""...
python
{ "resource": "" }
q20465
_set_concurrent_future_state
train
def _set_concurrent_future_state(concurrent, source): """Copy state from a future to a concurrent.futures.Future.""" assert source.done() if source.cancelled(): concurrent.cancel() if not concurrent.set_running_or_notify_cancel(): return exception = source.exception() if exceptio...
python
{ "resource": "" }
q20466
_copy_future_state
train
def _copy_future_state(source, dest): """Internal helper to copy state from another Future. The other Future may be a concurrent.futures.Future. """ assert source.done() if dest.cancelled(): return assert not dest.done() if source.cancelled(): dest.cancel() else: ...
python
{ "resource": "" }
q20467
run_coroutine_threadsafe
train
def run_coroutine_threadsafe(coro, loop): """Submit a coroutine object to a given event loop. Return a concurrent.futures.Future to access the result. """ if not asyncio.iscoroutine(coro): raise TypeError('A coroutine object is required') future = concurrent.futures.Future() def callbac...
python
{ "resource": "" }
q20468
_init_attr_config
train
def _init_attr_config(attr_cfg): """Helper function to initialize attribute config objects""" attr_cfg.name = '' attr_cfg.writable = AttrWriteType.READ attr_cfg.data_format = AttrDataFormat.SCALAR attr_cfg.data_type = 0 attr_cfg.max_dim_x = 0 attr_cfg.max_dim_y = 0 attr_cfg.description =...
python
{ "resource": "" }
q20469
GeventExecutor.delegate
train
def delegate(self, fn, *args, **kwargs): """Return the given operation as a gevent future.""" return self.subexecutor.spawn(fn, *args, **kwargs)
python
{ "resource": "" }
q20470
connect
train
def connect(obj, signal, slot, event_type=tango.EventType.CHANGE_EVENT): """Experimental function. Not part of the official API""" return obj._helper.connect(signal, slot, event_type=event_type)
python
{ "resource": "" }
q20471
get_readme
train
def get_readme(name='README.rst'): """Get readme file contents without the badges.""" with open(name) as f: return '\n'.join( line for line in f.read().splitlines() if not line.startswith('|') or not line.endswith('|'))
python
{ "resource": "" }
q20472
abspath
train
def abspath(*path): """A method to determine absolute path for a given relative path to the directory where this setup.py script is located""" setup_dir = os.path.dirname(os.path.abspath(__file__)) return os.path.join(setup_dir, *path)
python
{ "resource": "" }
q20473
DbExportDevice
train
def DbExportDevice(self, argin): """ Export a device to the database :param argin: Str[0] = Device name Str[1] = CORBA IOR Str[2] = Device server process host name Str[3] = Device server process PID or string ``null`` Str[4] = Device server process version :type: tango.DevVarStringArray ...
python
{ "resource": "" }
q20474
DataBase.DbGetDeviceDomainList
train
def DbGetDeviceDomainList(self, argin): """ Get list of device domain name matching the specified :param argin: The wildcard :type: tango.DevString :return: Device name domain list :rtype: tango.DevVarStringArray """ self._log.debug("In DbGetDeviceDomainList()") ...
python
{ "resource": "" }
q20475
DataBase.DbUnExportServer
train
def DbUnExportServer(self, argin): """ Mark all devices belonging to a specified device server process as non exported :param argin: Device server name (executable/instance) :type: tango.DevString :return: :rtype: tango.DevVoid """ self._log.debug("In DbUnExportS...
python
{ "resource": "" }
q20476
DataBase.DbDeleteAttributeAlias
train
def DbDeleteAttributeAlias(self, argin): """ Delete an attribute alias. :param argin: Attriibute alias name. :type: tango.DevString :return: :rtype: tango.DevVoid """ self._log.debug("In DbDeleteAttributeAlias()") self.db.delete_attribute_alias(argin)
python
{ "resource": "" }
q20477
DataBase.DbGetClassAttributePropertyHist
train
def DbGetClassAttributePropertyHist(self, argin): """ Retrieve Tango class attribute property history :param argin: Str[0] = Tango class Str[1] = Attribute name Str[2] = Property name :type: tango.DevVarStringArray :return: Str[0] = Attribute name Str[1] = Proper...
python
{ "resource": "" }
q20478
DataBase.DbPutDeviceAttributeProperty2
train
def DbPutDeviceAttributeProperty2(self, argin): """ Put device attribute property. This command adds the possibility to have attribute property which are arrays. Not possible with the old DbPutDeviceAttributeProperty command. This old command is not deleted for compatibility reasons. :p...
python
{ "resource": "" }
q20479
DataBase.DbGetAttributeAliasList
train
def DbGetAttributeAliasList(self, argin): """ Get attribute alias list for a specified filter :param argin: attribute alias filter string (eg: att*) :type: tango.DevString :return: attribute aliases :rtype: tango.DevVarStringArray """ self._log.debug("In DbGetAttributeAl...
python
{ "resource": "" }
q20480
DataBase.DbGetExportdDeviceListForClass
train
def DbGetExportdDeviceListForClass(self, argin): """ Query the database for device exported for the specified class. :param argin: Class name :type: tango.DevString :return: Device exported list :rtype: tango.DevVarStringArray """ self._log.debug("In DbGetExportdDeviceLi...
python
{ "resource": "" }
q20481
DataBase.DbPutAttributeAlias
train
def DbPutAttributeAlias(self, argin): """ Define an alias for an attribute :param argin: Str[0] = attribute name Str[1] = attribute alias :type: tango.DevVarStringArray :return: :rtype: tango.DevVoid """ self._log.debug("In DbPutAttributeAlias()") if len...
python
{ "resource": "" }
q20482
DataBase.DbGetServerList
train
def DbGetServerList(self, argin): """ Get list of device server process defined in database with name matching the specified filter :param argin: The filter :type: tango.DevString :return: Device server process name list :rtype: tango.DevVarStringArray """ self._...
python
{ "resource": "" }
q20483
DataBase.DbDeleteDeviceAttributeProperty
train
def DbDeleteDeviceAttributeProperty(self, argin): """ delete a device attribute property from the database :param argin: Str[0] = Device name Str[1] = Attribute name Str[2] = Property name Str[n] = Property name :type: tango.DevVarStringArray :return: :rt...
python
{ "resource": "" }
q20484
DataBase.DbGetDeviceFamilyList
train
def DbGetDeviceFamilyList(self, argin): """ Get a list of device name families for device name matching the specified wildcard :param argin: The wildcard :type: tango.DevString :return: Family list :rtype: tango.DevVarStringArray """ self._log.debug("In DbGetDevi...
python
{ "resource": "" }
q20485
DataBase.DbGetDeviceWideList
train
def DbGetDeviceWideList(self, argin): """ Get a list of devices whose names satisfy the filter. :param argin: filter :type: tango.DevString :return: list of exported devices :rtype: tango.DevVarStringArray """ self._log.debug("In DbGetDeviceWideList()") argin = r...
python
{ "resource": "" }
q20486
DataBase.DbDeleteProperty
train
def DbDeleteProperty(self, argin): """ Delete free property from database :param argin: Str[0] = Object name Str[1] = Property name Str[n] = Property name :type: tango.DevVarStringArray :return: :rtype: tango.DevVoid """ self._log.debug("In DbDeletePrope...
python
{ "resource": "" }
q20487
DataBase.DbGetClassAttributeProperty2
train
def DbGetClassAttributeProperty2(self, argin): """ This command supports array property compared to the old command called DbGetClassAttributeProperty. The old command has not been deleted from the server for compatibility reasons. :param argin: Str[0] = Tango class name Str[1] ...
python
{ "resource": "" }
q20488
DataBase.DbGetDeviceExportedList
train
def DbGetDeviceExportedList(self, argin): """ Get a list of exported devices whose names satisfy the filter (wildcard is :param argin: filter :type: tango.DevString :return: list of exported devices :rtype: tango.DevVarStringArray """ self._log.debug("In DbGetDeviceExpor...
python
{ "resource": "" }
q20489
DataBase.DbGetDeviceAlias
train
def DbGetDeviceAlias(self, argin): """ Return alias for device name if found. :param argin: The device name :type: tango.DevString :return: The alias found :rtype: tango.DevString """ self._log.debug("In DbGetDeviceAlias()") ret, dev_name, dfm = check_device_name...
python
{ "resource": "" }
q20490
DataBase.DbGetClassPropertyList
train
def DbGetClassPropertyList(self, argin): """ Get property list for a given Tango class with a specified filter :param argin: The filter :type: tango.DevString :return: Property name list :rtype: tango.DevVarStringArray """ self._log.debug("In DbGetClassPropertyList()") ...
python
{ "resource": "" }
q20491
DataBase.DbGetDeviceAliasList
train
def DbGetDeviceAliasList(self, argin): """ Get device alias name with a specific filter :param argin: The filter :type: tango.DevString :return: Device alias list :rtype: tango.DevVarStringArray """ self._log.debug("In DbGetDeviceAliasList()") if not argin: ...
python
{ "resource": "" }
q20492
DataBase.DbDeleteClassAttribute
train
def DbDeleteClassAttribute(self, argin): """ delete a class attribute and all its properties from database :param argin: Str[0] = Tango class name Str[1] = Attribute name :type: tango.DevVarStringArray :return: :rtype: tango.DevVoid """ self._log.debug("In DbDele...
python
{ "resource": "" }
q20493
DataBase.DbGetClassPropertyHist
train
def DbGetClassPropertyHist(self, argin): """ Retrieve Tango class property history :param argin: Str[0] = Tango class Str[1] = Property name :type: tango.DevVarStringArray :return: Str[0] = Property name Str[1] = date Str[2] = Property value number (array case) ...
python
{ "resource": "" }
q20494
DataBase.DbDeleteDeviceAttribute
train
def DbDeleteDeviceAttribute(self, argin): """ Delete device attribute properties from database :param argin: Str[0] = Device name Str[1] = Attribute name :type: tango.DevVarStringArray :return: :rtype: tango.DevVoid """ self._log.debug("In DbDeleteDeviceAttribut...
python
{ "resource": "" }
q20495
DataBase.DbMySqlSelect
train
def DbMySqlSelect(self, argin): """ This is a very low level command. It executes the specified SELECT command on TANGO database and returns its result without filter. :param argin: MySql Select command :type: tango.DevString :return: MySql Select command result - sval...
python
{ "resource": "" }
q20496
DataBase.DbGetPropertyList
train
def DbGetPropertyList(self, argin): """ Get list of property defined for a free object and matching the specified filter :param argin: Str[0] = Object name Str[1] = filter :type: tango.DevVarStringArray :return: Property name list :rtype: tango.DevVarStringArray ...
python
{ "resource": "" }
q20497
DataBase.DbUnExportDevice
train
def DbUnExportDevice(self, argin): """ Mark a device as non exported in database :param argin: Device name :type: tango.DevString :return: :rtype: tango.DevVoid """ self._log.debug("In DbUnExportDevice()") dev_name = argin[0].lower() self.db.unexport_devi...
python
{ "resource": "" }
q20498
DataBase.DbGetAliasDevice
train
def DbGetAliasDevice(self, argin): """ Get device name from its alias. :param argin: Alias name :type: tango.DevString :return: Device name :rtype: tango.DevString """ self._log.debug("In DbGetAliasDevice()") if not argin: argin = "%" else: ...
python
{ "resource": "" }
q20499
DataBase.DbDeleteDevice
train
def DbDeleteDevice(self, argin): """ Delete a devcie from database :param argin: device name :type: tango.DevString :return: :rtype: tango.DevVoid """ self._log.debug("In DbDeleteDevice()") ret, dev_name, dfm = check_device_name(argin) if not ret: ...
python
{ "resource": "" }