query stringlengths 16 255 | pos list | neg list | task stringclasses 1
value | instruction dict |
|---|---|---|---|---|
Return the appropriate HTTP status code according to the Exception/Error. | [
"def get_error(exc):\n \n\n if isinstance(exc, HTTPError):\n # Returning the HTTP Error code coming from requests module\n return exc.response.status_code, text(exc.response.content)\n\n if isinstance(exc, Timeout):\n # A timeout is a 408, and it's not a HTTPError (why? dunno).\n ... | [
"private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo... | codesearchnet | {
"query": "Represent the Github description about Natural Language Processing:",
"pos": "Represent the Github code about Natural Language Processing:",
"neg": "Represent the Github code about programming:"
} |
Text::signature
Create a signature text image watermark with Jellyka Saint-Andrew's Queen Truetype Font.
@param string $string
@param int $size
@param string $color
@return static | [
"public function signature($string, $size = 25, $color = 'ffffff')\r\n {\r\n $this->setFontPath(__DIR__ . DIRECTORY_SEPARATOR . 'Fonts/Jellyka_Saint-Andrew\\'s_Queen.ttf')\r\n ->setFontSize($size)\r\n ->setFontColor($color)\r\n ->setString($string);\r\n\r\n if ($thi... | [
"public function create(String $path = NULL) : String\n {\n if( isset($this->sets['filePath']) )\n {\n $path = $this->sets['filePath'];\n }\n\n # It keeps the used filters belonging to the GD class.\n # [5.7.8]added\n $this->sets['filters'] = $this->filters;\n... | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code about Programming:"
} |
@param Request $request
@return ReceivedAuthnRequest
@SuppressWarnings(PHPMD.NPathComplexity) | [
"public function receiveSignedAuthnRequestFrom(Request $request)\n {\n if (!$this->entityRepository) {\n throw new LogicException(\n 'Could not receive AuthnRequest from HTTP Request: a ServiceProviderRepository must be configured'\n );\n }\n\n if (!$requ... | [
"public Validation validate(@PName(\"context\") Context context, @PName(\"pid\") String pid,\n @PName(\"asOfDateTime\") Date asOfDateTime) throws ServerException {\n throw rejectCallsFromOutsideWhileInRecoveryMode();\n }"
] | codesearchnet | {
"query": "Represent the Github instruction about PHP:",
"pos": "Represent the Github code about PHP:",
"neg": "Represent the Github code:"
} |
Get an instance of DynamoDbSession configured from the environment if available.
@return null|DynamoDbSession | [
"public static function get()\n {\n // Use DynamoDB for distributed session storage if it's configured\n $awsDynamoDBSessionTable = Environment::getEnv('AWS_DYNAMODB_SESSION_TABLE');\n if (!empty($awsDynamoDBSessionTable)) {\n $awsRegionName = Environment::getEnv('AWS_REGION_NAME'... | [
"protected function initDefaultInitialContext()\n {\n\n // initialize the configuration values for the initial context\n $description = new DescriptionNode(new NodeValue('The initial context configuration.'));\n $storage = new StorageNode('AppserverIo\\Storage\\StackableStorage');\n\n ... | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Change a table column type.
@param string $columnName Column Name
@param string|\Phinx\Db\Table\Column|\Phinx\Util\Literal $newColumnType New Column Type
@param array $options Options
@return \Phinx\Db\Table | [
"public function changeColumn($columnName, $newColumnType, array $options = [])\n {\n if ($newColumnType instanceof Column) {\n $action = new ChangeColumn($this->table, $columnName, $newColumnType);\n } else {\n $action = ChangeColumn::build($this->table, $columnName, $newColu... | [
"public function toSql(\\Doctrine\\DBAL\\Schema\\SchemaDiff $schema) //Doctrine\\DBAL\\Schema\\SchemaDiff | \\Doctrine\\DBAL\\Schema\\Schema\n {\n return $schema->toSaveSql($this->getPlatform());\n //return $schema->toSql($this->getPlatform()); //it can return with DROP TABLE\n }"
] | codesearchnet | {
"query": "Represent the text about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
Returns for given <code>_key</code> the related link. If no link is found
<code>null</code> is returned.
@param _key key of searched link
@return found link; if not found <code>null</code>
@throws EFapsException on error
@see #links | [
"public Instance getLink(final String _key)\n throws EFapsException\n {\n return Instance.get(getValue(_key, ConfType.LINK));\n }"
] | [
"@Override\n public Object get(PageContext pc, Collection.Key key) throws PageException {\n\tMember member = getMember(pc, key, true, false);\n\tif (member != null) return member.getValue();\n\n\t// trigger\n\tif (triggerDataMember(pc) && !isPrivate(pc)) {\n\t return callGetter(pc, key);\n\t}\n\tthrow new Exp... | codesearchnet | {
"query": "Represent the sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
Return success
@return array | [
"protected function success()\n {\n $this->cleanup();\n\n if (empty($this->incidents)) {\n Log::warning(\n 'The collector ' . config(\"{$this->configBase}.collector.name\") . ' did not return any incidents ' .\n 'which should be investigated for collector an... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the text about NLP:",
"pos": "Represent the code about NLP:",
"neg": "Represent the code:"
} |
Indicate if the Event emitter should be enabled
@return bool | [
"private function isEventEmitterEnabled()\n {\n if (! isset($this->isEmitterEnabled)) {\n $this->isEmitterEnabled = $this->getConfig('event_emitter') != false;\n }\n\n return $this->isEmitterEnabled;\n }"
] | [
"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 comment about NLP:",
"pos": "Represent the code about NLP:",
"neg": "Represent the code:"
} |
Check if a file exists (and don't error out on unicode inputs) | [
"def file_exists(filename):\n \n try:\n return os.path.isfile(filename)\n except (UnicodeDecodeError, UnicodeEncodeError, ValueError):\n return False"
] | [
"def if_device_path_exists(device_serial, device_path)\n return if run_adb_command(\"adb -s #{device_serial} shell ls #{device_path}\",\n print_all: false,\n print_command: false).include?('No such file')\n\n yield(device_path)\n rescue\n ... | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
// SetTrainingJobSummaries sets the TrainingJobSummaries field's value. | [
"func (s *ListTrainingJobsForHyperParameterTuningJobOutput) SetTrainingJobSummaries(v []*HyperParameterTrainingJobSummary) *ListTrainingJobsForHyperParameterTuningJobOutput {\n\ts.TrainingJobSummaries = v\n\treturn s\n}"
] | [
"@NotNull\n @ApiModelProperty(required = true, value = \"Key-value pairs to add as custom property into alert. You can refer here for example values\")\n public Map<String, String> getDetails() {\n return details;\n }"
] | codesearchnet | {
"query": "Represent the Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
Add a PATCH route with a callable and optionally a templatePath.
@param string $url
@param callable $callable
@param string|null $name
@param string|null $templatePath
@return $this | [
"public function patch($url, $callable, $name = null, $templatePath = null)\n {\n $this->multiple([\\Parable\\Http\\Request::METHOD_PATCH], $url, $callable, $name, $templatePath);\n return $this;\n }"
] | [
"public function update(): self\n {\n /** @var self $data */\n $data = $this;\n\n if(!$this->validate(\"patch\", $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 post about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
Add the cypher clause to create the node corresponding to the root of the aggregate | [
"private function createAggregate(\n Identity $identity,\n object $entity,\n Query $query\n ): Query {\n $meta = ($this->metadata)(\\get_class($entity));\n $data = ($this->extract)($entity);\n $varName = $this->name->sprintf(\\md5($identity->value()));\n\n $query ... | [
"@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:"
} |
Creates a lookup array based on the "value" associated with an MpxjEnum.
@param <E> target enumeration
@param c enumeration class
@param arraySizeOffset offset to apply to the array size
@return lookup array | [
"@SuppressWarnings(\n {\n \"unchecked\"\n }) public static final <E extends Enum<E>> E[] createTypeArray(Class<E> c, int arraySizeOffset)\n {\n EnumSet<E> set = EnumSet.allOf(c);\n E[] array = (E[]) Array.newInstance(c, set.size() + arraySizeOffset);\n\n for (E e : set)\n {\n ... | [
"@SuppressWarnings(\"unchecked\")\n public <T> Param<T> get(int index) {\n // TODO: Provide a more type safe API. E.g. make index a pojo typed on T which is aligned with the Param<T>\n return (Param<T>) params[index];\n }"
] | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
Create a new config resource in the slicing service and upload the path contents to it | [
"def upload(self, path, engine, description=None):\n \"\"\"\"\"\"\n\n if description is None:\n head, tail = ntpath.split(path)\n description = tail or ntpath.basename(head)\n\n url = \"http://quickslice.{}/config/raw/\".format(self.config.host)\n\n with open(path) ... | [
"def platform\n # If you are declaring a new platform, you will need to tell\n # Train a bit about it.\n # If you were defining a cloud API, you should say you are a member\n # of the cloud family.\n\n # This plugin makes up a new platform. Train (or rather InSpec) only\n # know how t... | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
{@inheritDoc}
Defines the workflow sequence. | [
"public final void run(Closure templateCallback) {\n\t\treset();\n\t\tsetRunning();\n\t\tdoSetup();\n\t\twhile (processing()) {\n\t\t\ttemplateCallback.call(doWork());\n\t\t}\n\t\tsetCompleted();\n\t\tdoCleanup();\n\t}"
] | [
"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 about Text generation:",
"pos": "Represent the code about Text generation:",
"neg": "Represent the code:"
} |
Update the configuration for this lane if a custom analysis is specified. | [
"def update_w_custom(config, lane_info):\n \n name_remaps = {\"variant\": [\"SNP calling\", \"variant\", \"variant2\"],\n \"SNP calling\": [\"SNP calling\", \"variant\", \"variant2\"],\n \"variant2\": [\"SNP calling\", \"variant\", \"variant2\"]}\n config = copy.deepcopy... | [
"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 instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Increases the length of the SegmentChunk by the given delta.
@param delta The value to increase by. | [
"synchronized void increaseLength(long delta) {\n Preconditions.checkState(!this.sealed, \"Cannot increase the length of a sealed SegmentChunk.\");\n Preconditions.checkArgument(delta >= 0, \"Cannot decrease the length of a SegmentChunk.\");\n this.length += delta;\n }"
] | [
"public void changeComplete (float complete)\n {\n // Store the new state\n _complete = complete;\n\n // Determine the percentage difference between the \"actual\"\n // completion state and the completion amount to render during\n // the smooth interpolation\n _renderOff... | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// CopyDirectory copies srcDir to destDir | [
"func CopyDirectory(srcDir, destDir string) error {\n\tdestExists, _ := FileExists(destDir)\n\tif !destExists {\n\t\treturn errors.New(\"destination dir must exist\")\n\t}\n\n\tfiles, err := ioutil.ReadDir(srcDir)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tfor _, f := range files {\n\t\tsrc := filepath.Join(srcDi... | [
"function importTasks(options) {\n const opts = parseOptions(options);\n const cwd = process.cwd();\n const dir = path.join(cwd, opts.dir);\n\n debug(`importing tasks from \"${dir}\"...`);\n\n // This synchronously reads the contents within the chosen directory then\n // loops through each item, verifies that... | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Method used by mostly all the ClassMethods when doing a search | [
"def parse_query(query=nil, options={})\n valid_options = [:models, :lazy, :core, :results_format, :sql_options,\n :alternate_query, :boost_functions, :filter_queries, :facets, :sort,\n :scores, :operator, :latitude, :longitude, :radius, :relevance, :highlight,\n :offset, :per_page, :limit... | [
"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 summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
Requests are queued for delivery. | [
"def indication(self, pdu):\n \"\"\"\"\"\"\n if _debug: TCPServer._debug(\"indication %r\", pdu)\n\n self.request += pdu.pduData"
] | [
"func (r *controller) Update(ctx context.Context, t *api.Task) error {\n\t// TODO(stevvooe): While assignment of tasks is idempotent, we do allow\n\t// updates of metadata, such as labelling, as well as any other properties\n\t// that make sense.\n\treturn nil\n}"
] | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
// NewRequest builds a request from the client configuration.
// An http.Request will be initialized with the given context, method and path.
// A request.Request will be initialized with the http.Request, Handlers,
// params and data. | [
"func (c *Client) NewRequest(ctx context.Context, method, path string, params interface{}, data interface{}) *request.Request {\n\thttpReq, _ := http.NewRequest(method, path, nil)\n\thttpReq = httpReq.WithContext(ctx)\n\thttpReq.URL, _ = url.Parse(c.Info.Endpoint + path)\n\n\tr := request.New(httpReq, c.Info, c.Han... | [
"func WithNamespace(ctx context.Context, namespace string) context.Context {\n\tctx = context.WithValue(ctx, namespaceKey{}, namespace) // set our key for namespace\n\n\t// also store on the grpc headers so it gets picked up by any clients that\n\t// are using this.\n\treturn withGRPCNamespaceHeader(ctx, namespace)... | codesearchnet | {
"query": "Represent the comment about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code about consul address:"
} |
Get the admin information.
Optional arguments:
* server=None - Get admin information for -
server instead of the current server. | [
"def admin(self, server=None):\n \n with self.lock:\n if not server:\n self.send('ADMIN')\n else:\n self.send('ADMIN %s' % server)\n rvalue = []\n while self.readable():\n admin_ncodes = '257', '258', '259'\n ... | [
"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 comment about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about AWS Auto Scaling:"
} |
<p>
A list of configuration items with tags that you want to delete.
</p>
@param configurationIds
A list of configuration items with tags that you want to delete. | [
"public void setConfigurationIds(java.util.Collection<String> configurationIds) {\n if (configurationIds == null) {\n this.configurationIds = null;\n return;\n }\n\n this.configurationIds = new java.util.ArrayList<String>(configurationIds);\n }"
] | [
"function(apiClient) {\n this.apiClient = apiClient || Configuration.default.getDefaultApiClient() || ApiClient.instance;\n\n\n this.setApiClient = function(apiClient) {\n this.apiClient = apiClient;\n };\n\n this.getApiClient = function() {\n return this.apiClient;\n };\n\n\n /**\n ... | codesearchnet | {
"query": "Represent the Github instruction about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Software development:"
} |
Combined touch and mouse input
Touch has a higher priority then mouse, and while touching no mouse events are allowed.
This because touch devices also emit mouse events while doing a touch.
@constructor
@extends Input | [
"function TouchMouseInput() {\n Input.apply(this, arguments);\n\n var handler = this.handler.bind(this);\n this.touch = new TouchInput(this.manager, handler);\n this.mouse = new MouseInput(this.manager, handler);\n}"
] | [
"function (evt) {\n var domEvent = evt.domEvent;\n if (domEvent.target == this.getTextInputField()) {\n // Clicking on the input should directly give the focus to the input.\n // Setting this boolean to false prevents the focus from being given\n //... | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Adds the commerce address restriction to the database. Also notifies the appropriate model listeners.
@param commerceAddressRestriction the commerce address restriction
@return the commerce address restriction that was added | [
"@Indexable(type = IndexableType.REINDEX)\n\t@Override\n\tpublic CommerceAddressRestriction addCommerceAddressRestriction(\n\t\tCommerceAddressRestriction commerceAddressRestriction) {\n\t\tcommerceAddressRestriction.setNew(true);\n\n\t\treturn commerceAddressRestrictionPersistence.update(commerceAddressRestriction... | [
"def _reflex_rule_process(self, wf_action):\n \n # Check out if the analysis has any reflex rule bound to it.\n # First we have get the analysis' method because the Reflex Rule\n # objects are related to a method.\n a_method = self.getMethod()\n if not a_method:\n ... | codesearchnet | {
"query": "Represent the Github summarization about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
// Error can be either of the following types:
//
// - InvalidObjectFault
// - RuntimeFault | [
"func (service *VboxPortType) IShowWindowEventgetWinId(request *IShowWindowEventgetWinId) (*IShowWindowEventgetWinIdResponse, error) {\n\tresponse := new(IShowWindowEventgetWinIdResponse)\n\terr := service.client.Call(\"\", request, response)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn response, nil\n}... | [
"@Help(help = \"Create the object of type {#}\")\n public T create(final T object) throws SDKException {\n return (T) requestPost(object);\n }"
] | codesearchnet | {
"query": "Represent the Github sentence about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code:"
} |
Use this for generating wide format from long (tidy) data | [
"def group_by_interpolate(df, x=None, y=None, group_by=None,\n number_of_points=100, tidy=False,\n individual_x_cols=False, header_name=\"Unit\",\n dx=10.0, generate_new_x=True):\n \"\"\"\"\"\"\n\n time_00 = time.time()\n if x is None:... | [
"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 text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Check to see if the all the properties in the model are valid
@return true if the model is valid | [
"def valid?\n return false if @id.nil?\n return false if @created_at.nil?\n return false if @updated_at.nil?\n creation_source_validator = EnumAttributeValidator.new('String', [\"OTHER\", \"APPOINTMENTS\", \"COUPON\", \"DELETION_RECOVERY\", \"DIRECTORY\", \"EGIFTING\", \"EMAIL_COLLECTION\", \"FE... | [
"function Rule(rules) {\n this.rules = rules;\n // Identifies individual rule\n this.name = \"\";\n // Identifies the grammar that this rule belongs to \n this.grammarName = \"\";\n // Identifies types of rules. Rules can have \"types\" that are diff... | codesearchnet | {
"query": "Represent the Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
// Lookup returns true if data is in the counter | [
"func (cf *Filter) Lookup(data []byte) bool {\n\ti1, i2, fp := getIndicesAndFingerprint(data, uint(len(cf.buckets)))\n\tb1, b2 := cf.buckets[i1], cf.buckets[i2]\n\treturn b1.getFingerprintIndex(fp) > -1 || b2.getFingerprintIndex(fp) > -1\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:"
} |
include : INCLUDE FILENAME | [
"def p_include_fname(p):\n \n if ENABLED:\n p[0] = include_file(p[2], p.lineno(2), local_first=False)\n else:\n p[0] = []\n p.lexer.next_token = '_ENDFILE_'"
] | [
"function writeTimeBound(type, prmname, boundType, outputType) {\n return utils.parts(type, {\n B : prmname,\n // TODO: is this correct?\n C : boundType+'_'+(type === 'QU' ? 'UBT' : 'LBT')+'(KAF)',\n E : '1MON'\n }, outputType);\n //A=HEXT2014 B=SR-CMN_SR-CMN C=STOR_UBT(KAF) E=1MON F=CAMANCHE R FLOOD... | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* | [
"func (f genHelperEncoder) Extension(rtid uintptr) (xfn *extTypeTagFn) {\n\treturn f.e.h.getExt(rtid)\n}"
] | [
"public static MethodInterface[] getAllValues()\n {\n // This list must be created every time, to insure the caller does\n // not modify an internal list. Declaring a static final list does\n // not work, since it only protects the reference to the list, and\n // not the list entries.... | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Add user to group. | [
"def group_add_user_action(model, request):\n \n user_id = request.params.get('id')\n if not user_id:\n user_ids = request.params.getall('id[]')\n else:\n user_ids = [user_id]\n try:\n group = model.model\n validate_add_users_to_groups(model, user_ids, [group.id])\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 summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about Programming:"
} |
+li+ tag with the 'active' class added if the url is the current one.
Eg.:
<%= activable_li_tag users_path do %>
<%= link_to "Users", users_path %>
<% end %> | [
"def activable_li_tag(*url, &block)\n content_tag :li, capture(&block), :class => (\"active\" if url.any?{|u| current_page?(u)})\n end"
] | [
"def edit_link(obj, options = {})\n if policy(obj).edit?\n url = polymorphic_url([:edit] + Array(obj))\n action_link('Edit', url, 'pencil', options)\n end\n end"
] | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Calls a list of user-defined actions needed in tests. | [
"public function _bootstrapActions()\n {\n if (empty($this->config['bootstrapActions'])) {\n return;\n }\n\n foreach ($this->config['bootstrapActions'] as $action) {\n if (!is_callable($action)) {\n do_action($action);\n } else {\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 Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
Load the compiled eloquent entity models.
@return void | [
"protected function registerEloquentModels()\n {\n $files = $this->app['files']->files(storage_path('framework/entities'));\n \n foreach ($files as $file) {\n if ($this->app['files']->extension($file) == '') {\n require_once $file;\n }\n }\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 text about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Tries to get the result for the given api request from the cache.
@param RequestBag $requestBag
@return bool|mixed False or the actual result from cache. | [
"public static function getFromCache(RequestBag $requestBag)\n {\n // check if we have cache in settings\n if (!$requestBag->getApiConfig()->get('Cache', false) || $requestBag->getMethodData()['cache']['ttl'] <= 0) {\n return false;\n }\n\n $instance = new self($requestBag)... | [
"@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 summarization about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code about Programming:"
} |
// Schema is similar to Value.Schema. | [
"func (s *String) Schema(schema interface{}) *String {\n\tcheckSchema(&s.chain, s.value, schema)\n\treturn s\n}"
] | [
"def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)"
] | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Getter for $entityClassAlias
@return string $entityClassAlias | [
"public function getEntityClassAlias()\n {\n if ($this->entityClassAlias === null) {\n $entityClass = $this->getEntityClass();\n $this->setEntityClassAlias(strtolower(substr($entityClass, strrpos($entityClass, '\\\\')+1, 1)));\n }\n return $this->entityClassAlias;\n ... | [
"public @CheckForNull PropertyType getPropertyType(@Nonnull Object instance, @Nonnull String field) {\n // in global.jelly, instance==descriptor\n return instance==this ? getGlobalPropertyType(field) : getPropertyType(field);\n }"
] | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
// Restore pops the latest transform from the stack. | [
"func (p *Painter) Restore() {\n\tif len(p.transforms) > 0 {\n\t\tp.transforms = p.transforms[:len(p.transforms)-1]\n\t}\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 instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
// Error implements the built-in error interface. | [
"func (err *ErrClose) Error() string {\n\tif len(err.Errs) == 1 {\n\t\treturn err.Errs[0].Error()\n\t}\n\n\tvar buf bytes.Buffer\n\n\tfmt.Fprintf(&buf, \"The following kites failed to close:\\n\\n\")\n\n\tfor i, e := range err.Errs {\n\t\tif e == nil {\n\t\t\tcontinue\n\t\t}\n\n\t\tfmt.Fprintf(&buf, \"\\t[%d] %s\\n... | [
"func (_ *NilFormatter) Format(_ string, _ LogLevel, _ int, _ ...interface{}) {\n\t// noop\n}"
] | codesearchnet | {
"query": "Represent the Github post about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code about Computer Science:"
} |
Given the set of active tracks, estimate the cameras motion robustly
@return | [
"private boolean estimateMotion() {\n\t\t// organize the data\n\t\tList<Stereo2D3D> data = new ArrayList<>();\n\n\t\tfor( PointTrack l : candidates ) {\n\t\t\tLeftTrackInfo info = l.getCookie();\n\t\t\tPointTrack r = info.right;\n\n\t\t\tStereo2D3D stereo = info.location;\n\t\t\t// compute normalized image coordina... | [
"def enkf(self):\n \n\n for cycle_index, time_point in enumerate(self.timeline):\n if cycle_index >= len(self.timeline) - 1:\n # Logging : Last Update cycle has finished\n break\n\n print(\"Print information about this assimilation Cycle ???\") # sh... | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// IP returns the destination IP address for a given address family. | [
"func (d *Destination) IP(af AF) net.IP {\n\tswitch af {\n\tcase IPv4:\n\t\treturn d.Backend.IPv4Addr\n\tcase IPv6:\n\t\treturn d.Backend.IPv6Addr\n\t}\n\treturn nil\n}"
] | [
"function listen(self, address, port, addressType, backlog, exclusive) {\n /* TODO Index servers by a self-assigned identifier and the process\n * identifier so messages intended for previous instances do not pass\n * through. */\n servers[port] = self; // Index servers by port.\n self._port = port... | codesearchnet | {
"query": "Represent the instruction about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code:"
} |
returns an object Project which matches name | [
"def get_by_name(self, name):\n \n for p in self.project_list:\n if p.nme == name:\n return p\n return None"
] | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the Github text about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code:"
} |
BindView annotated fields and methods in the specified {@link Activity}. The current content
view is used as the view root.
@param target Target activity for view binding. | [
"@NonNull @UiThread\n public static Unbinder bind(@NonNull Activity target) {\n View sourceView = target.getWindow().getDecorView();\n return bind(target, sourceView);\n }"
] | [
"private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo... | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
TODO cache result | [
"private static String calcClassSign(String name) {\n try {\n Class<?> clazz = Class.forName(name);\n\n ByteArrayOutputStream result = new ByteArrayOutputStream();\n ObjectOutputStream outputStream = new ObjectOutputStream(result);\n outputStream.writeObject(clazz)... | [
"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:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Marshall the given parameter object. | [
"public void marshall(DescribeExclusionsRequest describeExclusionsRequest, ProtocolMarshaller protocolMarshaller) {\n\n if (describeExclusionsRequest == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\n }\n\n try {\n protocolMarshaller... | [
"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 text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
handle `Class.new arg` call without parens | [
"def on_command_call(*args)\n if args.last && :args == args.last[0]\n args_add = args.pop\n call = on_call(*args)\n on_method_add_arg(call, args_add)\n else\n super\n end\n end"
] | [
"def uncomment(key, value, tree)\n # Try to find if it is commented out, so we can replace line\n matcher = Matcher.new(\n collection: \"#comment\",\n # FIXME: this assumes a specific \"=\" syntax, bypassing the lens\n # FIXME: this will match also \"# If you set FOO=bar then...\"\... | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code about Computer Science:"
} |
// SetMeterStatus sets the current meter status for this model. | [
"func (m *Model) SetMeterStatus(status, info string) error {\n\tif _, err := isValidMeterStatusCode(status); err != nil {\n\t\treturn errors.Trace(err)\n\t}\n\tops := []txn.Op{{\n\t\tC: modelsC,\n\t\tId: m.doc.UUID,\n\t\tUpdate: bson.D{{\"$set\", bson.D{{\"meter-status\", modelMeterStatusdoc{\n\t\t\tCode: status,\... | [
"@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 programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
// Returns a human readable string describing the target FailureMessage.
//
// NOTE: Implements the error interface. | [
"func (f *FailExpiryTooSoon) Error() string {\n\treturn fmt.Sprintf(\"ExpiryTooSoon(update=%v\", spew.Sdump(f.Update))\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 Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Sets the rotation in degree.
@param int | [
"public function setRotationAngle($rotationAngle) {\r\n $this->rotationAngle = (int)$rotationAngle;\r\n if ($this->rotationAngle !== 90 && $this->rotationAngle !== 180 && $this->rotationAngle !== 270) {\r\n $this->rotationAngle = 0;\r\n }\r\n\r\n $this->rotationAngle = (360 - ... | [
"def ystep(self):\n \n \"\"\"\n\n self.Y = self.Pcn(self.AX + self.U)"
] | codesearchnet | {
"query": "Represent the Github instruction about mathematics:",
"pos": "Represent the Github code about mathematics:",
"neg": "Represent the Github code:"
} |
so completion is signaled after the remote comes back. | [
"private void handleCompleter( CountedCompleter cc ) {\n assert cc instanceof H2OCountedCompleter;\n if( _fjtasks == null || !_fjtasks.contains(cc) )\n addCompleter((H2OCountedCompleter)cc);\n _dt.setCompleter(null);\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 text:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Register the service provider. | [
"public function register()\n {\n parent::register();\n\n $this->app->register(\\Railken\\Amethyst\\Providers\\CatalogueServiceProvider::class);\n $this->app->register(\\Railken\\Amethyst\\Providers\\TargetServiceProvider::class);\n $this->app->register(\\Railken\\Amethyst\\Providers\... | [
"def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p"
] | codesearchnet | {
"query": "Represent the Github instruction about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Generate skeleton CDK C# sample module. | [
"def generate_sample_cdk_cs_module(env_root, module_dir=None):\n \"\"\"\"\"\"\n if module_dir is None:\n module_dir = os.path.join(env_root, 'sampleapp.cdk')\n generate_sample_module(module_dir)\n for i in ['add-project.hook.d.ts', 'cdk.json', 'package.json',\n 'runway.module.yml', '... | [
"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:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Delete the object from GPU memory.
Note that the GPU object will also be deleted when this gloo
object is about to be deleted. However, sometimes you want to
explicitly delete the GPU object explicitly. | [
"def delete(self):\n \n # We only allow the object from being deleted once, otherwise\n # we might be deleting another GPU object that got our gl-id\n # after our GPU object was deleted. Also note that e.g.\n # DataBufferView does not have the _glir attribute.\n if hasattr(... | [
"def fulfill(self, value):\n \n\n assert self._state==self.PENDING\n\n self._state=self.FULFILLED;\n self.value = value\n for callback in self._callbacks:\n try:\n callback(value)\n except Exception:\n # Ignore errors in callback... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Sets the image spacial derivatives. These should be computed from an image at the appropriate scale
in scale-space.
@param derivX x-derivative of input image
@param derivY y-derivative of input image | [
"public void setImageGradient(Deriv derivX , Deriv derivY ) {\n\t\tthis.imageDerivX.wrap(derivX);\n\t\tthis.imageDerivY.wrap(derivY);\n\t}"
] | [
"def _create_features(self, constraints):\n \"\"\"\"\"\"\n affine_warp_constraints = constraints\n if not isinstance(affine_warp_constraints, AffineWarpConstraints):\n affine_warp_constraints = AffineWarpConstraints(affine_warp_constraints)\n mask = affine_warp_constraints.mask\n psi = _create_a... | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Handle form entry of permission changes.
@param Request $request
@return bool | [
"public function bindRequest(Request $request)\n {\n $changes = $request->request->get('permission-hidden-fields');\n\n if (empty($changes)) {\n return true;\n }\n\n // Just apply the changes to the current node (non recursively)\n $this->applyAclChangeset($this->res... | [
"private function processAuthenticate(Session $session, AuthenticateMessage $msg)\n {\n $session->abort(new \\stdClass(), 'thruway.error.internal');\n Logger::error($this, 'Authenticate sent to realm without auth manager.');\n }"
] | codesearchnet | {
"query": "Represent the Github post about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about Programming:"
} |
Decode raw response from Consul
Set `@lock_modify_index`, `@lock_content`, and `@members`
@returns [Array] List of members | [
"def decode_semaphore_state\n lock_key = state.find { |k| k['Key'] == @lock }\n member_keys = state.delete_if { |k| k['Key'] == @lock }\n member_keys.map! { |k| k['Key'] }\n\n unless lock_key.nil?\n @lock_modify_index = lock_key['ModifyIndex']\n @lock_content = JSON.parse(lock_key[... | [
"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 text about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Build an instance of TokenInstance
:param dict payload: Payload response from the API
:returns: twilio.rest.api.v2010.account.token.TokenInstance
:rtype: twilio.rest.api.v2010.account.token.TokenInstance | [
"def get_instance(self, payload):\n \n return TokenInstance(self._version, payload, account_sid=self._solution['account_sid'], )"
] | [
"def incoming_phone_numbers(self):\n \n if self._incoming_phone_numbers is None:\n self._incoming_phone_numbers = IncomingPhoneNumberList(\n self._version,\n account_sid=self._solution['sid'],\n )\n return self._incoming_phone_numbers"
] | codesearchnet | {
"query": "Represent the text about Twilio:",
"pos": "Represent the code about Twilio:",
"neg": "Represent the code about Twilio:"
} |
bexpr : PEEK LP numbertype COMMA expr RP | [
"def p_expr_peektype_(p):\n \n p[0] = make_builtin(p.lineno(1), 'PEEK',\n make_typecast(TYPE.uinteger, p[5], p.lineno(4)),\n type_=p[3])"
] | [
"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:"
} |
Create an instance of {@link JAXBElement }{@code <}
{@link CmisExtensionType }{@code >} | [
"@XmlElementDecl(namespace = \"http://docs.oasis-open.org/ns/cmis/messaging/200908/\", name = \"extension\", scope = RemovePolicyResponse.class)\r\n\tpublic JAXBElement<CmisExtensionType> createRemovePolicyResponseExtension(\r\n\t\t\tCmisExtensionType value) {\r\n\t\treturn new JAXBElement<CmisExtensionType>(\r\n\t... | [
"@Help(help = \"Create the object of type {#}\")\n public T create(final T object) throws SDKException {\n return (T) requestPost(object);\n }"
] | codesearchnet | {
"query": "Represent the post about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
// CheckboxFromInstance creates and initializes a checkbox field based on its name, the reference object instance, field number and field options. | [
"func CheckboxFromInstance(val reflect.Value, t reflect.Type, fieldNo int, name string, options map[string]struct{}) *Field {\n\tret := FieldWithType(name, formcommon.CHECKBOX)\n\tif _, ok := options[\"checked\"]; ok {\n\t\tret.AddTag(\"checked\")\n\t} else {\n\t\tv := val.Field(fieldNo).Bool()\n\t\tif v {\n\t\t\tr... | [
"function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co... | codesearchnet | {
"query": "Represent the Github description about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
// Fail implements Assertion. | [
"func (a *assertion) Fail(msgs ...string) bool {\n\treturn a.failer.Fail(Fail, nil, nil, msgs...)\n}"
] | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github instruction about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code:"
} |
Parses the raw string input and returns the resulting root node.
@param string $input
@return Node | [
"public function parse($input)\n {\n if (strlen($input) == 0) {\n return null;\n }\n return $this->parser->parse(new TokenStream($this->tokenizer->getTokens($input)));\n }"
] | [
"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 description about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about Documentation:"
} |
Allows use of ImmutableMap.of() patterns. | [
"protected static void appendTo(@Nonnull StringBuilder buf, @Nonnull Map<? extends String, ? extends Object> values) {\n for (Map.Entry<? extends String, ? extends Object> e : values.entrySet()) {\n if (buf.length() > 0)\n buf.append(\",\");\n buf.append(e.getKey());\n ... | [
"public LHS toLHS( CallStack callstack, Interpreter interpreter)\n throws EvalError\n {\n // loosely typed map expression new {a=1, b=2} are treated\n // as non assignment (LHS) to retrieve Map.Entry key values\n // then wrapped in a MAP_ENTRY type LHS for value assignment.\n r... | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
visit an arg node by returning a fresh AssName instance | [
"def visit_arg(self, node, parent):\n \"\"\"\"\"\"\n return self.visit_assignname(node, parent, node.arg)"
] | [
"public LHS toLHS( CallStack callstack, Interpreter interpreter)\n throws EvalError\n {\n // loosely typed map expression new {a=1, b=2} are treated\n // as non assignment (LHS) to retrieve Map.Entry key values\n // then wrapped in a MAP_ENTRY type LHS for value assignment.\n r... | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Return a List with all the VNFDependencies that are contained in a specific
NetworkServiceDescriptor.
@param idNSD the ID of the NetworkServiceDescriptor
@return the List of VNFDependencies
@throws SDKException if the request fails | [
"@Help(\n help =\n \"Get all the VirtualNetworkFunctionDescriptor Dependency of a NetworkServiceDescriptor with specific id\"\n )\n public List<VNFDependency> getVNFDependencies(final String idNSD) throws SDKException {\n String url = idNSD + \"/vnfdependencies\";\n return Arrays.asList((VNFDepend... | [
"public static IGroupMember getGroupMember(String key, Class<?> type) throws GroupsException {\n /*\n * WARNING: The 'type' parameter is not the leafType; you're obligated\n * to say whether you want a group or a non-group (i.e. some type of\n * entity). In fact, the underlying imp... | codesearchnet | {
"query": "Represent the Github comment about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about Software development:"
} |
Add a component to the canvas | [
"function(model) {\n var t = this,\n componentView = new ComponentView({model: model});\n componentView.$el\n .addClass('nm-pv-component')\n .data('view', componentView);\n componentView.render();\n t.canvas.append(componentView.$el);\n t.componentViews[model.get('id'... | [
"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 instruction:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Bootstrap the service.
@return void | [
"public function boot()\n {\n $this->loadViewsFrom(__DIR__ . '/../../views', 'laravel-form-builder');\n\n $this->publishes([\n __DIR__ . '/../../views' => base_path('resources/views/vendor/laravel-form-builder'),\n __DIR__ . '/../../config/config.php' => config_path('laravel-f... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the description about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
// NewSwiftBackend constructs a Swift backend using a pre-existing
// container. Credentials can be provided to the backend, sourced
// from the environment. | [
"func NewSwiftBackend(conf map[string]string, logger log.Logger) (physical.Backend, error) {\n\tvar ok bool\n\n\tusername := os.Getenv(\"OS_USERNAME\")\n\tif username == \"\" {\n\t\tusername = conf[\"username\"]\n\t\tif username == \"\" {\n\t\t\treturn nil, fmt.Errorf(\"missing username\")\n\t\t}\n\t}\n\tpassword :... | [
"func tagUserCredentials(conf agent.Config) (string, string, error) {\n\tusername := conf.Tag().String()\n\tvar password string\n\t// TODO(perrito) we might need an accessor for the actual state password\n\t// just in case it ever changes from the same as api password.\n\tapiInfo, ok := conf.APIInfo()\n\tif ok {\n\... | codesearchnet | {
"query": "Represent the sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Sets a new ORG value | [
"def set_org(self, value, lineno):\n \n if value < 0 or value > MAX_MEM:\n error(lineno, \"Memory ORG out of range [0 .. 65535]. Current value: %i\" % value)\n\n self.index = self.ORG = value"
] | [
"@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 post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Creates a response instance from an entire HTTP message including HTTP status headers and body.
@param string $message The full HTTP message.
@param string $options Additionnal options.
@return object Returns a request instance. | [
"public static function parse($message, $options = [])\n {\n $parts = explode(\"\\r\\n\\r\\n\", $message, 2);\n if (count($parts) < 2) {\n throw new NetException(\"The CRLFCRLF separator between headers and body is missing.\");\n }\n $response = new static($options + ['form... | [
"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 Github comment about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
// SortWithInfo adds a sort order. | [
"func (r *SearchRequest) SortWithInfo(info SortInfo) *SearchRequest {\n\tr.searchSource = r.searchSource.SortWithInfo(info)\n\treturn 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 Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
格式化字段值,按以下顺序尝试: data_format|field_name|base_type|data_type
@param mixed $field
@param string $value
@param string | [
"static public function formatValue($field, $value=null)\n {\n $methods = [];\n if (isset($field['data_format']) && $field['data_format']) {\n $methods[] = $field['data_format'];\n }\n $methods[] = $field['field_name'];\n if (isset($field['base_type']) && $field['bas... | [
"static function position($name, $value=null, $settings=[])\n {\n if (!isset($settings['description'])) {\n $settings['description'] = '位置可设为:1到9的数字表示九宫格的位置, 或100|30, 或 center|center, 或100|left';\n }\n \n return static::input('text', $name, $value, $settings);\n }"
] | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
// NewEmaWithSrcLen creates an Exponential Moving Average (Ema) for offline usage | [
"func NewEmaWithSrcLen(sourceLength uint, timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *Ema, err error) {\n\tind, err := NewEma(timePeriod, selectData)\n\n\t// only initialise the storage if there is enough source data to require it\n\tif sourceLength-uint(ind.GetLookbackPeriod()) > 1 {\n\... | [
"public void setLossVariables(String... lossVariableNames){\n this.lossVariables.clear();\n for(String s : lossVariableNames){\n addLossVariable(s);\n }\n //After changing loss function variables, we (probably) need to recreate gradient function - as gradient\n // funct... | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
This method initializes paneStatus
@return JPanel | [
"private JPanel getPaneStatus() {\r\n\t\tif (paneStatus == null) {\r\n\t\t\tpaneStatus = new JPanel();\r\n\t\t\tpaneStatus.setLayout(new BorderLayout(0,0));\r\n\t\t\tpaneStatus.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));\r\n\t\t\tpaneStatus.add(getTabbedStatus());\r\n\t\t}\r\n\t\treturn paneStatus;\r\n\... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Read all directories in modules directory and add each module to Modules
class.
Generate the load tree.
Not initialize modules !
@return void | [
"protected function loadAllModules()\n {\n $listModules = array_diff(scandir(MODULES_DIR), ['.', '..']);\n\n foreach ($listModules as $moduleName) {\n $modulePath = realpath(MODULES_DIR.$moduleName); //Symlink\n\n if (!is_dir($modulePath)) {\n continue;\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 programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Indicates whether thread-local has been initialised for the current thread. | [
"public boolean isInitialized() {\n WeakReference<Holder> ref = local.get();\n if (ref != null) {\n Holder holder = ref.get();\n return holder != null && holder.value != UNINITIALISED;\n } else {\n return false;\n }\n }"
] | [
"private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo... | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Check whether the group is valid.
@return bool | [
"public function valid() : bool\n {\n if ($this->privateErrors()) {\n return false;\n }\n foreach ((array)$this as $element) {\n if (is_string($element)) {\n continue;\n }\n if (!$element->getElement()->valid()) {\n re... | [
"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 description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about File management:"
} |
An F (fisher) random variate
Parameters
----------
d1 : int
Numerator degrees of freedom
d2 : int
Denominator degrees of freedom | [
"def Fisher(d1, d2, tag=None):\n \n assert (\n int(d1) == d1 and d1 >= 1\n ), 'Fisher (F) \"d1\" must be an integer greater than 0'\n assert (\n int(d2) == d2 and d2 >= 1\n ), 'Fisher (F) \"d2\" must be an integer greater than 0'\n return uv(ss.f(d1, d2), tag=tag)"
] | [
"def pearson(x, y):\n \n mx = Decimal(mean(x))\n my = Decimal(mean(y))\n\n xm = [Decimal(i) - mx for i in x]\n ym = [Decimal(j) - my for j in y]\n\n sx = [i ** 2 for i in xm]\n sy = [j ** 2 for j in ym]\n\n num = sum([a * b for a, b in zip(xm, ym)])\n den = Decimal(sum(sx) * sum(sy)).sqrt... | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Natural Language Processing:"
} |
Check list and create permissions based on sign and filters. | [
"def has_permission(self, request, view):\n \"\"\"\"\"\"\n if view.suffix == 'Instance':\n return True\n\n filter_and_actions = self._get_filter_and_actions(\n request.query_params.get('sign'),\n view.action,\n '{}.{}'.format(\n view.qu... | [
"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:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
Load all the Distribution set.
@param startIndex
as page start
@param count
as total data | [
"@Override\n protected List<ProxyDistribution> loadBeans(final int startIndex, final int count) {\n Page<DistributionSet> distBeans;\n final List<ProxyDistribution> proxyDistributions = new ArrayList<>();\n if (startIndex == 0 && firstPageDistributionSets != null) {\n distBeans = ... | [
"public void setPage(int page) {\n if(page < 0)\n throw new IllegalArgumentException(Bundle.getErrorString(\"PagerModel_IllegalPage\"));\n\n /* todo: need to check that the new 'current' page is in range given the first/last boundaries */\n _currentRow = new Integer(page * getPageSiz... | codesearchnet | {
"query": "Represent the Github summarization about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
启动
@param join 是否同步阻断
@throws ServerException | [
"public void start(boolean join) throws ServerException {\r\n\t\tserver = new Server(JettySetting.createQueuedThreadPool());\r\n\t\t\r\n\t\t// JVM退出时关闭Jetty\r\n\t\tserver.setStopAtShutdown(true);\r\n\t\t\r\n\t\t//初始化Connector\r\n\t\tServerConnector serverConnector = JettySetting.createServerConnectorAndAddToServer(... | [
"public static String getTransferQueue(String name) {\n LOG.debug(\"对于需要保序的情况,只应该启动单个中转节点,目前启动多个节点原节点会被挤掉线,但是由于重连机制,会轮着挤掉线\");\n return IdManager.generateStaticQueueId(buildTransferName(name));\n }"
] | codesearchnet | {
"query": "Represent the Github comment about API documentation:",
"pos": "Represent the Github code about API documentation:",
"neg": "Represent the Github code:"
} |
closeEvent reimplementation | [
"def closeEvent(self, event):\r\n \"\"\"\"\"\"\r\n if self.closing(True):\r\n event.accept()\r\n else:\r\n event.ignore()"
] | [
"public H2StreamProcessor startNewInboundSession(Integer streamID) {\n H2StreamProcessor h2s = null;\n h2s = muxLink.createNewInboundLink(streamID);\n return h2s;\n // call the stream processor with the data it needs to then call \"ready\" are the underlying HttpInboundLink\n // (... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Get full image info (dimesions, mime-type etc)
@param string $filename
@return ImageInfo | [
"public function getImageInfo($filename)\n\t{\n\t\tif ($filename instanceof Image) {\n\t\t\t$filename = $this->adapter->getFileStorage()->getImagePath($filename);\n\t\t}\n\n\t\t$info = new ImageInfo($filename);\n\n\t\tif ($info->hasError()) {\n\t\t\tthrow new ImageProcessorException('File ' . $filename . ' not foun... | [
"public function reduceFilePath($varValue, \\DataContainer $dc)\n {\n $doc = $dc->activeRecord;\n\n $path = \\FilesModel::findByUuid($varValue)->path;\n\n $arrFileNameParts = \\Document::splitFileName(substr($path, strlen(\\DmsConfig::getBaseDirectory(true))));\n\n // TODO (#33): reset the new fileType... | codesearchnet | {
"query": "Represent the Github summarization about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about Software development:"
} |
Query.
@param db
the db
@param conditions
the conditions
@param type
the type
@param listener
the listener | [
"static void query(SQLiteDatabase db, String conditions, QueryType type, OnResultListener listener) {\n\t\tString query = String.format(\n\t\t\t\t\"SELECT name, sql FROM sqlite_master WHERE type='%s'and name!='sqlite_sequence' and name!='android_metadata'%s\",\n\t\t\t\ttype.toString().toLowerCase(), StringUtils.has... | [
"def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)"
] | codesearchnet | {
"query": "Represent the post about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Helperfunction, if IPv6 in NET_ADDR/PREFIX
@param string $UserIP
@param string $net_addr
@param integer $net_mask
@return boolean
@access public | [
"protected static function checkIp6InNetwork($UserIP, $net_addr=0, $net_mask=0)\n {\n if ($net_mask <= 0)\n {\n return false;\n }\n // UserIP to bin\n $UserIP = static::expandNotationIpv6($UserIP);\n $Parts = explode(':', $UserIP);\n $Ip = array('', ''... | [
"def getNetworkName(self):\n \"\"\"\"\"\"\n print '%s call getNetworkname' % self.port\n networkName = self.__sendCommand(WPANCTL_CMD + 'getprop -v Network:Name')[0]\n return self.__stripValue(networkName)"
] | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Read one character from the stream or queue if available. Return
EOF when EOF is reached. | [
"def char(self):\n \n # Read a new chunk from the input stream if necessary\n if self.chunkOffset >= self.chunkSize:\n if not self.readChunk():\n return EOF\n\n chunkOffset = self.chunkOffset\n char = self.chunk[chunkOffset]\n self.chunkOffset = ch... | [
"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 text:",
"pos": "Represent the code:",
"neg": "Represent the code about File management:"
} |
// SetUserPoolId sets the UserPoolId field's value. | [
"func (s *AdminRemoveUserFromGroupInput) SetUserPoolId(v string) *AdminRemoveUserFromGroupInput {\n\ts.UserPoolId = &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 Github sentence about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
Download jar through {@link Grape} given an org, module and version
It is assumed that an ivy settings file exists on the classpath | [
"public static URI[] downloadJar(String org, String module, String version, boolean transitive) throws IOException {\n Map<String, Object> artifactMap = Maps.newHashMap();\n artifactMap.put(\"org\", org);\n artifactMap.put(\"module\", module);\n artifactMap.put(\"version\", version);\n artifactMap.pu... | [
"private Class<?> resolveClassWithCL(String name) throws ClassNotFoundException {\n SecurityManager security = System.getSecurityManager();\n if (security != null) {\n return Class.forName(name, false, getClassLoader(thisClass));\n }\n\n // The platform classloader is null if ... | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code about Programming:"
} |
Check if a given LDAP object exists. | [
"def _check_exists(database: Database, table: LdapObjectClass, key: str, value: str):\n \n try:\n get_one(table, Q(**{key: value}), database=database)\n return True\n except ObjectDoesNotExist:\n return False"
] | [
"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 summarization about Technology:",
"pos": "Represent the code about Technology:",
"neg": "Represent the code:"
} |
Get config for [[Dropdown]] widget
@return array config options | [
"protected function getDropdownConfig() {\n $config = $this->dropdown;\n $config['id'] = ArrayHelper::getValue($config, 'id', null);\n $config['clientOptions'] = false;\n $config['view'] = $this->getView();\n \n return $config;\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 comment:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Return the separable sum evaluated in ``x``. | [
"def _call(self, x):\n \"\"\"\"\"\"\n return sum(fi(xi) for xi, fi in zip(x, self.functionals))"
] | [
"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 text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Converts a string in the form of {@code yyyy-MM-dd'T'HH:mm:ss} to an API date time in the time
zone supplied. | [
"public static DateTime toDateTime(String dateTime, String timeZoneId) {\n return dateTimesHelper.toDateTime(dateTime, timeZoneId);\n }"
] | [
"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 description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
// Has returns true if a binder responsible to
// bind and return a type of "typ" is already registered to this controller. | [
"func (bv Values) Has(value interface{}) bool {\n\treturn bv.valueTypeExists(reflect.TypeOf(value))\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 Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Convert mappings to namedtuples recursively. | [
"def mapper(mapping, _nt_name='NT'):\n \n if isinstance(mapping, Mapping) and not isinstance(mapping, AsDict):\n for key, value in list(mapping.items()):\n mapping[key] = mapper(value)\n return namedtuple_wrapper(_nt_name, **mapping)\n elif isinstance(mapping, list):\n retur... | [
"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 sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Extract a username from a "username@hostname" pattern.
@param hostname value
@return username extracted, or null | [
"public static String extractUserName(final String hostname) {\n if (containsUserName(hostname)) {\n return hostname.substring(0, hostname.indexOf(\"@\"));\n } else {\n return null;\n }\n }"
] | [
"def uncomment(key, value, tree)\n # Try to find if it is commented out, so we can replace line\n matcher = Matcher.new(\n collection: \"#comment\",\n # FIXME: this assumes a specific \"=\" syntax, bypassing the lens\n # FIXME: this will match also \"# If you set FOO=bar then...\"\... | codesearchnet | {
"query": "Represent the Github summarization about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Computer Science:"
} |
return list of geo points from circle with given center and radius
:param center_point: GeoPoint with center of search circle
:param radius: radius of search circle
:return: generator with tuple with GeoPoints and distance | [
"def get_nearest_points(self, center_point, radius, unit='km'):\n \n assert isinstance(center_point, GeoPoint), \\\n 'point should be GeoPoint instance'\n for point in self.get_nearest_points_dirty(center_point, radius):\n distance = point.distance_to(center_point, unit)\n... | [
"def set_prop(self, prop, value, ef=None):\n \n if ef:\n # prop should be restricted to n_decoys, an int, the no. of decoys corresponding to a given FPF.\n # value is restricted to the corresponding enrichment factor and should be a float\n self.ef[prop] = value\n ... | codesearchnet | {
"query": "Represent the Github comment about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code about programming:"
} |
Get OS type.
@return OS type | [
"public static Type getType() {\n String osName = System.getProperty(\"os.name\").toLowerCase();\n\n if (osName.contains(\"windows\")) {\n return Type.WINDOWS;\n } else if (osName.contains(\"linux\")) {\n return Type.LINUX;\n } else if (osName.contains(\"mac\")) {\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 sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
<!-- begin-user-doc -->
<!-- end-user-doc -->
@generated | [
"public NotificationChain basicSetOnEntryScript(OnEntryScriptType newOnEntryScript, NotificationChain msgs) {\n\t\treturn ((FeatureMap.Internal)getMixed()).basicAdd(DroolsPackage.Literals.DOCUMENT_ROOT__ON_ENTRY_SCRIPT, newOnEntryScript, msgs);\n\t}"
] | [
"protected function _init($definition=null)\n {\n\n if (!is_null($definition)) {\n $this->_packageXml = simplexml_load_string($definition);\n } else {\n $packageXmlStub = <<<END\n<?xml version=\"1.0\"?>\n<package>\n <name />\n <version />\n <stability />\n <license... | codesearchnet | {
"query": "Represent the sentence about Text generation:",
"pos": "Represent the code about Text generation:",
"neg": "Represent the code:"
} |
// SetDescription sets the Description field's value. | [
"func (s *Cluster) SetDescription(v string) *Cluster {\n\ts.Description = &v\n\treturn s\n}"
] | [
"function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co... | codesearchnet | {
"query": "Represent the summarization about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.