sob/utilities/inspect.py
def _get_module_name(file_name: str) -> str:
    """
    Given a frame info's file name, find the module name
    """
    module_name = getmodulename(file_name)
    if module_name is None:
        # Check to see if this is a doctest
        doc_test_prefix: str = "<doctest "
        if file_name.startswith(doc_test_prefix):
            doc_test_prefix_length: int = len(doc_test_prefix)
            module_name = file_name[doc_test_prefix_length:]
            module_name = module_name.rstrip(">")
            if "[" in module_name:
                module_name = "[".join(module_name.split("[")[:-1])
        else:
            raise ValueError(
                'The path "%s" is not a python module' % file_name
            )
    return module_name

    Given a frame info's file name, find the module name
    
Given a frame info's file name, find the module name
Given a frame info ' s file name find the module name
def _get_module_name(file_name: str) -> str:
    module_name = getmodulename(file_name)
    if module_name is None:
        doc_test_prefix: str = "<doctest "
        if file_name.startswith(doc_test_prefix):
            doc_test_prefix_length: int = len(doc_test_prefix)
            module_name = file_name[doc_test_prefix_length:]
            module_name = module_name.rstrip(">")
            if "[" in module_name:
                module_name = "[".join(module_name.split("[")[:-1])
        else:
            raise ValueError(
                'The path "%s" is not a python module' % file_name
            )
    return module_name
def _get_module_name ( file_name : str ) -> str : module_name = getmodulename ( file_name ) if module_name is None : doc_test_prefix : str = "<doctest " if file_name . startswith ( doc_test_prefix ) : doc_test_prefix_length : int = len ( doc_test_prefix ) module_name = file_name [ doc_test_prefix_length : ] module_name = module_name . rstrip ( ">" ) if "[" in module_name : module_name = "[" . join ( module_name . split ( "[" ) [ : - 1 ] ) else : raise ValueError ( 'The path "%s" is not a python module' % file_name ) return module_name
Given a frame info's file name, find the module name
Given a frame info ' s file name find the module name
"""
    Given a frame info's file name, find the module name
    """ # Check to see if this is a doctest
file_name
str