def valid():
 m_data = __salt__['config.merge']('mine_functions', {})
 if (not m_data):
  return
 data = {}
 for func in m_data:
  if (m_data[func] and isinstance(m_data[func], dict)):
   mine_func = m_data[func].pop('mine_function', func)
   if (not _mine_function_available(mine_func)):
    continue
   data[func] = {mine_func: m_data[func]}
  elif (m_data[func] and isinstance(m_data[func], list)):
   mine_func = func
   if (isinstance(m_data[func][0], dict) and ('mine_function' in m_data[func][0])):
    mine_func = m_data[func][0]['mine_function']
    m_data[func].pop(0)
   if (not _mine_function_available(mine_func)):
    continue
   data[func] = {mine_func: m_data[func]}
  else:
   if (not _mine_function_available(func)):
    continue
   data[func] = m_data[func]
 return data

def valid ( ) : m_data = __salt__ [ 'config.merge' ] ( 'mine_functions' , { } ) if ( not m_data ) : return data = { } for func in m_data : if ( m_data [ func ] and isinstance ( m_data [ func ] , dict ) ) : mine_func = m_data [ func ] . pop ( 'mine_function' , func ) if ( not _mine_function_available ( mine_func ) ) : continue data [ func ] = { mine_func : m_data [ func ] } elif ( m_data [ func ] and isinstance ( m_data [ func ] , list ) ) : mine_func = func if ( isinstance ( m_data [ func ] [ 0 ] , dict ) and ( 'mine_function' in m_data [ func ] [ 0 ] ) ) : mine_func = m_data [ func ] [ 0 ] [ 'mine_function' ] m_data [ func ] . pop ( 0 ) if ( not _mine_function_available ( mine_func ) ) : continue data [ func ] = { mine_func : m_data [ func ] } else : if ( not _mine_function_available ( func ) ) : continue data [ func ] = m_data [ func ] return data
determines if the individual is valid or not .