def METHOD_NAME(repo_ctx):
    if repo_ctx.attr.url and repo_ctx.attr.urls:
        fail("Either `url` or `urls` attribute must be set")
    if repo_ctx.attr.sha256 and repo_ctx.attr.sha256s:
        fail("Either `sha256` or `sha256s` attribute must be set")
    if repo_ctx.attr.strip_prefix and repo_ctx.attr.strip_prefixes:
        fail("Either `strip_prefix` or `strip_prefixes` attribute must be set")
    if repo_ctx.attr.url:
        return struct(
            urls = [repo_ctx.attr.url],
            sha256s = [repo_ctx.attr.sha256],
            strip_prefixes = [repo_ctx.attr.strip_prefix],
        )
    else:
        return struct(
            urls = repo_ctx.attr.urls,
            sha256s = repo_ctx.attr.sha256s,
            strip_prefixes = (
                repo_ctx.attr.strip_prefixes if repo_ctx.attr.strip_prefixes else
                len(repo_ctx.attr.urls) * [repo_ctx.attr.strip_prefix]
            ),
        )