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 |
|---|---|---|---|---|---|---|
Return a list with force and torque values [Fx,Fy,Fz,Tx,Ty,Tz] correcponding to the dataArray | def forceFromSerialMessage(serialMessage,zeroRef=[0,0,0,0,0,0]):
#Initialize variable
forceTorque=[0,0,0,0,0,0]
#converte bytearray values to integer. Apply the zero offset and round at 2 decimals
forceTorque[0]=round(int.from_bytes(serialMessage[2:4], byteorder='little', signed=True)/100-zeroRef[0],2)
force... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def forces(self):\n forces_array = get_data_node('array')\n forces_array.set_array('forces',\n array(\n self.vasprun_obj.ionic_steps[-1]['forces']))\n return forces_array",
"def get_force_vector(self) -> NDArray:\n\n forc... | [
"0.63969284",
"0.5930781",
"0.5863585",
"0.56926334",
"0.56165177",
"0.56125605",
"0.56071913",
"0.5569671",
"0.5453023",
"0.5441615",
"0.5385059",
"0.53306097",
"0.53239334",
"0.5302626",
"0.5282193",
"0.527346",
"0.5247686",
"0.52409893",
"0.5192743",
"0.5181213",
"0.518116... | 0.0 | -1 |
Check if the serial message have a valid CRC. | def crcCheck(serialMessage):
checkResult = False
#CRC from serial message
crc = int.from_bytes(serialMessage[14:16], byteorder='little', signed=False)
#calculated CRC
crcCalc = libscrc.modbus(serialMessage[0:14])
if crc == crcCalc:
checkResult = True
return checkResult | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_crc(self):\n return self.name.startswith('CRC')",
"def check_crc(chunk, crc):\n\n crc = bytes(crc)\n crc_this = bytes(ensure_crc(crc16.crc16xmodem(bytes(chunk))).encode('utf-8'))\n if crc_this == crc:\n return True\n else:\n return False",
"def check_crc(function_specifi... | [
"0.7833014",
"0.76461273",
"0.7568382",
"0.7517449",
"0.7303092",
"0.7155623",
"0.711303",
"0.6821579",
"0.68020415",
"0.6791723",
"0.6733442",
"0.64848715",
"0.6392629",
"0.6391682",
"0.6333633",
"0.622844",
"0.622844",
"0.6166218",
"0.6160127",
"0.61058235",
"0.6096547",
... | 0.8432148 | 0 |
This function tests that square inherits from Base | def test_SquareinheritancefromBase(self):
Square.reset_objects()
self.assertEqual(issubclass(Square, Base), True) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_SquareinheritancefromRectangle(self):\n Square.reset_objects()\n self.assertEqual(issubclass(Square, Rectangle), True)",
"def test_inheritance(self):\n self.assertTrue(issubclass(Rectangle, Base))",
"def test_square_class(self):\n s1 = Square(10)\n self.assertEqual(1... | [
"0.78790617",
"0.7464751",
"0.74157864",
"0.72943133",
"0.7226751",
"0.6838892",
"0.6658183",
"0.63029987",
"0.62793493",
"0.6201508",
"0.61887723",
"0.6183908",
"0.61684614",
"0.6153239",
"0.61244017",
"0.61089444",
"0.6081408",
"0.60803723",
"0.6078038",
"0.6011344",
"0.600... | 0.8380413 | 0 |
This function tests that square inherits from Base | def test_SquareinheritancefromRectangle(self):
Square.reset_objects()
self.assertEqual(issubclass(Square, Rectangle), True) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_SquareinheritancefromBase(self):\n Square.reset_objects()\n self.assertEqual(issubclass(Square, Base), True)",
"def test_inheritance(self):\n self.assertTrue(issubclass(Rectangle, Base))",
"def test_square_class(self):\n s1 = Square(10)\n self.assertEqual(10, s1.size... | [
"0.8381641",
"0.7465298",
"0.74154085",
"0.72949463",
"0.7227583",
"0.68388546",
"0.66581863",
"0.6302443",
"0.62782824",
"0.6202097",
"0.61873174",
"0.61839616",
"0.6166422",
"0.6153196",
"0.61243147",
"0.6108876",
"0.6081987",
"0.6081601",
"0.6077003",
"0.6009714",
"0.60062... | 0.7879409 | 1 |
This function tests that object is of type Rectangle | def test_objectinheritance(self):
Square.reset_objects()
s1 = Square(5)
self.assertEqual(isinstance(s1, Square), True) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_0_is_Rectangle_class(self):\r\n self.assertTrue(issubclass(type(self.S0), Rectangle) and\r\n type(self.S0) != Rectangle)",
"def test_inheritance(self):\n self.assertTrue(issubclass(Rectangle, Base))",
"def test_SquareinheritancefromRectangle(self):\n Square.... | [
"0.81240547",
"0.77088064",
"0.76751864",
"0.7652582",
"0.7423002",
"0.70680153",
"0.700833",
"0.69718456",
"0.69716054",
"0.69708675",
"0.6913482",
"0.6740271",
"0.6699377",
"0.6660337",
"0.66601557",
"0.6619761",
"0.6611006",
"0.6590472",
"0.65760404",
"0.657499",
"0.656991... | 0.6173705 | 44 |
This function tests that Typeerror is thrown when 0 arguments | def test_errorfornoarguments(self):
Square.reset_objects()
with self.assertRaises(TypeError) as e:
s1 = Square()
self.assertEqual(
str(e.exception),
"__init__() missing 1 required positional argument: 'size'") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_type_error(self):\n self._error_test(TypeError)",
"def test_value_error_for_computing_missing_type():\n with pytest.raises(ValueError):\n compute_type(\"missing_type\", {})",
"def test_badargs(self):\n self.assertRaises(TypeError, isint, [])\n self.assertRaises(TypeError... | [
"0.79296213",
"0.7687501",
"0.7513296",
"0.74324",
"0.72868884",
"0.7251024",
"0.72421396",
"0.722919",
"0.7216657",
"0.7172854",
"0.7167968",
"0.7160128",
"0.71230894",
"0.7108646",
"0.7043927",
"0.7019197",
"0.70073533",
"0.6990342",
"0.69550425",
"0.69542783",
"0.69237006"... | 0.7259122 | 5 |
This function tests that Typeerror is thrown when 0 arguments | def test_errorfortoomanyarguments(self):
Square.reset_objects()
with self.assertRaises(TypeError) as e:
s1 = Square(1, 2, 3, 4, 5)
self.assertEqual(
str(e.exception),
"__init__() takes from 2 to 5 positional" +
" arguments but 6 were given") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_type_error(self):\n self._error_test(TypeError)",
"def test_value_error_for_computing_missing_type():\n with pytest.raises(ValueError):\n compute_type(\"missing_type\", {})",
"def test_badargs(self):\n self.assertRaises(TypeError, isint, [])\n self.assertRaises(TypeError... | [
"0.79272693",
"0.76853794",
"0.7513777",
"0.7431842",
"0.7285539",
"0.7258863",
"0.72499096",
"0.72385985",
"0.72278345",
"0.72163785",
"0.71723783",
"0.71672547",
"0.71580905",
"0.7109186",
"0.704141",
"0.7019406",
"0.70061946",
"0.6987669",
"0.69550914",
"0.69545126",
"0.69... | 0.71228784 | 13 |
This function tests that Typeerror is thrown when 0 arguments | def test_negativesize(self):
Square.reset_objects()
with self.assertRaises(ValueError) as e:
s1 = Square(-1)
self.assertEqual(str(e.exception), "width must be > 0") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_type_error(self):\n self._error_test(TypeError)",
"def test_value_error_for_computing_missing_type():\n with pytest.raises(ValueError):\n compute_type(\"missing_type\", {})",
"def test_badargs(self):\n self.assertRaises(TypeError, isint, [])\n self.assertRaises(TypeError... | [
"0.79296213",
"0.7687501",
"0.7513296",
"0.74324",
"0.72868884",
"0.7259122",
"0.7251024",
"0.72421396",
"0.722919",
"0.7216657",
"0.7172854",
"0.7167968",
"0.7160128",
"0.71230894",
"0.7108646",
"0.7043927",
"0.7019197",
"0.70073533",
"0.6990342",
"0.69550425",
"0.69542783",... | 0.0 | -1 |
This function tests that ValueError is thrown for x value | def test_negativexvalue(self):
Square.reset_objects()
with self.assertRaises(ValueError) as e:
s1 = Square(1, -2)
self.assertEqual(str(e.exception), "x must be >= 0") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_value_error(self):\n self._error_test(ValueError)",
"def test_check_x_ValueError(self):\n self.assertRaisesRegex(\n ValueError,\n 'x must be >= 0',\n Rectangle,\n 4, 2, -1, 0, 12\n )",
"def test_check_X_not_int_not_float():\n with pyt... | [
"0.7744312",
"0.7628981",
"0.7376584",
"0.72498196",
"0.72077596",
"0.70309776",
"0.7029389",
"0.70177644",
"0.6965968",
"0.6950191",
"0.69336456",
"0.68996376",
"0.68669736",
"0.68582314",
"0.6836748",
"0.6823986",
"0.67863214",
"0.67758465",
"0.67752916",
"0.6768112",
"0.67... | 0.6772184 | 19 |
This function tests that ValueError is thrown for y value | def test_negativeyvalue(self):
Square.reset_objects()
with self.assertRaises(ValueError) as e:
s1 = Square(1, 2, -2)
self.assertEqual(str(e.exception), "y must be >= 0") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_cast_y_axis_extrema_invalid_input(self):\r\n self.assertRaises(ValueError, _cast_y_axis_extrema, 'foo')",
"def test_check_y_not_int_not_float(wage_X_y, wage_gam):\n X, y = wage_X_y\n y_str = ['hi'] * len(y)\n\n with pytest.raises(ValueError):\n check_y(y_str, wage_gam.link, wage_g... | [
"0.7913412",
"0.76596844",
"0.7343764",
"0.715125",
"0.70271635",
"0.6917319",
"0.68697965",
"0.6854336",
"0.68402386",
"0.6826492",
"0.6811204",
"0.68028307",
"0.67962307",
"0.67844146",
"0.6748008",
"0.67324376",
"0.6724416",
"0.66972107",
"0.6679238",
"0.6655606",
"0.65666... | 0.70518243 | 4 |
This function tests that ValueError is thrown for 0 size value | def test_0size(self):
Square.reset_objects()
with self.assertRaises(ValueError) as e:
s1 = Square(0)
self.assertEqual(str(e.exception), "width must be > 0") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def check_size(s):\n\n s = check_1d(s, \"size\")\n if any(map(lambda d: d <= 0, s)):\n raise Exception('Size cannot be 0 or negative')\n\n return s",
"def test_Sobol_G_raises_error_if_values_wrong_size():\n a = [1, 2, 3, 4, 5, 6, 7, 8]\n with raises(ValueError):\n evaluate(np.array([... | [
"0.7179001",
"0.70014584",
"0.6692978",
"0.66857994",
"0.6674627",
"0.6652692",
"0.665025",
"0.6612061",
"0.66108143",
"0.6585465",
"0.6583776",
"0.6574457",
"0.65705",
"0.6555679",
"0.6463471",
"0.6458329",
"0.6458053",
"0.64574504",
"0.6448534",
"0.64482915",
"0.6438322",
... | 0.73414814 | 0 |
This function tests for single instance creation | def test_singlesquarecreation(self):
Square.reset_objects()
s1 = Square(10)
self.assertEqual(s1.id, 1) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_singleinstancecreation(self):\n b1 = BaseModel()\n self.assertEqual(type(b1.id), str)\n self.assertEqual(type(b1.created_at), datetime)\n self.assertEqual(type(b1.updated_at), datetime)",
"def test_create(self):\n pass",
"def test_create_run(self):\n pass",
... | [
"0.76196355",
"0.75357515",
"0.73693967",
"0.72787684",
"0.72756666",
"0.71390694",
"0.71213174",
"0.7006854",
"0.6989904",
"0.6914466",
"0.6898167",
"0.68932796",
"0.6874841",
"0.6867281",
"0.6837268",
"0.682788",
"0.6796311",
"0.6785241",
"0.67483896",
"0.67466414",
"0.6740... | 0.6622727 | 33 |
This function tests for single instance creation | def test_multiplesquarecreation(self):
Square.reset_objects()
s1 = Square(10)
s2 = Square(2)
s3 = Square(3)
self.assertEqual(s1.id, 1)
self.assertEqual(s2.id, 2)
self.assertEqual(s3.id, 3) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_singleinstancecreation(self):\n b1 = BaseModel()\n self.assertEqual(type(b1.id), str)\n self.assertEqual(type(b1.created_at), datetime)\n self.assertEqual(type(b1.updated_at), datetime)",
"def test_create(self):\n pass",
"def test_create_run(self):\n pass",
... | [
"0.76196355",
"0.75357515",
"0.73693967",
"0.72787684",
"0.72756666",
"0.71390694",
"0.71213174",
"0.7006854",
"0.6989904",
"0.6914466",
"0.6898167",
"0.68932796",
"0.6874841",
"0.6867281",
"0.6837268",
"0.682788",
"0.6796311",
"0.6785241",
"0.67483896",
"0.67466414",
"0.6740... | 0.0 | -1 |
This function tests for single instance creation | def test_singlesquarecreationwithallvalues(self):
Square.reset_objects()
s1 = Square(10, 10, 10, 10)
self.assertEqual(s1.width, 10)
self.assertEqual(s1.height, 10)
self.assertEqual(s1.x, 10)
self.assertEqual(s1.y, 10)
self.assertEqual(s1.id, 10)
s2 = Squar... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_singleinstancecreation(self):\n b1 = BaseModel()\n self.assertEqual(type(b1.id), str)\n self.assertEqual(type(b1.created_at), datetime)\n self.assertEqual(type(b1.updated_at), datetime)",
"def test_create(self):\n pass",
"def test_create_run(self):\n pass",
... | [
"0.76196355",
"0.75357515",
"0.73693967",
"0.72787684",
"0.72756666",
"0.71390694",
"0.71213174",
"0.7006854",
"0.6989904",
"0.6914466",
"0.6898167",
"0.68932796",
"0.6874841",
"0.6867281",
"0.6837268",
"0.682788",
"0.6796311",
"0.6785241",
"0.67483896",
"0.67466414",
"0.6740... | 0.0 | -1 |
This function tests for single instance creation | def test_multiplesquarecreationwithallvalues(self):
Square.reset_objects()
s1 = Square(10, 10, 10, 10)
self.assertEqual(s1.width, 10)
self.assertEqual(s1.height, 10)
self.assertEqual(s1.x, 10)
self.assertEqual(s1.y, 10)
self.assertEqual(s1.id, 10) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_singleinstancecreation(self):\n b1 = BaseModel()\n self.assertEqual(type(b1.id), str)\n self.assertEqual(type(b1.created_at), datetime)\n self.assertEqual(type(b1.updated_at), datetime)",
"def test_create(self):\n pass",
"def test_create_run(self):\n pass",
... | [
"0.761875",
"0.753729",
"0.73705167",
"0.72800153",
"0.7275934",
"0.7140201",
"0.712181",
"0.7006881",
"0.69908947",
"0.6915506",
"0.68986833",
"0.68926793",
"0.6874148",
"0.6866983",
"0.6838875",
"0.68277276",
"0.67965597",
"0.67860496",
"0.6748356",
"0.67461395",
"0.6740085... | 0.0 | -1 |
This function tests for bad size value with string | def test_badsizevaluewithstring(self):
Rectangle.reset_objects()
with self.assertRaises(TypeError) as e:
r1 = Square("foo", 1, 2, 3)
self.assertEqual(str(e.exception), 'width must be an integer') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __size_restriction_incorrect_string_number(self):\n\n strTestName = 'String size lower than a number (incorrect)'\n RxCSObject = _RxCSobject()\n\n RxCSObject.paramAddMan('parameter1', 'String parameter')\n RxCSObject.paramType('parameter1', str)\n RxCSObject.paramSizHE('param... | [
"0.7669863",
"0.7477623",
"0.7419048",
"0.7352341",
"0.7311576",
"0.72015226",
"0.70834106",
"0.6952896",
"0.6923858",
"0.69134605",
"0.6859382",
"0.6821244",
"0.67668146",
"0.66895366",
"0.6682275",
"0.66676044",
"0.6610148",
"0.6606171",
"0.6576019",
"0.65450525",
"0.653307... | 0.72065604 | 5 |
This function tests for bad x value with string | def test_badxvaluewithstring(self):
Rectangle.reset_objects()
with self.assertRaises(TypeError) as e:
r1 = Square(1, "foo", 2, 3)
self.assertEqual(str(e.exception), 'x must be an integer') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_check_x_ValueError(self):\n self.assertRaisesRegex(\n ValueError,\n 'x must be >= 0',\n Rectangle,\n 4, 2, -1, 0, 12\n )",
"def test_is_valid_label_value_invalid_input():\n # test length violations\n assert not is_valid_label_value(value=f\... | [
"0.69795847",
"0.6597234",
"0.6589841",
"0.6565734",
"0.6538347",
"0.64426655",
"0.6354306",
"0.6324324",
"0.6260431",
"0.625534",
"0.62540674",
"0.6247289",
"0.6183881",
"0.61823475",
"0.61577374",
"0.615086",
"0.6148752",
"0.6140381",
"0.61370695",
"0.61370695",
"0.6133567"... | 0.7074882 | 0 |
This function tests for bad y value with string | def test_badyvaluewithstring(self):
Rectangle.reset_objects()
with self.assertRaises(TypeError) as e:
r1 = Square(1, 2, "foo", 3)
self.assertEqual(str(e.exception), 'y must be an integer') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_check_y_not_int_not_float(wage_X_y, wage_gam):\n X, y = wage_X_y\n y_str = ['hi'] * len(y)\n\n with pytest.raises(ValueError):\n check_y(y_str, wage_gam.link, wage_gam.distribution)",
"def test_check_y_TypeError_(self):\n self.assertRaisesRegex(\n ValueError,\n ... | [
"0.753807",
"0.70889246",
"0.69732106",
"0.66039157",
"0.640876",
"0.63733834",
"0.6315114",
"0.6285221",
"0.6224574",
"0.62008274",
"0.61970156",
"0.61897",
"0.61739707",
"0.61024666",
"0.6070352",
"0.6051122",
"0.60313845",
"0.5990926",
"0.59631824",
"0.5960594",
"0.5958864... | 0.6278318 | 8 |
This function tests for bad size value with tuple | def test_badsizevaluewithtuple(self):
Rectangle.reset_objects()
with self.assertRaises(TypeError) as e:
r1 = Square((1, 2), 1, 2, 3)
self.assertEqual(str(e.exception), 'width must be an integer') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __size_restriction_incorrect_tuple_number(self):\n\n strTestName = 'Tuple size lower than a number (incorrect)'\n RxCSObject = _RxCSobject()\n\n RxCSObject.paramAddMan('parameter1', 'Tuple parameter')\n RxCSObject.paramType('parameter1', tuple)\n RxCSObject.paramSizL('paramet... | [
"0.7745333",
"0.76174873",
"0.7546294",
"0.7530494",
"0.74570197",
"0.7148024",
"0.7107654",
"0.706195",
"0.6984527",
"0.6874661",
"0.6859477",
"0.6855563",
"0.67292804",
"0.67081946",
"0.6689908",
"0.66259843",
"0.65792155",
"0.6528646",
"0.64376557",
"0.6431915",
"0.6411197... | 0.68554556 | 12 |
This function tests for bad x value with tuple | def test_badxvaluewithtuple(self):
Rectangle.reset_objects()
with self.assertRaises(TypeError) as e:
r1 = Square(1, (1, 2), 2, 3)
self.assertEqual(str(e.exception), 'x must be an integer') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_tuples_to_avoid(self):\n self.assertFalse(\n any(key in self.resultDict and self.resultDict[key] == tuplesToAvoid[key] for key in tuplesToAvoid))",
"def __allowed_values_correct_tuple(self):\n strTestName = 'Values of a tuple (correct)'\n RxCSObject = _RxCSobject()\n\n ... | [
"0.7006258",
"0.69747514",
"0.6616531",
"0.6556147",
"0.6536729",
"0.6535097",
"0.6523847",
"0.65184593",
"0.64959896",
"0.6440684",
"0.6398612",
"0.6395714",
"0.637838",
"0.6376401",
"0.6351738",
"0.6275108",
"0.62562424",
"0.62542605",
"0.62175417",
"0.6212631",
"0.6210541"... | 0.69840086 | 1 |
This function tests for bad y value with tuple | def test_badyvaluewithtuple(self):
Rectangle.reset_objects()
with self.assertRaises(TypeError) as e:
r1 = Square(1, 2, (1, 2), 3)
self.assertEqual(str(e.exception), 'y must be an integer') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_check_y_not_int_not_float(wage_X_y, wage_gam):\n X, y = wage_X_y\n y_str = ['hi'] * len(y)\n\n with pytest.raises(ValueError):\n check_y(y_str, wage_gam.link, wage_gam.distribution)",
"def test_t_paired_bad_data(self):\r\n self.assertRaises(ValueError, t_paired, self.y, [1, 2, 3])... | [
"0.6962535",
"0.67410064",
"0.66566956",
"0.64912486",
"0.64383566",
"0.6384014",
"0.6354288",
"0.6308136",
"0.62844115",
"0.62844115",
"0.62844115",
"0.6284164",
"0.62556845",
"0.62373424",
"0.62274224",
"0.62152624",
"0.6158262",
"0.6144637",
"0.6132665",
"0.60868853",
"0.6... | 0.62552977 | 13 |
This function tests for bad size value with list | def test_badsizevaluelists(self):
Rectangle.reset_objects()
with self.assertRaises(TypeError) as e:
r1 = Square([1, 2], 1, 2, 3)
self.assertEqual(str(e.exception), 'width must be an integer') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __size_restriction_incorrect_list_number(self):\n\n strTestName = 'List size lower or equal to a number (incorrect)'\n RxCSObject = _RxCSobject()\n\n RxCSObject.paramAddMan('parameter1', 'List parameter')\n RxCSObject.paramType('parameter1', list)\n RxCSObject.paramSizLE('par... | [
"0.7617451",
"0.74557054",
"0.7381067",
"0.7376783",
"0.72377795",
"0.71048003",
"0.69397753",
"0.6922764",
"0.6913843",
"0.6894856",
"0.6888855",
"0.6861403",
"0.6846423",
"0.680957",
"0.67752904",
"0.6770166",
"0.67468673",
"0.67278963",
"0.67147034",
"0.66834074",
"0.66818... | 0.6899248 | 9 |
This function tests for bad x value with list | def test_badxvaluewithlist(self):
Rectangle.reset_objects()
with self.assertRaises(TypeError) as e:
r1 = Square(1, [1, 2], 2, 3)
self.assertEqual(str(e.exception), 'x must be an integer') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __allowed_values_incorrect_list_with_allowed_values(self):\n strTestName = 'Value NaN given in a list with allowed values (incorrect)'\n RxCSObject = _RxCSobject()\n\n RxCSObject.paramAddMan('parameter1', 'Numpy Array 2D')\n RxCSObject.paramAllowed('parameter1', range(int(2e3)) + [n... | [
"0.68315846",
"0.65919036",
"0.6537355",
"0.6444303",
"0.641923",
"0.6327543",
"0.6288081",
"0.6235862",
"0.6219361",
"0.61817026",
"0.6179775",
"0.61674714",
"0.61317503",
"0.6115415",
"0.6108486",
"0.61075026",
"0.6064361",
"0.60562",
"0.6040578",
"0.6025303",
"0.6013717",
... | 0.7108924 | 0 |
This function tests for bad y value with list | def test_badyvaluewithlist(self):
Rectangle.reset_objects()
with self.assertRaises(TypeError) as e:
r1 = Square(1, 2, [1, 2], 3)
self.assertEqual(str(e.exception), 'y must be an integer') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_check_y_not_int_not_float(wage_X_y, wage_gam):\n X, y = wage_X_y\n y_str = ['hi'] * len(y)\n\n with pytest.raises(ValueError):\n check_y(y_str, wage_gam.link, wage_gam.distribution)",
"def test_check_y_not_min_samples(wage_X_y, wage_gam):\n X, y = wage_X_y\n\n with pytest.raises(Va... | [
"0.6945641",
"0.6639127",
"0.65148705",
"0.6430637",
"0.6396397",
"0.637535",
"0.63702226",
"0.6319263",
"0.62643445",
"0.621969",
"0.6160414",
"0.61287785",
"0.61017686",
"0.60858613",
"0.6033019",
"0.60267466",
"0.6020096",
"0.6019205",
"0.5973048",
"0.59617954",
"0.5953005... | 0.6378812 | 5 |
This function tests for bad size value with bools | def test_badsizevaluebool(self):
Rectangle.reset_objects()
with self.assertRaises(TypeError) as e:
r1 = Square(True, 1, 2, 3)
self.assertEqual(str(e.exception), 'width must be an integer') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _check_size(size):\r\n\r\n if not isinstance(size, (list, tuple)):\r\n raise ValueError(\"Size must be a tuple\")\r\n if len(size) != 2:\r\n raise ValueError(\"Size must be a tuple of length 2\")\r\n if size[0] < 0 or size[1] < 0:\r\n raise ValueError(\"Width and height must be >=... | [
"0.71509224",
"0.68044245",
"0.6784293",
"0.67276603",
"0.6585997",
"0.654349",
"0.6481282",
"0.6463",
"0.64172286",
"0.6415458",
"0.64140904",
"0.63802457",
"0.6275432",
"0.6251223",
"0.62397385",
"0.6207709",
"0.61241347",
"0.6112032",
"0.6096959",
"0.6092303",
"0.6078279",... | 0.71739995 | 0 |
This function tests for bad x value with bools | def test_badxvaluewithbools(self):
Rectangle.reset_objects()
with self.assertRaises(TypeError) as e:
r1 = Square(1, False, 2, 3)
self.assertEqual(str(e.exception), 'x must be an integer') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _isvalid(self, x):\n return (x <= self.n) & (x > 0)",
"def check_for_bool(check):",
"def __bool__(x):\n if x.value == 1:\n return True\n elif x.value == -1:\n return False\n else:\n raise ValueError('cannot determine boolean value of Unknown')",
... | [
"0.7306708",
"0.7250086",
"0.71691465",
"0.6997383",
"0.6966766",
"0.6811232",
"0.66589147",
"0.66078395",
"0.6581805",
"0.65434927",
"0.65434927",
"0.6454775",
"0.6425078",
"0.642356",
"0.64137745",
"0.6384111",
"0.63749194",
"0.63547003",
"0.63211346",
"0.6297659",
"0.62824... | 0.72062206 | 2 |
This function tests for bad y value with bools | def test_badyvaluewithbools(self):
Rectangle.reset_objects()
with self.assertRaises(TypeError) as e:
r1 = Square(1, 2, True, 3)
self.assertEqual(str(e.exception), 'y must be an integer') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def has_y(self):\n return any(map(lambda s: s.is_y, self))",
"def false_neg(yt, yp) -> Any:\n from keras import backend as K\n return K.sum(K.cast((1 - yp) * (0 + yt) > 0.5, 'float')) / K.maximum(1.0, K.sum(0 + yt))",
"def isfalse(variable):\n\n # Return the answer\n return variable in [0, 0... | [
"0.69083273",
"0.6695718",
"0.6674473",
"0.66075134",
"0.6587407",
"0.6464221",
"0.64067847",
"0.6404094",
"0.6357871",
"0.63352954",
"0.6284141",
"0.6274285",
"0.62531525",
"0.6222517",
"0.62003815",
"0.6190041",
"0.6136608",
"0.60998005",
"0.6085489",
"0.60599977",
"0.60529... | 0.6742841 | 1 |
This function tests for bad size value with floats | def test_badsizevaluefloats(self):
Rectangle.reset_objects()
with self.assertRaises(TypeError) as e:
r1 = Square(float(1), 1, 2, 3)
self.assertEqual(str(e.exception), 'width must be an integer') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def check_for_float(check):",
"def is_float(self, size=None):\n return False",
"def test_float(self):\n self.assertFalse(validate_measure_input('0.0', self.measures))\n self.assertFalse(validate_measure_input('1.0', self.measures))\n self.assertFalse(validate_measure_input('1.1', se... | [
"0.7329806",
"0.726083",
"0.6919333",
"0.6791456",
"0.67735356",
"0.6667604",
"0.6654166",
"0.6617173",
"0.66136104",
"0.6580767",
"0.6558897",
"0.65265524",
"0.6493573",
"0.6468674",
"0.6459855",
"0.6433279",
"0.64139265",
"0.64002323",
"0.6386368",
"0.63839954",
"0.637679",... | 0.74446696 | 0 |
This function tests for bad x value with floats | def test_badxvaluewithfloats(self):
Rectangle.reset_objects()
with self.assertRaises(TypeError) as e:
r1 = Square(1, float(1), 2, 3)
self.assertEqual(str(e.exception), 'x must be an integer') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def check_for_float(check):",
"def test_check_X_not_int_not_float():\n with pytest.raises(ValueError):\n check_X(['hi'], verbose=False)",
"def is_float(x):\r\n try:\r\n float(x)\r\n except ValueError:\r\n return False\r\n return True",
"def test_float(self):\n self.ass... | [
"0.78297204",
"0.76367164",
"0.7104965",
"0.7084192",
"0.7035302",
"0.7031837",
"0.68980247",
"0.67634743",
"0.67634743",
"0.6742131",
"0.6734622",
"0.6722385",
"0.66641873",
"0.6663973",
"0.6649409",
"0.6641301",
"0.6619884",
"0.6614162",
"0.66128445",
"0.65823627",
"0.65799... | 0.7143771 | 2 |
This function tests for bad y value with floats | def test_badyvaluewithfloats(self):
Rectangle.reset_objects()
with self.assertRaises(TypeError) as e:
r1 = Square(1, 2, float(1), 3)
self.assertEqual(str(e.exception), 'y must be an integer') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_check_y_not_int_not_float(wage_X_y, wage_gam):\n X, y = wage_X_y\n y_str = ['hi'] * len(y)\n\n with pytest.raises(ValueError):\n check_y(y_str, wage_gam.link, wage_gam.distribution)",
"def test_cast_y_axis_extrema_invalid_input(self):\r\n self.assertRaises(ValueError, _cast_y_axis... | [
"0.7877926",
"0.705509",
"0.690517",
"0.67413193",
"0.665159",
"0.6554969",
"0.6444111",
"0.6441061",
"0.63995457",
"0.61819017",
"0.6176776",
"0.6150717",
"0.6132919",
"0.6119594",
"0.61141986",
"0.610733",
"0.61016685",
"0.6098543",
"0.609524",
"0.6089466",
"0.60824674",
... | 0.6870452 | 3 |
This function tests for bad size value with sets | def test_badsizevaluesets(self):
Rectangle.reset_objects()
with self.assertRaises(TypeError) as e:
r1 = Square({1, 2, 3}, 1, 2, 3)
self.assertEqual(str(e.exception), 'width must be an integer') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_length(self):\n self.assertEquals(0, len(djset()))\n self.assertEquals(3, len(djset([1, 2, 3])))\n self.assertEquals(6, len(djset([1, 2, 3], [4, 5, 6])))\n self.assertEquals(6, len(djset([1, 2, 3], [4, 5, 6], [5, 6])))",
"def test_normal_case():\n assert(minDeletionSize(['... | [
"0.682289",
"0.67507493",
"0.67083627",
"0.6673719",
"0.6664548",
"0.661408",
"0.64985293",
"0.64856684",
"0.64658356",
"0.64540344",
"0.64460754",
"0.64249414",
"0.641291",
"0.63752574",
"0.6371614",
"0.632714",
"0.6311753",
"0.6287061",
"0.62287503",
"0.62117106",
"0.620063... | 0.66117626 | 6 |
This function tests for bad x value with sets | def test_badxvaluewithsets(self):
Rectangle.reset_objects()
with self.assertRaises(TypeError) as e:
r1 = Square(1, {1, 2, 3}, 2, 3)
self.assertEqual(str(e.exception), 'x must be an integer') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_values(self):\n # Assume\n df1 = pd.DataFrame([[1, 6, 2, 3, 19],\n [4, 5, 8, 6, 30],\n [4, 5, 12, 8, 22],\n [4, 7, 9, 5, 21],\n [7, 8, 9, 12, 5]],\n columns=[... | [
"0.6515592",
"0.65142566",
"0.64434457",
"0.6162853",
"0.61155057",
"0.60888386",
"0.60695523",
"0.603732",
"0.6008015",
"0.5992704",
"0.5987261",
"0.5945447",
"0.5944256",
"0.59343463",
"0.5927906",
"0.59046",
"0.5895334",
"0.5876729",
"0.5865866",
"0.58559877",
"0.58026785"... | 0.705099 | 0 |
This function tests for bad y value with sets | def test_badyvaluewithsets(self):
Rectangle.reset_objects()
with self.assertRaises(TypeError) as e:
r1 = Square(1, 2, {1, 2, 3}, 3)
self.assertEqual(str(e.exception), 'y must be an integer') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_y(self):\n g = gca()\n lines = g.get_lines() \n self.assertEqual(lines[0].get_ydata().tolist(), [3, 3, 1, 1, 3])",
"def test_negative_stop(self):\n self.assertArrayEqual(self.dset[2:-2], self.arr[2:-2])",
"def test_Y_no_std (self):\n X, Y = self.dm.get_data(std=True,... | [
"0.65882415",
"0.65631443",
"0.64665055",
"0.6315038",
"0.62378085",
"0.622772",
"0.6197603",
"0.6169532",
"0.6168688",
"0.60904074",
"0.60815674",
"0.60759354",
"0.6075151",
"0.60498685",
"0.6039923",
"0.60382074",
"0.5976908",
"0.5960635",
"0.59492457",
"0.59384733",
"0.590... | 0.6515348 | 2 |
This function tests for bad size value with sets | def test_badsizevaluedicts(self):
Rectangle.reset_objects()
with self.assertRaises(TypeError) as e:
r1 = Square({"foo": 1}, 1, 2, 3)
self.assertEqual(str(e.exception), 'width must be an integer') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_length(self):\n self.assertEquals(0, len(djset()))\n self.assertEquals(3, len(djset([1, 2, 3])))\n self.assertEquals(6, len(djset([1, 2, 3], [4, 5, 6])))\n self.assertEquals(6, len(djset([1, 2, 3], [4, 5, 6], [5, 6])))",
"def test_normal_case():\n assert(minDeletionSize(['... | [
"0.6822824",
"0.6750266",
"0.6708674",
"0.66726536",
"0.6664144",
"0.6613117",
"0.6610604",
"0.64974403",
"0.64861095",
"0.646559",
"0.64538795",
"0.64456564",
"0.64242584",
"0.6412628",
"0.6374831",
"0.6372351",
"0.63262194",
"0.63110983",
"0.6287548",
"0.6228228",
"0.621118... | 0.6099169 | 36 |
This function tests for bad x value with dicts | def test_badxvaluewithdicts(self):
Rectangle.reset_objects()
with self.assertRaises(TypeError) as e:
r1 = Square(1, {"foo": 1}, 2, 3)
self.assertEqual(str(e.exception), 'x must be an integer') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_badyvaluewithdicts(self):\n Rectangle.reset_objects()\n with self.assertRaises(TypeError) as e:\n r1 = Square(1, 2, {\"foo\": 1}, 3)\n self.assertEqual(str(e.exception), 'y must be an integer')",
"def check_for_dict(check):",
"def test_bad_valuetype():\n test = [{'ke... | [
"0.7063102",
"0.6901642",
"0.68893194",
"0.67338705",
"0.6730255",
"0.66233486",
"0.65747875",
"0.6557071",
"0.6369715",
"0.6351837",
"0.6335188",
"0.6329998",
"0.6318528",
"0.6300104",
"0.62784344",
"0.62771666",
"0.6276584",
"0.62739366",
"0.62530696",
"0.6234832",
"0.62275... | 0.74902976 | 0 |
This function tests for bad y value with dicts | def test_badyvaluewithdicts(self):
Rectangle.reset_objects()
with self.assertRaises(TypeError) as e:
r1 = Square(1, 2, {"foo": 1}, 3)
self.assertEqual(str(e.exception), 'y must be an integer') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_check_y_not_int_not_float(wage_X_y, wage_gam):\n X, y = wage_X_y\n y_str = ['hi'] * len(y)\n\n with pytest.raises(ValueError):\n check_y(y_str, wage_gam.link, wage_gam.distribution)",
"def _validate_dict_data(self, expected, actual):\n for k, v in expected.iteritems():\n ... | [
"0.65423876",
"0.6532567",
"0.6517453",
"0.6497255",
"0.62020665",
"0.6187707",
"0.61815435",
"0.61809665",
"0.6161865",
"0.61170024",
"0.6088386",
"0.6066407",
"0.60333383",
"0.60322386",
"0.60267806",
"0.60139036",
"0.60025436",
"0.5979485",
"0.5971068",
"0.5970892",
"0.596... | 0.6933743 | 0 |
This function tests for bad size value with funcs | def test_badsizevaluefuncs(self):
Rectangle.reset_objects()
with self.assertRaises(TypeError) as e:
r1 = Square(print(), 1, 2, 3)
self.assertEqual(str(e.exception), 'width must be an integer') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_allowed_arg_sizes(submit_function_and_get_result, endpoint, size):\n r = submit_function_and_get_result(\n endpoint, func=large_arg_consumer, func_args=(bytearray(size),)\n )\n assert r.result == size",
"def test_arg_size_too_large(submit_function_and_get_result, endpoint, size=55000000)... | [
"0.69534785",
"0.6840836",
"0.66036606",
"0.65998334",
"0.65262866",
"0.65258205",
"0.6511323",
"0.6508684",
"0.6490107",
"0.6488285",
"0.6476385",
"0.64397216",
"0.6432376",
"0.6383667",
"0.63600254",
"0.6314917",
"0.63026154",
"0.62978524",
"0.6285855",
"0.6236728",
"0.6231... | 0.6773114 | 2 |
This function tests for bad x value with funcs | def test_badxvaluewithfuncs(self):
Rectangle.reset_objects()
with self.assertRaises(TypeError) as e:
r1 = Square(1, print(), 2, 3)
self.assertEqual(str(e.exception), 'x must be an integer') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_error(f, x):\n try:\n f(x)\n return False\n except:\n return True",
"def test_correct_value(self):\n self.assertTrue(py_function(6) == 36)\n self.assertFalse(py_function(5) == 9)\n for i in range(0, 10):\n self.assertTrue(py_function(i) == i**2 if... | [
"0.70177335",
"0.6598538",
"0.6551677",
"0.6535496",
"0.64791",
"0.64751804",
"0.6444109",
"0.6384782",
"0.63809425",
"0.6376168",
"0.6334867",
"0.63270766",
"0.6288615",
"0.6278401",
"0.62581235",
"0.62579507",
"0.62479675",
"0.6207513",
"0.6186114",
"0.6177712",
"0.6177712"... | 0.7192149 | 0 |
This function tests for bad y value with funcs | def test_badyvaluewithfuncs(self):
Rectangle.reset_objects()
with self.assertRaises(TypeError) as e:
r1 = Square(1, 2, print(), 3)
self.assertEqual(str(e.exception), 'y must be an integer') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_check_y_not_int_not_float(wage_X_y, wage_gam):\n X, y = wage_X_y\n y_str = ['hi'] * len(y)\n\n with pytest.raises(ValueError):\n check_y(y_str, wage_gam.link, wage_gam.distribution)",
"def test_cast_y_axis_extrema_invalid_input(self):\r\n self.assertRaises(ValueError, _cast_y_axis... | [
"0.7210701",
"0.66451573",
"0.6622491",
"0.64522356",
"0.64492494",
"0.6382686",
"0.6289286",
"0.62603635",
"0.62603635",
"0.6251412",
"0.62116814",
"0.61983037",
"0.61954623",
"0.6180743",
"0.6157754",
"0.61327106",
"0.6124652",
"0.61167055",
"0.61152244",
"0.61152244",
"0.6... | 0.6284567 | 7 |
This function tests for NaN x value | def test_NaNsize(self):
Rectangle.reset_objects()
with self.assertRaises(TypeError) as e:
r1 = Square(float('nan'), 10, 5, 7)
self.assertEqual(str(e.exception), 'width must be an integer') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def isnan(x):\n return False",
"def is_nan(x):\n return (x is np.nan or x != x)",
"def _is_nan(self, x: any) -> bool:\n return isinstance(x, float) and math.isnan(x)",
"def isNan(x: float) -> bool:\n return x != x",
"def pd_isnan(val):\n return val is None or val != val",
"def isfi... | [
"0.863595",
"0.8367752",
"0.8344786",
"0.8303544",
"0.8025045",
"0.7922485",
"0.78387076",
"0.78242415",
"0.7787158",
"0.7765412",
"0.7761106",
"0.7740717",
"0.7716268",
"0.7650367",
"0.7610521",
"0.75894",
"0.7503893",
"0.7333747",
"0.7333366",
"0.7318838",
"0.7269667",
"0... | 0.0 | -1 |
This function tests for NaN x value | def test_NaNx(self):
Rectangle.reset_objects()
with self.assertRaises(TypeError) as e:
r1 = Square(10, float('nan'), 5, 7)
self.assertEqual(str(e.exception), 'x must be an integer') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def isnan(x):\n return False",
"def is_nan(x):\n return (x is np.nan or x != x)",
"def _is_nan(self, x: any) -> bool:\n return isinstance(x, float) and math.isnan(x)",
"def isNan(x: float) -> bool:\n return x != x",
"def pd_isnan(val):\n return val is None or val != val",
"def isfi... | [
"0.863595",
"0.8367752",
"0.8344786",
"0.8303544",
"0.8025045",
"0.7922485",
"0.78387076",
"0.78242415",
"0.7787158",
"0.7765412",
"0.7761106",
"0.7740717",
"0.7716268",
"0.7650367",
"0.7610521",
"0.75894",
"0.7503893",
"0.7333747",
"0.7333366",
"0.7318838",
"0.7269667",
"0... | 0.66272634 | 46 |
This function tests for NaN y value | def test_NaNy(self):
Rectangle.reset_objects()
with self.assertRaises(TypeError) as e:
r1 = Square(10, 10, float('nan'), 7)
self.assertEqual(str(e.exception), 'y must be an integer') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def pd_isnan(val):\n return val is None or val != val",
"def nan_value(data):\n return data.isnull().any()",
"def isnan(x):\n return False",
"def is_nan(x):\n return (x is np.nan or x != x)",
"def isNan(x: float) -> bool:\n return x != x",
"def _is_nan(self, x: any) -> bool:\n r... | [
"0.76437473",
"0.74453664",
"0.7415195",
"0.7254075",
"0.71644074",
"0.711693",
"0.7088715",
"0.70583355",
"0.70240784",
"0.7012848",
"0.70034516",
"0.69880223",
"0.6928172",
"0.6925305",
"0.68984574",
"0.6816775",
"0.6781656",
"0.6743059",
"0.67362624",
"0.67345786",
"0.6718... | 0.6417035 | 42 |
This function tests for all NaN values | def test_NaNall(self):
Rectangle.reset_objects()
with self.assertRaises(TypeError) as e:
r1 = Square(
float('nan'), float('nan'), float('nan'), float('nan'))
self.assertEqual(str(e.exception), 'width must be an integer') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def nan_value(data):\n return data.isnull().any()",
"def pd_isnan(val):\n return val is None or val != val",
"def checkNaN(data):\n if data.isnull().values.any():\n N = data.isnull().sum().sum()\n print(\"There are {} missing values.\".format(N))",
"def is_nan(x):\n return (x is np.... | [
"0.81304824",
"0.8038728",
"0.80194646",
"0.7923684",
"0.792202",
"0.785646",
"0.78156465",
"0.78074735",
"0.77264684",
"0.76245695",
"0.75311315",
"0.75224787",
"0.7491541",
"0.7444155",
"0.74408966",
"0.74337053",
"0.7408254",
"0.7401185",
"0.73954564",
"0.73870057",
"0.732... | 0.0 | -1 |
This function tests for inf size value | def test_infsize(self):
Rectangle.reset_objects()
with self.assertRaises(TypeError) as e:
r1 = Square(float('Inf'), 10, 5, 7)
self.assertEqual(str(e.exception), 'width must be an integer') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def isinf(x):\n return False",
"def is_infinitesimal(G):\n return False",
"def isinf(data):\n return _make.isinf(data)",
"def full(self):\n return self.size >= self.maxsize",
"def has_definite_size(iterable):\n return hasattr(iterable, '__len__')",
"def isFull(T):\r\n return... | [
"0.6863899",
"0.67491794",
"0.6712881",
"0.6419701",
"0.6392617",
"0.6204324",
"0.613977",
"0.6129744",
"0.6044467",
"0.601842",
"0.5986852",
"0.5983175",
"0.59760034",
"0.5965754",
"0.59569365",
"0.5937848",
"0.59305644",
"0.59136516",
"0.59124273",
"0.5912097",
"0.58831096"... | 0.5985222 | 11 |
This function tests for inf x value | def test_infx(self):
Rectangle.reset_objects()
with self.assertRaises(TypeError) as e:
r1 = Square(10, float('Inf'), 5, 7)
self.assertEqual(str(e.exception), 'x must be an integer') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def isinf(x):\n return False",
"def isfinite ( x ) : \n y = float ( x ) \n return ( not math.isinf ( y ) ) and ( not math.isnan ( y ) )",
"def isinf(data):\n return _make.isinf(data)",
"def torch_isnotfinite(x):\n not_inf = ((x + 1) != x)\n not_nan = (x == x)\n return ... | [
"0.8768925",
"0.81358874",
"0.8017472",
"0.76561236",
"0.75882477",
"0.75802815",
"0.7430569",
"0.7408449",
"0.73875463",
"0.7387016",
"0.7318303",
"0.72317284",
"0.72256273",
"0.7037075",
"0.7012861",
"0.7012387",
"0.6915384",
"0.6913104",
"0.6898441",
"0.68432254",
"0.68393... | 0.0 | -1 |
This function tests for inf y value | def test_infy(self):
Rectangle.reset_objects()
with self.assertRaises(TypeError) as e:
r1 = Square(10, 10, float('Inf'), 7)
self.assertEqual(str(e.exception), 'y must be an integer') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def isinf(x):\n return False",
"def isinf(data):\n return _make.isinf(data)",
"def isfinite ( x ) : \n y = float ( x ) \n return ( not math.isinf ( y ) ) and ( not math.isnan ( y ) )",
"def test_finite(self):\n \n Number_of_tests = 1000\n low = -1000\n ... | [
"0.7572634",
"0.7365011",
"0.7271661",
"0.6861912",
"0.6842959",
"0.6728323",
"0.6716243",
"0.6708114",
"0.6569021",
"0.65148795",
"0.6453983",
"0.6430336",
"0.64301854",
"0.6409512",
"0.6393196",
"0.6366821",
"0.631314",
"0.6309159",
"0.6304307",
"0.6232701",
"0.61977315",
... | 0.5810046 | 45 |
This function tests for all inf value | def test_infall(self):
Rectangle.reset_objects()
with self.assertRaises(TypeError) as e:
r1 = Square(
float('Inf'), float('Inf'), float('Inf'), float('Inf'))
self.assertEqual(str(e.exception), 'width must be an integer') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def isinf(x):\n return False",
"def isinf(data):\n return _make.isinf(data)",
"def test_finite(self):\n \n Number_of_tests = 1000\n low = -1000\n high = 1000\n for i in range(Number_of_tests):\n x = np.random.rand(100) * (high - low) + low\n y ... | [
"0.8126929",
"0.7899565",
"0.7637224",
"0.75367105",
"0.75353324",
"0.7401335",
"0.7208366",
"0.7165761",
"0.71358037",
"0.70212376",
"0.6998133",
"0.6993802",
"0.6990964",
"0.696141",
"0.69562006",
"0.6931944",
"0.6856454",
"0.67528623",
"0.6732267",
"0.6608429",
"0.6579729"... | 0.0 | -1 |
This function tests the size getter | def test_sizegetter(self):
Rectangle.reset_objects()
r1 = Square(1, 2, 2, 3)
self.assertEqual(r1.size, 1) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_size(self):\n ...",
"def get_size(self):",
"def getSize(self):\n assert False",
"def size(self):",
"def size(self) -> int:",
"def size() -> int:\n ...",
"def _size(self):\n raise NotImplementedError",
"def getSize(self) -> int:\n ...",
"def getSize(self) -... | [
"0.79357636",
"0.7931725",
"0.78921765",
"0.7866568",
"0.7854694",
"0.7824038",
"0.7799345",
"0.7788262",
"0.7788262",
"0.7726975",
"0.76932454",
"0.7617639",
"0.75942594",
"0.75844234",
"0.7560417",
"0.75556916",
"0.75556916",
"0.75556916",
"0.7538814",
"0.753443",
"0.751555... | 0.8108042 | 0 |
This function tests the size setter | def test_sizesetter(self):
Rectangle.reset_objects()
r1 = Square(1, 2, 2, 3)
self.assertEqual(r1.size, 1)
r1.size = 100
self.assertEqual(r1.size, 100) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_sizesetterwithset(self):\n Rectangle.reset_objects()\n with self.assertRaises(TypeError) as e:\n r1 = Square(1, 2, 2, 3)\n self.assertEqual(r1.size, 1)\n r1.size = {\"foo\", 2}\n self.assertEqual(str(e.exception), \"width must be an integer\")",
"def... | [
"0.7792907",
"0.7693151",
"0.7666621",
"0.75800925",
"0.7571968",
"0.7473297",
"0.7417849",
"0.73012525",
"0.7267939",
"0.7258394",
"0.7256592",
"0.7232874",
"0.71553475",
"0.71380746",
"0.70957935",
"0.7058936",
"0.7051922",
"0.70510983",
"0.69948095",
"0.699118",
"0.6963985... | 0.8216275 | 0 |
This function tests the size setter with string | def test_sizesetterwithstring(self):
Rectangle.reset_objects()
with self.assertRaises(TypeError) as e:
r1 = Square(1, 2, 2, 3)
self.assertEqual(r1.size, 1)
r1.size = "foo"
self.assertEqual(str(e.exception), "width must be an integer") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __size_restriction_correct_string_number(self):\n\n strTestName = 'String size equal to a string (correct)'\n RxCSObject = _RxCSobject()\n\n RxCSObject.paramAddMan('parameter1', 'String parameter')\n RxCSObject.paramType('parameter1', str)\n RxCSObject.paramSizEq('parameter1'... | [
"0.7452561",
"0.74343324",
"0.72125316",
"0.7165165",
"0.7162416",
"0.7097643",
"0.70611894",
"0.70401406",
"0.7039656",
"0.700409",
"0.69777435",
"0.6852879",
"0.6768443",
"0.6762896",
"0.6759838",
"0.67128867",
"0.669268",
"0.6645321",
"0.66379744",
"0.6613321",
"0.6609989"... | 0.7871389 | 0 |
This function tests the size setter with string | def test_sizesetterwithtuple(self):
Rectangle.reset_objects()
with self.assertRaises(TypeError) as e:
r1 = Square(1, 2, 2, 3)
self.assertEqual(r1.size, 1)
r1.size = (1, 2)
self.assertEqual(str(e.exception), "width must be an integer") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_sizesetterwithstring(self):\n Rectangle.reset_objects()\n with self.assertRaises(TypeError) as e:\n r1 = Square(1, 2, 2, 3)\n self.assertEqual(r1.size, 1)\n r1.size = \"foo\"\n self.assertEqual(str(e.exception), \"width must be an integer\")",
"def _... | [
"0.7870166",
"0.7451696",
"0.7434786",
"0.72116023",
"0.7166455",
"0.7162464",
"0.7097079",
"0.7064215",
"0.7040272",
"0.70394224",
"0.7003021",
"0.6976711",
"0.6851612",
"0.67697823",
"0.6759529",
"0.67157",
"0.6694425",
"0.6645095",
"0.6636812",
"0.6613152",
"0.6611628",
... | 0.67634845 | 14 |
This function tests the size setter with string | def test_sizesetterwithlist(self):
Rectangle.reset_objects()
with self.assertRaises(TypeError) as e:
r1 = Square(1, 2, 2, 3)
self.assertEqual(r1.size, 1)
r1.size = [1, 2]
self.assertEqual(str(e.exception), "width must be an integer") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_sizesetterwithstring(self):\n Rectangle.reset_objects()\n with self.assertRaises(TypeError) as e:\n r1 = Square(1, 2, 2, 3)\n self.assertEqual(r1.size, 1)\n r1.size = \"foo\"\n self.assertEqual(str(e.exception), \"width must be an integer\")",
"def _... | [
"0.7871389",
"0.7452561",
"0.74343324",
"0.72125316",
"0.7165165",
"0.7162416",
"0.7097643",
"0.70611894",
"0.70401406",
"0.7039656",
"0.700409",
"0.69777435",
"0.6852879",
"0.6768443",
"0.6762896",
"0.6759838",
"0.67128867",
"0.669268",
"0.6645321",
"0.66379744",
"0.6613321"... | 0.65386516 | 25 |
This function tests the size setter with string | def test_sizesetterwithdict(self):
Rectangle.reset_objects()
with self.assertRaises(TypeError) as e:
r1 = Square(1, 2, 2, 3)
self.assertEqual(r1.size, 1)
r1.size = {"foo": 2}
self.assertEqual(str(e.exception), "width must be an integer") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_sizesetterwithstring(self):\n Rectangle.reset_objects()\n with self.assertRaises(TypeError) as e:\n r1 = Square(1, 2, 2, 3)\n self.assertEqual(r1.size, 1)\n r1.size = \"foo\"\n self.assertEqual(str(e.exception), \"width must be an integer\")",
"def _... | [
"0.7871389",
"0.7452561",
"0.74343324",
"0.72125316",
"0.7165165",
"0.7162416",
"0.7097643",
"0.70611894",
"0.70401406",
"0.7039656",
"0.700409",
"0.69777435",
"0.6852879",
"0.6768443",
"0.6762896",
"0.6759838",
"0.67128867",
"0.669268",
"0.66379744",
"0.6613321",
"0.6609989"... | 0.6645321 | 18 |
This function tests the size setter with string | def test_sizesetterwithset(self):
Rectangle.reset_objects()
with self.assertRaises(TypeError) as e:
r1 = Square(1, 2, 2, 3)
self.assertEqual(r1.size, 1)
r1.size = {"foo", 2}
self.assertEqual(str(e.exception), "width must be an integer") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_sizesetterwithstring(self):\n Rectangle.reset_objects()\n with self.assertRaises(TypeError) as e:\n r1 = Square(1, 2, 2, 3)\n self.assertEqual(r1.size, 1)\n r1.size = \"foo\"\n self.assertEqual(str(e.exception), \"width must be an integer\")",
"def _... | [
"0.7871389",
"0.7452561",
"0.74343324",
"0.72125316",
"0.7165165",
"0.7162416",
"0.7097643",
"0.70611894",
"0.70401406",
"0.700409",
"0.69777435",
"0.6852879",
"0.6768443",
"0.6762896",
"0.6759838",
"0.67128867",
"0.669268",
"0.6645321",
"0.66379744",
"0.6613321",
"0.6609989"... | 0.7039656 | 9 |
This function tests the size setter with func | def test_sizesetterwithfunc(self):
Rectangle.reset_objects()
with self.assertRaises(TypeError) as e:
r1 = Square(1, 2, 2, 3)
self.assertEqual(r1.size, 1)
r1.size = print()
self.assertEqual(str(e.exception), "width must be an integer") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_sizesetter(self):\n Rectangle.reset_objects()\n r1 = Square(1, 2, 2, 3)\n self.assertEqual(r1.size, 1)\n r1.size = 100\n self.assertEqual(r1.size, 100)",
"def test_sizesetterwithset(self):\n Rectangle.reset_objects()\n with self.assertRaises(TypeError) as... | [
"0.76074827",
"0.73241836",
"0.7299613",
"0.71340346",
"0.70718694",
"0.70272154",
"0.69879526",
"0.69618094",
"0.69158465",
"0.68551946",
"0.6852976",
"0.68434936",
"0.6834289",
"0.68095237",
"0.68004525",
"0.6782642",
"0.6782323",
"0.6747741",
"0.6726101",
"0.67179966",
"0.... | 0.7818356 | 0 |
This function tests the size setter with func | def test_sizesetterwithfloat(self):
Rectangle.reset_objects()
with self.assertRaises(TypeError) as e:
r1 = Square(1, 2, 2, 3)
self.assertEqual(r1.size, 1)
r1.size = float(1)
self.assertEqual(str(e.exception), "width must be an integer") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_sizesetterwithfunc(self):\n Rectangle.reset_objects()\n with self.assertRaises(TypeError) as e:\n r1 = Square(1, 2, 2, 3)\n self.assertEqual(r1.size, 1)\n r1.size = print()\n self.assertEqual(str(e.exception), \"width must be an integer\")",
"def tes... | [
"0.7816941",
"0.76064724",
"0.7321818",
"0.72994816",
"0.71326",
"0.70702416",
"0.7026041",
"0.698802",
"0.6959598",
"0.69142824",
"0.6855917",
"0.68521184",
"0.6842007",
"0.6834424",
"0.6808641",
"0.6799275",
"0.67819136",
"0.6781329",
"0.6746373",
"0.672534",
"0.67172694",
... | 0.67001927 | 23 |
This function tests the size setter with func | def test_sizesetterwithbool(self):
Rectangle.reset_objects()
with self.assertRaises(TypeError) as e:
r1 = Square(1, 2, 2, 3)
self.assertEqual(r1.size, 1)
r1.size = True
self.assertEqual(str(e.exception), "width must be an integer") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_sizesetterwithfunc(self):\n Rectangle.reset_objects()\n with self.assertRaises(TypeError) as e:\n r1 = Square(1, 2, 2, 3)\n self.assertEqual(r1.size, 1)\n r1.size = print()\n self.assertEqual(str(e.exception), \"width must be an integer\")",
"def tes... | [
"0.7816941",
"0.76064724",
"0.7321818",
"0.72994816",
"0.70702416",
"0.7026041",
"0.698802",
"0.6959598",
"0.69142824",
"0.6855917",
"0.68521184",
"0.6842007",
"0.6834424",
"0.6808641",
"0.6799275",
"0.67819136",
"0.6781329",
"0.6746373",
"0.672534",
"0.67172694",
"0.6715398"... | 0.71326 | 4 |
This function tests the update function | def test_update(self):
Square.reset_objects()
s1 = Square(5)
s1.update(10)
self.assertEqual(str(s1), "[Square] (10) 0/0 - 5")
s1.update(1, 2)
self.assertEqual(str(s1), "[Square] (1) 0/0 - 2")
s1.update(1, 2, 3)
self.assertEqual(str(s1), "[Square] (1) 3/0 -... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_update(self):\n pass",
"def test_update(self):\n pass",
"def test_update(self):\n pass",
"def test_update_case(self):\n pass",
"def test_update(self):\n # this is tested graphically, as it is UI\n pass",
"def test_update9(self):\n pass",
"def te... | [
"0.9276291",
"0.9276291",
"0.9276291",
"0.9146059",
"0.9097366",
"0.85921",
"0.8571493",
"0.85458064",
"0.8241054",
"0.8060316",
"0.79457283",
"0.7938115",
"0.78989923",
"0.7882538",
"0.7862813",
"0.78310704",
"0.7815335",
"0.77815706",
"0.7753437",
"0.7705494",
"0.7705145",
... | 0.70469147 | 71 |
This function tests updating args with kwargs | def test_kwargsskipped(self):
Rectangle.reset_objects()
s1 = Square(10, 10, 10, 10)
s1.update(1, 2, 3, 4, id=10)
self.assertEqual(s1.id, 1) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_020_kwargs(self):\n caller = self.get_caller([KwargsTaskOverride])\n self.assertEqual([\"A\", \"B\"], caller(\"A\", \"B\"))",
"def test_twoargs(self):\n varargs = (12, 13)\n kwargs = {}\n method = getattr(self.foo,'f_twoargs')\n var_dict = reassign_function_argu... | [
"0.7248761",
"0.71107507",
"0.70037097",
"0.698773",
"0.6985662",
"0.6958258",
"0.6834277",
"0.6793581",
"0.6792576",
"0.6752801",
"0.6743928",
"0.6729276",
"0.6705698",
"0.66908294",
"0.6684159",
"0.6630592",
"0.6507422",
"0.646146",
"0.64440185",
"0.6434372",
"0.6432425",
... | 0.6090516 | 64 |
This function tests for bad size value | def test_updatebadsizevalue(self):
Square.reset_objects()
r1 = Square(1, 2, 3, 4)
r1.update(1, "foo")
self.assertEqual(r1.size, 1) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_case_06_side_too_big(self):\n self.__assert_equals_test_case([(195, 10, 201)], 'InvalidInput')",
"def check_resize_size(size):\n if isinstance(size, int):\n check_value(size, (1, FLOAT_MAX_INTEGER))\n elif isinstance(size, (tuple, list)) and len(size) == 2:\n for i, value in e... | [
"0.73509747",
"0.7315988",
"0.7277218",
"0.72665447",
"0.72311634",
"0.7072943",
"0.69591564",
"0.689563",
"0.6893956",
"0.68895435",
"0.68382615",
"0.6799865",
"0.67929316",
"0.678865",
"0.67855436",
"0.6773282",
"0.67731273",
"0.67594373",
"0.67590624",
"0.67568725",
"0.674... | 0.6255078 | 94 |
This function tests for bad size value | def test_updatebadxvalue(self):
Square.reset_objects()
r1 = Square(1, 2, 3, 4)
r1.update(1, 2, "foo")
self.assertEqual(r1.x, 2) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_case_06_side_too_big(self):\n self.__assert_equals_test_case([(195, 10, 201)], 'InvalidInput')",
"def check_resize_size(size):\n if isinstance(size, int):\n check_value(size, (1, FLOAT_MAX_INTEGER))\n elif isinstance(size, (tuple, list)) and len(size) == 2:\n for i, value in e... | [
"0.73509747",
"0.7315988",
"0.7277218",
"0.72665447",
"0.72311634",
"0.7072943",
"0.69591564",
"0.689563",
"0.6893956",
"0.68895435",
"0.68382615",
"0.6799865",
"0.67929316",
"0.678865",
"0.67855436",
"0.6773282",
"0.67731273",
"0.67594373",
"0.67590624",
"0.67568725",
"0.674... | 0.0 | -1 |
This function tests for bad size value | def test_updatebadyvalue(self):
Square.reset_objects()
r1 = Square(1, 2, 3, 4)
r1.update(1, 2, 3, "foo")
self.assertEqual(r1.y, 3) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_case_06_side_too_big(self):\n self.__assert_equals_test_case([(195, 10, 201)], 'InvalidInput')",
"def check_resize_size(size):\n if isinstance(size, int):\n check_value(size, (1, FLOAT_MAX_INTEGER))\n elif isinstance(size, (tuple, list)) and len(size) == 2:\n for i, value in e... | [
"0.73509747",
"0.7315988",
"0.7277218",
"0.72665447",
"0.72311634",
"0.7072943",
"0.69591564",
"0.689563",
"0.6893956",
"0.68895435",
"0.68382615",
"0.6799865",
"0.67929316",
"0.678865",
"0.67855436",
"0.6773282",
"0.67731273",
"0.67594373",
"0.67590624",
"0.67568725",
"0.674... | 0.0 | -1 |
This function tests for all bad values | def test_updateallbadvalues(self):
Square.reset_objects()
r1 = Square(1, 2, 3, 4)
r1.update([1], (9, ), True, "foo")
self.assertEqual(r1.size, 1)
self.assertEqual(r1.x, 2)
self.assertEqual(r1.y, 3)
self.assertEqual(r1.id, 4) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_bad_values(self):\n self.assertOK([60])\n self.assertRaisesInternalError([59.9])\n self.assertRaisesInternalError([''])\n self.assertRaisesInternalError([';'])\n self.assertRaisesInternalError(['('])\n self.assertRaisesInternalError([None])",
"def test_negative_... | [
"0.80985147",
"0.7233883",
"0.71813595",
"0.70237476",
"0.68878794",
"0.6882196",
"0.6876192",
"0.67759377",
"0.6767207",
"0.6749413",
"0.6742207",
"0.67406553",
"0.67390317",
"0.6734939",
"0.6724945",
"0.6704477",
"0.6704477",
"0.67030925",
"0.67030925",
"0.6698367",
"0.6686... | 0.0 | -1 |
This function tests the to_dictionary function | def test_to_dict(self):
Square.reset_objects()
s1 = Square(10, 2, 1)
s1_dictionary = s1.to_dictionary()
self.assertEqual(s1_dictionary, {'id': 1, 'x': 2, 'size': 10, 'y': 1}) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_dict_to_dict(self):\n @converters.wrap\n def inner_test(param: dict):\n \"\"\"Make sure the parameter was converted correctly.\"\"\"\n self.assertEqual(param, {'foo': 1, 'bar': ['bat', 2]})\n inner_test(param={'foo': 1, 'bar': ['bat', 2]})",
"def test_key_dict(... | [
"0.7176084",
"0.7108782",
"0.7050815",
"0.70425564",
"0.7028966",
"0.7027133",
"0.7022392",
"0.696475",
"0.696263",
"0.69530326",
"0.6941427",
"0.6933888",
"0.69253755",
"0.6914849",
"0.68335044",
"0.6824801",
"0.68152386",
"0.67968",
"0.67782664",
"0.6765529",
"0.6721175",
... | 0.722105 | 0 |
This function tests the update function with to_dict | def test_updatewithdict(self):
s1 = Square(10, 2, 1)
s1_dictionary = s1.to_dictionary()
s2 = Square(1, 1)
s2.update(**s1_dictionary)
self.assertEqual(s2.size, 10)
self.assertEqual(s2.x, 2)
self.assertEqual(s2.y, 1) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_dict(new,old):",
"def test_updatewithdictionarybycomparingdictionaries(self):\n s1 = Square(10, 2, 1, 9)\n s1_dictionary = s1.to_dictionary()\n s2 = Square(1, 1)\n s2.update(**s1_dictionary)\n self.assertEqual(s1.__dict__, s2.__dict__)",
"def test_dict(self):\n ... | [
"0.7573673",
"0.7532664",
"0.7381514",
"0.7352229",
"0.7200704",
"0.6979389",
"0.69530696",
"0.69241667",
"0.6872416",
"0.6872416",
"0.6872416",
"0.6859202",
"0.6837425",
"0.6832763",
"0.6792921",
"0.6743073",
"0.67334944",
"0.6720713",
"0.6713036",
"0.67053515",
"0.6689018",... | 0.75755227 | 0 |
This function tests the to_dictionary function | def test_updatewithdictionarybycomparingdictionaries(self):
s1 = Square(10, 2, 1, 9)
s1_dictionary = s1.to_dictionary()
s2 = Square(1, 1)
s2.update(**s1_dictionary)
self.assertEqual(s1.__dict__, s2.__dict__) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_to_dict(self):\n Square.reset_objects()\n s1 = Square(10, 2, 1)\n s1_dictionary = s1.to_dictionary()\n self.assertEqual(s1_dictionary, {'id': 1, 'x': 2, 'size': 10, 'y': 1})",
"def test_dict_to_dict(self):\n @converters.wrap\n def inner_test(param: dict):\n ... | [
"0.722105",
"0.7176084",
"0.7108782",
"0.7050815",
"0.70425564",
"0.7028966",
"0.7027133",
"0.7022392",
"0.696475",
"0.696263",
"0.69530326",
"0.6941427",
"0.6933888",
"0.69253755",
"0.6914849",
"0.68335044",
"0.6824801",
"0.68152386",
"0.67968",
"0.67782664",
"0.6765529",
... | 0.0 | -1 |
This function tests the str function | def test__str__method(self):
Rectangle.reset_objects()
s1 = Square(5)
self.assertEqual(str(s1), "[Square] (1) 0/0 - 5")
s2 = Square(2, 2)
self.assertEqual(str(s2), "[Square] (2) 2/0 - 2")
s3 = Square(3, 1, 3)
self.assertEqual(str(s3), "[Square] (3) 1/3 - 3") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_str(self):\n self.assertEqual(str(self.bs), str(self.wbs))\n self.assertEqual(str(self.be), str(self.be))\n # str(us) fails in Python 2\n self.assertEqual(str, type(str(self.wus)))\n # str(ue) fails in Python 2\n self.assertEqual(str, type(str(self.wue)))",
"def... | [
"0.81526077",
"0.79792345",
"0.78861636",
"0.7799259",
"0.7759826",
"0.76521504",
"0.7563218",
"0.7455285",
"0.74340284",
"0.7338997",
"0.7241758",
"0.72405905",
"0.7235571",
"0.7229896",
"0.72039074",
"0.71856594",
"0.7048706",
"0.7044776",
"0.7036477",
"0.70264024",
"0.7018... | 0.0 | -1 |
This function tests the display function | def test_display__method(self):
Rectangle.reset_objects()
s1 = Square(5)
f = io.StringIO()
with contextlib.redirect_stdout(f):
s1.display()
self.assertEqual(f.getvalue(), "#####\n#####\n#####\n#####\n#####\n") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_updated_display1(self):\n capturedOutput = io.StringIO()\n sys.stdout = capturedOutput\n r1 = Rectangle(2, 3, 2, 2)\n r1.display()\n sys.stdout = sys.__stdout__\n desired = '\\n\\n ##\\n ##\\n ##\\n'\n self.assertEqual(capturedOutput.getvalue(), desired)... | [
"0.76996773",
"0.7673609",
"0.7643031",
"0.76228404",
"0.75821286",
"0.75602204",
"0.74880636",
"0.7453267",
"0.74367535",
"0.74138623",
"0.7400215",
"0.7366837",
"0.7365232",
"0.7323895",
"0.727535",
"0.7186175",
"0.713864",
"0.7048027",
"0.6800203",
"0.66780984",
"0.6641431... | 0.7729406 | 0 |
This function tests the display function | def test_display__method2(self):
Rectangle.reset_objects()
s2 = Square(2, 2)
f = io.StringIO()
with contextlib.redirect_stdout(f):
s2.display()
self.assertEqual(f.getvalue(), " ##\n ##\n") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_display__method(self):\n Rectangle.reset_objects()\n s1 = Square(5)\n f = io.StringIO()\n with contextlib.redirect_stdout(f):\n s1.display()\n self.assertEqual(f.getvalue(), \"#####\\n#####\\n#####\\n#####\\n#####\\n\")",
"def test_updated_display1(self):\n ... | [
"0.7729406",
"0.76996773",
"0.7673609",
"0.7643031",
"0.76228404",
"0.75821286",
"0.75602204",
"0.74880636",
"0.74367535",
"0.74138623",
"0.7400215",
"0.7366837",
"0.7365232",
"0.7323895",
"0.727535",
"0.7186175",
"0.713864",
"0.7048027",
"0.6800203",
"0.66780984",
"0.6641431... | 0.7453267 | 8 |
This function tests the display function | def test_display__method3(self):
Rectangle.reset_objects()
s3 = Square(3, 1, 3)
f = io.StringIO()
with contextlib.redirect_stdout(f):
s3.display()
self.assertEqual(f.getvalue(), "\n\n\n ###\n ###\n ###\n") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_display__method(self):\n Rectangle.reset_objects()\n s1 = Square(5)\n f = io.StringIO()\n with contextlib.redirect_stdout(f):\n s1.display()\n self.assertEqual(f.getvalue(), \"#####\\n#####\\n#####\\n#####\\n#####\\n\")",
"def test_updated_display1(self):\n ... | [
"0.7729406",
"0.76996773",
"0.7673609",
"0.7643031",
"0.76228404",
"0.75821286",
"0.75602204",
"0.74880636",
"0.7453267",
"0.74367535",
"0.74138623",
"0.7400215",
"0.7366837",
"0.7365232",
"0.7323895",
"0.7186175",
"0.713864",
"0.7048027",
"0.6800203",
"0.66780984",
"0.664143... | 0.727535 | 15 |
This test area computation | def test_area_method(self):
s3 = Square(3, 1, 3)
self.assertEqual(s3.area(), 9) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_area():\n\n pt0 = [0, 0]\n pt1 = [5, 5]\n pt2 = [5, 0]\n\n truth = 12.5\n\n assert isclose(truth, area([pt0, pt1, pt2]))",
"def area(x, y):\n return x*y/2",
"def compute_area(self):\r\n\r\n \"\"\"Косое произведение векторов\r\n A = (x2-x1; y2-y1; z2-z1)\r\n B = (... | [
"0.78739285",
"0.7654076",
"0.7607262",
"0.7506698",
"0.7488172",
"0.7483138",
"0.74505335",
"0.72719085",
"0.7260247",
"0.719918",
"0.71629936",
"0.7131914",
"0.7130735",
"0.71299064",
"0.7128044",
"0.71264493",
"0.7113098",
"0.7105086",
"0.70769906",
"0.70693594",
"0.706859... | 0.71139586 | 16 |
This test for positional error on area function | def test_area_methodwithargthrowerror(self):
s3 = Square(3, 1, 3)
with self.assertRaises(TypeError) as e:
s3.area(9)
self.assertEqual(str(e.exception),
"area() takes 1 positional argument but 2 were given") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_area():\n\n pt0 = [0, 0]\n pt1 = [5, 5]\n pt2 = [5, 0]\n\n truth = 12.5\n\n assert isclose(truth, area([pt0, pt1, pt2]))",
"def test_absolute_shape_areas(self):\n\n assert self.test_shape.area == pytest.approx((math.pi * (10**2) * 2) + (math.pi * (2 * 10) * 30))\n assert len... | [
"0.8021394",
"0.75691444",
"0.7495193",
"0.745044",
"0.7248229",
"0.7243476",
"0.7218561",
"0.7213277",
"0.7156837",
"0.715677",
"0.7114953",
"0.71036434",
"0.70982116",
"0.709634",
"0.709634",
"0.705792",
"0.7043299",
"0.6999752",
"0.69996583",
"0.69996583",
"0.6896001",
"... | 0.6909063 | 20 |
function to book all histograms and return as dictionary | def gethists():
histdict = {}
lept_type = ['elect', 'muon']
for lept in lept_type:
histdict["h_misE_{}".format(lept)] = TH1F('h_misE_{}'.format(lept), 'Gen/Reco missing energy comparison', 200, -70, 40)
histdict["h_misPx_{}".format(lept)] = TH1F('h_misPx_{}'.format(lept), 'Gen/Reco missing... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def hog_histograms(*args, **kwargs): # real signature unknown\n pass",
"def histograms(self, *args, **kwargs):\n return _image.image_histograms(self, *args, **kwargs)",
"def setup_hist(self):\n self.x_min = {}\n self.x_max = {}\n self.x_max_minus_min = {}\n self.dx = {}\n ... | [
"0.6834437",
"0.68014705",
"0.6753082",
"0.6684698",
"0.66550183",
"0.6531408",
"0.6521184",
"0.6478414",
"0.64730245",
"0.64355576",
"0.64195323",
"0.64071554",
"0.64042616",
"0.64042616",
"0.6402248",
"0.63903964",
"0.63464123",
"0.63016856",
"0.6283559",
"0.6281963",
"0.62... | 0.0 | -1 |
Centers the data s.t. the reference is the origin. Necessary to work in a linear subspace. Only needs to be called ONCE in the beginning, not on every iteration | def center_reference(x: np.array, ref_vectors: np.array) -> np.array:
return x - ref_vectors | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_center(self): \r\n \r\n self.grfx[0].center = self.center\r\n\r\n self.update_bbox()",
"def center(self, x):\n\n shape = x.shape\n nx = shape[1]\n ny = shape[0]\n hnx = nx // 2\n hny = ny // 2\n\n temp = x[0:hny, 0:hnx].copy()\n x[0:hny, 0:hnx]... | [
"0.68720996",
"0.6820035",
"0.67054796",
"0.67002136",
"0.6645099",
"0.66393924",
"0.66174424",
"0.6555558",
"0.6543385",
"0.6525934",
"0.65199",
"0.64752513",
"0.64387786",
"0.6427872",
"0.64042836",
"0.6397978",
"0.6364224",
"0.6363403",
"0.631033",
"0.624232",
"0.62347466"... | 0.61217606 | 27 |
Divides the array into 2 sublists, sorted and unsorted. Left sublist contains sorted elements, right sublist contains unsorted elements. For each element in unsorted list, compare with sorted list elements from right to left. if unsorted element is less than sorted element, swap their position and compare with next sor... | def insertion_sort(array):
# traverse the array starting from 2nd element
for i in xrange(1, len(array)):
# initialize j equal current index
j = i
# while j element less than previous element
while j > 0 and array[j] < array[j-1]:
# swap j and j-1 element
array[... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def wiggleSort(self, arr: List[int]) -> None:\n n = len(arr)\n if n <= 1:\n return\n\n #up = False # start with False so that first pair will be non-dec\n\n for i in range(1, n):\n #if up == (arr[i] >= arr[i-1]):\n if (i & 1 == 0) == (arr[i] >= arr[i-1])... | [
"0.6983334",
"0.6711952",
"0.67080307",
"0.6673519",
"0.65697",
"0.6566829",
"0.6559642",
"0.6530107",
"0.65156823",
"0.65133977",
"0.65022653",
"0.6492196",
"0.64712584",
"0.64685374",
"0.6417928",
"0.639114",
"0.63482845",
"0.634632",
"0.6344146",
"0.63409036",
"0.6340346",... | 0.0 | -1 |
Repeat a dataframe n times. | def repeat(df, n):
return pd.concat([df] * n, ignore_index=True) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def Repeat(dataset, count=None):\n return dataset.repeat(count=count)",
"def repeat(self, fn, *args, **kwargs):\n return repeat_n_times(self.n, fn, *args, **kwargs)",
"def repeat(x, repeats, axis=None):\r\n return RepeatOp(axis=axis)(x, repeats)",
"def repeat(self, n, keys=None, axis=1, wrap_kwa... | [
"0.7628029",
"0.72188824",
"0.6911393",
"0.68845344",
"0.6785106",
"0.6629356",
"0.65931594",
"0.6574859",
"0.6574258",
"0.6532897",
"0.63699496",
"0.6342583",
"0.62876594",
"0.6276754",
"0.623809",
"0.6219316",
"0.6213674",
"0.6166084",
"0.61549324",
"0.61308444",
"0.6125135... | 0.8607267 | 0 |
Test type inference works properly for a parquet file with unconventional types types. | def test_infer_parquet_types(tmpdir):
# Create a temporary directory to store the parquet file
tmpdir = str(tmpdir)
# Create a dataframe with all the types
df = pd.DataFrame(
{
"int": [1, 2, 3],
"float": [1.1, 2.2, 3.3],
"string": ["a", "b", "c"],
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_as_type(loader):\n exp = loader.find_by_id(3)\n assert isinstance(exp.artifacts[\"predictions_df\"], artifact.Artifact)\n # Use as_type for the first time.\n pickle_artifact1 = exp.artifacts[\"predictions_df\"].as_type(artifact.PickleArtifact)\n # Use as_type for the second time.\n pickl... | [
"0.5770566",
"0.57687217",
"0.5768028",
"0.5666308",
"0.5590542",
"0.558034",
"0.5571467",
"0.55513895",
"0.5543602",
"0.55353683",
"0.55230504",
"0.5512718",
"0.55033225",
"0.5497453",
"0.5489926",
"0.54898447",
"0.5441415",
"0.5438022",
"0.5430504",
"0.540938",
"0.5402098",... | 0.7926908 | 0 |
Shows all the installations from the database | def show_installations(self):
database = Database('data/database.db')
installations = database.read_installations()
view = Template(filename="view/template.html", lookup=lookup)
return view.render(
rows = [[item.number, item.name, item.address, item.zip_code, item.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def all_installation(self):\n\t\tself.db = DB()\n\t\tinstallation_all = self.db.select_all_from(\"installations\")\n\t\ttmpl = lookup.get_template(\"installation.html\")\n\t\treturn (tmpl.render(installation=installation_all))",
"def installation(request):\n return render(request, 'ecosystem/installation.html... | [
"0.81771755",
"0.65928066",
"0.65425545",
"0.6422345",
"0.6343154",
"0.61781883",
"0.6152795",
"0.60611415",
"0.5992566",
"0.5938621",
"0.5864382",
"0.58546007",
"0.57651806",
"0.5752968",
"0.57020676",
"0.5668832",
"0.565056",
"0.5634714",
"0.5633282",
"0.56175447",
"0.56138... | 0.84590834 | 0 |
Shows all the equipments from the database | def show_equipments(self):
database = Database('data/database.db')
equipments = database.read_equipments()
view = Template(filename="view/template.html", lookup=lookup)
return view.render(
rows = [[item.number, item.name, item.installation_number] for item ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def all_equipment(self):\n\t\tself.db = DB()\n\t\tactivity_all = self.db.select_all_from(\"equipment\")\n\t\ttmpl = lookup.get_template(\"equipment.html\")\n\t\treturn (tmpl.render(equipment=activity_all))",
"def show_equipment(self, number):\n database = Database('data/database.db')\n equip = data... | [
"0.76633227",
"0.6947809",
"0.67456573",
"0.6615799",
"0.6177239",
"0.61736935",
"0.6138498",
"0.60801035",
"0.6078603",
"0.6067097",
"0.60606223",
"0.6054881",
"0.60485995",
"0.59715",
"0.59245",
"0.5917239",
"0.58929026",
"0.5869813",
"0.5869021",
"0.586012",
"0.584841",
... | 0.82579195 | 0 |
Shows all the activities from the database | def show_activities(self):
database = Database('data/database.db')
activities = database.read_activities()
view = Template(filename="view/template.html", lookup=lookup)
return view.render(
rows = [[item.number, item.name] for item in activities],
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def all_activity(self):\n\t\tself.db = DB()\n\t\tactivity_all = self.db.select_all_from(\"activity\")\n\t\ttmpl = lookup.get_template(\"activity.html\")\n\t\treturn (tmpl.render(activity=activity_all))",
"def __ui_list_all_activities(self):\n activities_list = self.__activity_service.service_get_list_of_a... | [
"0.7956943",
"0.7559513",
"0.71567297",
"0.6593943",
"0.65700984",
"0.65081066",
"0.64780426",
"0.6435594",
"0.6362298",
"0.62765324",
"0.62336224",
"0.621595",
"0.6190602",
"0.61696124",
"0.6159179",
"0.6159179",
"0.6159179",
"0.6159179",
"0.6157847",
"0.6083726",
"0.6079967... | 0.83865505 | 0 |
Shows the installation which has the given number from the database | def show_installation(self, number):
database = Database('data/database.db')
inst = database.read_installation(number)
view = Template(filename="view/template.html", lookup=lookup)
try:
render = view.render(
rows = [[inst.number, inst.name, inst.address, ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show_installations(self):\n database = Database('data/database.db')\n installations = database.read_installations()\n view = Template(filename=\"view/template.html\", lookup=lookup)\n \n \n return view.render(\n rows = [[item.number, item.name, item.address, item.z... | [
"0.679254",
"0.63224375",
"0.5637825",
"0.55374575",
"0.5517338",
"0.54618335",
"0.5394725",
"0.53656566",
"0.53460836",
"0.5300642",
"0.52793235",
"0.5266057",
"0.52598614",
"0.5193216",
"0.5169169",
"0.5164407",
"0.51391256",
"0.51271594",
"0.51092535",
"0.510022",
"0.50842... | 0.7730804 | 0 |
Shows the equipment which has the given number from the database | def show_equipment(self, number):
database = Database('data/database.db')
equip = database.read_equipment(number)
view = Template(filename="view/template.html", lookup=lookup)
try:
render = view.render(
rows = [[equip.number, equip.name, equip.installation_nu... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show_equipments(self): \n database = Database('data/database.db')\n equipments = database.read_equipments()\n view = Template(filename=\"view/template.html\", lookup=lookup)\n \n \n return view.render(\n rows = [[item.number, item.name, item.installation_num... | [
"0.69405115",
"0.6025888",
"0.5856586",
"0.57539564",
"0.5740271",
"0.56885344",
"0.558453",
"0.55563587",
"0.55362034",
"0.5532173",
"0.5498387",
"0.548142",
"0.5451306",
"0.53929764",
"0.5377283",
"0.53668404",
"0.5342139",
"0.53247577",
"0.5303719",
"0.5300274",
"0.5288869... | 0.791672 | 0 |
Shows the activity which has the given number from the database | def show_activity(self, number):
database = Database('data/database.db')
activ = database.read_activity(number)
view = Template(filename="view/template.html", lookup=lookup)
try:
render = view.render(
rows = [[activ.number, activ.name]],
pageT... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show_activities(self): \n database = Database('data/database.db')\n activities = database.read_activities()\n view = Template(filename=\"view/template.html\", lookup=lookup)\n \n \n return view.render(\n rows = [[item.number, item.name] for item in activities]... | [
"0.703598",
"0.5651328",
"0.56446993",
"0.5596035",
"0.5421679",
"0.54168236",
"0.53886724",
"0.5314571",
"0.53015953",
"0.52724856",
"0.5244988",
"0.52392125",
"0.5209759",
"0.51946753",
"0.51631796",
"0.51054376",
"0.50989926",
"0.50710297",
"0.5067204",
"0.5057887",
"0.500... | 0.76558006 | 0 |
Shows all the installations, equipments and activities which match the given activity and city | def find_infos(self, activity_name, city):
database = Database('data/database.db')
infos = database.get_infos(activity_name, city)
view = Template(filename="view/template.html", lookup=lookup)
try:
render = view.render(
rows = [[item[0].number, i... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_search_result(self, user_input):\n\n conn = sqlite3.connect(self.db_name)\n\n request_field = '%' + user_input[0].strip() + '%'\n request_city = '%' + user_input[1].strip() + '%'\n\n activity_ids = []\n activities_dictionary = {}\n activities_array = self.search_ac... | [
"0.6081876",
"0.5634441",
"0.56299937",
"0.54854494",
"0.5451115",
"0.54429376",
"0.5318897",
"0.527957",
"0.52620614",
"0.5245779",
"0.5226336",
"0.5164053",
"0.5126602",
"0.51202446",
"0.5117655",
"0.51148504",
"0.510631",
"0.508857",
"0.50721574",
"0.5069758",
"0.5064015",... | 0.6213436 | 0 |
Loads the requested title otherwise returns search results | def search(request):
if request.method == "POST":
form = SearchForm(request.POST)
if form.is_valid():
title = form.cleaned_data["title"]
entryMD = util.get_entry(title)
print('search request: ', title)
if entryMD:
return redirect(reverse('entry', args=[tit... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def search_title(self):\n\t\tnew_name = self.removez_all(self.init_str)\n\t\tresult = self.search_ext(new_name)\n\t\tresult = self.search_encoder(result)\n\t\tresult = self.search_quality(result)\n\t\tresult = self.search_codec(result)\n\t\tresult = self.search_lang(result)\n\t\tresult = self.search_version(r... | [
"0.6697151",
"0.6664639",
"0.66247725",
"0.6591752",
"0.6531869",
"0.65061194",
"0.6485728",
"0.64793134",
"0.63928413",
"0.63749814",
"0.6361186",
"0.6301822",
"0.62578523",
"0.6242281",
"0.6226646",
"0.61994123",
"0.6194943",
"0.6187803",
"0.6169782",
"0.61489975",
"0.61322... | 0.5772967 | 65 |
fill line edit with curve name | def fillCurveLE(self):
sel = mn.ls( sl = True, dag = True, ni = True, typ = 'nurbsCurve' )
self.curve_le.setText( sel[0].name ) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_to_plot(self, line_name, points):\n points = [x * 100 for x in points]\n plt.plot(points, label=line_name)",
"def setCurve(self, index, curve) -> None:\n ...",
"def add_curve(self):\n pv_name = self._get_full_pv_name(self.pv_name_line_edt.text())\n color = random_colo... | [
"0.65251184",
"0.63600713",
"0.6350415",
"0.6244321",
"0.6214081",
"0.6091867",
"0.60685146",
"0.60510254",
"0.5991166",
"0.5967503",
"0.596386",
"0.59406424",
"0.5938429",
"0.5893543",
"0.583466",
"0.5831425",
"0.5829138",
"0.5812785",
"0.5776291",
"0.5767876",
"0.5730263",
... | 0.6569289 | 0 |
add selected transforms to list | def addObject(self):
sel = mc.ls( sl = True, typ = 'transform' )
if sel:
self.objects_lw.addItems( sel ) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def AddTransforms(self, transforms):\n self._legacy = False\n if transforms:\n self._transforms.update(transforms)",
"def draw_next_transform(self) -> List[Callable]:\n available_transforms = self.get_all_transforms()\n transform_names = np.random.choice(list(available_transforms), self.... | [
"0.66443163",
"0.6639522",
"0.6177895",
"0.61433786",
"0.601721",
"0.594729",
"0.59412503",
"0.58969665",
"0.5851388",
"0.58490455",
"0.5846163",
"0.5821299",
"0.57832867",
"0.5742237",
"0.5709454",
"0.5688187",
"0.56431025",
"0.5630481",
"0.563015",
"0.56215",
"0.5605921",
... | 0.553984 | 25 |
remove selected object from list | def removeObject(self):
for SelectedItem in self.objects_lw.selectedItems():
self.objects_lw.takeItem(self.objects_lw.row(SelectedItem) ) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def remove(self):",
"def remove():",
"def removeObject(self,object):\n self.removeList.append(object)",
"def get_non_selected(self):\n\n obj_list = self.get_list()\n\n for sel in self.get_selected():\n obj_list.remove(sel)\n\n return obj_list",
"def remove(sel... | [
"0.7310277",
"0.70695",
"0.70034885",
"0.6878407",
"0.6866645",
"0.6846475",
"0.6840973",
"0.6840973",
"0.6840973",
"0.675142",
"0.6743878",
"0.67410135",
"0.67245823",
"0.67245823",
"0.67107946",
"0.67068976",
"0.6683341",
"0.667483",
"0.667084",
"0.66617125",
"0.66386074",
... | 0.80012274 | 0 |
create scatter based on UI | def createScatter(self):
curv = str( self.curve_le.text() )
objCount = self.controlCount_sbx.value()
random = self.random_chb.isChecked()
useTip = self.useTips_chb.isChecked()
keepConn = self.keepConnected_chb.isChecked()
tangent = self.tangent_chb.isChecked()
groupIt = self.groupIt_chb.isChecked()
anim... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def draw(self):\n duplets = list(self._chunker(self.attr, 2))\n colors = self._set_colors(duplets)\n\n for i, duplet in enumerate(duplets, start=1):\n self.chart.make_scatter(self.source, duplet[0], duplet[1], 'circle', colors[i - 1])\n\n if i < len(duplets):\n ... | [
"0.70726407",
"0.67823887",
"0.65958464",
"0.6529031",
"0.6512134",
"0.6497885",
"0.6460971",
"0.64456946",
"0.6424747",
"0.6404196",
"0.64007133",
"0.63893604",
"0.6388845",
"0.6370495",
"0.6369845",
"0.63139355",
"0.6273838",
"0.6234437",
"0.622965",
"0.62135124",
"0.617904... | 0.76700217 | 0 |
use this to create project in maya | def main():
if mc.window( 'curveScatter_WIN', q = 1, ex = 1 ):
mc.deleteUI( 'curveScatter_WIN' )
PyForm=CurveScatterUI()
PyForm.show() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def project():",
"def project():",
"def project():",
"def create(self):\n \n # create the sequence structure by calling the self.project.create\n self.project.create()",
"def test_create_project(self):\n pass",
"def test_create_project(self):\n pass",
"def test_create... | [
"0.73715895",
"0.73715895",
"0.73715895",
"0.7212506",
"0.7137522",
"0.7137522",
"0.7137522",
"0.7110958",
"0.68010193",
"0.67627656",
"0.6690421",
"0.6669123",
"0.6666377",
"0.6661077",
"0.66519624",
"0.6629123",
"0.66253257",
"0.6616952",
"0.6588387",
"0.65791476",
"0.65582... | 0.0 | -1 |
Resizes the image using padding | def resize_img(self, filename: str, size: Tuple[int, int] = (299, 299)):
img = Image.open(join(self.source_dir, filename))
width, height = img.size
orig_shape = np.array(img.size)
wanted_shape = np.array(size)
ratios = wanted_shape / orig_shape
wanted_width, wanted_height... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def run_padding(self):\n\n image_padded, mask, self.pad_to_right, self.pad_to_bottom = gen_padded_image_and_mask (os.path.join('utils_dfn/temp', self.file_name_with_ext),\n self.new_height, self.new_width)\n cv2.imwrite(os.path.jo... | [
"0.7316216",
"0.7130031",
"0.70135695",
"0.681151",
"0.6795093",
"0.6792879",
"0.67635626",
"0.6699544",
"0.6646232",
"0.66167957",
"0.65944964",
"0.6531552",
"0.64512",
"0.6422381",
"0.64195",
"0.63639235",
"0.63593984",
"0.633706",
"0.63148755",
"0.63148755",
"0.6271717",
... | 0.5779563 | 91 |
StateSyncNode a model defined in Swagger | def __init__(self, cluster_node_id=None, api_listen_ip=None): # noqa: E501 # noqa: E501
self._cluster_node_id = None
self._api_listen_ip = None
self.discriminator = None
if cluster_node_id is not None:
self.cluster_node_id = cluster_node_id
if api_listen_ip is not... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, metadata=None, spec=None, id=None, state=None, uptime=None, create_at=None, last_start=None, last_update=None): # noqa: E501\n self.openapi_types = {\n 'metadata': WorkspaceMetadataSerializer,\n 'spec': ModelApiSpecSerializer,\n 'id': str,\n 's... | [
"0.5465263",
"0.5353707",
"0.5265909",
"0.52475554",
"0.52462596",
"0.5233502",
"0.5216201",
"0.5216201",
"0.5216201",
"0.5216201",
"0.5216201",
"0.51422125",
"0.5135079",
"0.51195383",
"0.5078749",
"0.5078147",
"0.50362366",
"0.5015123",
"0.50128716",
"0.50005466",
"0.499358... | 0.0 | -1 |
Sets the cluster_node_id of this StateSyncNode. | def cluster_node_id(self, cluster_node_id):
self._cluster_node_id = cluster_node_id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cluster_id(self, cluster_id):\n self._cluster_id = cluster_id",
"def set_cluster(self, cluster_id=None):\n cluster = objects.Cluster.get_by_uid(\n cluster_id, fail_if_not_found=False\n )\n if cluster:\n self._cluster = cluster\n self._set_task(self... | [
"0.76118255",
"0.68488646",
"0.6685833",
"0.6680353",
"0.665979",
"0.64597934",
"0.64168763",
"0.63185054",
"0.62717867",
"0.62717867",
"0.62717867",
"0.62717867",
"0.62717867",
"0.62717867",
"0.6237502",
"0.61332864",
"0.5897969",
"0.5849075",
"0.58098924",
"0.5744126",
"0.5... | 0.8481871 | 0 |
Sets the api_listen_ip of this StateSyncNode. | def api_listen_ip(self, api_listen_ip):
self._api_listen_ip = api_listen_ip | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async def async_set_slave_ip(self, slave_ip):\n self._slave_ip = slave_ip",
"def set_ip(self, ip: str, host_addr: str) -> None:\n self.config[\"linkIp\"] = ip\n self.config[\"ngapIp\"] = ip\n self.config[\"gtpIp\"] = ip",
"def api(self, api):\n if self._running:\n ... | [
"0.5769698",
"0.55941546",
"0.55758727",
"0.5282456",
"0.52659065",
"0.5219188",
"0.5210068",
"0.5210068",
"0.5200352",
"0.49966982",
"0.49550515",
"0.49326894",
"0.492381",
"0.48899937",
"0.48827827",
"0.48702243",
"0.4863016",
"0.48214495",
"0.4695518",
"0.46883398",
"0.468... | 0.8451454 | 0 |
Returns the model properties as a dict | def to_dict(self):
result = {}
for attr, _ in six.iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_dict(self):\n return self.properties",
"def to_dict(self):\n return self.properties",
"def get_properties(self):\n return self.properties",
"def asdict(self):\n return self._prop_dict",
"def json(self):\n rv = {\n prop: getattr(self, prop)\n f... | [
"0.7751324",
"0.7751324",
"0.7337662",
"0.73335254",
"0.72966903",
"0.72765553",
"0.7157653",
"0.71558887",
"0.7147938",
"0.7147938",
"0.7126862",
"0.71260864",
"0.7121746",
"0.71060866",
"0.7059236",
"0.704307",
"0.70337325",
"0.70245665",
"0.69634634",
"0.6960516",
"0.68999... | 0.0 | -1 |
Returns the string representation of the model | def to_str(self):
return pprint.pformat(self.to_dict()) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __str__(self):\n return super().__str__() + self.model.__str__()",
"def __str__(self) -> str:\n # noinspection PyUnresolvedReferences\n opts = self._meta\n if self.name_field:\n result = str(opts.get_field(self.name_field).value_from_object(self))\n else:\n ... | [
"0.85856134",
"0.7814518",
"0.77898884",
"0.7751367",
"0.7751367",
"0.7712228",
"0.76981676",
"0.76700574",
"0.7651133",
"0.7597206",
"0.75800353",
"0.7568254",
"0.7538184",
"0.75228703",
"0.7515832",
"0.7498764",
"0.74850684",
"0.74850684",
"0.7467648",
"0.74488163",
"0.7442... | 0.0 | -1 |
For `print` and `pprint` | def __repr__(self):
return self.to_str() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def pprint(*args, **kwargs):\n if PRINTING:\n print(*args, **kwargs)",
"def print_out():\n pass",
"def custom_print(*objects):\n print(*objects, sep=OFS, end=ORS)",
"def _print(self, *args):\n return _ida_hexrays.vd_printer_t__print(self, *args)",
"def _printable(self):\n ... | [
"0.75577617",
"0.73375154",
"0.6986672",
"0.698475",
"0.6944995",
"0.692333",
"0.6899106",
"0.6898902",
"0.68146646",
"0.6806209",
"0.6753795",
"0.67497987",
"0.6744008",
"0.6700308",
"0.6691256",
"0.6674591",
"0.6658083",
"0.66091245",
"0.6606931",
"0.6601862",
"0.6563738",
... | 0.0 | -1 |
Returns true if both objects are equal | def __eq__(self, other):
if not isinstance(other, StateSyncNode):
return False
return self.__dict__ == other.__dict__ | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __eq__(self, other):\n return are_equal(self, other)",
"def __eq__(self, other):\n return are_equal(self, other)",
"def __eq__(self,other):\n try: return self.object==other.object and isinstance(self,type(other))\n except: return False",
"def __eq__(self, other):\n if i... | [
"0.8088132",
"0.8088132",
"0.8054589",
"0.7982687",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
... | 0.0 | -1 |
Returns true if both objects are not equal | def __ne__(self, other):
return not self == other | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __ne__(self, other: object) -> bool:\n if self.__eq__(other):\n return False\n return True",
"def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)",
"def __ne__(self, other) -> bool:\n return not self.__eq__(other)",
"def __eq__(self, other):\n ... | [
"0.8457179",
"0.8393067",
"0.81457263",
"0.8140635",
"0.8133462",
"0.8094992",
"0.8093376",
"0.8093376",
"0.8093376",
"0.80863357",
"0.80863357",
"0.8077303",
"0.8077303",
"0.8066831"
] | 0.0 | -1 |
Adds additional player information from ScoreboardPlayers. | def add_players(game: LolGame, players: List[dict], add_page_id: bool = False) -> LolGame:
for team_side in game["teams"]:
team_side_leaguepedia = "1" if team_side == "BLUE" else "2"
for idx, game_player in enumerate(game["teams"][team_side]["players"]):
try:
# We get t... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_player(self, player):\n\t\tself.players.append(player)",
"def add_new_player(self) -> None:\n\n # 1\n for elem in self.data:\n key = ''\n value = ''\n for k, v in elem.items():\n if k == 'name':\n key = v\n el... | [
"0.6971224",
"0.66292316",
"0.6480513",
"0.64138997",
"0.63959414",
"0.6388674",
"0.6384125",
"0.63780624",
"0.6374383",
"0.6342534",
"0.63057035",
"0.6301633",
"0.62989295",
"0.62704206",
"0.62263113",
"0.6215813",
"0.6179381",
"0.61385846",
"0.60837513",
"0.6078024",
"0.603... | 0.5832073 | 35 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.