question
stringlengths
11
198
code
stringlengths
0
12.1k
null
db.rollback()
null
a = ['cat', 'dog', 'mouse']
null
myinst.__dict__['attr']
null
numpy.outer(numpy.array([1, 2]), numpy.array([3, 4]))
null
b = numpy.append(a, numpy.zeros([len(a), 1]), 1)
null
[[], [], []]
null
dtype([('x', '<i8'), ('y', 'S')])
null
window.after(1, lambda : window.focus_force())
null
my_function = __import__('my_apps.views').my_function
null
print(df.loc['one'])
null
zip(big_list[:], big_list[1:], big_list[2:])
null
"""""".join(sorted(x))
null
parser.parse_args()
null
xl.Workbooks.Open('C:\\Foo\\Bar.xlsx')
null
urllib.parse.urlencode({'data': {'wifi': {'ssid': 'guest', 'rssi': '80'}}})
null
bin(0)
null
tom_index = next(index for index, d in enumerate(lst) if d['name'] == 'Tom')
null
ax.get_xticklines()[i].set_visible(False)
null
y = x.astype(int)
null
"""""".join(random.choices(string.ascii_uppercase + string.digits, k=N))
null
f.write('foo\nbar\nbaz\n')
null
[len(x) for x in s.split()]
null
parser.add_option('-f', '--file', dest='filename', help='foo help')
null
hdl = logging.FileHandler('hits.log')
null
result = (list_[0][0] + list_[1][0]) * (list_[0][1] + list_[1][1])
null
dict((k, mydict[k]) for k in keys_to_select if k in mydict)
null
{k: sum(v) for k, v in list(trimmed.items())}
null
cv2.rectangle(image, (x, y), (x + w, y + h), (255, 255, 0), 5)
null
df[0].apply(lambda x: (0, 0) if x is np.nan else x)
null
myDict.pop(key, None)
null
connection = cql.connect('localhost:9160', cql_version='3.0.0')
null
[('1', 6), ('2', 4), ('7', 3), ('10', 2)]
null
print(', '.join(data[:-2] + [' and '.join(data[-2:])]))
null
zip(string, string[1:], string[2:])
null
pd.read_csv('whitespace.csv', header=None, delimiter='\\s+')
null
int(x) / int(y) == math.floor(float(x) / float(y))
null
lines.sort(key=itemgetter(2), reverse=True)
null
df.filter(regex='^foo\\.', axis=1)
null
return date.today() > self.date
null
text = text.replace('?"', '? "').replace('!"', '! "').replace('."', '. "')
null
return func(*args, **kwargs)
null
session.query(func.myThingFunction('bar')).all()
null
"""^\\s*[\\w_][\\w\\d_]*\\s*.*\\s*[\\w_][\\w\\d_]*\\s*\\(.*\\)\\s*$"""
null
{key: val for key, val in parent_dict.items() if 2 < key < 4}
null
random.sample(list(range(1, 10)), 5)
null
print(mydate.strftime('%Y-%m-%d'))
null
re.compile('[')
null
bbox_data = ax.transData.inverted().transform(bbox)
null
map(int, bin(6)[2:])
null
print("All normal prints after 'RESET' above.")
null
pdb.set_trace()
null
print(etree.tostring(root, pretty_print=True))
null
df.convert_objects(convert_numeric=True)
null
"""\\xc3\\x85あ""".encode('utf-8').decode('unicode_escape').encode('latin-1')
null
word = '*' * len(name)
null
u = User.objects.filter(userjob__job=a).filter(userjob__job=c)
null
return render_to_response('foo.html', {'results': decoded_json['Result']})
null
{v: (v ** 2) for v in l}
null
df.stack().between(2, 10, inclusive=False).unstack()
null
self.setWindowFlags(PyQt4.QtCore.Qt.WindowStaysOnTopHint)
null
pygame.init()
null
df.select(lambda x: re.search('prefix$', str(x)) is None, axis=1)
null
br.select_form(nr=1)
null
[(mylist[i:] + [newelement] + mylist[:i]) for i in range(len(mylist), -1, -1)]
null
print(lxml.etree.tostring(order, pretty_print=True))
null
print(r.dtype)
null
print(A.reshape(-1, k)[np.arange(n * m), B.ravel()])
null
soup = BeautifulSoup.BeautifulSoup(urllib.request.urlopen(url).read())
null
json1_data = json.loads(json1_str)[0]
null
Group.objects.get(id=1).members.filter(is_main_user=True)[0]
null
sys.stdout.write('\rComplete! \n')
null
numpy.set_printoptions(formatter={'float': lambda x: 'float: ' + str(x)})
null
print(map(lambda key_value: int(key_value[1]), list(ss.items())))
null
new = text[:1] + 'Z' + text[2:]
null
len(['DATE', 'TIME', 'DLAT', 'DLON', 'SLAT', 'SLON', 'SHGT', 'HGT', 'N', 'E'])
null
[[1, 1, 2, 2], [1, 1, 2, 2], [3, 3, 4, 4], [3, 3, 4, 4]]
null
a_lower = dict((k.lower(), v) for k, v in list(a.items()))
null
dfrm.drop(dfrm.index[len(dfrm) - 1])
null
'This is a string: %s' % 'abc'
null
[[1, -2], [3, -2]]
null
isinstance(variable, States)
null
del myList[i]
null
[x for y in l for x in y]
null
base = df.index.get_loc(18)
null
good_data = [data[(n), :][flag == 1].tolist() for n in range(data.shape[0])]
null
db_table = 'schema"."tablename'
null
ax.set_xlabel('Distance from heated face($10^{-2}$ m)')
null
print(len(str(decimal.Decimal('0.1'))))
null
img.save('/tmp/image.bmp')
null
print(maximize_nonoverlapping_count([[3, 4], [5, 8], [0, 6], [1, 2]]))
null
df.plot(kind='bar', stacked=True, color=my_colors)
null
output = subprocess.check_output(['ping', '-c', '2', '-W', '2', '1.1.1.1'])
null
output = ''.join(item[0].upper() for item in re.findall('\\w+', input))
null
[line for line in file if not line.startswith('#')]
null
return HttpResponse(json.dumps(locs), mimetype='application/json')
null
stopword_pattern.match('1999')
null
print('{:.6f}'.format(i))
null
winsound.PlaySound('alert.wav')
null
new_data = np.vectorize(boolstr_to_floatstr)(data).astype(float)
null
plt.rcParams['patch.edgecolor'] = 'white'