def leslie(f, s):
 f = np.atleast_1d(f)
 s = np.atleast_1d(s)
 if (f.ndim != 1):
  raise ValueError('Incorrect shape for f.  f must be one-dimensional')
 if (s.ndim != 1):
  raise ValueError('Incorrect shape for s.  s must be one-dimensional')
 if (f.size != (s.size + 1)):
  raise ValueError('Incorrect lengths for f and s.  The length of s must be one less than the length of f.')
 if (s.size == 0):
  raise ValueError('The length of s must be at least 1.')
 tmp = (f[0] + s[0])
 n = f.size
 a = np.zeros((n, n), dtype=tmp.dtype)
 a[0] = f
 a[(list(range(1, n)), list(range(0, (n - 1))))] = s
 return a

def leslie ( f , s ) : f = np . atleast_1d ( f ) s = np . atleast_1d ( s ) if ( f . ndim != 1 ) : raise ValueError ( 'Incorrect shape for f.  f must be one-dimensional' ) if ( s . ndim != 1 ) : raise ValueError ( 'Incorrect shape for s.  s must be one-dimensional' ) if ( f . size != ( s . size + 1 ) ) : raise ValueError ( 'Incorrect lengths for f and s.  The length of s must be one less than the length of f.' ) if ( s . size == 0 ) : raise ValueError ( 'The length of s must be at least 1.' ) tmp = ( f [ 0 ] + s [ 0 ] ) n = f . size a = np . zeros ( ( n , n ) , dtype = tmp . dtype ) a [ 0 ] = f a [ ( list ( range ( 1 , n ) ) , list ( range ( 0 , ( n - 1 ) ) ) ) ] = s return a
create a leslie matrix .