amrita20 15 Newbie Poster

i also wanted to convert a python code to java can any one help??

import datetime
import unittest
def getAlerts(user_id):

//This functions calculates the alerts for the user based on the
transactions of his/her friends. It gives the list of alerts in the
format <net_friends>,<BUY|SELL>,<ticker> for user to make a decision.
:param user_id: User ID of the user who wants the alerts
:return: list of stock alerts (ranked high to low) based on transactions of friends//


alerts = []
alerts_dict = dict()

records = createRecords(user_id)
sell = []
buy = []
for statement in records.values():
    for x in statement['SELL']:
        sell.append(x)
    for y in statement['BUY']:
        buy.append(y)

sell_map = createStockCountMap(sell)
buy_map = createStockCountMap(buy)

if len(buy_map) == 0 and len(sell_map) == 0:
    pass

elif len(sell_map) == 0 and len(buy_map) != 0:
    for x in buy_map:
        net_number = abs(buy_map[x])
        value = str(net_number) + ',BUY,' + x
        if not net_number in alerts_dict:
            alerts_dict[net_number] = [value]
        else:
            alerts_dict[net_number].append(value)

elif len(buy_map) == 0 and len(sell_map) != 0:
    for y in sell_map:
        net_number = abs(sell_map[y])
        value = str(net_number) + ',SELL,' + y
        if not net_number in alerts_dict:
            alerts_dict[net_number] = [value]
        else:
            alerts_dict[net_number].append(value)
else:
    for x in buy_map:
        for y in sell_map:
            if x == y:
                net_number = buy_map[x] - sell_map[y]
                if net_number > 0:
                    value = str(net_number) + ',BUY,' + x
                    net_number = abs(net_number)
                    if not net_number in alerts_dict:
                        alerts_dict[net_number] = [value]
                    else:
                        alerts_dict[net_number].append(value)
                    break

                elif net_number < 0:
                    value = str(abs(net_number)) + ',SELL,' + y
                    net_number = abs(net_number)
                    if not net_number in alerts_dict:
                        alerts_dict[net_number] = [value]
rproffitt commented: Please put this on it's own page along with how much you pay for such work. +15