from scheduler.block import BaseBlock class UniqueList(BaseBlock): def __call__(self, input: list) -> list: return list(set(input)) class HeadOfList(BaseBlock): def __call__(self, input: list) -> str: if len(input) > 0: return input[0] else: return None class ReverseList(BaseBlock): def __call__(self, input: list) -> list: l = input[:] l.reverse() return l class TailOfList(BaseBlock): def __call__(self, input: list) -> list: return input[1:] class LengthOfList(BaseBlock): def __call__(self, input: list) -> int: return len(input) class ConcatList(BaseBlock): def __call__(self, seq1: list, seq2: list) -> list: return seq1 + seq2