Caper spurge, paper spurge, moleplant
Euphorbia lathyris is native to the Caucasus (source), but can be found as an introduced species in many other regions. The fruits look like capers but, like the rest of the plant, they are poisonous.
This member of the Euphorbiaceae family is an annual or biennial. It dies as soon as its seeds ripen.
Caper spurge grows in shady to sunny places and is often found near gardens. Where it is planted to control moles or voles.
I can say from personal experience that it does not have a deterrent effect on these animals.
Euphorbia lathyris can grow up to 1.5 metres tall in evenly moist, nutrient-rich soil. In other places it remains smaller. It also grows along roadsides, in gravel paths, between stone joints and even on walls.