<commit_before><?php
ini_set('memory_limit','1024M');

use Illuminate\Database\Seeder;

class PortalMigration extends Seeder
{

    /**
     *
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        if (!config('database.full_seed')) {
            Echo "Running in abridged mode.  To pull in all users, add 'FULL_SEED=true' to the .env file\n";
        }
        if (!config('database.download_images')) {
            Echo "Not downloading images from portal S3 Bucket.  To do this, add 'DOWNLOAD_IMAGES=true' to the .env file\n";
        }
        try {
            $site_id = 1;
            // $user_ids = [1,2]; -- No longer assigning app developers TJC 2/11/18
            $user_bnums = ['B00573562','B00505893'];
            $user_devs = [];
            $key = config('app.key_portal');
            $site = \App\Site::where('id',$site_id)->first();

            /* Begin Import Users */
            echo "Importing Users (this takes a while) ...\n";
            $users_db = DB::connection('mysql-portal')->table('users')->get();
            $users_index = [];
            foreach($users_db as $index => $user_db) {
                if (config('database.full_seed') || in_array($user_db->bnum,$user_bnums)) {
                    $user = new \App\User;
                    $user->first_name = $user_db->first_name;
                    $user->last_name = $user_db->last_name;
                    $user->email = ($user_db->email=='')?NULL:$user_db->email;
                    $user->unique_id = ($user_db->bnum=='')?NULL:$user_db->bnum;
                    $user->params = ['pidm'=>$user_db->pidm,'bnum'=>$user_db->bnum,'pods'=>explode('@',$user_db->email)[0]];
                    try {
                        $user->save();
                        $users_index[$user_db->pidm] = $user;
                        $site->add_member($user,0,0);
                    } catch (Exception $e) {
                        echo "Error Creating User: ".$e->getMessage()."\n";
                        echo "... continuing anyway ...\n";
                    }
                }
                if (in_array($user_db->bnum,$user_bnums)) {
                    $user_devs[] = $user;
                }
            }
            /* End Import Users */
<commit_msg>Add include for <NAME>, <NAME><commit_after><?php
ini_set('memory_limit','1024M');

use Illuminate\Database\Seeder;

class PortalMigration extends Seeder
{

    /**
     *
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        if (!config('database.full_seed')) {
            Echo "Running in abridged mode.  To pull in all users, add 'FULL_SEED=true' to the .env file\n";
        }
        if (!config('database.download_images')) {
            Echo "Not downloading images from portal S3 Bucket.  To do this, add 'DOWNLOAD_IMAGES=true' to the .env file\n";
        }
        try {
            $site_id = 1;
            // $user_ids = [1,2]; -- No longer assigning app developers TJC 2/11/18
            $user_bnums = ['B00573562','B00505893','B00078891','B00612268'];
            $user_devs = [];
            $key = config('app.key_portal');
            $site = \App\Site::where('id',$site_id)->first();

            /* Begin Import Users */
            echo "Importing Users (this takes a while) ...\n";
            $users_db = DB::connection('mysql-portal')->table('users')->get();
            $users_index = [];
            foreach($users_db as $index => $user_db) {
                if (config('database.full_seed') || in_array($user_db->bnum,$user_bnums)) {
                    $user = new \App\User;
                    $user->first_name = $user_db->first_name;
                    $user->last_name = $user_db->last_name;
                    $user->email = ($user_db->email=='')?NULL:$user_db->email;
                    $user->unique_id = ($user_db->bnum=='')?NULL:$user_db->bnum;
                    $user->params = ['pidm'=>$user_db->pidm,'bnum'=>$user_db->bnum,'pods'=>explode('@',$user_db->email)[0]];
                    try {
                        $user->save();
                        $users_index[$user_db->pidm] = $user;
                        $site->add_member($user,0,0);
                    } catch (Exception $e) {
                        echo "Error Creating User: ".$e->getMessage()."\n";
                        echo "... continuing anyway ...\n";
                    }
                }
                if (in_array($user_db->bnum,$user_bnums)) {
                    $user_devs[] = $user;
                }
            }
            /* End Import Users */

{'fraction_non_alphanumeric': 0.16000863744331678, 'fraction_numerical': 0.017274886633556467, 'mean_word_length': 1.58050139275766, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 59, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3498763', 'n_tokens_mistral': 1458, 'n_tokens_neox': 1367, 'n_words': 266}