parameters: (self, repo, new_name)
return_statement: return success
docstring: Renames a repo.
  
          Returns True on success.
  
          Raises ValueError if either name has invalid characters.
          Raises LookupError if the repo doesn't exist.
          Raises ValueError if the new name is taken.
          Raises PermissionDenied if not repo_base owner.
docstring_summary: Renames a repo.
docstring_tokens: Renames a repo .
function: def rename_repo(self, repo, new_name):
          """
          Renames a repo.
  
          Returns True on success.
  
          Raises ValueError if either name has invalid characters.
          Raises LookupError if the repo doesn't exist.
          Raises ValueError if the new name is taken.
          Raises PermissionDenied if not repo_base owner.
          """
          # only a repo owner can rename a repo:
          if self.repo_base != self.username:
              raise PermissionDenied()
  
          # rename in user_con
          success = self.user_con.rename_repo(repo=repo, new_name=new_name)
          if success:
              # update collaborator(s), if there are any
              Collaborator.objects.filter(
                  repo_name=repo, repo_base=self.repo_base).update(
                      repo_name=new_name)
  
          return success
function_tokens: def rename_repo ( self , repo , new_name ) : # only a repo owner can rename a repo: if self . repo_base != self . username : raise PermissionDenied ( ) # rename in user_con success = self . user_con . rename_repo ( repo = repo , new_name = new_name ) if success : # update collaborator(s), if there are any Collaborator . objects . filter ( repo_name = repo , repo_base = self . repo_base ) . update ( repo_name = new_name ) return success