<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def make_general(basis, use_copy=True):
 """ Makes one large general contraction for each angular momentum If use_copy is True, the input basis set is not modified. The output of this function is not pretty. If you want to make it nicer, use sort_basis afterwards. """


    zero = '0.00000000'

    basis = uncontract_spdf(basis, 0, use_copy)

    for k, el in basis['elements'].items():
        if not 'electron_shells' in el:
            continue

        # See what we have
        all_am = []
        for sh in el['electron_shells']:
            if not sh['angular_momentum'] in all_am:
                all_am.append(sh['angular_momentum'])

        all_am = sorted(all_am)

        newshells = []
        for am in all_am:
            newsh = {
                'angular_momentum': am,
                'exponents': [],
                'coefficients': [],
                'region': '',
                'function_type': None,
            }

            # Do exponents first
            for sh in el['electron_shells']:
                if sh['angular_momentum'] != am:
                    continue
                newsh['exponents'].extend(sh['exponents'])

            # Number of primitives in the new shell
            nprim = len(newsh['exponents'])

            cur_prim = 0
            for sh in el['electron_shells']:
                if sh['angular_momentum'] != am:
                    continue

                if newsh['function_type'] is None:
                    newsh['function_type'] = sh['function_type']

                # Make sure the shells we are merging have the same function types
                ft1 = newsh['function_type']
                ft2 = sh['function_type']

                # Check if one function type is the subset of another
                # (should handle gto/gto_spherical, etc)
                if ft1 not in ft2 and ft2 not in ft1:
                    raise RuntimeError("Cannot make general contraction of different function types")

                ngen = len(sh['coefficients'])

                for g in range(ngen):
                    coef = [zero] * cur_prim
                    coef.extend(sh['coefficients'][g])
                    coef.extend([zero] * (nprim - len(coef)))
                    newsh['coefficients'].append(coef)

                cur_prim += len(sh['exponents'])

            newshells.append(newsh)

        el['electron_shells'] = newshells

    return basis