# Path: moonlight/staves/staffline_extractor.py
# DEFAULT_TARGET_HEIGHT = 18
# DEFAULT_NUM_SECTIONS = 19
# DEFAULT_STAFFLINE_DISTANCE_MULTIPLE = 3
#   STAFF = 0
#   POSITION = 1
#   Y = 2
#   X = 3
# class Axes(enum.IntEnum):
# class StafflineExtractor(object):
# class StafflinePatchExtractor(object):
# def get_staffline(y_position, extracted_staff_arr):
# def y_position_to_index(y_position, num_stafflines):
#   def __init__(self,
#                image,
#                staves,
#                target_height=DEFAULT_TARGET_HEIGHT,
#                num_sections=DEFAULT_NUM_SECTIONS,
#                staffline_distance_multiple=DEFAULT_STAFFLINE_DISTANCE_MULTIPLE):
#   def extract_staves(self):
#     def do_extract_staves():
#       def extract_staff(i):
#         def extract_staffline_by_index(j):
#   def _extract_staffline(self, staff_y, staffline_distance, staffline_num):
#   def _get_resized_width(self, staffline_distance):
#   def _get_staffline_window_size(self, staffline_distance):
#   def __init__(self,
#                num_sections=DEFAULT_NUM_SECTIONS,
#                patch_height=15,
#                patch_width=12,
#                run_options=None):
#   def extract_staff_strip(self, filename, staff_index, y_position):
#   def extract_staff_patch(self, filename, staff_index, y_position, image_x):
#   def page_patch_iterator(self, filename):
#     def generator():
#   def make_patch_id(filename, staff_index, y_position, image_x):
# 
# Path: moonlight/training/generation/generation.py
# POSITIVE_EXAMPLES_PER_IMAGE = 3
# def _normalize_path(filename):
#   def __init__(self, num_pages_per_batch, vexflow_generator_command,
#                svg_to_png_command):
#   def process(self, batch_num):
#   def get_pages_for_batch(self, batch_num, num_pages_per_batch):
#   def get_pages(self, seeds):
#   def _svg_to_png(self, svg):
#   def __init__(self,
#                negative_example_distance,
#                patch_width,
#                negative_to_positive_example_ratio,
#                noise_fn=lambda x: x):
#   def start_bundle(self):
#   def process(self, item):
#   def _create_example(self, staffline, x, label):
# class PageGenerationDoFn(beam.DoFn):
# class PatchExampleDoFn(beam.DoFn):


import os.path
import tensorflow as tf
from moonlight.staves import staffline_extractor
from moonlight.training.generation import generation
#     https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Tests for labeled data generation."""

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function




PATCH_WIDTH = 15


class GenerationTest(tf.test.TestCase):

  def testDoFn(self):
    page_gen = generation.PageGenerationDoFn(
        num_pages_per_batch=1,
        vexflow_generator_command=[
            os.path.join(tf.resource_loader.get_data_files_path(),
                         'vexflow_generator')
        ],
        svg_to_png_command=['/usr/bin/env', 'convert', 'svg:-', 'png:-'])
    page_gen.start_bundle()

# Path: moonlight/staves/staffline_extractor.py
# DEFAULT_TARGET_HEIGHT = 18
# DEFAULT_NUM_SECTIONS = 19
# DEFAULT_STAFFLINE_DISTANCE_MULTIPLE = 3
#   STAFF = 0
#   POSITION = 1
#   Y = 2
#   X = 3
# class Axes(enum.IntEnum):
# class StafflineExtractor(object):
# class StafflinePatchExtractor(object):
# def get_staffline(y_position, extracted_staff_arr):
# def y_position_to_index(y_position, num_stafflines):
#   def __init__(self,
#                image,
#                staves,
#                target_height=DEFAULT_TARGET_HEIGHT,
#                num_sections=DEFAULT_NUM_SECTIONS,
#                staffline_distance_multiple=DEFAULT_STAFFLINE_DISTANCE_MULTIPLE):
#   def extract_staves(self):
#     def do_extract_staves():
#       def extract_staff(i):
#         def extract_staffline_by_index(j):
#   def _extract_staffline(self, staff_y, staffline_distance, staffline_num):
#   def _get_resized_width(self, staffline_distance):
#   def _get_staffline_window_size(self, staffline_distance):
#   def __init__(self,
#                num_sections=DEFAULT_NUM_SECTIONS,
#                patch_height=15,
#                patch_width=12,
#                run_options=None):
#   def extract_staff_strip(self, filename, staff_index, y_position):
#   def extract_staff_patch(self, filename, staff_index, y_position, image_x):
#   def page_patch_iterator(self, filename):
#     def generator():
#   def make_patch_id(filename, staff_index, y_position, image_x):
# 
# Path: moonlight/training/generation/generation.py
# POSITIVE_EXAMPLES_PER_IMAGE = 3
# def _normalize_path(filename):
#   def __init__(self, num_pages_per_batch, vexflow_generator_command,
#                svg_to_png_command):
#   def process(self, batch_num):
#   def get_pages_for_batch(self, batch_num, num_pages_per_batch):
#   def get_pages(self, seeds):
#   def _svg_to_png(self, svg):
#   def __init__(self,
#                negative_example_distance,
#                patch_width,
#                negative_to_positive_example_ratio,
#                noise_fn=lambda x: x):
#   def start_bundle(self):
#   def process(self, item):
#   def _create_example(self, staffline, x, label):
# class PageGenerationDoFn(beam.DoFn):
# class PatchExampleDoFn(beam.DoFn):


# Path: moonlight/training/generation/generation_test.py
import os.path
import tensorflow as tf
from moonlight.staves import staffline_extractor
from moonlight.training.generation import generation

#     https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Tests for labeled data generation."""

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function




PATCH_WIDTH = 15


class GenerationTest(tf.test.TestCase):

  def testDoFn(self):
    page_gen = generation.PageGenerationDoFn(
        num_pages_per_batch=1,
        vexflow_generator_command=[
            os.path.join(tf.resource_loader.get_data_files_path(),
                         'vexflow_generator')
        ],
        svg_to_png_command=['/usr/bin/env', 'convert', 'svg:-', 'png:-'])
    page_gen.start_bundle()

    patch_examples = generation.PatchExampleDoFn(