query
stringlengths
16
255
pos
list
neg
list
task
stringclasses
1 value
instruction
dict
get models by some conditions @param array $criteria @param array|null $orderBy @param int|null $limit @param int|null $offset @param bool $withTrash @return static[]
[ "final public static function where(array $criteria, array $orderBy = ['createdAt' => 'DESC'], int $limit = null, int $offset = null, bool $withTrash = false)\n {\n $criteria = self::criteriaWithSoftDelete($criteria, $withTrash);\n return static::getRepository()\n ->findBy($criteria, $or...
[ "public function getPage(int $page, array $options = null)\n {\n\n $params = $this->preparePageParams($page, $options ?? []);\n\n // Log Debug\n $this->flow->getLogger()\n ->debug(\"Retrieving Resource List: $this->endpoint, $page, $this->id\");\n\n // Get the BasicResponse...
codesearchnet
{ "query": "Represent the sentence about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about PHP:" }
Run command_constructor and call run(args) on the resulting object :param command_constructor: class of an object that implements run(args) :param args: object arguments for specific command created by CommandParser
[ "def _run_command(self, command_constructor, args):\n \n verify_terminal_encoding(sys.stdout.encoding)\n self._check_pypi_version()\n config = create_config(allow_insecure_config_file=args.allow_insecure_config_file)\n self.show_error_stack_trace = config.debug_mode\n comma...
[ "def values(*rels):\n '''\n \n '''\n #Action function generator to multiplex a relationship at processing time\n def _values(ctx):\n '''\n Versa action function Utility to specify a list of relationships\n\n :param ctx: Versa context used in processing (e.g. includes the prototyp...
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Used in datasource methods @param string $name @param mixed $default @return mixed
[ "protected function getTemplateVariable($name, $default = null)\n {\n return array_key_exists($name, $this->templateVars)?$this->templateVars[$name]:$default;\n }" ]
[ "public function toFieldDefinition(StorageFieldDefinition $storageDef, FieldDefinition $fieldDef)\n {\n // @todo: Is it possible to store a default value in the DB?\n $fieldDef->defaultValue = new FieldValue();\n $fieldDef->defaultValue->data = array('text' => null);\n }" ]
codesearchnet
{ "query": "Represent the instruction about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
// NormalizeAddresses returns a new slice with all the passed addresses // normalized with the given default port and all duplicates removed.
[ "func NormalizeAddresses(addrs []string, defaultPort string,\n\ttcpResolver tcpResolver) ([]net.Addr, error) {\n\n\tresult := make([]net.Addr, 0, len(addrs))\n\tseen := map[string]struct{}{}\n\n\tfor _, addr := range addrs {\n\t\tparsedAddr, err := ParseAddressString(\n\t\t\taddr, defaultPort, tcpResolver,\n\t\t)\n...
[ "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 post about Computer Science:", "pos": "Represent the code about Computer Science:", "neg": "Represent the code:" }
Generates a configuration file inside our config directory Writes to /config/main.php
[ "private function generateConfigFile($db, $siteName, $key, $debug)\n {\n $user = $db['username'];\n $pass = $db['password'];\n $dsn = $db['dsn'];\n\n $config = \"<?php return array(\n\t 'name' => '{$siteName}',\n\t 'components' => array(\n\t 'db' => array(\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 instruction about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code:" }
// SetNextBuildNumber: Sets the build number that will be used for the // next build.
[ "func (s *Service) SetNextBuildNumber(legacyswarmbucketapisetnextbuildnumberrequest *LegacySwarmbucketApiSetNextBuildNumberRequest) *SetNextBuildNumberCall {\n\tc := &SetNextBuildNumberCall{s: s, urlParams_: make(gensupport.URLParams)}\n\tc.legacyswarmbucketapisetnextbuildnumberrequest = legacyswarmbucketapisetnext...
[ "def finish_parse(self, last_lineno_seen):\n \"\"\"\"\"\"\n if self.state == self.STATES['step_in_progress']:\n # We've reached the end of the log without seeing the final \"step finish\"\n # marker, which would normally have triggered updating the step. As such we\n #...
codesearchnet
{ "query": "Represent the Github summarization about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
Returns the national prefix extracted, or an empty string if it is not present. @return string
[ "private function removeNationalPrefixFromNationalNumber()\n {\n $startOfNationalNumber = 0;\n if ($this->isNanpaNumberWithNationalPrefix()) {\n $startOfNationalNumber = 1;\n $this->prefixBeforeNationalNumber .= '1' . self::$seperatorBeforeNationalNumber;\n $this->i...
[ "def initialize(self, id=None, text=None):\n self.id = none_or(id, int)\n \n\n self.text = none_or(text, str)\n \"\"\"\n Username or IP address of the user at the time of the edit : str | None\n \"\"\"" ]
codesearchnet
{ "query": "Represent the comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Recursively process a parameter while applying filters @param Parameter $param API parameter being processed @param \SimpleXMLElement $node Node being processed @return array
[ "private function recursiveProcess(\n Parameter $param,\n \\SimpleXMLElement $node\n ) {\n $result = [];\n $type = $param->getType();\n\n if ($type == 'object') {\n $result = $this->processObject($param, $node);\n } elseif ($type == 'array') {\n $re...
[ "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 post about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Software Development:" }
Strip connection control and transport encoding headers from the proxy response @param {Object} res - proxy response @return {Object}
[ "function stripProxyResHeaders(res) {\n return Object.entries(res.headers).reduce((memo, header) => {\n const [key, val] = header\n const invalid = [undefined, 'connection', 'content-encoding']\n if (invalid.indexOf(key) === -1) {\n memo[key] = val // eslint-disable-line\n }\n return memo\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 comment about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Assemble and write the XML file.
[ "def assemble_xml_file\n write_xml_declaration do\n # Write the xdr:wsDr element.\n write_drawing_workspace do\n if @embedded\n index = 0\n @drawings.each do |dimensions|\n # Write the xdr:twoCellAnchor element.\n index += 1\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 instruction about File management:", "pos": "Represent the code about File management:", "neg": "Represent the code:" }
// ExecOne acts like Exec, but query must affect only one row. It // returns ErrNoRows error when query returns zero rows or // ErrMultiRows when query returns multiple rows.
[ "func (db *baseDB) ExecOne(query interface{}, params ...interface{}) (Result, error) {\n\treturn db.execOne(context.TODO(), query, params...)\n}" ]
[ "public static function getRankingQueryLimit()\n {\n $configGeneral = Config::getInstance()->General;\n $configLimit = $configGeneral['archiving_ranking_query_row_limit'];\n $limit = $configLimit == 0 ? 0 : max(\n $configLimit,\n $configGeneral['datatable_archiving_maxi...
codesearchnet
{ "query": "Represent the description about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
Add the requested post parameters to the Request. @param request Request to add post params to
[ "private void addPostParams(final Request request) {\n if (username != null) {\n request.addPostParam(\"Username\", username);\n }\n\n if (password != null) {\n request.addPostParam(\"Password\", password);\n }\n }" ]
[ "@Route(method= HttpMethod.GET, uri=\"/{id}\")\n public Result get(@Parameter(\"id\") String id) {\n // The value of id is computed from the {id} url fragment.\n return ok(id);\n }" ]
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code about Programming:" }
Update scope value. Usually on autocorrection. @param {Object} scope - angular $scope object @param {Object} iAttrs - attribute object which contains HTML tag attributes @param {Mixed} - new value
[ "function (scope, iAttrs, newValue) {\n 'use strict';\n var ngModelArr = iAttrs.ngModel.split('.');\n // console.log(JSON.stringify(ngModelArr, null, 2));\n\n\n switch (ngModelArr.length) {\n case 1:\n scope.$apply(function () {scope[ngModelArr[0]] = newValue;});\n break;\n case 2:\n...
[ "function make_event(event, target) {\n return string_p(event)? Event.make(event, target)\n : /* otherwise */ event }" ]
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
a -> height of the curve's peak b -> position of the center of the peak c -> standard deviation or Gaussian RMS width d -> offset
[ "def gaussian(x, a, b, c, d=0):\r\n '''\r\n \r\n '''\r\n return a * np.exp( -(((x-b)**2 )/ (2*(c**2))) ) + d" ]
[ "def gaussian_window(t, params):\n \n window = suspect.basis.gaussian(t, 0, 0, params[\"line_broadening\"])\n\n # the above gaussian function returns an area 1 fid, for a windowing\n # function we need to be area preserving (first point must be 1)\n return window / window[0]" ]
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
Assert if given value is not empty @param value @param {string} message @param {string} id @returns {void}
[ "function isNotEmpty(value, message, id) {\r\n if (message === void 0) { message = ''; }\r\n if (id === void 0) { id = ''; }\r\n if (this.enabled &&\r\n ((typeof value === 'string' && value.length !== 0) ||\r\n (typeof value === 'number' && value !== 0))) {\r\n throw LogicException...
[ "public StringAssert isString() {\n Node node = assertType(STRING);\n return new StringAssert((String) node.getValue()).as(\"Different value found in node \\\"%s\\\"\", path);\n }" ]
codesearchnet
{ "query": "Represent the instruction about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Programming:" }
Returns a QCircuit-based latex diagram of the given circuit. Args: circuit: The circuit to represent in latex. qubit_order: Determines the order of qubit wires in the diagram. Returns: Latex code for the diagram.
[ "def circuit_to_latex_using_qcircuit(\n circuit: circuits.Circuit,\n qubit_order: ops.QubitOrderOrList = ops.QubitOrder.DEFAULT) -> str:\n \n diagram = circuit.to_text_diagram_drawer(\n qubit_namer=qcircuit_qubit_namer,\n qubit_order=qubit_order,\n get_circuit_diagram_info=g...
[ "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 Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// SignTransaction signs a tmp transaction in the wallet with the appropriate // keys from the wallet db // force=true ignores the existing balance and fee overpayment checks.
[ "func (w *Wallet) SignTransaction(name string, force bool) error {\n\ttx, err := w.GetTransaction(name)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif force == false {\n\t\t// check that the address balances are sufficient for the transaction\n\t\tif err := checkCovered(tx); err != nil {\n\t\t\treturn err\n\t\t}\n...
[ "func (r *controller) Update(ctx context.Context, t *api.Task) error {\n\t// TODO(stevvooe): While assignment of tasks is idempotent, we do allow\n\t// updates of metadata, such as labelling, as well as any other properties\n\t// that make sense.\n\treturn nil\n}" ]
codesearchnet
{ "query": "Represent the comment:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
Execute the command. @return void
[ "public function fire()\n {\n try {\n (new CriteriaGenerator([\n 'name' => $this->argument('name'),\n 'force' => $this->option('force'),\n ]))->run();\n\n $this->info(\"Criteria created successfully.\");\n } catch (FileAlreadyExistsExce...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Execute the SQL statement. @return mixed A database cursor resource on success, boolean false on failure. @since 1.0 @throws \Exception @throws \RuntimeException
[ "public function execute()\n\t{\n\t\t$this->connect();\n\n\t\tif (!is_resource($this->connection))\n\t\t{\n\t\t\t$this->log(\n\t\t\t\tLog\\LogLevel::ERROR,\n\t\t\t\t'Database query failed (error #{code}): {message}',\n\t\t\t\tarray('code' => $this->errorNum, 'message' => $this->errorMsg)\n\t\t\t);\n\t\t\tthrow new ...
[ "public static function getDatabaseConfig($dbConfig = null)\n {\n $config = Config::getInstance();\n\n if (is_null($dbConfig)) {\n $dbConfig = $config->database;\n }\n\n /**\n * Triggered before a database connection is established.\n *\n * This even...
codesearchnet
{ "query": "Represent the post about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code about Programming:" }
Save index to data structure. :param in_place: Do not copy index value to a new list object :type in_place: bool :return: Index data structure :rtype: list
[ "def save_to_data(self, in_place=False):\n \n if in_place:\n return [\n list(self._index.items()),\n list(self._undefined_keys.keys())\n ]\n return (\n [(key, values[:]) for key, values in self._index.items()],\n list(sel...
[ "def arg_to_array(func):\n \n def fn(self, arg, *args, **kwargs):\n \"\"\"Function\n\n Parameters\n ----------\n arg : array-like\n Argument to convert.\n *args : tuple\n Arguments.\n **kwargs : dict\n Keyword arguments.\n\n Ret...
codesearchnet
{ "query": "Represent the comment:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Auto Generated Code
[ "def logical_chassis_fwdl_status_output_cluster_fwdl_entries_fwdl_entries_message_id(self, **kwargs):\n \n config = ET.Element(\"config\")\n logical_chassis_fwdl_status = ET.Element(\"logical_chassis_fwdl_status\")\n config = logical_chassis_fwdl_status\n output = ET.SubElement(lo...
[ "public File getExistingFile(final String param) {\n return get(param, getFileConverter(),\n new And<>(new FileExists(), new IsFile()),\n \"existing file\");\n }" ]
codesearchnet
{ "query": "Represent the Github summarization about Natural Language Processing:", "pos": "Represent the Github code about Natural Language Processing:", "neg": "Represent the Github code about File management:" }
// Returns the size of the 0MQ thread pool in the current default context.
[ "func GetIoThreads() (int, error) {\n\tif initVersionError != nil {\n\t\treturn 0, initVersionError\n\t}\n\tif initContextError != nil {\n\t\treturn 0, initContextError\n\t}\n\treturn nr_of_threads, nil\n}" ]
[ "def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR...
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Converts a hex string representation to a byte array. @param hex the string holding the hex values @return the resulting byte array
[ "public static byte[] asByteArray(String hex) {\n byte[] bts = new byte[hex.length() / 2];\n for (int i = 0; i < bts.length; i++) {\n bts[i] = (byte) Integer.parseInt(hex.substring(2 * i, 2 * i + 2),\n 16);\n }\n\n return bts;\n }" ]
[ "def create_response_pdu(self, data):\n \n log.debug('Create single bit response pdu {0}.'.format(data))\n bytes_ = [data[i:i + 8] for i in range(0, len(data), 8)]\n\n # Reduce each all bits per byte to a number. Byte\n # [0, 0, 0, 0, 0, 1, 1, 1] is intepreted as binary en is deci...
codesearchnet
{ "query": "Represent the sentence about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Software development:" }
// SetSourceUrl sets the SourceUrl field's value.
[ "func (s *AwsSecurityFinding) SetSourceUrl(v string) *AwsSecurityFinding {\n\ts.SourceUrl = &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 summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Insert document, it must be new if there is ``_id`` in it.
[ "def insert(self, resource, doc_or_docs, **kwargs):\n \"\"\"\"\"\"\n ids = []\n kwargs.update(self._es_args(resource))\n for doc in doc_or_docs:\n self._update_parent_args(resource, kwargs, doc)\n _id = doc.pop('_id', None)\n res = self.elastic(resource)....
[ "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 Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Natural Language Processing:" }
Resolves a given group ID and command name to the path. @param string $groupID @param string $command @return string @throws \InvalidArgumentException
[ "function resolveCommandPath(string $groupID, string $command) {\n $paths = array();\n \n foreach($this->commandsDirectories as $dir) {\n $paths[] = $dir.'/'.\\mb_strtolower($groupID);\n }\n \n $paths[] = __DIR__.'/Commands/'.\\mb_strtolower($groupID);\n $...
[ "function validateService($pluginInstance)\n {\n if (! is_object($pluginInstance) )\n throw new \\Exception(sprintf('Can`t resolve to (%s) Instance.', $pluginInstance));\n\n if (!$pluginInstance instanceof aGrantRequest)\n throw new exContainerInvalidServiceType('Invalid Plugi...
codesearchnet
{ "query": "Represent the summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }
Reads the next value from the server. @return mixed The next value from the server, or null if there is none
[ "public function read()\n {\n $batch = [OP_RECV_MESSAGE => true];\n if ($this->metadata === null) {\n $batch[OP_RECV_INITIAL_METADATA] = true;\n }\n $read_event = $this->call->startBatch($batch);\n if ($this->metadata === null) {\n $this->metadata = $read_...
[ "function onChunk(count) {\n // If chunk read has no bytes than there is nothing left, so end a\n // collection.\n if (count === 0) return next(end)\n\n // Move a offset `position` with `count` towards the end unless\n // position was a `null` in which case we just keep it (`null` means\n ...
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about File management:" }
generate DataFrame of weighted sums. Parameters ---------- df_WS_data : type Description of parameter `df_WS_data`. Returns ------- type Description of returned object.
[ "def gen_WS_DF(df_WS_data):\n \n df_fs = gen_FS_DF(df_WS_data)\n\n list_index = [('mean', 'T2'), ('max', 'T2'), ('min', 'T2'),\n ('mean', 'U10'), ('max', 'U10'), ('min', 'U10'),\n ('mean', 'RH2'), ('max', 'RH2'), ('min', 'RH2'),\n ('mean', 'Kdown')]\n\n ...
[ "def arg_to_array(func):\n \n def fn(self, arg, *args, **kwargs):\n \"\"\"Function\n\n Parameters\n ----------\n arg : array-like\n Argument to convert.\n *args : tuple\n Arguments.\n **kwargs : dict\n Keyword arguments.\n\n Ret...
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Set value with pre-validated alarm and timeStamp
[ "def set_value_alarm_ts(self, value, alarm, ts):\n \"\"\"\"\"\"\n # type: (Any, Alarm, TimeStamp) -> None\n with self.notifier.changes_squashed:\n # Assume they are of the right format\n self.value = value\n self.notifier.add_squashed_change(self.path + [\"value...
[ "def transform_cb(self, setting, value):\n \"\"\"\"\"\"\n self.make_callback('transform')\n\n # whence=0 because need to calculate new extents for proper\n # cutout for rotation (TODO: always make extents consider\n # room for rotation)\n whence = 0\n self.redraw(wh...
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Sets the password on the users model. @return Model
[ "public function handle() : Model\n {\n if ($this->hasPasswordColumn()) {\n $password = $this->canSync() ?\n $this->password() : Str::random();\n\n if ($this->passwordNeedsUpdate($password)) {\n $this->applyPassword($password);\n }\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 comment about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code about Programming:" }
Add an option @param <T> @param name Option name Option name without @param description Option description @param exclusiveGroup A group of options. Only options of a single group are accepted. @param defValue Option default value
[ "public final <T> void addOption(String name, String description, String exclusiveGroup, T defValue)\r\n {\r\n Option opt = new Option(name, description, exclusiveGroup, defValue);\r\n Option old = map.put(name, opt);\r\n if (old != null)\r\n {\r\n throw new IllegalArgument...
[ "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:" }
Add a new connection and session to a pool. :param str pid: The pool id :type connection: psycopg2.extensions.connection :param connection: The connection to add to the pool
[ "def add(cls, pid, connection):\n \n with cls._lock:\n cls._ensure_pool_exists(pid)\n cls._pools[pid].add(connection)" ]
[ "def get_cursor(self, instance, db_key, db_name=None):\n '''\n \n '''\n conn_key = self._conn_key(instance, db_key, db_name)\n try:\n conn = self.connections[conn_key]['conn']\n except KeyError:\n # We catch KeyError to avoid leaking the auth info used...
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Programming:" }
角色观察(从模型中加载所有词语对应的所有角色,允许进行一些规则补充) @param wordSegResult 粗分结果 @return
[ "public static List<EnumItem<NR>> roleObserve(List<Vertex> wordSegResult)\n {\n List<EnumItem<NR>> tagList = new LinkedList<EnumItem<NR>>();\n Iterator<Vertex> iterator = wordSegResult.iterator();\n iterator.next();\n tagList.add(new EnumItem<NR>(NR.A, NR.K)); // 始##始 A K\n wh...
[ "protected static void fixResultByRule(List<Vertex> linkedArray)\n {\n\n //--------------------------------------------------------------------\n //Merge all seperate continue num into one number\n mergeContinueNumIntoOne(linkedArray);\n\n //-------------------------------------------...
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about text processing:" }
Whether parameter is set @param string $name @return bool
[ "public function has($name)\n {\n $keys = explode('.', $name);\n\n $lastBranch = $this->loadConfig();\n foreach ($keys as $keyName) {\n if (isset($lastBranch[$keyName]) && (is_array($lastBranch) || is_object($lastBranch))) {\n if (is_array($lastBranch)) {\n ...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
check if the structure of the frame is conform to the basic frame structure defined by the standard :param structure_description: string-list reflecting LLDP-msg structure
[ "def _frame_structure_check(structure_description):\n \n\n standard_frame_structure = [LLDPDUChassisID.__name__,\n LLDPDUPortID.__name__,\n LLDPDUTimeToLive.__name__,\n '<...>',\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 description:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Install limited bcbio_system.yaml file for setting core and memory usage. Adds any non-specific programs to the exposed bcbio_system.yaml file, only when upgrade happening inside a docker container.
[ "def _install_container_bcbio_system(datadir):\n \n base_file = os.path.join(datadir, \"config\", \"bcbio_system.yaml\")\n if not os.path.exists(base_file):\n return\n expose_file = os.path.join(datadir, \"galaxy\", \"bcbio_system.yaml\")\n expose = set([\"memory\", \"cores\", \"jvm_opts\"])\n...
[ "def list_nodes(self):\n \"\"\"\"\"\"\n self.add_environment_file(user='stack', filename='stackrc')\n ret, _ = self.run(\"ironic node-list --fields uuid|awk '/-.*-/ {print $2}'\", user='stack')\n # NOTE(Gonéri): the good new is, the order of the nodes is preserved and follow the one from...
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Technology:" }
// SetLongitude sets the Longitude optional argument. Mock longitude
[ "func (a *SetGeolocationOverrideArgs) SetLongitude(longitude float64) *SetGeolocationOverrideArgs {\n\ta.Longitude = &longitude\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 text:", "pos": "Represent the code:", "neg": "Represent the code:" }
Moved to DbHelper @deprecated
[ "@Deprecated \r\n\tprivate String convertDatabaseName(String name) {\r\n\t\tif (propBase.getBooleanProperty(\"db.useUnderscoreNaming\")) {\r\n\t\t\tname = CamelCaseConverter.camelCaseToUnderscore(name);\r\n\t\t}\r\n\t\tname = truncateLongDatabaseName(name);\r\n\t\tname = name.toUpperCase();\r\n\t\treturn name;\r\n\...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code:" }
Generate the interface for the documentation builder.
[ "protected void generateIEcoreDocumentationBuilder() {\n\t\tfinal TypeReference builder = getIEcoreDocumentationBuilder();\n\t\tfinal StringConcatenationClient content = new StringConcatenationClient() {\n\t\t\t@Override\n\t\t\tprotected void appendTo(TargetStringConcatenation it) {\n\t\t\t\tit.append(\"/** Build a...
[ "@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 post about Text generation:", "pos": "Represent the code about Text generation:", "neg": "Represent the code about programming:" }
Given a string, return a list of index positions where a character/non blank space exists. :param line: :return: >>> mark_list(" a b c") [1, 3, 5]
[ "def mark_list(line: str) -> List[int]:\n \n marks = []\n for idx, car in enumerate(list(line)):\n if car != \" \":\n marks.append(idx)\n return marks" ]
[ "def sanitizeString(name):\n \"\"\"\"\"\"\n newString = name\n # string cleaning, pass 1\n replaceTable = [\n ('^', '^5e'), # we need to do this one first\n ('\"', '^22'),\n ('<', '^3c'),\n ('?', '^3f'),\n ('*', '^2a'),\n ('=', '^3d'),\n ('+', '^2b'),\n ...
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Data processing:" }
Get encoded custom filters for passing along to BrowseboxController. @param Boolean $encoded Pass FALSE if you wish to retrieve the raw array @return String
[ "public function getFilters($encoded = true) {\n $out = array();\n foreach ($this->_filters as $filterId => $params) {\n $out[] = $filterId.':'.implode(Garp_Browsebox::BROWSEBOX_QUERY_FILTER_PROP_SEPARATOR, $params);\n }\n $out = implode(Garp_Browsebox::BROWSEBOX_QUERY_FILTER_...
[ "function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co...
codesearchnet
{ "query": "Represent the summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Undeploy event. @param event event to observe
[ "public void undeploy(@Observes final BeforeStop event) {\n if (extensionEnabled()) {\n debug(\"Catching BeforeStop event {0}\", event.toString());\n undeployDeployments = true;\n undeployEvent.fire(new UnDeployManagedDeployments());\n }\n }" ]
[ "def postloop(self):\n \n cmd.Cmd.postloop(self) # Clean up command completion\n d1_cli.impl.util.print_info(\"Exiting...\")" ]
codesearchnet
{ "query": "Represent the Github post about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Software development:" }
returns an Iterator that iterates Objects of class c if calling the .next() method. The Elements returned come from a SELECT ... WHERE Statement that is defined by the Query query. If itemProxy is null, no proxies are used.
[ "public Iterator getIteratorByQuery(Query query) throws PersistenceBrokerException\n {\n Class itemClass = query.getSearchClass();\n ClassDescriptor cld = getClassDescriptor(itemClass);\n return getIteratorFromQuery(query, cld);\n }" ]
[ "NameAndType nameType(Symbol sym) {\n return new NameAndType(sym.name, sym.externalType(types), types);\n // the NameAndType is generated from a symbol reference, and the\n // adjustment of adding an additional this$n parameter needs to be made.\n }" ]
codesearchnet
{ "query": "Represent the instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Sets the number of rows in the raster (if columns have not been initialized, set to 1 as well)
[ "def setRows(self, rows):\n \n self._raster[0] = rows\n if self._raster[1] == 0:\n self._raster[1] = 1" ]
[ "def handle_dims(opts):\n '''\n \n '''\n use,res = [],[];\n if opts['--X']:\n use.append('x');\n res.append(int(opts['--xres']));\n if opts['--Y']:\n use.append('y');\n res.append(int(opts['--yres']));\n if opts['--Z']:\n use.append('z');\n res.append(i...
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Index interface. @param Content $content @return Content
[ "public function index(Content $content)\n {\n return $content\n ->header(trans('admin.menu'))\n ->description(trans('admin.list'))\n ->row(function (Row $row) {\n $row->column(6, $this->treeView()->render());\n\n $row->column(6, function (Col...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Removes the language if there is no object having translation in it. \return True if the language was removed from the site, false otherwise.
[ "function removeThis()\n {\n if ( ($this->objectCount() > 0) or ($this->classCount() > 0) )\n {\n return false;\n }\n\n $this->remove();\n\n eZContentCacheManager::clearAllContentCache();\n\n eZContentLanguage::fetchList( true );\n\n return true;\n }...
[ "def get_render_language(contentitem):\n \n plugin = contentitem.plugin\n\n if plugin.render_ignore_item_language \\\n or (plugin.cache_output and plugin.cache_output_per_language):\n # Render the template in the current language.\n # The cache also stores the output under the current lang...
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Language and programming:" }
Creates the separators for an area using the selected algorithm @param root the root area @return the created separator set
[ "public static SeparatorSet createSeparators(AreaImpl root)\n {\n SeparatorSet sset;\n //sset = new SeparatorSetHV(root);\n sset = new SeparatorSetHVS(root);\n //sset = new SeparatorSetColumns(root);\n //sset = new SeparatorSetSim(root);\n //sset = new SeparatorSetGrid(r...
[ "def transform_cb(self, setting, value):\n \"\"\"\"\"\"\n self.make_callback('transform')\n\n # whence=0 because need to calculate new extents for proper\n # cutout for rotation (TODO: always make extents consider\n # room for rotation)\n whence = 0\n self.redraw(wh...
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Auto Generated Code
[ "def OSPFNeighborState_originator_switch_info_switchIpV4Address(self, **kwargs):\n \n config = ET.Element(\"config\")\n OSPFNeighborState = ET.SubElement(config, \"OSPFNeighborState\", xmlns=\"http://brocade.com/ns/brocade-notification-stream\")\n originator_switch_info = ET.SubElement(O...
[ "public File getExistingFile(final String param) {\n return get(param, getFileConverter(),\n new And<>(new FileExists(), new IsFile()),\n \"existing file\");\n }" ]
codesearchnet
{ "query": "Represent the Github post about Natural Language Processing:", "pos": "Represent the Github code about Natural Language Processing:", "neg": "Represent the Github code about File management:" }
Data collector expected - <number> | <string[]>, count or keys
[ "function Collector(expected) {\n this.expectKeys = Array.isArray(expected) ? new Set(expected) : null;\n this.expected = this.expectKeys ? expected.length : expected;\n this.keys = new Set();\n this.count = 0;\n this.timer = null;\n this.onDone = common.emptiness;\n this.isDistinct = false;\n this.isDone =...
[ "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 Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
@param bool $ignoreUnknownTrackTypes Optional parameter used to skip unknown track types by passing true. The default behavior (false) is throw an exception on unknown track types. @return MediaInfoContainer
[ "public function getMediaInfoContainer($ignoreUnknownTrackTypes = false)\n {\n if ($this->parsedOutput === null) {\n throw new \\Exception('You must run `parse` before running `getMediaInfoContainer`');\n }\n\n $mediaInfoContainerBuilder = new MediaInfoContainerBuilder();\n ...
[ "protected function getSingleFieldValue($value, FieldDefinition $fieldDefinition, $contentTypeIdentifier, array $context = array())\n {\n // booleans were handled here. They are now handled as complextypes\n\n // q: do we really want this to happen by default on all scalar field values?\n //...
codesearchnet
{ "query": "Represent the Github instruction about Java programming:", "pos": "Represent the Github code about Java programming:", "neg": "Represent the Github code about Programming:" }
Checks if is UT f8 value. @param clazz the clazz @return true, if is UT f8 value
[ "private static boolean isUTF8Value(Class<?> clazz)\n {\n return (clazz.isAssignableFrom(BigDecimal.class))\n || (clazz.isAssignableFrom(BigInteger.class) || (clazz.isAssignableFrom(String.class))\n || (clazz.isAssignableFrom(char.class)) || (clazz.isAssignableFrom(Ch...
[ "public void initFunctionData(int parametersCount) {\n params = new CallParameter[parametersCount];\n for (int i = 0; i < parametersCount; i++) {\n params[i] = new CallParameter();\n if (i > 0) {\n params[i].setInput(true);\n }\n }\n // the query was in the form {?=call function()}...
codesearchnet
{ "query": "Represent the Github text about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
Maps xml attribute to instance node property and setups bindings
[ "def apply_attribute(node: Node, attr: XmlAttr):\n \"\"\"\"\"\"\n setter = get_setter(attr)\n stripped_value = attr.value.strip() if attr.value else ''\n if is_expression(stripped_value):\n (binding_type, expr_body) = parse_expression(stripped_value)\n binder().apply(binding_type, node=nod...
[ "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 post about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
get initial module from licenseserver @param $id @throws \Exception @throws \PropelException @throws \Slashworks\AppBundle\Controller\AccessDeniedException @throws \Slashworks\libs\Exception
[ "public function generateInitialApiZipAction($id)\n {\n\n\n\n /** @var RemoteApp $oRemoteApp */\n $oRemoteApp = RemoteAppQuery::create()->findOneById($id);\n if (!$this->check4Client($oRemoteApp->getCustomerId())) {\n throw new AccessDeniedException();\n ...
[ "public function getTokenStatusDescriptionForBridge(\\MUtil_Model_Bridge_TableBridgeAbstract $bridge, $addDescription = false)\n {\n return \\MUtil_Lazy::method($this, 'getStatusDescription', $bridge->getLazy('token_status'));\n }" ]
codesearchnet
{ "query": "Represent the summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Callback method for rule tree traversing. Will be called at proper time from :py:class:`pynspect.rules.ListRule.traverse` method. :param pynspect.rules.Rule rule: Reference to rule. :param dict kwargs: Optional callback arguments.
[ "def list(self, rule, **kwargs):\n \n return '<ul class=\"pynspect-rule-list\">{}</ul>'.format(''.join(['<li class=\"pynspect-rule-list-item\">{}</li>'.format(v.traverse(self, **kwargs)) for v in rule.value]))" ]
[ "def _get_parsing_plan_for_multifile_children(self, obj_on_fs: PersistedObject, desired_type: Type[Any],\n logger: Logger) -> Dict[str, Any]:\n \n raise Exception('This should never happen, since this parser relies on underlying parsers')" ]
codesearchnet
{ "query": "Represent the Github text about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
Writes back hints file.
[ "public static void writeHints(File file, Map<String,List<Long>> hints) throws IOException {\n Closer closer = Closer.create();\n try {\n BufferedWriter w = closer.register(Files.newWriter(file, Charsets.UTF_8));\n if (!(hints instanceof SortedMap)) {\n hints = new TreeMap<String,List<Long>>(...
[ "def postloop(self):\n \n cmd.Cmd.postloop(self) # Clean up command completion\n d1_cli.impl.util.print_info(\"Exiting...\")" ]
codesearchnet
{ "query": "Represent the Github summarization about writing:", "pos": "Represent the Github code about writing:", "neg": "Represent the Github code about Software development:" }
--------------------------------------------------------------------------- fio.filedecode() ファイルデータ(文字列)からのデコード実行関数 ---------------------------------------------------------------------------
[ "function(datastr){\n\t\tvar puzzle = this.puzzle, bd = puzzle.board, pzl = pzpr.parser.parseFile(datastr, puzzle.pid);\n\t\tvar filetype = this.currentType = pzl.type;\n\n\t\tbd.initBoardSize(pzl.cols, pzl.rows);\n\n\t\tthis.filever = pzl.filever;\n\t\tif(filetype!==pzl.FILE_PBOX_XML){\n\t\t\tthis.lineseek = 0;\n\...
[ "public function correctEncoding(string $binary): string\n {\n if (mb_check_encoding($binary, 'UTF-8')) {\n $fromEncoding = 'UTF-8';\n } else {\n $fromEncoding = mb_detect_encoding($binary, self::ENCODING_DETECTION_ORDER);\n if (!$fromEncoding) {\n th...
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
// SetEngineType sets the EngineType field's value.
[ "func (s *BrokerInstanceOption) SetEngineType(v string) *BrokerInstanceOption {\n\ts.EngineType = &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 summarization about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
This methods creates a SASets object which you can use to run various analytics. See the sasets.py module. :return: sasets object
[ "def sasets(self) -> 'SASets':\n \n if not self._loaded_macros:\n self._loadmacros()\n self._loaded_macros = True\n return SASets(self)" ]
[ "def values(*rels):\n '''\n \n '''\n #Action function generator to multiplex a relationship at processing time\n def _values(ctx):\n '''\n Versa action function Utility to specify a list of relationships\n\n :param ctx: Versa context used in processing (e.g. includes the prototyp...
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// Validate validates this label configuration spec
[ "func (m *LabelConfigurationSpec) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validateUser(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\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 text about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Method: drawExternalGraphic Called to draw External graphics. Parameters: geometry - {<OpenLayers.Geometry>} style - {Object} featureId - {String}
[ "function(geometry, style, featureId) {\n var img = new Image();\n\n var title = style.title || style.graphicTitle; \n if (title) {\n img.title = title; \n }\n\n var width = style.graphicWidth || style.graphicHeight;\n var height = style.graphicH...
[ "function parse_drawing(data, rels) {\n\tif(!data) return \"??\";\n\t/*\n\t Chartsheet Drawing:\n\t - 20.5.2.35 wsDr CT_Drawing\n\t - 20.5.2.1 absoluteAnchor CT_AbsoluteAnchor\n\t - 20.5.2.16 graphicFrame CT_GraphicalObjectFrame\n\t - 20.1.2.2.16 graphic CT_GraphicalObject\n\t - 20.1.2.2.17 gr...
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// parseSecureCopy will parse a command and return if it's secure copy or not.
[ "func parseSecureCopy(path string) (string, string, bool, error) {\n\tparts := strings.Fields(path)\n\tif len(parts) == 0 {\n\t\treturn \"\", \"\", false, trace.BadParameter(\"no executable found\")\n\t}\n\n\t// Look for the -t flag, it indicates that an upload occurred. The other\n\t// flags do no matter for now.\...
[ "def file_or_token(value):\n \n if isfile(value):\n with open(value) as fd:\n return fd.read().strip()\n\n if any(char in value for char in '/\\\\.'):\n # This chars will never be in a token value, but may be in a path\n # The error message will be handled by the parser\n ...
codesearchnet
{ "query": "Represent the sentence about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
Splits the given parameter String into the query part and the cms specific arguments.<p> @param param the parameter String to parse @return a map containing the arguments
[ "private Map<String, String> getParamsAsMap(String param) {\n\n Map<String, String> result = new HashMap<String, String>();\n if (param != null) {\n int in = (param.indexOf('|'));\n if (in != -1) {\n String solrPart = param.substring(0, in);\n String...
[ "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 instruction about Documentation:", "pos": "Represent the code about Documentation:", "neg": "Represent the code about programming:" }
Sets {@link File} properties, such as {@link File#mimeType} and {@link File#encoding}, based on the given HTTP response @param {File} file - The File object whose properties are set @param {IncomingMessage} res - The HTTP response
[ "function setHttpMetadata (file, res) {\n var header = res.headers['content-type'];\n\n if (header && typeof header === 'string') {\n var parsed = contentType.parse(header);\n\n file.mimeType = lowercase(parsed.type);\n file.encoding = lowercase(parsed.parameters.charset || null);\n }\n}" ]
[ "function (options) {\n _.isString(options) && (options = { mode: 'raw', raw: options });\n if (!options.mode) { return; } // need a valid mode @todo raise error?\n\n var mode = RequestBody.MODES[options.mode.toString().toLowerCase()] || RequestBody.MODES.raw,\n urlencoded = options....
codesearchnet
{ "query": "Represent the post about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about PHP:" }
Busca os clientes a partir do documento. @param Request $request @return Response @Route("/clientes", name="novosga_triage_clientes", methods={"GET"})
[ "public function clientes(Request $request)\n {\n $envelope = new Envelope();\n $documento = $request->get('q');\n $clientes = $this\n ->getDoctrine()\n ->getManager()\n ->getRepository(Cliente::class)\n ->findByDocumento(\"{$documento}%\");\n ...
[ "public JSONObject find(HashMap<String, String> params) throws JSONException { \n return oClient.get(\"/profiles/v2/search/providers\", params);\n }" ]
codesearchnet
{ "query": "Represent the Github comment about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code about text processing:" }
Interprets and returns menu data. @return array [ layout, permissionsIndex ]
[ "protected function interpretMenuData()\n {\n $layout = $this->configInterpreter->interpretLayout($this->core->moduleConfig('menu.layout', []));\n\n return [\n $layout,\n $this->permissionsFilter->buildPermissionsIndex($layout)\n ];\n }" ]
[ "def getKeySequenceCounter(self):\n \"\"\"\"\"\"\n print '%s call getKeySequenceCounter' % self.port\n keySequence = ''\n keySequence = self.__sendCommand(WPANCTL_CMD + 'getprop -v Network:KeyIndex')[0]\n return keySequence" ]
codesearchnet
{ "query": "Represent the Github summarization about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code:" }
Subscribes an event handler for an event class type. @param clazz an event class @param handler an event handler
[ "public void subscribe(final Class<? extends T> clazz, final EventHandler<? extends T> handler) {\n lock.writeLock().lock();\n try {\n List<EventHandler<? extends T>> list = clazzToListOfHandlersMap.get(clazz);\n if (list == null) {\n list = new LinkedList<EventHandler<? extends T>>();\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 instruction about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Software development:" }
Locate matching detection points configuration from server-side config file. @param search detection point that has been added to the system @return DetectionPoint populated with configuration information from server-side config
[ "public Collection<DetectionPoint> findDetectionPoints(DetectionPoint search) {\n\t\tCollection<DetectionPoint> matches = new ArrayList<DetectionPoint>();\n\n\t\tfor (DetectionPoint configuredDetectionPoint : getDetectionPoints()) {\n\t\t\tif (configuredDetectionPoint.typeMatches(search)) {\n\t\t\t\tmatches.add(con...
[ "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 sentence about network configuration:", "pos": "Represent the Github code about network configuration:", "neg": "Represent the Github code about programming:" }
Loads an array with data about UrlWildcards (paged). @param mixed $offset @param mixed $limit @return array
[ "public function loadUrlWildcardsData($offset = 0, $limit = -1)\n {\n $limit = $limit === -1 ? self::MAX_LIMIT : $limit;\n\n /** @var $query \\eZ\\Publish\\Core\\Persistence\\Database\\SelectQuery */\n $query = $this->dbHandler->createSelectQuery();\n $query->select(\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:" }
// NewKeyPair generates a new SSH key pair using the specified // CreateKeyPairConfig.
[ "func NewKeyPair(config CreateKeyPairConfig) (KeyPair, error) {\n\tif config.Type == Default {\n\t\tconfig.Type = Ecdsa\n\t}\n\n\tswitch config.Type {\n\tcase Ecdsa:\n\t\treturn newEcdsaKeyPair(config)\n\tcase Rsa:\n\t\treturn newRsaKeyPair(config)\n\t}\n\n\treturn KeyPair{}, fmt.Errorf(\"Unable to generate new key...
[ "@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:" }
/* (non-Javadoc) @see org.joml.Vector2ic#maxComponent()
[ "public int maxComponent() {\n int absX = Math.abs(x);\n int absY = Math.abs(y);\n if (absX >= absY)\n return 0;\n return 1;\n }" ]
[ "public static List<Point2D_F64> convert_I32_F64(List<Point2D_I32> points) {\n\t\treturn convert_I32_F64(points,null).toList();\n\t}" ]
codesearchnet
{ "query": "Represent the instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Partially taken from typing.get_type_hints. Resolve string or ForwardRef annotations into type objects if possible.
[ "def resolve_annotations(raw_annotations: Dict[str, AnyType], module_name: Optional[str]) -> Dict[str, AnyType]:\n \n if module_name:\n base_globals: Optional[Dict[str, Any]] = sys.modules[module_name].__dict__\n else:\n base_globals = None\n annotations = {}\n for name, value in raw_an...
[ "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 Github instruction about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
Returns a default SubjectGuide model for the passed campus: seattle, bothell, tacoma
[ "def get_default_subject_guide(campus='seattle'):\n \n url = \"{}/{}/{}\".format(subject_guide_url_prefix, 'defaultGuide', campus)\n headers = {'Accept': 'application/json'}\n\n response = SubjectGuide_DAO().getURL(url, headers)\n\n if response.status != 200:\n raise DataFailureException(url, ...
[ "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 sentence:", "pos": "Represent the code:", "neg": "Represent the code about Natural Language Processing:" }
@see \ZfcDatagrid\Renderer\AbstractRenderer::getSortConditions() @return array @throws \Exception
[ "public function getSortConditions()\n {\n if (is_array($this->sortConditions)) {\n // set from cache! (for export)\n return $this->sortConditions;\n }\n\n $request = $this->getRequest();\n\n $optionsRenderer = $this->getOptionsRenderer();\n $parameterName...
[ "protected function loadStructure()\n {\n // Method ajaxTreeView is in TreeView.php - watch out!\n $response = new Response(\n $this->getDataContainer()->ajaxTreeView($this->getAjaxId(), (int) $this->getPost('level'))\n );\n\n throw new ResponseException($response);\n }"...
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
// UnmarshalJSON sets the object from the provided JSON representation
[ "func (l *ConfigConfigurationRecorderRecordingGroupList) UnmarshalJSON(buf []byte) error {\n\t// Cloudformation allows a single object when a list of objects is expected\n\titem := ConfigConfigurationRecorderRecordingGroup{}\n\tif err := json.Unmarshal(buf, &item); err == nil {\n\t\t*l = ConfigConfigurationRecorder...
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Deletes an attributes from a node. @param {DOMElement} node @param {string} name
[ "function (node, name) {\n\t node.removeAttribute(name);\n\t if (process.env.NODE_ENV !== 'production') {\n\t ReactDOMInstrumentation.debugTool.onDeleteValueForProperty(node, name);\n\t ReactInstrumentation.debugTool.onHostOperation(ReactDOMComponentTree.getInstanceFromNode(node)._debugID, 'remove a...
[ "public ClientlibLink withHash(String newHash) {\n return new ClientlibLink(type, kind, path, properties, newHash);\n }" ]
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about text processing:" }
// Get the ipv6_configuration_mode field of the given PIF.
[ "func (_class PIFClass) GetIpv6ConfigurationMode(sessionID SessionRef, self PIFRef) (_retval Ipv6ConfigurationMode, _err error) {\n\t_method := \"PIF.get_ipv6_configuration_mode\"\n\t_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf(\"%s(%s)\", _method, \"session_id\"), sessionID)\n\tif _err != nil {\n\t\tr...
[ "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 about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Technology:" }
Removes the given coupon code and its effects from the basket. @param string $code Coupon code entered by the user @throws Controller_Frontend_Basket_Exception if the coupon code is invalid
[ "public function deleteCoupon( $code )\n\t{\n\t\t$manager = MShop_Factory::createManager( $this->_getContext(), 'coupon' );\n\n\t\t$search = $manager->createSearch();\n\t\t$search->setConditions( $search->compare( '==', 'coupon.code.code', $code ) );\n\t\t$search->setSlice( 0, 1 );\n\n\t\t$result = $manager->search...
[ "protected function checkRequirements()\n {\n parent::checkRequirements();\n\n // verify there is at least one item added\n if (empty($this->items) || $this->items->count() === 0) {\n throw new \\Genesis\\Exceptions\\ErrorParameter('Empty (null) required parameter: items');\n ...
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
//FromOAuthClient creates an APIKey instance from an oauthservice.Oauth2Client
[ "func FromOAuthClient(client *oauthservice.Oauth2Client) APIKey {\n\tapiKey := APIKey{\n\t\tCallbackURL: client.CallbackURL,\n\t\tClientCredentialsGrantType: client.ClientCredentialsGrantType,\n\t\tLabel: client.Label,\n\t\tSecret: client.Secret,\n\t}\n\treturn apiKey\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 description:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Programming:" }
// Clean does some clean work.
[ "func (r *RetryInfo) Clean() {\n\tr.currRetryOff = 0\n\tif len(r.autoIncrementIDs) > 0 {\n\t\tr.autoIncrementIDs = r.autoIncrementIDs[:0]\n\t}\n\tif len(r.DroppedPreparedStmtIDs) > 0 {\n\t\tr.DroppedPreparedStmtIDs = r.DroppedPreparedStmtIDs[:0]\n\t}\n}" ]
[ "def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR...
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
documentation inherited from interface
[ "public boolean displayMessage (ChatMessage msg, boolean alreadyDisplayed)\n {\n // see if we're full, and if so, clear out a bunch of old stuff\n int adjusted;\n if (size() == MAX_HISTORY) {\n removeRange(0, PRUNE_HISTORY);\n adjusted = PRUNE_HISTORY;\n\n } else...
[ "def surface(self, canvas, X, Y, Z, color=None, label=None, **kwargs):\n \n raise NotImplementedError(\"Implement all plot functions in AbstractPlottingLibrary in order to use your own plotting library\")" ]
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code:" }
Registers a service provider. @param ServiceProviderInterface $provider A ServiceProviderInterface instance @param array $values An array of values that customizes the provider @return Application
[ "public function register(ServiceProviderInterface $provider, array $values = array())\n {\n $this->providers[] = $provider;\n $container = $this->container;\n $container->register($provider, $values);\n\n return $container;\n }" ]
[ "public function createService(ServiceLocatorInterface $serviceLocator)\n {\n $routeCollection = new RouteCollection();\n $requestContext = $serviceLocator->get('RouterRequestContext');\n $routerOptions = array();\n\n $logger = $serviceLocator->has('logger') ? $serviceLocator->get(...
codesearchnet
{ "query": "Represent the comment about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Programming:" }
// GenerateAuthorizeCode mocks base method
[ "func (m *MockAuthorizeCodeStrategy) GenerateAuthorizeCode(arg0 context.Context, arg1 fosite.Requester) (string, string, error) {\n\tret := m.ctrl.Call(m, \"GenerateAuthorizeCode\", arg0, arg1)\n\tret0, _ := ret[0].(string)\n\tret1, _ := ret[1].(string)\n\tret2, _ := ret[2].(error)\n\treturn ret0, ret1, ret2\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 description:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
2D Convolutional LSTM.
[ "def conv_lstm_2d(inputs, state, output_channels,\n kernel_size=5, name=None, spatial_dims=None):\n \"\"\"\"\"\"\n input_shape = common_layers.shape_list(inputs)\n batch_size, input_channels = input_shape[0], input_shape[-1]\n if spatial_dims is None:\n input_shape = input_shape[1:]\n else:\...
[ "def selections_group(self):\n \"\"\"\"\"\"\n cmd.group('Structures', '%s %s %sCartoon' % (self.protname, self.ligname, self.protname))\n cmd.group('Interactions', 'Hydrophobic HBonds HalogenBonds WaterBridges PiCation PiStackingP PiStackingT '\n 'Saltbridges Me...
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code:" }
// f is only set on transceiver.
[ "func (t *Transmitter) handlePDU(f HandlerFunc) {\n\tfor {\n\t\tp, err := t.cl.Read()\n\t\tif err != nil || p == nil {\n\t\t\tbreak\n\t\t}\n\t\tseq := p.Header().Seq\n\t\tt.tx.Lock()\n\t\trc := t.tx.inflight[seq]\n\t\tt.tx.Unlock()\n\t\tif rc != nil {\n\t\t\trc <- &tx{PDU: p}\n\t\t} else if f != nil {\n\t\t\tf(p)\n...
[ "def requests(self):\n ''''''\n path = pathjoin(self.path, self.name, Request.path)\n response = self.service.send(SRequest('GET', path))\n # a bin behaves as a push-down store --- better to return the requests\n # in order of appearance\n return list(reversed(Request.from_...
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code:" }
This method may transform the supplied source and return a new replacement for it @return string See RESULT_XXX constants in the interface
[ "public function transform(StreamMetaData $metadata): string\n {\n $selfValueVisitor = new SelfValueVisitor();\n $traverser = new NodeTraverser();\n $traverser->addVisitor($selfValueVisitor);\n $traverser->traverse($metadata->syntaxTree);\n\n $this->adjustSelfTokens($met...
[ "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 description about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
----------------------------------------------------------------------
[ "public function getBitStream()\r\n {\r\n\r\n $bstream = $this->mergeBitStream();\r\n\r\n if($bstream == null) {\r\n return null;\r\n }\r\n\r\n $ret = $this->appendPaddingBit($bstream);\r\n if($ret < 0) {\r\n return null;\r\n }\r\n\r\n return...
[ "function writeTimeBound(type, prmname, boundType, outputType) {\n return utils.parts(type, {\n B : prmname,\n // TODO: is this correct?\n C : boundType+'_'+(type === 'QU' ? 'UBT' : 'LBT')+'(KAF)',\n E : '1MON'\n }, outputType);\n //A=HEXT2014 B=SR-CMN_SR-CMN C=STOR_UBT(KAF) E=1MON F=CAMANCHE R FLOOD...
codesearchnet
{ "query": "Represent the Github sentence about language and writing:", "pos": "Represent the Github code about language and writing:", "neg": "Represent the Github code:" }
// SharedLock takes a co-operative (shared) lock on a key. // lockDir is the directory where the lock file will be created. // It will block if an exclusive lock is already held on the key.
[ "func SharedKeyLock(lockDir string, key string) (*KeyLock, error) {\n\treturn createAndLock(lockDir, key, keyLockShared)\n}" ]
[ "public void applyAndJournal(Supplier<JournalContext> context, DeleteFileEntry entry) {\n // Unlike most entries, the delete file entry must be applied *before* making the in-memory\n // change. This is because delete file and create file are performed with only a read lock on\n // the parent directory. As...
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software Development:" }
// ChromeUserAgent will generate a random chrome browser user agent string
[ "func ChromeUserAgent() string {\n\trandNum1 := strconv.Itoa(randIntRange(531, 536)) + strconv.Itoa(randIntRange(0, 2))\n\trandNum2 := strconv.Itoa(randIntRange(36, 40))\n\trandNum3 := strconv.Itoa(randIntRange(800, 899))\n\treturn \"Mozilla/5.0 \" + \"(\" + randomPlatform() + \") AppleWebKit/\" + randNum1 + \" (KH...
[ "function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co...
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
// XXX_OneofFuncs is for the internal use of the proto package.
[ "func (*AdditionalPropertiesItem) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _AdditionalPropertiesItem_OneofMarshaler, _AdditionalPropertiesItem_OneofUnmarshaler,...
[ "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 instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
Helper userd by {@link add_average_row()}. @param array $gradeaverages the raw grades. @return array the (partial) row of data.
[ "protected function format_average_grade_for_questions($gradeaverages) {\n $row = array();\n\n if (!$gradeaverages) {\n $gradeaverages = array();\n }\n\n foreach ($this->questions as $question) {\n if (isset($gradeaverages[$question->slot]) && $question->maxmark > 0...
[ "def getSampleTypeTitles(self):\n \n sample_types = self.getSampleTypes()\n sample_type_titles = map(lambda obj: obj.Title(), sample_types)\n\n # N.B. This is used only for search purpose, because the catalog does\n # not add an entry to the Keywordindex for an empty list.\n ...
codesearchnet
{ "query": "Represent the sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Patches the global it() function used by mocha, and returns a function that restores the original behavior when invoked. @param {Spec[]} specs Array on which to push specs @returns {function} Function that restores the original it() behavior
[ "function patchIt(specs) {\n var original = it;\n var restore = function() {\n it = original;\n xit = it.skip;\n };\n\n var createSpec = function(name, fn, opts) {\n opts = opts || {};\n\n var spec = {\n name: name,\n getPromise: function() {\n var start = Date.now();\n retur...
[ "function makeEventDispatcher(obj) {\n $.extend(obj, {\n on: on,\n off: off,\n one: one,\n trigger: trigger,\n _EventDispatcher: true\n });\n // Later, on() may add _eventHandlers: Object.<string, Array.<{event:string, namespace:?string,\n ...
codesearchnet
{ "query": "Represent the sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }
phpThumb Offsite Linking Watermark Source ~ Optional. A valid file system path to a file to use as a watermark source when your images are rendered offsite by phpThumb. @param string $value @return $this
[ "public function setCorePhpthumbNooffsitelinkWatermarkSrc($value)\n {\n $this->setFieldName('phpthumb_nooffsitelink_watermark_src');\n $this->loadObject(true);\n $this->setFieldValue($value);\n\n return $this;\n }" ]
[ "protected function getSnippetArrayFor($template, array $vars, $emailLocale)\n {\n // add a code snippet to reference the random image you added in the getParamArrayFor() method.\n // in the mean time it has been base64-encoded and attached as mime-part to your email.\n $vars['sampleSnippetW...
codesearchnet
{ "query": "Represent the sentence about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
Returns if the given host is reserved @param string $host @return boolean
[ "private function _isReserved($host){\n if (!preg_match('/^([0-9]{1,3}\\.){3}[0-9]{1,3}$/', $host)) {\n $host = gethostbyname($host);\n }\n\n $octet = explode('.',$host);\n if ((int)$octet[0] >= 224) {\n return true;\n } else if (array_key_exists($octet[0], $...
[ "public void setLog(String log) throws ApplicationException {\n\tif (StringUtil.isEmpty(log, true)) return;\n\tthis.log = log.trim();\n\t// throw new ApplicationException(\"invalid value for attribute log [\"+log+\"]\",\"valid values are\n\t// [application, scheduler,console]\");\n }" ]
codesearchnet
{ "query": "Represent the text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }
Go through all of the implementations of type, as well as the interfaces that they implement. If any of those types include the provided field, suggest them, sorted by how often the type is referenced, starting with Interfaces.
[ "function getSuggestedTypeNames(\n schema: GraphQLSchema,\n type: GraphQLOutputType,\n fieldName: string,\n): Array<string> {\n if (isAbstractType(type)) {\n const suggestedObjectTypes = [];\n const interfaceUsageCount = Object.create(null);\n for (const possibleType of schema.getPossibleTypes(type)) {...
[ "static ImmutableSet<ExecutableElement> abstractMethodsIn(\n ImmutableSet<ExecutableElement> methods) {\n Set<Name> noArgMethods = new HashSet<>();\n ImmutableSet.Builder<ExecutableElement> abstracts = ImmutableSet.builder();\n for (ExecutableElement method : methods) {\n if (method.getModifiers(...
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Execute GET OAuth Echo request. @param string $url full URL. @param mixed [$params] 1-demensional array or query string. @param string [$proxy] full proxy URL. e.g. https://111.222.333.444:8080 @return mixed @throws TwistException
[ "public function getOut($url, $params = array(), $proxy = '') {\r\n $ch = $this->curlGetOut($url, $params, $proxy);\r\n $response = curl_exec($ch);\r\n return self::decode($ch, $response);\r\n }" ]
[ "protected function configureApp ()\n {\n $this->envData['APP_ENV'] = $this->choice (\"Choose environment. [local|production]\", ['local', 'production'], 0);\n $this->envData['APP_KEY'] = \"\";\n $this->envData['APP_DEBUG'] = $this->confirm (\"Enable debugging?\", 'yes') ? \"true\" : \"f...
codesearchnet
{ "query": "Represent the text about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Software development:" }
Return if a method exists for the current instance. # Arguments key: The method name. # Returns: bool: * True if the current instance has the provided method. * False else.
[ "def has_method(self, key: str) -> bool:\n \n return hasattr(self.__class__, key) and callable(getattr(self.__class__, key))" ]
[ "def interface_required(interface):\n \n def _interface_required(func):\n \"\"\"Internal decorator that wraps around the decorated function.\n\n Args:\n func (function): function being decorated\n\n Returns:\n The wrapper function.\n ...
codesearchnet
{ "query": "Represent the sentence about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
Set the Drag View after the view is inflated
[ "@Override\n protected void onFinishInflate() {\n super.onFinishInflate();\n if (mDragViewResId != -1) {\n setDragView(findViewById(mDragViewResId));\n }\n if (mScrollableViewResId != -1) {\n setScrollableView(findViewById(mScrollableViewResId));\n }\n ...
[ "public void onTransformChanged() {\n Log.v(Log.SUBSYSTEM.WIDGET, TAG, \"onTransformChanged(): %s mPreventTransformChanged = %b\",\n getName(), mPreventTransformChanged);\n\n // Even if the calling code that altered the transform doesn't request a\n // layout, we'll do a layout t...
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// SetDomains sets the Domains field's value.
[ "func (s *GetDomainsOutput) SetDomains(v []*Domain) *GetDomainsOutput {\n\ts.Domains = v\n\treturn s\n}" ]
[ "private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo...
codesearchnet
{ "query": "Represent the instruction about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
Default implementation uses a predicate for removal.
[ "@Override\r\n public int removeAll(final KTypeLookupContainer<? super KType> c) {\r\n // We know c holds sub-types of KType and we're not modifying c, so go unchecked.\r\n return this.removeAll(new KTypePredicate<KType>() {\r\n public boolean apply(KType k) {\r\n return c.contains(k);\r\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:", "pos": "Represent the code:", "neg": "Represent the code:" }
Use this API to fetch all the sslservice resources that are configured on netscaler.
[ "public static sslservice[] get(nitro_service service) throws Exception{\n\t\tsslservice obj = new sslservice();\n\t\tsslservice[] response = (sslservice[])obj.get_resources(service);\n\t\treturn response;\n\t}" ]
[ "func (r *controller) Update(ctx context.Context, t *api.Task) error {\n\t// TODO(stevvooe): While assignment of tasks is idempotent, we do allow\n\t// updates of metadata, such as labelling, as well as any other properties\n\t// that make sense.\n\treturn nil\n}" ]
codesearchnet
{ "query": "Represent the summarization about htbridge.com:", "pos": "Represent the code about htbridge.com:", "neg": "Represent the code about Software development:" }