diff --git a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/python/ConfiguredInDetTrackingGeometryBuilderCond.py b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/python/ConfiguredInDetTrackingGeometryBuilderCond.py
index e7b5a0f97a74d3a3ab81e76cf5fd94e17a59b669..735ae4b690de2924a0f6ff0714da7316ad638867 100644
--- a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/python/ConfiguredInDetTrackingGeometryBuilderCond.py
+++ b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/python/ConfiguredInDetTrackingGeometryBuilderCond.py
@@ -184,7 +184,7 @@ class ConfiguredInDetTrackingGeometryBuilderCond( InDet__RobustTrackingGeometryB
         ServiceMgr += AtlasEnvelopeSvc
         
         if name.find('CondCond')>=0 :
-            raise exception('invalid name composition %s ' % (name))
+            raise Exception('invalid name composition %s ' % name)
         # the tracking geometry builder
         super(ConfiguredInDetTrackingGeometryBuilderCond,self).__init__(name,\
                                                       BeamPipeBuilder   = BeamPipeBuilder,\
diff --git a/InnerDetector/InDetMonitoring/TRTMonitoringRun3/python/TRTMonitoringRun3RAW_Alg.py b/InnerDetector/InDetMonitoring/TRTMonitoringRun3/python/TRTMonitoringRun3RAW_Alg.py
index 1a3f91769ea599758117ac652f34dc6da70d8bd0..f29e20aabc97244f4eb404c49693a1efce507cf4 100644
--- a/InnerDetector/InDetMonitoring/TRTMonitoringRun3/python/TRTMonitoringRun3RAW_Alg.py
+++ b/InnerDetector/InDetMonitoring/TRTMonitoringRun3/python/TRTMonitoringRun3RAW_Alg.py
@@ -20,7 +20,7 @@ def TRTHoleSearch(name='TRTTrackHoleSearchTool', **kwargs) :
     kwargs.setdefault('name',name)
     if 'Extrapolator' not in kwargs :
         from TrkExTools.AtlasExtrapolator import AtlasExtrapolator
-        kwargs=setDefaults(kwargs,Extrapolator = AtlasExtrapolator())
+        kwargs.setDefaults(kwargs,Extrapolator = AtlasExtrapolator())
 
     from TRT_TrackHoleSearch.TRT_TrackHoleSearchConf import TRTTrackHoleSearchTool
     return TRTTrackHoleSearchTool(**kwargs)
diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkTrigger/python/TriggerMatchingHelper.py b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkTrigger/python/TriggerMatchingHelper.py
index e35d0254b7651cae450864ee1bec12eb245fff55..e6dea5da2c1e1f805daef872b6d8e7eb7d8ea76b 100644
--- a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkTrigger/python/TriggerMatchingHelper.py
+++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkTrigger/python/TriggerMatchingHelper.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 
 from DerivationFrameworkTrigger.DerivationFrameworkTriggerConf import (
     DerivationFramework__TriggerMatchingTool,
@@ -6,9 +6,9 @@ from DerivationFrameworkTrigger.DerivationFrameworkTriggerConf import (
 from DerivationFrameworkCore.DerivationFrameworkCoreConf import (
     DerivationFramework__CommonAugmentation,
 )
-from DerivationFrameworkCore.DerivationFrameworkMaster import (
+from DerivationFrameworkCore.DerivationFrameworkMaster import (  # noqa: F401
     DerivationFrameworkJob,
-)  # noqa: F401
+)
 from TriggerMatchingTool.TriggerMatchingToolConf import Trig__R3IParticleRetrievalTool
 from TrigDecisionTool.TrigDecisionToolConf import Trig__TrigDecisionTool
 from AthenaConfiguration.AllConfigFlags import ConfigFlags
diff --git a/Reconstruction/Jet/JetValidation/python/PhysicsValidationHistos.py b/Reconstruction/Jet/JetValidation/python/PhysicsValidationHistos.py
index a8bd2a20a406f30fb50455608d23f9aed8b3c1b9..958884a3c6ed08de4d1ea2938b7e4e173668d8ff 100644
--- a/Reconstruction/Jet/JetValidation/python/PhysicsValidationHistos.py
+++ b/Reconstruction/Jet/JetValidation/python/PhysicsValidationHistos.py
@@ -1,9 +1,7 @@
-# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
-
-from __future__ import print_function
+# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 
 from JetMonitoring.JetHistoTools import jhm, selectionAndHistos
-from JetMonitoring.JetMonitoringConf import JetAttributeHisto, HistoDefinitionTool, JetMonitoringTool, JetKinematicHistos, JetContainerHistoFiller, JetSubStructureHistos
+from JetMonitoring.JetMonitoringConf import JetMonitoringTool, JetKinematicHistos, JetContainerHistoFiller, JetSubStructureHistos
 from AthenaCommon.AppMgr import ServiceMgr as svcMgr
 from PyUtils.MetaReader import read_metadata
 
diff --git a/Reconstruction/RecoAlgs/IsolationAlgs/python/IsoUpdatedTrackCones.py b/Reconstruction/RecoAlgs/IsolationAlgs/python/IsoUpdatedTrackCones.py
index d79a858410f57830104d663cabd1f28782a35b37..13971088d47367ecd38745785eda22c2b7df0dbf 100644
--- a/Reconstruction/RecoAlgs/IsolationAlgs/python/IsoUpdatedTrackCones.py
+++ b/Reconstruction/RecoAlgs/IsolationAlgs/python/IsoUpdatedTrackCones.py
@@ -1,8 +1,7 @@
-# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 
 from AthenaCommon.Logging import logging
 from AthenaCommon import CfgMgr
-from GaudiKernel import Constants
 
 log = logging.getLogger(__name__)
 
diff --git a/Simulation/ISF/ISF_Fatras/ISF_FatrasServices/python/FatrasTrackingGeometrySvc.py b/Simulation/ISF/ISF_Fatras/ISF_FatrasServices/python/FatrasTrackingGeometrySvc.py
index 5e938ea343c9dd8942b352dac40464f1273b24e2..65d3478be3c0e20eda6fc4813579b2779cc50c52 100755
--- a/Simulation/ISF/ISF_Fatras/ISF_FatrasServices/python/FatrasTrackingGeometrySvc.py
+++ b/Simulation/ISF/ISF_Fatras/ISF_FatrasServices/python/FatrasTrackingGeometrySvc.py
@@ -1,6 +1,4 @@
-# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
-
-from __future__ import print_function
+# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 
 class FatrasTrackingGeometryCondAlg:
   def __init__(self):
@@ -132,7 +130,7 @@ class FatrasTrackingGeometryCondAlg:
        FatrasGeometryBuilder.MuonTrackingGeometryBuilder = FatrasMuonTrackingGeometryBuilder      
   
     from FatrasExample.FatrasTuning import FatrasTuningFlags
-    from InDetCondFolders import InDetAlignFolders_FATRAS
+    from InDetCondFolders import InDetAlignFolders_FATRAS     # noqa: F401
     from TrackingGeometryCondAlg.AtlasTrackingGeometryCondAlg import ConfiguredTrackingGeometryCondAlg as GeometryCondAlg
     FatrasTrackingGeometryCondAlg = GeometryCondAlg(name = 'FatrasTrackingGeometryCondAlg')
 
diff --git a/Simulation/ISF/ISF_Fatras/ISF_FatrasServices/python/ISF_FatrasServicesConfig.py b/Simulation/ISF/ISF_Fatras/ISF_FatrasServices/python/ISF_FatrasServicesConfig.py
index 860e6f9128b9e49e2877cc3ac21ad0f799b1d012..f750f643811660f7533e7dea03a4aab3906ddd06 100644
--- a/Simulation/ISF/ISF_Fatras/ISF_FatrasServices/python/ISF_FatrasServicesConfig.py
+++ b/Simulation/ISF/ISF_Fatras/ISF_FatrasServices/python/ISF_FatrasServicesConfig.py
@@ -6,8 +6,6 @@ KG Tan, 04/12/2012
 Updated by J. Chapman
 """
 
-from __future__ import print_function
-
 from AthenaCommon import CfgMgr
 from AthenaCommon.CfgGetter import getPublicTool
 
@@ -178,7 +176,7 @@ def getFatrasNavigator(name="ISF_FatrasNavigator", **kwargs):
     condSeq = AthSequencer("AthCondSeq")
 
     if not hasattr (condSeq, 'AtlasTrackingGeometryCondAlg'):
-      from InDetCondFolders import InDetAlignFolders_FATRAS
+      from InDetCondFolders import InDetAlignFolders_FATRAS  # noqa: F401
       from TrackingGeometryCondAlg.AtlasTrackingGeometryCondAlg import ConfiguredTrackingGeometryCondAlg
       TrkGeoCondAlg = ConfiguredTrackingGeometryCondAlg('AtlasTrackingGeometryCondAlg')
       condSeq+= TrkGeoCondAlg
@@ -409,7 +407,7 @@ def getFatrasMaterialUpdator(name="ISF_FatrasMaterialUpdator", **kwargs):
     condSeq = AthSequencer("AthCondSeq")
 
     if not hasattr (condSeq, 'AtlasTrackingGeometryCondAlg'):
-      from InDetCondFolders import InDetAlignFolders_FATRAS
+      from InDetCondFolders import InDetAlignFolders_FATRAS  # noqa: F401
       from TrackingGeometryCondAlg.AtlasTrackingGeometryCondAlg import ConfiguredTrackingGeometryCondAlg
       TrkGeoCondAlg = ConfiguredTrackingGeometryCondAlg('AtlasTrackingGeometryCondAlg')
       condSeq+= TrkGeoCondAlg
diff --git a/Tracking/TrkConfig/python/AtlasExtrapolatorConfig.py b/Tracking/TrkConfig/python/AtlasExtrapolatorConfig.py
index fb4158dd026f93bef146ff1075cdf5851af45e45..5e6dcc2efaa1eff36b0db1403104b04d9b4ce0c1 100644
--- a/Tracking/TrkConfig/python/AtlasExtrapolatorConfig.py
+++ b/Tracking/TrkConfig/python/AtlasExtrapolatorConfig.py
@@ -24,7 +24,7 @@ def AtlasNavigatorCfg(flags, name='AtlasNavigator') :
               result.merge(acc)
        else :
             from TrackingGeometryCondAlg.AtlasTrackingGeometryCondAlgConfig import TrackingGeometryCondAlgCfg
-            result.merge( TrackingGeometryCondAlgCfg(flags) );
+            result.merge( TrackingGeometryCondAlgCfg(flags) )
             geom_cond_key = 'AtlasTrackingGeometry'
             # @TOOD how to get the key of the TrackingGeometry conditions data ?
        # the UNIQUE NAVIGATOR ( === UNIQUE GEOMETRY) --------------------------------------------------------------
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/python/chainDictDumper.py b/Trigger/TrigHypothesis/TrigHLTJetHypo/python/chainDictDumper.py
index 4e1c291990f70617d36b2652c0317018d24f1618..1cb6c5f7a98355191153c914915ac0dce56129c7 100644
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/python/chainDictDumper.py
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/python/chainDictDumper.py
@@ -10,7 +10,7 @@ pp = PrettyPrinter(indent=4)
 pp.pprint(JetChainParts)
 
 def do_it():
-    print('\n------------------\n') #noqa: ATL901
+    print('\n------------------\n') # noqa: ATL901
     chain_dict = dictFromChainName(chain_name)
     pp.pprint(chain_dict)
 
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/python/jetlabel_tester.py b/Trigger/TrigHypothesis/TrigHLTJetHypo/python/jetlabel_tester.py
index 8ee757dde506d96674ba79756355f830c6606913..d709448e2d7f881e7a9e651e7a44223f9eac1c10 100644
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/python/jetlabel_tester.py
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/python/jetlabel_tester.py
@@ -6,31 +6,31 @@ from __future__ import print_function
 from ChainLabelParser import ChainLabelParser
 
 def compile(label, do_dump=False, do_print=False):
-    print ('compile:',  label) #noqa: ATL901
+    print ('compile:',  label) # noqa: ATL901
 
     parser = ChainLabelParser(label, debug=False)
     forest = parser.parse()
 
-    print ('forest has %d' % len(forest),' tree(s)\n') #noqa: ATL901
+    print ('forest has %d' % len(forest),' tree(s)\n') # noqa: ATL901
     
     for i, tree in enumerate(forest):
 
-        print ('tree ', i, '\n') #noqa: ATL901
+        print ('tree ', i, '\n') # noqa: ATL901
 
         tree.set_ids(node_id=0, parent_id=0)
     
     
-        print ('compile: tree.scenario', tree.scenario) #noqa: ATL901
+        print ('compile: tree.scenario', tree.scenario) # noqa: ATL901
 
         
         
         if do_print:
-            print ('\nnode dumping top node only:\n') #noqa: ATL901
-            print (tree) #noqa: ATL901
+            print ('\nnode dumping top node only:\n') # noqa: ATL901
+            print (tree) # noqa: ATL901
 
         if do_dump:
-            print ('\nnode dump tree:\n') #noqa: ATL901
-            print (tree.dump()) #noqa: ATL901
+            print ('\nnode dump tree:\n') # noqa: ATL901
+            print (tree.dump()) # noqa: ATL901
         
     return forest
 
@@ -49,16 +49,16 @@ if __name__ == '__main__':
     try:
         index = int(c)
     except Exception:
-        print('expected int in [1,%d] ]on comand line, got %s' % (  #noqa: ATL901
+        print('expected int in [1,%d] ]on comand line, got %s' % (  # noqa: ATL901
             len(test_strings), c))
         sys.exit()
 
     if(index < 0 or index > len(test_strings) - 1):
-        print('index %d not in range [0, %d]' % (index, len(test_strings) -1))  #noqa: ATL901
+        print('index %d not in range [0, %d]' % (index, len(test_strings) -1))  # noqa: ATL901
         sys.exit()
                                                  
             
-    print('index', index)  #noqa: ATL901
+    print('index', index)  # noqa: ATL901
     label = test_strings[index]
 
     tree = compile(label, do_dump=True)
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/python/test_cases.py b/Trigger/TrigHypothesis/TrigHLTJetHypo/python/test_cases.py
index 0ead847364b311cb1a27e532b5a5e15bdec4e719..c2f7617ebeebacf1d2ded32dcb5e5098a4a853a5 100644
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/python/test_cases.py
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/python/test_cases.py
@@ -56,6 +56,6 @@ test_strings = [
 
 if __name__ == '__main__':
     for i, tc in enumerate(test_strings):
-        print (i, tc) #noqa: ATL901
+        print (i, tc) # noqa: ATL901
 
-    print('There are %d test cases' % len(test_strings)) #noqa: ATL901
+    print('There are %d test cases' % len(test_strings)) # noqa: ATL901
diff --git a/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/python/TrigFullScanLRTHypoTool.py b/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/python/TrigFullScanLRTHypoTool.py
index faf5f326d3e15bf3e1944d33042c87d8ffc9723d..b5ba8be251605a2e9ebc2c758cd19a87e10c1d9e 100644
--- a/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/python/TrigFullScanLRTHypoTool.py
+++ b/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/python/TrigFullScanLRTHypoTool.py
@@ -1,12 +1,6 @@
 # Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 
-from AthenaCommon.SystemOfUnits import GeV
 from AthenaCommon.Logging import logging
-log = logging.getLogger("TrigLongLivedParticlesHypo.TrigLRTHypoTool")
-from AthenaMonitoringKernel.GenericMonitoringTool import GenericMonitoringTool
-
-
-
 log = logging.getLogger('TrigLRTHypoTool')
 
 def TrigLRTHypoToolFromDict( chainDict ):
diff --git a/Trigger/TrigT1/TrigT1CaloSim/python/TrigT1CaloSimRun2Config.py b/Trigger/TrigT1/TrigT1CaloSim/python/TrigT1CaloSimRun2Config.py
index 2888364d878d41b0e1f374defddff608864d78c7..6c193ff04b9240301e02bd74ced419a6e22e6549 100644
--- a/Trigger/TrigT1/TrigT1CaloSim/python/TrigT1CaloSimRun2Config.py
+++ b/Trigger/TrigT1/TrigT1CaloSim/python/TrigT1CaloSimRun2Config.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 
 from TrigT1CaloSim.TrigT1CaloSimConf import LVL1__Run2TriggerTowerMaker
 
@@ -134,7 +134,7 @@ def L1LegacyCaloSimMCCfg(flags):
     from IOVDbSvc.IOVDbSvcConfig import addFolders
     acc.merge(addFolders(flags, L1CaloFolderList, 'TRIGGER_OFL'))
 
-    from TrigConfigSvc.TrigConfigSvcCfg import L1ConfigSvcCfg, getL1TopoConfigSvc
+    from TrigConfigSvc.TrigConfigSvcCfg import L1ConfigSvcCfg
     acc.merge(L1ConfigSvcCfg(flags))
 
     from TrigT1CaloSim.TrigT1CaloSimRun2Config import Run2TriggerTowerMakerCfg
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/UnconventionalTracking/FullScanLRTTrackingConfiguration.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/UnconventionalTracking/FullScanLRTTrackingConfiguration.py
index b6f0dc26ed63be918e21b7b8877e3e4a91fe3d1f..468cb0ae49ac0ce2cbcaed63fe320b5dc530bd7c 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/UnconventionalTracking/FullScanLRTTrackingConfiguration.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/UnconventionalTracking/FullScanLRTTrackingConfiguration.py
@@ -3,8 +3,6 @@ from AthenaCommon.CFElements import parOR
 from ..CommonSequences.FullScanDefs import trkFSRoI
 from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import MenuSequence, RecoFragmentsPool
 from AthenaCommon.Logging import logging
-from ViewAlgs.ViewAlgsConf import EventViewCreatorAlgorithm
-from DecisionHandling.DecisionHandlingConf import ViewCreatorInitialROITool
 
 logging.getLogger().info("Importing %s",__name__)
 log = logging.getLogger("TriggerMenuMT.HLTMenuConfig.UnconventionalTracking.FullScanLRTConfiguration")
@@ -17,7 +15,7 @@ def FullScanLRTTriggerSequence(ConfigFlags):
 
 
     from TrigEDMConfig.TriggerEDMRun3 import recordable
-    from TrigInDetConfig.InDetSetup import makeInDetAlgsNoView, makeInDetAlgs
+    from TrigInDetConfig.InDetSetup import makeInDetAlgsNoView
     view_algs = makeInDetAlgsNoView( config = fscfg, rois=trkFSRoI, secondStageConfig = lrtcfg)
 
     from TriggerMenuMT.HLTMenuConfig.Jet.JetMenuSequences import getTrackingInputMaker
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/UnconventionalTracking/UnconventionalTrackingChainConfiguration.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/UnconventionalTracking/UnconventionalTrackingChainConfiguration.py
index 042531170718a36671b0dd1d335753bf288121d1..6f3cb73023faeb492ff0788472f3ba29839bfd52 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/UnconventionalTracking/UnconventionalTrackingChainConfiguration.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/UnconventionalTracking/UnconventionalTrackingChainConfiguration.py
@@ -5,10 +5,9 @@ logging.getLogger().info("Importing %s",__name__)
 log = logging.getLogger("TriggerMenuMT.HLTMenuConfig.UnconventionalTracking.UnconventionalTrackingDef")
 
 from TriggerMenuMT.HLTMenuConfig.Menu.ChainConfigurationBase import ChainConfigurationBase
-from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import MenuSequence, RecoFragmentsPool, EmptyMenuSequence
-from AthenaCommon.CFElements import parOR, seqAND
+from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import MenuSequence, RecoFragmentsPool
+from AthenaCommon.CFElements import seqAND
 from ..CommonSequences.FullScanDefs import caloFSRoI
-from ..Menu.ChainMerging import mergeChainDefs
 
 def unconventionalTrackingChainParts(chainParts):
     unconvtrkChainParts = []
@@ -38,7 +37,6 @@ class UnconventionalTrackingChainConfiguration(ChainConfigurationBase):
 
 
         key = self.chainPart['extra']
-        import re
         #Work around to run isohpttrack with an alternative step without skip when there is an HLT_MET trigger
         # if key=="isohpttrack" and (re.match(".*_xe\d*_*",(self.chainName))):
         #     steps=stepDictionary["isohpttrackWithHLTMET"]