- Abstract
- 1.1 Overview
- 1.2 Goals
- 1.3 Benefits
- The solution
- 2.1 Modified
CreateModel
operation .
def get_overall_score_trending_factor_queryset(self, queryset): | |
duration = Epoch((F('now') - F('created_at'))) | |
queryset = queryset.annotate( | |
now=Cast(timezone.now(), DateTimeField()), | |
duration=duration, | |
trending_factor=ExpressionWrapper( | |
# the 10 ^ 6 * 3600 * 24 * 30 multiplication is to convert micro second duration to months | |
(F('score__overall_score') * 1_000_000 * 3600 * 24 * 30) / F('duration'), | |
output_field=DecimalField() |
def pause_item(self, user=None, paused_at=timezone.now()): | |
self.set_paused_at(paused_at) | |
self.set_paused_by(user) | |
self.set_is_paused(True) | |
return self.get_paused_at() |
# I'm calling the function without providing a value for the | |
# paused_at parameter | |
item.pause_item(request.user) |
class Person(object): | |
def __init__(self, name): | |
print('Instantiating a person') | |
self.name = name | |
def __str__(self): | |
return self.name | |
def say_selam(p=Person('Nebiyu')): | |
print(f'Selam {p}') |
import numpy as np | |
from sklearn.utils import shuffle | |
from pysad.models import IForestASD | |
from pysad.transform.preprocessing import InstanceUnitNormScaler | |
from pysad.transform.postprocessing import RunningAveragePostprocessor | |
from pysad.utils import Data | |
from pysad.evaluation import AUROCMetric | |
from pysad.utils.array_streamer import ArrayStreamer | |
from tqdm import tqdm | |
import pandas as pd |
Installed MongoDB using the following guide: Install MongoDB
However, the installation in the guide is for MongoDB 5.0
on WSL with Ubuntu 20.04 (focal)
distro.
The following is an adaptation of the guide for installing MongoDB 6.0
on WSL with Ubuntu 22.04 jammy
distro.
cd ~
sudo apt update