original_docstring: Read from git repository all tags and last commit date.  Put in DB.
docstring: Read from git repository all tags and last commit date.  Put in DB.
docstring_tokens: Read from git repository all tags and last commit date . Put in DB .
code: def populate_git_tag_dates():
      """Read from git repository all tags and last commit date.  Put in DB."""
      tagslist = []
      loginfo = G.log('--tags',
                      '--simplify-by-decoration',
                      '--pretty="format:%ci %d"')
      loginfo = re.findall(r'".+"', loginfo)
      for logentry in loginfo:
          if "tag:" in logentry:
              datepart = re.search(r"format:[0-9\-]+[ ][0-9\:]+[ ][0-9\-+]+",
                                   logentry)
              if datepart is None:
                  datepart = None
              else:
                  datepart = datepart.group(0)
              datepart = datepart.replace("format:", "")
              # Parse date time with UTC offset using dateutil.parser
              datepart = parser.parse(datepart)
              utc = pytz.UTC
              datepart = datepart.replace(tzinfo=utc) - datepart.utcoffset()
              tags = re.search(r'\(.+\)', logentry)
              if tags is None:
                  tags = None
              else:
                  tags = tags.group(0)
              tags = tags.replace("(", "")
              tags = tags.replace(")", "")
              tags = tags.split(',')
              for tag in tags:
                  if "tag:" in tag:
                      tag = tag.replace("tag:", "")
                      tag = tag.strip()
                      tagslist.append({'git_repo': GIT_REPO,
                                       'git_tag': tag,
                                       'git_tag_date': datepart})
      if len(tagslist) == 0:
          # If no tags, append master as the default
          tagslist.append({'git_repo': GIT_REPO,
                           'git_tag': 'master',
                           'git_tag_date': datetime.datetime.now()})
      tagsdf = pd.DataFrame(tagslist)
      tagsdf["git_tag_date"] = tagsdf['git_tag_date'].astype('datetime64')
      tagsdf.to_sql('git_tag_dates',
                    ENGINE,
                    if_exists='append',
                    index=False,
                    chunksize=1000,
                    dtype={'git_repo': sqlalchemy.types.NVARCHAR(length=255),
                           'git_tag': sqlalchemy.types.NVARCHAR(length=255),
                           'git_tag_date': sqlalchemy.types.DateTime()})
      return tagsdf
code_tokens: def populate_git_tag_dates ( ) : tagslist = [ ] loginfo = G . log ( '--tags' , '--simplify-by-decoration' , '--pretty="format:%ci %d"' ) loginfo = re . findall ( r'".+"' , loginfo ) for logentry in loginfo : if "tag:" in logentry : datepart = re . search ( r"format:[0-9\-]+[ ][0-9\:]+[ ][0-9\-+]+" , logentry ) if datepart is None : datepart = None else : datepart = datepart . group ( 0 ) datepart = datepart . replace ( "format:" , "" ) datepart = parser . parse ( datepart ) utc = pytz . UTC datepart = datepart . replace ( tzinfo = utc ) - datepart . utcoffset ( ) tags = re . search ( r'\(.+\)' , logentry ) if tags is None : tags = None else : tags = tags . group ( 0 ) tags = tags . replace ( "(" , "" ) tags = tags . replace ( ")" , "" ) tags = tags . split ( ',' ) for tag in tags : if "tag:" in tag : tag = tag . replace ( "tag:" , "" ) tag = tag . strip ( ) tagslist . append ( { 'git_repo' : GIT_REPO , 'git_tag' : tag , 'git_tag_date' : datepart } ) if len ( tagslist ) == 0 : tagslist . append ( { 'git_repo' : GIT_REPO , 'git_tag' : 'master' , 'git_tag_date' : datetime . datetime . now ( ) } ) tagsdf = pd . DataFrame ( tagslist ) tagsdf [ "git_tag_date" ] = tagsdf [ 'git_tag_date' ] . astype ( 'datetime64' ) tagsdf . to_sql ( 'git_tag_dates' , ENGINE , if_exists = 'append' , index = False , chunksize = 1000 , dtype = { 'git_repo' : sqlalchemy . types . NVARCHAR ( length = 255 ) , 'git_tag' : sqlalchemy . types . NVARCHAR ( length = 255 ) , 'git_tag_date' : sqlalchemy . types . DateTime ( ) } ) return tagsdf
short_docstring: Read from git repository all tags and last commit date.
short_docstring_tokens: Read from git repository all tags and last commit date .
comment: """Read from git repository all tags and last commit date.  Put in DB."""$SEP$# Parse date time with UTC offset using dateutil.parser$SEP$# If no tags, append master as the default