How to import context module export -drupal 7
Way1: Using Features module

I would recommend you to use features module to export your configurations like context, it will automatically pull the context configurations in code.

Way2: Using custom module

If for some reasons you want to do it in custom code then


Use context export module to export your context. This module will let you the configuration code for context.
Then create a plugin using hook_ctools_plugin_api and hook_context_default_contexts. Refernce link 


Sample Implementation for hook_ctools_plugin_api. 


This will let Drupal aware of the context export plugin using ctools API.

Sample Implementation for hook_context_default_contexts. 


Create file as _context.inc inside your 
Add the implementation of hook_context_default_contexts on _context.inc file. As in this example code.