(a) Every person operating a bicycle, electric bicycle or scooter upon a roadway shall ride as near to the right side of the roadway as practicable obeying all traffic rules applicable to vehicles and exercising due care when passing a standing vehicle or one proceeding in the same direction.
(b) This section does not require a person operating a bicycle, electric bicycle or scooter to ride at the edge of the roadway when it is unreasonable or unsafe to do so. Conditions that may require riding away from the edge of the roadway include when necessary to avoid fixed or moving objects, parked or moving vehicles, surface hazards, or if it otherwise is unsafe or impracticable to do so, including if the lane is too narrow for the bicycle, electric bicycle or scooter and an overtaking vehicle to travel safely side by side within the lane.