'Get the value of a supplementary field for an asset.
Parameters
sid : int
The sid of the asset to query.
field_name : str
Name of the supplementary field.
as_of_date : pd.Timestamp, None
The last known value on this date is returned. If None, a
value is returned only if we\'ve only ever had one value for
this sid. If None and we\'ve had multiple values,
MultipleValuesFoundForSid is raised.
Raises
NoValueForSid
If we have no values for this asset, or no values was known
on this as_of_date.
MultipleValuesFoundForSid
If we have had multiple values for this asset over time, and
None was passed for as_of_date.'

def get_supplementary_field(self, sid, field_name, as_of_date):

    try:
        periods = self.equity_supplementary_map_by_sid[(field_name, sid)]
        assert periods, ('empty    periods    list    for    %r' % (field_name, sid))
    except KeyError:
        raise NoValueForSid(field=field_name, sid=sid)
    if (not as_of_date):
        if (len(periods) > 1):
            raise MultipleValuesFoundForSid(field=field_name, sid=sid, options={p.value for p in periods})
        return periods[0].value
    for (start, end, _, value) in periods:
        if (start <= as_of_date < end):
            return value
    raise NoValueForSid(field=field_name, sid=sid)
