(self, idx=-1, role=None, suffix=tuple())
return rtn
get obj from other parties.

        Args:
            idx: id of party to get from.
                The default is -1, which means get values from parties regardless their party id
            suffix: additional tag suffix, the default is tuple()

        Returns:
            object or list of object
get obj from other parties.
get obj from other parties .
def get(self, idx=-1, role=None, suffix=tuple()):
        """
        get obj from other parties.

        Args:
            idx: id of party to get from.
                The default is -1, which means get values from parties regardless their party id
            suffix: additional tag suffix, the default is tuple()

        Returns:
            object or list of object
        """
        if role is None:
            src_parties = get_parties().roles_to_parties(
                roles=self._src, strict=False
            )
        else:
            if isinstance(role, str):
                role = [role]
            src_parties = get_parties().roles_to_parties(
                roles=role, strict=False
            )
        if isinstance(idx, list):
            rtn = self.get_parties(parties=[src_parties[i] for i in idx], suffix=suffix)
        elif isinstance(idx, int):
            if idx < 0:
                rtn = self.get_parties(parties=src_parties, suffix=suffix)
            else:
                if idx >= len(src_parties):
                    raise RuntimeError(
                        f"try to get from {idx}th party while only {len(src_parties)} configurated: {src_parties}, check {self._name}"
                    )
                rtn = self.get_parties(parties=src_parties[idx], suffix=suffix)[0]
        else:
            raise ValueError(
                f"illegal idx type: {type(idx)}, supported types: int or list of int"
            )
        return rtn
def get ( self , idx = - 1 , role = None , suffix = tuple ( ) ) : if role is None : src_parties = get_parties ( ) . roles_to_parties ( roles = self . _src , strict = False ) else : if isinstance ( role , str ) : role = [ role ] src_parties = get_parties ( ) . roles_to_parties ( roles = role , strict = False ) if isinstance ( idx , list ) : rtn = self . get_parties ( parties = [ src_parties [ i ] for i in idx ] , suffix = suffix ) elif isinstance ( idx , int ) : if idx < 0 : rtn = self . get_parties ( parties = src_parties , suffix = suffix ) else : if idx >= len ( src_parties ) : raise RuntimeError ( f"try to get from {idx}th party while only {len(src_parties)} configurated: {src_parties}, check {self._name}" ) rtn = self . get_parties ( parties = src_parties [ idx ] , suffix = suffix ) [ 0 ] else : raise ValueError ( f"illegal idx type: {type(idx)}, supported types: int or list of int" ) return rtn