pipeline/evaluate.py
def read_communities(fpath):
    """Takes the path of a found community data file and returns the name of the
    file (minus the extension), with the list of communities read from the file.

    :param str fpath: Path of the found community file. The name will be used as
        the name of the method in statistical output, and the extension will be
        used to determine how to read the file.
    :return: list of lists of strings, where each string is a node id.
    :raises Exception: if file extension is not one of {'csv', 'tsv', 'edcar'}.
    """
    lines = read_lines(fpath)
    basename = os.path.basename(fpath)
    pieces = os.path.splitext(basename)
    name, ext = pieces[0], pieces[1].replace('.','')
    if ext == 'txt':
        return (name, extract_comms(lines, ' '))
    elif ext == 'csv':
        return (name, extract_comms(lines, ','))
    elif ext == 'tsv':
        return (name, extract_comms(lines, '\t'))
    elif ext == 'edcar':
        return (name, extract_edcar_comms(lines))
    else:
        raise Exception('Unrecognized file extension: %s' % ext)
Takes the path of a found community data file and returns the name of the
    file (minus the extension), with the list of communities read from the file.

    :param str fpath: Path of the found community file. The name will be used as
        the name of the method in statistical output, and the extension will be
        used to determine how to read the file.
    :return: list of lists of strings, where each string is a node id.
    :raises Exception: if file extension is not one of {'csv', 'tsv', 'edcar'}.
    
Takes the path of a found community data file and returns the name of the
file (minus the extension), with the list of communities read from the file.
Takes the path of a found community data file and returns the name of the file ( minus the extension ) with the list of communities read from the file .
def read_communities(fpath):
    lines = read_lines(fpath)
    basename = os.path.basename(fpath)
    pieces = os.path.splitext(basename)
    name, ext = pieces[0], pieces[1].replace('.','')
    if ext == 'txt':
        return (name, extract_comms(lines, ' '))
    elif ext == 'csv':
        return (name, extract_comms(lines, ','))
    elif ext == 'tsv':
        return (name, extract_comms(lines, '\t'))
    elif ext == 'edcar':
        return (name, extract_edcar_comms(lines))
    else:
        raise Exception('Unrecognized file extension: %s' % ext)
def read_communities ( fpath ) : lines = read_lines ( fpath ) basename = os . path . basename ( fpath ) pieces = os . path . splitext ( basename ) name , ext = pieces [ 0 ] , pieces [ 1 ] . replace ( '.' , '' ) if ext == 'txt' : return ( name , extract_comms ( lines , ' ' ) ) elif ext == 'csv' : return ( name , extract_comms ( lines , ',' ) ) elif ext == 'tsv' : return ( name , extract_comms ( lines , '\t' ) ) elif ext == 'edcar' : return ( name , extract_edcar_comms ( lines ) ) else : raise Exception ( 'Unrecognized file extension: %s' % ext )
Takes the path of a found community data file and returns the name of the
file (minus the extension), with the list of communities read from the file.
Takes the path of a found community data file and returns the name of the file ( minus the extension ) with the list of communities read from the file .
"""Takes the path of a found community data file and returns the name of the
    file (minus the extension), with the list of communities read from the file.

    :param str fpath: Path of the found community file. The name will be used as
        the name of the method in statistical output, and the extension will be
        used to determine how to read the file.
    :return: list of lists of strings, where each string is a node id.
    :raises Exception: if file extension is not one of {'csv', 'tsv', 'edcar'}.
    """
list of lists of strings, where each string is a node id.
list of lists of strings where each string is a node id .
if file extension is not one of {'csv', 'tsv', 'edcar'}.
if file extension is not one of { ' csv ' ' tsv ' ' edcar ' } .
Exception
fpath
Path of the found community file. The name will be used as
the name of the method in statistical output, and the extension will be
used to determine how to read the file.
Path of the found community file . The name will be used as the name of the method in statistical output and the extension will be used to determine how to read the file .