original_docstring: 
      Main entry point - opens import data Excel sheet (assumed to be first 
      sheet) and processes each record, one at a time.
    
docstring: Main entry point - opens import data Excel sheet (assumed to be first
  sheet) and processes each record, one at a time.
docstring_tokens: Main entry point - opens import data Excel sheet ( assumed to be first sheet ) and processes each record one at a time .
code: def importData(fileName):
    """
      Main entry point - opens import data Excel sheet (assumed to be first 
      sheet) and processes each record, one at a time.
    """
    global importSheet, importRow, headers
    book = xlrd.open_workbook(fileName)
    importSheet = book.sheet_by_index(0)
    
    print "importing from %s" % importSheet.name
      
    # get cell value types from first-non header data row (2nd), since headers are all of type text  
    for colnum in range(0, importSheet.ncols):
      headers.append((importSheet.cell(0, colnum).value, importSheet.cell(1, colnum).ctype))
   
    configErrorReporting(headers)
    
    for importRow in range(1, importSheet.nrows):
      record = {}
      for colnum in range(0, importSheet.ncols):
        if headers[colnum][1] == xlrd.XL_CELL_DATE:
          dateTuple = xlrd.xldate_as_tuple(importSheet.cell(rowx=importRow, colx=colnum).value, book.datemode)
          date = datetime.date(dateTuple[0], dateTuple[1], dateTuple[2])
          # required format for xsd:Date type, for web service call
          record[headers[colnum][0]] = date.isoformat()
        else:
          value = importSheet.cell_value(rowx=importRow, colx=colnum)
          if isinstance(value, basestring):
            record[headers[colnum][0]] = value.strip()
          else:
            record[headers[colnum][0]] = value
        #print "%s: %s" % (type(record[headers[colnum]]), record[headers[colnum]])
  
      record = handleAccountContact(record)
  
    book.unload_sheet(importSheet.name)
code_tokens: def importData ( fileName ) : global importSheet , importRow , headers book = xlrd . open_workbook ( fileName ) importSheet = book . sheet_by_index ( 0 ) print "importing from %s" % importSheet . name for colnum in range ( 0 , importSheet . ncols ) : headers . append ( ( importSheet . cell ( 0 , colnum ) . value , importSheet . cell ( 1 , colnum ) . ctype ) ) configErrorReporting ( headers ) for importRow in range ( 1 , importSheet . nrows ) : record = { } for colnum in range ( 0 , importSheet . ncols ) : if headers [ colnum ] [ 1 ] == xlrd . XL_CELL_DATE : dateTuple = xlrd . xldate_as_tuple ( importSheet . cell ( rowx = importRow , colx = colnum ) . value , book . datemode ) date = datetime . date ( dateTuple [ 0 ] , dateTuple [ 1 ] , dateTuple [ 2 ] ) record [ headers [ colnum ] [ 0 ] ] = date . isoformat ( ) else : value = importSheet . cell_value ( rowx = importRow , colx = colnum ) if isinstance ( value , basestring ) : record [ headers [ colnum ] [ 0 ] ] = value . strip ( ) else : record [ headers [ colnum ] [ 0 ] ] = value record = handleAccountContact ( record ) book . unload_sheet ( importSheet . name )
short_docstring: Main entry point - opens import data Excel sheet (assumed to be first
  sheet) and processes each record, one at a time.
short_docstring_tokens: Main entry point - opens import data Excel sheet ( assumed to be first sheet ) and processes each record one at a time .
comment: """
      Main entry point - opens import data Excel sheet (assumed to be first 
      sheet) and processes each record, one at a time.
    """$SEP$# get cell value types from first-non header data row (2nd), since headers are all of type text  $SEP$# required format for xsd:Date type, for web service call$SEP$#print "%s: %s" % (type(record[headers[colnum]]), record[headers[colnum]])