parameters: (self, dir, prefix)
return_statement: return int(max(run_numbers)) + 1
docstring: Returns the next run number in a directory for the specified prefix.
  
          Examines the contents the specified directory for files with the
          specified prefix, extracts the run numbers from each file name,
          and returns the next run number after the largest it finds.
docstring_summary: Returns the next run number in a directory for the specified prefix.
docstring_tokens: Returns the next run number in a directory for the specified prefix .
function: def find_next_run_number(self, dir, prefix):
          """
          Returns the next run number in a directory for the specified prefix.
  
          Examines the contents the specified directory for files with the
          specified prefix, extracts the run numbers from each file name,
          and returns the next run number after the largest it finds.
          """
          x = re.compile(re.escape(prefix) + '-([0-9]+).*')
          matches = [x.match(e) for e in os.listdir(dir)]
          matches = [_f for _f in matches if _f]
          if not matches:
              return 0
          run_numbers = [int(m.group(1)) for m in matches]
          return int(max(run_numbers)) + 1
function_tokens: def find_next_run_number ( self , dir , prefix ) : x = re . compile ( re . escape ( prefix ) + '-([0-9]+).*' ) matches = [ x . match ( e ) for e in os . listdir ( dir ) ] matches = [ _f for _f in matches if _f ] if not matches : return 0 run_numbers = [ int ( m . group ( 1 ) ) for m in matches ] return int ( max ( run_numbers ) ) + 1