def properties_to_params(props):
 candidates = filter((lambda x: ('parameterDefinitions' in x)), props)
 if candidates:
  def transform(x):
   return {x['name']: x['defaultParameterValue']['value']}
  return {k: v for d in map(transform, candidates[0]['parameterDefinitions']) for (k, v) in d.items()}
 return None

def properties_to_params ( props ) : candidates = filter ( ( lambda x : ( 'parameterDefinitions' in x ) ) , props ) if candidates : def transform ( x ) : return { x [ 'name' ] : x [ 'defaultParameterValue' ] [ 'value' ] } return { k : v for d in map ( transform , candidates [ 0 ] [ 'parameterDefinitions' ] ) for ( k , v ) in d . items ( ) } return None
given jenkins build properties .