def checkRemoteExists(frm: Stack, to: str, # remoteName state: Optional[RemoteState] = None): remote = frm.getRemote(to) checkState(state, remote)