<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_instance(self, contract_name: str) -> None: """ Fetches a contract instance belonging to deployment after validating contract name. """

        self._validate_name_and_references(contract_name)
        # Use a deployment's "contract_type" to lookup contract factory
        # in case the deployment uses a contract alias
        contract_type = self.deployment_data[contract_name]["contract_type"]
        factory = self.contract_factories[contract_type]
        address = to_canonical_address(self.deployment_data[contract_name]["address"])
        contract_kwargs = {
            "abi": factory.abi,
            "bytecode": factory.bytecode,
            "bytecode_runtime": factory.bytecode_runtime,
        }
        return self.w3.eth.contract(address=address, **contract_kwargs)