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 |
|---|---|---|---|---|---|---|
AppendRows(numRows=1) > bool Append additional rows at the end of the table. | def AppendRows(self, numRows=1): # real signature unknown; restored from __doc__
return (self.GetNumberRows() + numRows) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def AppendRows(self, numRows = 1):\n for i in range(numRows):\n self.data = numpy.vstack((self.data,\n numpy.array([''] * self.data.shape[1], dtype = numpy.object),\n ))\n self.rowmask = numpy.append(self.rowmask, nu... | [
"0.82234913",
"0.7680864",
"0.7680864",
"0.67422974",
"0.66286564",
"0.65267634",
"0.65267634",
"0.65267634",
"0.65267634",
"0.65267634",
"0.65267634",
"0.65267634",
"0.65267634",
"0.65267634",
"0.62137854",
"0.60128397",
"0.60119236",
"0.5857733",
"0.5790014",
"0.5778878",
"... | 0.7819538 | 5 |
DeleteRows(pos=0, numRows=1) > bool Delete rows from the table. | def DeleteRows(self, pos=0, numRows=1): # real signature unknown; restored from __doc__
if self.data is None or len(self.data) == 0:
return False
for rowNum in range(0,numRows):
self.data.remove(self.data[numRows-1-pos-rowNum])
gridView=self.GetView()
gridView.Be... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def DeleteRows(self, pos=0, numRows=1): # real signature unknown; restored from __doc__\n if self.data is None or len(self.data) == 0:\n return False\n for rowNum in range(0, numRows):\n self.data.remove(self.data[numRows - 1 - pos - rowNum])\n gridView = self.GetView()\... | [
"0.8509247",
"0.8509247",
"0.7138309",
"0.6614276",
"0.6614276",
"0.6300265",
"0.6087969",
"0.59195846",
"0.59115934",
"0.5869983",
"0.58482474",
"0.57762325",
"0.57336473",
"0.570933",
"0.56701875",
"0.56412894",
"0.56196254",
"0.5617777",
"0.56165785",
"0.56080425",
"0.5603... | 0.85211456 | 5 |
Clear() Clear the table contents. | def Clear(self): # real signature unknown; restored from __doc__
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def clear(self):\n self.filled = 0\n self.used = 0\n self.table = []\n # Initialize the table to a clean slate of entries.\n for i in range(self.size):\n self.table.append(Entry())",
"def clear(self):\n\n self.size = 0\n\n self.table = [[]] * 100\n\n ... | [
"0.7549633",
"0.75100625",
"0.72180504",
"0.71167326",
"0.711315",
"0.7019527",
"0.6981833",
"0.6922991",
"0.6866691",
"0.68540704",
"0.6825538",
"0.681545",
"0.681545",
"0.681545",
"0.67841667",
"0.67506826",
"0.6735302",
"0.67126685",
"0.66913646",
"0.6681967",
"0.6681967",... | 0.618823 | 69 |
AppendCols(numCols=1) > bool Exactly the same as AppendRows() but for columns. | def AppendCols(self, numCols=1): # real signature unknown; restored from __doc__
return False | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_new_cols(cat, prefix=\"\", floatcols=None, boolcols=None):\n\t\n\tif floatcols != None:\n\t\tfor col in floatcols:\n\t\t\tcat.add_column(astropy.table.MaskedColumn(name=prefix+col, dtype=float, length=len(cat)))\n\t\t\tcat[prefix+col].mask = [True] * len(cat)\n\tif boolcols != None:\n\t\tfor col in boolcol... | [
"0.6017477",
"0.5631939",
"0.55924374",
"0.5548952",
"0.5529502",
"0.5455568",
"0.5444327",
"0.54101974",
"0.53786486",
"0.53754896",
"0.53557205",
"0.5345275",
"0.53391767",
"0.53190124",
"0.5316484",
"0.5307784",
"0.528852",
"0.5280459",
"0.5254802",
"0.525032",
"0.5224798"... | 0.89480335 | 8 |
AppendRows(numRows=1) > bool Append additional rows at the end of the table. | def AppendRows(self, numRows=1): # real signature unknown; restored from __doc__
return (self.GetNumberRows() + numRows) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def AppendRows(self, numRows = 1):\n for i in range(numRows):\n self.data = numpy.vstack((self.data,\n numpy.array([''] * self.data.shape[1], dtype = numpy.object),\n ))\n self.rowmask = numpy.append(self.rowmask, nu... | [
"0.82234913",
"0.7680864",
"0.7680864",
"0.67422974",
"0.66286564",
"0.65267634",
"0.65267634",
"0.65267634",
"0.65267634",
"0.65267634",
"0.65267634",
"0.65267634",
"0.65267634",
"0.65267634",
"0.62137854",
"0.60128397",
"0.60119236",
"0.5857733",
"0.5790014",
"0.5778878",
"... | 0.7819538 | 6 |
DeleteRows(pos=0, numRows=1) > bool Delete rows from the table. | def DeleteRows(self, pos=0, numRows=1): # real signature unknown; restored from __doc__
if self.data is None or len(self.data) == 0:
return False
for rowNum in range(0,numRows):
self.data.remove(self.data[numRows-1-pos-rowNum])
gridView=self.GetView()
gridView.Be... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def DeleteRows(self, pos=0, numRows=1): # real signature unknown; restored from __doc__\n if self.data is None or len(self.data) == 0:\n return False\n for rowNum in range(0, numRows):\n self.data.remove(self.data[numRows - 1 - pos - rowNum])\n gridView = self.GetView()\... | [
"0.8509247",
"0.8509247",
"0.7138309",
"0.6614276",
"0.6614276",
"0.6300265",
"0.6087969",
"0.59195846",
"0.59115934",
"0.5869983",
"0.58482474",
"0.57762325",
"0.57336473",
"0.570933",
"0.56701875",
"0.56412894",
"0.56196254",
"0.5617777",
"0.56165785",
"0.56080425",
"0.5603... | 0.85211456 | 4 |
Clear() Clear the table contents. | def Clear(self): # real signature unknown; restored from __doc__
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def clear(self):\n self.filled = 0\n self.used = 0\n self.table = []\n # Initialize the table to a clean slate of entries.\n for i in range(self.size):\n self.table.append(Entry())",
"def clear(self):\n\n self.size = 0\n\n self.table = [[]] * 100\n\n ... | [
"0.7549633",
"0.75100625",
"0.72180504",
"0.71167326",
"0.711315",
"0.7019527",
"0.6981833",
"0.6922991",
"0.6866691",
"0.68540704",
"0.6825538",
"0.681545",
"0.681545",
"0.681545",
"0.67841667",
"0.67506826",
"0.6735302",
"0.67126685",
"0.66913646",
"0.6681967",
"0.6681967",... | 0.618823 | 70 |
AppendCols(numCols=1) > bool Exactly the same as AppendRows() but for columns. | def AppendCols(self, numCols=1): # real signature unknown; restored from __doc__
return False | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_new_cols(cat, prefix=\"\", floatcols=None, boolcols=None):\n\t\n\tif floatcols != None:\n\t\tfor col in floatcols:\n\t\t\tcat.add_column(astropy.table.MaskedColumn(name=prefix+col, dtype=float, length=len(cat)))\n\t\t\tcat[prefix+col].mask = [True] * len(cat)\n\tif boolcols != None:\n\t\tfor col in boolcol... | [
"0.6017477",
"0.5631939",
"0.55924374",
"0.5548952",
"0.5529502",
"0.5455568",
"0.5444327",
"0.54101974",
"0.53786486",
"0.53754896",
"0.53557205",
"0.5345275",
"0.53391767",
"0.53190124",
"0.5316484",
"0.5307784",
"0.528852",
"0.5280459",
"0.5254802",
"0.525032",
"0.5224798"... | 0.89480335 | 6 |
AppendRows(numRows=1) > bool Append additional rows at the end of the table. | def AppendRows(self, numRows=1): # real signature unknown; restored from __doc__
return (self.GetNumberRows() + numRows) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def AppendRows(self, numRows = 1):\n for i in range(numRows):\n self.data = numpy.vstack((self.data,\n numpy.array([''] * self.data.shape[1], dtype = numpy.object),\n ))\n self.rowmask = numpy.append(self.rowmask, nu... | [
"0.82234913",
"0.7680864",
"0.7680864",
"0.67422974",
"0.66286564",
"0.65267634",
"0.65267634",
"0.65267634",
"0.65267634",
"0.65267634",
"0.65267634",
"0.65267634",
"0.65267634",
"0.65267634",
"0.62137854",
"0.60128397",
"0.60119236",
"0.5857733",
"0.5790014",
"0.5778878",
"... | 0.7819538 | 7 |
DeleteRows(pos=0, numRows=1) > bool Delete rows from the table. | def DeleteRows(self, pos=0, numRows=1): # real signature unknown; restored from __doc__
if self.data is None or len(self.data) == 0:
return False
for rowNum in range(0,numRows):
self.data.remove(self.data[numRows-1-pos-rowNum])
gridView=self.GetView()
gridView.Be... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def DeleteRows(self, pos=0, numRows=1): # real signature unknown; restored from __doc__\n if self.data is None or len(self.data) == 0:\n return False\n for rowNum in range(0, numRows):\n self.data.remove(self.data[numRows - 1 - pos - rowNum])\n gridView = self.GetView()\... | [
"0.8509247",
"0.8509247",
"0.7138309",
"0.6614276",
"0.6614276",
"0.6300265",
"0.6087969",
"0.59195846",
"0.59115934",
"0.5869983",
"0.58482474",
"0.57762325",
"0.57336473",
"0.570933",
"0.56701875",
"0.56412894",
"0.56196254",
"0.5617777",
"0.56165785",
"0.56080425",
"0.5603... | 0.85211456 | 6 |
Clear() Clear the table contents. | def Clear(self): # real signature unknown; restored from __doc__
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def clear(self):\n self.filled = 0\n self.used = 0\n self.table = []\n # Initialize the table to a clean slate of entries.\n for i in range(self.size):\n self.table.append(Entry())",
"def clear(self):\n\n self.size = 0\n\n self.table = [[]] * 100\n\n ... | [
"0.7549633",
"0.75100625",
"0.72180504",
"0.71167326",
"0.711315",
"0.7019527",
"0.6981833",
"0.6922991",
"0.6866691",
"0.68540704",
"0.6825538",
"0.681545",
"0.681545",
"0.681545",
"0.67841667",
"0.67506826",
"0.6735302",
"0.67126685",
"0.66913646",
"0.6681967",
"0.6681967",... | 0.618823 | 72 |
AppendCols(numCols=1) > bool Exactly the same as AppendRows() but for columns. | def AppendCols(self, numCols=1): # real signature unknown; restored from __doc__
return False | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_new_cols(cat, prefix=\"\", floatcols=None, boolcols=None):\n\t\n\tif floatcols != None:\n\t\tfor col in floatcols:\n\t\t\tcat.add_column(astropy.table.MaskedColumn(name=prefix+col, dtype=float, length=len(cat)))\n\t\t\tcat[prefix+col].mask = [True] * len(cat)\n\tif boolcols != None:\n\t\tfor col in boolcol... | [
"0.6017477",
"0.5631939",
"0.55924374",
"0.5548952",
"0.5529502",
"0.5455568",
"0.5444327",
"0.54101974",
"0.53786486",
"0.53754896",
"0.53557205",
"0.5345275",
"0.53391767",
"0.53190124",
"0.5316484",
"0.5307784",
"0.528852",
"0.5280459",
"0.5254802",
"0.525032",
"0.5224798"... | 0.89480335 | 4 |
AppendRows(numRows=1) > bool Append additional rows at the end of the table. | def AppendRows(self, numRows=1): # real signature unknown; restored from __doc__
return (self.GetNumberRows() + numRows) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def AppendRows(self, numRows = 1):\n for i in range(numRows):\n self.data = numpy.vstack((self.data,\n numpy.array([''] * self.data.shape[1], dtype = numpy.object),\n ))\n self.rowmask = numpy.append(self.rowmask, nu... | [
"0.82234913",
"0.7680864",
"0.7680864",
"0.67422974",
"0.66286564",
"0.65267634",
"0.65267634",
"0.65267634",
"0.65267634",
"0.65267634",
"0.65267634",
"0.65267634",
"0.65267634",
"0.65267634",
"0.62137854",
"0.60128397",
"0.60119236",
"0.5857733",
"0.5790014",
"0.5778878",
"... | 0.7819538 | 1 |
DeleteRows(pos=0, numRows=1) > bool Delete rows from the table. | def DeleteRows(self, pos=0, numRows=1): # real signature unknown; restored from __doc__
if self.data is None or len(self.data) == 0:
return False
for rowNum in range(0,numRows):
self.data.remove(self.data[numRows-1-pos-rowNum])
gridView=self.GetView()
gridView.Be... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def DeleteRows(self, pos=0, numRows=1): # real signature unknown; restored from __doc__\n if self.data is None or len(self.data) == 0:\n return False\n for rowNum in range(0, numRows):\n self.data.remove(self.data[numRows - 1 - pos - rowNum])\n gridView = self.GetView()\... | [
"0.8509247",
"0.8509247",
"0.7138309",
"0.6614276",
"0.6614276",
"0.6300265",
"0.6087969",
"0.59195846",
"0.59115934",
"0.5869983",
"0.58482474",
"0.57762325",
"0.57336473",
"0.570933",
"0.56701875",
"0.56412894",
"0.56196254",
"0.5617777",
"0.56165785",
"0.56080425",
"0.5603... | 0.85211456 | 0 |
Clear() Clear the table contents. | def Clear(self): # real signature unknown; restored from __doc__
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def clear(self):\n self.filled = 0\n self.used = 0\n self.table = []\n # Initialize the table to a clean slate of entries.\n for i in range(self.size):\n self.table.append(Entry())",
"def clear(self):\n\n self.size = 0\n\n self.table = [[]] * 100\n\n ... | [
"0.7549633",
"0.75100625",
"0.72180504",
"0.71167326",
"0.711315",
"0.7019527",
"0.6981833",
"0.6922991",
"0.6866691",
"0.68540704",
"0.6825538",
"0.681545",
"0.681545",
"0.681545",
"0.67841667",
"0.67506826",
"0.6735302",
"0.67126685",
"0.66913646",
"0.6681967",
"0.6681967",... | 0.618823 | 73 |
AppendCols(numCols=1) > bool Exactly the same as AppendRows() but for columns. | def AppendCols(self, numCols=1): # real signature unknown; restored from __doc__
return False | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_new_cols(cat, prefix=\"\", floatcols=None, boolcols=None):\n\t\n\tif floatcols != None:\n\t\tfor col in floatcols:\n\t\t\tcat.add_column(astropy.table.MaskedColumn(name=prefix+col, dtype=float, length=len(cat)))\n\t\t\tcat[prefix+col].mask = [True] * len(cat)\n\tif boolcols != None:\n\t\tfor col in boolcol... | [
"0.6017477",
"0.5631939",
"0.55924374",
"0.5548952",
"0.5529502",
"0.5455568",
"0.5444327",
"0.54101974",
"0.53786486",
"0.53754896",
"0.53557205",
"0.5345275",
"0.53391767",
"0.53190124",
"0.5316484",
"0.5307784",
"0.528852",
"0.5280459",
"0.5254802",
"0.525032",
"0.5224798"... | 0.89480335 | 5 |
AppendRows(numRows=1) > bool Append additional rows at the end of the table. | def AppendRows(self, numRows=1): # real signature unknown; restored from __doc__
return (self.GetNumberRows() + numRows) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def AppendRows(self, numRows = 1):\n for i in range(numRows):\n self.data = numpy.vstack((self.data,\n numpy.array([''] * self.data.shape[1], dtype = numpy.object),\n ))\n self.rowmask = numpy.append(self.rowmask, nu... | [
"0.82234913",
"0.7680864",
"0.7680864",
"0.67422974",
"0.66286564",
"0.65267634",
"0.65267634",
"0.65267634",
"0.65267634",
"0.65267634",
"0.65267634",
"0.65267634",
"0.65267634",
"0.65267634",
"0.62137854",
"0.60128397",
"0.60119236",
"0.5857733",
"0.5790014",
"0.5778878",
"... | 0.7819538 | 3 |
DeleteRows(pos=0, numRows=1) > bool Delete rows from the table. | def DeleteRows(self, pos=0, numRows=1): # real signature unknown; restored from __doc__
if self.data is None or len(self.data) == 0:
return False
for rowNum in range(0,numRows):
self.data.remove(self.data[numRows-1-pos-rowNum])
gridView=self.GetView()
gridView.Be... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def DeleteRows(self, pos=0, numRows=1): # real signature unknown; restored from __doc__\n if self.data is None or len(self.data) == 0:\n return False\n for rowNum in range(0, numRows):\n self.data.remove(self.data[numRows - 1 - pos - rowNum])\n gridView = self.GetView()\... | [
"0.8509247",
"0.8509247",
"0.7138309",
"0.6614276",
"0.6614276",
"0.6300265",
"0.6087969",
"0.59195846",
"0.59115934",
"0.5869983",
"0.58482474",
"0.57762325",
"0.57336473",
"0.570933",
"0.56701875",
"0.56412894",
"0.56196254",
"0.5617777",
"0.56165785",
"0.56080425",
"0.5603... | 0.85211456 | 2 |
Clear() Clear the table contents. | def Clear(self): # real signature unknown; restored from __doc__
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def clear(self):\n self.filled = 0\n self.used = 0\n self.table = []\n # Initialize the table to a clean slate of entries.\n for i in range(self.size):\n self.table.append(Entry())",
"def clear(self):\n\n self.size = 0\n\n self.table = [[]] * 100\n\n ... | [
"0.7549633",
"0.75100625",
"0.72180504",
"0.71167326",
"0.711315",
"0.7019527",
"0.6981833",
"0.6922991",
"0.6866691",
"0.68540704",
"0.6825538",
"0.681545",
"0.681545",
"0.681545",
"0.67841667",
"0.67506826",
"0.6735302",
"0.67126685",
"0.66913646",
"0.6681967",
"0.6681967",... | 0.618823 | 74 |
AppendCols(numCols=1) > bool Exactly the same as AppendRows() but for columns. | def AppendCols(self, numCols=1): # real signature unknown; restored from __doc__
return False | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_new_cols(cat, prefix=\"\", floatcols=None, boolcols=None):\n\t\n\tif floatcols != None:\n\t\tfor col in floatcols:\n\t\t\tcat.add_column(astropy.table.MaskedColumn(name=prefix+col, dtype=float, length=len(cat)))\n\t\t\tcat[prefix+col].mask = [True] * len(cat)\n\tif boolcols != None:\n\t\tfor col in boolcol... | [
"0.6017477",
"0.5631939",
"0.55924374",
"0.5548952",
"0.5529502",
"0.5455568",
"0.5444327",
"0.54101974",
"0.53786486",
"0.53754896",
"0.53557205",
"0.5345275",
"0.53391767",
"0.53190124",
"0.5316484",
"0.5307784",
"0.528852",
"0.5280459",
"0.5254802",
"0.525032",
"0.5224798"... | 0.89480335 | 7 |
AppendRows(numRows=1) > bool Append additional rows at the end of the table. | def AppendRows(self, numRows=1): # real signature unknown; restored from __doc__
return (self.GetNumberRows() + numRows) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def AppendRows(self, numRows = 1):\n for i in range(numRows):\n self.data = numpy.vstack((self.data,\n numpy.array([''] * self.data.shape[1], dtype = numpy.object),\n ))\n self.rowmask = numpy.append(self.rowmask, nu... | [
"0.82234913",
"0.7680864",
"0.7680864",
"0.67422974",
"0.66286564",
"0.65267634",
"0.65267634",
"0.65267634",
"0.65267634",
"0.65267634",
"0.65267634",
"0.65267634",
"0.65267634",
"0.65267634",
"0.62137854",
"0.60128397",
"0.60119236",
"0.5857733",
"0.5790014",
"0.5778878",
"... | 0.7819538 | 2 |
DeleteRows(pos=0, numRows=1) > bool Delete rows from the table. | def DeleteRows(self, pos=0, numRows=1): # real signature unknown; restored from __doc__
if self.data is None or len(self.data) == 0:
return False
for rowNum in range(0,numRows):
self.data.remove(self.data[numRows-1-pos-rowNum])
gridView=self.GetView()
gridView.Be... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def DeleteRows(self, pos=0, numRows=1): # real signature unknown; restored from __doc__\n if self.data is None or len(self.data) == 0:\n return False\n for rowNum in range(0, numRows):\n self.data.remove(self.data[numRows - 1 - pos - rowNum])\n gridView = self.GetView()\... | [
"0.8509247",
"0.8509247",
"0.7138309",
"0.6614276",
"0.6614276",
"0.6300265",
"0.6087969",
"0.59195846",
"0.59115934",
"0.5869983",
"0.58482474",
"0.57762325",
"0.57336473",
"0.570933",
"0.56701875",
"0.56412894",
"0.56196254",
"0.5617777",
"0.56165785",
"0.56080425",
"0.5603... | 0.85211456 | 1 |
Clear() Clear the table contents. | def Clear(self): # real signature unknown; restored from __doc__
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def clear(self):\n self.filled = 0\n self.used = 0\n self.table = []\n # Initialize the table to a clean slate of entries.\n for i in range(self.size):\n self.table.append(Entry())",
"def clear(self):\n\n self.size = 0\n\n self.table = [[]] * 100\n\n ... | [
"0.7549633",
"0.75100625",
"0.72180504",
"0.71167326",
"0.711315",
"0.7019527",
"0.6981833",
"0.6922991",
"0.6866691",
"0.68540704",
"0.6825538",
"0.681545",
"0.681545",
"0.681545",
"0.67841667",
"0.67506826",
"0.6735302",
"0.67126685",
"0.66913646",
"0.6681967",
"0.6681967",... | 0.618823 | 75 |
AppendCols(numCols=1) > bool Exactly the same as AppendRows() but for columns. | def AppendCols(self, numCols=1): # real signature unknown; restored from __doc__
return False | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_new_cols(cat, prefix=\"\", floatcols=None, boolcols=None):\n\t\n\tif floatcols != None:\n\t\tfor col in floatcols:\n\t\t\tcat.add_column(astropy.table.MaskedColumn(name=prefix+col, dtype=float, length=len(cat)))\n\t\t\tcat[prefix+col].mask = [True] * len(cat)\n\tif boolcols != None:\n\t\tfor col in boolcol... | [
"0.6017477",
"0.5631939",
"0.55924374",
"0.5548952",
"0.5529502",
"0.5455568",
"0.5444327",
"0.54101974",
"0.53786486",
"0.53754896",
"0.53557205",
"0.5345275",
"0.53391767",
"0.53190124",
"0.5316484",
"0.5307784",
"0.528852",
"0.5280459",
"0.5254802",
"0.525032",
"0.5224798"... | 0.89480335 | 2 |
AppendRows(numRows=1) > bool Append additional rows at the end of the table. | def AppendRows(self, numRows=1): # real signature unknown; restored from __doc__
return (self.GetNumberRows() + numRows) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def AppendRows(self, numRows = 1):\n for i in range(numRows):\n self.data = numpy.vstack((self.data,\n numpy.array([''] * self.data.shape[1], dtype = numpy.object),\n ))\n self.rowmask = numpy.append(self.rowmask, nu... | [
"0.82234913",
"0.7680864",
"0.7680864",
"0.67422974",
"0.66286564",
"0.65267634",
"0.65267634",
"0.65267634",
"0.65267634",
"0.65267634",
"0.65267634",
"0.65267634",
"0.65267634",
"0.65267634",
"0.62137854",
"0.60128397",
"0.60119236",
"0.5857733",
"0.5790014",
"0.5778878",
"... | 0.7819538 | 4 |
DeleteRows(pos=0, numRows=1) > bool Delete rows from the table. | def DeleteRows(self, pos=0, numRows=1): # real signature unknown; restored from __doc__
if self.data is None or len(self.data) == 0:
return False
for rowNum in range(0,numRows):
self.data.remove(self.data[numRows-1-pos-rowNum])
gridView=self.GetView()
gridView.Be... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def DeleteRows(self, pos=0, numRows=1): # real signature unknown; restored from __doc__\n if self.data is None or len(self.data) == 0:\n return False\n for rowNum in range(0, numRows):\n self.data.remove(self.data[numRows - 1 - pos - rowNum])\n gridView = self.GetView()\... | [
"0.8509247",
"0.8509247",
"0.7138309",
"0.6614276",
"0.6614276",
"0.6300265",
"0.6087969",
"0.59195846",
"0.59115934",
"0.5869983",
"0.58482474",
"0.57762325",
"0.57336473",
"0.570933",
"0.56701875",
"0.56412894",
"0.56196254",
"0.5617777",
"0.56165785",
"0.56080425",
"0.5603... | 0.85211456 | 3 |
Clear() Clear the table contents. | def Clear(self): # real signature unknown; restored from __doc__
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def clear(self):\n self.filled = 0\n self.used = 0\n self.table = []\n # Initialize the table to a clean slate of entries.\n for i in range(self.size):\n self.table.append(Entry())",
"def clear(self):\n\n self.size = 0\n\n self.table = [[]] * 100\n\n ... | [
"0.7549633",
"0.75100625",
"0.72180504",
"0.71167326",
"0.711315",
"0.7019527",
"0.6981833",
"0.6922991",
"0.6866691",
"0.68540704",
"0.6825538",
"0.681545",
"0.681545",
"0.681545",
"0.67841667",
"0.67506826",
"0.6735302",
"0.67126685",
"0.66913646",
"0.6681967",
"0.6681967",... | 0.618823 | 77 |
AppendCols(numCols=1) > bool Exactly the same as AppendRows() but for columns. | def AppendCols(self, numCols=1): # real signature unknown; restored from __doc__
return False | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_new_cols(cat, prefix=\"\", floatcols=None, boolcols=None):\n\t\n\tif floatcols != None:\n\t\tfor col in floatcols:\n\t\t\tcat.add_column(astropy.table.MaskedColumn(name=prefix+col, dtype=float, length=len(cat)))\n\t\t\tcat[prefix+col].mask = [True] * len(cat)\n\tif boolcols != None:\n\t\tfor col in boolcol... | [
"0.6017477",
"0.5631939",
"0.55924374",
"0.5548952",
"0.5529502",
"0.5455568",
"0.5444327",
"0.54101974",
"0.53786486",
"0.53754896",
"0.53557205",
"0.5345275",
"0.53391767",
"0.53190124",
"0.5316484",
"0.5307784",
"0.528852",
"0.5280459",
"0.5254802",
"0.525032",
"0.5224798"... | 0.89480335 | 0 |
AppendRows(numRows=1) > bool Append additional rows at the end of the table. | def AppendRows(self, numRows=1): # real signature unknown; restored from __doc__
return (self.GetNumberRows() + numRows) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def AppendRows(self, numRows = 1):\n for i in range(numRows):\n self.data = numpy.vstack((self.data,\n numpy.array([''] * self.data.shape[1], dtype = numpy.object),\n ))\n self.rowmask = numpy.append(self.rowmask, nu... | [
"0.82234913",
"0.7819538",
"0.7819538",
"0.7819538",
"0.7819538",
"0.7819538",
"0.7819538",
"0.7819538",
"0.67422974",
"0.66286564",
"0.65267634",
"0.65267634",
"0.65267634",
"0.65267634",
"0.65267634",
"0.65267634",
"0.65267634",
"0.65267634",
"0.65267634",
"0.62137854",
"0.... | 0.7680864 | 8 |
DeleteRows(pos=0, numRows=1) > bool Delete rows from the table. | def DeleteRows(self, pos=0, numRows=1): # real signature unknown; restored from __doc__
if self.data is None or len(self.data) == 0:
return False
for rowNum in range(0, numRows):
self.data.remove(self.data[numRows - 1 - pos - rowNum])
gridView = self.GetView()
gr... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def DeleteRows(self, pos=0, numRows=1): # real signature unknown; restored from __doc__\n if self.data is None or len(self.data) == 0:\n return False\n for rowNum in range(0,numRows):\n self.data.remove(self.data[numRows-1-pos-rowNum])\n gridView=self.GetView()\n ... | [
"0.85211456",
"0.85211456",
"0.85211456",
"0.85211456",
"0.85211456",
"0.85211456",
"0.85211456",
"0.7138309",
"0.6614276",
"0.6614276",
"0.6300265",
"0.6087969",
"0.59195846",
"0.59115934",
"0.5869983",
"0.58482474",
"0.57762325",
"0.57336473",
"0.570933",
"0.56701875",
"0.5... | 0.8509247 | 7 |
Clear() Clear the table contents. | def Clear(self): # real signature unknown; restored from __doc__
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def clear(self):\n self.filled = 0\n self.used = 0\n self.table = []\n # Initialize the table to a clean slate of entries.\n for i in range(self.size):\n self.table.append(Entry())",
"def clear(self):\n\n self.size = 0\n\n self.table = [[]] * 100\n\n ... | [
"0.7549633",
"0.75100625",
"0.72180504",
"0.71167326",
"0.711315",
"0.7019527",
"0.6981833",
"0.6922991",
"0.6866691",
"0.68540704",
"0.6825538",
"0.681545",
"0.681545",
"0.681545",
"0.67841667",
"0.67506826",
"0.6735302",
"0.67126685",
"0.66913646",
"0.6681967",
"0.6681967",... | 0.618823 | 76 |
AppendCols(numCols=1) > bool Exactly the same as AppendRows() but for columns. | def AppendCols(self, numCols=1): # real signature unknown; restored from __doc__
return False | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_new_cols(cat, prefix=\"\", floatcols=None, boolcols=None):\n\t\n\tif floatcols != None:\n\t\tfor col in floatcols:\n\t\t\tcat.add_column(astropy.table.MaskedColumn(name=prefix+col, dtype=float, length=len(cat)))\n\t\t\tcat[prefix+col].mask = [True] * len(cat)\n\tif boolcols != None:\n\t\tfor col in boolcol... | [
"0.6017477",
"0.5631939",
"0.55924374",
"0.5548952",
"0.5529502",
"0.5455568",
"0.5444327",
"0.54101974",
"0.53786486",
"0.53754896",
"0.53557205",
"0.5345275",
"0.53391767",
"0.53190124",
"0.5316484",
"0.5307784",
"0.528852",
"0.5280459",
"0.5254802",
"0.525032",
"0.5224798"... | 0.89480335 | 1 |
AppendRows(numRows=1) > bool Append additional rows at the end of the table. | def AppendRows(self, numRows=1): # real signature unknown; restored from __doc__
return (self.GetNumberRows() + numRows) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def AppendRows(self, numRows = 1):\n for i in range(numRows):\n self.data = numpy.vstack((self.data,\n numpy.array([''] * self.data.shape[1], dtype = numpy.object),\n ))\n self.rowmask = numpy.append(self.rowmask, nu... | [
"0.82234913",
"0.7819538",
"0.7819538",
"0.7819538",
"0.7819538",
"0.7819538",
"0.7819538",
"0.7819538",
"0.67422974",
"0.66286564",
"0.65267634",
"0.65267634",
"0.65267634",
"0.65267634",
"0.65267634",
"0.65267634",
"0.65267634",
"0.65267634",
"0.65267634",
"0.62137854",
"0.... | 0.7680864 | 9 |
DeleteRows(pos=0, numRows=1) > bool Delete rows from the table. | def DeleteRows(self, pos=0, numRows=1): # real signature unknown; restored from __doc__
if self.data is None or len(self.data) == 0:
return False
for rowNum in range(0, numRows):
self.data.remove(self.data[numRows - 1 - pos - rowNum])
gridView = self.GetView()
gr... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def DeleteRows(self, pos=0, numRows=1): # real signature unknown; restored from __doc__\n if self.data is None or len(self.data) == 0:\n return False\n for rowNum in range(0,numRows):\n self.data.remove(self.data[numRows-1-pos-rowNum])\n gridView=self.GetView()\n ... | [
"0.85211456",
"0.85211456",
"0.85211456",
"0.85211456",
"0.85211456",
"0.85211456",
"0.85211456",
"0.7138309",
"0.6614276",
"0.6614276",
"0.6300265",
"0.6087969",
"0.59195846",
"0.59115934",
"0.5869983",
"0.58482474",
"0.57762325",
"0.57336473",
"0.570933",
"0.56701875",
"0.5... | 0.8509247 | 8 |
Clear() Clear the table contents. | def Clear(self): # real signature unknown; restored from __doc__
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def clear(self):\n self.filled = 0\n self.used = 0\n self.table = []\n # Initialize the table to a clean slate of entries.\n for i in range(self.size):\n self.table.append(Entry())",
"def clear(self):\n\n self.size = 0\n\n self.table = [[]] * 100\n\n ... | [
"0.7549633",
"0.75100625",
"0.72180504",
"0.71167326",
"0.711315",
"0.7019527",
"0.6981833",
"0.6922991",
"0.6866691",
"0.68540704",
"0.6825538",
"0.681545",
"0.681545",
"0.681545",
"0.67841667",
"0.67506826",
"0.6735302",
"0.67126685",
"0.66913646",
"0.6681967",
"0.6681967",... | 0.618823 | 71 |
Get distribution for atoms. | def dist(self, x: torch.Tensor) -> torch.Tensor:
feature = self.feature_layer(x)
adv_hid = F.relu(self.advantage_hidden_layer(feature))
val_hid = F.relu(self.value_hidden_layer(feature))
advantage = self.advantage_layer(adv_hid).view(
-1, self.out_dim, self.atom_size... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def distribution(self) -> str:\n return pulumi.get(self, \"distribution\")",
"def get_distribution(self):\n return self._delegate.flush_distributions()",
"def get_charges(self, atoms):\n if 'charges' in self.results:\n return self.results['charges']\n else:\n r... | [
"0.615955",
"0.5907516",
"0.5904322",
"0.5819944",
"0.5723501",
"0.56171274",
"0.56018674",
"0.55872816",
"0.5546412",
"0.5522907",
"0.55175775",
"0.5508406",
"0.5492414",
"0.54577863",
"0.545719",
"0.5409746",
"0.5408357",
"0.5339537",
"0.5333",
"0.5325411",
"0.5311833",
"... | 0.0 | -1 |
Reset all noisy layers. | def reset_noise(self):
self.advantage_hidden_layer.reset_noise()
self.advantage_layer.reset_noise()
self.value_hidden_layer.reset_noise()
self.value_layer.reset_noise() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def reset(self):\n for layer in self.network:\n layer.clean()",
"def reset_layers(self, rov_id): # Clear hidden layers and output layers\n for i in range(self.n_nodes):\n self.hid_layer[rov_id, i] = 0.0\n\n for j in range(self.n_outputs):\n self.out_layer[ro... | [
"0.75135684",
"0.7388977",
"0.7320769",
"0.7070128",
"0.6976212",
"0.69198513",
"0.69061995",
"0.6805137",
"0.67520696",
"0.67174494",
"0.6668943",
"0.6648948",
"0.6637794",
"0.66241336",
"0.6584105",
"0.65818655",
"0.6574278",
"0.65249395",
"0.6519634",
"0.6511302",
"0.64818... | 0.8044907 | 0 |
Select an action from the input state. | def select_action(self, state: np.ndarray) -> np.ndarray:
# NoisyNet: no epsilon greedy action selection
temp_trans = [state]
state = torch.from_numpy(state).permute(2,0,1).unsqueeze(0)
selected_action = self.dqn(
torch.FloatTensor(state).to(self.device)
).argmax()
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def select_action(self, state):\n pass",
"def select_action(self, state):",
"def select_action(self, state):\n\t\treturn sample(range(0, self.action_space), 1)[0]",
"def choose_action(self, state, task=0):\n pass",
"def select_action(self):\n pass",
"def choose_action(self, game_stat... | [
"0.8670985",
"0.86409193",
"0.7746169",
"0.7685539",
"0.76761585",
"0.73878974",
"0.7374204",
"0.7175134",
"0.7159217",
"0.713064",
"0.7084519",
"0.7076152",
"0.69289273",
"0.6924434",
"0.6923039",
"0.6903199",
"0.6901642",
"0.68614924",
"0.6836678",
"0.68114316",
"0.6759053"... | 0.6696064 | 23 |
Take an action and return the response of the env. | def step(self, action: np.ndarray) -> Tuple[np.ndarray, np.float64, bool]:
next_state, reward, done, _ = self.env.step(action, resize=RESIZE, size = RESIZE_SIZE)
if not self.is_test:
self.transition += [reward, next_state, done]
# N-step transition
if se... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def takeAction(self, action):\n return self.env.step(action)",
"def step(self, action: ActionType) -> EnvResponse:\n action = self.action_space.clip_action_to_space(action)\n if self.action_space and not self.action_space.contains(action):\n raise ValueError(\"The given action doe... | [
"0.68610305",
"0.67101586",
"0.6494135",
"0.6454092",
"0.64038503",
"0.62968796",
"0.62087953",
"0.61535114",
"0.60504663",
"0.60347867",
"0.60093635",
"0.59869534",
"0.59604603",
"0.58899033",
"0.5886913",
"0.58514017",
"0.5849669",
"0.5849669",
"0.5844914",
"0.58401686",
"0... | 0.0 | -1 |
Update the model by gradient descent. | def update_model(self) -> torch.Tensor:
# PER needs beta to calculate weights
samples = self.memory.sample_batch(self.beta)
weights = torch.FloatTensor(
samples["weights"].reshape(-1, 1)
).to(self.device)
indices = samples["indices"]
# 1-step Learning... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _apply_gradient_descent(self, gradients):\n updated_sd = {}\n global_model = self._get_global_model()\n \n for name, param, grad in zip(global_model.keys(), global_model.values(), gradients):\n updated_sd[name] = param - self.global_lr * grad\n \n self._load... | [
"0.7587868",
"0.7201901",
"0.7072588",
"0.699131",
"0.6976535",
"0.69135207",
"0.68924814",
"0.68924814",
"0.6867019",
"0.6842787",
"0.6816539",
"0.6804453",
"0.67830783",
"0.67229676",
"0.6706951",
"0.66168296",
"0.66132414",
"0.66085064",
"0.6607951",
"0.6593324",
"0.658446... | 0.6464194 | 30 |
Return categorical dqn loss. | def _compute_dqn_loss(self, samples: Dict[str, np.ndarray], gamma: float) -> torch.Tensor:
device = self.device # for shortening the following lines
state = torch.FloatTensor(samples["obs"]).permute(0,3,1,2).to(device)
next_state = torch.FloatTensor(samples["next_obs"]).permute(0,3,1,2).to(devi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_loss(self):\n return categorical_cross_entropy.get_loss(loss_key=self.loss_key,\n output_name=self.args.output_name)",
"def loss_function(self, probs, labels):\n return tf.keras.losses.sparse_categorical_crossentropy(labels, probs)",
"def c... | [
"0.68605304",
"0.67149806",
"0.6686219",
"0.6592555",
"0.64848787",
"0.6320027",
"0.6248912",
"0.6234563",
"0.62179315",
"0.62094903",
"0.6202983",
"0.6202983",
"0.6185646",
"0.6164023",
"0.6157712",
"0.61265653",
"0.61004794",
"0.6093955",
"0.6060213",
"0.6043495",
"0.602176... | 0.0 | -1 |
Plot the training progresses. | def _plot(
self,
frame_idx: int,
scores: List[float],
losses: List[float],
):
clear_output(True)
plt.figure(figsize=(20, 5))
plt.subplot(131)
plt.title('frame %s. score: %s' % (frame_idx, np.mean(scores[-10:])))
plt.plot(scores)
plt.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def plot_training_progress(self):\n if self.score_record:\n plt.plot(self.score_record)\n plt.ylabel('Average score')\n plt.xlabel('Episode')\n plt.title('Average score for last 100 episodes in the training phase')\n else:\n print('No progress ma... | [
"0.75751024",
"0.74703175",
"0.73605293",
"0.71286047",
"0.70991313",
"0.6868523",
"0.68126166",
"0.6764339",
"0.675527",
"0.6670798",
"0.66644514",
"0.66370517",
"0.66220623",
"0.6587453",
"0.65738714",
"0.65317184",
"0.6487824",
"0.64450705",
"0.6429721",
"0.6408675",
"0.64... | 0.0 | -1 |
Given an undefined output folder path, we return the blank string | def test_make_output_folder_undefined_path(self):
test_object = Maic()
expected_result = ""
self.assertEqual(expected_result,
test_object.make_output_folder(output_folder=None),
"Should get back an empty string for an undefined "
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_make_output_folder_blank_path(self):\n test_object = Maic()\n expected_result = \"\"\n self.assertEqual(expected_result,\n test_object.make_output_folder(output_folder=\"\"),\n \"Should get back an empty string for an output \"\n ... | [
"0.76985216",
"0.70029175",
"0.69376665",
"0.6890628",
"0.68563265",
"0.6776184",
"0.6774517",
"0.6737329",
"0.6688305",
"0.6654316",
"0.66089475",
"0.6563189",
"0.6542934",
"0.6504976",
"0.64609385",
"0.63817656",
"0.6361122",
"0.6351268",
"0.63438004",
"0.63324255",
"0.6330... | 0.78773004 | 0 |
Given an empty output folder path, we return the blank string | def test_make_output_folder_blank_path(self):
test_object = Maic()
expected_result = ""
self.assertEqual(expected_result,
test_object.make_output_folder(output_folder=""),
"Should get back an empty string for an output "
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_make_output_folder_undefined_path(self):\n test_object = Maic()\n expected_result = \"\"\n self.assertEqual(expected_result,\n test_object.make_output_folder(output_folder=None),\n \"Should get back an empty string for an undefined \"\n ... | [
"0.7781955",
"0.6907767",
"0.66690165",
"0.6645506",
"0.6641241",
"0.66131055",
"0.65263367",
"0.63996685",
"0.6386103",
"0.6343422",
"0.6288943",
"0.62462056",
"0.6244957",
"0.61959714",
"0.6165891",
"0.61632746",
"0.6150932",
"0.61507374",
"0.60942763",
"0.6087422",
"0.6048... | 0.78897774 | 0 |
Given an output folder path of '.', we return the string './' | def test_make_output_folder_dot_path(self):
test_object = Maic()
expected_result = ".{}".format(os.sep)
self.assertEqual(expected_result,
test_object.make_output_folder(output_folder='.'),
"Should get back '{}' for an output folder "
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_output_path():\n return os.getcwd() + \"/output/\"",
"def output_path():\n folder = path.join(path.curdir, \"stages\")\n folder = path.abspath(folder)\n return ensure_path(folder)",
"def outpath(*path_components):\n basedir = os.path.join(\"..\", \"script-output\")\n return os.path.jo... | [
"0.76824987",
"0.76392555",
"0.73582447",
"0.72457474",
"0.7192313",
"0.7108729",
"0.70778614",
"0.7021433",
"0.69653285",
"0.69561756",
"0.69506764",
"0.6881675",
"0.6873361",
"0.68301535",
"0.6797586",
"0.6790728",
"0.67816705",
"0.6772952",
"0.6752346",
"0.6750241",
"0.674... | 0.69831115 | 8 |
Given a simple folder path, check that the code tries to make the folder and returns the path with a single trailing '/' appended only if required | def test_make_output_folder_simple_path(self, mock_makedirs):
mock_makedirs.return_value = True
test_object = Maic()
path = 'simple_path'
expected_result = '{path}{sep}'.format(path=path, sep=os.sep)
self.assertTrue(mock_makedirs.called_once_with(path))
self.assertEqual(e... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def format_folder_path(folder_path):\n if folder_path[-1] != '/':\n folder_path += '/'\n\n return folder_path",
"def make_dir_if_need(path):\n folder, filename, ext = split_path(path)\n if len(folder) > 0 and not os.path.exists(folder):\n try:\n os.makedirs(folder)\n e... | [
"0.76303756",
"0.7284018",
"0.7247778",
"0.6970601",
"0.6945575",
"0.6933",
"0.69271815",
"0.6888704",
"0.6886399",
"0.68816555",
"0.6851783",
"0.6796874",
"0.6796152",
"0.67820495",
"0.67656267",
"0.6765505",
"0.676332",
"0.6756368",
"0.67500246",
"0.67435205",
"0.67259693",... | 0.66658 | 25 |
Given a simple folder path, check that the code tries to make the folder and returns the path with a single trailing '/' appended only if required | def test_make_output_folder_simple_path_with_slash(self, mock_makedirs):
mock_makedirs.return_value = True
test_object = Maic()
path = 'simple_path/'
expected_result = path
self.assertEqual(expected_result,
test_object.make_output_folder(output_folder=pat... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def format_folder_path(folder_path):\n if folder_path[-1] != '/':\n folder_path += '/'\n\n return folder_path",
"def make_dir_if_need(path):\n folder, filename, ext = split_path(path)\n if len(folder) > 0 and not os.path.exists(folder):\n try:\n os.makedirs(folder)\n e... | [
"0.76315606",
"0.7284312",
"0.7246413",
"0.6969763",
"0.6945429",
"0.6933574",
"0.6927266",
"0.68890077",
"0.6887682",
"0.68805903",
"0.6852056",
"0.6798625",
"0.67966497",
"0.6783266",
"0.67655706",
"0.6765118",
"0.6763681",
"0.67570025",
"0.67500335",
"0.6727289",
"0.671890... | 0.67434174 | 19 |
Given a complex folder path with multiple embedded slashes, check that the code tries to make the folder and returns the path with a single trailing '/' appended only if required | def test_make_output_folder_path_with_multi_slashes(self, mock_makedirs):
mock_makedirs.return_value = True
test_object = Maic()
path = '/c/o/m/p/l/e/x_p/a/t/h/'
expected_result = path
self.assertEqual(expected_result,
test_object.make_output_folder(outpu... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def format_folder_path(folder_path):\n if folder_path[-1] != '/':\n folder_path += '/'\n\n return folder_path",
"def test_fix_path(self):\n\n expected = \"hello\" + PyFunceble.directory_separator + \"world\" + PyFunceble.directory_separator # pylint: disable=line-too-long\n actual = D... | [
"0.7249269",
"0.6797798",
"0.6691372",
"0.6648862",
"0.6491748",
"0.6453401",
"0.6421338",
"0.63004524",
"0.62997335",
"0.6285595",
"0.62594306",
"0.6247562",
"0.62401736",
"0.62397146",
"0.6239207",
"0.6219014",
"0.62041944",
"0.61918926",
"0.6191478",
"0.61791414",
"0.61717... | 0.6893744 | 1 |
Check that an output folder path that exists but does not end with something that looks like a timestamp gets a timestamp added | def test_make_output_folder_exists_no_timestamp(self, mock_makedirs,
mock_logger):
mock_makedirs.side_effect = [OSError, True]
test_object = Maic()
path = "my_path"
sep = os.sep
if os.sep == '\\':
# we've got a backs... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_make_output_folder_exists_with_timestamp_fails(self,\n mock_makedirs):\n mock_makedirs.side_effect = [OSError]\n test_object = Maic()\n path = \"my_path-1960-04-04--15-00\"\n try:\n test_object.make_output_fo... | [
"0.65769327",
"0.6254106",
"0.62120444",
"0.61580235",
"0.60756755",
"0.602552",
"0.60144717",
"0.6014027",
"0.6002626",
"0.59853584",
"0.5975292",
"0.5899892",
"0.58989424",
"0.5844146",
"0.5834909",
"0.5810283",
"0.5796441",
"0.5729634",
"0.5713246",
"0.57086563",
"0.567258... | 0.6856277 | 0 |
Check that an output folder path that exists and does end with something that looks like a timestamp raises an exception | def test_make_output_folder_exists_with_timestamp_fails(self,
mock_makedirs):
mock_makedirs.side_effect = [OSError]
test_object = Maic()
path = "my_path-1960-04-04--15-00"
try:
test_object.make_output_folder(output_f... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_make_output_folder_exists_no_timestamp(self, mock_makedirs,\n mock_logger):\n mock_makedirs.side_effect = [OSError, True]\n test_object = Maic()\n path = \"my_path\"\n sep = os.sep\n if os.sep == '\\\\':\n # w... | [
"0.66987944",
"0.63590485",
"0.6132183",
"0.60929406",
"0.604455",
"0.6034466",
"0.60191363",
"0.60158616",
"0.59803444",
"0.59565026",
"0.59523237",
"0.5931433",
"0.5840402",
"0.57827204",
"0.5757492",
"0.5711939",
"0.5690312",
"0.5685456",
"0.5668919",
"0.566759",
"0.565680... | 0.68613607 | 0 |
Function to remove the line numbers from the debug output of gyp and thus reduce the extreme fragility of the stdout comparison tests. | def remove_debug_line_numbers(contents):
lines = contents.splitlines()
# split each line on ":"
lines = [l.split(":", 3) for l in lines]
# join each line back together while ignoring the
# 3rd column which is the line number
lines = [len(l) > 3 and ":".join(l[3:]) or l for l in lines]
return "\n".join(lin... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def remove_curl_debug_lines(text: str) -> str:\n lines = text.split(\"\\n\")\n lines = [line for line in lines if not line.startswith(\"**\")]\n return \"\\n\".join(lines)",
"def lines_without_stdlib(self):\n prev_line = None\n current_module_path = inspect.getabsfile(inspect.currentframe(... | [
"0.6622459",
"0.59901255",
"0.59256816",
"0.58421296",
"0.581115",
"0.57030994",
"0.5660609",
"0.55992305",
"0.55508304",
"0.5550596",
"0.552097",
"0.55145377",
"0.54679954",
"0.5458479",
"0.5454181",
"0.54463637",
"0.54463637",
"0.53545886",
"0.53511184",
"0.5350658",
"0.534... | 0.7173805 | 0 |
File contents matcher that ignores line numbers. | def match_modulo_line_numbers(contents_a, contents_b):
contents_a = remove_debug_line_numbers(contents_a)
contents_b = remove_debug_line_numbers(contents_b)
return TestCommon.match_exact(contents_a, contents_b) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_line_count(self):\n self.assertEqual(analyze_text(self.filename)[0], 11)",
"def test_line_count(self):\n self.assertEqual(analyze_text(self.filename)[0], 4)",
"def test_line_count(self):\n self.assertEqual(analyze_text(self.filename)[0], 4)",
"def _MatchPatternLines(self, in_str... | [
"0.6075021",
"0.6011866",
"0.6011866",
"0.5980236",
"0.58842176",
"0.5875963",
"0.5659142",
"0.5647999",
"0.5642151",
"0.5629507",
"0.5616189",
"0.560516",
"0.55971444",
"0.55460477",
"0.5533876",
"0.55265915",
"0.5506669",
"0.5466076",
"0.54504406",
"0.54157746",
"0.5407447"... | 0.6234986 | 0 |
Context manager to provide a local OS environment. | def LocalEnv(local_env):
old_env = os.environ.copy()
os.environ.update(local_env)
try:
yield
finally:
os.environ.clear()
os.environ.update(old_env) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __MakeEnvironment(self):\n environment= os.environ.copy()\n\n for key, value in self.__context.items():\n if type(value) is str:\n name = \"QMV_\" + key.replace(\".\", \"__\")\n environment[name]= value\n\n return environment",
"def getEnvironment(self):\n pass",
"def con... | [
"0.67875075",
"0.6686934",
"0.6515697",
"0.63122493",
"0.62584555",
"0.6247671",
"0.6247671",
"0.624513",
"0.6243068",
"0.6239697",
"0.61648566",
"0.61648566",
"0.61096555",
"0.6074418",
"0.60684866",
"0.6040943",
"0.6029951",
"0.5992928",
"0.598052",
"0.5979621",
"0.59462166... | 0.6103447 | 13 |
Fails the test if the specified built file name does not exist. | def built_file_must_exist(self, name, type=None, **kw):
return self.must_exist(self.built_file_path(name, type, **kw)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def built_file_must_not_exist(self, name, type=None, **kw):\n return self.must_not_exist(self.built_file_path(name, type, **kw))",
"def check_build_exists(self):\n path = self.base_dir + \"/\" + self.app_name + \"/\" + \"build\"\n from django_swagger_utils.core.utils.check_path_exists import che... | [
"0.7556298",
"0.68302405",
"0.6742456",
"0.6706596",
"0.66908234",
"0.65641314",
"0.651123",
"0.6510022",
"0.6502727",
"0.64891094",
"0.64801955",
"0.64408535",
"0.6430225",
"0.6354745",
"0.6318534",
"0.6268824",
"0.62088376",
"0.6206341",
"0.6198592",
"0.61985487",
"0.617418... | 0.7726593 | 0 |
Fails the test if the specified built file name exists. | def built_file_must_not_exist(self, name, type=None, **kw):
return self.must_not_exist(self.built_file_path(name, type, **kw)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def built_file_must_exist(self, name, type=None, **kw):\n return self.must_exist(self.built_file_path(name, type, **kw))",
"def check_build_exists(self):\n path = self.base_dir + \"/\" + self.app_name + \"/\" + \"build\"\n from django_swagger_utils.core.utils.check_path_exists import check_path_... | [
"0.7764489",
"0.6900003",
"0.6773992",
"0.67330974",
"0.67238265",
"0.6665234",
"0.6645847",
"0.6642983",
"0.6570576",
"0.65533084",
"0.65091807",
"0.6487374",
"0.6403167",
"0.6386307",
"0.63263017",
"0.632228",
"0.62877107",
"0.6276694",
"0.62678105",
"0.6252823",
"0.6243601... | 0.75279915 | 1 |
Fails the test if the contents of the specified built file name do not match the specified contents. | def built_file_must_match(self, name, contents, **kw):
return self.must_match(self.built_file_path(name, **kw), contents) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def built_file_must_not_match(self, name, contents, **kw):\n return self.must_not_match(self.built_file_path(name, **kw), contents)",
"def built_file_must_not_contain(self, name, contents, **kw):\n return self.must_not_contain(self.built_file_path(name, **kw), contents)",
"def test_buildings_file_path(se... | [
"0.7865123",
"0.725757",
"0.6427956",
"0.6343546",
"0.61661303",
"0.6108487",
"0.6048125",
"0.6037537",
"0.60135037",
"0.59942937",
"0.5991819",
"0.59909046",
"0.5990231",
"0.5943843",
"0.5930705",
"0.5888282",
"0.5878586",
"0.58620876",
"0.5855489",
"0.5848895",
"0.58476365"... | 0.8206071 | 0 |
Fails the test if the contents of the specified built file name match the specified contents. | def built_file_must_not_match(self, name, contents, **kw):
return self.must_not_match(self.built_file_path(name, **kw), contents) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def built_file_must_match(self, name, contents, **kw):\n return self.must_match(self.built_file_path(name, **kw), contents)",
"def built_file_must_not_contain(self, name, contents, **kw):\n return self.must_not_contain(self.built_file_path(name, **kw), contents)",
"def built_file_must_exist(self, name, t... | [
"0.85351104",
"0.7359012",
"0.62920475",
"0.6136921",
"0.60466075",
"0.60382736",
"0.59580076",
"0.59560263",
"0.5939516",
"0.58847064",
"0.5883172",
"0.58079237",
"0.57745993",
"0.57733077",
"0.57392937",
"0.5728668",
"0.5728633",
"0.56980926",
"0.5695948",
"0.56950855",
"0.... | 0.79406774 | 1 |
Fails the test if the specified built file name contains the specified contents. | def built_file_must_not_contain(self, name, contents, **kw):
return self.must_not_contain(self.built_file_path(name, **kw), contents) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def built_file_must_match(self, name, contents, **kw):\n return self.must_match(self.built_file_path(name, **kw), contents)",
"def built_file_must_not_match(self, name, contents, **kw):\n return self.must_not_match(self.built_file_path(name, **kw), contents)",
"def built_file_must_exist(self, name, type=... | [
"0.81918883",
"0.8010083",
"0.6774321",
"0.6476558",
"0.62609273",
"0.6162972",
"0.61458814",
"0.60644317",
"0.60438615",
"0.59909314",
"0.587492",
"0.5853323",
"0.58421844",
"0.581482",
"0.5771519",
"0.5765038",
"0.5718235",
"0.5689747",
"0.56869435",
"0.56699526",
"0.566883... | 0.7965282 | 2 |
Copies the test configuration from the specified source_dir (the directory in which the test script lives) to the specified dest_dir (a temporary working directory). This ignores all files and directories that begin with the string 'gyptest', and all '.svn' subdirectories. | def copy_test_configuration(self, source_dir, dest_dir):
for root, dirs, files in os.walk(source_dir):
if '.svn' in dirs:
dirs.remove('.svn')
dirs = [ d for d in dirs if not d.startswith('gyptest') ]
files = [ f for f in files if not f.startswith('gyptest') ]
for dirname in dirs:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def copy_dir(source, dest, vars, verbosity=1, simulate=False, indent=0,\n sub_vars=True, interactive=False, overwrite=True,\n template_renderer=None, out_=sys.stdout):\n def out(msg):\n out_.write(msg)\n out_.write('\\n')\n out_.flush()\n # This allows you to ... | [
"0.5968082",
"0.5623668",
"0.55685383",
"0.5543154",
"0.54757017",
"0.53514683",
"0.5298348",
"0.5297488",
"0.5291825",
"0.5271045",
"0.5267549",
"0.52317536",
"0.51011693",
"0.5092042",
"0.5072532",
"0.5053451",
"0.50515586",
"0.5050869",
"0.50469726",
"0.5045372",
"0.501263... | 0.86488324 | 0 |
Initializes the .build_tool attribute. Searches the .build_tool_list for an executable name on the user's $PATH. The first tool on the list is used asis if nothing is found on the current $PATH. | def initialize_build_tool(self):
for build_tool in self.build_tool_list:
if not build_tool:
continue
if os.path.isabs(build_tool):
self.build_tool = build_tool
return
build_tool = self.where_is(build_tool)
if build_tool:
self.build_tool = build_tool
re... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def parse_tool_path(self):",
"def __find_tool_path(self):\n tool_path = Path(os.path.dirname(os.path.realpath(__file__)))\n # We asume the installion path is relative to our installation path\n tool_path = tool_path / '../../../bin'\n if os.name == 'posix':\n ret = tool_pat... | [
"0.6117797",
"0.59801966",
"0.57670516",
"0.5763969",
"0.57467836",
"0.5693948",
"0.5670825",
"0.5632699",
"0.55697215",
"0.5522049",
"0.5520909",
"0.5454913",
"0.5439451",
"0.54242945",
"0.54215056",
"0.5409395",
"0.5408753",
"0.5398145",
"0.53854394",
"0.53382486",
"0.53367... | 0.84088266 | 0 |
Renames (relocates) the specified source (usually a directory) to the specified destination, creating the destination directory first if necessary. | def relocate(self, source, destination):
destination_dir = os.path.dirname(destination)
if not os.path.exists(destination_dir):
self.subdir(destination_dir)
os.rename(source, destination) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def os_rename(self, source, destination):\n cmd = ['/bin/mv', source, destination]\n process = subprocess.Popen(cmd, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)\n returncode = subprocess.Popen.wait(process)\n return returncode",
"def hmove(src_path, res_path):\n os.rename... | [
"0.7349947",
"0.68736243",
"0.6767133",
"0.6640591",
"0.65091836",
"0.6415128",
"0.6383818",
"0.63748705",
"0.6370775",
"0.63415533",
"0.6336806",
"0.63208145",
"0.63091844",
"0.62984276",
"0.61878335",
"0.6184522",
"0.6032903",
"0.60203373",
"0.6016925",
"0.59881675",
"0.598... | 0.83426297 | 0 |
Reports that a build is not uptodate. This provides common reporting for formats that have complicated conditions for checking whether a build is uptodate. Formats that expect exact output from the command (make) can just set stdout= when they call the run_build() method. | def report_not_up_to_date(self):
print "Build is not up-to-date:"
print self.banner('STDOUT ')
print self.stdout()
stderr = self.stderr()
if stderr:
print self.banner('STDERR ')
print stderr | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _check_build_log(mysettings, out=None):\n\tlogfile = mysettings.get(\"PORTAGE_LOG_FILE\")\n\tif logfile is None:\n\t\treturn\n\ttry:\n\t\tf = open(_unicode_encode(logfile, encoding=_encodings['fs'],\n\t\t\terrors='strict'), mode='rb')\n\texcept EnvironmentError:\n\t\treturn\n\n\tf_real = None\n\tif logfile.end... | [
"0.6245686",
"0.61322933",
"0.5972909",
"0.5953914",
"0.5951226",
"0.5934385",
"0.56919557",
"0.55922455",
"0.5552093",
"0.54457146",
"0.54384977",
"0.5403101",
"0.53969556",
"0.5394229",
"0.5389238",
"0.5372847",
"0.53642845",
"0.5359401",
"0.5345811",
"0.5342945",
"0.533501... | 0.7970113 | 0 |
Runs gyp against the specified gyp_file with the specified args. | def run_gyp(self, gyp_file, *args, **kw):
# When running gyp, and comparing its output we use a comparitor
# that ignores the line numbers that gyp logs in its debug output.
if kw.pop('ignore_line_numbers', False):
kw.setdefault('match', match_modulo_line_numbers)
# TODO: --depth=. works around... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def TestGyp(*args, **kw):\n format = kw.pop('format', os.environ.get('TESTGYP_FORMAT'))\n if format != 'ninja':\n raise Exception(\"unknown format %r\" % format)\n return TestGypNinja(*args, **kw)",
"def build(self, gyp_file, target=None, **kw):\n raise NotImplementedError",
"def run_python_file(pytho... | [
"0.65655947",
"0.64958555",
"0.5667241",
"0.56293947",
"0.56070536",
"0.54797554",
"0.5434344",
"0.5331075",
"0.52507114",
"0.5226264",
"0.5204586",
"0.51571316",
"0.5147136",
"0.5133636",
"0.51022816",
"0.5073251",
"0.5073251",
"0.5066566",
"0.50257397",
"0.5001088",
"0.4970... | 0.673332 | 0 |
Executes a program by calling the superclass .run() method. This exists to provide a common place to filter out keyword arguments implemented in this layer, without having to update the toolspecific subclasses or clutter the tests themselves with platformspecific code. | def run(self, *args, **kw):
if kw.has_key('SYMROOT'):
del kw['SYMROOT']
super(TestGypBase, self).run(*args, **kw) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def main(cls, *args, **kwargs):\n assert not (bool(args) and bool(kwargs))\n if args:\n return cls._run_args(args)\n elif kwargs:\n return cls._run_kwargs(kwargs)\n else:\n return cls._run_args(None)",
"def run(self, args, **kwargs):\n raise Not... | [
"0.7026818",
"0.61980593",
"0.61843985",
"0.6099029",
"0.6099029",
"0.6087825",
"0.5988514",
"0.5976652",
"0.5927388",
"0.5923556",
"0.59165424",
"0.591313",
"0.59046715",
"0.58940053",
"0.58940053",
"0.58940053",
"0.58940053",
"0.58940053",
"0.58940053",
"0.58940053",
"0.589... | 0.55605435 | 53 |
Sets the configuration, to be used for invoking the build tool and testing potential built output. | def set_configuration(self, configuration):
self.configuration = configuration | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setConfiguration(self, config):\n raise NotImplementedError",
"def configure(self):\n pass",
"def configure(self):\n pass",
"def configure(self):\n\n pass",
"def configure(self):\r\n pass",
"def _configure(self):\n test_lib.test_config.setdefault('config_file... | [
"0.69929606",
"0.6917431",
"0.6917431",
"0.6913874",
"0.68464535",
"0.67752916",
"0.67648584",
"0.6723741",
"0.67059726",
"0.6701403",
"0.6684196",
"0.66793007",
"0.66417325",
"0.66096956",
"0.66000444",
"0.6597655",
"0.65903854",
"0.6584477",
"0.6580933",
"0.656267",
"0.6557... | 0.68520176 | 4 |
Runs a build of the specified target against the configuration generated from the specified gyp_file. A 'target' argument of None or the special value TestGyp.DEFAULT specifies the default argument for the underlying build tool. A 'target' argument of TestGyp.ALL specifies the 'all' target (if any) of the underlying bu... | def build(self, gyp_file, target=None, **kw):
raise NotImplementedError | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def run_gyp(self, gyp_file, *args, **kw):\n\n # When running gyp, and comparing its output we use a comparitor\n # that ignores the line numbers that gyp logs in its debug output.\n if kw.pop('ignore_line_numbers', False):\n kw.setdefault('match', match_modulo_line_numbers)\n\n # TODO: --depth=. ... | [
"0.6142762",
"0.5641256",
"0.55775917",
"0.5569497",
"0.53769106",
"0.5277803",
"0.52763253",
"0.5215424",
"0.5061313",
"0.505405",
"0.5053484",
"0.49617815",
"0.49577522",
"0.49448642",
"0.49349135",
"0.4898354",
"0.489373",
"0.48929888",
"0.48899007",
"0.48863566",
"0.48392... | 0.76094955 | 0 |
Returns a path to the specified file name, of the specified type. | def built_file_path(self, name, type=None, **kw):
raise NotImplementedError | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_filename(self, path, params, type_=None):\n phase = self.phase\n\n if type_:\n phase += ('_' + type_)\n\n filename = self.FILENAME_TEMPLATES[phase].format(**params)\n\n return os.path.join(path, filename)",
"def _get_filename(self, type_: str, name: str) -> str:\n ... | [
"0.7269891",
"0.7257632",
"0.69823027",
"0.6890883",
"0.68668914",
"0.6819215",
"0.67861587",
"0.67861587",
"0.67861587",
"0.67668647",
"0.6735627",
"0.6669159",
"0.6650285",
"0.662693",
"0.6601094",
"0.6599215",
"0.65784544",
"0.6483986",
"0.64744806",
"0.64740926",
"0.64678... | 0.6981568 | 3 |
Returns the base name of the specified file name, of the specified type. A bare=True keyword argument specifies that prefixes and suffixes shouldn't be applied. | def built_file_basename(self, name, type=None, **kw):
if not kw.get('bare'):
if type == self.EXECUTABLE:
name = name + self._exe
elif type == self.STATIC_LIB:
name = self.lib_ + name + self._lib
elif type == self.SHARED_LIB:
name = self.dll_ + name + self._dll
return na... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def make_fullname(basename, _type=None):\n return '{}.{}'.format(basename, extensions.get(_type, None))",
"def base_name(self):\n return \".\".join(posixpath.basename(self.file_name).split(\".\")[:-1])",
"def basefname(fname):\n return os.path.splitext(fname.split(\"\\\\\")[-1])[0]",
"def base_n... | [
"0.7135192",
"0.6425883",
"0.63058126",
"0.62789595",
"0.61583006",
"0.615667",
"0.61490166",
"0.60626936",
"0.59788233",
"0.59788233",
"0.59788233",
"0.59684837",
"0.5965139",
"0.59572744",
"0.5927984",
"0.59277415",
"0.5919521",
"0.59044087",
"0.5902169",
"0.5895096",
"0.58... | 0.76263374 | 0 |
Runs an executable program built from a gypgenerated configuration. The specified name should be independent of any particular generator. Subclasses should find the output executable in the appropriate output build directory, tack on any necessary executable suffix, etc. | def run_built_executable(self, name, *args, **kw):
raise NotImplementedError | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def build(self, progname):\n self.run_programm(self.COMPILED[self.progtype][0], \"%s %s %s\" %\\\n (progname, self.COMPILED[self.progtype][1], COMPILED_FILENAME ))\n\n compiled_progname=COMPILED_FILENAME\n return compiled_progname",
"def exe(self, name):\n\n return ... | [
"0.6624041",
"0.6600797",
"0.64478886",
"0.6147318",
"0.61315423",
"0.6088417",
"0.5887231",
"0.5876601",
"0.5817391",
"0.57601607",
"0.57026327",
"0.5663314",
"0.56571984",
"0.5645205",
"0.5624931",
"0.56230867",
"0.5593044",
"0.553381",
"0.5533443",
"0.553212",
"0.5465984",... | 0.7209196 | 0 |
Verifies that a build of the specified target is up to date. The subclass should implement this by calling build() (or a reasonable equivalent), checking whatever conditions will tell it the build was an "up to date" null build, and failing if it isn't. | def up_to_date(self, gyp_file, target=None, **kw):
raise NotImplementedError | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def needs_rebuild(source, target):\n return not os.path.isfile(target) or (\n os.path.getmtime(source) > os.path.getmtime(target))",
"def test_version_check_outdated(self):\n output = self.run_command(\"selfupdate --check bennr01:selfupdate_test_outdated\", exitcode=0)\n self.assertIn(\"Targe... | [
"0.65736365",
"0.6126367",
"0.6086127",
"0.6067434",
"0.6014907",
"0.60087216",
"0.59502554",
"0.59161144",
"0.5904096",
"0.5886729",
"0.5799496",
"0.5723355",
"0.561953",
"0.55603164",
"0.5559703",
"0.5531962",
"0.54967827",
"0.5467776",
"0.54588",
"0.54518825",
"0.5450072",... | 0.5800785 | 10 |
Convert to cygwin path if we are using cygwin. | def ConvertToCygpath(path):
if sys.platform == 'cygwin':
p = subprocess.Popen(['cygpath', path], stdout=subprocess.PIPE)
path = p.communicate()[0].strip()
return path | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cygpath(filename):\n if sys.platform == 'cygwin':\n proc = Popen(['cygpath', '-am', filename], stdout=PIPE)\n return proc.communicate()[0].strip()\n else:\n return filename",
"def conditional_abspath (filename):\n if sys.platform.find('cygwin') != -1:\n return filename\n else:... | [
"0.8049506",
"0.73739505",
"0.7203524",
"0.7143538",
"0.67795306",
"0.6647246",
"0.6647246",
"0.65076965",
"0.6450253",
"0.6416357",
"0.61581916",
"0.6095484",
"0.60797286",
"0.607077",
"0.6055507",
"0.59301335",
"0.5853573",
"0.5805152",
"0.5760639",
"0.5707755",
"0.5666738"... | 0.82450604 | 0 |
Returns path to MSBuild for msvs_version or latest available. Looks in the registry to find install location of MSBuild. MSBuild before v4.0 will not build c++ projects, so only use newer versions. | def FindMSBuildInstallation(msvs_version = 'auto'):
import TestWin
registry = TestWin.Registry()
msvs_to_msbuild = {
'2013': r'12.0',
'2012': r'4.0', # Really v4.0.30319 which comes with .NET 4.5.
'2010': r'4.0'}
msbuild_basekey = r'HKLM\SOFTWARE\Microsoft\MSBuild\ToolsVersions'
if not re... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def FindVisualStudioInstallation():\n possible_roots = ['%s:\\\\Program Files%s' % (chr(drive), suffix)\n for drive in range(ord('C'), ord('Z') + 1)\n for suffix in ['', ' (x86)']]\n possible_paths = {\n '2013': r'Microsoft Visual Studio 12.0\\Common7\\IDE\\devenv.com',... | [
"0.74490994",
"0.61283606",
"0.60080606",
"0.5867908",
"0.5809241",
"0.5623859",
"0.55386347",
"0.55197555",
"0.55090356",
"0.5305542",
"0.5296578",
"0.5279354",
"0.5249882",
"0.5218957",
"0.5179512",
"0.5171492",
"0.51507473",
"0.5116992",
"0.5103813",
"0.509796",
"0.5077102... | 0.8086731 | 0 |
Returns appropriate values for .build_tool and .uses_msbuild fields of TestGypBase for Visual Studio. We use the value specified by GYP_MSVS_VERSION. If not specified, we search %PATH% and %PATHEXT% for a devenv.{exe,bat,...} executable. Failing that, we search for likely deployment paths. | def FindVisualStudioInstallation():
possible_roots = ['%s:\\Program Files%s' % (chr(drive), suffix)
for drive in range(ord('C'), ord('Z') + 1)
for suffix in ['', ' (x86)']]
possible_paths = {
'2013': r'Microsoft Visual Studio 12.0\Common7\IDE\devenv.com',
'2012': ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def FindMSBuildInstallation(msvs_version = 'auto'):\n import TestWin\n registry = TestWin.Registry()\n\n msvs_to_msbuild = {\n '2013': r'12.0',\n '2012': r'4.0', # Really v4.0.30319 which comes with .NET 4.5.\n '2010': r'4.0'}\n\n msbuild_basekey = r'HKLM\\SOFTWARE\\Microsoft\\MSBuild\\ToolsVer... | [
"0.69029933",
"0.61118186",
"0.58593863",
"0.5823036",
"0.5704268",
"0.569332",
"0.5633969",
"0.5570575",
"0.5372743",
"0.5309162",
"0.52959627",
"0.5287438",
"0.5257357",
"0.5171771",
"0.5165725",
"0.5161343",
"0.51455754",
"0.5138159",
"0.51229465",
"0.5083195",
"0.5071728"... | 0.8004529 | 0 |
Run the dumpbin tool with the specified arguments, and capturing and returning stdout. | def run_dumpbin(self, *dumpbin_args):
assert sys.platform in ('win32', 'cygwin')
cmd = os.environ.get('COMSPEC', 'cmd.exe')
arguments = [cmd, '/c', self.vsvars_path, '&&', 'dumpbin']
arguments.extend(dumpbin_args)
proc = subprocess.Popen(arguments, stdout=subprocess.PIPE)
output = proc.communica... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def run_and_capture(*argv):\n print(*argv, file=sys.stderr)\n return subprocess.check_output(argv)",
"def dump(args):\n if args.dump_command == \"trace\":\n _dump_trace(args)\n elif args.dump_command == \"checkpoint\":\n _dump_checkpoint(args)\n elif args.dump_command == \"config\":\... | [
"0.6620855",
"0.64421326",
"0.6403631",
"0.6061605",
"0.60324913",
"0.599794",
"0.599789",
"0.59293294",
"0.59045",
"0.5888841",
"0.5851133",
"0.57390636",
"0.57296616",
"0.5724511",
"0.5675946",
"0.56678206",
"0.5652054",
"0.5632921",
"0.5618824",
"0.5589044",
"0.5553226",
... | 0.7729673 | 0 |
Returns an appropriate TestGyp instance for a specified GYP format. | def TestGyp(*args, **kw):
format = kw.pop('format', os.environ.get('TESTGYP_FORMAT'))
if format != 'ninja':
raise Exception("unknown format %r" % format)
return TestGypNinja(*args, **kw) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_driver(browser_name):\n if browser_name == BaseConstants.CHROME:\n options = webdriver.ChromeOptions()\n options.add_argument('headless')\n if BaseConstants.HEADLESS_MODE:\n return webdriver.Chrome(options=options)\n else:\n return webdriver.Chrome()\... | [
"0.48283198",
"0.4679778",
"0.46405205",
"0.46262017",
"0.4596164",
"0.4575837",
"0.45242107",
"0.45190325",
"0.449273",
"0.44799712",
"0.44797117",
"0.44374356",
"0.4432995",
"0.43943155",
"0.4385032",
"0.43449232",
"0.43261662",
"0.43182468",
"0.43172392",
"0.4313307",
"0.4... | 0.7641839 | 0 |
Read data from file, and return RDD data | def read_data(file_path, sparkContext):
data_rdd = sparkContext \
.textFile(file_path) \
.map(eval) \
.map(lambda x: (x[0], x[1]))
return data_rdd | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_file(file_name):\r\n f = open(file_name)\r\n\r\n tids = f.readlines()\r\n \r\n dataset = [(int(tid), get_from_id(int(tid))) for tid in tids]\r\n\r\n f.close()\r\n return dataset",
"def open_file(path):\n input_file = os.path.join(path)\n with open(input_file) as f:\n dataset... | [
"0.64890283",
"0.64516765",
"0.6394799",
"0.6333202",
"0.6283155",
"0.6235973",
"0.6203842",
"0.61601675",
"0.615744",
"0.6122503",
"0.6106315",
"0.60988206",
"0.60945296",
"0.6094214",
"0.6093703",
"0.6081706",
"0.60803366",
"0.60783815",
"0.6070833",
"0.60573804",
"0.605545... | 0.8014558 | 0 |
Swap the elements of a pair tuple. | def swap((u, v)):
return (v, u) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def swap(t, i, j):\n t[i], t[j] = t[j], t[i]",
"def swap(arr, first, second):\n arr[first], arr[second] = arr[second], arr[first]",
"def __fix_tuple(self, xy_tup):\n if self.__swapxy:\n return xy_tup[::-1]\n return xy_tup",
"def swap(array, x, y):\n array[x], array[y] = arra... | [
"0.710742",
"0.6921995",
"0.67650807",
"0.6753853",
"0.67195106",
"0.6608336",
"0.6608336",
"0.65285224",
"0.65226775",
"0.64976215",
"0.6457704",
"0.64406437",
"0.6424713",
"0.64173776",
"0.64168835",
"0.6398433",
"0.6393677",
"0.6344615",
"0.6300766",
"0.6300416",
"0.629629... | 0.7532806 | 0 |
Calculate the degree for each node in the graph, return the degree result RDD | def calc_degree(graph_rdd):
all_degree = graph_rdd \
.map(swap) \
.union(graph_rdd) \
.map(lambda (x, y): (x, 1)) \
.reduceByKey(add, numPartitions=40)
return all_degree | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _compute_node_degrees(self):\n mes = []\n args = []\n for metaedge, matrix in self.adj_matrices.items():\n mes.append(metaedge)\n args.append(matrix)\n res = parallel_process(array=args, function=mt.calculate_degrees, n_jobs=self.n_jobs, front_num=0)\n f... | [
"0.73189455",
"0.6666675",
"0.66346604",
"0.6527249",
"0.6472764",
"0.64700943",
"0.6447332",
"0.6439064",
"0.6412134",
"0.63582855",
"0.635775",
"0.6351265",
"0.6337845",
"0.63136494",
"0.62561065",
"0.62335783",
"0.6209105",
"0.6083658",
"0.6079586",
"0.6071218",
"0.6063278... | 0.82944816 | 0 |
Calculate the color of the given graph | def calc_coloring(graph_rdd):
graph_rdd = graph_rdd \
.map(swap) \
.union(graph_rdd)
nodes = graph_rdd.keys().distinct()
color = nodes.map(lambda x: (x, 1))
color_num = 1
while True:
graph_join_color = graph_rdd.join(color)
neighbour = graph_join_color \
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_graph_color ( self, object ):\n return self.graph_color_",
"def node_colors(self, nodes):\n zmin, zmax = nodes[:, 2].min(), nodes[:, 2].max()\n start_color = np.array(self.background) + 5\n end_color = np.array(self.nodeColor)\n z = (nodes[:, 2] - zmin) / (zmax - zmin)\... | [
"0.6921936",
"0.68462545",
"0.6812859",
"0.6628914",
"0.61997235",
"0.6196649",
"0.6177675",
"0.61515486",
"0.61393696",
"0.61063284",
"0.5977255",
"0.5973112",
"0.5952528",
"0.59323245",
"0.5927516",
"0.5913909",
"0.59100264",
"0.58947194",
"0.5864049",
"0.58494604",
"0.5835... | 0.65696484 | 4 |
Decides whether the extension should be called on this iteration. | def __call__(self, trainer):
observation = trainer.observation
summary = self._summary
key = self._key
if key in observation:
summary.add({key: observation[key]})
if not self._interval_trigger(trainer):
return False
if self._max_trigger(trainer):... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _do_iteration(self):\n return True",
"def _check_extend_function(self):\n for function_name, parameters in self._extend_function_dic.iteritems():\n if not apply(function_name, parameters):\n return False\n return True",
"def enabled(cls):\n return (cls ... | [
"0.6543473",
"0.64817363",
"0.63259906",
"0.6315664",
"0.6213796",
"0.6170994",
"0.61556333",
"0.60520947",
"0.5957609",
"0.595163",
"0.59396863",
"0.58867925",
"0.5883852",
"0.5877065",
"0.58711547",
"0.5867909",
"0.58117265",
"0.5806192",
"0.57352674",
"0.5727936",
"0.57109... | 0.0 | -1 |
Load config from a JSON file | def init(configpath):
try:
with open(configpath) as f:
config = json.load(f)
except IOError as err:
print("Cannot open configuration: %s. Exiting" % (str(err)))
sys.exit(1)
# create a Dejavu instance
return Dejavu(config) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def load_config(self):\r\n with open('config.json', 'r') as f:\r\n self.config = json.load(f)",
"def load_config():\n global config\n\n with open(\"config.json\") as f:\n json_config = f.read()\n f.close()\n config = json.loads(json_config)",
"def load_from_file(config_path... | [
"0.8552788",
"0.83786416",
"0.83611923",
"0.8340893",
"0.83344764",
"0.8171003",
"0.81469893",
"0.81373334",
"0.8113979",
"0.8045373",
"0.8014212",
"0.7972391",
"0.7936956",
"0.7911418",
"0.783825",
"0.7834013",
"0.7794506",
"0.7740724",
"0.7716325",
"0.7714573",
"0.7705778",... | 0.0 | -1 |
Returns the requested Detail Placement view in full detail. | def GetDetailPlacementView(self, request, context):
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def details_view(self):\n return_url = get_redirect_target() or self.get_url('.index_view')\n\n if not self.can_view_details:\n return redirect(return_url)\n\n id = get_mdict_item_or_list(request.args, 'id')\n if id is None:\n return redirect(return_url)\n\n ... | [
"0.62962556",
"0.6222012",
"0.60413206",
"0.60247207",
"0.599701",
"0.59846437",
"0.59270996",
"0.59270996",
"0.59270996",
"0.5781382",
"0.5744504",
"0.57360107",
"0.5722859",
"0.56349206",
"0.56211096",
"0.5606024",
"0.5596012",
"0.55128306",
"0.5510236",
"0.5470296",
"0.543... | 0.67889655 | 0 |
Test if the toolkit is correctly initialised | def isInitialized(self):
if self.isTypeSet and self.isCfgSet:
return True
else:
return False | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_initialization(self):\n self.assertEqual(self.widget.buffer, '')\n self.assertEqual(self.widget.cursor, 0)\n self.assertEqual(self.widget.killRing, [])\n self.assertEqual(self.widget.getInputHistory(), [])",
"def init(self):\n return True",
"def checkInit(this):\n\t\... | [
"0.6973852",
"0.6893085",
"0.67563367",
"0.651693",
"0.6469057",
"0.6453788",
"0.6442735",
"0.64315516",
"0.64127755",
"0.6312225",
"0.6263558",
"0.6261949",
"0.62522864",
"0.6242899",
"0.61295563",
"0.61053383",
"0.6033148",
"0.6012432",
"0.599946",
"0.5994019",
"0.59789073"... | 0.58350056 | 36 |
Test if the the toolkit has properly loaded a net | def isLoaded(self):
if (self.Loaded):
return True
else:
return False | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def net_check():\n resp = None\n host = \"https://gitlab.manjaro.org\"\n # noinspection PyBroadException\n try:\n resp = urllib.request.urlopen(host, timeout=2)\n except Exception:\n pass\n return bool(resp)",
"def test_support_NETWORK(self):\n ... | [
"0.657695",
"0.6575421",
"0.6294705",
"0.6179315",
"0.6170038",
"0.61642003",
"0.6063114",
"0.6054157",
"0.60277236",
"0.6014292",
"0.6007268",
"0.599984",
"0.59951115",
"0.59606314",
"0.5889282",
"0.58824193",
"0.57986444",
"0.5796869",
"0.5757363",
"0.5727531",
"0.5709009",... | 0.5260726 | 91 |
Returns a list of all available netloaders | def getNets(self):
return NetLoader.listNetworks() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getLoaders(self):\n return self.__loaders;",
"def list_all_sys_net_if():\n sys_net_path = glob.glob('/sys/class/net/*')\n # Now remove the /sys/class/net prefix, keep only the interface name\n p = re.compile('^/sys/class/net/')\n result = [ p.sub('', s) for s in sys_net_path ]\n \n r... | [
"0.66725755",
"0.6490495",
"0.63215595",
"0.62439114",
"0.60754764",
"0.60590166",
"0.6027253",
"0.600712",
"0.6005559",
"0.6004541",
"0.5944526",
"0.5937115",
"0.5898024",
"0.5864237",
"0.5839915",
"0.58086324",
"0.5807643",
"0.5779557",
"0.5754953",
"0.56995124",
"0.5694432... | 0.6645465 | 1 |
Sets the type of the net | def setType(self, type):
if not self.Loaded:
self.type = type
self.loader = NetLoader.getNetwork(type)
self.isTypeSet = True | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_network_type(self, nNetworkType):\n\t\tcall_sdk_function('PrlVirtNet_SetNetworkType', self.handle, nNetworkType)",
"def set_type(self, type):\n self.type = type",
"def set_type(self, type):\n self.type = type",
"def set_type(self, type):\n self._type = type",
"def set_type(self... | [
"0.7971514",
"0.71984947",
"0.71984947",
"0.6919849",
"0.6910896",
"0.6831771",
"0.673096",
"0.6675191",
"0.6675191",
"0.6673063",
"0.66369283",
"0.6631227",
"0.6560186",
"0.6550808",
"0.6550808",
"0.6550808",
"0.6550808",
"0.6550808",
"0.6550808",
"0.6550808",
"0.6550808",
... | 0.8372814 | 0 |
Sets the config of the net | def setConfig(self, cfg):
if not self.Loaded:
self.cfg = cfg
if (cfg != ""):
self.isCfgSet = NetLoader.loadConfig(self.type,cfg)
else:
self.isCfgSet = True | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def config(self):\n self._resource_manager = self._api._ixnetwork.ResourceManager\n self._ixn_vport = self._api._vport\n self._delete_vports()\n self._create_vports()\n self._create_capture()\n self._set_location()\n self._set_layer1()",
"def set_config(config_nam... | [
"0.7222632",
"0.6988482",
"0.698327",
"0.69201595",
"0.6917988",
"0.6894919",
"0.6846105",
"0.6840916",
"0.68287504",
"0.6813093",
"0.68010086",
"0.6800059",
"0.6800059",
"0.67930377",
"0.66927445",
"0.66901636",
"0.6685445",
"0.6637061",
"0.65850174",
"0.655442",
"0.6551127"... | 0.72783136 | 0 |
Sets type and config of the net | def init(self, type, cfg = ""):
self.setType(type)
self.setConfig(cfg) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def configure_net(self):\n try:\n transport_type = Conf.get(self._index,\n f'cluster>{self._server_id}')['network']['data']['transport_type']\n except:\n raise MotrError(errno.EINVAL, \"transport_type not found\")\n check_type(transport_type, str, \"transport_type\")\n\n if tra... | [
"0.7610962",
"0.73287976",
"0.69167465",
"0.68706095",
"0.6467029",
"0.61585915",
"0.6107175",
"0.6075406",
"0.5998509",
"0.59832966",
"0.59798235",
"0.5946747",
"0.5946313",
"0.5946313",
"0.5932036",
"0.5844273",
"0.57646656",
"0.5743971",
"0.5728634",
"0.57254034",
"0.56771... | 0.6504188 | 4 |
Creates a new net | def create(self):
if self.isInitialized():
self.Loaded = self.loader.create() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_network(self, body=None):\r\n return self.post(self.networks_path, body=body)",
"def new_network():\n new_names = Names()\n new_devices = Devices(new_names)\n return Network(new_names, new_devices)",
"def create_network(layers):\r\n return NeuronNetwork(layers)",
"def create_net... | [
"0.7752983",
"0.75935227",
"0.7579161",
"0.74720424",
"0.7450154",
"0.73505336",
"0.7265658",
"0.7226654",
"0.72092396",
"0.7184448",
"0.71351165",
"0.7125052",
"0.7001901",
"0.6985204",
"0.69297606",
"0.6902294",
"0.6866541",
"0.68564516",
"0.6822913",
"0.67636114",
"0.67529... | 0.0 | -1 |
Loads a net from a file | def load(self, filename):
if self.isInitialized():
self.Loaded = self.loader.load(filename) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def load_net(filepath):\n\twith open(filepath, 'r') as fh:\n\t\treturn load(file = fh)",
"def load_network(fpath):\n\twith open(fpath, \"rb\") as f:\n\t\tnetwork = pickle.load(f)\n\treturn network",
"def load_net_from_file(filename):\n\n print(\"Loading neural net from {}\".format(filename))\n with open(... | [
"0.84349024",
"0.78879464",
"0.7695586",
"0.76488405",
"0.7205535",
"0.69420034",
"0.6926592",
"0.6914786",
"0.68838954",
"0.682743",
"0.67022914",
"0.66932905",
"0.6624136",
"0.65968657",
"0.65368605",
"0.63931435",
"0.6385509",
"0.6375968",
"0.6369377",
"0.63594496",
"0.635... | 0.0 | -1 |
Saves the net the a file | def save(self, filename):
if (self.isLoaded()):
self.loader.save(filename) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def save_net(net, filepath):\n\twith open(filepath, 'wb+') as fh:\n\t\tdump(obj = net, file = fh, protocol = -1)",
"def save(self, filename):\n pass",
"def save():",
"def save(self, fname):\n pass",
"def save(self):\n # TODO: save the file",
"def save_network(network, fpath):\n\twith... | [
"0.75229055",
"0.73316634",
"0.72758085",
"0.7152448",
"0.71279424",
"0.70543814",
"0.7023385",
"0.7019048",
"0.6970766",
"0.695234",
"0.6947939",
"0.68580997",
"0.6842967",
"0.6841035",
"0.68323475",
"0.68147725",
"0.68147725",
"0.67504865",
"0.674834",
"0.67381054",
"0.6709... | 0.0 | -1 |
Feed the net with input data. | def input(self, data, output = None):
if (self.isLoaded()):
if output != None:
self.loader.input(data, output)
else:
self.loader.input(data) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def feed() -> None:\n ...",
"def _send_data_to_nn(self,wbtData):\n\t\tself._neuralNetwork.stdin.write(\"COMM IN\\n\") # this shitty COMM IN is not really needed..to modify in closedloop.py\n\t\tself._neuralNetwork.stdin.write(wbtData)",
"def _InfeedLoop(self, sess=None):\n self._InfeedLoopForInput(se... | [
"0.65780514",
"0.65370286",
"0.6486897",
"0.64747846",
"0.6459404",
"0.63143754",
"0.6267535",
"0.62215817",
"0.621933",
"0.6172441",
"0.60749334",
"0.6070215",
"0.6062808",
"0.59615",
"0.59615",
"0.59615",
"0.5932563",
"0.592809",
"0.59120107",
"0.5902207",
"0.58748436",
"... | 0.54257965 | 56 |
Reads the output from the net | def output(self):
if (self.isLoaded()):
return self.loader.output() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _nn_read_data(self):\n\t\treaData = True\n\t\tnnIncomingData = False\n\t\tnnData = \"\"\n\t\twhile reaData and self._neuralNetwork.poll()==None:\n\t\t\tnnIncomingMsg = self._neuralNetwork.stdout.readline().rstrip(\"\\n\").split()\n\t\t\tif \"COMM_OUT\" in nnIncomingMsg: nnIncomingData = True\n\t\t\telif \"END... | [
"0.6857984",
"0.673255",
"0.64946055",
"0.63726616",
"0.6248686",
"0.61688924",
"0.60370463",
"0.6036703",
"0.6026198",
"0.5983539",
"0.5961235",
"0.5936423",
"0.59283197",
"0.59017277",
"0.58711416",
"0.58341336",
"0.5794706",
"0.57396996",
"0.5738961",
"0.57280636",
"0.5722... | 0.0 | -1 |
Let the net evolve | def evolve(self):
if (self.isLoaded()):
self.loader.evolve() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def evolve(self):\n # print('Evolving using parent method')\n pass",
"def evolve(self, genomes, pool, params):\n pass",
"def weight_update_nesterov(self, network):\n # Before updating, take step back with current velocity\n for l, layer in enumerate(network.layers):\n ... | [
"0.7192464",
"0.6577296",
"0.6441808",
"0.64247847",
"0.6281182",
"0.6230837",
"0.6213925",
"0.6047841",
"0.60136026",
"0.599902",
"0.5998479",
"0.59983337",
"0.596406",
"0.5956148",
"0.5928153",
"0.5902687",
"0.5887638",
"0.58834386",
"0.58660793",
"0.58449715",
"0.5841963",... | 0.0 | -1 |
Visualizes the net using a specified visualisation tool | def visualize(self, filename, options = {'showHead'}):
Visualizer.useGraphViz(self, filename, options) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def base_visualization(self, filename, save_format='jpg', cfg=None):\n # TODO and detailed mode for the visualization function\n # in which the graph will also contain all the weights/bias\n # information.\n # if not cfg:\n # cfg = {}\n # graph = graphviz.Digraph(forma... | [
"0.66701585",
"0.66260993",
"0.6595881",
"0.6549969",
"0.6388977",
"0.6345816",
"0.63148457",
"0.6309874",
"0.62749845",
"0.623829",
"0.6233477",
"0.62124443",
"0.62090516",
"0.62049544",
"0.6201141",
"0.6192981",
"0.6081196",
"0.60595465",
"0.60311395",
"0.59965384",
"0.5978... | 0.60745823 | 17 |
Provides direct access to the netloader | def getNet(self):
return self.loader | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def load_network(self):\t\t\r\n\t\tself.dqn.load_network(self.path)",
"def setup_net(self):\n pass",
"def loader(self):\r\n return self._endpoint.loader",
"def load_device():",
"def loader(self):\n return self._loader",
"def _load_disk(self):\r\n pass",
"def getInstance():\n ... | [
"0.645929",
"0.6270606",
"0.61700976",
"0.61311126",
"0.612642",
"0.5924534",
"0.58821017",
"0.58444583",
"0.5807952",
"0.57599235",
"0.57308453",
"0.57299966",
"0.57299966",
"0.57212603",
"0.5716569",
"0.5710826",
"0.5686609",
"0.56737906",
"0.56279176",
"0.5610941",
"0.5587... | 0.7985111 | 0 |
Returns the number of neurons in the net | def getNeuronCount(self):
return self.loader.getNeuronCount() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def size_in(self):\n if isinstance(self.ensemble.neuron_type, Direct):\n # This will prevent users from connecting/probing Direct neurons\n # (since there aren't actually any neurons being simulated).\n return 0\n return self.ensemble.n_neurons",
"def numNodes(self)... | [
"0.8014516",
"0.7718805",
"0.7711043",
"0.7549032",
"0.7513461",
"0.7375314",
"0.73752713",
"0.736108",
"0.73195183",
"0.7298478",
"0.7297693",
"0.72939956",
"0.72719425",
"0.7255253",
"0.72395927",
"0.7193449",
"0.7181116",
"0.71256834",
"0.71191174",
"0.71191174",
"0.711391... | 0.8422572 | 0 |
Returns a single neuron from the net | def getNeuron(self, index):
return self.loader.getNeuron(index) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_neuron(self, position):\n return self.neurons[position]",
"def get_neuron_number(self):\n return self.neuronNumber",
"def _get_network(name):\n\n if name not in _NAME_TO_NETS:\n raise ValueError('Network name [%s] not recognized.' % name)\n return _NAME_TO_NETS[name].model",
"def g... | [
"0.76190454",
"0.67833936",
"0.61882776",
"0.60611504",
"0.60453904",
"0.60128474",
"0.5981504",
"0.59493107",
"0.5938629",
"0.5838178",
"0.5739871",
"0.56908137",
"0.56752616",
"0.5671026",
"0.5622484",
"0.5606323",
"0.55538636",
"0.555125",
"0.555125",
"0.555125",
"0.554771... | 0.81398237 | 0 |
Returns a new instance of the nets inputVector | def getInputVector(self, data = None):
return self.loader.getInputVector(data) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def feed(self, vector):\n return vector",
"def CreateVector(self) -> BaseVector:",
"def convertInput2Vec(self, vec):\r\n\t\treturn self.convert2Vec(self.getInput(), vec)",
"def feed_forward(self, input_vector):\n # return sigmoid(np.dot(self.weights, input_vector))\n return np.dot(self.w... | [
"0.7008192",
"0.67802066",
"0.6564515",
"0.6254879",
"0.62405634",
"0.62213254",
"0.6206645",
"0.6124485",
"0.6124016",
"0.608916",
"0.60445654",
"0.5996923",
"0.59619606",
"0.5941465",
"0.5840973",
"0.58397865",
"0.5812209",
"0.57971823",
"0.57887155",
"0.57058126",
"0.56953... | 0.5423653 | 57 |
Returns a new instance of the nets outputVector | def getOutputVector(self, data = None):
return self.loader.getOutputVector(data) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def output (self) -> np.ndarray :\n return RNN.sigmoid (self.Wout.dot (self.xvec))",
"def convertOutput2Vec(self, vec):\r\n\t\treturn self.convert2Vec(self.getOutput(), vec)",
"def output_multiple(self):\n return _add_vector_swig.add_vector_2_cpp_sptr_output_multiple(self)",
"def message_ports_... | [
"0.66333944",
"0.6446377",
"0.629674",
"0.61268777",
"0.6079231",
"0.60380054",
"0.60370886",
"0.6032098",
"0.60091865",
"0.6009079",
"0.6008311",
"0.5972698",
"0.5954502",
"0.59494245",
"0.59334284",
"0.5917383",
"0.58994985",
"0.58410573",
"0.583894",
"0.58219653",
"0.58155... | 0.61104596 | 4 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.