<commit_before>import argparse
import os
import sys

from .needy import Needy
from .platform import available_platforms


def satisfy(args=[]):
    parser = argparse.ArgumentParser(
        prog='%s satisfy' % os.path.basename(sys.argv[0]),
        description='Satisfies library and universal binary needs.',
        formatter_class=argparse.RawDescriptionHelpFormatter
    )
    parser.add_argument(
        '-t', '--target',
        default='host',
        help='builds needs for this target (example: iphone:armv7)')
    parser.add_argument(
        '-u', '--universal-binary',
        help='builds the universal binary with the given name')
    parser.add_argument(
        '-j', '--concurrency',
        default=1,
        const=0,
        nargs='?',
        type=int,
        help='number of jobs to process concurrently')
    for platform in available_platforms():
        platform.add_arguments(parser)
    parameters = parser.parse_args(args)

    needy = Needy('needs.json', parameters)

    if parameters.universal_binary:
        needy.satisfy_universal_binary(parameters.universal_binary)
    else:
        needy.satisfy_target(needy.target(parameters.target))

    return 0


def cflags(args=[]):
    parser = argparse.ArgumentParser(
        prog='%s cflags' % os.path.basename(sys.argv[0]),
        description='Gets compiler flags required for using the needs.',
        formatter_class=argparse.RawDescriptionHelpFormatter
    )
    parser.add_argument('-t', '--target', default='host', help='gets flags for this target (example: iphone:armv7)')
    parameters = parser.parse_args(args)

    needy = Needy('needs.json', parameters)
    target = needy.target(parameters.target)

    print(' '.join([('-I%s' % path) for path in needy.include_paths(target)]))
    return 0


def ldflags(args=[]):
    parser = argparse.ArgumentParser(
        prog='%s ldflags' % os.path.basename(sys.argv[0]),
        description='Gets linker flags required for using the needs.',
        formatter_class=argparse.RawDescriptionHelpFormatter
    )
    parser.add_argument('-t', '--target', default='host', help='gets flags for this target (example: iphone:armv7)')
    parser.add_argument('-u', '--universal-binary', help='gets flags for this universal binary')
    parameters = parser.parse_args(args)

    needy = Needy('needs.json', parameters)

    print(' '.join([('-L%s' % path) for path in needy.library_paths(parameters.universal_binary if parameters.universal_binary else needy.target(parameters.target))]))<commit_msg>dont print newline for cflags or ldflags<commit_after>from __future__ import print_function

import argparse
import os
import sys

from .needy import Needy
from .platform import available_platforms


def satisfy(args=[]):
    parser = argparse.ArgumentParser(
        prog='%s satisfy' % os.path.basename(sys.argv[0]),
        description='Satisfies library and universal binary needs.',
        formatter_class=argparse.RawDescriptionHelpFormatter
    )
    parser.add_argument(
        '-t', '--target',
        default='host',
        help='builds needs for this target (example: iphone:armv7)')
    parser.add_argument(
        '-u', '--universal-binary',
        help='builds the universal binary with the given name')
    parser.add_argument(
        '-j', '--concurrency',
        default=1,
        const=0,
        nargs='?',
        type=int,
        help='number of jobs to process concurrently')
    for platform in available_platforms():
        platform.add_arguments(parser)
    parameters = parser.parse_args(args)

    needy = Needy('needs.json', parameters)

    if parameters.universal_binary:
        needy.satisfy_universal_binary(parameters.universal_binary)
    else:
        needy.satisfy_target(needy.target(parameters.target))

    return 0


def cflags(args=[]):
    parser = argparse.ArgumentParser(
        prog='%s cflags' % os.path.basename(sys.argv[0]),
        description='Gets compiler flags required for using the needs.',
        formatter_class=argparse.RawDescriptionHelpFormatter
    )
    parser.add_argument('-t', '--target', default='host', help='gets flags for this target (example: iphone:armv7)')
    parameters = parser.parse_args(args)

    needy = Needy('needs.json', parameters)
    target = needy.target(parameters.target)

    print(' '.join([('-I%s' % path) for path in needy.include_paths(target)]), end='')
    return 0


def ldflags(args=[]):
    parser = argparse.ArgumentParser(
        prog='%s ldflags' % os.path.basename(sys.argv[0]),
        description='Gets linker flags required for using the needs.',
        formatter_class=argparse.RawDescriptionHelpFormatter
    )
    parser.add_argument('-t', '--target', default='host', help='gets flags for this target (example: iphone:armv7)')
    parser.add_argument('-u', '--universal-binary', help='gets flags for this universal binary')
    parameters = parser.parse_args(args)

    needy = Needy('needs.json', parameters)

    print(' '.join([('-L%s' % path) for path in needy.library_paths(parameters.universal_binary if parameters.universal_binary else needy.target(parameters.target))]), end='')
{'fraction_non_alphanumeric': 0.12767613857532115, 'fraction_numerical': 0.003892565200467108, 'mean_word_length': 3.515817223198594, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7440884', 'n_tokens_mistral': 1560, 'n_tokens_neox': 1492, 'n_words': 355}