<commit_before># <NAME>
# 
# Putting user in its own file since it's huge

import logging
from pylons import cache, request, session, c
from pylons.templating import render
from decorator import decorator
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, Table, sql
from sqlalchemy.sql import func, select, join, or_, and_
from sqlalchemy.orm import relation, join, synonym, aliased
from datetime import datetime
from . import (
    metadata,
    Session,
    songs_table,
    artists_table,
    playlists_table,
    spotlights_table,
    Artist,
    Album,
    Song,
    SongOwner,
    RemovedOwner,
    Playlist,
    Spotlight,
    SpotlightComment,
    BlogEntry,
    SongStat,
    Recommendation
)

from facebook.wsgi import facebook
from facebook import FacebookError

from masterapp.lib import fblogin
from masterapp.lib.fbaccess import fbaccess
from operator import itemgetter, attrgetter
import time

Base = declarative_base(metadata=metadata)

class User(Base):
    """
    User class that abstracts away all information that deals with a user. It
    pulls that data from whereever it might live, and takes care of all caching
    and refetching of that data as well.

    At the risk of being inconsistent, this is also the first mapped class to
    take advantage of sqlalchemy's declarative extension, which is included with
    sqlalchemy .5
    """

    # Declarative constructs
    __table__ = Table("users", Base.metadata, autoload=True)
    
    __mapper_args__ = {'allow_column_override': True}

    _nowplayingid = __table__.c.nowplayingid
    _name = __table__.c.name
    playlists = relation(Playlist, order_by=playlists_table.c.name)

    fbid = None<commit_msg>Fixed a logging bug<commit_after># <NAME>
# 
# Putting user in its own file since it's huge

import logging
from pylons import cache, request, session, c
from pylons.templating import render
from decorator import decorator
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, Table, sql
from sqlalchemy.sql import func, select, join, or_, and_
from sqlalchemy.orm import relation, join, synonym, aliased
from datetime import datetime
from . import (
    metadata,
    Session,
    songs_table,
    artists_table,
    playlists_table,
    spotlights_table,
    Artist,
    Album,
    Song,
    SongOwner,
    RemovedOwner,
    Playlist,
    Spotlight,
    SpotlightComment,
    BlogEntry,
    SongStat,
    Recommendation
)

from facebook.wsgi import facebook
from facebook import FacebookError

from masterapp.lib import fblogin
from masterapp.lib.fbaccess import fbaccess
from operator import itemgetter, attrgetter
import time

log = logging.getLogger(__name__)

Base = declarative_base(metadata=metadata)

class User(Base):
    """
    User class that abstracts away all information that deals with a user. It
    pulls that data from whereever it might live, and takes care of all caching
    and refetching of that data as well.

    At the risk of being inconsistent, this is also the first mapped class to
    take advantage of sqlalchemy's declarative extension, which is included with
    sqlalchemy .5
    """

    # Declarative constructs
    __table__ = Table("users", Base.metadata, autoload=True)
    
    __mapper_args__ = {'allow_column_override': True}

    _nowplayingid = __table__.c.nowplayingid
    _name = __table__.c.name
    playlists = relation(Playlist, order_by=playlists_table.c.name)

    fbid = None
{'fraction_non_alphanumeric': 0.05853658536585366, 'fraction_numerical': 0.0005738880918220947, 'mean_word_length': 3.8082758620689656, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5981034', 'n_tokens_mistral': 1047, 'n_tokens_neox': 1006, 'n_words': 366}