<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _edge_one_node(nodes: List[Node]):
 """Get edges where either the source or target are in the list of nodes. Note: doing this with the nodes directly is not yet supported by SQLAlchemy .. code-block:: python return or_( Edge.source.in_(nodes), Edge.target.in_(nodes), ) """

        node_ids = [node.id for node in nodes]

        return or_(
            Edge.source_id.in_(node_ids),
            Edge.target_id.in_(node_ids),
        )