scripts/deps.py
def find_extern_crates(text):
    """
    Returns extern crate information for a string.
    :param text: A text string.
    :return: A dict in the form of (macro_use and externs are distinct, both use local names):
    {
        "externs": [<crate>, ...],
        "macro_use": [<crate>, ...],
        "renames": {
            <local_name>: <real_name>,
            ...
        },
    }
    """
    externs = []
    macro_use = []
    renames = {}
    extern_crates = extern_crate.findall(text)
    for (macro, real_name, _, local_name) in extern_crates:
        if local_name == '':
            local_name = real_name
        else:
            renames[local_name] = real_name

        if macro == '':
            externs.append(local_name)
        else:
            macro_use.append(local_name)

    return {
        'externs': externs,
        'macro_use': macro_use,
        'renames': renames,
    }

    Returns extern crate information for a string.
    :param text: A text string.
    :return: A dict in the form of (macro_use and externs are distinct, both use local names):
    {
        "externs": [<crate>, ...],
        "macro_use": [<crate>, ...],
        "renames": {
            <local_name>: <real_name>,
            ...
        },
    }
    
Returns extern crate information for a string.
Returns extern crate information for a string .
def find_extern_crates(text):
    externs = []
    macro_use = []
    renames = {}
    extern_crates = extern_crate.findall(text)
    for (macro, real_name, _, local_name) in extern_crates:
        if local_name == '':
            local_name = real_name
        else:
            renames[local_name] = real_name
        if macro == '':
            externs.append(local_name)
        else:
            macro_use.append(local_name)
    return {
        'externs': externs,
        'macro_use': macro_use,
        'renames': renames,
    }
def find_extern_crates ( text ) : externs = [ ] macro_use = [ ] renames = { } extern_crates = extern_crate . findall ( text ) for ( macro , real_name , _ , local_name ) in extern_crates : if local_name == '' : local_name = real_name else : renames [ local_name ] = real_name if macro == '' : externs . append ( local_name ) else : macro_use . append ( local_name ) return { 'externs' : externs , 'macro_use' : macro_use , 'renames' : renames , }
Returns extern crate information for a string.
Returns extern crate information for a string .
"""
    Returns extern crate information for a string.
    :param text: A text string.
    :return: A dict in the form of (macro_use and externs are distinct, both use local names):
    {
        "externs": [<crate>, ...],
        "macro_use": [<crate>, ...],
        "renames": {
            <local_name>: <real_name>,
            ...
        },
    }
    """
A dict in the form of (macro_use and externs are distinct, both use local names):
{
"externs": [, ...],
"macro_use": [, ...],
"renames": {
: ,

},
}
A dict in the form of ( macro_use and externs are distinct both use local names ) : { " externs " : [ ... ] " macro_use " : [ ... ] " renames " : { : } }
text
A text string.
A text string .