query
stringlengths
16
255
pos
list
neg
list
task
stringclasses
1 value
instruction
dict
Reload a module @param {aria.templates.ModuleCtrl} moduleCtrl
[ "function (moduleCtrl) {\n var moduleFactory = this.bridge.getAriaPackage().templates.ModuleCtrlFactory;\n ariaUtilsJson.setValue(this._data, \"locked\", true);\n\n // do some cleaning\n this.clearHightlight();\n\n moduleFactory.reloadModuleCtrl(moduleCtrl, {\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:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Hash a file's contents @param string $file @param string $algo @return mixed String on success, false if $algo is not available
[ "private function hashFile($file, $algo)\n {\n if (!file_exists($file)) {\n return false;\n }\n\n $msg = file_get_contents($file);\n\n return $this->hash($msg, $algo);\n }" ]
[ "protected function set_key($key) {\n $bytes = strlen($key); // Get key length in bytes.\n\n // Only accept keys with the expected (backup::CIPHERKEYLEN) key length. There are a number of hashing,\n // random generators to achieve this esasily, like the one shown below to create the default\n ...
codesearchnet
{ "query": "Represent the comment about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Copy all properties from $source to $destination. @param mixed $source @param mixed $destination @return mixed
[ "public function extend($source, $destination)\n {\n foreach($source as $key => $value)\n {\n $destination->{$key} = $value;\n }\n\n return $destination;\n }" ]
[ "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 Github summarization about file transfer:", "pos": "Represent the Github code about file transfer:", "neg": "Represent the Github code about programming:" }
// MustAsset is like Asset but panics when Asset would return an error. // It simplifies safe initialization of global variables.
[ "func MustAsset(name string) []byte {\n\ta, err := Asset(name)\n\tif (err != nil) {\n\t\tpanic(\"asset: Asset(\" + name + \"): \" + err.Error())\n\t}\n\n\treturn a\n}" ]
[ "func (h Handler) GetE(cmd common.GetRequest) (<-chan common.GetEResponse, <-chan error) {\n\t// Being minimalist, not lazy. The chunked handler is not meant to be used with a\n\t// backing store that supports the GetE protocol extension. It would be a waste of\n\t// time and effort to support it here if it would \...
codesearchnet
{ "query": "Represent the Github comment about Go programming language:", "pos": "Represent the Github code about Go programming language:", "neg": "Represent the Github code about Software development:" }
// We want numbers that look like the following: /* "p90" "p50" "p999" "p75" "p333" */
[ "func percentToString(f float64) string {\n\tfInt := int64(f * 1000)\n\tif fInt == 0 {\n\t\treturn \"0\"\n\t}\n\tif fInt == 1000 {\n\t\treturn \"100\"\n\t}\n\tif fInt < 0 || fInt > 1000 {\n\t\treturn \"INVALID\"\n\t}\n\tr := strconv.FormatInt(fInt, 10)\n\tr = strings.TrimRight(r, \"0\")\n\tfor len(r) < 2 {\n\t\tr =...
[ "def get_populartimes_from_search(place_identifier, user_agent=default_user_agent, **kwargs):\n \n params_url = {\n \"tbm\": \"map\",\n \"tch\": 1,\n \"q\": urllib.parse.quote_plus(place_identifier),\n \"pb\": \"!4m12!1m3!1d4005.9771522653964!2d-122.42072974863942!3d37.807745979654...
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Programming:" }
Create a list of all features that include the specified key in their userMap(). @param key The key to consider. @return A list of features that include the key.
[ "public FeatureList selectByUserData(String key) {\n\t\tFeatureList list = new FeatureList();\n\t\tfor (FeatureI f : this) {\n\t\t\tif (f.userData().containsKey(key)) {\n\t\t\t\tlist.add(f);\n\t\t\t}\n\t\t}\n\t\treturn list;\n\t}" ]
[ "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 instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
/* (non-Javadoc) @see java.net.URLConnection#getContentLength()
[ "@Override\n public int getContentLength()\n {\n try\n {\n if (!connected)\n {\n connect();\n }\n\n return (int)nodeRepresentation.getContentLenght();\n }\n catch (IOException e)\n {\n if (LOG.isTraceEnabled())\n {\n ...
[ "public static void disableURLCaches() {\n BeanDesc bd = BeanDescFactory.getBeanDesc(URLConnection.class);\n LdiFieldUtil.set(bd.getField(\"defaultUseCaches\"), null, Boolean.FALSE);\n }" ]
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code:" }
// SetThingArn sets the ThingArn field's value.
[ "func (s *JobExecutionSummaryForJob) SetThingArn(v string) *JobExecutionSummaryForJob {\n\ts.ThingArn = &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 comment about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
List translations for a specific key. @param string $projectKey @param string $keyId @param array $params @return Index|ResponseInterface
[ "public function indexKey(string $projectKey, string $keyId, array $params = [])\n {\n if (isset($params['tags'])) {\n $params['q'] = 'tags:'.$params['tags'];\n unset($params['tags']);\n }\n\n $response = $this->httpGet(sprintf('/api/v2/projects/%s/keys/%s/translations'...
[ "public List<Symbol> getSymbolList(final String param) {\n return get(param, new StringToSymbolList(\",\"),\n new AlwaysValid<List<Symbol>>(),\n \"comma-separated list of strings\");\n }" ]
codesearchnet
{ "query": "Represent the Github sentence about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about Documentation:" }
// Units lists all Units stored in the Registry, ordered by name. This includes both global and non-global units.
[ "func (r *EtcdRegistry) Units() ([]job.Unit, error) {\n\tkey := r.prefixed(jobPrefix)\n\topts := &etcd.GetOptions{\n\t\t// We need Job Units to be sorted\n\t\tSort: true,\n\t\tRecursive: true,\n\t}\n\tres, err := r.kAPI.Get(context.Background(), key, opts)\n\tif err != nil {\n\t\tif isEtcdError(err, etcd.Error...
[ "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 instruction:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
// Sign sets the blob builder's camliSigner field with SetSigner // and returns the signed JSON using the provided signer.
[ "func (bb *Builder) Sign(ctx context.Context, signer *Signer) (string, error) {\n\treturn bb.SignAt(ctx, signer, time.Time{})\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:" }
Args: names (tuple[str]): names of the dataset split Returns: a 32x32x3 image, the mean of all images in the given datasets
[ "def get_per_pixel_mean(names=('train', 'test', 'extra')):\n \n for name in names:\n assert name in ['train', 'test', 'extra'], name\n images = [SVHNDigit(x).X for x in names]\n return np.concatenate(tuple(images)).mean(axis=0)" ]
[ "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 description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Return True if the minion matches the given data target CLI Example: .. code-block:: bash salt '*' match.data 'spam:eggs'
[ "def data(tgt):\n '''\n \n '''\n matchers = salt.loader.matchers(__opts__)\n try:\n return matchers['data_match.match'](tgt, opts=__opts__)\n except Exception as exc:\n log.exception(exc)\n return False" ]
[ "def _list_nodes(call=None):\n '''\n \n '''\n local = salt.client.LocalClient()\n ret = local.cmd('salt-cloud:driver:vagrant', 'grains.items', '', tgt_type='grain')\n return ret" ]
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Get a handler that calls Jenkins API to discover a Jenkins instance on specified host. @param {Function} cb: callback for argument handling @return Jenkins API handler function
[ "function discover(cb) {\n return function (host, args) {\n if (!args) {\n args = host || {};\n host = 'localhost';\n }\n function resultCb(result) {\n console.log(text.__('Jenkins ver. %s is running on %s'),\n result.hudson.version[0],\n (result.hudson.url && result.hudso...
[ "@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 comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Closes socket and stream readers/writers @throws org.drizzle.jdbc.internal.common.QueryException if the socket or readers/writes cannot be closed
[ "public void close() throws QueryException {\n try {\n if(! (socket instanceof SSLSocket))\n socket.shutdownInput();\n } catch (IOException ignored) {\n }\n try {\n final ClosePacket closePacket = new ClosePacket();\n closePacket.send(write...
[ "@Override\n public void close() throws IllegalStateException, IOException {\n\n // validate state\n if (isClosed())\n \t throw new IllegalStateException(\"Serial connection is not open; cannot 'close()'.\");\n\n // remove serial port listener\n SerialInterrupt.removeListener(fi...
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code:" }
Remove dump from tmp path. @param [String] path the path, where the dump/archive is located. @return [nil]
[ "def cleanup_tar_file(path)\n Mongolicious.logger.info(\"Cleaning up local path #{path}\")\n begin\n File.delete(path)\n rescue => exception\n Mongolicious.logger.error(\"Error trying to delete: #{path}\")\n Mongolicious.logger.info(exception.message)\n end\n end" ]
[ "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 text:", "pos": "Represent the code:", "neg": "Represent the code about AWS Auto Scaling:" }
Returns the table that has an index with the given name and schema.
[ "Table findUserTableForIndex(Session session, String name,\n String schemaName) {\n\n Schema schema = (Schema) schemaMap.get(schemaName);\n HsqlName indexName = schema.indexLookup.getName(name);\n\n if (indexName == null) {\n return null;\n ...
[ "public FunctionHandle resolveFunction(Session session, QualifiedName name, List<TypeSignatureProvider> parameterTypes)\n {\n // TODO Actually use session\n // Session will be used to provide information about the order of function namespaces to through resolving the function.\n // This is l...
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
@param array $filters @param $data @return mixed @throws ServerErrorHttpException @throws InvalidConfigException
[ "public static function runAll(array $filters, $data) {\n\t\tif(empty($filters)) {\n\t\t\treturn $data;\n\t\t}\n\t\t$filters = ArrayHelper::toArray($filters);\n\t\tforeach($filters as $config) {\n\t\t\t$config = Helper::isEnabledComponent($config);\n\t\t\tif($config) {\n\t\t\t\t$data = self::run($config, $data);\n\...
[ "public function execute($request)\n {\n RequestNotSupportedException::assertSupports($this, $request);\n $this->logger->info(\"Ecommpay order #{$request->getFirstModel()->getOrder()->getNumber()} have paid\");\n throw new HttpResponse('OK');\n }" ]
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:" }
/* USERS ENDPOINTS
[ "@Override\n public InstagramPaginatingResponse<InstagramFeedItem> getSelfFeed(String accessToken,\n int count,\n String maxContentId,\n ...
[ "protected function prepareResponseHeaders()\n {\n $this->getResponse(true)->headers->set('Content-Type', 'text/html');\n $this->getResponse()->setCharset('utf-8');\n\n\n // FIX FOR IE SESSION COOKIE\n // CAO IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT\n //...
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code about PHP programming:" }
Removes all types (int, string, long etc.) of attributes with the specified name. @param name The name.
[ "public void removeAttribute(String name) {\n for(Map<String, ?> attributeValueMap : attributeMaps.values()) {\n clearAttribute(attributeValueMap, name);\n }\n }" ]
[ "function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co...
codesearchnet
{ "query": "Represent the Github instruction about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
Given a specific attribute with parameters, this will resolve it while first resolving any dependent attributes that first need to be resolved. @param $attribute @param array $parameters
[ "protected function resolveParametersForAttribute($attribute, array $parameters)\n {\n $children = $this->getDependentAttributes($parameters);\n\n if (!empty($children)) {\n foreach ($children as $child) {\n $this->resolveParametersForAttribute($child, $this->requirements[...
[ "public function hintJsonStructure($column, $structure)\n {\n if (json_decode($structure) === null) {\n throw new InvalidJsonException();\n }\n\n $this->hintedJsonAttributes[$column] = $structure;\n\n // Run the call to add hinted attributes to the internal json\n //...
codesearchnet
{ "query": "Represent the instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software Development:" }
Set a cached item by key WARN: Regardless if the item is already in the cache, it will be udpated with the new value.
[ "def set(self, key, val, bucket):\n \n\n if bucket not in self._cache:\n self._cache[bucket] = {}\n\n self._cache[bucket][key] = val" ]
[ "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 text:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Throws an {@link IllegalArgumentException} is the specified array is not of specified size @param size for array to have @param array to check @param errmsg generates message to put into exception
[ "public static void assertArraySize(int size, double[] array, Supplier<String> errmsg){\n\t\tif(array.length != size){\n\t\t\tthrow new IllegalArgumentException(errmsg.get());\n\t\t}\n\t}" ]
[ "public static void check(final Object result, final Class<?> targetType) {\n if (result != null && !targetType.isAssignableFrom(result.getClass())) {\n // note: conversion logic may go wrong (e.g. because converter expect collection input mostly and may\n // not work correctly for sing...
codesearchnet
{ "query": "Represent the text about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code about programming:" }
Class construction methods
[ "function add( key, value ) {\n\t\tvar desc;\n\t\tswitch ( typeof value ) {\n\t\t\tcase 'object' : desc = util.type( value ) == 'descriptor' ? value : util.describe( { value : value }, 'cw' ); break;\n\t\t\tcase 'function' : desc = util.describe( make_method( 'parent', value, get_method_descriptor( this,...
[ "def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)" ]
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code:" }
Fetches the next element from the resource. @return mixed The next result (or `null` if there is none).
[ "public function next() {\n\t\tif ($this->_buffer) {\n\t\t\tlist($this->_key, $this->_current) = array_shift($this->_buffer);\n\t\t\treturn $this->_current;\n\t\t}\n\n\t\tif (!$next = $this->_fetch()) {\n\t\t\t$this->_key = null;\n\t\t\t$this->_current = null;\n\t\t\t$this->_valid = false;\n\n\t\t\treturn null;\n\t...
[ "public static function insert(array $data)\n {\n $self = static::getInstance();\n\n $data = static::filterColumns($data);\n\n if (!\\count($data)) {\n throw new DbException(\n \"Invalid field names of table `{$self->name}`. Please check use of `insert()` method\"\n...
codesearchnet
{ "query": "Represent the summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Programming:" }
// Dialer returns a Dialer that wraps d and injects n's latency in its // connections. n's Latency is also injected to the connection's creation.
[ "func (n *Network) Dialer(d Dialer) Dialer {\n\treturn func(network, address string) (net.Conn, error) {\n\t\tconn, err := d(network, address)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn n.Conn(conn)\n\t}\n}" ]
[ "func (e *endpoint) Attach(dispatcher stack.NetworkDispatcher) {\n\te.dispatcher = dispatcher\n\t// Link endpoints are not savable. When transportation endpoints are\n\t// saved, they stop sending outgoing packets and all incoming packets\n\t// are rejected.\n\tgo e.dispatchLoop()\n}" ]
codesearchnet
{ "query": "Represent the comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }
// SetCompressionFormat sets the CompressionFormat field's value.
[ "func (s *S3DestinationConfiguration) SetCompressionFormat(v string) *S3DestinationConfiguration {\n\ts.CompressionFormat = &v\n\treturn s\n}" ]
[ "public String getEventDescriptor(Class controlInterface)\n {\n //\n // NOTE: The input controlInterface is currently unused, but included to\n // enable downstream optimization of serialization representation. See the\n // OPTIMIZE comment below for more details. If implemented, th...
codesearchnet
{ "query": "Represent the instruction about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Software development:" }
check if we're running in an interactive shell returns True if running under python/ipython interactive shell
[ "def in_interactive_session():\n \n from pandas import get_option\n\n def check_main():\n try:\n import __main__ as main\n except ModuleNotFoundError:\n return get_option('mode.sim_interactive')\n return (not hasattr(main, '__file__') or\n get_optio...
[ "def zipline_magic(line, cell=None):\n \n load_extensions(\n default=True,\n extensions=[],\n strict=True,\n environ=os.environ,\n )\n try:\n return run.main(\n # put our overrides at the start of the parameter list so that\n # users may pass valu...
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code:" }
Reconfigure this block based on the mutator dialog's components. @param {!Blockly.Block} containerBlock Root block in mutator. @this Blockly.Block
[ "function(containerBlock) {\n // Parameter list.\n this.arguments_ = [];\n this.paramIds_ = [];\n var paramBlock = containerBlock.getInputTargetBlock('STACK');\n while (paramBlock) {\n this.arguments_.push(paramBlock.getFieldValue('NAME'));\n this.paramIds_.push(paramBlock.id);\n param...
[ "function SelectionTooltipField(type, options) {\n Field.call(this, type, options);\n\n this.onInputChange = this.onInputChange.bind(this);\n this.arg = new Argument();\n\n this.menu = new Menu({ document: this.document, type: type });\n this.element = this.menu.element;\n\n this.onFieldChange = util.createEv...
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Get the content length of the given record in bytes, not 16 bit words. @param index The index, from 0 to getRecordCount - 1 @return The lengh in bytes of the record. @throws java.io.IOException
[ "public int getContentLength(int index) throws IOException {\n\t\tint ret = -1;\n\n\t\tif (this.lastIndex != index) {\n\t\t\tthis.readRecord(index);\n\t\t}\n\n\t\tret = this.recLen;\n\n\t\treturn ret;\n\t}" ]
[ "def parse_result(self, data):\n \n # typedef struct {\n # uint8_t numBytes; // Number of bytes in buffer now\n # } YSM_BUFFER_LOAD_RESP;\n count = ord(data[0])\n if self.offset == 0:\n # if offset was 0, the buffer was reset and\n ...
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Log the message at the specified level with the specified throwable if any. This method creates a LogRecord and fills in caller date before calling this instance's JDK14 logger. See bug report #13 for more details. @param level @param msg @param t
[ "private void log(String callerFQCN, Level level, String msg, Throwable t) {\r\n // millis and thread are filled by the constructor\r\n LogRecord record = new LogRecord(level, msg);\r\n record.setLoggerName(getName());\r\n record.setThrown(t);\r\n // Note: parameters in record are...
[ "public void setHeader(String name, String s) {\n if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) { //306998.15\n logger.logp(Level.FINE, CLASS_NAME,\"setHeader\", \" name --> \" + name + \" value --> \" + PasswordNullifier.nullifyParams(s), \"[\"+this+\"...
codesearchnet
{ "query": "Represent the post about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Programming:" }
@param $composite @param $clauses @return $this|WhereBuilder
[ "private function x($composite, $clauses)\n {\n $builder = new self($composite);\n\n if ($clauses) {\n foreach ($clauses as $x) {\n $builder->add($x);\n }\n\n $this->add($builder);\n\n return $this;\n }\n\n return $builder;\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 Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
Check that tweet can be deleted. @param int $tweetId @return bool
[ "public function mustBeKept($tweetId)\n {\n if (count($this->getRetweetingStatuses()) == 0) {\n // This tweet has not been retweeted\n return false;\n }\n\n // Check that this tweet has not been retweeted after $tweetId\n foreach ($this->getRetweetingStatuses() a...
[ "public function handle(PublishThePost $event) {\n\n $status = \"Article: \";\n $status .= $event->data['id']['title'];\n $status .= \" \";\n $status .= $event->data['id']['canonical_url'];\n $status .= \" #Laravel\";\n\n $twitter_status = Twitter::postTweet(['status' => $s...
codesearchnet
{ "query": "Represent the Github description about NLP:", "pos": "Represent the Github code about NLP:", "neg": "Represent the Github code about Software development:" }
Turn off receiver via HTTP get command.
[ "def power_off(self):\n \"\"\"\"\"\"\n try:\n if self.send_get_command(self._urls.command_power_standby):\n self._power = POWER_STANDBY\n self._state = STATE_OFF\n return True\n else:\n return False\n except reque...
[ "def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR...
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Render list data The ui parameter tells us if user interface is enable (buttons, links etc.) @param ListDataEvent $event @param bool $ui @return string
[ "public function render(ListDataEvent $event, bool $ui = true):string\n {\n $data = $this->getData($event, !$ui);\n $params = array_merge(\n $data,\n [\n 'columns' => $this->getColumns(),\n 'actions' => $this->getActions(),\n 'ui' =...
[ "def openCurrentItem(self):\n \n logger.debug(\"openCurrentItem\")\n _currentItem, currentIndex = self.getCurrentItem()\n if not currentIndex.isValid():\n return\n\n # Expanding the node will call indirectly call RepoTreeModel.fetchMore which will call\n # BaseRt...
codesearchnet
{ "query": "Represent the Github description about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
/* (non-Javadoc) @see com.ibm.jaggr.core.config.IConfigListener#configLoaded(com.ibm.jaggr.core.config.IConfig, long)
[ "@Override\r\n\tpublic void configLoaded(IConfig config, long sequence) {\r\n\t\tfinal String sourceMethod = \"configLoaded\"; //$NON-NLS-1$\r\n\t\tfinal boolean isTraceLogging = log.isLoggable(Level.FINER);\r\n\t\tif (isTraceLogging) {\r\n\t\t\tlog.entering(sourceClass, sourceMethod, new Object[] { aggregator });\...
[ "@SuppressWarnings(\"unchecked\")\n public static StackFinder getInstance() {\n if (finder == null) {\n AccessController.doPrivileged(new PrivilegedAction() {\n public Object run() {\n finder = new StackFinder();\n return null;\n ...
codesearchnet
{ "query": "Represent the Github comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Clean up constructions that exists only in the unexpanded code @param drl @return
[ "private String cleanupExpressions(String drl) {\n // execute cleanup\n for ( final DSLMappingEntry entry : this.cleanup ) {\n drl = entry.getKeyPattern().matcher( drl ).replaceAll( entry.getValuePattern() );\n }\n return drl;\n }" ]
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Parse single node mesh geometry in FBXTree.Objects.Geometry
[ "function ( relationships, geoNode, deformers ) {\n\n\t\t\tvar skeletons = deformers.skeletons;\n\t\t\tvar morphTargets = deformers.morphTargets;\n\n\t\t\tvar modelNodes = relationships.parents.map( function ( parent ) {\n\n\t\t\t\treturn fbxTree.Objects.Model[ parent.ID ];\n\n\t\t\t} );\n\n\t\t\t// don't create ge...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the comment about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code:" }
// makeFontEncoding builds differences from reference encoding
[ "func makeFontEncoding(encList encListType, refEncFileStr string) (diffStr string, err error) {\n\tvar refList encListType\n\tif refList, err = loadMap(refEncFileStr); err != nil {\n\t\treturn\n\t}\n\tvar buf fmtBuffer\n\tlast := 0\n\tfor j := 32; j < 256; j++ {\n\t\tif encList[j].name != refList[j].name {\n\t\t\ti...
[ "public String filePath(int index, String savePath) {\n // not calling the corresponding swig function because internally,\n // the use of the function GetStringUTFChars does not consider the case of\n // a copy not made\n return savePath + File.separator + fs.file_path(index);\n }" ]
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
loopBody will only be executed for non-null positions in the Block
[ "private static BytecodeBlock generateBlockNonNullPositionForLoop(Scope scope, Variable positionVariable, BytecodeBlock loopBody)\n {\n Variable rowsVariable = scope.declareVariable(int.class, \"rows\");\n Variable blockVariable = scope.getVariable(\"block\");\n\n BytecodeBlock block = new B...
[ "@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:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// IndexRangesToKVRanges converts index ranges to "KeyRange".
[ "func IndexRangesToKVRanges(sc *stmtctx.StatementContext, tid, idxID int64, ranges []*ranger.Range, fb *statistics.QueryFeedback) ([]kv.KeyRange, error) {\n\tif fb == nil || fb.Hist == nil {\n\t\treturn indexRangesToKVWithoutSplit(sc, tid, idxID, ranges)\n\t}\n\tfeedbackRanges := make([]*ranger.Range, 0, len(ranges...
[ "@Override\n public List findByRange(byte[] muinVal, byte[] maxVal, EntityMetadata m, boolean isWrapReq, List<String> relations,\n List<String> columns, List<IndexExpression> conditions, int maxResults) throws Exception {\n throw new UnsupportedOperationException(\"Support available only for thrift...
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Handle `PG.connect()` callback results using Promise @param resolve @param reject @param err @param client @param done @returns {*}
[ "function catchResults (resolve, reject, err, client, done) {\n\t//debug.log('catchResults()...');\n\tif (err) {\n\t\treturn reject(err);\n\t}\n\tresolve({\"client\":client, \"done\":done});\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 comment:", "pos": "Represent the code:", "neg": "Represent the code:" }
Multi-byte str-pad @param string $input @param integer $pad_length @param string $pad_string @param int $pad_type @param null $encoding @return string
[ "public static function mbStringPad($input, $pad_length, $pad_string = ' ', $pad_type = STR_PAD_RIGHT, $encoding = NULL)\n {\n if (!$encoding)\n {\n $diff = strlen($input) - mb_strlen($input);\n }\n else\n {\n $diff = strlen($input) - mb_strlen($input, $en...
[ "protected static function parsePrintableString(&$data, &$result)\n {\n // Printable string type\n $data = self::parseCommon($data, $stringData);\n $result[] = [\n 'Printable String (' . self::$len . ')',\n $stringData, ];\n }" ]
codesearchnet
{ "query": "Represent the instruction about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Programming:" }
Returns a prediction @param int $predictionid @param bool $requirelogin @return array array($model, $prediction, $context)
[ "public static function get_prediction($predictionid, $requirelogin = false) {\n global $DB;\n\n if (!$predictionobj = $DB->get_record('analytics_predictions', array('id' => $predictionid))) {\n throw new \\moodle_exception('errorpredictionnotfound', 'analytics');\n }\n\n $con...
[ "def search_prod_type_tags(self, ins, type, tags, pipeline):\n ''''''\n return StoredProduct(id=100, content='null.fits', tags={})" ]
codesearchnet
{ "query": "Represent the sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Converts a constant in internal representation (in which boolean, char, byte, short, and int are each represented by an Integer) into standard representation. Other values (including null) are returned unchanged.
[ "public static Object decode(Object value, Type type) {\n if (value instanceof Integer) {\n int i = (Integer) value;\n switch (type.getTag()) {\n case BOOLEAN: return i != 0;\n case CHAR: return (char) i;\n case BYTE: return (byte) i;\n ...
[ "public static Double toDouble(Number self) {\n // Conversions in which all decimal digits are known to be good.\n if ((self instanceof Double)\n || (self instanceof Long)\n || (self instanceof Integer)\n || (self instanceof Short)\n || (self...
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
When navigating on a different route but the same component is used, Vue.js Will not update the instance data, so we have to update $data ourselves
[ "function fixPrepatch(to, ___) {\n var _this3 = this;\n\n if (this._hashChanged) return;\n\n __WEBPACK_IMPORTED_MODULE_6_vue__[\"default\"].nextTick(function () {\n var instances = Object(__WEBPACK_IMPORTED_MODULE_9__utils__[\"g\" /* getMatchedComponentsInstances */])(to);\n\n _lastComponentsFiles = instan...
[ "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:" }
Delete record from the database. Requires a uniqueness constraint. Assign those columns before calling delete(). @return boolean
[ "public function delete()\n {\n if (empty($this->unique)) {\n return false;\n }\n foreach($this->unique as $column) {\n if (!isset($this->instance[$column])) {\n return false;\n }\n }\n\n $sql = 'DELETE FROM '.$this->fq_name.' WHE...
[ "def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)" ]
codesearchnet
{ "query": "Represent the Github summarization about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code:" }
---------------------------------------------------------------
[ "function () {\n var pluginDir = $bc_$18.App.getAppPluginDir();\n var runOS = $bc_$18.App.getAppRunOnOS();\n if (runOS === 'MacOSX') {\n return pluginDir + '/pythonCLI.app/Contents/MacOS/pythonCLI'\n } else if (runOS === 'win32') {\n return pluginDir + '/python/pythonCLI/romanysoft.services.ex...
[ "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 sentence about language and writing:", "pos": "Represent the code about language and writing:", "neg": "Represent the code:" }
Generate an unique Atom id for the given content
[ "def _get_id(owner, date, content):\n \n h = hashlib.sha256()\n # Hash still contains the original project url, keep as is\n h.update(\"github.com/spacetelescope/asv\".encode('utf-8'))\n for x in content:\n if x is None:\n h.update(\",\".encode('utf-8'))\n else:\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:", "pos": "Represent the code:", "neg": "Represent the code:" }
Evaluate the cache control headers for the request to see if it can be served from the cache. @param request the request @param servletResponse the servlet response @param resource the fedora resource @param session the session
[ "protected void checkCacheControlHeaders(final Request request,\n final HttpServletResponse servletResponse,\n final FedoraResource resource,\n final HttpSession sess...
[ "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 PHP programming:", "pos": "Represent the code about PHP programming:", "neg": "Represent the code about programming:" }
Generate the display of the question number. @param string|null $number The question number to display. 'i' is a special value that gets displayed as Information. Null means no number is displayed. @return HTML fragment.
[ "protected function number($number) {\n if (trim($number) === '') {\n return '';\n }\n $numbertext = '';\n if (trim($number) === 'i') {\n $numbertext = get_string('information', 'question');\n } else {\n $numbertext = get_string('questionx', 'quest...
[ "function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co...
codesearchnet
{ "query": "Represent the Github instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Parses a single iCal Lines. @access protected @static @param string $line Line to parse @return array
[ "protected static function parseLine( $line )\r\n\t{\r\n\t\t$pos\t= strpos( $line, \":\" );\r\n\t\t$name\t= substr( $line, 0, $pos );\r\n\t\t$value\t= substr( $line, $pos+1 );\r\n\r\n\t\t$params\t= array();\r\n\t\tif( substr_count( $name, \";\" ) )\r\n\t\t{\r\n\t\t\t$pos\t= strpos( $name, \";\" );\r\n\t\t\t$params\...
[ "protected function processDetails(Buffer &$buffer, Result &$result)\n {\n parent::processDetails($buffer, $result);\n\n // Add in map\n $result->add('mapname', 'Panau');\n $result->add('dedicated', 'true');\n }" ]
codesearchnet
{ "query": "Represent the Github instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
Build and execute the SQL DELETE sentence Return how many rows where altered @param string $extraWhereClause @return int|false
[ "final public function delete($extraWhereClause = '')\n {\n if (self::RSMODE_CONNECTED_EDIT !== $this->mode) {\n throw new \\LogicException('Recordset: The recordset is not on edit mode [current: ' . $this->mode . ']');\n }\n // check the entity is not empty\n if ('' === $t...
[ "@Override\n\tpublic void showHelp(final Terminal terminal) {\n\t\tterminal.writer().println(\"\\t\" + this.toString() + \": generate sql to access the table.\");\n\t\tterminal.writer().println(\n\t\t\t\t\"\\t\\tex) generate [select/insert/update/delete] [table name]<Enter> : Show sql to access tables according to ...
codesearchnet
{ "query": "Represent the description about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code:" }
The item id e.g. a chapter id @param string $idref @param string $linear
[ "public function addToSpine($idref, $linear = 'yes')\n {\n $itemref = $this->spine->appendChild($this->createElement('itemref'));\n $itemref->setAttribute('idref', $idref);\n $itemref->setAttribute('linear', 'yes');\n\n return $itemref;\n }" ]
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Check if the found value is a nestedValidation @param array $value @return boolean @see NestedValidation
[ "private static function isNestedValidation(array $value)\r\n {\r\n return !(key_exists(Properties::TYPE, $value) && !is_array($value[Properties::TYPE]));\r\n }" ]
[ "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 text about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
not private for testing
[ "ExpandedPair retrieveNextPair(BitArray row, List<ExpandedPair> previousPairs, int rowNumber)\n throws NotFoundException {\n boolean isOddPattern = previousPairs.size() % 2 == 0;\n if (startFromEven) {\n isOddPattern = !isOddPattern;\n }\n\n FinderPattern pattern;\n\n boolean keepFinding =...
[ "def star_sep_check(self, original, loc, tokens):\n \"\"\"\"\"\"\n return self.check_py(\"3\", \"keyword-only argument separator (add 'match' to front to produce universal code)\", original, loc, tokens)" ]
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code:" }
/* Schema Object Validators
[ "function validateArrayTypeItemsExistence (api, response, schema, path) {\n if (schema.type === 'array' && _.isUndefined(schema.items)) {\n response.errors.push({\n code: 'OBJECT_MISSING_REQUIRED_PROPERTY',\n message: 'Missing required property: items',\n path: path\n });\n }\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 instruction about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
Binds a Pale API implementation to a webapp2 WSGIApplication
[ "def bind_pale_to_webapp2(pale_app_module,\n webapp_wsgiapplication,\n route_prefix=None):\n \"\"\"\"\"\"\n\n if not isinstance(webapp_wsgiapplication, webapp2.WSGIApplication):\n raise TypeError(\"pale.adapters.webapp2.bind_pale_to_webapp2 expected \"\n \"the passed in web...
[ "@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 comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Load a CRMod configuration file Parameters ---------- filename: string absolute or relative path to a crmod config.dat file
[ "def load_crmod_config(self, filename):\n \n with open(filename, 'r') as fid:\n nr_of_configs = int(fid.readline().strip())\n configs = np.loadtxt(fid)\n print('loaded configs:', configs.shape)\n if nr_of_configs != configs.shape[0]:\n raise E...
[ "def create(location: str, simpleobjects_found = None, complexobject_attributes_found = None): # -> ObjectNotFoundOnFileSystemError:\n \n if len(complexobject_attributes_found) > 0 or len(simpleobjects_found) > 0:\n return ObjectNotFoundOnFileSystemError('Mandatory object : ' + location + ...
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Returns an integer that is equal to the margin of victory of the election profile, that is, the smallest number k such that changing k votes can change the winners. :ivar Profile profile: A Profile object that represents an election profile.
[ "def AppMoVMaximin(profile):\n \n\n # Currently, we expect the profile to contain complete ordering over candidates.\n elecType = profile.getElecType()\n if elecType != \"soc\" and elecType != \"toc\":\n print(\"ERROR: unsupported profile type\")\n exit()\n\n # Initialization\n n = p...
[ "def _pdf_value(pdf, population, fitnesses, fitness_threshold):\n \n # Add the chance of obtaining a solution from the pdf\n # when the fitness for that solution exceeds a threshold\n value = 0.0\n for solution, fitness in zip(population, fitnesses):\n if fitness >= fitness_threshold:\n ...
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
This method applies the {@link HyphenationPattern pattern} matching at the given {@code offset}. @param pattern is the matching {@link HyphenationPattern pattern}. @param pos is the offset in the word to hyphenate.
[ "private void apply(HyphenationPattern pattern, int pos) {\r\n\r\n int internalOffset = pos - 2;\r\n HyphenationPatternPosition[] positions = pattern.getHyphenationPositions();\r\n for (HyphenationPatternPosition hyphenationPosition : positions) {\r\n int i = hyphenationPosition.index + internalOffset...
[ "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 comment about text processing:", "pos": "Represent the code about text processing:", "neg": "Represent the code:" }
// nextOpConflicted is called after an upgrade operation has failed, and hasn't // yet been resolved or reverted. When in this mode, the resolver will only // consider those two possibilities for progressing.
[ "func (s *uniterResolver) nextOpConflicted(\n\tlocalState resolver.LocalState,\n\tremoteState remotestate.Snapshot,\n\topFactory operation.Factory,\n) (operation.Operation, error) {\n\tif remoteState.ResolvedMode != params.ResolvedNone {\n\t\tif err := s.config.ClearResolved(); err != nil {\n\t\t\treturn nil, error...
[ "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 post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }
Extract the article content from {@code text} markup tags. @param text Raw article text. @return Article text extracted from {@code text} tags.
[ "private void extractArticle(StringBuilder article) {\n // remove all html tags before we unescape the text itself\n // and possibly introduce non-html < characters\n int startOfTextTag = article.indexOf(\"<text\");\n int endOfStart = article.indexOf(\">\", startOfTextTag); \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 text about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
// SetLimit sets the Limit field's value.
[ "func (s *ListApplicationsInput) SetLimit(v int64) *ListApplicationsInput {\n\ts.Limit = &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 description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Determine Julian day count from Islamic date
[ "def to_jd(year, month, day):\n ''''''\n return (day + ceil(29.5 * (month - 1)) + (year - 1) * 354 + trunc((3 + (11 * year)) / 30) + EPOCH) - 1" ]
[ "def resolve(self, year: int = YEAR_ANY) -> MDate:\n \n year = year or self.year\n if year:\n return self._resolve(year)\n raise ValueError('Unable resolve the date without a specified year.')" ]
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Programming:" }
Split into lines, pushing doublewidth characters at the end of a line to the next line. When a double-width character is pushed to the next line, a space is added to pad out the line.
[ "def width_aware_splitlines(self, columns):\n # type: (int) -> Iterator[FmtStr]\n \n if columns < 2:\n raise ValueError(\"Column width %s is too narrow.\" % columns)\n if wcswidth(self.s) == -1:\n raise ValueError('bad values for width aware slicing')\n retur...
[ "def _set_text(self, value):\n \n working_index = self.working_index\n working_lines = self._working_lines\n\n original_value = working_lines[working_index]\n working_lines[working_index] = value\n\n # Return True when this text has been changed.\n if len(value) != l...
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Make a wire from the group of bdas to a set of destination bdas @param wireFromBdas the wiring from bda @param wireToBdas the wiring destination bda
[ "private void wireBdas(Collection<WebSphereBeanDeploymentArchive> wireFromBdas, Collection<WebSphereBeanDeploymentArchive> wireToBdas) {\n for (WebSphereBeanDeploymentArchive wireFromBda : wireFromBdas) {\n Collection<BeanDeploymentArchive> accessibleBdas = wireFromBda.getBeanDeploymentArchives();...
[ "def complete(self, stream):\n \n assert not self.is_complete()\n self._marker.addInputPort(outputPort=stream.oport)\n self.stream.oport.schema = stream.oport.schema\n # Update the pending schema to the actual schema\n # Any downstream filters that t...
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
// Returns if a member is a consul node. Returns a bool, // and the datacenter.
[ "func isConsulNode(m serf.Member) (bool, string) {\n\tif m.Tags[\"role\"] != \"node\" {\n\t\treturn false, \"\"\n\t}\n\treturn true, m.Tags[\"dc\"]\n}" ]
[ "def list_nodes(self):\n \"\"\"\"\"\"\n self.add_environment_file(user='stack', filename='stackrc')\n ret, _ = self.run(\"ironic node-list --fields uuid|awk '/-.*-/ {print $2}'\", user='stack')\n # NOTE(Gonéri): the good new is, the order of the nodes is preserved and follow the one from...
codesearchnet
{ "query": "Represent the instruction about Networking:", "pos": "Represent the code about Networking:", "neg": "Represent the code about Technology:" }
Ob das zu ueberwachende Ereignis oder der Zustandswechsel eingetreten sind oder nicht. @return bool - TRUE, wenn die Abhaengigkeit weiterhin erfuellt ist. FALSE, wenn der Zustandswechsel eingetreten ist und die Abhaengigkeit nicht mehr erfuellt ist.
[ "public function isValid() {\n if ($this->type == 'AND') {\n foreach ($this->dependencies as $dependency) {\n if (!$dependency->isValid())\n return false;\n }\n return true;\n }\n\n if ($this->type == 'OR' ) {\n forea...
[ "public function updateIndex(UniqueConstraint $constraint, Array $dataRows) {\n if (!array_key_exists($constraint->getName(), $this->uniqueConstraints)) {\n throw new InvalidArgumentException(sprintf(\"Constraint '%s' wurde noch nicht mit addConstraint() hinzugefügt'\",$constraint->getName()));\n }\n ...
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Zwraca obliczoną ilość stron @return integer
[ "public function getPagesCount()\n {\n return ceil($this->_grid->getState()->getDataCount() / $this->_grid->getState()->getRowsPerPage());\n }" ]
[ "public function send($headers = true)\n {\n //wysłanie nagłówków\n $headers ? $this->sendHeaders() : null;\n //opcjonalne uruchomienie panelu deweloperskiego\n if ($this->_debug) {\n //debugger wykonuje zmianę w contencie\n new \\Mmi\\Http\\ResponseDebugger;\n ...
codesearchnet
{ "query": "Represent the Github description about software development:", "pos": "Represent the Github code about software development:", "neg": "Represent the Github code about Programming:" }
reset captcha @param string $token @return void
[ "static public function resetCaptcha($token=null)\n {\n if (!$token) {\n $token = isset($_POST['_form_token']) ? $_POST['_form_token'] : null;\n }\n \n return Captcha::instance()->reset($token);\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:" }
// Returns the string describing a difference with the given // configuration object. If the given configuration object is // identical, an empty string is returned.
[ "func (s *serverConfig) ConfigDiff(t *serverConfig) string {\n\tswitch {\n\tcase t == nil:\n\t\treturn \"Given configuration is empty\"\n\tcase s.Credential != t.Credential:\n\t\treturn \"Credential configuration differs\"\n\tcase s.Region != t.Region:\n\t\treturn \"Region configuration differs\"\n\tcase s.StorageC...
[ "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 Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Items --------------
[ "public function addItem( $model, $item, $config = [] ) {\n\n\t\t$cartItemService = Yii::$app->factory->get( 'cartItemService' );\n\n\t\t$item->cartId = $model->id;\n\n\t\t// Remove in case it's not required\n\t\tif( isset( $item->id ) && $item->id > 0 && !$item->keep ) {\n\n\t\t\t$cartItemService->delete( $item );...
[ "function writeTimeBound(type, prmname, boundType, outputType) {\n return utils.parts(type, {\n B : prmname,\n // TODO: is this correct?\n C : boundType+'_'+(type === 'QU' ? 'UBT' : 'LBT')+'(KAF)',\n E : '1MON'\n }, outputType);\n //A=HEXT2014 B=SR-CMN_SR-CMN C=STOR_UBT(KAF) E=1MON F=CAMANCHE R FLOOD...
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Convert a date and a time string to a Unix time (in milliseconds). Either date or time can be null.
[ "public static long parse(String date, String time) {\r\n\t\treturn parseDate(date) + parseTime(time) + timeZoneOffset;\r\n\t}" ]
[ "private function to8601Utc(\\DateTimeInterface $dateTime): string\n {\n // Convert to UTC if we can\n if ($dateTime instanceof DateTime) {\n $dateTime->setTimezone(new \\DateTimeZone('UTC'));\n } elseif ($dateTime instanceof \\DateTimeImmutable && $dateTime->getOffset() > 0) {\n ...
codesearchnet
{ "query": "Represent the Github instruction about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
Turns params into a URL
[ "def params_to_url(params)\n string = '?'\n params.each do |k,v|\n string += CGI::escape(k)\n string += '='\n string += CGI::escape(v)\n string += '&'\n end\n string\n end" ]
[ "@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:" }
// User sets the value for optional user parameter
[ "func (c *UsersProfileSetCall) User(user string) *UsersProfileSetCall {\n\tc.user = user\n\treturn c\n}" ]
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the Github instruction about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
Invokes an aggregate function @param \eMapper\SQL\Aggregate\SQLFunction $function @throws \InvalidArgumentException @return mixed
[ "protected function sqlFunction(SQLFunction $function) {\n\t\t//connect to database\n\t\t$this->mapper->connect();\n\t\n\t\t//build query\n\t\t$query = $this->mapper->newQuery($this->entityProfile)\n\t\t->from($this->entityProfile->getEntityTable(), Schema::DEFAULT_ALIAS)\n\t\t->select($function->getFunctionInstanc...
[ "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 description about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
// All implements the StringSet interface.
[ "func (s *stringSet) All() []string {\n\tall := []string{}\n\tfor v := range s.values {\n\t\tall = append(all, v)\n\t}\n\treturn all\n}" ]
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the summarization about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
/* @see javax.servlet.ServletRequest#getServerName()
[ "@Override\n public String getServerName() {\n String name = this.request.getVirtualHost();\n if (null == name) {\n name = \"localhost\";\n }\n if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {\n Tr.debug(tc, \"getServerName: \" + name);\n ...
[ "public boolean setDbParamaters(HttpServletRequest request, String provider) {\n\n return setDbParamaters(request.getParameterMap(), provider, request.getContextPath(), request.getSession());\n }" ]
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software Development:" }
Get the path and query. @return the path and query string. @throws URIException incomplete trailing escape pattern or unsupported character encoding @see #decode
[ "public String getPathQuery() throws URIException {\n char[] rawPathQuery = getRawPathQuery();\n return (rawPathQuery == null) ? null : decode(rawPathQuery,\n getProtocolCharset());\n }" ]
[ "def label(self, string):\n \n if '*/' in string:\n raise ValueError(\"Bad label - cannot be embedded in SQL comment\")\n return self.extra(where=[\"/*QueryRewrite':label={}*/1\".format(string)])" ]
codesearchnet
{ "query": "Represent the summarization about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Software development:" }
Returns true if the container can return an entry for the given identifier. Returns false otherwise. @param string $id Identifier of the entry to look for. @return boolean
[ "public function has($id)\n {\n if (array_key_exists($id, $this->entries)) {\n return true;\n }\n if (array_key_exists($id, $this->factories)) {\n return true;\n }\n return false;\n }" ]
[ "public function initializeArguments()\n {\n $this->registerArgument('path', 'string', 'Location of the resource, can be either a path relative to the Public resource directory of the package or a resource://... URI', false, null);\n $this->registerArgument('package', 'string', 'Target package key....
codesearchnet
{ "query": "Represent the Github comment about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code about programming:" }
Extract package to a temporary folder. Return: pathlib.Path: Temp dir with package contents.
[ "def _extract(filename):\n \n random_string = '{:0d}'.format(randint(0, 10**6))\n tmp = '/tmp/kytos-napp-' + Path(filename).stem + '-' + random_string\n os.mkdir(tmp)\n with tarfile.open(filename, 'r:xz') as tar:\n tar.extractall(tmp)\n return Path(tmp)" ]
[ "def is_multifile_object_without_children(self, location: str) -> bool:\n \n # (1) Find the base directory and base name\n if isdir(location): # special case: parent location is the root folder where all the files are.\n return len(self.find_multifile_object_children(location)) == 0...
codesearchnet
{ "query": "Represent the Github instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
// Adds a Contraint to the group
[ "func (self *ConstraintGroup) AddConstraint(constraint ...*Constraint) {\n\tif self.constraints == nil {\n\t\tself.constraints = make([]*Constraint, 0)\n\t}\n\n\tself.constraints = append(self.constraints, constraint...)\n}" ]
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
// Get returns the current basic memory information.
[ "func (prof *Profiler) Get() (inf *Info, err error) {\n\tvar (\n\t\ti, pos, nameLen int\n\t\tv byte\n\t\tn uint64\n\t)\n\terr = prof.Reset()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tinf = &Info{}\n\tinf.Timestamp = time.Now().UTC().UnixNano()\n\tfor {\n\t\tprof.Val = prof.Val[:0]\...
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the Github instruction about File management:", "pos": "Represent the Github code about File management:", "neg": "Represent the Github code:" }
Validates an entity. @param AnDomainEntityAbstract $entity The entity to be validatd @return bool
[ "public function validate($entity)\n {\n //reset the error message\n $context = $this->getCommandContext();\n $context->entity = $entity;\n if ($entity->isValidatable()) {\n $entity->resetErrors();\n }\n $result = $this->getCommandChain()->run('on.validate', $...
[ "public function insert(): self\n {\n /** @var self $data */\n $data = $this;\n\n if(!$this->validate(\"post\", $missing))\n {\n throw new \\Exception(\"[MVQN\\REST\\Endpoints\\Endpoint] Annotations for the '\".get_class($this).\"' class require valid values be set \".\n ...
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
Returns the set of key transactions with the given query parameters. @param queryParams The query parameters @return The set of key transactions
[ "public Collection<KeyTransaction> list(List<String> queryParams)\n {\n return HTTP.GET(\"/v2/key_transactions.json\", null, queryParams, KEY_TRANSACTIONS).get();\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 post about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
See ECMA 15.4.4.4
[ "private static Scriptable js_reverse(Context cx, Scriptable thisObj, Object[] args)\n {\n if (thisObj instanceof NativeArray) {\n NativeArray na = (NativeArray) thisObj;\n if (na.denseOnly) {\n for (int i=0, j=((int)na.length)-1; i < j; i++,j--) {\n ...
[ "function writeTimeBound(type, prmname, boundType, outputType) {\n return utils.parts(type, {\n B : prmname,\n // TODO: is this correct?\n C : boundType+'_'+(type === 'QU' ? 'UBT' : 'LBT')+'(KAF)',\n E : '1MON'\n }, outputType);\n //A=HEXT2014 B=SR-CMN_SR-CMN C=STOR_UBT(KAF) E=1MON F=CAMANCHE R FLOOD...
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code:" }
Adds the "request" helper to the view object @param \Aimeos\MW\View\Iface $view View object @return \Aimeos\MW\View\Iface Modified view object
[ "protected function addRequest( \\Aimeos\\MW\\View\\Iface $view )\n\t{\n\t\t$request = $this->requestStack->getMasterRequest();\n\n\t\tif( $request !== null )\n\t\t{\n\t\t\t$helper = new \\Aimeos\\MW\\View\\Helper\\Request\\Symfony2( $view, $request );\n\t\t\t$view->addHelper( 'request', $helper );\n\t\t}\n\n\t\tre...
[ "protected function addCache( \\Aimeos\\MShop\\Context\\Item\\Iface $context )\n\t{\n\t\t$cache = new \\Aimeos\\MAdmin\\Cache\\Proxy\\Standard( $context );\n\n\t\treturn $context->setCache( $cache );\n\t}" ]
codesearchnet
{ "query": "Represent the sentence about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Aimeos:" }
Sets a fail format @param string|null $message Any message to pass to the page @param mixed $validation Field specific errors @return string
[ "protected function fail($message = null, $validation = null)\n {\n $this->trigger('json-fail', $this, $message, $validation);\n $this->trigger('response-fail', $this, $message, $validation);\n\n $json = array('error' => true);\n\n if($message) {\n $json['message'] = $messa...
[ "public function shutdown()\n {\n\n // query whether or not, class has been shutdown by an unhandled error\n if ($lastError = error_get_last()) {\n // add the passed error information to the array with the errors\n $error = ErrorUtil::singleton()->fromArray($lastError);\n ...
codesearchnet
{ "query": "Represent the summarization about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Software development:" }
This client generates a similarity graph from features in PE Files.
[ "def run():\n \"\"\"\"\"\"\n\n # Grab server args\n args = client_helper.grab_server_args()\n\n # Start up workbench connection\n workbench = zerorpc.Client(timeout=300, heartbeat=60)\n workbench.connect('tcp://'+args['server']+':'+args['port'])\n\n # Test out PEFile -> pe_deep_sim -> pe_jaccar...
[ "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:" }
Sort triggers based on type and word count from largest to smallest. @param Collection $triggers @return Collection
[ "protected function sortTriggers($triggers)\n {\n $triggers = $this->determineWordCount($triggers);\n $triggers = $this->determineTypeCount($triggers);\n\n $triggers = $triggers->sort(function ($current, $previous) {\n return ($current['order'] < $previous['order']) ? -1 : 1;\n ...
[ "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 instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Build a qualifier for the given annotation. @param annotation The annotation @param <T> The component type @return The qualifier
[ "public static <T> Qualifier<T> byAnnotation(Annotation annotation) {\n if (annotation.annotationType() == Type.class) {\n Type typeAnn = (Type) annotation;\n return byType(typeAnn.value());\n } else if (annotation.annotationType() == Named.class) {\n Named nameAnn = (...
[ "@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:" }
Getter for retrieving xpath from a DOMElement @param \DOMElement $nodeList @param integer $level @return type
[ "public function getPaths(\\DOMElement $nodeList, $level = 0)\n {\n $output = $nodeList->getNodePath();\n\n foreach ($nodeList->childNodes as $childObject) {\n $output .= $childObject->getNodePath() . \"\\n\";\n\n if ($childObject instanceof \\DOMElement) {\n $o...
[ "protected function parseExpressionHtmlLine( Line$line ):self\n\t{\n\t\t$content= $line->slice(1);\n\n\t\treturn $this->openNode(new StringNode($this,$line))->appendLine(\"<?$content?>\");\n\t}" ]
codesearchnet
{ "query": "Represent the instruction about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
Create a new {@link DocumentBuilderFactory} using the defaults defined in this class ({@link #DEFAULT_DOM_NAMESPACE_AWARE}, {@link #DEFAULT_DOM_VALIDATING} etc.). @return Never <code>null</code>.
[ "@Nonnull\n public static DocumentBuilderFactory createDefaultDocumentBuilderFactory ()\n {\n final DocumentBuilderFactory aDocumentBuilderFactory = DocumentBuilderFactory.newInstance ();\n aDocumentBuilderFactory.setNamespaceAware (DEFAULT_DOM_NAMESPACE_AWARE);\n aDocumentBuilderFactory.setValidating (D...
[ "@Override\n public Resource createResource(URI uri) {\n DroolsFactoryImpl.init();\n BpsimFactoryImpl.init();\n JBPMBpmn2ResourceImpl result = new JBPMBpmn2ResourceImpl(uri);\n ExtendedMetaData extendedMetadata = new XmlExtendedMetadata();\n result.getDefaultSaveOptions().put(X...
codesearchnet
{ "query": "Represent the Github description about Healthcare IT:", "pos": "Represent the Github code about Healthcare IT:", "neg": "Represent the Github code about Text generation:" }
Run skesa to assemble genomes
[ "def skesa_assemble(self):\n \n with progressbar(self.metadata) as bar:\n for sample in bar:\n # Initialise the assembly command\n sample.commands.assemble = str()\n try:\n if sample.general.trimmedcorrectedfastqfiles:\n ...
[ "def document_agents(p):\n \n p.comment('agent.py', 'base agent class')\n p.comment('run_agents.py', 'Top level function to run the agents')\n \n p.comment('agent_image_metadata.py', 'agent to collect file picture metadata')\n p.comment('agent_learn_aixi.py', '')\n p.comment('dummy_learn_1.py',...
codesearchnet
{ "query": "Represent the Github text about Bioinformatics:", "pos": "Represent the Github code about Bioinformatics:", "neg": "Represent the Github code:" }
Disassemble a code object. :param co: code object :param lasti: internal :yields: Instructions.
[ "def disassembler(co, lasti= -1):\n \n\n code = co.co_code\n labels = dis.findlabels(code)\n linestarts = dict(dis.findlinestarts(co))\n i = 0\n extended_arg = 0\n lineno = 0\n free = None\n for i, op, oparg in _walk_ops(co):\n if i in linestarts:\n lineno = linestarts[i...
[ "def show(self):\n \n bytecode._Print(\"MAP_LIST SIZE\", self.size)\n for i in self.map_item:\n if i.item != self:\n # FIXME this does not work for CodeItems!\n # as we do not have the method analysis here...\n i.show()" ]
codesearchnet
{ "query": "Represent the Github text about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
// ProcessCurrentState processes current state as read from stateStore
[ "func (ag *Agent) ProcessCurrentState() error {\n\topts := ag.pluginConfig.Instance\n\treadNet := &mastercfg.CfgNetworkState{}\n\treadNet.StateDriver = ag.netPlugin.StateDriver\n\tnetCfgs, err := readNet.ReadAll()\n\tif err == nil {\n\t\tfor idx, netCfg := range netCfgs {\n\t\t\tnet := netCfg.(*mastercfg.CfgNetwork...
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the Github comment about software development:", "pos": "Represent the Github code about software development:", "neg": "Represent the Github code:" }
Valid form: <code>groupId:artifactId</code> @see org.jboss.shrinkwrap.resolver.api.Coordinate#toCanonicalForm()
[ "@Override\n public String toCanonicalForm() {\n return new StringBuilder(groupId).append(SEPARATOR_COORDINATE).append(artifactId).toString();\n }" ]
[ "public String getDependencyJsonModel() throws IOException {\n final Artifact artifact = DataModelFactory.createArtifact(\"\",\"\",\"\",\"\",\"\",\"\",\"\");\n return JsonUtils.serialize(DataModelFactory.createDependency(artifact, Scope.COMPILE));\n }" ]
codesearchnet
{ "query": "Represent the comment about container management:", "pos": "Represent the code about container management:", "neg": "Represent the code about programming:" }
// SetAlias sets the Alias field's value.
[ "func (s *CreateAliasOutput) SetAlias(v *Alias) *CreateAliasOutput {\n\ts.Alias = 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 instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Get source.schema within a {@link InputType#RECORD} type. The source.schema is represented by a {@link JsonArray} @return
[ "public JsonArray getDataTypeValues() {\n if (this.type.equals(RECORD)) {\n return getDataType().get(RECORD_FIELDS_KEY).getAsJsonArray();\n }\n return new JsonArray();\n }" ]
[ "static Optional<AnnotatedValueResolver> ofBeanField(Field field, Set<String> pathParams,\n List<RequestObjectResolver> objectResolvers) {\n // 'Field' is only used for converting a bean.\n // So we always need to pass 'implicitRequestObjectAnnota...
codesearchnet
{ "query": "Represent the text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Healthcare IT:" }