query stringlengths 16 255 | pos list | neg list | task stringclasses 1
value | instruction dict |
|---|---|---|---|---|
Checks to see if the *caller* of this expression should become part
of a function. If so, either a new function is created, or the
expression becomes part of the last function we created.
@param parentExpr | [
"private void visitParentExpression(AbstractFunctionExpression parentExpr) {\n\n if (nextFunctionBodyStart == null) {\n nextFunctionBodyStart = parentExpr;\n }\n\n if (currentFunctionName != null) {\n updateCurrentFunction(parentExpr);\n } else {\n create... | [
"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 summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
if an index exists for the given entry, the existing index is kept unless the timestamp is modified | [
"private ClassIndex indexForPath(Path path) {\n if (isJRTMarkerFile(path)) {\n FileSystem jrtfs = FileSystems.getFileSystem(URI.create(\"jrt:/\"));\n Path modules = jrtfs.getPath(\"modules\");\n return PATH_TO_INDEX.compute(path, (p, index) -> {\n try {\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 text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
This method is able to recursively collect all the matched words from Elasticsearch Explanation
document
@return a set of matched words that are matched to different ontology terms | [
"Set<String> findMatchedWords(Explanation explanation) {\n Set<String> words = new HashSet<>();\n String description = explanation.getDescription();\n if (description.startsWith(Options.SUM_OF.toString())\n || description.startsWith(Options.PRODUCT_OF.toString())) {\n if (newArrayList(explanati... | [
"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:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
CPU burst max running time - self.runtime_cfg.inner_burst_op_count | [
"def command_inner_burst_op_count(self, event=None):\n \n try:\n inner_burst_op_count = self.inner_burst_op_count_var.get()\n except ValueError:\n inner_burst_op_count = self.runtime_cfg.inner_burst_op_count\n\n if inner_burst_op_count < 1:\n inner_burst_... | [
"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 Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
xss sorgularından temizler
@param string $data
@return mixed|string
@throws \Exception | [
"public function xssProtection($data = '')\n {\n\n $data = str_replace($this->getReplaceTags(), '', $data);\n if (!is_string($data)) {\n\n throw new \\Exception(sprintf('%s veri tipi %s fonksiyonunda kullanılamaz', gettype($data),\n __FUNCTION__));\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 comment about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
Retrieve data from the cache.
@param string $identifier Identifier for this bit of data to read.
@return mixed The cached data, or false if the data doesn't exist, has expired, or on error while fetching. | [
"public function fetch($identifier)\n {\n [$config, $key] = $this->configSplit($identifier);\n\n return CakeCache::read(static::CACHE_PREFIX . $key, $config);\n }"
] | [
"public function item()\n {\n if (!empty($this->response['data'])) {\n return new Fluent($this->resource, $this->response['data']);\n }\n\n // On a valid response that does not have a data field, we can assume that\n // the request is an update/delete type of request that d... | codesearchnet | {
"query": "Represent the Github text about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about Software development:"
} |
Creates an returns a request.
@param array $config
@return ComConnectOauthRequest | [
"public function getRequest($config = array())\n {\n $config['consumer'] = $this->getConsumer();\n $config['token'] = $this->getToken();\n $config['version'] = $this->getVersion();\n\n return new ComConnectOauthRequest(new AnConfig($config));\n }"
] | [
"def includeme(config):\n \n root = config.get_root_resource()\n root.add('nef_polymorphic', '{collections:.+,.+}',\n view=PolymorphicESView,\n factory=PolymorphicACL)"
] | codesearchnet | {
"query": "Represent the Github description about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
Returns whether the output has been committed or not. | [
"public boolean isCommitted()\n {\n if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())\n { // 306998.15\n Tr.debug(tc, \"isCommitted: \" + committed);\n }\n return committed;\n }"
] | [
"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 text about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about File management:"
} |
Evaluates the ensemble and updates the database when finished/
Args:
path (str): Path to Xcessiv notebook
ensemble_id (str): Ensemble ID | [
"def evaluate_stacked_ensemble(path, ensemble_id):\n \n with functions.DBContextManager(path) as session:\n stacked_ensemble = session.query(models.StackedEnsemble).filter_by(\n id=ensemble_id).first()\n if not stacked_ensemble:\n raise exceptions.UserError('Stacked ensembl... | [
"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 instruction about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code:"
} |
// SetMessage sets the Message field's value. | [
"func (s *UpdateConnectivityInfoOutput) SetMessage(v string) *UpdateConnectivityInfoOutput {\n\ts.Message = &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 text about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
Get all of the artist in a user's collection. | [
"def getArtistsInCollection(user=nil,start=nil,count=nil,sort=nil,\n query=nil,extras=nil)\n method = 'getArtistsInCollection'\n type = Artist\n args = {}\n args[:user] = user if user\n args[:start] = start if start\n args[:count] = count if count\n a... | [
"def videos(self, days=None):\n \n if days is None:\n days = self._min_days_vdo_cache\n library = ArloMediaLibrary(self._session, preload=False)\n try:\n return library.load(only_cameras=[self], days=days)\n except (AttributeError, IndexError):\n #... | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Set retries
@param *int $retry The number of retries
@return Eve\Framework\Queue | [
"public function setRetry($retry)\n {\n Argument::i()\n ->test(1, 'int');\n\n $this->retry = $retry;\n return $this->setData($this->message);\n }"
] | [
"function CheckDevAck() {\n self.Debug (3,\"Waiting Acknowledgment Response %d/%d\", self.retry, smsc.opts.retry);\n smsc.GetFrom (CheckDevAckCB, smscmd.phone)\n }"
] | codesearchnet | {
"query": "Represent the instruction about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
// DecodeGRPCFindSessionByTokenRequest is a transport/grpc.DecodeRequestFunc that converts a
// gRPC request to a user-domain request. | [
"func DecodeGRPCFindSessionByTokenRequest(_ context.Context, request interface{}) (interface{}, error) {\n\treq := request.(*pb.FindSessionByTokenRequest)\n\treturn findSessionByTokenRequest{\n\t\tToken: req.Token,\n\t}, nil\n}"
] | [
"func (zip GobMeddler) PreRead(fieldAddr interface{}) (scanTarget interface{}, err error) {\n\t// give a pointer to a byte buffer to grab the raw data\n\treturn new([]byte), nil\n}"
] | codesearchnet | {
"query": "Represent the Github sentence about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Packages a build of the Unreal plugin in the specified directory, suitable for use as a prebuilt Engine module | [
"def packagePlugin(self, dir=os.getcwd(), extraArgs=[]):\n\t\t\n\t\t\n\t\t# Invoke UAT to package the build\n\t\tdistDir = os.path.join(os.path.abspath(dir), 'dist')\n\t\tself.runUAT([\n\t\t\t'BuildPlugin',\n\t\t\t'-Plugin=' + self.getPluginDescriptor(dir),\n\t\t\t'-Package=' + distDir\n\t\t] + extraArgs)"
] | [
"def platform\n # If you are declaring a new platform, you will need to tell\n # Train a bit about it.\n # If you were defining a cloud API, you should say you are a member\n # of the cloud family.\n\n # This plugin makes up a new platform. Train (or rather InSpec) only\n # know how t... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Special not PDO function to format display of query bindings.
@return string | [
"private function displayBindings()\n {\n $bindings = array();\n foreach ($this->bindings as $binding) {\n if (is_object($binding)) {\n $bindings[] = get_class($binding);\n } else {\n $bindings[] = (string) $binding;\n }\n }\n\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 text about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about programming:"
} |
Marshall the given parameter object. | [
"public void marshall(DeleteGraphqlApiRequest deleteGraphqlApiRequest, ProtocolMarshaller protocolMarshaller) {\n\n if (deleteGraphqlApiRequest == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\n }\n\n try {\n protocolMarshaller.marsh... | [
"def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p"
] | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
// MarshalBinary encodes the given payload to a slice of bytes. | [
"func (p DataFragmentPayload) MarshalBinary() ([]byte, error) {\n\tb := make([]byte, p.Size())\n\n\tbinary.LittleEndian.PutUint16(b[0:2], p.IndexAndN.N&0x3fff)\n\tb[1] |= (p.IndexAndN.FragIndex & 0x03) << 6\n\tcopy(b[2:], p.Payload)\n\n\treturn b, nil\n}"
] | [
"func (zip GobMeddler) PreRead(fieldAddr interface{}) (scanTarget interface{}, err error) {\n\t// give a pointer to a byte buffer to grab the raw data\n\treturn new([]byte), nil\n}"
] | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
// IsFinished return boolean | [
"func (pb *ProgressBar) IsFinished() bool {\n\tpb.mu.Lock()\n\tdefer pb.mu.Unlock()\n\treturn pb.isFinish\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 text about NLP:",
"pos": "Represent the code about NLP:",
"neg": "Represent the code about programming:"
} |
执行语句
@access public
@param string $sql sql指令
@param array $bind 参数绑定
@return bool|int
@throws PDOException
@throws \ErrorException
@throws BindParamException | [
"public function execute($sql, $bind = [])\n {\n $this->initConnect(true);\n if (!$this->linkID) {\n return false;\n }\n\n // 记录SQL语句\n $this->queryStr = $sql;\n if ($bind) {\n $this->bind = $bind;\n }\n\n //释放前次的查询结果\n if (!emp... | [
"public function invokeAction(array $params)\n {\n if (!$this->inited) {\n throw new \\wf\\app\\web\\Exception('请在'.get_called_class().'::__construct()调用parent::__construct()');\n }\n\n $action = $this->act . 'Action';\n\n if(!method_exists($this, $action)) {\n t... | codesearchnet | {
"query": "Represent the Github sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Creates a reverse transaction through the HpsGiftCardService | [
"public function execute()\n {\n parent::execute();\n\n $reverseSvc = new HpsGiftCardService($this->service->servicesConfig());\n if ($this->token != null && ($this->token instanceof HpsTokenData)) {\n if ($this->card == null) {\n $this->card = new HpsGiftCard();\n ... | [
"@Override\n public void perform() throws PortalException {\n // push the change into the PLF\n if (nodeId.startsWith(Constants.FRAGMENT_ID_USER_PREFIX)) {\n // remove the parm edit\n ParameterEditManager.removeParmEditDirective(nodeId, name, person);\n }\n // pu... | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
/*
Returns a new function that wraps `fn` with a timer. The wrapper logs the
time it takes to execute the function. | [
"function time(name, fn) {\n var start = _.now();\n try {\n return fn();\n } finally {\n console.log(name + \" time: \" + (_.now() - start) + \"ms\");\n }\n}"
] | [
"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 description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about File management:"
} |
Reads a response from the connection.
@param response_class [#decode] an object that can decode the response from
a given Decoder.
@return [nil] | [
"def read_response(response_class, notification)\n @logger.debug \"Waiting for response #{@correlation_id} from #{to_s}\"\n\n data = @decoder.bytes\n notification[:response_size] = data.bytesize\n\n buffer = StringIO.new(data)\n response_decoder = Kafka::Protocol::Decoder.new(buffer)\n\n ... | [
"def processRequest(cls, ps, **kw):\n \n resource = kw['resource']\n method = resource.getOperation(ps, None) # This getOperation method is valid for ServiceSOAPBinding subclass\n rsp = method(ps, **kw)[1] # return (request, response) but we only need response\n return rsp"
] | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Computer Science:"
} |
Helper function for caculating a magic value for block sizes
@access public
@param integer $i2 The argument
@see save()
@return integer | [
"private static function _adjust2($i2)\n\t{\n\t\t$iWk = log($i2)/log(2);\n\t\treturn ($iWk > floor($iWk))? floor($iWk)+1:$iWk;\n\t}"
] | [
"def BL(self, params):\n \n label = self.get_one_parameter(self.ONE_PARAMETER, params)\n\n self.check_arguments(label_exists=(label,))\n # TODO check if label is within +- 16 MB\n\n # BL label\n def BL_func():\n self.register['LR'] = self.register['PC'] # No nee... | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Overwrite attributes with the persisted attributes in Riak. | [
"def load!(id)\n self.__robject.key = id\n __load_robject! id, @__robject.reload(force: true)\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 instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Combine the iterables into a single one.
@param iterables
@return a single combined iterable | [
"public static <T> Iterable<T> concat(final Iterable<? extends Iterable<? extends T>> iterables) {\n return () -> Iterators.concat(iterators(iterables));\n }"
] | [
"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 comment about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Provided Ranges are unioned together to form the SortedRangeSet | [
"static SortedRangeSet copyOf(Type type, Iterable<Range> ranges)\n {\n return new Builder(type).addAll(ranges).build();\n }"
] | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// GetFields fetches the field info. | [
"func (jn *Join) GetFields(vcursor VCursor, bindVars map[string]*querypb.BindVariable) (*sqltypes.Result, error) {\n\tjoinVars := make(map[string]*querypb.BindVariable)\n\tlresult, err := jn.Left.GetFields(vcursor, bindVars)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tresult := &sqltypes.Result{}\n\tfor k := ra... | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Allows you to add incomplete object builders without calling get()
@param elements json builders
@return json array with the builder objects | [
"public static @Nonnull JsonSet set(JsonBuilder... elements) {\n JsonSet jjArray = new JsonSet();\n for (JsonBuilder b : elements) {\n jjArray.add(b);\n }\n return jjArray;\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 comment about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
-------------- private methods --------------------- | [
"private function createHeaders($from, $cc = array(), $bcc = array(), $replyTo = null) {\n if ($from)\n $this->headers('From: ' . $from);\n\n if (!is_array($cc)) {\n $cc = ($cc) ? array($cc) : array();\n }\n if (!is_array($bcc)) {\n $bcc = ($bcc) ? array(... | [
"def generate_enums(basename, xml):\n ''''''\n directory = os.path.join(basename, '''enums''')\n mavparse.mkdir_p(directory)\n for en in xml.enum:\n f = open(os.path.join(directory, en.name+\".java\"), mode='w')\n t.write(f, '''\n/* AUTO-GENERATED FILE. DO NOT MODIFY.\n *\n * This class w... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
method that takes care of processing job records in STATE_EMBRYO state | [
"def _process_state_embryo(self, job_record):\n \n uow, is_duplicate = self.insert_and_publish_uow(job_record, 0, 0)\n try:\n target_state = self._compute_next_job_state(job_record)\n self.update_job(job_record, uow, target_state)\n except ValueError:\n #... | [
"function writeTimeBound(type, prmname, boundType, outputType) {\n return utils.parts(type, {\n B : prmname,\n // TODO: is this correct?\n C : boundType+'_'+(type === 'QU' ? 'UBT' : 'LBT')+'(KAF)',\n E : '1MON'\n }, outputType);\n //A=HEXT2014 B=SR-CMN_SR-CMN C=STOR_UBT(KAF) E=1MON F=CAMANCHE R FLOOD... | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Configure SSH options for production staging.
@param InputInterface $input
@param OutputInterface $output
@param QuestionHelper $questionHelper
@param array $deployData
@return array The production staging configuration | [
"protected function configureSSH(InputInterface $input, OutputInterface $output, QuestionHelper $questionHelper, $deployData)\n {\n $serverOptions = [\n 'domain' => [\n 'helper' => $deployData['ssh_user'],\n 'label' => 'Domain name',\n ],\n ];\n ... | [
"protected static function bootstrapSSHDataService(array $instanceConfig)\n {\n // TODO: This is a little bit strange that i have to put KeyFile and Port into the SSH adapter\n // I think this has to be refactored.\n // All SSH credentials have to be in one place\n $sshCon... | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software Development:"
} |
Find by param type and method and url list.
@param paramType the param type
@param method the method
@param url the url
@return the list | [
"public List<ValidationData> findByParamTypeAndMethodAndUrl(ParamType paramType, String method, String url) {\n return this.findByMethodAndUrl(method, url).stream().filter(d -> d.getParamType().equals(paramType)).collect(Collectors.toList());\n }"
] | [
"@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 Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Programming:"
} |
<p>
The IDs of the Availability Zones.
</p>
@return The IDs of the Availability Zones. | [
"public java.util.List<String> getZoneIds() {\n if (zoneIds == null) {\n zoneIds = new com.amazonaws.internal.SdkInternalList<String>();\n }\n return zoneIds;\n }"
] | [
"func addNonCACommonFields(fields map[string]*framework.FieldSchema) map[string]*framework.FieldSchema {\n\tfields = addIssueAndSignCommonFields(fields)\n\n\tfields[\"role\"] = &framework.FieldSchema{\n\t\tType: framework.TypeString,\n\t\tDescription: `The desired role with configuration for this\nrequest`,\n\t}\n\... | codesearchnet | {
"query": "Represent the Github post about AWS Route 53:",
"pos": "Represent the Github code about AWS Route 53:",
"neg": "Represent the Github code:"
} |
Draws font to given image at given position
@param Image $image
@param integer $posx
@param integer $posy
@return void | [
"public function applyToImage(Image $image, $posx = 0, $posy = 0)\n {\n // parse text color\n $color = new Color($this->color);\n\n if ($this->hasApplicableFontFile()) {\n\n if ($this->angle !== 0 || is_string($this->align) || is_string($this->valign)) {\n\n $box = ... | [
"@Override\n public void renderReference( PositionedText canvas, double x, double y, String target, String name )\n {\n canvas.add( x, y, \"|\" + name + \"|\" );\n }"
] | codesearchnet | {
"query": "Represent the Github sentence about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
Fire a notification for a collection of beans that have been created.
@param beans created beans | [
"public final void fireCreate(Collection<Bean> beans) {\n ConfigChanges changes = new ConfigChanges();\n for (Bean bean : beans) {\n changes.add(ConfigChange.created(bean));\n }\n fire(changes);\n }"
] | [
"private void onDataSetStaleEvent(@Observes DataSetStaleEvent event) {\n checkNotNull(\"event\",\n event);\n String uuid = event.getDataSetDef().getUUID();\n\n // Remove any stale data existing on the client.\n // This will force next lookup requests to push a refresh... | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
/*
(non-Javadoc)
@see mtas.search.spans.util.MtasSpanQuery#rewrite(org.apache.lucene.index.
IndexReader) | [
"@Override\n public MtasSpanQuery rewrite(IndexReader reader) throws IOException {\n MtasSpanQuery newQ1 = (MtasSpanQuery) q1.rewrite(reader);\n MtasSpanQuery newQ2 = (MtasSpanQuery) q2.rewrite(reader);\n if (!newQ1.equals(q1) || !newQ2.equals(q2)) {\n return new MtasSpanIntersectingQuery(newQ1, newQ... | [
"public static GroupAnalyzer createGroupAnalyzer(AreaImpl root)\n {\n //return new org.fit.segm.grouping.op.GroupAnalyzerByGrouping(root);\n //return new org.fit.segm.grouping.op.GroupAnalyzerBySeparators(root);\n //return new org.fit.segm.grouping.op.GroupAnalyzerByGroupingAndSeparators(roo... | codesearchnet | {
"query": "Represent the Github sentence about org.archive.wayback.resourceindex:",
"pos": "Represent the Github code about org.archive.wayback.resourceindex:",
"neg": "Represent the Github code about Deep Learning:"
} |
Log the list of service implementations to the given {@link Logger}. | [
"public static void logLoadedServices(Logger log, Class<?> type, List<?> services)\n {\n log.info(\"Loaded [\" + services.size() + \"] \" + type.getName() + \" [\" + NEWLINE\n + joinTypeNames(new ArrayList<>(services)) + \"]\");\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 description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Serialize this RESTCatalog into a UNode tree and return the root node. The UNode
tree can be serialized into into JSON or XML using {@link UNode#toJSON()} or
{@link UNode#toXML()}.
@return Root node of the serialized {@link UNode} tree. | [
"public UNode toUNode() {\n UNode rootNode = UNode.createMapNode(\"commands\");\n for (String ownerName : m_cmdsByOwnerMap.keySet()) {\n Map<String, RESTCommand> ownerMap = m_cmdsByOwnerMap.get(ownerName);\n UNode ownerNode = rootNode.addMapNode(ownerName, \"owner\");\n ... | [
"public static org.w3c.dom.Node toDomNode(Object xmlObject) {\n // Could return DocumentFragment for XMLList\n // Probably a single node for XMLList with one element\n if (xmlObject instanceof XML) {\n return ((XML)xmlObject).toDomNode();\n } else {\n throw ne... | codesearchnet | {
"query": "Represent the Github instruction about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Loop the resolver until we are out of attempts | [
"function attemptNext() {\n if (--settings.attempts > 0 && dirty) {\n dirty = false; // Mark sweep as clean - will get dirty if resolver sees a function return\n\n resolver(base, []).then(attemptNext);\n } else {\n resolve();\n }\n }"
] | [
"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 instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about File management:"
} |
Gets the priceExtensionType value for this PriceFeedItem.
@return priceExtensionType * Price extension type of this extension. Required. | [
"public com.google.api.ads.adwords.axis.v201809.cm.PriceExtensionType getPriceExtensionType() {\n return priceExtensionType;\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 Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
Displays info, an error message, and then exits the cli
@param {string} msg - Message
@param {*} logMe - Passed to `console.log` | [
"function errorAndExit(msg, logMe) {\n // @todo Only trigger if `verbosity > 1`\n if (logMe) {\n // Adding some empty lines before error message for readability\n console.log();\n console.log();\n console.log(logMe);\n }\n error(`Error: ${msg}`);\n\n // There's a few ways to handle exiting\n\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:"
} |
// Version returns the runc and runtime-spec versions | [
"func (r *Runc) Version(context context.Context) (Version, error) {\n\tdata, err := cmdOutput(r.command(context, \"--version\"), false)\n\tif err != nil {\n\t\treturn Version{}, err\n\t}\n\treturn parseVersion(data)\n}"
] | [
"def execPath(self):\n \"\"\"\"\"\"\n vers = self.version.label if self.version else None # executables in Versions folder are stored by baseVersion (modified by game data patches)\n return self.installedApp.exec_path(vers)"
] | codesearchnet | {
"query": "Represent the Github sentence about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Inspects a class and its superclasses (all the way to {@link Object} for method instances that contain a given
annotation. This even identifies private, package and protected methods, not just public ones. | [
"private static void inspectRecursively(Class<?> c, List<Method> s, Class<? extends Annotation> annotationType) {\n\n for (Method m : c.getDeclaredMethods()) {\n // don't bother if this method has already been overridden by a subclass\n if (notFound(m, s) && m.isAnnotationPresent(annotationType... | [
"static ImmutableSet<ExecutableElement> abstractMethodsIn(\n ImmutableSet<ExecutableElement> methods) {\n Set<Name> noArgMethods = new HashSet<>();\n ImmutableSet.Builder<ExecutableElement> abstracts = ImmutableSet.builder();\n for (ExecutableElement method : methods) {\n if (method.getModifiers(... | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Sets a cluster size to a specific size.
@param clusterId
@param zoneId
@param newSize
@throws InterruptedException if the cluster is in the middle of updating, and an interrupt was
received | [
"public void setClusterSize(String clusterId, String zoneId, int newSize)\n throws InterruptedException {\n setClusterSize(instanceName.toClusterName(clusterId).getClusterName(), newSize);\n }"
] | [
"@Override\n protected void updateCount() {\n // set counter to the actual value, rather than to try and\n // keep track with a seperate variable.\n // This counter must only be updated by the selector thread,\n // which allows us to omit synchronized logic.\n // there can be t... | codesearchnet | {
"query": "Represent the Github description about AWS Redshift:",
"pos": "Represent the Github code about AWS Redshift:",
"neg": "Represent the Github code:"
} |
Ensure collections are sharded for all documents that can be loaded with the
metadata factory.
@throws MongoDBException | [
"public function ensureSharding(?WriteConcern $writeConcern = null) : void\n {\n foreach ($this->metadataFactory->getAllMetadata() as $class) {\n assert($class instanceof ClassMetadata);\n if ($class->isMappedSuperclass || ! $class->isSharded()) {\n continue;\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 summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about Programming:"
} |
// MessageWithExtras sends a message to Rollbar with the given severity
// level with extra custom data. | [
"func (c *Client) MessageWithExtras(level string, msg string, extras map[string]interface{}) {\n\tc.MessageWithExtrasAndContext(context.TODO(), level, msg, extras)\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 summarization about Localization:",
"pos": "Represent the code about Localization:",
"neg": "Represent the code about Computer Science:"
} |
// SetDays sets the Days field's value. | [
"func (s *Transition) SetDays(v int64) *Transition {\n\ts.Days = &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 text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
This function returns the file info from the request data.
@param inputData
The input data
@return The file info | [
"@Override\n protected FileInfo getFileInfoFromInputDataImpl(Message inputData)\n {\n FileInfo fileInfo=null;\n try\n {\n //get file info\n fileInfo=this.getFileInfo(inputData);\n }\n catch(MessagingException exception)\n {\n throw new... | [
"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 post about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
Specify file valid file extensions here to restrict uploads to specific
types.
@param aAllowedExtensions
The allowed extensions to be added.
@return this for chaining | [
"@Nonnull\n public FineUploader5Validation addAllowedExtensions (@Nullable final Collection <String> aAllowedExtensions)\n {\n if (aAllowedExtensions != null)\n m_aValidationAllowedExtensions.addAll (aAllowedExtensions);\n return this;\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 description about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
{@inheritdoc}
@throws DbException
@throws InvalidPrimaryKeyException if wrong count of values passed
@throws \InvalidArgumentException | [
"public static function find(...$keys): array\n {\n $keyNames = array_values(static::getInstance()->getPrimaryKey());\n $whereList = [];\n\n foreach ($keys as $keyValues) {\n $keyValues = (array)$keyValues;\n if (\\count($keyValues) !== \\count($keyNames)) {\n ... | [
"@Override\n public List findByRange(byte[] muinVal, byte[] maxVal, EntityMetadata m, boolean isWrapReq, List<String> relations,\n List<String> columns, List<IndexExpression> conditions, int maxResults) throws Exception {\n throw new UnsupportedOperationException(\"Support available only for thrift... | codesearchnet | {
"query": "Represent the Github post about API documentation:",
"pos": "Represent the Github code about API documentation:",
"neg": "Represent the Github code about programming:"
} |
Push to the queue system.
@throws \Exception | PhpSmsException
@return mixed | [
"public function push()\n {\n if (!is_callable(self::$howToUseQueue)) {\n throw new PhpSmsException('Expected define how to use the queue system by methods `queue`.');\n }\n try {\n $this->pushedToQueue = true;\n\n return call_user_func_array(self::$howToUseQ... | [
"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 Technology:",
"pos": "Represent the code about Technology:",
"neg": "Represent the code about programming:"
} |
Currently inside an expression | [
"def in_global_expression(self):\n \"\"\"\"\"\"\n return (self.parenthesis_count == 0 and self.curly_bracket_count == 0\n and self.square_bracket_count == 0\n and not self.in_single_quote and not self.in_double_quote)"
] | [
"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 instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
stringify, render and parse: | [
"async function renderObj(nj, myVars, templateVars) {\n return JSON.parse(await render(nj, JSON.stringify(myVars), templateVars));\n}"
] | [
"function make_event(event, target) {\n return string_p(event)? Event.make(event, target)\n : /* otherwise */ event }"
] | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Converts data back into original format.
Args:
col(pandas.DataFrame): Data to transform.
Returns:
pandas.DataFrame | [
"def reverse_transform(self, col):\n \n if isinstance(col, pd.Series):\n col = col.to_frame()\n\n output = pd.DataFrame(index=col.index)\n output[self.col_name] = col.apply(self.safe_date, axis=1)\n\n return output"
] | [
"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 post:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Extends the EPPClient::Domain#domain_create to make sure there's no
<tt>:ns</tt>, <tt>:dsData</tt> or <tt>:keyData</tt> records, AFNIC's
servers sends quite a strange error when there is. | [
"def domain_create(args)\n raise ArgumentError, \"You can't create a domain with ns records, you must do an update afterwards\" if args.key?(:ns)\n raise ArgumentError, \"You can't create a domain with ds or key records, you must do an update afterwards\" if args.key?(:dsData) || args.key?(:keyData)\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:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
// Warningf warning log | [
"func (logger *Logger) Warningf(m string, args ...interface{}) {\n\tlogger.log(WARNING, m, args...)\n}"
] | [
"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 Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
Compatibility wrapper for the loop.create_future() call introduced in
3.5.2. | [
"def create_future(loop):\n # pragma: no cover\n \"\"\"\"\"\"\n if hasattr(loop, 'create_future'):\n return loop.create_future()\n return asyncio.Future(loop=loop)"
] | [
"def map_size(self, key):\n \n # TODO: This should use get_count, but we need to check for compat\n # with server version (i.e. >= 4.6) first; otherwise it just\n # disconnects.\n\n rv = self.get(key)\n return len(rv.value)"
] | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// Get retrieves the underlying node at the specified index.
// Get without parameter is not implemented, since the node array is available
// on the Selection object. | [
"func (s *Selection) Get(index int) *html.Node {\n\tif index < 0 {\n\t\tindex += len(s.Nodes) // Negative index gets from the end\n\t}\n\treturn s.Nodes[index]\n}"
] | [
"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 description about AWS S3:",
"pos": "Represent the code about AWS S3:",
"neg": "Represent the code about Software development:"
} |
// Retrieve A flag indicating whether or not the datacenter/location is EU compliant. | [
"func (r Location) GetEuCompliantFlag() (resp bool, err error) {\n\terr = r.Session.DoRequest(\"SoftLayer_Location\", \"getEuCompliantFlag\", nil, &r.Options, &resp)\n\treturn\n}"
] | [
"private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo... | codesearchnet | {
"query": "Represent the Github text about Networking:",
"pos": "Represent the Github code about Networking:",
"neg": "Represent the Github code about programming:"
} |
Get the current lang used or if not present the default lang for the shop
@return \Thelia\Model\Lang | [
"protected function getLang()\n {\n if (null === $this->lang) {\n $this->lang = $this->getSession() ? $this->getSession()->getLang(true) : $this->lang = Lang::getDefaultLanguage();\n }\n\n return $this->lang;\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 description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Determines whether another element is available in the iteration.
@return a boolean value indicating whether another element is available in the iteration.
@see java.util.Iterator#hasNext() | [
"@Override\n public boolean hasNext() {\n while (!(iteratorList.isEmpty() || iteratorList.get(currentIteratorIndex).hasNext())) {\n Assert.isFalse(iteratorList.remove(currentIteratorIndex).hasNext(), \"removing a non-empty Iterator\");\n currentIteratorIndex = (iteratorList.isEmpty() ? 0 : (currentIte... | [
"@InterfaceAudience.Public\n public QueryEnumerator getRows() {\n start();\n if (rows == null) {\n return null;\n }\n else {\n // Have to return a copy because the enumeration has to start at item #0 every time\n return new QueryEnumerator(rows);\n ... | codesearchnet | {
"query": "Represent the sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
// Validate performs basic validation on the machine settings | [
"func (m *Machine) Validate() error {\n\tif m.MachineName == \"\" {\n\t\treturn fmt.Errorf(\"a machine name is required\")\n\t}\n\n\tif m.MachineVersion == \"\" {\n\t\treturn fmt.Errorf(\"a machine version is required\")\n\t}\n\n\tif m.InitialState == \"\" {\n\t\treturn fmt.Errorf(\"an initial state is required\")\... | [
"@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 instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
For backward compatibility. TO BE DEPRECATED--DO NOT USE.
Use rescale_by_factors() instead. | [
"def rescale_by(self, scale_x, scale_y, detail):\n \n self.rescale_by_factors((scale_x, scale_y), detail)"
] | [
"def scopes(cls):\n \n # Why do we need this? This should either\n # * Be bubbled to the places where it is used (AcidXBlock).\n # * Be automatic. Look for all members of a type.\n return [cls.USAGE, cls.DEFINITION, cls.TYPE, cls.ALL]"
] | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Updates this sketch with a String key and U value.
The value is passed to update() method of the Summary object associated with the key
@param key The given String key
@param value The given U value | [
"public void update(final String key, final U value) {\n update(Util.stringToByteArray(key), value);\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 sentence about Documentation:",
"pos": "Represent the Github code about Documentation:",
"neg": "Represent the Github code:"
} |
Method to disable all debug log | [
"public static function setConfigDropAllDebugLog()\n {\n self::setConfig('log', 'loadFile', false);\n self::setConfig('log', 'loadRef', false);\n self::setConfig('log', 'replaceRef', false);\n self::setConfig('log', 'registerRef', false);\n self::setConfig('log', 'dropRef', fal... | [
"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 post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Get anime/manga stat summary.
@return array | [
"private function getSummary()\n {\n $summary = [];\n $summary_area = $this->_parser->find('h2', 0)->next_sibling();\n if ($summary_area->tag == 'div') {\n while (true) {\n\n // status\n $temp_type = $summary_area->find('span', 0)->plaintext;\n ... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Return structure for update_inplace_editable()
@since Moodle 3.1
@return external_description | [
"public static function update_inplace_editable_returns() {\n return new external_single_structure(\n array(\n 'displayvalue' => new external_value(PARAM_RAW, 'display value (may contain link or other html tags)'),\n 'component' => new external_value(PARAM_NOTAGS, 'co... | [
"def observe_meta_signal_changes(self, changed_model, prop_name, info):\n \"\n self.logger.info(NotificationOverview(info))"
] | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
Validate the schema constraints on the provided Entity instance
@param entity the entity to validate | [
"public void validateConstraints(Entity entity) {\n\t\tfor (String propertyName : requiredProperties) {\n Object value = entity.getProperty(propertyName);\n\t\t\tif (value == null || (value instanceof String && ((String) value).length() == 0)) {\n\t\t\t\tthrow new RequiredFieldException(\"Required proper... | [
"@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 Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Generates the auth state value.
@return string auth state value.
@since 2.1 | [
"protected function generateAuthState()\n {\n $baseString = get_class($this) . '-' . time();\n if (Yii::$app->has('session')) {\n $baseString .= '-' . Yii::$app->session->getId();\n }\n return hash('sha256', uniqid($baseString, true));\n }"
] | [
"public void setHeader(String name, String s) {\n if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) { //306998.15\n logger.logp(Level.FINE, CLASS_NAME,\"setHeader\", \" name --> \" + name + \" value --> \" + PasswordNullifier.nullifyParams(s), \"[\"+this+\"... | codesearchnet | {
"query": "Represent the text about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Programming:"
} |
Render a standalone menu | [
"public function renderAction()\n {\n $params = $this->params();\n $navigation = $this->getServiceLocator()\n ->get( 'Grid\\Menu\\Model\\Menu\\Model' )\n ->findNavigation( $params->fromRoute( 'id' ) );\n\n $view = new ViewModel( array(\... | [
"def surface(self, canvas, X, Y, Z, color=None, label=None, **kwargs):\n \n raise NotImplementedError(\"Implement all plot functions in AbstractPlottingLibrary in order to use your own plotting library\")"
] | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
set sample and trait designs
F: NxK sample design
A: LxP sample design
REML: REML for this term?
index: index of which fixed effect to replace. If None, just append. | [
"def addFixedEffect(self,F=None,A=None, REML=True, index=None):\n \n if F is None: F = np.ones((self.N,1))\n if A is None:\n A = np.eye(self.P)\n A_identity = True\n elif (A.shape == (self.P,self.P)) & (A==np.eye(self.P)).all():\n A_identity = True\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 instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Return a persisted occurrences matching the occ and remove it from
lookup since it has already been matched | [
"def get_occurrence(self, occ):\n \n return self.lookup.pop(\n (occ.event, occ.original_start, occ.original_end),\n occ)"
] | [
"def finish_parse(self, last_lineno_seen):\n \"\"\"\"\"\"\n if self.state == self.STATES['step_in_progress']:\n # We've reached the end of the log without seeing the final \"step finish\"\n # marker, which would normally have triggered updating the step. As such we\n #... | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
/**
* Function ported from encoding/json: func (e *encodeState) string(s string) (int, error)
*/ | [
"func WriteJson(buf JsonStringWriter, s []byte) {\n\tbuf.WriteByte('\"')\n\tstart := 0\n\tfor i := 0; i < len(s); {\n\t\tif b := s[i]; b < utf8.RuneSelf {\n\t\t\t/*\n\t\t\t\tif 0x20 <= b && b != '\\\\' && b != '\"' && b != '<' && b != '>' && b != '&' {\n\t\t\t\t\ti++\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t*/\n\t\t\t... | [
"func (m BinaryFloatMapper) ID(fi ...interface{}) (rowIDs []int64, err error) {\n\t// TODO implement (have to redo the Mapper interface to handle slice)\n\treturn []int64{0}, nil\n}"
] | codesearchnet | {
"query": "Represent the Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Text processing:"
} |
Performs provided action on each element.
<p>This is an intermediate operation.
@param action the action to be performed on each element
@return the new stream | [
"@NotNull\n public Stream<T> peek(@NotNull final Consumer<? super T> action) {\n return new Stream<T>(params, new ObjPeek<T>(iterator, action));\n }"
] | [
"@Override\n public <T> Streamlet<T> applyOperator(IStreamletOperator<R, T> operator) {\n checkNotNull(operator, \"operator cannot be null\");\n\n // By default, NoneStreamGrouping stategy is used. In this stategy, tuples are forwarded\n // from parent component to a ramdon one of all the instances of the... | codesearchnet | {
"query": "Represent the Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Programming:"
} |
Enables / disables the visibility of the 3d effect gradient overlay for the areas
@param AREA_3DEFFECT_VISIBLE | [
"public void setArea3DEffectVisible(final boolean AREA_3DEFFECT_VISIBLE) {\n area3DEffectVisible = AREA_3DEFFECT_VISIBLE;\n init(getInnerBounds().width, getInnerBounds().height);\n repaint(getInnerBounds());\n }"
] | [
"function writeTimeBound(type, prmname, boundType, outputType) {\n return utils.parts(type, {\n B : prmname,\n // TODO: is this correct?\n C : boundType+'_'+(type === 'QU' ? 'UBT' : 'LBT')+'(KAF)',\n E : '1MON'\n }, outputType);\n //A=HEXT2014 B=SR-CMN_SR-CMN C=STOR_UBT(KAF) E=1MON F=CAMANCHE R FLOOD... | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
replace if value matches. if value not matches, return the existing entry or the dummy entry. | [
"protected boolean replace(final K key, final boolean _compare, final V _oldValue, final V _newValue) {\n Entry e = lookupEntry(key);\n if (e == null) {\n metrics.peekMiss();\n return false;\n }\n synchronized (e) {\n e.waitForProcessing();\n if (e.isGone() || !e.hasFreshData(clock))... | [
"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 description:",
"pos": "Represent the code:",
"neg": "Represent the code about Technology:"
} |
找出第一个词性为label的单词的指针(不检查复合词内部的简单词)<br>
若要查看该单词,请调用 previous<br>
若要删除该单词,请调用 remove<br>
@param label
@return | [
"public ListIterator<IWord> findFirstWordIteratorByLabel(String label)\n {\n ListIterator<IWord> listIterator = this.wordList.listIterator();\n while (listIterator.hasNext())\n {\n IWord word = listIterator.next();\n if (label.equals(word.getLabel()))\n {\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 post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about text processing:"
} |
// RequiredUIs returns the required UIs. | [
"func (e *AccountReset) RequiredUIs() []libkb.UIKind {\n\treturn []libkb.UIKind{\n\t\tlibkb.LoginUIKind,\n\t\tlibkb.SecretUIKind,\n\t}\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 description about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
Similar to string.replace() but is case insensitive
Code borrowed from: http://forums.devshed.com/python-programming-11/
case-insensitive-string-replace-490921.html | [
"def replace_insensitive(string, target, replacement):\n \n no_case = string.lower()\n index = no_case.rfind(target.lower())\n if index >= 0:\n return string[:index] + replacement + string[index + len(target):]\n else: # no results so return the original string\n return string"
] | [
"def gen_part_from_iterables(iterables: Iterable[Any],\n part_index: int) -> Generator[Any, None, None]:\n \n\n \"\"\"\n # RST: make part of word bold/italic:\n # https://stackoverflow.com/questions/12771480/part-of-a-word-bold-in-restructuredtext # noqa\n for iterable in ... | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Marshall the given parameter object. | [
"public void marshall(UpdateApplicationRequest updateApplicationRequest, ProtocolMarshaller protocolMarshaller) {\n\n if (updateApplicationRequest == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\n }\n\n try {\n protocolMarshaller.ma... | [
"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 programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Instantiates a class from a reflection. uses $data to navigate constructors
@param \stdClass $data
@param \ReflectionClass $reflection
@return object
@throws \Exception | [
"private function getClassInstance(\\stdClass $data, \\ReflectionClass $reflection)\n {\n switch (true):\n case $this->genericInstantiator->supports($data, $reflection):\n $output = $this->genericInstantiator->instantiate($data, $reflection);\n break;\n ... | [
"static function parseWith($optionsResource, array $_ = null)\n {\n if (!static::isConfigurableWith($optionsResource))\n throw new \\InvalidArgumentException(sprintf(\n 'Invalid Configuration Resource provided on (%s); given: (%s).'\n , static::class, \\Poirot\\Std... | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
Run a tag processor.
Args:
tag_proc_name: A string key that maps to the TagProcessor to run. | [
"def run_tag_processor(self, tag_proc_name):\n '''\n '''\n tag_processor = self.tag_procs[tag_proc_name]\n\n for tag in tag_processor.find(self.soup):\n self.process_tag(tag_proc_name, tag)"
] | [
"def reset ():\n \n global __prefixes_suffixes, __suffixes_to_types, __types, __rule_names_to_types, __target_suffixes_cache\n\n __register_features ()\n\n # Stores suffixes for generated targets.\n __prefixes_suffixes = [property.PropertyMap(), property.PropertyMap()]\n\n # Maps suffixes to types... | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// Pods gets all pods from marathon | [
"func (r *marathonClient) Pods() ([]Pod, error) {\n\tvar result []Pod\n\tif err := r.apiGet(marathonAPIPods, nil, &result); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn result, nil\n}"
] | [
"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 comment about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about Technology:"
} |
setAttribute
Set an attribute, tracking changes (if applicable)
@param string $name The name of the attribute to set
@param mixed $value The value to set it to | [
"protected function _setAttribute($name, $val) {\n $this->initialize();\n\n if (!array_key_exists($name, $this->attributes)) {\n throw (new UnknownAttributeException(\"You're trying to set an attribute (`$name`) that is not valid for this resource.\"))\n ->addOffender($name);... | [
"function DataModelMigration() {\n /**\n * Gets an array that contains the definition of fields that are going to be added\n * @type {Array}\n */\n this.add = [];\n /**\n * Gets an array that contains a collection of constraints which are going to be added\n * @type {Array}\n */\n ... | codesearchnet | {
"query": "Represent the Github sentence about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
@param string $path
@return Image | [
"private function createFromJpeg(string $path): self\n {\n $imageData = imagecreatefromjpeg($path);\n if (false === $imageData) {\n throw new ImageException(sprintf('Unable to create JPEG image from %s!', $path));\n }\n $this->workingData = $imageData;\n $this->encry... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
<!-- begin-user-doc -->
<!-- end-user-doc -->
@return the first non-null result returned by a <code>caseXXX</code> call.
@generated | [
"@Override\n protected T doSwitch(int classifierID, EObject theEObject)\n {\n switch (classifierID)\n {\n case PureXbasePackage.MODEL:\n {\n Model model = (Model)theEObject;\n T result = caseModel(model);\n if (result == null) result = defaultCase(theEObject);\n return ... | [
"protected void createGenModelAnnotations()\n\t{\n\t\tString source = \"http://www.eclipse.org/emf/2002/GenModel\";\t\n\t\taddAnnotation\n\t\t (jvmIdentifiableElementEClass.getEOperations().get(0), \n\t\t source, \n\t\t new String[] \n\t\t {\n\t\t\t \"documentation\", \"<p>The identifier of a JvmIdentifiable... | codesearchnet | {
"query": "Represent the Github post about Text generation:",
"pos": "Represent the Github code about Text generation:",
"neg": "Represent the Github code about Text generation:"
} |
Mark the decorated command as the intended entrypoint of the
command module. | [
"def entrypoint(cls):\n \n if not isinstance(cls, type) or not issubclass(cls, Command):\n raise TypeError(f\"inappropriate entrypoint instance of type {cls.__class__}\")\n cls._argcmdr_entrypoint_ = True\n return cls"
] | [
"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 comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Manage Coupons list display
@return \Thelia\Core\HttpFoundation\Response | [
"public function browseAction()\n {\n if (null !== $response = $this->checkAuth(AdminResources::COUPON, [], AccessManager::VIEW)) {\n return $response;\n }\n\n return $this->render('coupon-list', [\n 'coupon_order' => $this->getListOrderFromSession('coupon', 'coupon_ord... | [
"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 comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Set the property metadata.
@param array $data The property configset.
@return FormPropertyWidget Chainable | [
"public function setPropertyData(array $data)\n {\n $this->propertyData = $data;\n\n if (!$this->isMergingWidgetData) {\n $this->setCoreData($this->propertyData);\n }\n\n if ($this->property) {\n $this->property->setData($data);\n }\n\n return $this... | [
"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 summarization about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
// PlainInit create an empty git repository at the given path. isBare defines
// if the repository will have worktree (non-bare) or not (bare), if the path
// is not empty ErrRepositoryAlreadyExists is returned. | [
"func PlainInit(path string, isBare bool) (*Repository, error) {\n\tvar wt, dot billy.Filesystem\n\n\tif isBare {\n\t\tdot = osfs.New(path)\n\t} else {\n\t\twt = osfs.New(path)\n\t\tdot, _ = wt.Chroot(GitDirName)\n\t}\n\n\ts := filesystem.NewStorage(dot, cache.NewObjectLRUDefault())\n\n\treturn Init(s, wt)\n}"
] | [
"func main() {\n\tCheckArgs(\"<url>\", \"<directory>\")\n\turl := os.Args[1]\n\tdirectory := os.Args[2]\n\n\t// Clone the given repository to the given directory\n\tInfo(\"git clone %s %s\", url, directory)\n\n\t_, err := git.PlainClone(directory, false, &git.CloneOptions{\n\t\tURL: url,\n\t\tDepth: 1,\n\n\t\t// ... | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about software development:"
} |
get a key which can be used to enter a room vs entering room via
roomID
@param {String} roomID id of the room you'd like a key for
@return {Promise} A promise will be returned which will return a roomKey on success | [
"function( roomID ) {\n\n\t\tif( keys.length > 0 ) {\n\n\t\t\tvar randIdx = Math.round( Math.random() * ( keys.length - 1 ) ),\n\t\t\t\tkey = keys.splice( randIdx, 1 )[ 0 ];\n\n\t\t\tkeyToId[ key ] = roomID;\n\t\t\tidToKey[ roomID ] = key;\n\n\t\t\treturn promise.resolve( key );\n\t\t} else {\n\n\t\t\treturn promis... | [
"function(loader) {\n // public\n this.maxRecursion = 5;\n this.loader = (typeof loader === 'function') ? loader : null;\n\n // internal\n this._schemaRegistry = new SchemaRegistry();\n this._customFormatHandlers = {};\n\n // _refsRequested is an object where the key is the normalized ID\n // of the schema ... | codesearchnet | {
"query": "Represent the comment about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Create a new view instance from the given arguments.
@param string $view
@param string $path
@param \Illuminate\Contracts\Support\Arrayable|array $data
@return \Illuminate\Contracts\View\View | [
"protected function viewInstance($view, $path, $data)\n {\n return new View($this, $this->getEngineFromPath($path), $view, $path, $data);\n }"
] | [
"private function registerAliases()\n {\n\n // register this container to facades\n Facade::setApplication($this);\n\n $aliases = [\n\n 'app' => ['Anonym\\Application\\Application', Container::class],\n 'redirect' => ['Anonym\\Http\\Redirect'],\n 'va... | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Data management:"
} |
This method serialize a game an export it as a txt file
@return \Zend\Stdlib\ResponseInterface | [
"public function exportAction()\n {\n $this->checkGame();\n $content = serialize($this->game);\n\n $response = $this->getResponse();\n $headers = $response->getHeaders();\n $headers->addHeaderLine('Content-Encoding: UTF-8');\n $headers->addHeaderLine('Content-Type', 'tex... | [
"public ExportSection loadExportSection() throws IOException {\n Optional<ExportSection> edata = maybeLoadExportSection();\n return (ExportSection) getOrThrow(edata,\n \"unable to load export section\");\n }"
] | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
/*
Update the status (enabled or disabled) for event tracking. | [
"function event_status($params, $post_data) {\n\t\t// version 2 only.\n\t\t$request_url = \"{$this->url_base}/track/event\";\n\t\t$response = $this->curl($request_url, $post_data, \"POST\", \"tracking_event_status\");\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 summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
An example is pending
@param Example $example | [
"public function examplePending(Example $example)\n {\n $this->pending[] = $example;\n $event = new ExamplePendEvent($example);\n $this->dispatcher->dispatch(Events::EXAMPLE_PEND, $event);\n }"
] | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Return public user details | [
"public function details() {\n\t\treturn array_intersect_key(count($this->_details)?$this->_details:array(), array_flip($this->_public_details));\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 summarization about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code:"
} |
Validates an attribute against all validators defined for that attribute. If one or more errors are found, the first error message is returned. If the attribute is valid, an empty string is returned. | [
"function(model, attr, value, computed) {\n // Reduces the array of validators to an error message by\n // applying all the validators and returning the first error\n // message, if any.\n return _.reduce(getValidators(model, attr), function(memo, validator){\n // Pass the format function... | [
"func (sm *StateMachine) validate() []error {\n\tvalidationErrors := make([]error, 0)\n\tif sm.stateDefinitionError != nil {\n\t\tvalidationErrors = append(validationErrors, sm.stateDefinitionError)\n\t}\n\n\t// TODO - add Catcher validator\n\t/*\n\t\tEach Catcher MUST contain a field named “ErrorEquals”, specified... | codesearchnet | {
"query": "Represent the text about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
Tries to calculate the size by adding the size of each stream.
If any of the streams do not return a valid number, then the size of the
append stream cannot be determined and null is returned. | [
"public function length()\n {\n $length = 0;\n\n foreach ($this->_streams as $stream) {\n $len = $stream->length();\n if ($len === null) {\n return;\n }\n $length += $len;\n }\n return $length;\n }"
] | [
"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 description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about File management:"
} |
Parse GnuPG components' paths. | [
"def get_gnupg_components(sp=subprocess):\n \"\"\"\"\"\"\n args = [util.which('gpgconf'), '--list-components']\n output = check_output(args=args, sp=sp)\n components = dict(re.findall('(.*):.*:(.*)', output.decode('utf-8')))\n log.debug('gpgconf --list-components: %s', components)\n return compone... | [
"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 comment about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
// EnvStyle replaces instances of {foo} in a string with $FOO. | [
"func EnvStyle(s string) string {\n\treturn envStyleRegexp.ReplaceAllStringFunc(s, func(s string) string {\n\t\treturn \"$\" + strings.ToUpper(s[1:len(s)-1])\n\t})\n}"
] | [
"def label(self, string):\n \n if '*/' in string:\n raise ValueError(\"Bad label - cannot be embedded in SQL comment\")\n return self.extra(where=[\"/*QueryRewrite':label={}*/1\".format(string)])"
] | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.