parameters: (filename)
return_statement: return False
docstring: Check that a lidar csv file is valid. It must have at least threee entries on one line.
docstring_summary: Check that a lidar csv file is valid. It must have at least threee entries on one line.
docstring_tokens: Check that a lidar csv file is valid . It must have at least threee entries on one line .
function: def isValidLidarCSV(filename):
      '''Check that a lidar csv file is valid. It must have at least threee entries on one line.'''
  
      if not os.path.exists(filename):
          return False
  
      with open(filename, "r") as ins:
          array = []
          for line in ins:
  
              # This will help with lines which only have spaces
              line = line.strip()
              
              # Skip empty lines
              if len(line) == 0:
                  continue
  
              # Skip lines starting with spaces followed by #
              m = re.match("^\s*\#", line)
              if m:
                  continue
  
              line = line.replace(',',  ' ')
              line = line.replace('\t', ' ')
  
              vals = line.split(' ')
              num = 0
              for val in vals:
                  if len(val) == 0:
                      continue
                  num += 1
  
              if num >= 3:
                  return True
              else:
                  return False
  
      return False
function_tokens: def isValidLidarCSV ( filename ) : if not os . path . exists ( filename ) : return False with open ( filename , "r" ) as ins : array = [ ] for line in ins : # This will help with lines which only have spaces line = line . strip ( ) # Skip empty lines if len ( line ) == 0 : continue # Skip lines starting with spaces followed by # m = re . match ( "^\s*\#" , line ) if m : continue line = line . replace ( ',' , ' ' ) line = line . replace ( '\t' , ' ' ) vals = line . split ( ' ' ) num = 0 for val in vals : if len ( val ) == 0 : continue num += 1 if num >= 3 : return True else : return False return False