query
stringlengths
16
255
pos
list
neg
list
task
stringclasses
1 value
instruction
dict
// eq returns whether this and that are equal.
[ "func eq(this, that *MyStruct) bool {\n\treturn (this == nil && that == nil) ||\n\t\tthis != nil && that != nil &&\n\t\t\tthis.Int64 == that.Int64 &&\n\t\t\t((this.StringPtr == nil && that.StringPtr == nil) || (this.StringPtr != nil && that.StringPtr != nil && *(this.StringPtr) == *(that.StringPtr)))\n}" ]
[ "function _parseVertex(line) {\n var vertex = JSON.parse(line);\n assert.ok(_smellsLikeAnElement(vertex));\n // A vertex is an object, i.e. a key,value map.\n // We don't sort the keys of the object, leaving that to jsonStableStringify below.\n // But a vertex values contain `prop...
codesearchnet
{ "query": "Represent the Github text about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Programming:" }
akede@users - 1.7.2 patch Files readonly
[ "public void setDataReadOnly(boolean value) {\n\n // Changing the Read-Only mode for the table is only allowed if the\n // the database can realize it.\n if (!value && database.isFilesReadOnly() && isFileBased()) {\n throw Error.error(ErrorCode.DATA_IS_READONLY);\n }\n\n ...
[ "function writeTimeBound(type, prmname, boundType, outputType) {\n return utils.parts(type, {\n B : prmname,\n // TODO: is this correct?\n C : boundType+'_'+(type === 'QU' ? 'UBT' : 'LBT')+'(KAF)',\n E : '1MON'\n }, outputType);\n //A=HEXT2014 B=SR-CMN_SR-CMN C=STOR_UBT(KAF) E=1MON F=CAMANCHE R FLOOD...
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Send an ON message to device group.
[ "def on(self):\n \"\"\"\"\"\"\n on_command = ExtendedSend(self._address,\n COMMAND_LIGHT_ON_0X11_NONE,\n self._udata,\n cmd2=0xff)\n on_command.set_checksum()\n self._send_method(on_command...
[ "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 sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Clean the config params from unnecessary params no to make the notification too heavy. @return array
[ "private function cleanConfigParams()\n {\n /**\n * Add the params you want to be removed from the push notification\n */\n $paramsToBeRemoved = ['apiKey'];\n\n return array_filter($this->config, function ($key) use ($paramsToBeRemoved) {\n return !in_array($key, $...
[ "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 programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Fetch the file names with status from the commit. @param string $commitId The commit identifier. @param GitRepository $git The git repository. @return string
[ "private function fetchNameStatusFromCommit($commitId, GitRepository $git)\n {\n $arguments = [\n $git->getConfig()->getGitExecutablePath(),\n 'show',\n $commitId,\n '-M',\n '--name-status',\n '--format='\n ];\n\n // git show ...
[ "protected static function initRepository(Binary $git, $path, $initArguments = null)\n {\n $initArguments = $initArguments ?: Array();\n\n /** @var $result CallResult */\n $result = $git->{'init'}($path, $initArguments);\n $result->assertSuccess(sprintf('Cannot initialize a Git reposi...
codesearchnet
{ "query": "Represent the instruction about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
Returns the declared return type of a method (for PHP < 7.0 this will always return null) @param string $className @param string $methodName @return string The declared return type of the method or null if none was declared
[ "public function getMethodDeclaredReturnType($className, $methodName)\n {\n $className = $this->prepareClassReflectionForUsage($className);\n if (!isset($this->classReflectionData[$className][self::DATA_CLASS_METHODS][$methodName][self::DATA_METHOD_DECLARED_RETURN_TYPE])) {\n return null...
[ "protected function getClassDistance(\n string $childClass,\n string $parentClass\n ): int {\n if ($childClass === $parentClass) {\n return 0;\n }\n\n $result = 0;\n $childParents = class_parents($childClass, true);\n foreach($childParents as $childPare...
codesearchnet
{ "query": "Represent the instruction about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code about Software Development:" }
Marshall the given parameter object.
[ "public void marshall(AssociateCreatedArtifactRequest associateCreatedArtifactRequest, ProtocolMarshaller protocolMarshaller) {\n\n if (associateCreatedArtifactRequest == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\n }\n\n try {\n ...
[ "def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p" ]
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Store a new user. @return \Illuminate\Http\Response
[ "public function store()\n {\n $password = Str::random();\n\n $input = array_merge(Binput::only(['first_name', 'last_name', 'email']), [\n 'password' => $password,\n 'activated' => true,\n 'activated_at' => new DateTime(),\n ]);\n\n $rules = Use...
[ "public function handle(PublishThePost $event) {\n $this->sendEmailsFromList->sendEmails($event->data['id']['listID'], $event->data['id']);\n \\Log::info('Lasallecms\\Lasallecmsapi\\Listeners\\TriggerLaSalleCRMList listener completed');\n }" ]
codesearchnet
{ "query": "Represent the comment about Laravel:", "pos": "Represent the code about Laravel:", "neg": "Represent the code about Software development:" }
XYZ to RGB conversion.
[ "def XYZ_to_RGB(cobj, target_rgb, *args, **kwargs):\n \n temp_X = cobj.xyz_x\n temp_Y = cobj.xyz_y\n temp_Z = cobj.xyz_z\n\n logger.debug(\" \\- Target RGB space: %s\", target_rgb)\n target_illum = target_rgb.native_illuminant\n logger.debug(\" \\- Target native illuminant: %s\", target_illum...
[ "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 post:", "pos": "Represent the code:", "neg": "Represent the code:" }
Encode a string for use in the URL @param toEncode @return
[ "private static String encoder(final String toEncode) {\n try {\n return URLEncoder.encode(toEncode, URL_ENCODING);\n } catch (UnsupportedEncodingException ex) {\n LOG.warn(\"Failed to encode: {}\", ex.getMessage(), ex);\n return \"\";\n }\n }" ]
[ "def changeTo(self, path):\n '''\n '''\n dictionary = DictSingle(Pair('PATH', StringSingle(path)))\n self.value = [dictionary]" ]
codesearchnet
{ "query": "Represent the summarization about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
Handle request. @throws \EntWeChat\Core\Exceptions\RuntimeException @throws \EntWeChat\Server\BadRequestException @return array
[ "protected function handleRequest()\n {\n $message = $this->getMessage();\n $response = $this->handleMessage($message);\n\n return [\n 'to' => $message['FromUserName'],\n 'from' => $message['ToUserName'],\n 'response' => $response,\n ];\n ...
[ "public function setSubscriptionAddon(SetAddon\\RequestData $requestData)\n {\n $request = new SetAddon\\Request($requestData);\n\n return $this->sendRequest($request, SetAddon\\ApiResponse::class);\n }" ]
codesearchnet
{ "query": "Represent the Github comment about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code about Programming:" }
Closes all tabs of the states editor for a specific sm_id
[ "def close_pages_for_specific_sm_id(self, sm_id):\n \"\"\"\"\"\"\n states_to_be_closed = []\n for state_identifier in self.tabs:\n state_m = self.tabs[state_identifier][\"state_m\"]\n if state_m.state.get_state_machine().state_machine_id == sm_id:\n states_t...
[ "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 summarization:", "pos": "Represent the code:", "neg": "Represent the code:" }
Send to data output back to editor's associated element.
[ "function updateEditorElement() {\n\t\tvar element = this.element;\n\n\t\t// Some editor creation mode will not have the\n\t\t// associated element.\n\t\tif ( element && this.elementMode != CKEDITOR.ELEMENT_MODE_APPENDTO ) {\n\t\t\tvar data = this.getData();\n\n\t\t\tif ( this.config.htmlEncodeOutput )\n\t\t\t\tdat...
[ "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 summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Removes a task from a taskType queue @param taskType the taskType to identify the queue @param taskId the id of the task to be removed
[ "public void removeTaskFromQueue(String taskType, String taskId) {\n Preconditions.checkArgument(StringUtils.isNotBlank(taskType), \"Task type cannot be blank\");\n Preconditions.checkArgument(StringUtils.isNotBlank(taskId), \"Task id cannot be blank\");\n\n delete(\"tasks/queue/{taskType}/{tas...
[ "function(loader) {\n // public\n this.maxRecursion = 5;\n this.loader = (typeof loader === 'function') ? loader : null;\n\n // internal\n this._schemaRegistry = new SchemaRegistry();\n this._customFormatHandlers = {};\n\n // _refsRequested is an object where the key is the normalized ID\n // of the schema ...
codesearchnet
{ "query": "Represent the comment about Work management:", "pos": "Represent the code about Work management:", "neg": "Represent the code:" }
@param array $components @param array $keys @return null|string
[ "protected function guessBestComponent(array $components, array $keys)\n {\n foreach ($keys as $key) {\n if (isset($components[$key]) && !empty($components[$key])) {\n return $components[$key];\n }\n }\n\n return null;\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 Github text about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Uninstalls the Docker image associated with a given bug.
[ "def uninstall(self, bug: Bug) -> bool:\n \n r = self.__api.post('bugs/{}/uninstall'.format(bug.name))\n raise NotImplementedError" ]
[ "func New(*SmartSampleConfig, log.Logger, dtsink) (*SmartSampler, error) {\n\treturn nil, errors.New(\"you are attempting to configure a regular SignalFx Gateway with the config of a Smart Gateway. This is an unsupported configuration\")\n}" ]
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
// Close closes the alias store.
[ "func (a *Aliases) Close() error {\n\ta.mtx.Lock()\n\tdefer a.mtx.Unlock()\n\n\treturn a.db.Close()\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 Github post about Container management:", "pos": "Represent the Github code about Container management:", "neg": "Represent the Github code:" }
Same as ActiveModel::model but allows you to define the main model in the composition using +:on+. class CoverSongForm < Reform::Form model :song, on: :cover_song
[ "def model(main_model, options={})\n super\n\n composition_model = options[:on] || main_model\n\n # FIXME: this should just delegate to :model as in FB, and the comp would take care of it internally.\n [:persisted?, :to_key, :to_param].each do |method|\n define_method method do\n ...
[ "def map ref,route, options={}\n context = Context.collection[get_context]\n context.routes[ref]= Route.new(route, context,options)\n end" ]
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
Pobranie plików dla podanych obiektów (np. news, categorywidget itp.) @param array $objects @return array indeksowane po nazwie md5
[ "public function getFileList($objects)\n {\n //błąd\n if (!is_array($objects)) {\n return [];\n }\n //zwrot meta plików\n return (new \\Cms\\Orm\\CmsFileQuery)->whereObject()->equals($objects)\n ->findPairs('name', 'original');\n }" ]
[ "public static function byObjectAndClass($object = null, $objectId = null, $class = 'image')\n {\n //zapytanie o pliki po obiektach i id\n return (new self)\n ->whereObject()->equals($object)\n ->andFieldObjectId()->equals($objectId)\n ->whereClass()->eq...
codesearchnet
{ "query": "Represent the post about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Programming:" }
Execute the command.
[ "public function handle()\n {\n $config = $this->getConfig();\n\n if (! $config->isForce() && ! $this->confirm('Are you sure you want to scrap the view?')) {\n $this->line('Alright, nothing happened.');\n\n return;\n }\n\n (new Destroyer($config, $this->getPath()...
[ "def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p" ]
codesearchnet
{ "query": "Represent the Github text about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Invokes the property grid with this element as its target.
[ "public void editProperties() {\n try {\n PropertyGrid.create(this, null);\n } catch (Exception e) {\n DialogUtil.showError(\"Displaying property grid: \\r\\n\" + e.toString());\n }\n }" ]
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
@param $name @param null $value @param null|bool $literal @return mixed @throws KeyDoesNotExistException
[ "public function item($name, $value = null, $literal = null)\n {\n $literal = is_null($literal) ? $this->isLiteral() : $literal;\n\n func_num_args() < 2 || $this->items[$name] = $value;\n\n if (!$literal) {\n return $this->find($name, $this->items);\n }\n\n isset($th...
[ "public static function ExpectRetrievedValueIsString(\n string $property,\n $value,\n string $class_name\n ) : string {\n /**\n * @psalm-var T\n */\n $value = static::MaybeThrowIfNotType($property, $value, $class_name, 'string');\n\n return $value;\n }" ...
codesearchnet
{ "query": "Represent the instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }
Initialize the console
[ "protected function initConsole()\n {\n $consoles = $this->setConsoles();\n foreach ($consoles as $console) {\n\n if ($console[0] == $this->consoleArguments[0]) {\n Console::add($console[1], $this->consoleArguments);\n }\n }\n\n Console::dispatch()...
[ "@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 post:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Programming:" }
Remove broken entity references This removes references from nodes to entities which don't exist anymore. @param string $workspaceName @return void @throws NodeException @throws PropertyException @throws SecurityException
[ "public function removeBrokenEntityReferences($workspaceName)\n {\n $this->dispatch(self::EVENT_NOTICE, 'Checking for broken entity references ...');\n\n /** @var \\Neos\\ContentRepository\\Domain\\Model\\Workspace $workspace */\n $workspace = $this->workspaceRepository->findByIdentifier($wo...
[ "public static function all($params = null, $opts = null)\n {\n $msg = \"Subscription Schedule Revisions cannot be listed without a Subscription Schedule ID. \" .\n \"List those using \\$schedule->allRevisions('revision_id') instead.\";\n throw new Error\\InvalidRequest($msg, null);\n...
codesearchnet
{ "query": "Represent the text about Technology:", "pos": "Represent the code about Technology:", "neg": "Represent the code about PHP:" }
Check if the IP address is valid and routable Return either True or False
[ "def _valid_ip(ip_address):\n '''\n \n '''\n\n try:\n address = ipaddress.IPv4Address(ip_address)\n except ipaddress.AddressValueError:\n return False\n\n if address.is_unspecified or \\\n address.is_loopback or \\\n address.is_link_local or \\\n address.is_multi...
[ "def connection_ok():\n \n try:\n urlopen(Dataset.base_url, timeout=1)\n # if an index page is ever added, this will pass through\n return True\n except HTTPError:\n # There's no index for BASE_URL so Error 404 is expected\n return True\n except URLError:\n # Th...
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Find document root @return string @access public
[ "public function getDocumentRootPath()\n {\n /**\n * The absolute pathname of the currently executing script.\n * Notatka: If a script is executed with the CLI, as a relative path, such as file.php or ../file.php,\n * $_SERVER['SCRIPT_FILENAME'] will contain the relative path speci...
[ "private function cmdGenerate()\n {\n //check if path exists\n if (!is_dir($this->configKeyPath)) {\n Main::copyDirectoryContents(dirname(__DIR__).'/Config/Devbr/Key', $this->configKeyPath);\n }\n //Now, OPEN_SSL\n $this->createKeys();\n return \"\\n Can, Ope...
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Marshall the given parameter object.
[ "public void marshall(PutTelemetryRecordsRequest putTelemetryRecordsRequest, ProtocolMarshaller protocolMarshaller) {\n\n if (putTelemetryRecordsRequest == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\n }\n\n try {\n protocolMarshal...
[ "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:" }
Run build given the following skyuxconfig object. Starts server and resolves when ready.
[ "function prepareBuild(config) {\n\n function serve(exitCode) {\n\n // Save our exitCode for testing\n _exitCode = exitCode;\n\n // Reset skyuxconfig.json\n resetConfig();\n\n return server.start('unused-root', tmp)\n .then(port => browser.get(`https://localhost:${port}/dist/`));\n }\n\n writ...
[ "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 description about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
// ResetNetwork resets all properties of a network to its initial (empty) state
[ "func (s *Server) ResetNetwork(w http.ResponseWriter, req *http.Request) {\n\ts.network.Reset()\n\n\tw.WriteHeader(http.StatusOK)\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 summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
// NewFromFile attempts to create a policy list from the given file. // // TODO: Have policies be created via an API call and stored in REST storage.
[ "func NewFromFile(path string) (PolicyList, error) {\n\t// File format is one map per line. This allows easy concatenation of files,\n\t// comments in files, and identification of errors by line number.\n\tfile, err := os.Open(path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer file.Close()\n\n\tscanner :=...
[ "public FunctionHandle resolveFunction(Session session, QualifiedName name, List<TypeSignatureProvider> parameterTypes)\n {\n // TODO Actually use session\n // Session will be used to provide information about the order of function namespaces to through resolving the function.\n // This is l...
codesearchnet
{ "query": "Represent the Github summarization about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about Software development:" }
Creates an UploadedFileMap from the $_FILES superglobal. @param array $files @return array
[ "public static function createFromFilesGlobal(array $files) : array\n {\n $items = [];\n $files = self::normalizeSuperglobal($files);\n self::buildMap($files, $items);\n\n return $items;\n }" ]
[ "public File getExistingFile(final String param) {\n return get(param, getFileConverter(),\n new And<>(new FileExists(), new IsFile()),\n \"existing file\");\n }" ]
codesearchnet
{ "query": "Represent the text about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about File management:" }
Returns a list of game objects matching the search query. Learn more: https://github.com/justintv/Twitch-API/blob/master/v3_resources/search.md#get-searchgames @param string $query Search query @param array $params Optional params @return array
[ "public function searchGames($query, $params = [])\n {\n $defaults = [\n 'query' => urlencode($query),\n 'limit' => 25,\n 'type' => 'suggest',\n 'live' => false,\n ];\n\n return $this->wrapper->request('GET', 'search/games', ['query' => $this->resolveOptions($pa...
[ "def group_list(self, params=None):\n ''' \n '''\n params = params if params else dict()\n return self.request('/v1/firewall/group_list', params, 'GET')" ]
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code:" }
@see \PDO::quote() @param string $string @param int $parameter_type @return string
[ "public function quote($string, $parameter_type = \\PDO::PARAM_STR): string {\n return $this->connection->quote($string, $parameter_type);\n }" ]
[ "public function columnSql($column, $platform)\n {\n return $platform->columnSql($column, \"set('\" . implode(\"','\", $this->_set) . \"')\", $this->options());\n }" ]
codesearchnet
{ "query": "Represent the Github summarization about PHP programming:", "pos": "Represent the Github code about PHP programming:", "neg": "Represent the Github code about Software development:" }
Get items array of target dirctory @param string $dirname itemId path @param bool $recursive @param number $maxResults @param string $query @return array Items array
[ "protected function getItems($dirname, $recursive = false, $maxResults = 0, $query = '')\n {\n list (, $itemId) = $this->splitPath($dirname);\n\n $maxResults = min($maxResults, 1000);\n $results = [];\n $parameters = [\n 'pageSize' => $maxResults ?: 1000,\n 'fiel...
[ "def requests(self):\n ''''''\n path = pathjoin(self.path, self.name, Request.path)\n response = self.service.send(SRequest('GET', path))\n # a bin behaves as a push-down store --- better to return the requests\n # in order of appearance\n return list(reversed(Request.from_...
codesearchnet
{ "query": "Represent the Github instruction about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
Tests the existance and eventually creates a directory @param string $dir @param int $mode @param boolean $recursive @return boolean
[ "public static function safeMkdir($dir, $mode = 0777, $recursive = true) {\n\t\tif (! \\is_dir ( $dir ))\n\t\t\treturn \\mkdir ( $dir, $mode, $recursive );\n\t\treturn true;\n\t}" ]
[ "function openForWrite()\n {\n $this->mode_xxx['write'] = 'W';\n\n if (!$this->hasCreate() && !$this->hasXCreate())\n ## write to file must has create or xcreate by default\n $this->createFile();\n\n return $this;\n }" ]
codesearchnet
{ "query": "Represent the Github description about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about File management:" }
Go through all the values of an object and adds the corresponding value inside its entries using the provided keyName @param {Object} container @param {String} keyName
[ "function (container, keyName) {\n for (var element in container) {\n if (container.hasOwnProperty(element)) {\n container[element][keyName] = element;\n }\n }\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 post about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Store a value in an encrypted cookie @param string $name @return mixed|null (typically an array) @throws InvalidDigestLength @throws InvalidSignature @throws CannotPerformOperation @throws InvalidType @throws \TypeError
[ "public function fetch(string $name)\n {\n if (!isset($_COOKIE[$name])) {\n return null;\n }\n try {\n /** @var string|array|int|float|bool $stored */\n $stored = $_COOKIE[$name];\n if (!\\is_string($stored)) {\n throw new InvalidTyp...
[ "protected function sendBackgroundEncodedFormElementsByPost($urlToSendTo, $params = [])\n {\n $postingUrl = filter_var($urlToSendTo, FILTER_VALIDATE_URL);\n if ($postingUrl === false) {\n throw new \\Exception('Invalid URL in ' . __FUNCTION__);\n }\n if ($params !== []) {\n...
codesearchnet
{ "query": "Represent the Github comment about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about Programming:" }
Lazy-load the available choices for the select box
[ "public function load_choices() {\n if (during_initial_install()) {\n return false;\n }\n if (is_array($this->choices)) {\n return true;\n }\n\n $this->choices = ['' => new lang_string('sitepolicyhandlercore', 'core_admin')];\n $manager = new \\core_pr...
[ "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:" }
Attempts to get all information about this user. This method will make 3 requests! @param mixed $identities @return Dto\Summoner;
[ "public function allInfo($identities)\n\t{\n\t\t$summoners = $this->info($identities);\n\t\t$this->runePages($summoners);\n\t\t$this->masteryPages($summoners);\n\n\t\treturn $summoners;\n\t}" ]
[ "def syncItems(self):\n \n if 'sync-target' not in self.provides:\n raise BadRequest('Requested syncList for device which do not provides sync-target')\n\n return self._server.syncItems(client=self)" ]
codesearchnet
{ "query": "Represent the post about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Copy the application into the package.
[ "function (options, dir, callback) {\n var applicationDir = path.join(dir, 'lib', options.id)\n options.logger('Copying application to ' + applicationDir)\n\n async.waterfall([\n async.apply(fs.ensureDir, applicationDir),\n async.apply(fs.copy, options.src, applicationDir)\n ], function (err) {\n callb...
[ "@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 text:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Scan for miflora devices. Note: this must be run as root!
[ "def scan(backend, timeout=10):\n \n result = []\n for (mac, name) in backend.scan_for_devices(timeout):\n if (name is not None and name.lower() in VALID_DEVICE_NAMES) or \\\n mac is not None and mac.upper().startswith(DEVICE_PREFIX):\n result.append(mac.upper())\n retur...
[ "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 description:", "pos": "Represent the code:", "neg": "Represent the code:" }
Get an MD5 for a geometry object Parameters ------------ geometry : object Returns ------------ MD5 : str
[ "def geometry_hash(geometry):\n \n if hasattr(geometry, 'md5'):\n # for most of our trimesh objects\n md5 = geometry.md5()\n elif hasattr(geometry, 'tostring'):\n # for unwrapped ndarray objects\n md5 = str(hash(geometry.tostring()))\n\n if hasattr(geometry, 'visual'):\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 description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
process any watches in the last time period
[ "function processWatches(items) {\n // queue up matches\n // { \"member\" : { \"uri\" : [ \"match\", \"match\" ] } }\n var toSend = {};\n GLOBAL.svc.indexer.retrieveWatches({}, function(err, res) {\n if (res.hits) {\n var watches = _.pluck(res.hits.hits, '_source');\n // for each hit\n items.f...
[ "def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR...
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Construct a DataFrame from an RDD of DataFrames. No checking or validation occurs.
[ "def fromDataFrameRDD(cls, rdd, sql_ctx):\n \"\"\"\"\"\"\n result = DataFrame(None, sql_ctx)\n return result.from_rdd_of_dataframes(rdd)" ]
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the comment:", "pos": "Represent the code:", "neg": "Represent the code:" }
Get sort structure. @return array
[ "public function getSortStructure()\n {\n $sort = [$this->getField() => (object)['order' => $this->getOrder()]];\n\n if ($this->getMode()) {\n $sort[$this->getField()]->mode = $this->getMode();\n }\n if ($this->getMissing()) {\n $sort[$this->getField()]->missing ...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
// GetBucketInfo gets bucket metadata..
[ "func (l *b2Objects) GetBucketInfo(ctx context.Context, bucket string) (bi minio.BucketInfo, err error) {\n\tif _, err = l.Bucket(ctx, bucket); err != nil {\n\t\treturn bi, err\n\t}\n\treturn minio.BucketInfo{\n\t\tName: bucket,\n\t\tCreated: time.Unix(0, 0),\n\t}, nil\n}" ]
[ "private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo...
codesearchnet
{ "query": "Represent the sentence about AWS S3:", "pos": "Represent the code about AWS S3:", "neg": "Represent the code about programming:" }
Return an absolute version of this path. This function works even if the path doesn't point to anything. No normalization is done, i.e. all '.' and '..' will be kept along. Use resolve() to get the canonical path to a file.
[ "def absolute(self):\n \n # XXX untested yet!\n if self.is_absolute():\n return self\n # FIXME this must defer to the specific flavour (and, under Windows,\n # use nt._getfullpathname())\n obj = self._from_parts([os.getcwd()] + self._parts, init=False)\n o...
[ "def resolveEntryPoint(entryPoint):\n \n if inVirtualEnv():\n path = os.path.join(os.path.dirname(sys.executable), entryPoint)\n # Inside a virtualenv we try to use absolute paths to the entrypoints.\n if os.path.isfile(path):\n # If the entrypoint is present, Toil must have be...
codesearchnet
{ "query": "Represent the sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }
Indents a string. @param String string @param Number nchars @param String prefix @return String
[ "function indent(string, nchars, prefix) {\n \"use strict\";\n return string.split('\\n').map(function(line) {\n return (prefix || '') + new Array(nchars).join(' ') + line;\n }).join('\\n');\n}" ]
[ "def get_variable_grammar(self):\n \n # Defining a expression for valid word\n word_expr = Word(alphanums + '_' + '-')\n word_expr2 = Word(initChars=printables, excludeChars=['{', '}', ',', ' '])\n name_expr = Suppress('variable') + word_expr + Suppress('{')\n state_expr = ...
codesearchnet
{ "query": "Represent the Github sentence about text processing:", "pos": "Represent the Github code about text processing:", "neg": "Represent the Github code about programming:" }
get MetricSnapshot formatted value string
[ "public static String getMetricValue(MetricSnapshot snapshot) {\n if (snapshot == null) return null;\n MetricType type = MetricType.parse(snapshot.get_metricType());\n switch (type) {\n case COUNTER:\n return format(snapshot.get_longValue());\n case GAUGE:\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 sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Programming:" }
Format search results. Args: search_results (list of `ResourceSearchResult`): Search to format. Returns: List of 2-tuple: Text and color to print in.
[ "def format_search_results(self, search_results):\n \n formatted_lines = []\n\n for search_result in search_results:\n lines = self._format_search_result(search_result)\n formatted_lines.extend(lines)\n\n return formatted_lines" ]
[ "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 about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
Marshall the given parameter object.
[ "public void marshall(DescribePullRequestEventsRequest describePullRequestEventsRequest, ProtocolMarshaller protocolMarshaller) {\n\n if (describePullRequestEventsRequest == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\n }\n\n try {\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 description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Dumps the node descendants into a string using HTML formatting. @param string $delimiter @return string
[ "public function innerHtml($delimiter = '')\n {\n $innerHtml = [];\n\n foreach ($this->node->childNodes as $childNode) {\n $innerHtml[] = $childNode->ownerDocument->saveHTML($childNode);\n }\n\n return implode($delimiter, $innerHtml);\n }" ]
[ "def label(self, string):\n \n if '*/' in string:\n raise ValueError(\"Bad label - cannot be embedded in SQL comment\")\n return self.extra(where=[\"/*QueryRewrite':label={}*/1\".format(string)])" ]
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
// SetSshKey sets the SshKey field's value.
[ "func (s *Source) SetSshKey(v string) *Source {\n\ts.SshKey = &v\n\treturn s\n}" ]
[ "private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo...
codesearchnet
{ "query": "Represent the Github instruction about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code about programming:" }
Arguments are comma-separated expressions
[ "function() {\n var args = [], arg;\n\n arg = $(this.expression);\n while (arg) {\n args.push(arg);\n if (! $(',')) { break; }\n arg = $(this.expression);\n }\n\n ...
[ "def serialize_identity(self, identity):\n \n section, check, iterargs = identity\n values = map(\n # separators are without space, which is the default in JavaScript;\n # just in case we need to make these keys in JS.\n partial(json.dumps, separators=(',', ':'))\n # iterargs ar...
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
remove the source path from the dirname (if it exists)
[ "def digest_dirname(file_path)\n slash_path(File.dirname(file_path)).sub(slash_path(self.source.path), '')\n end" ]
[ "function(request, modules_root, options){\n var [path, analysis] = normalize_path(request, modules_root, options.relative_path_root);\n var cache_path = path; // define cachepath as path to file with content. For modules, defines path to package.json\n if(analysis.is_a_module) cache_path = \"m...
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Create the Whisper file on disk
[ "def _create(self):\n \"\"\"\"\"\"\n if not os.path.exists(settings.SALMON_WHISPER_DB_PATH):\n os.makedirs(settings.SALMON_WHISPER_DB_PATH)\n archives = [whisper.parseRetentionDef(retentionDef)\n for retentionDef in settings.ARCHIVES.split(\",\")]\n whisper....
[ "func New(*SmartSampleConfig, log.Logger, dtsink) (*SmartSampler, error) {\n\treturn nil, errors.New(\"you are attempting to configure a regular SignalFx Gateway with the config of a Smart Gateway. This is an unsupported configuration\")\n}" ]
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
@param \Platformsh\Client\Model\Certificate $cert @param string $alias @return string|bool
[ "protected function getCertificateIssuerByAlias(Certificate $cert, $alias) {\n foreach ($cert->issuer as $issuer) {\n if (isset($issuer['alias'], $issuer['value']) && $issuer['alias'] === $alias) {\n return $issuer['value'];\n }\n }\n\n return false;\n }"...
[ "public function file(string $path, string $md5)\n {\n //==============================================================================\n // Create Event Object\n $event = new ObjectFileEvent($this->getWebserviceId(), $path, $md5);\n //============================================...
codesearchnet
{ "query": "Represent the comment about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Software development:" }
Run the system test suite.
[ "def system(session):\n \"\"\"\"\"\"\n\n # Sanity check: Only run system tests if the environment variable is set.\n if not os.environ.get('GOOGLE_APPLICATION_CREDENTIALS', ''):\n session.skip('Credentials must be set via environment variable.')\n\n # Install all test dependencies, then install t...
[ "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 description:", "pos": "Represent the code:", "neg": "Represent the code:" }
//MarshalAnsilbe mashals the struct into an Ansible supported JSON
[ "func (h *Host) MarshalAnsible() map[string]interface{} {\n\tvar vStr []map[string]interface{}\n\tif len(h.Vars) > 0 {\n\t\tfor i := range h.Vars {\n\t\t\tvStr = append(vStr, h.Vars[i].MarshalAnsible())\n\t\t}\n\t\treturn map[string]interface{}{h.Name: map[string]interface{}{\"vars\": vStr}}\n\t}\n\treturn map[stri...
[ "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:" }
// AddSSHKeyToAllInstances adds an SSH public key as a legal identity for all instances // expected format for the key is standard ssh-keygen format: <protocol> <blob>
[ "func (g *Cloud) AddSSHKeyToAllInstances(ctx context.Context, user string, keyData []byte) error {\n\tctx, cancel := cloud.ContextWithCallTimeout()\n\tdefer cancel()\n\n\treturn wait.Poll(2*time.Second, 30*time.Second, func() (bool, error) {\n\t\tproject, err := g.c.Projects().Get(ctx, g.projectID)\n\t\tif err != 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 summarization:", "pos": "Represent the code:", "neg": "Represent the code about Technology:" }
Renders the provided value. @param array<string, mixed> $context @param mixed $value @param array<string, mixed> $parameters @param string $viewContext @return string
[ "public function renderValue(array $context, $value, array $parameters = [], ?string $viewContext = null): string\n {\n try {\n return $this->renderer->renderValue(\n $value,\n $this->getViewContext($context, $viewContext),\n $parameters\n ...
[ "protected static function getField(\n ParticleInterface $particle,\n FieldsCargo $cargo,\n string $name,\n array $args = []\n )/*: mixed*/\n {\n $name = Utils::findFieldName($cargo, $name);\n return $particle->attributes()->$name; // test with null.\n }" ]
codesearchnet
{ "query": "Represent the Github description about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Software development:" }
// SetSubmitTimeMillis sets the SubmitTimeMillis field's value.
[ "func (s *Timing) SetSubmitTimeMillis(v int64) *Timing {\n\ts.SubmitTimeMillis = &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 sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Safely create a symbolic link to an input field.
[ "def make_symlink(src_path, lnk_path):\n \"\"\"\"\"\"\n\n # Check for Lustre 60-character symbolic link path bug\n if CHECK_LUSTRE_PATH_LEN:\n src_path = patch_lustre_path(src_path)\n lnk_path = patch_lustre_path(lnk_path)\n\n # os.symlink will happily make a symlink to a non-existent\n ...
[ "def template(self):\n \n\n # First try props\n if self.props.template:\n return self.props.template\n else:\n # Return the wtype of the widget, and we'll presume that,\n # like resources, there's a .html file in that directory\n return self.wt...
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
/* At this point, any content is assumed to be an URL
[ "function(url) {\n\t\t\t\t\tvar self = this,\n\t\t\t\t\t\tdeferred = $.Deferred();\n\t\t\t\t\t/* we are using load so one can specify a target with: url.html #targetelement */\n\t\t\t\t\tvar $container = $('<div></div>').load(url, function(response, status){\n\t\t\t\t\t\tif ( status !== \"error\" ) {\n\t\t\t\t\t\t...
[ "public FunctionHandle resolveFunction(Session session, QualifiedName name, List<TypeSignatureProvider> parameterTypes)\n {\n // TODO Actually use session\n // Session will be used to provide information about the order of function namespaces to through resolving the function.\n // This is l...
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
// GetPassword gets a line with the prefix and doesn't echo input.
[ "func (term *Terminal) GetPassword(prefix string) (string, error) {\n\tprefix += \" \"\n\n\tif !term.t.supportsEditing {\n\t\treturn term.simplePrompt(prefix)\n\t}\n\n\tbuf := NewBuffer(prefix, term.Out, false)\n\treturn term.password(buf, NewAnsiReader(term.In))\n}" ]
[ "def handle_key ch\n $log.debug \" KeyDispatcher GOT KEY #{ch} \"\n @keyint = ch\n @keychr = nil\n chr = nil\n chr = ch.chr if ch > 32 and ch < 127\n @keychr = chr\n\n ret = process_key ch\n # revert to the basic handling of key_map and refreshing pad.\n #####\n # ...
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code:" }
Loads the context map from the VFS.<p> @return the context map @throws Exception if something goes wrong
[ "private Map<String, CmsTemplateContext> initMap() throws Exception {\r\n\r\n Map<String, CmsTemplateContext> result = new LinkedHashMap<String, CmsTemplateContext>();\r\n String path = getConfigurationPropertyPath();\r\n CmsResource resource = m_cms.readResource(path);\r\n CmsFile file ...
[ "@Override\n public boolean setProperty(String name, Object value)\n {\n /* Note: can not call local method, since it'll return false for\n * recognized but non-mutable properties\n */\n return mConfig.setProperty(name, value);\n }" ]
codesearchnet
{ "query": "Represent the comment about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
Get informations about SaaS CSP2 options REST: GET /order/cart/{cartId}/csp2/options @param cartId [required] Cart identifier @param planCode [required] Identifier of a SaaS CSP2 main offer
[ "public ArrayList<OvhGenericOptionDefinition> cart_cartId_csp2_options_GET(String cartId, String planCode) throws IOException {\n\t\tString qPath = \"/order/cart/{cartId}/csp2/options\";\n\t\tStringBuilder sb = path(qPath, cartId);\n\t\tquery(sb, \"planCode\", planCode);\n\t\tString resp = execN(qPath, \"GET\", sb....
[ "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 post:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Natural Language Processing:" }
Write a list of Strings to document as elements with given tag name. @param xmlOutput the XMLOutput object to write to @param tagName the tag name @param listValues Collection of String values to write
[ "public static void writeElementList(XMLOutput xmlOutput, String tagName, Iterable<String> listValues) throws IOException {\n writeElementList(xmlOutput, tagName, listValues.iterator());\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 Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
See neighbor_graph.
[ "def incremental_neighbor_graph(X, precomputed=False, k=None, epsilon=None,\n weighting='none'):\n ''''''\n assert ((k is not None) or (epsilon is not None)\n ), \"Must provide `k` or `epsilon`\"\n assert (_issequence(k) ^ _issequence(epsilon)\n ), \"Exactly one of...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
@param Queries\ISegment[] $segments @return Queries\ISegment[]
[ "protected function processSegments(array $segments)\n {\n $this->segments = [];\n\n foreach ($segments as $segment) {\n $this->segments[] = $segment->traverse($this);\n }\n\n return $this->segments;\n }" ]
[ "public function handleManipulateAST(ManipulateAST $ManipulateAST): void\n {\n $ManipulateAST->documentAST = ASTHelper::attachDirectiveToObjectTypeFields(\n $ManipulateAST->documentAST,\n PartialParser::directive('@deferrable')\n );\n\n $ManipulateAST->documentAST->setD...
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
// NewAddress is called to get new addresses for delivery, change etc.
[ "func (m *mockWalletController) NewAddress(addrType lnwallet.AddressType,\n\tchange bool) (btcutil.Address, error) {\n\taddr, _ := btcutil.NewAddressPubKey(\n\t\tm.rootKey.PubKey().SerializeCompressed(), &chaincfg.MainNetParams)\n\treturn addr, nil\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 text about Address:", "pos": "Represent the Github code about Address:", "neg": "Represent the Github code about Software development:" }
Apply a predicate to the optional, if the optional is present, and the predicate is true, return the optional, otherwise return empty. @param predicate the predicate to apply @return the optional if the predicate is true, empty if not @since 1.7
[ "public Optional<T> filter(final Predicate<? super T> predicate) {\n if (isPresent() && predicate.test(get())) {\n return this;\n }\n\n return empty();\n }" ]
[ "function Rule(rules) {\n this.rules = rules;\n // Identifies individual rule\n this.name = \"\";\n // Identifies the grammar that this rule belongs to \n this.grammarName = \"\";\n // Identifies types of rules. Rules can have \"types\" that are diff...
codesearchnet
{ "query": "Represent the Github instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
----- private methods -----
[ "private void updateAccessInformation(final SecurityContext securityContext, final PropertyContainer propertyContainer) throws FrameworkException {\n\n\t\ttry {\n\n\t\t\tif (securityContext.modifyAccessTime()) {\n\n\t\t\t\tfinal Principal user = securityContext.getUser(false);\n\t\t\t\tString modifiedById = null;\...
[ "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 comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Delete migration file if options is set @param string $migration @return null
[ "protected function deleteIfNeeded($migration)\n {\n if (!$this->input->getOption('delete')) {\n return;\n }\n\n if ($this->migrator->deleteMigrationFile($migration)) {\n $this->message(\"<info>Deleted:</info> {$migration}.php\");\n }\n }" ]
[ "private function cmdGenerate()\n {\n //check if path exists\n if (!is_dir($this->configKeyPath)) {\n Main::copyDirectoryContents(dirname(__DIR__).'/Config/Devbr/Key', $this->configKeyPath);\n }\n //Now, OPEN_SSL\n $this->createKeys();\n return \"\\n Can, Ope...
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
/* The source of Slack message can be either Json asset or process variable.
[ "public JSONObject getMessage() throws ActivityException {\n String message = null;\n String slackMessageName = getAttributeValueSmart(SLACK_MESSAGE);\n if (slackMessageName == null)\n throw new ActivityException(\"slack message attribute is not set\");\n Asset template = Asse...
[ "@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 about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
Get the data from a *hole instance.
[ "async def main():\n \"\"\"\"\"\"\n async with aiohttp.ClientSession() as session:\n data = Hole('192.168.0.215', loop, session)\n await data.get_data()\n\n # Get the raw data\n print(json.dumps(data.data, indent=4, sort_keys=True))\n\n print(\"Status:\", data.status)\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 text about Data processing:", "pos": "Represent the code about Data processing:", "neg": "Represent the code:" }
Store given transition in the backend
[ "def store_transition(self, frame, action, reward, done, extra_info=None):\n \n self.current_idx = (self.current_idx + 1) % self.buffer_capacity\n\n if self.frame_stack_compensation:\n # Compensate for frame stack built into the environment\n idx_range = np.arange(-frame.s...
[ "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 description:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Throw a new UnsupportedFilterException if the given filter cannot be adapted to bigtable reader expressions. @param scan a {@link org.apache.hadoop.hbase.client.Scan} object. @param filter a {@link org.apache.hadoop.hbase.filter.Filter} object.
[ "public void throwIfUnsupportedFilter(Scan scan, Filter filter) {\n List<FilterSupportStatus> filterSupportStatuses = new ArrayList<>();\n FilterAdapterContext context = new FilterAdapterContext(scan, null);\n collectUnsupportedStatuses(context, filter, filterSupportStatuses);\n if (!filterSupportStatus...
[ "@Deprecated\n public CqlRecordWriter getRecordWriter(org.apache.hadoop.fs.FileSystem filesystem, org.apache.hadoop.mapred.JobConf job, String name, org.apache.hadoop.util.Progressable progress) throws IOException\n {\n return new CqlRecordWriter(job, progress);\n }" ]
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code about Programming:" }
Returns the opitmal SNR squared in the given detector. Parameters ---------- det : str The name of the detector. Returns ------- float : The opimtal SNR squared.
[ "def det_optimal_snrsq(self, det):\n \n # try to get it from current stats\n try:\n return getattr(self._current_stats, '{}_optimal_snrsq'.format(det))\n except AttributeError:\n # hasn't been calculated yet; call loglr to do so\n self._loglr()\n ...
[ "def _check_cutoff(self):\n \n\n if self.cutoff is not None:\n\n cutoff = self.cutoff # Namespace shortcut for speed.\n\n def check_cutoff(distance):\n \"\"\"\n Stops the search of the investigated node of the ArciDispatch\n algorithm...
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Computer Science:" }
NOTE: This method is used by hierarchy report template, harmless for others. Creates the HTML fragments for any features assigned to this suite, and stores them in `featureMarkup` attribute of the suite so we can render them in index.tmpl @param suite
[ "function (suite) {\n return _.template(readFileForRespectiveTemplates('features.html'))({\n suite: suite,\n _: _,\n calculateDuration: calculateDuration,\n columnLayoutWidth: getColumnLayoutWidth(),\n decideScenarioTitlePadding: preventOverlappingTheSce...
[ "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 Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
Register js for ajax notifications
[ "protected function registerJs()\n {\n $config['options'] = $this->options;\n $config['layerOptions'] = $this->layerOptions;\n $config['layerOptions']['layerId'] = $this->layer->getLayerId();\n\n $config = Json::encode($config);\n $layerClass = Json::encode($this->layerClass);\...
[ "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 comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Initialize the YouTubeSupportFrament attached as top fragment to the DraggablePanel widget and reproduce the YouTube video represented with a YouTube url.
[ "private void initializeYoutubeFragment() {\n youtubeFragment = new YouTubePlayerSupportFragment();\n youtubeFragment.initialize(YOUTUBE_API_KEY, new YouTubePlayer.OnInitializedListener() {\n\n @Override public void onInitializationSuccess(YouTubePlayer.Provider provider,\n YouTubePlayer player,...
[ "function _doLaunchAfterServerReady(initialDoc) {\n // update status\n _setStatus(STATUS_CONNECTING);\n _createLiveDocumentForFrame(initialDoc);\n\n // start listening for requests\n _server.start();\n\n // Install a one-time event handler when connected to the launcher pag...
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code:" }
Return extracted data (configured by fields array) from node.
[ "private function getFieldsData(\n Row $row,\n NodeInterface $node,\n $document,\n $fields,\n $templateKey,\n $webspaceKey,\n $locale\n ) {\n $fieldsData = [];\n foreach ($fields as $field) {\n // determine target for data in result array\...
[ "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:" }
Do Transition from C @return self Fluent Interface
[ "private function doTransitionFromC() : self\n {\n if ($this->getToken() === Grammar::T_X) {\n if ($this->hasToken(1) && $this->getToken(1) === Grammar::T_X) {\n if ($this->hasToken(2) && $this->getToken(2) === Grammar::T_X) {\n $this\n -...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github text about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Генерация тега keywords @return Tag
[ "public function keywords($default = null)\n {\n if (!$k = $this->getKeywords()) {\n $d = $default ?: $this->getDefaultKeywords();\n $k = is_null($d) ? $this->getTitle() : $d;\n }\n\n return new Tag('meta', null, array('name' => 'keywords', 'content' => $k), true);\n }" ]
[ "private function nameFull() {return dfc($this, function() {return\n\t\t$this->isTop()\n\t\t? df_trim_text_right($this->getName(), '[value]')\n\t\t// Анонимные филдсеты не добавляют своё имя в качестве префикса имён полей.\n\t\t: (!$this->_anonymous ? $this->getId() : $this->_parent->nameFull())\n\t;});}" ]
codesearchnet
{ "query": "Represent the summarization about software development:", "pos": "Represent the code about software development:", "neg": "Represent the code about programming:" }
Copies the atributes from an obj to a destination obj @param sourceResource source resource obj @param destinationResource destination resource obj @param <T> @return @throws MPException
[ "private static <T extends MPBase> T fillResource(T sourceResource, T destinationResource) throws MPException {\n Field[] declaredFields = destinationResource.getClass().getDeclaredFields();\n for (Field field : declaredFields) {\n try {\n Field originField = sourceResource.g...
[ "@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 comment about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Import's object from given Python path.
[ "def get_object_from_path(path):\n \n try:\n return sys.IMPORT_CACHE[path]\n except KeyError:\n _path = path.split('.')\n module_path = '.'.join(_path[:-1])\n class_name = _path[-1]\n module = importlib.import_module(module_path)\n sys.IMPORT_CACHE[path] = getattr(...
[ "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:" }
Throws an exception if any included/excluded variable pattern is not applicable to the given input definition.
[ "private void assertApplicable( FunctionInputDef inputDef) throws IllegalArgumentException\n {\n try\n {\n for( VarNamePattern varNamePattern : getIncludedVars())\n {\n assertApplicable( inputDef, varNamePattern);\n }\n for( VarNamePattern varNamePattern : getExcludedVars()...
[ "public FunctionHandle resolveFunction(Session session, QualifiedName name, List<TypeSignatureProvider> parameterTypes)\n {\n // TODO Actually use session\n // Session will be used to provide information about the order of function namespaces to through resolving the function.\n // This is l...
codesearchnet
{ "query": "Represent the instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }
Heuristically extracts the base indentation from the provided code. Finds the smallest indentation following a newline not at the end of the string.
[ "def get_base_indentation(code, include_start=False):\n \n new_line_indentation = re_new_line_indentation[include_start].finditer(code)\n new_line_indentation = tuple(m.groups(0)[0] for m in new_line_indentation)\n if new_line_indentation:\n return min(new_line_indentation, key=len)\n else:\n ...
[ "def DocToHelp(doc):\n \"\"\"\"\"\"\n\n # Get rid of starting and ending white space. Using lstrip() or even\n # strip() could drop more than maximum of first line and right space\n # of last line.\n doc = doc.strip()\n\n # Get rid of all empty lines.\n whitespace_only_line = re.compile('^[ \\t]+$', re.M)\n ...
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Invokes the pipeline with the defined command. Command line arguments, and the command need to be set with arg_builder, and command_builder respectively before this method can be invoked.
[ "def run(self, args, pipeline_command):\n \n\n # output that must be moved but not renamed\n consistentNaming = ['alignments/normal_dna_fix_pg_sorted.bam',\n 'alignments/normal_dna_fix_pg_sorted.bam.bai',\n 'alignments/rna_genome_sorted.bam',\...
[ "def __resolveport(self, definitions):\n \n ref = qualify(self.type, self.root, definitions.tns)\n port_type = definitions.port_types.get(ref)\n if port_type is None:\n raise Exception(\"portType '%s', not-found\" % (self.type,))\n # Later on we will require access to t...
codesearchnet
{ "query": "Represent the comment:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Simple helper hash function
[ "def _my_hash(arg_list):\n # type: (List[Any]) -> int\n \"\"\"\"\"\"\n res = 0\n for arg in arg_list:\n res = res * 31 + hash(arg)\n return res" ]
[ "def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR...
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Calculate start/end date for event list TODO this should go in a helper class
[ "public static function offset_date($type, $timestamp, $offset = 30)\n {\n if (!$timestamp) {\n $timestamp = time();\n }\n\n // check whether the timestamp was\n // given as a date string (2016-09-05)\n if(strpos($timestamp, \"-\") > 0) {\n $timestamp = st...
[ "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:" }
Formats query. @param alert {@link net.anotheria.moskito.core.threshold.alerts.ThresholdAlert} @return query
[ "private String formatQuery(final ThresholdAlert alert) {\n return String.format(SMS_QUERY_FORMAT, user, password, createMessage(alert, smsTemplate), recipients); // TODO: improve not to replace user/password/etc every time\n }" ]
[ "def includeme(config):\n \n root = config.get_root_resource()\n root.add('nef_polymorphic', '{collections:.+,.+}',\n view=PolymorphicESView,\n factory=PolymorphicACL)" ]
codesearchnet
{ "query": "Represent the comment about text processing:", "pos": "Represent the code about text processing:", "neg": "Represent the code:" }
Skips empty lines before frame headers (they are allowed after \00)
[ "private function skipEmptyLines()\n {\n $foundHeartbeat = false;\n while ($this->offset < $this->bufferSize) {\n $char = substr($this->buffer, $this->offset, 1);\n if ($char === \"\\x00\" || $char === \"\\n\" || $char === \"\\r\") {\n $this->offset++;\n ...
[ "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 sentence:", "pos": "Represent the code:", "neg": "Represent the code:" }
Stretch the color map via altering the shift map.
[ "def stretch(self, scale_factor, callback=True):\n \n self.scale_pct *= scale_factor\n self.scale_and_shift(self.scale_pct, 0.0, callback=callback)" ]
[ "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 sentence:", "pos": "Represent the code:", "neg": "Represent the code:" }
Returns if the given URI is pointing to the OpenCms workplace UI.<p> @param uri the URI @return <code>true</code> if the given URI is pointing to the OpenCms workplace UI
[ "public static boolean isWorkplaceUri(URI uri) {\n\n return (uri != null) && uri.getPath().startsWith(OpenCms.getSystemInfo().getWorkplaceContext());\n }" ]
[ "function(terria) {\n CatalogGroup.call(this, terria, \"csw\");\n\n /**\n * Gets or sets the URL of the CSW server. This property is observable.\n * @type {String}\n */\n this.url = \"\";\n\n /**\n * Gets or sets the template XML string to POST to the CSW server to query for catalog items. If this pro...
codesearchnet
{ "query": "Represent the Github comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about AWS Redshift:" }
Find published news categories by parent ID. @param int $pid @return Collection|null
[ "public static function findPublishedByPid($pid)\n {\n $t = static::getTableAlias();\n $columns = [\"$t.pid=?\"];\n $values = [$pid];\n\n if (!BE_USER_LOGGED_IN) {\n $columns[] = \"$t.published=?\";\n $values[] = 1;\n }\n\n return static::findBy($co...
[ "public static function getPageAuthority($url = false)\n {\n $data = static::getCols('34359738368', $url);\n return (parent::noDataDefaultValue() == $data) ? $data :\n $data['upa'];\n }" ]
codesearchnet
{ "query": "Represent the text about Computer Science:", "pos": "Represent the code about Computer Science:", "neg": "Represent the code:" }
Checks if a task is revoked, returns a 2-tuple indicating: 1. Is task revoked? 2. Should task be restored?
[ "def _check_revoked(self, revoke_id, timestamp=None, peek=True):\n \n res = self.get(revoke_id, peek=True)\n if res is None:\n return False, False\n\n revoke_until, revoke_once = res\n if revoke_until is not None and timestamp is None:\n timestamp = self._get...
[ "def error(self):\n \"\"\"\"\"\"\n # Copy the error from any failed item to be the error for the whole\n # barrier. The first error seen \"wins\". Also handles the case where\n # the WorkItems passed into the barrier have already completed and\n # been marked with errors.\n ...
codesearchnet
{ "query": "Represent the Github description about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Natural Language Processing:" }
Query currently-available TA checks, return the check ID and metadata of the 'performance/Service Limits' check. :returns: 2-tuple of Service Limits TA check ID (string), metadata (list), or (None, None). :rtype: tuple
[ "def _get_limit_check_id(self):\n \n logger.debug(\"Querying Trusted Advisor checks\")\n try:\n checks = self.conn.describe_trusted_advisor_checks(\n language='en'\n )['checks']\n except ClientError as ex:\n if ex.response['Error']['Code'] ...
[ "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 AWS Route 53:", "pos": "Represent the Github code about AWS Route 53:", "neg": "Represent the Github code about programming:" }
// Validate inspects the fields of the type to determine if they are valid.
[ "func (s *CreateCaseInput) Validate() error {\n\tinvalidParams := request.ErrInvalidParams{Context: \"CreateCaseInput\"}\n\tif s.CommunicationBody == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"CommunicationBody\"))\n\t}\n\tif s.CommunicationBody != nil && len(*s.CommunicationBody) < 1 {\n\t\tinvalid...
[ "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 summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }