query stringlengths 16 255 | pos list | neg list | task stringclasses 1
value | instruction dict |
|---|---|---|---|---|
// GetUserClass returns the User Class Option value, described in RFC 3315,
// Section 22.15.
//
// The Data structure returned contains any raw class data present in
// the option. | [
"func GetUserClass(o dhcp6.Options) (Data, error) {\n\tv, err := o.GetOne(dhcp6.OptionUserClass)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar d Data\n\terr = d.UnmarshalBinary(v)\n\treturn d, err\n}"
] | [
"def initialize(self, id=None, text=None):\n self.id = none_or(id, int)\n \n\n self.text = none_or(text, str)\n \"\"\"\n Username or IP address of the user at the time of the edit : str | None\n \"\"\""
] | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Return a copy where the float usage is hard-coded to mimic the
behavior of the real os.stat_result. | [
"def copy(self):\n \n stat_result = copy(self)\n stat_result.use_float = self.use_float\n return stat_result"
] | [
"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 comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Applies the wavelet filter to a data vector a[0, n-1]. | [
"void forward(double[] a, int n) {\n if (n < ncof) {\n return;\n }\n\n if (n > workspace.length) {\n workspace = new double[n];\n } else {\n Arrays.fill(workspace, 0, n, 0.0);\n }\n\n int nmod = ncof * n;\n int n1 = n - 1;\n in... | [
"def nn_x(self, x, k=1, radius=np.inf, eps=0.0, p=2):\n \n assert len(x) == self.dim_x\n k_x = min(k, self.size)\n # Because linear models requires x vector to be extended to [1.0]+x\n # to accomodate a constant, we store them that way.\n return self._nn(DATA_X, x, k=k_x, r... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// ToBytes converts a literal into a typed byte slice representation. | [
"func ToBytes(l Literal) []byte {\n\tswitch l := l.(type) {\n\tcase B:\n\t\tif l {\n\t\t\treturn []byte{bID, 1}\n\t\t}\n\t\treturn []byte{bID, 0}\n\tcase S:\n\t\treturn append([]byte{sID}, l[:]...)\n\tcase F32:\n\t\tret := make([]byte, 5)\n\t\tret[0] = f32ID\n\t\tbinary.BigEndian.PutUint32(ret[1:], math.Float32bits... | [
"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 Github comment about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code about programming:"
} |
// Change Print* functions' output to a given writer.
// For example, you can limit output by ENV.
//
// func init() {
// if os.Getenv("DEBUG") == "" {
// pp.SetDefaultOutput(ioutil.Discard)
// }
// } | [
"func SetDefaultOutput(o io.Writer) {\n\toutLock.Lock()\n\tout = o\n\toutLock.Unlock()\n}"
] | [
"func NewStdoutClient(filename string, prefix string) *StdoutClient {\n\tvar err error\n\t// allow %HOST% in the prefix string\n\tprefix = strings.Replace(prefix, \"%HOST%\", Hostname, 1)\n\tvar fh *os.File\n\tif filename == \"\" {\n\t\tfh = os.Stdout\n\t} else {\n\t\tfh, err = os.OpenFile(filename, os.O_WRONLY, 06... | codesearchnet | {
"query": "Represent the Github text about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
Visit a tuple type.
@param TupleType $type The type.
@return mixed The result of visitation. | [
"public function visitTupleType(TupleType $type)\n {\n $difference = $this->comparePrimaryType($type);\n\n if (0 !== $difference) {\n return $difference;\n }\n\n return $this->compareTypeList($type->types(), true, false);\n }"
] | [
"@SuppressWarnings(\"unchecked\")\n public <T> Param<T> get(int index) {\n // TODO: Provide a more type safe API. E.g. make index a pojo typed on T which is aligned with the Param<T>\n return (Param<T>) params[index];\n }"
] | codesearchnet | {
"query": "Represent the post about PHP programming:",
"pos": "Represent the code about PHP programming:",
"neg": "Represent the code about Software development:"
} |
@param string $name
@return string | [
"public function helptext($name)\n {\n $path = $this->path.'.helptexts.'.$name;\n\n return $this->translator->get($path, '');\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 post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Does this linesegment intersect with another or not?
@param lineSegment
The other linesegment.
@return Returns true if they intersect in 1 point, false otherwise. | [
"public boolean intersects(LineSegment lineSegment) {\n\t\tdouble x1 = this.x1();\n\t\tdouble y1 = this.y1();\n\t\tdouble x2 = this.x2();\n\t\tdouble y2 = this.y2();\n\t\tdouble x3 = lineSegment.x1();\n\t\tdouble y3 = lineSegment.y1();\n\t\tdouble x4 = lineSegment.x2();\n\t\tdouble y4 = lineSegment.y2();\n\n\t\tdou... | [
"def collides(self, other):\n \"\"\"\"\"\"\n\n angle = self.angle\n width = self.width\n height = self.height\n\n if angle == 0:\n return other.collides(Rect(-0.5 * width,\n -0.5 * height, width, height))\n\n # Phase 1\n ... | codesearchnet | {
"query": "Represent the text about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code:"
} |
Define a polymorphic one-to-many relationship.
@param string $related
@param string $name
@param string $type
@param string $id
@param string $localKey
@return \Illuminate\Database\Eloquent\Relations\MorphMany | [
"public function morphMany($related, $name, $type = null, $id = null, $localKey = null)\n {\n $instance = $this->newRelatedInstance($related);\n\n // Here we will gather up the morph type and ID for the relationship so that we\n // can properly query the intermediate table of a relation. Fin... | [
"private function isRelationship($model, $conditions)\n {\n /**\n * A valid relationship must:\n * - Be a method\n * - Not appear in the 'except' list\n * - Appear in the 'only' list (if used)\n * - Extend Illuminate\\Database\\Eloquent\\Relations\\Relation\n ... | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
return a list of document which will be displayed in AJAX
@param $productId
@param $pseId
@return Response | [
"public function getVirtualDocumentListAjaxAction($productId, $pseId)\n {\n $this->checkAuth(AdminResources::PRODUCT, array(), AccessManager::VIEW);\n $this->checkXmlHttpRequest();\n\n $selectedId = \\intval(MetaDataQuery::getVal('virtual', MetaData::PSE_KEY, $pseId));\n\n $documents ... | [
"def search_prod_type_tags(self, ins, type, tags, pipeline):\n ''''''\n return StoredProduct(id=100, content='null.fits', tags={})"
] | codesearchnet | {
"query": "Represent the comment about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Format using strftime(). The date part of the timestamp passed
to underlying strftime should not be used. | [
"def strftime(self, fmt):\n \n # The year must be >= 1000 else Python's strftime implementation\n # can raise a bogus exception.\n timetuple = (1900, 1, 1,\n self._hour, self._minute, self._second,\n 0, 1, -1)\n return _wrap_strftime(self, f... | [
"def GetDictToFormat(self):\n \"\"\"\"\"\"\n d = {}\n for k, v in self.__dict__.items():\n # TODO: Better handling of unicode/utf-8 within Schedule objects.\n # Concatinating a unicode and utf-8 str object causes an exception such\n # as \"UnicodeDecodeError: 'ascii' codec can't decode byte ... | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
// UnmarshalJSON parses the output from Synced Flush API. | [
"func (resp *IndicesSyncedFlushResponse) UnmarshalJSON(data []byte) error {\n\tm := make(map[string]json.RawMessage)\n\terr := json.Unmarshal(data, &m)\n\tif err != nil {\n\t\treturn err\n\t}\n\tresp.Index = make(map[string]*IndicesShardsSyncedFlushResult)\n\tfor k, v := range m {\n\t\tif k == \"_shards\" {\n\t\t\t... | [
"@Override\n public void generatePluginConfig(String serverName, File writeDirectory) {\n // Pass true to utilityRequest since this method will be called from the pluginUtility\n // or by the GeneratePluginConfigListener not by a call to the mbean.\n generatePluginConfig(null,serverName,true... | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Add view to template.
Added view will be know to template by $known's value.
$known must be stirng.
@param string $name
@param string $known
@param array $data | [
"public function addView($name, $known, $data = array())\r\n {\r\n $this->view[$known] = $this->loadView($this->getViewPath($name), $data, TRUE);\r\n }"
] | [
"public function insertInsertTagMD( $objPage, $objLayout, $objPageRegular)\n {\n // set vary header for browsers to avoid caching in Proxies for different browsers\n header('Vary: User-Agent', false);\n \n // add mobiledetectioncss class to page css class\n $objPage->cssClass = $... | codesearchnet | {
"query": "Represent the description about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Removes a key to the list of keys used
@param string $key
@return AbstractDriver | [
"protected function _removeKey($key)\n {\n $keys = $this->get('__stored_keys__', []);\n if (in_array($key, $keys)) {\n $reverse = array_flip($keys);\n unset($reverse[$key]);\n $this->set('__stored_keys__', array_keys($reverse));\n }\n return $this;\n ... | [
"def getKeySequenceCounter(self):\n \"\"\"\"\"\"\n print '%s call getKeySequenceCounter' % self.port\n keySequence = ''\n keySequence = self.__sendCommand(WPANCTL_CMD + 'getprop -v Network:KeyIndex')[0]\n return keySequence"
] | codesearchnet | {
"query": "Represent the Github post about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code:"
} |
Context manager that translates upstream API exceptions. | [
"def catch_raise_api_exception():\n \"\"\"\"\"\"\n try:\n yield\n except _ApiException as exc:\n detail = None\n fields = None\n\n if exc.body:\n try:\n # pylint: disable=no-member\n data = json.loads(exc.body)\n detail = d... | [
"def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR... | codesearchnet | {
"query": "Represent the instruction about Go programming language:",
"pos": "Represent the code about Go programming language:",
"neg": "Represent the code about programming:"
} |
// Load balancers of type 'network' cannot have their subnets updated at
// this time. If the type is 'network' and subnets have changed, mark the
// diff as a ForceNew operation | [
"func customizeDiffNLBSubnets(diff *schema.ResourceDiff, v interface{}) error {\n\t// The current criteria for determining if the operation should be ForceNew:\n\t// - lb of type \"network\"\n\t// - existing resource (id is not \"\")\n\t// - there are actual changes to be made in the subnets\n\t//\n\t// Any other c... | [
"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 description:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
returns the appropriate connection based on message type.
returns null if a connection could not be established. | [
"OutboundTcpConnection getConnection(MessageOut msg)\n {\n Stage stage = msg.getStage();\n return stage == Stage.REQUEST_RESPONSE || stage == Stage.INTERNAL_RESPONSE || stage == Stage.GOSSIP\n ? ackCon\n : cmdCon;\n }"
] | [
"public static String getDefaultMediaType(ResultType expectedType) {\n ResponseFormat format = (expectedType != null) ? defaultTypeFormats.get(expectedType) : null;\n \n // If the expected type is unknown, we should let the server decide, otherwise we could\n // wind up requesting a response type that d... | codesearchnet | {
"query": "Represent the summarization about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
Validates if the hash of the given password is identical to the saved hash in the database.
It will always succeed if the module is in DEBUG mode.
@return void | [
"public function validatePassword($attribute, $params)\n {\n if ($this->user === null || !Password::validate($this->password, $this->user->password_hash))\n $this->addError($attribute, Yii::t('user', 'Invalid login or password'));\n }"
] | [
"def verify(build)\n # TODO might as well cache this and store in the db so we dont have to\n # convert every time\n pkey = to_rsa_pkey\n signature = Base64.decode64(build.signature)\n digest = OpenSSL::Digest::SHA256.new\n\n # If the user submits html were going to expect the\n #... | codesearchnet | {
"query": "Represent the Github text about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
@param float|int|string $number
@return self | [
"public static function fromNumber($number)\n {\n if (is_float($number)) {\n return self::fromString(sprintf('%.14F', $number));\n }\n\n if (is_int($number)) {\n return new self($number);\n }\n\n if (is_string($number)) {\n return self::fromStri... | [
"final protected function c() {return dfc($this, function() {/** @var int|null $id $id */return\n\t\t!($id = $this->o()->getCustomerId()) ? null : df_customer($id)\n\t;});}"
] | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Builds the textual representation of the whole configuration object
with it's children. | [
"def build(self):\n '''\n \n '''\n header = self.build_header()\n body = self.build_body()\n tail = self.build_tail()\n return header + body + tail"
] | [
"@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:"
} |
Ghost the HTTP in the system properties
@param test whether to test the proxy
@return used proxy
@throws IOException I/O Exception | [
"public static Proxy ghostMySystemProperties(boolean test) throws IOException {\n LOGGER.info(\"Ghosting System Properties...\");\n\n Proxy use = getProxy(test);\n\n if (use != null) {\n applyProxy(use);\n }\n\n return use;\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:"
} |
The card response.
Generated from protobuf field <code>.google.cloud.dialogflow.v2.Intent.Message.Card card = 4;</code>
@param \Google\Cloud\Dialogflow\V2\Intent\Message\Card $var
@return $this | [
"public function setCard($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\Dialogflow\\V2\\Intent_Message_Card::class);\n $this->writeOneof(4, $var);\n\n return $this;\n }"
] | [
"public function ListSessionEntityTypes(\\Google\\Cloud\\Dialogflow\\V2\\ListSessionEntityTypesRequest $argument,\n $metadata = [], $options = []) {\n return $this->_simpleRequest('/google.cloud.dialogflow.v2.SessionEntityTypes/ListSessionEntityTypes',\n $argument,\n ['\\Google\\Cloud\\Dia... | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Clear all event queues and their cached events. | [
"def clear_all_events(self):\n \"\"\"\"\"\"\n self.lock.acquire()\n self.event_dict.clear()\n self.lock.release()"
] | [
"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:"
} |
// Delete removes the key and associated value from the data map. | [
"func (s *Simple) Delete(key string) {\n\tatomic.AddInt64(&s.stats.Deletes, 1)\n\n\ts.lock.RLock()\n\t_, ok := s.data[key]\n\ts.lock.RUnlock()\n\tif !ok {\n\t\t// If key is not in the data map then there is nothing to delete.\n\t\treturn\n\t}\n\n\t// Element is in data map, but need to acquire exclusive map lock be... | [
"@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 post about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code:"
} |
// SetNextToken sets the NextToken field's value. | [
"func (s *ListInputSecurityGroupsOutput) SetNextToken(v string) *ListInputSecurityGroupsOutput {\n\ts.NextToken = &v\n\treturn s\n}"
] | [
"function Rule(rules) {\n this.rules = rules;\n // Identifies individual rule\n this.name = \"\";\n // Identifies the grammar that this rule belongs to \n this.grammarName = \"\";\n // Identifies types of rules. Rules can have \"types\" that are diff... | codesearchnet | {
"query": "Represent the Github text about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
Get the data
@return The data | [
"public MBeanData[] getData()\n {\n MBeanData[] data = new MBeanData[domainData.size()];\n domainData.toArray(data);\n return data;\n }"
] | [
"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 text about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code:"
} |
// SetDescription sets the Description field's value. | [
"func (s *OptionGroupOption) SetDescription(v string) *OptionGroupOption {\n\ts.Description = &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 comment about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
Execute the actions necessary to perform a `molecule idempotence` and
returns None.
:return: None | [
"def execute(self):\n \n self.print_info()\n if not self._config.state.converged:\n msg = 'Instances not converged. Please converge instances first.'\n util.sysexit_with_message(msg)\n\n output = self._config.provisioner.converge(out=None, err=None)\n\n idem... | [
"def delete(self, instance):\n \n \n #TODO: Really drop the database based on a policy set in `instance.parameters`.\n #\n # We need :\n # - Set a policy in parameters of the instance (eg: policy-on-delete : retain|drop => default to retain)\n # - t... | codesearchnet | {
"query": "Represent the instruction about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about AWS Auto Scaling:"
} |
Convert as reference on column.
table => "table"
table.column => "table"."column"
db.table.column => "db"."table"."column"
table."col.umn" => "table"."col.umn"
"table"."col.umn" => "table"."col.umn" | [
"def reference(cls, value):\n \n from sqlpuzzle._common.utils import force_text\n value = force_text(value)\n parts = re.split(r'{quote}([^{quote}]+){quote}|\\.'.format(quote=cls.reference_quote), value)\n parts = ('{quote}{i}{quote}'.format(quote=cls.reference_quote, i=i) if i !=... | [
"def field_default(colx, table_name, tables_dict):\n \"\"\n if colx.coltp.type.lower() == 'serial':\n x = sqparse2.parse('select coalesce(max(%s),-1)+1 from %s' % (colx.name, table_name))\n return sqex.run_select(x, tables_dict, Table)[0]\n elif colx.not_null: raise NotImplementedError('todo: not_null erro... | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Map MXNet's LRN operator attributes to onnx's LRN operator
and return the created node. | [
"def convert_lrn(node, **kwargs):\n \n name, input_nodes, attrs = get_inputs(node, kwargs)\n\n alpha = float(attrs.get(\"alpha\", 0.0001))\n beta = float(attrs.get(\"beta\", 0.75))\n bias = float(attrs.get(\"knorm\", 1.0))\n size = int(attrs.get(\"nsize\"))\n\n lrn_node = onnx.helper.make_node(... | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Check if this lockFile corresponds to a locked process
@param boolean $recover
@return boolean | [
"public function isLocked($recover = true) {\n $myPid = getmypid();\n if (!file_exists($this->pidFile)) {\n return false;\n }\n\n $lockPid = trim(file_get_contents($this->pidFile));\n\n // This is my lockfile, nothing to do\n if ($myPid == $lockPid) {\n ... | [
"public File getExistingFile(final String param) {\n return get(param, getFileConverter(),\n new And<>(new FileExists(), new IsFile()),\n \"existing file\");\n }"
] | codesearchnet | {
"query": "Represent the Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about File management:"
} |
Apply AES(K, W) operation (encrypt) to 64 bit block.
@param string $kek
@param string $block
@throws \RuntimeException If encrypt fails
@return string | [
"protected function _encrypt(string $kek, string $block): string\n {\n $str = openssl_encrypt($block, $this->_cipherMethod(), $kek,\n OPENSSL_RAW_DATA | OPENSSL_ZERO_PADDING);\n if (false === $str) {\n throw new \\RuntimeException(\n \"openssl_encrypt() failed: ... | [
"public static byte[] encipher(byte[] decrypted_bytes, String crypto_algorithm)\n throws InvalidPasswordCipherException, UnsupportedCryptoAlgorithmException {\n EncryptedInfo info = encipher_internal(decrypted_bytes, crypto_algorithm, (String) null); // TODO check null\n return info... | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
Returns the number of finished papers already done by the user for a given exercise.
@param Exercise $exercise
@param User $user
@return array | [
"public function countUserFinishedPapers(Exercise $exercise, User $user)\n {\n return $this->repository->countUserFinishedPapers($exercise, $user);\n }"
] | [
"public static function all($params = null, $opts = null)\n {\n $msg = \"Subscription Schedule Revisions cannot be listed without a Subscription Schedule ID. \" .\n \"List those using \\$schedule->allRevisions('revision_id') instead.\";\n throw new Error\\InvalidRequest($msg, null);\n... | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about PHP:"
} |
overwrite data for trace t | [
"def update_line(self, t, x, y, panel=None, **kw):\n \n if panel is None:\n panel = self.current_panel\n self.panels[panel].update_line(t, x, y, **kw)"
] | [
"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 text:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
statement : WHILE LPAREN expr RPAREN while_statement | [
"def p_statement_while(p):\n ''\n p[0] = ast.While(p[3], p[5], lineno=p.lineno(1))"
] | [
"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:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Gets a List of Views matching a given class.
@param rootView the root View to traverse.
@param classType the class to find.
@param <T> the class to find.
@return a List of every matching View encountered. | [
"@NonNull public static <T> List<T> findByClass(@NonNull View rootView, Class<T> classType) {\n ViewGroup viewGroup = (ViewGroup) rootView.findViewById(android.R.id.content);\n return viewGroup == null ? new ArrayList<T>() : findByClass(viewGroup, classType);\n }"
] | [
"function Rule(rules) {\n this.rules = rules;\n // Identifies individual rule\n this.name = \"\";\n // Identifies the grammar that this rule belongs to \n this.grammarName = \"\";\n // Identifies types of rules. Rules can have \"types\" that are diff... | codesearchnet | {
"query": "Represent the Github description about Natural Language Processing:",
"pos": "Represent the Github code about Natural Language Processing:",
"neg": "Represent the Github code:"
} |
Returns the extra properties, *i.e.* non-ECF, non-RSA properties
:param props: A dictionary of properties
:return: A filtered dictionary | [
"def get_extra_props(props):\n # type: (Dict[str, Any]) -> Dict[str, Any]\n \n return {\n key: value\n for key, value in props.items()\n if key not in ECFPROPNAMES\n and key not in RSA_PROP_NAMES\n and not key.startswith(ENDPOINT_PACKAGE_VERSION_)\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 sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Put all LEDs back to their default color | [
"def reset(self):\n \n\n if not self.leds:\n return\n\n self.animate_stop()\n\n for group in self.led_groups:\n self.set_color(group, LED_DEFAULT_COLOR)"
] | [
"def handle_dims(opts):\n '''\n \n '''\n use,res = [],[];\n if opts['--X']:\n use.append('x');\n res.append(int(opts['--xres']));\n if opts['--Y']:\n use.append('y');\n res.append(int(opts['--yres']));\n if opts['--Z']:\n use.append('z');\n res.append(i... | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
@param $service
@param $resource
@param $record
@param $key
@return bool
@throws \DreamFactory\Core\Exceptions\InternalServerErrorException
@throws \DreamFactory\Core\Exceptions\RestException | [
"protected static function patchExisting($service, $resource, $record, $key)\n {\n $api = $service . '/' . $resource;\n $value = array_get($record, $key);\n switch ($api) {\n case 'system/event_script':\n case 'system/custom':\n case 'user/custom':\n ... | [
"protected function registerDocumentTypeInterface()\n\t{\n\t\t$this->app->bind('Mgallegos\\DecimaAccounting\\Accounting\\Repositories\\DocumentType\\DocumentTypeInterface', function($app)\n\t\t{\n\t\t\t$AuthenticationManager = $app->make('App\\Kwaai\\Security\\Services\\AuthenticationManagement\\AuthenticationManag... | codesearchnet | {
"query": "Represent the Github instruction about PHP:",
"pos": "Represent the Github code about PHP:",
"neg": "Represent the Github code about programming:"
} |
Makes function to concat two byte chunks.
@param {Boolean} [chunkType] Specifies type of input chunks.
@return {Function} The function to concat two byte chunks. | [
"function makeConcat(chunkType) {\n\tswitch (chunkType) {\n\tcase BUFFER:\n\t\treturn (a, b) => Buffer.concat([a, b]);\n\tdefault:\n\t\treturn (a, b) => {\n\t\t\t// console.log('[%d, %d]', a.length, b.length);\n\t\t\tconst t = new Uint8Array(a.length + b.length);\n\t\t\tt.set(a);\n\t\t\tt.set(b, a.length);\n\t\t\t/... | [
"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 post about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
// UpdateDestination updates the specified destination in the IPVS table. | [
"func UpdateDestination(svc Service, dst Destination) error {\n\tic := &ipvsCommand{\n\t\tService: newIPVSService(&svc),\n\t\tDestination: newIPVSDestination(&dst),\n\t}\n\treturn netlink.SendMessageMarshalled(C.IPVS_CMD_SET_DEST, family, 0, ic)\n}"
] | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the Github description about Address:",
"pos": "Represent the Github code about Address:",
"neg": "Represent the Github code:"
} |
// NewRequest will construct a Request suitible for use with
// Stream.RequestAuthentication() <- Request. | [
"func NewRequest(username, password string) Request {\n\tinvalidCh := make(chan InvalidPassword)\n\tcreatedCh := make(chan CreatedUser)\n\tauthenticatedCh := make(chan AuthenticatedUser)\n\n\treturn Request{\n\t\tTime: filu.Now(),\n\t\tUsername: username,\n\t\tPassword: password,\n\n\t\tInvalidPassword: inval... | [
"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 description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Validates if a deploy can be fulfilled. | [
"def validate_capacity(self, servers):\n \n try:\n return self.manager.validate_capacity(servers)\n except packet.baseapi.Error as msg:\n raise PacketManagerException(msg)"
] | [
"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 comment about container management:",
"pos": "Represent the code about container management:",
"neg": "Represent the code about Software development:"
} |
@param Stmt\Echo_ $node
@return string | [
"public function pStmt_Echo(Stmt\\Echo_ $node)\n {\n return sprintf(\n '%s %s;',\n $this->color('echo', SyntaxHighlighterConfig::TYPE_CONSTRUCT),\n $this->pCommaSeparated($node->exprs)\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 programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Create or update user
@param User $user
@return User | [
"public function save(User $user)\n {\n if ($user->getId() != null) {\n return $this->update($user);\n }\n return $this->create($user);\n }"
] | [
"public List<Audit> getAllNotifications(JPAEntity entity) {\n\t\treturn _auditService.findByEntityHostnameMessage(entity.getId(), null, \"Triggering event value:\");\n\t}"
] | codesearchnet | {
"query": "Represent the summarization about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about Documentation:"
} |
Deletes a product
@param integer $product_id
@param bool $check
@return boolean | [
"public function delete($product_id, $check = true)\n {\n $result = null;\n $this->hook->attach('product.delete.before', $product_id, $check, $result, $this);\n\n if (isset($result)) {\n return (bool) $result;\n }\n\n if ($check && !$this->canDelete($product_id)) {\n... | [
"protected function setGeneratorCategorymembers()\n {\n $this->logger->debug('Base:setGeneratorCategorymembers');\n $this->setParam('generator', 'categorymembers');\n $this->setParam('gcmprop', 'ids|title|type|timestamp');\n $this->setParam('gcmlimit', $this->getLimit());\n }"
] | codesearchnet | {
"query": "Represent the instruction about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about Programming:"
} |
// Check returns true if the task can be scheduled into the given node.
// TODO(amitshukla): investigate storing Plugins as a map so it can be easily probed | [
"func (f *PluginFilter) Check(n *NodeInfo) bool {\n\tif n.Description == nil || n.Description.Engine == nil {\n\t\t// If the node is not running Engine, plugins are not\n\t\t// supported.\n\t\treturn true\n\t}\n\n\t// Get list of plugins on the node\n\tnodePlugins := n.Description.Engine.Plugins\n\n\t// Check if al... | [
"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 Github summarization about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about Software development:"
} |
List all treeHandlers as directories which have the given path as a parent
@param path path
@return | [
"private Set<Resource<T>> listStackDirectory(Path path) {\n HashSet<Resource<T>> merge = new HashSet<Resource<T>>();\n if (treeHandlerList.size() > 0) {\n for (SelectiveTree<T> treeHandler : treeHandlerList) {\n if (PathUtil.hasRoot(treeHandler.getSubPath(), path) && !PathUti... | [
"def getChild(self, name, request):\n \n request.prepath = []\n request.postpath.insert(0, name)\n # re-establishes request.postpath so to contain the entire path\n return self.wsgi_resource"
] | codesearchnet | {
"query": "Represent the description about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Commit a transaction, using one-phase optimization.
@exception SystemException
an unindentified error has been reported
by the resource manager.
@exception RollbackException | [
"public final void commit_one_phase() throws XAException\n {\n if (tc.isEntryEnabled()) Tr.entry(tc, \"commit_one_phase\", _resource);\n if (tcSummary.isDebugEnabled()) Tr.debug(tcSummary, \"commit_one_phase\", this);\n\n //\n // Commit the one-phase resource.\n //\n try... | [
"@Override\n public void close()\n {\n if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())\n Tr.debug(tc, \"em.close();\\n\" + toString());\n\n // JPA 5.9.1 Container Responsibilities\n // The container must throw the IllegalStateException if the application calls\... | codesearchnet | {
"query": "Represent the Github text about Database management:",
"pos": "Represent the Github code about Database management:",
"neg": "Represent the Github code:"
} |
/* (non-Javadoc)
@see org.duracloud.snapshot.service.RestorationManager#restoreSnapshot(java.lang.String,
org.duracloud.snapshot.db.model.DuracloudEndPointConfig) | [
"@Override\n public Restoration restoreSnapshot(String snapshotId,\n DuracloudEndPointConfig destination,\n String userEmail)\n throws SnapshotNotFoundException, SnapshotInProcessException, SnapshotException {\n\n checkInit... | [
"private void addRestResourceClasses(Set<Class<?>> resources) {\n resources.add(pl.setblack.airomem.direct.banksample.rest.BankResource.class);\n }"
] | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Create new users as admin
@return void | [
"public function getPostCreateAdmin()\n {\n $this->di->get(\"auth\")->isAdmin(true);\n\n $title = \"Admin - Skapa en ny användare\";\n $card = \"Användarinformation\";\n $view = $this->di->get(\"view\");\n $pageRender = $this->di->get(\"pageRender\");\n ... | [
"def _unlinkUser(self):\n \n KEY = \"linked_contact_uid\"\n\n # Nothing to do if no user is linked\n if not self.hasUser():\n return False\n\n user = self.getUser()\n username = user.getId()\n\n # Unset the UID from the User Property\n user.setMembe... | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// SetRegistrantPrivacy sets the RegistrantPrivacy field's value. | [
"func (s *GetDomainDetailOutput) SetRegistrantPrivacy(v bool) *GetDomainDetailOutput {\n\ts.RegistrantPrivacy = &v\n\treturn s\n}"
] | [
"func (wfe *WebFrontEndImpl) prepChallengeForDisplay(request *http.Request, authz core.Authorization, challenge *core.Challenge) {\n\t// Update the challenge URL to be relative to the HTTP request Host\n\tif authz.V2 {\n\t\tchallenge.URL = web.RelativeEndpoint(request, fmt.Sprintf(\"%sv2/%s/%s\", challengePath, aut... | codesearchnet | {
"query": "Represent the Github comment about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
Get the family for this famc to build the navigator with.
@param famc the famc
@return the family | [
"private static Family findFamily(final FamC famc) {\n if (!famc.isSet()) {\n return new Family();\n }\n final Family foundFamily = (Family) famc.find(famc.getToString());\n if (foundFamily == null) {\n return new Family();\n }\n return foundFamily;\n ... | [
"def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)"
] | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Determines if the gateway supports CC store for later use.
@return bool | [
"public function isVaultEnabled() {\n $storeId = $this->_storeManager->getStore()->getId();\n $vaultPayment = $this->getVaultPayment();\n\n return $vaultPayment->isActive($storeId);\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 text about NLP:",
"pos": "Represent the code about NLP:",
"neg": "Represent the code about Programming:"
} |
// insertRunes inserts several characters. | [
"func (b *buffer) insertRunes(runes []rune) error {\n\tfor _, r := range runes {\n\t\tif err := b.insertRune(r); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}"
] | [
"public String filePath(int index, String savePath) {\n // not calling the corresponding swig function because internally,\n // the use of the function GetStringUTFChars does not consider the case of\n // a copy not made\n return savePath + File.separator + fs.file_path(index);\n }"
] | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
增加查询条件,当conversation的属性中对应的字段对应的值不包含在指定值中时即可返回
@param key
@param value
@return | [
"public AVIMConversationsQuery whereNotContainsIn(String key, Collection<?> value) {\n conditions.whereNotContainedIn(key, value);\n return this;\n }"
] | [
"public static String getTransferQueue(String name) {\n LOG.debug(\"对于需要保序的情况,只应该启动单个中转节点,目前启动多个节点原节点会被挤掉线,但是由于重连机制,会轮着挤掉线\");\n return IdManager.generateStaticQueueId(buildTransferName(name));\n }"
] | codesearchnet | {
"query": "Represent the text about text processing:",
"pos": "Represent the code about text processing:",
"neg": "Represent the code:"
} |
Run the external control daemon.
:param conf_file: Name of the configuration file. | [
"def remote_daemon(conf_file):\n \n\n eventlet.monkey_patch()\n conf = config.Config(conf_file=conf_file)\n daemon = remote.RemoteControlDaemon(None, conf)\n daemon.serve()"
] | [
"def run(self, args): # pylint: disable=unused-argument\n \n logging.basicConfig(stream=sys.stdout, level=logging.INFO)\n\n # This is used as a tool only to segment translation files when adding a\n # new segment. In the regular workflow, the work is done by the extract\n # phas... | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Main thread function. | [
"def run(self):\n\t\t\n\t\tif not hasattr(self, 'queue'):\n\t\t\traise RuntimeError(\"Audio queue is not intialized.\")\n\n\t\tchunk = None\n\t\tchannel = None\n\t\tself.keep_listening = True\n\t\twhile self.keep_listening:\n\t\t\tif chunk is None:\n\t\t\t\ttry:\n\t\t\t\t\tframe = self.queue.get(timeout=queue_timeo... | [
"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 post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
// NewBearerAuthFileRoundTripper adds the bearer token read from the provided file to a request unless
// the authorization header has already been set. This file is read for every request. | [
"func NewBearerAuthFileRoundTripper(bearerFile string, rt http.RoundTripper) http.RoundTripper {\n\treturn &bearerAuthFileRoundTripper{bearerFile, rt}\n}"
] | [
"func valid(authorization []string) bool {\n\tif len(authorization) < 1 {\n\t\treturn false\n\t}\n\ttoken := strings.TrimPrefix(authorization[0], \"Bearer \")\n\t// Perform the token validation here. For the sake of this example, the code\n\t// here forgoes any of the usual OAuth2 token validation and instead check... | codesearchnet | {
"query": "Represent the text about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
Pull the current status of a service by name.
Returns:
dict: A dictionary of service status | [
"async def service_status(self, name):\n \n\n return await self.send_command(OPERATIONS.CMD_QUERY_STATUS, {'name': name},\n MESSAGES.QueryStatusResponse, timeout=5.0)"
] | [
"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 instruction about AWS Route 53:",
"pos": "Represent the Github code about AWS Route 53:",
"neg": "Represent the Github code:"
} |
// NewRequest creates a new Request from the tcp connection | [
"func NewRequest(bufConn io.Reader) (*Request, error) {\n\t// Read the version byte\n\theader := []byte{0, 0, 0}\n\tif _, err := io.ReadAtLeast(bufConn, header, 3); err != nil {\n\t\treturn nil, fmt.Errorf(\"Failed to get command version: %v\", err)\n\t}\n\n\t// Ensure we are compatible\n\tif header[0] != socks5Ver... | [
"@Override\n public void init(TCPWriteRequestContext x, H2MuxTCPWriteCallback c) {\n writeReqContext = x;\n muxCallback = c;\n\n // callback will need to know how to get back to this write queue.\n // This means one and only one H2WriteTree per H2InboundLink which has just one true TC... | codesearchnet | {
"query": "Represent the instruction about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code:"
} |
/*
ParseDoc parses and returns a top level jsh.Document. In most cases, using
"ParseList" or "ParseObject" is preferable.
*/ | [
"func ParseDoc(r *http.Request, mode DocumentMode) (*Document, *Error) {\n\treturn NewParser(r).Document(r.Body, mode)\n}"
] | [
"function getSyntacticAutoCompleteSuggestions(input, startRule = 'prog') {\n const lexResult = JDLLexer.tokenize(input);\n\n // \".input\" is a setter which will reset the parser's internal state.\n parserSingleton.input = lexResult.tokens;\n\n const syntacticSuggestions = parserSingleton.computeContentAssist(s... | codesearchnet | {
"query": "Represent the Github sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Copy properties from one object to another - not replacing if required | [
"function merge (a, b, soft) {\n for (var k in b)\n if (!soft || !a.hasOwnProperty(k)) a[k] = b[k]\n return a\n}"
] | [
"function Scope(context, parent, meta) {\n\t// The object that will be looked on for values.\n\t// If the type of context is TemplateContext, there will be special rules for it.\n\tthis._context = context;\n\t// The next Scope object whose context should be looked on for values.\n\tthis._parent = parent;\n\t// If t... | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Tells whenever header with given `name` is set or not.
@return [Boolean] | [
"def include?(name)\n name = normalize_header name.to_s\n @pile.any? { |k, _| k == name }\n end"
] | [
"def setTargets(self, targets):\n \n if not self.verifyArguments(targets) and not self.patterned:\n raise NetworkError('setTargets() requires [[...],[...],...] or [{\"layerName\": [...]}, ...].', targets)\n self.targets = targets"
] | codesearchnet | {
"query": "Represent the Github sentence about NLP:",
"pos": "Represent the Github code about NLP:",
"neg": "Represent the Github code:"
} |
Merges the {@code returnElement} with the given element which was popped from the stack.
If the {@code returnElement} existed before, the values are merged.
@param stackElement The popped element | [
"private void mergeReturnElement(final Element stackElement) {\n if (returnElement != null)\n stackElement.merge(returnElement);\n returnElement = stackElement;\n }"
] | [
"private static PortablePosition navigateToPathTokenWithoutQuantifier(\n PortableNavigatorContext ctx, PortablePathCursor path) throws IOException {\n if (path.isLastToken()) {\n // if it's a token that's on the last position we calculate its direct access position and return it for\n ... | codesearchnet | {
"query": "Represent the sentence about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Given a plain source namespace, return the corresponding Namespace
object, or None if it is not included. | [
"def lookup(self, plain_src_ns):\n \n # Ignore the namespace if it is excluded.\n if plain_src_ns in self._ex_namespace_set:\n return None\n # Include all namespaces if there are no included namespaces.\n if not self._regex_map and not self._plain:\n return N... | [
"def persistent_id(self, obj):\n \"\"\"\"\"\"\n if isinstance(obj, Element):\n # Here, our persistent ID is simply a tuple, containing a tag and\n # a key\n return obj.__class__.__name__, obj.symbol\n else:\n # If obj does not have a persistent ID, re... | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Submit link to this subreddit (POST). Calls :meth:`narwal.Reddit.submit_link`.
:param title: title of submission
:param url: url submission links to | [
"def submit_link(self, title, url):\n \n return self._reddit.submit_link(self.display_name, title, url)"
] | [
"def initialize(self, id=None, text=None):\n self.id = none_or(id, int)\n \n\n self.text = none_or(text, str)\n \"\"\"\n Username or IP address of the user at the time of the edit : str | None\n \"\"\""
] | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
get the value of attribute with the given name of the given object | [
"function getAttr(obj, name) {\n return _.find(obj.attr, function(item) {\n return item.name == name;\n }).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 comment about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
Creates a custom policy string based on the supplied parameters. | [
"def _custom_policy(resource, expires=None, valid_after=None, ip_address=None):\n \n condition = {}\n if expires:\n condition[\"DateLessThan\"] = {\"AWS:EpochTime\": expires}\n if valid_after:\n condition[\"DateGreaterThan\"] = {\"AWS:EpochTime\": valid_after}\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 text about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Software development:"
} |
Return all matches for this event. The first matcher is also returned for each matched object.
:param event: an input event | [
"def matches(self, event):\n '''\n \n '''\n ret = []\n self._matches(event, set(), ret)\n return tuple(r[0] for r in ret)"
] | [
"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 post about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Auto-increment reference number.
@param \Cake\Event\Event $event Event object
@param \Cake\Datasource\EntityInterface $entity Translation entity
@param \ArrayObject $options entity options
@return void | [
"public function autoIncrementFieldValue(Event $event, EntityInterface $entity, ArrayObject $options) : void\n {\n $table = $event->getSubject();\n\n if (!$table instanceof Table) {\n return;\n }\n\n $fields = $this->getAutoIncrementFields($table);\n\n // skip if no ... | [
"public function beforeFilter(\\Cake\\Event\\Event $event)\n {\n parent::beforeFilter($event);\n\n // get the type-string\n $type = $this->PostTypes->postTypeFinder($this->request);\n $this->_type = $type;\n\n // check if the string exists. Will throw an exception\n $thi... | codesearchnet | {
"query": "Represent the text about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software development:"
} |
Internal: Calculates and caches the path from the root state to the receiver state. Subsequent calls will return the cached path array. Returns an array of `State` objects. | [
"function _path() {\n return this.__cache__._path = this.__cache__._path ||\n (this.superstate ? _path.call(this.superstate).concat(this) : [this]);\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:"
} |
@param $params
@param $name
@param bool $throwException
@return mixed|null
Get a symfony form object form a function/block parameter | [
"protected function getSymfonyFormFromParams($params, $name, $throwException = false)\n {\n $sfForm = $this->getParam($params, $name);\n\n if (null === $sfForm && false === $throwException) {\n return null;\n }\n\n if (!$sfForm instanceof SymfonyForm) {\n throw n... | [
"def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)"
] | codesearchnet | {
"query": "Represent the Github summarization about Symfony:",
"pos": "Represent the Github code about Symfony:",
"neg": "Represent the Github code:"
} |
Determine the cheapest instance type given a minimum
number of cores and minimum amount of RAM (in GB). | [
"def get_cheapest_instance_type(cores, memory):\n \n\n pricelist = get_gcloud_pricelist()\n\n # Filter out preemptible, shared-CPU, and non-US instance types\n us_instance_types = {k: v for k, v in pricelist.items()\n if k.startswith('CP-COMPUTEENGINE-VMIMAGE-')\n ... | [
"function NodeInfo() {\n\n /**\n * the CPU model\n * \n * @type {String}\n */\n this.model = null;\n\n /**\n * memory size in kilobytes\n * @type {Number}\n */\n this.memory = 0;\n\n /**\n * the number of active CPUs\n * @type {Number}\n */\n this.cpus = 0;\... | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Adds multiple resources to cache.
@param resources items to add
@throws IllegalStateException in case <code>init()</code> was not called | [
"public void cache(Map<String, Object> resources) {\n\t\tverifyState();\n\n\t\tif (!cacheLocked.get()) {\n\t\t\tresourceCache.get().putAll(resources);\n\t\t}\n\t}"
] | [
"public MultipleDataProviderContext<DPO> read(Collection<DataProvider<DPO>> dataProviders) {\n if (dataProviders != null) {\n addedDataProviders.addAll(dataProviders);\n }\n\n // Stay in the same context and re-use the same instance because no type has changed\n return this;\n... | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
@param string $exchangeName
@param string $messageBody
@param string $routingKey
@param int $flags
@param array $attributes
@return bool | [
"public function publish(\n $exchangeName,\n $messageBody,\n $routingKey = '',\n $flags = AMQP_NOPARAM,\n array $attributes = []\n ) {\n $exchange = $this->produceExchangeInstance($exchangeName);\n\n $return = $exchange->publish(\n $messageBody,\n ... | [
"public function file(string $path, string $md5)\n {\n //==============================================================================\n // Create Event Object\n $event = new ObjectFileEvent($this->getWebserviceId(), $path, $md5);\n //============================================... | codesearchnet | {
"query": "Represent the post about PHP programming:",
"pos": "Represent the code about PHP programming:",
"neg": "Represent the code about Software development:"
} |
// NewEffectiveCallerID creates a new vtrpcpb.CallerID with principal, component and
// subComponent | [
"func NewEffectiveCallerID(principal string, component string, subComponent string) *vtrpcpb.CallerID {\n\treturn &vtrpcpb.CallerID{Principal: principal, Component: component, Subcomponent: subComponent}\n}"
] | [
"func (e *environ) AdoptResources(ctx context.ProviderCallContext, controllerUUID string, fromVersion version.Number) error {\n\t// This provider doesn't track instance -> controller.\n\treturn nil\n}"
] | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
TODO create own visualizer for that task, maybe with decorator pattern | [
"@SuppressWarnings(\"unused\")\n\tprivate void drawAnomalies() {\n\t\tPEAnomalyScanner scanner = PEAnomalyScanner.newInstance(data);\n\t\tList<Anomaly> anomalies = scanner.getAnomalies();\n\t\tfor (Anomaly anomaly : anomalies) {\n\t\t\tList<PhysicalLocation> locs = anomaly.locations();\n\t\t\tfor (PhysicalLocation ... | [
"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:"
} |
<tt>validate_export_data_lengths</tt> ensures that the headers and all data rows are of the
same size. (This is an important data integrity check if you are using NoSQL.) | [
"def validate_export_data_lengths(data_set, data_headers=nil)\n row_length = !data_headers.blank? ? data_headers.size : data_set[0].size\n if data_set.any? {|row| row_length != row.size }\n raise MakeExportable::ExportFault.new(\"Headers and all rows in the data set must be the same size.\")\... | [
"def run_objective(objective, _name, raw_output, output_files, threads)\n # output is a, array: [raw_output, output_files].\n # output_files is a hash containing the absolute paths\n # to file(s) output by the target in the format expected by the\n # objective function(s), with keys as the keys ... | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Initialize favico | [
"function() {\n\t\t\t//merge initial options\n\t\t\t_opt = merge(_def, opt);\n\t\t\t_opt.bgColor = hexToRgb(_opt.bgColor);\n\t\t\t_opt.textColor = hexToRgb(_opt.textColor);\n\t\t\t_opt.position = _opt.position.toLowerCase();\n\t\t\t_opt.animation = (animation.types['' + _opt.animation]) ? _opt.animation : _def.anim... | [
"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 instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// HandlePacket is called by the stack when new packets arrive to this transport
// endpoint. | [
"func (e *endpoint) HandlePacket(r *stack.Route, id stack.TransportEndpointID, vv buffer.VectorisedView) {\n\ts := newSegment(r, id, vv)\n\tif !s.parse() {\n\t\te.stack.Stats().MalformedRcvdPackets.Increment()\n\t\te.stack.Stats().TCP.InvalidSegmentsReceived.Increment()\n\t\ts.decRef()\n\t\treturn\n\t}\n\n\tif !s.c... | [
"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 sentence about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
// Annotate iterates over all tokens and applies the type annotation on them | [
"func (a *TypeBasedAnnotation) Annotate(tokens []*Token) []*Token {\n\tfor _, augTok := range tokens {\n\t\ta.typeAnnotation(augTok)\n\t}\n\treturn tokens\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 instruction about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
Sanitize field values
Used before saving and before providing instance to widget template.
@since 0.9
@param array $instance Widget instance
@return array Sanitized instance | [
"function ctc_sanitize( $instance ) { // prefix in case WP core adds method with same name\n\n\t\tglobal $allowedposttags;\n\n\t\t// Array to add sanitized values to\n\t\t$sanitized_instance = array();\n\n\t\t// Loop valid fields to sanitize\n\t\t$fields = $this->ctc_prepared_fields();\n\t\tforeach ( $fields as $id... | [
"public function getStoreValue($data = null)\n {\n\n // If Overrite Value\n if (isset($this->value) && $this->overwriteValue) {\n return $this->value;\n }\n\n // If user have user input value\n if ($data != null && isset($data[$this->getName()])) {\n\n // ... | codesearchnet | {
"query": "Represent the Github text about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
// SetIntegrationId sets the IntegrationId field's value. | [
"func (s *CreateIntegrationResponseInput) SetIntegrationId(v string) *CreateIntegrationResponseInput {\n\ts.IntegrationId = &v\n\treturn s\n}"
] | [
"private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n classLoaderIdentifier = (String) fields.get(CLASS_LOADER_IDENTIFIER, null);\n\n // Note that further processing is required in JEEMetadataContextProviderImp... | codesearchnet | {
"query": "Represent the description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Creates export dialog, and returns associated document. | [
"private static <T> void createConvertDialog(final JFrame frm, final Formatting fmt, final UnaryFunction<Document,Callable<T>> init, final Callable<Void> end) {\n\n // Prepares UI components\n final JLabel dialogLabel =\n new JLabel(\"<html><b>Formatted data</b></html>\");\n dialogLa... | [
"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:"
} |
Add the export view to urls. | [
"def get_urls(self):\n \n urls = super(FormSubmissionAdmin, self).get_urls()\n from django.conf.urls import url\n\n def wrap(view):\n def wrapper(*args, **kwargs):\n return self.admin_site.admin_view(view)(*args, **kwargs)\n return update_wrapper(wrap... | [
"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 sentence:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Plot 2d ellipse in 3d using matplotlib backend | [
"def plot_ellipse_matplotlib(cov, pos, ax, nstd=2, **kwargs):\n \n from matplotlib.patches import Ellipse\n from mpl_toolkits.mplot3d import art3d, Axes3D\n ellipse_param, normal = calc_2d_ellipse_properties(cov,nstd)\n ellipse_kwds = merge_keywords(ellipse_param, kwargs)\n ellip = Ellipse(xy=(0,0... | [
"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 description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Insert the given array of lines at offset 'at', count them as having the given height. | [
"function(at, lines, height) {\n this.height += height;\n this.lines = this.lines.slice(0, at).concat(lines).concat(this.lines.slice(at));\n for (var i = 0; i < lines.length; ++i) lines[i].parent = this;\n }"
] | [
"def rs_calc_syndromes(msg, nsym, fcr=0, generator=2):\n '''\n '''\n # Note the \"[0] +\" : we add a 0 coefficient for the lowest degree (the constant). This effectively shifts the syndrome, and will shift every computations depending on the syndromes (such as the errors locator polynomial, errors evaluato... | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code about Natural Language Processing:"
} |
Purpose unknown
@param {unknown} path unknown
@returns {unknown} unknown | [
"function generateDownloadsDir() {\n // Create temporary directory for file uploads\n let dloads = path.join(path.dirname(require.main.filename), 'download');\n\n if (!fs.existsSync(dloads)) {\n fs.mkdirSync(dloads);\n }\n\n let files = fs.readdirSync(dloads);\n\n for (let ix = 0; ix < file... | [
"func (m *Strings) ToRawInfo() interface{} {\n\tinfo := yaml.MapSlice{}\n\tif m == nil {\n\t\treturn info\n\t}\n\t// &{Name:additionalProperties Type:NamedString StringEnumValues:[] MapType:string Repeated:true Pattern: Implicit:true Description:}\n\treturn info\n}"
] | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Validate the requests authorization header for the provider.
@param \Illuminate\Http\Request $request
@throws \Symfony\Component\HttpKernel\Exception\BadRequestHttpException
@return bool | [
"public function validateAuthorizationHeader(Request $request)\n {\n if (Str::startsWith(\\strtolower($request->headers->get('authorization')), $this->getAuthorizationMethod())) {\n return true;\n }\n\n throw new BadRequestHttpException();\n }"
] | [
"public function register()\n {\n if (env('USE_JSON_EXCEPTION_HANDLER', false)) {\n $this->app->bind(\n \\Illuminate\\Contracts\\Debug\\ExceptionHandler::class,\n 'RobRogers3\\LaravelExceptionHandler\\JsonAwareExceptionHandler'\n );\n }\n \... | codesearchnet | {
"query": "Represent the post about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software development:"
} |
@param $dataVencimento
@param string $format
@return $this | [
"public function setDataVencimento($dataVencimento, $format = 'dmY')\n {\n $this->dataVencimento = trim($dataVencimento, '0 ') ? Carbon::createFromFormat($format, $dataVencimento) : null;\n\n return $this;\n }"
] | [
"final protected function c() {return dfc($this, function() {/** @var int|null $id $id */return\n\t\t!($id = $this->o()->getCustomerId()) ? null : df_customer($id)\n\t;});}"
] | codesearchnet | {
"query": "Represent the description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
// SetChapEnabled sets the ChapEnabled field's value. | [
"func (s *DeviceiSCSIAttributes) SetChapEnabled(v bool) *DeviceiSCSIAttributes {\n\ts.ChapEnabled = &v\n\treturn s\n}"
] | [
"private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo... | codesearchnet | {
"query": "Represent the instruction about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
@param \ReflectionMethod $method
@return bool | [
"private function shouldProxiedMethodReturn(\\ReflectionMethod $method)\n {\n if ( ! $method->hasReturnType()) {\n return true;\n }\n\n return 'void' !== strtolower($this->formatType($method->getReturnType(), $method));\n }"
] | [
"public function handleManipulateAST(ManipulateAST $ManipulateAST): void\n {\n $ManipulateAST->documentAST = ASTHelper::attachDirectiveToObjectTypeFields(\n $ManipulateAST->documentAST,\n PartialParser::directive('@deferrable')\n );\n\n $ManipulateAST->documentAST->setD... | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
// ValidateModelDetails ensures that given model details are valid. | [
"func ValidateModelDetails(details ModelDetails) error {\n\tif details.ModelUUID == \"\" {\n\t\treturn errors.NotValidf(\"missing uuid, model details\")\n\t}\n\tif details.ModelType == \"\" {\n\t\treturn errors.NotValidf(\"missing type, model details\")\n\t}\n\treturn nil\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 summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Render the complete section
@since 1.0.0
@access public
@return string|null HTML of rendered notice | [
"public function render() {\n\n\t\t$output = '<' . $this->element . ' ' . $this->build_attributes() . '>';\n\n\t\t$output .= $this->label();\n\n\t\t$output .= $this->description();\n\n\t\t$output .= $this->render_template();\n\n\t\tif ( ! empty( $this->child ) ) {\n\t\t\t$output .= $this->render_children();\n\t\t}\... | [
"protected function configureFormer()\n {\n // Use Bootstrap 3\n Config::set('former.framework', 'TwitterBootstrap3');\n\n // Reduce the horizontal form's label width\n Config::set('former.TwitterBootstrap3.labelWidths', []);\n\n // Change Former's required field HTML\n ... | codesearchnet | {
"query": "Represent the Github post about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about Software development:"
} |
select save_engine , tushare ts Tushare 使用 Tushare 免费数据接口, tdx 使用通达信数据接口
:param engine: 字符串Str
:param paralleled: 是否并行处理;默认为False
:return: sts means save_tushare_py or stdx means save_tdx_py | [
"def select_save_engine(engine, paralleled=False):\n '''\n \n '''\n if engine in ['tushare', 'ts', 'Tushare']:\n return sts\n elif engine in ['tdx']:\n if paralleled:\n return stdx_parallelism\n else:\n return stdx\n elif engine in ['gm', 'goldenminer']:\... | [
"def QA_SU_save_stock_terminated(client=DATABASE):\n '''\n \n '''\n\n # 🛠todo 已经失效从wind 资讯里获取\n # 这个函数已经失效\n print(\"!!! tushare 这个函数已经失效!!!\")\n df = QATs.get_terminated()\n #df = QATs.get_suspended()\n print(\n \" Get stock terminated from tushare,stock count is %d (终止上市股票列表)\"... | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about API documentation:"
} |
// fileName returns a file name for use with os.NewFile for Addr. | [
"func (a *Addr) fileName() string {\n\treturn fmt.Sprintf(\"%s:%s\", a.Network(), a.String())\n}"
] | [
"public String filePath(int index, String savePath) {\n // not calling the corresponding swig function because internally,\n // the use of the function GetStringUTFChars does not consider the case of\n // a copy not made\n return savePath + File.separator + fs.file_path(index);\n }"
] | codesearchnet | {
"query": "Represent the Github post about File management:",
"pos": "Represent the Github code about File management:",
"neg": "Represent the Github code about programming:"
} |
// SetExecutionProperty sets the ExecutionProperty field's value. | [
"func (s *JobUpdate) SetExecutionProperty(v *ExecutionProperty) *JobUpdate {\n\ts.ExecutionProperty = v\n\treturn s\n}"
] | [
"private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo... | codesearchnet | {
"query": "Represent the Github comment about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
Encode the Eds as a dictionary suitable for JSON serialization. | [
"def to_dict(self, properties=True):\n \n nodes = {}\n for node in self.nodes():\n nd = {\n 'label': node.pred.short_form(),\n 'edges': self.edges(node.nodeid)\n }\n if node.lnk is not None:\n nd['lnk'] = {'from': nod... | [
"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 text about Technology:",
"pos": "Represent the code about Technology:",
"neg": "Represent the code about programming:"
} |
Gets the size of the bounded list underneath. Note that this num can change if the inner list is swapped out.
@return | [
"public int getSize() {\n\t\tInnerList iList = ref.get();\n\t\treturn iList != null ? iList.getList().size() : 0;\n\t}"
] | [
"private static String keyToGoWithElementsString(String label, DuplicateGroupedAndTyped elements) {\n /*\n * elements.toString(), which the caller is going to use, includes the homogeneous type (if\n * any), so we don't want to include it here. (And it's better to have it in the value, rather\n * tha... | codesearchnet | {
"query": "Represent the description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.