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: defaults.go
    path of file: ./repos/gnark/std/algebra
    
    the code of the file until where you have to start completion: package algebra

import (
	"fmt"

	"github.com/consensys/gnark/frontend"
	"github.com/consensys/gnark/std/algebra/emulated/sw_bls12381"
	"github.com/consensys/gnark/std/algebra/emulated/sw_bn254"
	"github.com/consensys/gnark/std/algebra/emulated/sw_bw6761"
	"github.com/consensys/gnark/std/algebra/emulated/sw_emulated"
	"github.com/consensys/gnark/std/algebra/native/sw_bls12377"
	"github.com/consensys/gnark/std/algebra/native/sw_bls24315"
	"github.com/consensys/gnark/std/math/emulated"
	"github.com/consensys/gnark/std/math/emulated/emparams"
)

// GetCurve returns the [Curve] implementation corresponding to the scalar and
// G1 type parameters. The method allows to have a fully generic implementation
// without taking into consideration the initialization differences of different
// curves.
func GetCurve[FR emulated.FieldParams, G1El G1ElementT](api frontend.API) (Curve[FR, G1El], error) {
	var ret Curve[FR, G1El]
	switch s := any(&ret).(type) {
	case *Curve[sw_bn254.ScalarField, sw_bn254.G1Affine]:
		c, err := sw_emulated.New[emparams.BN254Fp, emparams.BN254Fr](api, sw_emulated.GetBN254Params())
		if err != nil {
			return ret, fmt.Errorf("new curve: %w", err)
		}
		*s = c
	case *Curve[sw_bw6761.Scala
    
func GetCurve[FR emulated.FieldParams, G1El G1ElementT](api frontend.API) (Curve[FR, G1El], error) {
	var ret Curve[FR, G1El]
	switch s := any(&ret).(type) {
	case *Curve[sw_bn254.ScalarField, sw_bn254.G1Affine]:
		c, err := sw_emulated.New[emparams.BN254Fp, emparams.BN254Fr](api, sw_emulated.GetBN254Params())
		if err != nil {
			return ret, fmt.Errorf("new curve: %w", err)
		}
		*s = c
	case *Curve[sw_bw6761.ScalarField, sw_bw6761.G1Affine]:
		c, err := sw_emulated.New[emparams.BW6761Fp, emparams.BW6761Fr](api, sw_emulated.GetBW6761Params())
		if err != nil {
			return ret, fmt.Errorf("new curve: %w", err)
		}
		*s = c
	case *Curve[sw_bls12381.ScalarField, sw_bls12381.G1Affine]:
		c, err := sw_emulated.New[emparams.BLS12381Fp, emparams.BLS12381Fr](api, sw_emulated.GetBLS12381Params())
		if err != nil {
			return ret, fmt.Errorf("new curve: %w", err)
		}
		*s = c
	case *Curve[sw_bls12377.ScalarField, sw_bls12377.G1Affine]:
		c, err := sw_bls12377.NewCurve(api)
		if err != nil {
			return ret, fmt.Errorf("new curve: %w", err)
		}
		*s = c
	case *Curve[sw_bls24315.ScalarField, sw_bls24315.G1Affine]:
		c, err := sw_bls24315.NewCurve(api)
		if err != nil {
			return ret, fmt.Errorf("new curve: %w", err)
		}
		*s = c
	default:
		return ret, fmt.Errorf("unknown type parametrisation")
	}
	return ret, nil
}