<commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# #############################################################################
# AUTHOR: <NAME>                                                       #
# EMAIL: <EMAIL>                                                      #
# VERSION: 0.0.5                                                              #
# DESCRIPTION: Upload images to the cloud using Openstack API                 #
# ##############################################################################
from clouds import *
from pyglancepush.delete import delete_image
import keystoneclient.v2_0.client as ksclient
import novaclient.v1_1.client as nvclient
import novaclient.exceptions
import logging
import json
import glanceclient
from sys import exit
from os import environ

__author__ = "<NAME>"
__license__ = "MIT"
__maintainer__ = "<NAME>"
__email__ = "<EMAIL>"
__status__ = "Development"


def publish_image(image_file, image_name, image_format, container_format, is_public, is_protected, properties_dict):
    """
    Publish image into quarantine area
    :param image_file: Location in the filesystem of the image to be uploaded to Glance
    :param image_name: Name of the image
    :param image_format: Format of the image (usually QCOW2)
    :param container_format: Format of the container (usually bare)
    :param properties_dict: A dictionary which contains all properties from meta_file
    :return: None
    """
    logger = logging.getLogger('glancepush')
    if environ['OS_IS_SECURE'] == "True":
        is_secure = True
    else:
        is_secure = False

    if is_public == "\"yes\"":
        public = True
    else:
        public = False

    if is_protected == "\"yes\"":
        protect_image = True
    else:
        protect_image = False
    # Before doing anything else, check if this image is associated with current VO
    File_Open = False
    skip_image = False<commit_msg>* Upload was referenced before assigment<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# #############################################################################
# AUTHOR: <NAME>                                                       #
# EMAIL: <EMAIL>                                                      #
# VERSION: 0.0.5                                                              #
# DESCRIPTION: Upload images to the cloud using Openstack API                 #
# ##############################################################################
from clouds import *
from pyglancepush.delete import delete_image
import keystoneclient.v2_0.client as ksclient
import novaclient.v1_1.client as nvclient
import novaclient.exceptions
import logging
import json
import glanceclient
from sys import exit
from os import environ

__author__ = "<NAME>"
__license__ = "MIT"
__maintainer__ = "<NAME>"
__email__ = "<EMAIL>"
__status__ = "Development"


def publish_image(image_file, image_name, image_format, container_format, is_public, is_protected, properties_dict):
    """
    Publish image into quarantine area
    :param image_file: Location in the filesystem of the image to be uploaded to Glance
    :param image_name: Name of the image
    :param image_format: Format of the image (usually QCOW2)
    :param container_format: Format of the container (usually bare)
    :param properties_dict: A dictionary which contains all properties from meta_file
    :return: None
    """
    logger = logging.getLogger('glancepush')
    if environ['OS_IS_SECURE'] == "True":
        is_secure = True
    else:
        is_secure = False

    if is_public == "\"yes\"":
        public = True
    else:
        public = False

    if is_protected == "\"yes\"":
        protect_image = True
    else:
        protect_image = False
    # Before doing anything else, check if this image is associated with current VO
    File_Open = False
    skip_image = False
    upload = False
{'fraction_non_alphanumeric': 0.15227388860500765, 'fraction_numerical': 0.004598875830352581, 'mean_word_length': 2.628359592215014, 'pattern_counts': {'":': 6, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 14, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6577193', 'n_tokens_mistral': 1017, 'n_tokens_neox': 979, 'n_words': 334}