def check_gamma(combinations):
  """This function is used to remove element combinations for 
  a single busbar which violate the 'One Line Constraint',(also called 
  gamma constraint) which states:
  Out of the elements connected to a bus-bar, at least one of them has to be a line. 
  Or: a bus-bar cannot have ONLY non-line elements (loads, generators) connected to it.
  The input to this function is a combination of elements, 
  e.g: [('loads_id1,generators_id1), ('line_ex_id1,generators_id1'), ('line_or_id2,generators_id1')]
  In this example, the first combination:('loads_id1,generators_id1) violates the gamma constraint. 
  Hence, it has to be removed. So the resulting set of combinations of elements that will be returned
  from this function are
  combs : [('line_ex_id1,generators_id1'), ('line_or_id2,generators_id1')] """
  for elem in combinations: 
    #the following loop is to remove combinations
    #that have ONLY two non-line elements (gamma)
    temp1=elem[0]
    temp2=elem[1]
    if((''.join(temp1)).find('loads_id') != -1 and (''.join(temp2)).find('generators_id') != -1):
      combinations.remove(elem)
  return combinations