<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _get_variants(data):
 """Retrieve variants from CWL and standard inputs for organizing variants. """

    active_vs = []
    if "variants" in data:
        variants = data["variants"]
        # CWL based list of variants
        if isinstance(variants, dict) and "samples" in variants:
            variants = variants["samples"]
        for v in variants:
            # CWL -- a single variant file
            if isinstance(v, six.string_types) and os.path.exists(v):
                active_vs.append(_add_filename_details(v))
            elif (isinstance(v, (list, tuple)) and len(v) > 0 and
                  isinstance(v[0], six.string_types) and os.path.exists(v[0])):
                for subv in v:
                    active_vs.append(_add_filename_details(subv))
            elif isinstance(v, dict):
                if v.get("vrn_file"):
                    active_vs.append(v)
                elif v.get("population"):
                    vrnfile = v.get("population").get("vcf")
                    active_vs.append(_add_filename_details(vrnfile))
                elif v.get("vcf"):
                    active_vs.append(_add_filename_details(v.get("vcf")))
    return active_vs