def make_lag_names(names, lag_order, trendorder=1):
 lag_names = []
 if isinstance(names, string_types):
  names = [names]
 for i in range(1, (lag_order + 1)):
  for name in names:
   if (not isinstance(name, string_types)):
    name = str(name)
   lag_names.append(((('L' + str(i)) + '.') + name))
 if (trendorder != 0):
  lag_names.insert(0, 'const')
 if (trendorder > 1):
  lag_names.insert(0, 'trend')
 if (trendorder > 2):
  lag_names.insert(0, 'trend**2')
 return lag_names

def make_lag_names ( names , lag_order , trendorder = 1 ) : lag_names = [ ] if isinstance ( names , string_types ) : names = [ names ] for i in range ( 1 , ( lag_order + 1 ) ) : for name in names : if ( not isinstance ( name , string_types ) ) : name = str ( name ) lag_names . append ( ( ( ( 'L' + str ( i ) ) + '.' ) + name ) ) if ( trendorder != 0 ) : lag_names . insert ( 0 , 'const' ) if ( trendorder > 1 ) : lag_names . insert ( 0 , 'trend' ) if ( trendorder > 2 ) : lag_names . insert ( 0 , 'trend**2' ) return lag_names
produce list of lag-variable names .