:calls: `GET /repos/:owner/:repo/git/blobs/:sha <http://developer.github.com/v3/git/blobs>`_
        :param sha: string
        :rtype: :class:`github.GitBlob.GitBlob`
971331
def get_git_blob(self, sha):
        
        assert isinstance(sha, (str, unicode)), sha
        headers, data = self._requester.requestJsonAndCheck(
            "GET",
            self.url + "/git/blobs/" + sha
        )
        return github.GitBlob.GitBlob(self._requester, headers, data, completed=True)
1227985
def tag(self, sha):
        
        json = None
        if sha:
            url = self._build_url('git', 'tags', sha, base_url=self._api)
            json = self._json(self._get(url), 200)
        return Tag(json) if json else None
536333
def get(self, file):
        
        uri = "{api}/repos/{origin}/contents/{path}".format(
            api=self.github_api_url,
            origin=self.origin,
            path=file.path
        )
        params = {
            "ref": file.branch
        }
        data = self.request("GET", uri, params=params)
        # We update the file blob because it exists and we need it for update
        if data.status_code == 200:
            data = json.loads(data.content.decode("utf-8"))
            file.blob = data["sha"]
        elif data.status_code == 404:
            pass
        else:
            decoded_data = json.loads(data.content.decode("utf-8"))
            return self.ProxyError(
                data.status_code, (decoded_data, "message"),
                step="get", context={
                    "uri": uri,
                    "params": params
                }
            )
        return file
508230
function _getSHA(id, callback) {
        repo.contents("").fetch({
            ref: options.branch
        }, function(err, res) {
            if (err) return callback(err);
            var sha = res.reduce(function(previousValue, item) {
                return item.name === id ? item.sha : previousValue;
            }, "");
            callback(err, sha);
        });
    }
887151
def git_hash():
    """"""
    if git_repo() is None:
        return "unknown"
    git_hash = subprocess.check_output(
        ["git", "rev-parse", "HEAD"])
    # git_hash is a byte string; we want a string.
    git_hash = git_hash.decode("utf-8")
    # git_hash also comes with an extra \n at the end, which we remove.
    git_hash = git_hash.strip()
    return git_hash
44003
def run
      if ref.nil?
        puts "That is not a valid shard reference."
        return
      end

      if Shard::Credentials.saved? && Shard::Credentials.valid?
        fork_shard
      else
        puts "You are not currently logged into Github."
        Shard::CLI::Config.run

        if Shard::Credentials.saved?
          run
        end
      end
    end
576395
def get_short_sha(self) -> str:
        
        short_sha: str = self.get_sha()[:7]
        LOGGER.debug('short SHA: %s', short_sha)
        return short_sha
439151
def remote_differs?
      remote_sha = nil
      current_sha = nil
      git_repo = git_repo_for(@repo_dir)
      without_size_limit(git_repo) do
        do_fetch(git_repo)
        revision = resolve_revision
        remote_name = validate_revision(git_repo, revision)
        remote_sha = git_repo.sha_for(remote_name ? remote_name : revision)
        current_sha = git_repo.sha_for(nil)
      end
      current_sha != remote_sha
    end
806181
def run(username)
      lister = Shard::Lister.new(username)

      if lister.shards.any?
        puts "Shards for Github user #{ username }:"
        puts

        lister.shard_names.each do |name|
          shard = lister.shards[name]
          puts "#{ name }:"
          puts "  Description | #{ shard.description }"
          puts "  URL         | #{ shard.url }"
          puts
        end
      else
        puts "Github user #{ username } does not have any shards."
        puts "Shards are gists that have a file named shard.rb or <foo>.shard.rb"
      end
    end
1346887
function getFileUrl (repo, path, sha, line) {
  return HOST + "/" + repo + "/src/" + sha + "/" + path + "#cl-" + line;
}
1186025
def sha1(self):
        

        if self._sha1 is None:
            self._sha1 = hashlib.sha1(byte_cls(self['public_key'])).digest()
        return self._sha1
912300
def git_commit(self, sha):
        
        json = {}
        if sha:
            url = self._build_url('git', 'commits', sha, base_url=self._api)
            json = self._json(self._get(url), 200)
        return Commit(json, self) if json else None
1232417
def partial_to_complete_sha_hex(self, partial_hexsha):
        """"""
        try:
            hexsha, typename, size = self._git.get_object_header(partial_hexsha)  # @UnusedVariable
            return hex_to_bin(hexsha)
        except (GitCommandError, ValueError):
            raise BadObject(partial_hexsha)
1086240
def git_hash(blob):
    """"""
    head = str("blob " + str(len(blob)) + "\0").encode("utf-8")
    return sha1(head + blob).hexdigest()
398452
def get_hash(path, cut=0):
    
    code, output = call(path, 'rev-parse', 'HEAD')
    if code > 0:
        return None
    # maybe the string is with a linebreak.
    sha1 = output.strip()
    if cut > 0:
        sha1 = sha1[:7]
    return sha1
452945
def get_revision_sha(self, dest, rev):
        
        # Pass rev to pre-filter the list.
        output = self.run_command(['show-ref', rev], cwd=dest,
                                  show_stdout=False, on_returncode='ignore')
        refs = {}
        for line in output.strip().splitlines():
            try:
                sha, ref = line.split()
            except ValueError:
                # Include the offending line to simplify troubleshooting if
                # this error ever occurs.
                raise ValueError('unexpected show-ref line: {!r}'.format(line))

            refs[ref] = sha

        branch_ref = 'refs/remotes/origin/{}'.format(rev)
        tag_ref = 'refs/tags/{}'.format(rev)

        sha = refs.get(branch_ref)
        if sha is not None:
            return (sha, True)

        sha = refs.get(tag_ref)

        return (sha, False)
1334653
def sha_hash_file(filename):
    
    hash_sha = hashlib.sha1()

    with open(filename, 'rb') as f:
        for chunk in iter(lambda: f.read(1024*1024), b""):
            hash_sha.update(chunk)

    return hash_sha.hexdigest()