text: from sqlalchemy.orm import Session
  
  from src.models.db_models import user_model
  from src.models.schemas import user_schema
  
  
  def get_user(db: Session, idportfolio: int):
      return db.query(user_model.User).filter(
          user_model.User.idportfolio == idportfolio
          ).first()
  
  
  def get_user_by_twitter_user_name(db: Session, twitter_user_name: str):
      return db.query(user_model.User).filter(
          user_model.User.twitter_user_name == twitter_user_name
          ).first()
  
  
  def create_user(db: Session, user: user_schema.UserCreate):
      db_user = user_model.User(**user.dict())
      db.add(db_user)
      db.commit()
      db.refresh(db_user)
      return db_user
  