def METHOD_NAME(self, key) -> str:
    """
    _get_source_service attempts to get Magma service from command line
    arguments of running process or binary name
    Args:
        key: struct of type key_t from which service name is inferred
    Returns:
        Magma service name inferred from key
    Raises:
        ValueError: Could not infer service name from key
    """
    try:
        # get python service name from command line args
        # e.g. "python3 -m magma.state.main"
        cmdline = self._get_cmdline(key.pid)
        python_service = self._get_service_from_cmdline(cmdline)
        if python_service:
            return python_service
    # key.pid process has exited or was not a Python service
    except (psutil.NoSuchProcess, IndexError):
        binary_name = key.comm.decode()
        if binary_name in self._services:
            # was a non-Python service
            return binary_name
    raise ValueError('Could not infer service name from key %s' % key.comm)