class_docstr: BBox container
class_docstr_tok: ["BBox","container"]
code: def factory(cls, arg):
      # validate input first
      if not isinstance(arg, (list, dict)):
          raise ValueError(
              "BBox factory only accept a dict or a list as argument"
          )
      # we have a dict... just check which fields are given
      if isinstance(arg, dict):
          if "southwest" in arg:
              return cls(bounds=arg)
          elif "bbox" in arg:
              return cls(bbox=arg["bbox"])
          elif "bounds" in arg:
              return cls(bounds=arg["bounds"])
          elif "lat" in arg:
              return cls(lat=arg["lat"], lng=arg["lng"])
          elif "west" in arg:
              return cls(
                  west=arg["west"],
                  south=arg["south"],
                  east=arg["east"],
                  north=arg["north"],
              )
          else:
              raise ValueError(
                  "Could not found valid values in dict to create a bbox"
              )
      # we have a list... guess what to call according to the number of parameters given:
      if len(arg) == 2:
          lat, lng = arg
          return cls(lat=lat, lng=lng)
      elif len(arg) == 4:
          return cls(bbox=arg)
      else:
          raise ValueError(
              "Could not found valid values in list to create a bbox"
          )
  
imports: import re
  import geocoder
  from six import string_types
label_desc: Use image node_id 1 for calling the BBox obj's underlying member method code with example usage: obj.factory(cls, arg) and returns: cls, cls, cls, cls, cls, cls, cls