

from mod import Mod
import random
import os


class ModDefault(Mod):
    def __init__(
        self,
        filename=None,
        logger=None
    ):
        Mod.__init__(self, logger)
        text_path = filename or os.path.join(
            os.path.abspath(os.path.dirname(__file__)),
            "default.txt"
        )
        self.default_texts = [line.strip() for line in open(text_path)]

    def is_fire(self, message, master):
        return True

    def reses(self, message, master):
        return [
            (random.random(),
             text, "default", dict())
            for text in self.default_texts
        ]



from mod import Mod
import random
import os


class ModDefault(Mod):
    def __init__(
        self,
        filename=None,
        logger=None
    ):
        Mod.__init__(self, logger)
        text_path = filename or os.path.join(
            os.path.abspath(os.path.dirname(__file__)),
            "default.txt"
        )
        self.default_texts = [line.strip() for line in open(text_path)]

    def is_fire(self, message, master):
        return True

    def reses(self, message, master):
        return [
            (random.uniform(0, 0.3),
             text, "default", dict())
            for text in self.default_texts
        ]

Use uniform instead of random
Use uniform instead of random

  
  
  from mod import Mod
  import random
  import os
  
  
  class ModDefault(Mod):
      def __init__(
          self,
          filename=None,
          logger=None
      ):
          Mod.__init__(self, logger)
          text_path = filename or os.path.join(
              os.path.abspath(os.path.dirname(__file__)),
              "default.txt"
          )
          self.default_texts = [line.strip() for line in open(text_path)]
  
      def is_fire(self, message, master):
          return True
  
      def reses(self, message, master):
          return [
-             (random.random(),
+             (random.uniform(0, 0.3),
               text, "default", dict())
              for text in self.default_texts
          ]
  
Use uniform instead of random
## Code Before:


from mod import Mod
import random
import os


class ModDefault(Mod):
    def __init__(
        self,
        filename=None,
        logger=None
    ):
        Mod.__init__(self, logger)
        text_path = filename or os.path.join(
            os.path.abspath(os.path.dirname(__file__)),
            "default.txt"
        )
        self.default_texts = [line.strip() for line in open(text_path)]

    def is_fire(self, message, master):
        return True

    def reses(self, message, master):
        return [
            (random.random(),
             text, "default", dict())
            for text in self.default_texts
        ]

## Instruction:
Use uniform instead of random
## Code After:


from mod import Mod
import random
import os


class ModDefault(Mod):
    def __init__(
        self,
        filename=None,
        logger=None
    ):
        Mod.__init__(self, logger)
        text_path = filename or os.path.join(
            os.path.abspath(os.path.dirname(__file__)),
            "default.txt"
        )
        self.default_texts = [line.strip() for line in open(text_path)]

    def is_fire(self, message, master):
        return True

    def reses(self, message, master):
        return [
            (random.uniform(0, 0.3),
             text, "default", dict())
            for text in self.default_texts
        ]
