I've got 6
TPS's sitting in front of me, and not one has a connector pin setup that matches yours. Sorry. I've got two different types here, pins and flat blades, yours looks like a different type of pin setup.
As for the other thing, that's emissions stuff. It should be a vacuum line and you can fix it by connecting the broken pieces with a section of windshield washer or vacuum hose.