You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: cs_scc2.m
    path of file: ./repos/SuiteSparse/CXSparse/MATLAB/CSparse
    
    the code of the file until where you have to start completion: function [p, q, r, s] = cs_scc2 (A, bipartite)
%CS_SCC2 cs_scc, or connected components of a bipartite graph.
%   [p,q,r,s] = cs_scc2(A) finds a permutation p so that A(p,q) is permuted into
%   block upper triangular form (if A is square).  In this case, r=s, p=q and
%   the kth diagonal block is given by A (t,t) where t = r(k):r(k)+1. 
%   The diagonal of A is ignored.  Each block is one strongly connected
%   component of A.
%

    
function [p, q, r, s] = cs_scc2 (A, bipartite)
%CS_SCC2 cs_scc, or connected components of a bipartite graph.
%   [p,q,r,s] = cs_scc2(A) finds a permutation p so that A(p,q) is permuted into
%   block upper triangular form (if A is square).  In this case, r=s, p=q and
%   the kth diagonal block is given by A (t,t) where t = r(k):r(k)+1. 
%   The diagonal of A is ignored.  Each block is one strongly connected
%   component of A.
%
%   If A is not square (or for [p,q,r,s] = cs_scc2(A,1)), then the connected
%   components of the bipartite graph of A are found.  A(p,q) is permuted into
%   block diagonal form, where the diagonal blocks are rectangular.  The kth
%   block is given by A(r(k):r(k+1)-1,s(k):s(k+1)-1).  A can be rectangular.
%
%   Example:
%       Prob = ssget ('HB/arc130') ; A = Prob.A ; [p q r s] = cs_scc2 (A) ;
%       cspy (A (p,q)) ;
%       Prob = ssget ('HB/wm1') ; A = Prob.A ; [p q r s] = cs_scc2 (A) ;
%       cspy (A (p,q)) ;
%
%   See also CS_DMPERM, DMPERM, CS_SCC, CCSPY.

% CXSparse, Copyright (c) 2006-2022, Timothy A. Davis. All Rights Reserved.
% SPDX-License-Identifier: LGPL-2.1+

[m n] = size (A) ;
if (nargin < 2)
    bipartite = 0 ;
end