def METHOD_NAME(netlist, voltage_cell_name, pins_to_remove):
    """remove proxy pins in the cell which produces the different voltage (if they are present) and correct every instance of such cell, takes and returns a string"""
    if voltage_cell_name == None or pins_to_remove == None:
        return netlist
    # return a match to only the pinout of the voltage cell definition, only non case sensitive on .subckt
    voltage_cell_pinout_m = re.search(
        "(?i)\.SUBCKT (?-i:" + voltage_cell_name + ".*\n(\+.*\n)*)", netlist
    )
    # convert match object to string
    voltage_cell_pinout = voltage_cell_pinout_m.group(0)
    # remove proxy pins
    correct_voltage_cell_pinout = voltage_cell_pinout
    for pin in pins_to_remove:
        correct_voltage_cell_pinout = correct_voltage_cell_pinout.replace(" " + pin, "")
    # swap out for the new voltage cell definition
    netlist = netlist.replace(voltage_cell_pinout, correct_voltage_cell_pinout)
    # *****NOW: correct the inputs for every instantiation of the voltage cell*****
    # find the position of the removed pins
    # make the original voltage cell pinout one line + del extra /n
    voltage_cell_pinout = voltage_cell_pinout.replace("\n+", "").replace("\n", "")
    voltage_cell_pinout_arr = voltage_cell_pinout.split(" ")
    # find the indices in the pinout of pins to remove
    indices = list()
    for pin in pins_to_remove:
        if pin in voltage_cell_pinout_arr:
            indices.append(voltage_cell_pinout_arr.index(pin))
    # sort from biggest to smallest because last pin should be removed first to not invalidate other indices
    indices.sort(reverse=True)
    # get all voltage cell instances and one line them
    # voltage_cell_instances_m = re.findall(".*"+voltage_cell_name+"$", netlist,flags=re.MULTILINE)# edit here
    voltage_cell_instances = get_all_instantiations(voltage_cell_name, netlist)
    for instance in voltage_cell_instances:
        netlist = netlist.replace(
            instance, instance.replace("\n+", "").replace("\n", "")
        )
    # update voltage_cell_instances after we have flattend everything (easier to implement than reference for loop)
    voltage_cell_instances = get_all_instantiations(voltage_cell_name, netlist)
    # loop through voltage cell instances correcting the inputs
    for voltage_cell_instance in voltage_cell_instances:
        voltage_cell_instance_arr = voltage_cell_instance.split(" ")
        # voltage cell instance must have name pin1 pin2 ... pinN voltage_cell_name
        # delete pins at index positions in the pin order
        for pin_position in indices:
            voltage_cell_instance_arr.pop(pin_position - 1)
        correct_voltage_cell_instance = " ".join(voltage_cell_instance_arr)
        netlist = netlist.replace(voltage_cell_instance, correct_voltage_cell_instance)
    return netlist