ATLAS Offline Software
Functions
ActsUtilities Namespace Reference

Functions

dict extractChildKwargs (*str prefix, **dict kwargs)
 

Function Documentation

◆ extractChildKwargs()

dict ActsUtilities.extractChildKwargs ( *str  prefix,
**dict  kwargs 
)
Extract subset of kwargs with common prefix 

Definition at line 3 of file ActsUtilities.py.

4  prefix: str,
5  **kwargs: dict) -> dict:
6  """ Extract subset of kwargs with common prefix """
7  assert isinstance(kwargs, dict)
8  assert isinstance(prefix, str)
9 
10  args = dict()
11  for (k,v) in kwargs.items():
12  if len(k) <= len(prefix):
13  continue
14  if k[:len(prefix)] != prefix:
15  continue
16  args[ k[len(prefix):] ] = v
17  return args
ActsUtilities.extractChildKwargs
dict extractChildKwargs(*str prefix, **dict kwargs)
Definition: ActsUtilities.py:3