7. Given two non-zero complex numbers $x, y$ whose sum of cubes is 0, then $\left(\frac{x}{x-y}\right)^{2017}+\left(\frac{y}{x-y}\right)^{2017}=$
7.0 or $\pm \sqrt{3} i$

Analysis: According to the problem, $x^{3}+y^{3}=(x+y)\left(x^{2}-x y+y^{2}\right)=0$.
(1) If $x+y=0$, then obviously $\left(\frac{x}{x-y}\right)^{2017}+\left(\frac{y}{x-y}\right)^{2017}=0$;
(2) If $x+y \neq 0$, then $x^{2}-x y+y^{2}=0$, let $t=\frac{x}{y}$, then $t^{2}-t+1=0$ and $t^{3}+1=0, t=\frac{1 \pm \sqrt{3} i}{2}$,
$$
\begin{array}{l}
\text { Thus }\left(\frac{x}{x-y}\right)^{2017}+\left(\frac{y}{x-y}\right)^{2017}=\left(\frac{t}{t-1}\right)^{2017}+\left(\frac{1}{t-1}\right)^{2017}=\frac{t^{2017}+1}{(t-1)^{2017}}=\frac{t+1}{t^{2}}=-t(t+1) \\
=1-2 t= \pm \sqrt{3} i .
\end{array}
$$

In summary, the original expression's value is 0 or $\pm \sqrt{3} i$.