query
stringlengths
16
255
pos
list
neg
list
task
stringclasses
1 value
instruction
dict
// WithAuth ensures that request is authenticated
[ "func (h *Handler) WithAuth(fn ContextHandler) httprouter.Handle {\n\treturn httplib.MakeHandler(func(w http.ResponseWriter, r *http.Request, p httprouter.Params) (interface{}, error) {\n\t\tctx, err := h.AuthenticateRequest(w, r, true)\n\t\tif err != nil {\n\t\t\treturn nil, trace.Wrap(err)\n\t\t}\n\t\treturn fn(w...
[ "def set_schema(self, schema_name, include_public=True):\n \n self.tenant = FakeTenant(schema_name=schema_name)\n self.schema_name = schema_name\n self.include_public_schema = include_public\n self.set_settings_schema(schema_name)\n self.search_path_set = False\n # C...
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Returns specific part of a query like JOIN, LIMIT, OFFSET etc. @param string $section @param array $statements @return string @throws Exception
[ "protected function buildQueryPart(string $section, array $statements): string\n {\n switch ($section) {\n case static::QUERY_PART_JOIN:\n return $this->buildJoin($statements);\n case static::QUERY_PART_LIMIT:\n return isset($statements['limit']) ? 'LIMI...
[ "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 post about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
The parameters. These are specific to each resource type (i.e. each factory as specified inside {@link #getFactory()} has its own parameter needs). E.g. for MQSeries: HOST, PORT, CHAN, TRAN, QMGR, ...
[ "public Collection<JndiObjectResourceParameter> getParameters(DbConn cnx)\n {\n ResultSet rs = cnx.runSelect(\"jndiprm_select_all_in_jndisrc\", this.id);\n List<JndiObjectResourceParameter> res = new ArrayList<>();\n JndiObjectResourceParameter tmp = null;\n try\n {\n ...
[ "public void init(DatabaseOwner databaseOwner, String strDbName, int iDatabaseType, Map<String, Object> properties)\n {\n super.init(databaseOwner, strDbName, iDatabaseType, properties);\n // Typically, JDBC databases do not support locking (Change to \"true\" otherwise on JDBC open)\n this....
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Read and parse the current theme's config.yml configuration file. @param DirectoryInterface $themeDir @param array $generalConfig @return array
[ "protected function parseTheme(DirectoryInterface $themeDir, array $generalConfig)\n {\n $themeConfig = $this->parseConfigYaml('theme.yml', $themeDir);\n\n /** @deprecated Deprecated since 3.0, to be removed in 4.0. (config.yml was the old filename) */\n if (empty($themeConfig)) {\n ...
[ "protected function beforeInit()\n {\n parent::beforeInit();\n \n $this->isCli = true;\n \n // load default config\n Config::setDefault(DefaultConfig::console());\n \n // load default definition\n $this->definition = $this->getDefaultDefinition()...
codesearchnet
{ "query": "Represent the text about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
Reduce input tensor by l1 normalization.
[ "def reduce_l1(attrs, inputs, proto_obj):\n \"\"\"\"\"\"\n new_attrs = translation_utils._fix_attribute_names(attrs, {'axes':'axis'})\n new_attrs = translation_utils._add_extra_attributes(new_attrs,\n {'ord' : 1})\n return 'norm', new_attrs, inputs"...
[ "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 post:", "pos": "Represent the code:", "neg": "Represent the code about Natural Language Processing:" }
Wait for child and terminate.
[ "public function exitWorker(int $sig, array $pid): self\n {\n $this->logger->debug('worker ['.$pid['pid'].'] exit with ['.$sig.']', [\n 'category' => get_class($this),\n ]);\n\n pcntl_waitpid($pid['pid'], $status, WNOHANG | WUNTRACED);\n\n foreach ($this->forks as $id => $p...
[ "def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR...
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Adds eventlisteners cross browser @param {Object} el The element which gets the listener @param {String} e The event type @param {Function} callback The action to execute on event @param {Boolean} capture The capture mode
[ "function addEvent(el, e, callback, capture) {\n if (el.addEventListener) {\n el.addEventListener(e, callback, capture || false);\n }\n else\n if (el.attachEvent) {\n el.attachEvent('on' + e, callback);\n }\n }" ]
[ "function WidgetDef(config, endFunc, out) {\n this.type = config.type; // The widget module type name that is passed to the factory\n this.id = config.id; // The unique ID of the widget\n this.config = config.config; // Widget config object (may be null)\n this.state = config.state; // Widget state obje...
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// SetSceneByName does a lookup for the `Scene` where its `Type()` equals `name`, and then sets it as current `Scene`
[ "func SetSceneByName(name string, forceNewWorld bool) error {\n\tsceneMutex.RLock()\n\tscene, ok := scenes[name]\n\tsceneMutex.RUnlock()\n\tif !ok {\n\t\treturn fmt.Errorf(\"scene not registered: %s\", name)\n\t}\n\n\tSetScene(scene.scene, forceNewWorld)\n\n\treturn nil\n}" ]
[ "function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co...
codesearchnet
{ "query": "Represent the Github description about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
// removeHandshake removes handshake for peer with peerID // from the bzz handshake store
[ "func (b *Bzz) removeHandshake(peerID enode.ID) {\n\tb.mtx.Lock()\n\tdefer b.mtx.Unlock()\n\tdelete(b.handshakes, peerID)\n}" ]
[ "func (c channelState) ConnectedNodes() map[NodeID]struct{} {\n\tnodes := make(map[NodeID]struct{})\n\tfor _, channels := range c {\n\t\tnodes[channels.Node] = struct{}{}\n\t}\n\n\t// TODO(roasbeef): add outgoing, nodes, allow incoming and outgoing to\n\t// per node\n\t// * only add node is chan as funding amt set...
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
return the SQL string for set @param array $values associative array,the key must be the SQL field name @return string set
[ "private static function updateSet(array $values)\n {\n $ret = \"\";\n foreach($values as $key=>$value)\n $ret .= $key.\"=\".$value.\", \";\n $ret = substr($ret,0,-2);//remove last \\\", \\\"\n return $ret;\n }" ]
[ "def fix_config(self, options):\n \n options = super(Trigger, self).fix_config(options)\n\n opt = \"condition\"\n if opt not in options:\n options[opt] = \"True\"\n if opt not in self.help:\n self.help[opt] = \"The (optional) condition for teeing off the toke...
codesearchnet
{ "query": "Represent the sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Get the local adapter. @param string[] $config @return \League\Flysystem\Adapter\Local
[ "protected function getAdapter(array $config)\n {\n // Pull parameters from config and set defaults for optional values\n $path = $config['path'];\n $writeFlags = array_get($config, 'write_flags', LOCK_EX);\n $linkHandling = array_get($config, 'link_handling', Local::DISALLOW_LINKS);\...
[ "public function init()\n {\n $this->response->disableLayout();\n $this->userStore = b8\\Store\\Factory::getStore('User');\n }" ]
codesearchnet
{ "query": "Represent the Github summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
// SetEngineVersion sets the EngineVersion field's value.
[ "func (s *RestoreDBClusterFromSnapshotInput) SetEngineVersion(v string) *RestoreDBClusterFromSnapshotInput {\n\ts.EngineVersion = &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 instruction about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
{@inheritdoc} @throws \InvalidArgumentException @throws \Symfony\Component\Console\Exception\CommandNotFoundException @throws \Symfony\Component\Console\Exception\InvalidArgumentException @throws \PhpSchool\CliMenu\Exception\InvalidTerminalException
[ "protected function execute(InputInterface $input, OutputInterface $output): int\n {\n $builder = $this->getMenuBuilder($input, $output);\n if ($input->getOption('dump')) {\n $this->dumpCommands($builder, $output);\n } else {\n $builder->build()->open();\n }\n ...
[ "public function register(Container $app): void\n {\n $this->registerWriters($app);\n $this->registerDependenciesOnXsltExtension($app);\n\n $app->register(new \\phpDocumentor\\Plugin\\Graphs\\ServiceProvider());\n $app->register(new \\phpDocumentor\\Plugin\\Twig\\ServiceProvider());\n...
codesearchnet
{ "query": "Represent the Github text about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about Software Development:" }
Format trie @param trie trie to format @param formatBitString true if the bits for this key should be included in the node @return formatted trie, not null
[ "public String format(PatriciaTrie<V> trie, boolean formatBitString) {\n StringBuilder builder = new StringBuilder();\n builder.append(formatHeader());\n builder.append(formatNode(trie.getRoot().getLeft(), -1, trie.getKeyMapper(), formatBitString));\n builder.append(formatTrailer());\n ...
[ "def delete_node_storage(node)\n return if node == BLANK_NODE\n raise ArgumentError, \"node must be Array or BLANK_NODE\" unless node.instance_of?(Array)\n\n encoded = encode_node node\n return if encoded.size < 32\n\n # FIXME: in current trie implementation two nodes can share identical\n ...
codesearchnet
{ "query": "Represent the Github summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
Stop a VM in DimensionData. name: The name of the VM to stop. CLI Example: .. code-block:: bash salt-cloud -a stop vm_name
[ "def stop(name, call=None):\n '''\n \n '''\n conn = get_conn()\n node = get_node(conn, name) # pylint: disable=not-callable\n log.debug('Node of Cloud VM: %s', node)\n\n status = conn.ex_shutdown_graceful(node)\n log.debug('Status of Cloud VM: %s', status)\n\n return status" ]
[ "def docker(gandi, vm, args):\n \n if not [basedir for basedir in os.getenv('PATH', '.:/usr/bin').split(':')\n if os.path.exists('%s/docker' % basedir)]:\n gandi.echo(\"\"\"'docker' not found in $PATH, required for this command \\\nto work\nSee https://docs.docker.com/installation/#installat...
codesearchnet
{ "query": "Represent the Github summarization about technology:", "pos": "Represent the Github code about technology:", "neg": "Represent the Github code:" }
Translates "condition" to a Druid filter, or returns null if we cannot translate the condition. @param plannerContext planner context @param querySignature row signature of the dataSource to be filtered @param expression Calcite row expression
[ "@Nullable\n public static DimFilter toFilter(\n final PlannerContext plannerContext,\n final DruidQuerySignature querySignature,\n final RexNode expression\n )\n {\n final SqlKind kind = expression.getKind();\n\n if (kind == SqlKind.IS_TRUE || kind == SqlKind.IS_NOT_FALSE) {\n return t...
[ "@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 Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code:" }
Parse a YAML specification of a target port into this object.
[ "def parse_yaml(self, y):\n ''''''\n super(TargetPort, self).parse_yaml(y)\n self.port_name = y['portName']\n return 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 comment about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
Get all validation messages (including nested models). @return array
[ "public function getErrors(): array\n {\n if ($this->errors === null) {\n $this->errors = $this->fetchErrors();\n }\n\n //Making sure that each error point to proper input origin\n return $this->mapper->mapErrors($this, $this->validateNested($this->errors));\n }" ]
[ "def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)" ]
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
// DiscardUnknown recursively discards all unknown fields.
[ "func (a *InternalMessageInfo) DiscardUnknown(m Message) {\n\tdi := atomicLoadDiscardInfo(&a.discard)\n\tif di == nil {\n\t\tdi = getDiscardInfo(reflect.TypeOf(m).Elem())\n\t\tatomicStoreDiscardInfo(&a.discard, di)\n\t}\n\tdi.discard(toPointer(&m))\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 instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
checks to see if the server_core is running args: delay: will cycle till core is up. timeout: number of seconds to wait
[ "def verify_server_core(timeout=120, start_delay=90):\n ''' \n '''\n timestamp = time.time()\n last_check = time.time() + start_delay - 10\n last_delay_notification = time.time() - 10\n server_down = True\n return_val = False\n timeout += 1\n # loop until the server is up or the timeout i...
[ "def calc_finished(self):\n '''\n \n '''\n #print_stack(limit=5)\n if not self.calc_running :\n #print('Calc running:',self.calc_running)\n return True\n else:\n # The calc is marked as running check if this is still true\n # We d...
codesearchnet
{ "query": "Represent the Github text about IT infrastructure management:", "pos": "Represent the Github code about IT infrastructure management:", "neg": "Represent the Github code:" }
Checks if the passed in date is the same day as the instance current day. :type dt: DateTime or datetime or str or int :rtype: bool
[ "def is_same_day(self, dt):\n \n dt = pendulum.instance(dt)\n\n return self.to_date_string() == dt.to_date_string()" ]
[ "def _parse_filter_word(self, word):\n \n if isinstance(word, str):\n word = \"'{}'\".format(word)\n elif isinstance(word, dt.date):\n if isinstance(word, dt.datetime):\n if word.tzinfo is None:\n # if it's a naive datetime, localize the d...
codesearchnet
{ "query": "Represent the comment about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code:" }
convert any based value bellow or equals to 64 to its decimal value @param string $number @param int $base @throws \InvalidArgumentException @return static
[ "public static function fromBase($number, $base)\n {\n // trim base 64 padding char, only positive\n $number = trim($number, ' =-');\n if ($number === '' || strpos($number, '.') !== false) {\n throw new \\InvalidArgumentException('Argument number is not an integer');\n }\n\...
[ "final private function checkScalarValue(string $scalar):bool\n {\n if ($this->strlikeInArray($scalar, $this->scalar) !== false) {\n return (true);\n } else {\n throw new Server500(new \\ArrayObject(array(\"explain\" => \"Unknow type $scalar in Mercure\",\n \"so...
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
Get logs from Log service. Unsuccessful operation will cause an Exception. @param GetLogsRequest $request the GetLogs request parameters class. @throws Exception @return GetLogsResponse
[ "public function getLogs(GetLogsRequest $request)\n {\n $headers = array();\n $params = array();\n if ($request->getTopic() !== null) {\n $params ['topic'] = $request->getTopic();\n }\n if ($request->getFrom() !== null) {\n $params ['from'] = $request->ge...
[ "@Help(help = \"Create the object of type {#}\")\n public T create(final T object) throws SDKException {\n return (T) requestPost(object);\n }" ]
codesearchnet
{ "query": "Represent the Github post about PHP:", "pos": "Represent the Github code about PHP:", "neg": "Represent the Github code:" }
Execute the console command. @return void
[ "public function handle()\n {\n $provider = $this->laravel->getProvider(EventServiceProvider::class);\n\n foreach ($provider->listens() as $event => $listeners) {\n $this->makeEventAndListeners($event, $listeners);\n }\n\n $this->info('Events and listeners generated success...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Creates a new commerce discount rel with the primary key. Does not add the commerce discount rel to the database. @param commerceDiscountRelId the primary key for the new commerce discount rel @return the new commerce discount rel
[ "@Override\n\tpublic com.liferay.commerce.discount.model.CommerceDiscountRel createCommerceDiscountRel(\n\t\tlong commerceDiscountRelId) {\n\t\treturn _commerceDiscountRelLocalService.createCommerceDiscountRel(commerceDiscountRelId);\n\t}" ]
[ "def _reflex_rule_process(self, wf_action):\n \n # Check out if the analysis has any reflex rule bound to it.\n # First we have get the analysis' method because the Reflex Rule\n # objects are related to a method.\n a_method = self.getMethod()\n if not a_method:\n ...
codesearchnet
{ "query": "Represent the Github post about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
Yield model reaction limits as YAML dicts.
[ "def model_reaction_limits(model):\n \"\"\"\"\"\"\n for reaction in sorted(model.reactions, key=lambda r: r.id):\n equation = reaction.properties.get('equation')\n if equation is None:\n continue\n\n # Determine the default flux limits. If the value is already at the\n #...
[ "def _get_generic_schema(self):\n \n schema = Schema(\n vid=ID(stored=True, unique=True), # Object id\n title=NGRAMWORDS(),\n keywords=KEYWORD, # Lists of coverage identifiers, ISO time values and GVIDs, source names, source abbrev\n doc=TEXT) # Generated...
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Helper function to determine if scalar or array value is finite extending np.isfinite with support for None, string, datetime types.
[ "def isfinite(val):\n \n if not np.isscalar(val):\n val = asarray(val, strict=False)\n\n if val is None:\n return False\n elif isinstance(val, np.ndarray):\n if val.dtype.kind == 'M':\n return ~isnat(val)\n elif val.dtype.kind == 'O':\n return np.array([...
[ "def _choose_float_dtype(dtype, has_offset):\n \"\"\"\"\"\"\n # Keep float32 as-is. Upcast half-precision to single-precision,\n # because float16 is \"intended for storage but not computation\"\n if dtype.itemsize <= 4 and np.issubdtype(dtype, np.floating):\n return np.float32\n # float32 ca...
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code about text processing:" }
Parameters: - new_index - index_table
[ "def add_index(self, new_index, index_table):\n \n self.send_add_index(new_index, index_table)\n return self.recv_add_index()" ]
[ "def feed(self, data):\n \n \"\"\"\n self.rawdata = self.rawdata + data\n self.goahead(0)" ]
codesearchnet
{ "query": "Represent the Github text about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Data processing:" }
Get file as content. @param string $file with content @return string as content of the file @throws Exception when file does not exist
[ "public function get($file)\n {\n $basepath = $this->config['basepath'];\n $suffix = $this->config['suffix'];\n $target = \"$basepath/$file{$suffix}\";\n\n if (!is_readable($target)) {\n throw new \\Exception(t(\"No such file content: @FILENAME\", [\"@FILENAME\" => $target]...
[ "public function getTemplateFile($filename, $data)\n {\n $data['getRegion'] = function($name) { \n return $this->getRegion($name); \n }; // This is for mustache compatibility\n\n // Push the data into regions and then pass a pointer to this class to the layout\n // $thi...
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:" }
Decorate the service object if DecorateExtension loaded @param object $service @return self @throws LogicException if something goes wrong @access protected
[ "protected function decorateService($service)\n {\n $extName = DecorateExtension::EXTENSION_CLASS;\n\n // decorate extension loaded\n if ($this->hasExtension($extName)) {\n /* @var $ext DecorateExtension */\n $ext = $this->getExtension($extName);\n $ext->deco...
[ "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 iAuthenticator)\n throw new exContainerInvalidServiceType('Invalid Plugin...
codesearchnet
{ "query": "Represent the Github text about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
Set the install directory. @param string $dir @return bool
[ "public function setInstallDir($dir)\n {\n $dir = $this->addTrailingSlash($dir);\n\n if (!is_dir($dir)) {\n $this->log->addDebug(sprintf('Creating new install directory \"%s\"', $dir));\n\n if (!mkdir($dir, 0755, true)) {\n $this->log->addCritical(sprintf('Could...
[ "private function cmdGenerate()\n {\n //check if path exists\n if (!is_dir($this->configKeyPath)) {\n Main::copyDirectoryContents(dirname(__DIR__).'/Config/Devbr/Key', $this->configKeyPath);\n }\n //Now, OPEN_SSL\n $this->createKeys();\n return \"\\n Can, Ope...
codesearchnet
{ "query": "Represent the instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Now that working transport is determined, associates it with the socket.
[ "function init(trans) {\n // Assign `trans` to `transport` which is associated with the\n // socket.\n transport = trans;\n // When the transport has received a message from the server.\n transport.on(\"text\", function(text) {\n // Converts JSON...
[ "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 comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
indexed getter for probability - gets an indexed value - @generated @param i index in the array to get @return value of the element at index i
[ "public double getProbability(int i) {\n if (TopicDistribution_Type.featOkTst && ((TopicDistribution_Type)jcasType).casFeat_probability == null)\n jcasType.jcas.throwFeatMissing(\"probability\", \"ch.epfl.bbp.uima.types.TopicDistribution\");\n jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getRefValue...
[ "function(c, i, array) {\n if (c === undefined || c === null) return;\n // c is the component, type is dimension|attribute,\n // level is dataset|series|observation, i is index,\n // array is the component array\n failed += !iterator.call(context, c, type, level, i, array);\n }" ]
codesearchnet
{ "query": "Represent the text about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
退货交易、撤销交易 @param reqData 请求参数 @return {String}
[ "@Deprecated\n\tpublic static String refund(Map<String, String> reqData) {\n\t\treturn HttpUtils.post(SDKConfig.getConfig().getBackRequestUrl(), reqData);\n\t}" ]
[ "public static String getTransferQueue(String name) {\n LOG.debug(\"对于需要保序的情况,只应该启动单个中转节点,目前启动多个节点原节点会被挤掉线,但是由于重连机制,会轮着挤掉线\");\n return IdManager.generateStaticQueueId(buildTransferName(name));\n }" ]
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
This method returns the realization of the process at a certain time index. @param timeIndex Time index at which the process should be observed @param componentIndex Component of the process vector @return A vector of process realizations (on path)
[ "public RandomVariable getProcessValue(int timeIndex, int componentIndex)\n\t{\n\t\tif(timeIndex == 0) {\n\t\t\treturn getInitialValue()[componentIndex];\n\t\t}\n\n\t\t// Lazy initialization, synchronized for thread safety\n\t\tsynchronized(this) {\n\t\t\tif(discreteProcess == null || discreteProcess.length == 0) {...
[ "def enkf(self):\n \n\n for cycle_index, time_point in enumerate(self.timeline):\n if cycle_index >= len(self.timeline) - 1:\n # Logging : Last Update cycle has finished\n break\n\n print(\"Print information about this assimilation Cycle ???\") # sh...
codesearchnet
{ "query": "Represent the summarization about Deep Learning:", "pos": "Represent the code about Deep Learning:", "neg": "Represent the code:" }
Returns the parameters to execute this query. @return array
[ "public function getQueryData(): array\n {\n return \\array_merge($this->whereConditions, [\n 'limit' => $this->limit,\n 'skip' => $this->skip,\n 'content_type' => $this->contentType,\n 'mimetype_group' => $this->mimeTypeGroup,\n 'order' => $this->ord...
[ "@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 instruction about database:", "pos": "Represent the code about database:", "neg": "Represent the code about Programming:" }
Validates if a string is valid as a sitemap priority @link http://www.sitemaps.org/protocol.php#prioritydef <priority> @param string $value value to validate @return boolean
[ "public function isValid($value)\n {\n $this->_setValue($value);\n\n if (!is_numeric($value)) {\n return false;\n }\n\n $value = (float)$value;\n return $value >= 0 && $value <= 1;\n }" ]
[ "def validate\n xsd = Nokogiri::XML::Schema(File.read(SCHEMA_FILE))\n out = \"\"\n xsd.validate(@report).each do |error|\n out << error.message unless error.message == \"Element 'algorithm', attribute 'publication_ref': '' is not a valid value of the atomic type 'xs:IDREF'.\" || error.message ...
codesearchnet
{ "query": "Represent the comment about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
Install required components into supported hosts An unsupported host will still run, but may encounter issues, especially with threading.
[ "def install_host(use_threaded_wrapper):\n \n\n for install in (_install_maya,\n _install_houdini,\n _install_nuke,\n _install_nukeassist,\n _install_hiero,\n _install_nukestudio,\n _install_blend...
[ "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 sentence:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
// Validate inspects the fields of the type to determine if they are valid.
[ "func (s *CreateDeliverabilityTestReportInput) Validate() error {\n\tinvalidParams := request.ErrInvalidParams{Context: \"CreateDeliverabilityTestReportInput\"}\n\tif s.Content == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"Content\"))\n\t}\n\tif s.FromEmailAddress == nil {\n\t\tinvalidParams.Add(req...
[ "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 sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Adds the pair $userAgent, $deviceID to the clusters they belong to. @param String $userAgent @param String $deviceID @see WURFL_Handlers_Handler::filter()
[ "public function filter($userAgent, $deviceID) {\n\t\tWURFL_Handlers_Utils::reset();\n\t\t$this->_userAgentHandlers[0]->filter($userAgent, $deviceID);\n\t}" ]
[ "public List<Audit> getAllNotifications(JPAEntity entity) {\n\t\treturn _auditService.findByEntityHostnameMessage(entity.getId(), null, \"Triggering event value:\");\n\t}" ]
codesearchnet
{ "query": "Represent the Github text about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Documentation:" }
Given a symm matrix S that stores just its subdiagonal elements, reconstructs the full symmetric matrix. @FIXME: evitare il doppio setQuick
[ "public static final DoubleMatrix2D fillSubdiagonalSymmetricMatrix(DoubleMatrix2D S){\r\n\r\n\t\tif(S.rows() != S.columns()){\r\n\t\t\tthrow new IllegalArgumentException(\"Not square matrix\");\r\n\t\t}\r\n\r\n\t\tboolean isSparse = S instanceof SparseDoubleMatrix2D;\r\n\t\tDoubleFactory2D F2D = (isSparse)? DoubleF...
[ "def deriv(self, mu):\n \n from statsmodels.tools.numdiff import approx_fprime_cs, approx_fprime\n # return approx_fprime_cs(mu, self) # TODO fix breaks in `fabs\n # TODO: diag is workaround problem with numdiff for 1d\n return np.diag(approx_fprime(mu, self))" ]
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Determine if this path's name contains a substring. @param string $needle The substring to search for. @param boolean|null $caseSensitive True if case sensitive. @return boolean True if this path's name contains the substring.
[ "public function nameContains($needle, $caseSensitive = null)\n {\n if ('' === $needle) {\n return true;\n }\n if (null === $caseSensitive) {\n $caseSensitive = false;\n }\n\n if ($caseSensitive) {\n return false !== mb_strpos($this->name(), $ne...
[ "function Pointer ($ref, path, friendlyPath) {\n /**\n * The {@link $Ref} object that contains this {@link Pointer} object.\n * @type {$Ref}\n */\n this.$ref = $ref;\n\n /**\n * The file path or URL, containing the JSON pointer in the hash.\n * This path is relative to the path of the main JSON schema ...
codesearchnet
{ "query": "Represent the text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Programming:" }
This method has to be module level function :type params: Params
[ "def spawn_worker(params):\n \n setup_logging(params)\n log.info(\"Adding worker: idx=%s\\tconcurrency=%s\\tresults=%s\", params.worker_index, params.concurrency,\n params.report)\n worker = Worker(params)\n worker.start()\n worker.join()" ]
[ "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:" }
Determines if the supplied token digests to the stored digest in the user model.
[ "def authenticated?(attribute, token)\n return false unless respond_to?(\"#{attribute}_digest\")\n digest = send(\"#{attribute}_digest\")\n return false if digest.blank?\n BCrypt::Password.new(digest).is_password?(token)\n end" ]
[ "def delete_node_storage(node)\n return if node == BLANK_NODE\n raise ArgumentError, \"node must be Array or BLANK_NODE\" unless node.instance_of?(Array)\n\n encoded = encode_node node\n return if encoded.size < 32\n\n # FIXME: in current trie implementation two nodes can share identical\n ...
codesearchnet
{ "query": "Represent the Github text about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code about Software development:" }
Calculate a hedged value. <p> @param value is the value @return the hedged value
[ "public double calculateValue(double value) {\n\t\tJexlContext context = new MapContext();\n\t\tcontext.set(getArg(), value);\n\t\treturn (double) expression.evaluate(context);\n\t}" ]
[ "def __create_price_for(self, commodity: Commodity, price: PriceModel):\n \n logging.info(\"Adding a new price for %s, %s, %s\",\n commodity.mnemonic, price.datetime.strftime(\"%Y-%m-%d\"), price.value)\n\n # safety check. Compare currencies.\n sec_svc = SecurityAggre...
codesearchnet
{ "query": "Represent the Github post about invoice calculation:", "pos": "Represent the Github code about invoice calculation:", "neg": "Represent the Github code:" }
Obtains configured filter @return \eMapper\SQL\Predicate\SQLPredicate
[ "protected function getFilter() {\n\t\t$filter = $this->getOption('query.filter');\n\t\t$negate = false;\n\t\tif ($this->hasOption('query.negate'))\n\t\t\t$negate = (bool) $this->getOption('query.negate');\n\t\tif (is_array($filter))\n\t\t\treturn new Filter($filter, $negate);\n\t\treturn new Filter([$filter], $neg...
[ "protected List<List<Row<I>>> incorporateCounterExample(DefaultQuery<I, D> ce) {\n return ObservationTableCEXHandlers.handleClassicLStar(ce, table, oracle);\n }" ]
codesearchnet
{ "query": "Represent the Github text about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code:" }
Load libary by searching possible path.
[ "def _load_lib():\n \"\"\"\"\"\"\n lib_path = _find_lib_path()\n lib = ctypes.cdll.LoadLibrary(lib_path[0])\n # DMatrix functions\n lib.MXGetLastError.restype = ctypes.c_char_p\n return lib" ]
[ "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:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Parse a XML dictionary entry.
[ "def parse_plist(entry):\n \"\"\"\"\"\"\n if is_leaf(entry):\n url = entry[KEY_URLSTRING]\n title = entry[KEY_URIDICTIONARY].get('title', url)\n yield (url, title)\n elif has_children(entry):\n for child in entry[KEY_CHILDREN]:\n for item in parse_plist(child):\n ...
[ "def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p" ]
codesearchnet
{ "query": "Represent the Github text about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
// All the IDs corresponding to the given value
[ "func (idx *ListIndex) All(value []byte, opts *Options) ([][]byte, error) {\n\tvar list [][]byte\n\tc := idx.IndexBucket.Cursor()\n\tcur := internal.Cursor{C: c, Reverse: opts != nil && opts.Reverse}\n\n\tprefix := generatePrefix(value)\n\n\tk, id := c.Seek(prefix)\n\tif cur.Reverse {\n\t\tvar count int\n\t\tkc := ...
[ "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 summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Erzeugt HTML Box for Hover über HTML-Elementen. @access public @static @param string $html HTML of linked Element @param string $text Text within HelpHover @param string $class CSS Class of HelpHover
[ "public static function HelpHover( $html, $text, $class = 'helptext' )\r\n\t{\r\n\t\t$id\t= uniqid( \"hhItem\" );\r\n\t\t$code\t= \"<span class=\\\"hover\\\" id=\\\"\".$id.\"\\\">\".$html.\"</span><div class=\\\"\".$class.\"\\\" id=\\\"\".$id.\"Help\\\">\".$text.\"</div>\";\r\n\t\treturn $code;\r\n\t}" ]
[ "public function render($renderer)\n {\n $renderer->setCurrentStyle('footnotenum');\n $renderer->Write($renderer->getCurrentStyleHeight(), $this->numText, $this->addlink); //source link numbers after name\n }" ]
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
// UpsertSchema upserts the schema through RPC
[ "func (c *Connector) UpsertSchema(ctx context.Context, scope, namePrefix string, eds []*dosa.EntityDefinition) (*dosa.SchemaStatus, error) {\n\trpcEds := EntityDefsToThrift(eds)\n\trequest := &dosarpc.UpsertSchemaRequest{\n\t\tScope: &scope,\n\t\tNamePrefix: &namePrefix,\n\t\tEntityDefs: rpcEds,\n\t}\n\n\tresp...
[ "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 text about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
Checks that all routes are validate and have corresponding lambda functions
[ "def check_route_connected_functions\n return if Jets::Router.all_routes_valid\n\n puts \"Deploy fail: The jets application contain invalid routes.\".color(:red)\n puts \"Please double check the routes below map to valid controllers:\"\n Jets::Router.invalid_routes.each do |route|\n puts ...
[ "func (r *controller) Update(ctx context.Context, t *api.Task) error {\n\t// TODO(stevvooe): While assignment of tasks is idempotent, we do allow\n\t// updates of metadata, such as labelling, as well as any other properties\n\t// that make sense.\n\treturn nil\n}" ]
codesearchnet
{ "query": "Represent the Github comment about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Software development:" }
Get the class name in the table caption and the table header. @param classStr the class name to print. @return the table caption and header
[ "protected Content getClassName(Content classStr) {\n Content table = HtmlTree.TABLE(HtmlStyle.constantsSummary, 0, 3, 0, constantsTableSummary,\n getTableCaption(classStr));\n table.addContent(getSummaryTableHeader(constantsTableHeader, \"col\"));\n return table;\n }" ]
[ "function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co...
codesearchnet
{ "query": "Represent the description about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
Dry Bulb Temperature (C) and humidity_ratio at at wet_bulb (C), rel_humid (%) and Pressure b_press (Pa). Formula is only valid for rel_humid == 0 or rel_humid == 100.
[ "def db_temp_from_wb_rh(wet_bulb, rel_humid, b_press=101325):\n \n assert rel_humid == 0 or rel_humid == 100, 'formula is only valid for' \\\n ' rel_humid == 0 or rel_humid == 100'\n humidity_ratio = humid_ratio_from_db_rh(wet_bulb, rel_humid, b_press)\n hr_saturation = humid_ratio_from_db_rh(wet...
[ "def _compute_focal_depth_term(self, C, hypo_depth):\n \n # p. 901. \"(i.e, depth is capped at 125 km)\".\n focal_depth = hypo_depth\n if focal_depth > 125.0:\n focal_depth = 125.0\n\n # p. 902. \"We used the value of 15 km for the\n # depth coefficient hc ...\"....
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code:" }
Assert that two values are equal (using == ). @param mixed $value @param mixed $value2 @param string $message @param string $propertyPath @return void @throws Exception
[ "static public function eq($value, $value2, $message = null, $propertyPath = null)\n {\n if ($value != $value2) {\n $message = $message ?: sprintf(\n 'Value \"%s\" does not equal expected value \"%s\".',\n static::stringify($value),\n ...
[ "public function setMustPass($ref)\n {\n if (null!==$this->getMask($ref)) {\n $this->must_pass = $ref;\n } else {\n throw new \\Exception(sprintf(\"Unknown standard [%s] in Hostname validation!\", $ref));\n }\n }" ]
codesearchnet
{ "query": "Represent the comment about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Software development:" }
// See: http://duktape.org/api.html#duk_resize_buffer
[ "func (d *Context) ResizeBuffer(index int, newSize int) unsafe.Pointer {\n\treturn C.duk_resize_buffer(d.duk_context, C.duk_idx_t(index), C.duk_size_t(newSize))\n}" ]
[ "func NewWithFlags(flags *Flags) *Context {\n\td := &Context{\n\t\t&context{\n\t\t\tduk_context: C.duk_create_heap(nil, nil, nil, nil, nil),\n\t\t\tfnIndex: newFunctionIndex(),\n\t\t\ttimerIndex: &timerIndex{},\n\t\t},\n\t}\n\n\tctx := d.duk_context\n\tC.duk_logging_init(ctx, C.duk_uint_t(flags.Logging))\n\tC....
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
getFieldType Return the type associated with the given field. @access public @param string $name @throws ModelException if $name is null or field does not exist @return string null if type is not set
[ "public function getFieldType($name)\n {\n return $this->checkFieldExist($name)->types[$name] != null\n ? rtrim($this->types[$name], '[]')\n : null;\n }" ]
[ "public function get($key, $default = null)\n {\n $this->hydrate();\n\n // Create an Element instance using the data for the key\n if ($this->has($key)) {\n return new $this->model(array_merge($this->items[$key], ['key' => $key]));\n }\n\n // If the key doesn't exist...
codesearchnet
{ "query": "Represent the post about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Programming:" }
This is the entry point method.
[ "public void onModuleLoad() {\n\t\tDockPanel dock = new DockPanel();\n\t\tdock.addStyleName(\"mainBackground\");\n\t\tdock.setWidth(\"700px\");\n\t\tdock.setHeight(\"300px\");\n\t\tdock.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);\n\t\tdock.setVerticalAlignment(HasVerticalAlignment.ALIGN_TOP);\n\n\t...
[ "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 post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
Use this API when you have permission to have your call act as the end client's ID. Your calls will get 403 errors if you do not have this permission. it is a special setup, rarely given. @param apiVersion @param req @return @throws CadiException
[ "public Rcli<CLIENT> clientAs(String apiVersion, ServletRequest req) throws CadiException {\n\t\tRcli<CLIENT> cl = client(apiVersion);\n\t\treturn cl.forUser(transferSS(((HttpServletRequest)req).getUserPrincipal()));\n\t}" ]
[ "def create(self, **kwargs):\n \n raise exceptions.MethodNotImplemented(method=self.create, url=self.url, details='GUID cannot be duplicated, to create a new GUID use the relationship resource')" ]
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code about Natural Language Processing:" }
Handles a request for a PDF thumbnail.<p> @param cms the current CMS context @param request the servlet request @param response the servlet response @param uri the current uri @throws Exception if something goes wrong
[ "private void handleThumbnailLink(\n CmsObject cms,\n HttpServletRequest request,\n HttpServletResponse response,\n String uri)\n throws Exception {\n\n String options = request.getParameter(CmsPdfThumbnailLink.PARAM_OPTIONS);\n if (CmsStringUtil.isEmptyOrWhitespaceOnly(...
[ "public void reinitialize( HttpServletRequest request, HttpServletResponse response, ServletContext servletContext )\n {\n //\n // Cache the associated ModuleConfig. This is used throughout the code, in places where the request\n // isn't available to do a lazy initialization.\n //\n...
codesearchnet
{ "query": "Represent the comment about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Check that the given {@code paramValue} matches the static type of {@code param}.
[ "private void checkStrictParamType(\n final TemplateNode node, final TemplateParam param, @Nullable SoyValueProvider paramValue) {\n Kind kind = param.type().getKind();\n if (kind == Kind.ANY || kind == Kind.UNKNOWN) {\n // Nothing to check. ANY and UKNOWN match all types.\n return;\n }\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 Github sentence about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Software development:" }
// Fetch queries a whois server and returns a Response.
[ "func Fetch(query string) (*Response, error) {\n\treq, err := NewRequest(query)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn DefaultClient.Fetch(req)\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 comment about Computer Science:", "pos": "Represent the code about Computer Science:", "neg": "Represent the code about programming:" }
Note: There is an assumption here...and it is that the argument's length >= 4
[ "function _singularize($tables)\n\t{\n\n\t\tif (!ADODB_Active_Record::$_changeNames) {\n\t\t\treturn $table;\n\t\t}\n\n\t\t$ut = strtoupper($tables);\n\t\t$len = strlen($tables);\n\t\tif($ut[$len-1] != 'S') {\n\t\t\treturn $tables; // I know...forget oxen\n\t\t}\n\t\tif($ut[$len-2] != 'E') {\n\t\t\treturn substr($t...
[ "def _calculate_index_of_coincidence(frequency_map, length):\n \n if length <= 1:\n return 0\n # We cannot error here as length can legitimiately be 1.\n # Imagine a ciphertext of length 3 and a key of length 2.\n # Spliting this text up and calculating the index of coincidence res...
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
设置生存时长 @param string $key key @param int $seconds 生存时长(单位:秒) @return mixed
[ "public function expire($key, $seconds) {\n return $this->getHandler($this->judge(__FUNCTION__))->expire($key, $seconds);\n }" ]
[ "protected boolean isVirtualDns(Host host) {\n\t\tlong millis = host.getExpiration() - System.currentTimeMillis();\n\t\t// JVM的DNS缓存默认是30秒过期,如果过期时间大于1年则表示自定义的域名解析记录\n\t\t// 在要求特别准确的情况下请注意:如果自定义了JVM DNS缓存时间超过1年,则会返回错误数据.\n\t\treturn (millis > ABOUT_YEAR);\n\t}" ]
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Programming:" }
// Convert_v1_RoleList_To_authorization_RoleList is an autogenerated conversion function.
[ "func Convert_v1_RoleList_To_authorization_RoleList(in *v1.RoleList, out *authorization.RoleList, s conversion.Scope) error {\n\treturn autoConvert_v1_RoleList_To_authorization_RoleList(in, out, s)\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 post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Removes the specified keys. A key is ignored if it does not exist.
[ "function del(/* key-1, key-N, req */) {\n var args = slice.call(arguments, 0)\n , req = typeof args[args.length-1] === 'object' ? args.pop() : null;\n var deleted = 0;\n for(var i = 0;i < args.length;i++) {\n if(this.keyExists(args[i])) {\n this.delKey(args[i], req);\n deleted++;\n }\n }\n ...
[ "function DataModelMigration() {\n /**\n * Gets an array that contains the definition of fields that are going to be added\n * @type {Array}\n */\n this.add = [];\n /**\n * Gets an array that contains a collection of constraints which are going to be added\n * @type {Array}\n */\n ...
codesearchnet
{ "query": "Represent the Github description about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code:" }
/* Чистим сессиии и куки
[ "public function removeData()\n {\n $cookies = \\Yii::$app->response->cookies;\n\n \\Yii::$app->session->remove($this->timezoneSessionKey);\n $cookies->remove($this->timezoneCookieName);\n\n \\Yii::$app->session->remove($this->citySessionKey);\n $cookies->remove($this->cityCook...
[ "private function processA(array $result) {\n\t\ttry {\n\t\t\t$result = $this->processI($result);\n\t\t}\n\t\t/**\n\t\t * 2016-08-02\n\t\t * Исключительная ситуация может быть не только типа @see \\Df\\Core\\Exception,\n\t\t * но и типа @see \\Exception,\n\t\t * потому что чтение некорректных данных может приводить...
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Programming:" }
Создает DOMElement - эквивалентный состоянию дескриптора @param DOMDocument $dom @return DOMElement|null @throws InvalidDescriptorException @throws InvalidWriteWorkflowException
[ "public function writeXml(DOMDocument $dom = null)\n {\n if (null === $dom) {\n $errMsg = 'Не передан DOMDocument';\n throw new InvalidWriteWorkflowException($errMsg);\n }\n $descriptor = $dom->createElement('step');\n\n if (!$this->hasId()) {\n $errMs...
[ "private function nameFull() {return dfc($this, function() {return\n\t\t$this->isTop()\n\t\t? df_trim_text_right($this->getName(), '[value]')\n\t\t// Анонимные филдсеты не добавляют своё имя в качестве префикса имён полей.\n\t\t: (!$this->_anonymous ? $this->getId() : $this->_parent->nameFull())\n\t;});}" ]
codesearchnet
{ "query": "Represent the description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
get asset version content using pg large object streams :param bool force: False by default, forces get content from database instead of using cached value :rtype: str :return: content in raw format
[ "def get_blob_data(self, tag_target='asset', force=False):\n \n if hasattr(self, '_blob_data') and not force:\n return self._blob_data\n\n if six.PY2:\n self._blob_data = six.binary_type('')\n elif six.PY3:\n self._blob_data = six.binary_type('', encoding...
[ "def from_bucket(cls, connection, bucket):\n \"\"\"\"\"\"\n if bucket is None:\n raise errors.NoContainerException\n\n # It appears that Amazon does not have a single-shot REST query to\n # determine the number of keys / overall byte size of a bucket.\n return cls(conne...
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code about AWS S3:" }
Selects a subset of `points` to preserve graph structure while minimizing the number of points used, by removing points within `close_distance`. Returns the downsampled indices.
[ "def epsilon_net(points, close_distance):\n ''''''\n num_points = points.shape[0]\n indices = set(range(num_points))\n selected = []\n while indices:\n idx = indices.pop()\n nn_inds, = nearest_neighbors(points[idx], points, epsilon=close_distance)\n indices.difference_update(nn_inds)\n selected.app...
[ "def _check_graph(self, graph):\n \"\"\"\"\"\"\n if graph.num_vertices != self.size:\n raise TypeError(\"The number of vertices in the graph does not \"\n \"match the length of the atomic numbers array.\")\n # In practice these are typically the same arrays using the s...
codesearchnet
{ "query": "Represent the comment about Computer Science:", "pos": "Represent the code about Computer Science:", "neg": "Represent the code:" }
Recursively finds events defined by the given type and its implemented interfaces. @param type the type for which to find events @return the events defined by the given type and its parent interfaces
[ "private static Map<Method, EventType> findMethods(Class<?> type) {\n Map<Method, EventType> events = new HashMap<>();\n for (Method method : type.getDeclaredMethods()) {\n Event event = method.getAnnotation(Event.class);\n if (event != null) {\n String name = event.value().equals(\"\") ? met...
[ "def reset ():\n \n global __prefixes_suffixes, __suffixes_to_types, __types, __rule_names_to_types, __target_suffixes_cache\n\n __register_features ()\n\n # Stores suffixes for generated targets.\n __prefixes_suffixes = [property.PropertyMap(), property.PropertyMap()]\n\n # Maps suffixes to types...
codesearchnet
{ "query": "Represent the Github comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
// SubscribeUnbuffered does the same as Subscribe, except it returns a // subscription with unbuffered channel. Use with caution as it can freeze the // server.
[ "func (s *Server) SubscribeUnbuffered(ctx context.Context, clientID string, query Query) (*Subscription, error) {\n\treturn s.subscribe(ctx, clientID, query, 0)\n}" ]
[ "void offerData(byte[] chunk) {\n if (chunk == null || chunk.length == 0) {\n throw new IllegalArgumentException(\"chunk must have at least one byte of data\");\n }\n\n if (closed) {\n return;\n }\n\n // Since this is an unbounded queue, offer() always succeeds. In addition, we don't make a...
codesearchnet
{ "query": "Represent the Github sentence about Messaging:", "pos": "Represent the Github code about Messaging:", "neg": "Represent the Github code:" }
// SetBody sets the Body optional argument. A response body.
[ "func (a *FulfillRequestArgs) SetBody(body string) *FulfillRequestArgs {\n\ta.Body = &body\n\treturn a\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 Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
/* Scalar type extensions have the potential to be invalid if incorrectly defined. The named type must already be defined and must be a Scalar type. Any directives provided must not already apply to the original Scalar type.
[ "private void checkScalarTypeExtensions(List<GraphQLError> errors, TypeDefinitionRegistry typeRegistry) {\n typeRegistry.scalarTypeExtensions()\n .forEach((name, extensions) -> {\n checkTypeExtensionHasCorrespondingType(errors, typeRegistry, name, extensions, ScalarTypeDefin...
[ "NameAndType nameType(Symbol sym) {\n return new NameAndType(fieldName(sym),\n retrofit\n ? sym.erasure(types)\n : sym.externalType(types), types);\n // if we retrofit, then the NameAndType has been read in as is...
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
/* jshint maxparams: 5
[ "function RingpopClient(ringpop, subChannel, timers, date, middlewares) {\n this.ringpop = ringpop;\n this.subChannel = subChannel;\n this.timers = timers || globalTimers;\n this.date = date || Date;\n this.middlewares = middlewares || [];\n\n this.config = this.ringpop.config;\n this.logger = ...
[ "function (v) {\n if (typeof v === \"number\")\n return 1;\n if (typeof v === \"string\")\n return 2;\n if (typeof v === \"boolean\")\n return 8;\n if (isArray(v))\n return 4;\n if (v === null)\n return 10;\n if (_.isRegExp(v))\n // note that typeof(/x/) === \"object\...
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code:" }
@author Vova Feldman (@svovaf) @since 1.0.5 @param bool|null $is_localhost @return FS_Plugin_License[]
[ "function get_available_premium_licenses( $is_localhost = null ) {\r\n $this->_logger->entrance();\r\n\r\n $licenses = array();\r\n if ( ! $this->has_paid_plan() ) {\r\n return $licenses;\r\n }\r\n\r\n if ( is_array( $this->_licenses ) ) {\r\n ...
[ "public function logBanner($additions = null)\n {\n $this->addStatusMessage('FlexiBee '.str_replace('://',\n '://'.$this->user.'@', $this->getApiUrl()).' FlexiPeeHP v'.self::$libVersion.' (FlexiBee '.EvidenceList::$version.') EasePHP Framework v'.\\Ease\\Atom::$frameworkVersion.' '.$additio...
codesearchnet
{ "query": "Represent the text about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
Download a user\'s playlists by id.
[ "def user(netease, name, id):\n \"\"\"\"\"\"\n if name:\n netease.download_user_playlists_by_search(name)\n\n if id:\n netease.download_user_playlists_by_id(id)" ]
[ "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 instruction:", "pos": "Represent the code:", "neg": "Represent the code:" }
Return disk size in bytes
[ "def _get_image_size(self, image_path):\n \"\"\"\"\"\"\n command = 'du -b %s' % image_path\n (rc, output) = zvmutils.execute(command)\n if rc:\n msg = (\"Error happened when executing command du -b with\"\n \"reason: %s\" % output)\n LOG.error(msg)...
[ "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:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Saves TransitSignal. Calls :func:`TransitSignal.save`; default filename is ``trsig.pkl`` in ``self.folder``.
[ "def save_signal(self,filename=None):\n \n if filename is None:\n filename = os.path.join(self.folder,'trsig.pkl')\n self.trsig.save(filename)" ]
[ "def on_all_ok(self):\n \n # Merge DDB files.\n out_ddb = self.merge_ddb_files()\n return self.Results(node=self, returncode=0, message=\"DDB merge done\")" ]
codesearchnet
{ "query": "Represent the comment about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
Stop the timer without executing the callback.
[ "def cancel(self):\n \"\"\"\"\"\"\n self._cancelled.set()\n if not self._dead:\n self._ready_sem.acquire()\n self._ready_sem.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 instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
/* (non-Javadoc) @see javax.sip.SipListener#processTransactionTerminated(javax.sip.TransactionTerminatedEvent)
[ "public void processTransactionTerminated(\n TransactionTerminatedEvent transactionTerminatedEvent) {\n Transaction transaction = null;\n if(transactionTerminatedEvent.isServerTransaction()) {\n transaction = transactionTerminatedEvent.getServerTransaction();\n if(logg...
[ "public void initMediaConnection(SipServletRequest request) throws IOException {\n\t\tlog.info(\"initiating media connection\");\n\t\tsipServletResponse = request.createResponse(SipServletResponse.SC_OK);\n\t\tfireEvent(\n\t\t\t\tnull, \n\t\t\t\t(byte[])request.getContent(), \n\t\t\t\t\"org.mobicents.slee.service.i...
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Authenticates to the Tor server. Autodetect authentication method if not set in options @throws \Exception @return \TorControl\TorControl
[ "public function authenticate()\n {\n if (static::AUTH_METHOD_NOT_SET === $this->options['authmethod']) {\n $this->detectAuthMethod();\n }\n\n switch ($this->options['authmethod']) {\n case static::AUTH_METHOD_NULL:\n $this->executeCommand('AUTHENTICATE')...
[ "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 sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Programming:" }
set scripts for the current HTML page
[ "public static function setScripts(array $scripts, bool $replace_existing=false) :void {\n\t\t// if we want to purge existing scripts\n\t\t!$replace_existing ?: self::$_scripts = [];\n\t\t// for each script we have to set\n\t\tforeach($scripts as $script) {\n\t\t\t// rewrite its path\n\t\t\tself::$_scripts[] = self...
[ "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 comment:", "pos": "Represent the code:", "neg": "Represent the code about Technology:" }
比较两个字段 @access public @param string|array $field1 查询字段 @param string $operator 比较操作符 @param string $field2 比较字段 @param string $logic 查询逻辑 and or xor @return $this
[ "public function whereColumn($field1, $operator, $field2 = null, $logic = 'AND')\n {\n if (is_array($field1)) {\n foreach ($field1 as $item) {\n $this->whereColumn($item[0], $item[1], isset($item[2]) ? $item[2] : null);\n }\n return $this;\n }\n\n ...
[ "public function select($field = null, $where = null, $order = null, $limit = null)\n {\n //如果未提供条件/排序/分页参数\n if (!$where and !$order and !$limit) {\n //并且未提供字段参数,则表明是之前已经提供,现在要真正执行\n if (!$field) {\n return $this->go();\n }\n\n //只提供了字段, 并...
codesearchnet
{ "query": "Represent the Github sentence about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
Store the city that will be queried against. >>> three.city('sf')
[ "def city(name=None):\n \n info = find_info(name)\n os.environ['OPEN311_CITY_INFO'] = dumps(info)\n return Three(**info)" ]
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Return the contents of a file when given a path.
[ "def file_to_string(path):\n \n if not os.path.exists(path):\n ui.error(c.MESSAGES[\"path_missing\"], path)\n sys.exit(1)\n\n with codecs.open(path, \"r\", \"UTF-8\") as contents:\n return contents.read()" ]
[ "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 post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
// readStringN reads a string of a given length
[ "func (r *reader) readStringN(n uint32) string {\n\treturn string(r.readBytes(n))\n}" ]
[ "function onChunk(count) {\n // If chunk read has no bytes than there is nothing left, so end a\n // collection.\n if (count === 0) return next(end)\n\n // Move a offset `position` with `count` towards the end unless\n // position was a `null` in which case we just keep it (`null` means\n ...
codesearchnet
{ "query": "Represent the comment about 32-bit integers:", "pos": "Represent the code about 32-bit integers:", "neg": "Represent the code about File management:" }
/* CONNECTION METHODS
[ "public function connect() {\n\t\tif ($this->connection instanceof \\SQLite3)\n\t\t\treturn $this->connection;\n\t\n\t\ttry {\n\t\t\t$this->connection = empty($this->config['encription_key']) ? new \\SQLite3($this->config['filename'], $this->config['flags']) : new \\SQLite3($this->config['filename'], $this->config[...
[ "public static function get_supported_features(array $configuration = array()) {\n return self::SUPPORTS_DATA_GUARANTEE +\n self::SUPPORTS_NATIVE_TTL +\n self::IS_SEARCHABLE +\n self::SUPPORTS_MULTIPLE_IDENTIFIERS +\n self::DEREFERENCES_OBJECTS;\n }"...
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Return True if the arrow is in a chemical name.
[ "def _is_saccharide_arrow(self, before, after):\n \"\"\"\"\"\"\n if (before and after and before[-1].isdigit() and after[0].isdigit() and\n before.rstrip('0123456789').endswith('(') and after.lstrip('0123456789').startswith(')-')):\n return True\n else:\n return...
[ "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 description:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
DeleteProcessById. [Preview API] Removes a process of a specific ID. :param str process_type_id:
[ "def delete_process_by_id(self, process_type_id):\n \n route_values = {}\n if process_type_id is not None:\n route_values['processTypeId'] = self._serialize.url('process_type_id', process_type_id, 'str')\n self._send(http_method='DELETE',\n location_id='02cc6...
[ "def Call(self, Id=0):\n \n o = Call(self, Id)\n o.Status # Test if such a call exists.\n return o" ]
codesearchnet
{ "query": "Represent the Github post about Work management:", "pos": "Represent the Github code about Work management:", "neg": "Represent the Github code about programming:" }
// Read implements the Conn interface.
[ "func (c *conn) Read() (pdu.Body, error) {\n\treturn pdu.Decode(c.r)\n}" ]
[ "@Override\n public void init(TCPWriteRequestContext x, H2MuxTCPWriteCallback c) {\n writeReqContext = x;\n muxCallback = c;\n\n // callback will need to know how to get back to this write queue.\n // This means one and only one H2WriteTree per H2InboundLink which has just one true TC...
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Store or calculate char_offsets, adding the offset of the doc end
[ "def _get_char_offsets(self, char_offsets):\n \"\"\"\"\"\"\n if char_offsets:\n char_offsets = char_offsets\n char_offsets.append(len(self.text))\n else:\n char_offsets = np.zeros(len(self.tokens) + 1)\n for i, tok in enumerate(self.tokens):\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 text:", "pos": "Represent the code:", "neg": "Represent the code about Natural Language Processing:" }
// SerializeToString returns the string representation of the serializer(s) // same as Serialize but returns string
[ "func (s Serializers) SerializeToString(key string, obj interface{}, options ...map[string]interface{}) (string, error) {\n\tresult, err := s.Serialize(key, obj, options...)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn string(result), nil\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 comment about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
%prog merge bedfiles > newbedfile Concatenate bed files together. Performing seqid and name changes to avoid conflicts in the new bed file.
[ "def merge(args):\n \n p = OptionParser(merge.__doc__)\n p.set_outfile()\n opts, args = p.parse_args(args)\n\n if len(args) < 1:\n sys.exit(not p.print_help())\n\n bedfiles = args\n fw = must_open(opts.outfile, \"w\")\n for bedfile in bedfiles:\n bed = Bed(bedfile)\n pf ...
[ "def runner(self):\n \n logging.info('Starting {} analysis pipeline'.format(self.analysistype))\n if not self.pipeline:\n # If the metadata has been passed from the method script, self.pipeline must still be false in order to\n # get Sippr() to function correctly, but the ...
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
Like `eager_partial`, but applies if callable is not annotated.
[ "def eager_partial_regardless(self, fn, *a, **kw):\n \"\"\"\"\"\"\n if self.has_annotations(fn):\n return self.eager_partial(fn, *a, **kw)\n return functools.partial(fn, *a, **kw)" ]
[ "def path(self, path):\n \"\"\"\"\"\"\n\n # pylint: disable=attribute-defined-outside-init\n self._path = copy_.copy(path)\n\n # The provided path is shallow copied; it does not have any attributes\n # with mutable types.\n\n # We perform this check after the initialization...
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code:" }
Dense [k-1]x4 transition frequency matrix
[ "def transitions(self):\n \"\"\"\"\"\"\n if self._transitions is not None:\n return self._transitions\n transitions = self.array.astype(np.float)\n transitions /= transitions.sum(1)[:, np.newaxis]\n self._transitions = transitions\n return transitions" ]
[ "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 summarization:", "pos": "Represent the code:", "neg": "Represent the code:" }
// CreateCheckpoint persists checkpoint in CheckpointStore.
[ "func (manager *impl) CreateCheckpoint(checkpointKey string, checkpoint Checkpoint) error {\n\tmanager.mutex.Lock()\n\tdefer manager.mutex.Unlock()\n\tblob, err := checkpoint.MarshalCheckpoint()\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn manager.store.Write(checkpointKey, blob)\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 Github text about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Programming:" }
@name trace @memberof logger @method @param {Arguments} messages Variable argument message @example logger.trace('hoge', 'foo', 'bar', 10); > hoge foo bar 10
[ "function () {\n var prefix = 'TRACE';\n this.output(prefix, prefix.cyan, Array.prototype.slice.call(arguments));\n }" ]
[ "function (err, node, next) {\n var func = node.action + 'Action';\n var obj = eval(func + '(node.params)');\n logger.log('debug', 'M|actionQueue::execute|obj=%j', +obj, meta);\n return null;\n }" ]
codesearchnet
{ "query": "Represent the Github instruction about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
Adds instances to the Statical Manager @param string[] $aliases @param \RunBB\Core\Statical\Manager $manager @param object $instance
[ "protected static function addInstances($aliases, $manager, $instance)\n {\n foreach ($aliases as $alias) {\n $proxy = __NAMESPACE__.'\\\\'.$alias;\n $manager->addProxyInstance($alias, $proxy, $instance);\n }\n }" ]
[ "final public static function sinfo(array $params):string\n {\n return (\\iumioFramework\\Core\\Base\\Server\\GlobalServer::getServerInfo($params['name']));\n }" ]
codesearchnet
{ "query": "Represent the description about Data management:", "pos": "Represent the code about Data management:", "neg": "Represent the code about programming:" }
Read a `~chemlab.core.Molecule` from a file. .. seealso:: `chemlab.io.datafile`
[ "def load_molecule(name, format=None):\n '''\n \n ''' \n mol = datafile(name, format=format).read('molecule')\n display_system(System([mol]))" ]
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }