You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: test_env.go
    path of file: ./repos/chainlink/integration-tests/docker/test_env
    
    the code of the file until where you have to start completion: package test_env

import (
	"encoding/json"
	"fmt"
	"math/big"
	"runtime/debug"
	"testing"

	"github.com/ethereum/go-ethereum/accounts/keystore"
	"github.com/rs/zerolog"
	"github.com/rs/zerolog/log"
	"github.com/smartcontractkit/seth"
	tc "github.com/testcontainers/testcontainers-go"

	"github.com/smartcontractkit/chainlink-testing-framework/blockchain"
	"github.com/smartcontractkit/chainlink-testing-framework/docker"
	"github.com/smartcontractkit/chainlink-testing-framework/docker/test_env"
	"github.com/smartcontractkit/chainlink-testing-framework/logging"
	"github.com/smartcontractkit/chainlink-testing-framework/logstream"
	"github.com/smartcontractkit/chainlink-testing-framework/utils/runid"
	"github.com/smartcontractkit/chainlink/v2/core/services/chainlink"

	actions_seth "github.com/smartcontractkit/chainlink/integration-tests/actions/seth"
	"github.com/smartcontractkit/chainlink/integration-tests/client"
	"githu
    
func (te *CLClusterTestEnv) Cleanup() error {
	te.l.Info().Msg("Cleaning up test environment")

	runIdErr := runid.RemoveLocalRunId()
	if runIdErr != nil {
		te.l.Warn().Msgf("Failed to remove .run.id file due to: %s (not a big deal, you can still remove it manually)", runIdErr.Error())
	}

	if te.t == nil {
		return fmt.Errorf("cannot cleanup test environment without a testing.T")
	}

	if te.ClCluster == nil || len(te.ClCluster.Nodes) == 0 {
		return fmt.Errorf("chainlink nodes are nil, unable cleanup chainlink nodes")
	}

	te.logWhetherAllContainersAreRunning()

	if te.EVMClient == nil && te.SethClient == nil {
		return fmt.Errorf("both EVMClient and SethClient are nil, unable to return funds from chainlink nodes during cleanup")
	} else if te.isSimulatedNetwork {
		te.l.Info().
			Msg("Network is a simulated network. Skipping fund return.")
	} else {
		if err := te.returnFunds(); err != nil {
			return err
		}
	}

	// close EVMClient connections
	if te.EVMClient != nil {
		err := te.EVMClient.Close()
		return err
	}

	if te.SethClient != nil {
		te.SethClient.Client.Close()
	}

	return nil
}