def copy_descriptor(descriptor, newname=None):
 if (newname is None):
  newname = descriptor.name
 if descriptor.is_discrete:
  newf = Orange.data.DiscreteVariable(newname, values=descriptor.values, base_value=descriptor.base_value, ordered=descriptor.ordered)
  newf.attributes = dict(descriptor.attributes)
 elif descriptor.is_continuous:
  newf = Orange.data.ContinuousVariable(newname)
  newf.number_of_decimals = descriptor.number_of_decimals
  newf.attributes = dict(descriptor.attributes)
 else:
  newf = type(descriptor)(newname)
  newf.attributes = dict(descriptor.attributes)
 return newf

def copy_descriptor ( descriptor , newname = None ) : if ( newname is None ) : newname = descriptor . name if descriptor . is_discrete : newf = Orange . data . DiscreteVariable ( newname , values = descriptor . values , base_value = descriptor . base_value , ordered = descriptor . ordered ) newf . attributes = dict ( descriptor . attributes ) elif descriptor . is_continuous : newf = Orange . data . ContinuousVariable ( newname ) newf . number_of_decimals = descriptor . number_of_decimals newf . attributes = dict ( descriptor . attributes ) else : newf = type ( descriptor ) ( newname ) newf . attributes = dict ( descriptor . attributes ) return newf
create a copy of the descriptor .