def _isproperdist(X):
 X = np.asarray(X)
 if ((not np.allclose(np.sum(X), 1)) or (not np.all((X >= 0))) or (not np.all((X <= 1)))):
  return False
 else:
  return True

def _isproperdist ( X ) : X = np . asarray ( X ) if ( ( not np . allclose ( np . sum ( X ) , 1 ) ) or ( not np . all ( ( X >= 0 ) ) ) or ( not np . all ( ( X <= 1 ) ) ) ) : return False else : return True
checks to see if x is a proper probability distribution .