code: def testVertexNameIndexing(self):
      g = Graph.Famous("bull")
      g.vs["name"] = ["foo", "bar", "baz", "fred", "thud"]
      self.assertTrue(g.degree("bar") == 3)
      self.assertTrue(g.degree(["bar", "fred", 0]) == [3, 1, 2])
      g.vs[2]["name"] = "quack"
      self.assertRaises(ValueError, g.degree, "baz")
      self.assertTrue(g.degree("quack") == 3)
      self.assertTrue(g.degree("quack") == 3)
      self.assertTrue(g.degree(["bar", "thud", 0]) == [3, 1, 2])
      del g.vs["name"]
      self.assertRaises(ValueError, g.degree, ["bar", "thud", 0])
  
imports: import unittest
  from igraph import Graph
label_desc: Use image node_id 6 for calling the AttributeTests obj's underlying member method code with example usage: obj.testVertexNameIndexing() without return types