from typing import List
import numpy as np
from axelrod.action import Action
from axelrod.interaction_utils import compute_final_score
from axelrod.player import Player
from axelrod.strategies.finite_state_machines import FSMPlayer
lllllIIlIIIIlllIIllI, IlllllIIlIllllllIlI = Action.C, Action.D
class IlllIlllllIIIllllIlI(Player):
    IlllllllIIIlIIIl = "strategy"
    lIIIIlIIllIlllIlI = {
        "memory_depth": float("inf"),
        "stochastic": True,
        "long_run_time": False,
        "inspects_source": False,
        "manipulates_source": False,
        "manipulates_state": False,
    }
    def lIIlIIlllIlIlll(IlIlIllllIlIIIIIlIl, IIIlIlllIIllllllIIII: Player) -> Action:
        if not len(IIIlIlllIIllllllIIII.history):
            return lllllIIlIIIIlllIIllI
        if IIIlIlllIIllllllIIII.history[-1] == lllllIIlIIIIlllIIllI:
            return lllllIIlIIIIlllIIllI
        llIIIlIllIIIllllII = IIIlIlllIIllllllIIII.defections / len(IIIlIlllIIllllllIIII.history)
        return IlIlIllllIlIIIIIlIl._random.random_choice(1 - llIIIlIllIIIllllII)