<commit_before>import pandas as pd


def load_data():

    """Reads two dataframes from Github source, containing sample data
     and meta data and joins them.
     Returns one dataframe with a sampleID index
     Input type: None
     Output type: Pandas dataframe
     Output dataframe index: sampleID
     Output dataframe column labels: 'kingdom', 'phylum', 'class', 'order',
             'family', 'genus', 'length', 'oxygen',
             'replicate', 'week', 'abundance'"""

    # Reading data sets from the links provided.
    df1 = pd.read_csv("https://raw.githubusercontent.com/JanetMatsen/"
                      "bacteriopop/master/raw_data/raw_data.csv", 
                      error_bad_lines=False)
    df2 = pd.read_csv('https://raw.githubusercontent.com/JanetMatsen/'
                      'bacteriopop/master/raw_data/sample_meta_info.tsv',
                      sep='\t')
    df2 = df2.set_index(df2['project'])
    # Removing duplicate columns.
    del df2['project']
    del df2['ID']
    df1 = df1.set_index(df1['project'])
    # Removing duplicate column.
    del df1['project']
    # Joining the two datasets.
    df = df1.join(df2)
    # Uniformity in non-capitalization of column names.
    df.rename(columns={'Kingdom': 'kingdom', 'Phylum': 'phylum',
                       'Class': 'class', 'Order': 'order',
                       'Family': 'family', 'Genus': 'genus',
                       'Length': 'length'}, inplace=True)
    df.index.names = ['sampleID']
    # Rearranging columns so that abundance is the last column.
    df = df[['kingdom',	'phylum', 'class', 'order',
             'family', 'genus', 'length', 'oxygen',
             'replicate', 'week', 'abundance']]
    return df


# Run the following code if the file is run at the command line
def main():
    return load_data()

if __name__ == "__main__":
    main()<commit_msg>Added assert statement<commit_after>import pandas as pd


def load_data():

    """Reads two dataframes from Github source, containing sample data
     and meta data and joins them.
     Returns one dataframe with a sampleID index
     Input type: None
     Output type: Pandas dataframe
     Output dataframe index: sampleID
     Output dataframe column labels: 'kingdom', 'phylum', 'class', 'order',
             'family', 'genus', 'length', 'oxygen',
             'replicate', 'week', 'abundance'"""

    # Reading data sets from the links provided.
    df1 = pd.read_csv("https://raw.githubusercontent.com/JanetMatsen/"
                      "bacteriopop/master/raw_data/raw_data.csv", 
                      error_bad_lines=False)
    df2 = pd.read_csv('https://raw.githubusercontent.com/JanetMatsen/'
                      'bacteriopop/master/raw_data/sample_meta_info.tsv',
                      sep='\t')
    df2 = df2.set_index(df2['project'])
    # Removing duplicate columns.
    del df2['project']
    del df2['ID']
    df1 = df1.set_index(df1['project'])
    # Removing duplicate column.
    del df1['project']
    # Joining the two datasets.
    df = df1.join(df2)
    # Uniformity in non-capitalization of column names.
    df.rename(columns={'Kingdom': 'kingdom', 'Phylum': 'phylum',
                       'Class': 'class', 'Order': 'order',
                       'Family': 'family', 'Genus': 'genus',
                       'Length': 'length'}, inplace=True)
    df.index.names = ['sampleID']
    # Rearranging columns so that abundance is the last column.
    df = df[['kingdom',	'phylum', 'class', 'order',
             'family', 'genus', 'length', 'oxygen',
             'replicate', 'week', 'abundance']]
    assert isinstance(df, pd.DataFrame)
    return df


# Run the following code if the file is run at the command line
def main():
    return load_data()

if __name__ == "__main__":
    main()
{'fraction_non_alphanumeric': 0.13076720274189296, 'fraction_numerical': 0.006854732401792776, 'mean_word_length': 2.4775435380384967, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5469476', 'n_tokens_mistral': 1171, 'n_tokens_neox': 1126, 'n_words': 320}