query
stringlengths
16
255
pos
list
neg
list
task
stringclasses
1 value
instruction
dict
// Lenient specifies whether format-based query failures // (such as providing text to a numeric field) should be ignored.
[ "func (s *ValidateService) Lenient(lenient bool) *ValidateService {\n\ts.lenient = &lenient\n\treturn s\n}" ]
[ "def generate(options, command: nil)\n # First, enable `always_trace`, to show the stack trace\n always_trace!\n\n used_switches = []\n options.each do |option|\n next if option.description.to_s.empty? # \"private\" options\n next unless option.display_in_shell\n\n short_swi...
codesearchnet
{ "query": "Represent the Github text about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
Add the requested query string arguments to the Request. @param request Request to add query string arguments to
[ "private void addQueryParams(final Request request) {\n if (priority != null) {\n request.addQueryParam(\"Priority\", priority.toString());\n }\n\n if (assignmentStatus != null) {\n for (String prop : assignmentStatus) {\n request.addQueryParam(\"AssignmentS...
[ "function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co...
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Parse the `req` url with memoization. @param {ServerRequest} req @return {Object} @public
[ "function parseurl (req) {\n var url = req.url\n\n if (url === undefined) {\n // URL is undefined\n return undefined\n }\n\n var parsed = req._parsedUrl\n\n if (fresh(url, parsed)) {\n // Return cached URL parse\n return parsed\n }\n\n // Parse the URL\n parsed = fastparse(url)\n parsed._raw = ...
[ "function (resourceName, req, callback, config) {\n\t\t\t// remove suffixes (future)\n\t\t\t// get the text\n\t\t\tfetchText(req['toUrl'](resourceName), callback, callback['error'] || error);\n\t\t}" ]
codesearchnet
{ "query": "Represent the Github instruction about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
Handles the requirements in the target repository, returns a path to a executable of the virtualenv.
[ "def get_or_create_environment(self, repo: str, branch: str, git_repo: Repo, repo_path: Path) -> str:\n \n return str(self.get_or_create_venv(repo_path).resolve() / \"bin\" / \"python\")" ]
[ "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 text about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
// GetPeers returns peers who have announced having infoHash.
[ "func (dht *DHT) GetPeers(infoHash string) error {\n\tif !dht.Ready {\n\t\treturn ErrNotReady\n\t}\n\n\tif dht.OnGetPeersResponse == nil {\n\t\treturn ErrOnGetPeersResponseNotSet\n\t}\n\n\tif len(infoHash) == 40 {\n\t\tdata, err := hex.DecodeString(infoHash)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tinfoHa...
[ "@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 comment about Text processing:", "pos": "Represent the code about Text processing:", "neg": "Represent the code:" }
Removes duplicated coordinates within a geometry. @param geom @return
[ "public static Geometry removeCoordinates(Geometry geom) {\n if(geom ==null){\n return null;\n }\n else if (geom.isEmpty()) {\n return geom;\n } else if (geom instanceof Point){\n return geom; }\n else if (geom instanceof MultiPoint) {\n ...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Update the specified annotation.
[ "def update(self, event, annotation):\n \"\"\"\"\"\"\n # Decide whether or not to hide previous highlights...\n for artist in self.highlights.values():\n if self.display == 'multiple':\n continue\n if self.display == 'one-per-axes':\n if event...
[ "@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 description:", "pos": "Represent the code:", "neg": "Represent the code:" }
generates 36 capacity digits string from integer result is string of [0-1A-Z] @param {number} num @returns {string}
[ "function int2Str36(num) {\n let baseIdx = d36.length;\n let result = [];\n let empty = null;\n if (num === 0) return '0';\n for (let i = 0; i < baseIdx; i++) {\n let d = d36[i];\n let c = 0;\n if (d <= num) {\n c = Math.trunc(num/d);\n num -= d * c;\n ...
[ "def BIF_templates(self):\n \n network_template = Template('network $name {\\n}\\n')\n # property tag may or may not be present in model,and since no of properties\n # can be more than one , will replace them accoriding to format otherwise null\n variable_template = Template(\"\"\...
codesearchnet
{ "query": "Represent the Github text about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
// SetSubscriptionName sets the SubscriptionName field's value.
[ "func (s *DescribeEventSubscriptionsInput) SetSubscriptionName(v string) *DescribeEventSubscriptionsInput {\n\ts.SubscriptionName = &v\n\treturn s\n}" ]
[ "@NotNull\n @ApiModelProperty(required = true, value = \"Key-value pairs to add as custom property into alert. You can refer here for example values\")\n public Map<String, String> getDetails() {\n return details;\n }" ]
codesearchnet
{ "query": "Represent the instruction about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Software development:" }
/* (non-Javadoc) @see com.ibm.ws.clientcontainer.remote.common.object.RemoteObjectInstance#getObject(com.ibm.ws.serialization.SerializationService)
[ "@Override\n public Object getObject() throws RemoteObjectInstanceException {\n Object object;\n\n ClassLoader tccl = AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {\n\n @Override\n public ClassLoader run() {\n return Thread.currentThread().g...
[ "public static void setTextInfoEnabled(boolean textInfoEnabled) {\n com.ibm.ws.pmi.stat.StatsImpl.setEnableTextInfo(textInfoEnabled);\n }" ]
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code:" }
same as scipy.ndimage.convolve but is only executed on mask==True ... which should speed up everything
[ "def maskedConvolve(arr, kernel, mask, mode='reflect'):\r\n '''\r\n \r\n '''\r\n arr2 = extendArrayForConvolution(arr, kernel.shape, modex=mode, modey=mode)\r\n print(arr2.shape)\r\n out = np.zeros_like(arr)\r\n return _calc(arr2, kernel, mask, out)" ]
[ "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 summarization:", "pos": "Represent the code:", "neg": "Represent the code:" }
// Interpolate interpolates between a and b at t (0,1).
[ "func Interpolate(a, b *T, t float64) T {\n\tt1 := 1 - t\n\treturn T{\n\t\ta[0]*t1 + b[0]*t,\n\t\ta[1]*t1 + b[1]*t,\n\t\ta[2]*t1 + b[2]*t,\n\t}\n}" ]
[ "def gaussian_window(t, params):\n \n window = suspect.basis.gaussian(t, 0, 0, params[\"line_broadening\"])\n\n # the above gaussian function returns an area 1 fid, for a windowing\n # function we need to be area preserving (first point must be 1)\n return window / window[0]" ]
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
// Append opens an existing file in HDFS and returns an io.WriteCloser for // writing to it. Because of the way that HDFS writes are buffered and // acknowledged asynchronously, it is very important that Close is called after // all data has been written.
[ "func (c *Client) Append(name string) (*FileWriter, error) {\n\t_, err := c.getFileInfo(name)\n\tif err != nil {\n\t\treturn nil, &os.PathError{\"append\", name, interpretException(err)}\n\t}\n\n\tappendReq := &hdfs.AppendRequestProto{\n\t\tSrc: proto.String(name),\n\t\tClientName: proto.String(c.namenode.Cl...
[ "void offerData(byte[] chunk) {\n if (chunk == null || chunk.length == 0) {\n throw new IllegalArgumentException(\"chunk must have at least one byte of data\");\n }\n\n if (closed) {\n return;\n }\n\n // Since this is an unbounded queue, offer() always succeeds. In addition, we don't make a...
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code:" }
delete @param QueueMessage|string $message @return static @internal param null $queue
[ "public function delete(QueueMessage $message)\n {\n $this->client->deleteMessage(\n [\n 'QueueUrl' => $this->getQueueUrl($message->getQueueName()),\n 'ReceiptHandle' => $this->getReceiptHandle($message),\n ]\n );\n\n return $this;\n }" ...
[ "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 Github instruction about PHP programming:", "pos": "Represent the Github code about PHP programming:", "neg": "Represent the Github code about programming:" }
@param int $diskQuote disk limit (in bytes) @return Client
[ "public function setDiskQuote(int $diskQuote)\n {\n $this->diskQuote = $diskQuote;\n\n $this->hostConfig = array_merge($this->hostConfig, ['DiskQuota ' => $diskQuote]);\n\n return $this;\n }" ]
[ "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 post about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
getInstance @param string $locale @param bool $new @return FakerGenerator @throws \Psr\Cache\InvalidArgumentException @since 3.5
[ "public function getInstance(string $locale = FakerFactory::DEFAULT_LOCALE, bool $new = false): FakerGenerator\n {\n return $this->once($locale, function () use ($locale) {\n return $this->create($locale);\n }, $new);\n }" ]
[ "public static function backwardsCompatibility(&$oBindTo)\n {\n // @todo (Pablo - 2017-06-07) - Remove these\n $oBindTo->db = Factory::service('Database');\n $oBindTo->encrypt = Factory::service('Encrypt');\n }" ]
codesearchnet
{ "query": "Represent the instruction about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Software development:" }
Get a shallow copy of the cells in this row. @return a List&lt;Cell&gt; shallow copy of the cells in this row.
[ "public List<Cell> getCellsCopy()\n {\n final ArrayList<Cell> cells = new ArrayList<>(this.getCellsCount());\n\n for (Cell c: this)\n {\n cells.add(c);\n }\n return cells;\n }" ]
[ "function NDDBIndex(idx, nddb) {\n // The name of the index.\n this.idx = idx;\n // Reference to the whole nddb database.\n this.nddb = nddb;\n // Map indexed-item to a position in the original database.\n this.resolve = {};\n // List of all keys in `resolve` object....
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
This method loads the command styles (warning|general|notice|fatal_error) @return void
[ "public function loadOutputStyles()\n {\n $styleOne = array('bold');\n $styleTwo = array('bold', 'underscore');\n $style = new OutputFormatterStyle();\n $this->output->getFormatter()->setStyle('normal', $style);\n $style = new OutputFormatterStyle('white', 'red', ...
[ "def observe_meta_signal_changes(self, changed_model, prop_name, info):\n \"\n self.logger.info(NotificationOverview(info))" ]
codesearchnet
{ "query": "Represent the text about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Software development:" }
// ContainerRename renames the given container
[ "func (c *ContainerServer) ContainerRename(container, name string) error {\n\tctr, err := c.LookupContainer(container)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\toldName := ctr.Name()\n\t_, err = c.ReserveContainerName(ctr.ID(), name)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer func() {\n\t\tif err != nil {\...
[ "@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 Github instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Set up the keystroke mapper. Add a map entry
[ "def []=(indexes, value)\n indexes = [indexes] unless indexes.is_a?(Range)\n\n indexes.each do |index|\n process_non_terminals(index)\n\n if @map.has_key?(index)\n fail MiniTermKME, \"Duplicate entry #{index.inspect}\"\n end\n\n @map[index] = [value, index]\n end\...
[ "def _enter(self):\n \"\"\"\"\"\"\n command = self.command\n logger.log(5, \"Snippet keystroke `Enter`.\")\n # NOTE: we need to set back the actions (mode_off) before running\n # the command.\n self.mode_off()\n self.run(command)" ]
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code:" }
// Reap is used to cleanup dead evaluations and allocations
[ "func (e *Eval) Reap(args *structs.EvalDeleteRequest,\n\treply *structs.GenericResponse) error {\n\tif done, err := e.srv.forward(\"Eval.Reap\", args, args, reply); done {\n\t\treturn err\n\t}\n\tdefer metrics.MeasureSince([]string{\"nomad\", \"eval\", \"reap\"}, time.Now())\n\n\t// Update via Raft\n\t_, index, err...
[ "def _shutdown_broker(self):\n \n if self.broker:\n self.broker.shutdown()\n self.broker.join()\n self.broker = None\n self.router = None\n\n # #420: Ansible executes \"meta\" actions in the top-level process,\n # meaning \"reset_connec...
codesearchnet
{ "query": "Represent the Github post about Computer Science:", "pos": "Represent the Github code about Computer Science:", "neg": "Represent the Github code about programming:" }
@param \Symfony\Component\Form\FormBuilderInterface $builder @param array $options @return $this
[ "protected function addBankCountry(FormBuilderInterface $builder, array $options)\n {\n if (count($options[static::OPTIONS_FIELD_NAME][static::OPTION_BANK_COUNTRIES]) == 1) {\n $builder->add(\n static::FIELD_BANK_COUNTRY,\n HiddenType::class,\n [\n ...
[ "public function createService(ServiceLocatorInterface $serviceLocator)\n {\n $services = $serviceLocator->getServiceLocator();\n /* @var $options ModuleOptionsInterface */\n $options = $services->get(ModuleOptions::class);\n $element = new Money('money');\n return $element;\n ...
codesearchnet
{ "query": "Represent the text about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about writing:" }
Sets the tile axis property. This is the axis along which the child views are tiled. @param axis either <code>View.X_AXIS</code> or <code>View.Y_AXIS</code>
[ "public void setAxis(int axis)\n {\n boolean axisChanged = (axis != majorAxis);\n majorAxis = axis;\n if (axisChanged)\n {\n preferenceChanged(null, true, true);\n }\n }" ]
[ "protected float getViewPortSize(final Axis axis) {\n float size = mViewPort == null ? 0 : mViewPort.get(axis);\n Log.d(Log.SUBSYSTEM.LAYOUT, TAG, \"getViewPortSize for %s %f mViewPort = %s\", axis, size, mViewPort);\n return size;\n }" ]
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code:" }
静态插入 @param string $table @param array $data @return int|string
[ "public static function insert($table, $data) {\n $insert = Insert::table($table);\n foreach ($data as $field => $value) {\n $insert->set($field, $value);\n }\n return $insert->excuse();\n }" ]
[ "static function position($name, $value=null, $settings=[])\n {\n if (!isset($settings['description'])) {\n $settings['description'] = '位置可设为:1到9的数字表示九宫格的位置, 或100|30, 或 center|center, 或100|left';\n }\n \n return static::input('text', $name, $value, $settings);\n }" ]
codesearchnet
{ "query": "Represent the Github comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
Returns a copy of the pymongo collection with various options set up
[ "def _collection_with_options(self, kwargs):\n \n\n # class DocumentClassWithFields(self.document_class):\n # _fetched_fields = kwargs.get(\"projection\")\n # mongokat_collection = self\n\n read_preference = kwargs.get(\"read_preference\") or getattr(self.collection, \"rea...
[ "def path(self, path):\n \"\"\"\"\"\"\n\n # pylint: disable=attribute-defined-outside-init\n self._path = copy_.copy(path)\n\n # The provided path is shallow copied; it does not have any attributes\n # with mutable types.\n\n # We perform this check after the initialization...
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Método que convierte los datos en el formato de entrada al formato oficial en JSON @author Esteban De La Fuente Rubio, DeLaF (esteban[at]sasco.cl) @version 2018-01-19
[ "public static function toJSON($formato, $datos)\n {\n return json_encode(self::toArray($formato, $datos), JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);\n }" ]
[ "public function agregar(array $datos)\n {\n $this->recibos[] = [\n '@attributes' => [\n 'version' => '1.0',\n ],\n 'DocumentoRecibo' => array_merge([\n '@attributes' => [\n 'ID' => 'LibreDTE_T'.$datos['TipoDoc'].'F'.$datos[...
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// WithLogger sets the logger used internally by the service and by Log.
[ "func (service *Service) WithLogger(logger LogAdapter) {\n\tservice.Context = WithLogger(service.Context, logger)\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 post:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Start listening to comments, using a separate thread.
[ "def _listen_comments(self):\n \"\"\"\"\"\"\n # Collect comments in a queue\n comments_queue = Queue(maxsize=self._n_jobs * 4)\n\n threads = [] # type: List[BotQueueWorker]\n\n try:\n\n # Create n_jobs CommentsThreads\n for i in range(self._n_jobs):\n ...
[ "public function postCommit(\n InputInterface $input,\n OutputInterface $output,\n ParameterBagInterface $configuration\n ): void {\n // Yes we can send a notification to slack fx?\n // Then we would just add some configuration with slack channel, username etc etc\n // A...
codesearchnet
{ "query": "Represent the comment about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
-----------------------------------------------------------------------------
[ "function window($wnd)\n {\n $result =\n \"<table border=\\\"0\\\" class=\\\"admWindow\\\"\".(empty($wnd['width'])?'':' style=\"width: '.\n $wnd['width'].';\"').\">\\n\".\n (empty($wnd['caption'])?'':\"<tr><th>\".$wnd['caption'].\"</th></tr>\\n\").\n \"<tr><...
[ "protected static function showVersion()\n {\n \\cli\\line();\n \\cli\\line(\\cli\\Colors::colorize('%y+----------------------------------------------------------------------+%N'));\n \\cli\\line(\\cli\\Colors::colorize('%y| Welcome to Doozr\\'s Demo project installer. ...
codesearchnet
{ "query": "Represent the Github comment about language and writing:", "pos": "Represent the Github code about language and writing:", "neg": "Represent the Github code:" }
Lists information about app profiles in an instance. @param \Google\Cloud\Bigtable\Admin\V2\ListAppProfilesRequest $argument input argument @param array $metadata metadata @param array $options call options
[ "public function ListAppProfiles(\\Google\\Cloud\\Bigtable\\Admin\\V2\\ListAppProfilesRequest $argument,\n $metadata = [], $options = []) {\n return $this->_simpleRequest('/google.bigtable.admin.v2.BigtableInstanceAdmin/ListAppProfiles',\n $argument,\n ['\\Google\\Cloud\\Bigtable\\Admin\\V...
[ "public function GetDataSource(\\Google\\Cloud\\BigQuery\\DataTransfer\\V1\\GetDataSourceRequest $argument,\n $metadata = [], $options = []) {\n return $this->_simpleRequest('/google.cloud.bigquery.datatransfer.v1.DataTransferService/GetDataSource',\n $argument,\n ['\\Google\\Cloud\\BigQue...
codesearchnet
{ "query": "Represent the sentence about Cloud Foundry API:", "pos": "Represent the code about Cloud Foundry API:", "neg": "Represent the code about programming:" }
// SetScalingPlans sets the ScalingPlans field's value.
[ "func (s *DescribeScalingPlansOutput) SetScalingPlans(v []*ScalingPlan) *DescribeScalingPlansOutput {\n\ts.ScalingPlans = v\n\treturn s\n}" ]
[ "func (r *Resource) ReservationRole() string {\n\t// if using reservation refinement, return the role of the last refinement\n\trs := r.GetReservations()\n\tif x := len(rs); x > 0 {\n\t\treturn rs[x-1].GetRole()\n\t}\n\t// if using the old reservation API, role is a first class field of Resource\n\t// (and it's nev...
codesearchnet
{ "query": "Represent the Github comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Overrides the implementation from DefaultPlatform @author Niklas Närhinen <niklas@narhinen.net> @return string @see DefaultPlatform::getModifyColumnsDDL
[ "public function getModifyColumnsDDL($columnDiffs)\n {\n $ret = '';\n foreach ($columnDiffs as $columnDiff) {\n $ret .= $this->getModifyColumnDDL($columnDiff);\n }\n\n return $ret;\n }" ]
[ "public function logBanner($additions = null)\n {\n $this->addStatusMessage('FlexiBee '.str_replace('://',\n '://'.$this->user.'@', $this->getApiUrl()).' FlexiPeeHP v'.self::$libVersion.' (FlexiBee '.EvidenceList::$version.') EasePHP Framework v'.\\Ease\\Atom::$frameworkVersion.' '.$additio...
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
@throws PageException
[ "private void doGetDatasource() throws PageException {\n\n\tString name = getString(\"admin\", action, \"name\");\n\tMap ds = config.getDataSourcesAsMap();\n\tIterator it = ds.keySet().iterator();\n\n\twhile (it.hasNext()) {\n\t String key = (String) it.next();\n\t if (key.equalsIgnoreCase(name)) {\n\t\tDataS...
[ "public File getExistingFile(final String param) {\n return get(param, getFileConverter(),\n new And<>(new FileExists(), new IsFile()),\n \"existing file\");\n }" ]
codesearchnet
{ "query": "Represent the comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about File management:" }
Lecture du counter depuis son fichier. @throws IOException e
[ "void readFromFile() throws IOException {\r\n\t\tfinal Counter counter = new CounterStorage(this).readFromFile();\r\n\t\tif (counter != null) {\r\n\t\t\tfinal Counter newCounter = clone();\r\n\t\t\tstartDate = counter.getStartDate();\r\n\t\t\trequests.clear();\r\n\t\t\tfor (final CounterRequest request : counter.ge...
[ "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:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
// RectBound returns a Rect that bounds this entity.
[ "func (cu *CellUnion) RectBound() Rect {\n\tbound := EmptyRect()\n\tfor _, c := range *cu {\n\t\tbound = bound.Union(CellFromCellID(c).RectBound())\n\t}\n\treturn bound\n}" ]
[ "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 programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Convert a Qt font to CSS style
[ "def qt_font_to_style(font, color):\n \n if font is None:\n font = \"TypeWriter,10,-1,5,75,0,0,0,0,0\"\n font_info = font.split(\",\")\n style = \"font-family: {};font-size: {};\".format(font_info[0], font_info[1])\n if font_info[4] == \"75\":\n style += \"font-weight: bold;\"\n if f...
[ "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 instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
// handleGetCoordinate is used to get the cached coordinate for a node.
[ "func (i *AgentIPC) handleGetCoordinate(client *IPCClient, seq uint64) error {\n\tvar req coordinateRequest\n\tif err := client.dec.Decode(&req); err != nil {\n\t\treturn fmt.Errorf(\"decode failed: %v\", err)\n\t}\n\n\t// Fetch the coordinate.\n\tvar result coordinate.Coordinate\n\tcoord, ok := i.agent.Serf().GetC...
[ "@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 comment about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Get a summoner by summoner name. @param [String] name Summoner name @return [DynamicModel] Summoner representation
[ "def find_by_name name\n name = CGI.escape name.downcase.gsub(/\\s/, '')\n DynamicModel.new perform_request api_url \"summoners/by-name/#{name}\"\n end" ]
[ "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 text about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Documentation:" }
Adds the given element to the given position in the grid, with the given size. There is no limit to the number of elements that can be assigned to the same cell(s).
[ "def add_element(self, element, col, row, cols=1, rows=1):\n \"\"\"\"\"\"\n\n # Update the number of rows and colums\n self.rows = max(self.rows, row+rows)\n self.cols = max(self.cols, col+cols)\n\n # Add the raw element record\n self.elements.append((col, row, cols, rows, ...
[ "function assignGroupMarginsAndHeaders(offset) {\n if (options.last) {\n // When looking for the *last* group, the *trailing* header and margin belong to the group.\n return offset - that._getHeaderSizeGroupAdjustment() - that._sizes.items...
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code:" }
// PreviousLine moves cursor to beginning of the line n lines up.
[ "func (c *Cursor) PreviousLine(n int) {\n\tfmt.Fprintf(c.Out, \"\\x1b[%dF\", n)\n}" ]
[ "@Nonnull\n public String getLine() {\n if (preLoaded) {\n if (bufferOffset >= 0) {\n int lineStart = bufferOffset;\n if (linePos > 0) {\n lineStart -= linePos - 1;\n }\n int lineEnd = bufferOffset;\n ...
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Programming:" }
// SetName sets the Name field's value.
[ "func (s *InstanceAssociationStatusInfo) SetName(v string) *InstanceAssociationStatusInfo {\n\ts.Name = &v\n\treturn s\n}" ]
[ "function Rule(rules) {\n this.rules = rules;\n // Identifies individual rule\n this.name = \"\";\n // Identifies the grammar that this rule belongs to \n this.grammarName = \"\";\n // Identifies types of rules. Rules can have \"types\" that are diff...
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
// InitDbLogs sets up the indexes for the logs collection. It should // be called as state is opened. It is idempotent.
[ "func InitDbLogs(session *mgo.Session, modelUUID string) error {\n\tlogsColl := session.DB(logsDB).C(logCollectionName(modelUUID))\n\tfor _, key := range logIndexes {\n\t\terr := logsColl.EnsureIndex(mgo.Index{Key: key})\n\t\tif err != nil {\n\t\t\treturn errors.Annotate(err, \"cannot create index for logs collecti...
[ "def ready(self):\n \"\"\"\"\"\"\n # Initialize the type extension composer.\n from . composer import composer\n composer.discover_extensions()\n\n is_migrating = sys.argv[1:2] == ['migrate']\n if is_migrating:\n # Do not register signals and ES indices when:\n ...
codesearchnet
{ "query": "Represent the Github post about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
/* (non-Javadoc) @see com.att.cadi.Lur#clear(java.security.Principal, java.lang.StringBuilder)
[ "@Override\n\tpublic void clear(Principal p, StringBuilder report) {\n\t\treport.append(NullLur.class.getSimpleName());\n\t\treport.append('\\n');\n\t}" ]
[ "@SuppressWarnings(\"unchecked\")\n public static StackFinder getInstance() {\n if (finder == null) {\n AccessController.doPrivileged(new PrivilegedAction() {\n public Object run() {\n finder = new StackFinder();\n return null;\n ...
codesearchnet
{ "query": "Represent the text about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Set the number of satellites used to calculate the GPX fix for a point. @param contentBuffer Contains the information to put in the table
[ "public final void setSat(StringBuilder contentBuffer) {\n ptValues[GpxMetadata.PTSAT] = Integer.parseInt(contentBuffer.toString());\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 Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// writes a record in the subscriptions file. // store's lock is held on entry.
[ "func (ss *FileSubStore) writeRecord(w io.Writer, recType recordType, rec record) error {\n\tvar err error\n\ttotalSize := 0\n\trecSize := rec.Size()\n\n\tvar bwBuf *bufio.Writer\n\tneedsUnlock := false\n\n\tif w == nil {\n\t\tif err := ss.lockFile(); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tneedsUnlock = true\n\...
[ "boolean setReplica( H2ONode h2o ) {\n assert _key.home(); // Only the HOME node for a key tracks replicas\n assert h2o != H2O.SELF; // Do not track self as a replica\n if( !read_lock() ) return false; // Write-locked; no new replications. Read fails to read *this* value\n // Narrow non-race here. ...
codesearchnet
{ "query": "Represent the description about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
// isPackage reports whether pkg has path as the canonical path, // taking into account vendoring effects
[ "func isPackage(pkg *types.Package, path string) bool {\n\tif pkg == nil {\n\t\treturn false\n\t}\n\n\treturn pkg.Path() == path ||\n\t\tstrings.HasSuffix(pkg.Path(), \"/vendor/\"+path)\n}" ]
[ "def register (g):\n \n assert isinstance(g, Generator)\n id = g.id()\n\n __generators [id] = g\n\n # A generator can produce several targets of the\n # same type. We want unique occurence of that generator\n # in .generators.$(t) in that case, otherwise, it will\n # be tried twice and we'll...
codesearchnet
{ "query": "Represent the Github summarization about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
sets background color @param string $backgroundColor
[ "public function setBackgroundColor($backgroundColor)\n {\n $this->_backgroundColor = $backgroundColor;\n if ($this->_backgroundColor && $this->_colorTable) {\n $this->_colorTable->add($this->_backgroundColor);\n }\n }" ]
[ "def anim(host, seq, anim, d):\n \n at(host, 'ANIM', seq, [anim, d])" ]
codesearchnet
{ "query": "Represent the summarization about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Get the status of the device @return the status @throws DevFailed
[ "public String updateStatus(final DeviceState state) throws DevFailed {\n xlogger.entry();\n if (getStatusMethod != null) {\n try {\n status = (String) getStatusMethod.invoke(businessObject);\n } catch (final IllegalArgumentException e) {\n throw Dev...
[ "public DeviceData command_inout(TacoTangoDevice tacoDevice, String command, DeviceData argin) throws DevFailed {\n Except.throw_exception(\"Api_TacoFailed\",\n \"Taco protocol not supported\",\n \"TacoTangoDeviceDAODefaultImpl.command_inout()\");\n return null;\n }" ]
codesearchnet
{ "query": "Represent the Github post about NLP:", "pos": "Represent the Github code about NLP:", "neg": "Represent the Github code about N/A:" }
Use this API to fetch all the ip6tunnel resources that are configured on netscaler.
[ "public static ip6tunnel[] get(nitro_service service) throws Exception{\n\t\tip6tunnel obj = new ip6tunnel();\n\t\tip6tunnel[] response = (ip6tunnel[])obj.get_resources(service);\n\t\treturn response;\n\t}" ]
[ "func (r *controller) Update(ctx context.Context, t *api.Task) error {\n\t// TODO(stevvooe): While assignment of tasks is idempotent, we do allow\n\t// updates of metadata, such as labelling, as well as any other properties\n\t// that make sense.\n\treturn nil\n}" ]
codesearchnet
{ "query": "Represent the Github comment about API documentation:", "pos": "Represent the Github code about API documentation:", "neg": "Represent the Github code about Software development:" }
For use with auto-committing statements such as CREATE TABLE or CREATE INDEX.
[ "def createSQL(self, sql, args=()):\n \n before = time.time()\n self._execSQL(sql, args)\n after = time.time()\n if after - before > 2.0:\n log.msg('Extremely long CREATE: %s' % (after - before,))\n log.msg(sql)" ]
[ "def last_insert_id(self, cursor, table_name, pk_name):\n \n # TODO: Check how the `last_insert_id` is being used in the upper layers\n # in context of multithreaded access, compare with other backends\n\n # IDENT_CURRENT: http://msdn2.microsoft.com/en-us/library/ms175098.aspx\n ...
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code about SQL:" }
Given a message, route it either to the incoming queue, or to the future associated with its correlation_id.
[ "async def route_msg(self, msg):\n \n if msg.correlation_id in self._futures:\n self._set_reply(msg.correlation_id, msg)\n else:\n await self._push_incoming(msg)" ]
[ "def do_threaded_dispatch(participant, msg)\n\n msg = Rufus::Json.dup(msg)\n #\n # the thread gets its own copy of the message\n # (especially important if the main thread does something with\n # the message 'during' the dispatch)\n\n # Maybe at some point a limit on the number...
codesearchnet
{ "query": "Represent the instruction about Technology:", "pos": "Represent the code about Technology:", "neg": "Represent the code:" }
Fetch the foreground color to use for a lexical token with the given value.
[ "public Color getForeground( int code )\n {\n Style s = _tokenStyles.get( new Integer( code ) );\n if( s == null )\n {\n s = getStyle( DEFAULT_STYLE );\n }\n return getForeground( s );\n }" ]
[ "def visit_rule(self, node, rule):\n \"\"\"\"\"\"\n label, equals, expression = rule\n expression.name = label # Assign a name to the expr.\n return expression" ]
codesearchnet
{ "query": "Represent the description about Language and programming:", "pos": "Represent the code about Language and programming:", "neg": "Represent the code about programming:" }
Make dirs' configurations @param string|bool $code The dir's name (code) @return array|bool
[ "public function dirs($code=false){\n $all = $this->options->full_soptions(self::_dev_path());\n $cats = [];\n $r = [];\n foreach ( $all as $a ){\n if ( \\defined($a['bbn_path']) ){\n $k = $a['bbn_path'] . '/' . ($a['code'] === '/' ? '' : $a['code']);\n if ( !isset($cats[$a['id_alias'...
[ "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:" }
// Err returns the current error (if any)
[ "func (lex *GotestLexer) Err() error {\n\tif lex.err != nil {\n\t\treturn lex.err\n\t}\n\treturn lex.scanner.Err()\n}" ]
[ "func (logger *Logger) Log(level Level, v ...interface{}) {\n\t// Don't delete this calling. The calling is used to keep the same\n\t// calldepth for all the logging functions. The calldepth is used to\n\t// get runtime information such as line number, function name, etc.\n\tlogger.log(level, v...)\n}" ]
codesearchnet
{ "query": "Represent the Github summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Computer Science:" }
This method checks if the recently downloaded file from $source located at $path is a valid resource, if not will remove the file and throw an exception @param string $source @param string $path @throws \RuntimeException when the source is not valid
[ "protected function checkIsValidDownloadedFile(string $source, string $path)\n {\n // check content is not empty\n if (0 === (int) filesize($path)) {\n unlink($path);\n throw new \\RuntimeException(\"The source $source is not an xml file because it is empty\");\n }\n ...
[ "public function initializeArguments()\n {\n $this->registerArgument('path', 'string', 'Location of the resource, can be either a path relative to the Public resource directory of the package or a resource://... URI', false, null);\n $this->registerArgument('package', 'string', 'Target package key....
codesearchnet
{ "query": "Represent the Github comment about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
Inverse of _parse_header. >>> _encode_header('permessage-deflate', ... {'client_max_window_bits': 15, 'client_no_context_takeover': None}) 'permessage-deflate; client_max_window_bits=15; client_no_context_takeover'
[ "def _encode_header(key: str, pdict: Dict[str, str]) -> str:\n \n if not pdict:\n return key\n out = [key]\n # Sort the parameters just to make it easy to test.\n for k, v in sorted(pdict.items()):\n if v is None:\n out.append(k)\n else:\n # TODO: quote if n...
[ "def _extract_tls_session_ticket(ssl_session: nassl._nassl.SSL_SESSION) -> str:\n \n session_string = ((ssl_session.as_text()).split('TLS session ticket:'))[1]\n session_tls_ticket = (session_string.split('Compression:'))[0]\n return session_tls_ticket" ]
codesearchnet
{ "query": "Represent the Github text about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
// shuffleBootstrappers shuffles the set of bootstrappers in order to avoid // querying the same bootstrapper over and over. To shuffle the set of // candidates, we use a version of the Fisher–Yates shuffle algorithm.
[ "func shuffleBootstrappers(candidates []NetworkPeerBootstrapper) []NetworkPeerBootstrapper {\n\tshuffled := make([]NetworkPeerBootstrapper, len(candidates))\n\tperm := prand.Perm(len(candidates))\n\n\tfor i, v := range perm {\n\t\tshuffled[v] = candidates[i]\n\t}\n\n\treturn shuffled\n}" ]
[ "func (tab *Table) doRefresh(done chan struct{}) {\n\tdefer close(done)\n\n\t// Load nodes from the database and insert\n\t// them. This should yield a few previously seen nodes that are\n\t// (hopefully) still alive.\n\ttab.loadSeedNodes()\n\n\t// Run self lookup to discover new neighbor nodes.\n\ttab.net.lookupSe...
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code about Networking:" }
splits path into parent, child
[ "def split(path):\n \n if path == '/':\n return ('/', None)\n\n parent, child = path.rsplit('/', 1)\n\n if parent == '':\n parent = '/'\n\n return (parent, child)" ]
[ "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 post:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// IntAtLeast returns a SchemaValidateFunc which tests if the provided value // is of type int and is at least min (inclusive)
[ "func IntAtLeast(min int) schema.SchemaValidateFunc {\n\treturn func(i interface{}, k string) (s []string, es []error) {\n\t\tv, ok := i.(int)\n\t\tif !ok {\n\t\t\tes = append(es, fmt.Errorf(\"expected type of %s to be int\", k))\n\t\t\treturn\n\t\t}\n\n\t\tif v < min {\n\t\t\tes = append(es, fmt.Errorf(\"expected ...
[ "function normalizeLimit (options) {\n const limit = options.limit || options.resultRecordCount || options.count || options.maxFeatures\n // If there is a limit, add 1 to it so we can later calculate a limitExceeded. The result set will be resized accordingly, post SQL\n if (limit) return limit + 1\n}" ]
codesearchnet
{ "query": "Represent the sentence about Computer Science:", "pos": "Represent the code about Computer Science:", "neg": "Represent the code:" }
// New return a new rest instance
[ "func New(server *osin.Server, service ServiceInterface) *rest {\n\treturn &rest{server, service}\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 description about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
// Takes the result of flatmap.Expand for an array of policy attributes and // returns ELB API compatible objects
[ "func expandPolicyAttributes(configured []interface{}) ([]*elb.PolicyAttribute, error) {\n\tattributes := make([]*elb.PolicyAttribute, 0, len(configured))\n\n\t// Loop over our configured attributes and create\n\t// an array of aws-sdk-go compatible objects\n\tfor _, lRaw := range configured {\n\t\tdata := lRaw.(ma...
[ "@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 Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// FirewallRules returns the firewall rules for the specified known service names.
[ "func (c *Client) FirewallRules(knownServices ...string) ([]params.FirewallRule, error) {\n\targs := params.KnownServiceArgs{\n\t\tKnownServices: make([]params.KnownServiceValue, len(knownServices)),\n\t}\n\tfor i, s := range knownServices {\n\t\targs.KnownServices[i] = params.KnownServiceValue(s)\n\t}\n\n\tvar res...
[ "func getEnterpriseResourceIter(context structs.Context, _ *acl.ACL, namespace, prefix string, ws memdb.WatchSet, state *state.StateStore) (memdb.ResultIterator, error) {\n\t// If we have made it here then it is an error since we have exhausted all\n\t// open source contexts.\n\treturn nil, fmt.Errorf(\"context mus...
codesearchnet
{ "query": "Represent the description about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Software development:" }
Retrieves the user's qwerly username. @return string
[ "public function getQwerly()\n {\n return isset($this->_data[self::PROFILE][self::QWERLY]) ? $this->_data[self::PROFILE][self::QWERLY] : null;\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 comment about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code:" }
Block parser for UU5.RichText.Block . The rich text block is using following signature: {richtext} ...richtext content... {/richtext} @param state @param startLine @param endLine @param silent @returns {boolean}
[ "function richtext(state, startLine, endLine, silent, opts) {\n let pos = state.bMarks[startLine] + state.tShift[startLine],\n max = state.eMarks[startLine],\n contentEndLine;\n\n if (pos >= max) {\n return false;\n }\n\n let line = state.getLines(startLine, startLine + 1, 0, false);\n\n if (!line.sta...
[ "protected function parseExpressionHtmlLine( Line$line ):self\n\t{\n\t\t$content= $line->slice(1);\n\n\t\treturn $this->openNode(new StringNode($this,$line))->appendLine(\"<?$content?>\");\n\t}" ]
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
// Bytes returns a specific return parameter as a []byte. // If a result has not been set, it returns nil.
[ "func (r *MockResult) Bytes(i int) []byte {\n\tif r.Contains(i) {\n\t\tif rr := r.Result[i]; rr == nil {\n\t\t\treturn nil\n\t\t} else {\n\t\t\treturn rr.([]byte)\n\t\t}\n\t} else {\n\t\treturn nil\n\t}\n}" ]
[ "function Rule(rules) {\n this.rules = rules;\n // Identifies individual rule\n this.name = \"\";\n // Identifies the grammar that this rule belongs to \n this.grammarName = \"\";\n // Identifies types of rules. Rules can have \"types\" that are diff...
codesearchnet
{ "query": "Represent the description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
// GetDNSIP returns a dnsIP, which is 10th IP in svcSubnet CIDR range
[ "func GetDNSIP(svcSubnet string) (net.IP, error) {\n\t// Get the service subnet CIDR\n\t_, svcSubnetCIDR, err := net.ParseCIDR(svcSubnet)\n\tif err != nil {\n\t\treturn nil, errors.Wrapf(err, \"couldn't parse service subnet CIDR %q\", svcSubnet)\n\t}\n\n\t// Selects the 10th IP in service subnet CIDR range as dnsIP...
[ "func (vm *DockerVM) GetVMName(ccid ccintf.CCID) string {\n\t// replace any invalid characters with \"-\" (either in network id, peer id, or in the\n\t// entire name returned by any format function)\n\treturn vmRegExp.ReplaceAllString(vm.preFormatImageName(ccid), \"-\")\n}" ]
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
// Find is responsible for finding the launch template for us
[ "func (t *LaunchTemplate) Find(c *fi.Context) (*LaunchTemplate, error) {\n\tcloud, ok := c.Cloud.(awsup.AWSCloud)\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"invalid cloud provider: %v, expected: %s\", c.Cloud, \"awsup.AWSCloud\")\n\t}\n\n\t// @step: get the latest launch template version\n\tlt, err := t.findLatestLa...
[ "func (r *controller) Update(ctx context.Context, t *api.Task) error {\n\t// TODO(stevvooe): While assignment of tasks is idempotent, we do allow\n\t// updates of metadata, such as labelling, as well as any other properties\n\t// that make sense.\n\treturn nil\n}" ]
codesearchnet
{ "query": "Represent the Github summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
Overloaded method which sets an embedded image on account of name and {@link DataSource}. @param name The name of the image as being referred to from the message content body (eg. '&lt;cid:embeddedimage&gt;'). @param imagedata The image data.
[ "public void addEmbeddedImage(final String name, final DataSource imagedata) {\r\n\t\tembeddedImages.add(new AttachmentResource(name, imagedata));\r\n\t}" ]
[ "public static OriginIdElement addOriginId(Message message) {\n OriginIdElement originId = new OriginIdElement();\n message.addExtension(originId);\n // TODO: Find solution to have both the originIds stanzaId and a nice to look at incremental stanzaID.\n // message.setStanzaId(originId.g...
codesearchnet
{ "query": "Represent the summarization about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Software development:" }
Removes errors for all attributes or a single attribute. @param null $attribute
[ "public function clearErrors($attribute = null)\n {\n if ($attribute === null) {\n $this->errors = [];\n } else {\n unset($this->errors[$attribute]);\n }\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 comment about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Extracts properties to filter from the request.
[ "protected function extractProperties(Request $request/*, string $resourceClass*/): array\n {\n @trigger_error(sprintf('The use of \"%s::extractProperties()\" is deprecated since 2.2. Use the \"filters\" key of the context instead.', __CLASS__), E_USER_DEPRECATED);\n\n $resourceClass = \\func_num_a...
[ "@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 Github summarization about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
strips unwanted string(s), or whitespace by default, from a target string
[ "function stripX(str, unwanted) {\n if ([\"string\"].indexOf(type(str)) < 0)\n throw `stripX(): Invalid str argument type; expected 'string'; found ${type(str)}`;\n\n if ([\"undefined\", \"null\", \"array\", \"string\"].indexOf(type(unwanted)) < 0)\n throw `stripX(): Invalid unwa...
[ "def DocToHelp(doc):\n \"\"\"\"\"\"\n\n # Get rid of starting and ending white space. Using lstrip() or even\n # strip() could drop more than maximum of first line and right space\n # of last line.\n doc = doc.strip()\n\n # Get rid of all empty lines.\n whitespace_only_line = re.compile('^[ \\t]+$', re.M)\n ...
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Creates context instance. @param ReflectionClass $reflection @param array $arguments @return mixed
[ "private function createInstance(ReflectionClass $reflection, array $arguments)\n {\n if (count($arguments)) {\n return $reflection->newInstanceArgs($arguments);\n }\n\n return $reflection->newInstance();\n }" ]
[ "@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 sentence about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Recursive helper method that converts BSON types so they can be converted into json.
[ "def _json_convert(obj, json_options=DEFAULT_JSON_OPTIONS):\n \n if hasattr(obj, 'iteritems') or hasattr(obj, 'items'): # PY3 support\n return SON(((k, _json_convert(v, json_options))\n for k, v in iteritems(obj)))\n elif hasattr(obj, '__iter__') and not isinstance(obj, (text_typ...
[ "def GetDictToFormat(self):\n \"\"\"\"\"\"\n d = {}\n for k, v in self.__dict__.items():\n # TODO: Better handling of unicode/utf-8 within Schedule objects.\n # Concatinating a unicode and utf-8 str object causes an exception such\n # as \"UnicodeDecodeError: 'ascii' codec can't decode byte ...
codesearchnet
{ "query": "Represent the sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Attach one or more listeners Implementors may add an optional $priority argument; the EventManager implementation will pass this to the aggregate. @param EventManagerInterface $events @param int $priority @return void
[ "public function attach(EventManagerInterface $events, $priority = 1)\n {\n $events->attach(MediaEvent::EVENT_ADD, [$this, 'setImageSize']);\n $events->attach(MediaEvent::EVENT_ADD, [$this, 'resizeImages']);\n $events->attach(MediaEvent::EVENT_ADD, [$this, 'setCache']);\n $events->att...
[ "public function listen($uri, EventHandler $handler, $overRideYamlKey) {\n //CP-2 added this while working on calling listeners during core/components/render call\n //no need to add handlers that will never match our request\n //CP-265 - $overRideYamlKey - render component is the main __YML_KEY...
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
Rotates an image the number of degrees specified by $rotation @param int $rotation
[ "public function rotate($rotation)\n {\n if(isset($this->edited)){\n $this->getInfo();\n $this->edited = imagerotate($this->edited, $rotation, 0);\n } else {\n $this->edited = imagerotate($this->original, $rotation, 0);\n }\n\n }" ]
[ "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 about mathematics:", "pos": "Represent the Github code about mathematics:", "neg": "Represent the Github code:" }
Creates a twig environment if not injected @return Twig_Environment
[ "private function getTwigEnvironment()\n {\n if (null == $this->twigEnvironment) {\n $this->twigEnvironment = $this->createTwigEnvironment();\n }\n return $this->twigEnvironment;\n }" ]
[ "public static function createFromEnvironment()\n {\n // Clean and update live global variables\n $variables = static::cleanEnvironment(Environment::getVariables());\n Environment::setVariables($variables); // Currently necessary for SSViewer, etc to work\n\n // Health-check prior to ...
codesearchnet
{ "query": "Represent the text about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code about PHP:" }
查找单元格。 @param sheet 表单 @param rowIndex 行索引 @param searchKey 单元格中包含的关键字 @return 单元格,没有找到时返回null
[ "public static Cell searchRowCell(Sheet sheet, int rowIndex, String searchKey) {\n if (StringUtils.isEmpty(searchKey)) return null;\n\n return searchRow(sheet.getRow(rowIndex), searchKey);\n }" ]
[ "protected static void fixResultByRule(List<Vertex> linkedArray)\n {\n\n //--------------------------------------------------------------------\n //Merge all seperate continue num into one number\n mergeContinueNumIntoOne(linkedArray);\n\n //-------------------------------------------...
codesearchnet
{ "query": "Represent the Github instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about text processing:" }
// ReadDataFrom reads a binary representation of the Hll data written // by WriteDataTo() from io stream. It returns the number of bytes read // and error. // If serialized Hll configuration is different it returns error with expected params
[ "func (h *HyperLogLog) ReadDataFrom(stream io.Reader) (int, error) {\n\tvar m uint64\n\t// read register number first\n\terr := binary.Read(stream, binary.LittleEndian, &m)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\t// check if register number is appropriate\n\t// hll register number should be same with serializ...
[ "NameAndType nameType(Symbol sym) {\n return new NameAndType(sym.name, sym.externalType(types), types);\n // the NameAndType is generated from a symbol reference, and the\n // adjustment of adding an additional this$n parameter needs to be made.\n }" ]
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Loads location which is starting point for selecting destination content object. @param null $defaultLocationId @return \eZ\Publish\API\Repository\Values\Content\Location|null
[ "protected function loadDefaultLocationForSelection($defaultLocationId = null): ?Location\n {\n if (!empty($defaultLocationId)) {\n try {\n return $this->locationService->loadLocation((int)$defaultLocationId);\n } catch (NotFoundException|UnauthorizedException $e) {\n ...
[ "public function initServices() {\n $this->getFrontController()->getRequestHandler()->addService($entityService = $this->getEntityService());\n \n // wir mappen den users controller auf den in Psc\n $entityService->setControllerClass('User', 'Psc\\CMS\\Controller\\UserEntityController');\n }" ]
codesearchnet
{ "query": "Represent the Github description about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
Simplified method form for invoking the SetQueueAttributes operation. @see #setQueueAttributesAsync(SetQueueAttributesRequest)
[ "@Override\n public java.util.concurrent.Future<SetQueueAttributesResult> setQueueAttributesAsync(String queueUrl, java.util.Map<String, String> attributes) {\n\n return setQueueAttributesAsync(new SetQueueAttributesRequest().withQueueUrl(queueUrl).withAttributes(attributes));\n }" ]
[ "public LogStreamResponse getLogs(Log.LogRequestBuilder logRequest) {\n return connection.execute(new Log(logRequest), apiKey);\n }" ]
codesearchnet
{ "query": "Represent the Github sentence about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
Output chemical contents to a file @param contents File contents @param currentID Chemical ID, used to determine the filename @throws IOException
[ "private void writeID(String contents, String currentID) throws IOException{\n\n\t\tString localName = getLocalFileName(currentID);\n\n\t\ttry ( PrintWriter pw = new PrintWriter(new GZIPOutputStream(new FileOutputStream(localName))) ) {\n\n\t\t\tpw.print(contents);\n\t\t\tpw.flush();\n\t\t}\n\t}" ]
[ "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 text about File management:", "pos": "Represent the Github code about File management:", "neg": "Represent the Github code:" }
// gets a human-readable description for a set string
[ "func (c CharSet) String() string {\n\tbuf := &bytes.Buffer{}\n\tbuf.WriteRune('[')\n\n\tif c.IsNegated() {\n\t\tbuf.WriteRune('^')\n\t}\n\n\tfor _, r := range c.ranges {\n\n\t\tbuf.WriteString(CharDescription(r.first))\n\t\tif r.first != r.last {\n\t\t\tif r.last-r.first != 1 {\n\t\t\t\t//groups that are 1 char ap...
[ "def _get_generic_schema(self):\n \n schema = Schema(\n vid=ID(stored=True, unique=True), # Object id\n title=NGRAMWORDS(),\n keywords=KEYWORD, # Lists of coverage identifiers, ISO time values and GVIDs, source names, source abbrev\n doc=TEXT) # Generated...
codesearchnet
{ "query": "Represent the Github post about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
Generate a "select" query @param boolean $all [optional] @return string
[ "public function getSelectSQL($all = false)\n {\n if (!$this->query->getTable() instanceof Table) {\n throw new Exception('Trying to generate sql when no table is being used.');\n }\n $sql = $this->generateSelectSQL();\n $sql .= $this->generateJoinSQ...
[ "@Override\n\tpublic void showHelp(final Terminal terminal) {\n\t\tterminal.writer().println(\"\\t\" + this.toString() + \": generate sql to access the table.\");\n\t\tterminal.writer().println(\n\t\t\t\t\"\\t\\tex) generate [select/insert/update/delete] [table name]<Enter> : Show sql to access tables according to ...
codesearchnet
{ "query": "Represent the instruction about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
// IsVersionAtLeast returns whether the git version is the one specified or higher // argument is plain version string separated by '.' e.g. "2.3.1" but can omit minor/patch
[ "func IsGitVersionAtLeast(ver string) bool {\n\tgitver, err := Version()\n\tif err != nil {\n\t\ttracerx.Printf(\"Error getting git version: %v\", err)\n\t\treturn false\n\t}\n\treturn IsVersionAtLeast(gitver, ver)\n}" ]
[ "def collect_manifest_dependencies(manifest_data, lockfile_data):\n \"\"\"\"\"\"\n output = {}\n\n for dependencyName, dependencyConstraint in manifest_data.items():\n output[dependencyName] = {\n # identifies where this dependency is installed from\n 'source': 'example-package...
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// See https://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html#function_datediff
[ "func builtinDateDiff(args []types.Datum, ctx context.Context) (d types.Datum, err error) {\n\tsc := ctx.GetSessionVars().StmtCtx\n\tt1, err := convertDatumToTime(sc, args[0])\n\tif err != nil {\n\t\treturn d, errors.Trace(err)\n\t}\n\n\tt2, err := convertDatumToTime(sc, args[1])\n\tif err != nil {\n\t\treturn d, e...
[ "public function execute($sql) {\n //\n // TODO: check mysql_unbuffered_query() with mysql_free_result() for larger result sets\n // @see https://www.percona.com/blog/2006/06/26/handling-of-big-parts-of-data/\n // @see https://dev.mysql.com/doc/refman/5.7/en/mysql-use-resul...
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
modifies header to sent redirect location by GiroCheckout
[ "public function redirectCustomerToPaymentProvider() {\n if (isset($this->response['redirect'])) {\n header('location:' . $this->response['redirect']);\n exit;\n }\n elseif (isset($this->response['url'])) {\n header('location:' . $this->response['url']);\n exit;\n }\n }" ]
[ "def getDeviceRole(self):\n \"\"\"\"\"\"\n print '%s call getDeviceRole' % self.port\n return self.__stripValue(self.__sendCommand(WPANCTL_CMD + 'getprop -v Network:NodeType')[0])" ]
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// SetProjectName sets the ProjectName field's value.
[ "func (s *PlacementDescription) SetProjectName(v string) *PlacementDescription {\n\ts.ProjectName = &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 sentence about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
Returns the custom CSS URL for embedded integration. @return string
[ "public function getCustomCss() {\n // Prepare the paths\n $base_url = $this->storeManager->getStore()->getBaseUrl(\\Magento\\Framework\\UrlInterface::URL_TYPE_MEDIA);\n $file_path = $this->getValue(\n 'payment/checkout_com/checkout_com_base_settings/custom_css',\n $this->...
[ "@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 sentence about text processing:", "pos": "Represent the code about text processing:", "neg": "Represent the code about Programming:" }
Has this tuple expired? (true/false). A tuple has expired when its expiry timer based on the +sec+ argument to #initialize runs out.
[ "def expired?\n return true unless @expires\n return false if @expires > Time.now\n return true if @renewer.nil?\n renew(@renewer)\n return true unless @expires\n return @expires < Time.now\n end" ]
[ "def getLockByID(self, lockid):\n \n assert isinstance(lockid, (locks.MasterLock, locks.WorkerLock))\n if lockid not in self.locks:\n self.locks[lockid] = lockid.lockClass(lockid)\n # if the master.cfg file has changed maxCount= on the lock, the next\n # time a build is...
codesearchnet
{ "query": "Represent the text about Elm programming language:", "pos": "Represent the code about Elm programming language:", "neg": "Represent the code about programming:" }
Create a node for the SARL script. @param parentNode the parent node. @param modelElement the feature container for which a node should be created.
[ "protected void _createChildren(DocumentRootNode parentNode, SarlScript modelElement) {\n\t\tif (!Strings.isNullOrEmpty(modelElement.getPackage())) {\n\t\t\t// Create the node for the package declaration.\n\t\t\tcreateEStructuralFeatureNode(\n\t\t\t\t\tparentNode, modelElement,\n\t\t\t\t\tXtendPackage.Literals.XTEN...
[ "function Rule(rules) {\n this.rules = rules;\n // Identifies individual rule\n this.name = \"\";\n // Identifies the grammar that this rule belongs to \n this.grammarName = \"\";\n // Identifies types of rules. Rules can have \"types\" that are diff...
codesearchnet
{ "query": "Represent the Github text about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
When did pmxbot last see <nick> speak?
[ "def where(channel, nick, rest):\n\t\"\"\n\tonick = rest.strip()\n\tlast = Logger.store.last_seen(onick)\n\tif last:\n\t\ttm, chan = last\n\t\ttmpl = \"I last saw {onick} speak at {tm} in channel #{chan}\"\n\t\treturn tmpl.format(tm=tm, chan=chan, onick=onick)\n\telse:\n\t\treturn \"Sorry! I don't have any record ...
[ "def precmd(self, line):\n \"\"\"\"\"\"\n if line.startswith('help'):\n if not q(\"`help in key`.q\"):\n try:\n q(\"\\\\l help.q\")\n except kerr:\n return '-1\"no help available - install help.q\"'\n if line == 'hel...
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code:" }
Provide either a file with one cutoff per motif or a single cutoff returns a hash with motif id as key and cutoff as value
[ "def parse_cutoff(motifs, cutoff, default=0.9):\n \n \n cutoffs = {}\n if os.path.isfile(str(cutoff)):\n for i,line in enumerate(open(cutoff)):\n if line != \"Motif\\tScore\\tCutoff\\n\":\n try:\n motif,_,c = line.strip().split(\"\\t\")\n ...
[ "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:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Resolve application bootstrapper. @param \Illuminate\Foundation\Application $app @return void
[ "protected function resolveApplicationBootstrappers($app)\n {\n $app->make('Illuminate\\Foundation\\Bootstrap\\HandleExceptions')->bootstrap($app);\n $app->make('Illuminate\\Foundation\\Bootstrap\\RegisterFacades')->bootstrap($app);\n $app->make('Illuminate\\Foundation\\Bootstrap\\SetRequest...
[ "public static function boot() : object\n {\n ModulusCLI::$appdir = config('app.dir');\n ModulusCLI::$approot = config('app.root');\n\n $app = new Application('Modulus Craftsman', (new ModulusCLI)->getVersion());\n $app->load(ModulusCLI::config());\n\n Self::autoload_plugins(true, $app);\n\n retu...
codesearchnet
{ "query": "Represent the Github comment about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
Trim the monitored job list. @return void
[ "public function trimMonitoredJobs()\n {\n $this->connection()->zremrangebyscore(\n 'monitored_jobs', Chronos::now()->subMinutes($this->monitoredJobExpires)->getTimestamp() * -1, '+inf'\n );\n }" ]
[ "@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 sentence:", "pos": "Represent the code:", "neg": "Represent the code about Programming:" }
Returns a state that was previously saved @param *string $key the state name @return mixed
[ "public function loadState(string $name)\n {\n $state = $this->resolve($name);\n\n if (is_callable($state)) {\n if ($state instanceof Closure) {\n $state = $state->bindTo($this, get_class($this));\n }\n\n $state = call_user_func($state, $this);\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 Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
Deferred event 'onSessionStart' @return callable
[ "public function onSessionStartEvent()\n {\n return function ($sessionStartEvent) {\n /** @var \\PHPDaemon\\Core\\DeferredEvent $sessionStartEvent */\n $name = ini_get('session.name');\n $sid = $this->getCookieStr($name);\n if ($sid === '') {\n $t...
[ "def postloop(self):\n \n cmd.Cmd.postloop(self) # Clean up command completion\n d1_cli.impl.util.print_info(\"Exiting...\")" ]
codesearchnet
{ "query": "Represent the sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }
Assembles the message body. Returns an empty string on failure. @access public @return string The assembled message body
[ "public function CreateBody() {\n $body = '';\n\n if ($this->sign_key_file) {\n $body .= $this->GetMailMIME().$this->LE;\n }\n\n $this->SetWordWrap();\n\n switch($this->message_type) {\n case 'inline':\n $body .= $this->GetBoundary($this->boundary[1], '', '', '');\n $body .= $...
[ "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 text about PHP programming:", "pos": "Represent the code about PHP programming:", "neg": "Represent the code about Programming:" }
Inserts content at caret position. @method insertContent @param {String} content Content to insert. @param {Object} args Optional args to pass to insert call.
[ "function (content, args) {\n if (args) {\n content = extend({ content: content }, args);\n }\n\n this.execCommand('mceInsertContent', false, content);\n }" ]
[ "function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co...
codesearchnet
{ "query": "Represent the description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Build email from parts. @param Email $email @return Email
[ "public function build(Email $email): Email\n {\n foreach ($this->parts as $part) {\n $resolver = $this->registry->getResolverForPart($part);\n $resolver->addPart($email, $part);\n }\n\n $this->parts = [];\n\n return $email;\n }" ]
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the comment about PHP programming:", "pos": "Represent the code about PHP programming:", "neg": "Represent the code:" }
singleton instance @param String $name @param array $config @param Container $repository @param Repository $cache @return Self
[ "public static function getInstance($name, array $config, Container $repository, Repository $cache)\n {\n if (self::$oInstance == false) {\n self::$oInstance = new Registry($name, $config, $repository, $cache);\n }\n return self::$oInstance;\n }" ]
[ "public function init()\n {\n $this->response->disableLayout();\n $this->userStore = b8\\Store\\Factory::getStore('User');\n }" ]
codesearchnet
{ "query": "Represent the sentence about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }