parameters: (cls, file_path)
docstring: Return a DB handle for the given file, such as a run number
              This will handle file formats in two formats:
              EQSANS_([0-9]+)_event
              EQSANS_([0-9]+).nxs
docstring_summary: Return a DB handle for the given file, such as a run number
              This will handle file formats in two formats:
              EQSANS_([0-9]+)_event
              EQSANS_([0-9]+).nxs
docstring_tokens: Return a DB handle for the given file such as a run number This will handle file formats in two formats : EQSANS_ ( [ 0 - 9 ] + ) _event EQSANS_ ( [ 0 - 9 ] + ) . nxs
function: def handle(cls, file_path):
          """
              Return a DB handle for the given file, such as a run number
              This will handle file formats in two formats:
              EQSANS_([0-9]+)_event
              EQSANS_([0-9]+).nxs
          """
          file_path = file_path.strip()
          r_re = re.search(r"EQSANS_([0-9]+)(_event|\.nxs)", file_path)
          if r_re is not None:
              return r_re.group(1)
          else:
              # Check whether we simply have a run number
              try:
                  int(file_path)
                  return file_path
              except:
                  return None
function_tokens: def handle ( cls , file_path ) : file_path = file_path . strip ( ) r_re = re . search ( r"EQSANS_([0-9]+)(_event|\.nxs)" , file_path ) if r_re is not None : return r_re . group ( 1 ) else : # Check whether we simply have a run number try : int ( file_path ) return file_path except : return None