from pprint import pformat
from functools import partial
from os.path import join
from decorators import debugtask
from buildercore import project, utils as core_utils, config

def _hackgibson():
    fixtures_dir = join(config.SRC_PATH, 'tests', 'fixtures')
    config.PROJECTS_FILES = [
        'src/tests/fixtures/projects/',
        # specific file
        'src/tests/fixtures/projects/dummy-project.yaml',
    ]
    project.project_map.cache_clear()
    config.app.cache_clear()
    return fixtures_dir

@debugtask
def lst():
    _hackgibson()
    for org, plist in project.org_project_map().items():
        print(org)
        for project_name in plist:
            print('  ', project_name)
        print()

@debugtask
def regen(output_format='json'):
    "given a project name, returns the fully realized project description data."
    fixtures_dir = _hackgibson()
    formatters = {
        'json': partial(core_utils.json_dumps, indent=4),
        'yaml': core_utils.yaml_dumps,

        'default': lambda v: pformat(core_utils.remove_ordereddict(v))
    }
    formatter = formatters.get(output_format if output_format in formatters else 'default')

    for org, plist in project.org_project_map().items():
        print(org)
        for pname in plist:
            fix = formatter(project.project_data(pname))
            output_path = join(fixtures_dir, "%s-project.%s" % (pname, output_format))
            with open(output_path, 'w') as fh:
                fh.write(fix)
            print('- wrote', output_path)

@@ -175,26 +175,39 @@
 g%0A%0Adef _
-hackgibson
+switch_in_test_settings
 ():%0A    
@@ -541,26 +541,39 @@
 ):%0A    _
-hackgibson
+switch_in_test_settings
 ()%0A    f
@@ -882,18 +882,31 @@
  = _
-hackgibson
+switch_in_test_settings
 ()%0A 

Rename function to comprehensible name