Popular recipes by Manuel Garcia http://code.activestate.com/recipes/users/2827266/2010-09-10T00:10:47-07:00ActiveState Code RecipesNon-recursive Flatten, leaves Strings and Dicts alone, minimal type assumptions, with tests (Python) 2010-09-10T00:10:47-07:00Manuel Garciahttp://code.activestate.com/recipes/users/2827266/http://code.activestate.com/recipes/577387-non-recursive-flatten-leaves-strings-and-dicts-alo/ <p style="color: grey"> Python recipe 577387 by <a href="/recipes/users/2827266/">Manuel Garcia</a> (<a href="/recipes/tags/nonrecursive/">nonrecursive</a>). </p> <p>I have written Flatten a few dozen times, and also searched the interwebs - I don't feel good about a heavily recursive function for Python, and some of the "type-sniffing" I saw in some codes seemed fishy - so I coded up this version. At least this increases the options. Handles strings, dictionaries, generators, sequences, lists, tuples -- in sensible ways. Handles arbitrarily deep levels of nesting. Does the bare minimum of type-sniffing. With Doctest tests.</p> Dump all Active Directory Information using LDAP scripting (Python) 2007-04-04T17:07:38-07:00Manuel Garciahttp://code.activestate.com/recipes/users/2827266/http://code.activestate.com/recipes/511451-dump-all-active-directory-information-using-ldap-s/ <p style="color: grey"> Python recipe 511451 by <a href="/recipes/users/2827266/">Manuel Garcia</a> (<a href="/recipes/tags/network/">network</a>). </p> <p>From Active Directory (or any other LDAP server) dump ALL information about computers, users, and groups, in a nicely formatted report.</p> iterator wrapper, allowing 'pushback' and 'nonzero' test (Python) 2007-03-12T09:59:03-07:00Manuel Garciahttp://code.activestate.com/recipes/users/2827266/http://code.activestate.com/recipes/502304-iterator-wrapper-allowing-pushback-and-nonzero-tes/ <p style="color: grey"> Python recipe 502304 by <a href="/recipes/users/2827266/">Manuel Garcia</a> (<a href="/recipes/tags/algorithms/">algorithms</a>). </p> <p>Needed the ability to 'pushback' values back onto an iterator, and also was able to add a 'nonzero' test to the iterator at the same time.</p> Add thousands separator commas to formatted numbers (Python) 2006-10-07T15:49:28-07:00Manuel Garciahttp://code.activestate.com/recipes/users/2827266/http://code.activestate.com/recipes/498181-add-thousands-separator-commas-to-formatted-number/ <p style="color: grey"> Python recipe 498181 by <a href="/recipes/users/2827266/">Manuel Garcia</a> (<a href="/recipes/tags/text/">text</a>). </p> <p>Needed formatted numbers with thousands separator commas added on an end-user report. The usual way mentioned is to use 'module locale.format', but that didn't work cleanly on my Windows machine, and the cure seemed worse than the disease.</p> Get all active email addresses from Windows Exchange Server (Python) 2006-03-24T19:04:23-08:00Manuel Garciahttp://code.activestate.com/recipes/users/2827266/http://code.activestate.com/recipes/475179-get-all-active-email-addresses-from-windows-exchan/ <p style="color: grey"> Python recipe 475179 by <a href="/recipes/users/2827266/">Manuel Garcia</a> (<a href="/recipes/tags/sysadmin/">sysadmin</a>). </p> <p>For Windows Exchange Server running on Windows Server 2000/2003, from Exchange and Active Directory, get all email addresses (and aliases) from all active users. Uses ASDI scripting, LDAP paths to get user info from Active Directory. Uses Pythonwin</p>