Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def resources(self):
"""
Get a list of CachedResource objects for the session
:return: List of CachedResource objects for the session
"""
res_list = []
ruri = 'xnat:resources/xnat:resource'
file_elements = self.sess_element.findall(ruri, NS)
if file_elements:
for file_element in file_elements:
xmltype = '{http://www.w3.org/2001/XMLSchema-instance}type'
xsi_type = file_element.get(xmltype)
if xsi_type == 'xnat:resourceCatalog':
res_list.append(CachedResource(file_element, self))
return res_list
def out_resources(self):
"""
Get a list of CachedResource objects for "out" type
:return: List of CachedResource objects for "out" type
"""
res_list = []
file_elements = self.assr_element.findall('xnat:out/xnat:file', NS)
if file_elements:
for file_element in file_elements:
res_list.append(CachedResource(file_element, self))
return res_list
def in_resources(self):
"""
Get a list of CachedResource objects for "in" type
:return: List of CachedResource objects for "in" type
"""
res_list = []
file_elements = self.assr_element.findall('xnat:in/xnat:file', NS)
if file_elements:
for file_element in file_elements:
res_list.append(CachedResource(file_element, self))
return res_list
def resources(self):
"""
Get a list of the CachedResource (s) associated with this scan.
:return: List of the CachedResource (s) associated with this scan.
"""
res_list = []
file_elements = self.scan_element.findall('xnat:file', NS)
if file_elements:
for file_element in file_elements:
xmltype = '{http://www.w3.org/2001/XMLSchema-instance}type'
xsi_type = file_element.get(xmltype)
if xsi_type == 'xnat:resourceCatalog':
res_list.append(CachedResource(file_element, self))
return res_list