autoflake.py
def extract_package_name(line):
    """Return package name in import statement."""
    assert '\\' not in line
    assert '(' not in line
    assert ')' not in line
    assert ';' not in line

    if line.lstrip().startswith(('import', 'from')):
        word = line.split()[1]
    else:
        # Ignore doctests.
        return None

    package = word.split('.')[0]
    assert ' ' not in package

    return package
def extract_package_name(line):
    """Return package name in import statement."""
    assert '\\' not in line
    assert '(' not in line
    assert ')' not in line
    assert ';' not in line

    if line.lstrip().startswith(('import', 'from')):
        word = line.split()[1]
    else:
        # Ignore doctests.
        return None

    package = word.split('.')[0]
    assert ' ' not in package

    return package
def extract_package_name ( line ) : assert '\\' not in line assert '(' not in line assert ')' not in line assert ';' not in line if line . lstrip ( ) . startswith ( ( 'import' , 'from' ) ) : word = line . split ( ) [ 1 ] else : # Ignore doctests. return None package = word . split ( '.' ) [ 0 ] assert ' ' not in package return package
Return package name in import statement.
Return package name in import statement .