def _fetch_bounded_seq(self, var, start, end, window_size, boundary):
var_len = end - start - window_size<EOL>start = start if start >= boundary[<NUM_LIT:0>] else boundary[<NUM_LIT:0>]<EOL>end = end if end <= boundary[<NUM_LIT:1>] else boundary[<NUM_LIT:1>]<EOL>if start >= end:<EOL><INDENT>return "<STR_LIT>"<EOL><DEDENT>seq = self.hdp.get_seq(var.ac, start, end)<EOL>if len(seq) < end - start and len(seq) < var_len:<EOL><INDENT>raise HGVSInvalidVariantError(<EOL>"<STR_LIT>".format(var=var))<EOL><DEDENT>return seq<EOL>
Fetch reference sequence from hgvs data provider.

        The start position is 0 and the interval is half open