def get_sample_weight(samples, metric):
    """
    Positional Arguements:
        samples: Numpy Array. Required.
        metric: String. 'l1' or 'l2'. Required.
    """
    assert metric in ['l1', 'l2']
    if metric == 'l1':
        sample_weight = samples.apply(lambda y: 1 / y)
    elif metric == 'l2':
        sample_weight = samples.apply(lambda y: 1 / y ** 2)
    sample_weight = sample_weight / sample_weight.sum()
    sample_weight = sample_weight.get_values()
    return sample_weight
