query stringlengths 9 3.4k | document stringlengths 9 87.4k | metadata dict | negatives listlengths 4 101 | negative_scores listlengths 4 101 | document_score stringlengths 3 10 | document_rank stringclasses 102
values |
|---|---|---|---|---|---|---|
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) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"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... | [
"0.89949",
"0.6965111",
"0.6361787",
"0.62369287",
"0.6113074",
"0.60967517",
"0.6074677",
"0.6043116",
"0.60060585",
"0.59845704",
"0.59814596",
"0.5941611",
"0.59217054",
"0.5831631",
"0.58297473",
"0.57571024",
"0.5754986",
"0.5676297",
"0.5632185",
"0.5622995",
"0.5618078... | 0.82056046 | 1 |
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... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"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... | [
"0.8250177",
"0.7224048",
"0.707309",
"0.6871811",
"0.6064735",
"0.58782834",
"0.5704154",
"0.56204504",
"0.54422724",
"0.5369249",
"0.52549726",
"0.5253745",
"0.5215147",
"0.51658744",
"0.5073383",
"0.50687295",
"0.5062825",
"0.5059147",
"0.50579226",
"0.50538254",
"0.495039... | 0.79923165 | 1 |
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... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"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... | [
"0.7553127",
"0.59015036",
"0.5858663",
"0.5723628",
"0.5667749",
"0.56350636",
"0.56292766",
"0.55843794",
"0.55843794",
"0.55649745",
"0.5564228",
"0.5543848",
"0.5543789",
"0.5518771",
"0.5512596",
"0.54900783",
"0.54300296",
"0.5406005",
"0.535901",
"0.5344803",
"0.534077... | 0.7163861 | 1 |
Reads problem data from a file. readdata(self,filename_) | def readdata(self,filename_):
if isinstance(filename_,unicode):
filename_ = filename_.encode("utf-8",errors="replace")
res = __library__.MSK_XX_readdataautoformat(self.__nativep,filename_)
if res != 0:
_,msg = self.__getlasterror(res)
raise Error(rescode(res),msg) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def read_from_file(self, filename: str) -> None:",
"def read(self, filename):\n pass",
"def read(self, filename):\n pass",
"def read(self, filename):\n raise NotImplementedError",
"def readFromFile(filename):\n raise NotImplementedError",
"def read_data(self,filename):\n ... | [
"0.6964632",
"0.67534983",
"0.67534983",
"0.6653428",
"0.66341674",
"0.66181225",
"0.6576051",
"0.65169454",
"0.64502215",
"0.6448525",
"0.62780577",
"0.6276363",
"0.6273351",
"0.62559056",
"0.62428236",
"0.6226585",
"0.6153581",
"0.61261386",
"0.61246955",
"0.61210287",
"0.6... | 0.5698743 | 61 |
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) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"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 readParameterfile(self, filename):\n return None",
"def read_parameter_file( param_file_name ):\n re... | [
"0.8607383",
"0.83839995",
"0.72262895",
"0.709628",
"0.6801133",
"0.6741827",
"0.6637675",
"0.663633",
"0.6620843",
"0.661949",
"0.661949",
"0.65961736",
"0.65885526",
"0.6566686",
"0.6501145",
"0.64481163",
"0.6423041",
"0.6395702",
"0.6357999",
"0.6351804",
"0.63192177",
... | 0.8297628 | 2 |
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) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"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)",
... | [
"0.8768888",
"0.67774564",
"0.6366709",
"0.6275069",
"0.6227779",
"0.62035143",
"0.61865556",
"0.60015136",
"0.5968991",
"0.5949018",
"0.58523256",
"0.5774951",
"0.5774951",
"0.57240754",
"0.57240754",
"0.57240754",
"0.5700822",
"0.5640482",
"0.5634896",
"0.5604267",
"0.55850... | 0.8492971 | 1 |
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) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"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 su... | [
"0.7899001",
"0.6519644",
"0.65138835",
"0.60788524",
"0.59421",
"0.59183806",
"0.5882844",
"0.5876368",
"0.57434404",
"0.5713873",
"0.5700075",
"0.557035",
"0.5532855",
"0.55146515",
"0.5475546",
"0.53840125",
"0.5378493",
"0.53440875",
"0.5329391",
"0.5329391",
"0.53114873"... | 0.74428695 | 1 |
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) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"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 prepare_pr_optimal_model_c... | [
"0.8304745",
"0.52103585",
"0.51943374",
"0.50631404",
"0.50303227",
"0.50238323",
"0.49848595",
"0.4903367",
"0.4879516",
"0.48169866",
"0.4804174",
"0.47891757",
"0.47816435",
"0.47773397",
"0.47563007",
"0.4723178",
"0.47225302",
"0.47225302",
"0.47225302",
"0.47050464",
"... | 0.8394918 | 0 |
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) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"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 _checkAvailableMemory():\n #execute free -m to get output in MB\n logging.debug(\"checking total memory\")\n... | [
"0.8956478",
"0.6172901",
"0.61476266",
"0.5966271",
"0.5839869",
"0.5747777",
"0.5662355",
"0.558952",
"0.55579066",
"0.5434767",
"0.5403096",
"0.54001987",
"0.5385859",
"0.53383994",
"0.5325104",
"0.5304694",
"0.52878374",
"0.52868325",
"0.52741265",
"0.5272602",
"0.5210603... | 0.8647315 | 1 |
Obtains information about the amount of memory used by a task. getmemusage(self) | def getmemusage(self):
meminuse_ = ctypes.c_int64()
maxmemuse_ = ctypes.c_int64()
res = __library__.MSK_XX_getmemusagetask(self.__nativep,ctypes.byref(meminuse_),ctypes.byref(maxmemuse_))
if res != 0:
_,msg = self.__getlasterror(res)
raise Error(rescode(res),msg)
meminuse_ = meminuse_.va... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_mem_usage():\n return process.memory_info().rss / 1024.**2",
"def getmemusage(self): # 3\n res,resargs = self.__obj.getmemusagetask()\n if res != 0:\n result,msg = self.__getlasterror(res)\n raise Error(rescode(res),msg)\n _meminuse_return_value,_maxmemuse_return_value = r... | [
"0.81289196",
"0.7946258",
"0.7892419",
"0.76762784",
"0.74214274",
"0.73518866",
"0.735019",
"0.73324805",
"0.72175497",
"0.71775776",
"0.7160333",
"0.7114913",
"0.70797753",
"0.70734024",
"0.70682377",
"0.70225513",
"0.70024467",
"0.6981002",
"0.6958003",
"0.6952827",
"0.68... | 0.76534486 | 4 |
Resets all parameter values. setdefaults(self) | def setdefaults(self):
res = __library__.MSK_XX_setdefaults(self.__nativep)
if res != 0:
_,msg = self.__getlasterror(res)
raise Error(rescode(res),msg) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_default_parameters(self):\n super().set_default_parameters()",
"def reset(self):\n self.data = self._defaults",
"def reset(self):\r\n # TODO: have reset flag such that it forces all the bottom changes\r\n self.pwm_freq = self._default[\"pwm_freq\"]\r\n self.gate_logic... | [
"0.7635572",
"0.7606381",
"0.7493379",
"0.7476525",
"0.7468762",
"0.7467287",
"0.7315893",
"0.7213384",
"0.7207722",
"0.72026306",
"0.71951437",
"0.71768165",
"0.71706927",
"0.71178776",
"0.710447",
"0.70173246",
"0.70173246",
"0.70131224",
"0.6976783",
"0.697559",
"0.6966734... | 0.65770113 | 63 |
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... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"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... | [
"0.82378125",
"0.7520855",
"0.7130622",
"0.6716045",
"0.65864074",
"0.6542276",
"0.65399134",
"0.65024155",
"0.64941233",
"0.6442446",
"0.64409184",
"0.64374423",
"0.6399567",
"0.6366495",
"0.6350611",
"0.6329383",
"0.6290776",
"0.62602293",
"0.61625254",
"0.61530423",
"0.615... | 0.7923763 | 1 |
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) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"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 clear(self)... | [
"0.7279343",
"0.6581316",
"0.61854655",
"0.61191547",
"0.60800874",
"0.60800874",
"0.5985228",
"0.5961063",
"0.59411716",
"0.5815005",
"0.5813991",
"0.5778785",
"0.57717663",
"0.5751076",
"0.5720295",
"0.5719897",
"0.56984323",
"0.5693372",
"0.5637449",
"0.56347036",
"0.56307... | 0.7549941 | 0 |
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) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"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... | [
"0.8853265",
"0.8302041",
"0.81137526",
"0.6555255",
"0.6380672",
"0.6087827",
"0.60587895",
"0.60307497",
"0.6008222",
"0.5991637",
"0.59595245",
"0.5958175",
"0.59552217",
"0.5938021",
"0.5918894",
"0.58800006",
"0.58726686",
"0.58662325",
"0.5847555",
"0.5815037",
"0.57407... | 0.86803454 | 1 |
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) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"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)",
... | [
"0.8490436",
"0.7806848",
"0.74153596",
"0.6858063",
"0.67407346",
"0.65829104",
"0.64990044",
"0.6447631",
"0.6409437",
"0.63984436",
"0.63822955",
"0.6373469",
"0.63680404",
"0.6366793",
"0.6324539",
"0.63099676",
"0.6302245",
"0.6295538",
"0.62811995",
"0.625854",
"0.62493... | 0.8438411 | 1 |
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) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"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... | [
"0.8501529",
"0.64527994",
"0.61899984",
"0.6184468",
"0.61392975",
"0.61199677",
"0.58779514",
"0.58288413",
"0.5672516",
"0.55942315",
"0.5495648",
"0.5467258",
"0.54266113",
"0.54105836",
"0.53628093",
"0.5335758",
"0.53230315",
"0.5302198",
"0.5299515",
"0.52725923",
"0.5... | 0.8344963 | 1 |
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) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"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)",... | [
"0.83530533",
"0.6444",
"0.6087136",
"0.60660774",
"0.6059675",
"0.6035606",
"0.5917163",
"0.5904062",
"0.58675843",
"0.58628947",
"0.5861443",
"0.58124137",
"0.5800309",
"0.57916075",
"0.57707924",
"0.5766543",
"0.5747041",
"0.5743333",
"0.5730653",
"0.5721178",
"0.572087",
... | 0.84929657 | 0 |
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... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"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... | [
"0.88242376",
"0.6349188",
"0.6107515",
"0.6085521",
"0.60675335",
"0.6044869",
"0.5956564",
"0.5874813",
"0.5784901",
"0.57551634",
"0.5743284",
"0.5739826",
"0.56517434",
"0.5638696",
"0.5600427",
"0.55771667",
"0.5558863",
"0.5557807",
"0.55551755",
"0.5549347",
"0.553369"... | 0.85956 | 1 |
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... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"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 _GetKeyString(self):",
"def _GetKeyString(self):",
"def _... | [
"0.7463206",
"0.63048255",
"0.63048255",
"0.6093281",
"0.60203123",
"0.5681855",
"0.56371945",
"0.55297583",
"0.5436478",
"0.5360586",
"0.53496593",
"0.53464997",
"0.5341332",
"0.53328174",
"0.5318203",
"0.52947754",
"0.52796894",
"0.52793884",
"0.5278508",
"0.5275866",
"0.52... | 0.8100815 | 0 |
Writes problem data to a file. writedata(self,filename_) | def writedata(self,filename_):
if isinstance(filename_,unicode):
filename_ = filename_.encode("utf-8",errors="replace")
res = __library__.MSK_XX_writedata(self.__nativep,filename_)
if res != 0:
_,msg = self.__getlasterror(res)
raise Error(rescode(res),msg) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def writedata(self,filename_): # 3\n res = self.__obj.writedata(filename_)\n if res != 0:\n result,msg = self.__getlasterror(res)\n raise Error(rescode(res),msg)",
"def write(self, filename, data):\n raise NotImplementedError",
"def save_to_file(self, data):\n\t\tif self.data_fil... | [
"0.8009261",
"0.7946218",
"0.74100626",
"0.7154202",
"0.7059672",
"0.70318",
"0.7005215",
"0.7005215",
"0.6958824",
"0.6937671",
"0.6870956",
"0.6805846",
"0.6771315",
"0.6761199",
"0.6702333",
"0.6698775",
"0.66839826",
"0.6675867",
"0.66444194",
"0.6603851",
"0.6600509",
... | 0.7222679 | 3 |
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) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"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 serialize(self, to_file=None):\n if to_file is not None:\n raise ValueError(\n \"TaskIn... | [
"0.76278293",
"0.66411906",
"0.6338404",
"0.6297968",
"0.6297968",
"0.6217573",
"0.6178854",
"0.60562927",
"0.6003934",
"0.59263074",
"0.5922769",
"0.5882908",
"0.5819537",
"0.58133584",
"0.58092064",
"0.5795702",
"0.57952464",
"0.57715166",
"0.5770719",
"0.575975",
"0.574959... | 0.7415279 | 1 |
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) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"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 load_tasks(self, task_file):\n\n\t\tself.tasklist.tasks = util.load(task_file)\n\t\tTask.last_id = len(self.tasklist.tasks... | [
"0.80296904",
"0.72496146",
"0.7088076",
"0.7083461",
"0.69893193",
"0.6900385",
"0.68146265",
"0.67244583",
"0.6720494",
"0.6645653",
"0.6595403",
"0.65645224",
"0.65645224",
"0.6510227",
"0.6467875",
"0.6425703",
"0.6416887",
"0.64050037",
"0.63069814",
"0.62808853",
"0.623... | 0.77301157 | 1 |
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) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"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 ... | [
"0.6794951",
"0.64501524",
"0.6257614",
"0.62188506",
"0.5981521",
"0.59138155",
"0.58334607",
"0.57561445",
"0.55966187",
"0.553957",
"0.5505495",
"0.53398323",
"0.5314852",
"0.52946866",
"0.5283617",
"0.525373",
"0.52212423",
"0.52142024",
"0.5210204",
"0.5205793",
"0.52055... | 0.7010937 | 0 |
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) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"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 ... | [
"0.6374487",
"0.63396025",
"0.6261898",
"0.5823688",
"0.5761187",
"0.572786",
"0.5603073",
"0.55118525",
"0.548002",
"0.5409333",
"0.53713614",
"0.53710246",
"0.5349839",
"0.53278965",
"0.53266686",
"0.5312053",
"0.5271302",
"0.52626383",
"0.52433527",
"0.52351403",
"0.520678... | 0.7284312 | 0 |
Load task data from a string in JSON format. readjsonstring(self,data_) | def readjsonstring(self,data_):
if isinstance(data_,unicode):
data_ = data_.encode("utf-8",errors="replace")
res = __library__.MSK_XX_readjsonstring(self.__nativep,data_)
if res != 0:
_,msg = self.__getlasterror(res)
raise Error(rescode(res),msg) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _load_data_from_str(self, data_as_str):\n try:\n data = json.loads(data_as_str)\n except json.JSONDecodeError:\n data = data_utils.data_generator(data_as_str.splitlines())\n data = data_utils.read_json(\n data_generator=data,\n select... | [
"0.7473371",
"0.73492724",
"0.70103645",
"0.6908961",
"0.67095613",
"0.66338253",
"0.6541871",
"0.65246135",
"0.6445135",
"0.643727",
"0.6423963",
"0.6287553",
"0.6281268",
"0.62648505",
"0.6253007",
"0.62117",
"0.6190784",
"0.61543965",
"0.6138435",
"0.6130036",
"0.6093991",... | 0.6714592 | 4 |
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) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"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 readstring(self, fstring):\n return self.parse(fstring)",
"def _read_data(self, \n data_path : st... | [
"0.624653",
"0.58884597",
"0.5842658",
"0.58061516",
"0.57342064",
"0.5731174",
"0.5722274",
"0.5629815",
"0.5598952",
"0.557254",
"0.55650526",
"0.5564843",
"0.5533171",
"0.54985625",
"0.53941905",
"0.53820044",
"0.5362768",
"0.5348556",
"0.5286359",
"0.5258125",
"0.52522415... | 0.7285745 | 0 |
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) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"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_parameter_sets(self, filename = 'inputparameterfile', *args,\n **kwargs):\n ... | [
"0.8479623",
"0.7223541",
"0.71134436",
"0.704342",
"0.69193083",
"0.68712884",
"0.6840946",
"0.6750531",
"0.6718471",
"0.6663219",
"0.66562045",
"0.6610654",
"0.65982085",
"0.65181977",
"0.647503",
"0.6464667",
"0.6421562",
"0.6421562",
"0.64120954",
"0.6394938",
"0.6388683"... | 0.78043985 | 1 |
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... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ineqconstr(x, problem):\n x, t_final = matrify(x, problem)\n c = []\n\n # inter vehicles\n c += [veh_coll_avoid(x[:, :2, v1], x[:, :2, v2], problem)\n for v1 in range(problem['Nv']) for v2 in range(v1 + 1, problem['Nv'])]\n\n # obstacles\n c += [obs.avoid(x[:, :2, veh]) for obs in pr... | [
"0.5406454",
"0.5405638",
"0.54013044",
"0.54003686",
"0.53582644",
"0.53561485",
"0.534527",
"0.53344864",
"0.53250533",
"0.53217924",
"0.53196096",
"0.53157514",
"0.5308851",
"0.5305068",
"0.5287506",
"0.5270815",
"0.5264659",
"0.52540594",
"0.52518165",
"0.524636",
"0.5227... | 0.86953276 | 0 |
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) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"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)",
... | [
"0.87910414",
"0.7406337",
"0.72049326",
"0.7029762",
"0.6727161",
"0.6507342",
"0.63737875",
"0.6302796",
"0.6293724",
"0.6199659",
"0.61895025",
"0.6181373",
"0.61070776",
"0.61070776",
"0.60899645",
"0.60780126",
"0.607718",
"0.6065927",
"0.60460186",
"0.5984384",
"0.59831... | 0.83074623 | 1 |
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) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"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, filename):\n with open(filename, 'a+') as f:\n f.write(json.dumps(self.weights)... | [
"0.87295",
"0.74165505",
"0.72694594",
"0.71959645",
"0.7129806",
"0.7129806",
"0.71224076",
"0.7121763",
"0.7065886",
"0.70466745",
"0.70419866",
"0.70303464",
"0.700208",
"0.69454724",
"0.6898068",
"0.6853677",
"0.68358284",
"0.6761869",
"0.6744697",
"0.671354",
"0.6709994"... | 0.8033375 | 1 |
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... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"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\")... | [
"0.8516134",
"0.61320364",
"0.6070157",
"0.5505288",
"0.5244543",
"0.5228772",
"0.51506406",
"0.50980216",
"0.50866646",
"0.5006929",
"0.5002792",
"0.49891976",
"0.49730042",
"0.49282205",
"0.49270394",
"0.49166498",
"0.49019164",
"0.48693013",
"0.48592722",
"0.48548737",
"0.... | 0.8563157 | 0 |
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) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"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)... | [
"0.84275156",
"0.53856975",
"0.5332675",
"0.52303034",
"0.5183973",
"0.50662196",
"0.50250715",
"0.50113016",
"0.49753663",
"0.49550012",
"0.49106225",
"0.49092293",
"0.48568374",
"0.48396832",
"0.47451615",
"0.473587",
"0.47343108",
"0.47330227",
"0.4705782",
"0.47011182",
"... | 0.81320953 | 1 |
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... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"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... | [
"0.8261849",
"0.6106334",
"0.6104639",
"0.58061737",
"0.57007354",
"0.55202544",
"0.53209084",
"0.524894",
"0.52469116",
"0.5143102",
"0.5046833",
"0.50303704",
"0.49652806",
"0.49631125",
"0.4957558",
"0.49527156",
"0.49477494",
"0.49313244",
"0.49223545",
"0.49127185",
"0.4... | 0.83717173 | 0 |
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... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"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... | [
"0.63646656",
"0.5643291",
"0.5561428",
"0.512266",
"0.51177776",
"0.5061218",
"0.50380147",
"0.49591717",
"0.4938649",
"0.49026117",
"0.49010754",
"0.48953548",
"0.48889136",
"0.48848823",
"0.4877491",
"0.4876011",
"0.48473015",
"0.48344618",
"0.4819269",
"0.48074353",
"0.47... | 0.5803405 | 1 |
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_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"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... | [
"0.6602464",
"0.5121303",
"0.5121116",
"0.50080115",
"0.48946133",
"0.47785783",
"0.47696742",
"0.46918422",
"0.46745405",
"0.46690065",
"0.46030888",
"0.45859867",
"0.45737752",
"0.4560305",
"0.45586684",
"0.4554464",
"0.45519593",
"0.45377553",
"0.45205483",
"0.44452822",
"... | 0.61663544 | 1 |
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 ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"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_server(self):\r\n # TODO-SDH Add way to stop the server from running.\r",
"def stop(... | [
"0.85108995",
"0.6669743",
"0.6566155",
"0.6552622",
"0.6488106",
"0.64568543",
"0.6397652",
"0.6383138",
"0.636795",
"0.63649935",
"0.63017964",
"0.62986946",
"0.62985563",
"0.62593824",
"0.62358534",
"0.62237436",
"0.6220952",
"0.61999017",
"0.6176527",
"0.61644346",
"0.612... | 0.84137243 | 1 |
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... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"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... | [
"0.7130952",
"0.63021195",
"0.6182163",
"0.607293",
"0.5802242",
"0.5686539",
"0.5662773",
"0.55745256",
"0.5566215",
"0.5563341",
"0.5563341",
"0.55591416",
"0.552535",
"0.55108213",
"0.54052144",
"0.5399891",
"0.5390036",
"0.5387752",
"0.5369794",
"0.5271437",
"0.5226669",
... | 0.7092134 | 1 |
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")
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"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 ... | [
"0.82163835",
"0.6389818",
"0.63313067",
"0.60418195",
"0.6038077",
"0.5966368",
"0.5915231",
"0.5874337",
"0.57946885",
"0.57472014",
"0.568589",
"0.5681426",
"0.5653823",
"0.5595842",
"0.5568461",
"0.5545757",
"0.5533846",
"0.55289096",
"0.55240965",
"0.5513361",
"0.5510967... | 0.81356907 | 1 |
Returns type name as defined in WebIDL spec; e.g. LongLongOrNullClamp for '[Clamp] long long?'. Identifier | def type_name(self):
# TODO(peria): Replace with exceptions.NotImplementedError() after shipping.
assert 'type_name() is not implemented for class %s' % (type(self)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def typeToName(type: int) -> unicode:\n ...",
"def _type_name(t):\n module = t.__module__\n qualname = t.__qualname__\n if module == \"builtins\":\n return qualname\n elif t == Real:\n return \"float\"\n elif t == Integral:\n return \"int\"\n return f\"{module}.{qual... | [
"0.717802",
"0.69927263",
"0.69442093",
"0.6779133",
"0.67748976",
"0.6772938",
"0.6762617",
"0.6725226",
"0.6704195",
"0.6688965",
"0.6637395",
"0.6537905",
"0.65264785",
"0.65120476",
"0.6481191",
"0.64322853",
"0.6428616",
"0.6403532",
"0.63880455",
"0.63670975",
"0.632595... | 0.61733097 | 32 |
Returns True if this type is used in an optional argument. bool | def is_optional(self):
raise exceptions.NotImplementedError() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def optional(self) -> bool:\n return False",
"def is_optional(cls) -> bool:\n return cls.optional",
"def NeedsOptional(self, type_):\n return self._NameComponents(type_) in self._optional_types",
"def bool_option (arg: Any) -> bool:\n return True",
"def is_simple_in_opt_and_not_opt(self... | [
"0.7237668",
"0.72037935",
"0.709011",
"0.69880986",
"0.66822135",
"0.66811407",
"0.66736525",
"0.6660319",
"0.65815026",
"0.65815026",
"0.65815026",
"0.65815026",
"0.65815026",
"0.65815026",
"0.6533586",
"0.64503354",
"0.64380187",
"0.6419174",
"0.6419174",
"0.6419174",
"0.6... | 0.6169652 | 62 |
Returns True if this type is used in a variadic argument. bool | def is_variadic(self):
raise exceptions.NotImplementedError() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_variadic(self):\n if self.is_function() and self.args:\n return self.args[-1].endswith(\"...\")\n return False",
"def check_args(args):\n for arg in vars(args):\n if getattr(args, arg):\n return True\n return False",
"def takes_multiple_ar... | [
"0.7789966",
"0.6522471",
"0.6384409",
"0.6294994",
"0.6294994",
"0.62792814",
"0.6124202",
"0.6067434",
"0.60662395",
"0.6052541",
"0.60394627",
"0.60286164",
"0.59856653",
"0.59645915",
"0.59602636",
"0.5950267",
"0.59254897",
"0.5895693",
"0.5832743",
"0.5820968",
"0.57882... | 0.7150723 | 1 |
Returns True if |self| is a NumberType. bool | def is_number_type(self):
raise exceptions.NotImplementedError() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_number(self) -> bool:\n return False",
"def isnumeric(self):\n return isnumeric(self)",
"def is_numerable(self):\n return (self.is_unknown or self.is_byte or self.is_word\n or self.is_dword or self.is_qword)",
"def is_number(self, value):\n if isinstance(value, (... | [
"0.7953751",
"0.7412868",
"0.7394168",
"0.73898447",
"0.72582585",
"0.72320116",
"0.7230378",
"0.71296614",
"0.71097714",
"0.7034134",
"0.70097035",
"0.6974943",
"0.69388425",
"0.6865268",
"0.68128484",
"0.6790667",
"0.6776975",
"0.67644984",
"0.66986984",
"0.66595286",
"0.66... | 0.77732486 | 1 |
Returns True if |self| is an IntegerType. bool | def is_integer_type(self):
raise exceptions.NotImplementedError() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def isInteger(self):\n return isinstance(self.value, int)",
"def isInteger(self):\n return self._is_int",
"def isInteger(self):\n pass",
"def is_int(self):\n return self.value_type in (int, arrow.JuArrow)",
"def isInteger(self):",
"def isInteger(self):",
"def isInteger(self)... | [
"0.84779936",
"0.839476",
"0.82530975",
"0.8080338",
"0.8026144",
"0.8026144",
"0.7747703",
"0.7482953",
"0.74238193",
"0.72873175",
"0.72454697",
"0.71479577",
"0.71226734",
"0.70430493",
"0.697637",
"0.68980926",
"0.6886339",
"0.6882673",
"0.6866101",
"0.6795355",
"0.674570... | 0.7671321 | 7 |
Returns True if |self| is a RealNumberType. bool | def is_real_number_type(self):
raise exceptions.NotImplementedError() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"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):\r\n return self._imag.is_zero()",
"def is_real(self) -> bool:\n return not any(self.v)",
"def _is_real(symbol):\n... | [
"0.75589144",
"0.7233921",
"0.6978747",
"0.681329",
"0.67448235",
"0.66748357",
"0.66022563",
"0.65728545",
"0.65497756",
"0.653825",
"0.6438274",
"0.6377211",
"0.6347165",
"0.62609124",
"0.62475",
"0.6229639",
"0.62187284",
"0.6214366",
"0.6165807",
"0.5998228",
"0.59811014"... | 0.7969597 | 0 |
Returns True if |self| is a BooleanType. bool | def is_boolean_type(self):
raise exceptions.NotImplementedError() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_bool(self):\n answer = self._call('is_bool')\n return answer.yes",
"def isBoolean(self):\n return _libsbml.ASTNode_isBoolean(self)",
"def as_bool(self):\n return self.as_type(bool)",
"def __bool__(self):\n return bool(self._value)",
"def __bool__(self):\n re... | [
"0.81790584",
"0.79737103",
"0.79040664",
"0.75805515",
"0.75393873",
"0.7524598",
"0.75197995",
"0.7460989",
"0.74104637",
"0.72200793",
"0.72200793",
"0.71395105",
"0.7098527",
"0.70766455",
"0.7033548",
"0.7030978",
"0.7024969",
"0.6913013",
"0.68852055",
"0.68579674",
"0.... | 0.7735801 | 3 |
Returns True if |self| is a StringType. bool | def is_string_type(self):
raise exceptions.NotImplementedError() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def isString(data):\n\ttry:\n\t\tfrom types import UnicodeType, StringType\n\t\tif type(data) == UnicodeType or type(data) == StringType:\n\t\t\treturn True\n\texcept ImportError:\n\t\tif type(data) == type(\"\"):\n\t\t\treturn True\n\treturn False",
"def is_str ( self, s ):\r\n\t\treturn isinstance ( s, type( s... | [
"0.7018396",
"0.6701445",
"0.64621323",
"0.643731",
"0.638714",
"0.6369953",
"0.6331593",
"0.6240773",
"0.617432",
"0.6147924",
"0.6146009",
"0.61335045",
"0.6128808",
"0.6101989",
"0.60783356",
"0.60483795",
"0.60433745",
"0.59743047",
"0.5936232",
"0.5932818",
"0.5907146",
... | 0.65447366 | 2 |
Returns True if |self| is an ObjectType. bool | def is_object_type(self):
raise exceptions.NotImplementedError() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def isinstance_blender_object(self, b_obj):\n # lame and slow, but functional\n return b_obj in Blender.Object.Get()",
"def verify_type(self, obj):\n return isinstance(obj, self.type_)",
"def object_type_present(self, object_type):\n # Check input.\n if not isinstance(object_... | [
"0.7290644",
"0.6918381",
"0.6855239",
"0.681674",
"0.6812159",
"0.66543907",
"0.664714",
"0.65621924",
"0.65621924",
"0.65621924",
"0.65621924",
"0.65621924",
"0.6510388",
"0.64790374",
"0.64409184",
"0.6381249",
"0.63387465",
"0.6333009",
"0.62965983",
"0.62965983",
"0.6294... | 0.73837817 | 0 |
Returns True if |self| is an AnyType. bool | def is_any_type(self):
raise exceptions.NotImplementedError() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _is_any(typeval: Type) -> bool:\n return typeval in _ANY",
"def any(self) -> bool:",
"def is_a(self, t):\n return isinstance(self._, t)",
"def of_type(self, a):\n return type(a) == type(self.one)",
"def __bool__(self):\n return bool(self.obj)",
"def any(x) -> bool:\n pass",
... | [
"0.7405247",
"0.6943971",
"0.65161765",
"0.6286378",
"0.6231235",
"0.6206884",
"0.61998576",
"0.61801803",
"0.6145843",
"0.61362964",
"0.6085742",
"0.6085742",
"0.60733044",
"0.60606396",
"0.6040771",
"0.6012931",
"0.6012655",
"0.5969699",
"0.59533924",
"0.5941362",
"0.592886... | 0.7389143 | 1 |
Returns True if |self| is an InterfaceType. bool | def is_interface_type(self):
raise exceptions.NotImplementedError() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"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 # Search for string match \"class type... | [
"0.7116907",
"0.69529134",
"0.6768456",
"0.65538967",
"0.6530441",
"0.6227138",
"0.61110246",
"0.6041694",
"0.60142016",
"0.59563255",
"0.58967304",
"0.5890976",
"0.588442",
"0.58537626",
"0.5843988",
"0.579155",
"0.5761401",
"0.5754417",
"0.5736469",
"0.5722448",
"0.5722448"... | 0.7915525 | 0 |
Returns True if |self| is a DictionaryType. bool | def is_dictionary_type(self):
raise exceptions.NotImplementedError() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_typed_dict(self) -> bool:\n return True",
"def is_dict(self) -> bool:\n return True",
"def isDict(data):\n\ttry:\n\t\tfrom types import DictType\n\t\tif type(data) == DictType:\n\t\t\treturn True\n\texcept ImportError:\n\t\tif type(data) == type({}):\n\t\t\treturn True\n\treturn False",
... | [
"0.83596665",
"0.8282886",
"0.7185274",
"0.7174881",
"0.7002042",
"0.69743806",
"0.6910194",
"0.69039637",
"0.68584085",
"0.6709575",
"0.67012036",
"0.6694288",
"0.65412045",
"0.615393",
"0.60514045",
"0.59867156",
"0.5901052",
"0.5798987",
"0.5758512",
"0.57490814",
"0.57340... | 0.802854 | 2 |
Returns True if |self| is a NamespaceType. bool | def is_namespace_type(self):
raise exceptions.NotImplementedError() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def hasNamespaceNS(self, *args):\n return _libsbml.XMLToken_hasNamespaceNS(self, *args)",
"def isSBMLNamespace(*args):\n return _libsbml.SBMLNamespaces_isSBMLNamespace(*args)",
"def hasNS(self, *args):\n return _libsbml.XMLNamespaces_hasNS(self, *args)",
"def hasNamespaceURI(self, *args)... | [
"0.6642418",
"0.65552014",
"0.64188397",
"0.63565373",
"0.6347774",
"0.6345759",
"0.6091694",
"0.60831106",
"0.6014322",
"0.5938113",
"0.5913756",
"0.58826727",
"0.5857198",
"0.58479625",
"0.58289057",
"0.5818701",
"0.5818701",
"0.5781182",
"0.56841654",
"0.5679502",
"0.56740... | 0.776895 | 0 |
Returns True if |self| is an EnumerationType. bool | def is_enumeration_type(self):
raise exceptions.NotImplementedError() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_enum(self):\n return self.is_complex and not self.is_class",
"def is_enum(self):\n return False",
"def __bool__(self):\n raise ValueError(\"never bool enums\")",
"def is_enum(schema_obj):\n\n return (isinstance(schema_obj, schema.Enum) or\n (isinstance(schema_obj, schema... | [
"0.75733083",
"0.7569544",
"0.6962072",
"0.6221248",
"0.593877",
"0.5817571",
"0.5783149",
"0.57705",
"0.57169104",
"0.5677263",
"0.56612563",
"0.56568766",
"0.5621548",
"0.5560102",
"0.55483013",
"0.5544188",
"0.5514909",
"0.5514909",
"0.5502364",
"0.5480135",
"0.5452716",
... | 0.7311989 | 2 |
Returns True if |self| is a CallbackInterfaceType. bool | def is_callback_interface_type(self):
raise exceptions.NotImplementedError() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_callback_function_type(self):\n raise exceptions.NotImplementedError()",
"def isCall(self) -> bool:\n ...",
"def is_function_type(self, objtype):\n # return self.__cfuncptrt == type(objtype)\n return issubclass(objtype, self.__cfuncptrt)\n # return isinstance(objtype, ... | [
"0.72134316",
"0.6319314",
"0.6022175",
"0.59459776",
"0.59300095",
"0.5850091",
"0.5819407",
"0.57849604",
"0.57714933",
"0.5738899",
"0.5683553",
"0.56677616",
"0.5630323",
"0.5536595",
"0.5504375",
"0.5490046",
"0.546221",
"0.5431004",
"0.5413289",
"0.54089355",
"0.5399478... | 0.7897599 | 0 |
Returns True if |self| is a CallbackFunctionType. bool | def is_callback_function_type(self):
raise exceptions.NotImplementedError() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_function_type(self, objtype):\n # return self.__cfuncptrt == type(objtype)\n return issubclass(objtype, self.__cfuncptrt)\n # return isinstance(objtype, self.__cfuncptrt)",
"def is_function(self):\n return self.args is not None",
"def is_function(self):\n return False"... | [
"0.7153936",
"0.6989906",
"0.6942195",
"0.6871938",
"0.6591295",
"0.64573854",
"0.64336544",
"0.64194083",
"0.6401891",
"0.62902033",
"0.62851524",
"0.61820483",
"0.61599416",
"0.6106562",
"0.59508336",
"0.5926797",
"0.5912897",
"0.5894191",
"0.5893967",
"0.5843545",
"0.58299... | 0.7611457 | 0 |
Returns True if |self| is a VoidType. bool | def is_void_type(self):
raise exceptions.NotImplementedError() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_void(self):\n return False",
"def IsVoid(self, *args):\n return _Bnd.Bnd_Box_IsVoid(self, *args)",
"def is_void(type):\n return remove_alias(type) in create_cv_types(cpptypes.void_t())",
"def IsVoid(self, *args):\n return _Bnd.Bnd_Box2d_IsVoid(self, *args)",
"def is_pointer_t... | [
"0.82286865",
"0.7611015",
"0.74208486",
"0.68909454",
"0.6569038",
"0.6109725",
"0.593446",
"0.581228",
"0.5786375",
"0.5749218",
"0.57407707",
"0.57311565",
"0.57092",
"0.5671437",
"0.5671437",
"0.5671437",
"0.5671437",
"0.5667571",
"0.56453985",
"0.5642926",
"0.5642926",
... | 0.7789936 | 1 |
Returns True if |self| is a NullableType. bool | def is_nullable_type(self):
raise exceptions.NotImplementedError() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _is_nullable(self) -> bool:\n return self.__nullable",
"def is_nullable(self):\n return self._is_nullable",
"def is_nullable(self) -> bool: # pragma: no cover\n pass",
"def isNullable(self):\n if self.isPrimaryKey():\n return False\n else:\n retur... | [
"0.8178933",
"0.7918046",
"0.79070556",
"0.76075095",
"0.69676435",
"0.6672594",
"0.65094495",
"0.6502415",
"0.647941",
"0.6284314",
"0.6273103",
"0.62613225",
"0.62450457",
"0.6224936",
"0.6208757",
"0.6208757",
"0.6208757",
"0.6208757",
"0.6208757",
"0.6177551",
"0.61642456... | 0.72613966 | 4 |
Returns True if |self| is an AnnotatedType. bool | def is_annotated_type(self):
raise exceptions.NotImplementedError() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_annotated_type(self) -> bool:\n return get_origin(self.type) is Annotated",
"def is_typing_annotation(node: ast.AST, ctx: 'model.Documentable') -> bool:\n return is_using_annotations(node, TYPING_ALIAS, ctx) or \\\n is_using_annotations(node, SUBSCRIPTABLE_CLASSES_PEP585, ctx)",
"de... | [
"0.8426096",
"0.6878035",
"0.67209965",
"0.6478677",
"0.614293",
"0.6041532",
"0.60102296",
"0.6004325",
"0.5994643",
"0.5971596",
"0.5964204",
"0.5907197",
"0.58609444",
"0.5856965",
"0.5855007",
"0.58441585",
"0.58273065",
"0.582121",
"0.57902175",
"0.57866234",
"0.57857174... | 0.7609778 | 1 |
Returns True if |self| is a PromiseType. bool | def is_promise_type(self):
raise exceptions.NotImplementedError() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __bool__(self):\n return self.is_successful",
"def is_task(self):\n from .tasks import Task\n return isinstance(self, Task)",
"def __bool__(self):\n return bool(self.obj)",
"def in_progress(self: \"Status\") -> bool:\n return isinstance(self, InProgress)",
"def is_asy... | [
"0.60700285",
"0.6006526",
"0.600101",
"0.5995107",
"0.5994056",
"0.59527934",
"0.59483606",
"0.59320986",
"0.5809807",
"0.574972",
"0.56372863",
"0.5637197",
"0.5637197",
"0.5637197",
"0.5628994",
"0.56172556",
"0.56081927",
"0.56081927",
"0.56081927",
"0.55745226",
"0.55606... | 0.76272804 | 0 |
Returns True if |self| is a RecordType. bool | def is_record_type(self):
raise exceptions.NotImplementedError() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def supports_book_record_type(self, book_record_type=None):\n if book_record_type is None:\n raise NullArgument()\n return False",
"def supports_catalog_record_type(self, catalog_record_type=None):\n if catalog_record_type is None:\n raise NullArgument()\n return... | [
"0.657329",
"0.6553393",
"0.6409709",
"0.6220432",
"0.6149315",
"0.6113821",
"0.61134356",
"0.6092015",
"0.603679",
"0.5925932",
"0.58947814",
"0.5886511",
"0.5882126",
"0.5842346",
"0.58168924",
"0.5733191",
"0.57082087",
"0.5686609",
"0.5648512",
"0.56156236",
"0.56152785",... | 0.79121345 | 0 |
Returns True if |self| is a SequenceType. bool | def is_sequence_type(self):
raise exceptions.NotImplementedError() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_sequence(self) -> bool:\n return isinstance(self.yaml_node, yaml.SequenceNode)",
"def isSequence(obj):\n # type: (Any) -> bool\n return isinstance(obj, Sequence)",
"def issequence(obj) -> bool:\n return hasattr(type(obj), '__iter__') and hasattr(type(obj), '__len__')",
"def _is_sequenc... | [
"0.80957925",
"0.71997213",
"0.6930186",
"0.6835188",
"0.6770618",
"0.64282125",
"0.6424273",
"0.64200723",
"0.6333723",
"0.63057405",
"0.6290044",
"0.60951614",
"0.6089056",
"0.60546523",
"0.6032186",
"0.6004696",
"0.59916586",
"0.5949501",
"0.5874908",
"0.586695",
"0.583887... | 0.7640966 | 1 |
Returns True if |self| is a UnionType. bool | def is_union_type(self):
raise exceptions.NotImplementedError() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"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:\... | [
"0.8105555",
"0.7861087",
"0.7817273",
"0.7705603",
"0.7646727",
"0.7483963",
"0.7477847",
"0.74555516",
"0.69131905",
"0.6808421",
"0.65584767",
"0.58904076",
"0.5881067",
"0.570471",
"0.56558865",
"0.56558865",
"0.5652963",
"0.562509",
"0.5571252",
"0.5558063",
"0.5529574",... | 0.81638217 | 0 |
Returns Typedef instances which directly point this type. tuple(Typedef) | def typedefs(self):
raise exceptions.NotImplementedError() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def typenames(self):\n return tuple((item[0] for item in self))",
"def visit_tuple_type(self, left: TupleType) -> T:",
"def type(self) -> global___Type:",
"def __tuple(self):\n return (self.__app, self.__namespace, self.__pairs)",
"def _p_type(self):\n # FIXME: Something about self referen... | [
"0.6696826",
"0.57943803",
"0.57066506",
"0.56916595",
"0.56512207",
"0.5642418",
"0.5635808",
"0.5627796",
"0.55997837",
"0.5572192",
"0.5496701",
"0.5446311",
"0.5444676",
"0.5443081",
"0.5426574",
"0.5398417",
"0.53773963",
"0.53727347",
"0.5328607",
"0.5304586",
"0.527899... | 0.64053947 | 1 |
Returns inner type if |this| is a nullable or an annotated type. IdlType? | def inner_type(self):
raise exceptions.NotImplementedError() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getType_(self, ctx):\n # type: (Optional[RelayParser.Type_Context]) -> Optional[ty.Type]\n\n if ctx is None:\n return None\n\n return self.visit(ctx)",
"def _schema_type(self) -> Optional[type]:\n return None",
"def get_type_annotation(self) -> FakeAnnotation:\n ... | [
"0.609237",
"0.60214883",
"0.6018178",
"0.59910977",
"0.58618265",
"0.58472747",
"0.58026415",
"0.58026415",
"0.58026415",
"0.58026415",
"0.58026415",
"0.58026415",
"0.58026415",
"0.58026415",
"0.58026415",
"0.58026415",
"0.58026415",
"0.58026415",
"0.58026415",
"0.58026415",
... | 0.55396795 | 44 |
Returns the interface that |self| points if |self| is an InterfaceType. Interface | def interface(self):
raise exceptions.NotImplementedError() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def interface(self) -> type:\n return self.get_interface()",
"def _get_interface_type(self):\n return self.__interface_type",
"def interfaceType(self): # pylint: disable=invalid-name\n return self.interface_type",
"def interface(self):\n return self._interface",
"def _get_interface... | [
"0.8142879",
"0.7760429",
"0.7617031",
"0.76076543",
"0.72924703",
"0.72924703",
"0.72924703",
"0.72924703",
"0.72924703",
"0.72924703",
"0.72924703",
"0.72924703",
"0.72924703",
"0.72924703",
"0.72924703",
"0.72924703",
"0.72924703",
"0.72924703",
"0.72924703",
"0.7253932",
... | 0.5923083 | 71 |
Returns the dictionary that |self| points if |self| is an DictionaryType. Dictionary | def dictionary(self):
raise exceptions.NotImplementedError() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getDict(self):\n \n return self[self._name]",
"def dict(self) -> Dict:\r\n return super().dict()",
"def dict(self) -> Dict:\r\n return super().dict()",
"def asdict(self) -> dict:\n return self.__asdict(self)",
"def dict(self):\n return self.__dict__",
"def di... | [
"0.7037504",
"0.69438475",
"0.69438475",
"0.68541074",
"0.68119997",
"0.68119997",
"0.68119997",
"0.68119997",
"0.68119997",
"0.68119997",
"0.68119997",
"0.6691709",
"0.6664338",
"0.666296",
"0.6588652",
"0.6580622",
"0.6580622",
"0.65131795",
"0.64481884",
"0.6436729",
"0.64... | 0.6181581 | 42 |
Returns the namespace that |self| points if |self| is an NamespaceType. Namespace | def namespace(self):
raise exceptions.NotImplementedError() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def namespace (self) :\n\n return self.__namespace__",
"def namespace(self):\n return self._namespace",
"def namespace(self) -> _iomanagers.Namespace:\n # It cannot set self.__namespace,\n # but it can function as a setter to the namespace variables.\n return self.__namespace... | [
"0.8055387",
"0.80458236",
"0.8039847",
"0.7999933",
"0.7881447",
"0.7881447",
"0.7881447",
"0.77895963",
"0.77386844",
"0.77386844",
"0.77386844",
"0.77386844",
"0.77386844",
"0.77302724",
"0.76803803",
"0.7679001",
"0.75191694",
"0.75191694",
"0.75191694",
"0.75191694",
"0.... | 0.6365088 | 65 |
Returns the enumeration that |self| points if |self| is an EnumerationType. Enumeration | def enumeration(self):
raise exceptions.NotImplementedError() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def enum(self):\r\n raise NotImplementedError",
"def type(self):\n if self.__type is None:\n found_type = find_definition(\n self.__type_name, self.message_definition())\n if not (found_type is not Enum and\n isinstance(found_type, type) and\n... | [
"0.6754995",
"0.6505485",
"0.6498391",
"0.64226437",
"0.64147794",
"0.6215564",
"0.62026507",
"0.6193123",
"0.6181149",
"0.61001414",
"0.6067181",
"0.5867183",
"0.5742926",
"0.5690248",
"0.5673847",
"0.55770445",
"0.55766934",
"0.55766934",
"0.5558914",
"0.5537204",
"0.550784... | 0.6433254 | 3 |
Returns the callback interface that |self| points if |self| is an CallbackInterfaceType. CallbackInterface | def callback_interface(self):
raise exceptions.NotImplementedError() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_callback(self):\n return self.callbacks[self.type]",
"def is_callback_interface_type(self):\n raise exceptions.NotImplementedError()",
"def interface(self) -> type:\n return self.get_interface()",
"def _get_interface_ref(self):\n return self.__interface_ref",
"def _get_inter... | [
"0.72727275",
"0.7211086",
"0.6604015",
"0.6456605",
"0.6456605",
"0.6456605",
"0.6456605",
"0.6456605",
"0.6456605",
"0.6378537",
"0.6378537",
"0.6378537",
"0.6378537",
"0.6378537",
"0.6378537",
"0.6378537",
"0.6378537",
"0.6378537",
"0.6378537",
"0.6378537",
"0.6378537",
... | 0.67811304 | 2 |
Returns the callback function that |self| points if |self| is an CallbackFunctionType. CallbackFunction | def callback_function(self):
raise exceptions.NotImplementedError() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_callback(self):\n return self.callbacks[self.type]",
"def callback(self):\n return self._callback",
"def callback(self):\n if self._weak:\n return self._callback()\n return self._callback",
"def get_function(callable_):\n if isinstance(callable_, types.Method... | [
"0.751113",
"0.6812911",
"0.6366499",
"0.6194071",
"0.6112495",
"0.60155153",
"0.5968445",
"0.57926375",
"0.57628703",
"0.5712974",
"0.5643827",
"0.5585703",
"0.55800635",
"0.5564222",
"0.5536213",
"0.5528235",
"0.5508395",
"0.55019987",
"0.5474349",
"0.5464456",
"0.5431351",... | 0.5362523 | 23 |
Returns True if 'unrestricted' is specified. bool | def is_unrestricted(self):
raise exceptions.NotImplementedError() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def permissive(self) -> bool:\n return self._permissive",
"def privileged(self) -> Optional[pulumi.Input[bool]]:\n return pulumi.get(self, \"privileged\")",
"def privileged(self) -> Optional[pulumi.Input[bool]]:\n return pulumi.get(self, \"privileged\")",
"def _disallow_public_access(sel... | [
"0.6544667",
"0.638061",
"0.638061",
"0.6114495",
"0.60935193",
"0.60935193",
"0.60431635",
"0.60431635",
"0.59647554",
"0.5900266",
"0.58141834",
"0.5814022",
"0.58053815",
"0.57084066",
"0.5697186",
"0.56897306",
"0.56897306",
"0.5680323",
"0.560833",
"0.5602042",
"0.559735... | 0.75456357 | 0 |
Returns the key type. IdlType | def key_type(self):
raise exceptions.NotImplementedError() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def key_type(self):\n return self._key_type",
"def key_type(self) -> global___Type:",
"def __guess_key_type(self):\n if self.__key:\n if isinstance(self.__key, types.IntType) or \\\n isinstance(self.__key, types.LongType) or \\\n isinstance(self.__key, types... | [
"0.8287919",
"0.80417645",
"0.72916764",
"0.7204664",
"0.705062",
"0.6509091",
"0.6392",
"0.6380191",
"0.63717896",
"0.6315969",
"0.6315062",
"0.6271492",
"0.6241569",
"0.6228857",
"0.6224559",
"0.62191284",
"0.6217665",
"0.62150204",
"0.6200808",
"0.6175375",
"0.6175375",
... | 0.7703498 | 2 |
Returns the value type. IdlType | def value_type(self):
raise exceptions.NotImplementedError() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def value_type(self) -> str:\n return pulumi.get(self, \"value_type\")",
"def value_type(self) -> global___Type:",
"def value_type(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"value_type\")",
"def get_type(value):\n return type(value)",
"def get_data_type(self) -> Type[ATTRIBUT... | [
"0.8055694",
"0.78766716",
"0.77919865",
"0.7361258",
"0.7355152",
"0.73029304",
"0.7250476",
"0.7248106",
"0.71400183",
"0.712206",
"0.70682406",
"0.6973799",
"0.69301075",
"0.6928292",
"0.69244415",
"0.6912212",
"0.68916804",
"0.68774706",
"0.6860282",
"0.6860282",
"0.68602... | 0.72933155 | 6 |
Returns the result type. IdlType | def result_type(self):
raise exceptions.NotImplementedError() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def result_type(self) -> Optional[str]:\n if hasattr(self, \"_result_type\"):\n return self._result_type\n _args: list[Arg] = []\n _ctx = self._select(\"resultType\", _args)\n return _ctx.execute_sync(Optional[str])",
"def result_type(self):\r\n if not hasattr(self, ... | [
"0.7371791",
"0.7227484",
"0.70264876",
"0.695912",
"0.68952215",
"0.67422324",
"0.6730174",
"0.6698153",
"0.6698153",
"0.6698153",
"0.6698153",
"0.6698153",
"0.6698153",
"0.6698153",
"0.6698153",
"0.6698153",
"0.6698153",
"0.6698153",
"0.6698153",
"0.6698153",
"0.6698153",
... | 0.72648156 | 1 |
Returns a list of member types. tuple(IdlType) | def member_types(self):
raise exceptions.NotImplementedError() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def flattened_member_types(self):\n raise exceptions.NotImplementedError()",
"def get_members():",
"def typenames(self):\n return tuple((item[0] for item in self))",
"def getTypeCode(self):\n return _libsbml.ListOfMembers_getTypeCode(self)",
"def ntypes(self): # -> list[str]:\n ... | [
"0.68188757",
"0.63429254",
"0.6320436",
"0.628236",
"0.6216023",
"0.6130448",
"0.606133",
"0.6058626",
"0.6038821",
"0.6021799",
"0.6015155",
"0.6015155",
"0.59637636",
"0.5952403",
"0.59175074",
"0.5888799",
"0.5880538",
"0.5880081",
"0.58317626",
"0.583168",
"0.5800849",
... | 0.71356374 | 0 |
Returns a set of flattened member types. | def flattened_member_types(self):
raise exceptions.NotImplementedError() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def direct_descendant_type_set(self) -> Set[str]:\n return set(chain.from_iterable(seg.class_types for seg in self.segments))",
"def descendant_type_set(self) -> Set[str]:\n return set(\n chain.from_iterable(\n seg.descendant_type_set | seg.class_types for seg in self.segm... | [
"0.6395949",
"0.61097467",
"0.6098791",
"0.60910064",
"0.6064942",
"0.60378265",
"0.60336834",
"0.6015646",
"0.5942752",
"0.5909887",
"0.5851412",
"0.5845181",
"0.5836261",
"0.58322257",
"0.57702565",
"0.5755678",
"0.572548",
"0.5714109",
"0.5702991",
"0.5687666",
"0.56698954... | 0.8199972 | 0 |
Calculate derivative of f at x ... | def derivative(f, x, epsilon = 1e-10):
x_ = x + epsilon
value = (f(x_) - f(x)) / epsilon
return value | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def derivative(func: Callable, x: float, delta: float) -> float:\n return (func(x + delta) - func(x - delta)) / (2.0 * delta)",
"def dalf(x):\n return derivative(alf, x, dx=1e-6)",
"def ddalf(x):\n return derivative(dalf, x, dx=1e-6)",
"def ddalf(x):\n return derivative(dalf, x, dx=1e... | [
"0.8399586",
"0.8368309",
"0.8243807",
"0.8243807",
"0.80135554",
"0.76355505",
"0.76177835",
"0.759907",
"0.75759",
"0.7549782",
"0.7521599",
"0.7458555",
"0.7403107",
"0.7348985",
"0.7286614",
"0.72405046",
"0.7226039",
"0.72241956",
"0.7214791",
"0.7148547",
"0.70950574",
... | 0.822914 | 4 |
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 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"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 =... | [
"0.75414956",
"0.736744",
"0.73278105",
"0.7199806",
"0.71724826",
"0.71724826",
"0.714068",
"0.702706",
"0.69684196",
"0.6934339",
"0.69137716",
"0.688898",
"0.6880599",
"0.68199027",
"0.68155897",
"0.67816776",
"0.67622113",
"0.67365223",
"0.6713649",
"0.66943544",
"0.65928... | 0.8333256 | 0 |
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 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def jacobian_func(f):\n jacobian = jacfwd(f)\n return jacobian",
"def jacobian(f, x):\n\n B, N = x.shape\n x.requires_grad = True\n in_ = torch.zeros(B, 1)\n \n y = f(in_, x)\n jacobian = list()\n \n for i in range(N):\n v = torch.zeros_like(y)\n v[:, i] = 1.\n ... | [
"0.8722021",
"0.8635077",
"0.8538924",
"0.84087753",
"0.8155197",
"0.801174",
"0.79759496",
"0.78006744",
"0.7767167",
"0.7756485",
"0.7756485",
"0.77275866",
"0.7719678",
"0.7650497",
"0.76414347",
"0.7623823",
"0.7577455",
"0.7467225",
"0.7465109",
"0.7456953",
"0.7437073",... | 0.86678606 | 1 |
Newton Raphson Optimizer ... | def newton_method(f, x_init = 0, epsilon = 1e-10):
prev_value = x_init + 2 * epsilon
value = x_init
iterations = 0
while abs(prev_value - value) > epsilon:
prev_value = value
f_dash = derivative(f, value)
value = value - f(value) / f_dash
iterations += 1
print(f"N... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def newtonraphson(self,g_temp,var_init):\n n_step=0\n error=np.linalg.norm(self.evaluate(var_init,g_temp))\n\n while (error > 1e-12 and n_step < 50):\n #Improve solution while error is too large and the number of steps does not exceed a limit\n J_inv=np.linalg.pinv(self.jacobian(var_init,g_temp)... | [
"0.73199046",
"0.72256666",
"0.7183944",
"0.7149301",
"0.7107763",
"0.7029765",
"0.7028431",
"0.70118195",
"0.6997567",
"0.69021887",
"0.6868596",
"0.6840032",
"0.6760218",
"0.6729579",
"0.67147064",
"0.6672244",
"0.663721",
"0.6561485",
"0.6543052",
"0.653823",
"0.6524338",
... | 0.66847134 | 15 |
Newton Raphson Optimizer for Vector Functions ... | def newton_method_vector(f, x_init, epsilon = 1e-10):
prev_value = x_init + 2 * epsilon
value = x_init
iterations = 0
while np.all(np.abs(prev_value - value)) > epsilon:
prev_value = value
j = jacobian(f, value)
value = value - np.dot(np.linalg.pinv(j), f(value))
itera... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _newton_update(func):\n return lambda x: x - func[0](x) / func[1](x)",
"def newton_update(f, df):\n def update(x):\n return x - f(x) / df(x)\n return update",
"def _compute_newton_step(lambdas, p_norm, w_norm):\n return lambdas.candidate + (p_norm / w_norm) ** 2 * (p_norm - 1)",
"def t... | [
"0.72647244",
"0.7235846",
"0.70901346",
"0.7068557",
"0.7045494",
"0.6998087",
"0.6988659",
"0.68796784",
"0.68378675",
"0.6802702",
"0.674208",
"0.67404073",
"0.6705107",
"0.65690404",
"0.6563226",
"0.64800274",
"0.6463862",
"0.64637756",
"0.6450425",
"0.6428148",
"0.638642... | 0.70037144 | 5 |
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 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"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... | [
"0.7136234",
"0.69508874",
"0.683343",
"0.6732784",
"0.6722891",
"0.6712324",
"0.6674293",
"0.6639559",
"0.662268",
"0.66004324",
"0.65794253",
"0.65109783",
"0.64871514",
"0.6413661",
"0.6333544",
"0.6296736",
"0.6278239",
"0.6260027",
"0.6147197",
"0.6048034",
"0.59243625",... | 0.69843024 | 1 |
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 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def generate_negative_sample_list(self, xc_start):\r\n return [self.get_random_Nb_sample(xc_start) for _ in range(self.Nb)]",
"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 positiv... | [
"0.67092043",
"0.659947",
"0.6404769",
"0.6344144",
"0.6319633",
"0.6240499",
"0.61978734",
"0.61512685",
"0.61288166",
"0.6084549",
"0.6071787",
"0.6045156",
"0.59752685",
"0.59652776",
"0.59609824",
"0.59361213",
"0.59042007",
"0.58985853",
"0.5882967",
"0.5882967",
"0.5882... | 0.6612375 | 1 |
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... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"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... | [
"0.7962767",
"0.7113393",
"0.6915076",
"0.67396253",
"0.6736857",
"0.6665003",
"0.65617204",
"0.6539428",
"0.6518947",
"0.65147203",
"0.6502605",
"0.64700353",
"0.6469974",
"0.6457087",
"0.6433749",
"0.64269245",
"0.6422392",
"0.6416041",
"0.63974875",
"0.6356123",
"0.6339711... | 0.79631 | 0 |
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... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"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 ... | [
"0.84610265",
"0.65147275",
"0.6495986",
"0.632336",
"0.63160795",
"0.6192951",
"0.6191186",
"0.61434877",
"0.6129643",
"0.6103901",
"0.60978335",
"0.608716",
"0.6058954",
"0.603675",
"0.603421",
"0.6027226",
"0.6024294",
"0.59999007",
"0.59602183",
"0.59490293",
"0.5924875",... | 0.84600556 | 1 |
Working too slow, actually slower than the original. Still processes the same number of items but the extra loops add to execution time | def triangle(row):
if len(row) == 0:
raise ValidationError("Row empty")
if len(row) == 1:
return row
if len(row) < 8:
return small_triangles(row)
make_steps()
while len(row) > 50:
streams = defaultdict(list)
j = 0
streams[j] = list(row)
for i i... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def algorithm_loop(self):",
"def analyze(L):\n rslt=[]\n #p=util.Progress(len(L))\n i=0\n import multiprocessing\n s_pid=str(multiprocessing.current_process().pid)\n for s_name, S_hit, S_go in L:\n i+=1\n #if (i % 500... | [
"0.58263874",
"0.57833457",
"0.57502186",
"0.57413995",
"0.5719363",
"0.56521094",
"0.5621582",
"0.55443466",
"0.55193293",
"0.5508911",
"0.5461393",
"0.5437186",
"0.54334235",
"0.54307234",
"0.54241854",
"0.54225546",
"0.54160535",
"0.54103637",
"0.54101413",
"0.53760815",
"... | 0.0 | -1 |
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... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"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 ... | [
"0.69191617",
"0.6760998",
"0.6308087",
"0.623117",
"0.61973536",
"0.61973536",
"0.61879206",
"0.61140317",
"0.60523087",
"0.60180354",
"0.60157675",
"0.6008048",
"0.60011387",
"0.5983024",
"0.59410757",
"0.5926585",
"0.59205323",
"0.59090775",
"0.590305",
"0.58944255",
"0.58... | 0.6762888 | 1 |
This function exists to enable mocking the `bzr status` output in tests. | def _get_bzr_status(output):
return output[0].decode("utf-8").splitlines() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_get_status(self):\n pass",
"def test_get_status(self):\n pass",
"def test_do_status(config, mocker, path_map_mock):\n logger_mock = mocker.MagicMock()\n p = Unpacker(config, logger_mock)\n assert p._do_status() == {}",
"def test_status_python_api(self):\n report = statu... | [
"0.73363245",
"0.73363245",
"0.715519",
"0.67845184",
"0.66005677",
"0.6572421",
"0.65377516",
"0.6526974",
"0.6477695",
"0.6435713",
"0.643362",
"0.63395154",
"0.63283074",
"0.6213151",
"0.6165627",
"0.6158066",
"0.61552596",
"0.61295754",
"0.6114481",
"0.6086743",
"0.608495... | 0.62420446 | 13 |
returns the temperature in degrees Fahrenheit | def fahrenheit(T_in_celsius):
return (T_in_celsius * 9 / 5) + 32 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def temperature() -> float:",
"def target_temperature_f(self) -> float:\r\n self._logger.debug(log_message_formatter(\r\n \"get\", f\"{self}\", \"target_temperature_f\"))\r\n return celsius_to_fahrenheit(self.target_temperature_c)",
"def ambient_temperature_f(self) -> float:\r\n ... | [
"0.8488724",
"0.8198983",
"0.81489986",
"0.8096503",
"0.804603",
"0.78485745",
"0.7830313",
"0.7802292",
"0.7635135",
"0.7629729",
"0.7591137",
"0.753169",
"0.7487268",
"0.7486671",
"0.7473806",
"0.7432369",
"0.7417386",
"0.7413472",
"0.740109",
"0.73969823",
"0.7387348",
"... | 0.74954575 | 12 |
A friendly function for anyone wanting a friendly greeting | def hello(name):
return f'Hello, {name}!' | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def greeting_message(name):\n print('My name is ' + name)",
"def greeter_user(username):\n print(f\"Hello {username}\")",
"def greet_user(username):\r\n print(f\"Hello, {username.title()}!\")",
"def greet_user():\r\n print('Hi,' + FirstName + ' ' + LastName + ' thanks for joining us inside the b... | [
"0.7749547",
"0.7504465",
"0.7503182",
"0.74993086",
"0.74669003",
"0.7456384",
"0.7456384",
"0.74484235",
"0.74119574",
"0.73600996",
"0.7359773",
"0.73447055",
"0.7292503",
"0.72723085",
"0.72594655",
"0.71972096",
"0.7166354",
"0.71299905",
"0.7120065",
"0.7101632",
"0.710... | 0.65929586 | 66 |
Implements the EulerMaruyama scheme. | def __init__(self, initial, funcs, theta, noise, dt=1):
super().__init__(initial, funcs, theta, noise)
self.dt = dt | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def eulerphi(n):\r\n\treturn euler_phi(n)",
"def eulerphi(n):\n\treturn euler_phi(n)",
"def euler(faces, edges, verticies):\n\n # Return the calculated value\n return verticies + edges - faces",
"def prjEuler():\r\n #Constants\r\n NUMSTRING = ( \"73167176531330624919225119674426574742355349194934... | [
"0.579975",
"0.572334",
"0.56796336",
"0.55885196",
"0.5424599",
"0.5366248",
"0.5341598",
"0.52492607",
"0.5232314",
"0.5219813",
"0.51901567",
"0.5117316",
"0.5108414",
"0.5106345",
"0.5105374",
"0.5038084",
"0.5011644",
"0.50035936",
"0.49938428",
"0.49654838",
"0.4956562"... | 0.0 | -1 |
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... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update(self):\n q = self.M[self.state,:][0]\n self.state = random.choice(self.N,1,p = q)\n return self.state",
"def update(self, next_state, reward):\n pass",
"def update(self):\n if self.size() < 2: return\n idx = random.randint(0, 100) % 3\n if idx < 2:\n slot = ... | [
"0.6271556",
"0.61507183",
"0.59220254",
"0.5901581",
"0.58661723",
"0.58061427",
"0.57873684",
"0.5770999",
"0.5711735",
"0.56835014",
"0.56593686",
"0.5658279",
"0.56573635",
"0.5653307",
"0.5647151",
"0.56323695",
"0.56268525",
"0.5618667",
"0.5605903",
"0.5596673",
"0.559... | 0.6893653 | 0 |
runs through one timestep and updates the atoms | def Iterate(self):
for atom in self.atoms:
self.UpdateAtom(atom) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def next_period_step(self):\n self.update_forces()\n element: Cell\n for element in self.cells:\n self.update_coordinates(element)\n self.update_volosity(element)",
"def _update_positions(self, delta_t):\n\n for atom in self.atoms:\n atom.update(delta_... | [
"0.68202317",
"0.6715678",
"0.6414524",
"0.628308",
"0.6197439",
"0.6184594",
"0.61320144",
"0.6113552",
"0.60633576",
"0.60368603",
"0.6036309",
"0.60067433",
"0.59957993",
"0.59397817",
"0.5897747",
"0.5897021",
"0.5874688",
"0.58444345",
"0.5821056",
"0.58185893",
"0.58007... | 0.7384793 | 0 |
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... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"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... | [
"0.627075",
"0.5974408",
"0.5943118",
"0.5872826",
"0.58601767",
"0.5731816",
"0.5659566",
"0.5647532",
"0.5573353",
"0.55374664",
"0.5527548",
"0.5518267",
"0.5488848",
"0.54798263",
"0.5470446",
"0.54632896",
"0.5436311",
"0.5432833",
"0.5427665",
"0.5418614",
"0.5414802",
... | 0.64096814 | 0 |
updates the atom's atomic numbers | def Update(self,n,l):
self.n = n
self.l = l | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_atomic_number(molecule, atom_index, atomic_num):\n molecule.SetAtomAtomicNumber(atom_index, atomic_num)",
"def updateNumerosity(self, num):\n self.numerosity += num",
"def inc(self):\n self._value += 1",
"def updateCounter(self):\n self.counter = self.counter + 1\n self... | [
"0.64485514",
"0.608502",
"0.6060538",
"0.6036555",
"0.59697956",
"0.59349847",
"0.5930148",
"0.59272087",
"0.5914348",
"0.5914348",
"0.5869126",
"0.5856178",
"0.5824182",
"0.5821639",
"0.58214134",
"0.5800693",
"0.5795214",
"0.5790661",
"0.57782084",
"0.57629734",
"0.5679768... | 0.5335342 | 61 |
Create a World account. | def _create_account(user_id: int):
now = datetime.now()
_created_at = now.strftime("%m/%d/%Y at %H:%M:%S")
Wealth.collection.insert_one({
"_id": user_id,
"coins": 100,
"cookie": 0,
"choc": 0,
"poop": 0,
"beans": 0,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_account():\n account = w3.eth.account.create()\n return account",
"def _create_account(self, username, email, password):\r\n resp = self.client.post('/create_account', {\r\n 'username': username,\r\n 'email': email,\r\n 'password': password,\r\n ... | [
"0.72102565",
"0.68331754",
"0.6789098",
"0.67094475",
"0.668502",
"0.6616837",
"0.66151345",
"0.66097593",
"0.656955",
"0.6564049",
"0.6503966",
"0.6500551",
"0.6400922",
"0.63500893",
"0.6304074",
"0.6266442",
"0.6229182",
"0.61712396",
"0.61150014",
"0.61128783",
"0.609722... | 0.6116119 | 18 |
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
}}) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"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... | [
"0.7368084",
"0.7210584",
"0.71865326",
"0.71241224",
"0.7043473",
"0.69961643",
"0.6883361",
"0.6883361",
"0.6859989",
"0.68431985",
"0.68298614",
"0.6818901",
"0.6789854",
"0.67864424",
"0.6737196",
"0.6642632",
"0.66231024",
"0.66116875",
"0.6569632",
"0.65545714",
"0.6537... | 0.797517 | 0 |
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"
]) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def random_image(context, person):\n collection = db['people']\n images = collection.find({'person': person})\n row = []\n for image in images:\n row.append(image['image_url'])\n rand_img = random.choice(list(row))\n return context.channel.send(rand_img)",
"def get_random_image():\r\n\r\... | [
"0.7145525",
"0.704462",
"0.67138517",
"0.6664869",
"0.65583915",
"0.64679533",
"0.6271986",
"0.62697124",
"0.62639177",
"0.62261814",
"0.61183375",
"0.6114843",
"0.61070025",
"0.6083373",
"0.60642034",
"0.6022996",
"0.6014336",
"0.597643",
"0.5945873",
"0.59402484",
"0.58898... | 0.6920481 | 2 |
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"
]) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def random_image(context, person):\n collection = db['people']\n images = collection.find({'person': person})\n row = []\n for image in images:\n row.append(image['image_url'])\n rand_img = random.choice(list(row))\n return context.channel.send(rand_img)",
"def get_a_picture_randomly(sel... | [
"0.65586865",
"0.6467759",
"0.6397638",
"0.6377332",
"0.6242254",
"0.60787094",
"0.60604465",
"0.6005842",
"0.59123677",
"0.5841395",
"0.5834412",
"0.57959676",
"0.5688708",
"0.5661508",
"0.5629392",
"0.5547989",
"0.5545386",
"0.55240476",
"0.5522917",
"0.55134743",
"0.548782... | 0.68730336 | 0 |
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
]) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def random_image(context, person):\n collection = db['people']\n images = collection.find({'person': person})\n row = []\n for image in images:\n row.append(image['image_url'])\n rand_img = random.choice(list(row))\n return context.channel.send(rand_img)",
"def random_img(path):\n ful... | [
"0.6314875",
"0.5989403",
"0.5938749",
"0.5929158",
"0.5898837",
"0.5824625",
"0.5752863",
"0.5730477",
"0.5720863",
"0.56660914",
"0.5637061",
"0.5596575",
"0.55663687",
"0.552755",
"0.5518498",
"0.55022883",
"0.5477218",
"0.54448146",
"0.542192",
"0.5327834",
"0.5300046",
... | 0.6855739 | 0 |
Updates relu activation functions so that 1 stores output in forward pass 2 imputes zero for gradient values that are less than zero | def update_relus(self):
def relu_backward_hook_function(module, grad_in, grad_out):
"""
If there is a negative gradient, change it to zero
"""
# Get last forward output
corresponding_forward_output = self.forward_relu_outputs[-1]
correspond... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_relus(self):\n def relu_backward_hook_function(module, grad_in, grad_out):\n \"\"\"\n If there is a negative gradient, change it to zero\n \"\"\"\n # Get last forward output\n corresponding_forward_output = self.forward_relu_outputs[-1]\n corresponding_forward_output[c... | [
"0.71002835",
"0.7058546",
"0.7051403",
"0.7016013",
"0.6980029",
"0.6936653",
"0.6891817",
"0.68849665",
"0.68542355",
"0.67622566",
"0.6736303",
"0.66012645",
"0.65662277",
"0.656202",
"0.6528573",
"0.64789206",
"0.6472497",
"0.6466472",
"0.64646626",
"0.64496136",
"0.64196... | 0.6970306 | 5 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.