This script removes outputs of a given notebook so that you can load smoothly.
This is from my stackoverflow question. Thanks to "bitoiu". Here is the real thread.
How to pick up a single commit from a remote repo
Assuming you have a local clone of the repo you forked if you type in the following you should get a single origin:
> git show remote origin
Unless you've added the original's repo location, you won't have access to the commit you want to pick into your local one. So we need to add that, let's assume this repo ishttps://github.com/GitbookIO/gitbook.git. Notice this is an HTTPS clone URL because you won't have write access to this repo. Let's name it original_repo:
> git remote add original_repo https://github.com/GitbookIO/gitbook.git
And now let's get all the refs back:
> git fetch origina_repo
At this point you have all you need locally, you'll just need to merge the commit into one of your branches, let's assume your local master.
Find the commit you want to merge. This implies finding it in one of the branches the team used. Could be already merged to master or you could be picking it up from the branch that was used for the pull request. Either way, just run a series of
git log to check what commit you want if you don't know the reference. When you do simply go to the branch where you want to merge the commit to and run:
> git cherry-pick COMMIT_ID
This will bring the commit to whatever branch you are at the moment.
How to merge a branch from a remote repo
The only difference in this steps is that instead of doing the cherry-pick you will be doing a merge. So imagine the contents of the pull request are in a branch named
so-pr, you would simply do:
> git merge original_repo/so-pr
And that would merge the contents of
so-pr into your working branch.
# Add the remote, call it "upstream": git remote add upstream https://github.com/whoever/whatever.git # Fetch all the branches of that remote into remote-tracking branches, # such as upstream/master: git fetch upstream # Make sure that you're on your master branch: git checkout master # Rewrite your master branch so that any commits of yours that # aren't already in upstream/master are replayed on top of that # other branch: git rebase upstream/master #If you don't want to rewrite the history of your master branch, (for # example because other people may have cloned it) then you should # replace the last command with However, for making further pull # requests that are as clean as possible, it's probably better to # rebase. git merge upstream/master.
I always stumble upon questions that request a way of computing prediction probabilities through LinearSVC model of Sklearn. I am also the one of these people :). Here I come up with a simple subclass of LinearSVC model predicting probabilities by Platt's scaling.