def can_eliminate_tool_dependency(metadata_dict, name, dependency_type, version):
 td_dict = metadata_dict.get('tool_dependencies', {})
 for (td_key, td_val) in td_dict.items():
  if (td_key == 'set_environment'):
   for td in td_val:
    n = td.get('name', None)
    t = td.get('type', None)
    if ((n == name) and (t == dependency_type)):
     return False
  else:
   n = td_val.get('name', None)
   t = td_val.get('type', None)
   v = td_val.get('version', None)
   if ((n == name) and (t == dependency_type) and (v == version)):
    return False
 return True

def can_eliminate_tool_dependency ( metadata_dict , name , dependency_type , version ) : td_dict = metadata_dict . get ( 'tool_dependencies' , { } ) for ( td_key , td_val ) in td_dict . items ( ) : if ( td_key == 'set_environment' ) : for td in td_val : n = td . get ( 'name' , None ) t = td . get ( 'type' , None ) if ( ( n == name ) and ( t == dependency_type ) ) : return False else : n = td_val . get ( 'name' , None ) t = td_val . get ( 'type' , None ) v = td_val . get ( 'version' , None ) if ( ( n == name ) and ( t == dependency_type ) and ( v == version ) ) : return False return True
determine if the relationship between a tool_dependency record associated with a tool_shed_repository record on the galaxy side can be eliminated .