parameters: (self, value, fail_value=None)
return_statement: return fail_value
docstring: return the first key of this dictionary given the value
docstring_summary: return the first key of this dictionary given the value
docstring_tokens: return the first key of this dictionary given the value
function: def get_first_key_for_value(self, value, fail_value=None):
          """return the first key of this dictionary given the value"""
          list_result = [item[0] for item in self.items() if item[1] == value]
          if len(list_result) > 0:
              return list_result[0]
          return fail_value
function_tokens: def get_first_key_for_value ( self , value , fail_value = None ) : list_result = [ item [ 0 ] for item in self . items ( ) if item [ 1 ] == value ] if len ( list_result ) > 0 : return list_result [ 0 ] return fail_value