►
From YouTube: Python Code Suggestions demo - Part I
Description
This demo demonstrates recent changes we've done in pre/postprocessing to improve the quality of Python code completions.
A
Hi
everyone,
my
name,
is
Alexander
and
I'm,
a
senior
engineer
for
the
ISIS
group
at
gitlab,
so
in
this
demo,
I
would
like
to
present
you.
The
recent
changes
we've
made
and
cut
suggestions
to
improve
the
quality
of
completions
for
python.
So,
let's
just
cut
together
to
solve
a
very
simple
task
and,
for
example,
let's
just
let's
just
Implement.
A
Let's
just
translate
our
messages
from
English
to
to
French
and
Spanish,
using
the
predefined
vocabulary
and
to
solve
this
task
we
probably
need
to
implement
an
interface
which
is
an
abstract
class
in
Python,
concrete
implementation
for
the
French
localizer
for
the
Spanish
one,
let's
also
Implement
a
factory
method
and
just
a
loop
to
iterate
over
the
hard-coded
messages
that
we
would
like
to
translate
to
either
the
French
or
to
Spanish.
So,
let's
start
and
first
we
need
to
create
a
an
abstract
class
for
the
base
localizer.
So
first,
let's
import
the
ABC
dependency.
A
Dependency
right,
so
we
can
do
like
that
yeah
here
we
are
so
we
get
our
first
line,
which
is
correct.
We
also
get
some
other
completions
and
recommendations.
So
let's
create
a
an
abstract
animal
class.
We
don't
need
it.
So,
let's
just
accept
and
let's
clean
the
the
rest
of
the
completion
and
also
yeah,
let's
just
create
a
an
abstract.
A
Yeah,
you
were
here
so
class
localizer
that
inherits
ABC
with
abstract
methods
but
yeah.
Let's
just
change
this
abstract
method
to
accept
message
which
is
string
and
also
return.
Let's
return
string
as
well
right,
okay,
so
now,
let's
just
create,
we
need
to
create
a
French
localizer
Let's,
just
only
just
to
type
there.
The
signature
on
this
classy
class
name
French
localizer,
so
all
Goods
return
message:
upper
yeah
the
method
looks
good
I
mean
we
inherit
the
correct
one
with
to
to
have
the
concrete
implementation,
but
we
don't
need
this
line.
A
A
Isolation
spread.
So
let's
call
it
okay,
let's
just
wait
for
the
condition:
okay,
self
localized
message:
hello,
bonjour
world:
let's
wait
probably
for
some
okay,
let's
just
type
something
else,
so
let's
say
instead
of
world,
so
we
can
ask
for
the
car
and
it's
it
should
be
what
you
write
so
world
is
we
still
receive
the
world?
Let's
just
skip
it,
we
can,
for
instance,
request
for
the
plane
right.
A
Okay,
Avion,
that's
good,
so
I
think
it's
not.
Let's
just
have
three
words
pretty
fun
and
right
now
we
can
write
dark
streams
to
be
a
more
pythonic
right
and
you
don't
need
this
function
and
we
need
to
return
return
return.
The
translation
by
looking
into
the
dictionary.
A
Okay:
let's
wait,
okay,
now
all
good,
so
we
return
self.
We
just
look
into
the
dictionary
which
is
self-localized
for
us,
but
we
can
also
change,
probably
the
type
the
return
type
Let,
It
Be
optional,.
A
Optional
right
and
we
need
to
apply
the
same
here
within
our
concrete
implementation,
and
in
this
case,
let's
just
wait.
Probably
it
will
change
no
okay,
but
we
can
do
like
that
return.
A
A
A
That
needs
correct
and
now
I
think
we'll
get
yeah
we'll
get
the
same,
Keys
hello,
current
plane
and
they
are
translations
to
friends
for
sorry
to
Spanish.
That
looks
correct,
so
my
understanding
and
also
we
need
another
another
method.
We
need
to
implement
localize,
the
abstract
methods
and,
let's
just
write.
A
A
Now,
let's
just
wait
for
the
completion:
okay
get
localizer
by
type
and
also
a
correct
return
type.
If
type
is
French,
we
return
French
localizer.
Let's
just
wait
for
the
for
another
completion.
If
else,
if
type
is
Spanish,
so
we
return
Spanish
localizer
and
we
also
raise
exception.
So
that
was
what
we
expected
with
our
request
right
and
now
we
probably
maybe
we
can
just
create
a
at
least
with
messages.
A
Let's
say
that
we
would
like
to
translate:
blame
sorry,
plane,
car
and,
let's
see,
table
right,
and
then
let's
create
a
French
and
Spanish
equalizer.
A
Messages
right
here:
okay,
for
each
message
in
messages:
we
we
ask
for
the
French
translation
and
also
maybe
we'll
get
it
in
Spanish
yeah,
and
also
we
get
a
Spanish
one.
Okay,
that's
great
thanks
a
lot
for
watching
this
demo.
We
also,
maybe
with
the
next
demo,
we'll
show
you
how
to
use
custom
suggestions
to
work,
let's
say
to
generate
a
fast
API
server
and
so
on.
We
also
we
continue
to
work
on
improving
the
quality
yeah
great
thanks,
stay
tuned.