query
stringlengths
16
255
pos
list
neg
list
task
stringclasses
1 value
instruction
dict
Updates this object's origin tile coordinate. Its bounds and other cached screen coordinate information are updated.
[ "public void relocateObject (MisoSceneMetrics metrics, int tx, int ty)\n {\n// Log.info(\"Relocating object \" + this + \" to \" +\n// StringUtil.coordsToString(tx, ty));\n info.x = tx;\n info.y = ty;\n computeInfo(metrics);\n }" ]
[ "function (element) {\n $.data(element, \"velocity\", {\n /* Store whether this is an SVG element, since its properties are retrieved and updated differently than standard HTML elements. */\n isSVG: Type.isSVG(element),\n /* Keep track of whether the element i...
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Mark the WorkUnit failed, returning the exception to central.
[ "def fail_work_unit(exception)\n keep_trying_to \"mark work unit as failed\" do\n data = base_params.merge({:status => 'failed', :output => {'output' => exception.message}.to_json})\n @node.central[\"/work/#{data[:id]}\"].put(data)\n log \"failed #{display_work_unit} in #{data[:time]} seco...
[ "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:", "pos": "Represent the code:", "neg": "Represent the code:" }
加载JSON配置文件,使用系统默认编码 @param jsonPath JSON文件路径 @param clazz 类 @param <T> 类型值 @return Bean @throws IOException 异常 @since 1.0.8
[ "public static <T> T loadJsonToBean(String jsonPath, Class<T> clazz) throws IOException {\n return loadJsonToBean(jsonPath, ValueConsts.NULL_STRING, clazz);\n }" ]
[ "private Enumeration<URL> getUrlsByPackge(ClassLoader classLoader, String packageName) {\n try {\n return classLoader.getResources(packageName);\n } catch (IOException e) {\n // 由于是扫描package下的class,即时出现异常,也忽略掉.\n log.warn(\"【警告】未找到包:'\" + packageName + \"'下的URL,将忽略此种错误...
codesearchnet
{ "query": "Represent the Github comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Programming:" }
Get glyphs @param string $char Char @param integer $type Type @return string
[ "protected function getGlyphs($char, $type)\n {\n\n $pos = mb_strpos($this->_glyphs, $char);\n \n if ($pos > 49) {\n $pos = ($pos-49)/2 + 49;\n }\n \n $pos = $pos*16 + $type*4;\n \n return substr($this->_hex, $pos, 4);\n }" ]
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the description about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
Called at static initialization time. Selects and initializes our logging backend.
[ "protected static void initLogger ()\n {\n // if a custom class was specified as a system property, use that\n Factory factory = createConfiguredFactory();\n\n // create and a log4j logger if the log4j configuration system property is set\n try {\n if (factory == null && Sy...
[ "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 sentence about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Software development:" }
Returns the value to which the specified key is mapped, or {@code null} if this map contains no mapping for the key.
[ "public V get(Object key) {\n\tcheckKey(key);\n\t\n\tString cs = (String)key;\n\tNode<V> n = lookup(cs);\n\treturn (n == null) ? null : n.value;\n }" ]
[ "@Override\n public void putAll(Map<? extends K, ? extends V> m) {\n\tfor (Map.Entry<? extends K, ? extends V> e: m.entrySet())\n\t put(e.getKey(), e.getValue());\n }\n\n /**\n * Removes the key (and its corresponding value) from this map. This method does nothing if the key\n * is not in the ma...
codesearchnet
{ "query": "Represent the comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Returns the server port or 80 as default if the server port can not be retrieved from the hostname or the server variable 'SERVER_PORT' @return int
[ "public static function serverPort()\n {\n if ( empty( $GLOBALS['eZSysServerPort'] ) )\n {\n $hostname = self::hostname();\n if ( preg_match( \"/.*:([0-9]+)/\", $hostname, $regs ) )\n {\n $port = (int) $regs[1];\n }\n else\n ...
[ "def get_config(self, key, default=None):\n \n depr(0, 13, \"Route.get_config() is deprectated.\",\n \"The Route.config property already includes values from the\"\n \" application config for missing keys. Access it directly.\")\n return self.config.get(key...
codesearchnet
{ "query": "Represent the post about Computer Science:", "pos": "Represent the code about Computer Science:", "neg": "Represent the code about Software development:" }
Get number of blocks mined by each pool. :param str time_span: duration of the chart. Default is 4days (optional) :param str api_code: Blockchain.info API code (optional) :return: an instance of dict:{str,int}
[ "def get_pools(time_span=None, api_code=None):\n \n\n resource = 'pools'\n if time_span is not None:\n resource += '?timespan=' + time_span\n if api_code is not None:\n resource += '&api_code=' + api_code\n response = util.call_api(resource, base_url='https://api.blockchain.info/')\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 instruction about Blockchain:", "pos": "Represent the code about Blockchain:", "neg": "Represent the code about programming:" }
Sets the S3 prefix for a CloudTrail Trail Args: region (`str`): Name of the AWS region name (`str`): Name of the CloudTrail Trail Returns: `None`
[ "def set_s3_prefix(self, region, name):\n \n ct = self.session.client('cloudtrail', region_name=region)\n ct.update_trail(Name=name, S3KeyPrefix=self.account.account_name)\n\n auditlog(\n event='cloudtrail.set_s3_prefix',\n actor=self.ns,\n data={\n ...
[ "def get_api_id(self, lambda_name):\n \n try:\n response = self.cf_client.describe_stack_resource(StackName=lambda_name,\n LogicalResourceId='Api')\n return response['StackResourceDetail'].get('PhysicalResourceId', None...
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
update mouse input tracking
[ "function updateMouse(e) {\n input.mouse.clientX = e.clientX;\n input.mouse.clientY = e.clientY;\n input.mouse.buttons = e.buttons;\n if (e.type === 'mouseleave') input.mouse.mouseOnDocument = false;\n else input.mouse.mouseOnDocument = true;\n}" ]
[ "def transform_cb(self, setting, value):\n \"\"\"\"\"\"\n self.make_callback('transform')\n\n # whence=0 because need to calculate new extents for proper\n # cutout for rotation (TODO: always make extents consider\n # room for rotation)\n whence = 0\n self.redraw(wh...
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Convert field value pairs into regular message. Args: js: A JSON object to convert the field value pairs. message: A regular protocol message to record the data. Raises: ParseError: In case of problems converting.
[ "def _ConvertFieldValuePair(self, js, message):\n \n names = []\n message_descriptor = message.DESCRIPTOR\n fields_by_json_name = dict((f.json_name, f)\n for f in message_descriptor.fields)\n for name in js:\n try:\n field = fields_by_json_name.get(name, None...
[ "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 comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
@param Command $command @return self
[ "public function bind($command)\n {\n $this->command = $command;\n $this->config = $command->getApplication()->config();\n $this->init();\n\n return $this;\n }" ]
[ "final protected function c() {return dfc($this, function() {/** @var int|null $id $id */return\n\t\t!($id = $this->o()->getCustomerId()) ? null : df_customer($id)\n\t;});}" ]
codesearchnet
{ "query": "Represent the Github instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Create a new instance from the Typesafe Config object.
[ "static JmxConfig from(Config config) {\n try {\n ObjectName query = new ObjectName(config.getString(\"query\"));\n List<JmxMeasurementConfig> ms = new ArrayList<>();\n for (Config cfg : config.getConfigList(\"measurements\")) {\n ms.add(JmxMeasurementConfig.from(cfg));\n }\n retu...
[ "@Override\n public void generatePluginConfig(String serverName, File writeDirectory) {\n // Pass true to utilityRequest since this method will be called from the pluginUtility\n // or by the GeneratePluginConfigListener not by a call to the mbean.\n generatePluginConfig(null,serverName,true...
codesearchnet
{ "query": "Represent the Github instruction about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
/* sort criteria for window list: open windows first, then alpha by title
[ "function windowCmp(tabWindowA, tabWindowB) {\n // focused window very first:\n var fA = tabWindowA.focused;\n var fB = tabWindowB.focused;\n if (fA !== fB) {\n if (fA) {\n return -1;\n }\n return 1;\n }\n\n // open windows first:\n if (tabWindowA.open !== tabWindowB.open) {\n if (tabWindowA...
[ "function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co...
codesearchnet
{ "query": "Represent the instruction about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
Returns the file extension of the value without the dot or an empty string. @param value @return the extension without dot or an empry string
[ "public static String getFileExtension(String value) {\n int index = value.lastIndexOf('.');\n if (index > -1) {\n return value.substring(index + 1);\n }\n\n return \"\";\n }" ]
[ "def file_or_token(value):\n \n if isfile(value):\n with open(value) as fd:\n return fd.read().strip()\n\n if any(char in value for char in '/\\\\.'):\n # This chars will never be in a token value, but may be in a path\n # The error message will be handled by the parser\n ...
codesearchnet
{ "query": "Represent the Github text about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
Imports a single project. We save name, description and parent project. @param array $project Project info like description or parent project @param array $parentMapping Array where parent / child relation will be saved @return int
[ "public function importProject(array $project, array &$parentMapping)\n {\n $this->output('Project \"' . $project['name'] . '\"');\n\n $row = $this->existsGerritProject($project['name'], $this->getServerId());\n\n $projectRow = $project;\n $projectRow['server_id'] = $this->getServerId...
[ "public function reduceFilePath($varValue, \\DataContainer $dc)\n {\n $doc = $dc->activeRecord;\n\n $path = \\FilesModel::findByUuid($varValue)->path;\n\n $arrFileNameParts = \\Document::splitFileName(substr($path, strlen(\\DmsConfig::getBaseDirectory(true))));\n\n // TODO (#33): reset the new fileType...
codesearchnet
{ "query": "Represent the Github text about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code about Software development:" }
Wrapper method for MongoCursor::tailable(). @see http://php.net/manual/en/mongocursor.tailable.php @param boolean $tail @return $this
[ "public function tailable($tail = true)\n {\n $tail = (boolean) $tail;\n $this->tailable = $tail;\n $this->mongoCursor->tailable($tail);\n return $this;\n }" ]
[ "public function init()\n {\n $this->db = \\PHPDaemon\\Clients\\Mongo\\Pool::getInstance($this->config->mongoclientname->value);\n $this->cache = \\PHPDaemon\\Clients\\Memcache\\Pool::getInstance($this->config->memcacheclientname->value);\n if (!isset($this->config->limitinstances)) {\n ...
codesearchnet
{ "query": "Represent the Github comment about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
Finds min/max for bounds across blocks Returns: tuple(float): length 6 tuple of floats containing min/max along each axis
[ "def bounds(self):\n \n bounds = [np.inf,-np.inf, np.inf,-np.inf, np.inf,-np.inf]\n\n def update_bounds(ax, nb, bounds):\n \"\"\"internal helper to update bounds while keeping track\"\"\"\n if nb[2*ax] < bounds[2*ax]:\n bounds[2*ax] = nb[2*ax]\n i...
[ "def gaussian_window(t, params):\n \n window = suspect.basis.gaussian(t, 0, 0, params[\"line_broadening\"])\n\n # the above gaussian function returns an area 1 fid, for a windowing\n # function we need to be area preserving (first point must be 1)\n return window / window[0]" ]
codesearchnet
{ "query": "Represent the Github description about Computer Science:", "pos": "Represent the Github code about Computer Science:", "neg": "Represent the Github code about Software development:" }
= null; //cache which keys are generic annotations so we don't have to do too many instanceof checks
[ "@SuppressWarnings({\"unchecked\", \"SuspiciousMethodCalls\"})\r\n private void makeGenericKeyCache(CoreLabel c) {\r\n genericAnnotationKeys = new HashSet<Class<? extends GenericAnnotation<?>>>();\r\n for (Class<?> key : c.keySet()) {\r\n if (CoreLabel.genericValues.containsKey(key)) {\r\n Class<...
[ "def set_identifiers(self, data):\n \n for id_info in self._details.identifiers:\n var_name = id_info['var_name']\n self._data[var_name] = data.get(var_name)\n\n # FIXME: This needs to likely kick off invalidating/rebuilding\n # relations.\n # F...
codesearchnet
{ "query": "Represent the Github summarization about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
This read is used by `._walk` to read from the scope. This will use `hasKey` on the last property instead of reading it.
[ "function(context, keys){\n\n\t\t\t\t// If nothing can be found with the keys we are looking for, save the\n\t\t\t\t// first possible match. This is where we will write to.\n\t\t\t\tif(firstSearchedContext === undefined && !(context instanceof LetContext)) {\n\t\t\t\t\tfirstSearchedContext = context;\n\t\t\t\t}\n\...
[ "def path(self, path):\n \"\"\"\"\"\"\n\n # pylint: disable=attribute-defined-outside-init\n self._path = copy_.copy(path)\n\n # The provided path is shallow copied; it does not have any attributes\n # with mutable types.\n\n # We perform this check after the initialization...
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code:" }
// Attrs returns the configuration attributes for a storage source.
[ "func (c *Config) Attrs() map[string]interface{} {\n\tif c.attrs == nil {\n\t\treturn nil\n\t}\n\tattrs := make(map[string]interface{})\n\tfor k, v := range c.attrs {\n\t\tattrs[k] = v\n\t}\n\treturn attrs\n}" ]
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
/* 数据绑定 $params:键值对参数数组
[ "public function bind($params = null)\n {\n\n if (is_array($params)) {\n foreach ($params as $k => $v) {\n $this->bindParam($k, $v);\n }\n }\n\n return $this;\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 sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Returns a list of usernames of approvers who approved this approval.
[ "def GetNonExpiredApprovers(self):\n \"\"\"\"\"\"\n\n lifetime = rdfvalue.Duration(\n self.Get(self.Schema.LIFETIME) or config.CONFIG[\"ACL.token_expiry\"])\n\n # Check that there are enough approvers.\n #\n # TODO(user): approvals have to be opened with\n # age=aff4.ALL_TIMES because versi...
[ "def ObjectInitializedEventHandler(analysis, event):\n \n\n # Initialize the analysis if it was e.g. added by Manage Analysis\n wf.doActionFor(analysis, \"initialize\")\n\n # Try to transition the analysis_request to \"sample_received\". There are\n # some cases that can end up with an inconsistent s...
codesearchnet
{ "query": "Represent the text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Check the end flag. If this return value is `True`, the learning is end. Args: state_key: The key of state in `self.t`. Returns: bool
[ "def check_the_end_flag(self, state_key):\n '''\n \n '''\n # As a rule, the learning can not be stopped.\n x, y = state_key\n end_point_tuple = np.where(self.__map_arr == self.__end_point_label)\n end_point_x_arr, end_point_y_arr = end_point_tuple\n if x == en...
[ "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 sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Computer Science:" }
// Connect connects two nodes together by calling the "admin_addPeer" RPC // method on the "one" node so that it connects to the "other" node
[ "func (net *Network) Connect(oneID, otherID enode.ID) error {\n\tnet.lock.Lock()\n\tdefer net.lock.Unlock()\n\treturn net.connect(oneID, otherID)\n}" ]
[ "func (c *NetworkGetCommand) Info() *cmd.Info {\n\targs := \"<binding-name> [--ingress-address] [--bind-address] [--egress-subnets]\"\n\tdoc := `\nnetwork-get returns the network config for a given binding name. By default\nit returns the list of interfaces and associated addresses in the space for\nthe binding, as...
codesearchnet
{ "query": "Represent the instruction about Networking:", "pos": "Represent the code about Networking:", "neg": "Represent the code about programming:" }
Returns another instance of this field, but "cast" to a different class. @see FormField::castedCopy() @param String $classOrCopy @return FormField
[ "public function castedCopy($classOrCopy)\n {\n $field = parent::castedCopy($classOrCopy);\n if ($field instanceof SelectField) {\n $field->setSource($this->getSource());\n }\n return $field;\n }" ]
[ "public @CheckForNull PropertyType getPropertyType(@Nonnull Object instance, @Nonnull String field) {\n // in global.jelly, instance==descriptor\n return instance==this ? getGlobalPropertyType(field) : getPropertyType(field);\n }" ]
codesearchnet
{ "query": "Represent the Github instruction about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code:" }
Called by BeanContextSupport superclass during construction and deserialization to initialize subclass transient state
[ "public void initialize()\n {\n super.initialize();\n\n //\n // Register the ServletService classes associated with the ServletServiceProvider\n //\n ServletServiceProvider ssp = ServletServiceProvider.getProvider();\n addService(ServletContext.class, ssp);\n addS...
[ "private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo...
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Gets the path to the expires file Returns group path if possible. Otherwise, returns key path
[ "private function getExpiresPath(Memento\\Key $key = null)\n {\n return $this->getKeyPath($this->groupKey ? null : $key);\n }" ]
[ "def delete_node_storage(node)\n return if node == BLANK_NODE\n raise ArgumentError, \"node must be Array or BLANK_NODE\" unless node.instance_of?(Array)\n\n encoded = encode_node node\n return if encoded.size < 32\n\n # FIXME: in current trie implementation two nodes can share identical\n ...
codesearchnet
{ "query": "Represent the Github comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
Connects to the database. @return void @throws eZClusterHandlerDBNoConnectionException @throws eZClusterHandlerDBNoDatabaseException
[ "public function _connect()\n {\n $siteINI = eZINI::instance( 'site.ini' );\n\n // DB Connection setup\n // This part is not actually required since _connect will only be called\n // once, but it is useful to run the unit tests. So be it.\n // @todo refactor this using eZINI::s...
[ "public function GetListOfTablesInDatabase() {\n $dbConfig = new \\Puzzlout\\Framework\\Dal\\DbStatementConfig(null, \\Puzzlout\\Framework\\Dal\\DbExecutionType::SHOWTABLES, new \\Puzzlout\\Framework\\Dal\\DbQueryFilters());\n $dbConfig->setQuery(\"SHOW TABLES;\");\n $this->addDbConfigItem($dbC...
codesearchnet
{ "query": "Represent the sentence about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code about database:" }
Send a xcmd Overture Response @param overtureCmd The overture command which this is a response to @param hdr The header @param body The body @throws IOException
[ "private void xcmdOvertureResponse(DBGPXCmdOvertureCommandType overtureCmd,\n\t\t\tStringBuilder hdr, StringBuilder body) throws IOException\n\t{\n\t\tStringBuilder sb = new StringBuilder();\n\n\t\tsb.append(\"<xcmd_overture_response command=\\\"\");\n\t\tsb.append(command);\n\t\tsb.append(\"\\\"\");\n\n\t\tsb.appe...
[ "def send(self, service, request):\n \n if not isinstance(request, list):\n request = [request]\n\n # Prefix request with protocol frames\n # Frame 0: empty (REQ emulation)\n # Frame 1: \"MDPCxy\" (six bytes, MDP/Client x.y)\n # Frame 2: Service name (printable s...
codesearchnet
{ "query": "Represent the comment about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Software development:" }
// RESTClient mocks base method
[ "func (m *MockApiextensionsV1beta1Interface) RESTClient() rest.Interface {\n\tret := m.ctrl.Call(m, \"RESTClient\")\n\tret0, _ := ret[0].(rest.Interface)\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 sentence about Computer Science:", "pos": "Represent the Github code about Computer Science:", "neg": "Represent the Github code about programming:" }
Build Java code to represent a cast to the given type. This will be an argument of the form "(pkg.Cls1)" or "(pkg.Cls2[])" or "(primtype)" @param builder the builder in which to build the argument @param cls the type for the argument
[ "protected static void buildClassCast(StringBuilder builder, Class cls) {\n builder.append('(');\n buildClass(builder, cls);\n builder.append(')');\n }" ]
[ "NameAndType nameType(Symbol sym) {\n return new NameAndType(sym.name, sym.externalType(types), types);\n // the NameAndType is generated from a symbol reference, and the\n // adjustment of adding an additional this$n parameter needs to be made.\n }" ]
codesearchnet
{ "query": "Represent the Github comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
// SetKeyId sets the KeyId field's value.
[ "func (s *PutParameterInput) SetKeyId(v string) *PutParameterInput {\n\ts.KeyId = &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:" }
Return base API url string for the QualysGuard api_version and server.
[ "def url_api_version(self, api_version):\n \n # Set base url depending on API version.\n if api_version == 1:\n # QualysGuard API v1 url.\n url = \"https://%s/msp/\" % (self.server,)\n elif api_version == 2:\n # QualysGuard API v2 url.\n url = ...
[ "@Override\n\tpublic void validateSetup(Server server, Query query) throws ValidationException {\n\t\tlogger.info(\"Starting Stackdriver writer connected to '{}', proxy {} ...\", gatewayUrl, proxy);\n\t}" ]
codesearchnet
{ "query": "Represent the Github description about Graph API:", "pos": "Represent the Github code about Graph API:", "neg": "Represent the Github code about Programming:" }
Process pagination @param array $pagination @param Criteria $criteria
[ "protected function processPagination(array $pagination, Criteria $criteria): void\n {\n if (isset($pagination['offset'])) {\n $criteria->setFirstResult((int) $pagination['offset']);\n }\n\n if (isset($pagination['limit'])) {\n $criteria->setMaxResults((int) $pagination...
[ "protected function setGeneratorCategorymembers()\n {\n $this->logger->debug('Base:setGeneratorCategorymembers');\n $this->setParam('generator', 'categorymembers');\n $this->setParam('gcmprop', 'ids|title|type|timestamp');\n $this->setParam('gcmlimit', $this->getLimit());\n }" ]
codesearchnet
{ "query": "Represent the Github sentence about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Programming:" }
//SliceRemove SliceRomove(a,4,5) //a[4]
[ "func SliceRemove(slice []interface{}, start int, args ...int) []interface{} {\n\tvar end int\n\tif len(args) == 0 {\n\t\tend = start + 1\n\t} else {\n\t\tend = args[0]\n\t}\n\tif end > len(slice)-1 {\n\t\treturn slice[:start]\n\t}\n\treturn append(slice[:start], slice[end:]...)\n}" ]
[ "def backward_word(self, e): # (M-b)\r\n \"\"\"\r\n self.l_buffer.backward_word(self.argument_reset)\r\n self.finalize()" ]
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Cancel the timer created by sink_ object with ID equal to id_.
[ "public void cancelTimer(IPollEvents sink, int id)\n {\n assert (Thread.currentThread() == worker);\n\n TimerInfo copy = new TimerInfo(sink, id);\n // Complexity of this operation is O(n). We assume it is rarely used.\n\n TimerInfo timerInfo = timers.find(copy);\n if (timerInf...
[ "def _enter(self):\n \"\"\"\"\"\"\n command = self.command\n logger.log(5, \"Snippet keystroke `Enter`.\")\n # NOTE: we need to set back the actions (mode_off) before running\n # the command.\n self.mode_off()\n self.run(command)" ]
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code:" }
Remove double brackets (internal links) but leave the viewable text. Args: text: a unicode string Returns: a unicode string
[ "def _remove_double_brackets(text):\n \n def replacement_fn(s):\n if u\":\" in s:\n # this is probably a category or something like that.\n return \"\"\n # keep the part after the bar.\n bar_pos = s.find(u\"|\")\n if bar_pos == -1:\n return s\n return s[bar_pos + 1:]\n return _find_...
[ "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 sentence about PHP programming:", "pos": "Represent the Github code about PHP programming:", "neg": "Represent the Github code about programming:" }
Set Route Info @param $request RequestContract
[ "protected function setRouteInfo($request)\n {\n $this->route_info = Route::getWebInfo($request);\n if (!$this->route_info['controller'] || !$this->route_info['action']) {\n $this->route_info['controller'] = 'index';\n $this->route_info['action'] = 'index';\n $home ...
[ "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 comment about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
<p> Returns the absolute value of the element in the matrix that has the smallest absolute value.<br> <br> Min{ |a<sub>ij</sub>| } for all i and j<br> </p> @param a A matrix. Not modified. @return The max element value of the matrix.
[ "public static double elementMinAbs( DMatrixD1 a ) {\n final int size = a.getNumElements();\n\n double min = Double.MAX_VALUE;\n for( int i = 0; i < size; i++ ) {\n double val = Math.abs(a.get(i));\n if( val < min ) {\n min = val;\n }\n }\n...
[ "def perm(A, p):\n \n assert isinstance(A,spmatrix), \"argument must be a sparse matrix\"\n assert A.size[0] == A.size[1], \"A must be a square matrix\"\n assert A.size[0] == len(p), \"length of p must be equal to the order of A\"\n return A[p,p]" ]
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Build a ContentDisposition from a requests (PyPI) response.
[ "def parse_requests_response(response, **kwargs):\n \n\n return parse_headers(\n response.headers.get('content-disposition'), response.url, **kwargs)" ]
[ "@Override\n public void generatePluginConfig(String serverName, File writeDirectory) {\n // Pass true to utilityRequest since this method will be called from the pluginUtility\n // or by the GeneratePluginConfigListener not by a call to the mbean.\n generatePluginConfig(null,serverName,true...
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Returns a random variate from the negative binomial distribution. `size` must be strictly positive, and `prob` must be in `(0, 1]`. @fullName rnbinom(size, prob)() @memberof nbinom
[ "function rnbinom(size, prob) {\n var rg;\n\n if (size <= 0 || prob <= 0 || prob > 1) {\n return function() { return NaN; };\n }\n if (prob === 1) { return function() { return 0; }; }\n rg = rgamma(size, (1 - prob) / prob);\n return function() { return rpois(rg())(); };\n }" ...
[ "def Normal(mu, sigma, tag=None):\n \n assert sigma > 0, 'Normal \"sigma\" must be greater than zero'\n return uv(ss.norm(loc=mu, scale=sigma), tag=tag)" ]
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code:" }
Create a new {@link GenericResponseBuilder} with a not-modified status. @param tag the entity tag of the unmodified entity @return a new builder
[ "public static <T> GenericResponseBuilder<T> notModified(EntityTag tag) {\n return GenericResponses.<T>notModified().tag(tag);\n }" ]
[ "@SuppressWarnings(\"unused\")\n @Internal\n protected final void warnMissingProperty(Class type, String method, String property) {\n if (LOG.isWarnEnabled()) {\n LOG.warn(\"Configuration property [{}] could not be set as the underlying method [{}] does not exist on builder [{}]. This usuall...
codesearchnet
{ "query": "Represent the Github sentence about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Software development:" }
Convert Bitcoin to Satoshi @param {number|string} bitcoin Amount of Bitcoin to convert @throws {TypeError} Thrown if input is not a number or string @returns {number}
[ "function(bitcoin) {\n //validate arg\n var bitcoinType = typeof bitcoin;\n if (bitcoinType === 'string') {\n bitcoin = toNumber(bitcoin);\n bitcoinType = 'number';\n }\n if (bitcoinType !== 'number'){\n throw new TypeError('toSatoshi must be called on a number or string, got ' + bitco...
[ "function getValueOfUnit(unitInput) {\n const unit = unitInput ? unitInput.toLowerCase() : 'ether';\n var unitValue = unitMap[unit]; // eslint-disable-line\n\n if (typeof unitValue !== 'string') {\n throw new Error(`[ethjs-unit] the unit provided ${unitInput} doesn't exists, please use the one of the followin...
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Encode the contents of this update record without including a record header. Returns: bytearary: The encoded contents.
[ "def encode_contents(self):\n \n\n header = struct.pack(\"<LL\", self.offset, len(self.raw_data))\n return bytearray(header) + self.raw_data" ]
[ "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 sentence about Technology:", "pos": "Represent the Github code about Technology:", "neg": "Represent the Github code about programming:" }
Create the code for a single hook. @param $hook_short_name The short name of the hook, i.e., without the 'hook_' prefix. @param $parameters_string A string of the hook's parameters. @return A string of formatted code for inclusion in the api.php file.
[ "function hook_code($hook_short_name, $parameters_string) {\n $parameters = explode(', ', $parameters_string);\n $parameters_doc_lines = array();\n foreach ($parameters as $parameter) {\n $parameters_doc_lines[] = \" * @param $parameter\\n\" .\n \" * TODO: document thi...
[ "public function getTemplateFile($filename, $data)\n {\n $data['getRegion'] = function($name) { \n return $this->getRegion($name); \n }; // This is for mustache compatibility\n\n // Push the data into regions and then pass a pointer to this class to the layout\n // $thi...
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
// List returns all memberships for a given organization, team, or user/machine
[ "func (m *MembershipsClient) List(ctx context.Context, orgID *identity.ID,\n\tteamID *identity.ID, ownerID *identity.ID) ([]envelope.Membership, error) {\n\n\tquery := &url.Values{}\n\tif orgID != nil {\n\t\tquery.Set(\"org_id\", orgID.String())\n\t}\n\tif teamID != nil {\n\t\tquery.Set(\"team_id\", teamID.String()...
[ "def set_schema(self, schema_name, include_public=True):\n \n self.tenant = FakeTenant(schema_name=schema_name)\n self.schema_name = schema_name\n self.include_public_schema = include_public\n self.set_settings_schema(schema_name)\n self.search_path_set = False\n # C...
codesearchnet
{ "query": "Represent the comment about Agent Identity Management:", "pos": "Represent the code about Agent Identity Management:", "neg": "Represent the code:" }
Create and write the RSA private file @throws \Exception
[ "public function createRSAPrivateKey()\n {\n $path = $this->getConfig()->getPrivateKeyFilePath();\n $this->createDir($path);\n $this->getConfig()->setPrivateKey((new RsaKeyGen())->createPrivateKey());\n\n if (@file_put_contents($path, $this->getConfig()->getPrivateKey()) === false) {\...
[ "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:" }
// Parse parses the DataType expecting it to be a String type.
[ "func (parser StringTypeParser) Parse(d DataType) error {\n\tif value, ok := AsString(d); ok {\n\t\tparser.setter(value)\n\t} else {\n\t\treturn fmt.Errorf(\"Error parsing type of %#v as a String\", d)\n\t}\n\treturn nil\n}" ]
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the text about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
Read sample data for this sample from a WAV file. :param filename: the file from which to read
[ "def read_wav(self, filename):\n \n wave_input = None\n\n try:\n wave_input = wave.open(filename, 'r')\n wave_frames = bytearray(\n wave_input.readframes(wave_input.getnframes()))\n\n self.sample_data = [x >> 4 for x in wave_frames]\n\n fin...
[ "def open(self, mode=MODE_READ):\n \n if mode not in [MODE_READ, MODE_WRITE]:\n error = \"Open mode must be '{}' or '{}'\".format(\n MODE_READ, MODE_WRITE)\n raise ValueError(error)\n self._openMode = mode\n if mode == MODE_READ:\n self.ass...
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
Authenticate using SCRAM.
[ "def _authenticate_scram(credentials, sock_info, mechanism):\n \"\"\"\"\"\"\n\n username = credentials.username\n if mechanism == 'SCRAM-SHA-256':\n digest = \"sha256\"\n digestmod = hashlib.sha256\n data = saslprep(credentials.password).encode(\"utf-8\")\n else:\n digest = \...
[ "@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 summarization:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
== Parameters: c1,c2,c3:: c1 and c2 are the coeficiens of the homothetie. c3 is optional
[ "def homothétie c1, c2, c3=1.0\n if c1 == nil or c2 == nil\n Error.call \"Coefficients are invalids\"\n end\n\n s = Matrix.new [[c1.to_f, 0, 0], [0, c2.to_f, 0], [0, 0, c3.to_f]]\n @matrix_op = s\n cpy = self\n cpy.z = 1.0\n\n puts \"homothétie de rapports #{c1.to_f}, #{c2....
[ "def rs_calc_syndromes(msg, nsym, fcr=0, generator=2):\n '''\n '''\n # Note the \"[0] +\" : we add a 0 coefficient for the lowest degree (the constant). This effectively shifts the syndrome, and will shift every computations depending on the syndromes (such as the errors locator polynomial, errors evaluato...
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Natural Language Processing:" }
// Send a message using the HTTP GCM connection server.
[ "func SendHttp(apiKey string, m HttpMessage) (*HttpResponse, error) {\n\tc := &httpGcmClient{httpAddress, &http.Client{}, \"0\"}\n\tb := newExponentialBackoff()\n\treturn sendHttp(apiKey, m, c, b)\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 sentence about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
// MakeQuad converts quad.Quad to its protobuf representation.
[ "func MakeQuad(q quad.Quad) *Quad {\n\treturn &Quad{\n\t\tSubjectValue: MakeValue(q.Subject),\n\t\tPredicateValue: MakeValue(q.Predicate),\n\t\tObjectValue: MakeValue(q.Object),\n\t\tLabelValue: MakeValue(q.Label),\n\t}\n}" ]
[ "public String filePath(int index, String savePath) {\n // not calling the corresponding swig function because internally,\n // the use of the function GetStringUTFChars does not consider the case of\n // a copy not made\n return savePath + File.separator + fs.file_path(index);\n }" ]
codesearchnet
{ "query": "Represent the Github instruction about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
Stops a proces that contains arg1 and is filtered by arg2
[ "def kill(arg1, arg2):\n \n from subprocess import Popen, PIPE\n\n # Wait until ready\n t0 = time.time()\n # Wait no more than these many seconds\n time_out = 30\n running = True\n\n while running and time.time() - t0 < time_out:\n if os.name == 'nt':\n p = Popen(\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 comment:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Returns defaultUrlParams including configured prefixes. @return array URL params
[ "public static function defaultUrlParams() {\n\t\t$defaults = ['plugin' => false];\n\t\t$prefixes = (array)Configure::read('Routing.prefixes');\n\t\tforeach ($prefixes as $prefix) {\n\t\t\t$defaults[$prefix] = false;\n\t\t}\n\t\treturn $defaults;\n\t}" ]
[ "public static OriginIdElement addOriginId(Message message) {\n OriginIdElement originId = new OriginIdElement();\n message.addExtension(originId);\n // TODO: Find solution to have both the originIds stanzaId and a nice to look at incremental stanzaID.\n // message.setStanzaId(originId.g...
codesearchnet
{ "query": "Represent the Github instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
A topic survives if (1) it doesn't match the blacklist, and (2) either whitelist is empty, or it matches the whitelist. Whitelist and blacklist use regex patterns (NOT glob patterns).
[ "public static boolean survived(String topic, List<Pattern> blacklist, List<Pattern> whitelist) {\n if (stringInPatterns(topic, blacklist)) {\n return false;\n }\n return (whitelist.isEmpty() || stringInPatterns(topic, whitelist));\n }" ]
[ "def _is_prefix_of_longer_match(self, key_presses):\n \n keys = tuple(k.key for k in key_presses)\n cli = self._cli_ref()\n\n # Get the filters for all the key bindings that have a longer match.\n # Note that we transform it into a `set`, because we don't care about\n # the...
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code:" }
// ruleParser parses protobuf L7 rules to enforcement objects // May panic
[ "func ruleParser(rule *cilium.PortNetworkPolicyRule) []proxylib.L7NetworkPolicyRule {\n\tl7Rules := rule.GetL7Rules()\n\tvar rules []proxylib.L7NetworkPolicyRule\n\tif l7Rules == nil {\n\t\treturn rules\n\t}\n\tfor _, l7Rule := range l7Rules.GetL7Rules() {\n\t\tvar rr r2d2Rule\n\t\tfor k, v := range l7Rule.Rule {\n...
[ "func (f *Factory) BindFlags(flags *pflag.FlagSet) {\n\t// any flags defined by external projects (not part of pflags)\n\tflags.AddGoFlagSet(flag.CommandLine)\n\n\t// Merge factory's flags\n\tflags.AddFlagSet(f.flags)\n\n\t// Globally persistent flags across all subcommands.\n\t// TODO Change flag names to consts t...
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
This kills us with no cleanups.
[ "def Run(self, unused_arg):\n \"\"\"\"\"\"\n logging.debug(\"Disabling service\")\n\n win32serviceutil.ChangeServiceConfig(\n None,\n config.CONFIG[\"Nanny.service_name\"],\n startType=win32service.SERVICE_DISABLED)\n svc_config = QueryService(config.CONFIG[\"Nanny.service_name\"])\...
[ "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:" }
// Checks the Revel repos for the latest version
[ "func (v *VersionCommand) doRepoCheck(updateLibs bool) (versionInfo string, needsUpdate bool) {\n\tvar (\n\t\ttitle string\n\t\tlocalVersion *model.Version\n\t)\n\tfor _, repo := range []string{\"revel\", \"cmd\", \"modules\"} {\n\t\tversonFromRepo, err := v.versionFromRepo(repo, \"\", \"version.go\")\n\t\tif err !...
[ "def list_nodes(self):\n \"\"\"\"\"\"\n self.add_environment_file(user='stack', filename='stackrc')\n ret, _ = self.run(\"ironic node-list --fields uuid|awk '/-.*-/ {print $2}'\", user='stack')\n # NOTE(Gonéri): the good new is, the order of the nodes is preserved and follow the one from...
codesearchnet
{ "query": "Represent the Github sentence about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Technology:" }
// UnitStatus returns the unit agent and workload status for a given // unit, with special handling for agent presence.
[ "func (c *ModelPresenceContext) UnitStatus(unit UnitStatusGetter) (agent StatusAndErr, workload StatusAndErr) {\n\tagent.Status, agent.Err = unit.AgentStatus()\n\tworkload.Status, workload.Err = unit.Status()\n\n\tif !canBeLost(agent.Status, workload.Status) {\n\t\t// The unit is allocating or installing - there'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 Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
returns the rml mapping filepath rml_name(str): Name of the rml mapping to retrieve rtn_format: ['filepath', 'data']
[ "def get_rml(self, rml_name, rtn_format=\"filepath\"):\n \n\n try:\n rml_path = self.rml_maps[rml_name]\n except KeyError:\n if rml_name in self.rml_maps.values() or os.path.exists(rml_name):\n rml_path = rml_name\n else:\n raise Lo...
[ "def requests(self):\n ''''''\n path = pathjoin(self.path, self.name, Request.path)\n response = self.service.send(SRequest('GET', path))\n # a bin behaves as a push-down store --- better to return the requests\n # in order of appearance\n return list(reversed(Request.from_...
codesearchnet
{ "query": "Represent the summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Perform the authorization for the shipment at the given index @param int $shipmentNumber order item index to authorize @return string amazonAuthorizationId for the single auth call
[ "private function _performAuthorizationForShipment($shipmentNumber)\n {\n $response = $this->callStepAndCheckForException('performAuthorizationForShipment', array($shipmentNumber));\n printAuthorizeResponse($response);\n return $response->getAuthorizeResult()->getAuthorizationDetails()->getA...
[ "def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p" ]
codesearchnet
{ "query": "Represent the summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Build forms @param FormBuilderInterface $builder @param array $options
[ "public function buildForm(FormBuilderInterface $builder, array $options)\n {\n parent::buildForm($builder, $options);\n\n $transformerStrategy = $options['transformer'];\n if ($transformerStrategy === 'auto') {\n $transformerStrategy = $options['multiple'] ? 'multiple' : 'class';...
[ "private function generateFormType()\n {\n $this->generateEntityAdminType($this->bundle, $this->entity, 'PageParts', $this->fields);\n\n $this->assistant->writeLine('Generating form type : <info>OK</info>');\n }" ]
codesearchnet
{ "query": "Represent the description about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Software development:" }
// GetSealer mocks base method
[ "func (m *MockCryptoSetup) GetSealer() (protocol.EncryptionLevel, handshake.Sealer) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"GetSealer\")\n\tret0, _ := ret[0].(protocol.EncryptionLevel)\n\tret1, _ := ret[1].(handshake.Sealer)\n\treturn ret0, ret1\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 description:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
@param mixed $token @return bool
[ "private function isOpenTag($token): bool\n {\n if (!is_array($token)) {\n return false;\n }\n\n if ($token[0] == T_ECHO && $token[1] == '<?=') {\n return true;\n }\n\n return $token[0] == T_OPEN_TAG || $token[0] == T_OPEN_TAG_WITH_ECHO;\n }" ]
[ "final protected function c() {return dfc($this, function() {/** @var int|null $id $id */return\n\t\t!($id = $this->o()->getCustomerId()) ? null : df_customer($id)\n\t;});}" ]
codesearchnet
{ "query": "Represent the comment about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
processes one item on the queue. Returns true if there was an item to process, false if there was no item
[ "def process_queue_item #:nodoc:\n return false if @queue.empty?\n\n # Even though we just asked if the queue was empty, it\n # still could have had an item which by this statement\n # is now gone. For this reason we pass true to Queue#deq\n # because we will sleep indefinitely if it i...
[ "public T get() {\n T object;\n\n while (true) {\n // 1. get the next free object\n int p = m_put.get();\n int g = m_get.get();\n if (g >= p) {\n // get index hits the put index, implying empty pool\n if (p >= LIMIT) {\n ...
codesearchnet
{ "query": "Represent the Github post about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Software development:" }
Removes all container elements with the given id from all containers and the client side cache.<p> @param resourceId the resource id
[ "protected void removeContainerElements(String resourceId) {\n\n boolean changed = false;\n Iterator<org.opencms.ade.containerpage.client.ui.CmsContainerPageElementPanel> it = getAllDragElements().iterator();\n while (it.hasNext()) {\n org.opencms.ade.containerpage.client.ui.CmsConta...
[ "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 comment about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
Get the value of the provided key. @param string $key @return Maybe @throws CoreException
[ "public function lookup($key)\n {\n foreach ($this->value as $innerKey => $value) {\n if ($key === $innerKey) {\n return Maybe::just($value);\n }\n }\n\n return Maybe::nothing();\n }" ]
[ "function validateService($pluginInstance)\n {\n if (! is_object($pluginInstance) )\n throw new \\Exception(sprintf('Can`t resolve to (%s) Instance.', $pluginInstance));\n\n if (!$pluginInstance instanceof aGrantRequest)\n throw new exContainerInvalidServiceType('Invalid Plugi...
codesearchnet
{ "query": "Represent the Github summarization about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about Software development:" }
从sdp中解析trackID=2形式的字符串
[ "def _parse_track_id(self,sdp):\n ''''''\n m = re.search(r'a=control:(?P<trackid>[\\w=\\d]+)',sdp,re.S)\n return (m and m.group('trackid')) or ''" ]
[ "protected static void fixResultByRule(List<Vertex> linkedArray)\n {\n\n //--------------------------------------------------------------------\n //Merge all seperate continue num into one number\n mergeContinueNumIntoOne(linkedArray);\n\n //-------------------------------------------...
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code about text processing:" }
// ProductName order item's color name
[ "func (item *OrderItem) ProductName() string {\n\titem.loadSizeVariation()\n\treturn item.SizeVariation.ColorVariation.Product.Name\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 sentence:", "pos": "Represent the code:", "neg": "Represent the code:" }
// SetId sets the Id field's value.
[ "func (s *DeleteNamespaceInput) SetId(v string) *DeleteNamespaceInput {\n\ts.Id = &v\n\treturn s\n}" ]
[ "function Rule(rules) {\n this.rules = rules;\n // Identifies individual rule\n this.name = \"\";\n // Identifies the grammar that this rule belongs to \n this.grammarName = \"\";\n // Identifies types of rules. Rules can have \"types\" that are diff...
codesearchnet
{ "query": "Represent the Github instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Creates a new hunt.
[ "def _HandleLegacy(self, args, token=None):\n \"\"\"\"\"\"\n\n # We only create generic hunts with /hunts/create requests.\n generic_hunt_args = rdf_hunts.GenericHuntArgs()\n generic_hunt_args.flow_runner_args.flow_name = args.flow_name\n generic_hunt_args.flow_args = args.flow_args\n\n # Clear al...
[ "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 instruction:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
If one object path doesn't inlcude a host, don't include the hosts in the comparison
[ "def paths_equal(self, lhs, rhs):\n \n\n if lhs is rhs:\n return True\n if lhs.host is not None and rhs.host is not None and\\\n lhs.host != rhs.host:\n return False\n # need to make sure this stays in sync with CIMInstanceName.__cmp__()\n return no...
[ "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 post:", "pos": "Represent the code:", "neg": "Represent the code about Technology:" }
Regex substitution function. Replaces regex ``search`` with ``replace`` in ``text``
[ "def substitute(search, replace, text):\n ''\n return re.sub(re.compile(str(search)), replace, text)" ]
[ "def wrap_embedded_keyvalue(self, data):\n \n if data is not None:\n try:\n data = u'{}'.format(data)\n # variables = re.findall(self._vars_keyvalue_embedded, u'{}'.format(data))\n except UnicodeEncodeError:\n # variables = re.findall(...
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Programming:" }
This is the function that does the actual checking. This should allow either matches to the regex or empty values. @param mixed $value The value being checked @return bool True if the value is valid
[ "protected function checkValidity($value) : bool\n {\n if (preg_match(static::$regex, $value)) {\n return true;\n } elseif ('' === $value) {\n return true;\n } else {\n return false;\n }\n }" ]
[ "def fix_config(self, options):\n \n options = super(Trigger, self).fix_config(options)\n\n opt = \"condition\"\n if opt not in options:\n options[opt] = \"True\"\n if opt not in self.help:\n self.help[opt] = \"The (optional) condition for teeing off the toke...
codesearchnet
{ "query": "Represent the text about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
/*! \static Initialize the bork translator if this is not allready done.
[ "static function initialize()\n {\n if ( !isset( $GLOBALS['eZ1337Translator'] ) ||\n !( $GLOBALS['eZ1337Translator'] instanceof eZ1337Translator ) )\n {\n $GLOBALS['eZ1337Translator'] = new eZ1337Translator();\n }\n\n $man = eZTranslatorManager::instance();\n ...
[ "def get_app(self):\n \n # First see to connection stack\n ctx = connection_stack.top\n if ctx is not None:\n return ctx.app\n\n # Next return app from instance cache\n if self.app is not None:\n return self.app\n\n # Something went wrong, in mo...
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code:" }
Override the default implementation of the GetterFactory used to get access to value from the ResultSet. @param getterFactory the getterFactory @return the current factory
[ "public JdbcMapperFactory getterFactory(final GetterFactory<ResultSet, JdbcColumnKey> getterFactory) {\n\t\treturn addGetterFactory(new ContextualGetterFactoryAdapter<ResultSet, JdbcColumnKey>(getterFactory));\n\t}" ]
[ "protected Expression instantiate(Object oldInstance, Encoder out)\n {\n //\n // An implementation instance is actually constructed at decode time by calling\n // ControlBean.ensureControl on the parent bean. This will create a new impl\n // instance and run the impl initializer on i...
codesearchnet
{ "query": "Represent the instruction about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
Attempt to set the stdin property @return void @throws RuntimeException
[ "protected function setStdIn()\n {\n if ($this->stdIn !== false) {\n fclose($this->stdIn);\n }\n\n $this->stdIn = fopen('php://stdin', 'r');\n\n if (!$this->stdIn) {\n throw new RuntimeException('Unable to read from STDIN');\n }\n }" ]
[ "public AttributeConfig[] get_attribute_config(TacoTangoDevice tacoDevice, String[] attrnames) throws DevFailed {\n Except.throw_exception(\"Api_TacoFailed\",\n \"Taco protocol not supported\",\n \"TacoTangoDeviceDAODefaultImpl.command_inout()\");\n return null;\n }" ]
codesearchnet
{ "query": "Represent the Github comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about N/A:" }
Return the request token for this API. If we've not fetched it yet, go out, request and memoize it.
[ "def get_request_token(self):\n \n \n if self._request_token is None:\n self._request_token = self._get_request_token()\n return self._request_token" ]
[ "async function fetchCacheableResource(request) {\n const cache = await caches.open(CACHE_NAME);\n const cachedResponse = await cache.match(request);\n\n if (!navigator.onLine) {\n // We are offline, and we know it. Just return the cached response, to\n // avoid a bunch of pointless errors in the JS conso...
codesearchnet
{ "query": "Represent the text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Computer Science:" }
Generate the diff of the files. @param Product $product Themeisle Product. @param array $files Array of files. @param bool $recurse Whether to recurse or not. @return mixed Diff data.
[ "private function generate_diff( $product, $files, $recurse = false ) {\n\t\trequire_once( ABSPATH . 'wp-admin/includes/file.php' );\n\t\tWP_Filesystem();\n\t\tglobal $wp_filesystem;\n\n\t\t$diff = array();\n\t\t$path = str_replace( ABSPATH, $wp_filesystem->abspath(), plugin_dir_path( $product->get_basefile() ) );\...
[ "public function initializeArguments()\n {\n $this->registerArgument('path', 'string', 'Location of the resource, can be either a path relative to the Public resource directory of the package or a resource://... URI', false, null);\n $this->registerArgument('package', 'string', 'Target package key....
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Sets image size @param int $width @param int $height @return Thumb
[ "public function size(Int $width, Int $height) : Thumb\n {\n $this->sets['width'] = $width;\n $this->sets['height'] = $height;\n\n return $this;\n }" ]
[ "protected function setGeneratorImages()\n {\n $this->logger->debug('Base:setGeneratorImages');\n $this->setParam('generator', 'images');\n $this->setParam('gimlimit', $this->getLimit());\n }" ]
codesearchnet
{ "query": "Represent the Github comment about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about Programming:" }
@param Fieldset $fieldset @param boolean $groupActions @return HtmlElement
[ "protected function renderFieldset(Fieldset $fieldset, $groupActions = false)\n {\n $fieldsetElement = new HtmlElement('fieldset');\n $id = $fieldset->getAttribute('id') ? : $fieldset->getName();\n $parent = $this->getElement();\n\n $fieldsetElement->addAttribute...
[ "protected final function AddCssClassField()\n {\n $name = 'CssClass';\n $this->AddField(Input::Text($name, $this->Content()->GetCssClass()), false, Trans(\"Core.ContentForm.$name\"));\n }" ]
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
// SetPolicy sets the Policy field's value.
[ "func (s *InitiateVaultLockInput) SetPolicy(v *VaultLockPolicy) *InitiateVaultLockInput {\n\ts.Policy = v\n\treturn s\n}" ]
[ "function Rule(rules) {\n this.rules = rules;\n // Identifies individual rule\n this.name = \"\";\n // Identifies the grammar that this rule belongs to \n this.grammarName = \"\";\n // Identifies types of rules. Rules can have \"types\" that are diff...
codesearchnet
{ "query": "Represent the Github instruction about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
Stores the gui setting in the header of the supplied databox. hkeys in the file are set to have the format "self.controlname"
[ "def _store_gui_setting(self, databox, name):\n \n try: databox.insert_header(name, eval(name + \".get_value()\"))\n except: print(\"ERROR: Could not store gui setting \"+repr(name))" ]
[ "def anim(host, seq, anim, d):\n \n at(host, 'ANIM', seq, [anim, d])" ]
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Check parameters for validity and assign global static variables. @param paramBuilder {@link Builder} reference
[ "private static void checkParams(final Builder paramBuilder) {\n checkState(paramBuilder.mSession != null && paramBuilder.mKey >= 0 && paramBuilder.mNewRev >= 0\n && paramBuilder.mOldRev >= 0 && paramBuilder.mObservers != null && paramBuilder.mKind != null,\n \"No valid arguments specif...
[ "def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)" ]
codesearchnet
{ "query": "Represent the Github sentence about text processing:", "pos": "Represent the Github code about text processing:", "neg": "Represent the Github code:" }
// PropagateResync fills registered channels with the data.
[ "func (adapter *Registry) PropagateResync(ctx context.Context, txData map[string]datasync.ChangeValue) error {\n\tvar events []func(done chan error)\n\tadapter.lastRev.Cleanup()\n\n\tfor _, sub := range adapter.subscriptions {\n\t\titems := map[string]datasync.KeyValIterator{}\n\n\t\tfor _, prefix := range sub.KeyP...
[ "@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 Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Prepares bulk data to store in elasticsearch index for model properties eav values @param HasProperties | PropertiesTrait $model @param array $props @param string $index @param string $type @param array $languages @return array
[ "private static function prepareEav($model, $props, $index, $type, $languages)\n {\n $eavTable = $model->eavTable();\n $values = (new Query())\n ->from($eavTable)\n ->where([\n 'model_id' => $model->id,\n 'property_id' => array_keys($props)\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 sentence about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code:" }
URL URL for the download cradle
[ "def options(self, context, module_options):\n '''\n \n '''\n\n if not 'URL' in module_options:\n context.log.error('URL option is required!')\n exit(1)\n\n self.url = module_options['URL']" ]
[ "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:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
Remove a scope from update queue @param {{index: number}} refresh_ticket @param {number} level
[ "function(refresh_ticket, level) {\n\n\t\tif (Lava.schema.DEBUG && refresh_ticket == null) Lava.t();\n\n\t\tthis._scope_refresh_queues[level][refresh_ticket.index] = null;\n\n\t}" ]
[ "function completeQuery(err) {\n if (err) return cb(err);\n db.eval(zahd, 2, 'expiring_domains', 'querying_domains',\n expiration, domain, next);\n }" ]
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// GetSlavesFromLeader will return the current slaves of the leader node of the cluster.
[ "func (c *Client) GetSlavesFromLeader() (*State, error) {\n\tresp, err := c.GetHTTPResponseFromLeader(c.GetURLForSlavesFilePid)\n\treturn c.parseStateResponse(resp, err)\n}" ]
[ "@Override\n public <T> Streamlet<T> applyOperator(IStreamletOperator<R, T> operator) {\n checkNotNull(operator, \"operator cannot be null\");\n\n // By default, NoneStreamGrouping stategy is used. In this stategy, tuples are forwarded\n // from parent component to a ramdon one of all the instances of the...
codesearchnet
{ "query": "Represent the Github text about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Programming:" }
Write settings.xml to XML format @param PHPExcel $pPHPExcel @return string XML Output @throws PHPExcel_Writer_Exception
[ "public function write(PHPExcel $pPHPExcel = null)\n {\n if (!$pPHPExcel) {\n $pPHPExcel = $this->getParentWriter()->getPHPExcel();\n }\n\n $objWriter = null;\n if ($this->getParentWriter()->getUseDiskCaching()) {\n $objWriter = new PHPExcel_Shared_XMLWriter(PHPE...
[ "function _load()\n {\n $file = $this->_getFilePath();\n if (! file_exists($file) )\n ## nothing to import, no data written yet!\n return;\n\n ErrorStack::handleError(E_ALL);\n ## \\\\\\\\\\\n $data = include $file;\n $data = $this->getDataIntercha...
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code:" }
Load queues from user configuration @param ContainerBuilder $container SF2 Container Builder @param array $config Configuration array @return {$this}
[ "public function loadQueues(ContainerBuilder $container, array $config)\n {\n foreach ($config as $name => $attributes) {\n $container\n ->setDefinition(\n self::getQueueServiceKey($name),\n new Definition(\n $container...
[ "protected function beforeInit()\n {\n parent::beforeInit();\n \n $this->isCli = true;\n \n // load default config\n Config::setDefault(DefaultConfig::console());\n \n // load default definition\n $this->definition = $this->getDefaultDefinition()...
codesearchnet
{ "query": "Represent the comment about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code:" }
// Implements proto.MultiBulkParse
[ "func boolSliceParser(rd *proto.Reader, n int64) (interface{}, error) {\n\tbools := make([]bool, 0, n)\n\tfor i := int64(0); i < n; i++ {\n\t\tn, err := rd.ReadIntReply()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tbools = append(bools, n == 1)\n\t}\n\treturn bools, nil\n}" ]
[ "def DeserializeExclusiveData(self, reader):\n \n self.Type = TransactionType.StateTransaction\n\n self.Descriptors = reader.ReadSerializableArray('neo.Core.State.StateDescriptor.StateDescriptor')" ]
codesearchnet
{ "query": "Represent the comment:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
Utility method to test if a certificate is self-signed. This is the case iff the subject and issuer X500Principals are equal AND the certificate's subject public key can be used to verify the certificate. In case of exception, returns false.
[ "public static boolean isSelfSigned(X509Certificate cert,\n String sigProvider) {\n if (isSelfIssued(cert)) {\n try {\n if (sigProvider == null) {\n cert.verify(cert.getPublicKey());\n } else {\n cert.verify(cert.getPublicK...
[ "def verify(build)\n # TODO might as well cache this and store in the db so we dont have to\n # convert every time\n pkey = to_rsa_pkey\n signature = Base64.decode64(build.signature)\n digest = OpenSSL::Digest::SHA256.new\n\n # If the user submits html were going to expect the\n #...
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code:" }
Import data from json response.
[ "def data_import(self, json_response):\n \"\"\"\"\"\"\n if 'data' not in json_response:\n raise PyVLXException('no element data found: {0}'.format(\n json.dumps(json_response)))\n data = json_response['data']\n\n for item in data:\n if 'category' not ...
[ "def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p" ]
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Determine if the memory limit has been exceeded. @return bool
[ "protected function memoryExceeded()\n {\n static $warning_percent = 0.5;\n\n $percent = (memory_get_usage() / 1024 / 1024) / $this->memoryLimit;\n\n if ($percent >= $warning_percent) {\n $this->log(sprintf('Memory usage at %d%% (Max %s MB)', round($percent * 100, 1), $this->memor...
[ "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 comment about NLP:", "pos": "Represent the code about NLP:", "neg": "Represent the code:" }
Converts internal path segments to their external formats. @param path the internal path @return the external path
[ "public static String convertToExternalPath(final String path) {\n String newPath = replaceOnce(path, \"/\" + CONTAINER_WEBAC_ACL, \"/\" + FCR_ACL);\n\n newPath = replaceOnce(newPath, \"/\" + LDPCV_TIME_MAP, \"/\" + FCR_VERSIONS);\n\n newPath = replaceOnce(newPath, \"/\" + FEDORA_DESCRIPTION, ...
[ "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 sentence about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
// Update updates the information for the given entity.
[ "func (a *multiwatcherStore) Update(info multiwatcher.EntityInfo) {\n\tid := info.EntityId()\n\telem, ok := a.entities[id]\n\tif !ok {\n\t\ta.add(id, info)\n\t\treturn\n\t}\n\tentry := elem.Value.(*entityEntry)\n\t// Nothing has changed, so change nothing.\n\t// TODO(rog) do the comparison more efficiently.\n\tif r...
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Converts an Exception to String @param \Exception $exception @return string[]
[ "private function normalizeException(\\Exception $exception) {\n\t\t$data = [\n\t\t\t'class' => get_class($exception),\n\t\t\t'message' => $exception->getMessage(),\n\t\t\t'code' => $exception->getCode(),\n\t\t\t'file' => $exception->getFile() . ':' . $exception->getLine(),\n\t\t];\n\t\t$trace = $exception-...
[ "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 comment about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Software development:" }