You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
463 B
17 lines
463 B
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
# Licensed under the MIT License.
|
|
"""
|
|
Short examples used in the documentation.
|
|
"""
|
|
import os
|
|
|
|
|
|
def get_example(name):
|
|
"""
|
|
Retrieves the absolute file name of an example.
|
|
"""
|
|
this = os.path.abspath(os.path.dirname(__file__))
|
|
full = os.path.join(this, name)
|
|
if not os.path.exists(full):
|
|
raise FileNotFoundError("Unable to find example '{0}'".format(name))
|
|
return full
|