

def _set_controls(coordinator, root, namespace):
    '\n  Get controls from coordinator XML\n\n  Set properties on ``coordinator`` with controls from XML etree ``root``.\n  '
    namespaces = {
        'n': namespace,
    }
    controls_list = root.xpath('n:controls', namespaces=namespaces)
    if controls_list:
        controls = controls_list[0]
        concurrency = controls.xpath('n:concurrency', namespaces=namespaces)
        timeout = controls.xpath('n:timeout', namespaces=namespaces)
        execution = controls.xpath('n:execution', namespaces=namespaces)
        throttle = controls.xpath('n:throttle', namespaces=namespaces)
        if concurrency:
            coordinator.concurrency = concurrency[0].text
        if timeout:
            coordinator.timeout = timeout[0].text
        if execution:
            coordinator.execution = execution[0].text
        if throttle:
            coordinator.throttle = throttle[0].text

dataset/ETHPy150Open cloudera/hue/apps/oozie/src/oozie/importlib/coordinators.py _set_controls/original