+ def filter_lease(reservation_list, filter_type, filter_value ):
+ """Filters the lease reservation list by removing each lease whose
+ filter_type is not equal to the filter_value provided. Returns the list
+ of leases in one slice, defined by the slice_hrn if filter_type
+ is 'slice_hrn'. Otherwise, returns all leases scheduled starting from
+ the filter_value if filter_type is 't_from'.
+
+ :param reservation_list: leases list
+ :type reservation_list: list of dictionary
+ :param filter_type: can be either 't_from' or 'slice hrn'
+ :type filter_type: string
+ :param filter_value: depending on the filter_type, can be the slice_hrn
+ or can be defining a timespan.
+ :type filter_value: if filter_type is 't_from', filter_value is int.
+ if filter_type is 'slice_hrn', filter_value is a string.
+
+
+ :returns: filtered_reservation_list, contains only leases running or
+ scheduled in the given slice (wanted_slice).Dict keys are
+ 'lease_id','reserved_nodes','slice_id', 'state', 'user',
+ 'component_id_list','slice_hrn', 'resource_ids', 't_from', 't_until'
+ :rtype: list of dict
+
+ """