Returns a tuple (hash, and commit object)
329016
def last_commit(self) -> Tuple:
        """"""
        from libs.repos import git

        return git.get_last_commit(repo_path=self.path)
1123818
def get_git_tree(self, sha, recursive=github.GithubObject.NotSet):
        
        assert isinstance(sha, (str, unicode)), sha
        assert recursive is github.GithubObject.NotSet or isinstance(recursive, bool), recursive
        url_parameters = dict()
        if recursive is not github.GithubObject.NotSet and recursive:
            # GitHub API requires the recursive parameter be set to 1.
            url_parameters["recursive"] = 1
        headers, data = self._requester.requestJsonAndCheck(
            "GET",
            self.url + "/git/trees/" + sha,
            parameters=url_parameters
        )
        return github.GitTree.GitTree(self._requester, headers, data, completed=True)
172692
def _make_tuple(self, env):
    """"""
    t = runtime.Tuple(self, env, dict2tuple)
    # A tuple also provides its own schema spec
    schema = schema_spec_from_tuple(t)
    t.attach_schema(schema)
    return t
382210
def compute_hash(attributes, ignored_attributes=None):
    
    ignored_attributes = list(ignored_attributes) if ignored_attributes else []
    tuple_attributes = _convert(attributes.copy(), ignored_attributes)
    hasher = hashlib.sha256(str(tuple_attributes).encode('utf-8', errors='ignore'))
    return hasher.hexdigest()
1157607
def omnihash(obj):
    
    if isinstance(obj, set):
        return hash(frozenset(omnihash(e) for e in obj))
    elif isinstance(obj, (tuple, list)):
        return hash(tuple(omnihash(e) for e in obj))
    elif isinstance(obj, dict):
        return hash(frozenset((k, omnihash(v)) for k, v in obj.items()))
    else:
        return hash(obj)
197199
def get_commit(self, commit_id: str) -> Commit:
        
        return Commit(self.repo.commit(commit_id), self.path, self.main_branch)
630989
def make_dict_hash(o):
    
    if isinstance(o, (set, tuple, list)):
        return tuple([make_dict_hash(e) for e in o])
    elif not isinstance(o, dict):
        return hash(o)

    new_o = copy.deepcopy(o)
    for k, v in new_o.items():
        new_o[k] = make_dict_hash(v)

    return hash(tuple(frozenset(sorted(new_o.items()))))
278336
def to_hash
      OPTIONS.inject({}) do |hash, option|
        hash.merge(option.to_sym => send(option))
      end
    end
291307
def get_branch(db, root_hash, key):
    
    validate_is_bytes(key)

    return tuple(_get_branch(db, root_hash, encode_to_bin(key)))
684366
def get_tuple(self):
        """"""
        objType, objInstance = self.value

        if isinstance(objType, int):
            pass
        elif isinstance(objType, long):
            objType = int(objType)
        elif isinstance(objType, basestring):
            # turn it back into an integer
            objType = self.objectTypeClass()[objType]
        else:
            raise TypeError("invalid datatype for objType")

        # pack the components together
        return (objType, objInstance)
755167
def create_securityhash(action_tuples):
    
    from settings import SECRET_KEY

    action_string = "".join(["_%s%s" % a for a in action_tuples])
    security_hash = sha1(action_string + SECRET_KEY).hexdigest()
    return security_hash
1284869
def to_hash
      {
        confirmations: self.confirmations.nil? ? 0 : self.confirmations,
        version: self.version,
        lock_time: self.lock_time,
        hash: self.hex_hash,
        fee: self.fee,
        inputs: self.inputs,
        outputs: self.outputs
      }
    end
1355956
def each # FIXME
      if Hash === @tuple
        @tuple.each { |k, v| yield(k, v) }
      else
        @tuple.each_with_index { |v, k| yield(k, v) }
      end
    end
199116
def delete(tuple)
      key = bin_key(tuple)
      bin = @hash[key]
      return nil unless bin
      bin.delete(tuple)
      @hash.delete(key) if bin.empty?
      tuple
    end
608742
def new_from_sha(cls, repo, sha1):
        
        if sha1 == cls.NULL_BIN_SHA:
            # the NULL binsha is always the root commit
            return get_object_type_by_name(b'commit')(repo, sha1)
        # END handle special case
        oinfo = repo.odb.info(sha1)
        inst = get_object_type_by_name(oinfo.type)(repo, oinfo.binsha)
        inst.size = oinfo.size
        return inst
530969
def match_associations(commit_sha, files)
        new_lines = lines_added(commit_sha)

        files = files.split("\n").group_by { |f| f.split('.').pop }

        associations.each do |ext, related|
          files[ext] ||= []
          related.each do |child|
            next if files[child].blank?

            files[child].each do |c|
              # hack to ignore deleted files
              files[child] = new_lines[c].blank? ? [] : [ filename: File.join(@config.working_dir, c), changes: new_lines[c] ]
            end
            files[ext].concat(files[child])
            files.delete(child)
          end
        end

        files.delete_if { |k,v| v.blank? || k.nil? }
        files
      end
327385
def commit(self, snapshot: Tuple[Hash32, UUID]) -> None:
        
        _, account_snapshot = snapshot
        self._account_db.commit(account_snapshot)