def create_layer_2_socket():
<EOL>s = None<EOL>try:<EOL><INDENT>log.info("<STR_LIT>")<EOL>s = socket.socket(socket.AF_PACKET,<EOL>socket.SOCK_RAW,<EOL>socket.ntohs(<NUM_LIT>))<EOL><DEDENT>except socket.error as msg:<EOL><INDENT>log.error(("<STR_LIT>")<EOL>.format(msg))<EOL><DEDENT>return s<EOL>
create_layer_2_socket