<commit_before>#!/usr/bin/env python
# pass angle in degrees
# Wheel A = front left
# Wheel B = front Right
# Wheel C = Back Left
# Wheel D = Back Right
	
# Motion library to abstract wheel movement and macro moves from hardware.
from math import sin, cos, pi
from time import sleep

def iowrite(wheel, ds):
  print wheel, ds
	
def move(speed, angle, time=0):
  """Calculating voltage multiplier for each wheel, passing to io pins.

  :param speed: Magnitude of robot's translation speed.
  :type speed: float.
  :param angle: Angle at which robot should translate.
  :type angle: float.
  :param time: Time in seconds that robot should do this move.
  :type time: float.

  """

  # Calculate voltage multipliers
  front_left = speed * sin(angle*pi/180 + pi/4)
  front_right = speed * cos(angle*pi/180 + pi/4)
  back_left = speed * cos(angle*pi/180 + pi/4)
  back_right = speed * sin(angle*pi/180 + pi/4)  
  
  # Write to io pins.
  iowrite("front_left", front_left)
  iowrite("front_right", front_right)
  iowrite("back_left", back_left)
  iowrite("back_right", back_right)
  
  # Sleep for user defined amount of time
  sleep(time)
  
  # Stop robot movement.
  iowrite("front_left", 0)
  iowrite("front_right", 0)
  iowrite("back_left", 0)
  iowrite("back_right", 0)
  
def rotate(Rspeed, time=0):
  """Controlling rotation of robot"""
  
  #Calculate voltage multipliers
  front_left = Rspeed
  front_right = -Rspeed
  back_left = Rspeed
  back_right = -Rspeed
  
  # Write to io pins.
  iowrite("front_left", front_left)
  iowrite("front_right", front_right)
  iowrite("back_left", back_left)
  iowrite("back_right", back_right)
  
  # Sleep for user defined amount of time
  sleep(time)
  
  # Stop robot movement.
  iowrite("front_left", 0)
  iowrite("front_right", 0)
  iowrite("back_left", 0)
  iowrite("back_right", 0)<commit_msg>2-space indent to 4-space (PEP8)<commit_after>#!/usr/bin/env python
# pass angle in degrees
# Wheel A = front left
# Wheel B = front Right
# Wheel C = Back Left
# Wheel D = Back Right
	
# Motion library to abstract wheel movement and macro moves from hardware.
from math import sin, cos, pi
from time import sleep

def iowrite(wheel, ds):
    print wheel, ds
	
def move(speed, angle, time=0):
    """Calculating voltage multiplier for each wheel, passing to io pins.

    :param speed: Magnitude of robot's translation speed.
    :type speed: float.
    :param angle: Angle at which robot should translate.
    :type angle: float.
    :param time: Time in seconds that robot should do this move.
    :type time: float.

    """

    # Calculate voltage multipliers
    front_left = speed * sin(angle*pi/180 + pi/4)
    front_right = speed * cos(angle*pi/180 + pi/4)
    back_left = speed * cos(angle*pi/180 + pi/4)
    back_right = speed * sin(angle*pi/180 + pi/4)  

    # Write to io pins.
    iowrite("front_left", front_left)
    iowrite("front_right", front_right)
    iowrite("back_left", back_left)
    iowrite("back_right", back_right)

    # Sleep for user defined amount of time
    sleep(time)

    # Stop robot movement.
    iowrite("front_left", 0)
    iowrite("front_right", 0)
    iowrite("back_left", 0)
    iowrite("back_right", 0)
  
def rotate(Rspeed, time=0):
    """Controlling rotation of robot"""

    #Calculate voltage multipliers
    front_left = Rspeed
    front_right = -Rspeed
    back_left = Rspeed
    back_right = -Rspeed

    # Write to io pins.
    iowrite("front_left", front_left)
    iowrite("front_right", front_right)
    iowrite("back_left", back_left)
    iowrite("back_right", back_right)

    # Sleep for user defined amount of time
    sleep(time)

    # Stop robot movement.
    iowrite("front_left", 0)
    iowrite("front_right", 0)
    iowrite("back_left", 0)
    iowrite("back_right", 0)
{'fraction_non_alphanumeric': 0.10908128144029654, 'fraction_numerical': 0.014561821551495897, 'mean_word_length': 3.524550898203593, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3185580', 'n_tokens_mistral': 1341, 'n_tokens_neox': 1258, 'n_words': 397}