@post('/api/worksheets/command/')
def post_worksheets_command():
    # TODO(klopyrev): The Content-Type header is not set correctly in
    # editable_field.jsx, so we can't use request.json.
    data = json.loads(request.body.read())
    service = BundleService()

    if data.get('raw_command', None):
        data['command'] = service.get_command(data['raw_command'])

    if not data.get('worksheet_uuid', None) and not data.get('command', None):
        return HTTPResponse("Must have worksheet uuid and command", status=httplib.BAD_REQUEST)

    # If 'autocomplete' field is set, return a list of completions instead
    if data.get('autocomplete', False):
        return {
            'completions': service.complete_command(data['worksheet_uuid'], data['command'])
        }

    result = service.general_command(data['worksheet_uuid'], data['command'])
    # The return value is a list, so the normal Bottle JSON return-value logic
    # doesn't apply since it handles only dicts.
    response.content_type = 'application/json'
    return json.dumps(result)
dataset/ETHPy150Open codalab/codalab-cli/codalab/rest/legacy.py/post_worksheets_command/operator `or` -> `and`