Example #1
0
def main():
    res = Run()
        absolute_overlap_sizes.append(len(graph_lexicals & text_lexicals))
        relative_overlap_sizes.append(
            len(graph_lexicals & text_lexicals) / len(text_lexicals)
        )

    print(
        "Avg absolute overlap size: {:.1f}\nStdev: {:.1f}\nMax: {}\nMin: {}".format(
            np.mean(absolute_overlap_sizes), np.std(absolute_overlap_sizes),
            max(absolute_overlap_sizes), min(absolute_overlap_sizes)
        )
    )
    print(
        "Avg relative overlap size: {:.3f}\nStdev: {:.3f}\nMax: {}\nMin: {}".format(
            np.mean(relative_overlap_sizes), np.std(relative_overlap_sizes),
            max(relative_overlap_sizes), min(relative_overlap_sizes)
        )
    )
    print(
        "{} ({:.1f}%) samples with 100% overlap\n{} ({:.1f}%) samples with 0% overlap".format(
            relative_overlap_sizes.count(1.0),
            relative_overlap_sizes.count(
                1.0) / len(relative_overlap_sizes) * 100,
            absolute_overlap_sizes.count(0),
            absolute_overlap_sizes.count(0) / len(absolute_overlap_sizes) * 100
        )
    )


if __name__ == "__main__":
    Run()
Example #3
0
@command()
def another_simple_greet(name):
    """An example of @command() without arguments.

  Arguments:
    name - Name to greet.
  """
    print 'Aloha %s!' % name


def some_decorator(fn):
    @wraps(fn)
    def _wrapper(*args, **kwargs):
        print 'Wrapper Here!'
        return fn(*args, **kwargs)

    return _wrapper


@command('test_decorated')
@some_decorator
def DecoratedFunction(arg1, arg2=1):
    """An example usage of stacked decorators."""
    print arg1, arg2


if __name__ == '__main__':
    Run(hyphenate=True)

########NEW FILE########
Example #4
0
def main():
    Run()
Example #5
0
def run():
    Run()
Example #6
0
def entry():
    SetOptions(main='main')
    Run()