"""
    Function to calculate delays for like/follow/unfollow etc.
"""

import time
import random


def add_dispersion(delay_value):
    return delay_value * 3 / 4 + delay_value * random.random() / 2


def like_delay(bot):
    time.sleep(add_dispersion(bot.like_delay))


def unlike_delay(bot):
    time.sleep(add_dispersion(bot.unlike_delay))


def follow_delay(bot):
    time.sleep(add_dispersion(bot.follow_delay))


def unfollow_delay(bot):
    time.sleep(add_dispersion(bot.unfollow_delay))


def comment_delay(bot):
    time.sleep(add_dispersion(bot.comment_delay))


def block_delay(bot):
    time.sleep(add_dispersion(bot.block_delay))


def unblock_delay(bot):
    time.sleep(add_dispersion(bot.unblock_delay))


def error_delay(bot):
    time.sleep(10)


def small_delay(bot):
    time.sleep(add_dispersion(3))


def very_small_delay(bot):
    time.sleep(add_dispersion(0.7))

@@ -199,29 +199,22 @@
 2%0A%0A%0Adef 
-like_delay(bo
+sleep(
 t):%0A    
@@ -243,23 +243,65 @@
 ion(
-bot.like_delay)
+t))%0A%0A%0Adef like_delay(bot):%0A    sleep(bot.User.delays.like
 )%0A%0A%0A
@@ -331,51 +331,36 @@
     
-time.
 sleep(
-add_dispersion(bot.unlike_delay)
+bot.User.delays.unlike
 )%0A%0A%0A
@@ -390,51 +390,36 @@
     
-time.
 sleep(
-add_dispersion(bot.follow_delay)
+bot.User.delays.follow
 )%0A%0A%0A
@@ -451,37 +451,29 @@
     
-time.
 sleep(
-add_dispersion(bot
+bot.User.delays
 .unf
@@ -477,23 +477,16 @@
 unfollow
-_delay)
 )%0A%0A%0Adef 
@@ -513,45 +513,37 @@
     
-time.
 sleep(
-add_dispersion(bot
+bot.User.delays
 .comment
 _del
@@ -538,23 +538,16 @@
 .comment
-_delay)
 )%0A%0A%0Adef 
@@ -572,50 +572,35 @@
     
-time.
 sleep(
-add_dispersion(bot.block_delay)
+bot.User.delays.block
 )%0A%0A%0A
@@ -631,45 +631,37 @@
     
-time.
 sleep(
-add_dispersion(bot
+bot.User.delays
 .unblock
 _del
@@ -660,15 +660,8 @@
 lock
-_delay)
 )%0A%0A%0A
@@ -682,29 +682,24 @@
 y(bot):%0A    
-time.
 sleep(10)%0A%0A%0A
@@ -728,36 +728,15 @@
     
-time.
 sleep(
-add_dispersion(3)
+3
 )%0A%0A%0A
@@ -770,36 +770,15 @@
     
-time.
 sleep(
-add_dispersion(
 0.7)
-)
 %0A

add sleep function