def moran_cultural(network):
if not network.transmissions():  <EOL><INDENT>replacer = random.choice(network.nodes(type=Source))<EOL>replacer.transmit()<EOL><DEDENT>else:<EOL><INDENT>replacer = random.choice(network.nodes(type=Agent))<EOL>replaced = random.choice(replacer.neighbors(direction="<STR_LIT:to>", type=Agent))<EOL>from operator import attrgetter<EOL>replacer.transmit(<EOL>what=max(replacer.infos(), key=attrgetter("<STR_LIT>")),<EOL>to_whom=replaced,<EOL>)<EOL><DEDENT>
Generalized cultural Moran process.

    At eachtime step, an individual is chosen to receive information from
    another individual. Nobody dies, but perhaps their ideas do.