question_id
int64 502
42.8M
| parent_answer_post_id
int64 595
42.8M
| prob
float64 0
0.87
| snippet
stringlengths 0
12.1k
| intent
stringlengths 11
198
| id
stringlengths 9
20
|
|---|---|---|---|---|---|
6,656,819 | 6,657,975 | 0.000261 |
import readline, glob
|
filepath autocompletion using users input
|
6656819_6657975_18
|
5,872,858 | 21,736,385 | 0.00026 |
import rtmidi_python as rtmidi
vmidi_out = rtmidi.MidiOut()
vmidi_out.open_virtual_port('My Virtual MIDI Output Port')
vmidi_out.send_message([144, 48, 100])
|
Configure Mac OS X MIDI programatically
|
5872858_21736385_14
|
42,344,365 | 42,345,790 | 0.00026 |
TYPE
|
How to count unique occurences of particular value per row?
|
42344365_42345790_4
|
12,329,807 | 12,330,005 | 0.000259 |
import multiprocessing
daemon = False
bind = 'unix:/tmp/gunicorn.sock'
|
Django app deployment on nGINX
|
12329807_12330005_15
|
11,021,130 | 29,618,322 | 0.000255 |
twine
markdown
python - slugify
|
Parallel Pip install
|
11021130_29618322_19
|
11,021,130 | 29,618,322 | 0.000255 |
psutil
requests
|
Parallel Pip install
|
11021130_29618322_18
|
27,759,407 | 27,759,940 | 0.000253 |
from allauth.socialaccount.adapter import DefaultSocialAccountAdapter
class SocialAccountAdapter(DefaultSocialAccountAdapter):
pass
|
Django allauth Redirect after social signup
|
27759407_27759940_11
|
4,905,368 | 22,600,827 | 0.000252 |
from textblob.classifiers import NaiveBayesClassifier
train = [('training test totally tubular', 't')]
|
How to incrementally train an nltk classifier
|
4905368_22600827_17
|
2,298,517 | 23,859,736 | 0.000252 |
import pyqtree
spindex = pyqtree.Index(bbox=[0, 0, 1000, 500])
for item in items:
pass
|
Are any of these quad-tree libraries any good?
|
2298517_23859736_13
|
24,197,970 | 24,198,880 | 0.000251 |
myproject
|
PyCharm import external library
|
24197970_24198880_2
|
29,349,607 | 29,350,541 | 0.00025 |
clr.AddReference('System.Data')
from System.Data.SqlClient import *
Conn_string = (
'data source=Server_Name; initial catalog=Database_Name; trusted_connection=True'
)
ScheduleConn = SqlConnection(Conn_string)
ScheduleConn.Open()
|
pymssql windows authentication
|
29349607_29350541_15
|
25,033,631 | 25,053,080 | 0.00025 |
from joblib import Memory
mem = Memory(cachedir=cachedir)
@mem.cache
def f(arguments):
pass
|
Multiple processes sharing a single Joblib cache
|
25033631_25053080_17
|
25,033,631 | 25,053,080 | 0.00025 |
from joblib import Memory
mem = Memory(cachedir=cachedir)
@mem.cache
def f(arguments):
"""do things"""
|
Multiple processes sharing a single Joblib cache
|
25033631_25053080_18
|
7,249,488 | 7,254,337 | 0.000249 |
import foo as module
module_name = module.__name__
import_line = 'from %s import (%%s)' % module_name
length = len(import_line) - 3
|
Tool to help eliminate wildcard imports
|
7249488_7254337_18
|
10,767,736 | 10,771,055 | 0.000248 |
import Control.Monad.ST.Lazy
import Data.Array.ST
import Control.Monad
import Data.List
|
How to make ST computation produce lazy result stream (or operate like a co-routine)?
|
10767736_10771055_9
|
7,249,488 | 7,254,337 | 0.000246 |
import re
import foo as module
module_name = module.__name__
import_line = 'from %s import (%%s)' % module_name
length = len(import_line) - 3
|
Tool to help eliminate wildcard imports
|
7249488_7254337_19
|
15,691,740 | 15,691,929 | 0.000244 |
a2 is a
a2
|
Does assignment with advanced indexing copy array data?
|
15691740_15691929_14
|
2,814,609 | 2,815,796 | 0.000241 |
from myModule import subModule as sm
import imp
sm.MyClass.kind
imp.reload(sm)
sm.MyClass.kind
|
reloading module, need to re-compile sub modules?
|
2814609_2815796_18
|
5,474,514 | 5,474,796 | 0.000239 |
zero = 1 == 0 and 0 or 1
zero = False and 0 or 1
zero = 0 or 1
zero = False or 1
|
Use of OR as branch control in FP
|
5474514_5474796_14
|
2,957,013 | 2,957,181 | 0.000237 |
Red
Blue
Yellow
|
BeautifulSoup: just get inside of a tag, no matter how many enclosing tags there are
|
2957013_2957181_6
|
13,814,208 | 13,826,658 | 0.000237 |
from pyparsing import Keyword, javaStyleComment, dblQuotedString
keyword = 'public'
|
Trying to find all instances of a keyword NOT in comments or literals?
|
13814208_13826658_11
|
3,050,298 | 3,050,374 | 0.000229 |
ONE
TWO
|
Parsing email with Python
|
3050298_3050374_8
|
4,905,368 | 22,600,827 | 0.000228 |
from textblob.classifiers import NaiveBayesClassifier
train = [('training test totally tubular', 't')]
cl = NaiveBayesClassifier(train)
cl.update([('super speeding special sport', 's')])
print(('t', cl.classify('tubular test')))
|
How to incrementally train an nltk classifier
|
4905368_22600827_18
|
6,656,819 | 6,657,975 | 0.000227 |
import readline, glob
def complete(text, state):
return (glob.glob(text + '*') + [None])[state]
readline.set_completer_delims(' \t\n;')
readline.parse_and_bind('tab: complete')
|
filepath autocompletion using users input
|
6656819_6657975_19
|
8,358,962 | 8,359,856 | 0.000227 |
cc
|
Efficiently Row Standardize a Matrix
|
8358962_8359856_14
|
7,117,143 | 7,141,077 | 0.000225 |
timeit.timeit(
'pygame.surfarray.blit_array(screen, pixels);pygame.display.flip()',
setup=
'import pygame;import numpy as np;size=(1920,1080);screen=pygame.display.set_mode(size);pixels=np.random.randint(np.iinfo(np.uint32).max,size=size).astype(np.uint32)'
, number=20)
|
Setting Pixels Quickly
|
7117143_7141077_7
|
2,499,746 | 2,499,903 | 0.000222 |
Loop
|
Extracting columns from text file using Perl one-liner: similar to Unix cut
|
2499746_2499903_7
|
21,123,473 | 21,127,663 | 0.000221 |
147
|
How do I manipulate a variable whose name conflicts with PDB commands?
|
21123473_21127663_10
|
6,731,345 | 6,731,481 | 0.00022 |
PI = 3.14
import constants
|
How-to import constants in many files
|
6731345_6731481_9
|
35,792,422 | 35,793,409 | 0.000217 |
numpy
|
Further confusion with imports in Python
|
35792422_35793409_3
|
20,611,504 | 20,611,773 | 0.000217 |
from pkg_resources import require
match = require('lxml')
|
Find python lxml version
|
20611504_20611773_12
|
31,967,170 | 33,519,170 | 0.000216 |
131
21
|
How to structure a program to work with minesweeper configurations
|
31967170_33519170_18
|
35,491,426 | 35,491,719 | 0.000215 |
import matplotlib.mlab as mlab
regions = mlab.contiguous_regions(ser_orig == manual_mode)
for i, (start, end) in enumerate(regions):
ser_orig[start:end] = new_manual_mode_text.format(i)
ser_orig
|
Finding contiguous, non-unique slices in Pandas series without iterating
|
35491426_35491719_12
|
16,908,236 | 16,908,265 | 0.000212 |
Hi
|
How to execute Python inline from a bash shell
|
16908236_16908265_0
|
5,370,762 | 5,506,230 | 0.000212 |
Else
EndIf
EndIf
|
How to hide Firefox window (Selenium WebDriver)?
|
5370762_5506230_5
|
35,446,211 | 35,479,765 | 0.000211 |
"""import numpy as np
import scipy as sp
import matplotlib as plt
"""
|
Configuring Jupyter default imports
|
35446211_35479765_3
|
34,803,234 | 34,860,388 | 0.000211 |
FROM
foo
|
Sqlalchemy: subquery in FROM must have an alias
|
34803234_34860388_12
|
3,401,428 | 29,698,242 | 0.00021 |
import arrow
|
How to get an isoformat datetime string including the default timezone?
|
3401428_29698242_5
|
29,349,607 | 29,350,541 | 0.000208 |
import clr
clr.AddReference('System.Data')
from System.Data.SqlClient import *
Conn_string = (
'data source=Server_Name; initial catalog=Database_Name; trusted_connection=True'
)
ScheduleConn = SqlConnection(Conn_string)
|
pymssql windows authentication
|
29349607_29350541_16
|
7,912,820 | 32,020,282 | 0.000206 |
s
stationLat
|
How do I change a value while debugging python with pdb?
|
7912820_32020282_5
|
12,166,819 | 12,166,860 | 0.000206 |
ccg
chat
chunk
classify
|
Use NLTK without installing
|
12166819_12166860_18
|
37,425,819 | 37,426,164 | 0.0002 |
Date
|
Rolling average pairwise correlation in Python
|
37425819_37426164_8
|
13,308,498 | 13,320,020 | 0.0002 |
psycopg2
pytest
|
How to add a bootstrap script to tox's virtualenv?
|
13308498_13320020_19
|
3,531,980 | 3,541,858 | 0.000198 |
parts = python
eggs = tornado
|
How to migrate from virtualenv to buildout?
|
3531980_3541858_11
|
24,187,248 | 24,187,326 | 0.000197 |
420
420
|
Python 2to3 tool adds a vowel to my integer
|
24187248_24187326_12
|
7,354,096 | 7,355,298 | 0.000196 |
under
|
Override default installation directory for Python bdist Windows installer
|
7354096_7355298_0
|
5,281,341 | 14,725,655 | 0.000193 |
done
fi
|
Get local network interface addresses using only proc?
|
5281341_14725655_3
|
35,491,426 | 35,491,719 | 0.000189 |
import matplotlib.mlab as mlab
regions = mlab.contiguous_regions(ser_orig == manual_mode)
|
Finding contiguous, non-unique slices in Pandas series without iterating
|
35491426_35491719_13
|
7,117,143 | 7,141,077 | 0.000187 |
"""
pygame.surfarray.blit_array(screen, pixels)
pygame.display.flip()
""",
|
Setting Pixels Quickly
|
7117143_7141077_8
|
35,792,422 | 35,793,409 | 0.000187 |
numpy
import numpy.random
|
Further confusion with imports in Python
|
35792422_35793409_4
|
29,349,607 | 29,350,541 | 0.000186 |
clr.AddReference('System.Data')
from System.Data.SqlClient import *
Conn_string = (
'data source=Server_Name; initial catalog=Database_Name; trusted_connection=True'
)
ScheduleConn = SqlConnection(Conn_string)
|
pymssql windows authentication
|
29349607_29350541_17
|
5,370,762 | 5,506,230 | 0.000185 |
EndIf
EndIf
|
How to hide Firefox window (Selenium WebDriver)?
|
5370762_5506230_6
|
29,349,607 | 29,350,541 | 0.000184 |
Conn_string = (
'data source=Server_Name; initial catalog=Database_Name; trusted_connection=True'
)
ScheduleConn = SqlConnection(Conn_string)
|
pymssql windows authentication
|
29349607_29350541_18
|
11,624,955 | 11,625,147 | 0.000183 |
from builtins import sum as builtin_sum
def sum(iterable, startobj=MyCustomStartObject):
pass
|
Avoiding Python sum default start arg behavior
|
11624955_11625147_5
|
2,471,804 | 33,797,841 | 0.000181 |
from recommonmark.parser import CommonMarkParser
source_parsers = {'.md': CommonMarkParser}
|
Using sphinx with Markdown instead of RST
|
2471804_33797841_5
|
20,611,504 | 20,611,773 | 0.00018 |
from pkg_resources import require
match = require('lxml')
match
lxml = match[0]
|
Find python lxml version
|
20611504_20611773_13
|
18,327,790 | 24,312,648 | 0.000179 |
derp_r1_sum_select = """
select sum(`derp_related_1`.`amount`)
from `derp_related_1`
where `derp_related_1`.`fk` = `derp`.`pk`
"""
|
Django aggregation across multiple tables in ModelAdmin queryset
|
18327790_24312648_18
|
22,476,112 | 28,961,977 | 0.000175 |
cd
|
Using chromedriver with selenium/python/ubuntu
|
22476112_28961977_2
|
19,356,410 | 39,851,067 | 0.000169 |
from Spline.Spline import *
operation = Spline()
|
Splines in pythonOCC
|
19356410_39851067_13
|
7,117,143 | 7,141,077 | 0.000157 |
import timeit
timeit.timeit(
'pygame.surfarray.blit_array(screen, pixels);pygame.display.flip()',
setup=
'import pygame;import numpy as np;size=(1920,1080);screen=pygame.display.set_mode(size);pixels=np.random.randint(np.iinfo(np.uint32).max,size=size).astype(np.uint32)'
, number=20)
|
Setting Pixels Quickly
|
7117143_7141077_9
|
12,166,819 | 12,166,860 | 0.000156 |
chunk
classify
|
Use NLTK without installing
|
12166819_12166860_19
|
4,905,368 | 22,600,827 | 0.000153 |
from textblob.classifiers import NaiveBayesClassifier
train = [('training test totally tubular', 't')]
cl = NaiveBayesClassifier(train)
cl.update([('super speeding special sport', 's')])
|
How to incrementally train an nltk classifier
|
4905368_22600827_19
|
3,123,371 | 3,124,374 | 0.000152 |
python
import dis
|
Splitting a 16 bit int into two 8 bit ints in python
|
3123371_3124374_6
|
16,678,551 | 16,678,743 | 0.000151 |
dupes
|
Pandas: Create new dataframe that averages duplicates from another dataframe
|
16678551_16678743_16
|
2,957,013 | 41,140,750 | 0.000148 |
Red
Blue
Yellow
|
BeautifulSoup: just get inside of a tag, no matter how many enclosing tags there are
|
2957013_41140750_5
|
3,050,298 | 3,050,359 | 0.000143 |
ONE
TWO
|
Parsing email with Python
|
3050298_3050359_5
|
5,281,341 | 14,725,655 | 0.000143 |
fi
fi
|
Get local network interface addresses using only proc?
|
5281341_14725655_4
|
2,814,609 | 2,815,796 | 0.000142 |
from myModule import subModule as sm
sm.MyClass.kind
|
reloading module, need to re-compile sub modules?
|
2814609_2815796_19
|
10,767,736 | 10,768,103 | 0.000141 |
import Control.Monad.ST.Lazy
import Data.STRef.Lazy
|
How to make ST computation produce lazy result stream (or operate like a co-routine)?
|
10767736_10768103_5
|
9,788,299 | 9,788,516 | 0.000141 |
Parameters
|
convenient slicing of DataFrames with datetime indexes in pandas
|
9788299_9788516_2
|
25,033,631 | 25,053,080 | 0.000137 |
from joblib import Memory
mem = Memory(cachedir=cachedir)
|
Multiple processes sharing a single Joblib cache
|
25033631_25053080_19
|
16,294,819 | 37,456,080 | 0.000135 |
requests
simplejson
|
How to check if my Python has all required packages?
|
16294819_37456080_3
|
12,544,510 | 12,544,831 | 0.000132 |
row = (
"""172.16.0.3 - - [25/Sep/2002:14:04:19 +0200] "GET / HTTP/1.1" 401 - "" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.1) Gecko/20020827" """
)
import re
|
Parsing apache log files
|
12544510_12544831_6
|
3,058,374 | 16,182,764 | 0.000126 |
touch / tmp / foo.tar
python
import tarfile
|
is_tarfile() returns True for a blank file
|
3058374_16182764_9
|
20,611,504 | 20,611,773 | 0.000122 |
from pkg_resources import require
match = require('lxml')
match
|
Find python lxml version
|
20611504_20611773_14
|
32,172,125 | 32,172,225 | 0.000119 |
test3
|
Numpy index, get bands of width 2
|
32172125_32172225_16
|
17,573,814 | 17,574,265 | 0.000114 |
Parameters
|
Count occurrences of certain words in pandas dataframe
|
17573814_17574265_13
|
39,397,034 | 39,398,969 | 0.000111 |
tr
fold
ps
|
Script works differently when ran from the terminal and ran from Python
|
39397034_39398969_12
|
27,901,211 | 27,901,437 | 0.000108 |
python << _EOF_
import vim
|
How to pass arguments from vimscript functions to python interface?
|
27901211_27901437_14
|
5,281,341 | 14,725,655 | 0.000107 |
done
fi
fi
|
Get local network interface addresses using only proc?
|
5281341_14725655_5
|
8,478,137 | 8,478,633 | 0.000106 |
alpha
beta
|
How redirect a shell command output to a Python script input ?
|
8478137_8478633_10
|
20,630,121 | 20,639,234 | 0.0001 |
Parameters
|
Pandas - how to convert r dataframe back to pandas?
|
20630121_20639234_12
|
8,478,137 | 8,478,633 | 0.0001 |
alpha
beta
gamma
|
How redirect a shell command output to a Python script input ?
|
8478137_8478633_12
|
8,478,137 | 8,478,633 | 0.0001 |
beta
gamma
|
How redirect a shell command output to a Python script input ?
|
8478137_8478633_11
|
7,117,143 | 7,141,077 | 0.000087 |
"""
import pygame
import numpy as np
size=(1920,1080)
screen=pygame.display.set_mode(size)
pixels=np.random.randint(np.iinfo(np.uint32).max,size=size).astype(np.uint32)
"""
|
Setting Pixels Quickly
|
7117143_7141077_10
|
33,248,866 | 33,249,103 | 0.000081 |
End
End
|
Distance from smallest to the largest element in lists (inside a list)
|
33248866_33249103_2
|
2,957,013 | 2,957,181 | 0.000078 |
Red
Blue
|
BeautifulSoup: just get inside of a tag, no matter how many enclosing tags there are
|
2957013_2957181_7
|
5,180,184 | 5,180,297 | 0.000077 |
RawPurchaseAmount
|
Python Remove Comma In Dollar Amount
|
5180184_5180297_4
|
5,180,184 | 5,180,297 | 0.000076 |
import re
RawPurchaseAmount
|
Python Remove Comma In Dollar Amount
|
5180184_5180297_5
|
2,957,013 | 41,140,750 | 0.000049 |
Red
Blue
|
BeautifulSoup: just get inside of a tag, no matter how many enclosing tags there are
|
2957013_41140750_6
|
39,397,034 | 39,398,969 | 0.00003 |
tr
fold
|
Script works differently when ran from the terminal and ran from Python
|
39397034_39398969_13
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.