<s> """<STR_LIT>""" <EOL> from flask import Flask , request , jsonify <EOL> from . core import __DB__ , get_ports <EOL> app = Flask ( __name__ ) <EOL> @ app . route ( "<STR_LIT>" , methods = [ "<STR_LIT:GET>" ] ) <EOL> def all_ports ( ) : <EOL> """<STR_LIT>""" <EOL> return jsonify ( { "<STR_LIT>" : __DB__ . all ( ) } ) <EOL> @ app . route ( "<STR_LIT>" , methods = [ "<STR_LIT:GET>" ] ) <EOL> def specific_ports ( pattern ) : <EOL> """<STR_LIT>""" <EOL> like = "<STR_LIT>" in request . args <EOL> return jsonify ( { "<STR_LIT>" : get_ports ( pattern , like ) } ) </s>
