https://developer.zendesk.com/rest_api/docs/chat/shortcuts#create-shortcut
774653
def shortcut_create(self, data, **kwargs):
        ""
        api_path = "/api/v2/shortcuts"
        return self.call(api_path, method="POST", data=data, **kwargs)
118819
function makeRequest(apiKey, path, opts, callback) {
    var 
        key,
        req,
        dataStr = '';
        
    if(callback === undefined) {
        throw 'No callback defined';
        return;
    }

    path = '/plus/v1/' + path + '?key=' + apiKey;
    for(key in opts) {
        path += '&' + key + '=' + opts[key];
    }

    req = https.request({
        host: 'www.googleapis.com',
        port: 443,
        path: path,
        method: 'GET'
    }, function(res) {
        res.on('data', function(data) {
            dataStr += data;
        });
        
        res.on('end', function() {
            if(opts.alt === undefined || opts.alt.toLowerCase() == 'json') {
                try {
                    callback(null, JSON.parse(dataStr));
                } catch(err) {
                    callback(null, dataStr);
                }
            }
            else {
                callback(null, dataStr);
            }
        });
        
        res.on('close', function () {
            res.emit('end');
        });
    });
    req.end();
    
    req.on('error', function(err) {
        callback(err);
    });

    return req;
}
600258
def action_add(self):
        

        # prepare values for new shortcut
        path = self.args['--workdir'] or os.getcwd()
        name = self.args['<name>']
        cmd = self.args['<command>']

        overwrite = self.args['--force']

        # check for conflicts in DB
        if not overwrite and self.shortcut_exists(name):
            print_err('The shortcut "%s" already exists.' % name)
            return

        # if cmd has arguments, extract the command only
        cmd_parts = [x.strip() for x in cmd.split(' ')]
        cmd_real = cmd_parts[0]
        cmd_tail = ' '.join(cmd_parts[1:])

        # if cmd_real starts with ./, remove that
        if cmd_real.startswith('./'):
            cmd_real = cmd_real[2:]

        # path to the file (if it's in the folder)
        localfile = os.path.abspath(os.path.join(path, cmd_real))

        # check if the file is present at the path given
        if os.path.isfile(localfile):

            # file extension
            ext = os.path.splitext(cmd_real)[1]

            # check for exacutable bit
            # jar is executable, but cannot be run directly
            if os.access(localfile, os.X_OK) and not ext == '.jar':
                # file is executable
                cmd = ''

                if not cmd_real.startswith('/'):
                    cmd = './'

                cmd = cmd + cmd_real + ' ' + cmd_tail

            else:
                # not executable
                # try to find interpreter for the file

                interpreter = {
                    '.py': 'python',
                    '.rb': 'ruby',
                    '.js': 'node',
                    '.pl': 'perl',
                    '.sh': 'sh',
                    '.php': 'php',
                    '.jar': 'java -jar',
                }.get(ext, None)

                # check if interpreter was found
                if interpreter is None:

                    msg = ('Could not make a shortcut to "%s":'
                           + '\n - not executable & unknown extension.') % localfile

                    print_err(msg)
                    return

                cmd = str(interpreter) + ' ' + \
                    str(cmd_real) + ' ' + str(cmd_tail)
        else:
            # use cmd, as given.
            pass

        if overwrite:
            self.db_exec('''
                    DELETE FROM shortcuts WHERE name=?
                    ''', (name,))
        # save to DB
        self.db_exec('''
            INSERT INTO shortcuts (name, path, command)
            VALUES (?, ?, ?)
            ''', (str(name), str(path), str(cmd)))

        # show OK message
        msg = ('Shortcut "%s" has been created.\n'
               + self.shortcut_str(path, cmd)) % name

        print_msg(msg)
1040448
def create_api_key(self):
        """"""
        apikeys = self.client.get_api_keys()
        for key in apikeys['items']:
            if key['name'] == self.app_name:
                self.log.info("Key %s already exists", self.app_name)
                break
        else:
            self.client.create_api_key(
                name=self.app_name, enabled=True, stageKeys=[{
                    'restApiId': self.api_id,
                    'stageName': self.env
                }])
            self.log.info("Successfully created API Key %s. Look in the AWS console for the key", self.app_name)
294870
def create_toolbutton(parent, text=None, shortcut=None, icon=None, tip=None,
                      toggled=None, triggered=None,
                      autoraise=True, text_beside_icon=False):
    """"""
    button = QToolButton(parent)
    if text is not None:
        button.setText(text)
    if icon is not None:
        if is_text_string(icon):
            icon = get_icon(icon)
        button.setIcon(icon)
    if text is not None or tip is not None:
        button.setToolTip(text if tip is None else tip)
    if text_beside_icon:
        button.setToolButtonStyle(Qt.ToolButtonTextBesideIcon)
    button.setAutoRaise(autoraise)
    if triggered is not None:
        button.clicked.connect(triggered)
    if toggled is not None:
        button.toggled.connect(toggled)
        button.setCheckable(True)
    if shortcut is not None:
        button.setShortcut(shortcut)
    return button
286440
Observable<ComapiResult<ConversationDetails>> doCreateConversation(@NonNull final String token, @NonNull final ConversationCreate request) {
        return wrapObservable(service.createConversation(AuthManager.addAuthPrefix(token), apiSpaceId, request)
                .map(mapToComapiResult()), log, "Creating conversation" + request.getName());
    }
1045990
def _create_get_request(self, resource, billomat_id='', command=None, params=None):
        
        if not params:
            params = {}

        if not command:
            command = ''
        else:
            command = '/' + command

        assert (isinstance(resource, str))
        if billomat_id:
            assert (isinstance(billomat_id, int) or isinstance(billomat_id, str))

            if isinstance(billomat_id, int):
                billomat_id = str(billomat_id)
        response = self.session.get(
            url=self.api_url + resource + ('/' + billomat_id if billomat_id else '') + command,
            params=params,
        )

        return self._handle_response(response)
906353
def create(self, **kwargs):
        """"""
        self._check_create_parameters(**kwargs)
        if kwargs['checkPayload'] is True:
            self._meta_data['minimum_additional_parameters'] = {
                'allowTextMessage', 'allowJsonMessage', 'allowBinaryMessage'
            }
        if 'allowTextMessage' in kwargs:
            self._meta_data['required_creation_parameters'].update((
                'plainTextProfileReference',)
            )
        if 'allowJsonMessage' in kwargs:
            self._meta_data['required_creation_parameters'].update((
                'jsonProfileReference',)
            )
        return super(Websocket_Url, self)._create(**kwargs)
1211325
def _api_create(cls, api_key=djstripe_settings.STRIPE_SECRET_KEY, **kwargs):
		

		return cls.stripe_class.create(api_key=api_key, **kwargs)
869806
def help_center_category_create(self, data, locale=None, **kwargs):
        ""
        api_path = "/api/v2/help_center/categories.json"
        if locale:
            api_opt_path = "/api/v2/help_center/{locale}/categories.json"
            api_path = api_opt_path.format(locale=locale)
        return self.call(api_path, method="POST", data=data, **kwargs)
32423
def _build_url(self, endpoint):
        
        if not issubclass(type(self), ChatApiBase) and not self.subdomain:
            raise ZenpyException("subdomain is required when accessing the Zendesk API!")

        if self.subdomain:
            endpoint.netloc = '{}.{}'.format(self.subdomain, self.domain)
        else:
            endpoint.netloc = self.domain

        endpoint.prefix_path(self.api_prefix)
        return endpoint.build()
865522
def create_api_key(self, api_id, stage_name):
        
        response = self.apigateway_client.create_api_key(
            name='{}_{}'.format(stage_name, api_id),
            description='Api Key for {}'.format(api_id),
            enabled=True,
            stageKeys=[
                {
                    'restApiId': '{}'.format(api_id),
                    'stageName': '{}'.format(stage_name)
                },
            ]
        )
        print('Created a new x-api-key: {}'.format(response['id']))
1140804
function slackSlashCommand(req, res, next) {
  if (req.body.command === '/interactive-example') {
    const type = req.body.text.split(' ')[0];
    if (type === 'button') {
      res.json(interactiveButtons);
    } else if (type === 'menu') {
      res.json(interactiveMenu);
    } else if (type === 'dialog') {
      res.send();
      web.dialog.open({
        trigger_id: req.body.trigger_id,
        dialog,
      }).catch((error) => {
        return axios.post(req.body.response_url, {
          text: `An error occurred while opening the dialog: ${error.message}`,
        });
      }).catch(console.error);
    } else {
      res.send('Use this command followed by `button`, `menu`, or `dialog`.');
    }
  } else {
    next();
  }
}
153849
def create_workspace(self) -> None:
        

        def create_clicked(text):
            if text:
                command = Workspace.CreateWorkspaceCommand(self, text)
                command.perform()
                self.document_controller.push_undo_command(command)

        self.pose_get_string_message_box(caption=_("Enter a name for the workspace"), text=_("Workspace"),
                                         accepted_fn=create_clicked, accepted_text=_("Create"),
                                         message_box_id="create_workspace")
6325
def create_shortcuts(self):
        """"""
        # Configurable
        copyfig = config_shortcut(self.copy_figure, context='plots',
                                  name='copy', parent=self)
        prevfig = config_shortcut(self.go_previous_thumbnail, context='plots',
                                  name='previous figure', parent=self)
        nextfig = config_shortcut(self.go_next_thumbnail, context='plots',
                                  name='next figure', parent=self)

        return [copyfig, prevfig, nextfig]
866040
def request_create(self, data, **kwargs):
        ""
        api_path = "/api/v2/requests.json"
        return self.call(api_path, method="POST", data=data, **kwargs)
37329
def constructor_shortcut( target )
      define_method target.to_s.downcase do |*args|
        new target, *args
      end
    end