text: '' Convert the following perl code to python
  Class::Accessor::Fast/;
  my @other_fields = qw/calculation_status calculation_failed name object_name
  round_off/;
  CLASS->mk_accessors(@other_fields);
  sub new {
  my $caller = shift;
  my $class = ref $caller || $caller;
  my $self = bless {}, $class;
  $self->name('TreasuryMarginAllocationModel');
  return $self;
  }
  sub Clone {
  }
  sub init {
  }
  sub do {
  my $self = shift;
  my $inputs = shift;
  my $bu_href = shift;
  my $bu_allocation_ratios = shift;
  if ( $inputs->{total_margin} != 0) {
  foreach my $bu (keys %{$bu_allocation_ratios}) {
  $bu_allocation_ratios->{$bu}->{gamma_ratio} = +DEFAULT_VALUE;
  }
  foreach my $bu (keys %{$bu_href}) {
  $bu_allocation_ratios->{$bu}->{gamma_ratio} =
  $bu_href->{$bu}->{margin} / $inputs->{total_margin};
  }
  }
  return $bu_allocation_ratios;
  }
  sub round_off {
  }
  1;
  __END__
  '''