```python
description = 'vehicle in the wrong lane’
vehicles = get_objects_of_category(log_dir, category="VEHICLE")
non_buses = scenario_not(is_category)(vehicles, log_dir, category="BUS")
non_bus_in_bus_lane = on_lane_type(non_buses, log_dir, lane_type='BUS')
non_bike_in_bike_lane = on_lane_type(non_buses, log_dir, lane_type='BIKE')
in_wrong_lane_type = scenario_or([non_bus_in_bus_lane, non_bike_in_bike_lane])
output_scenario(in_wrong_lane_type, description, log_dir, output_dir)
```
```python
description = 'vehicle changing lanes'
vehicles = get_objects_of_category(log_dir, category='VEHICLE')
lane_changes = changing_lanes(vehicles, log_dir)
output_scenario(lane_changes, description, log_dir, output_dir)
```
```python
description = 'accelerating to the side'
all_objects = get_objects_of_category(log_dir, category=”ANY)
accel = scenario_not(has_lateral_acceleration)(all_objects, log_dir, min_accel=-1, max_accel=1)
output_scenario(accel, description, log_dir, output_dir)
```
```python
description='vehicle near multiple pedestrians'
vehicles = get_objects_of_category(log_dir, category='VEHICLE')
peds = get_objects_of_category(log_dir, category='PEDESTRIAN')
vehicles_near_peds = near_objects(vehicles, peds, log_dir, min_objects=2)
output_scenario(vehicles_near_peds, description, log_dir, output_dir)
```
```python
description='turning left'
vehicle_uuids = get_objects_of_category(log_dir, category='VEHICLE')
left_turn = turning(vehicle_uuids, log_dir, direction='left')
output_scenario(left_turn, description, log_dir, output_dir)
```
```python
description='pedestrian crossing in front of vehicles'
vehicles = get_objects_of_category(log_dir, category='VEHICLE')
peds = get_objects_of_category(log_dir, category='PEDESTRIAN')
stationary_vehicles = stationary(vehicles, log_dir)
peds = reverse_relationship(being_crossed_by)(stationary_vehicles, peds, log_dir)
output_scenario(peds, description, log_dir, output_dir)
```
```python
description='jaywalking pedestrian'
peds = get_objects_of_category(log_dir, category='PEDESTRIAN')
peds_on_road = on_road(peds, log_dir)
jaywalking_peds = scenario_not(at_pedestrian_crossing)(peds_on_road, log_dir)
output_scenario(jaywalking_peds, description, log_dir, output_dir)
```
```python
description = 'the vehicle behind another vehicle being crossed by a jaywalking pedestrian'
peds = get_objects_of_category(log_dir, category='PEDESTRIAN')
peds_on_road = on_road(peds, log_dir)
jaywalking_peds = scenario_not(at_pedestrian_crossing)(peds_on_road, log_dir)


vehicles = get_objects_of_category(log_dir, category='VEHICLE')
moving_vehicles = scenario_and([in_drivable_area(vehicles, log_dir), scenario_not(stationary)(vehicles, log_dir)])
crossed_vehicles = being_crossed_by(moving_vehicles, jaywalking_peds, log_dir)
#a distance of 25 is fairly arbitrary but around the reasonable distance to be considered following behind
behind_crossed_vehicle = get_objects_in_relative_direction(crossed_vehicles, moving_vehicles, log_dir, direction='backward', max_number=1, within_distance=25)
output_scenario(behind_crossed_vehicle, description, log_dir, output_dir)
```


```python
description='pedestrian walking between two stopped vehicles'
vehicles = get_objects_of_category(log_dir, category='VEHICLE')
peds = get_objects_of_category(log_dir, category='PEDESTRIAN')


stationary_vehicles = stationary(vehicles, log_dir)


peds_behind = get_objects_in_relative_direction(stationary_vehicles, peds, log_dir, direction='behind', within_distance=5,lateral_thresh=.5)
peds_in_front  = get_objects_in_relative_direction(stationary_vehicles, peds_behind, log_dir, direction='front', within_distance=5, lateral_thresh=.5)


peds_beween_vehicles = scenario_and([peds_in_front, peds_in_front])
output_scenario(peds_beween_vehicles, description, log_dir, output_dir)
```
```python
description = 'vehicle with another vehicle in their lane'
vehicles = get_objects_of_category(log_dir, category='VEHICLE')
vehicles_in_same_lane = in_same_lane(vehicles, vehicles, log_dir)
output_scenario(vehicles_in_same_lane, description, log_dir, output_dir)
```
```python
description = 'ego vehicle being overtaken on right by a semi'
vehicles = get_objects_of_category(log_dir, category=’EGO_VEHICLE’)
semi = get_objects_of_category(log_dir, category=’TRUCK_CAB’)
moving_vehicles = scenario_not(stationary)(vehicles, log_dir)
#defining overtaking to be within 10m of the front and back of the vehicle
overtaken_on_right = being_crossed_by(moving_vehicles, truck_cab, log_dir, direction='right', forward_thresh=5, lateral_thresh=10)
output_scenario(overtaken_on_right, description, log_dir, output_dir)
```
```python
#Lane splitting is moving between two cars that are in adjacent lanes, usually during slow traffic
description = 'lane splitting motorcycle'
#Getting motorcycles that are on the road and moving
motorcycles = get_objects_of_category(log_dir, category='MOTORCYCLE')
active_motocycles = scenario_not(stationary)(motorcycles, log_dir)


#Getting vehicles that are to the left and right of any active motorcycle
vehicles = get_objects_of_category(log_dir, category='VEHICLE')
vehicles_left_of_motorcycle = get_objects_in_relative_direction(active_motocycles, vehicles, log_dir, direction='left', min_number=1, max_number=1, within_distance=4, lateral_thresh=2)
vehicles_right_of_motorcycle = get_objects_in_relative_direction(active_motocycles, vehicles, log_dir, direction='right', min_number=1, max_number=1, within_distance=4, lateral_thresh=2)


#Motorcycle must be in the same the same lane as one of the cars
motorcycle_in_lane_to_left = in_same_lane(active_motocycles, vehicles_right_of_motorcycle, log_dir)
motorcycle_in_lane_to_right = in_same_lane(active_motocycles, vehicles_left_of_motorcycle, log_dir)


#The motorcycle can be in the same lane as either the car to the left or right of it
lane_splitting_motorcycles = scenario_or([has_objects_in_relative_direction(motorcycle_in_lane_to_left, vehicles_left_of_motorcycle, log_dir, direction='left', within_distance=4, lateral_thresh=2),
  has_objects_in_relative_direction(motorcycle_in_lane_to_right, vehicles_right_of_motorcycle, log_dir, direction='right', within_distance=4, lateral_thresh=2)])
output_scenario(lane_splitting_motorcycles, description, log_dir, output_dir)
```
