# flags: --preview --pyi
#
# Test case for https://github.com/psf/black/issues/4256
# Blank line should be enforced between a function and a decorated class in stubs.

def foo(): ...
@decorator
class Bar: ...

def baz(): ...

@decorator
class Qux: ...

class Already: ...

@decorator
class After: ...

@decorator
class First: ...
@decorator
class Second: ...

def before(): ...
@decorator1
@decorator2
class MultiDecorated: ...

@decorator
def decorated_func(): ...
@decorator
class AfterDecoratedFunc: ...

class Outer:
    def method(self) -> None: ...
    @decorator
    class Inner: ...

    @decorator
    class AnotherInner: ...
    def after_inner(self) -> None: ...

    @decorator
    class InnerA: ...
    @decorator
    class InnerB: ...

def func(): ...
@decorator
class NonStub:
    x: int
    y: str

# output
#
# Test case for https://github.com/psf/black/issues/4256
# Blank line should be enforced between a function and a decorated class in stubs.

def foo(): ...

@decorator
class Bar: ...

def baz(): ...

@decorator
class Qux: ...

class Already: ...

@decorator
class After: ...

@decorator
class First: ...

@decorator
class Second: ...

def before(): ...

@decorator1
@decorator2
class MultiDecorated: ...

@decorator
def decorated_func(): ...

@decorator
class AfterDecoratedFunc: ...

class Outer:
    def method(self) -> None: ...

    @decorator
    class Inner: ...

    @decorator
    class AnotherInner: ...

    def after_inner(self) -> None: ...

    @decorator
    class InnerA: ...

    @decorator
    class InnerB: ...

def func(): ...

@decorator
class NonStub:
    x: int
    y: str
