Skip to content
TheChatArchiveThe Chat Archive
gpt-3.5-turbo-0301· OpenAIAi2 WildChat-4.8M (AI2)

переведи с perl на python sub getmaxpk { my $self = shift; my $instr = shift; my $dbhdst…

  1. User

    переведи с perl на python sub _get_max_pk { my self=shift;myself = shift; my instr = shift; my dbhdst=shift;returnundefifdbh_dst = shift; return undef if instr->{overwrite}; return undef if instr−>isdiffrequired;myinstr->{is_diff_required}; my max_pk = self−>getmaxcol(dbh=>self->_get_max_col( dbh => instr->{dbh_dst }, tb => instr−>dsttboriginal,col=>instr->{ dst_tb_original }, col => instr->{ pk }, ); return maxpkifnotmax_pk if not instr->{is_history}; my max_pk__history = self->_get_max_col( dbh => instr−>dbhdst,tb=>instr->{dbh_dst }, tb => instr->{ dst_tb }, col => instr−>pk,);instr->{ pk }, ); max_pk = max_pk__history if max_pk__history and max_pk__history > max_pk; return $max_pk; }

  2. Assistant

    def _get_max_pk(self, instr, dbh_dst): if instr['overwrite']: return None if instr['is_diff_required']: return None max_pk = self._get_max_col( dbh=dbh_dst, tb=instr['dst_tb_original'], col=instr['pk'] ) if not instr['is_history']: return max_pk max_pk__history = self._get_max_col( dbh=dbh_dst, tb=instr['dst_tb'], col=instr['pk'] ) if max_pk__history and max_pk__history > max_pk: max_pk = max_pk__history return max_pk