def METHOD_NAME(structure_or_job):
    """
    Return structure from structure or atomic job.
    Args:
        structure_or_job (:class:`~.AtomisticGenericJob`, :class:`~.Atoms`):
            if :class:`~.AtomisticGenericJob` try to get most recent structure,
    copy it and set the job_id in :attr:`~.Atoms.info`
    Returns:
        :class:`~.Atoms`: structure from the job or given structure
    Raises:
        ValueError: if given :class:`~.AtomisticGenericJob` has no structure set
        TypeError: if structure_or_job is of invalid type
    """
    if isinstance(structure_or_job, AtomisticGenericJob):
        if structure_or_job.structure:
            s = structure_or_job.get_structure(-1).copy()
            s.info["jobid"] = structure_or_job.job_id
            return s
        else:
            raise ValueError("The job does not contain any structure to import.")
    elif isinstance(structure_or_job, Atoms):
        return structure_or_job
    else:
        raise TypeError(
            f"structure_or_job must be of type {Atoms} or {AtomisticGenericJob}, not {type(structure_or_job)}"
        )