def get_random_job_prefix(fixed_prefix='', max_job_prefix_len=10, leading_trailing_underscores=True):
 length = (max_job_prefix_len - len(fixed_prefix))
 if leading_trailing_underscores:
  length -= 2
 result = [choice(RANDOM_JOB_PREFIX_CHARS) for i in range(length)]
 if leading_trailing_underscores:
  return (((fixed_prefix + '_') + ''.join(result)) + '_')
 else:
  return (fixed_prefix + ''.join(result))

def get_random_job_prefix ( fixed_prefix = '' , max_job_prefix_len = 10 , leading_trailing_underscores = True ) : length = ( max_job_prefix_len - len ( fixed_prefix ) ) if leading_trailing_underscores : length -= 2 result = [ choice ( RANDOM_JOB_PREFIX_CHARS ) for i in range ( length ) ] if leading_trailing_underscores : return ( ( ( fixed_prefix + '_' ) + '' . join ( result ) ) + '_' ) else : return ( fixed_prefix + '' . join ( result ) )
return a string to use as job prefix .