Skip to content

Instantly share code, notes, and snippets.

@my-other-github-account
Created June 6, 2023 05:34
Show Gist options
  • Save my-other-github-account/330566edb08522272c6f627f38806cde to your computer and use it in GitHub Desktop.
Save my-other-github-account/330566edb08522272c6f627f38806cde to your computer and use it in GitHub Desktop.
Example H2O Prompt
<|prompt|>
Complete the following Python code:
Notes: respond with the entire complete function definition
do not add any comments, be as concise in your code as possible
use only built-in libraries, assume no additional imports other than those provided (if any)
code:
from typing import List
def has_close_elements(numbers: List[float], threshold: float) -> bool:
""" Check if in given list of numbers, are any two numbers closer to each other than
given threshold.
>>> has_close_elements([1.0, 2.0, 3.0], 0.5)
False
>>> has_close_elements([1.0, 2.8, 3.0, 4.0, 5.0, 2.0], 0.3)
True
"""
<|endoftext|><|answer|>
```python
def has_close_elements(
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment