| OLD | NEW |
| 1 # Copyright 2013 The LUCI Authors. All rights reserved. | 1 # Copyright 2013 The LUCI Authors. All rights reserved. |
| 2 # Use of this source code is governed by the Apache v2.0 license that can be | 2 # Use of this source code is governed under the Apache License, Version 2.0 |
| 3 # found in the LICENSE file. | 3 # that can be found in the LICENSE file. |
| 4 | 4 |
| 5 """Mixed bag of NDB utilities.""" | 5 """Mixed bag of NDB utilities.""" |
| 6 | 6 |
| 7 # Disable 'Access to a protected member ...'. NDB uses '_' for other purposes. | 7 # Disable 'Access to a protected member ...'. NDB uses '_' for other purposes. |
| 8 # pylint: disable=W0212 | 8 # pylint: disable=W0212 |
| 9 | 9 |
| 10 # Disable: 'Method could be a function'. It can't: NDB expects a method. | 10 # Disable: 'Method could be a function'. It can't: NDB expects a method. |
| 11 # pylint: disable=R0201 | 11 # pylint: disable=R0201 |
| 12 | 12 |
| 13 import datetime | 13 import datetime |
| (...skipping 613 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 627 | 627 |
| 628 @functools.wraps(async_fn) | 628 @functools.wraps(async_fn) |
| 629 def sync(*args, **kwargs): | 629 def sync(*args, **kwargs): |
| 630 return async_fn(*args, **kwargs).get_result() | 630 return async_fn(*args, **kwargs).get_result() |
| 631 | 631 |
| 632 if is_static_method: | 632 if is_static_method: |
| 633 sync = staticmethod(sync) | 633 sync = staticmethod(sync) |
| 634 elif is_class_method: | 634 elif is_class_method: |
| 635 sync = classmethod(sync) | 635 sync = classmethod(sync) |
| 636 return sync | 636 return sync |
| OLD | NEW |