query
stringlengths
16
255
pos
list
neg
list
task
stringclasses
1 value
instruction
dict
Returns the node attributes or null, if it is not DOMElement. @param string[] $names @return array|null
[ "public function attributes(array $names = null)\n {\n if (!$this->node instanceof DOMElement) {\n return null;\n }\n\n if ($names === null) {\n $result = [];\n\n foreach ($this->node->attributes as $name => $attribute) {\n $result[$name] = $at...
[ "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 Github post about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about Documentation:" }
Search migration files. If $exists = false search only not installed files, if true - only installed @param string|null $query @param bool $exist @return array|false
[ "public function search(?string $query = null, bool $exist = false)\n {\n // initialize db migration record\n $records = new Migration();\n if ($this->connection !== null) {\n $records->setConnection($this->connection);\n }\n\n // get installed migrations\n $d...
[ "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:", "pos": "Represent the code:", "neg": "Represent the code:" }
Parse a string to ANSI codes if the glyph is a pair, we match [0] as the start and [1] as the end marker. the matches are sent to +stylize+
[ "def parse string\n self.styles.inject(string) do |str, (name, options)|\n glyph, style = options[:match], options[:style]\n if glyph.is_a? Array\n str.gsub(/#{Regexp.escape(glyph.first)}(.*?)\n #{Regexp.escape(glyph.last)}/x) { stylize $1, style }\n else\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 instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Initialize component. @param array $config Configurations. @return void
[ "public function initialize(array $config)\n {\n parent::initialize($config);\n\n $this->Controller = $this->_registry->getController();\n\n $this->_setRecipientList();\n }" ]
[ "function init(entry, socket, req) { // {{{2\n/**\n * Class constructor\n *\n * @param entry {Object} Entry of xorg kind\n *\n * @method constructor\n */\n\n this.entry = entry;\n\n O.link.open(this, socket);\n}" ]
codesearchnet
{ "query": "Represent the sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Computer Science:" }
Run the operator. :param module: The target module path. :type module: ``str`` :param options: Any runtime options. :type options: ``dict`` :return: The operator results. :rtype: ``dict``
[ "def run(self, module, options):\n \n logger.debug(\"Running maintainability harvester\")\n return dict(self.harvester.results)" ]
[ "def arg_to_array(func):\n \n def fn(self, arg, *args, **kwargs):\n \"\"\"Function\n\n Parameters\n ----------\n arg : array-like\n Argument to convert.\n *args : tuple\n Arguments.\n **kwargs : dict\n Keyword arguments.\n\n Ret...
codesearchnet
{ "query": "Represent the summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
/*[deutsch] <p>Subtrahiert die angegebenen Wochen von dieser Kalenderwoche. </p> @param weeks the count of weeks to be subtracted @return result of subtraction
[ "public CalendarWeek minus(Weeks weeks) {\n\n if (weeks.isEmpty()) {\n return this;\n }\n\n PlainDate date = this.start.getTemporal().minus(weeks.getAmount(), CalendarUnit.WEEKS);\n int y = date.getInt(YEAR_OF_WEEKDATE);\n int w = date.getInt(WEEK_OF_YEAR);\n ret...
[ "public function stripCommentAsteriks($body) {\n /* okay, also das Prinzip ist eigentlich: lösche alle Tokens am Anfang der Zeile (deshalb /m)\n bzw * / am Ende der Zeile \n \n da aber bei leeren Zeilen im Docblock bzw. Zeilen ohne * das multi-line-pattern kaputt geht\n überprüfen wir im ...
codesearchnet
{ "query": "Represent the Github comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Get output path If no "output path" value has been set, this method will set and return a default "output path" value, if any such value is available @see getDefaultOutputPath() @return string|null output path or null if no output path has been set
[ "public function getOutputPath() : ?string \n {\n if ( ! $this->hasOutputPath()) {\n $this->setOutputPath($this->getDefaultOutputPath());\n }\n return $this->outputPath;\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 Github instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
sets new umask setting and returns previous umask setting If no value is given only the current umask setting is returned. @param int|null $umask new umask setting @return int @since 0.8.0
[ "public static function umask(int $umask = null): int\n {\n $oldUmask = self::$umask;\n if (null !== $umask) {\n self::$umask = $umask;\n }\n\n return $oldUmask;\n }" ]
[ "private function checkParams()\n {\n if ($this->file === null && empty($this->filesets) && empty($this->dirsets)) {\n throw new BuildException(\n \"Specify at least one source - a file, dirset or a fileset.\"\n );\n }\n\n if ($this->mode === null) {\n ...
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
// SetDomainName sets the DomainName field's value.
[ "func (s *StreamingDistribution) SetDomainName(v string) *StreamingDistribution {\n\ts.DomainName = &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 description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
// Join implements Observer.
[ "func (n *RequestObserver) Join(req *http.Request, connectionID uint64) {\n\tn.state.id = connectionID\n\tn.state.websocketConnected = n.clock.Now()\n\n\tn.logger.Debugf(\n\t\t\"[%X] API connection from %s\",\n\t\tn.state.id,\n\t\treq.RemoteAddr,\n\t)\n}" ]
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github post about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
Search Simple search using a match _all query @param string $term @return ElasticquentResultCollection
[ "public static function search($term = '')\n {\n $instance = new static;\n\n $params = $instance->getBasicEsParams();\n\n $params['body']['query']['match']['_all'] = $term;\n\n $result = $instance->getElasticSearchClient()->search($params);\n\n return static::hydrateElasticsear...
[ "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 Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code about programming:" }
For Nokogiri 1.4.0 compatibility
[ "def make_node(html, doc)\n\t\tresult = Nokogiri::XML::Node.new('div', doc)\n\t\tresult.inner_html = html\n\t\treturn result.children[0]\n\tend" ]
[ "def get_pad content_rows, content_cols\n pad = FFI::NCurses.newpad(content_rows, content_cols)\n @pads ||= []\n @pads << pad\n ## added 2013-03-05 - 19:21 without next line how was pad being returned\n return pad\n end" ]
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code:" }
Loads the given children location as the root. @param {String|Object} childrentLocation The childrenLocation or an object with a ChildrenLocation field. @returns {orion.Promise}
[ "function(childrenLocation, force) {\n\t\t\treturn this.commandsRegistered.then(function() {\n\t\t\t\tif (childrenLocation && typeof childrenLocation === \"object\") {\n\t\t\t\t\treturn this.load(childrenLocation);\n\t\t\t\t}\n\t\t\t\treturn this.loadResourceList(childrenLocation, force);\n\t\t\t}.bind(this));\n\t\...
[ "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 comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Custom attribute writer method checking allowed values (enum). @param [Object] sort Object to be assigned
[ "def sort=(sort)\n validator = EnumAttributeValidator.new('String', [\"COUNT\", \"INDEX\"])\n unless validator.valid?(sort)\n fail ArgumentError, \"invalid value for 'sort', must be one of #{validator.allowable_values}.\"\n end\n @sort = sort\n end" ]
[ "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 post:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// Gather reads the stats from Elasticsearch and writes it to the // Accumulator.
[ "func (e *Elasticsearch) Gather(acc telegraf.Accumulator) error {\n\tif e.client == nil {\n\t\tclient, err := e.createHttpClient()\n\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\te.client = client\n\t}\n\n\tvar wg sync.WaitGroup\n\twg.Add(len(e.Servers))\n\n\tfor _, serv := range e.Servers {\n\t\tgo func(s str...
[ "@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 sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Get one user or all users
[ "def get(self, request, id):\n \n if id:\n return self._get_one(id)\n else:\n return self._get_all()" ]
[ "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 instruction:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Gets the rank given the shape info buffer @param buffer the buffer to get the rank for @return the rank for the shape buffer
[ "public static long length(DataBuffer buffer) {\n long ret = 1;\n val rr = buffer.asLong();\n DataBuffer shape = Shape.shapeOf(buffer);\n int rank = Shape.rank(buffer);\n for (int i = 0; i < rank; i++)\n ret *= shape.getLong(i);\n\n return ret;\n }" ]
[ "def _check_graph(self, graph):\n \"\"\"\"\"\"\n if graph.num_vertices != self.size:\n raise TypeError(\"The number of vertices in the graph does not \"\n \"match the length of the atomic numbers array.\")\n # In practice these are typically the same arrays using the s...
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Registers new filter @param string $name @param mixed $callback @param string|int|null $wiringSchema @throws InvalidArgumentException
[ "public function registerFilter($name, $callback, $wiringSchema = null)\n {\n if (!preg_match('#^[a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff]*$#', $name)) {\n throw new InvalidArgumentException(\n \"Invalid filter name given: '$name'. For filter names apply the same rules as for f...
[ "public function setAttr(\\n2n\\persistence\\orm\\property\\EntityProperty $entityProperty, $name, $value) {\r\n\t\tthrow new UnsupportedOperationException();\r\n\t}" ]
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
prepareColumn @param Column $column @return Column
[ "protected function prepareColumn(Column $column)\n {\n /** @var PostgresqlType $typeMapper */\n $typeMapper = $this->getDataType();\n\n $type = $typeMapper::getType($column->getType());\n\n $length = $typeMapper::noLength($type) ? null : $column->getLength();\n\n $column->leng...
[ "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 sentence about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code about programming:" }
// SetTimeSeriesServiceStatistics sets the TimeSeriesServiceStatistics field's value.
[ "func (s *GetTimeSeriesServiceStatisticsOutput) SetTimeSeriesServiceStatistics(v []*TimeSeriesServiceStatistics) *GetTimeSeriesServiceStatisticsOutput {\n\ts.TimeSeriesServiceStatistics = v\n\treturn s\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 about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Determine the current call type based on get params as they can change the output behavior to make the ngrest crud list view. @return boolean|string
[ "public function getNgRestCallType()\n {\n if ($this->_ngrestCallType === null) {\n $this->_ngrestCallType = (!Yii::$app instanceof \\yii\\web\\Application) ? false : Yii::$app->request->get('ngrestCallType', false);\n }\n\n return $this->_ngrestCallType;\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:" }
Method to get field element objects @return array
[ "public function getFields()\n {\n $fields = [];\n foreach ($this->fieldsets as $fieldset) {\n $fields = array_merge($fields, $fieldset->getAllFields());\n }\n return $fields;\n }" ]
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github comment about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
List comments in a repository @link https://developer.github.com/v3/issues/comments/#list-comments-in-a-repository @param string $sort @param string $direction @param string $since @return array
[ "public function listRepositoryComments(string $sort = AbstractApi::SORT_CREATED,\n string $direction = AbstractApi::DIRECTION_DESC,\n string $since = 'now'): array\n {\n return $this->getApi()->request($this->getApi()->sp...
[ "public function addLabelsToAnIssue($owner, $repo, $number, $name)\n\t{\n\t\t$data = array($name);\n\n\t\treturn $this->client->request(\"/repos/$owner/$repo/issues/$number/labels\", 'POST', json_encode($data), 200, '');\n\t}" ]
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code:" }
Method: parseGeometry.polygon Given a KML node representing a polygon geometry, create an OpenLayers polygon geometry. Parameters: node - {DOMElement} A KML Polygon node. Returns: {<OpenLayers.Geometry.Polygon>} A polygon geometry.
[ "function(node) {\n var nodeList = this.getElementsByTagNameNS(node, this.internalns,\n \"LinearRing\");\n var numRings = nodeList.length;\n var components = new Array(numRings);\n if(numRings > 0) {\n /...
[ "function MultiPolygon(input){\n if(input && input.type === \"MultiPolygon\" && input.coordinates){\n extend(this, input);\n } else if(isArray(input)) {\n this.coordinates = input;\n } else {\n throw \"Terraformer: invalid input for Terraformer.MultiPolygon\";\n }\n\n this.type = \"Mul...
codesearchnet
{ "query": "Represent the Github comment about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code:" }
// open opens and initializes the view.
[ "func (v *view) open() error {\n\n\t// Never keep a cache for field views.\n\tif strings.HasPrefix(v.name, viewBSIGroupPrefix) {\n\t\tv.cacheType = CacheTypeNone\n\t}\n\n\tif err := func() error {\n\t\t// Ensure the view's path exists.\n\t\tv.logger.Debugf(\"ensure view path exists: %s\", v.path)\n\t\tif err := os....
[ "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 summarization:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
// RegisterFieldDecoder register TypeDecoder for a struct field
[ "func RegisterFieldDecoder(typ string, field string, decoder ValDecoder) {\n\tfieldDecoders[fmt.Sprintf(\"%s/%s\", typ, field)] = decoder\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:" }
// NewAdxrForStream creates an Average Directional Rating Index (Adxr) for online usage with a source data stream
[ "func NewAdxrForStream(priceStream gotrade.DOHLCVStreamSubscriber, timePeriod int) (indicator *Adxr, err error) {\n\tind, err := NewAdxr(timePeriod)\n\tpriceStream.AddTickSubscription(ind)\n\treturn ind, err\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 description:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
@param array $options @param Branch|string $arg @throws \RuntimeException @return string
[ "public function revParse($arg = null, Array $options = array())\n {\n $this->clearAll();\n $this->addCommandName(self::GIT_REV_PARSE_COMMAND);\n // if there are options add them.\n if (! is_null($options)) {\n foreach ($options as $option) {\n $this->addComm...
[ "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 summarization about PHP:", "pos": "Represent the code about PHP:", "neg": "Represent the code about Software development:" }
Convert the object into a json serializable dictionary. Note: It uses the private method _save_to_input_dict of the parent. :return dict: json serializable dictionary containing the needed information to instantiate the object
[ "def to_dict(self):\n \n\n input_dict = super(Linear, self)._save_to_input_dict()\n input_dict[\"class\"] = \"GPy.mappings.Linear\"\n input_dict[\"A\"] = self.A.values.tolist()\n return input_dict" ]
[ "def values(*rels):\n '''\n \n '''\n #Action function generator to multiplex a relationship at processing time\n def _values(ctx):\n '''\n Versa action function Utility to specify a list of relationships\n\n :param ctx: Versa context used in processing (e.g. includes the prototyp...
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
@param string $site @param string $env @return \Acquia\Cloud\Api\Response\Domains @throws \Guzzle\Http\Exception\ClientErrorResponseException @see http://cloudapi.acquia.com/#GET__sites__site_envs__env_domains-instance_route
[ "public function domains($site, $env)\n {\n $variables = array(\n 'site' => $site,\n 'env' => $env,\n );\n $request = $this->get(array('{+base_path}/sites/{site}/envs/{env}/domains.json', $variables));\n return new Response\\Domains($request);\n }" ]
[ "def Delete(self):\n\t\t\n\t\tr = clc.v2.API.Call('DELETE','antiAffinityPolicies/%s/%s' % (self.alias,self.id),{},session=self.session)" ]
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Print Line @param string $text @param string $type
[ "public static function printLine($text = '', $type = 'normal')\n {\n $colorList = array(\n 'normal' => '0',\n 'information' => '1;34',\n 'success' => '1;32',\n 'warning' => '1;33',\n 'error' => '1;31'\n );\n $color = isset($colorList[$t...
[ "public function render($renderer)\n {\n $renderer->setCurrentStyle('footnotenum');\n $renderer->Write($renderer->getCurrentStyleHeight(), $this->numText, $this->addlink); //source link numbers after name\n }" ]
codesearchnet
{ "query": "Represent the Github post about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
// Build a url path and query string
[ "func (o *LoginUserURL) Build() (*url.URL, error) {\n\tvar _result url.URL\n\n\tvar _path = \"/users/login\"\n\n\t_basePath := o._basePath\n\tif _basePath == \"\" {\n\t\t_basePath = \"/v2\"\n\t}\n\t_result.Path = golangswaggerpaths.Join(_basePath, _path)\n\n\tqs := make(url.Values)\n\n\tvar password string\n\tif o....
[ "function(request, modules_root, options){\n var [path, analysis] = normalize_path(request, modules_root, options.relative_path_root);\n var cache_path = path; // define cachepath as path to file with content. For modules, defines path to package.json\n if(analysis.is_a_module) cache_path = \"m...
codesearchnet
{ "query": "Represent the description about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
todo: should delay parent unmount() by returning res prom?
[ "function removeChild(parEl, el) {\n\tvar node = el._node;\n\n\t// already marked for removal\n\tif (node._dead) { return; }\n\n\tvar res = deepNotifyRemove(node);\n\n\tif (res != null && isProm(res)) {\n\t\tnode._dead = true;\n\t\tres.then(curry(_removeChild, [parEl, el, true]));\n\t}\n\telse\n\t\t{ _removeChild(p...
[ "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 instruction:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Generates 'aggregate' command. @param string $collectionName collection name @param array $pipelines list of pipeline operators. @param array $options optional parameters. @return array command document.
[ "public function aggregate($collectionName, $pipelines, $options = [])\n {\n foreach ($pipelines as $key => $pipeline) {\n if (isset($pipeline['$match'])) {\n $pipelines[$key]['$match'] = $this->buildCondition($pipeline['$match']);\n }\n }\n\n $document =...
[ "public function hintJsonStructure($column, $structure)\n {\n if (json_decode($structure) === null) {\n throw new InvalidJsonException();\n }\n\n $this->hintedJsonAttributes[$column] = $structure;\n\n // Run the call to add hinted attributes to the internal json\n //...
codesearchnet
{ "query": "Represent the text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software Development:" }
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WebhookThrottleConfig.
[ "func (in *WebhookThrottleConfig) DeepCopy() *WebhookThrottleConfig {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(WebhookThrottleConfig)\n\tin.DeepCopyInto(out)\n\treturn out\n}" ]
[ "func (r Registration) Unmarshal(fileContent []byte) (runtime.Object, error) {\n\t// Do a deepcopy of the empty value so we don't mutate it, which could lead to strange errors\n\tobj := r.EmptyValue.DeepCopyObject()\n\n\t// Decode the file content into obj which is a pointer to an empty struct of the internal Compo...
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
// AfterInit registers HTTP handlers.
[ "func (p *Plugin) AfterInit() error {\n\tif p.HTTP != nil {\n\t\tp.Lock()\n\t\tdefer p.Unlock()\n\t\tfor path, reg := range p.regs {\n\t\t\tp.HTTP.RegisterHTTPHandler(path, p.createHandlerHandler(reg.Gatherer, reg.httpOpts), \"GET\")\n\t\t\tp.Log.Infof(\"Serving %s on port %d\", path, p.HTTP.GetPort())\n\n\t\t}\n\t...
[ "@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 sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
process an HTML get or post. @exception ServletException From inherited class. @exception IOException From inherited class.
[ "public void service(HttpServletRequest req, HttpServletResponse res) \n throws ServletException, IOException\n {\n String regex = this.getProperty(REGEX);\n String server = req.getServerName();\n if (regex != null)\n \tif (server != null)\n {\n \tString match = n...
[ "public void reinitialize( HttpServletRequest request, HttpServletResponse response, ServletContext servletContext )\n {\n //\n // Cache the associated ModuleConfig. This is used throughout the code, in places where the request\n // isn't available to do a lazy initialization.\n //\n...
codesearchnet
{ "query": "Represent the summarization about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
根据用户传入的c得到单词的状态. 0.代表这个字不在词典中 1.继续 2.是个词但是还可以继续 3.停止已经是个词了 @param c @return
[ "private int getStatement() {\n checkValue = baseValue;\n baseValue = DATDictionary.getItem(checkValue).getBase() + charHashCode;\n if (baseValue < DATDictionary.arrayLength && (DATDictionary.getItem(baseValue).getCheck() == checkValue\n || DATDictionary.getItem(baseValue...
[ "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 text about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about text processing:" }
Redirect back to the original page, if any
[ "function (req, res) {\n req.session.loggedIn = true;\n if (config.oauth2.validateHostedDomain) {\n req.session.allowedDomain = config.oauth2.hostedDomain;\n }\n var redirect = req.session.oauth2return || '/';\n delete req.session.oauth2return;\n res.redirect(redirect);\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 Github description about Laravel:", "pos": "Represent the Github code about Laravel:", "neg": "Represent the Github code about programming:" }
Proxy write to the underlying socket.
[ "function write(data, cb) {\n if(this._tcp) {\n //this.emit('output', data);\n this.encoder.write(data, cb);\n }else{\n this._socket.write.call(this._socket, data, cb);\n }\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:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Update existing TelegramBot --- serializer: TelegramBotUpdateSerializer responseMessages: - code: 401 message: Not authenticated - code: 400 message: Not valid request
[ "def put(self, request, bot_id, id, format=None):\n \n return super(TelegramBotDetail, self).put(request, bot_id, id, format)" ]
[ "def raise_right_error(response):\n \"\"\"\"\"\"\n if response.status_code == 200:\n return\n if response.status_code == 500:\n raise ServerError('Clef servers are down.')\n if response.status_code == 403:\n message = response.json().get('error')\n error_class = MESSAGE_TO_ER...
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Natural Language Processing:" }
Returns a full HTML rendering of the CMS navigation menu @return string
[ "protected function menu()\n {\n\n $this->Benchmark->start('getMenu');\n try {\n $menu = $this->CMSNavItemService->getMenu();\n } catch (Exception $e) {\n return '';\n }\n $this->Benchmark->end('getMenu');\n\n $this->Benchmark->start('buildMenu');\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 description about text processing:", "pos": "Represent the Github code about text processing:", "neg": "Represent the Github code:" }
Move all the intervals in the list by the given ``offset``. :param offset: the shift to be applied :type offset: :class:`~aeneas.exacttiming.TimeValue` :raises TypeError: if ``offset`` is not an instance of ``TimeValue``
[ "def offset(self, offset):\n \n self.log(u\"Applying offset to all fragments...\")\n self.log([u\" Offset %.3f\", offset])\n for fragment in self.fragments:\n fragment.interval.offset(\n offset=offset,\n allow_negative=False,\n min...
[ "def __set_interval(self, value):\n '''\n \n '''\n if not isinstance(self, Interval):\n raise ValueError(\"'value' must be of type Interval\")\n\n self.__interval = value" ]
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Creates mapping df based on ann_label_table and self.custom_labels. Table composed of entire WFDB standard annotation table, overwritten/appended with custom_labels if any. Sets __label_map__ attribute, or returns value.
[ "def create_label_map(self, inplace=True):\n \n\n label_map = ann_label_table.copy()\n\n if self.custom_labels is not None:\n self.standardize_custom_labels()\n for i in self.custom_labels.index:\n label_map.loc[i] = self.custom_labels.loc[i]\n\n if ...
[ "def values(*rels):\n '''\n \n '''\n #Action function generator to multiplex a relationship at processing time\n def _values(ctx):\n '''\n Versa action function Utility to specify a list of relationships\n\n :param ctx: Versa context used in processing (e.g. includes the prototyp...
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Insert the required TR nodes into the table for display @param {object} oSettings dataTables settings object @memberof DataTable#oApi
[ "function _fnDraw( oSettings )\r\n\t{\r\n\t\t/* Provide a pre-callback function which can be used to cancel the draw is false is returned */\r\n\t\tvar aPreDraw = _fnCallbackFire( oSettings, 'aoPreDrawCallback', 'preDraw', [oSettings] );\r\n\t\tif ( $.inArray( false, aPreDraw ) !== -1 )\r\n\t\t{\r\n\t\t\t_fnProcess...
[ "function(elTh, oColumn) {\n SDT.superclass._initThEl.call(this, elTh, oColumn);\n elTh.id = this.getId() +\"-fixedth-\" + oColumn.getSanitizedKey(); // Needed for getColumn by TH and ColumnDD\n}" ]
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Indica si este input se debe evaluar para alguno de los tipos dados @param string ...$types @return bool
[ "public function isEvaluableForTypes(string ...$types): bool\n {\n if (!$this->isValid()) {\n return false;\n }\n\n if (is_empty($types)) {\n return true;\n }\n\n return Data::make($this->value)->isTypeOf(...$types);\n }" ]
[ "public static void registerAgent(Agent agent, String serviceName, String serviceType) throws FIPAException{\n DFAgentDescription dfd = new DFAgentDescription();\n ServiceDescription sd = new ServiceDescription();\n \n sd.setType(serviceType);\n sd.setName(serviceName);\n \...
codesearchnet
{ "query": "Represent the Github comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
Return new Command object that will be run in specified directory. new_cmd = old_cmd.in_dir("/usr")
[ "def in_dir(self, directory):\n \n new_command = copy.deepcopy(self)\n new_command._directory = str(directory)\n return new_command" ]
[ "function(uuid, env) {\n\n app.status('Pushing files.');\n\n // Hack together an rsync command\n var envSite = [env, uuid].join('.');\n var fileBox = envSite + '@appserver.' + envSite + '.drush.in:files/';\n return commands.rsync('/media/', fileBox);\n\n }" ]
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
<!-- begin-user-doc --> <!-- end-user-doc --> @generated
[ "@Override\n\tpublic void eUnset(int featureID) {\n\t\tswitch (featureID) {\n\t\t\tcase AfplibPackage.BMO__OVLY_NAME:\n\t\t\t\tsetOvlyName(OVLY_NAME_EDEFAULT);\n\t\t\t\treturn;\n\t\t\tcase AfplibPackage.BMO__TRIPLETS:\n\t\t\t\tgetTriplets().clear();\n\t\t\t\treturn;\n\t\t}\n\t\tsuper.eUnset(featureID);\n\t}" ]
[ "protected function _init($definition=null)\n {\n\n if (!is_null($definition)) {\n $this->_packageXml = simplexml_load_string($definition);\n } else {\n $packageXmlStub = <<<END\n<?xml version=\"1.0\"?>\n<package>\n <name />\n <version />\n <stability />\n <license...
codesearchnet
{ "query": "Represent the post about Text generation:", "pos": "Represent the code about Text generation:", "neg": "Represent the code:" }
-- HTTP REQUEST -------------------------------------------------------------
[ "function makeHttpRequest(encoding, next) {\n var start = Date.now();\n\n request(\n {\n url: 'http://localhost:1337/' + encoding,\n method: 'GET',\n headers: {\n 'accept-encoding': encoding,\n },\n },\n function(err, data, body) {\n var time = Date.now() - start;\n\n ...
[ "def set_https_port(port=443):\n '''\n \n '''\n _current = global_settings()\n\n if _current['Global Settings']['HTTP_PORT']['VALUE'] == port:\n return True\n\n _xml = \"\"\"<RIBCL VERSION=\"2.0\">\n <LOGIN USER_LOGIN=\"adminname\" PASSWORD=\"password\">\n <R...
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Ensures that this manager always returns nodes in tree order.
[ "def get_queryset(self, *args, **kwargs):\n \n qs = super(TreeManager, self).get_queryset(*args, **kwargs)\n\n # Restrict operations to pages on the current site if needed\n if settings.PAGES_HIDE_SITES and settings.PAGES_USE_SITE_ID:\n return qs.order_by(self.tree_id_attr, se...
[ "public FunctionHandle resolveFunction(Session session, QualifiedName name, List<TypeSignatureProvider> parameterTypes)\n {\n // TODO Actually use session\n // Session will be used to provide information about the order of function namespaces to through resolving the function.\n // This is l...
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }
Shows the tab and put into the foreground, if no query is executed yet.
[ "private void showTab() {\n\t\tif (parentTab != null) {\n\t\t\ttab = parentTab.getTab(this);\n\t\t\tif (tab != null) {\n\t\t\t\t// FIXME: this should be added by the constructor or by the panel that adds this\n\t\t\t\t// tab\n\t\t\t\t// tab.getComponent().addStyleName(\"example-queries-tab\");\n\t\t\t\ttab.setEnabl...
[ "@PrefMetadata(type = CmsTimeWarpPreference.class)\n public String getTimeWarp() {\n\n long warp = m_settings.getTimeWarp();\n return warp < 0 ? \"\" : \"\" + warp; // if timewarp < 0 (i.e. time warp is not set), use the empty string because we don't want the date selector widget to interpret the n...
codesearchnet
{ "query": "Represent the comment:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
// Decode accepts a packed byte array and populates the fields of the SetQuadMotorsSetpoint
[ "func (m *SetQuadMotorsSetpoint) Decode(buf []byte) {\n\tdata := bytes.NewBuffer(buf)\n\tbinary.Read(data, binary.LittleEndian, &m.MOTOR_FRONT_NW)\n\tbinary.Read(data, binary.LittleEndian, &m.MOTOR_RIGHT_NE)\n\tbinary.Read(data, binary.LittleEndian, &m.MOTOR_BACK_SE)\n\tbinary.Read(data, binary.LittleEndian, &m.MOT...
[ "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 about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
tries to connect to the same app on differnet host from dist-info
[ "def reelect_app(self, request, app):\n \"\"\"\"\"\"\n\n # disconnect app explicitly to break possibly existing connection\n app.disconnect()\n endpoints_size = len(app.locator.endpoints)\n\n # try x times, where x is the number of different endpoints in app locator.\n for ...
[ "def list_nodes(self):\n \"\"\"\"\"\"\n self.add_environment_file(user='stack', filename='stackrc')\n ret, _ = self.run(\"ironic node-list --fields uuid|awk '/-.*-/ {print $2}'\", user='stack')\n # NOTE(Gonéri): the good new is, the order of the nodes is preserved and follow the one from...
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Technology:" }
<p> Returns the absolute value of the element in the matrix that has the largest absolute value.<br> <br> Max{ |a<sub>ij</sub>| } for all i and j<br> </p> @param a A matrix. Not modified. @return The max abs element value of the matrix.
[ "public static double elementMaxAbs( DMatrix4x4 a ) {\n double max = Math.abs(a.a11);\n double tmp = Math.abs(a.a12); if( tmp > max ) max = tmp;\n tmp = Math.abs(a.a13); if( tmp > max ) max = tmp;\n tmp = Math.abs(a.a14); if( tmp > max ) max = tmp;\n tmp = Math.abs(a.a21); if( tmp...
[ "def perm(A, p):\n \n assert isinstance(A,spmatrix), \"argument must be a sparse matrix\"\n assert A.size[0] == A.size[1], \"A must be a square matrix\"\n assert A.size[0] == len(p), \"length of p must be equal to the order of A\"\n return A[p,p]" ]
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
// parse property with `?` suffix as optional property
[ "func (t *Type) parseOptionalProperty(name string) {\n\tif !strings.HasSuffix(name, \"?\") {\n\t\treturn\n\t}\n\tnewName := strings.TrimSuffix(name, \"?\")\n\n\tp := t.Properties[name]\n\n\t// we will modify both property name\n\t// and content, so we delete it\n\tdelete(t.Properties, name)\n\n\tswitch p.(type) {\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:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
// SetThingName sets the ThingName field's value.
[ "func (s *UpdateConnectivityInfoInput) SetThingName(v string) *UpdateConnectivityInfoInput {\n\ts.ThingName = &v\n\treturn s\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:" }
Fixes spaces around various brackets. @param input [String] The paragraph which will be converted. @return [String] Paragraph with correct spaces around brackets.
[ "def brackets_whitespace(input)\n output = input.gsub(/([\\(\\[\\{])\\s*/, '\\1')\n output = output.gsub(/\\s*([\\]\\)\\}])/, '\\1')\n output = output.gsub(/\\s+([\\(\\[\\{])\\s*/, ' \\1')\n output = output.gsub(/\\s*([\\]\\)\\}])\\s+/, '\\1 ')\n end" ]
[ "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 Github text about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
Creates \Google\Protobuf\FileDescriptorProto object from serialized Protocol Buffers message. @param string $input @param FileDescriptorProto $object @param int $start @param int $end @throws \Exception @return FileDescriptorProto
[ "public static function fromProtobuf($input, $object = NULL, &$start = 0, $end = NULL)\n\t{\n\t\tif ($object === null) {\n\t\t\t$object = new FileDescriptorProto();\n\t\t}\n\n\t\tif ($end === null) {\n\t\t\t$end = strlen($input);\n\t\t}\n\n\t\twhile ($start < $end) {\n\t\t\t$tag = Binary::decodeVarint($input, $star...
[ "final public function getArray()\n {\n $res = $this->getArrayInternal();\n if (!$this->isArray($res) && !$this->isArrayObject($res)) {\n $errorMessage = 'AbstractDriver method _getArray() must return array or ArrayObject.';\n $errorMessage .= ' Make sure you have provided a v...
codesearchnet
{ "query": "Represent the sentence about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Software Development:" }
微信操作权限判断 增加微信管理员ID判断 @see yii\wechat\User::can() @return bool
[ "public static function can($permissionName, $params = [], $allowCaching = true)\n {\n $user = Yii::$app->user;\n $adminId = (array) Yii::$app->getModule('wechat')->adminId;\n return in_array($user->getId(), $adminId) || $user->can($permissionName, $params, $allowCaching);\n }" ]
[ "public static String getTransferQueue(String name) {\n LOG.debug(\"对于需要保序的情况,只应该启动单个中转节点,目前启动多个节点原节点会被挤掉线,但是由于重连机制,会轮着挤掉线\");\n return IdManager.generateStaticQueueId(buildTransferName(name));\n }" ]
codesearchnet
{ "query": "Represent the post about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code:" }
Check if the form was posted
[ "public function posted($method = 'post')\n {\n $postIndicator = $this->getPostIndicator();\n\n if ($postIndicator->posted($method)) {\n if ($method == 'post') {\n $this->setValues($_POST, $_FILES);\n } else if ($method == 'get') {\n $this->setVal...
[ "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 Github sentence about Writing:", "pos": "Represent the Github code about Writing:", "neg": "Represent the Github code about Data synchronization:" }
Server side validation.
[ "function validation($data, $files) {\n $errors = parent::validation($data, $files);\n $columns = $this->_customdata['columns'];\n $optype = $data['uutype'];\n $updatetype = $data['uuupdatetype'];\n\n // detect if password column needed in file\n if (!in_array('password', ...
[ "@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 summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Programming:" }
Send a subscribe message for the given doctype trough the given websocket, but only if it is in a ready state. If not, retry a few milliseconds later.
[ "function subscribeWhenReady(doctype, socket) {\n if (socket.readyState === WEBSOCKET_STATE.OPEN) {\n try {\n socket.send(\n JSON.stringify({\n method: 'SUBSCRIBE',\n payload: {\n type: doctype\n }\n })\n )\n } catch (error) {\n // eslint-dis...
[ "function onChunk(count) {\n // If chunk read has no bytes than there is nothing left, so end a\n // collection.\n if (count === 0) return next(end)\n\n // Move a offset `position` with `count` towards the end unless\n // position was a `null` in which case we just keep it (`null` means\n ...
codesearchnet
{ "query": "Represent the Github sentence about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about File management:" }
// CreateDir adds a dir at the specified path
[ "func (c *Connection) CreateDir(path string) error {\n\tc.RLock()\n\tdefer c.RUnlock()\n\tif err := c.isClosed(); err != nil {\n\t\treturn err\n\t}\n\tif err := c.ensurePath(path); err != nil {\n\t\treturn err\n\t}\n\treturn c.createDir(path)\n}" ]
[ "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 Github instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Determines whether space(s) before after arrow(`=>`) is satisfy rule. if before/after value is `true`, there should be space(s). if before/after value is `false`, there should be no space. @param {ASTNode} node The arrow function node. @returns {void}
[ "function spaces(node) {\n const tokens = getTokens(node);\n const countSpace = countSpaces(tokens);\n\n if (rule.before) {\n\n // should be space(s) before arrow\n if (countSpace.before === 0) {\n context.report({\n ...
[ "function run(booleanOrString, anyDataType, functionOrObject, aNumber, anArray) {\n /*\n * if expectations aren't met, args checker will throw appropriate exceptions\n * notifying the user regarding the errors of the arguments.\n * */\n \targs.expect(arguments, ['boolean|string', '*',...
codesearchnet
{ "query": "Represent the Github description about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code about programming:" }
@param string $family @return \Interpro\Core\Contracts\Executor\BDestructor
[ "public function getBDestructor($family)\n {\n if(!array_key_exists($family, $this->destructorsB))\n {\n throw new CoreException('Деструктор агрегатных(B) типов пакета '.$family.' не найдена в медиаторе!');\n }\n\n return $this->destructorsB[$family];\n }" ]
[ "def DeserializeExclusiveData(self, reader):\n \n self.Type = TransactionType.StateTransaction\n\n self.Descriptors = reader.ReadSerializableArray('neo.Core.State.StateDescriptor.StateDescriptor')" ]
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
If a config file name is specified, flushes cached config values for specified config file. Otherwise, flushes all cached config data. The latter should be avoided in production environments, if possible.
[ "def flush_cache(name=nil)\n if name\n name = name.to_s\n self.cache_hash[name] &&= nil\n else\n logger.warn \"RConfig: Flushing config data cache.\"\n self.suffixes = {}\n self.cache = {}\n self.cache_files = {}\n self.cache_hash ...
[ "def resolveEntryPoint(entryPoint):\n \n if inVirtualEnv():\n path = os.path.join(os.path.dirname(sys.executable), entryPoint)\n # Inside a virtualenv we try to use absolute paths to the entrypoints.\n if os.path.isfile(path):\n # If the entrypoint is present, Toil must have be...
codesearchnet
{ "query": "Represent the description about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code about Software development:" }
Function responsible for executing the steps of any task (setting the $executed property to true)
[ "public function execute() {\n if (!$this->built) {\n throw new base_task_exception('base_task_not_built', $this->name);\n }\n if ($this->executed) {\n throw new base_task_exception('base_task_already_executed', $this->name);\n }\n\n // Starts progress based ...
[ "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 post:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Paints the given WTextArea. @param component the WTextArea to paint. @param renderContext the RenderContext to paint to.
[ "@Override\n\tpublic void doRender(final WComponent component, final WebXmlRenderContext renderContext) {\n\t\tWTextArea textArea = (WTextArea) component;\n\t\tXmlStringBuilder xml = renderContext.getWriter();\n\t\tboolean readOnly = textArea.isReadOnly();\n\t\txml.appendTagOpen(\"ui:textarea\");\n\t\txml.appendAtt...
[ "public void setColor(TimeArea area, Color color) {\n // If null was supplied, then use the default color.\n if (color == null) {\n color = area.defaultColor;\n }\n // Save the color to the color map.\n colors.put(area, color);\n\n // Call any \"updating function...
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Fetch movie FPS from MPlayer output or return given default.
[ "def detectFpsFromMovie(cls, movieFile, default = 23.976):\n \"\"\"\"\"\"\n\n # initialize with a default FPS value, but not with a movieFile\n videoInfo = VideoInfo(float(default))\n\n command = ['mplayer',\n '-really-quiet', '-vo', 'null', '-ao', 'null', '-frames', '0', '-id...
[ "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 description:", "pos": "Represent the code:", "neg": "Represent the code:" }
Return method argument code @return Expr|Expr\FuncCall
[ "public function getArgStmt(Argument $argument) : NodeAbstract\n {\n $dependencyIndex = (string) $argument;\n if ($dependencyIndex === 'Ray\\Di\\InjectionPointInterface-' . Name::ANY) {\n return $this->getInjectionPoint();\n }\n $hasDependency = isset($this->container->getC...
[ "def property_(getter: Map[Domain, Range]) -> property:\n \n return property(map_(WeakKeyDictionary())(getter))" ]
codesearchnet
{ "query": "Represent the instruction about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
Returns the indentation for this node Iff a node is in a suite, then it has indentation.
[ "def indentation(node):\n \n while node.parent is not None and node.parent.type != syms.suite:\n node = node.parent\n if node.parent is None:\n return u\"\"\n # The first three children of a suite are NEWLINE, INDENT, (some other node)\n # INDENT.value contains the indentation for this ...
[ "private static String keyToGoWithElementsString(String label, DuplicateGroupedAndTyped elements) {\n /*\n * elements.toString(), which the caller is going to use, includes the homogeneous type (if\n * any), so we don't want to include it here. (And it's better to have it in the value, rather\n * tha...
codesearchnet
{ "query": "Represent the Github summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Loads a user object with data for this field ready for the edit profile form @param stdClass $user a user object
[ "public function edit_load_user_data($user) {\n if ($this->data !== null) {\n $user->{$this->inputname} = $this->data;\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 description:", "pos": "Represent the code:", "neg": "Represent the code:" }
Configure a proxy to use for HTTPS connections created anywhere in the JVM (not recommended). @param host the proxyHost @param port the proxyPort
[ "public static void setJVMProxy(String host, String port) {\n\t\tSystem.setProperty(JVM_PROXY_HOST_PROPERTY, host);\n\t\tSystem.setProperty(JVM_PROXY_PORT_PROPERTY, port);\n\t}" ]
[ "public int getPort() {\n final Connector[] connectors = this.server.getConnectors();\n checkState(connectors.length >= 1, \"Server must have at least 1 connector\");\n\n // The first connector is created upon initializing the server. That's the one that has the port.\n return connectors[0].getLocalPort...
codesearchnet
{ "query": "Represent the comment about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Software development:" }
Create master-slave data source. @param dataSourceMap data source map @param masterSlaveRuleConfig master-slave rule configuration @param props props @return master-slave data source @throws SQLException SQL exception
[ "public static DataSource createDataSource(final Map<String, DataSource> dataSourceMap, final MasterSlaveRuleConfiguration masterSlaveRuleConfig, final Properties props) throws SQLException {\n return new MasterSlaveDataSource(dataSourceMap, masterSlaveRuleConfig, props);\n }" ]
[ "private void createOrUpdateKeyspace(List<TableInfo> tableInfos) throws Exception\n {\n KsDef ksDef = onCreateKeyspace(); // create keyspace event.\n createColumnFamilies(tableInfos, ksDef); // create column family event.\n }" ]
codesearchnet
{ "query": "Represent the Github description about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Software development:" }
Returns whether a given name is already in use by anything that it would conflict with for this model @param string $name @return bool
[ "protected function doesRelationNameConflict($name)\n {\n // relationships\n $relationships = array_merge(\n $this->data['relationships']['normal'],\n $this->data['relationships']['reverse'],\n $this->data['relationships']['image'],\n $this->data['relatio...
[ "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 comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Read configuration file options.
[ "def read_config(cls, configparser):\n \"\"\"\"\"\"\n config = dict()\n section = cls.__name__\n option = \"prefixes\"\n if configparser.has_option(section, option):\n value = configparser.get(section, option)\n names = [x.strip().lower() for x in value.split...
[ "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 instruction:", "pos": "Represent the code:", "neg": "Represent the code:" }
/* (non-Javadoc) @see com.ibm.ws.sib.processor.impl.interfaces.DownstreamControl#sendNotFlushedMessage(com.ibm.ws.sib.utils.SIBUuid12, long)
[ "public void sendNotFlushedMessage(SIBUuid8 ignore, SIBUuid12 streamID, long requestID) \n throws SIResourceException \n {\n if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) \n SibTr.entry(tc, \"sendNotFlushedMessage\", \n new Object[]{ignore, streamID, new Long(requestID)});\n ...
[ "protected InvokerExtensionProcessor getInvokerExtensionProcessor(com.ibm.ws.webcontainer.webapp.WebApp app)\n {\n return new com.ibm.ws.webcontainer.osgi.extension.InvokerExtensionProcessor(app, config.getInvokerAttributes());\n }" ]
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Render a default HTML "Whitelabel Error Page". <p> Useful when no other error view is available in the application. @param responseBody the error response being built @param error the error data as a map @return a Publisher of the {@link ServerResponse}
[ "protected Mono<ServerResponse> renderDefaultErrorView(\n\t\t\tServerResponse.BodyBuilder responseBody, Map<String, Object> error) {\n\t\tStringBuilder builder = new StringBuilder();\n\t\tDate timestamp = (Date) error.get(\"timestamp\");\n\t\tObject message = error.get(\"message\");\n\t\tObject trace = error.get(\"...
[ "@Route(method= HttpMethod.GET, uri=\"/{id}\")\n public Result get(@Parameter(\"id\") String id) {\n // The value of id is computed from the {id} url fragment.\n return ok(id);\n }" ]
codesearchnet
{ "query": "Represent the instruction about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Programming:" }
Set parent field value to child - variants
[ "protected function _assignParentDependFields()\n {\n $sParent = $this->getParentArticle();\n if ($sParent) {\n foreach ($this->_getCopyParentFields() as $sField) {\n $this->$sField = new \\OxidEsales\\Eshop\\Core\\Field($sParent->$sField->value);\n }\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 about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
Returns block name for given `node` by `prefix`, which tells the depth of of parent node lookup @param {Node} node @param {Map} lookup @param {String} prefix @return {String}
[ "function getBlockName(node, lookup, prefix) {\n\tlet depth = prefix.length > 1 ? prefix.length : 0;\n\n\t// NB don’t walk up to root node, stay at first root child in case of\n\t// too deep prefix\n\twhile (node.parent && node.parent.parent && depth--) {\n\t\tnode = node.parent;\n\t}\n\n\treturn lookup.get(node) |...
[ "function enum_ (options) {\n options.hash.kind = 'member'\n options.hash.isEnum = true\n var result = _identifier(options)\n return result ? options.fn(result) : 'ERROR, Cannot find enum.'\n}" ]
codesearchnet
{ "query": "Represent the sentence about Computer Science:", "pos": "Represent the code about Computer Science:", "neg": "Represent the code:" }
Returns a collection of momentjs filters
[ "def get_filters(self):\n \n return dict(\n moment_format=self.format,\n moment_calendar=self.calendar,\n moment_fromnow=self.from_now,\n )" ]
[ "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 comment:", "pos": "Represent the code:", "neg": "Represent the code:" }
Register the router adapter. @return void
[ "protected function registerRouterAdapter()\n {\n $this->app->singleton('api.router.adapter', function($app) {\n return new DingoRoutingLaravelAdapter($this->cloneLaravelRouter(), $app['router']->getRoutes());\n });\n }" ]
[ "def getNetworkFragmentID(self):\n \n print '%s call getNetworkFragmentID' % self.port\n if not self.____isOpenThreadWpanRunning():\n print 'OpenThreadWpan is not running'\n return None\n\n return self.__sendCommand(WPANCTL_CMD + 'getprop -v Network:PartitionId')[0]...
codesearchnet
{ "query": "Represent the Github post about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
Extract metadata from document @param ZipArchive $package ZipArchive OpenXML package @return array Key-value pairs containing document meta data
[ "protected function extractMetaData(ZipArchive $package)\n {\n // Data holders\n $coreProperties = array();\n\n // Read relations and search for core properties\n $relations = simplexml_load_string($package->getFromName(\"_rels/.rels\"));\n foreach ($relations->Relationship as ...
[ "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 Github summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Adds a permission on a view or menu to the backend :param permission_name: name of the permission to add: 'can_add','can_edit' etc... :param view_menu_name: name of the view menu to add
[ "def add_permission_view_menu(self, permission_name, view_menu_name):\n \n if not (permission_name and view_menu_name):\n return None\n pv = self.find_permission_view_menu(\n permission_name,\n view_menu_name\n )\n if pv:\n return pv\n ...
[ "def get_field_visibility_mode(self, field):\n \n fallback_mode = (\"hidden\", \"hidden\")\n widget = field.widget\n\n # TODO This needs to be done differently\n # Check where the field has to be located\n layout = widget.isVisible(self.context, \"header_table\")\n i...
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code:" }
Returns an object or array of the FDC error parsed from the Guzzle Request exception @param RequestException $requestException @param bool $isAssoc @return string
[ "public static function parseError(RequestException $requestException, $isAssoc = true)\n\t{\n\n\t\t$error = $error = json_decode($requestException->getResponse()->getBody(), $isAssoc);\n\n\t\tif (!is_null($error))\n\t\t{\n\t\t\treturn $error;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn $requestException->getMessage();\n...
[ "private function processAuthenticate(Session $session, AuthenticateMessage $msg)\n {\n $session->abort(new \\stdClass(), 'thruway.error.internal');\n Logger::error($this, 'Authenticate sent to realm without auth manager.');\n }" ]
codesearchnet
{ "query": "Represent the summarization about PHP:", "pos": "Represent the code about PHP:", "neg": "Represent the code about Programming:" }
Reads the given file into a table using default options Uses converter specified based on given file extension Use {@link #usingOptions(ReadOptions) usingOptions} to use non-default options
[ "public Table file(File file) throws IOException {\n\tString extension = Files.getFileExtension(file.getCanonicalPath());\n\tDataReader<?> reader = registry.getReaderForExtension(extension);\n\treturn reader.read(new Source(file));\n }" ]
[ "public ParseSetup guessSetup(ByteVec v, byte[] bits, byte sep, int ncols, boolean singleQuotes, int checkHeader, String[] columnNames, byte[] columnTypes, String[][] domains, String[][] naStrings) {\n throw new UnsupportedOperationException(\"Not implemented. This method is kept only for backwards compatibility...
codesearchnet
{ "query": "Represent the Github text about File management:", "pos": "Represent the Github code about File management:", "neg": "Represent the Github code about programming:" }
Creates a all items generator. @param Builder $query @param int $count @return Generator
[ "protected function each(Builder $query, $count = 100): Generator\n {\n $query = $this->exportableQuery($query);\n\n // enforce order by statement.\n if (empty($query->orders) && empty($query->unionOrders)) {\n $query->orderBy($query->getModel()->getQualifiedKeyName(), 'asc');\n ...
[ "protected function setGeneratorImages()\n {\n $this->logger->debug('Base:setGeneratorImages');\n $this->setParam('generator', 'images');\n $this->setParam('gimlimit', $this->getLimit());\n }" ]
codesearchnet
{ "query": "Represent the comment about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Programming:" }
// Case-sensitive match of origin header
[ "func matchOrigin(origin string, config Config) bool {\n\tfor _, value := range config.origins {\n\t\tif value == origin {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\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 text:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Convert old style options into arguments to boto3.session.Session.
[ "def convert_aws_args(aws_args):\n \"\"\"\"\"\"\n if not isinstance(aws_args, dict):\n raise errors.InvalidConfiguration(\n 'Elastic DocManager config option \"aws\" must be a dict'\n )\n old_session_kwargs = dict(\n region=\"region_name\",\n access_id=\"aws_access_ke...
[ "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 summarization:", "pos": "Represent the code:", "neg": "Represent the code:" }
split: like os.path.split @rtype: tuple(URI, str) @return: a 2 tuple. The first element is a URI instance and the second a string, representing the basename.
[ "def split(self):\n \n try:\n first, second = self.uri.rsplit('/', 1)\n except ValueError:\n first = ''\n second = self.uri\n # we might be already on the root\n if first.endswith('//'):\n first = first + '/'\n if not first:\n ...
[ "def get_sphinx_ref(self, url, label=None):\n \n\n # Raise an exception if the initial part of url does not match\n # the base url for this object\n n = len(self.baseurl)\n if url[0:n] != self.baseurl:\n raise KeyError('base of url %s does not match base url %s' %\n ...
codesearchnet
{ "query": "Represent the comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
<!-- begin-user-doc --> <!-- end-user-doc --> @generated
[ "@Override\r\n\tpublic EClass getServiceDescriptor() {\r\n\t\tif (serviceDescriptorEClass == null) {\r\n\t\t\tserviceDescriptorEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(StorePackage.eNS_URI).getEClassifiers().get(56);\r\n\t\t}\r\n\t\treturn serviceDescriptorEClass;\r\n\t}" ]
[ "protected function _init($definition=null)\n {\n\n if (!is_null($definition)) {\n $this->_packageXml = simplexml_load_string($definition);\n } else {\n $packageXmlStub = <<<END\n<?xml version=\"1.0\"?>\n<package>\n <name />\n <version />\n <stability />\n <license...
codesearchnet
{ "query": "Represent the Github summarization about Text generation:", "pos": "Represent the Github code about Text generation:", "neg": "Represent the Github code:" }
// NewClient returns an Attribute Protocol Client.
[ "func NewClient(l2c ble.Conn, h NotificationHandler) *Client {\n\tc := &Client{\n\t\tl2c: l2c,\n\t\trspc: make(chan []byte),\n\t\tchTxBuf: make(chan []byte, 1),\n\t\trxBuf: make([]byte, ble.MaxMTU),\n\t\tchErr: make(chan error, 1),\n\t\thandler: h,\n\t}\n\tc.chTxBuf <- make([]byte, l2c.TxMTU(), l2c.TxMTU...
[ "@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 programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Programming:" }
Get a relative URI for {@code file} from {@code output} folder.
[ "static String createRelativeUri(File file, File output) {\n if (file == null) {\n return null;\n }\n try {\n file = file.getCanonicalFile();\n output = output.getCanonicalFile();\n if (file.equals(output)) {\n throw new IllegalArgumentException(\"File path and output folder are ...
[ "function(request, modules_root, options){\n var [path, analysis] = normalize_path(request, modules_root, options.relative_path_root);\n var cache_path = path; // define cachepath as path to file with content. For modules, defines path to package.json\n if(analysis.is_a_module) cache_path = \"m...
codesearchnet
{ "query": "Represent the description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Returns the log of the pdf at the given values. The keyword arguments must contain all of parameters in self's params. Unrecognized arguments are ignored.
[ "def _logpdf(self, **kwargs):\n \n if kwargs in self:\n return numpy.log(self._pdf(**kwargs))\n else:\n return -numpy.inf" ]
[ "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 description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
ToC: Connection listeners @param data The data @return The events @exception Exception If an error occurs
[ "public static Map<String, List<TraceEvent>> tocConnectionListeners(List<TraceEvent> data) throws Exception\n {\n Map<String, List<TraceEvent>> result = new TreeMap<String, List<TraceEvent>>();\n\n for (TraceEvent te : data)\n {\n if (te.getType() == TraceEvent.GET_CONNECTION_LISTENER ||\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 instruction about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code:" }
@param string[] $searchedDirs @return null|string
[ "public function getPhpunitXmlDir($searchedDirs = [])\n {\n $locations = array_merge([$this->getSystemService()->getCurrentWorkingDirectory()], $searchedDirs);\n $path = null;\n\n foreach ($locations as $location) {\n if ($this->getFilesystemService()->isReadableFile($locatio...
[ "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 Github comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about File management:" }
------------------------------- Rendering -------------------------------
[ "function basename(s) {\n\t\t\tif ( s == null ) {\n\t\t\t\treturn \"\";\n\t\t\t}\n\t\t\ts = String(s);\n\t\t\treturn s.slice(1 + s.lastIndexOf('.'));\n\t\t}" ]
[ "function openTable()\n {\n $this->examples = [];\n $this->markdown = ''; // Clear table\n $this->declareAbstraction = true;\n $this->add('| Visibility | Function |');\n $this->add('|:-----------|:---------|');\n }" ]
codesearchnet
{ "query": "Represent the comment:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Returns the name of the output mask file that should reside on disk for the given signature.
[ "def getFilename(self,signature):\n \n\n filename=constructFilename(signature)\n\n if(fileutil.checkFileExists(filename)):\n return filename\n else:\n print(\"\\nmMask file for \", str(signature), \" does not exist on disk\", file=sys.stderr)\n return Non...
[ "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 comment:", "pos": "Represent the code:", "neg": "Represent the code:" }
// Contains determines whether the host is within aws.
[ "func (s *awsIPs) contains(ip net.IP) bool {\n\tnetworks := s.getCandidateNetworks(ip)\n\tfor _, network := range networks {\n\t\tif network.Contains(ip) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\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 instruction about Networking:", "pos": "Represent the Github code about Networking:", "neg": "Represent the Github code about programming:" }
Retrieve details on a single order.
[ "def retrieve_order(self, order_id):\n \"\"\"\"\"\"\n\n response = self.request(E.retrieveOrderSslCertRequest(\n E.id(order_id)\n ))\n\n return response.as_model(SSLOrder)" ]
[ "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 Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }