def _generate_chunk(self, n=2**10):
        output = self.pattern[self.last_offset:self.last_offset + n]
        n_left = n - len(output)
        whole_patterns = n_left / len(self.pattern)
        output += self.pattern * whole_patterns
        self.last_offset = n - len(output)
        output += self.pattern[:self.last_offset]
        return output
dataset/ETHPy150Open lbryio/lbry/tests/functional_tests.py/GenFile._generate_chunk/original