Char onions and garlic. Place the onion and garlic on a baking sheet under the broiler. Broil for 9-10 minutes, flipping occasionally. Once they are soft and charred, remove from the heat.
Peel garlic. Let garlic cool slightly, then peel.
Toast chiles. Heat a cast iron skillet over medium heat. When hot, add ancho chiles and toast for 3-4 minutes flipping frequently until all sides have darkened in color, but not burnt.
Soak chiles. Bring a small saucepan of water to a boil and add toasted chiles. Remove from heat and soak chiles for 10-15 minutes or until soft.
Fry the pumpkin seeds. Return the skillet to the heat and add 1 tablespoon of the oil. Add the pumpkin seeds and fry in the oil until golden and starting to pop. Remove to a plate. Season with salt.
Fry the almonds. Return the skillet to medium heat. Add the sliced almonds and toast, stirring frequently, until golden. Remove to a separate plate.
Fry the spices. Return the skillet to medium heat and add another tablespoon of oil. Fry the cloves, and canela for about a minute or until fragrant. Transfer to the plate with the almonds.
Puree the sauce. Transfer the onion, garlic, chiles, 1 cup of chile soaking liquid, almonds, 1/4 cup of the toasted pumpkin seeds, cloves, cinnamon and allspice in the blender and purée until smooth.
Fry the sauce. In a deep frying pan or saucepan, heat the remaining 2 tablespoons of oil over medium heat. Once shimmering add the chile mixture. It will bubble vigorously so be careful. Stir until it stops spitting then add the salt and sugar. Cook for about 5 minutes, stirring frequently to help prevent the sauce from sticking to the bottom of the pan. The color will darken considerably.
Add pumpkin and broth. Add the pumpkin purée and chicken broth to the sauce. Stir well until the pumpkin has dissolved, it will have a silky consistency. Continue to cook for about 12 minutes, stirring occasionally or if you have them time cook over very low heat, covered, for an hour.
Serve! Season with more salt if necessary and serve over grilled or broiled chicken, shrimp, or pork or even enchiladas, garnished with the remaining toasted pumpkin seeds. You can also let cool then transfer to mason jars and keep in the refrigerator for up to a week.