def get_time_variable(ds):
for var in ds.variables:<EOL><INDENT>if getattr(ds.variables[var], '<STR_LIT>', '<STR_LIT>') == '<STR_LIT:T>':<EOL><INDENT>return var<EOL><DEDENT><DEDENT>else:<EOL><INDENT>candidates = ds.get_variables_by_attributes(standard_name='<STR_LIT:time>')<EOL>if len(candidates) == <NUM_LIT:1>:<EOL><INDENT>return candidates[<NUM_LIT:0>].name<EOL><DEDENT>else:  <EOL><INDENT>for candidate in candidates:<EOL><INDENT>if candidate.dimensions == (candidate.name,):<EOL><INDENT>return candidate.name<EOL><DEDENT><DEDENT><DEDENT><DEDENT>return None<EOL>
Returns the likeliest variable to be the time coordiante variable

:param netCDF4.Dataset ds: An open netCDF4 Dataset