Code Duplication    Length = 23-23 lines in 2 locations

gitfollow/gitfollow.py 2 locations

@@ 252-274 (lines=23) @@
249
    :type username:str
250
    :return: stared repo as list
251
    '''
252
    try:
253
        star_list_temp=[]
254
        while (True):
255
            page_number += 1
256
            star_url = url_maker_star(username, page_number)
257
            star_html = get_html(star_url)
258
            temp_list = star_extract(star_html)
259
            if len(temp_list)==0:
260
                break
261
            star_list_temp.extend(temp_list)
262
        return star_list_temp
263
    except Exception as ex:
264
        if counter>3:
265
            sys.exit()
266
        error_log("Error In Page " + str(page_number) + " Stars Page")
267
        star_list(username,page_number,counter+1)
268
269
def following_list_gen(follower_name,page_number=0,counter=0):
270
    '''
271
    This function generate following list
272
    :param follower_name: username
273
    :type follower_name:str
274
    :return: username following list
275
    '''
276
    try:
277
        following_list = []
@@ 182-204 (lines=23) @@
179
        if "Not Found" in raw_data:
180
            print("Invalid Github User")
181
            sys.exit()
182
        return raw_data
183
    else:
184
        print("Error In Internet")
185
        pass
186
187
188
def end_check(input_string):
189
    '''
190
    This function check end page
191
    :param input_string: raw html
192
    :type input_string:str
193
    :return: True or False
194
    '''
195
    if input_string.find("reached the end")!=-1:
196
        return True
197
    else:
198
        return False
199
def follower_list_gen(follower_name,page_number=0,counter=0):
200
    '''
201
    This function generate follower_list
202
    :param follower_name: username
203
    :type follower_name:str
204
    :return: username follower list
205
    '''
206
    try:
207
        follower_list = []