# Path: constants/exceptions.py
# class invalidArgumentsException(Exception):
# class loginFailedException(Exception):
# class userBannedException(Exception):
# class userLockedException(Exception):
# class noBanchoSessionException(Exception):
# class osuApiFailException(Exception):
# class fileNotFoundException(Exception):
# class invalidBeatmapException(Exception):
# class unsupportedGameModeException(Exception):
# class beatmapTooLongException(Exception):
# class need2FAException(Exception):
# class noAPIDataError(Exception):
# class scoreNotFoundError(Exception):
# class ppCalcException(Exception):
# 	def __init__(self, handler):
# 	def __init__(self, handler, who):
# 	def __init__(self, handler, who):
# 	def __init__(self, handler, who):
# 	def __init__(self, handler, who, ip):
# 	def __init__(self, handler):
# 	def __init__(self, handler, f):
# 	def __init__(self, handler):
# 	def __init__(self, handler, who, ip):
# 	def __init__(self, exception):
# 
# Path: helpers/mapsHelper.py
# def isBeatmap(fileName=None, content=None):
# def shouldDownloadMap(mapFile, _beatmap):
# def cacheMap(mapFile, _beatmap):
# def cachedMapPath(beatmap_id):
# 
# Path: objects/glob.py
# 		VERSION = f.read().strip()
# 	VERSION = "Unknown"
# ACHIEVEMENTS_VERSION = 1
# DATADOG_PREFIX = "lets"


import contextlib
from common.log import logUtils as log
from common.constants import gameModes, mods
from constants import exceptions
from helpers import mapsHelper
from objects import glob
from pp.catch_the_pp.osu_parser.beatmap import Beatmap as CalcBeatmap
from pp.catch_the_pp.osu.ctb.difficulty import Difficulty
from pp.catch_the_pp import ppCalc
        if score_ is not None:
            self.score = score_
            self.accuracy = self.score.accuracy
            self.mods = self.score.mods
            self.combo = self.score.maxCombo
            self.misses = self.score.cMiss
        else:
            # Otherwise, set acc and mods from params (tillerino)
            self.accuracy = accuracy
            self.mods = mods_
            self.combo = combo
            if self.combo is None or self.combo < 0:
                self.combo = self.beatmap.maxCombo
            self.misses = misses

        # Multiple acc values computation
        self.tillerino = tillerino

        # Result
        self.pp = 0
        self.stars = 0
        self.calculate_pp()

    @property
    def unrelaxMods(self):
        return self.mods & ~(mods.RELAX | mods.RELAX2)

    def _calculate_pp(self):
        try:
            # Cache beatmap

# Path: constants/exceptions.py
# class invalidArgumentsException(Exception):
# class loginFailedException(Exception):
# class userBannedException(Exception):
# class userLockedException(Exception):
# class noBanchoSessionException(Exception):
# class osuApiFailException(Exception):
# class fileNotFoundException(Exception):
# class invalidBeatmapException(Exception):
# class unsupportedGameModeException(Exception):
# class beatmapTooLongException(Exception):
# class need2FAException(Exception):
# class noAPIDataError(Exception):
# class scoreNotFoundError(Exception):
# class ppCalcException(Exception):
# 	def __init__(self, handler):
# 	def __init__(self, handler, who):
# 	def __init__(self, handler, who):
# 	def __init__(self, handler, who):
# 	def __init__(self, handler, who, ip):
# 	def __init__(self, handler):
# 	def __init__(self, handler, f):
# 	def __init__(self, handler):
# 	def __init__(self, handler, who, ip):
# 	def __init__(self, exception):
# 
# Path: helpers/mapsHelper.py
# def isBeatmap(fileName=None, content=None):
# def shouldDownloadMap(mapFile, _beatmap):
# def cacheMap(mapFile, _beatmap):
# def cachedMapPath(beatmap_id):
# 
# Path: objects/glob.py
# 		VERSION = f.read().strip()
# 	VERSION = "Unknown"
# ACHIEVEMENTS_VERSION = 1
# DATADOG_PREFIX = "lets"


# Path: pp/cicciobello.py
import contextlib
from common.log import logUtils as log
from common.constants import gameModes, mods
from constants import exceptions
from helpers import mapsHelper
from objects import glob
from pp.catch_the_pp.osu_parser.beatmap import Beatmap as CalcBeatmap
from pp.catch_the_pp.osu.ctb.difficulty import Difficulty
from pp.catch_the_pp import ppCalc

        if score_ is not None:
            self.score = score_
            self.accuracy = self.score.accuracy
            self.mods = self.score.mods
            self.combo = self.score.maxCombo
            self.misses = self.score.cMiss
        else:
            # Otherwise, set acc and mods from params (tillerino)
            self.accuracy = accuracy
            self.mods = mods_
            self.combo = combo
            if self.combo is None or self.combo < 0:
                self.combo = self.beatmap.maxCombo
            self.misses = misses

        # Multiple acc values computation
        self.tillerino = tillerino

        # Result
        self.pp = 0
        self.stars = 0
        self.calculate_pp()

    @property
    def unrelaxMods(self):
        return self.mods & ~(mods.RELAX | mods.RELAX2)

    def _calculate_pp(self):
        try:
            # Cache beatmap

            mapFile = mapsHelper.cachedMapPath(self.beatmap.beatmapID)