<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def max_run_length(x: np.ndarray, val: int):
 """Finds the maximum continuous length of the given value in the sequence"""

        if x.size == 0:
            return 0
        else:
            y = np.array(x[1:] != x[:-1])
            i = np.append(np.where(y), len(x) - 1)
            run_lengths = np.diff(np.append(-1, i))
            run_length_values = x[i]
            return max([rl for rl, v in zip(run_lengths, run_length_values) if v == val], default=0)