<commit_before><?php

require '../vendor/autoload.php';

Dotenv::load("../");


$lastfm = new \Dandelionmood\LastFm\LastFm( $_ENV['LAST_FM_API_Key'], $_ENV['LAST_FM_API_Secret'] );

$pink_floyd = $lastfm->artist_getInfo(
    array(
        'artist' => '<NAME>'
    )
);

$file_db = new PDO('sqlite:colour.sqlite3');


// Inserts Last.fm artist
// Return value: artist id
function insert_lastfm_artist($artist, $file_db) {
                
    $insert = "INSERT INTO artists (name, mbid) 
                VALUES (:name, :mbid)";
    $stmt = $file_db->prepare($insert);

    $stmt->bindValue(':name', $artist->artist->name);
    $stmt->bindValue(':mbid', $artist->artist->mbid);
    
    $stmt->execute();
    
    return $file_db->lastInsertId();
}

// Inserts Last.fm genre
// Return value: genre id
function insert_lastfm_genre($genre, $file_db) {
                
    $insert = "INSERT INTO genres (title, blurb) VALUES (:name, :blurb)";
    $stmt = $file_db->prepare($insert);
    <commit_msg>Removed unnecessary call from import function<commit_after><?php

require '../vendor/autoload.php';

Dotenv::load("../");


$lastfm = new \Dandelionmood\LastFm\LastFm( $_ENV['LAST_FM_API_Key'], $_ENV['LAST_FM_API_Secret'] );

$file_db = new PDO('sqlite:colour.sqlite3');


// Inserts Last.fm artist
// Return value: artist id
function insert_lastfm_artist($artist, $file_db) {
                
    $insert = "INSERT INTO artists (name, mbid) 
                VALUES (:name, :mbid)";
    $stmt = $file_db->prepare($insert);

    $stmt->bindValue(':name', $artist->artist->name);
    $stmt->bindValue(':mbid', $artist->artist->mbid);
    
    $stmt->execute();
    
    return $file_db->lastInsertId();
}

// Inserts Last.fm genre
// Return value: genre id
function insert_lastfm_genre($genre, $file_db) {
                
    $insert = "INSERT INTO genres (title, blurb) VALUES (:name, :blurb)";
    $stmt = $file_db->prepare($insert);
    
{'fraction_non_alphanumeric': 0.17674418604651163, 'fraction_numerical': 0.0010335917312661498, 'mean_word_length': 3.2178649237472765, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 26, 'https://': 0, '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': '5496166', 'n_tokens_mistral': 705, 'n_tokens_neox': 679, 'n_words': 132}