code: def _get_variable(vid, variables):
      
      if isinstance(vid, six.string_types):
          vid = get_base_id(vid)
      else:
          vid = _get_string_vid(vid)
      for v in variables:
          if vid == get_base_id(v["id"]):
              return copy.deepcopy(v)
      raise ValueError("Did not find variable %s in \n%s" % (vid, pprint.pformat(variables)))
docs: Retrieve an input variable from our existing pool of options.