<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def delete_repo(self, repo_name=None, envs=[], query='/repositories/'):
 """ `repo_name` - Name of repository to delete Delete repo in specified environments """

        orphan_query = '/content/orphans/rpm/'
        juicer.utils.Log.log_debug("Delete Repo: %s", repo_name)

        for env in self.args.envs:
            if not juicer.utils.repo_exists_p(repo_name, self.connectors[env], env):
                juicer.utils.Log.log_info("repo `%s` doesn't exist in %s... skipping!",
                                           (repo_name, env))
                continue
            else:
                url = "%s%s-%s/" % (query, repo_name, env)
                _r = self.connectors[env].delete(url)
                if _r.status_code == Constants.PULP_DELETE_ACCEPTED:
                    juicer.utils.Log.log_info("deleted repo `%s` in %s",
                                              (repo_name, env))

                    # if delete was successful, delete orphaned rpms
                    _r = self.connectors[env].get(orphan_query)
                    if _r.status_code is Constants.PULP_GET_OK:
                        if len(juicer.utils.load_json_str(_r.content)) > 0:
                            __r = self.connectors[env].delete(orphan_query)
                            if __r.status_code is Constants.PULP_DELETE_ACCEPTED:
                                juicer.utils.Log.log_debug("deleted orphaned rpms in %s." % env)
                            else:
                                juicer.utils.Log.log_error("unable to delete orphaned rpms in %s. a %s error was returned", (env, __r.status_code))
                    else:
                        juicer.utils.Log.log_error("unable to get a list of orphaned rpms. encountered a %s error." % _r.status_code)
                else:
                    _r.raise_for_status()
        return True