query stringlengths 9 9.05k | document stringlengths 10 222k | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
Replaces a conic constraint. putcone(self,k_,ct_,conepar_,submem_) | def putcone(self,k_,ct_,conepar_,submem_):
nummem_ = None
if nummem_ is None:
nummem_ = len(submem_)
elif nummem_ != len(submem_):
raise IndexError("Inconsistent length of array submem")
if submem_ is None:
raise ValueError("Argument submem cannot be None")
if submem_ is None:
... | [
"def putcone(self,k_,ct_,conepar_,submem): # 3\n if not isinstance(ct_,conetype): raise TypeError(\"Argument ct has wrong type\")\n nummem_ = None\n if nummem_ is None:\n nummem_ = len(submem)\n elif nummem_ != len(submem):\n raise IndexError(\"Inconsistent length of array submem\"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Appends a general sparse symmetric matrix to the storage of symmetric matrices. appendsparsesymmat(self,dim_,subi_,subj_,valij_) | def appendsparsesymmat(self,dim_,subi_,subj_,valij_):
nz_ = None
if nz_ is None:
nz_ = len(subi_)
elif nz_ != len(subi_):
raise IndexError("Inconsistent length of array subi")
if nz_ is None:
nz_ = len(subj_)
elif nz_ != len(subj_):
raise IndexError("Inconsistent length of ar... | [
"def appendsparsesymmat(self,dim_,subi,subj,valij): # 3\n nz_ = None\n if nz_ is None:\n nz_ = len(subi)\n elif nz_ != len(subi):\n raise IndexError(\"Inconsistent length of array subi\")\n if nz_ is None:\n nz_ = len(subj)\n elif nz_ != len(subj):\n raise IndexE... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Appends a general sparse symmetric matrix to the storage of symmetric matrices. appendsparsesymmatlist(self,dims_,nz_,subi_,subj_,valij_,idx_) | def appendsparsesymmatlist(self,dims_,nz_,subi_,subj_,valij_,idx_):
num_ = None
if num_ is None:
num_ = len(dims_)
elif num_ != len(dims_):
raise IndexError("Inconsistent length of array dims")
if num_ is None:
num_ = len(nz_)
elif num_ != len(nz_):
raise IndexError("Inconsis... | [
"def appendsparsesymmat(self,dim_,subi_,subj_,valij_):\n nz_ = None\n if nz_ is None:\n nz_ = len(subi_)\n elif nz_ != len(subi_):\n raise IndexError(\"Inconsistent length of array subi\")\n if nz_ is None:\n nz_ = len(subj_)\n elif nz_ != len(subj_):\n raise IndexError(\"Inconsis... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Obtains information about a matrix from the symmetric matrix storage. getsymmatinfo(self,idx_) | def getsymmatinfo(self,idx_):
dim_ = ctypes.c_int32()
nz_ = ctypes.c_int64()
type_ = ctypes.c_int32()
res = __library__.MSK_XX_getsymmatinfo(self.__nativep,idx_,ctypes.byref(dim_),ctypes.byref(nz_),ctypes.byref(type_))
if res != 0:
_,msg = self.__getlasterror(res)
raise Error(rescode(res... | [
"def getsymmatinfo(self,idx_): # 3\n res,resargs = self.__obj.getsymmatinfo(idx_)\n if res != 0:\n result,msg = self.__getlasterror(res)\n raise Error(rescode(res),msg)\n _dim_return_value,_nz_return_value,_type_return_value = resargs\n _type_return_value = symmattype(_type_return_... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Obtains the number of symmetric matrices stored. getnumsymmat(self) | def getnumsymmat(self):
num_ = ctypes.c_int64()
res = __library__.MSK_XX_getnumsymmat(self.__nativep,ctypes.byref(num_))
if res != 0:
_,msg = self.__getlasterror(res)
raise Error(rescode(res),msg)
num_ = num_.value
_num_return_value = num_
return (_num_return_value) | [
"def getnumsymmat(self): # 3\n res,resargs = self.__obj.getnumsymmat()\n if res != 0:\n result,msg = self.__getlasterror(res)\n raise Error(rescode(res),msg)\n _num_return_value = resargs\n return _num_return_value",
"def getsymmatinfo(self,idx_): # 3\n res,resargs = self.__... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets a single symmetric matrix from the matrix store. getsparsesymmat(self,idx_,subi_,subj_,valij_) | def getsparsesymmat(self,idx_,subi_,subj_,valij_):
maxlen_ = self.getsymmatinfo((idx_))[1]
_subi_minlength = (maxlen_)
if (maxlen_) > 0 and subi_ is not None and len(subi_) != (maxlen_):
raise ValueError("Array argument subi is not long enough: Is %d, expected %d" % (len(subi_),(maxlen_)))
if isin... | [
"def getsparsesymmat(self,idx_,subi,subj,valij): # 3\n maxlen_ = self.getsymmatinfo((idx_))[1]\n _copyback_subi = False\n if subi is None:\n subi_ = None\n else:\n try:\n subi_ = memoryview(subi)\n except TypeError:\n try:\n _tmparr_subi = array.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets an integer parameter. putintparam(self,param_,parvalue_) | def putintparam(self,param_,parvalue_):
res = __library__.MSK_XX_putintparam(self.__nativep,param_,parvalue_)
if res != 0:
_,msg = self.__getlasterror(res)
raise Error(rescode(res),msg) | [
"def putintparam(self,param_,parvalue_): # 3\n if not isinstance(param_,iparam): raise TypeError(\"Argument param has wrong type\")\n res = self.__obj.putintparam(param_,parvalue_)\n if res != 0:\n result,msg = self.__getlasterror(res)\n raise Error(rescode(res),msg)",
"def getintpara... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the number of preallocated constraints in the optimization task. putmaxnumcon(self,maxnumcon_) | def putmaxnumcon(self,maxnumcon_):
res = __library__.MSK_XX_putmaxnumcon(self.__nativep,maxnumcon_)
if res != 0:
_,msg = self.__getlasterror(res)
raise Error(rescode(res),msg) | [
"def putmaxnumcon(self,maxnumcon_): # 3\n res = self.__obj.putmaxnumcon(maxnumcon_)\n if res != 0:\n result,msg = self.__getlasterror(res)\n raise Error(rescode(res),msg)",
"def putmaxnumcone(self,maxnumcone_):\n res = __library__.MSK_XX_putmaxnumcone(self.__nativep,maxnumcone_)\n if... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the number of preallocated conic constraints in the optimization task. putmaxnumcone(self,maxnumcone_) | def putmaxnumcone(self,maxnumcone_):
res = __library__.MSK_XX_putmaxnumcone(self.__nativep,maxnumcone_)
if res != 0:
_,msg = self.__getlasterror(res)
raise Error(rescode(res),msg) | [
"def putmaxnumcone(self,maxnumcone_): # 3\n res = self.__obj.putmaxnumcone(maxnumcone_)\n if res != 0:\n result,msg = self.__getlasterror(res)\n raise Error(rescode(res),msg)",
"def putmaxnumcon(self,maxnumcon_): # 3\n res = self.__obj.putmaxnumcon(maxnumcon_)\n if res != 0:\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Obtains the number of preallocated cones in the optimization task. getmaxnumcone(self) | def getmaxnumcone(self):
maxnumcone_ = ctypes.c_int32()
res = __library__.MSK_XX_getmaxnumcone(self.__nativep,ctypes.byref(maxnumcone_))
if res != 0:
_,msg = self.__getlasterror(res)
raise Error(rescode(res),msg)
maxnumcone_ = maxnumcone_.value
_maxnumcone_return_value = maxnumcone_
... | [
"def getmaxnumcone(self): # 3\n res,resargs = self.__obj.getmaxnumcone()\n if res != 0:\n result,msg = self.__getlasterror(res)\n raise Error(rescode(res),msg)\n _maxnumcone_return_value = resargs\n return _maxnumcone_return_value",
"def getnumcone(self): # 3\n res,resargs =... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the number of preallocated variables in the optimization task. putmaxnumvar(self,maxnumvar_) | def putmaxnumvar(self,maxnumvar_):
res = __library__.MSK_XX_putmaxnumvar(self.__nativep,maxnumvar_)
if res != 0:
_,msg = self.__getlasterror(res)
raise Error(rescode(res),msg) | [
"def putmaxnumvar(self,maxnumvar_): # 3\n res = self.__obj.putmaxnumvar(maxnumvar_)\n if res != 0:\n result,msg = self.__getlasterror(res)\n raise Error(rescode(res),msg)",
"def putmaxnumbarvar(self,maxnumbarvar_): # 3\n res = self.__obj.putmaxnumbarvar(maxnumbarvar_)\n if res !=... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the number of preallocated symmetric matrix variables. putmaxnumbarvar(self,maxnumbarvar_) | def putmaxnumbarvar(self,maxnumbarvar_):
res = __library__.MSK_XX_putmaxnumbarvar(self.__nativep,maxnumbarvar_)
if res != 0:
_,msg = self.__getlasterror(res)
raise Error(rescode(res),msg) | [
"def putmaxnumbarvar(self,maxnumbarvar_): # 3\n res = self.__obj.putmaxnumbarvar(maxnumbarvar_)\n if res != 0:\n result,msg = self.__getlasterror(res)\n raise Error(rescode(res),msg)",
"def putmaxnumvar(self,maxnumvar_): # 3\n res = self.__obj.putmaxnumvar(maxnumvar_)\n if res !=... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the number of preallocated nonzero entries in the linear coefficient matrix. putmaxnumanz(self,maxnumanz_) | def putmaxnumanz(self,maxnumanz_):
res = __library__.MSK_XX_putmaxnumanz(self.__nativep,maxnumanz_)
if res != 0:
_,msg = self.__getlasterror(res)
raise Error(rescode(res),msg) | [
"def putmaxnumanz(self,maxnumanz_): # 3\n res = self.__obj.putmaxnumanz(maxnumanz_)\n if res != 0:\n result,msg = self.__getlasterror(res)\n raise Error(rescode(res),msg)",
"def putmaxnumqnz(self,maxnumqnz_):\n res = __library__.MSK_XX_putmaxnumqnz(self.__nativep,maxnumqnz_)\n if res... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the number of preallocated nonzero entries in quadratic terms. putmaxnumqnz(self,maxnumqnz_) | def putmaxnumqnz(self,maxnumqnz_):
res = __library__.MSK_XX_putmaxnumqnz(self.__nativep,maxnumqnz_)
if res != 0:
_,msg = self.__getlasterror(res)
raise Error(rescode(res),msg) | [
"def putmaxnumqnz(self,maxnumqnz_): # 3\n res = self.__obj.putmaxnumqnz(maxnumqnz_)\n if res != 0:\n result,msg = self.__getlasterror(res)\n raise Error(rescode(res),msg)",
"def getmaxnumqnz(self): # 3\n res,resargs = self.__obj.getmaxnumqnz64()\n if res != 0:\n result,msg... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets a string parameter. putnastrparam(self,paramname_,parvalue_) | def putnastrparam(self,paramname_,parvalue_):
if isinstance(paramname_,unicode):
paramname_ = paramname_.encode("utf-8",errors="replace")
if isinstance(parvalue_,unicode):
parvalue_ = parvalue_.encode("utf-8",errors="replace")
res = __library__.MSK_XX_putnastrparam(self.__nativep,paramname_,parv... | [
"def putnastrparam(self,paramname_,parvalue_): # 3\n res = self.__obj.putnastrparam(paramname_,parvalue_)\n if res != 0:\n result,msg = self.__getlasterror(res)\n raise Error(rescode(res),msg)",
"def putstrparam(self,param_,parvalue_): # 3\n if not isinstance(param_,sparam): raise Typ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Assigns a new name to the objective. putobjname(self,objname_) | def putobjname(self,objname_):
if isinstance(objname_,unicode):
objname_ = objname_.encode("utf-8",errors="replace")
res = __library__.MSK_XX_putobjname(self.__nativep,objname_)
if res != 0:
_,msg = self.__getlasterror(res)
raise Error(rescode(res),msg) | [
"def putobjname(self,objname_): # 3\n res = self.__obj.putobjname(objname_)\n if res != 0:\n result,msg = self.__getlasterror(res)\n raise Error(rescode(res),msg)",
"def SetName(obj, name: Text):\n # Not doing type assertion on obj, since it may be a mock object used\n # in tests.\n pre... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Modifies the value of parameter. putparam(self,parname_,parvalue_) | def putparam(self,parname_,parvalue_):
if isinstance(parname_,unicode):
parname_ = parname_.encode("utf-8",errors="replace")
if isinstance(parvalue_,unicode):
parvalue_ = parvalue_.encode("utf-8",errors="replace")
res = __library__.MSK_XX_putparam(self.__nativep,parname_,parvalue_)
if res !=... | [
"def putparam(self,parname_,parvalue_): # 3\n res = self.__obj.putparam(parname_,parvalue_)\n if res != 0:\n result,msg = self.__getlasterror(res)\n raise Error(rescode(res),msg)",
"def setParam(self,param,value):\n if param in self.params.keys():\n self.params[param] = v... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Replaces all quadratic terms in constraints. putqcon(self,qcsubk_,qcsubi_,qcsubj_,qcval_) | def putqcon(self,qcsubk_,qcsubi_,qcsubj_,qcval_):
numqcnz_ = None
if numqcnz_ is None:
numqcnz_ = len(qcsubi_)
elif numqcnz_ != len(qcsubi_):
raise IndexError("Inconsistent length of array qcsubi")
if numqcnz_ is None:
numqcnz_ = len(qcsubj_)
elif numqcnz_ != len(qcsubj_):
ra... | [
"def putqconk(self,k_,qcsubi_,qcsubj_,qcval_):\n numqcnz_ = None\n if numqcnz_ is None:\n numqcnz_ = len(qcsubi_)\n elif numqcnz_ != len(qcsubi_):\n raise IndexError(\"Inconsistent length of array qcsubi\")\n if numqcnz_ is None:\n numqcnz_ = len(qcsubj_)\n elif numqcnz_ != len(qcsubj_... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Replaces all quadratic terms in a single constraint. putqconk(self,k_,qcsubi_,qcsubj_,qcval_) | def putqconk(self,k_,qcsubi_,qcsubj_,qcval_):
numqcnz_ = None
if numqcnz_ is None:
numqcnz_ = len(qcsubi_)
elif numqcnz_ != len(qcsubi_):
raise IndexError("Inconsistent length of array qcsubi")
if numqcnz_ is None:
numqcnz_ = len(qcsubj_)
elif numqcnz_ != len(qcsubj_):
raise ... | [
"def putqconk(self,k_,qcsubi,qcsubj,qcval): # 3\n numqcnz_ = None\n if numqcnz_ is None:\n numqcnz_ = len(qcsubi)\n elif numqcnz_ != len(qcsubi):\n raise IndexError(\"Inconsistent length of array qcsubi\")\n if numqcnz_ is None:\n numqcnz_ = len(qcsubj)\n elif numqcnz_ ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Replaces all quadratic terms in the objective. putqobj(self,qosubi_,qosubj_,qoval_) | def putqobj(self,qosubi_,qosubj_,qoval_):
numqonz_ = None
if numqonz_ is None:
numqonz_ = len(qosubi_)
elif numqonz_ != len(qosubi_):
raise IndexError("Inconsistent length of array qosubi")
if numqonz_ is None:
numqonz_ = len(qosubj_)
elif numqonz_ != len(qosubj_):
raise Inde... | [
"def putqobj(self,qosubi,qosubj,qoval): # 3\n numqonz_ = None\n if numqonz_ is None:\n numqonz_ = len(qosubi)\n elif numqonz_ != len(qosubi):\n raise IndexError(\"Inconsistent length of array qosubi\")\n if numqonz_ is None:\n numqonz_ = len(qosubj)\n elif numqonz_ != l... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Replaces one coefficient in the quadratic term in the objective. putqobjij(self,i_,j_,qoij_) | def putqobjij(self,i_,j_,qoij_):
res = __library__.MSK_XX_putqobjij(self.__nativep,i_,j_,qoij_)
if res != 0:
_,msg = self.__getlasterror(res)
raise Error(rescode(res),msg) | [
"def putqobjij(self,i_,j_,qoij_): # 3\n res = self.__obj.putqobjij(i_,j_,qoij_)\n if res != 0:\n result,msg = self.__getlasterror(res)\n raise Error(rescode(res),msg)",
"def getqobjij(self,i_,j_): # 3\n res,resargs = self.__obj.getqobjij(i_,j_)\n if res != 0:\n result,msg ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the primal and dual solution information for a single constraint. putconsolutioni(self,i_,whichsol_,sk_,x_,sl_,su_) | def putconsolutioni(self,i_,whichsol_,sk_,x_,sl_,su_):
res = __library__.MSK_XX_putconsolutioni(self.__nativep,i_,whichsol_,sk_,x_,sl_,su_)
if res != 0:
_,msg = self.__getlasterror(res)
raise Error(rescode(res),msg) | [
"def putsolutioni(self,accmode_,i_,whichsol_,sk_,x_,sl_,su_,sn_): # 3\n if not isinstance(accmode_,accmode): raise TypeError(\"Argument accmode has wrong type\")\n if not isinstance(whichsol_,soltype): raise TypeError(\"Argument whichsol has wrong type\")\n if not isinstance(sk_,stakey): raise TypeEr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the primal and dual solution information for a single variable. putvarsolutionj(self,j_,whichsol_,sk_,x_,sl_,su_,sn_) | def putvarsolutionj(self,j_,whichsol_,sk_,x_,sl_,su_,sn_):
res = __library__.MSK_XX_putvarsolutionj(self.__nativep,j_,whichsol_,sk_,x_,sl_,su_,sn_)
if res != 0:
_,msg = self.__getlasterror(res)
raise Error(rescode(res),msg) | [
"def putsolution(self,whichsol_,skc,skx,skn,xc,xx,y,slc,suc,slx,sux,snx): # 3\n if not isinstance(whichsol_,soltype): raise TypeError(\"Argument whichsol has wrong type\")\n if skc is None:\n skc_ = None\n else:\n try:\n skc_ = memoryview(skc)\n except TypeError:\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Inputs the dual variable of a solution. putsolutionyi(self,i_,whichsol_,y_) | def putsolutionyi(self,i_,whichsol_,y_):
res = __library__.MSK_XX_putsolutionyi(self.__nativep,i_,whichsol_,y_)
if res != 0:
_,msg = self.__getlasterror(res)
raise Error(rescode(res),msg) | [
"def putsolutionyi(self,i_,whichsol_,y_): # 3\n if not isinstance(whichsol_,soltype): raise TypeError(\"Argument whichsol has wrong type\")\n res = self.__obj.putsolutionyi(i_,whichsol_,y_)\n if res != 0:\n result,msg = self.__getlasterror(res)\n raise Error(rescode(res),msg)",
"def p... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets a string parameter. putstrparam(self,param_,parvalue_) | def putstrparam(self,param_,parvalue_):
if isinstance(parvalue_,unicode):
parvalue_ = parvalue_.encode("utf-8",errors="replace")
res = __library__.MSK_XX_putstrparam(self.__nativep,param_,parvalue_)
if res != 0:
_,msg = self.__getlasterror(res)
raise Error(rescode(res),msg) | [
"def putstrparam(self,param_,parvalue_): # 3\n if not isinstance(param_,sparam): raise TypeError(\"Argument param has wrong type\")\n res = self.__obj.putstrparam(param_,parvalue_)\n if res != 0:\n result,msg = self.__getlasterror(res)\n raise Error(rescode(res),msg)",
"def putnastrpa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the variable type of one variable. putvartype(self,j_,vartype_) | def putvartype(self,j_,vartype_):
res = __library__.MSK_XX_putvartype(self.__nativep,j_,vartype_)
if res != 0:
_,msg = self.__getlasterror(res)
raise Error(rescode(res),msg) | [
"def putvartype(self,j_,vartype_): # 3\n if not isinstance(vartype_,variabletype): raise TypeError(\"Argument vartype has wrong type\")\n res = self.__obj.putvartype(j_,vartype_)\n if res != 0:\n result,msg = self.__getlasterror(res)\n raise Error(rescode(res),msg)",
"def getvartype(s... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the variable type for one or more variables. putvartypelist(self,subj_,vartype_) | def putvartypelist(self,subj_,vartype_):
num_ = None
if num_ is None:
num_ = len(subj_)
elif num_ != len(subj_):
raise IndexError("Inconsistent length of array subj")
if num_ is None:
num_ = len(vartype_)
elif num_ != len(vartype_):
raise IndexError("Inconsistent length of ar... | [
"def putvartypelist(self,subj,vartype): # 3\n num_ = None\n if num_ is None:\n num_ = len(subj)\n elif num_ != len(subj):\n raise IndexError(\"Inconsistent length of array subj\")\n if num_ is None:\n num_ = len(vartype)\n elif num_ != len(vartype):\n raise Index... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Reads problem data from a file. readdataformat(self,filename_,format_,compress_) | def readdataformat(self,filename_,format_,compress_):
if isinstance(filename_,unicode):
filename_ = filename_.encode("utf-8",errors="replace")
res = __library__.MSK_XX_readdataformat(self.__nativep,filename_,format_,compress_)
if res != 0:
_,msg = self.__getlasterror(res)
raise Error(resco... | [
"def readdataformat(self,filename_,format_,compress_): # 3\n if not isinstance(format_,dataformat): raise TypeError(\"Argument format has wrong type\")\n if not isinstance(compress_,compresstype): raise TypeError(\"Argument compress has wrong type\")\n res = self.__obj.readdataformat(filename_,format... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Reads a parameter file. readparamfile(self,filename_) | def readparamfile(self,filename_):
if isinstance(filename_,unicode):
filename_ = filename_.encode("utf-8",errors="replace")
res = __library__.MSK_XX_readparamfile(self.__nativep,filename_)
if res != 0:
_,msg = self.__getlasterror(res)
raise Error(rescode(res),msg) | [
"def readparamfile(self,filename_): # 3\n res = self.__obj.readparamfile(filename_)\n if res != 0:\n result,msg = self.__getlasterror(res)\n raise Error(rescode(res),msg)",
"def read_parameter_file( param_file_name ):\n return json.loads( open( param_file_name).read() )",
"def get_par... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Reads a solution from a file. readsolution(self,whichsol_,filename_) | def readsolution(self,whichsol_,filename_):
if isinstance(filename_,unicode):
filename_ = filename_.encode("utf-8",errors="replace")
res = __library__.MSK_XX_readsolution(self.__nativep,whichsol_,filename_)
if res != 0:
_,msg = self.__getlasterror(res)
raise Error(rescode(res),msg) | [
"def readsolution(self,whichsol_,filename_): # 3\n if not isinstance(whichsol_,soltype): raise TypeError(\"Argument whichsol has wrong type\")\n res = self.__obj.readsolution(whichsol_,filename_)\n if res != 0:\n result,msg = self.__getlasterror(res)\n raise Error(rescode(res),msg)",
... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Prints information about last file read. readsummary(self,whichstream_) | def readsummary(self,whichstream_):
res = __library__.MSK_XX_readsummary(self.__nativep,whichstream_)
if res != 0:
_,msg = self.__getlasterror(res)
raise Error(rescode(res),msg) | [
"def readsummary(self,whichstream_): # 3\n if not isinstance(whichstream_,streamtype): raise TypeError(\"Argument whichstream has wrong type\")\n res = self.__obj.readsummary(whichstream_)\n if res != 0:\n result,msg = self.__getlasterror(res)\n raise Error(rescode(res),msg)",
"def so... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Resizes an optimization task. resizetask(self,maxnumcon_,maxnumvar_,maxnumcone_,maxnumanz_,maxnumqnz_) | def resizetask(self,maxnumcon_,maxnumvar_,maxnumcone_,maxnumanz_,maxnumqnz_):
res = __library__.MSK_XX_resizetask(self.__nativep,maxnumcon_,maxnumvar_,maxnumcone_,maxnumanz_,maxnumqnz_)
if res != 0:
_,msg = self.__getlasterror(res)
raise Error(rescode(res),msg) | [
"def resizetask(self,maxnumcon_,maxnumvar_,maxnumcone_,maxnumanz_,maxnumqnz_): # 3\n res = self.__obj.resizetask(maxnumcon_,maxnumvar_,maxnumcone_,maxnumanz_,maxnumqnz_)\n if res != 0:\n result,msg = self.__getlasterror(res)\n raise Error(rescode(res),msg)",
"def run_optimiser(out_folder, ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks the memory allocated by the task. checkmem(self,file_,line_) | def checkmem(self,file_,line_):
if isinstance(file_,unicode):
file_ = file_.encode("utf-8",errors="replace")
res = __library__.MSK_XX_checkmemtask(self.__nativep,file_,line_)
if res != 0:
_,msg = self.__getlasterror(res)
raise Error(rescode(res),msg) | [
"def checkmem(self,file_,line_): # 3\n res = self.__obj.checkmemtask(file_,line_)\n if res != 0:\n result,msg = self.__getlasterror(res)\n raise Error(rescode(res),msg)",
"def check_memory(self, memory, state):\n if memory is None or memory == []:\n return\n for (l... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks whether a solution is defined. solutiondef(self,whichsol_) | def solutiondef(self,whichsol_):
isdef_ = ctypes.c_int32()
res = __library__.MSK_XX_solutiondef(self.__nativep,whichsol_,ctypes.byref(isdef_))
if res != 0:
_,msg = self.__getlasterror(res)
raise Error(rescode(res),msg)
isdef_ = isdef_.value
_isdef_return_value = isdef_
return (_isdef... | [
"def solutiondef(self,whichsol_): # 3\n if not isinstance(whichsol_,soltype): raise TypeError(\"Argument whichsol has wrong type\")\n res,resargs = self.__obj.solutiondef(whichsol_)\n if res != 0:\n result,msg = self.__getlasterror(res)\n raise Error(rescode(res),msg)\n _isdef_retu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Undefine a solution and free the memory it uses. deletesolution(self,whichsol_) | def deletesolution(self,whichsol_):
res = __library__.MSK_XX_deletesolution(self.__nativep,whichsol_)
if res != 0:
_,msg = self.__getlasterror(res)
raise Error(rescode(res),msg) | [
"def deletesolution(self,whichsol_): # 3\n if not isinstance(whichsol_,soltype): raise TypeError(\"Argument whichsol has wrong type\")\n res = self.__obj.deletesolution(whichsol_)\n if res != 0:\n result,msg = self.__getlasterror(res)\n raise Error(rescode(res),msg)",
"def gmoUnloadSo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Prints a short summary of a specified solution. onesolutionsummary(self,whichstream_,whichsol_) | def onesolutionsummary(self,whichstream_,whichsol_):
res = __library__.MSK_XX_onesolutionsummary(self.__nativep,whichstream_,whichsol_)
if res != 0:
_,msg = self.__getlasterror(res)
raise Error(rescode(res),msg) | [
"def onesolutionsummary(self,whichstream_,whichsol_): # 3\n if not isinstance(whichstream_,streamtype): raise TypeError(\"Argument whichstream has wrong type\")\n if not isinstance(whichsol_,soltype): raise TypeError(\"Argument whichsol has wrong type\")\n res = self.__obj.onesolutionsummary(whichstr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Prints a short summary of the current solutions. solutionsummary(self,whichstream_) | def solutionsummary(self,whichstream_):
res = __library__.MSK_XX_solutionsummary(self.__nativep,whichstream_)
if res != 0:
_,msg = self.__getlasterror(res)
raise Error(rescode(res),msg) | [
"def solutionsummary(self,whichstream_): # 3\n if not isinstance(whichstream_,streamtype): raise TypeError(\"Argument whichstream has wrong type\")\n res = self.__obj.solutionsummary(whichstream_)\n if res != 0:\n result,msg = self.__getlasterror(res)\n raise Error(rescode(res),msg)",
... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update the information items related to the solution. updatesolutioninfo(self,whichsol_) | def updatesolutioninfo(self,whichsol_):
res = __library__.MSK_XX_updatesolutioninfo(self.__nativep,whichsol_)
if res != 0:
_,msg = self.__getlasterror(res)
raise Error(rescode(res),msg) | [
"def updatesolutioninfo(self,whichsol_): # 3\n if not isinstance(whichsol_,soltype): raise TypeError(\"Argument whichsol has wrong type\")\n res = self.__obj.updatesolutioninfo(whichsol_)\n if res != 0:\n result,msg = self.__getlasterror(res)\n raise Error(rescode(res),msg)",
"def get... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Prints a short summary with optimizer statistics from last optimization. optimizersummary(self,whichstream_) | def optimizersummary(self,whichstream_):
res = __library__.MSK_XX_optimizersummary(self.__nativep,whichstream_)
if res != 0:
_,msg = self.__getlasterror(res)
raise Error(rescode(res),msg) | [
"def optimizersummary(self,whichstream_): # 3\n if not isinstance(whichstream_,streamtype): raise TypeError(\"Argument whichstream has wrong type\")\n res = self.__obj.optimizersummary(whichstream_)\n if res != 0:\n result,msg = self.__getlasterror(res)\n raise Error(rescode(res),msg)",... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Obtains a cone type code. strtoconetype(self,str_) | def strtoconetype(self,str_):
if isinstance(str_,unicode):
str_ = str_.encode("utf-8",errors="replace")
conetype_ = ctypes.c_int32()
res = __library__.MSK_XX_strtoconetype(self.__nativep,str_,ctypes.byref(conetype_))
if res != 0:
_,msg = self.__getlasterror(res)
raise Error(rescode(res... | [
"def strtoconetype(self,str_): # 3\n res,resargs = self.__obj.strtoconetype(str_)\n if res != 0:\n result,msg = self.__getlasterror(res)\n raise Error(rescode(res),msg)\n _conetype_return_value = resargs\n _conetype_return_value = conetype(_conetype_return_value)\n return _con... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Obtains a status key. strtosk(self,str_) | def strtosk(self,str_):
if isinstance(str_,unicode):
str_ = str_.encode("utf-8",errors="replace")
sk_ = ctypes.c_int32()
res = __library__.MSK_XX_strtosk(self.__nativep,str_,ctypes.byref(sk_))
if res != 0:
_,msg = self.__getlasterror(res)
raise Error(rescode(res),msg)
_sk_return_va... | [
"def strtosk(self,str_): # 3\n res,resargs = self.__obj.strtosk(str_)\n if res != 0:\n result,msg = self.__getlasterror(res)\n raise Error(rescode(res),msg)\n _sk_return_value = resargs\n return _sk_return_value",
"def KS(kstr):\n return Keystroke(kstr)",
"def parse_key(cls,... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Write a complete binary dump of the task data. writetask(self,filename_) | def writetask(self,filename_):
if isinstance(filename_,unicode):
filename_ = filename_.encode("utf-8",errors="replace")
res = __library__.MSK_XX_writetask(self.__nativep,filename_)
if res != 0:
_,msg = self.__getlasterror(res)
raise Error(rescode(res),msg) | [
"def writetask(self,filename_): # 3\n res = self.__obj.writetask(filename_)\n if res != 0:\n result,msg = self.__getlasterror(res)\n raise Error(rescode(res),msg)",
"def write(self, filename):\n pass",
"def save_task(self, task):\n if type(task) != Task:\n raise ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Load task data from a file. readtask(self,filename_) | def readtask(self,filename_):
if isinstance(filename_,unicode):
filename_ = filename_.encode("utf-8",errors="replace")
res = __library__.MSK_XX_readtask(self.__nativep,filename_)
if res != 0:
_,msg = self.__getlasterror(res)
raise Error(rescode(res),msg) | [
"def readtask(self,filename_): # 3\n res = self.__obj.readtask(filename_)\n if res != 0:\n result,msg = self.__getlasterror(res)\n raise Error(rescode(res),msg)",
"def loadTaskFile(self,file): \n taskcode=open(file,\"r\").read()\n toks=file.split('/')\n name=toks[-1]\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Load task data from a string in OPF format. readopfstring(self,data_) | def readopfstring(self,data_):
if isinstance(data_,unicode):
data_ = data_.encode("utf-8",errors="replace")
res = __library__.MSK_XX_readopfstring(self.__nativep,data_)
if res != 0:
_,msg = self.__getlasterror(res)
raise Error(rescode(res),msg) | [
"def readptfstring(self,data_):\n if isinstance(data_,unicode):\n data_ = data_.encode(\"utf-8\",errors=\"replace\")\n res = __library__.MSK_XX_readptfstring(self.__nativep,data_)\n if res != 0:\n _,msg = self.__getlasterror(res)\n raise Error(rescode(res),msg)",
"def _load(self, data):\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Load task data from a string in LP format. readlpstring(self,data_) | def readlpstring(self,data_):
if isinstance(data_,unicode):
data_ = data_.encode("utf-8",errors="replace")
res = __library__.MSK_XX_readlpstring(self.__nativep,data_)
if res != 0:
_,msg = self.__getlasterror(res)
raise Error(rescode(res),msg) | [
"def readptfstring(self,data_):\n if isinstance(data_,unicode):\n data_ = data_.encode(\"utf-8\",errors=\"replace\")\n res = __library__.MSK_XX_readptfstring(self.__nativep,data_)\n if res != 0:\n _,msg = self.__getlasterror(res)\n raise Error(rescode(res),msg)",
"def _load(self, data):\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Load task data from a string in PTF format. readptfstring(self,data_) | def readptfstring(self,data_):
if isinstance(data_,unicode):
data_ = data_.encode("utf-8",errors="replace")
res = __library__.MSK_XX_readptfstring(self.__nativep,data_)
if res != 0:
_,msg = self.__getlasterror(res)
raise Error(rescode(res),msg) | [
"def _load(self, data):\n raise NotImplementedError(\"Don't know how to load the task\")",
"def load_from_string_list(self, data):\n self.data = data\n self.loaded = True",
"def read_tsp_file(self, tsp_data_file):\r\n\r\n with open(tsp_data_file) as tsp_data:\r\n\r\n line ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Writes all the parameters to a parameter file. writeparamfile(self,filename_) | def writeparamfile(self,filename_):
if isinstance(filename_,unicode):
filename_ = filename_.encode("utf-8",errors="replace")
res = __library__.MSK_XX_writeparamfile(self.__nativep,filename_)
if res != 0:
_,msg = self.__getlasterror(res)
raise Error(rescode(res),msg) | [
"def writeparamfile(self,filename_): # 3\n res = self.__obj.writeparamfile(filename_)\n if res != 0:\n result,msg = self.__getlasterror(res)\n raise Error(rescode(res),msg)",
"def write_parameters_to_file(self,file_name):\n out_file = open(file_name,'wt')\n out_file.write('# ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Obtains an infeasible subproblem. getinfeasiblesubproblem(self,whichsol_) | def getinfeasiblesubproblem(self,whichsol_):
inftask_ = ctypes.c_void_p()
res = __library__.MSK_XX_getinfeasiblesubproblem(self.__nativep,whichsol_,ctypes.byref(inftask_))
if res != 0:
_,msg = self.__getlasterror(res)
raise Error(rescode(res),msg)
_inftask_return_value = Task(nativep = infta... | [
"def analyzesolution(self,whichstream_,whichsol_):\n res = __library__.MSK_XX_analyzesolution(self.__nativep,whichstream_,whichsol_)\n if res != 0:\n _,msg = self.__getlasterror(res)\n raise Error(rescode(res),msg)",
"def getpviolvar(self,whichsol_,sub_,viol_):\n num_ = None\n if num_ is Non... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Write a solution to a file. writesolution(self,whichsol_,filename_) | def writesolution(self,whichsol_,filename_):
if isinstance(filename_,unicode):
filename_ = filename_.encode("utf-8",errors="replace")
res = __library__.MSK_XX_writesolution(self.__nativep,whichsol_,filename_)
if res != 0:
_,msg = self.__getlasterror(res)
raise Error(rescode(res),msg) | [
"def writesolution(self,whichsol_,filename_): # 3\n if not isinstance(whichsol_,soltype): raise TypeError(\"Argument whichsol has wrong type\")\n res = self.__obj.writesolution(whichsol_,filename_)\n if res != 0:\n result,msg = self.__getlasterror(res)\n raise Error(rescode(res),msg)",
... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Writes a solution to a JSON file. writejsonsol(self,filename_) | def writejsonsol(self,filename_):
if isinstance(filename_,unicode):
filename_ = filename_.encode("utf-8",errors="replace")
res = __library__.MSK_XX_writejsonsol(self.__nativep,filename_)
if res != 0:
_,msg = self.__getlasterror(res)
raise Error(rescode(res),msg) | [
"def writejsonsol(self,filename_): # 3\n res = self.__obj.writejsonsol(filename_)\n if res != 0:\n result,msg = self.__getlasterror(res)\n raise Error(rescode(res),msg)",
"def write_json(self, file_name):\n with open(file_name, 'w') as f:\n f.write(self.to_json())\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Perform sensitivity analysis on bounds. primalsensitivity(self,subi_,marki_,subj_,markj_,leftpricei_,rightpricei_,leftrangei_,rightrangei_,leftpricej_,rightpricej_,leftrangej_,rightrangej_) | def primalsensitivity(self,subi_,marki_,subj_,markj_,leftpricei_,rightpricei_,leftrangei_,rightrangei_,leftpricej_,rightpricej_,leftrangej_,rightrangej_):
numi_ = None
if numi_ is None:
numi_ = len(subi_)
elif numi_ != len(subi_):
raise IndexError("Inconsistent length of array subi")
if numi... | [
"def primalsensitivity(self,subi,marki,subj,markj,leftpricei,rightpricei,leftrangei,rightrangei,leftpricej,rightpricej,leftrangej,rightrangej): # 3\n numi_ = None\n if numi_ is None:\n numi_ = len(subi)\n elif numi_ != len(subi):\n raise IndexError(\"Inconsistent length of array subi\")... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a sensitivity report. sensitivityreport(self,whichstream_) | def sensitivityreport(self,whichstream_):
res = __library__.MSK_XX_sensitivityreport(self.__nativep,whichstream_)
if res != 0:
_,msg = self.__getlasterror(res)
raise Error(rescode(res),msg) | [
"def sensitivityreport(self,whichstream_): # 3\n if not isinstance(whichstream_,streamtype): raise TypeError(\"Argument whichstream has wrong type\")\n res = self.__obj.sensitivityreport(whichstream_)\n if res != 0:\n result,msg = self.__getlasterror(res)\n raise Error(rescode(res),msg)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Performs sensitivity analysis on objective coefficients. dualsensitivity(self,subj_,leftpricej_,rightpricej_,leftrangej_,rightrangej_) | def dualsensitivity(self,subj_,leftpricej_,rightpricej_,leftrangej_,rightrangej_):
numj_ = None
if numj_ is None:
numj_ = len(subj_)
elif numj_ != len(subj_):
raise IndexError("Inconsistent length of array subj")
if subj_ is None:
raise ValueError("Argument subj cannot be None")
if... | [
"def dualsensitivity(self,subj,leftpricej,rightpricej,leftrangej,rightrangej): # 3\n numj_ = None\n if numj_ is None:\n numj_ = len(subj)\n elif numj_ != len(subj):\n raise IndexError(\"Inconsistent length of array subj\")\n if numj_ is None: numj_ = 0\n if subj is None: raise... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Offload the optimization task to a solver server. optimizermt(self,server_,port_) | def optimizermt(self,server_,port_):
if isinstance(server_,unicode):
server_ = server_.encode("utf-8",errors="replace")
if isinstance(port_,unicode):
port_ = port_.encode("utf-8",errors="replace")
trmcode_ = ctypes.c_int32()
res = __library__.MSK_XX_optimizermt(self.__nativep,server_,port_,c... | [
"def optimizermt(self,server_,port_): # 3\n res,resargs = self.__obj.optimizermt(server_,port_)\n if res != 0:\n result,msg = self.__getlasterror(res)\n raise Error(rescode(res),msg)\n _trmcode_return_value = resargs\n _trmcode_return_value = rescode(_trmcode_return_value)\n r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Offload the optimization task to a solver server. asyncoptimize(self,server_,port_) | def asyncoptimize(self,server_,port_):
if isinstance(server_,unicode):
server_ = server_.encode("utf-8",errors="replace")
if isinstance(port_,unicode):
port_ = port_.encode("utf-8",errors="replace")
token_ = (ctypes.c_char * 33)()
res = __library__.MSK_XX_asyncoptimize(self.__nativep,server_... | [
"def asyncoptimize(self,server_,port_): # 3\n arr_token = array.array(\"b\",[0]*(33))\n memview_arr_token = memoryview(arr_token)\n res,resargs = self.__obj.asyncoptimize(server_,port_,memview_arr_token)\n if res != 0:\n result,msg = self.__getlasterror(res)\n raise Error(rescode(r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Request that the job identified by the token is terminated. asyncstop(self,server_,port_,token_) | def asyncstop(self,server_,port_,token_):
if isinstance(server_,unicode):
server_ = server_.encode("utf-8",errors="replace")
if isinstance(port_,unicode):
port_ = port_.encode("utf-8",errors="replace")
if isinstance(token_,unicode):
token_ = token_.encode("utf-8",errors="replace")
res ... | [
"def asyncstop(self,server_,port_,token_): # 3\n res = self.__obj.asyncstop(server_,port_,token_)\n if res != 0:\n result,msg = self.__getlasterror(res)\n raise Error(rescode(res),msg)",
"def stop():\n server = current_server()\n server.stop()",
"def stopped(self, server):\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Requests information about the status of the remote job. asyncpoll(self,server_,port_,token_) | def asyncpoll(self,server_,port_,token_):
if isinstance(server_,unicode):
server_ = server_.encode("utf-8",errors="replace")
if isinstance(port_,unicode):
port_ = port_.encode("utf-8",errors="replace")
if isinstance(token_,unicode):
token_ = token_.encode("utf-8",errors="replace")
resp... | [
"def asyncpoll(self,server_,port_,token_): # 3\n res,resargs = self.__obj.asyncpoll(server_,port_,token_)\n if res != 0:\n result,msg = self.__getlasterror(res)\n raise Error(rescode(res),msg)\n _respavailable_return_value,_resp_return_value,_trm_return_value = resargs\n _trm_retur... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Request a response from a remote job. asyncgetresult(self,server_,port_,token_) | def asyncgetresult(self,server_,port_,token_):
if isinstance(server_,unicode):
server_ = server_.encode("utf-8",errors="replace")
if isinstance(port_,unicode):
port_ = port_.encode("utf-8",errors="replace")
if isinstance(token_,unicode):
token_ = token_.encode("utf-8",errors="replace")
... | [
"def asyncgetresult(self,server_,port_,token_): # 3\n res,resargs = self.__obj.asyncgetresult(server_,port_,token_)\n if res != 0:\n result,msg = self.__getlasterror(res)\n raise Error(rescode(res),msg)\n _respavailable_return_value,_resp_return_value,_trm_return_value = resargs\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
机构名识别 >>> sentences = [ ... "我在上海林原科技有限公司兼职工作,", ... "我经常在台川喜宴餐厅吃饭,", ... "偶尔去开元地中海影城看电影。", ... ] >>> demo_organization_recognition(sentences) [我/rr, 在/p, 上海/ns, 林原科技有限公司/nt, 兼职/vn, 工作/vn, ,/w] [我/rr, 经常/d, 在/p, 台川喜宴餐厅/nt, 吃饭/vi, ,/w] [偶尔/d, 去/vf, 开元地中海影城/nt, 看/v, 电影/n, 。/w] | def demo_organization_recognition(sentences):
Segment = JClass("com.hankcs.hanlp.seg.Segment")
Term = JClass("com.hankcs.hanlp.seg.common.Term")
segment = HanLP.newSegment().enableOrganizationRecognize(True)
for sentence in sentences:
term_list = segment.seg(sentence)
print(term_list) | [
"def _parse_organism_name(self, org):\n split_org = org.split()\n return split_org[0], split_org[1]",
"def thesis_organization(self):\n\n organizations = []\n if 'v52' in self.data['article']:\n for organization in self.data['article']['v52']:\n org = {}\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns True if this type is used in a variadic argument. bool | def is_variadic(self):
raise exceptions.NotImplementedError() | [
"def is_variadic(self):\n if self.is_function() and self.args:\n return self.args[-1].endswith(\"...\")\n return False",
"def isvariadic(obj):\n return isinstance(obj, VariadicSignatureType)",
"def has_variable_arguments(self):\n\t\treturn core.BNTypeHasVariableArguments(self.handle)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns True if |self| is a NumberType. bool | def is_number_type(self):
raise exceptions.NotImplementedError() | [
"def isnumeric(self):\n return isnumeric(self)",
"def isNumeric(self) -> bool:\n ...",
"def is_numeric(self) -> bool:\n return False",
"def ISNUMBER(value):\n return isinstance(value, numbers.Number)",
"def isNumber(self):\n return _libsbml.ASTNode_isNumber(self)",
"def isnume... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns True if |self| is a RealNumberType. bool | def is_real_number_type(self):
raise exceptions.NotImplementedError() | [
"def is_real(self):\n return all([isinstance(dim, Real) for dim in self.dimensions])",
"def isReal(self):\n return _libsbml.ASTNode_isReal(self)",
"def is_real(self) -> bool:\n return not any(self.v)",
"def _is_real(symbol):\n return isa(symbol, float) or is_int(symbol)",
"def isreal... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns True if |self| is an ObjectType. bool | def is_object_type(self):
raise exceptions.NotImplementedError() | [
"def isType(self):\r\n return self._wrap(type(self.obj) is type)",
"def isinstance_blender_object(self, b_obj):\n # lame and slow, but functional\n return b_obj in Blender.Object.Get()",
"def supports_object_type(self, object_type=None):\n # Implemented from template for osid.Metadat... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns True if |self| is an AnyType. bool | def is_any_type(self):
raise exceptions.NotImplementedError() | [
"def _is_any(typeval: Type) -> bool:\n return typeval in _ANY",
"def isType(self):\r\n return self._wrap(type(self.obj) is type)",
"def is_a(self, t):\n return isinstance(self._, t)",
"def _is_type(self, value: Any) -> bool:\n return isinstance(value, self.op)",
"def is_primitive(sel... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns True if |self| is an InterfaceType. bool | def is_interface_type(self):
raise exceptions.NotImplementedError() | [
"def IsInterface(self) -> bool:",
"def is_interface(self, file, i):\n\n # Get doc_str for class\n doc_str = self.get_doc_str(file, i)\n\n # Check if line specifies interface\n class_type = None\n\n # Iterate over lines in docstring\n for line in doc_str:\n\n # ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns True if |self| is a NamespaceType. bool | def is_namespace_type(self):
raise exceptions.NotImplementedError() | [
"def is_namespace(self):\n return bool(self.__namespaces)",
"def in_namespace(self, namespace: Sequence[str]):\n if self.namespace is None:\n return False\n\n for index, item in enumerate(namespace):\n try:\n if item != self.namespace[index]:\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns True if |self| is a CallbackInterfaceType. bool | def is_callback_interface_type(self):
raise exceptions.NotImplementedError() | [
"def is_callback_function_type(self):\n raise exceptions.NotImplementedError()",
"def IsInterface(self) -> bool:",
"def isCall(self) -> bool:\n ...",
"def receiving(self):\n return self._recv_callback is not None",
"def has_subscribed(self, klass, callback):\n return self.subscr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns True if |self| is a CallbackFunctionType. bool | def is_callback_function_type(self):
raise exceptions.NotImplementedError() | [
"def is_function(self):\n\n return self.get_type() == TOKEN_TYPE_FUNCTION",
"def is_func(self):\n return inspect.isfunction(self.func)",
"def is_function(self):\n return self.type == 'STT_FUNC'",
"def isfunction(object):\r\n return isinstance(object, types.FunctionType)",
"def isfunc... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns True if |self| is a VoidType. bool | def is_void_type(self):
raise exceptions.NotImplementedError() | [
"def is_void(self):\n return False",
"def is_void(self):\n return self.type == BipOpType.VOID",
"def is_void(type):\n return remove_alias(type) in create_cv_types(cpptypes.void_t())",
"def is_pointer_to_void_type(self, objtype):\n # FIXME: DOCME what is that _subtype_ case\n if ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns True if |self| is an AnnotatedType. bool | def is_annotated_type(self):
raise exceptions.NotImplementedError() | [
"def is_annotated_type(self) -> bool:\n return get_origin(self.type) is Annotated",
"def is_annotated(self):\n return self.data.is_annotated()",
"def isType(self):\r\n return self._wrap(type(self.obj) is type)",
"def is_typing_annotation(node: ast.AST, ctx: 'model.Documentable') -> bool:\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns True if |self| is a PromiseType. bool | def is_promise_type(self):
raise exceptions.NotImplementedError() | [
"def isType(self):\r\n return self._wrap(type(self.obj) is type)",
"def isinstance(self, other) -> bool:\n return isinstance(self.result, other)",
"def is_primitive(self) -> bool:\n return isinstance(self.type, PythonType)",
"def is_task(self):\n from .tasks import Task\n re... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns True if |self| is a RecordType. bool | def is_record_type(self):
raise exceptions.NotImplementedError() | [
"def implements_record_type(self, record_type):\n return # boolean",
"def supports_response_record_type(self, response_record_type):\n return # boolean",
"def supports_request_record_type(self, request_record_type):\n return # boolean",
"def supports_asset_record_type(self, asset_record... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns True if |self| is a SequenceType. bool | def is_sequence_type(self):
raise exceptions.NotImplementedError() | [
"def is_sequence(self) -> bool:\n return isinstance(self.yaml_node, yaml.SequenceNode)",
"def is_sequence(self) -> bool:\n return self._sequence_run is not None",
"def is_sequence(obj):\n return isinstance(obj, collections.Sequence)",
"def in_sequence(self) -> bool:\n return self._in_s... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns True if |self| is a UnionType. bool | def is_union_type(self):
raise exceptions.NotImplementedError() | [
"def _is_union(typeval: Type) -> bool:\n return get_origin(typeval) is Union",
"def is_union(type_):\n if not is_class(type_):\n return False\n decl = class_traits.get_declaration(type_)\n return decl.class_type == class_declaration.CLASS_TYPES.UNION",
"def is_Union(tp):\n if tp is Union:\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns Typedef instances which directly point this type. tuple(Typedef) | def typedefs(self):
raise exceptions.NotImplementedError() | [
"def typenames(self):\n return tuple((item[0] for item in self))",
"def _get_leaf_types() -> Tuple[type, ...]: # pylint: disable=g-bare-generic\n return (NameDef, WildcardPattern, Number, NameRef, EnumRef, ModRef)",
"def visit_tuple_type(self, left: TupleType) -> T:",
"def Types(self) -> CodeTypeDecl... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns True if 'unrestricted' is specified. bool | def is_unrestricted(self):
raise exceptions.NotImplementedError() | [
"def is_system_unrestricted(self):\n\t\treturn self.__is_system_unrestricted",
"def privileged(self) -> Optional[pulumi.Input[bool]]:\n return pulumi.get(self, \"privileged\")",
"def has_special_restriction(self, user, perm):\n return False",
"def _disallow_public_access(self) -> typing.Optional... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the result type. IdlType | def result_type(self):
raise exceptions.NotImplementedError() | [
"def get_result_type(self):\n return self.result_type",
"def return_type(self):\r\n return Type(self._ptr.getReturnType())",
"def result_type(self):\r\n if not hasattr(self, '_result_type'):\r\n self._result_type = conf.lib.clang_getResultType(self.type)\r\n\r\n return sel... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a list of member types. tuple(IdlType) | def member_types(self):
raise exceptions.NotImplementedError() | [
"def members(self):\n ordered = sorted(self.fields.items(), key=lambda x: x[1].offset)\n return [(k, v.type) for k, v in ordered]",
"def Members(self) -> CodeTypeMemberCollection:",
"def flattened_member_types(self):\n raise exceptions.NotImplementedError()",
"def getMemberTypesVocab(self... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a set of flattened member types. | def flattened_member_types(self):
raise exceptions.NotImplementedError() | [
"def flattened(self):\n return self.members(flatten=True)",
"def getMemberTypesVocab(self):\n remtypes = getRememberTypes(self)\n remtypes.sort()\n remtypes = [(i, i) for i in remtypes]\n return DisplayList(remtypes)",
"def get_super_types(self):\n return set(i2 for i2 in s... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Calculate partial derivative of f at xi ... | def partial_derivative(f, x, i, epsilon = 1e-10):
x_ = np.copy(x).astype(np.float64)
x_[i] = x_[i] + epsilon
value = (f(x_) - f(x)) / epsilon
return value | [
"def partial ( index , func , x , h = 0 , I = 2 , err = False ) :\n \n if len(x) <= index :\n raise AttributeError(\"Invalid argument length/index %d/%d\" % ( len(x) , index ) )\n \n _x = [ float(a) for a in x ]\n \n ## create wrapper function \n def _wrap ( z ) :\n _z =... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Calculate Jacobian of f wrt x ... | def jacobian(f, x, epsilon = 1e-10):
f_ = f(x)
value = np.zeros((len(f_), len(x)))
for i in range(len(x)):
f_ = partial_derivative(f, x, i, epsilon)
value[:,i] = f_
return value | [
"def jacobian_func(f):\n jacobian = jacfwd(f)\n return jacobian",
"def jacobianF(self):\n\n jacob = np.eye(len(self.x))\n jacob[0][1] = 1\n jacob[2][0] = self.x[4] + self.x[6] * self.x[0] + self.x[8] * (self.x[0] ** 2) / 2\n jacob[2][4] = self.x[0]\n jacob[2][6] = (self.x[... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
parity of a big word is the xor of the parity of words that compose this big word | def parity_of_very_long(x, word_size=8):
res = 0
hash_map = {}
while x!=0:
word = x & ( (1<<word_size)-1)
if not(word in hash_map):
hash_map[word] = parityOf(word)
res ^= hash_map[word]
x >>= word_size
print(hash_map)
return res | [
"def calc_syndrome(codeword, n):\r\n sym = 0\r\n for i in range(1, n):\r\n if codeword[i]:\r\n sym ^= i\r\n extra_parity = calc_parity_vector(codeword)\r\n if extra_parity == codeword[0]:\r\n if sym == 0:\r\n return 0, sym\r\n else:\r\n return 2, sym... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return list with 50 positive and 10 negative samples | def sampleset():
pos = [(0, i) for i in range(50)]
neg = [(1, i) for i in range(10)]
return pos + neg | [
"def _sample_negative(self, positives):\n max_val = self._H * self._W\n num_pos = len(positives)\n num_neg = int(num_pos * self._sample_ratio)\n positives = np.round(positives).astype(\"int\")\n positives = positives[:, :2]\n positives = np.ravel_multi_index((positives[:, 0... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create exactly num_directories subdirectories in path. | def _create_directory_tree(self, path, num_directories):
assert num_directories >= 0
if not num_directories:
return
self._create_directory(path)
num_directories -= 1
# Divide the remaining number of directories to create among 4
# subdirectories in an approximate even fashion.
for i i... | [
"def _create_directory_tree(self, path, num_directories):\n assert num_directories >= 0\n if not num_directories:\n return\n\n self._create_directory(path)\n num_directories -= 1\n # Divide the remaining number of directories to create among 4\n # subdirectories in an approximate even fashion... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tests that internal _directory_to_subdirs is updated on delete. | def test_subdirectory_deleted(self):
path = self._create_directory('test')
sub_path = self._create_directory('test/test2')
self._watcher.start()
self.assertEqual(
set([sub_path]),
self._watcher._directory_to_subdirs[path])
os.rmdir(sub_path)
self.assertEqual(
set([sub_pa... | [
"def test_subdirectory_deleted(self):\n path = self._create_directory('test')\n sub_path = self._create_directory('test/test2')\n self._watcher.start()\n\n self.assertEqual(\n set([sub_path]),\n self._watcher._directory_to_subdirs[path])\n os.rmdir(sub_path)\n self.assertEqual(\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Run a sentiment analysis request on text within a passed filename. | def analyze_text_sentiment(raw_data_path):
client = language.LanguageServiceClient()
with open(raw_data_path, 'r') as review_file:
content = review_file.read()
document = types.Document(
content=content,
type=enums.Document.Type.PLAIN_TEXT)
annotations = client.analyze_sentimen... | [
"def analyze(movie_review_filename):\n client = language.LanguageServiceClient()\n\n with open(movie_review_filename, 'r') as review_file:\n # Instantiates a plain text document.\n content = review_file.read()\n\n document = types.Document(content=content,\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
updates a single atom to a potentially new state, quasirandomly | def UpdateAtom(self,atom,update_mode='ordered'):
current = (atom.n,atom.l)
possible = [(final,self.probs[current][final]) for final \
in self.probs[current]]
if update_mode=='random':
random.shuffle(possible)
if update_mode=='ordered':
possible.sort(key=lambda x:x[1])
final = current
for state in p... | [
"def update(self):\n if self.size() < 2: return\n idx = random.randint(0, 100) % 3\n if idx < 2:\n slot = self.slots[idx]\n if slot.get_state() == Slot.CLEAN:\n slot.set_state(Slot.DIRTY)\n # self.slots[idx] = slot",
"def update(dt):\n\tworld.next_state()",
"def random_state(sta... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
runs through one timestep and updates the atoms | def Iterate(self):
for atom in self.atoms:
self.UpdateAtom(atom) | [
"def _update_observables(self, force=False):\n for observable in self._observables.values():\n observable.update(timestep=self.model_timestep, obs_cache=self._obs_cache, force=force)",
"def iterateMotion(self):\n\n self.system.updateAccelerations()\n self.system.updateVelocities()\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
creates a comparison plot of the current atomic state distribution compared to what we expect | def Compare(self,step,steps,saving=True):
plt.ioff()
plt.figure()
plt.plot(np.arange(1,5),self.expected,'o-',color='black',label\
='expected')
plt.plot(np.arange(1,5),np.divide(self.states,np.sum(self.states))\
,'o-',color='green',label='actual')
plt.legend()
plt.title('Expected vs Actual Atom Distrib... | [
"def compare_one_state_evolution(self, value, true_state, option='density'):\n\n fig = plt.figure(figsize=(16, 8), dpi=100)\n ax = fig.add_subplot(111)\n if option == 'density':\n ax.plot(np.squeeze(np.array(self.est_density[value, :])), 'r--', label='Estimated')\n elif option... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Deposit coins into the users bank prop | def _deposit_coins(user_id: int, coins: int):
if not Wealth.collection.find_one({"_id": user_id}):
return
Wealth.collection.update_one({"_id": user_id}, {"$inc": {
"Bank": coins,
"coins": -coins
}}) | [
"def deposit_money():\n print(\"\\n\")\n print(messages.account_credentials)\n u_id = pyip.inputInt(\"Your Id: \", greaterThan=0)\n password = pyip.inputPassword(\"Your Password: \")\n\n credentials = {\"id\":u_id, \"password\":password}\n result = BankOperationsBackend.dep... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Pick a random photo for the `Fishing` command. | def fishing_ran():
return choice([
"https://im-a-dev.xyz/1kKJXQSr.png",
"https://im-a-dev.xyz/ImWqkaSy.png",
"https://im-a-dev.xyz/sqPSfhJJ.png",
"https://im-a-dev.xyz/syTQUdrV.png"
]) | [
"def get_random_image():\r\n\r\n logging.debug('get_random_image()')\r\n\r\n choice = random.randint(1, 10)\r\n if choice < 7:\r\n return get_random_image_from_any_source()\r\n else:\r\n return get_random_image_from_database()",
"def get_cute_animal_picture(self, message=None):\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Pick a random photo for the `Shootout` command. | def shootout_ran():
return choice([
"https://im-a-dev.xyz/QqoZ2M6m.png",
"https://im-a-dev.xyz/BvdekLII.png",
"https://im-a-dev.xyz/MfSnYYAa.png"
]) | [
"def get_random_image(self):\n\n chosen_endpoint = \\\n self._get_random_endpoint_from_list_by_substring('/random')\n self.client.get(chosen_endpoint)",
"def pick_image():\r\n only_files = [f for f in listdir('./images') if isfile(join('./images', f))]\r\n i = randrange(0, len(only_... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Pick a random photo for the `Trash` command. | def trash_ran():
return choice([
"https://im-a-dev.xyz/om3vsD0s.png", # coins
"https://im-a-dev.xyz/zqyCJ9sH.png", # cookie
"https://im-a-dev.xyz/ogWxLI7K.png", # reputation
"https://im-a-dev.xyz/i8HiGmwU.png" # Nothing
]) | [
"def random_file():\n image = choice(choice_set)\n choice_set.remove(image)\n return image",
"def pick_image():\r\n only_files = [f for f in listdir('./images') if isfile(join('./images', f))]\r\n i = randrange(0, len(only_files), 2)\r\n return f'./images/{only_files[i]}'",
"def random_img(path):\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
upate the balance, sell acount, buy acount, based on returan rate | def _balance_update(self):
return_rate = self.df.loc[self.currentStep, "return_Close"]
self.buy_amount += return_rate * self.buy_amount
self.sell_amount -= return_rate * self.sell_amount | [
"def fitBalance(self):\n self.fitSell()\n self.fitBuy()",
"def update_and_get_balance(self):\n balance = self.cash_balance\n for holding in self.holdings.values():\n holding.current_price = self.data_source.get_price(holding.symbol, self.timestamp)\n balance = bal... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Prepare the dict of values to create the new invoice for a sale order. This method may be overridden to implement custom invoice generation (making sure to call super() to establish a clean extension chain). | def _prepare_invoice(self, cr, uid, order, lines, context=None):
invoice_vals = super(my_sale_order, self)._prepare_invoice(cr, uid, order,
lines, context)
invoice_vals.update({
'partner_shipping_id': order.partner_shipping_id.... | [
"def _prepare_invoice(self, cr, uid, order, lines, context=None):\n invoice_vals = super(sale_order, self)._prepare_invoice(cr, uid, order,\n lines, context=context)\n invoice_vals.update({'partner_bank_id': order.partner_bank_id.id})\n return invoice_vals",
"def _prepare_invoice(s... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The function convert Euler angle to quaternion object | def euler_to_quaternion(euler: tuple) -> object:
(yaw, pitch, roll) = (euler[0], euler[1], euler[2])
qy = np.sin(roll / 2) * np.cos(pitch / 2) * np.cos(yaw / 2) - np.cos(roll / 2) * np.sin(pitch / 2) * np.sin(yaw / 2)
qx = np.cos(roll / 2) * np.sin(pitch / 2) * np.cos(yaw / 2) + np.sin(roll / 2) * np.cos(p... | [
"def euler_to_quaternion(yaw, pitch, roll):\n c_y = math.cos(yaw * 0.5)\n s_y = math.sin(yaw * 0.5)\n c_p = math.cos(pitch * 0.5)\n s_p = math.sin(pitch * 0.5)\n c_r = math.cos(roll * 0.5)\n s_r = math.sin(roll * 0.5)\n\n q_w = c_y * c_p * c_r + s_y * s_p * s_r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The function write the recovered camera poses according to COLMAP documentation | def write_camera_pose_to_file(camera_pose_abs_dict: dict, pose_dir_path: str) -> None:
image_dst = path.join(pose_dir_path, 'images.txt')
with open(image_dst, 'w+') as file:
file.write('# Image list with two lines of data per image:\n')
file.write('# IMAGE_ID, QW, QX, QY, QZ, TX, TY, TZ, CAMER... | [
"def save_poses():\n get_marshmallow_pose(should_remember=True)\n get_mouth_pose(should_remember=True)\n rospy.sleep(1)\n print \"Finished saving poses\"",
"def writeCamera(ob, obMat, obName, rSet, active):\n if not (ob.data): #paranoid\n return None\n\n #if not (ac... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Поправьте код, чтобы возвращаемое значение было ближайшим сверху, кратным к 20 | def t1(number):
return number - number % 20 + 20 if number % 20 else number | [
"def check_if_50s_and_20s(self,value):\n if (value%50)%20!=0:\n return 1\n else:\n return 0",
"def checkio(number):\n # Для определения количества разрядов в числе, переводим ее в строку\n number_str = str(number)\n\n # Количество соток, десяток и единиц\n xxx, xx, ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Draw an n x n grid with edges / nodes from X in red | def draw_grid(n,X):
G = nx.grid_2d_graph(n+1,n+1)
set_node_colors(G,G.nodes(),'k')
set_edge_colors(G,G.edges(),'k')
set_edge_weights(G,G.edges(),0.5)
set_node_colors(G,edge_subgraph_nodes(X),'r')
set_edge_colors(G,X,'r')
set_edge_weights(G,X,1)
nc = [G.node[n]['color'] for... | [
"def draw(deps):\n graph = nx.DiGraph()\n for node in deps:\n graph.add_node(node)\n for node, neighbors in deps.items():\n for neighbor in neighbors:\n graph.add_edge(node, neighbor)\n pos = exploded_layout(graph.nodes(), graph.edges())\n nx.draw_networkx_nodes(\n gra... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Only show the debug toolbar to users with the superuser flag. | def _custom_show_toolbar(request: 'HttpRequest') -> bool:
return DEBUG and request.user.is_superuser | [
"def _custom_show_toolbar(request):\n return DEBUG and request.user.is_superuser",
"def strict_show_toolbar_callback(request):\n if hasattr(request, 'user') and \\\n request.user.has_perm('debug_toolbar.show'):\n\n logger.debug('DjDT allowed for \"%s\" <%s>',\n request.user.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |