    <span class="k">def</span> <span class="nf">get_heteroatoms</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">elements</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        Identify non-H, non-C atoms in the MoleculeGraph, returning a list of</span>
<span class="sd">        their node indices.</span>

<span class="sd">        :param elements: List of 