def apply_random_samples(prop, og_prop, attr, attr_randomization_params,
                         curr_gym_step_count, extern_sample=None, bucketing_randomization_params=None):
    
    """
    @params:
        prop: property we want to randomise
        og_prop: the original property and its value 
        attr: which particular attribute we want to randomise e.g. damping, stiffness
        attr_randomization_params: the attribute randomisation meta-data e.g. distr, range, schedule
        curr_gym_step_count: gym steps so far 

    """

    if isinstance(prop, gymapi.SimParams):
        
        if attr == 'gravity':
            
            sample = generate_random_samples(attr_randomization_params, 3, curr_gym_step_count)
            if attr_randomization_params['operation'] == 'scaling':
                prop.gravity.x = og_prop['gravity'].x * sample[0]
                prop.gravity.y = og_prop['gravity'].y * sample[1]
                prop.gravity.z = og_prop['gravity'].z * sample[2]
            elif attr_randomization_params['operation'] == 'additive':
                prop.gravity.x = og_prop['gravity'].x + sample[0]
                prop.gravity.y = og_prop['gravity'].y + sample[1]
                prop.gravity.z = og_prop['gravity'].z + sample[2]


        if attr == 'rest_offset':

           sample = generate_random_samples(attr_randomization_params, 1, curr_gym_step_count)
           prop.physx.rest_offset = sample
                

    elif isinstance(prop, np.ndarray):
        assert False, "DOES THIS EVER RUN???"

        sample = generate_random_samples(attr_randomization_params, prop[attr].shape,
                                         curr_gym_step_count, extern_sample)

        if attr_randomization_params['operation'] == 'scaling':
            if 'num_buckets' in attr_randomization_params and attr_randomization_params['num_buckets'] > 0:
                sample = get_bucketed_val(sample, attr_randomization_params)
            new_prop_val = og_prop[attr] * sample
        elif attr_randomization_params['operation'] == 'additive':
            if 'num_buckets' in attr_randomization_params and attr_randomization_params['num_buckets'] > 0:
                sample = get_bucketed_val(sample, attr_randomization_params)
            new_prop_val = og_prop[attr] + sample

        # if 'num_buckets' in attr_randomization_params and attr_randomization_params['num_buckets'] > 0:
        #     new_prop_val = get_bucketed_val(new_prop_val, attr_randomization_params)
        
        prop[attr] = new_prop_val
    else:
        sample = generate_random_samples(attr_randomization_params, 1,
                                         curr_gym_step_count, extern_sample)

        cur_attr_val = og_prop[attr]
        if attr_randomization_params['operation'] == 'scaling':
            if 'num_buckets' in attr_randomization_params and attr_randomization_params['num_buckets'] > 0:
                sample = get_bucketed_val(sample, attr_randomization_params)
            new_prop_val = cur_attr_val * sample
        elif attr_randomization_params['operation'] == 'additive':
            if 'num_buckets' in attr_randomization_params and attr_randomization_params['num_buckets'] > 0:
                sample = get_bucketed_val(sample, attr_randomization_params)
            new_prop_val = cur_attr_val + sample
        
        assert bucketing_randomization_params is None, "TODO NOT SUPPORTED"

        # if 'num_buckets' in attr_randomization_params and attr_randomization_params['num_buckets'] > 0:
        #     if bucketing_randomization_params is None:
        #         new_prop_val = get_bucketed_val(new_prop_val, attr_randomization_params)
        #     else:
        #         new_prop_val = get_bucketed_val(new_prop_val, bucketing_randomization_params)

    print(f"attr: {attr}, og_prop: {og_prop[attr]}, new_prop_val: {new_prop_val}")
    setattr(prop, attr, new_prop_val)

    @params:
        prop: property we want to randomise
        og_prop: the original property and its value 
        attr: which particular attribute we want to randomise e.g. damping, stiffness
        attr_randomization_params: the attribute randomisation meta-data e.g. distr, range, schedule
        curr_gym_step_count: gym steps so far 

    
globe_walking/go1_gym/utils/dr_utils.py