question
stringlengths
11
198
code
stringlengths
0
12.1k
null
df2.reset_index(drop=True)
null
subprocess.Popen(executable, creationflags=DETACHED_PROCESS, close_fds=True)
null
print(list(sampleDict.values())[0].keys()[0])
null
[(n / d) for n, d in (map(float, i.split('/')) for i in data)]
null
bins = np.linspace(0, 360, 10)
null
br.set_handle_robots(False)
null
df.groupby('a')['b'].apply(list)
null
sys.exit()
null
Activity.objects.filter(list__topic=my_topic)
null
sum([i for i in range(1000) if i % 3 == 0 or i % 5 == 0])
null
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
null
Popen(['python', 'StripCore.py'])
null
p.add_argument('--sizes', type=pair, nargs='+')
null
range(N, -1, -1)
null
plt.gca().invert_yaxis()
null
df['A'].replace(to_replace=0, method='ffill')
null
np.asarray(V).min(0)
null
df['last_updated_time'] = d.dt.strftime('%H:%M:%S')
null
display_axes.set_rlim([-1, 1])
null
x[:, 1::2]
null
print(os.path.join(path, filename))
null
ds.loc['wiki':'wikj']
null
soup.select('tr.colour.blue')
null
soup.findAll('meta', name=re.compile('^description$', re.I))
null
ax.spines['top'].set_visible(False)
null
os.system('scp FILE USER@SERVER:PATH')
null
self.setWindowTitle('')
null
print(re.sub('(\\\\u[0-9A-Fa-f]+)', unescapematch, 'Wi\\u2011Fi'))
null
np.einsum('ij,jk->jik', A, B)
null
{'label_Bbb': 'hereaswell', 'labelA': 'thereissomethinghere'}
null
"""^[ \\t]*#define(.*\\\\\\n)+.*$"""
null
df2.columns = ['letter', 'num']
null
[e for i, e in enumerate(main_list) if i in indexes]
null
getattr(this_prize, choice)
null
print(find_words('tableprechaun', words=set(['tab', 'table', 'leprechaun'])))
null
return qs.values('date').annotate(Sum('amount')).order_by('date')
null
painter.restore()
null
from functools import reduce reduce(lambda x, y: x.replace(y, dict[y]), dict, s)
null
ssh.exec_command('. .profile ; cd /home/test/;$run ./test.sh')
null
sorted(zipped, key=operator.itemgetter(1))
null
csv.reader(upload_file, delimiter=',', quotechar='"')
null
y = set(x.flatten())
null
[sum(x) for x in zip(*lists_of_lists)]
null
np.isclose([10000000000.0, 1e-07], [10000100000.0, 1e-08])
null
os.system('gpio mode 6 out && gpio mode 5 out')
null
nx.draw_networkx_edges(G, pos, edgelist=black_edges, arrows=False)
null
0, '2012-11-06T16:23:36-05:00', 0, None, 23759918, 'baseline', '0 to 100', null, 105114, 2009524, True, 'charge', 'Charge'
null
self.cdr = cdr
null
list(pad([1, 2, 3], 7, ''))
null
raise NotImplementedError('Subclasses should implement this!')
null
print('\n'.join([x.rsplit(None, 1)[0] for x in target.strip().split('\n')]))
null
Cordi1 = [[int(i) for i in line.split()] for line in data]
null
response = opener.open('http://www.google.com/')
null
[[]] * 10
null
os.chdir('l:\\')
null
p.start()
null
df.groupby([df.index.date, 'action']).count()
null
print(open('FILE-WITH-STRING', 'rb').read().decode('base64'))
null
test.f(0)
null
return ''.join(random.choice(char) for x in range(length))
null
numpy.argwhere(a.max() == a)
null
im = Image.open(image_file)
null
['x', 'y', 'z', 'car', 'bus', 'a', 'b', 'c', 'car', '!']
null
writer.writerows(['Hi, there'])
null
myShelvedDict.update(myDict)
null
driver.send_keys(Keys.CONTROL + 'Escape')
null
np.mean(a, axis=1)
null
print(wjdata['data']['current_condition'][0]['temp_C'])
null
print(np.random.randint(0, 100, 10))
null
df1.join(df2, how='inner')
null
sys.path.append('..')
null
param, value = line.split('=', 1)
null
3 not in [1, 2, 'a']
null
df.groupby('d').apply(f)
null
total = sum([int(i) for i in cost])
null
wildcards = ','.join(['%s'] * len(frame.columns))
null
return dict([k_v for k_v in list(d1.items()) if k_v[0] in d2 and d2[k_v[0]] == k_v[1]])
null
a = ['a', 'a', 'a', 'a', 'b', 'b', 'c', 'c', 'c', 'd', 'e', 'e', 'e', 'e', 'e']
null
df['date'] = pd.to_datetime(df['date'])
null
sum(int(i) for i in data)
null
array([0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0])
null
[list(itertools.chain(*x)) for x in zip(L1, L2)]
null
int(sum(jdcal.gcal2jd(dt.year, dt.month, dt.day)))
null
ts.reindex(pd.date_range(min(date_index), max(date_index)))
null
yourlist = ['{}_{}_{}'.format(s.rsplit('_', 2)[0], x, y) for s in yourlist]
null
AtB = A.stack(0).dot(twos).unstack()
null
print(pd.merge(df1, df2, on='B')['B'])
null
print(date(today.year + 1, today.month, today.day))
null
a.transpose(2, 1, 0)
null
urlpatterns = patterns('kiosks.views', url('^([\\w ]+)/$', 'dashboard'))
null
format(x, ',').replace(',', '.')
null
ham.__class__.__name__
null
""".*?\\b"""
null
re.sub('\\d+', lambda x: x.group().zfill(padding), s)
null
df.C[df.B == 'x'] = df.C.shift(-1)
null
total = sum(int(r[1]) for r in csv.reader(fin))
null
plt.savefig('figure%d.png' % i)
null
savetxt(fname='newPicksData.txt', X=new_picks.astype(int), fmt='%.0f\n')
null
return ''.join(parts)
null
str = re.sub(',(?=[^"]*"[^"]*$)', '@', str)