def lookup_guid_with_wbic(wbic):

    ursi = get_ursi_by_wbic(get_ursi_data_manager().get_ursi_data(), wbic)
    guid = get_ursi_data_manager().get_ursi_data()[ursi]["GUID"]

    if guid == "NONE":
        raise Exception("GUID can't be found for this wtp family")

    return guid
Beispiel #2
0
def lookup_guid_with_wbic(wbic):

    ursi = get_ursi_by_wbic(get_ursi_data_manager().get_ursi_data(), wbic)
    guid = get_ursi_data_manager().get_ursi_data()[ursi]["GUID"]

    if guid == "NONE":
        raise Exception("GUID can't be found for this wtp family")

    return guid
Beispiel #3
0
    def _func_(self, data_list, args=None):

        wbic = data_list[0]
        assert wbic != "", "The wbic passed in has nothing "

        # import ipdb;ipdb.set_trace()

        #ursi_data_manager = UrsiDataManager(temp_data_path, first_time_enter)
        ursi_data_manager = get_ursi_data_manager()
        data_dict = ursi_data_manager.get_ursi_data()
        for ursi, ursi_dict in data_dict.items():
            try:
                if ursi_dict["WBIC"] == wbic:

                    guid = ursi_dict["GUID"]
                    # Check whether the guid is None
                    if guid == "NONE":
                        raise KeyError()
                    else:
                        return guid

            except KeyError as e:
                raise Exception("WBIC or GUID key is not in the information file")

        raise Exception("The WBIC provided can't be found")
Beispiel #4
0
def get_ursi_by_wbic(wbic):
    for ursi, ursi_dict in get_ursi_data_manager().get_ursi_data().items():
        try:
            if ursi_dict["WBIC"] == wbic:
                return ursi
        except KeyError as e:
            raise Exception("WBIC or URSI key is not in the information file")
    def _func_(self, data_list, args=None):
        print('finding the gender')
        ursi = self.convert_tag_to_ursi(data_list)
        assert ursi != '', 'No ursi has been passed'

        ursi_data_manager = get_ursi_data_manager()
        data_dict = ursi_data_manager.get_ursi_data()
        gender = data_dict[ursi]["gender"]
        return gender
    def _func_(self, data_list, args=None):
        print('finding the gender')
        ursi = self.convert_tag_to_ursi(data_list)
        assert ursi != '', 'No ursi has been passed'

        ursi_data_manager = get_ursi_data_manager()
        data_dict = ursi_data_manager.get_ursi_data()
        gender = data_dict[ursi]["gender"]
        return gender
Beispiel #7
0
    def _func_(self, data_list, args=None):
        print('finding the gender')
        ursi = data_list[0]
        assert ursi != '', 'No ursi has been passed'

        #ursi_data_manager = UrsiDataManager(temp_data_path, first_time_enter)
        ursi_data_manager = get_ursi_data_manager()
        data_dict = ursi_data_manager.get_ursi_data()
        gender = data_dict[ursi]["gender"]
        return gender
Beispiel #8
0
    def _func_(self, data_list, args=None):
        print('finding the gender')
        ursi = data_list[0]
        assert ursi != '', 'No ursi has been passed'

        #ursi_data_manager = UrsiDataManager(temp_data_path, first_time_enter)
        ursi_data_manager = get_ursi_data_manager()
        data_dict = ursi_data_manager.get_ursi_data()
        gender = data_dict[ursi]["gender"]
        return gender
Beispiel #9
0
def findBirthdateByWBIC(wbic, args= None):
    DOB_dateformat = "%m/%d/%Y"
    #ursi_data_manager = UrsiDataManager(temp_data_path, first_time_enter)
    ursi_data_manager = get_ursi_data_manager()
    data_dict = ursi_data_manager.get_ursi_data()
    ursi = get_ursi_by_wbic(data_dict=data_dict, wbic=wbic)
    assert ursi != '', 'No ursi has been passed'

    birth_date = data_dict[ursi]['birth_date']
    DOB_date = datetime.strptime(birth_date, DOB_dateformat)
    return DOB_date
Beispiel #10
0
def findBirthdateByWBIC(wbic, args=None):
    DOB_dateformat = "%m/%d/%Y"
    #ursi_data_manager = UrsiDataManager(temp_data_path, first_time_enter)
    ursi_data_manager = get_ursi_data_manager()
    data_dict = ursi_data_manager.get_ursi_data()
    ursi = get_ursi_by_wbic(data_dict=data_dict, wbic=wbic)
    assert ursi != '', 'No ursi has been passed'

    birth_date = data_dict[ursi]['birth_date']
    DOB_date = datetime.strptime(birth_date, DOB_dateformat)
    return DOB_date
Beispiel #11
0
    def _func_(self, data_list, args=None):
        print('finding the gender')
        wcib = data_list[0]
        #ursi_data_manager = UrsiDataManager(temp_data_path, first_time_enter)
        ursi_data_manager = get_ursi_data_manager()
        data_dict = ursi_data_manager.get_ursi_data()

        # convert wcib to ursi, use that as a key
        ursi = get_ursi_by_wbic(data_dict, wcib)
        assert ursi != '', 'No ursi has been passed'

        gender = data_dict[ursi]["gender"]
        return gender
Beispiel #12
0
    def _func_(self, data_list, args=None):
        print('finding the gender')
        wcib = data_list[0]
        #ursi_data_manager = UrsiDataManager(temp_data_path, first_time_enter)
        ursi_data_manager = get_ursi_data_manager()
        data_dict = ursi_data_manager.get_ursi_data()

        # convert wcib to ursi, use that as a key
        ursi = get_ursi_by_wbic(data_dict, wcib)
        assert ursi != '', 'No ursi has been passed'


        gender = data_dict[ursi]["gender"]
        return gender
    def find_birthdate(self, ursi, args=None):
        """
            This function is called in the coins2ndar load_function().
            It will return a datetime object.
        """
        DOB_dateformat = "%m/%d/%Y"

        ursi_data_manager = get_ursi_data_manager()
        data_dict = ursi_data_manager.get_ursi_data()
        assert ursi != '', 'No ursi has been passed'

        birth_date = data_dict[ursi]['birth_date']
        DOB_date = datetime.strptime(birth_date, DOB_dateformat)

        return DOB_date
    def find_birthdate(self, ursi, args=None):
        """
            This function is called in the coins2ndar load_function().
            It will return a datetime object.
        """
        DOB_dateformat = "%m/%d/%Y"

        ursi_data_manager = get_ursi_data_manager()
        data_dict = ursi_data_manager.get_ursi_data()
        assert ursi != '', 'No ursi has been passed'

        birth_date = data_dict[ursi]['birth_date']
        DOB_date = datetime.strptime(birth_date, DOB_dateformat)

        return DOB_date
Beispiel #15
0
def findBirthdate(ursi, args=None):
    """
        This function is called in the coins2ndar load_function().
        It will return a datetime object.
    """
    DOB_dateformat = "%m/%d/%Y"
    #ursi_data_manager = UrsiDataManager(temp_data_path,first_time_enter)
    ursi_data_manager = get_ursi_data_manager()
    data_dict = ursi_data_manager.get_ursi_data()
    assert ursi != '', 'No ursi has been passed'

    birth_date = data_dict[ursi]['birth_date']
    DOB_date = datetime.strptime(birth_date, DOB_dateformat)

    return DOB_date
Beispiel #16
0
    def _func_(self, data_list, args=None):
        data_dict = ''
        GUID = ''
        ursi = data_list[0]

        #ursi_data_manager = UrsiDataManager(temp_data_path, first_time_enter)
        ursi_data_manager = get_ursi_data_manager()
        data_dict = ursi_data_manager.get_ursi_data()

        assert ursi != '', 'No ursi has been passed'
        GUID = data_dict[ursi]['GUID']
        if GUID == "NONE":
            raise Exception(('No guid found ' 'matching ursi %s') % ursi)

        return GUID
Beispiel #17
0
    def _func_(self, data_list, args=None):
        # given wbic I can get ursi

        # The first element is considered as ursi.
        wbic = data_list[0]

        for ursi, ursi_dict in get_ursi_data_manager().get_ursi_data().items():
            try:
                if ursi_dict["WBIC"] == wbic:
                    return ursi
            except KeyError as e:
                raise Exception("WBIC or URSI key is not in the information file")

        # how to deal with data not found? Raise exception that will drop the row or return null?
        return None
Beispiel #18
0
def findBirthdate(ursi, args=None):
    """
        This function is called in the coins2ndar load_function().
        It will return a datetime object.
    """
    DOB_dateformat = "%m/%d/%Y"
    #ursi_data_manager = UrsiDataManager(temp_data_path,first_time_enter)
    ursi_data_manager = get_ursi_data_manager()
    data_dict = ursi_data_manager.get_ursi_data()
    assert ursi != '', 'No ursi has been passed'

    birth_date = data_dict[ursi]['birth_date']
    DOB_date = datetime.strptime(birth_date, DOB_dateformat)

    return DOB_date
Beispiel #19
0
    def _func_(self, data_list, args=None):
        # given wbic I can get ursi

        # The first element is considered as ursi.
        wbic = data_list[0]

        for ursi, ursi_dict in get_ursi_data_manager().get_ursi_data().items():
            try:
                if ursi_dict["WBIC"] == wbic:
                    return ursi
            except KeyError as e:
                raise Exception(
                    "WBIC or URSI key is not in the information file")

        # how to deal with data not found? Raise exception that will drop the row or return null?
        return None
Beispiel #20
0
    def _func_(self, data_list, args=None):
        data_dict = ''
        GUID = ''
        ursi = data_list[0]

        #ursi_data_manager = UrsiDataManager(temp_data_path, first_time_enter)
        ursi_data_manager = get_ursi_data_manager()
        data_dict = ursi_data_manager.get_ursi_data()

        assert ursi != '', 'No ursi has been passed'
        GUID = data_dict[ursi]['GUID']
        if GUID == "NONE":
            raise Exception(('No guid found '
                                 'matching ursi %s') % ursi)

        return GUID
Beispiel #21
0
    def _func_(self, data_list, args=None):

        wbic = data_list[0]
        assert wbic != "", "The wbic passed in has nothing "

        #ursi_data_manager = UrsiDataManager(temp_data_path, first_time_enter)
        ursi_data_manager = get_ursi_data_manager()
        data_dict = ursi_data_manager.get_ursi_data()
        for ursi, ursi_dict in data_dict.items():
            try:
                if ursi_dict["WBIC"] == wbic:

                    guid = ursi_dict["GUID"]
                    # Check whether the guid is None
                    if guid == "NONE":
                        raise KeyError()
                    else:
                        return guid

            except KeyError as e:
                raise Exception(
                    "WBIC or GUID key is not in the information file")

        raise Exception("The WBIC provided can't be found")