query
stringlengths
16
255
pos
list
neg
list
task
stringclasses
1 value
instruction
dict
Executes the given action. Raise a KeyError on unkown actions.
[ "def call_action(self, service_name, action_name, **kwargs):\n \"\"\"\"\"\"\n action = self.services[service_name].actions[action_name]\n return action.execute(**kwargs)" ]
[ "def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR...
codesearchnet
{ "query": "Represent the Github summarization about Natural Language Processing:", "pos": "Represent the Github code about Natural Language Processing:", "neg": "Represent the Github code about programming:" }
:param ekey: export key, i.e. a pair (datastore key, fmt) :param dstore: datastore object
[ "def export_agg_risk_csv(ekey, dstore):\n \n writer = writers.CsvWriter(fmt=writers.FIVEDIGITS)\n path = '%s.%s' % (sanitize(ekey[0]), ekey[1])\n fname = dstore.export_path(path)\n writer.save(dstore['agg_risk'].value, fname)\n return [fname]" ]
[ "def add_reference(self, reftype: str, label: str, target):\n \n\n # The self.data[reftype] dict springs into being during the\n # register_references event handler at startup, which looks in the\n # kb registry for all registered reference names.\n self.data[reftype][label] = tar...
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code:" }
Disconnect from device.
[ "def stop(self):\n \"\"\"\"\"\"\n if self._outstanding:\n _LOGGER.warning('There were %d outstanding requests',\n len(self._outstanding))\n\n self._initial_message_sent = False\n self._outstanding = {}\n self._one_shots = {}\n self.conn...
[ "@Override\n\tpublic void validateSetup(Server server, Query query) throws ValidationException {\n\t\tlogger.info(\"Starting Stackdriver writer connected to '{}', proxy {} ...\", gatewayUrl, proxy);\n\t}" ]
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Programming:" }
Ruby 1.8.6 has no Method#owner method, this is a poor man's replacement. It has horrible performance and may break for other ruby implementations than MRI.
[ "def poor_mans_method_owner(method, method_name)\n # A Method object has no :owner method, but we can infer it's owner from the result of it's\n # :to_s method. Examples:\n # 37.method(:rdiv).to_s => \"#<Method: Fixnum#rdiv>\"\n # 37.method(:ceil).to_s => \"#<Method: Fixnum(Integer)#ceil>\"\n ...
[ "def verify(build)\n # TODO might as well cache this and store in the db so we dont have to\n # convert every time\n pkey = to_rsa_pkey\n signature = Base64.decode64(build.signature)\n digest = OpenSSL::Digest::SHA256.new\n\n # If the user submits html were going to expect the\n #...
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Returns the value mapped by {@code name} if it exists and is a {@code JsonArray}, or null otherwise.
[ "public JsonArray optJsonArray(String name) {\n JsonElement el = null;\n try {\n el = get(name);\n } catch (JsonException e) {\n return null;\n }\n if (!el.isJsonArray()) {\n return null;\n }\n return el.asJsonArray();\n }" ]
[ "function Pointer ($ref, path, friendlyPath) {\n /**\n * The {@link $Ref} object that contains this {@link Pointer} object.\n * @type {$Ref}\n */\n this.$ref = $ref;\n\n /**\n * The file path or URL, containing the JSON pointer in the hash.\n * This path is relative to the path of the main JSON schema ...
codesearchnet
{ "query": "Represent the instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Programming:" }
// Visited implements Storage.Visited()
[ "func (s *InMemoryStorage) Visited(requestID uint64) error {\n\ts.lock.Lock()\n\ts.visitedURLs[requestID] = true\n\ts.lock.Unlock()\n\treturn nil\n}" ]
[ "@Override\n public List findByRange(byte[] muinVal, byte[] maxVal, EntityMetadata m, boolean isWrapReq, List<String> relations,\n List<String> columns, List<IndexExpression> conditions, int maxResults) throws Exception {\n throw new UnsupportedOperationException(\"Support available only for thrift...
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
/* EditInlineMessageLiveLocation edits location in message sent via the bot (using inline mode). Available options: - OptInlineKeyboardMarkup(markup *InlineKeyboardMarkup) */
[ "func (c *Client) EditInlineMessageLiveLocation(inlineMessageID string, latitude, longitude float64, opts ...sendOption) error {\n\treq := url.Values{}\n\treq.Set(\"inline_message_id\", inlineMessageID)\n\treq.Set(\"latitude\", fmt.Sprint(latitude))\n\treq.Set(\"longitude\", fmt.Sprint(longitude))\n\tfor _, opt := ...
[ "func updateMessage(message editingMessage) error {\n\treturn createMessage(message, message.NumericSender(), message.NumericReference(), message.Text(), message.Language())\n}" ]
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
// PullImage waits for an image to be available on the docker registry so it // can be pulled (if it does not exist locally).
[ "func (l *RegistryListener) PullImage(cancel <-chan time.Time, image string) error {\n\timageID, err := commons.ParseImageID(image)\n\tif err != nil {\n\t\treturn err\n\t}\n\trImage := &registry.Image{\n\t\tLibrary: imageID.User,\n\t\tRepo: imageID.Repo,\n\t\tTag: imageID.Tag,\n\t}\n\tif imageID.IsLatest() {...
[ "def begin_commit():\n \n\n session_token = request.headers['session_token']\n repository = request.headers['repository']\n\n #===\n current_user = have_authenticated_user(request.environ['REMOTE_ADDR'], repository, session_token)\n if current_user is False: return fail(user_auth_fail_msg)\n\n ...
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Generate the complete URL of a link. @param array $parameters The link parameters (go to LinkTrait to have the list) @param string $avoidRefresh Do we have to refresh or not ? @param array $url Fallback url @return string
[ "public function victoireLinkUrl($parameters, $avoidRefresh = true, $url = '#')\n {\n $referenceType = isset($parameters['referenceType']) ? $parameters['referenceType'] : UrlGeneratorInterface::ABSOLUTE_PATH;\n if (!isset($parameters['locale'])) {\n if ($this->request) {\n ...
[ "public function initializeArguments()\n {\n $this->registerTagAttribute('enctype', 'string', 'MIME type with which the form is submitted');\n $this->registerTagAttribute('method', 'string', 'Transfer type (GET or POST or dialog)');\n $this->registerTagAttribute('name', 'string', 'Name of fo...
codesearchnet
{ "query": "Represent the post about text processing:", "pos": "Represent the code about text processing:", "neg": "Represent the code about programming:" }
Check Plugin Info Unlike with the Phar library, this function only gathers the release information. Downloads are handled some other way. @param string $key Key. @return mixed Details, detail, false.
[ "protected static function check_plugin($key=null) {\n\t\tif (\\is_null(static::$_plugin)) {\n\t\t\t// Pull the remote info and store it for later.\n\t\t\tif (false === ($remote = static::get_release_info('Info URI', static::PLUGIN_TEMPLATE))) {\n\t\t\t\tstatic::$_plugin = false;\n\t\t\t\treturn static::$_plugin;\n...
[ "def spec(self):\n \"\"\"\"\"\"\n from ambry_sources.sources import SourceSpec\n\n d = self.dict\n d['url'] = self.url\n\n # Will get the URL twice; once as ref and once as URL, but the ref is ignored\n\n return SourceSpec(**d)" ]
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Adds entries to _classes_* Args: m: module object that must contain the following sub-modules: datatypes, vis
[ "def _collect_classes(m):\n \n from f311 import filetypes as ft\n from f311 import explorer as ex\n\n def _extend(classes, newclasses):\n \"\"\"Filters out classes already present in list.\n\n This shouldn't be necessary, but collaborators may accidentally import already loaded\n cl...
[ "def add_reference(self, reftype: str, label: str, target):\n \n\n # The self.data[reftype] dict springs into being during the\n # register_references event handler at startup, which looks in the\n # kb registry for all registered reference names.\n self.data[reftype][label] = tar...
codesearchnet
{ "query": "Represent the description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
// SafeWriteToFile is a pass-through to safeWriteToFileOnce on non-Windows.
[ "func SafeWriteToFile(g SafeWriteLogger, t SafeWriter, mode os.FileMode) error {\n\treturn safeWriteToFileOnce(g, t, mode)\n}" ]
[ "public String filePath(int index, String savePath) {\n // not calling the corresponding swig function because internally,\n // the use of the function GetStringUTFChars does not consider the case of\n // a copy not made\n return savePath + File.separator + fs.file_path(index);\n }" ]
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Builds all targets of this dependency and returns the result of self.function on the resulting values
[ "def resolve(self):\n \n values = {}\n for target_name in self.target_names:\n if self.context.is_build_needed(self.parent, target_name):\n self.context.build_task(target_name)\n\n if len(self.keyword_chain) == 0:\n values[target_name] = self....
[ "def run_objective(objective, _name, raw_output, output_files, threads)\n # output is a, array: [raw_output, output_files].\n # output_files is a hash containing the absolute paths\n # to file(s) output by the target in the format expected by the\n # objective function(s), with keys as the keys ...
codesearchnet
{ "query": "Represent the summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
// OnActivityFailedTimedOutCanceled builds a composed decider that fires when a matching activity fails, times out, or is canceled.
[ "func OnActivityFailedTimedOutCanceled(activityName string, deciders ...Decider) Decider {\n\treturn OnActivityEvents(activityName, []string{\n\t\tswf.EventTypeActivityTaskFailed,\n\t\tswf.EventTypeActivityTaskTimedOut,\n\t\tswf.EventTypeActivityTaskCanceled,\n\t\tswf.EventTypeScheduleActivityTaskFailed,\n\t}, deci...
[ "boolean detectAndHandleBackupTimeout(long timeoutMillis) {\n // if the backups have completed, we are done; this also filters out all non backup-aware operations\n // since the backupsAcksExpected will always be equal to the backupsAcksReceived\n boolean backupsCompleted = backupsAcksExpected ...
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// Swap is part of sort.Interface.
[ "func (e eventlist) Swap(i, j int) {\n\te[i], e[j] = e[j], e[i]\n}" ]
[ "public String filePath(int index, String savePath) {\n // not calling the corresponding swig function because internally,\n // the use of the function GetStringUTFChars does not consider the case of\n // a copy not made\n return savePath + File.separator + fs.file_path(index);\n }" ]
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Decide which columns we want to display. @return Column\AbstractColumn[] @throws \Exception
[ "private function getColumnsToDisplay()\n {\n if (is_array($this->columnsToDisplay)) {\n return $this->columnsToDisplay;\n }\n\n $columnsToDisplay = [];\n foreach ($this->getColumns() as $column) {\n /* @var $column \\ZfcDatagrid\\Column\\AbstractColumn */\n\n ...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github sentence about User interface customization:", "pos": "Represent the Github code about User interface customization:", "neg": "Represent the Github code:" }
Array Access: Offset Set
[ "public function offsetSet($offset, $value)\n {\n $canonical = $this->canonical($offset);\n $this->headers[$canonical] = $value;\n $this->map[$canonical] = $offset;\n }" ]
[ "def property_(getter: Map[Domain, Range]) -> property:\n \n return property(map_(WeakKeyDictionary())(getter))" ]
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Write a new file using a stream. @param string $path @param resource $resource @param Config $config Config object @return array|false false on failure file meta data on success
[ "public function writeStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }" ]
[ "public function body($payload, $mimeType = null)\n {\n $this->mime($mimeType);\n $this->payload = $payload;\n // Iserntentially don't call _serializePayload yet. Wait until\n // we actually send off the request to convert payload to string.\n // At that time, the `serialized_...
codesearchnet
{ "query": "Represent the Github sentence about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Programming:" }
result in utc-days
[ "private long firstDayOfMonth(\n int cycle,\n int yearOfCycle,\n EastAsianMonth month\n ) {\n long newYear = this.newYear(cycle, yearOfCycle);\n long approxStartOfMonth = this.newMoonOnOrAfter(newYear + (month.getNumber() - 1) * 29);\n\n if (month.equals(this.transform(a...
[ "def _init_prtfmt(self, key=\"fmta\"):\n \"\"\"\"\"\"\n prtfmt = self.gosubdag.prt_attr[key]\n return prtfmt.replace(\"{NS}\", \"{NS} {hdr1usr01:2} {num_usrgos:>4} uGOs\")" ]
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Check client content MD5. @return boolean
[ "public function isValidMD5()\n {\n // Get client secret if available\n $client = $this->getClient();\n $clientSecret = '';\n if ( ! is_null($client)) {\n $clientSecret = $client->secret;\n }\n unset($client);\n\n // Get md5 data from header\n $md5 = $this->getRequest()->header('CO...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the instruction about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
Loads a specific configuration. @param array $configs An array of configuration values @param ContainerBuilder $container A ContainerBuilder instance @throws \InvalidArgumentException When provided tag is not defined in this extension
[ "public function load(array $configs, ContainerBuilder $container)\n {\n $configs[] = $this->options;\n $configuration = $this->getConfiguration($configs, $container);\n $config = $this->processConfiguration($configuration, $configs);\n\n $container->register('doctrine.orm.metadata_dr...
[ "public function getSection($key)\n {\n if (false === $this->hasSection($key)) {\n throw new ConfigException(sprintf('\"%s\" is not a section', $key));\n }\n\n // do not return the parent object if we were subclassed, but an actual\n // \"Config\" object to avoid copying in...
codesearchnet
{ "query": "Represent the description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
// Open opens a URL using osascript..
[ "func (o *OSXOpener) Open(u string, windowType WindowType, autoRaise bool) error {\n\tscript := fmt.Sprintf(`open location \"%s\"`, strings.Replace(u, `\"`, \"%22\", -1))\n\tcmd := exec.Command(\"/usr/bin/osascript\", \"-e\", script)\n\treturn cmd.Run()\n}" ]
[ "def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR...
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
// functionVars returns the function variables as terraform -var arguments.
[ "func (p *Proxy) functionVars() (args []string) {\n\n\targs = append(args, \"-var\")\n\targs = append(args, fmt.Sprintf(\"aws_region=%s\", p.Region))\n\n\targs = append(args, \"-var\")\n\targs = append(args, fmt.Sprintf(\"apex_environment=%s\", p.Environment))\n\n\tif p.Role != \"\" {\n\t\targs = append(args, \"-va...
[ "public LHS toLHS( CallStack callstack, Interpreter interpreter)\n throws EvalError\n {\n // loosely typed map expression new {a=1, b=2} are treated\n // as non assignment (LHS) to retrieve Map.Entry key values\n // then wrapped in a MAP_ENTRY type LHS for value assignment.\n r...
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Sets the singular forn of the name to use in PHP sources. It will generate a phpName from its name if no $phpSingularName is passed. @param string $phpSingularName
[ "public function setPhpSingularName($phpSingularName = null)\n {\n if (null === $phpSingularName) {\n $this->phpSingularName = self::generatePhpSingularName($this->getPhpName());\n } else {\n $this->phpSingularName = $phpSingularName;\n }\n }" ]
[ "public String filePath(int index, String savePath) {\n // not calling the corresponding swig function because internally,\n // the use of the function GetStringUTFChars does not consider the case of\n // a copy not made\n return savePath + File.separator + fs.file_path(index);\n }" ]
codesearchnet
{ "query": "Represent the instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
过滤传递的空参数 @param &$params @return void
[ "protected function filterEmptyParams(&$params)\n {\n foreach ($params as $key => $item) {\n if (empty($item)) {\n unset($params[$key]);\n }\n }\n }" ]
[ "public static String getTransferQueue(String name) {\n LOG.debug(\"对于需要保序的情况,只应该启动单个中转节点,目前启动多个节点原节点会被挤掉线,但是由于重连机制,会轮着挤掉线\");\n return IdManager.generateStaticQueueId(buildTransferName(name));\n }" ]
codesearchnet
{ "query": "Represent the Github post about text processing:", "pos": "Represent the Github code about text processing:", "neg": "Represent the Github code:" }
// SetReplicationTaskArn sets the ReplicationTaskArn field's value.
[ "func (s *ModifyReplicationTaskInput) SetReplicationTaskArn(v string) *ModifyReplicationTaskInput {\n\ts.ReplicationTaskArn = &v\n\treturn s\n}" ]
[ "function(apiClient) {\n this.apiClient = apiClient || Configuration.default.getDefaultApiClient() || ApiClient.instance;\n\n\n this.setApiClient = function(apiClient) {\n this.apiClient = apiClient;\n };\n\n this.getApiClient = function() {\n return this.apiClient;\n };\n\n\n /**\n ...
codesearchnet
{ "query": "Represent the comment about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Software development:" }
@name setCountLike () @author Can Berkol @since 1.0.0 @version 1.0.0 @use $this->setModified() @param mixed $count_like @return object $this
[ "public function setCountLike($count_like) {\r\n if(!$this->setModified('count_like', $count_like)->isModified()) {\r\n return $this;\r\n }\r\n\t\t$this->count_like = $count_like;\r\n\t\treturn $this;\r\n }" ]
[ "static function init() {return dfcf(function() {\n\t\t$appId = S::s()->appId(); /** @var string|null $appId */\n\t\treturn !$appId ? '' : df_block_output(__CLASS__, 'init', ['appId' => $appId]);\n\t});}" ]
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
show messages in UI
[ "function showMessage(userId, msg, attachmentFileId) {\n var userLogin = getUserLoginById(userId);\n var messageHtml = buildMessageHTML(msg.body, userLogin, new Date(), attachmentFileId, msg.id);\n\n $('#messages-list').append(messageHtml);\n\n // scroll to bottom\n var mydiv = $('#messages-list');\n...
[ "def openCurrentItem(self):\n \n logger.debug(\"openCurrentItem\")\n _currentItem, currentIndex = self.getCurrentItem()\n if not currentIndex.isValid():\n return\n\n # Expanding the node will call indirectly call RepoTreeModel.fetchMore which will call\n # BaseRt...
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code:" }
// next returns the next token.
[ "func (t *Template) next() item {\n\tif t.peekCount > 0 {\n\t\tt.peekCount--\n\t} else {\n\t\tt.token[0] = t.lex.nextItem()\n\t}\n\treturn t.token[t.peekCount]\n}" ]
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the summarization about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
// Error can be either of the following types: // // - InvalidObjectFault // - RuntimeFault
[ "func (service *VboxPortType) IBIOSSettingsgetPXEDebugEnabled(request *IBIOSSettingsgetPXEDebugEnabled) (*IBIOSSettingsgetPXEDebugEnabledResponse, error) {\n\tresponse := new(IBIOSSettingsgetPXEDebugEnabledResponse)\n\terr := service.client.Call(\"\", request, response)\n\tif err != nil {\n\t\treturn nil, err\n\t}\...
[ "@Help(help = \"Create the object of type {#}\")\n public T create(final T object) throws SDKException {\n return (T) requestPost(object);\n }" ]
codesearchnet
{ "query": "Represent the Github summarization about Computer Science:", "pos": "Represent the Github code about Computer Science:", "neg": "Represent the Github code:" }
===================================================================
[ "private String[] stringVect2StringArray(final Vector v) {\n final String[] array = new String[v.size()];\n for (int i = 0; i < v.size(); i++) {\n array[i] = (String) v.elementAt(i);\n }\n return array;\n }" ]
[ "function writeTimeBound(type, prmname, boundType, outputType) {\n return utils.parts(type, {\n B : prmname,\n // TODO: is this correct?\n C : boundType+'_'+(type === 'QU' ? 'UBT' : 'LBT')+'(KAF)',\n E : '1MON'\n }, outputType);\n //A=HEXT2014 B=SR-CMN_SR-CMN C=STOR_UBT(KAF) E=1MON F=CAMANCHE R FLOOD...
codesearchnet
{ "query": "Represent the Github sentence about N/A:", "pos": "Represent the Github code about N/A:", "neg": "Represent the Github code:" }
{{{ private static function getFieldNameArray()
[ "private static function getFieldNameArray($fields)\n {\n if (count($fields) === 0) {\n return;\n }\n\n $names = array();\n\n foreach ($fields as &$field) {\n $names[] = $field->name;\n }\n\n return $names;\n }" ]
[ "protected final function AddCssClassField()\n {\n $name = 'CssClass';\n $this->AddField(Input::Text($name, $this->Content()->GetCssClass()), false, Trans(\"Core.ContentForm.$name\"));\n }" ]
codesearchnet
{ "query": "Represent the summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Check if a plugin is active @return bool @throws \Exception
[ "public function isActive()\n {\n // wee need a namespace first\n if(!isset($this->namespace)) {\n return false;\n }\n\n // Plugin is not active is it's not installed\n if(!self::isInstalled($this->namespace)) {\n return false;\n }\n\n if(!$t...
[ "function validateService($pluginInstance)\n {\n if (! is_object($pluginInstance) )\n throw new \\Exception(sprintf('Can`t resolve to (%s) Instance.', $pluginInstance));\n\n if (!$pluginInstance instanceof aGrantRequest)\n throw new exContainerInvalidServiceType('Invalid Plugi...
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
modified from https://github.com/vuejs/vue/blob/v2.5.17/src/compiler/parser/index.js#L370-L387
[ "function parseVueFor(value) {\n const forAliasRE = /([^]*?)\\s+(in|of)\\s+([^]*)/;\n const forIteratorRE = /,([^,}\\]]*)(?:,([^,}\\]]*))?$/;\n const stripParensRE = /^\\(|\\)$/g;\n\n const inMatch = value.match(forAliasRE);\n if (!inMatch) {\n return;\n }\n const res = {};\n res.for = inMatch[3].trim();...
[ "func IsNotFoundError(err error) bool {\n\tes := err.Error()\n\tif strings.Contains(es, \"does not exist\") {\n\t\t// set with the same name already exists\n\t\t// xref: https://github.com/Olipro/ipset/blob/master/lib/errcode.c#L32-L33\n\t\treturn true\n\t}\n\tif strings.Contains(es, \"element is missing\") {\n\t\t...
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Add a cookie. @param KHttpCookie $cookie
[ "public function addCookie(KHttpCookie $cookie)\n {\n $this->_cookies[$cookie->domain][(string) $cookie->path][$cookie->name] = $cookie;\n }" ]
[ "def getKeySequenceCounter(self):\n \"\"\"\"\"\"\n print '%s call getKeySequenceCounter' % self.port\n keySequence = ''\n keySequence = self.__sendCommand(WPANCTL_CMD + 'getprop -v Network:KeyIndex')[0]\n return keySequence" ]
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Return the factory defined for the named reporter @param string $name @return null|string|callable
[ "public function getReporterFactory($name)\n {\n $definition = $this->getReporterDefinition($name);\n if (! isset($definition['factory'])) {\n $definition['factory'] = null;\n }\n return $definition['factory'];\n }" ]
[ "function validateService($pluginInstance)\n {\n if (! is_object($pluginInstance) )\n throw new \\Exception(sprintf('Can`t resolve to (%s) Instance.', $pluginInstance));\n\n if (!$pluginInstance instanceof aGrantRequest)\n throw new exContainerInvalidServiceType('Invalid Plugi...
codesearchnet
{ "query": "Represent the Github post about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Software development:" }
GEN-LAST:event_btImportActionPerformed
[ "private void btListActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_btListActionPerformed\n {//GEN-HEADEREND:event_btListActionPerformed\n\n ListDialog dlg = new ListDialog(this, true, corpusAdministration);\n dlg.setVisible(true);\n\n }" ]
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code:" }
// GetGitRepoName return git repo name
[ "func GetGitRepoName(url string) (string, error) {\n\tif !(strings.Contains(url, \"git@\") || strings.Contains(url, \"gitlab@\") || strings.Contains(url, \"https://\")) ||\n\t\t!strings.HasSuffix(url, \".git\") {\n\t\treturn \"\", fmt.Errorf(\"Bad git url format %q\", url)\n\t}\n\n\treturn strings.TrimSuffix(Tail(u...
[ "public String filePath(int index, String savePath) {\n // not calling the corresponding swig function because internally,\n // the use of the function GetStringUTFChars does not consider the case of\n // a copy not made\n return savePath + File.separator + fs.file_path(index);\n }" ]
codesearchnet
{ "query": "Represent the Github summarization about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
// pushDownTopNToChild will push a topN to one child of join. The idx stands for join child index. 0 is for left child.
[ "func (p *LogicalJoin) pushDownTopNToChild(topN *LogicalTopN, idx int) LogicalPlan {\n\tif topN == nil {\n\t\treturn p.children[idx].pushDownTopN(nil)\n\t}\n\n\tfor _, by := range topN.ByItems {\n\t\tcols := expression.ExtractColumns(by.Expr)\n\t\tfor _, col := range cols {\n\t\t\tif p.children[1-idx].Schema().Cont...
[ "@Override\n public <T> Streamlet<T> applyOperator(IStreamletOperator<R, T> operator) {\n checkNotNull(operator, \"operator cannot be null\");\n\n // By default, NoneStreamGrouping stategy is used. In this stategy, tuples are forwarded\n // from parent component to a ramdon one of all the instances of the...
codesearchnet
{ "query": "Represent the comment about Computer Science:", "pos": "Represent the code about Computer Science:", "neg": "Represent the code about Programming:" }
set the source image path
[ "public function source($path, $override_chroot = false) {\n\t\t// if chroot is enabled, restrict the path to the chroot\n\t\t$this->Source = Filesystem::chroot($path, $override_chroot);\n\t\t// return self\n\t\treturn($this);\n\t}" ]
[ "def transform_cb(self, setting, value):\n \"\"\"\"\"\"\n self.make_callback('transform')\n\n # whence=0 because need to calculate new extents for proper\n # cutout for rotation (TODO: always make extents consider\n # room for rotation)\n whence = 0\n self.redraw(wh...
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// NewBufferStore creates a BufferStore using r for read.
[ "func NewBufferStore(r Retriever, cap int) *BufferStore {\n\tif cap <= 0 {\n\t\tcap = DefaultTxnMembufCap\n\t}\n\treturn &BufferStore{\n\t\tr: r,\n\t\tMemBuffer: &lazyMemBuffer{cap: cap},\n\t}\n}" ]
[ "@Override\n public void init(TCPWriteRequestContext x, H2MuxTCPWriteCallback c) {\n writeReqContext = x;\n muxCallback = c;\n\n // callback will need to know how to get back to this write queue.\n // This means one and only one H2WriteTree per H2InboundLink which has just one true TC...
codesearchnet
{ "query": "Represent the Github sentence about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
Get the replacement for given word @param string $word Original word @return string Replacement if the word is censored, or the original word otherwise
[ "protected function getReplacement($word)\n\t{\n\t\tif ($this->isAllowed($word))\n\t\t{\n\t\t\treturn $word;\n\t\t}\n\n\t\tforeach ($this->replacements as list($regexp, $replacement))\n\t\t{\n\t\t\tif (preg_match($regexp, $word))\n\t\t\t{\n\t\t\t\treturn $replacement;\n\t\t\t}\n\t\t}\n\n\t\treturn $this->defaultRep...
[ "def _clean_suffix(string, suffix):\n \n suffix_len = len(suffix)\n\n if len(string) < suffix_len:\n # the string param was shorter than the suffix\n raise ValueError(\"A suffix can not be bigger than string argument.\")\n if string.endswith(suffix):\n # return from the beginning up...
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Security scan. Scan for such as embedded php code in the uploaded file. @return boolean Return true on safety, return false for otherwise.
[ "protected function securityScan()\n {\n if (\n is_array($this->files[$this->input_file_name]) && \n array_key_exists('name', $this->files[$this->input_file_name]) && \n array_key_exists('tmp_name', $this->files[$this->input_file_name]) && \n $this->files[$this-...
[ "private function writeToOutputNow($output)\n {\n if ($this->sendHttpCode() && \\Whoops\\Util\\Misc::canSendHeaders()) {\n $httpCode = $this->sendHttpCode();\n\n if (function_exists('http_response_code')) {\n http_response_code($httpCode);\n } else {\n ...
codesearchnet
{ "query": "Represent the summarization about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
All valid states; "Q" in the mathematical description of a state machine.
[ "def states(self):\n \n return frozenset(\n chain.from_iterable(\n (inState, outState)\n for\n (inState, inputSymbol, outState, outputSymbol)\n in self._transitions\n )\n )" ]
[ "def star_sep_check(self, original, loc, tokens):\n \"\"\"\"\"\"\n return self.check_py(\"3\", \"keyword-only argument separator (add 'match' to front to produce universal code)\", original, loc, tokens)" ]
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
/* (non-Javadoc) @see mtas.codec.util.DataCollector.MtasDataOperations#add11(java.lang.Number, java.lang.Number)
[ "@Override\n public Long add11(Long arg1, Long arg2) {\n if (arg1 == null || arg2 == null) {\n return null;\n } else {\n return arg1 + arg2;\n }\n }" ]
[ "public PythonDataStream add_java_source(SourceFunction<Object> src) {\n\t\treturn new PythonDataStream<>(env.addSource(src).map(new AdapterMap<>()));\n\t}" ]
codesearchnet
{ "query": "Represent the Github summarization about Java programming:", "pos": "Represent the Github code about Java programming:", "neg": "Represent the Github code:" }
Read input from <bedfile>, set the width of all entries to <width> and write the result to <outfile>. Input file needs to be in BED or WIG format.
[ "def write_equalwidth_bedfile(bedfile, width, outfile):\n \"\"\"\"\"\"\n\n BUFSIZE = 10000\n f = open(bedfile)\n out = open(outfile, \"w\")\n lines = f.readlines(BUFSIZE)\n line_count = 0\n while lines:\n for line in lines:\n line_count += 1\n if not line.startswith...
[ "def handle_dims(opts):\n '''\n \n '''\n use,res = [],[];\n if opts['--X']:\n use.append('x');\n res.append(int(opts['--xres']));\n if opts['--Y']:\n use.append('y');\n res.append(int(opts['--yres']));\n if opts['--Z']:\n use.append('z');\n res.append(i...
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Attach an authenticator @param mixed $authenticator An object that implements DispatcherAuthenticatorInterface, an ObjectIdentifier or valid identifier string @param array $config An optional associative array of configuration options @return $this
[ "public function addAuthenticator($authenticator, $config = array())\n {\n //Create the complete identifier if a partial identifier was passed\n if (is_string($authenticator) && strpos($authenticator, '.') === false)\n {\n $identifier = $this->getIdentifier()->toArray();\n\n ...
[ "public static function current()\n {\n if (static::$_current === null) {\n if ($token = AuthToken::current()) {\n //\n // TODO: (known bug)\n // When accessing $token->auth inside an observer other than `auth`,\n // the table name of ...
codesearchnet
{ "query": "Represent the summarization about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Software development:" }
// GET /servers/{id}/hardware/hdds/{id}
[ "func (api *API) GetServerHdd(server_id string, hdd_id string) (*Hdd, error) {\n\tresult := new(Hdd)\n\turl := createUrl(api, serverPathSegment, server_id, \"hardware/hdds\", hdd_id)\n\terr := api.Client.Get(url, &result, http.StatusOK)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tresult.api = api\n\treturn resu...
[ "def os_change_list(self, subid, params=None):\n ''' \n '''\n params = update_params(params, {'SUBID': subid})\n return self.request('/v1/server/os_change_list', params, 'GET')" ]
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code:" }
Exports a coverage to a Istanbul compatible JSON format. @param array $options The option array where the possible values are: -`'collector'` _object_ : The collector instance. @return string
[ "public static function export($options)\n {\n $defaults = [\n 'collector' => null,\n 'base_path' => getcwd()\n ];\n $options += $defaults;\n\n $collector = $options['collector'];\n\n $export = [];\n\n $base = $options['base_path'] ? rtrim($options[...
[ "def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)" ]
codesearchnet
{ "query": "Represent the comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Deletes the line content after the cursor
[ "def _end_del(self):\n \n text = self.edit_text[:self.edit_pos]\n self.set_edit_text(text)" ]
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code:" }
Set jpeg adapter @param \PHPImageOptim\Tools\Jpeg\JpegOptim $jpegOptim @return \Extlib\ImageOptimizer
[ "public function setJpegOptim(\\PHPImageOptim\\Tools\\Jpeg\\JpegOptim $jpegOptim)\n {\n $this->jpegOptim = $jpegOptim;\n return $this;\n }" ]
[ "final public static function sinfo(array $params):string\n {\n return (\\iumioFramework\\Core\\Base\\Server\\GlobalServer::getServerInfo($params['name']));\n }" ]
codesearchnet
{ "query": "Represent the description about Image compression:", "pos": "Represent the code about Image compression:", "neg": "Represent the code about programming:" }
// ReadSSHIdentityFromKeyPair reads identity from initialized keypair
[ "func ReadSSHIdentityFromKeyPair(keyBytes, certBytes []byte) (*Identity, error) {\n\tif len(keyBytes) == 0 {\n\t\treturn nil, trace.BadParameter(\"PrivateKey: missing private key\")\n\t}\n\n\tif len(certBytes) == 0 {\n\t\treturn nil, trace.BadParameter(\"Cert: missing parameter\")\n\t}\n\n\tpubKey, _, _, _, err := ...
[ "private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo...
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Remove an account from any list
[ "def unlist(ctx, unlist_account, account):\n \n account = Account(account, blockchain_instance=ctx.blockchain)\n print_tx(account.nolist(unlist_account))" ]
[ "protected function addSynchronizationInformation()\n {\n $this->html->pInfo($this->_(\n 'Check source for new surveys, changes in survey status and survey deletion. Can also perform maintenance on some sources, e.g. by changing the number of attributes.'\n ));\n $this...
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code about Data synchronization:" }
Invokes an override for a method. @param req The request @param cookie The cookie @return The method's return value
[ "private JsonNode invokeCallbackMethod(final InvokeRequest req, final String cookie) {\n Object obj = this.getObject(req.getObjref());\n Method method = this.findCallbackMethod(obj.getClass(), cookie);\n\n final Class<?>[] argTypes = method.getParameterTypes();\n final Object[] args = ne...
[ "def processRequest(cls, ps, **kw):\n \n resource = kw['resource']\n method = resource.getOperation(ps, None) # This getOperation method is valid for ServiceSOAPBinding subclass\n rsp = method(ps, **kw)[1] # return (request, response) but we only need response\n return rsp" ]
codesearchnet
{ "query": "Represent the instruction about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Computer Science:" }
Gets the rendering height of strings. @return the string height
[ "public float getStringHeight(String text, FontOptions options)\n\t{\n\t\tStringWalker walker = new StringWalker(text, options);\n\t\twalker.walkToEnd();\n\t\treturn walker.lineHeight();\n\t}" ]
[ "def transform_cb(self, setting, value):\n \"\"\"\"\"\"\n self.make_callback('transform')\n\n # whence=0 because need to calculate new extents for proper\n # cutout for rotation (TODO: always make extents consider\n # room for rotation)\n whence = 0\n self.redraw(wh...
codesearchnet
{ "query": "Represent the sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Returns the actual read- and editable config IN: file (type: str, hint: should be a valid path)
[ "def load(self, file):\n\t\t\n\t\tif isfile(file):\n\t\t\ttry:\n\t\t\t\tconfig = load_source(\"config\", file)\n\t\t\texcept Exception as e:\n\t\t\t\traise ExceptionInConfigError(e)\n\t\t\toption_missing = False\n\t\t\tvalues = {}\n\t\t\tfor option in self.options:\n\t\t\t\t# Make sure all options are avaliable (va...
[ "public String filePath(int index, String savePath) {\n // not calling the corresponding swig function because internally,\n // the use of the function GetStringUTFChars does not consider the case of\n // a copy not made\n return savePath + File.separator + fs.file_path(index);\n }" ]
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
returns how much to add to offset
[ "private int generateGroupEncodeDecode(\n final List<Token> tokens,\n final String typeName,\n final StringBuilder encode,\n final StringBuilder decode,\n final StringBuilder rc,\n final int currentOffset)\n {\n final char varName = Character.toLowerCase(typeName....
[ "def transform_cb(self, setting, value):\n \"\"\"\"\"\"\n self.make_callback('transform')\n\n # whence=0 because need to calculate new extents for proper\n # cutout for rotation (TODO: always make extents consider\n # room for rotation)\n whence = 0\n self.redraw(wh...
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// CompareToDef compare this synthdef to another.
[ "func (def *Synthdef) CompareToDef(other *Synthdef) (bool, error) {\n\tvar (\n\t\tbuf1 = &bytes.Buffer{}\n\t\tbuf2 = &bytes.Buffer{}\n\t)\n\tif err := def.Write(buf1); err != nil {\n\t\treturn false, err\n\t}\n\tif err := other.Write(buf2); err != nil {\n\t\treturn false, err\n\t}\n\treturn compareBytes(buf1.Bytes(...
[ "public LHS toLHS( CallStack callstack, Interpreter interpreter)\n throws EvalError\n {\n // loosely typed map expression new {a=1, b=2} are treated\n // as non assignment (LHS) to retrieve Map.Entry key values\n // then wrapped in a MAP_ENTRY type LHS for value assignment.\n r...
codesearchnet
{ "query": "Represent the comment:", "pos": "Represent the code:", "neg": "Represent the code:" }
Gets optional if true. @param <T> the type parameter @param bool the bool @param target the target @return the optional if true
[ "public static <T> Optional<T> getOptionalIfTrue(boolean bool, T target) {\n return bool ? Optional.ofNullable(target) : Optional.empty();\n }" ]
[ "@SuppressWarnings(\"unchecked\")\n public <T> Param<T> get(int index) {\n // TODO: Provide a more type safe API. E.g. make index a pojo typed on T which is aligned with the Param<T>\n return (Param<T>) params[index];\n }" ]
codesearchnet
{ "query": "Represent the summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }
The validateTokens event is triggered before every request. It's a moment where this plugin can check all the supplied lock tokens in the If: header, and check if they are valid. @param RequestInterface $request @param array $conditions
[ "public function validateTokens(RequestInterface $request, &$conditions)\n {\n foreach ($conditions as $kk => $condition) {\n foreach ($condition['tokens'] as $ii => $token) {\n // Sync-tokens must always start with our designated prefix.\n if (self::SYNCTOKEN_PREF...
[ "public static function current()\n {\n if (static::$_current === null) {\n if ($token = AuthToken::current()) {\n //\n // TODO: (known bug)\n // When accessing $token->auth inside an observer other than `auth`,\n // the table name of ...
codesearchnet
{ "query": "Represent the post about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Software development:" }
Perform the attribute conversion process. @param array $attributes @param bool $toLdap @return array
[ "protected function convert(array $attributes, $toLdap = true)\n {\n $direction = $toLdap ? 'toLdap' : 'fromLdap';\n\n foreach ($attributes as $attribute => $values) {\n // No converter, but the value should still be encoded.\n if (!$this->schema->hasConverter($attribute) && !...
[ "public function toFieldDefinition(StorageFieldDefinition $storageDef, FieldDefinition $fieldDef)\n {\n // @todo: Is it possible to store a default value in the DB?\n $fieldDef->defaultValue = new FieldValue();\n $fieldDef->defaultValue->data = array('text' => null);\n }" ]
codesearchnet
{ "query": "Represent the Github sentence about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
Converts the given source parameter to an array. @param array|ArrayAccess $source @return array
[ "protected function getSourceAsArray($source)\n {\n if (!is_array($source) && !($source instanceof ArrayAccess)) {\n user_error('$source passed in as invalid type', E_USER_ERROR);\n }\n \n if ($source instanceof SS_List || $source instanceof Map) {\n $source = $s...
[ "public List<Symbol> getSymbolList(final String param) {\n return get(param, new StringToSymbolList(\",\"),\n new AlwaysValid<List<Symbol>>(),\n \"comma-separated list of strings\");\n }" ]
codesearchnet
{ "query": "Represent the summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Documentation:" }
// skipWhitespace consumes whitespace characters and comments. // It returns true if there was actually anything to skip.
[ "func (p *parser) skipWhitespace() bool {\n\ti := p.i\n\tfor i < len(p.s) {\n\t\tswitch p.s[i] {\n\t\tcase ' ', '\\t', '\\r', '\\n', '\\f':\n\t\t\ti++\n\t\t\tcontinue\n\t\tcase '/':\n\t\t\tif strings.HasPrefix(p.s[i:], \"/*\") {\n\t\t\t\tend := strings.Index(p.s[i+len(\"/*\"):], \"*/\")\n\t\t\t\tif end != -1 {\n\t\...
[ "function skip1(previousExpr) {\n \n \n if( previousExpr == always ) {\n /* If there is no previous expression this consume command \n is at the start of the jsonPath.\n Since JSONPath specifies what we'd like to find but not \n necessarily everything leading down t...
codesearchnet
{ "query": "Represent the summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Returns all atoms in AMPAL object within `cut-off` distance from the `point`.
[ "def is_within(self, cutoff_dist, point, ligands=True):\n \"\"\"\"\"\"\n return find_atoms_within_distance(self.get_atoms(ligands=ligands), cutoff_dist, point)" ]
[ "def transform_cb(self, setting, value):\n \"\"\"\"\"\"\n self.make_callback('transform')\n\n # whence=0 because need to calculate new extents for proper\n # cutout for rotation (TODO: always make extents consider\n # room for rotation)\n whence = 0\n self.redraw(wh...
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Return list of trainable params in `m`.
[ "def trainable_params(m:nn.Module)->ParamList:\n \"\"\n res = filter(lambda p: p.requires_grad, m.parameters())\n return res" ]
[ "def optimizer(self) -> Union[mx.optimizer.Optimizer, SockeyeOptimizer]:\n \n # TODO: Push update to MXNet to expose the optimizer (Module should have a get_optimizer method)\n return self.current_module._optimizer" ]
codesearchnet
{ "query": "Represent the comment about Natural Language Processing:", "pos": "Represent the code about Natural Language Processing:", "neg": "Represent the code about programming:" }
Returns the COID itself if it is a root COID or a new IRI object representing the namespace underlying the given COID. @param IRI $coid @return IRI|null
[ "public static function getNamespaceCOID(IRI $coid) {\n switch (self::getType($coid)) {\n case self::COID_ROOT:\n return $coid;\n case self::COID_UNVERSIONED:\n case self::COID_VERSIONED:\n case self::COID_VERSION_WILDCARD:\n return new IRI('coid://'.$coid->getHost());\n de...
[ "public LHS toLHS( CallStack callstack, Interpreter interpreter)\n throws EvalError\n {\n // loosely typed map expression new {a=1, b=2} are treated\n // as non assignment (LHS) to retrieve Map.Entry key values\n // then wrapped in a MAP_ENTRY type LHS for value assignment.\n r...
codesearchnet
{ "query": "Represent the Github summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Checks if the response is valid @return bool
[ "public function isValid(ShaComposer $shaComposer)\n {\n if (function_exists('hash_equals')) {\n return hash_equals($shaComposer->compose($this->parameters), $this->shaSign);\n } else {\n return $shaComposer->compose($this->parameters) == $this->shaSign;\n }\n }" ]
[ "def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p" ]
codesearchnet
{ "query": "Represent the Github description about NLP:", "pos": "Represent the Github code about NLP:", "neg": "Represent the Github code:" }
Send content to a gitter.im chat room through the rest api. @param string $content @see https://developer.gitter.im/docs/messages-resource
[ "protected function send($content)\n {\n $url = sprintf('https://%s/%s/%s/%s', self::HOST, self::ROOMS_ENDPOINT, $this->roomId, self::MESSAGES_ENDPOINT);\n $data = json_encode(array('text' => $content));\n $headers = array(\n 'Content-Type: application/json',\n 'Accept:...
[ "def tempo_account_add_account(self, data=None):\n \n url = 'rest/tempo-accounts/1/account/'\n if data is None:\n return \"\"\"Please, provide data e.g.\n {name: \"12312312321\",\n key: \"1231231232\",\n lead: {name: \...
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Programming:" }
Creates a processing item with a specific processor and paralellism level. @param processor @param parallelism @return ProcessingItem
[ "private ProcessingItem createPi(Processor processor, int parallelism) {\n ProcessingItem pi = this.componentFactory.createPi(processor, parallelism);\n this.topology.addProcessingItem(pi, parallelism);\n return pi;\n }" ]
[ "def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)" ]
codesearchnet
{ "query": "Represent the Github sentence about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code:" }
Execute the console command. @return mixed
[ "public function handle()\n {\n try {\n\n // replace all space after ucwords\n $class_name = preg_replace('/\\s+/', '', ucwords($this->argument('name')));\n\n //retrieves store directory configuration\n $directory = $this->option('directory') ? $this->appPath($t...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
@param string $command @return array
[ "public function exec( $command ) {\n\t\t$command .= ' 2>&1';\n\t\t$command = escapeshellcmd( $command );\n\t\texec( $command, $output, $return_var );\n\n\t\treturn [ $output, $return_var ];\n\t}" ]
[ "final protected function c() {return dfc($this, function() {/** @var int|null $id $id */return\n\t\t!($id = $this->o()->getCustomerId()) ? null : df_customer($id)\n\t;});}" ]
codesearchnet
{ "query": "Represent the comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
// Endpoint returns a usable endpoint that will invoke the gRPC specified by the // client.
[ "func (c Client) Endpoint() endpoint.Endpoint {\n\treturn func(ctx context.Context, request interface{}) (response interface{}, err error) {\n\t\tctx, cancel := context.WithCancel(ctx)\n\t\tdefer cancel()\n\n\t\tif c.finalizer != nil {\n\t\t\tdefer func() {\n\t\t\t\tfor _, f := range c.finalizer {\n\t\t\t\t\tf(ctx,...
[ "@Override\n\tpublic void validateSetup(Server server, Query query) throws ValidationException {\n\t\tlogger.info(\"Starting Stackdriver writer connected to '{}', proxy {} ...\", gatewayUrl, proxy);\n\t}" ]
codesearchnet
{ "query": "Represent the Github instruction about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Programming:" }
Specify a unique index for the table. @param string|array $columns @param string $name @param string|null $algorithm @return \Illuminate\Support\Fluent
[ "public function unique($columns, $name = null, $algorithm = null)\n {\n return $this->indexCommand('unique', $columns, $name, $algorithm);\n }" ]
[ "public function onMixin(ObjectMixable $mixer)\n {\n parent::onMixin($mixer);\n\n if ($mixer instanceof ModelDatabase)\n {\n $table = $mixer->getTable();\n\n // Set the dynamic states based on the unique table keys\n foreach ($table->getUniqueColumns() as $ke...
codesearchnet
{ "query": "Represent the summarization about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code about programming:" }
// SetUserId sets the UserId field's value.
[ "func (s *UserError) SetUserId(v string) *UserError {\n\ts.UserId = &v\n\treturn s\n}" ]
[ "def initialize(self, id=None, text=None):\n self.id = none_or(id, int)\n \n\n self.text = none_or(text, str)\n \"\"\"\n Username or IP address of the user at the time of the edit : str | None\n \"\"\"" ]
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Get image type if it is one of: .gif, .jpg or .png @param string $file Full path to file @return string|boolean
[ "static public function type($file) {\n $type = getimagesize($file);\n $type = $type[2];\n switch($type) {\n case IMAGETYPE_GIF: return 'gif';\n case IMAGETYPE_JPEG: return 'jpg';\n case IMAGETYPE_PNG: return 'png';\n }\n return FALSE;\n...
[ "public function reduceFilePath($varValue, \\DataContainer $dc)\n {\n $doc = $dc->activeRecord;\n\n $path = \\FilesModel::findByUuid($varValue)->path;\n\n $arrFileNameParts = \\Document::splitFileName(substr($path, strlen(\\DmsConfig::getBaseDirectory(true))));\n\n // TODO (#33): reset the new fileType...
codesearchnet
{ "query": "Represent the Github description about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about Software development:" }
发送短信 @param string $mobile 手机号码 @param string $msg 短信内容 @param string $needstatus 是否需要状态报告
[ "public function sendSMS( $mobile, $msg, $needstatus = 'false') {\n\n\t\t//创蓝接口参数\n\t\t$postArr = array (\n\t\t\t\t 'account' => $this->apiAccount,\n\t\t\t\t 'pswd' => $this->apiPassword,\n\t\t\t\t 'msg' => $msg,\n\t\t\t\t 'mobile' => $mobile,\n\t\t\t\t 'needstatus' => $...
[ "public function info() {\n /**\n * avatar\t用户头像\tString\t如果没有数据的时候不会返回该数据,请做好容错\t可空\thttps://tfsimg.alipay.com/images/partner/T1k0xiXXRnXXXXXXXX\n nick_name\t用户昵称\tString\t如果没有数据的时候不会返回该数据,请做好容错\t可空\t张三\n province\t省份\tString\t用户注册时填写的省份 如果没有数据的时候不会返回该数据,请做好容错\t可空\t浙江省\n city\t城...
codesearchnet
{ "query": "Represent the sentence about PHP programming:", "pos": "Represent the code about PHP programming:", "neg": "Represent the code about programming:" }
// GetChannelByID return the channel by the channel id. // // NOTE: This method is part of the ChannelGraphSource interface.
[ "func (r *ChannelRouter) GetChannelByID(chanID lnwire.ShortChannelID) (\n\t*channeldb.ChannelEdgeInfo,\n\t*channeldb.ChannelEdgePolicy,\n\t*channeldb.ChannelEdgePolicy, error) {\n\n\treturn r.cfg.Graph.FetchChannelEdgesByID(chanID.ToUint64())\n}" ]
[ "func New(*SmartSampleConfig, log.Logger, dtsink) (*SmartSampler, error) {\n\treturn nil, errors.New(\"you are attempting to configure a regular SignalFx Gateway with the config of a Smart Gateway. This is an unsupported configuration\")\n}" ]
codesearchnet
{ "query": "Represent the summarization about Graph API:", "pos": "Represent the code about Graph API:", "neg": "Represent the code about programming:" }
Check that all required attributes have been set
[ "@Override\n protected void checkParameters() {\n super.checkParameters();\n\n if (projectFile == null && classLocations.size() == 0 && filesets.size() == 0 && dirsets.size() == 0 && auxAnalyzepath == null) {\n throw new BuildException(\"either projectfile, <class/>, <fileset/> or <auxAn...
[ "def is_background_knowledge(stmt):\n ''''''\n any_background = False\n # Iterate over all evidence for the statement\n for ev in stmt.evidence:\n epi = ev.epistemics\n if epi is not None:\n sec = epi.get('section_type')\n # If there is at least one evidence not from ...
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Check for dependency cycles.
[ "def cleanup(self):\n \n if not self.pending_children:\n return\n\n nclist = [(n, find_cycle([n], set())) for n in self.pending_children]\n\n genuine_cycles = [\n node for node,cycle in nclist\n if cycle or node.get_state() != NODE_EXECUTED\n ...
[ "def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p" ]
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code:" }
Load the page. The _file_name param is known, because this method is only called after having checked that the page exists.
[ "def _load(self, slug):\n \n #here we know that the slug exists\n self._slug = slug\n page_dir = os.path.join(self.site.dirs['source'], self._slug)\n page_file_name = os.path.join(page_dir, self._slug + '.md')\n self._dirs['source_dir'] = page_dir\n self._dirs['sourc...
[ "def get_render_language(contentitem):\n \n plugin = contentitem.plugin\n\n if plugin.render_ignore_item_language \\\n or (plugin.cache_output and plugin.cache_output_per_language):\n # Render the template in the current language.\n # The cache also stores the output under the current lang...
codesearchnet
{ "query": "Represent the sentence about File management:", "pos": "Represent the code about File management:", "neg": "Represent the code about Language and programming:" }
Returns list of eZContentClassAttribute objects (represented as subtree limitations) @return eZContentClassAttribute[]
[ "public function getSubTreeLimitations()\n {\n if ( $this->attribute( 'main_tag_id' ) != 0 )\n return array();\n\n return parent::fetchObjectList( eZContentClassAttribute::definition(), null,\n array( 'data_type_string' => '...
[ "private void checkSchemaFields(ZooClassDef schema, Collection<ZooClassDef> cachedSchemata, \n\t\t\tSet<String> missingSchemas) {\n\t\t//do this only now, because only now we can check which field types\n\t\t//are really persistent!\n\t\t//TODO check for field types that became persistent only now -> error!!\n\t\t/...
codesearchnet
{ "query": "Represent the comment about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code about Software development:" }
Read a csv file into a DataAccessObject :param fname: filename
[ "def read_csv(fname):\n \n values = defaultdict(list)\n with open(fname) as f:\n reader = csv.DictReader(f)\n for row in reader:\n for (k,v) in row.items():\n values[k].append(v)\n npvalues = {k: np.array(values[k]) for k in values.keys()}\n for k in npvalues.k...
[ "def usufyToCsvExport(d, fPath):\n \n\n from pyexcel_io import get_data\n try:\n oldData = {\"OSRFramework\": get_data(fPath) }\n except:\n # No information has been recovered\n oldData = {\"OSRFramework\":[]}\n\n # Generating the new tabular data.\n tabularData = _generateTab...
codesearchnet
{ "query": "Represent the description about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
Gets information about the jobs associated with the subscription. @throws IllegalArgumentException thrown if parameters fail the validation @return the observable to the PagedList&lt;JobInner&gt; object
[ "public Observable<Page<JobInner>> listAsync() {\n return listWithServiceResponseAsync()\n .map(new Func1<ServiceResponse<Page<JobInner>>, Page<JobInner>>() {\n @Override\n public Page<JobInner> call(ServiceResponse<Page<JobInner>> response) {\n ret...
[ "@Help(\n help =\n \"Resumes a NSR that failed while executing a script in a VNFR. The id in the URL specifies the Network Service Record that will be resumed.\"\n )\n public void resume(final String idNsr) throws SDKException {\n String url = idNsr + \"/resume\";\n requestPost(url);\n }" ]
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code:" }
Filters an object from an object schema @param data Object to filter @param schema Fields to keep @returns {*} @private
[ "function _filterByObjectSchema(data, schema) {\n return Object\n .keys(data)\n .filter(function (key) {\n return schema.hasOwnProperty(key);\n })\n .reduce(function (memo, key) {\n var value = data[key];\n var schemaPart = schema[key];\n if...
[ "def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)" ]
codesearchnet
{ "query": "Represent the text about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
Sets the related products
[ "protected function setDataRelatedIndexProduct()\n {\n $products = $this->getRelatedProduct();\n\n if (!empty($products)) {\n\n $pager_options = array(\n 'key' => 'rlp',\n 'total' => count($products),\n 'limit' => $this->config('related_pager_...
[ "def transform_cb(self, setting, value):\n \"\"\"\"\"\"\n self.make_callback('transform')\n\n # whence=0 because need to calculate new extents for proper\n # cutout for rotation (TODO: always make extents consider\n # room for rotation)\n whence = 0\n self.redraw(wh...
codesearchnet
{ "query": "Represent the Github post about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
get menu object and display it for editing
[ "def edit\n @menu = Menu.find(params[:id])\n\n # add breadcrumb and set title\n add_breadcrumb I18n.t(\"controllers.admin.menus.edit.breadcrumb\", menu_name: @menu.name)\n set_title(I18n.t(\"controllers.admin.menus.edit.title\", menu_name: @menu.name))\n end" ]
[ "def template(self):\n \n\n # First try props\n if self.props.template:\n return self.props.template\n else:\n # Return the wtype of the widget, and we'll presume that,\n # like resources, there's a .html file in that directory\n return self.wt...
codesearchnet
{ "query": "Represent the comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Taken and modified from os.makedirs to set user, group and mode for each directory created. CLI Example: .. code-block:: bash salt '*' file.makedirs_perms /opt/code
[ "def makedirs_perms(name,\n user=None,\n group=None,\n mode='0755'):\n '''\n \n '''\n name = os.path.expanduser(name)\n\n path = os.path\n head, tail = path.split(name)\n if not tail:\n head, tail = path.split(head)\n if head and t...
[ "def docker(gandi, vm, args):\n \n if not [basedir for basedir in os.getenv('PATH', '.:/usr/bin').split(':')\n if os.path.exists('%s/docker' % basedir)]:\n gandi.echo(\"\"\"'docker' not found in $PATH, required for this command \\\nto work\nSee https://docs.docker.com/installation/#installat...
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Fetch the dynamic marketplaces configuration for this environment and configure the Maestrano presets @param $preset string Dev-Platform configuration preset @throws Maestrano_Config_Error
[ "public static function loadMarketplacesConfigWithPreset($preset)\n {\n if (self::$cache == NULL)\n self::$cache = new Maestrano_Util_Cache();\n self::$cache->cache_path = dirname(__FILE__) . '/';\n self::$cache->cache_time = 43200; // 12h\n\n if(!$data = self::$cache->get_...
[ "@Override\n\tpublic void validateSetup(Server server, Query query) throws ValidationException {\n\t\tlogger.info(\"Starting Stackdriver writer connected to '{}', proxy {} ...\", gatewayUrl, proxy);\n\t}" ]
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Programming:" }
// SetDependsOn sets the DependsOn field's value.
[ "func (s *SubmitJobInput) SetDependsOn(v []*JobDependency) *SubmitJobInput {\n\ts.DependsOn = v\n\treturn s\n}" ]
[ "private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo...
codesearchnet
{ "query": "Represent the Github instruction about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
Return the matches of the given state |methcoro| Args: state: see :class:`MatchState` Raises: APIException
[ "async def get_matches(self, state: MatchState = MatchState.all_):\n \n matches = await self.connection('GET',\n 'tournaments/{}/matches'.format(self._tournament_id),\n state=state.value,\n ...
[ "def setTargets(self, targets):\n \n if not self.verifyArguments(targets) and not self.patterned:\n raise NetworkError('setTargets() requires [[...],[...],...] or [{\"layerName\": [...]}, ...].', targets)\n self.targets = targets" ]
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code:" }
Get the file format description. This describes the type of data stored on disk.
[ "def get_file_format(self):\n \n # Have cached file format?\n if self._file_fmt is not None:\n return self._file_fmt\n\n # Make the call to retrieve it.\n desc = AudioStreamBasicDescription()\n size = ctypes.c_int(ctypes.sizeof(desc))\n check(_coreaudio.Ex...
[ "def run_objective(objective, _name, raw_output, output_files, threads)\n # output is a, array: [raw_output, output_files].\n # output_files is a hash containing the absolute paths\n # to file(s) output by the target in the format expected by the\n # objective function(s), with keys as the keys ...
codesearchnet
{ "query": "Represent the Github post about File management:", "pos": "Represent the Github code about File management:", "neg": "Represent the Github code:" }
Gets a consumer from the list of consumers on this messaging engine @param id The id to find from the list.
[ "ConsumerSessionImpl getConsumer(long id) {\n if (TraceComponent.isAnyTracingEnabled()\n && tc.isEntryEnabled())\n SibTr.entry(tc, \"getConsumer\", new Long(id));\n\n ConsumerSessionImpl consumer = _consumerList.get(id);\n\n if (TraceComponent.isAnyTracingEnabled()\n ...
[ "def from_bucket(cls, connection, bucket):\n \"\"\"\"\"\"\n if bucket is None:\n raise errors.NoContainerException\n\n # It appears that Amazon does not have a single-shot REST query to\n # determine the number of keys / overall byte size of a bucket.\n return cls(conne...
codesearchnet
{ "query": "Represent the text about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about AWS S3:" }
// SetRegionName sets the RegionName field's value.
[ "func (s *ReplicaSettingsUpdate) SetRegionName(v string) *ReplicaSettingsUpdate {\n\ts.RegionName = &v\n\treturn s\n}" ]
[ "private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo...
codesearchnet
{ "query": "Represent the text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Returns the predecessor of the given element in the list structure defined by this LinkedListManager. @param currentElement @return previous element
[ "@Override\n\tpublic T listGetPrevious(final T currentElement) {\n\n\t\tRelation<T, T, OneStartpoint<T>, OneEndpoint<T>> prevRel = currentElement.getIncomingRelationship(getSiblingLinkType());\n\t\tif (prevRel != null) {\n\n\t\t\treturn (T)prevRel.getSourceNode();\n\t\t}\n\n\t\treturn null;\n\t}" ]
[ "public LHS toLHS( CallStack callstack, Interpreter interpreter)\n throws EvalError\n {\n // loosely typed map expression new {a=1, b=2} are treated\n // as non assignment (LHS) to retrieve Map.Entry key values\n // then wrapped in a MAP_ENTRY type LHS for value assignment.\n r...
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
//Clone makes a new clone of this collector
[ "func (c Collector) Clone() Collector {\n\tcol := make(Collector)\n\tcol.Copy(c)\n\treturn col\n}" ]
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code:" }
Run the database seeds.
[ "public function run()\n {\n // php artisan db:seed --class=\"PermissionRoleTableSeeder\"\n $permissions = Permission::all();\n $adminRole = Role::whereName('admin')->first();\n\n foreach ($permissions as $permission) {\n if (! $adminRole->hasPermissionTo($permission)) {\n ...
[ "@Override\n public void generatePluginConfig(String serverName, File writeDirectory) {\n // Pass true to utilityRequest since this method will be called from the pluginUtility\n // or by the GeneratePluginConfigListener not by a call to the mbean.\n generatePluginConfig(null,serverName,true...
codesearchnet
{ "query": "Represent the Github instruction about Database Management:", "pos": "Represent the Github code about Database Management:", "neg": "Represent the Github code about programming:" }
// GetUserinfo retrieves the userinfo from the // https://graph.facebook.com/v2.9/{user-id} // endpoint.
[ "func (apiutil *ClientUtil) GetUserinfo() (RingCentralExtensionInfo, error) {\n\tresp, err := apiutil.Client.Get(\n\t\turlutil.JoinAbsolute(\n\t\t\tfmt.Sprintf(\"%v://\", httputilmore.SchemeHTTPS), Hostname, MeURL))\n\n\tif err != nil {\n\t\treturn RingCentralExtensionInfo{}, err\n\t}\n\n\tbodyBytes, err := httputi...
[ "def get_api_publisher(self, social_user):\n \n\n def _post(**kwargs):\n api = self.get_api(social_user)\n from pudb import set_trace; set_trace()\n # api.group.getInfo('uids'='your_group_id', 'fields'='members_count')\n #response = api.wall.post(**kwargs)\n...
codesearchnet
{ "query": "Represent the comment about Graph API:", "pos": "Represent the code about Graph API:", "neg": "Represent the code:" }
Revives a marker instance by creating it without constructor invocation. @param string $typeName @param array<string, mixed> $params @return Marker
[ "protected function reviveMarker($typeName, array $params = NULL)\n\t{\n\t\tstatic $refs = [];\n\t\t\n\t\tif(empty($refs[$typeName]))\n\t\t{\n\t\t\t$refs[$typeName] = new \\ReflectionClass($typeName);\n\t\t}\n\t\t\n\t\t$marker = $refs[$typeName]->newInstanceWithoutConstructor();\n\t\t\n\t\tforeach((array)$params as...
[ "public function toFieldDefinition(StorageFieldDefinition $storageDef, FieldDefinition $fieldDef)\n {\n // @todo: Is it possible to store a default value in the DB?\n $fieldDef->defaultValue = new FieldValue();\n $fieldDef->defaultValue->data = array('text' => null);\n }" ]
codesearchnet
{ "query": "Represent the comment about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Starts the async executor
[ "public void start() {\n if (isActive) {\n return;\n }\n\n log.info(\"Starting up the default async job executor [{}].\", getClass().getName());\n \n if (timerJobRunnable == null) {\n timerJobRunnable = new AcquireTimerJobsRunnable(this, processEngineConfiguration.getJobManager());\n }\n...
[ "def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR...
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Instantiates a new tag create struct. @param mixed $parentTagId @param string $mainLanguageCode @return \Netgen\TagsBundle\API\Repository\Values\Tags\TagCreateStruct
[ "public function newTagCreateStruct($parentTagId, $mainLanguageCode)\n {\n $tagCreateStruct = new TagCreateStruct();\n $tagCreateStruct->parentTagId = $parentTagId;\n $tagCreateStruct->mainLanguageCode = $mainLanguageCode;\n\n return $tagCreateStruct;\n }" ]
[ "protected final function AddCssClassField()\n {\n $name = 'CssClass';\n $this->AddField(Input::Text($name, $this->Content()->GetCssClass()), false, Trans(\"Core.ContentForm.$name\"));\n }" ]
codesearchnet
{ "query": "Represent the description about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }