
import os
import shutil
import locale

def rmtree_if_exists(directory):
    if os.path.exists(directory):
        shutil.rmtree(directory)

def uniqify(l):
    # see: http://stackoverflow.com/questions/480214/how-do-you-remove-duplicates-from-a-list-in-python-whilst-preserving-order/29898968#29898968
    reduce(lambda r, v: v in r[1] and r or (r[0].append(v) or r[1].add(v)) or r, l, ([], set()))[0]

def flatten_list(l):
    all_items = [item if len(item) > 1 else sublist for sublist in l for item in sublist]
    return uniqify(all_items)

def unicode_available():
    return locale.getdefaultlocale()[1] == 'UTF-8'


import os
import shutil
import locale

def rmtree_if_exists(directory):
    if os.path.exists(directory):
        shutil.rmtree(directory)

def uniqify(_list):
    # see: http://stackoverflow.com/questions/480214/how-do-you-remove-duplicates-from-a-list-in-python-whilst-preserving-order/29898968#29898968
    reduce(lambda r, v: v in r[1] and r or (r[0].append(v) or r[1].add(v)) or r, _list, ([], set()))[0]

def flatten_list(_list):
    all_items = [item if len(item) > 1 else sublist for sublist in _list for item in sublist]
    return uniqify(all_items)

def unicode_available():
    return locale.getdefaultlocale()[1] == 'UTF-8'

Remove all traces of ls.
Remove all traces of ls.

  
  import os
  import shutil
  import locale
  
  def rmtree_if_exists(directory):
      if os.path.exists(directory):
          shutil.rmtree(directory)
  
- def uniqify(l):
+ def uniqify(_list):
      # see: http://stackoverflow.com/questions/480214/how-do-you-remove-duplicates-from-a-list-in-python-whilst-preserving-order/29898968#29898968
-     reduce(lambda r, v: v in r[1] and r or (r[0].append(v) or r[1].add(v)) or r, l, ([], set()))[0]
+     reduce(lambda r, v: v in r[1] and r or (r[0].append(v) or r[1].add(v)) or r, _list, ([], set()))[0]
  
- def flatten_list(l):
+ def flatten_list(_list):
-     all_items = [item if len(item) > 1 else sublist for sublist in l for item in sublist]
+     all_items = [item if len(item) > 1 else sublist for sublist in _list for item in sublist]
      return uniqify(all_items)
  
  def unicode_available():
      return locale.getdefaultlocale()[1] == 'UTF-8'
  
Remove all traces of ls.
## Code Before:

import os
import shutil
import locale

def rmtree_if_exists(directory):
    if os.path.exists(directory):
        shutil.rmtree(directory)

def uniqify(l):
    # see: http://stackoverflow.com/questions/480214/how-do-you-remove-duplicates-from-a-list-in-python-whilst-preserving-order/29898968#29898968
    reduce(lambda r, v: v in r[1] and r or (r[0].append(v) or r[1].add(v)) or r, l, ([], set()))[0]

def flatten_list(l):
    all_items = [item if len(item) > 1 else sublist for sublist in l for item in sublist]
    return uniqify(all_items)

def unicode_available():
    return locale.getdefaultlocale()[1] == 'UTF-8'

## Instruction:
Remove all traces of ls.
## Code After:

import os
import shutil
import locale

def rmtree_if_exists(directory):
    if os.path.exists(directory):
        shutil.rmtree(directory)

def uniqify(_list):
    # see: http://stackoverflow.com/questions/480214/how-do-you-remove-duplicates-from-a-list-in-python-whilst-preserving-order/29898968#29898968
    reduce(lambda r, v: v in r[1] and r or (r[0].append(v) or r[1].add(v)) or r, _list, ([], set()))[0]

def flatten_list(_list):
    all_items = [item if len(item) > 1 else sublist for sublist in _list for item in sublist]
    return uniqify(all_items)

def unicode_available():
    return locale.getdefaultlocale()[1] == 'UTF-8'
