def _maybe_align_partitions(args):
 dfs = [df for df in args if isinstance(df, _Frame)]
 if (not dfs):
  return args
 divisions = dfs[0].divisions
 if (not all(((df.divisions == divisions) for df in dfs))):
  dfs2 = iter(align_partitions(*dfs)[0])
  return [(a if (not isinstance(a, _Frame)) else next(dfs2)) for a in args]
 return args

def _maybe_align_partitions ( args ) : dfs = [ df for df in args if isinstance ( df , _Frame ) ] if ( not dfs ) : return args divisions = dfs [ 0 ] . divisions if ( not all ( ( ( df . divisions == divisions ) for df in dfs ) ) ) : dfs2 = iter ( align_partitions ( * dfs ) [ 0 ] ) return [ ( a if ( not isinstance ( a , _Frame ) ) else next ( dfs2 ) ) for a in args ] return args
align dataframe blocks if divisions are different .