This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ============== GOOD =============== | |
| .. ipython:: python | |
| from baron import parse, dumps | |
| source_code_string = "a = 1" | |
| ast = parse(source_code_string) | |
| generated_source_code = dumps(ast) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| INFO interface: output: Box 'archlinux-x86_64' could not be found. Attempting to find and install... | |
| INFO interface: output: ==> build: Box 'archlinux-x86_64' could not be found. Attempting to find and install... | |
| ==> build: Box 'archlinux-x86_64' could not be found. Attempting to find and install... | |
| INFO interface: detail: Box Provider: virtualbox | |
| INFO interface: detail: build: Box Provider: virtualbox | |
| build: Box Provider: virtualbox | |
| INFO interface: detail: Box Version: >= 0 | |
| INFO interface: detail: build: Box Version: >= 0 | |
| build: Box Version: >= 0 | |
| INFO runner: Preparing hooks for middleware sequence... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| gprof2dot -f pstats $profile_file | dot -Tpng -o $profile_graph | |
| gnome-open $profile_graph |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| extract if case outside of a loop | |
| diff --git a/redbaron/redbaron.py b/redbaron/redbaron.py | |
| index 4d37dcb..5a7d3fd 100644 | |
| --- a/redbaron/redbaron.py | |
| +++ b/redbaron/redbaron.py | |
| @@ -788,32 +788,22 @@ class Node(GenericNodesUtils): | |
| Take a list/tuple of attributes that can match and a query, return True | |
| if any of the attributes match the query. | |
| """ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def __getattr__(self, key): | |
| - return self.find(key) | |
| + for i in self.data: | |
| + if key in i._identifiers: | |
| + return i | |
| def __getattr__(self, key): | |
| - if key.endswith("_") and key[:-1] in self._all_my_keys(): | |
| - return getattr(self, key[:-1]) | |
| - |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Haskakafka | |
| import qualified Data.ByteString.Char8 as C8 | |
| kafkaConfig = [] | |
| topicConfig = [] | |
| host = "localhost:9092" | |
| topic = "ttp" | |
| partition = 0 | |
| timeoutMs = 1000 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| """ | |
| Taken from http://www.stavros.io/posts/python-fuse-filesystem/ | |
| """ | |
| from __future__ import with_statement | |
| import os | |
| import sys |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Thanks to this post: | |
| # http://blog.ikato.com/post/15675823000/how-to-install-consolas-font-on-mac-os-x | |
| brew install cabextract | |
| cd ~/Downloads | |
| mkdir consolas | |
| cd consolas | |
| curl -O http://download.microsoft.com/download/f/5/a/f5a3df76-d856-4a61-a6bd-722f52a5be26/PowerPointViewer.exe | |
| cabextract PowerPointViewer.exe |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ==> Making package: ib-tws 954.2s-2 (Tue Feb 16 04:30:50 UTC 2016) | |
| ==> Checking runtime dependencies... | |
| ==> Checking buildtime dependencies... | |
| ==> Retrieving sources... | |
| -> Found LICENSE | |
| -> Found ib-tws | |
| -> Found ib-tws.desktop | |
| -> Found ib-gw | |
| -> Found ib-gw.desktop | |
| -> Downloading tws-latest-standalone-linux-x64.sh... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # pip install percol | |
| # pip install prompter | |
| movie=$1 | |
| ok=false | |
| while [ $ok = false ]; do | |
| torrentId=$(t411 -l 40 search -c filmvideo/film "$movie" size | percol | awk '{ print $1}') |