<commit_before># Includes documentation #
## database.php ##
### Variables (absolutely do not to use outside of database.ph[) ###
 - $username: The username to the assets database
 - $password: The password to the assets database
 - $db_name: The name of the assets database
 - $assets_table_name: The name of the assets table in the assets database
 - $dbh: The database handle

### Functions ###
 - connectDatabase():void: Connects to the assets database and initializes $dbh
 - getDatabaseError():array: Returns the last PDO error, if any. See the [PDO documentation](http://php.net/manual/en/pdo.errorinfo.php) for more info
 - getAssetsTableName():string: Returns the name of the assets table. Use this rather than the actual variable.
 - imagesQuery($query:string, $parameters:array):array: Returns an associative array of PDO results for the given string and parameters
   - Example: ```php
imagesQuery("SELECT * FROM `".getAssetsTableName()."` WHERE `userid`=? AND `hash`=?", array($userid_you_want, $hash_you_want))
```
   - TODO: Rename this to something more descriptive
 - imagesQuery0($query:string, $parameters:array):void: like imagesQuery(), but does not expect a result.
   - TODO: Rename this to something more descriptive
 - getAllImages():array: Returns an associative array of all entries in the assets table.
   - TODO: Rename this. "Images" is because a lot of this code is from picturit, which only handled images.
 - getImagesForUser($userid:int):array: Returns an associative array of assets belonging to the user with the given user id
 - createImagesTable():void: Creates the assets table in the assets database. Used internally on connectDatabase()
 - imageExists($hash:string):boolean: Checks if an asset already exists in the database, returns true if so, false otherwise.<commit_msg>fix errors<commit_after># Includes documentation #
## database.php ##
### Variables (absolutely do not to use outside of database.php) ###
 - $username: The username to the assets database
 - $password: The password to the assets database
 - $db_name: The name of the assets database
 - $assets_table_name: The name of the assets table in the assets database
 - $dbh: The database handle

### Functions ###
 - connectDatabase():void: Connects to the assets database and initializes $dbh
 - getDatabaseError():array: Returns the last PDO error, if any. See the [PDO documentation](http://php.net/manual/en/pdo.errorinfo.php) for more info
 - getAssetsTableName():string: Returns the name of the assets table. Use this rather than the actual variable.
 - imagesQuery($query:string, $parameters:array):array: Returns an associative array of PDO results for the given string and parameters
   - Example: ```imagesQuery("SELECT * FROM `".getAssetsTableName()."` WHERE `userid`=? AND `hash`=?", array($userid_you_want, $hash_you_want))```
   - TODO: Rename this to something more descriptive
 - imagesQuery0($query:string, $parameters:array):void: like imagesQuery(), but does not expect a result.
   - TODO: Rename this to something more descriptive
 - getAllImages():array: Returns an associative array of all entries in the assets table.
   - TODO: Rename this. "Images" is because a lot of this code is from picturit, which only handled images.
 - getImagesForUser($userid:int):array: Returns an associative array of assets belonging to the user with the given user id
 - createImagesTable():void: Creates the assets table in the assets database. Used internally on connectDatabase()
 - imageExists($hash:string):boolean: Checks if an asset already exists in the database, returns true if so, false otherwise.
{'fraction_non_alphanumeric': 0.09635560463832137, 'fraction_numerical': 0.0005521811154058532, 'mean_word_length': 4.919934640522876, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4096957', 'n_tokens_mistral': 953, 'n_tokens_neox': 932, 'n_words': 427}