def __init__(self, type_, url, tags, origin=None):
        # validate inputs
        if not type_ in VALID_TYPES:
            raise ValueError("type must be one of [%s]"%(','.join(VALID_TYPES)))
        parsed = urlparse.urlparse(url)
        if not parsed.scheme or (parsed.scheme != 'file' and not parsed.netloc) or parsed.path in ('', '/'):
            raise ValueError("url must be a fully-specified URL with scheme, hostname, and path: %s"%(str(url)))
        if not type(tags) == list:
            raise ValueError("tags must be a list: %s"%(str(tags)))

        self.type = type_
        self.tags = tags

        self.url = url
        self.origin = origin
Test that, after successfully generating a keypair,
dataset/ETHPy150Open ros-infrastructure/rosdep/src/rosdep2/sources_list.py/DataSource.__init__--crossover with--dataset/ETHPy150Open nii-cloud/dodai-compute/nova/tests/test_api.py/ApiEc2TestCase.test_create_duplicate_key_pair