def abcd_normalize(A=None, B=None, C=None, D=None):
 (A, B, C, D) = map(_atleast_2d_or_none, (A, B, C, D))
 (MA, NA) = _shape_or_none(A)
 (MB, NB) = _shape_or_none(B)
 (MC, NC) = _shape_or_none(C)
 (MD, ND) = _shape_or_none(D)
 p = _choice_not_none(MA, MB, NC)
 q = _choice_not_none(NB, ND)
 r = _choice_not_none(MC, MD)
 if ((p is None) or (q is None) or (r is None)):
  raise ValueError('Not enough information on the system.')
 (A, B, C, D) = map(_none_to_empty_2d, (A, B, C, D))
 A = _restore(A, (p, p))
 B = _restore(B, (p, q))
 C = _restore(C, (r, p))
 D = _restore(D, (r, q))
 return (A, B, C, D)

def abcd_normalize ( A = None , B = None , C = None , D = None ) : ( A , B , C , D ) = map ( _atleast_2d_or_none , ( A , B , C , D ) ) ( MA , NA ) = _shape_or_none ( A ) ( MB , NB ) = _shape_or_none ( B ) ( MC , NC ) = _shape_or_none ( C ) ( MD , ND ) = _shape_or_none ( D ) p = _choice_not_none ( MA , MB , NC ) q = _choice_not_none ( NB , ND ) r = _choice_not_none ( MC , MD ) if ( ( p is None ) or ( q is None ) or ( r is None ) ) : raise ValueError ( 'Not enough information on the system.' ) ( A , B , C , D ) = map ( _none_to_empty_2d , ( A , B , C , D ) ) A = _restore ( A , ( p , p ) ) B = _restore ( B , ( p , q ) ) C = _restore ( C , ( r , p ) ) D = _restore ( D , ( r , q ) ) return ( A , B , C , D )
check state-space matrices and ensure they are two-dimensional .