# noqa: D100, D101, D102

import datetime as dt
from pathlib import Path
from urllib.parse import urlparse

import dateutil.parser
from owslib.wps import ComplexDataInput

from ..utils import is_file, sanitize


def filter_case_insensitive(names, complete_list):
    """Filter a sequence of process names into a `known` and `unknown` list."""
    contained = []
    missing = []
    complete_list_lower = set(map(str.lower, complete_list))

    if isinstance(names, str):
        names = [
            names,
        ]

    for name in names:
        if name.lower() in complete_list_lower:
            contained.append(name)