Create function select_repositories