def add(self, foreign_currency, foreign_curve=None, fx_spot=<NUM_LIT:1.0>):
assert isinstance(foreign_currency, type(self.currency))<EOL>assert isinstance(foreign_curve, curve.RateCurve)<EOL>assert isinstance(fx_spot, float)<EOL>self[self.currency, foreign_currency] = FxCurve.cast(fx_spot, self.domestic_curve, foreign_curve)<EOL>self[foreign_currency, self.currency] = FxCurve.cast(<NUM_LIT:1> / fx_spot, foreign_curve, self.domestic_curve)<EOL>f = foreign_currency<EOL>new = dict()<EOL>for d, s in self:<EOL><INDENT>if s is self.currency and d is not foreign_currency:<EOL><INDENT>triangulated = self[d, s](self.domestic_curve.origin) * fx_spot<EOL>if (d, f) in self:<EOL><INDENT>self[d, f].foreign_curve = foreign_curve<EOL>self[d, f].fx_spot = triangulated<EOL>self[f, d].domestic_curve = foreign_curve<EOL>self[f, d].fx_spot = <NUM_LIT:1> / triangulated<EOL><DEDENT>else:<EOL><INDENT>new[d, f] = FxCurve.cast(triangulated, self[d, s].domestic_curve, foreign_curve)<EOL>new[f, d] = FxCurve.cast(<NUM_LIT:1> / triangulated, foreign_curve, self[d, s].domestic_curve)<EOL><DEDENT><DEDENT><DEDENT>self.update(new)<EOL>
adds contents to FxShelf.
If curve is FxCurve or FxDict, spot should turn curve.currency into self.currency,
else spot should turn currency into self.currency by
N in EUR * spot = N in USD for currency = EUR and self.currency = USD