Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@ObjectMapper.object_attr('related_publications')
def publication_obj_attr(self, container, manager):
ret = None
if isinstance(container.related_publications, str):
ret = (container.related_publications,)
return ret
@ObjectMapper.object_attr('colnames')
def attr_columns(self, container, manager):
if all(len(col) == 0 for col in container.columns):
return tuple()
return container.colnames
@ObjectMapper.object_attr('scratch_containers')
def scratch_containers(self, container, manager):
scratch = container.scratch
ret = list()
for s in scratch.values():
if not isinstance(s, ScratchData):
ret.append(s)
return ret
@ObjectMapper.object_attr('scratch_datas')
def scratch_datas(self, container, manager):
scratch = container.scratch
ret = list()
for s in scratch.values():
if isinstance(s, ScratchData):
ret.append(s)
return ret
@ObjectMapper.object_attr('experimenter')
def experimenter_obj_attr(self, container, manager):
ret = None
if isinstance(container.experimenter, str):
ret = (container.experimenter,)
return ret