<commit_before>;;; github.el -*- lexical-binding: t -*-

(require 'seq)

(cl-defun vendle:source-site-github-p (source)
  (cond
    ((string-match (rx "github:" (submatch (+ (not (in "/")))
                                           "/"
                                           (+ (not (in "/")))))
                   source)
     t)
    ((string-match (rx   line-start
                         (one-or-more (not (in "/")))
                         "/"
                         (one-or-more (not (in "/")))
                         line-end)
                   source)
     t)
    (t nil)))

(cl-defun vendle:source-site-format-github (source)
  (cond
    ((string-match (rx "github:" (submatch (+ (not (in "/")))
                                           "/"
                                           (+ (not (in "/")))))
                   source)
     (match-string-no-properties 1 source))
    ((string-match (rx   line-start
                         (one-or-more (not (in "/")))
                         "/"
                         (one-or-more (not (in "/")))
                         line-end)
                   source)
     (match-string-no-properties 0 source))))

(cl-defun vendle:make-package-github (source option)
  (cl-letf ((name (vendle:make-package-name-github source option))
            (path (vendle:make-package-path-github source option))
            (lpath (vendle:make-package-load-path-github source option))
            (origin (vendle:make-package-origin-github source option)))
    (make-instance 'vendle:<package>
                   :type 'git
                   :site "github"
                   :name name
                   :path path
                   :load-path lpath
                   :url (cl-concatenate 'string "<EMAIL>:" source)
                   :compile (cl-getf option :compile t)
                   :dependency (cl-getf option :depends nil)
                   :build (cl-getf option :build nil)
                   :info (cl-getf option :info nil)
                   :origin origin
                   :tag (cl-getf option :tag nil)
                   :desc (cl-getf option :desc "")
                   :recursive (cl-getf option :recursive))))

(cl-defun vendle:make-package-name-github (source option)
  (if option
      (cl-letf ((name (cl-getf option :name)))
        (if name
            name
          (cl-second (split-string source "/"))))
    (cl-second (split-string source "/"))))

(cl-defun vendle:make-package-load-path-github (source option)
  (cl-letf ((path (cl-getf option :load-path nil))
            (origin (vendle:make-package-origin-github source option)))
    (if path
        (if (listp path)
            (seq-map
             (lambda (p)
               (vendle:concat-path vendle-directory origin p))<commit_msg>* vendle/source/github.el: use seq-concatenate<commit_after>;;; github.el -*- lexical-binding: t -*-

(require 'seq)

(cl-defun vendle:source-site-github-p (source)
  (cond
    ((string-match (rx "github:" (submatch (+ (not (in "/")))
                                           "/"
                                           (+ (not (in "/")))))
                   source)
     t)
    ((string-match (rx   line-start
                         (one-or-more (not (in "/")))
                         "/"
                         (one-or-more (not (in "/")))
                         line-end)
                   source)
     t)
    (t nil)))

(cl-defun vendle:source-site-format-github (source)
  (cond
    ((string-match (rx "github:" (submatch (+ (not (in "/")))
                                           "/"
                                           (+ (not (in "/")))))
                   source)
     (match-string-no-properties 1 source))
    ((string-match (rx   line-start
                         (one-or-more (not (in "/")))
                         "/"
                         (one-or-more (not (in "/")))
                         line-end)
                   source)
     (match-string-no-properties 0 source))))

(cl-defun vendle:make-package-github (source option)
  (cl-letf ((name (vendle:make-package-name-github source option))
            (path (vendle:make-package-path-github source option))
            (lpath (vendle:make-package-load-path-github source option))
            (origin (vendle:make-package-origin-github source option)))
    (make-instance 'vendle:<package>
                   :type 'git
                   :site "github"
                   :name name
                   :path path
                   :load-path lpath
                   :url (seq-concatenate 'string "git@github.com:" source)
                   :compile (cl-getf option :compile t)
                   :dependency (cl-getf option :depends nil)
                   :build (cl-getf option :build nil)
                   :info (cl-getf option :info nil)
                   :origin origin
                   :tag (cl-getf option :tag nil)
                   :desc (cl-getf option :desc "")
                   :recursive (cl-getf option :recursive))))

(cl-defun vendle:make-package-name-github (source option)
  (if option
      (cl-letf ((name (cl-getf option :name)))
        (if name
            name
          (cl-second (split-string source "/"))))
    (cl-second (split-string source "/"))))

(cl-defun vendle:make-package-load-path-github (source option)
  (cl-letf ((path (cl-getf option :load-path nil))
            (origin (vendle:make-package-origin-github source option)))
    (if path
        (if (listp path)
            (seq-map
             (lambda (p)
               (vendle:concat-path vendle-directory origin p))
{'fraction_non_alphanumeric': 0.1382012466607302, 'fraction_numerical': 0.0007123775601068567, 'mean_word_length': 1.289441500203832, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 16, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6055651', 'n_tokens_mistral': 1606, 'n_tokens_neox': 1541, 'n_words': 368}