(motions)
return " ".join(
        [
            get_count(motion, len(list(group)))
            for motion, group in itertools.groupby(motions)
        ]
    )
Return the given motion sequence in single-line form.

    e.g. 2* 5j $
Return the given motion sequence in single-line form.
Return the given motion sequence in single - line form .
def compact_motions(motions):
    """
    Return the given motion sequence in single-line form.

    e.g. 2* 5j $
    """
    return " ".join(
        [
            get_count(motion, len(list(group)))
            for motion, group in itertools.groupby(motions)
        ]
    )
def compact_motions ( motions ) : return " " . join ( [ get_count ( motion , len ( list ( group ) ) ) for motion , group in itertools . groupby ( motions ) ] )