parameters: (self, soinfo: dict)
return_statement: return os.path.join(path, inner_folder_name, binary_name)
docstring: To get path for given buildId.
  
          :param soinfo: soinfo as dict
          :return: path as string or None (if path not found)
docstring_summary: To get path for given buildId.
docstring_tokens: To get path for given buildId .
function: def get_dbg_file(self, soinfo: dict) -> str or None:
          """
          To get path for given buildId.
  
          :param soinfo: soinfo as dict
          :return: path as string or None (if path not found)
          """
          build_id = soinfo.get("buildId", "").lower()
          binary_name = 'mongo'
          # search from cached results
          path = self.get_from_cache(build_id)
          if not path:
              # path does not exist in cache, so we send request to server
              try:
                  response = self.http_client.get(f'{self.host}/find_by_id',
                                                  params={'build_id': build_id})
                  if response.status_code != 200:
                      # if we could not find the path of binary, that might be system library.
                      # we can try using frame's own `path` data.
                      # symbolization can succeed only if that binary exists on local
                      # machine (more specifically: in the given path).
                      system_path = soinfo.get('path')
                      if system_path:
                          sys.stdout.write(
                              f"Could not find path of binary from symbolizer web service. Trying to use the "
                              f"provided path: {system_path}\n")
                          return system_path
                      sys.stderr.write(
                          f"Server returned unsuccessful status: {response.status_code}, "
                          f"response body: {response.text}\n")
                      return None
                  else:
                      data = response.json().get('data', {})
                      path, binary_name = data.get('debug_symbols_url'), data.get('file_name')
              except Exception as err:  # noqa pylint: disable=broad-except
                  sys.stderr.write(f"Error occurred while trying to get response from server "
                                   f"for buildId({build_id}): {err}\n")
                  return None
  
              # update cached results
              if path:
                  self.add_to_cache(build_id, path)
  
          if not path:
              return None
  
          # download & unpack debug symbols file and assign `path` to unpacked file's local path
          try:
              dl_path, exists_locally = self.download(path)
              if exists_locally:
                  path = dl_path.replace('.tgz', '', 1)
              else:
                  print("Downloaded, now unpacking...")
                  path = self.unpack(dl_path)
          except Exception as err:  # noqa pylint: disable=broad-except
              sys.stderr.write(f"Failed to download & unpack file: {err}\n")
          # we may have '<name>.debug', '<name>.so' or just executable binary file which may not have file 'extension'.
          # if file has extension, it is good. if not, we should append .debug, because those without extension are
          # from release builds, and their debug symbol files contain .debug extension.
          # we need to map those 2 different file names ('<name>' becomes '<name>.debug').
          if not binary_name.endswith('.debug') and not binary_name.endswith('.so'):
              binary_name = f'{binary_name}.debug'
  
          inner_folder_name = self.path_options.get_binary_folder_name(binary_name)
  
          return os.path.join(path, inner_folder_name, binary_name)
function_tokens: def get_dbg_file ( self , soinfo : dict ) -> str or None : build_id = soinfo . get ( "buildId" , "" ) . lower ( ) binary_name = 'mongo' # search from cached results path = self . get_from_cache ( build_id ) if not path : # path does not exist in cache, so we send request to server try : response = self . http_client . get ( f'{self.host}/find_by_id' , params = { 'build_id' : build_id } ) if response . status_code != 200 : # if we could not find the path of binary, that might be system library. # we can try using frame's own `path` data. # symbolization can succeed only if that binary exists on local # machine (more specifically: in the given path). system_path = soinfo . get ( 'path' ) if system_path : sys . stdout . write ( f"Could not find path of binary from symbolizer web service. Trying to use the " f"provided path: {system_path}\n" ) return system_path sys . stderr . write ( f"Server returned unsuccessful status: {response.status_code}, " f"response body: {response.text}\n" ) return None else : data = response . json ( ) . get ( 'data' , { } ) path , binary_name = data . get ( 'debug_symbols_url' ) , data . get ( 'file_name' ) except Exception as err : # noqa pylint: disable=broad-except sys . stderr . write ( f"Error occurred while trying to get response from server " f"for buildId({build_id}): {err}\n" ) return None # update cached results if path : self . add_to_cache ( build_id , path ) if not path : return None # download & unpack debug symbols file and assign `path` to unpacked file's local path try : dl_path , exists_locally = self . download ( path ) if exists_locally : path = dl_path . replace ( '.tgz' , '' , 1 ) else : print ( "Downloaded, now unpacking..." ) path = self . unpack ( dl_path ) except Exception as err : # noqa pylint: disable=broad-except sys . stderr . write ( f"Failed to download & unpack file: {err}\n" ) # we may have '<name>.debug', '<name>.so' or just executable binary file which may not have file 'extension'. # if file has extension, it is good. if not, we should append .debug, because those without extension are # from release builds, and their debug symbol files contain .debug extension. # we need to map those 2 different file names ('<name>' becomes '<name>.debug'). if not binary_name . endswith ( '.debug' ) and not binary_name . endswith ( '.so' ) : binary_name = f'{binary_name}.debug' inner_folder_name = self . path_options . get_binary_folder_name ( binary_name ) return os . path . join ( path , inner_folder_name , binary_name )