What is the difference between sample weight and class weight options in scikit learn?
sample_weight and class_weight have a similar function, that is to make your estimator pay more attention to some samples. 
Actual sample weights will be sample_weight * weights from class_weight.
This serves the same purpose as under/oversampling but the behavior is likely to be different: say you have an algorithm that randomly picks samples (like in random forests), it matters whether you oversampled or not.
To sum it up:
class_weight and sample_weight both do 2), option 2) is one way to handle class imbalance. I don't know of an universally recommended way, I would try 1), 2) and 1) + 2) on your specific problem to see what works best.
I have class imbalance problem and want to solve this using cost sensitive learning. 

under sample and over sample 
give weights to class to use a modified loss function 

Question 
Scikit learn has 2 options called class weights and sample weights. Is sample weight actually doing option 2) and class weight options 1). Is option 2) the the recommended way of handling class imbalance.