247. Every person who, knowingly, by an act or omission attempts to aid a person to commit an offence or advises a person to commit an offence, encourages or incites him thereto, is himself a party to the offence and liable to the same penalty as that provided for the person who committed it, whether or not such person has been prosecuted or convicted.