flowcraft/generator/inspect.py
def _size_coverter(s):
        """Converts size string into megabytes

        Parameters
        ----------
        s : str
            The size string can be '30KB', '20MB' or '1GB'

        Returns
        -------
        float
            With the size in bytes

        """

        if s.upper().endswith("KB"):
            return float(s.rstrip("KB")) / 1024

        elif s.upper().endswith(" B"):
            return float(s.rstrip("B")) / 1024 / 1024

        elif s.upper().endswith("MB"):
            return float(s.rstrip("MB"))

        elif s.upper().endswith("GB"):
            return float(s.rstrip("GB")) * 1024

        elif s.upper().endswith("TB"):
            return float(s.rstrip("TB")) * 1024 * 1024

        else:
            return float(s)
def _size_coverter(s):
        if s.upper().endswith("KB"):
            return float(s.rstrip("KB")) / 1024

        elif s.upper().endswith(" B"):
            return float(s.rstrip("B")) / 1024 / 1024

        elif s.upper().endswith("MB"):
            return float(s.rstrip("MB"))

        elif s.upper().endswith("GB"):
            return float(s.rstrip("GB")) * 1024

        elif s.upper().endswith("TB"):
            return float(s.rstrip("TB")) * 1024 * 1024

        else:
            return float(s)
def _size_coverter ( s ) : if s . upper ( ) . endswith ( "KB" ) : return float ( s . rstrip ( "KB" ) ) / 1024 elif s . upper ( ) . endswith ( " B" ) : return float ( s . rstrip ( "B" ) ) / 1024 / 1024 elif s . upper ( ) . endswith ( "MB" ) : return float ( s . rstrip ( "MB" ) ) elif s . upper ( ) . endswith ( "GB" ) : return float ( s . rstrip ( "GB" ) ) * 1024 elif s . upper ( ) . endswith ( "TB" ) : return float ( s . rstrip ( "TB" ) ) * 1024 * 1024 else : return float ( s )
Converts size string into megabytes

        Parameters
        ----------
        s : str
            The size string can be '30KB', '20MB' or '1GB'

        Returns
        -------
        float
            With the size in bytes
Converts size string into megabytes