legacy: fix for run_sql import in bibrecord

* Addresses issue with imports outside application context.  (closes #2295)

Signed-off-by: Jiri Kuncar <jiri.kuncar@cern.ch>
422: D401 First line should be imperative: 'create', not 'creates'
422: D400 First line should end with '.', not 'e'
422: D200 One-line docstring should not occupy 2 lines
479: D400 First line should end with '.', not 'e'
517: D401 First line should be imperative: 'Return', not 'Returns'
517: D200 One-line docstring should not occupy 3 lines
608:9: F841 local variable 'sets_names' is assigned to but never used
638: D401 First line should be imperative: 'return', not 'returns'
638: D400 First line should end with '.', not 'e'
638: D208 Docstring is over-indented
638: D200 One-line docstring should not occupy 3 lines
649: D401 First line should be imperative: 'return', not 'returns'
649: D400 First line should end with '.', not 'e'
649: D208 Docstring is over-indented
649: D200 One-line docstring should not occupy 3 lines
660: D103 Docstring missing
699: D103 Docstring missing
765: D103 Docstring missing
778: D290 White spaces around docstring should be trimmed.
778: D400 First line should end with '.', not 'a'
778: D205 Blank line missing between one-line summary and description
778: D208 Docstring is over-indented
818: D103 Docstring missing
940: D400 First line should end with '.', not 'd'
995: D401 First line should be imperative: 'Harvest', not 'Harvests'
995: D400 First line should end with '.', not 't'
995: D208 Docstring is over-indented
995: D200 One-line docstring should not occupy 3 lines
1007: D103 Docstring missing
1019: D401 First line should be imperative: 'Format', not 'Formats'
1019: D205 Blank line missing between one-line summary and description
1046: D400 First line should end with '.', not 't'
1056:15: E711 comparison to None should be 'if cond is None:'
1060:19: E711 comparison to None should be 'if cond is None:'
1076: D401 First line should be imperative: 'Launche', not 'Launches'
1076: D200 One-line docstring should not occupy 3 lines
1097: D400 First line should end with '.', not 'd'
1117: D400 First line should end with '.', not 'w'
1127: D103 Docstring missing
1135: D103 Docstring missing
1158: D290 White spaces around docstring should be trimmed.
1158: D400 First line should end with '.', not 'd'
1224: D103 Docstring missing
1268: D103 Docstring missing
1319: D103 Docstring missing
1325: D103 Docstring missing
1334: D103 Docstring missing
1353: D103 Docstring missing
1362: D103 Docstring missing
1373: D103 Docstring missing
1384: D103 Docstring missing
1391: D103 Docstring missing
1395: D103 Docstring missing
1401: D208 Docstring is over-indented
1447: D202 No blank lines allowed *after* function docstring, found 1
1526: D401 First line should be imperative: 'Find', not 'Finds'