docstr: Infer the attribute type of data named name. Currently this only
  supports inference of numeric types.
  
  If self.infer_numeric_types is false, type is used. Otherwise, pick the
  most general of types found across all values with name and scope. This
  means edges with data named 'weight' are treated separately from nodes
  with data named 'weight'.
docstr_tok: ["Infer","the","attribute","type","of","data","named","name",".","Currently","this","only","supports","inference","of","numeric","types",".","If","self.infer_numeric_types","is","false",",","type","is","used",".","Otherwise",",","pick","the","most","general","of","types","found","across","all","values","with","name","and","scope",".","This","means","edges","with","data","named","'weight","'","are","treated","separately","from","nodes","with","data","named","'weight","'","."]
code: def attr_type(self, name, scope, value):
      """Infer the attribute type of data named name. Currently this only
      supports inference of numeric types.
  
      If self.infer_numeric_types is false, type is used. Otherwise, pick the
      most general of types found across all values with name and scope. This
      means edges with data named 'weight' are treated separately from nodes
      with data named 'weight'.
      """
      if self.infer_numeric_types:
          types = self.attribute_types[(name, scope)]
  
          if len(types) > 1:
              types = {self.get_xml_type(t) for t in types}
              if "string" in types:
                  return str
              elif "float" in types or "double" in types:
                  return float
              else:
                  return int
          else:
              return list(types)[0]
      else:
          return type(value)
  
imports: import warnings
  from collections import defaultdict
  import networkx
  from networkx.utils import open_file
label_desc: Use image node_id 3 for calling the GraphMLWriter obj's underlying member method code with example usage: obj.attr_type(name, scope, value) and returns: type, list, str, float, int