Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoPR cognitiveservices/data-plane/ComputerVision] Rename examples to match generated names #3541

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion azure-cognitiveservices-vision-computervision/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
include *.rst
include azure_bdist_wheel.py
2 changes: 1 addition & 1 deletion azure-cognitiveservices-vision-computervision/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Microsoft Azure SDK for Python

This is the Microsoft Azure Cognitive Services Computer Vision Client Library.

This package has been tested with Python 2.7, 3.4, 3.5 and 3.6.
This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7.

For a more complete set of Azure libraries, see the `azure <https://pypi.python.org/pypi/azure>`__ bundle package.

Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__import__('pkg_resources').declare_namespace(__name__)
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__import__('pkg_resources').declare_namespace(__name__)
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__import__('pkg_resources').declare_namespace(__name__)
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,13 @@ def list_models(

# Construct headers
header_parameters = {}
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
header_parameters['Accept'] = 'application/json'
if custom_headers:
header_parameters.update(custom_headers)

# Construct and send request
request = self._client.get(url, query_parameters)
response = self._client.send(request, header_parameters, stream=False, **operation_config)
request = self._client.get(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)

if response.status_code not in [200]:
raise models.ComputerVisionErrorException(self._deserialize, response)
Expand Down Expand Up @@ -195,6 +195,7 @@ def analyze_image(

# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if custom_headers:
header_parameters.update(custom_headers)
Expand All @@ -203,9 +204,8 @@ def analyze_image(
body_content = self._serialize.body(image_url, 'ImageUrl')

# Construct and send request
request = self._client.post(url, query_parameters)
response = self._client.send(
request, header_parameters, body_content, stream=False, **operation_config)
request = self._client.post(url, query_parameters, header_parameters, body_content)
response = self._client.send(request, stream=False, **operation_config)

if response.status_code not in [200]:
raise models.ComputerVisionErrorException(self._deserialize, response)
Expand Down Expand Up @@ -276,6 +276,7 @@ def generate_thumbnail(

# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/octet-stream'
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if custom_headers:
header_parameters.update(custom_headers)
Expand All @@ -284,9 +285,8 @@ def generate_thumbnail(
body_content = self._serialize.body(image_url, 'ImageUrl')

# Construct and send request
request = self._client.post(url, query_parameters)
response = self._client.send(
request, header_parameters, body_content, stream=True, **operation_config)
request = self._client.post(url, query_parameters, header_parameters, body_content)
response = self._client.send(request, stream=True, **operation_config)

if response.status_code not in [200]:
raise HttpOperationError(self._deserialize, response)
Expand Down Expand Up @@ -356,6 +356,7 @@ def recognize_printed_text(

# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if custom_headers:
header_parameters.update(custom_headers)
Expand All @@ -364,9 +365,8 @@ def recognize_printed_text(
body_content = self._serialize.body(image_url, 'ImageUrl')

# Construct and send request
request = self._client.post(url, query_parameters)
response = self._client.send(
request, header_parameters, body_content, stream=False, **operation_config)
request = self._client.post(url, query_parameters, header_parameters, body_content)
response = self._client.send(request, stream=False, **operation_config)

if response.status_code not in [200]:
raise models.ComputerVisionErrorException(self._deserialize, response)
Expand Down Expand Up @@ -436,6 +436,7 @@ def describe_image(

# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if custom_headers:
header_parameters.update(custom_headers)
Expand All @@ -444,9 +445,8 @@ def describe_image(
body_content = self._serialize.body(image_url, 'ImageUrl')

# Construct and send request
request = self._client.post(url, query_parameters)
response = self._client.send(
request, header_parameters, body_content, stream=False, **operation_config)
request = self._client.post(url, query_parameters, header_parameters, body_content)
response = self._client.send(request, stream=False, **operation_config)

if response.status_code not in [200]:
raise models.ComputerVisionErrorException(self._deserialize, response)
Expand Down Expand Up @@ -510,6 +510,7 @@ def tag_image(

# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if custom_headers:
header_parameters.update(custom_headers)
Expand All @@ -518,9 +519,8 @@ def tag_image(
body_content = self._serialize.body(image_url, 'ImageUrl')

# Construct and send request
request = self._client.post(url, query_parameters)
response = self._client.send(
request, header_parameters, body_content, stream=False, **operation_config)
request = self._client.post(url, query_parameters, header_parameters, body_content)
response = self._client.send(request, stream=False, **operation_config)

if response.status_code not in [200]:
raise models.ComputerVisionErrorException(self._deserialize, response)
Expand Down Expand Up @@ -587,6 +587,7 @@ def analyze_image_by_domain(

# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if custom_headers:
header_parameters.update(custom_headers)
Expand All @@ -595,9 +596,8 @@ def analyze_image_by_domain(
body_content = self._serialize.body(image_url, 'ImageUrl')

# Construct and send request
request = self._client.post(url, query_parameters)
response = self._client.send(
request, header_parameters, body_content, stream=False, **operation_config)
request = self._client.post(url, query_parameters, header_parameters, body_content)
response = self._client.send(request, stream=False, **operation_config)

if response.status_code not in [200]:
raise models.ComputerVisionErrorException(self._deserialize, response)
Expand Down Expand Up @@ -660,9 +660,8 @@ def recognize_text(
body_content = self._serialize.body(image_url, 'ImageUrl')

# Construct and send request
request = self._client.post(url, query_parameters)
response = self._client.send(
request, header_parameters, body_content, stream=False, **operation_config)
request = self._client.post(url, query_parameters, header_parameters, body_content)
response = self._client.send(request, stream=False, **operation_config)

if response.status_code not in [202]:
raise models.ComputerVisionErrorException(self._deserialize, response)
Expand Down Expand Up @@ -709,13 +708,13 @@ def get_text_operation_result(

# Construct headers
header_parameters = {}
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
header_parameters['Accept'] = 'application/json'
if custom_headers:
header_parameters.update(custom_headers)

# Construct and send request
request = self._client.get(url, query_parameters)
response = self._client.send(request, header_parameters, stream=False, **operation_config)
request = self._client.get(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)

if response.status_code not in [200]:
raise models.ComputerVisionErrorException(self._deserialize, response)
Expand Down Expand Up @@ -800,6 +799,7 @@ def analyze_image_in_stream(

# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
header_parameters['Content-Type'] = 'application/octet-stream'
if custom_headers:
header_parameters.update(custom_headers)
Expand All @@ -808,9 +808,8 @@ def analyze_image_in_stream(
body_content = self._client.stream_upload(image, callback)

# Construct and send request
request = self._client.post(url, query_parameters)
response = self._client.send(
request, header_parameters, body_content, stream=False, **operation_config)
request = self._client.post(url, query_parameters, header_parameters, body_content)
response = self._client.send(request, stream=False, **operation_config)

if response.status_code not in [200]:
raise models.ComputerVisionErrorException(self._deserialize, response)
Expand Down Expand Up @@ -879,6 +878,7 @@ def generate_thumbnail_in_stream(

# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/octet-stream'
header_parameters['Content-Type'] = 'application/octet-stream'
if custom_headers:
header_parameters.update(custom_headers)
Expand All @@ -887,9 +887,8 @@ def generate_thumbnail_in_stream(
body_content = self._client.stream_upload(image, callback)

# Construct and send request
request = self._client.post(url, query_parameters)
response = self._client.send(
request, header_parameters, body_content, stream=True, **operation_config)
request = self._client.post(url, query_parameters, header_parameters, body_content)
response = self._client.send(request, stream=True, **operation_config)

if response.status_code not in [200]:
raise HttpOperationError(self._deserialize, response)
Expand Down Expand Up @@ -962,6 +961,7 @@ def recognize_printed_text_in_stream(

# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
header_parameters['Content-Type'] = 'application/octet-stream'
if custom_headers:
header_parameters.update(custom_headers)
Expand All @@ -970,9 +970,8 @@ def recognize_printed_text_in_stream(
body_content = self._client.stream_upload(image, callback)

# Construct and send request
request = self._client.post(url, query_parameters)
response = self._client.send(
request, header_parameters, body_content, stream=False, **operation_config)
request = self._client.post(url, query_parameters, header_parameters, body_content)
response = self._client.send(request, stream=False, **operation_config)

if response.status_code not in [200]:
raise models.ComputerVisionErrorException(self._deserialize, response)
Expand Down Expand Up @@ -1045,6 +1044,7 @@ def describe_image_in_stream(

# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
header_parameters['Content-Type'] = 'application/octet-stream'
if custom_headers:
header_parameters.update(custom_headers)
Expand All @@ -1053,9 +1053,8 @@ def describe_image_in_stream(
body_content = self._client.stream_upload(image, callback)

# Construct and send request
request = self._client.post(url, query_parameters)
response = self._client.send(
request, header_parameters, body_content, stream=False, **operation_config)
request = self._client.post(url, query_parameters, header_parameters, body_content)
response = self._client.send(request, stream=False, **operation_config)

if response.status_code not in [200]:
raise models.ComputerVisionErrorException(self._deserialize, response)
Expand Down Expand Up @@ -1122,6 +1121,7 @@ def tag_image_in_stream(

# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
header_parameters['Content-Type'] = 'application/octet-stream'
if custom_headers:
header_parameters.update(custom_headers)
Expand All @@ -1130,9 +1130,8 @@ def tag_image_in_stream(
body_content = self._client.stream_upload(image, callback)

# Construct and send request
request = self._client.post(url, query_parameters)
response = self._client.send(
request, header_parameters, body_content, stream=False, **operation_config)
request = self._client.post(url, query_parameters, header_parameters, body_content)
response = self._client.send(request, stream=False, **operation_config)

if response.status_code not in [200]:
raise models.ComputerVisionErrorException(self._deserialize, response)
Expand Down Expand Up @@ -1202,6 +1201,7 @@ def analyze_image_by_domain_in_stream(

# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
header_parameters['Content-Type'] = 'application/octet-stream'
if custom_headers:
header_parameters.update(custom_headers)
Expand All @@ -1210,9 +1210,8 @@ def analyze_image_by_domain_in_stream(
body_content = self._client.stream_upload(image, callback)

# Construct and send request
request = self._client.post(url, query_parameters)
response = self._client.send(
request, header_parameters, body_content, stream=False, **operation_config)
request = self._client.post(url, query_parameters, header_parameters, body_content)
response = self._client.send(request, stream=False, **operation_config)

if response.status_code not in [200]:
raise models.ComputerVisionErrorException(self._deserialize, response)
Expand Down Expand Up @@ -1278,9 +1277,8 @@ def recognize_text_in_stream(
body_content = self._client.stream_upload(image, callback)

# Construct and send request
request = self._client.post(url, query_parameters)
response = self._client.send(
request, header_parameters, body_content, stream=False, **operation_config)
request = self._client.post(url, query_parameters, header_parameters, body_content)
response = self._client.send(request, stream=False, **operation_config)

if response.status_code not in [202]:
raise models.ComputerVisionErrorException(self._deserialize, response)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@
# --------------------------------------------------------------------------

try:
from .word_py3 import Word
from .line_py3 import Line
from .recognition_result_py3 import RecognitionResult
from .text_operation_result_py3 import TextOperationResult
from .face_rectangle_py3 import FaceRectangle
from .celebrities_model_py3 import CelebritiesModel
from .landmarks_model_py3 import LandmarksModel
Expand Down Expand Up @@ -41,11 +37,11 @@
from .tag_result_py3 import TagResult
from .computer_vision_error_py3 import ComputerVisionError, ComputerVisionErrorException
from .image_url_py3 import ImageUrl
from .word_py3 import Word
from .line_py3 import Line
from .recognition_result_py3 import RecognitionResult
from .text_operation_result_py3 import TextOperationResult
except (SyntaxError, ImportError):
from .word import Word
from .line import Line
from .recognition_result import RecognitionResult
from .text_operation_result import TextOperationResult
from .face_rectangle import FaceRectangle
from .celebrities_model import CelebritiesModel
from .landmarks_model import LandmarksModel
Expand Down Expand Up @@ -73,21 +69,21 @@
from .tag_result import TagResult
from .computer_vision_error import ComputerVisionError, ComputerVisionErrorException
from .image_url import ImageUrl
from .word import Word
from .line import Line
from .recognition_result import RecognitionResult
from .text_operation_result import TextOperationResult
from .computer_vision_client_enums import (
TextOperationStatusCodes,
Gender,
ComputerVisionErrorCodes,
TextOperationStatusCodes,
VisualFeatureTypes,
OcrLanguages,
TextRecognitionMode,
Details,
)

__all__ = [
'Word',
'Line',
'RecognitionResult',
'TextOperationResult',
'FaceRectangle',
'CelebritiesModel',
'LandmarksModel',
Expand Down Expand Up @@ -115,9 +111,13 @@
'TagResult',
'ComputerVisionError', 'ComputerVisionErrorException',
'ImageUrl',
'TextOperationStatusCodes',
'Word',
'Line',
'RecognitionResult',
'TextOperationResult',
'Gender',
'ComputerVisionErrorCodes',
'TextOperationStatusCodes',
'VisualFeatureTypes',
'OcrLanguages',
'TextRecognitionMode',
Expand Down
Loading