clearml_agent/helper/repo.py
def clone(self, branch=None):
        # type: (Text) -> None
        """
        Clone repository to destination and checking out `branch`.
        If not in debug mode, filter VCS password from output.
        """
        self._set_ssh_url()
        clone_command = ("clone", self.url_with_auth, self.location) + self.clone_flags
        # clone all branches regardless of when we want to later checkout
        # if branch:
        #    clone_command += ("-b", branch)
        if self.session.debug_mode:
            self.call(*clone_command)
            return

        def normalize_output(result):
            """
            Returns result string without user's password.
            NOTE: ``self.get_stderr``'s result might or might not have the same type as ``e.output`` in case of error.
            """
            string_type = (
                ensure_text
                if isinstance(result, six.text_type)
                else ensure_binary
            )
            return result.replace(
                string_type(self.url),
                string_type(furl(self.url).remove(password=True).tostr()),
            )

        def print_output(output):
            print(ensure_text(output))

        try:
            print_output(normalize_output(self.get_stderr(*clone_command)))
        except subprocess.CalledProcessError as e:
            # In Python 3, subprocess.CalledProcessError has a `stderr` attribute,
            # but since stderr is redirect to `subprocess.PIPE` it will appear in the usual `output` attribute
            if e.output:
                e.output = normalize_output(e.output)
                print_output(e.output)
            raise

        Clone repository to destination and checking out `branch`.
        If not in debug mode, filter VCS password from output.
        
Clone repository to destination and checking out `branch`.
If not in debug mode, filter VCS password from output.
Clone repository to destination and checking out ` branch ` . If not in debug mode filter VCS password from output .
def clone(self, branch=None):
        self._set_ssh_url()
        clone_command = ("clone", self.url_with_auth, self.location) + self.clone_flags
        if self.session.debug_mode:
            self.call(*clone_command)
            return
        def normalize_output(result):
            string_type = (
                ensure_text
                if isinstance(result, six.text_type)
                else ensure_binary
            )
            return result.replace(
                string_type(self.url),
                string_type(furl(self.url).remove(password=True).tostr()),
            )
        def print_output(output):
            print(ensure_text(output))
        try:
            print_output(normalize_output(self.get_stderr(*clone_command)))
        except subprocess.CalledProcessError as e:
            if e.output:
                e.output = normalize_output(e.output)
                print_output(e.output)
            raise
def clone ( self , branch = None ) : self . _set_ssh_url ( ) clone_command = ( "clone" , self . url_with_auth , self . location ) + self . clone_flags if self . session . debug_mode : self . call ( * clone_command ) return def normalize_output ( result ) : """
            Returns result string without user's password.
            NOTE: ``self.get_stderr``'s result might or might not have the same type as ``e.output`` in case of error.
            """ string_type = ( ensure_text if isinstance ( result , six . text_type ) else ensure_binary ) return result . replace ( string_type ( self . url ) , string_type ( furl ( self . url ) . remove ( password = True ) . tostr ( ) ) , ) def print_output ( output ) : print ( ensure_text ( output ) ) try : print_output ( normalize_output ( self . get_stderr ( * clone_command ) ) ) except subprocess . CalledProcessError as e : if e . output : e . output = normalize_output ( e . output ) print_output ( e . output ) raise
Clone repository to destination and checking out `branch`.
Clone repository to destination and checking out ` branch ` .
# type: (Text) -> None """
        Clone repository to destination and checking out `branch`.
        If not in debug mode, filter VCS password from output.
        """ # clone all branches regardless of when we want to later checkout # if branch: #    clone_command += ("-b", branch) """
            Returns result string without user's password.
            NOTE: ``self.get_stderr``'s result might or might not have the same type as ``e.output`` in case of error.
            """ # In Python 3, subprocess.CalledProcessError has a `stderr` attribute, # but since stderr is redirect to `subprocess.PIPE` it will appear in the usual `output` attribute
self
branch