query stringlengths 16 255 | pos list | neg list | task stringclasses 1
value | instruction dict |
|---|---|---|---|---|
Decode a BSON decimal128 to bson.decimal128.Decimal128. | [
"def _get_decimal128(data, position, dummy0, dummy1, dummy2):\n \"\"\"\"\"\"\n end = position + 16\n return Decimal128.from_bid(data[position:end]), end"
] | [
"def genKw(w,msk,z):\n \n # Hash inputs into a string of bytes\n b = hmac(msk, z + w, tag=\"TAG_PYTHIA_KW\")\n\n # Convert the string into a long value (no larger than the order of Gt),\n # then return a BigInt value.\n return BigInt(longFromString(b) % long(orderGt()))"
] | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Deserialize a stream or string of JSON data. | [
"def Deserializer(stream_or_string, **options):\n \n\n geometry_field = options.get(\"geometry_field\", \"geom\")\n\n def FeatureToPython(dictobj):\n properties = dictobj['properties']\n model_name = options.get(\"model_name\") or properties.pop('model')\n # Deserialize concrete fields... | [
"def GetDictToFormat(self):\n \"\"\"\"\"\"\n d = {}\n for k, v in self.__dict__.items():\n # TODO: Better handling of unicode/utf-8 within Schedule objects.\n # Concatinating a unicode and utf-8 str object causes an exception such\n # as \"UnicodeDecodeError: 'ascii' codec can't decode byte ... | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Wraps Content in DIV.
@access protected
@static
@param string $content ...
@param string $class CSS Class of DIV
@param array $attributes Array of Attributes
@return string | [
"protected static function wrap( $content, $class, $attributes = array() )\n\t{\n\t\t$attributes\t= array_merge( $attributes, array( 'class' => $class ) );\n\t\treturn UI_HTML_Tag::create( \"div\", $content, $attributes );\n\t}"
] | [
"public function setWide($wide) {\n\t\t$wide=Wide::getConstants()[\"W\" . $wide];\n\t\t$this->addToPropertyCtrl(\"class\", $wide, Wide::getConstants());\n\t\treturn $this->addToPropertyCtrl(\"class\", \"column\", array (\"column\" ));\n\t}"
] | codesearchnet | {
"query": "Represent the summarization about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Software development:"
} |
/* (non-Javadoc)
@see io.github.classgraph.ScanResultObject#getClassName() | [
"@Override\n protected String getClassName() {\n if (className == null) {\n getTypeSignature();\n if (typeSignature instanceof BaseTypeSignature) {\n className = ((BaseTypeSignature) typeSignature).getType().getName();\n } else if (typeSignature instanceof C... | [
"private void finalization() {\n Map<String, Object> dataModel = newHashMap();\n dataModel.put(\"cppFormatter\", new SourceFormatter());\n Set<ClassModel> dependencies = newHashSet();\n for (Java4CppType type : context.getClassesAlreadyDone()) {\n Class<?> clazz = type.getRawC... | codesearchnet | {
"query": "Represent the Github sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
// SetReplicationGroupId sets the ReplicationGroupId field's value. | [
"func (s *CreateSnapshotInput) SetReplicationGroupId(v string) *CreateSnapshotInput {\n\ts.ReplicationGroupId = &v\n\treturn s\n}"
] | [
"function(apiClient) {\n this.apiClient = apiClient || Configuration.default.getDefaultApiClient() || ApiClient.instance;\n\n\n this.setApiClient = function(apiClient) {\n this.apiClient = apiClient;\n };\n\n this.getApiClient = function() {\n return this.apiClient;\n };\n\n\n /**\n ... | codesearchnet | {
"query": "Represent the Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
// SetBuildDescription sets the description of a build | [
"func (jenkins *Jenkins) SetBuildDescription(build Build, description string) error {\n\trequestUrl := fmt.Sprintf(\"%ssubmitDescription?description=%s\", build.Url, url.QueryEscape(description))\n\treq, err := http.NewRequest(\"GET\", requestUrl, nil)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tres, err := jenkin... | [
"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 summarization about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
Hash a set of leaves representing a valid full tree. | [
"def hash_full_tree(self, leaves):\n \"\"\"\"\"\"\n root_hash, hashes = self._hash_full(leaves, 0, len(leaves))\n assert len(hashes) == count_bits_set(len(leaves))\n assert (self._hash_fold(hashes) == root_hash if hashes else\n root_hash == self.hash_empty())\n retu... | [
"@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 text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Initialize Log Analytics data client for use with CLI. | [
"def applicationinsights_data_plane_client(cli_ctx, _, subscription=None):\n \"\"\"\"\"\"\n from .vendored_sdks.applicationinsights import ApplicationInsightsDataClient\n from azure.cli.core._profile import Profile\n profile = Profile(cli_ctx=cli_ctx)\n cred, _, _ = profile.get_login_credentials(\n ... | [
"func New(*SmartSampleConfig, log.Logger, dtsink) (*SmartSampler, error) {\n\treturn nil, errors.New(\"you are attempting to configure a regular SignalFx Gateway with the config of a Smart Gateway. This is an unsupported configuration\")\n}"
] | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Computes the unique ID of a content object language version
@param eZContentObject|int $contentObject The content object OR content object Id
@param string $languageCode
@return string guid | [
"function guid( $contentObject, $languageCode = '' )\n {\n if ( !$contentObject instanceof eZContentObject )\n return md5( self::installationID() . '-' . $contentObject . '-' . $languageCode );\n\n return md5( self::installationID() . '-' . $contentObject->attribute( 'id' ) . '-' . $lang... | [
"public function initializeArguments()\n {\n parent::initializeArguments();\n $this->registerUniversalTagAttributes();\n $this->registerTagAttribute('name', 'string', 'Specifies the name of an anchor');\n $this->registerTagAttribute('rel', 'string', 'Specifies the relationship between... | codesearchnet | {
"query": "Represent the post about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about Computer Science:"
} |
感谢或取消感谢回答
:param Answer answer: 要感谢或取消感谢的回答
:param thanks: True-->感谢,False-->取消感谢
:return: 成功返回True,失败返回False
:rtype: bool | [
"def thanks(self, answer, thanks=True):\n \n from .answer import Answer\n if isinstance(answer, Answer) is False:\n raise ValueError('argument answer need to be Zhihu.Answer object.')\n if answer.author.url == self.url:\n return False\n data = {\n ... | [
"public function info() {\n /**\n * avatar\t用户头像\tString\t如果没有数据的时候不会返回该数据,请做好容错\t可空\thttps://tfsimg.alipay.com/images/partner/T1k0xiXXRnXXXXXXXX\n nick_name\t用户昵称\tString\t如果没有数据的时候不会返回该数据,请做好容错\t可空\t张三\n province\t省份\tString\t用户注册时填写的省份 如果没有数据的时候不会返回该数据,请做好容错\t可空\t浙江省\n city\t城... | codesearchnet | {
"query": "Represent the Github post about text analysis:",
"pos": "Represent the Github code about text analysis:",
"neg": "Represent the Github code about programming:"
} |
Helper function to match reponse of a request to the expected status
code
:param r: This field is the response of request.
:param expected_code: This field is the expected status code for the
function. | [
"def handle_error(r, expected_code):\n \n code = r.status_code\n if code != expected_code:\n info = 'API response status code {}'.format(code)\n try:\n if 'detail' in r.json():\n info = info + \": {}\".format(r.json()['detail'])\n elif 'metadata' in r.json... | [
"def response_from_mixed(mixed):\n \"\"\"\"\"\"\n\n # if none then give empty Response\n if mixed is None:\n return Response()\n\n # if not Response, then treat like body\n if not isinstance(mixed, Response):\n return Response(mixed)\n\n # it's already a Response\n return mixed"
] | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
publish this project from Basecamp API
@return <Logan::Project> this project | [
"def publish\n post_params = {\n :body => {}.to_json,\n :headers => Logan::Client.headers.merge({'Content-Type' => 'application/json'})\n }\n\n response = Logan::Client.post \"/projects/#{@id}/publish.json\", post_params\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 post:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Decorator for registering shortcode functions. | [
"def register(tag, end_tag=None):\n \n\n def register_function(function):\n tagmap[tag] = {'func': function, 'endtag': end_tag}\n if end_tag:\n tagmap['endtags'].append(end_tag)\n return function\n\n return register_function"
] | [
"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 Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
---------------------------------- | [
"protected void onDraw(Canvas canvas) {\n super.onDraw(canvas);\n\n canvas.drawArc(circleBounds, 360, 360, false, rimPaint);\n\n boolean mustInvalidate = false;\n\n if (!shouldAnimate) {\n return;\n }\n\n if (isSpinning) {\n //Draw the spinning bar\n mustInvalidate = true;\n\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 text about language and writing:",
"pos": "Represent the Github code about language and writing:",
"neg": "Represent the Github code:"
} |
@param $newsId
@return null|NewsEntity | [
"public function getNews4Id($newsId)\n {\n /** @var \\PServerCore\\Entity\\Repository\\News $repository */\n $repository = $this->entityManager->getRepository($this->collectionOptions->getEntityOptions()->getNews());\n return $repository->getNews4Id($newsId);\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 programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
// MarshalJSON supports json.Marshaler interface | [
"func (v Flags) MarshalJSON() ([]byte, error) {\n\tw := jwriter.Writer{}\n\teasyjsonCce3d1beEncodeGithubComMailgunMailgunGoEvents5(&w, v)\n\treturn w.Buffer.BuildBytes(), w.Error\n}"
] | [
"func (ev *ChangeWatchResp) GetValue(val proto.Message) error {\n\treturn json.Unmarshal(ev.message.Content, val) //TODO use contentType...\n}"
] | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Opens connections to Duts. Starts Dut read threads.
:return: Nothing
:raises DutConnectionError: if problems were encountered while opening dut connection. | [
"def open_dut_connections(self):\n \n for dut in self.duts:\n try:\n dut.start_dut_thread()\n if hasattr(dut, \"command\"):\n dut.open_dut(dut.command)\n else:\n dut.open_dut()\n except DutConnecti... | [
"def putParamset(self, paramset, data={}):\n \n try:\n if paramset in self._PARAMSETS and data:\n self._proxy.putParamset(self._ADDRESS, paramset, data)\n # We update all paramsets to at least have a temporarily accurate state for the device.\n #... | codesearchnet | {
"query": "Represent the Github summarization about Natural Language Processing:",
"pos": "Represent the Github code about Natural Language Processing:",
"neg": "Represent the Github code:"
} |
Convert AudioBuffer to Buffer with specified format | [
"function toArrayBuffer (audioBuffer, format) {\n\tif (!isNormalized(format)) format = normalize(format)\n\n\tvar data\n\n\t//convert to arraybuffer\n\tif (audioBuffer._data) data = audioBuffer._data.buffer;\n\n\telse {\n\t\tvar floatArray = audioBuffer.getChannelData(0).constructor;\n\t\tdata = new floatArray(audi... | [
"@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:"
} |
模型中的词向量维度
@return | [
"public int dimension()\n {\n if (storage == null || storage.isEmpty())\n {\n return 0;\n }\n return storage.values().iterator().next().size();\n }"
] | [
"protected static void fixResultByRule(List<Vertex> linkedArray)\n {\n\n //--------------------------------------------------------------------\n //Merge all seperate continue num into one number\n mergeContinueNumIntoOne(linkedArray);\n\n //-------------------------------------------... | codesearchnet | {
"query": "Represent the Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about text processing:"
} |
Dequeue an exception for a specific method invocation
@param string $method
@param mixed $default
@return mixed | [
"private function throwException($method)\n {\n if (isset($this->exceptions[$method]) && ! empty($this->exceptions[$method])) {\n $exception = array_shift($this->exceptions[$method]);\n\n if ($exception != null) {\n throw $exception;\n }\n }\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 Github description about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Programming:"
} |
Builds an array of tokens by merging their raw value.
@param string|Token[]|TokensList $list the tokens to be built
@return string | [
"public static function build($list)\n {\n if (is_string($list)) {\n return $list;\n }\n\n if ($list instanceof self) {\n $list = $list->tokens;\n }\n\n $ret = '';\n if (is_array($list)) {\n foreach ($list as $tok) {\n $ret... | [
"public LHS toLHS( CallStack callstack, Interpreter interpreter)\n throws EvalError\n {\n // loosely typed map expression new {a=1, b=2} are treated\n // as non assignment (LHS) to retrieve Map.Entry key values\n // then wrapped in a MAP_ENTRY type LHS for value assignment.\n r... | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Get the tile grid
@param totalBox
total bounding box
@param matrixWidth
matrix width
@param matrixHeight
matrix height
@param boundingBox
bounding box
@return tile grid | [
"public static TileGrid getTileGrid(BoundingBox totalBox, long matrixWidth,\n\t\t\tlong matrixHeight, BoundingBox boundingBox) {\n\n\t\tlong minColumn = getTileColumn(totalBox, matrixWidth,\n\t\t\t\tboundingBox.getMinLongitude());\n\t\tlong maxColumn = getTileColumn(totalBox, matrixWidth,\n\t\t\t\tboundingBox.getMa... | [
"def setTopRight(self, loc):\n \n offset = self.getTopRight().getOffset(loc) # Calculate offset from current top right\n return self.setLocation(self.getTopLeft().offset(offset)) # Move top left corner by the same offset"
] | codesearchnet | {
"query": "Represent the text about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Determine if given path is file, directory, or other. Compare with target to see if it's the type we wanted.
:param str path: Path
:param str target: Target type wanted
:return bool: Path is what it claims to be (True) or mismatch (False) | [
"def path_type(path, target):\n \n if os.path.isfile(path) and target == \"file\":\n return True\n elif os.path.isdir(path) and target == \"directory\":\n return True\n else:\n print(\"Error: Path given is not a {}: {}\".format(target, path))\n return False"
] | [
"def match(tgt, opts=None):\n '''\n \n '''\n\n if not opts:\n opts = __opts__\n try:\n if ',' + opts['id'] + ',' in tgt \\\n or tgt.startswith(opts['id'] + ',') \\\n or tgt.endswith(',' + opts['id']):\n return True\n # tgt is a string, whi... | codesearchnet | {
"query": "Represent the Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Adds Index.
@param array $columns
@param string $name
@return ClassMetadataBuilder | [
"public function addIndex(array $columns, $name)\n {\n if (!isset($this->cm->table['indexes'])) {\n $this->cm->table['indexes'] = array();\n }\n\n $this->cm->table['indexes'][$name] = array('columns' => $columns);\n\n return $this;\n }"
] | [
"public function toFieldDefinition(StorageFieldDefinition $storageDef, FieldDefinition $fieldDef)\n {\n // @todo: Is it possible to store a default value in the DB?\n $fieldDef->defaultValue = new FieldValue();\n $fieldDef->defaultValue->data = array('text' => null);\n }"
] | codesearchnet | {
"query": "Represent the sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
格式化集思录返回的json数据,以字典形式保存 | [
"def formatfundbjson(fundbjson):\n \"\"\"\"\"\"\n result = {}\n for row in fundbjson[\"rows\"]:\n cell = row[\"cell\"]\n fundb_id = cell[\"fundb_id\"]\n result[fundb_id] = cell\n return result"
] | [
"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 summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about text processing:"
} |
Creates a normal async socket, returns it.
Args:
location (tuple(str, int)): A tuple of net location (eg
'127.0.0.1' or 'example.org') and port (eg 80 or 25000). | [
"async def _open_connection_http(self, location):\n '''\n \n '''\n sock = await connect_tcp(location[0], location[1], bind_host=self.source_address)\n sock._active = True\n return sock"
] | [
"def dns_lookup(host, port, afi=socket.AF_UNSPEC):\n \"\"\"\"\"\"\n # XXX: all DNS functions in Python are blocking. If we really\n # want to be non-blocking here, we need to use a 3rd-party\n # library like python-adns, or move resolution onto its\n # own thread. This will be subject to the default ... | codesearchnet | {
"query": "Represent the Github instruction about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code:"
} |
Create a new application
@param array $input
@param array $queryParams
@return Response | [
"public function create(array $input, array $queryParams = [])\n {\n $response = $this->client->post($this->uri(), [\n RequestOptions::JSON => ['application' => $input],\n 'query' => $queryParams,\n ]);\n\n return $this->handleResponse($response);\n }"
] | [
"function newService()\n {\n ### Attain Login Continue If Has\n /** @var iHttpRequest $request */\n $request = \\IOC::GetIoC()->get('/HttpRequest');\n $tokenAuthIdentifier = new IdentifierHttpToken;\n $tokenAuthIdentifier\n ->setRequest($request)\n ->setT... | codesearchnet | {
"query": "Represent the post about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
control gimbal mode | [
"def cmd_gimbal_mode(self, args):\n ''''''\n if len(args) != 1:\n print(\"usage: gimbal mode <GPS|MAVLink>\")\n return\n if args[0].upper() == 'GPS':\n mode = mavutil.mavlink.MAV_MOUNT_MODE_GPS_POINT\n elif args[0].upper() == 'MAVLINK':\n mode ... | [
"def _init_objcolor(self, node_opts, **kwu):\n \"\"\"\"\"\"\n objgoea = node_opts.kws['dict'].get('objgoea', None)\n # kwu: go2color go2bordercolor dflt_bordercolor key2col\n return Go2Color(self.gosubdag, objgoea, **kwu)"
] | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Displays the scan header, as defined by self.HEADER and self.HEADER_FORMAT.
Returns None. | [
"def header(self):\n '''\n \n '''\n self.config.display.format_strings(self.HEADER_FORMAT, self.RESULT_FORMAT)\n self.config.display.add_custom_header(self.VERBOSE_FORMAT, self.VERBOSE)\n\n if type(self.HEADER) == type([]):\n self.config.display.header(*self.HEAD... | [
"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 text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
@param array $data
@return void | [
"public function init(array $data = [])\n {\n foreach ($data as $key => $value) {\n $this->set($key, $value);\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 Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Loads/creates multiple models from persistence layer Records.
@param string $typeKey The model type.
@param RecordSetInterface $records The persistence layer records.
@return Model[] | [
"protected function loadModels($typeKey, RecordSetInterface $records)\n {\n $models = [];\n foreach ($records as $record) {\n $models[] = $this->loadModel($typeKey, $record);\n }\n return $models;\n }"
] | [
"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 summarization about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software Development:"
} |
// New returns a new and initialized DnstapIO. | [
"func New(endpoint string, socket bool) DnstapIO {\n\treturn &dnstapIO{\n\t\tendpoint: endpoint,\n\t\tsocket: socket,\n\t\tenc: newDnstapEncoder(&fs.EncoderOptions{\n\t\t\tContentType: []byte(\"protobuf:dnstap.Dnstap\"),\n\t\t\tBidirectional: true,\n\t\t}),\n\t\tqueue: make(chan tap.Dnstap, queueSize),\n\t\tqui... | [
"@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 comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Programming:"
} |
// SetPrecedence sets the Precedence field's value. | [
"func (s *GroupType) SetPrecedence(v int64) *GroupType {\n\ts.Precedence = &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 Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
We contain this code inside a function so that the imports
we do in here are not visible at the module level. | [
"def _populate_label_legacy_structures():\n \n global DIE_CUT_LABEL, ENDLESS_LABEL, ROUND_DIE_CUT_LABEL\n global label_sizes, label_type_specs\n\n from brother_ql.labels import FormFactor\n DIE_CUT_LABEL = FormFactor.DIE_CUT\n ENDLESS_LABEL = FormFactor.ENDLESS\n ROUND_DIE_CUT_LABEL... | [
"void appendGoogRequiresTo(StringBuilder sb) {\n for (GoogRequire require : googRequires.values()) {\n // TODO(lukes): we need some namespace management here... though really we need namespace\n // management with all declarations... The problem is that a require could introduce a name\n // alias ... | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Load blocks.
@param array $blocks Blocks
@param ContainerBuilder $container Container
@return $this self Object | [
"protected function loadBlocks(array $blocks, ContainerBuilder $container)\n {\n foreach ($blocks as $blockName => $block) {\n $container\n ->register(\n 'elcodi.sitemap_element_provider.entity_' . $blockName,\n 'Elcodi\\Component\\Sitemap\\E... | [
"public function fetchData(OutputNode $node = null): array\n {\n /** @var OutputNode $node */\n $node = $node ?? $this->loader->createNode();\n\n //Working with parser defined by loader itself\n $this->loader->loadData($node);\n\n return $node->getResult();\n }"
] | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Print the information in Unicode safe manner. | [
"def _print_level(level, msg):\n \"\"\"\"\"\"\n for l in str(msg.rstrip()).split(\"\\n\"):\n print(\"{0:<9s}{1}\".format(level, str(l)))"
] | [
"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:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
process events from queue each after other, until ERROR or RETRY will happen | [
"private void processEventQueue(final TaskRec head) {\n\t\tfinal TedResult headResult = processEvent(head);\n\t\tTaskConfig tc = context.registry.getTaskConfig(head.name);\n\t\tif (tc == null) {\n\t\t\tcontext.taskManager.handleUnknownTasks(asList(head));\n\t\t\treturn;\n\t\t}\n\n\t\tTaskRec lastUnsavedEvent = null... | [
"def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR... | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Get this object as a DateTime, returning <code>this</code> if possible.
@param chronology chronology to apply, or ISOChronology if null
@return a DateTime using the same millis | [
"public DateTime toDateTime(Chronology chronology) {\n chronology = DateTimeUtils.getChronology(chronology);\n if (getChronology() == chronology) {\n return this;\n }\n return super.toDateTime(chronology);\n }"
] | [
"public StringBuffer format(final Calendar calendar, final StringBuffer buf) {\n // do not pass in calendar directly, this will cause TimeZone of FastDatePrinter to be ignored\n return format(calendar.getTime(), buf);\n }"
] | codesearchnet | {
"query": "Represent the Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Convert a kickstart file to an SLS file | [
"def mksls(src, dst=None):\n '''\n \n '''\n mode = 'command'\n sls = {}\n ks_opts = {}\n with salt.utils.files.fopen(src, 'r') as fh_:\n for line in fh_:\n if line.startswith('#'):\n continue\n\n if mode == 'command':\n if line.startswi... | [
"def initrd(self, initrd):\n \n\n initrd = self.manager.get_abs_image_path(initrd)\n\n log.info('QEMU VM \"{name}\" [{id}] has set the QEMU initrd path to {initrd}'.format(name=self._name,\n id=self._id,\n... | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// Exists check if the document exists for given query | [
"func (s *DbSession) Exists(query Q, document Document) (bool, error) {\n\tq := s.findQuery(document, query)\n\tif err := q.Select(bson.M{\"_id\": 1}).Limit(1).One(document); err != nil {\n\t\tif err.Error() == mgo.ErrNotFound.Error() {\n\t\t\treturn false, nil\n\t\t}\n\t\treturn false, err\n\t}\n\treturn true, nil... | [
"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 sentence about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about programming:"
} |
Returns the z-score for a given input score, given that score and the
list from which that score came. Not appropriate for population calculations.
Usage: lz(inlist, score) | [
"def lz (inlist, score):\n \n z = (score-mean(inlist))/samplestdev(inlist)\n return z"
] | [
"def is_stationary(self):\n \"\"\"\n # for disconnected matrices, the stationary distribution depends on the estimator, so we can't compute\n # it directly. Therefore we test whether the initial distribution is stationary.\n return np.allclose(np.dot(self._Pi, self._Tij), self._Pi)"
] | codesearchnet | {
"query": "Represent the Github sentence about Mathematics:",
"pos": "Represent the Github code about Mathematics:",
"neg": "Represent the Github code:"
} |
Extracts all references from the supplied CSS content.
@param string $content The CSS content
@return array An array of unique URLs | [
"public static function extractImports($content)\n {\n $imports = array();\n static::filterImports($content, function($matches) use(& $imports) {\n $imports[] = $matches['url'];\n });\n\n return array_unique($imports);\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 comment about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
Returns parent repo or input path if none found.
:return: grit.Local or path | [
"def get_repo_parent(path):\n \n # path is a repository\n if is_repo(path):\n return Local(path)\n\n # path is inside a repository\n elif not os.path.isdir(path):\n _rel = ''\n while path and path != '/':\n if is_repo(path):\n return Local(path)\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 comment about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
orderBy.
@param order a {@link org.beangle.commons.collection.Order} object.
@return a {@link org.beangle.commons.dao.query.builder.OqlBuilder} object. | [
"public OqlBuilder<T> orderBy(final Order order) {\n if (null != order) { return orderBy(Collections.singletonList(order)); }\n return this;\n }"
] | [
"public static void useAsDataTransfer(Dialect dialect, IContainerFactory containerFactory) {\r\n\t\tuseAsDataTransfer(dialect, containerFactory, new com.jfinal.plugin.activerecord.cache.EhCache());\r\n\t}"
] | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
TODO(louiscryan): Not clear if we want to use this idiom for 'simple' stubs. | [
"public static <ReqT, RespT> Iterator<RespT> blockingServerStreamingCall(\n Channel channel, MethodDescriptor<ReqT, RespT> method, CallOptions callOptions, ReqT req) {\n ThreadlessExecutor executor = new ThreadlessExecutor();\n ClientCall<ReqT, RespT> call = channel.newCall(method, callOptions.withExecut... | [
"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:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Build a request for the _all_docs endpoint.
<P>
Example usage:
</P>
<pre>
{@code
getAllDocsRequestBuilder().build().getResponse();
}
</pre>
@return a request builder for the _all_docs endpoint of this database | [
"public AllDocsRequestBuilder getAllDocsRequestBuilder() {\n return new AllDocsRequestBuilderImpl(new ViewQueryParameters<String,\n AllDocsRequestResponse.AllDocsValue>(client, this, \"\", \"\", String.class,\n AllDocsRequestResponse.AllDocsValue.class) {\n protected ... | [
"public ItemRequest<Task> addDependencies(String task) {\n \n String path = String.format(\"/tasks/%s/addDependencies\", task);\n return new ItemRequest<Task>(this, Task.class, path, \"POST\");\n }"
] | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Cloud Foundry API:"
} |
Fetch an entity by id
@param entity
name
@param groupId
customer group id
@param entityId
id of the entity to retrieve
@return entity
@throws MnoException | [
"public Map<String, Object> retrieve(String entityName, String groupId, String entityId) throws MnoException {\n\t\treturn retrieve(entityName, groupId, entityId, getAuthenticatedClient());\n\t}"
] | [
"@RequestMapping(value = \"/api/profile/{profileIdentifier}\", method = RequestMethod.DELETE)\n public\n @ResponseBody\n HashMap<String, Object> removeFromList(Model model, @PathVariable String profileIdentifier) throws Exception {\n Integer profileId = ControllerUtils.convertProfileIdentifier(profi... | codesearchnet | {
"query": "Represent the instruction about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software development:"
} |
Create acl for znodes, anyone could read, but only admin can operate if set scure.
@param failoverWatcher the watcher which has the configuration
@return the acls | [
"public static ArrayList<ACL> createAcl(FailoverWatcher failoverWatcher, String znode) {\n if (znode.equals(\"/chronos\")) {\n return Ids.OPEN_ACL_UNSAFE;\n }\n \n if (failoverWatcher.isZkSecure()) {\n ArrayList<ACL> acls = new ArrayList<ACL>();\n acls.add(new ACL(ZooDefs.Perms.READ, ZooD... | [
"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:"
} |
// Run starts the NCC server. | [
"func (n *Server) Run() {\n\tif err := server.RemoveUnixSocket(n.nccSocket); err != nil {\n\t\tlog.Fatalf(\"Failed to remove socket: %v\", err)\n\t}\n\tln, err := net.Listen(\"unix\", n.nccSocket)\n\tif err != nil {\n\t\tlog.Fatalf(\"listen error: %v\", err)\n\t}\n\tdefer ln.Close()\n\tdefer os.Remove(n.nccSocket)\... | [
"@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 text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
// Sane defaults for HandshakeController initialization | [
"func NewHandshakeParams() *HandshakeParams {\n\treturn &HandshakeParams{\n\t\tSymKeyRequestTimeout: defaultSymKeyRequestTimeout * time.Millisecond,\n\t\tSymKeyExpiryTimeout: defaultSymKeyExpiryTimeout * time.Millisecond,\n\t\tSymKeySendLimit: defaultSymKeySendLimit,\n\t\tSymKeyCapacity: defaultSymKeyCa... | [
"private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo... | codesearchnet | {
"query": "Represent the Github instruction about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about programming:"
} |
Open file for reading
@param string $pFilename
@throws PHPExcel_Reader_Exception
@return resource | [
"protected function openFile($pFilename)\n {\n // Check if file exists\n if (!file_exists($pFilename) || !is_readable($pFilename)) {\n throw new PHPExcel_Reader_Exception(\"Could not open \" . $pFilename . \" for reading! File does not exist.\");\n }\n\n // Open file\n ... | [
"function validateService($pluginInstance)\n {\n if (! is_object($pluginInstance) )\n throw new \\Exception(sprintf('Can`t resolve to (%s) Instance.', $pluginInstance));\n\n if (!$pluginInstance instanceof aGrantRequest)\n throw new exContainerInvalidServiceType('Invalid Plugi... | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
Init.
@param \Workerman\Events\EventInterface $event
@return void | [
"public static function init($event = null)\n {\n if ($event) {\n self::$_event = $event;\n } else {\n pcntl_signal(SIGALRM, array('\\Workerman\\Lib\\Timer', 'signalHandle'), false);\n }\n }"
] | [
"public function close()\n {\n $this->started = false;\n \n \\Wslim\\Ioc::logger('session')->debug(sprintf('[%s]close', static::getId()));\n }"
] | codesearchnet | {
"query": "Represent the instruction about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
region --- Utils and settings | [
"function setAsRootDocument(doc) {\n rootDoc = doc;\n var window = rootDoc.defaultView;\n window.setTimeout = function(code, delay, arguments) {};\n window.setInterval = function(code, delay, arguments) {};\n anychartify(rootDoc);\n\n return rootDoc\n}"
] | [
"function make_event(event, target) {\n return string_p(event)? Event.make(event, target)\n : /* otherwise */ event }"
] | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Returns an IPv4 netmask | [
"def cidr_to_ipv4_netmask(cidr_bits):\n '''\n \n '''\n try:\n cidr_bits = int(cidr_bits)\n if not 1 <= cidr_bits <= 32:\n return ''\n except ValueError:\n return ''\n\n netmask = ''\n for idx in range(4):\n if idx:\n netmask += '.'\n if c... | [
"public String filePath(int index, String savePath) {\n // not calling the corresponding swig function because internally,\n // the use of the function GetStringUTFChars does not consider the case of\n // a copy not made\n return savePath + File.separator + fs.file_path(index);\n }"
] | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Publish a metric with the given name | [
"def publish(self, name, value, raw_value=None, precision=0,\n metric_type='GAUGE', instance=None):\n \n # Check whitelist/blacklist\n if self.config['metrics_whitelist']:\n if not self.config['metrics_whitelist'].match(name):\n return\n elif self... | [
"@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 comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Lists the currently cached region keys (if any).
@return {Array.<{region: string}>} a list of region keys | [
"function listRegionKeys() {\n const regionKeys = new Array(regionKeysByRegion.size);\n const iter = regionKeysByRegion.values();\n let v = iter.next();\n let i = -1;\n while (!v.done) {\n regionKeys[++i] = v.value;\n v = iter.next();\n }\n return regionKeys;\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 summarization about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
@param array $decodedContent
@return JsonRpcCall
@throws \Exception | [
"public function denormalize(array $decodedContent) : JsonRpcCall\n {\n $jsonRpcCall = new JsonRpcCall(\n $this->guessBatchOrNot($decodedContent)\n );\n\n $this->populateItem($jsonRpcCall, $decodedContent);\n\n return $jsonRpcCall;\n }"
] | [
"public function beforeSend(\\Mmi\\Http\\Request $request)\n {\n //pobranie odpowiedzi\n $response = \\Mmi\\App\\FrontController::getInstance()->getResponse();\n //zmiana contentu\n $response->setContent((new \\Cms\\Model\\ContentFilter($response->getContent()))->getFilteredContent())... | codesearchnet | {
"query": "Represent the Github comment about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about Programming:"
} |
fetch post accessed data. post_data, and ext_dic. | [
"def fetch_post_data(self):\n '''\n \n '''\n post_data = {}\n ext_dic = {}\n for key in self.request.arguments:\n if key.startswith('def_'):\n ext_dic[key] = self.get_argument(key)\n else:\n post_data[key] = self.get_argum... | [
"function completeQuery(err) {\n if (err) return cb(err);\n db.eval(zahd, 2, 'expiring_domains', 'querying_domains',\n expiration, domain, next);\n }"
] | codesearchnet | {
"query": "Represent the comment about Data retrieval:",
"pos": "Represent the code about Data retrieval:",
"neg": "Represent the code:"
} |
// Creates a security group | [
"func (s *SecurityGroupService) CreateSecurityGroup(p *CreateSecurityGroupParams) (*CreateSecurityGroupResponse, error) {\n\tresp, err := s.cs.newRequest(\"createSecurityGroup\", p.toURLValues())\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif resp, err = getRawValue(resp); err != nil {\n\t\treturn nil, 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 instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Check if user has permission.
@param Request $request
@param Closure $next
@param string|array $permissions
@return \Illuminate\Http\RedirectResponse | [
"public function handle(Request $request, Closure $next, $permissions)\n {\n $accessDenied = true;\n\n if (!$user = $this->auth->getActiveUser()) {\n Flash::error(trans('dashboard::dashboard.flash.access_denied'));\n\n return redirect()->back();\n }\n\n if (!is_a... | [
"function newService()\n {\n $auths = \\Module\\Authorization\\Services::ContainerAuthenticators();\n $guards = \\Module\\Authorization\\Services::ContainerGuards();\n\n $action = new AuthenticatorAction($auths, $guards);\n return $action;\n }"
] | codesearchnet | {
"query": "Represent the Github text about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about Software development:"
} |
// SetKilled is used to mark that the task has been killed. | [
"func (r *RestartTracker) SetKilled() *RestartTracker {\n\tr.lock.Lock()\n\tdefer r.lock.Unlock()\n\tr.killed = true\n\treturn r\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 sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Create a new instance of the related model.
@param array $attributes
@return \Illuminate\Database\Eloquent\Model | [
"public function create(array $attributes = [])\n {\n return tap($this->related->newInstance($attributes), function ($instance) {\n $foreignKey = $this->getForeignKeyName();\n $parentKeyValue = $this->getParentKey();\n\n if (is_array($foreignKey)) { //Check for multi-colum... | [
"public function register()\n {\n $this->registerFileConfig();\n $this->registerDatabaseConfig();\n\n // Bind the concrete types\n $this->app->bind('Concrete\\Core\\Config\\Repository\\Repository', 'config');\n $this->app->bind('Illuminate\\Config\\Repository', 'Concrete\\Core\... | codesearchnet | {
"query": "Represent the Github instruction about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code:"
} |
Writes a inner XML representing the source object.
@param \XMLWriter $xmlWriter The XML writer | [
"public function writeInnerXml(\\XMLWriter $xmlWriter)\n {\n Validate::notNull($xmlWriter, 'xmlWriter');\n if (!is_null($this->attributes)) {\n if (is_array($this->attributes)) {\n foreach ($this->attributes as $attributeName => $attributeValue) {\n $xml... | [
"public String filePath(int index, String savePath) {\n // not calling the corresponding swig function because internally,\n // the use of the function GetStringUTFChars does not consider the case of\n // a copy not made\n return savePath + File.separator + fs.file_path(index);\n }"
] | codesearchnet | {
"query": "Represent the instruction about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
Start or resume a server session, or raise ConfigurationError. | [
"def get_server_session(self):\n \"\"\"\"\"\"\n with self._lock:\n session_timeout = self._description.logical_session_timeout_minutes\n if session_timeout is None:\n # Maybe we need an initial scan? Can raise ServerSelectionError.\n if self._descrip... | [
"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:"
} |
Generate the constraints at the ip/device level.
Those constraints are those used by ansible to enforce tc/netem rules. | [
"def _build_ip_constraints(roles, ips, constraints):\n \n local_ips = copy.deepcopy(ips)\n for constraint in constraints:\n gsrc = constraint['src']\n gdst = constraint['dst']\n gdelay = constraint['delay']\n grate = constraint['rate']\n gloss = constraint['loss']\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 post:",
"pos": "Represent the code:",
"neg": "Represent the code about Technology:"
} |
a general method for all widgets to override with their favorite or most meaninful event
Ideally this is where the block in the constructor should land up.
@since 1.5.0 2011-11-21 | [
"def command *args, &block\n if event? :PRESS\n bind :PRESS, *args, &block\n else\n bind :CHANGED, *args, &block\n end\n end"
] | [
"def set_form form\n raise \"Form is nil in set_form\" if form.nil?\n @form = form\n @id = form.add_widget(self) if !form.nil? and form.respond_to? :add_widget\n # 2009-10-29 15:04 use form.window, unless buffer created\n # should not use form.window so explicitly everywhere.\n # added... | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Foward pass: y[i] = x[j], where j = (i1, i2, ..., i(d-1), k, i(d+1), ..., i(n)) | [
"@Override\n public Tensor forward() {\n Tensor x = modIn.getOutput();\n y = x.select(dim, idx);\n return y;\n }"
] | [
"def Itax(mt, x, t):\n \n return (Sx(mt, x + 1) - Sx(mt, x + t + 1)) / Dx(mt, x)"
] | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Add frame to the end of the message, i.e. after all other frames.
Message takes ownership of frame, will destroy it when message is sent.
Returns 0 on success. Deprecates zmsg_add, which did not nullify the
caller's frame reference. | [
"def append(self, frame_p):\n \n return lib.zmsg_append(self._as_parameter_, byref(zframe_p.from_param(frame_p)))"
] | [
"def connect(self, host, port):\n '''\n \n '''\n # Clear the connect state immediately since we're no longer connected\n # at this point.\n self._connected = False\n\n # Only after the socket has connected do we clear this state; closed\n # must be False so th... | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Distance from camera
@param x X position
@param y Y position
@return Squared distance | [
"public double squaredDistanceFromCamera(double x, double y) {\n double dx = (distance * sinZ) - x;\n double dy = (distance * -cosZ) - y;\n return dx * dx + dy * dy;\n }"
] | [
"def setCenter(self, loc):\n \n offset = self.getCenter().getOffset(loc) # Calculate offset from current center\n return self.setLocation(self.getTopLeft().offset(offset)) # Move top left corner by the same offset"
] | codesearchnet | {
"query": "Represent the summarization about mathematics:",
"pos": "Represent the code about mathematics:",
"neg": "Represent the code:"
} |
Internal function which applies the rectification adjustment to a calibrated stereo pair | [
"private static void adjustCalibrated(FMatrixRMaj rectifyLeft, FMatrixRMaj rectifyRight,\n\t\t\t\t\t\t\t\t\t\t FMatrixRMaj rectifyK,\n\t\t\t\t\t\t\t\t\t\t RectangleLength2D_F32 bound, float scale) {\n\t\t// translation\n\t\tfloat deltaX = -bound.x0*scale;\n\t\tfloat deltaY = -bound.y0*scale;\n\n\t\t// adjustment ma... | [
"def gaussian_window(t, params):\n \n window = suspect.basis.gaussian(t, 0, 0, params[\"line_broadening\"])\n\n # the above gaussian function returns an area 1 fid, for a windowing\n # function we need to be area preserving (first point must be 1)\n return window / window[0]"
] | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
@param Configuration $configuration
@param OutputInterface $output
@return DefaultRenderer|Violation\Renderer\Html\Renderer | [
"private function getRenderer(Configuration $configuration, OutputInterface $output)\n {\n $messageHelper = $this->getMessageHelper();\n\n if ($logFilePath = $configuration->logHtml()) {\n $factory = new RendererFactory($messageHelper, new Filesystem());\n\n return $factory->c... | [
"final public static function sinfo(array $params):string\n {\n return (\\iumioFramework\\Core\\Base\\Server\\GlobalServer::getServerInfo($params['name']));\n }"
] | codesearchnet | {
"query": "Represent the summarization about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
Gathers angular-wrapped versions of each element
@param elements
@returns {{}} | [
"function getAngularElements (elements) {\n var obj = {};\n for (var key in elements) {\n if (elements.hasOwnProperty(key)) obj[ key ] = angular.element(elements[ key ]);\n }\n return obj;\n }"
] | [
"function make_event(event, target) {\n return string_p(event)? Event.make(event, target)\n : /* otherwise */ event }"
] | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Add a filter.
If a name is given, it will be added as a key, otherwise considered as an anonymous filter
@param AbstractQuery $filter
@param string $name
@return $this | [
"public function addFilter(AbstractQuery $filter, string $name = null): self\n {\n $filterArray = [];\n\n $type = self::NAMED_TYPE;\n\n if (null === $name) {\n $filterArray[] = $filter;\n $type = self::ANONYMOUS_TYPE;\n } else {\n $filterArray[$name] =... | [
"public function validate() {\n if ($this->initializer) {\n Ensure::isFalse($this->initializer->getRepository() && $this->initializer->getValue(), 'It makes no sense to define initializer repository and value simultaneously for column [%s]', $this->name);\n }\n }"
] | codesearchnet | {
"query": "Represent the comment about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
Generate size param for bid request using sizes array
@param {Array} sizes Possible sizes for the ad unit.
@return {string} Processed sizes param to be used for the bid request. | [
"function generateSizeParam(sizes) {\n return sizes.map(size => size.join(DIMENSION_SEPARATOR)).join(SIZE_SEPARATOR);\n}"
] | [
"function(apiClient) {\n this.apiClient = apiClient || Configuration.default.getDefaultApiClient() || ApiClient.instance;\n\n\n this.setApiClient = function(apiClient) {\n this.apiClient = apiClient;\n };\n\n this.getApiClient = function() {\n return this.apiClient;\n };\n\n\n /**\n ... | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
Compress the bitmap to a PNG and return its {@link ByteArrayInputStream}
@param bitmap The {@link Bitmap} to compress
@return The {@link ByteArrayInputStream} | [
"public static ByteArrayInputStream toPNGInputStream(Bitmap bitmap) {\n\t\tByteArrayOutputStream bytes = new ByteArrayOutputStream();\n\t\tbitmap.compress(Bitmap.CompressFormat.PNG, 100, bytes);\n\t\treturn new ByteArrayInputStream(bytes.toByteArray());\n\t}"
] | [
"@Nullable\n public Bitmap updateBitmap(String id, @Nullable Bitmap bitmap) {\n ImageAssetManager bm = getImageAssetManager();\n if (bm == null) {\n Log.w(L.TAG, \"Cannot update bitmap. Most likely the drawable is not added to a View \" +\n \"which prevents Lottie from getting a Context.\");\n ... | codesearchnet | {
"query": "Represent the Github comment about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code:"
} |
Constructor: OpenLayers.Format.KML
Create a new parser for KML.
Parameters:
options - {Object} An optional object whose properties will be set on
this instance. | [
"function(options) {\n // compile regular expressions once instead of every time they are used\n this.regExes = {\n trimSpace: (/^\\s*|\\s*$/g),\n removeSpace: (/\\s*/g),\n splitSpace: (/\\s+/),\n trimComma: (/\\s*,\\s*/g),\n kmlColor: (/(\\w{2})(... | [
"function(terria, url) {\n DataSourceCatalogItem.call(this, terria);\n\n this._dataSource = undefined;\n this._readyData = undefined;\n\n this.url = url;\n\n /**\n * Gets or sets the GeoJSON data, represented as a binary blob, object literal, or a Promise for one of those things.\n * If this property is se... | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Launch the topology | [
"@Override\n public boolean launch(PackingPlan packing) {\n LOG.log(Level.FINE, \"Launching topology for local cluster {0}\",\n LocalContext.cluster(config));\n\n // setup the working directory\n // mainly it downloads and extracts the heron-core-release and topology package\n if (!setupWorkingD... | [
"@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 post:",
"pos": "Represent the code:",
"neg": "Represent the code about Programming:"
} |
Load a glove model from an input stream.
The format is:
word num1 num2....
@param is the input stream to read from for the weights
@param vocab the vocab for the lookuptable
@return the loaded model
@throws java.io.IOException if one occurs | [
"public static GloveWeightLookupTable load(InputStream is, VocabCache<? extends SequenceElement> vocab)\n throws IOException {\n LineIterator iter = IOUtils.lineIterator(is, \"UTF-8\");\n GloveWeightLookupTable glove = null;\n Map<String, float[]> wordVectors = new HashMap<>(... | [
"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:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
See {@link #unsortedSegmentMin(String, SDVariable, SDVariable, int)} | [
"public SDVariable unsortedSegmentMin(SDVariable data, SDVariable segmentIds, int numSegments) {\n return unsortedSegmentMin(null, data, segmentIds, numSegments);\n }"
] | [
"public static LinkedFlowScope createEntryLattice(TypedScope scope) {\n return new LinkedFlowScope(HamtPMap.<TypedScope, OverlayScope>empty(), scope, scope);\n }"
] | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
create a setter for computed properties | [
"function createSetter(namespace, mappings) {\n let mutation = mappings.mutation;\n\n if (namespace) {\n mutation = namespace + '/' + mutation;\n }\n\n return function (value) {\n this.$store.commit(mutation, value)\n };\n}"
] | [
"public String filePath(int index, String savePath) {\n // not calling the corresponding swig function because internally,\n // the use of the function GetStringUTFChars does not consider the case of\n // a copy not made\n return savePath + File.separator + fs.file_path(index);\n }"
] | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Writes a $line to the log with a severity level of CRIT.
@param string $line Information to log
@param array|string $args
@return void | [
"public function logCrit($line, $args = self::NO_ARGUMENTS)\n\t{\n $this->log($line, self::CRIT, $args);\n }"
] | [
"public function errTrace($text)\n {\n //====================================================================//\n // Build Error Trace\n $trace = (new Exception())->getTrace()[1];\n\n //====================================================================//\n // Push Error to Lo... | codesearchnet | {
"query": "Represent the comment about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
Used when data is read from the disk into the Cache the first time.
New Nodes are created which are then indexed. | [
"void setNewNodes() {\n\n int index = tTable.getIndexCount();\n\n nPrimaryNode = new NodeAVLMemoryPointer(this);\n\n NodeAVL n = nPrimaryNode;\n\n for (int i = 1; i < index; i++) {\n n.nNext = new NodeAVLMemoryPointer(this);\n n = n.nNext;\n }\n }"
] | [
"public static long createFileId(long containerId) {\n long id = BlockId.createBlockId(containerId, BlockId.getMaxSequenceNumber());\n if (id == INVALID_FILE_ID) {\n // Right now, there's not much we can do if the file id we're returning is -1, since the file\n // id is completely determined by the ... | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
// SetGroupByAttribute sets the GroupByAttribute field's value. | [
"func (s *CreateInsightInput) SetGroupByAttribute(v string) *CreateInsightInput {\n\ts.GroupByAttribute = &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 summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
/*
@see javax.servlet.http.HttpSession#getAttributeNames() | [
"@Override\n public Enumeration<String> getAttributeNames() {\n if (isInvalid()) {\n throw new IllegalStateException(\"Session is invalid\");\n }\n return Collections.enumeration(this.attributes.keySet());\n }"
] | [
"public static ContainerWrapper getContainer(HttpServletRequest request) throws Exception {\r\n\t\tContainerFinderImp scf = new ContainerFinderImp();\r\n\t\tServletContext sc = request.getSession().getServletContext();\r\n\t\treturn scf.findContainer(new ServletContextWrapper(sc));\r\n\t}"
] | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
{@inheritDoc}
@since 2.0.0 | [
"public Configuration getInfinispanConfiguration(ConfigurationBuilder baseBuilder) {\n\t\tConfigurationChildBuilder builder = baseBuilder;\n\t\tif (null == builder) {\n\t\t\tbuilder = new ConfigurationBuilder();\n\t\t}\n\t\tbuilder = builder.locking().useLockStriping(false);\n\t\tif (EVICTION_NOT_SET != evictionWak... | [
"@Override\n public final EJSWrapperCommon getWrapper(BeanId id) // f111627\n throws CSIException,\n RemoteException\n {\n homeEnabled();\n return wrapperManager.getWrapper(id); // d156807.1\n }"
] | codesearchnet | {
"query": "Represent the Github text about writing:",
"pos": "Represent the Github code about writing:",
"neg": "Represent the Github code:"
} |
Tear down permissions from the component ACL.
@param string $componentFullName
@throws \RuntimeException | [
"public function down(string $componentFullName)\n {\n $componentFullName = $this->getNormalizedName($componentFullName);\n $memory = $this->getMemoryProvider();\n\n $memory->forget('acl_' . $componentFullName);\n $memory->finish();\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 Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Programming:"
} |
Show the viewer (only available in modal mode)
@param {boolean} [immediate=false] - Indicates if show the viewer immediately or not.
@returns {Viewer} this | [
"function show() {\n var immediate = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n var element = this.element,\n options = this.options;\n\n\n if (options.inline || this.showing || this.isShown || this.showing) {\n return this;\n }\n\n if (!this.ready) {\n ... | [
"function(element, options) {\n\n var $el = $(element);\n // React on every server/socket.io message.\n // If the element is defined with a data-react-on-event attribute\n // we take that as an eventType the user wants to be warned on this\n // element and we forward the event via jQuery events on $(... | codesearchnet | {
"query": "Represent the Github description about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
// Get returns a flag by it's name, if flag not found returns nil | [
"func (c Flags) Get(name string) *Flag {\n\tfor idx, v := range c {\n\t\tif v.Name == name {\n\t\t\treturn c[idx]\n\t\t}\n\t}\n\n\treturn nil\n}"
] | [
"def get(self, key, namespace=None):\n \"\"\"\"\"\"\n full_key = generate_uppercase_key(key, namespace)\n full_key = full_key.lower()\n\n logger.debug('Searching %s for %s', self, full_key)\n\n # Build a map of lowercase -> actual key\n obj_keys = {\n item.lower(... | codesearchnet | {
"query": "Represent the Github text about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
//NewTask creates a Task | [
"func newTask(s schedule.Schedule, wf *schedulerWorkflow, m *workManager, mm managesMetrics, emitter gomit.Emitter, opts ...core.TaskOption) (*task, error) {\n\n\t//Task would always be given a default name.\n\t//However if a user want to change this name, she can pass optional arguments, in form of core.TaskOption... | [
"@Override\n public void generatePluginConfig(String serverName, File writeDirectory) {\n // Pass true to utilityRequest since this method will be called from the pluginUtility\n // or by the GeneratePluginConfigListener not by a call to the mbean.\n generatePluginConfig(null,serverName,true... | codesearchnet | {
"query": "Represent the Github instruction about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
Checks if the given containerpage is used as a detail containers and adds the related detail content to the resource set.<p>
@param adminCms the cms context
@param containerPages the containerpages
@param containerPage the container page site path | [
"private void addDetailContent(CmsObject adminCms, Set<CmsResource> containerPages, String containerPage) {\n\n if (CmsDetailOnlyContainerUtil.isDetailContainersPage(adminCms, containerPage)) {\n\n try {\n CmsResource detailRes = adminCms.readResource(\n CmsDetail... | [
"protected void topFrameReload(CmsWorkplaceSettings settings) {\n\n // ensure to read the settings from the database\n initUserSettings(getCms(), settings, true);\n\n // reset the HTML list in order to force a full reload\n settings.setListObject(null);\n }"
] | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Subscribe synchronously to a pipe
@param key for registered simple-react async.Adapter
@param subscriber Reactive Streams reactiveSubscriber for data on this pipe | [
"public void subscribeTo(final K key, final Subscriber<V> subscriber) {\n registered.get(key)\n .stream()\n .subscribe(subscriber);\n\n }"
] | [
"public H2StreamProcessor startNewInboundSession(Integer streamID) {\n H2StreamProcessor h2s = null;\n h2s = muxLink.createNewInboundLink(streamID);\n return h2s;\n // call the stream processor with the data it needs to then call \"ready\" are the underlying HttpInboundLink\n // (... | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Marshall the given parameter object. | [
"public void marshall(Button button, ProtocolMarshaller protocolMarshaller) {\n\n if (button == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\n }\n\n try {\n protocolMarshaller.marshall(button.getText(), TEXT_BINDING);\n p... | [
"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 about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
a very simple example of getting data from a playlist | [
"async function runSample() {\n // the first query will return data with an etag\n const res = await getPlaylistData(null);\n const etag = res.data.etag;\n console.log(`etag: ${etag}`);\n\n // the second query will (likely) return no data, and an HTTP 304\n // since the If-None-Match header was set with a mat... | [
"def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR... | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
// GenerateFileDeps returns contents of make file describing
// dependencies of given target on given files and checking if files
// weren't added or removed in directories where given files are. | [
"func GenerateFileDeps(target, filesGenerator string, files []string) string {\n\treturn replacePlaceholders(fileDepMkTemplate,\n\t\t\"DEPS_GEN_APP_NAME\", appName(),\n\t\t\"DEPS_GEN_FILES_GENERATOR\", filesGenerator,\n\t\t\"DEPS_GEN_ALL_FILES_STORED\", strings.Join(files, \" \"),\n\t\t\"DEPS_GEN_TARGET\", target,\... | [
"def register (g):\n \n assert isinstance(g, Generator)\n id = g.id()\n\n __generators [id] = g\n\n # A generator can produce several targets of the\n # same type. We want unique occurence of that generator\n # in .generators.$(t) in that case, otherwise, it will\n # be tried twice and we'll... | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Queue a new e-mail message for sending after (n) seconds.
@param \DateTimeInterface|\DateInterval|int $delay
@param \Illuminate\Contracts\Mail\Mailable $view
@param string|null $queue
@return mixed
@throws \InvalidArgumentException | [
"public function later($delay, $view, $queue = null)\n {\n if (! $view instanceof MailableContract) {\n throw new InvalidArgumentException('Only mailables may be queued.');\n }\n\n return $view->later($delay, is_null($queue) ? $this->queue : $queue);\n }"
] | [
"protected function ensureEvent($event): Event\n {\n if (Assert::instanceOf($event, '\\\\One\\\\Event\\\\Event')) {\n return $event;\n } elseif (Assert::string($event)) {\n return new Event($event);\n }\n\n throw new InvalidArgumentException(\n '`Event... | codesearchnet | {
"query": "Represent the Github instruction about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
// DATE-FULLYEAR = 4DIGIT | [
"func parseYear(buff []byte, cursor *int, l int) (int, error) {\n\tyearLen := 4\n\n\tif *cursor+yearLen > l {\n\t\treturn 0, syslogparser.ErrEOL\n\t}\n\n\t// XXX : we do not check for a valid year (ie. 1999, 2013 etc)\n\t// XXX : we only checks the format is correct\n\tsub := string(buff[*cursor : *cursor+yearLen])... | [
"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 text about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code:"
} |
Encode the MessageList into the packed_message_list rdfvalue. | [
"def EncodeMessageList(cls, message_list, packed_message_list):\n \"\"\"\"\"\"\n # By default uncompress\n uncompressed_data = message_list.SerializeToString()\n packed_message_list.message_list = uncompressed_data\n\n compressed_data = zlib.compress(uncompressed_data)\n\n # Only compress if it bu... | [
"def requests(self):\n ''''''\n path = pathjoin(self.path, self.name, Request.path)\n response = self.service.send(SRequest('GET', path))\n # a bin behaves as a push-down store --- better to return the requests\n # in order of appearance\n return list(reversed(Request.from_... | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// Additional methods
// RemoveClient removes the client by id (primary key) | [
"func (s *OAuth2Storage) RemoveClient(id uint64) error {\n\tif id <= 0 {\n\t\treturn errors.New(\"Invalid client id\")\n\t}\n\n\treturn Db().Where(&OAuth2Client{ID: id}).Delete(OAuth2Client{})\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 summarization about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
Adds index method to a given $properties
@param string $properties
@param array $indexes
@return $this | [
"protected function addIndexes(&$properties, array $indexes, array $validColumns)\n {\n foreach ($indexes as $index) {\n if (!$index->hasColumns()) {\n continue;\n }\n\n $indexName = '';\n if ($index->hasName()) {\n $indexName = spr... | [
"public function toFieldDefinition(StorageFieldDefinition $storageDef, FieldDefinition $fieldDef)\n {\n // @todo: Is it possible to store a default value in the DB?\n $fieldDef->defaultValue = new FieldValue();\n $fieldDef->defaultValue->data = array('text' => null);\n }"
] | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Notifies all registered listener that an entry leaves the queue.
@param entry that leaves the queue. | [
"void fireEntryLeave(AsteriskQueueEntryImpl entry)\n {\n synchronized (listeners)\n {\n for (AsteriskQueueListener listener : listeners)\n {\n try\n {\n listener.onEntryLeave(entry);\n }\n catch (Ex... | [
"private void impossibleOffsetFailed(T object, ObjectId objectId, Cleaners.Cleanable cleanable, ObjectLeakNotifier notifier)\n {\n poolSize.decrementAndGet();\n notifier.disable();\n // Effectively does nothing, because notifier is disabled above. The purpose of this call is to deregister the\n // clea... | codesearchnet | {
"query": "Represent the Github summarization about Software development:",
"pos": "Represent the Github code about Software development:",
"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.