def _dup_decompose(f, K):
 df = (len(f) - 1)
 for s in range(2, df):
  if ((df % s) != 0):
   continue
  h = _dup_right_decompose(f, s, K)
  if (h is not None):
   g = _dup_left_decompose(f, h, K)
   if (g is not None):
    return (g, h)
 return None

def _dup_decompose ( f , K ) : df = ( len ( f ) - 1 ) for s in range ( 2 , df ) : if ( ( df % s ) != 0 ) : continue h = _dup_right_decompose ( f , s , K ) if ( h is not None ) : g = _dup_left_decompose ( f , h , K ) if ( g is not None ) : return ( g , h ) return None
helper function for :func:dup_decompose .