def get_usage(action_mapping):
 usage = ['%prog action [options]\nactions:']
 available_actions = action_mapping.keys()
 available_actions.sort()
 for a in available_actions:
  func = action_mapping[a]
  usage.append(('  %s %s' % (a, func.args)))
  usage.extend(textwrap.wrap(getattr(func, 'help_doc', textwrap.dedent(func.__doc__.strip())), initial_indent='    ', subsequent_indent='    '))
  usage.append('')
 return '\n'.join(usage[:(-1)])

def get_usage ( action_mapping ) : usage = [ '%prog action [options]\nactions:' ] available_actions = action_mapping . keys ( ) available_actions . sort ( ) for a in available_actions : func = action_mapping [ a ] usage . append ( ( '  %s %s' % ( a , func . args ) ) ) usage . extend ( textwrap . wrap ( getattr ( func , 'help_doc' , textwrap . dedent ( func . __doc__ . strip ( ) ) ) , initial_indent = '    ' , subsequent_indent = '    ' ) ) usage . append ( '' ) return '\n' . join ( usage [ : ( - 1 ) ] )
return the current usage of a ratelimit for the specified time slice .