<commit_before>#!/usr/bin/env python
# PYTHON_ARGCOMPLETE_OK
import argh, json
from argh import arg
import client.swagger
from client.BuildconfigurationsApi import BuildconfigurationsApi
from client.LicensesApi import LicensesApi
from client.ProductsApi import ProductsApi
from client.ProjectsApi import ProjectsApi
from client.models.Configuration import Configuration
from client.models.License import License
import client.models.Product
from client.EnvironmentsApi import EnvironmentsApi
from client.models.Environment import Environment

from pnc_help_formatter import PNCFormatter

#TODO: load this from a config file
base_pnc_url = "http://localhost:8080/pnc-rest/rest"
apiclient = client.swagger.ApiClient(base_pnc_url)

def _create_product_object(name, description, abbreviation, product_code, system_code):
    """
    Create an instance of the Product object
    :param name:
    :param description:
    :param abbreviation:
    :param product_code:
    :param system_code:
    :return: new Product instance
    """
    created_product = client.models.Product.Product()
    created_product.name = name
    #TODO: better way to do this?
    if description: created_product.description = description
    if abbreviation: created_product.abbreviation = abbreviation
    if product_code: created_product.productCode = product_code
    if system_code: created_product.pgmSystemName = system_code
    return created_product

#TODO: Error checking configuration_ids is necessary, since it must consist of a list of valid build_configuration ids
def _create_project_object(name, description, configuration_ids, issue_url, project_url, license_id):<commit_msg>udpate the project creation function with better parameter names consistent with use elsewhere<commit_after>#!/usr/bin/env python
# PYTHON_ARGCOMPLETE_OK
import argh, json
from argh import arg
import client.swagger
from client.BuildconfigurationsApi import BuildconfigurationsApi
from client.LicensesApi import LicensesApi
from client.ProductsApi import ProductsApi
from client.ProjectsApi import ProjectsApi
from client.models.Configuration import Configuration
from client.models.License import License
import client.models.Product
from client.EnvironmentsApi import EnvironmentsApi
from client.models.Environment import Environment

from pnc_help_formatter import PNCFormatter

#TODO: load this from a config file
base_pnc_url = "http://localhost:8080/pnc-rest/rest"
apiclient = client.swagger.ApiClient(base_pnc_url)

def _create_product_object(name, description, abbreviation, product_code, system_code):
    """
    Create an instance of the Product object
    :param name:
    :param description:
    :param abbreviation:
    :param product_code:
    :param system_code:
    :return: new Product instance
    """
    created_product = client.models.Product.Product()
    created_product.name = name
    #TODO: better way to do this?
    if description: created_product.description = description
    if abbreviation: created_product.abbreviation = abbreviation
    if product_code: created_product.productCode = product_code
    if system_code: created_product.pgmSystemName = system_code
    return created_product

#TODO: Error checking configuration_ids is necessary, since it must consist of a list of valid build_configuration ids
def _create_project_object(name, description, issue_url, project_url, configuration_ids, license_id):
{'fraction_non_alphanumeric': 0.05873715124816446, 'fraction_numerical': 0.0023494860499265785, 'mean_word_length': 5.537428023032629, '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': '2909830', 'n_tokens_mistral': 943, 'n_tokens_neox': 910, 'n_words': 291}