It's hard to develop reliable cooked pasta calorie measures. But in general, speaking of plain flour and water pasta, 2 oz by weight cooks to about a cup, and both have roughly 210 calories. Cooking may make more of the flour become nutritionally available, but not enough to worry about. For dried pasta, the calorie content is essentially that of the same weight of flour.
If some resource suggests a difference between one cup cooked and two ounces uncooked pasta, it will be the result of (1) plain error, (2) confusion over conversion of weight to volume measures. It's a little hard to be precise about cooked pasta, since the form of the pasta influences how it fills the typical one cup volume.
Fresh pasta will have fewer calories than the same weight of dry, because there is still some water in it.
Food label calories are derived using the Atwater system that assigns kcal values per gram for the components of foods, carbohydrates, proteins, and fats, with an additional value for alcohol. The values were originally derived by burning. So the calorie values for various foods are really the result of analyzing the components by weight and applying the standard values.