def METHOD_NAME(self, boards=None):
    envname = None
    default_envs = self.config.default_envs()
    if default_envs:
        envname = default_envs[0]
        if not boards:
            return envname
    for env in self.config.envs():
        if not boards:
            return env
        if not envname:
            envname = env
        items = self.config.items(env=env, as_dict=True)
        if "board" in items and items.get("board") in boards:
            return env
    return envname