Returns a list of mounting connectors

    :param red_data: The red data to be searched
    :param ignore_outputs: If outputs should be ignored
    :return: A list of connectors with active mount option.
320622
def red_get_mount_connectors(red_data, ignore_outputs):
    

    keys = []

    batches = red_data.get('batches')
    inputs = red_data.get('inputs')
    if batches:
        for batch in batches:
            keys.extend(red_get_mount_connectors_from_inputs(batch['inputs']))
    elif inputs:
        keys.extend(red_get_mount_connectors_from_inputs(inputs))

    if not ignore_outputs:
        outputs = red_data.get('outputs')
        if batches:
            for batch in batches:
                batch_outputs = batch.get('outputs')
                if batch_outputs:
                    keys.extend(red_get_mount_connectors_from_outputs(batch_outputs))

        elif outputs:
            keys.extend(red_get_mount_connectors_from_outputs(outputs))

    return keys
733782
def get_connected_devices():
        
        all_daplinks = []
        all_interfaces = _get_interfaces()
        for interface in all_interfaces:
            try:
                new_daplink = DAPAccessCMSISDAP(None, interface=interface)
                all_daplinks.append(new_daplink)
            except DAPAccessIntf.TransferError:
                logger = logging.getLogger(__name__)
                logger.error('Failed to get unique id', exc_info=session.Session.get_current().log_tracebacks)
        return all_daplinks
912045
def get_available_devices(self):
        
        connected_devices = self.mbeds.list_mbeds() if self.mbeds else []
        # Check non mbedOS supported devices.
        # Just for backward compatible reason - is obsolete..
        edbg_ports = self.available_edbg_ports()
        for port in edbg_ports:
            connected_devices.append({
                "platform_name": "SAM4E",
                "serial_port": port,
                "mount_point": None,
                "target_id": None,
                "baud_rate": 460800
            })
        for dev in connected_devices:
            dev['state'] = "unknown"

        return connected_devices
617938
def _list_devices(self, df_output):
        
        all_devices = [l.strip().split() for l in df_output.splitlines()]

        # Skip the header row and empty lines.
        raw_devices = [l for l in all_devices[1:] if l]

        # Flatten the disks that appear in the mulitple lines.
        flattened_devices = self._flatten_devices(raw_devices)

        # Filter fake or unwanteddisks.
        return [d for d in flattened_devices if self._keep_device(d)]
1010882
def parse_networks_output(out):
    
    if not out:
        return []
    line_iter = islice(out.splitlines(), 1, None)  # Skip header
    return list(map(_network_info, line_iter))
1081858
def get_unignored_file_paths(ignore_list=None, whitelist=None):
    
    unignored_files = []
    if ignore_list is None:
        ignore_list = []
    if whitelist is None:
        whitelist = []

    for root, dirs, files in os.walk("."):
        floyd_logger.debug("Root:%s, Dirs:%s", root, dirs)

        if ignore_path(unix_style_path(root), ignore_list, whitelist):
            # Reset dirs to avoid going further down this directory.
            # Then continue to the next iteration of os.walk, which causes
            # everything in this directory to be ignored.
            #
            # Note that whitelisted files that are within directories that are
            # ignored will not be whitelisted. This follows the expected
            # behavior established by .gitignore logic:
            # "It is not possible to re-include a file if a parent directory of
            # that file is excluded."
            # https://git-scm.com/docs/gitignore#_pattern_format
            dirs[:] = []
            floyd_logger.debug("Ignoring directory : %s", root)
            continue

        for file_name in files:
            file_path = unix_style_path(os.path.join(root, file_name))
            if ignore_path(file_path, ignore_list, whitelist):
                floyd_logger.debug("Ignoring file : %s", file_name)
                continue

            unignored_files.append(os.path.join(root, file_name))

    return unignored_files
1010824
def _filter(self, data):
        
        filtered_data = []
        for queue, data in zip(self._raw_data_queues, data):
            queue.append(data)
            filtered_data.append(numpy.median(queue))

        return filtered_data
406197
def _get_outputs(self):
        
        out_size = mx_uint()
        handles = ctypes.POINTER(NDArrayHandle)()
        check_call(_LIB.MXExecutorOutputs(self.handle,
                                          ctypes.byref(out_size), ctypes.byref(handles)))
        num_output = out_size.value
        outputs = [_ndarray_cls(NDArrayHandle(handles[i])) for i in range(num_output)]
        return outputs
895753
def get_output_sensors(self):
        
        data = dict()
        found_sensors = get_sensors()
        if len(found_sensors) == 0:
            raise Exception("No sensors detected! "
                            "Ensure lm-sensors is installed and check the output of the `sensors` command.")
        for sensor in found_sensors:
            data[sensor.name] = self.format_sensor(sensor)
            data["{}_bar".format(sensor.name)] = self.format_sensor_bar(sensor)
        data['temp'] = max((s.current for s in found_sensors))
        return {
            'full_text': self.format.format(**data),
            'urgent': self.get_urgent(found_sensors),
            'color': self.color if not self.dynamic_color else None,
        }
717068
def output(data, **kwargs):  # pylint: disable=unused-argument
    '''
    
    '''
    try:
        if 'output_indent' not in __opts__:
            return salt.utils.json.dumps(data, default=repr, indent=4)

        indent = __opts__.get('output_indent')
        sort_keys = False

        if indent is None:
            indent = None

        elif indent == 'pretty':
            indent = 4
            sort_keys = True

        elif isinstance(indent, int):
            if indent >= 0:
                indent = indent
            else:
                indent = None

        return salt.utils.json.dumps(data, default=repr, indent=indent, sort_keys=sort_keys)

    except UnicodeDecodeError as exc:
        log.error('Unable to serialize output to json')
        return salt.utils.json.dumps(
            {'error': 'Unable to serialize output to json',
             'message': six.text_type(exc)}
        )

    except TypeError:
        log.debug('An error occurred while outputting JSON', exc_info=True)
    # Return valid JSON for unserializable objects
    return salt.utils.json.dumps({})
419691
def get_ports_by_name(device_name):
    ''''''
    filtered_devices = filter(
        lambda device: device_name in device[1],
        list_ports.comports()
    )
    device_ports = [device[0] for device in filtered_devices]
    return device_ports
1203916
def _get_result_paths(self, data):
        
        result = {}

        # Always output:
        result['UnassembledReads1'] = ResultPath(Path=
                                                 self._unassembled_reads1_out_file_name(
                                                 ),
                                                 IsWritten=True)
        result['UnassembledReads2'] = ResultPath(Path=
                                                 self._unassembled_reads2_out_file_name(
                                                 ),
                                                 IsWritten=True)

        # optional output, so we check for each
        # check for assembled reads file
        if self.Parameters['-s'].isOn():
            result['Assembled'] = ResultPath(Path=
                                             self._assembled_out_file_name(),
                                             IsWritten=True)

        # check for discarded (unassembled) reads1 file
        if self.Parameters['-3'].isOn():
            result['Reads1Discarded'] = ResultPath(Path=
                                                   self._discarded_reads1_out_file_name(
                                                   ),
                                                   IsWritten=True)

        # check for discarded (unassembled) reads2 file
        if self.Parameters['-4'].isOn():
            result['Reads2Discarded'] = ResultPath(Path=
                                                   self._discarded_reads2_out_file_name(
                                                   ),
                                                   IsWritten=True)

        # check for pretty-alignment file
        if self.Parameters['-E'].isOn():
            result['PrettyAlignments'] = ResultPath(Path=
                                                    self._pretty_alignment_out_file_name(
                                                    ),
                                                    IsWritten=True)

        return result
1147125
def connections(self, hotspot=None):
        
        cons = self.findItems(XNodeConnection)
        if hotspot is not None:
            filt = lambda x: hotspot in (x.inputHotspot(), x.outputHotspot())
            return filter(filt, cons)
        return cons
503273
def identify_datafiles(root,
                       extensions_to_ignore=None,
                       directories_to_ignore=None,
                       files_to_ignore=None):
    

    for dirpath, dirnames, filenames in walk(root):

        for ignore in directories_to_ignore:
            if ignore in dirnames:
                dirnames.remove(ignore)  # don't visit ignored directories


        for filename in filenames:


            # Ignore extensions that need no IP check
            ignore = False
            for ext in extensions_to_ignore:
                if filename.endswith(ext):
                    ignore = True

            if filename in files_to_ignore:
                ignore = True

            if ignore is False:
                yield dirpath, filename
130854
def find_mounts(self):
        

        for mountpoint, (orig, fs, opts) in self.mountpoints.items():
            if 'bind' not in opts and (re.match(self.orig_re_pattern, orig) or
                                       (self.be_greedy and re.match(self.re_pattern, mountpoint))):
                yield mountpoint
283115
def get_connections(self, data=False):
        
        if data:
            return self._connections
        return list(self._connections.keys())
571049
def output(data, **kwargs):  # pylint: disable=unused-argument
    '''
    
    '''
    color = salt.utils.color.get_colors(
            __opts__.get('color'),
            __opts__.get('color_theme'))
    strip_colors = __opts__.get('strip_colors', True)
    ident = 0
    if __opts__.get('__multi_key'):
        ident = 4
    if __opts__['transport'] in ('zeromq', 'tcp'):
        acc = 'minions'
        pend = 'minions_pre'
        den = 'minions_denied'
        rej = 'minions_rejected'

        cmap = {pend: color['RED'],
                acc: color['GREEN'],
                den: color['MAGENTA'],
                rej: color['BLUE'],
                'local': color['MAGENTA']}

        trans = {pend: u'{0}{1}Unaccepted Keys:{2}'.format(
                                    ' ' * ident,
                                    color['LIGHT_RED'],
                                    color['ENDC']),
                 acc: u'{0}{1}Accepted Keys:{2}'.format(
                                    ' ' * ident,
                                    color['LIGHT_GREEN'],
                                    color['ENDC']),
                 den: u'{0}{1}Denied Keys:{2}'.format(
                                    ' ' * ident,
                                    color['LIGHT_MAGENTA'],
                                    color['ENDC']),
                 rej: u'{0}{1}Rejected Keys:{2}'.format(
                                    ' ' * ident,
                                    color['LIGHT_BLUE'],
                                    color['ENDC']),
                 'local': u'{0}{1}Local Keys:{2}'.format(
                                    ' ' * ident,
                                    color['LIGHT_MAGENTA'],
                                    color['ENDC'])}
    else:
        acc = 'accepted'
        pend = 'pending'
        rej = 'rejected'

        cmap = {pend: color['RED'],
                acc: color['GREEN'],
                rej: color['BLUE'],
                'local': color['MAGENTA']}

        trans = {pend: u'{0}{1}Unaccepted Keys:{2}'.format(
                                    ' ' * ident,
                                    color['LIGHT_RED'],
                                    color['ENDC']),
                 acc: u'{0}{1}Accepted Keys:{2}'.format(
                                    ' ' * ident,
                                    color['LIGHT_GREEN'],
                                    color['ENDC']),
                 rej: u'{0}{1}Rejected Keys:{2}'.format(
                                    ' ' * ident,
                                    color['LIGHT_BLUE'],
                                    color['ENDC']),
                 'local': u'{0}{1}Local Keys:{2}'.format(
                                    ' ' * ident,
                                    color['LIGHT_MAGENTA'],
                                    color['ENDC'])}

    ret = ''

    for status in sorted(data):
        ret += u'{0}\n'.format(trans[status])
        for key in sorted(data[status]):
            key = salt.utils.data.decode(key)
            skey = salt.output.strip_esc_sequence(key) if strip_colors else key
            if isinstance(data[status], list):
                ret += u'{0}{1}{2}{3}\n'.format(
                        ' ' * ident,
                        cmap[status],
                        skey,
                        color['ENDC'])
            if isinstance(data[status], dict):
                ret += u'{0}{1}{2}:  {3}{4}\n'.format(
                        ' ' * ident,
                        cmap[status],
                        skey,
                        data[status][key],
                        color['ENDC'])
    return ret