query
stringlengths
16
255
pos
list
neg
list
task
stringclasses
1 value
instruction
dict
// SetScopeDescription sets the ScopeDescription field's value.
[ "func (s *ResourceServerScopeType) SetScopeDescription(v string) *ResourceServerScopeType {\n\ts.ScopeDescription = &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 Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
Writes a vvr to the end of file "f" with the byte stream "data".
[ "def _write_vvr(self, f, data):\n '''\n \n '''\n f.seek(0, 2)\n byte_loc = f.tell()\n block_size = CDF.VVR_BASE_SIZE64 + len(data)\n section_type = CDF.VVR_\n\n vvr1 = bytearray(12)\n vvr1[0:8] = struct.pack('>q', block_size)\n vvr1[8:12] = struc...
[ "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 text about File management:", "pos": "Represent the Github code about File management:", "neg": "Represent the Github code about programming:" }
Returns the number of cp definition links where CPDefinitionId = ? and type = ?. @param CPDefinitionId the cp definition ID @param type the type @return the number of matching cp definition links
[ "@Override\n\tpublic int countByCPD_T(long CPDefinitionId, String type) {\n\t\tFinderPath finderPath = FINDER_PATH_COUNT_BY_CPD_T;\n\n\t\tObject[] finderArgs = new Object[] { CPDefinitionId, type };\n\n\t\tLong count = (Long)finderCache.getResult(finderPath, finderArgs, this);\n\n\t\tif (count == null) {\n\t\t\tStr...
[ "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 text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Step 1: If the pixel is unlabeled and the pixel above is not one, then it must be an external contour of a newly encountered blob.
[ "private void handleStep1() {\n\t\tContourPacked c = contours.grow();\n\t\tc.reset();\n\t\tc.id = contours.size();\n\t\ttracer.setMaxContourSize(maxContourSize);\n\t\t// save the set index for this contour and declare memory for it\n\t\tc.externalIndex = packedPoints.size();\n\t\tpackedPoints.grow();\n\t\tc.interna...
[ "private void scanHot() {\n // As mentioned above, what triggers the movement of handHot is that a cold page is found to\n // have been accessed in its test period and thus turns into a hot page, which maybe accordingly\n // turns the hot page with the largest recency into a cold page. If the reference bit...
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code:" }
Returns an Enumeration of the names of the subcontexts.
[ "@Override\n public synchronized Enumeration getSubContextNames() {\n Vector scNames = new Vector();\n for (int i = 0; i < mySubContexts.size(); i++) {\n Entry entry = (Entry) mySubContexts.get(i);\n if (entry.getKey() != null) {\n scNames.add(entry.getKey());\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:" }
Returns the html for the "delete siblings" options when deleting a a resource with siblings.<p> @return the html for the "delete siblings" options
[ "public String buildDeleteSiblings() {\n\n StringBuffer result = new StringBuffer(512);\n if (isMultiOperation() || (hasSiblings() && hasCorrectLockstate())) {\n // show only for multi resource operation or if resource has siblings and correct lock state\n CmsResourceDeleteMode d...
[ "function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co...
codesearchnet
{ "query": "Represent the Github text about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Get avatar path /users/avatars/<year>/<month>/<day>/<social type>-<social-id>/
[ "public function getavatarpath(){\n\t\tif(empty($this->created)){\n\t\t\treturn false;\n\t\t\t}\n\t\tif(empty($this->provider)){\n\t\t\treturn false;\n\t\t\t}\n\t\tif(empty($this->social_id)){\n\t\t\treturn false;\n\t\t\t}\n\t\t$avatarpath='/users/avatars/';\n\t\t$avatarpath.=$this->created->format('Y').'/';\n\t\t$...
[ "def single(self):\n \n return 'display: none;' not in self._looking_for_xpb.li(id='ajax_single').\\\n one_(self._profile.profile_tree).attrib['style']" ]
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// GetAWSSDBDomainWithName retrieves all AWSSDBDomain items from an AWS CloudFormation template // whose logical ID matches the provided name. Returns an error if not found.
[ "func (t *Template) GetAWSSDBDomainWithName(name string) (*resources.AWSSDBDomain, error) {\n\tif untyped, ok := t.Resources[name]; ok {\n\t\tswitch resource := untyped.(type) {\n\t\tcase *resources.AWSSDBDomain:\n\t\t\treturn resource, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"resource %q of type AWSSDBDomain no...
[ "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 sentence about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Software development:" }
Sets the Position of Stamp Image. @access public @param string $horizontal Horizontal Position of Stamp Image (left,center,right) @param string $vertical Vertical Position of Stamp Image (top,middle,bottom) @return void
[ "public function setPosition( $horizontal, $vertical )\r\n\t{\r\n\t\tif( in_array( $horizontal, array( 'left', 'center', 'right' ) ) )\r\n\t\t\t$this->positionH\t= $horizontal;\r\n\t\telse\r\n\t\t\tthrow new InvalidArgumentException( 'Horizontal Position \"'.$horizontal.'\" must be on of (left, center, right).' );\...
[ "public function addCaptionBox($side = 'b', $thickness = 50, $padding = 0, $bgColor = '#000', $transaprencyAmount = 30)\n\t\t#\n\t\t# Author: Jarrod Oberto\n\t\t# Date: 26 May 2011\n\t\t# Purpose: Add a caption box\n\t\t# Params in: (str) $side: the side to add the caption box (t, r, b, or l).\n\t\t# (i...
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Search for refill. @param string $plugin @param string $field @param Request $request @return Response
[ "public function searchAction($plugin, $field, Request $request)\n {\n /* @var $refiller RefillerInterface */\n if (!($refiller = $this->get('anime_db.plugin.refiller')->getPlugin($plugin))) {\n throw $this->createNotFoundException('Plugin \\''.$plugin.'\\' is not found');\n }\n ...
[ "public function LinkingMode()\n {\n /** @var Page_Controller $controller */\n $controller = Controller::curr();\n $params = $controller->getURLParams();\n\n return $params['ID'] === $this->URLSegment ? 'current' : 'link';\n }" ]
codesearchnet
{ "query": "Represent the Github summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about text processing:" }
// SetSuggester sets the Suggester field's value.
[ "func (s *DeleteSuggesterOutput) SetSuggester(v *SuggesterStatus) *DeleteSuggesterOutput {\n\ts.Suggester = v\n\treturn s\n}" ]
[ "function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co...
codesearchnet
{ "query": "Represent the Github description about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
// CREATE REST call
[ "func httpCreatePolicy(w http.ResponseWriter, r *http.Request, vars map[string]string) (interface{}, error) {\n\tlog.Debugf(\"Received httpGetPolicy: %+v\", vars)\n\n\tvar obj Policy\n\tkey := vars[\"key\"]\n\n\t// Get object from the request\n\terr := json.NewDecoder(r.Body).Decode(&obj)\n\tif err != nil {\n\t\tlo...
[ "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 description about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Serializes the object @param [String] str @return [String]
[ "def to_xml_string(str = '')\n str << ('<styleSheet xmlns=\"' << XML_NS << '\">')\n [:numFmts, :fonts, :fills, :borders, :cellStyleXfs, :cellXfs, :cellStyles, :dxfs, :tableStyles].each do |key|\n self.instance_values[key.to_s].to_xml_string(str) unless self.instance_values[key.to_s].nil?\n end...
[ "function make_event(event, target) {\n return string_p(event)? Event.make(event, target)\n : /* otherwise */ event }" ]
codesearchnet
{ "query": "Represent the Github instruction about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
// Finalizer mocks base method
[ "func (m *MockBytes) Finalizer() resource.Finalizer {\n\tret := m.ctrl.Call(m, \"Finalizer\")\n\tret0, _ := ret[0].(resource.Finalizer)\n\treturn ret0\n}" ]
[ "@Override\n public void generatePluginConfig(String serverName, File writeDirectory) {\n // Pass true to utilityRequest since this method will be called from the pluginUtility\n // or by the GeneratePluginConfigListener not by a call to the mbean.\n generatePluginConfig(null,serverName,true...
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Fetches the where values for the related table from the call arguments @param array $callArgs @param string $column @param mixed $value @return array @throws \Exception
[ "private function getRelTableWhere(array &$callArgs, $column, $value) {\n $where = array();\n\n if (!isset($callArgs[0]) || (isset($callArgs[0]) && !is_array($callArgs[0])) ||\n (isset($callArgs[0]) && is_array($callArgs[0]) && !isset($callArgs[0]['where']))) {\n $where[] = a...
[ "public function insert(): self\n {\n /** @var self $data */\n $data = $this;\n\n if(!$this->validate(\"post\", $missing))\n {\n throw new \\Exception(\"[MVQN\\REST\\Endpoints\\Endpoint] Annotations for the '\".get_class($this).\"' class require valid values be set \".\n ...
codesearchnet
{ "query": "Represent the Github summarization about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Software development:" }
Send a COM_INIT_DB request to specify the default schema for the connection. @param pos Write outputStream @param database database name @throws IOException if connection problem occur
[ "public static void send(final PacketOutputStream pos, final String database) throws IOException {\n pos.startPacket(0);\n pos.write(Packet.COM_INIT_DB);\n pos.write(database.getBytes(\"UTF-8\"));\n pos.flush();\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:" }
Removes the entry for the specified key only if it is currently mapped to the specified value.
[ "public boolean remove(Object key, Object value) {\r\n final Object curValue = get(key);\r\n\r\n if (!Objects.equals(curValue, value) || (curValue == null && !containsKey(key))) {\r\n return false;\r\n }\r\n\r\n remove(key);\r\n\r\n return true;\r\n }" ]
[ "function Rule(rules) {\n this.rules = rules;\n // Identifies individual rule\n this.name = \"\";\n // Identifies the grammar that this rule belongs to \n this.grammarName = \"\";\n // Identifies types of rules. Rules can have \"types\" that are diff...
codesearchnet
{ "query": "Represent the Github description about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code:" }
// Run runs the agent. Run will not return until a SIGINT, SIGTERM, or SIGKILL is received
[ "func (a *agent) Run() error {\n\tif err := a.Start(); err != nil {\n\t\treturn err\n\t}\n\treturn a.Wait()\n}" ]
[ "def raiseMasterKilled(signum, _stack):\n \n # Disable further CTRL-C to allow tasks revocation when Celery is used\n if OQ_DISTRIBUTE.startswith('celery'):\n signal.signal(signal.SIGINT, inhibitSigInt)\n\n msg = 'Received a signal %d' % signum\n if signum in (signal.SIGTERM, signal.SIGINT):\n...
codesearchnet
{ "query": "Represent the description about Container management:", "pos": "Represent the code about Container management:", "neg": "Represent the code about programming:" }
Pobiera rekord rodzica @return \Cms\Orm\CmsCategoryRecord
[ "public function getParentRecord()\n {\n //brak parenta\n if (!$this->parentId) {\n return;\n }\n //próba pobrania rodzica z cache\n if (null === $parent = \\App\\Registry::$cache->load($cacheKey = 'category-' . $this->parentId)) {\n //pobieranie rodzica\n...
[ "public function initServices() {\n $this->getFrontController()->getRequestHandler()->addService($entityService = $this->getEntityService());\n \n // wir mappen den users controller auf den in Psc\n $entityService->setControllerClass('User', 'Psc\\CMS\\Controller\\UserEntityController');\n }" ]
codesearchnet
{ "query": "Represent the Github text about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
<p class="changed_added_2_2"> Return the resetValues status of this behavior.</p> @since 2.2
[ "public boolean isResetValues() {\n Boolean result = (Boolean) eval(RESET_VALUES, resetValues);\n return ((result != null) ? result : false);\n }" ]
[ "public void setLog(String log) throws ApplicationException {\n\tif (StringUtil.isEmpty(log, true)) return;\n\tthis.log = log.trim();\n\t// throw new ApplicationException(\"invalid value for attribute log [\"+log+\"]\",\"valid values are\n\t// [application, scheduler,console]\");\n }" ]
codesearchnet
{ "query": "Represent the Github instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
Parses an HTML color in either hex, hsl, or rgb. @param $color @return Color
[ "public static function parse($color)\n {\n $hsl = '/hsl\\(([0-9]{1,3}),\\s*([0-9]{1,3})%,\\s*([0-9]{1,3})%\\)/';\n $rgb = '/rgb\\(([0-9]{1,3}),\\s*([0-9]{1,3}),\\s*([0-9]{1,3})\\)/';\n\n // HSL\n if (preg_match($hsl, $color, $m)) {\n return static::hsl((int)$m[1], (int)$m[...
[ "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 post about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Software development:" }
Creates and returns a listener, which allows to show a toast, when the positive button of a dialog has been clicked. @return The listener, which has been created, as an instance of the class {@link OnClickListener}
[ "private OnClickListener createPositiveButtonListener() {\n return new OnClickListener() {\n\n @Override\n public void onClick(DialogInterface dialog, int which) {\n Toast.makeText(getActivity(), R.string.positive_button_toast, Toast.LENGTH_SHORT)\n ...
[ "function (message) {\n if ('string' !== typeof message) {\n callFunc(WebViewBridge.onError, \"message is type '\" + typeof message + \"', and it needs to be string\");\n return;\n }\n\n //we queue the messages to make sure that native can collects all of them in one shot.\n sendQu...
codesearchnet
{ "query": "Represent the post about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
//InitializeKeys - initializes public/private keys
[ "func (s *BoshBase) InitializeKeys() (err error) {\n\tvar publicKey, privateKey string\n\tif publicKey, privateKey, err = pluginutil.GenerateKeys(); err == nil {\n\t\ts.PublicKey = publicKey\n\t\ts.PrivateKey = privateKey\n\t}\n\treturn\n}" ]
[ "def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)" ]
codesearchnet
{ "query": "Represent the Github text about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Determine if the given node is a docstring, as long as it is at the correct place in the node tree.
[ "def isDocstring(self, node):\n \n return isinstance(node, ast.Str) or (isinstance(node, ast.Expr) and\n isinstance(node.value, ast.Str))" ]
[ "def t_ANY_ID(self, token):\n '\n if token.value in self.KEYWORDS:\n if (token.value == 'annotation_type') and self.cur_indent:\n # annotation_type was added as a reserved keyword relatively\n # late, when there could be identifers with the same name\n ...
codesearchnet
{ "query": "Represent the text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Regular expressions:" }
Close inotify's instance (close its file descriptor). It destroys all existing watches, pending events,... This method is automatically called at the end of loop(). Afterward it is invalid to access this instance.
[ "def stop(self):\n \n if self._fd is not None:\n self._pollobj.unregister(self._fd)\n os.close(self._fd)\n self._fd = None\n self._sys_proc_fun = None" ]
[ "def cancel(self, *args, **kwargs):\n \"\"\"\"\"\"\n # Because remove all futures will trigger `set_result`,\n # we cancel itself first.\n super().cancel()\n for future in self.traverse():\n # All cancelled futures should have callbacks to removed itself\n # ...
codesearchnet
{ "query": "Represent the comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Log a user in using the given adapter from the construct @throws InvalidCredentialsException @throws UnrecognisedAuthenticationResultException @return boolean|throws
[ "public function login()\n {\n $result = $this->adapter->getResult();\n if ($result === self::PHAVOUR_AUTH_SERVICE_SUCCESS) {\n $auth = Auth::getInstance();\n $auth->login($this->adapter->getIdentity());\n $auth->setRoles($this->adapter->getRoles());\n\n ...
[ "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 summarization about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Programming:" }
Get routes. Sort children that group routes will be matched first, nested routes before flat routes. @return RouteInterface[]
[ "protected function getRoutes(): array\n {\n uasort($this->routes, function (RouteInterface $left, RouteInterface $right) {\n if ($left instanceof GroupRoute || $right instanceof GroupRoute) {\n return 1;\n }\n\n return 0;\n });\n\n return $thi...
[ "function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co...
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Return the ISO8601-formatted UTC representation of a datetime object.
[ "def isoformat(dt, localtime=False, *args, **kwargs):\n \"\"\"\"\"\"\n if localtime and dt.tzinfo is not None:\n localized = dt\n else:\n if dt.tzinfo is None:\n localized = UTC.localize(dt)\n else:\n localized = dt.astimezone(UTC)\n return localized.isoformat(...
[ "public static PendingResult<TimeZone> getTimeZone(GeoApiContext context, LatLng location) {\n return context.get(\n API_CONFIG,\n Response.class,\n \"location\",\n location.toString(),\n // Java has its own lookup for time -> DST, so we really only need to fetch the TZ id.\n ...
codesearchnet
{ "query": "Represent the Github instruction about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about Software development:" }
Creates the payment form. @param OrderPaymentInterface $payment @param string $action @param string $cancelPath @return \Symfony\Component\Form\Form
[ "private function createPaymentForm(OrderPaymentInterface $payment, $action, $cancelPath)\n {\n $form = $this->createForm('ekyna_order_order_payment', $payment, [\n 'action' => $action,\n 'method' => 'POST',\n 'attr' => [\n 'class' => 'form-horizontal form-w...
[ "public function execute($request)\n {\n RequestNotSupportedException::assertSupports($this, $request);\n $this->logger->info(\"Ecommpay order #{$request->getFirstModel()->getOrder()->getNumber()} have paid\");\n throw new HttpResponse('OK');\n }" ]
codesearchnet
{ "query": "Represent the Github post about Symfony:", "pos": "Represent the Github code about Symfony:", "neg": "Represent the Github code about Software development:" }
Perform actual flash data kill
[ "private function killMarkedFlashData()\n {\n foreach ($this->killList as $killVariable) {\n if (isset($this->userData[$killVariable])) {\n unset($this->userData[$killVariable]);\n }\n }\n }" ]
[ "def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR...
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Traverse `Object.defineProperties(someObject, propertyDefinitions);`.
[ "private void traverseObjectDefinePropertiesCall(Node callNode, Scope scope) {\n // First child is Object.defineProperties or some equivalent of it.\n Node callee = callNode.getFirstChild();\n Node targetObject = callNode.getSecondChild();\n Node propertyDefinitions = targetObject.getNext();\n\n if (...
[ "function (obj) {\n return Boolean(obj) && ((obj instanceof Script) ||\n _.inSuperChain(obj.constructor, '_postman_propertyName', Script._postman_propertyName));\n }" ]
codesearchnet
{ "query": "Represent the Github summarization about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Programming:" }
检测路由别名 @access private @param Request $request @param string $url URL地址 @return Dispatch|false
[ "private function checkRouteAlias($url)\n {\n $alias = strpos($url, '|') ? strstr($url, '|', true) : $url;\n\n $item = $this->router->getAlias($alias);\n\n return $item ? $item->check($url) : false;\n }" ]
[ "private static function appRun(){\n // echo \"runing\";\n // 当有get参数传递时 获取get参数\n if(isset($_GET['s'])){\n // 更加\"/\"将get参数分割成数组\n $info = explode('/',$_GET['s']);\n\n // 获取模块名称 转换成小写\n $m = strtolower($info[0]);\n // 获取控制器名称 转换成小写\n ...
codesearchnet
{ "query": "Represent the post about PHP:", "pos": "Represent the code about PHP:", "neg": "Represent the code:" }
Generate the toggle url. @param ModelInterface $model The model. @return string
[ "private function generateToggleUrl(ModelInterface $model)\n {\n $toggleUrlEvent = new AddToUrlEvent(\n 'ptg=' . $model->getId() . '&amp;provider=' . $model->getProviderName()\n );\n $this->getEnvironment()->getEventDispatcher()->dispatch(ContaoEvents::BACKEND_ADD_TO_URL, $toggleU...
[ "function validateService($pluginInstance)\n {\n if (! is_object($pluginInstance) )\n throw new \\Exception(sprintf('Can`t resolve to (%s) Instance.', $pluginInstance));\n\n if (!$pluginInstance instanceof aGrantRequest)\n throw new exContainerInvalidServiceType('Invalid Plugi...
codesearchnet
{ "query": "Represent the Github post about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about Software development:" }
@param string $name @param string $id @return RoleInterface|null
[ "public function getBelongTo(string $name, string $id): ?RoleInterface\n {\n return $this->belongTo[$name][$id] ?? null;\n }" ]
[ "static function init() {return dfcf(function() {\n\t\t$appId = S::s()->appId(); /** @var string|null $appId */\n\t\treturn !$appId ? '' : df_block_output(__CLASS__, 'init', ['appId' => $appId]);\n\t});}" ]
codesearchnet
{ "query": "Represent the summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
View slackbuilds packages
[ "def sbo_network(self):\n \n flag = []\n options = [\n \"-n\",\n \"--network\"\n ]\n additional_options = [\n \"--checklist\",\n \"--case-ins\"\n ]\n for add in additional_options:\n if add in self.args:\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:" }
Args: lookup: any CNAME on the Cloudfront distribution default: the optional value to return if lookup failed; returns None if not set Returns: The domain name (FQDN) of the Cloudfront distrinbution, or default/None if no match
[ "def cloudfront_domain_name(self, lookup, default=None):\n \n # list_distributions returns at most 100 distributions per request\n list_limit = \"100\"\n distributions = EFAwsResolver.__CLIENTS[\"cloudfront\"].list_distributions(MaxItems=list_limit)[\"DistributionList\"]\n # Return if the account has...
[ "def get(self, key, namespace=None):\n \"\"\"\"\"\"\n full_key = generate_uppercase_key(key, namespace)\n full_key = full_key.lower()\n\n logger.debug('Searching %s for %s', self, full_key)\n\n # Build a map of lowercase -> actual key\n obj_keys = {\n item.lower(...
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Encode an ASN.1 GeneralizedTime. @param date the date value @param buf the buffer with space to the left of current position where the value will be encoded @return the length of the encoded data
[ "public static int encodeGeneralizedTime(Date date, ByteBuffer buf) {\n if (date == null) {\n throw new IllegalArgumentException();\n }\n\n int pos = buf.position();\n SimpleDateFormat format = new SimpleDateFormat(GENERALIZED_TIME_FORMAT);\n format.setTimeZone(TimeZone...
[ "def write_padding_bits(buff, version, length):\n \n # ISO/IEC 18004:2015(E) - 7.4.10 Bit stream to codeword conversion -- page 32\n # [...]\n # All codewords are 8 bits in length, except for the final data symbol\n # character in Micro QR Code versions M1 and M3 symbols, which is 4 bits\n # in le...
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Programming:" }
map initialization methods
[ "function (id) {\r\n\t\tvar container = this._container = L.DomUtil.get(id);\r\n\r\n\t\tif (!container) {\r\n\t\t\tthrow new Error('Map container not found.');\r\n\t\t} else if (container._leaflet) {\r\n\t\t\tthrow new Error('Map container is already initialized.');\r\n\t\t}\r\n\r\n\t\tL.DomEvent.addListener(contai...
[ "def star_sep_check(self, original, loc, tokens):\n \"\"\"\"\"\"\n return self.check_py(\"3\", \"keyword-only argument separator (add 'match' to front to produce universal code)\", original, loc, tokens)" ]
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code:" }
Run the migrations. @return void
[ "public function up()\r\n {\r\n\r\n // --------------------------------\r\n // Table: member_tag_job\r\n // --------------------------------\r\n Schema::create(config('combine-core.tablePrefix', 'combine') . '_member_tag_job', function (Blueprint $table) {\r\n $table->char(...
[ "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 description about Database management:", "pos": "Represent the Github code about Database management:", "neg": "Represent the Github code about programming:" }
copies in progress.
[ "private final Object[] help_copy( Object[] helper ) {\r\n // Read the top-level KVS only once. We'll try to help this copy along,\r\n // even if it gets promoted out from under us (i.e., the copy completes\r\n // and another KVS becomes the top-level copy).\r\n Object[] topkvs = _kvs;\r\n CHM topch...
[ "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:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
过滤<br> 过滤过程通过传入的Filter实现来过滤返回需要的元素内容,这个Filter实现可以实现以下功能: <pre> 1、过滤出需要的对象,{@link Filter#accept(Object)}方法返回true的对象将被加入结果集合中 </pre> @param <T> 集合元素类型 @param collection 集合 @param filter 过滤器 @return 过滤后的数组 @since 3.1.0
[ "public static <T> Collection<T> filter(Collection<T> collection, Filter<T> filter) {\r\n\t\tif (null == collection || null == filter) {\r\n\t\t\treturn collection;\r\n\t\t}\r\n\r\n\t\tCollection<T> collection2 = ObjectUtil.clone(collection);\r\n\t\ttry {\r\n\t\t\tcollection2.clear();\r\n\t\t} catch (UnsupportedOpe...
[ "public Select parseSelect(MySqlSelectQueryBlock query) throws SqlParseException {\n\n Select select = new Select();\n /*zhongshu-comment SqlParser类没有成员变量,里面全是方法,所以将this传到WhereParser对象时是无状态的,\n 即SqlParser对象并没有给WhereParser传递任何属性,也不存在WhereParser修改SqlParser的成员变量值这一说\n ...
codesearchnet
{ "query": "Represent the text about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
Adds to the result parameter all classes that aren't present in it @param classes classes to control @param result List to enrich
[ "private void addClasses(Class<?>[] classes, HashSet<Class<?>> result){\r\n\t\t\r\n\t\tif(isNull(classes) || classes.length==0)\t\r\n\t\t\tError.globalClassesAbsent(configuredClass);\r\n\t\t\r\n\t\tfor (Class<?> classe : classes)\tresult.add(classe);\r\n\t}" ]
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the Github summarization about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code:" }
<!-- begin-user-doc --> <!-- end-user-doc --> @generated
[ "@Override\r\n\tpublic EClass getIfcDistributionChamberElement() {\r\n\t\tif (ifcDistributionChamberElementEClass == null) {\r\n\t\t\tifcDistributionChamberElementEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI)\r\n\t\t\t\t\t.getEClassifiers().get(178);\r\n\t\t}\r\n\t\treturn ifcDistrib...
[ "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 Github instruction about Text generation:", "pos": "Represent the Github code about Text generation:", "neg": "Represent the Github code:" }
Draw the figure using the renderer
[ "def draw(self):\n \n if __debug__: verbose.report('FigureCanvasAgg.draw', 'debug-annoying')\n\n self.renderer = self.get_renderer(cleared=True)\n # acquire a lock on the shared font cache\n RendererAgg.lock.acquire()\n\n try:\n self.figure.draw(self.renderer)\n ...
[ "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 Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Parse command line, fill `fuse_args` attribute.
[ "def parse(self, *args, **kw):\n \"\"\"\"\"\"\n\n ev = 'errex' in kw and kw.pop('errex')\n if ev and not isinstance(ev, int):\n raise TypeError(\"error exit value should be an integer\")\n\n try:\n self.cmdline = self.parser.parse_args(*args, **kw)\n except O...
[ "def _env(self, line):\n '''\n \n '''\n line = self._setup('ENV', line)\n\n # Extract environment (list) from the line\n environ = parse_env(line)\n\n # Add to global environment, run during install\n self.install += environ\n\n # Also define for global envi...
codesearchnet
{ "query": "Represent the Github post about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about Software development:" }
@param int $keyTag @param int $algorithm @param string $digest @param int $digestType @return DS
[ "public static function Ds(int $keyTag, int $algorithm, string $digest, int $digestType = DS::DIGEST_SHA1)\n {\n $rdata = new DS();\n $rdata->setKeyTag($keyTag);\n $rdata->setAlgorithm($algorithm);\n $rdata->setDigest($digest);\n $rdata->setDigestType($digestType);\n\n r...
[ "protected function processDetails(Buffer &$buffer, Result &$result)\n {\n parent::processDetails($buffer, $result);\n\n // Add in map\n $result->add('mapname', 'Panau');\n $result->add('dedicated', 'true');\n }" ]
codesearchnet
{ "query": "Represent the Github text about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Software development:" }
Set Standard Model Registry Criteria: Extension Instance ID @param string $prefix @return $this @since 1.0.0
[ "protected function setModelRegistryExtensionInstanceIdCriteria($prefix)\n {\n $e = (int)$this->query->getModelRegistry('criteria_extension_instance_id', 0);\n\n if ((int)$e === 0) {\n } elseif (isset($this->model_registry['fields']['extension_instance_id'])) {\n $this->query->whe...
[ "public static function backwardsCompatibility(&$oBindTo)\n {\n // @todo (Pablo - 2017-06-07) - Remove these\n $oBindTo->db = Factory::service('Database');\n $oBindTo->encrypt = Factory::service('Encrypt');\n }" ]
codesearchnet
{ "query": "Represent the text about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code about Software development:" }
get icon name @return void
[ "protected function distro()\n {\n $this->sys->setDistributionIcon('Darwin.png');\n if (!CommonFunctions::executeProgram('system_profiler', 'SPSoftwareDataType', $buffer, PSI_DEBUG)) {\n parent::distro();\n } else {\n $arrBuff = preg_split(\"/\\n/\", $buffer, -1, PREG_S...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code:" }
Base level method for updating data via the API
[ "def _post_json(self, instance, space=None, rel_path=None, extra_params=None):\n \n\n model = type(instance)\n\n # Only API.spaces and API.event should not provide\n # the `space argument\n if space is None and model not in (Space, Event):\n raise Exception(\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 summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
-----------------------------------------------------------------------------
[ "function populateInterfacesList(intfs) {\n e_interfaceList.innerHTML = \"\"\n\n fixedIntfs = []\n intfs.forEach(function(intf){\n fixedIntfs.push(intf.name)\n Interfaces[intf.name] = intf\n\n if (!intf.methods) intf.methods = []\n if (!intf.attributes) intf.attributes = [...
[ "protected static function showVersion()\n {\n \\cli\\line();\n \\cli\\line(\\cli\\Colors::colorize('%y+----------------------------------------------------------------------+%N'));\n \\cli\\line(\\cli\\Colors::colorize('%y| Welcome to Doozr\\'s Demo project installer. ...
codesearchnet
{ "query": "Represent the instruction about language and writing:", "pos": "Represent the code about language and writing:", "neg": "Represent the code:" }
Adds an item to the selection, if it's not selected yet. @param item The item to add. May be an item with 'id' and 'text' properties or just an ID.
[ "function(item) {\n var itemIsId = Selectivity.isValidId(item);\n var id = itemIsId ? item : this.validateItem(item) && item.id;\n\n if (this.options.allowDuplicates || this._value.indexOf(id) === -1) {\n this._value.push(id);\n\n if (itemIsId && this.options.initSelection...
[ "function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co...
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Returns the supplied success URL.
[ "def get_success_url(self):\n \n if self.success_url:\n # Forcing possible reverse_lazy evaluation\n url = force_text(self.success_url)\n else:\n raise ImproperlyConfigured(\n \"No URL to redirect to. Provide a success_url.\")\n return url"...
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
/* Shows an alert that already exists
[ "function(replaceOthers, removeOthers, onOpen, onClose){\n\n if( replaceOthers != false )\n {\n replaceOthers = true;\n }\n\n if( removeOthers !== false )\n {\n removeOthers = true;\n }\n\...
[ "def finish_parse(self, last_lineno_seen):\n \"\"\"\"\"\"\n if self.state == self.STATES['step_in_progress']:\n # We've reached the end of the log without seeing the final \"step finish\"\n # marker, which would normally have triggered updating the step. As such we\n #...
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Tells if a given value is a fully qualified class name of an existing php class. @param mixed $value @return ResultInterface Returns Ok if the value is valid, otherwise an Error is returned.
[ "public function validate($value)\n {\n return class_exists($value) || interface_exists($value) ? Ok::unit() : Error::unit([ Error::CLASS_NOT_EXISTS ]);\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 description about PHP programming:", "pos": "Represent the code about PHP programming:", "neg": "Represent the code:" }
Sets the sections to the given list of Section objects. The sections will be used to colorize areas with a special meaning such as the red area in a rpm gauge. Areas in the Medusa library usually are more eye-catching than Sections. @param AREAS
[ "public void setAreas(final List<Section> AREAS) {\n areas.setAll(AREAS);\n Collections.sort(areas, new SectionComparator());\n fireUpdateEvent(SECTION_EVENT);\n }" ]
[ "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 Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Extends the run() method of threading.Thread
[ "def run(self):\n '''\n '''\n\n self.connect()\n while True:\n for event in self.slack_client.rtm_read():\n logger.debug(event)\n if 'type' in event and event['type'] in self.supported_events:\n event_type = event['type']\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:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Возвращает разметку списка меню @return string HTML @since 3.00
[ "public function listAction()\n {\n $table = $this->plugin->table;\n if (!is_null(arg('section')))\n {\n $table['condition'] = \"`section`='\" . arg('section', 'int') . \"'\";\n }\n $html = $this->ui->renderTable($table);\n return $html;\n }" ]
[ "private function processA(array $result) {\n\t\ttry {\n\t\t\t$result = $this->processI($result);\n\t\t}\n\t\t/**\n\t\t * 2016-08-02\n\t\t * Исключительная ситуация может быть не только типа @see \\Df\\Core\\Exception,\n\t\t * но и типа @see \\Exception,\n\t\t * потому что чтение некорректных данных может приводить...
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Programming:" }
<!-- begin-user-doc --> <!-- end-user-doc --> @generated
[ "@Override\n\tpublic void eUnset(int featureID) {\n\t\tswitch (featureID) {\n\t\t\tcase AfplibPackage.DEVICE_APPEARANCE__DEV_APP:\n\t\t\t\tsetDevApp(DEV_APP_EDEFAULT);\n\t\t\t\treturn;\n\t\t\tcase AfplibPackage.DEVICE_APPEARANCE__RESERVED:\n\t\t\t\tsetReserved(RESERVED_EDEFAULT);\n\t\t\t\treturn;\n\t\t}\n\t\tsuper....
[ "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:" }
Returns a string representing a temporary file, that must be manually deleted
[ "def getTempFile(suffix=\"\", rootDir=None):\n \n if rootDir is None:\n handle, tmpFile = tempfile.mkstemp(suffix)\n os.close(handle)\n return tmpFile\n else:\n tmpFile = os.path.join(rootDir, \"tmp_\" + getRandomAlphaNumericString() + suffix)\n open(tmpFile, 'w').close()...
[ "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 Github summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
// NewCmdAddClusterRoleToUser implements the OpenShift cli add-cluster-role-to-user command
[ "func NewCmdAddClusterRoleToUser(name, fullName string, f kcmdutil.Factory, streams genericclioptions.IOStreams) *cobra.Command {\n\to := NewRoleModificationOptions(streams)\n\to.RoleKind = \"ClusterRole\"\n\to.SANames = []string{}\n\tcmd := &cobra.Command{\n\t\tUse: name + \" <role> <user | -z serviceaccount> [u...
[ "func (e *environ) AdoptResources(ctx context.ProviderCallContext, controllerUUID string, fromVersion version.Number) error {\n\t// This provider doesn't track instance -> controller.\n\treturn nil\n}" ]
codesearchnet
{ "query": "Represent the comment about API documentation:", "pos": "Represent the code about API documentation:", "neg": "Represent the code:" }
Gets a directory which already exists.
[ "public File getExistingDirectory(final String param) {\n return get(param, new StringToFile(),\n new And<>(new FileExists(), new IsDirectory()),\n \"existing directory\");\n }" ]
[ "public FunctionHandle resolveFunction(Session session, QualifiedName name, List<TypeSignatureProvider> parameterTypes)\n {\n // TODO Actually use session\n // Session will be used to provide information about the order of function namespaces to through resolving the function.\n // This is l...
codesearchnet
{ "query": "Represent the instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }
Returns -------
[ "def get_temporal_score_df(self):\n\t\t'''\n\t\t\n\n\t\t'''\n\t\tscoredf = {}\n\t\ttdf = self.term_ranker(self.corpus).get_ranks()\n\t\tfor cat in sorted(self.corpus.get_categories()):\n\t\t\tif cat >= self.starting_time_step:\n\t\t\t\tnegative_categories = self._get_negative_categories(cat, tdf)\n\t\t\t\tscores = ...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code:" }
Get the color to be set on the text field for the current state, if the helptext is not enabled. @protected
[ "function () {\n if (this._simpleHTML) {\n return this._skinObj.states[this._state].color;\n }\n if (this._isIE7OrLess) {\n // As \"inherit\" does not work in this case in IE7, we are obliged to read the property from\n // the frame state...
[ "def set_form form\n raise \"Form is nil in set_form\" if form.nil?\n @form = form\n @id = form.add_widget(self) if !form.nil? and form.respond_to? :add_widget\n # 2009-10-29 15:04 use form.window, unless buffer created\n # should not use form.window so explicitly everywhere.\n # added...
codesearchnet
{ "query": "Represent the description about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Triple Exponential Moving Average. Formula: TEMA = (3*EMA - 3*EMA(EMA)) + EMA(EMA(EMA))
[ "def triple_exponential_moving_average(data, period):\n \n catch_errors.check_for_period_error(data, period)\n\n tema = ((3 * ema(data, period) - (3 * ema(ema(data, period), period))) +\n ema(ema(ema(data, period), period), period)\n )\n return tema" ]
[ "def QA_indicator_SKDJ(DataFrame, N=9, M=3):\n \n CLOSE = DataFrame['close']\n LOWV = LLV(DataFrame['low'], N)\n HIGHV = HHV(DataFrame['high'], N)\n RSV = EMA((CLOSE - LOWV) / (HIGHV - LOWV) * 100, M)\n K = EMA(RSV, M)\n D = MA(K, M)\n DICT = {'RSV': RSV, 'SKDJ_K': K, 'SKDJ_D': D}\n\n ret...
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Execute all recorded undo operations from stack @param {Array} aUndoStack stack of recorded undo operations
[ "function(aUndoStack) {\n\t\t\twhile (aUndoStack.length) {\n\t\t\t\tvar oOperation = aUndoStack.pop();\n\t\t\t\tthis[oOperation.name].apply(this, oOperation.properties);\n\t\t\t}\n\t\t}" ]
[ "function nodeClosed( ascent ) {\n\n emitNodeClosed( ascent);\n \n return tail( ascent) ||\n // If there are no nodes left in the ascent the root node\n // just closed. Emit a special event for this: \n emitRootClosed(nodeOf(head(ascent)));\n }" ]
codesearchnet
{ "query": "Represent the Github summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Logout user and remove from local store @param state @param commit
[ "function logout(_ref3) {\n var state = _ref3.state,\n commit = _ref3.commit;\n commit('c3s/user/SET_CURRENT_USER', null, {\n root: true\n });\n commit('SET_ANON', false);\n }" ]
[ "def postloop(self):\n \n cmd.Cmd.postloop(self) # Clean up command completion\n d1_cli.impl.util.print_info(\"Exiting...\")" ]
codesearchnet
{ "query": "Represent the comment about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Software development:" }
Returns title page suffix used in template @return string
[ "public function getTitlePageSuffix()\n {\n if (($activePage = $this->getActPage())) {\n return \\OxidEsales\\Eshop\\Core\\Registry::getLang()->translateString('PAGE') . \" \" . ($activePage + 1);\n }\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 sentence about Text translation:", "pos": "Represent the Github code about Text translation:", "neg": "Represent the Github code about Software development:" }
Get the adapter User-Agent string @return string
[ "public function getDefaultUserAgent(): string\n {\n $defaultAgent = 'Swoft/' . App::version();\n if (\\extension_loaded('curl') && \\function_exists('curl_version')) {\n $defaultAgent .= ' curl/' . \\curl_version()['version'];\n }\n $defaultAgent .= ' PHP/' . PHP_VERSION;\...
[ "def getDeviceRole(self):\n \"\"\"\"\"\"\n print '%s call getDeviceRole' % self.port\n return self.__stripValue(self.__sendCommand(WPANCTL_CMD + 'getprop -v Network:NodeType')[0])" ]
codesearchnet
{ "query": "Represent the Github instruction about text processing:", "pos": "Represent the Github code about text processing:", "neg": "Represent the Github code:" }
Will query different JMX MBeans for a list of runtime connectors. JBoss discovery will be used first, then Tomcat. @return the list of connectors found
[ "private HttpConnectorList getHttpConnectors() throws Exception {\n logger.info(\"Searching HTTP connectors.\");\n HttpConnectorList httpConnectorList = null;\n //find Jboss first as is typical setup\n httpConnectorList = jBossConnectorDiscover.findConnectors();\n if (httpConnecto...
[ "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 comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
/* (non-Javadoc) @see org.joml.Matrix3dc#mulComponentWise(org.joml.Matrix3dc, org.joml.Matrix3d)
[ "public Matrix3d mulComponentWise(Matrix3dc other, Matrix3d dest) {\n dest.m00 = m00 * other.m00();\n dest.m01 = m01 * other.m01();\n dest.m02 = m02 * other.m02();\n dest.m10 = m10 * other.m10();\n dest.m11 = m11 * other.m11();\n dest.m12 = m12 * other.m12();\n dest....
[ "public static double dot(@javax.annotation.Nonnull final List<double[]> a, @javax.annotation.Nonnull final List<double[]> b) {\n return com.simiacryptus.util.ArrayUtil.sum(com.simiacryptus.util.ArrayUtil.multiply(a, b));\n }" ]
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Programming:" }
// Check if the outInnerType is of type struct
[ "func ensureOutInnerType(outInnerType reflect.Type) error {\n\tswitch outInnerType.Kind() {\n\tcase reflect.Struct:\n\t\treturn nil\n\t}\n\treturn fmt.Errorf(\"cannot use \" + outInnerType.String() + \", only struct supported\")\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 description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Write the specified text to the config file @param Plugin $plugin The plugin that requested the addition @param string $text The text to add @param string &$log Holds a log of the changes made @return true
[ "public function insertSnippet(Plugin $plugin, $text, &$log = '')\n {\n $snippetProperties = $this->readProperties($text);\n $configContents = file_get_contents($this->configFileLocation);\n\n if (stripos($configContents, \"BEGIN PLUGIN CONFIG: {$plugin->Slug}\") === false) {\n\n ...
[ "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 text about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
Generate waves of the shapes defined above. Arguments: logdir: the directory into which to store all the runs' data verbose: if true, print out each run's name as it begins
[ "def run_all(logdir, verbose=False):\n \n waves = [sine_wave, square_wave, triangle_wave,\n bisine_wave, bisine_wahwah_wave]\n for (i, wave_constructor) in enumerate(waves):\n wave_name = wave_constructor.__name__\n run_name = 'wave:%02d,%s' % (i + 1, wave_name)\n if verbose:\n print('---...
[ "def read_description():\n \"\"\"\"\"\"\n try:\n with open(\"README.md\") as r:\n description = \"\\n\"\n description += r.read()\n with open(\"CHANGELOG.md\") as c:\n description += \"\\n\"\n description += c.read()\n return description\n ex...
codesearchnet
{ "query": "Represent the comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Check for existing MemberInvitation on Team with UUID @param [type] $teamId UUID of Team to check for User Member @return boolean
[ "public function hasMemberInvitationOnTeam($teamId)\r\n {\r\n /** @noinspection PhpUndefinedMethodInspection */\r\n $memberInvitationsOnTeam = $this->memberInvitations->filter(function ($memberInvitation) use ($teamId) {\r\n return ($memberInvitation->member->team_id === $teamId) && ($me...
[ "def _unlinkUser(self):\n \n KEY = \"linked_contact_uid\"\n\n # Nothing to do if no user is linked\n if not self.hasUser():\n return False\n\n user = self.getUser()\n username = user.getId()\n\n # Unset the UID from the User Property\n user.setMembe...
codesearchnet
{ "query": "Represent the instruction about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code:" }
Sets up Spark RDD across S3 or GS objects specified by dataPath. Returns RDD of <string bucket keyname, string buffer> k/v pairs.
[ "def read(self, path, ext=None, start=None, stop=None, recursive=False, npartitions=None):\n \n from .utils import connection_with_anon, connection_with_gs\n\n path = addextension(path, ext)\n scheme, bucket_name, keylist = self.getfiles(\n path, start=start, stop=stop, recurs...
[ "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 sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Gets a timetable for a specific stop. @param stopId The id of the stop you want to get a timetable for. @param options Options to limit the results by. Default: StopTimetableQueryOptions.defaultQueryOptions() @return The stop timetable.
[ "public TransportApiResult<List<StopTimetable>> getStopTimetable(String stopId, StopTimetableQueryOptions options)\r\n {\r\n \tif (Extensions.isNullOrWhiteSpace(stopId))\r\n \t{\r\n \t\tthrow new IllegalArgumentException(\"StopId is required.\");\r\n \t}\r\n \t\r\n \tif (options == null)\r\n ...
[ "function initialize () {\n return pullTaskRunner.run(function() {\n return store.defineTable({\n name: pulltimeTableName,\n columnDefinitions: {\n id: 'string', // column for storing queryId\n tableName: 'string', // column for s...
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
/* host objs smartness
[ "private Object resolveHostObject(Object value, Context cx, Scriptable scope) throws Exception {\n\t\tif (value instanceof List) { // list -> array\n\t\t\treturn RHINO.fromList((List<?>) value, cx, scope);\n\t\t}\n\t\tif (value instanceof Map) { // map -> object\n\t\t\treturn RHINO.fromMap((Map<?, ?>) value, cx, sc...
[ "def postloop(self):\n \n cmd.Cmd.postloop(self) # Clean up command completion\n d1_cli.impl.util.print_info(\"Exiting...\")" ]
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
// CAConfig is used when restoring from a snapshot.
[ "func (s *Restore) CAConfig(config *structs.CAConfiguration) error {\n\t// Don't restore a blank CA config\n\t// https://github.com/hashicorp/consul/issues/4954\n\tif config.Provider == \"\" {\n\t\treturn nil\n\t}\n\n\tif err := s.tx.Insert(caConfigTableName, config); err != nil {\n\t\treturn fmt.Errorf(\"failed re...
[ "def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR...
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Invoked when a child sends up an SIGCHLD signal. :param int _signum: The signal that was invoked :param frame _unused_frame: The frame that was interrupted
[ "def on_sigchld(self, _signum, _unused_frame):\n \n LOGGER.info('SIGCHLD received from child')\n if not self.active_processes(False):\n LOGGER.info('Stopping with no active processes and child error')\n signal.setitimer(signal.ITIMER_REAL, 0, 0)\n self.set_state...
[ "def forward_all_signals_async(target_pid, process_name):\n \"\"\"\"\"\"\n def forwarding_signal_handler(signum):\n _forward_signal(signum, process_name, forwarding_signal_handler.target_pid)\n\n # Somehow we get a Python SystemError sometimes if we access target_pid directly from inside function.\n...
codesearchnet
{ "query": "Represent the Github comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Returns the size of the physical memory in bytes on Windows. @return the size of the physical memory in bytes or {@code -1}, if the size could not be determined
[ "private static long getSizeOfPhysicalMemoryForWindows() {\n\t\tBufferedReader bi = null;\n\t\ttry {\n\t\t\tProcess proc = Runtime.getRuntime().exec(\"wmic memorychip get capacity\");\n\n\t\t\tbi = new BufferedReader(new InputStreamReader(proc.getInputStream()));\n\n\t\t\tString line = bi.readLine();\n\t\t\tif (lin...
[ "function NodeInfo() {\n\n /**\n * the CPU model\n * \n * @type {String}\n */\n this.model = null;\n\n /**\n * memory size in kilobytes\n * @type {Number}\n */\n this.memory = 0;\n\n /**\n * the number of active CPUs\n * @type {Number}\n */\n this.cpus = 0;\...
codesearchnet
{ "query": "Represent the Github description about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
Deserialize a JSON String to the target object. @param body the JSON String. @param clazz the Object class name deserialized to. @return the deserialized Object instance. @throws ServiceException
[ "<T> T deserialize(String body, Class<T> clazz) {\n if (body == null || body.isEmpty()) {\n throw new ServiceException(ErrorCode.REMOTE_DIRECTORY_SERVER_ERROR,\n ErrorCode.REMOTE_DIRECTORY_SERVER_ERROR.getMessageTemplate(),\n \"the message body is empty\");\n ...
[ "private void validateString(Class<?> clazz) throws SerializerException {\n if (null != clazz && !clazz.isAssignableFrom(String.class)) {\n throw new SerializerException(\"String serializer is able to work only with data types assignable from java.lang.String\");\n }\n }" ]
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
/* (non-Javadoc) @see org.apereo.portal.portlets.groupselector.GroupsSelectorHelper#getEntityBeans(java.util.List)
[ "@Override\n public List<JsonEntityBean> getEntityBeans(List<String> params) {\n // if no parameters have been supplied, just return an empty list\n if (params == null || params.isEmpty()) {\n return Collections.<JsonEntityBean>emptyList();\n }\n\n List<JsonEntityBean> bean...
[ "private void addRestResourceClasses(Set<Class<?>> resources) {\n resources.add(pl.setblack.airomem.direct.banksample.rest.BankResource.class);\n }" ]
codesearchnet
{ "query": "Represent the Github description about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
Sorts the result files after severity in following order: - Error - Warning @param {Array} messages Messages. @returns {Array} Sorted messages.
[ "function sortMessages(messages) {\n var fileArray = {\n error: [],\n warning: []\n };\n\n messages.forEach(function (message) {\n if (message.severity === 1) {\n fileArray.warning.push(message);\n } else {\n fileArray.error.push(message);\n }\n });\n\n return lodash.concat(fileArray.e...
[ "function Flow(waits, // @arg Integer: Number of wait for processes\n callback, // @arg Function/FunctionHash/Flow/FlowHash: callback and forks\n // callback on completion of processes.\n // callback(err:Error, args:MixArray)\n ...
codesearchnet
{ "query": "Represent the comment about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Parses XML for an address into an array. @param SimpleXMLElement $xml <p>Address node of the XML response from Amazon.</p> @return array Parsed structure from XML
[ "public function parseAddress($xml) {\n $r = array();\n $r['Name'] = (string)$xml->Name;\n $r['Line1'] = (string)$xml->Line1;\n if (isset($xml->Line2)){\n $r['Line2'] = (string)$xml->Line2;\n }\n if (isset($xml->Line3)){\n $r['Line3'] = (string)$xml->L...
[ "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 instruction about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
Checks the array for a properties with name 'textures' and creates a PlayerProperties for it @param $propertiesArray array the array of properties @return PlayerProperties the parsed properties or null if textures property not found
[ "private function parseTexturesProperties($propertiesArray)\n {\n foreach($propertiesArray as $property) {\n if($property['name'] == 'textures') {\n $texturesJSON = json_decode(base64_decode($property['value']), true);\n\n $properties = new PlayerProperties(\n ...
[ "def reset ():\n \n global __prefixes_suffixes, __suffixes_to_types, __types, __rule_names_to_types, __target_suffixes_cache\n\n __register_features ()\n\n # Stores suffixes for generated targets.\n __prefixes_suffixes = [property.PropertyMap(), property.PropertyMap()]\n\n # Maps suffixes to types...
codesearchnet
{ "query": "Represent the instruction about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
Return True if after is newer than seconds.
[ "def is_newer_than(after, seconds):\n \"\"\"\"\"\"\n if isinstance(after, six.string_types):\n after = parse_strtime(after).replace(tzinfo=None)\n else:\n after = after.replace(tzinfo=None)\n\n return after - utcnow() > datetime.timedelta(seconds=seconds)" ]
[ "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 summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
// Vectorizable checks whether a list of expressions can employ vectorized execution.
[ "func Vectorizable(exprs []Expression) bool {\n\tfor _, expr := range exprs {\n\t\tif HasGetSetVarFunc(expr) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}" ]
[ "public FunctionHandle resolveFunction(Session session, QualifiedName name, List<TypeSignatureProvider> parameterTypes)\n {\n // TODO Actually use session\n // Session will be used to provide information about the order of function namespaces to through resolving the function.\n // This is l...
codesearchnet
{ "query": "Represent the comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }
Marshall the given parameter object.
[ "public void marshall(ListPublishedSchemaArnsRequest listPublishedSchemaArnsRequest, ProtocolMarshaller protocolMarshaller) {\n\n if (listPublishedSchemaArnsRequest == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\n }\n\n try {\n pro...
[ "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 about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Converts Propel log levels to PSR log levels @param int $level @return string
[ "protected function convertLogLevel($level)\n {\n $map = [\n Propel::LOG_EMERG => LogLevel::EMERGENCY,\n Propel::LOG_ALERT => LogLevel::ALERT,\n Propel::LOG_CRIT => LogLevel::CRITICAL,\n Propel::LOG_ERR => LogLevel::ERROR,\n Propel::LOG_WAR...
[ "public function antiLight(array $req): void\n {\n $this->isConfigDebug ? print('anti light') : null;\n $this->log(configDefault('anti/light', 'log', 'anti', 'light'), $req);\n }" ]
codesearchnet
{ "query": "Represent the text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Starts the Service. :Exceptions: - WebDriverException : Raised either when it can't start the service or when it can't connect to the service
[ "def start(self):\n \n try:\n cmd = [self.path]\n cmd.extend(self.command_line_args())\n self.process = subprocess.Popen(cmd, env=self.env,\n close_fds=platform.system() != 'Windows',\n ...
[ "def connectTo(self, remoteRouteName):\n \n self.remoteRouteName = remoteRouteName\n # This route must not be started before its router is started. If\n # sender is None, then the router is not started. When the router is\n # started, it will start this route.\n if self.r...
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// NewAdaptor returns a new Beaglebone Black/Green Adaptor
[ "func NewAdaptor() *Adaptor {\n\tb := &Adaptor{\n\t\tname: gobot.DefaultName(\"BeagleboneBlack\"),\n\t\tdigitalPins: make([]*sysfs.DigitalPin, 120),\n\t\tpwmPins: make(map[string]*sysfs.PWMPin),\n\t\ti2cBuses: make(map[int]i2c.I2cDevice),\n\t\tmutex: &sync.Mutex{},\n\t\tpinMap: bbbPin...
[ "@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 comment about Data processing:", "pos": "Represent the code about Data processing:", "neg": "Represent the code about programming:" }
Use this API to fetch filtered set of clusternodegroup resources. filter string should be in JSON format.eg: "port:80,servicetype:HTTP".
[ "public static clusternodegroup[] get_filtered(nitro_service service, String filter) throws Exception{\n\t\tclusternodegroup obj = new clusternodegroup();\n\t\toptions option = new options();\n\t\toption.set_filter(filter);\n\t\tclusternodegroup[] response = (clusternodegroup[]) obj.getfiltered(service, option);\n\...
[ "def list(self, mask=None):\n \n if mask is None:\n mask = \"mask[id, name, createDate, rule, guestCount, backendRouter[id, hostname]]\"\n groups = self.client.call('Account', 'getPlacementGroups', mask=mask, iter=True)\n return groups" ]
codesearchnet
{ "query": "Represent the Github summarization about API documentation:", "pos": "Represent the Github code about API documentation:", "neg": "Represent the Github code:" }
Shortcut for setting up transient logging I am a replica of ``logging.basicConfig`` which installs a transient logging handler to stderr.
[ "def basicConfig(level=logging.WARNING, transient_level=logging.NOTSET):\n \n fmt = \"%(asctime)s [%(levelname)s] [%(name)s:%(lineno)d] %(message)s\"\n logging.root.setLevel(transient_level) # <--- IMPORTANT\n hand = TransientStreamHandler(level=level)\n hand.setFormatter(logging.Formatter(fmt))\n ...
[ "def get_modernrpc_logger(name):\n \"\"\"\"\"\"\n logger = logging.getLogger(name)\n if not logger_has_handlers(logger):\n # If logging is not configured in the current project, configure this logger to discard all logs messages.\n # This will prevent the 'No handlers could be found for logge...
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
ALL DSSAT Data Output method @param arg0 file output path @param result data holder object @throws FileNotFoundException @throws IOException
[ "private void writeMultipleExp(String arg0, Map result) throws FileNotFoundException, IOException {\n\n arg0 = revisePath(arg0);\n ArrayList<HashMap> expArr = getObjectOr(result, \"experiments\", new ArrayList());\n ArrayList<HashMap> soilArr = getObjectOr(result, \"soils\", new ArrayList());\n...
[ "def putBlock(self, blockcontent, migration=False):\n \n #YG\n try:\n #1 insert configuration\n self.logger.debug(\"insert configuration\")\n configList = self.insertOutputModuleConfig(\n blockcontent['dataset_conf_list'], migration)\n...
codesearchnet
{ "query": "Represent the comment:", "pos": "Represent the code:", "neg": "Represent the code:" }
Consume one token and verify it is of the expected kind.
[ "def consume(self, kind):\n \"\"\"\"\"\"\n next_token = self.stream.move()\n if next_token.kind != kind:\n raise UnexpectedTokenError(token=next_token, expected_kind=kind)" ]
[ "public function getStockQuantity(string $sku) {\n $stock = $this->getStock($sku);\n\n if (empty($stock['status'])) {\n return 0;\n }\n\n // @TODO: For now there is no scenario in which we have quantity in float.\n // We have kept the database field to match what is there in MDC and code\n //...
codesearchnet
{ "query": "Represent the Github text about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Use PriceEstimateSerializer to serialize estimate children
[ "def build_nested_field(self, field_name, relation_info, nested_depth):\n \n if field_name != 'children':\n return super(PriceEstimateSerializer, self).build_nested_field(field_name, relation_info, nested_depth)\n field_class = self.__class__\n field_kwargs = {'read_only': Tru...
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code:" }
// SetStreamARN sets the StreamARN field's value.
[ "func (s *DescribeStreamConsumerInput) SetStreamARN(v string) *DescribeStreamConsumerInput {\n\ts.StreamARN = &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 text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
// SetQueueUrl sets the QueueUrl field's value.
[ "func (s *PurgeQueueInput) SetQueueUrl(v string) *PurgeQueueInput {\n\ts.QueueUrl = &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 summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Determine if an item exists in the collection. @param mixed $key @param mixed $value @return bool
[ "public function contains($key, $value = null): bool\n {\n if (func_num_args() == 2) {\n return $this->contains(function ($k, $item) use ($key, $value) {\n return ArrayHelper::getValue($item, $key) == $value;\n });\n }\n\n if ($this->useAsCallable($key)) ...
[ "public function insert(): self\n {\n /** @var self $data */\n $data = $this;\n\n if(!$this->validate(\"post\", $missing))\n {\n throw new \\Exception(\"[MVQN\\REST\\Endpoints\\Endpoint] Annotations for the '\".get_class($this).\"' class require valid values be set \".\n ...
codesearchnet
{ "query": "Represent the post about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Software development:" }
focus - sets focus to either the textarea or iframe
[ "function focus(editor) {\r\n setTimeout(function() {\r\n if (sourceMode(editor)) editor.$area.focus();\r\n else editor.$frame[0].contentWindow.focus();\r\n refreshButtons(editor);\r\n }, 0);\r\n }" ]
[ "function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co...
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }