def is_structure(structure):
    """Check if an object is a structure that javelin can understand.

    ase.atoms with have cell, get_scaled_positions and get_atomic_numbers attributes
    diffpy.structure with have lattice, xyz, and element attributes
    """
    return (((hasattr(structure, 'cell') or hasattr(structure, 'unitcell')) and
             hasattr(structure, 'get_scaled_positions') and
             hasattr(structure, 'get_atomic_numbers'))
            or
            (hasattr(structure, 'lattice') and
             hasattr(structure, 'xyz') and
             hasattr(structure, 'element')))