def check_header_chars(header, warnings, allowed_chars_header=(('_' + digits) + letters)):
 for curr_elem in range(len(header)):
  for curr_char in header[curr_elem]:
   if (curr_char not in allowed_chars_header):
    warnings.append((('Found invalid character in %s ' % header[curr_elem]) + ('header field. DCTB %d,%d' % (0, curr_elem))))
    break
 return warnings

def check_header_chars ( header , warnings , allowed_chars_header = ( ( '_' + digits ) + letters ) ) : for curr_elem in range ( len ( header ) ) : for curr_char in header [ curr_elem ] : if ( curr_char not in allowed_chars_header ) : warnings . append ( ( ( 'Found invalid character in %s ' % header [ curr_elem ] ) + ( 'header field. DCTB %d,%d' % ( 0 , curr_elem ) ) ) ) break return warnings
checks for valid characters in headers .